parse
Version:
Parse JavaScript SDK
25,450 lines • 1.16 MB
JavaScript
(function(t) {
"function" == typeof define && define.amd ? define([], t) : t();
})((function() {
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __esmMin = (t, e, r) => () => {
if (r) throw r[0];
try {
return t && (e = t(t = 0)), e;
} catch (t) {
throw r = [t], t;
}
}, __commonJSMin = (t, e) => () => (e || (t((e = { exports: {} }).exports, e), t = null), e.exports), __exportAll = (t, e) => {
let r = {};
for (var i in t) __defProp(r, i, {
get: t[i],
enumerable: !0
});
return e || __defProp(r, Symbol.toStringTag, { value: "Module" }), r;
}, __copyProps = (t, e, r, i) => {
if (e && "object" == typeof e || "function" == typeof e) for (var n, o = __getOwnPropNames(e), s = 0, a = o.length; s < a; s++) n = o[s], __hasOwnProp.call(t, n) || n === r || __defProp(t, n, {
get: ((t) => e[t]).bind(null, n),
enumerable: !(i = __getOwnPropDesc(e, n)) || i.enumerable
});
return t;
}, __toESM = (t, e, r) => (r = null != t ? __create(__getProtoOf(t)) : {}, __copyProps(!e && t && t.__esModule ? r : __defProp(r, "default", {
value: t,
enumerable: !0
}), t)), __toCommonJS = (t) => __hasOwnProp.call(t, "module.exports") ? t["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: !0 }), t), browser, process, cachedSetTimeout, cachedClearTimeout, queue, draining, currentQueue, queueIndex, browserExports, process$1;
function getDefaultExportFromCjs(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function defaultSetTimout() {
throw new Error("setTimeout has not been defined");
}
function defaultClearTimeout() {
throw new Error("clearTimeout has not been defined");
}
function runTimeout(t) {
if (cachedSetTimeout === setTimeout) return setTimeout(t, 0);
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) return cachedSetTimeout = setTimeout, setTimeout(t, 0);
try {
return cachedSetTimeout(t, 0);
} catch (e) {
try {
return cachedSetTimeout.call(null, t, 0);
} catch (e) {
return cachedSetTimeout.call(this, t, 0);
}
}
}
function runClearTimeout(t) {
if (cachedClearTimeout === clearTimeout) return clearTimeout(t);
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) return cachedClearTimeout = clearTimeout, clearTimeout(t);
try {
return cachedClearTimeout(t);
} catch (e) {
try {
return cachedClearTimeout.call(null, t);
} catch (e) {
return cachedClearTimeout.call(this, t);
}
}
}
function cleanUpNextTick() {
draining && currentQueue && (draining = !1, currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1, queue.length && drainQueue());
}
function drainQueue() {
if (!draining) {
var t = runTimeout(cleanUpNextTick);
draining = !0;
for (var e = queue.length; e;) {
for (currentQueue = queue, queue = []; ++queueIndex < e;) currentQueue && currentQueue[queueIndex].run();
queueIndex = -1, e = queue.length;
}
currentQueue = null, draining = !1, runClearTimeout(t);
}
}
function Item(t, e) {
this.fun = t, this.array = e;
}
function noop() {}
var init_dist$2 = __esmMin((() => {
process = (browser = { exports: {} }).exports = {}, function() {
try {
cachedSetTimeout = "function" == typeof setTimeout ? setTimeout : defaultSetTimout;
} catch (t) {
cachedSetTimeout = defaultSetTimout;
}
try {
cachedClearTimeout = "function" == typeof clearTimeout ? clearTimeout : defaultClearTimeout;
} catch (t) {
cachedClearTimeout = defaultClearTimeout;
}
}(), queue = [], draining = !1, queueIndex = -1, process.nextTick = function(t) {
var e = new Array(arguments.length - 1);
if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r];
queue.push(new Item(t, e)), 1 !== queue.length || draining || runTimeout(drainQueue);
}, Item.prototype.run = function() {
this.fun.apply(null, this.array);
}, process.title = "browser", process.browser = !0, process.env = {}, process.argv = [], process.version = "", process.versions = {}, process.on = noop, process.addListener = noop, process.once = noop, process.off = noop, process.removeListener = noop, process.removeAllListeners = noop, process.emit = noop, process.prependListener = noop, process.prependOnceListener = noop, process.listeners = function(t) {
return [];
}, process.binding = function(t) {
throw new Error("process.binding is not supported");
}, process.cwd = function() {
return "/";
}, process.chdir = function(t) {
throw new Error("process.chdir is not supported");
}, process.umask = function() {
return 0;
}, browserExports = browser.exports, process$1 = getDefaultExportFromCjs(browserExports);
}));
init_dist$2();
var config = {
IS_NODE: void 0 !== process$1 && !!process$1.versions && !!process$1.versions.node && !process$1.versions.electron,
REQUEST_ATTEMPT_LIMIT: 5,
REQUEST_BATCH_SIZE: 20,
REQUEST_HEADERS: {},
SERVER_URL: "https://api.parse.com/1",
LIVEQUERY_SERVER_URL: null,
ENCRYPTED_KEY: null,
VERSION: "js8.6.2",
APPLICATION_ID: null,
JAVASCRIPT_KEY: null,
MAINTENANCE_KEY: null,
MASTER_KEY: null,
USE_MASTER_KEY: !1,
PERFORM_USER_REWRITE: !0,
FORCE_REVOCABLE_SESSION: !1,
ENCRYPTED_USER: !1,
IDEMPOTENCY: !1,
ALLOW_CUSTOM_OBJECT_ID: !1,
PARSE_ERRORS: [],
NODE_LOGGING: !1
};
function requireMethods(t, e, r) {
e.forEach(((e) => {
if ("function" != typeof r[e]) throw new Error(`${t} must implement ${e}()`);
}));
}
var CoreManager = {
get: function(t) {
if (Object.hasOwn(config, t)) return config[t];
throw new Error("Configuration key not found: " + t);
},
set: function(t, e) {
config[t] = e;
},
setIfNeeded: function(t, e) {
return Object.hasOwn(config, t) || (config[t] = e), config[t];
},
setAnalyticsController(t) {
requireMethods("AnalyticsController", ["track"], t), config.AnalyticsController = t;
},
getAnalyticsController: () => config.AnalyticsController,
setCloudController(t) {
requireMethods("CloudController", [
"run",
"getJobsData",
"startJob"
], t), config.CloudController = t;
},
getCloudController: () => config.CloudController,
setConfigController(t) {
requireMethods("ConfigController", [
"current",
"get",
"save"
], t), config.ConfigController = t;
},
getConfigController: () => config.ConfigController,
setCryptoController(t) {
requireMethods("CryptoController", ["encrypt", "decrypt"], t), config.CryptoController = t;
},
getCryptoController: () => config.CryptoController,
setEventEmitter(t) {
config.EventEmitter = t;
},
getEventEmitter: () => config.EventEmitter,
setFileController(t) {
requireMethods("FileController", ["saveFile", "saveBase64"], t), config.FileController = t;
},
setEventuallyQueue(t) {
requireMethods("EventuallyQueue", [
"poll",
"save",
"destroy"
], t), config.EventuallyQueue = t;
},
getEventuallyQueue: () => config.EventuallyQueue,
getFileController: () => config.FileController,
setInstallationController(t) {
requireMethods("InstallationController", [
"currentInstallationId",
"currentInstallation",
"updateInstallationOnDisk"
], t), config.InstallationController = t;
},
getInstallationController: () => config.InstallationController,
setLiveQuery(t) {
config.LiveQuery = t;
},
getLiveQuery: () => config.LiveQuery,
setObjectController(t) {
requireMethods("ObjectController", [
"save",
"fetch",
"destroy"
], t), config.ObjectController = t;
},
getObjectController: () => config.ObjectController,
setObjectStateController(t) {
requireMethods("ObjectStateController", [
"getState",
"initializeState",
"removeState",
"getServerData",
"setServerData",
"getPendingOps",
"setPendingOp",
"pushPendingState",
"popPendingState",
"mergeFirstPendingState",
"getObjectCache",
"estimateAttribute",
"estimateAttributes",
"commitServerChanges",
"enqueueTask",
"clearAllState"
], t), config.ObjectStateController = t;
},
getObjectStateController: () => config.ObjectStateController,
setPushController(t) {
requireMethods("PushController", ["send"], t), config.PushController = t;
},
getPushController: () => config.PushController,
setQueryController(t) {
requireMethods("QueryController", ["find", "aggregate"], t), config.QueryController = t;
},
getQueryController: () => config.QueryController,
setRESTController(t) {
requireMethods("RESTController", ["request", "ajax"], t), config.RESTController = t;
},
getRESTController: () => config.RESTController,
setSchemaController(t) {
requireMethods("SchemaController", [
"get",
"create",
"update",
"delete",
"send",
"purge"
], t), config.SchemaController = t;
},
getSchemaController: () => config.SchemaController,
setSessionController(t) {
requireMethods("SessionController", ["getSession"], t), config.SessionController = t;
},
getSessionController: () => config.SessionController,
setStorageController(t) {
t.async ? requireMethods("An async StorageController", [
"getItemAsync",
"setItemAsync",
"removeItemAsync",
"getAllKeysAsync"
], t) : requireMethods("A synchronous StorageController", [
"getItem",
"setItem",
"removeItem",
"getAllKeys"
], t), config.StorageController = t;
},
setLocalDatastoreController(t) {
requireMethods("LocalDatastoreController", [
"pinWithName",
"fromPinWithName",
"unPinWithName",
"getAllContents",
"clear"
], t), config.LocalDatastoreController = t;
},
getLocalDatastoreController: () => config.LocalDatastoreController,
setLocalDatastore(t) {
config.LocalDatastore = t;
},
getLocalDatastore: () => config.LocalDatastore,
getStorageController: () => config.StorageController,
setAsyncStorage(t) {
config.AsyncStorage = t;
},
getAsyncStorage: () => config.AsyncStorage,
setWebSocketController(t) {
config.WebSocketController = t;
},
getWebSocketController: () => config.WebSocketController,
setUserController(t) {
requireMethods("UserController", [
"setCurrentUser",
"currentUser",
"currentUserAsync",
"signUp",
"logIn",
"become",
"logOut",
"me",
"requestPasswordReset",
"upgradeToRevocableSession",
"requestEmailVerification",
"verifyPassword",
"linkWith"
], t), config.UserController = t;
},
getUserController: () => config.UserController,
setLiveQueryController(t) {
requireMethods("LiveQueryController", [
"setDefaultLiveQueryClient",
"getDefaultLiveQueryClient",
"_clearCachedDefaultClient"
], t), config.LiveQueryController = t;
},
getLiveQueryController: () => config.LiveQueryController,
setHooksController(t) {
requireMethods("HooksController", [
"create",
"get",
"update",
"remove"
], t), config.HooksController = t;
},
getHooksController: () => config.HooksController,
setParseOp(t) {
config.ParseOp = t;
},
getParseOp: () => config.ParseOp,
setParseObject(t) {
config.ParseObject = t;
},
getParseObject: () => config.ParseObject,
setParseQuery(t) {
config.ParseQuery = t;
},
getParseQuery: () => config.ParseQuery,
setParseRole(t) {
config.ParseRole = t;
},
getParseRole: () => config.ParseRole,
setParseUser(t) {
config.ParseUser = t;
},
getParseUser: () => config.ParseUser
}, buffer, base64Js, lookup, revLookup, Arr, code, i, len, ieee754, Buffer$1, Blob$1, BlobOptions, Buffer$1$1, File, FileOptions, INSPECT_MAX_BYTES, SlowBuffer, TranscodeEncoding, atob, btoa, constants, isAscii, isUtf8, kMaxLength, kStringMaxLength, resolveObjectURL, transcode;
function getLens(t) {
var e = t.length;
if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
var r = t.indexOf("=");
return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4];
}
function byteLength(t) {
var e = getLens(t), r = e[0], i = e[1];
return 3 * (r + i) / 4 - i;
}
function _byteLength(t, e, r) {
return 3 * (e + r) / 4 - r;
}
function toByteArray(t) {
var e, r, i = getLens(t), n = i[0], o = i[1], s = new Arr(_byteLength(t, n, o)), a = 0, h = o > 0 ? n - 4 : n;
for (r = 0; r < h; r += 4) e = revLookup[t.charCodeAt(r)] << 18 | revLookup[t.charCodeAt(r + 1)] << 12 | revLookup[t.charCodeAt(r + 2)] << 6 | revLookup[t.charCodeAt(r + 3)], s[a++] = e >> 16 & 255, s[a++] = e >> 8 & 255, s[a++] = 255 & e;
return 2 === o && (e = revLookup[t.charCodeAt(r)] << 2 | revLookup[t.charCodeAt(r + 1)] >> 4, s[a++] = 255 & e), 1 === o && (e = revLookup[t.charCodeAt(r)] << 10 | revLookup[t.charCodeAt(r + 1)] << 4 | revLookup[t.charCodeAt(r + 2)] >> 2, s[a++] = e >> 8 & 255, s[a++] = 255 & e), s;
}
function tripletToBase64(t) {
return lookup[t >> 18 & 63] + lookup[t >> 12 & 63] + lookup[t >> 6 & 63] + lookup[63 & t];
}
function encodeChunk(t, e, r) {
for (var i, n = [], o = e; o < r; o += 3) i = (t[o] << 16 & 16711680) + (t[o + 1] << 8 & 65280) + (255 & t[o + 2]), n.push(tripletToBase64(i));
return n.join("");
}
function fromByteArray(t) {
for (var e, r = t.length, i = r % 3, n = [], o = 16383, s = 0, a = r - i; s < a; s += o) n.push(encodeChunk(t, s, s + o > a ? a : s + o));
return 1 === i ? (e = t[r - 1], n.push(lookup[e >> 2] + lookup[e << 4 & 63] + "==")) : 2 === i && (e = (t[r - 2] << 8) + t[r - 1], n.push(lookup[e >> 10] + lookup[e >> 4 & 63] + lookup[e << 2 & 63] + "=")), n.join("");
}
var init_dist$1 = __esmMin((() => {
for (buffer = {}, (base64Js = {}).byteLength = byteLength, base64Js.toByteArray = toByteArray, base64Js.fromByteArray = fromByteArray, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, i = 0, len = (code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").length; i < len; ++i) lookup[i] = code[i], revLookup[code.charCodeAt(i)] = i;
revLookup["-".charCodeAt(0)] = 62, revLookup["_".charCodeAt(0)] = 63, (ieee754 = {}).read = function(t, e, r, i, n) {
var o, s, a = 8 * n - i - 1, h = (1 << a) - 1, u = h >> 1, f = -7, l = r ? n - 1 : 0, c = r ? -1 : 1, d = t[e + l];
for (l += c, o = d & (1 << -f) - 1, d >>= -f, f += a; f > 0; o = 256 * o + t[e + l], l += c, f -= 8);
for (s = o & (1 << -f) - 1, o >>= -f, f += i; f > 0; s = 256 * s + t[e + l], l += c, f -= 8);
if (0 === o) o = 1 - u;
else {
if (o === h) return s ? NaN : Infinity * (d ? -1 : 1);
s += Math.pow(2, i), o -= u;
}
return (d ? -1 : 1) * s * Math.pow(2, o - i);
}, ieee754.write = function(t, e, r, i, n, o) {
var s, a, h, u = 8 * o - n - 1, f = (1 << u) - 1, l = f >> 1, c = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = i ? 0 : o - 1, p = i ? 1 : -1, m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
for (e = Math.abs(e), isNaN(e) || e === Infinity ? (a = isNaN(e) ? 1 : 0, s = f) : (s = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -s)) < 1 && (s--, h *= 2), (e += s + l >= 1 ? c / h : c * Math.pow(2, 1 - l)) * h >= 2 && (s++, h /= 2), s + l >= f ? (a = 0, s = f) : s + l >= 1 ? (a = (e * h - 1) * Math.pow(2, n), s += l) : (a = e * Math.pow(2, l - 1) * Math.pow(2, n), s = 0)); n >= 8; t[r + d] = 255 & a, d += p, a /= 256, n -= 8);
for (s = s << n | a, u += n; u > 0; t[r + d] = 255 & s, d += p, s /= 256, u -= 8);
t[r + d - p] |= 128 * m;
}, function(t) {
const e = base64Js, r = ieee754, i = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null;
t.Buffer = u, t.SlowBuffer = function(t) {
+t != t && (t = 0);
return u.alloc(+t);
}, t.INSPECT_MAX_BYTES = 50;
const n = 2147483647;
t.kMaxLength = n;
const { Uint8Array: o, ArrayBuffer: s, SharedArrayBuffer: a } = globalThis;
function h(t) {
if (t > n) throw new RangeError("The value \"" + t + "\" is invalid for option \"size\"");
const e = new o(t);
return Object.setPrototypeOf(e, u.prototype), e;
}
function u(t, e, r) {
if ("number" == typeof t) {
if ("string" == typeof e) throw new TypeError("The \"string\" argument must be of type string. Received type number");
return c(t);
}
return f(t, e, r);
}
function f(t, e, r) {
if ("string" == typeof t) return function(t, e) {
"string" == typeof e && "" !== e || (e = "utf8");
if (!u.isEncoding(e)) throw new TypeError("Unknown encoding: " + e);
const r = 0 | g(t, e);
let i = h(r);
const n = i.write(t, e);
n !== r && (i = i.slice(0, n));
return i;
}(t, e);
if (s.isView(t)) return function(t) {
if (Q(t, o)) {
const e = new o(t);
return p(e.buffer, e.byteOffset, e.byteLength);
}
return d(t);
}(t);
if (null == t) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
if (Q(t, s) || t && Q(t.buffer, s)) return p(t, e, r);
if (void 0 !== a && (Q(t, a) || t && Q(t.buffer, a))) return p(t, e, r);
if ("number" == typeof t) throw new TypeError("The \"value\" argument must not be of type number. Received type number");
const i = t.valueOf && t.valueOf();
if (null != i && i !== t) return u.from(i, e, r);
const n = function(t) {
if (u.isBuffer(t)) {
const e = 0 | m(t.length), r = h(e);
return 0 === r.length || t.copy(r, 0, 0, e), r;
}
if (void 0 !== t.length) return "number" != typeof t.length || Y(t.length) ? h(0) : d(t);
if ("Buffer" === t.type && Array.isArray(t.data)) return d(t.data);
}(t);
if (n) return n;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof t[Symbol.toPrimitive]) return u.from(t[Symbol.toPrimitive]("string"), e, r);
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
}
function l(t) {
if ("number" != typeof t) throw new TypeError("\"size\" argument must be of type number");
if (t < 0) throw new RangeError("The value \"" + t + "\" is invalid for option \"size\"");
}
function c(t) {
return l(t), h(t < 0 ? 0 : 0 | m(t));
}
function d(t) {
const e = t.length < 0 ? 0 : 0 | m(t.length), r = h(e);
for (let i = 0; i < e; i += 1) r[i] = 255 & t[i];
return r;
}
function p(t, e, r) {
if (e < 0 || t.byteLength < e) throw new RangeError("\"offset\" is outside of buffer bounds");
if (t.byteLength < e + (r || 0)) throw new RangeError("\"length\" is outside of buffer bounds");
let i;
return i = void 0 === e && void 0 === r ? new o(t) : void 0 === r ? new o(t, e) : new o(t, e, r), Object.setPrototypeOf(i, u.prototype), i;
}
function m(t) {
if (t >= n) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + n.toString(16) + " bytes");
return 0 | t;
}
function g(t, e) {
if (u.isBuffer(t)) return t.length;
if (s.isView(t) || Q(t, s)) return t.byteLength;
if ("string" != typeof t) throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof t);
const r = t.length, i = arguments.length > 2 && !0 === arguments[2];
if (!i && 0 === r) return 0;
let n = !1;
for (;;) switch (e) {
case "ascii":
case "latin1":
case "binary": return r;
case "utf8":
case "utf-8": return V(t).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return 2 * r;
case "hex": return r >>> 1;
case "base64": return H(t).length;
default:
if (n) return i ? -1 : V(t).length;
e = ("" + e).toLowerCase(), n = !0;
}
}
function y(t, e, r) {
let i = !1;
if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return "";
if ((r >>>= 0) <= (e >>>= 0)) return "";
for (t || (t = "utf8");;) switch (t) {
case "hex": return R(this, e, r);
case "utf8":
case "utf-8": return O(this, e, r);
case "ascii": return I(this, e, r);
case "latin1":
case "binary": return k(this, e, r);
case "base64": return C(this, e, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return q(this, e, r);
default:
if (i) throw new TypeError("Unknown encoding: " + t);
t = (t + "").toLowerCase(), i = !0;
}
}
function b(t, e, r) {
const i = t[e];
t[e] = t[r], t[r] = i;
}
function v(t, e, r, i, n) {
if (0 === t.length) return -1;
if ("string" == typeof r ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), Y(r = +r) && (r = n ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
if (n) return -1;
r = t.length - 1;
} else if (r < 0) {
if (!n) return -1;
r = 0;
}
if ("string" == typeof e && (e = u.from(e, i)), u.isBuffer(e)) return 0 === e.length ? -1 : _(t, e, r, i, n);
if ("number" == typeof e) return e &= 255, "function" == typeof o.prototype.indexOf ? n ? o.prototype.indexOf.call(t, e, r) : o.prototype.lastIndexOf.call(t, e, r) : _(t, [e], r, i, n);
throw new TypeError("val must be string, number or Buffer");
}
function _(t, e, r, i, n) {
let o, s = 1, a = t.length, h = e.length;
if (void 0 !== i && ("ucs2" === (i = String(i).toLowerCase()) || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (t.length < 2 || e.length < 2) return -1;
s = 2, a /= 2, h /= 2, r /= 2;
}
function u(t, e) {
return 1 === s ? t[e] : t.readUInt16BE(e * s);
}
if (n) {
let i = -1;
for (o = r; o < a; o++) if (u(t, o) === u(e, -1 === i ? 0 : o - i)) {
if (-1 === i && (i = o), o - i + 1 === h) return i * s;
} else -1 !== i && (o -= o - i), i = -1;
} else for (r + h > a && (r = a - h), o = r; o >= 0; o--) {
let r = !0;
for (let i = 0; i < h; i++) if (u(t, o + i) !== u(e, i)) {
r = !1;
break;
}
if (r) return o;
}
return -1;
}
function w(t, e, r, i) {
r = Number(r) || 0;
const n = t.length - r;
i ? (i = Number(i)) > n && (i = n) : i = n;
const o = e.length;
let s;
for (i > o / 2 && (i = o / 2), s = 0; s < i; ++s) {
const i = parseInt(e.substr(2 * s, 2), 16);
if (Y(i)) return s;
t[r + s] = i;
}
return s;
}
function M(t, e, r, i) {
return Z(V(e, t.length - r), t, r, i);
}
function S(t, e, r, i) {
return Z(function(t) {
const e = [];
for (let r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));
return e;
}(e), t, r, i);
}
function E(t, e, r, i) {
return Z(H(e), t, r, i);
}
function A(t, e, r, i) {
return Z(function(t, e) {
let r, i, n;
const o = [];
for (let s = 0; s < t.length && !((e -= 2) < 0); ++s) r = t.charCodeAt(s), i = r >> 8, n = r % 256, o.push(n), o.push(i);
return o;
}(e, t.length - r), t, r, i);
}
function C(t, r, i) {
return 0 === r && i === t.length ? e.fromByteArray(t) : e.fromByteArray(t.slice(r, i));
}
function O(t, e, r) {
r = Math.min(t.length, r);
const i = [];
let n = e;
for (; n < r;) {
const e = t[n];
let o = null, s = e > 239 ? 4 : e > 223 ? 3 : e > 191 ? 2 : 1;
if (n + s <= r) {
let r, i, a, h;
switch (s) {
case 1:
e < 128 && (o = e);
break;
case 2:
r = t[n + 1], 128 == (192 & r) && (h = (31 & e) << 6 | 63 & r, h > 127 && (o = h));
break;
case 3:
r = t[n + 1], i = t[n + 2], 128 == (192 & r) && 128 == (192 & i) && (h = (15 & e) << 12 | (63 & r) << 6 | 63 & i, h > 2047 && (h < 55296 || h > 57343) && (o = h));
break;
case 4: r = t[n + 1], i = t[n + 2], a = t[n + 3], 128 == (192 & r) && 128 == (192 & i) && 128 == (192 & a) && (h = (15 & e) << 18 | (63 & r) << 12 | (63 & i) << 6 | 63 & a, h > 65535 && h < 1114112 && (o = h));
}
}
null === o ? (o = 65533, s = 1) : o > 65535 && (o -= 65536, i.push(o >>> 10 & 1023 | 55296), o = 56320 | 1023 & o), i.push(o), n += s;
}
return function(t) {
const e = t.length;
if (e <= P) return String.fromCharCode.apply(String, t);
let r = "", i = 0;
for (; i < e;) r += String.fromCharCode.apply(String, t.slice(i, i += P));
return r;
}(i);
}
u.TYPED_ARRAY_SUPPORT = function() {
try {
const t = new o(1), e = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(e, o.prototype), Object.setPrototypeOf(t, e), 42 === t.foo();
} catch (t) {
return !1;
}
}(), u.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(u.prototype, "parent", {
enumerable: !0,
get: function() {
if (u.isBuffer(this)) return this.buffer;
}
}), Object.defineProperty(u.prototype, "offset", {
enumerable: !0,
get: function() {
if (u.isBuffer(this)) return this.byteOffset;
}
}), u.poolSize = 8192, u.from = function(t, e, r) {
return f(t, e, r);
}, Object.setPrototypeOf(u.prototype, o.prototype), Object.setPrototypeOf(u, o), u.alloc = function(t, e, r) {
return function(t, e, r) {
return l(t), t <= 0 ? h(t) : void 0 !== e ? "string" == typeof r ? h(t).fill(e, r) : h(t).fill(e) : h(t);
}(t, e, r);
}, u.allocUnsafe = function(t) {
return c(t);
}, u.allocUnsafeSlow = function(t) {
return c(t);
}, u.isBuffer = function(t) {
return null != t && !0 === t._isBuffer && t !== u.prototype;
}, u.compare = function(t, e) {
if (Q(t, o) && (t = u.from(t, t.offset, t.byteLength)), Q(e, o) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(t) || !u.isBuffer(e)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
if (t === e) return 0;
let r = t.length, i = e.length;
for (let n = 0, o = Math.min(r, i); n < o; ++n) if (t[n] !== e[n]) {
r = t[n], i = e[n];
break;
}
return r < i ? -1 : i < r ? 1 : 0;
}, u.isEncoding = function(t) {
switch (String(t).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 !0;
default: return !1;
}
}, u.concat = function(t, e) {
if (!Array.isArray(t)) throw new TypeError("\"list\" argument must be an Array of Buffers");
if (0 === t.length) return u.alloc(0);
let r;
if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;
const i = u.allocUnsafe(e);
let n = 0;
for (r = 0; r < t.length; ++r) {
let e = t[r];
if (Q(e, o)) n + e.length > i.length ? (u.isBuffer(e) || (e = u.from(e)), e.copy(i, n)) : o.prototype.set.call(i, e, n);
else {
if (!u.isBuffer(e)) throw new TypeError("\"list\" argument must be an Array of Buffers");
e.copy(i, n);
}
n += e.length;
}
return i;
}, u.byteLength = g, u.prototype._isBuffer = !0, u.prototype.swap16 = function() {
const t = this.length;
if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let e = 0; e < t; e += 2) b(this, e, e + 1);
return this;
}, u.prototype.swap32 = function() {
const t = this.length;
if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let e = 0; e < t; e += 4) b(this, e, e + 3), b(this, e + 1, e + 2);
return this;
}, u.prototype.swap64 = function() {
const t = this.length;
if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let e = 0; e < t; e += 8) b(this, e, e + 7), b(this, e + 1, e + 6), b(this, e + 2, e + 5), b(this, e + 3, e + 4);
return this;
}, u.prototype.toString = function() {
const t = this.length;
return 0 === t ? "" : 0 === arguments.length ? O(this, 0, t) : y.apply(this, arguments);
}, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(t) {
if (!u.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
return this === t || 0 === u.compare(this, t);
}, u.prototype.inspect = function() {
let e = "";
const r = t.INSPECT_MAX_BYTES;
return e = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (e += " ... "), "<Buffer " + e + ">";
}, i && (u.prototype[i] = u.prototype.inspect), u.prototype.compare = function(t, e, r, i, n) {
if (Q(t, o) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(t)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof t);
if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === i && (i = 0), void 0 === n && (n = this.length), e < 0 || r > t.length || i < 0 || n > this.length) throw new RangeError("out of range index");
if (i >= n && e >= r) return 0;
if (i >= n) return -1;
if (e >= r) return 1;
if (this === t) return 0;
let s = (n >>>= 0) - (i >>>= 0), a = (r >>>= 0) - (e >>>= 0);
const h = Math.min(s, a), f = this.slice(i, n), l = t.slice(e, r);
for (let t = 0; t < h; ++t) if (f[t] !== l[t]) {
s = f[t], a = l[t];
break;
}
return s < a ? -1 : a < s ? 1 : 0;
}, u.prototype.includes = function(t, e, r) {
return -1 !== this.indexOf(t, e, r);
}, u.prototype.indexOf = function(t, e, r) {
return v(this, t, e, r, !0);
}, u.prototype.lastIndexOf = function(t, e, r) {
return v(this, t, e, r, !1);
}, u.prototype.write = function(t, e, r, i) {
if (void 0 === e) i = "utf8", r = this.length, e = 0;
else if (void 0 === r && "string" == typeof e) i = e, r = this.length, e = 0;
else {
if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === i && (i = "utf8")) : (i = r, r = void 0);
}
const n = this.length - e;
if ((void 0 === r || r > n) && (r = n), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
let o = !1;
for (;;) switch (i) {
case "hex": return w(this, t, e, r);
case "utf8":
case "utf-8": return M(this, t, e, r);
case "ascii":
case "latin1":
case "binary": return S(this, t, e, r);
case "base64": return E(this, t, e, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return A(this, t, e, r);
default:
if (o) throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(), o = !0;
}
}, u.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
const P = 4096;
function I(t, e, r) {
let i = "";
r = Math.min(t.length, r);
for (let n = e; n < r; ++n) i += String.fromCharCode(127 & t[n]);
return i;
}
function k(t, e, r) {
let i = "";
r = Math.min(t.length, r);
for (let n = e; n < r; ++n) i += String.fromCharCode(t[n]);
return i;
}
function R(t, e, r) {
const i = t.length;
(!e || e < 0) && (e = 0), (!r || r < 0 || r > i) && (r = i);
let n = "";
for (let i = e; i < r; ++i) n += G[t[i]];
return n;
}
function q(t, e, r) {
const i = t.slice(e, r);
let n = "";
for (let t = 0; t < i.length - 1; t += 2) n += String.fromCharCode(i[t] + 256 * i[t + 1]);
return n;
}
function T(t, e, r) {
if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
}
function x(t, e, r, i, n, o) {
if (!u.isBuffer(t)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
if (e > n || e < o) throw new RangeError("\"value\" argument is out of bounds");
if (r + i > t.length) throw new RangeError("Index out of range");
}
function N(t, e, r, i, n) {
J(e, i, n, t, r, 7);
let o = Number(e & BigInt(4294967295));
t[r++] = o, o >>= 8, t[r++] = o, o >>= 8, t[r++] = o, o >>= 8, t[r++] = o;
let s = Number(e >> BigInt(32) & BigInt(4294967295));
return t[r++] = s, s >>= 8, t[r++] = s, s >>= 8, t[r++] = s, s >>= 8, t[r++] = s, r;
}
function B(t, e, r, i, n) {
J(e, i, n, t, r, 7);
let o = Number(e & BigInt(4294967295));
t[r + 7] = o, o >>= 8, t[r + 6] = o, o >>= 8, t[r + 5] = o, o >>= 8, t[r + 4] = o;
let s = Number(e >> BigInt(32) & BigInt(4294967295));
return t[r + 3] = s, s >>= 8, t[r + 2] = s, s >>= 8, t[r + 1] = s, s >>= 8, t[r] = s, r + 8;
}
function j(t, e, r, i, n, o) {
if (r + i > t.length) throw new RangeError("Index out of range");
if (r < 0) throw new RangeError("Index out of range");
}
function L(t, e, i, n, o) {
return e = +e, i >>>= 0, o || j(t, 0, i, 4), r.write(t, e, i, n, 23, 4), i + 4;
}
function D(t, e, i, n, o) {
return e = +e, i >>>= 0, o || j(t, 0, i, 8), r.write(t, e, i, n, 52, 8), i + 8;
}
u.prototype.slice = function(t, e) {
const r = this.length;
(t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t);
const i = this.subarray(t, e);
return Object.setPrototypeOf(i, u.prototype), i;
}, u.prototype.readUintLE = u.prototype.readUIntLE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = this[t], n = 1, o = 0;
for (; ++o < e && (n *= 256);) i += this[t + o] * n;
return i;
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = this[t + --e], n = 1;
for (; e > 0 && (n *= 256);) i += this[t + --e] * n;
return i;
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(t, e) {
return t >>>= 0, e || T(t, 1, this.length), this[t];
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(t, e) {
return t >>>= 0, e || T(t, 2, this.length), this[t] | this[t + 1] << 8;
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(t, e) {
return t >>>= 0, e || T(t, 2, this.length), this[t] << 8 | this[t + 1];
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3];
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
}, u.prototype.readBigUInt64LE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = e + 256 * this[++t] + 65536 * this[++t] + this[++t] * 2 ** 24, n = this[++t] + 256 * this[++t] + 65536 * this[++t] + r * 2 ** 24;
return BigInt(i) + (BigInt(n) << BigInt(32));
})), u.prototype.readBigUInt64BE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = e * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + this[++t], n = this[++t] * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + r;
return (BigInt(i) << BigInt(32)) + BigInt(n);
})), u.prototype.readIntLE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = this[t], n = 1, o = 0;
for (; ++o < e && (n *= 256);) i += this[t + o] * n;
return n *= 128, i >= n && (i -= Math.pow(2, 8 * e)), i;
}, u.prototype.readIntBE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = e, n = 1, o = this[t + --i];
for (; i > 0 && (n *= 256);) o += this[t + --i] * n;
return n *= 128, o >= n && (o -= Math.pow(2, 8 * e)), o;
}, u.prototype.readInt8 = function(t, e) {
return t >>>= 0, e || T(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t];
}, u.prototype.readInt16LE = function(t, e) {
t >>>= 0, e || T(t, 2, this.length);
const r = this[t] | this[t + 1] << 8;
return 32768 & r ? 4294901760 | r : r;
}, u.prototype.readInt16BE = function(t, e) {
t >>>= 0, e || T(t, 2, this.length);
const r = this[t + 1] | this[t] << 8;
return 32768 & r ? 4294901760 | r : r;
}, u.prototype.readInt32LE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
}, u.prototype.readInt32BE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
}, u.prototype.readBigInt64LE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = this[t + 4] + 256 * this[t + 5] + 65536 * this[t + 6] + (r << 24);
return (BigInt(i) << BigInt(32)) + BigInt(e + 256 * this[++t] + 65536 * this[++t] + this[++t] * 2 ** 24);
})), u.prototype.readBigInt64BE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = (e << 24) + 65536 * this[++t] + 256 * this[++t] + this[++t];
return (BigInt(i) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + r);
})), u.prototype.readFloatLE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), r.read(this, t, !0, 23, 4);
}, u.prototype.readFloatBE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), r.read(this, t, !1, 23, 4);
}, u.prototype.readDoubleLE = function(t, e) {
return t >>>= 0, e || T(t, 8, this.length), r.read(this, t, !0, 52, 8);
}, u.prototype.readDoubleBE = function(t, e) {
return t >>>= 0, e || T(t, 8, this.length), r.read(this, t, !1, 52, 8);
}, u.prototype.writeUintLE = u.prototype.writeUIntLE = function(t, e, r, i) {
if (t = +t, e >>>= 0, r >>>= 0, !i) x(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
let n = 1, o = 0;
for (this[e] = 255 & t; ++o < r && (n *= 256);) this[e + o] = t / n & 255;
return e + r;
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(t, e, r, i) {
if (t = +t, e >>>= 0, r >>>= 0, !i) x(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
let n = r - 1, o = 1;
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256);) this[e + n] = t / o & 255;
return e + r;
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1;
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t, e + 4;
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
}, u.prototype.writeBigUInt64LE = X((function(t, e = 0) {
return N(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
})), u.prototype.writeBigUInt64BE = X((function(t, e = 0) {
return B(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
})), u.prototype.writeIntLE = function(t, e, r, i) {
if (t = +t, e >>>= 0, !i) {
const i = Math.pow(2, 8 * r - 1);
x(this, t, e, r, i - 1, -i);
}
let n = 0, o = 1, s = 0;
for (this[e] = 255 & t; ++n < r && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + n - 1] && (s = 1), this[e + n] = (t / o | 0) - s & 255;
return e + r;
}, u.prototype.writeIntBE = function(t, e, r, i) {
if (t = +t, e >>>= 0, !i) {
const i = Math.pow(2, 8 * r - 1);
x(this, t, e, r, i - 1, -i);
}
let n = r - 1, o = 1, s = 0;
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + n + 1] && (s = 1), this[e + n] = (t / o | 0) - s & 255;
return e + r;
}, u.prototype.writeInt8 = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1;
}, u.prototype.writeInt16LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 32767, -32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
}, u.prototype.writeInt16BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
}, u.prototype.writeInt32LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 2147483647, -2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
}, u.prototype.writeInt32BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
}, u.prototype.writeBigInt64LE = X((function(t, e = 0) {
return N(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
})), u.prototype.writeBigInt64BE = X((function(t, e = 0) {
return B(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
})), u.prototype.writeFloatLE = function(t, e, r) {
return L(this, t, e, !0, r);
}, u.prototype.writeFloatBE = function(t, e, r) {
return L(this, t, e, !1, r);
}, u.prototype.writeDoubleLE = function(t, e, r) {
return D(this, t, e, !0, r);
}, u.prototype.writeDoubleBE = function(t, e, r) {
return D(this, t, e, !1, r);
}, u.prototype.copy = function(t, e, r, i) {
if (!u.isBuffer(t)) throw new TypeError("argument should be a Buffer");
if (r || (r = 0), i || 0 === i || (i = this.length), e >= t.length && (e = t.length), e || (e = 0), i > 0 && i < r && (i = r), i === r) return 0;
if (0 === t.length || 0 === this.length) return 0;
if (e < 0) throw new RangeError("targetStart out of bounds");
if (r < 0 || r >= this.length) throw new RangeError("Index out of range");
if (i < 0) throw new RangeError("sourceEnd out of bounds");
i > this.length && (i = this.length), t.length - e < i - r && (i = t.length - e + r);
const n = i - r;
return this === t && "function" == typeof o.prototype.copyWithin ? this.copyWithin(e, r, i) : o.prototype.set.call(t, this.subarray(r, i), e), n;
}, u.prototype.fill = function(t, e, r, i) {
if ("string" == typeof t) {
if ("string" == typeof e ? (i = e, e = 0, r = this.length) : "string" == typeof r && (i = r, r = this.length), void 0 !== i && "string" != typeof i) throw new TypeError("encoding must be a string");
if ("string" == typeof i && !u.isEncoding(i)) throw new TypeError("Unknown encoding: " + i);
if (1 === t.length) {
const e = t.charCodeAt(0);
("utf8" === i && e < 128 || "latin1" === i) && (t = e);
}
} else "number" == typeof t ? t &= 255 : "boolean" == typeof t && (t = Number(t));
if (e < 0 || this.length < e || this.length < r) throw new RangeError("Out of range index");
if (r <= e) return this;
let n;
if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, t || (t = 0), "number" == typeof t) for (n = e; n < r; ++n) this[n] = t;
else {
const o = u.isBuffer(t) ? t : u.from(t, i), s = o.length;
if (0 === s) throw new TypeError("The value \"" + t + "\" is invalid for argument \"value\"");
for (n = 0; n < r - e; ++n) this[n + e] = o[n % s];
}
return this;
};
const U = {};
function $(t, e, r) {
U[t] = class extends r {
constructor() {
super(), Object.defineProperty(this, "message", {
value: e.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${t}]`, this.stack, delete this.name;
}
get code() {
return t;
}
set code(t) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: t,
writable: !0
});
}
toString() {
return `${this.name} [${t}]: ${this.message}`;
}
};
}
function F(t) {
let e = "", r = t.length;
const i = "-" === t[0] ? 1 : 0;
for (; r >= i + 4; r -= 3) e = `_${t.slice(r - 3, r)}${e}`;
return `${t.slice(0, r)}${e}`;
}
function J(t, e, r, i, n, o) {
if (t > r || t < e) {
const i = "bigint" == typeof e ? "n" : "";
let n;
throw n = o > 3 ? 0 === e || e === BigInt(0) ? `>= 0${i} and < 2${i} ** ${8 * (o + 1)}${i}` : `>= -(2${i} ** ${8 * (o + 1) - 1}${i}) and < 2 ** ${8 * (o + 1) - 1}${i}` : `>= ${e}${i} and <= ${r}${i}`, new U.ERR_OUT_OF_RANGE("value", n, t);
}
(function(t, e, r) {
z(e, "offset"), void 0 !== t[e] && void 0 !== t[e + r] || K(e, t.length - (r + 1));
})(i, n, o);
}
function z(t, e) {
if ("number" != typeof t) throw new U.ERR_INVALID_ARG_TYPE(e, "number", t);
}
function K(t, e, r) {
if (Math.floor(t) !== t) throw z(t, r), new U.ERR_OUT_OF_RANGE(r || "offset", "an integer", t);
if (e < 0) throw new U.ERR_BUFFER_OUT_OF_BOUNDS();
throw new U.ERR_OUT_OF_RANGE(r || "offset", `>= ${r ? 1 : 0} and <= ${e}`, t);
}
$("ERR_BUFFER_OUT_OF_BOUNDS", (function(t) {
return t ? `${t} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
}), RangeError), $("ERR_INVALID_ARG_TYPE", (function(t, e) {
return `The "${t}" argument must be of type number. Received type ${typeof e}`;
}), TypeError), $("ERR_OUT_OF_RANGE", (function(t, e, r) {
let i = `The value of "${t}" is out of range.`, n = r;
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? n = F(String(r)) : "bigint" == typeof r && (n = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (n = F(n)), n += "n"), i += ` It must be ${e}. Received ${n}`, i;
}), RangeError);
const W = /[^+/0-9A-Za-z-_]/g;
function V(t, e) {
let r;
e = e || Infinity;
const i = t.length;
let n = null;
const o = [];
for (let s = 0; s < i; ++s) {
if (r = t.charCodeAt(s), r > 55295 && r < 57344) {
if (!n) {
if (r > 56319) {
(e -= 3) > -1 && o.push(239, 191, 189);
continue;
}
if (s + 1 === i) {
(e -= 3) > -1 && o.push(239, 191, 189);
continue;
}
n = r;
continue;
}
if (r < 56320) {
(e -= 3) > -1 && o.push(239, 191, 189), n = r;
continue;
}
r = 65536 + (n - 55296 << 10 | r - 56320);
} else n && (e -= 3) > -1 && o.push(239, 191, 189);
if (n = null, r < 128) {
if ((e -= 1) < 0) break;
o.push(r);
} else if (r < 2048) {
if ((e -= 2) < 0) break;
o.push(r >> 6 | 192, 63 & r | 128);
} else if (r < 65536) {
if ((e -= 3) < 0) break;
o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128);
} else {
if (!(r < 1114112)) throw new Error("Invalid code point");
if ((e -= 4) < 0) break;
o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);
}
}
return o;
}
function H(t) {
return e.toByteArray(function(t) {
if ((t = (t = t.split("=")[0]).trim().replace(W, "")).length < 2) return "";
for (; t.length % 4 != 0;) t += "=";
return t;
}(t));
}
function Z(t, e, r, i) {
let n;
for (n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) e[n + r] = t[n];
return n;
}
function Q(t, e) {
return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name;
}
function Y(t) {
return t != t;
}
const G = function() {
const t = "0123456789abcdef", e = new Array(256);
for (let r = 0; r < 16; ++r) {
const i = 16 * r;
for (let n = 0; n < 16; ++n) e[i + n] = t[r] + t[n];
}
return e;
}();
function X(t) {
return "undefined" == typeof BigInt ? tt : t;
}
function tt() {
throw new Error("BigInt not supported");
}
}(buffer), Buffer$1 = buffer.Buffer, buffer.Blob, buffer.BlobOptions, buffer.Buffer, buffer.File, buffer.FileOptions, buffer.INSPECT_MAX_BYTES, buffer.SlowBuffer, buffer.TranscodeEncoding, buffer.atob, buffer.btoa, buffer.constants, buffer.isAscii, buffer.isUtf8, buffer.kMaxLength, buffer.kStringMaxLength, buffer.resolveObjectURL, buffer.transcode;
})), require_events = __commonJSMin(((t, e) => {
var r, i = "object" == typeof Reflect ? Reflect : null, n = i && "function" == typeof i.apply ? i.apply : function(t, e, r) {
return Function.prototype.apply.call(t, e, r);
};
r = i && "function" == typeof i.ownKeys ? i.ownKeys : Object.getOwnPropertySymbols ? function(t) {
return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));
} : function(t) {
return Object.getOwnPropertyNames(t);
};
var o = Number.isNaN || function(t) {
return t != t;
};
function s() {
s.init.call(this);
}
e.exports = s, e.exports.once = function(t, e) {
return new Promise((function(r, i) {
function n(r) {
t.removeListener(e, o), i(r);
}
function o() {
"function" == typeof t.removeListener && t.removeListener("error", n), r([].slice.call(arguments));
}
g(t, e, o, { once: !0 }), "error" !== e && function(t, e, r) {
"function" == typeof t.on && g(t, "error", e, r);
}(t, n, { once: !0 });
}));
}, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;
var a = 10;
function h(t) {
if ("function" != typeof t) throw new TypeError("The \"listener\" argument must be of type Function. Received type " + typeof t);
}
function u(t) {
return void 0 === t._maxListeners ? s.defaultMaxListeners : t._maxListeners;
}
function f(t, e, r, i) {
var n, o, s, a;
if (h(r), void 0 === (o = t._events) ? (o = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== o.newListener && (t.emit("newListener", e, r.listener ? r.listener : r), o = t._events), s = o[e]), void 0 === s) s = o[e] = r, ++t._eventsCount;
else if ("function" == typeof s ? s = o[e] = i ? [r, s] : [s, r] : i ? s.unshift(r) : s.push(r), (n = u(t)) > 0 && s.length > n && !s.warned) {
s.warned = !0;
var f = /* @__PURE__ */ new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length, a = f, console && console.warn && console.warn(a);
}
return t;
}
function l() {
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
}
function c(t, e, r) {
var i = {
fired: !1,
wrapFn: void 0,
target: t,
type: e,
listener: r
}, n = l.bind(i);
return n.listener = r, i.wrapFn = n, n;
}
function d(t, e, r) {
var i = t._events;
if (void 0 === i) return [];
var n = i[e];
return void 0 === n ? [] : "function" == typeof n ? r ? [n.listener || n] : [n] : r ? function(t) {
for (var e = new Array(t.length), r = 0; r < e.length; ++r) e[r] = t[r].listener || t[r];
return e;
}(n) : m(n, n.length);
}
function p(t) {
var e = this._events;
if (void 0 !== e) {
var r = e[t];
if ("function" == typeof r) return 1;
if (void 0 !== r) return r.length;
}
return 0;
}
function m(t, e) {
for (var r = new Array(e), i = 0; i < e; ++i) r[i] = t[i];
return r;
}
function g(t, e, r, i) {
if ("function" == typeof t.on) i.once ? t.once(e, r) : t.on(e, r);
else {
if ("function" != typeof t.addEventListener) throw new TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof t);
t.addEventListener(e, (function n(o) {
i.once && t.removeEventListener(e, n), r(o);
}));
}
}
Object.defineProperty(s, "defaultMaxListeners", {
enumerable: !0,
get: function() {
return a;
},
set: function(t) {
if ("number" != typeof t || t < 0 || o(t)) throw new RangeError("The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received " + t + ".");
a = t;
}
}), s.init = function() {
void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
}, s.prototype.setMaxListeners = function(t) {
if ("number" != typeof t || t < 0 || o(t)) throw new RangeError("The value of \"n\" is out of range. It must be a non-negative number. Received " + t + ".");
return this._maxListeners = t, this;
}, s.prototype.getMaxListeners = function() {
return u(this);
}, s.prototype.emit = function(t) {
for (var e = [], r = 1; r < arguments.length; r++) e.push(arguments[r]);
var i = "error" === t, o = this._events;
if (void 0 !== o) i = i && void 0 === o.error;
else if (!i) return !1;
if (i) {
var s;
if (e.length > 0 && (s = e[0]), s instanceof Error) throw s;
var a = /* @__PURE__ */ new Error("Unhandled error." + (s ? " (" + s.message + ")" : ""));
throw a.context = s, a;
}
var h = o[t];
if (void 0 === h) return !1;
if ("function" == typeof h) n(h, this, e);
else {
var u = h.length, f = m(h, u);
for (r = 0; r < u; ++r) n(f[r], this, e);
}
return !0;
}, s.prototype.addListener = function(t, e) {
return f(this, t, e, !1);
}, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(t, e) {
return f(this, t, e, !0);
}, s.prototype.once = function(t, e) {
return h(e), this.on(t, c(this, t, e)), this;
}, s.prototype.prependOnceListener = function(t, e) {
return h(e), this.prependListener(t, c(this, t, e)), this;
}, s.prototype.removeListener = function(t, e) {
var r, i, n, o, s;
if (h(e), void 0 === (i = this._events)) return this;
if (void 0 === (r = i[t])) return this;
if (r === e || r.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete i[t], i.removeListener && this.emit("removeListener", t, r.listener || e));
else if ("function" != typeof r) {
for (n = -1, o = r.length - 1; o >= 0; o--) if (r[o] === e || r[o].listener === e) {
s = r[o].listener, n = o;
break;
}
if (n < 0) return this;
0 === n ? r.shift() : function(t, e) {
for (; e + 1 < t.length; e++) t[e] = t[e + 1];
t.pop();
}(r, n), 1 === r.length && (i[t] = r[0]), void 0 !== i.removeListener && this.emit("removeListener", t, s || e);
}
return this;
}, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(t) {
var e, r, i = this._events;
if (void 0 === i) return this;
if (void 0 === i.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== i[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete i[t]), this;
if (0 === arguments.length) {
var n, o = Object.keys(i);
for (r = 0; r < o.length; ++r) "removeListener" !== (n = o[r]) && this.removeAllListeners(n);
return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this;
}
if ("function" == typeof (e = i[t])) this.removeListener(t, e);
else if (void 0 !== e) for (r = e.length - 1; r >= 0; r--) this.removeListener(t, e[r]);
return this;
}, s.prototype.listeners = function(t) {
return d(this, t, !0);
}, s.prototype.rawListeners = function(t) {
return d(this, t, !1);
}, s.listenerCount = function(t, e) {
return "function" == typeof t.listenerCount ? t.listenerCount(e) : p.call(t, e);
}, s.prototype.listenerCount = p, s.prototype.eventNames = function() {
return this._eventsCount > 0 ? r(this._events) : [];
};
})), require_inherits_browser = __commonJSMin(((t, e) => {
"function" == typeof Object.create ? e.exports = function(t, e) {
e && (t.super_ = e, t.prototype = Object.create(e.prototype, { constructor: {
value: t,
enumerable: !1,
writable: !0,
configurable: !0
} }));
} : e.exports = function(t, e) {
if (e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
};
})), global, init_dist = __esmMin((() => {
global = globalThis || self;
})), require_stream_browser$1 = __commonJSMin(((t, e) => {
e.exports = require_events().EventEmitter;
})), require_dist = __commonJSMin(((t) => {
Object.defineProperties(t, {
__esModule: { value: !0 },
[Symbol.toStringTag]: { value: "Module" }
});
for (var e = {}, r = {
byteLength: function(t) {
var e = h(t), r = e[0], i = e[1];
return 3 * (r + i) / 4 - i;
},
toByteArray: function(t) {
var e, r, i = h(t), s = i[0], a = i[1], u = new o(function(t, e, r) {
return 3 * (e + r) / 4 - r;
}(0, s, a)), f = 0, l = a > 0 ? s - 4 : s;
for (r = 0; r < l; r += 4) e = n[t.charCodeAt(r)] << 18 | n[t.charCodeAt(r + 1)] << 12 | n[t.charCodeAt(r + 2)] << 6 | n[t.charCodeAt(r + 3)], u[f++] = e >> 16 & 255, u[f++] = e >> 8 & 255, u[f++] = 255 & e;
2 === a && (e = n[t.charCodeAt(r)] << 2 | n[t.charCodeAt(r + 1)] >> 4, u[f++] = 255 & e);
1 === a && (e = n[t.charCodeAt(r)] << 10 | n[t.charCodeAt(r + 1)] << 4 | n[t.charCodeAt(r + 2)] >> 2, u[f++] = e >> 8 & 255, u[f++] = 255 & e);
return u;
},
fromByteArray: function(t) {
for (var e, r = t.length, n = r % 3, o = [], s = 16383, a = 0, h = r - n; a < h; a += s) o.push(u(t, a, a + s > h ? h : a + s));
1 === n ? (e = t[r - 1], o.push(i[e >> 2] + i[e << 4 & 63] + "==")) : 2 === n && (e = (t[r - 2] << 8) + t[r - 1], o.push(i[e >> 10] + i[e >> 4 & 63] + i[e << 2 & 63] + "="));
return o.join("");
}
}, i = [], n = [], o = "undefined" != typeof Uint8Array ? Uint8Array : Array, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = 0; a < 64; ++a) i[a] = s[a], n[s.charCodeAt(a)] = a;
function h(t) {
var e = t.length;
if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
var r = t.indexOf("=");
return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4];
}
function u(t, e, r) {
for (var n, o, s = [], a = e; a < r; a += 3) n = (t[a] << 16 & 16711680) + (t[a + 1] << 8 & 65280) + (255 & t[a + 2]), s.push(i[(o = n) >> 18 & 63] + i[o >> 12 & 63] + i[o >> 6 & 63] + i[63 & o]);
return s.join("");
}
n["-".charCodeAt(0)] = 62, n["_".charCodeAt(0)] = 63;
var f = {
read: function(t, e, r, i, n) {
var o, s, a = 8 * n - i - 1, h = (1 << a) - 1, u = h >> 1, f = -7, l = r ? n - 1 : 0, c = r ? -1 : 1, d = t[e + l];
for (l += c, o = d & (1 << -f) - 1, d >>= -f, f += a; f > 0; o = 256 * o + t[e + l], l += c, f -= 8);
for (s = o & (1 << -f) - 1, o >>= -f, f += i; f > 0; s = 256 * s + t[e + l], l += c, f -= 8);
if (0 === o) o = 1 - u;
else {
if (o === h) return s ? NaN : Infinity * (d ? -1 : 1);
s += Math.pow(2, i), o -= u;
}
return (d ? -1 : 1) * s * Math.pow(2, o - i);
},
write: function(t, e, r, i, n, o) {
var s, a, h, u = 8 * o - n - 1, f = (1 << u) - 1, l = f >> 1, c = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = i ? 0 : o - 1, p = i ? 1 : -1, m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
for (e = Math.abs(e), isNaN(e) || e === Infinity ? (a = isNaN(e) ? 1 : 0, s = f) : (s = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -s)) < 1 && (s--, h *= 2), (e += s + l >= 1 ? c / h : c * Math.pow(2, 1 - l)) * h >= 2 && (s++, h /= 2), s + l >= f ? (a = 0, s = f) : s + l >= 1 ? (a = (e * h - 1) * Math.pow(2, n), s += l) : (a = e * Math.pow(2, l - 1) * Math.pow(2, n), s = 0)); n >= 8; t[r + d] = 255 & a, d += p, a /= 256, n -= 8);
for (s = s << n | a, u += n; u > 0; t[r + d] = 255 & s, d += p, s /= 256, u -= 8);
t[r + d - p] |= 128 * m;
}
};
(function(t) {
const e = r, i = f, n = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null;
t.Buffer = l, t.SlowBuffer = function(t) {
+t != t && (t = 0);
return l.alloc(+t);
}, t.INSPECT_MAX_BYTES = 50;
const o = 2147483647;
t.kMaxLength = o;
const { Uint8Array: s, ArrayBuffer: a, SharedArrayBuffer: h } = globalThis;
function u(t) {
if (t > o) throw new RangeError("The value \"" + t + "\" is invalid for option \"size\"");
const e = new s(t);
return Object.setPrototypeOf(e, l.prototype), e;
}
function l(t, e, r) {
if ("number" == typeof t) {
if ("string" == typeof e) throw new TypeError("The \"string\" argument must be of type string. Received type number");
return p(t);
}
return c(t, e, r);
}
function c(t, e, r) {
if ("string" == typeof t) return function(t, e) {
"string" == typeof e && "" !== e || (e = "utf8");
if (!l.isEncoding(e)) throw new TypeError("Unknown encoding: " + e);
const r = 0 | b(t, e);
let i = u(r);
const n = i.write(t, e);
n !== r && (i = i.slice(0, n));
return i;
}(t, e);
if (a.isView(t)) return function(t) {
if (G(t, s)) {
const e = new s(t);
return g(e.buffer, e.byteOffset, e.byteLength);
}
return m(t);
}(t);
if (null == t) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
if (G(t, a) || t && G(t.buffer, a)) return g(t, e, r);
if (void 0 !== h && (G(t, h) || t && G(t.buffer, h))) return g(t, e, r);
if ("number" == typeof t) throw new TypeError("The \"value\" argument must not be of type number. Received type number");
const i = t.valueOf && t.valueOf();
if (null != i && i !== t) return l.from(i, e, r);
const n = function(t) {
if (l.isBuffer(t)) {
const e = 0 | y(t.length), r = u(e);
return 0 === r.length || t.copy(r, 0, 0, e), r;
}
if (void 0 !== t.length) return "number" != typeof t.length || X(t.length) ? u(0) : m(t);
if ("Buffer" === t.type && Array.isArray(t.data)) return m(t.data);
}(t);
if (n) return n;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof t[Symbol.toPrimitive]) return l.from(t[Symbol.toPrimitive]("string"), e, r);
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
}
function d(t) {
if ("number" != typeof t) throw new TypeError("\"size\" argument must be of type number");
if (t < 0) throw new RangeError("The value \"" + t + "\" is invalid for option \"size\"");
}
function p(t) {
return d(t), u(t < 0 ? 0 : 0 | y(t));
}
function m(t) {
const e = t.length < 0 ? 0 : 0 | y(t.length), r = u(e);
for (let i = 0; i < e; i += 1) r[i] = 255 & t[i];
return r;
}
function g(t, e, r) {
if (e < 0 || t.byteLength < e) throw new RangeError("\"offset\" is outside of buffer bounds");
if (t.byteLength < e + (r || 0)) throw new RangeError("\"length\" is outside of buffer bounds");
let i;
return i = void 0 === e && void 0 === r ? new s(t) : void 0 === r ? new s(t, e) : new s(t, e, r), Object.setPrototypeOf(i, l.prototype), i;
}
function y(t) {
if (t >= o) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o.toString(16) + " bytes");
return 0 | t;
}
function b(t, e) {
if (l.isBuffer(t)) return t.length;
if (a.isView(t) || G(t, a)) return t.byteLength;
if ("string" != typeof t) throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof t);
const r = t.length, i = arguments.length > 2 && !0 === arguments[2];
if (!i && 0 === r) return 0;
let n = !1;
for (;;) switch (e) {
case "ascii":
case "latin1":
case "binary": return r;
case "utf8":
case "utf-8": return Z(t).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return 2 * r;
case "hex": return r >>> 1;
case "base64": return Q(t).length;
default:
if (n) return i ? -1 : Z(t).length;
e = ("" + e).toLowerCase(), n = !0;
}
}
function v(t, e, r) {
let i = !1;
if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return "";
if ((r >>>= 0) <= (e >>>= 0)) return "";
for (t || (t = "utf8");;) switch (t) {
case "hex": return T(this, e, r);
case "utf8":
case "utf-8": return I(this, e, r);
case "ascii": return R(this, e, r);
case "latin1":
case "binary": return q(this, e, r);
case "base64": return P(this, e, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return x(this, e, r);
default:
if (i) throw new TypeError("Unknown encoding: " + t);
t = (t + "").toLowerCase(), i = !0;
}
}
function _(t, e, r) {
const i = t[e];
t[e] = t[r], t[r] = i;
}
function w(t, e, r, i, n) {
if (0 === t.length) return -1;
if ("string" == typeof r ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), X(r = +r) && (r = n ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
if (n) return -1;
r = t.length - 1;
} else if (r < 0) {
if (!n) return -1;
r = 0;
}
if ("string" == typeof e && (e = l.from(e, i)), l.isBuffer(e)) return 0 === e.length ? -1 : M(t, e, r, i, n);
if ("number" == typeof e) return e &= 255, "function" == typeof s.prototype.indexOf ? n ? s.prototype.indexOf.call(t, e, r) : s.prototype.lastIndexOf.call(t, e, r) : M(t, [e], r, i, n);
throw new TypeError("val must be string, number or Buffer");
}
function M(t, e, r, i, n) {
let o, s = 1, a = t.length, h = e.length;
if (void 0 !== i && ("ucs2" === (i = String(i).toLowerCase()) || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (t.length < 2 || e.length < 2) return -1;
s = 2, a /= 2, h /= 2, r /= 2;
}
function u(t, e) {
return 1 === s ? t[e] : t.readUInt16BE(e * s);
}
if (n) {
let i = -1;
for (o = r; o < a; o++) if (u(t, o) === u(e, -1 === i ? 0 : o - i)) {
if (-1 === i && (i = o), o - i + 1 === h) return i * s;
} else -1 !== i && (o -= o - i), i = -1;
} else for (r + h > a && (r = a - h), o = r; o >= 0; o--) {
let r = !0;
for (let i = 0; i < h; i++) if (u(t, o + i) !== u(e, i)) {
r = !1;
break;
}
if (r) return o;
}
return -1;
}
function S(t, e, r, i) {
r = Number(r) || 0;
const n = t.length - r;
i ? (i = Number(i)) > n && (i = n) : i = n;
const o = e.length;
let s;
for (i > o / 2 && (i = o / 2), s = 0; s < i; ++s) {
const i = parseInt(e.substr(2 * s, 2), 16);
if (X(i)) return s;
t[r + s] = i;
}
return s;
}
function E(t, e, r, i) {
return Y(Z(e, t.length - r), t, r, i);
}
function A(t, e, r, i) {
return Y(function(t) {
const e = [];
for (let r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));
return e;
}(e), t, r, i);
}
function C(t, e, r, i) {
return Y(Q(e), t, r, i);
}
function O(t, e, r, i) {
return Y(function(t, e) {
let r, i, n;
const o = [];
for (let s = 0; s < t.length && !((e -= 2) < 0); ++s) r = t.charCodeAt(s), i = r >> 8, n = r % 256, o.push(n), o.push(i);
return o;
}(e, t.length - r), t, r, i);
}
function P(t, r, i) {
return 0 === r && i === t.length ? e.fromByteArray(t) : e.fromByteArray(t.slice(r, i));
}
function I(t, e, r) {
r = Math.min(t.length, r);
const i = [];
let n = e;
for (; n < r;) {
const e = t[n];
let o = null, s = e > 239 ? 4 : e > 223 ? 3 : e > 191 ? 2 : 1;
if (n + s <= r) {
let r, i, a, h;
switch (s) {
case 1:
e < 128 && (o = e);
break;
case 2:
r = t[n + 1], 128 == (192 & r) && (h = (31 & e) << 6 | 63 & r, h > 127 && (o = h));
break;
case 3:
r = t[n + 1], i = t[n + 2], 128 == (192 & r) && 128 == (192 & i) && (h = (15 & e) << 12 | (63 & r) << 6 | 63 & i, h > 2047 && (h < 55296 || h > 57343) && (o = h));
break;
case 4: r = t[n + 1], i = t[n + 2], a = t[n + 3], 128 == (192 & r) && 128 == (192 & i) && 128 == (192 & a) && (h = (15 & e) << 18 | (63 & r) << 12 | (63 & i) << 6 | 63 & a, h > 65535 && h < 1114112 && (o = h));
}
}
null === o ? (o = 65533, s = 1) : o > 65535 && (o -= 65536, i.push(o >>> 10 & 1023 | 55296), o = 56320 | 1023 & o), i.push(o), n += s;
}
return function(t) {
const e = t.length;
if (e <= k) return String.fromCharCode.apply(String, t);
let r = "", i = 0;
for (; i < e;) r += String.fromCharCode.apply(String, t.slice(i, i += k));
return r;
}(i);
}
l.TYPED_ARRAY_SUPPORT = function() {
try {
const t = new s(1), e = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(e, s.prototype), Object.setPrototypeOf(t, e), 42 === t.foo();
} catch (t) {
return !1;
}
}(), l.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(l.prototype, "parent", {
enumerable: !0,
get: function() {
if (l.isBuffer(this)) return this.buffer;
}
}), Object.defineProperty(l.prototype, "offset", {
enumerable: !0,
get: function() {
if (l.isBuffer(this)) return this.byteOffset;
}
}), l.poolSize = 8192, l.from = function(t, e, r) {
return c(t, e, r);
}, Object.setPrototypeOf(l.prototype, s.prototype), Object.setPrototypeOf(l, s), l.alloc = function(t, e, r) {
return function(t, e, r) {
return d(t), t <= 0 ? u(t) : void 0 !== e ? "string" == typeof r ? u(t).fill(e, r) : u(t).fill(e) : u(t);
}(t, e, r);
}, l.allocUnsafe = function(t) {
return p(t);
}, l.allocUnsafeSlow = function(t) {
return p(t);
}, l.isBuffer = function(t) {
return null != t && !0 === t._isBuffer && t !== l.prototype;
}, l.compare = function(t, e) {
if (G(t, s) && (t = l.from(t, t.offset, t.byteLength)), G(e, s) && (e = l.from(e, e.offset, e.byteLength)), !l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
if (t === e) return 0;
let r = t.length, i = e.length;
for (let n = 0, o = Math.min(r, i); n < o; ++n) if (t[n] !== e[n]) {
r = t[n], i = e[n];
break;
}
return r < i ? -1 : i < r ? 1 : 0;
}, l.isEncoding = function(t) {
switch (String(t).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 !0;
default: return !1;
}
}, l.concat = function(t, e) {
if (!Array.isArray(t)) throw new TypeError("\"list\" argument must be an Array of Buffers");
if (0 === t.length) return l.alloc(0);
let r;
if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;
const i = l.allocUnsafe(e);
let n = 0;
for (r = 0; r < t.length; ++r) {
let e = t[r];
if (G(e, s)) n + e.length > i.length ? (l.isBuffer(e) || (e = l.from(e)), e.copy(i, n)) : s.prototype.set.call(i, e, n);
else {
if (!l.isBuffer(e)) throw new TypeError("\"list\" argument must be an Array of Buffers");
e.copy(i, n);
}
n += e.length;
}
return i;
}, l.byteLength = b, l.prototype._isBuffer = !0, l.prototype.swap16 = function() {
const t = this.length;
if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let e = 0; e < t; e += 2) _(this, e, e + 1);
return this;
}, l.prototype.swap32 = function() {
const t = this.length;
if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let e = 0; e < t; e += 4) _(this, e, e + 3), _(this, e + 1, e + 2);
return this;
}, l.prototype.swap64 = function() {
const t = this.length;
if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let e = 0; e < t; e += 8) _(this, e, e + 7), _(this, e + 1, e + 6), _(this, e + 2, e + 5), _(this, e + 3, e + 4);
return this;
}, l.prototype.toString = function() {
const t = this.length;
return 0 === t ? "" : 0 === arguments.length ? I(this, 0, t) : v.apply(this, arguments);
}, l.prototype.toLocaleString = l.prototype.toString, l.prototype.equals = function(t) {
if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
return this === t || 0 === l.compare(this, t);
}, l.prototype.inspect = function() {
let e = "";
const r = t.INSPECT_MAX_BYTES;
return e = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (e += " ... "), "<Buffer " + e + ">";
}, n && (l.prototype[n] = l.prototype.inspect), l.prototype.compare = function(t, e, r, i, n) {
if (G(t, s) && (t = l.from(t, t.offset, t.byteLength)), !l.isBuffer(t)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof t);
if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === i && (i = 0), void 0 === n && (n = this.length), e < 0 || r > t.length || i < 0 || n > this.length) throw new RangeError("out of range index");
if (i >= n && e >= r) return 0;
if (i >= n) return -1;
if (e >= r) return 1;
if (this === t) return 0;
let o = (n >>>= 0) - (i >>>= 0), a = (r >>>= 0) - (e >>>= 0);
const h = Math.min(o, a), u = this.slice(i, n), f = t.slice(e, r);
for (let t = 0; t < h; ++t) if (u[t] !== f[t]) {
o = u[t], a = f[t];
break;
}
return o < a ? -1 : a < o ? 1 : 0;
}, l.prototype.includes = function(t, e, r) {
return -1 !== this.indexOf(t, e, r);
}, l.prototype.indexOf = function(t, e, r) {
return w(this, t, e, r, !0);
}, l.prototype.lastIndexOf = function(t, e, r) {
return w(this, t, e, r, !1);
}, l.prototype.write = function(t, e, r, i) {
if (void 0 === e) i = "utf8", r = this.length, e = 0;
else if (void 0 === r && "string" == typeof e) i = e, r = this.length, e = 0;
else {
if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === i && (i = "utf8")) : (i = r, r = void 0);
}
const n = this.length - e;
if ((void 0 === r || r > n) && (r = n), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
let o = !1;
for (;;) switch (i) {
case "hex": return S(this, t, e, r);
case "utf8":
case "utf-8": return E(this, t, e, r);
case "ascii":
case "latin1":
case "binary": return A(this, t, e, r);
case "base64": return C(this, t, e, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return O(this, t, e, r);
default:
if (o) throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(), o = !0;
}
}, l.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
const k = 4096;
function R(t, e, r) {
let i = "";
r = Math.min(t.length, r);
for (let n = e; n < r; ++n) i += String.fromCharCode(127 & t[n]);
return i;
}
function q(t, e, r) {
let i = "";
r = Math.min(t.length, r);
for (let n = e; n < r; ++n) i += String.fromCharCode(t[n]);
return i;
}
function T(t, e, r) {
const i = t.length;
(!e || e < 0) && (e = 0), (!r || r < 0 || r > i) && (r = i);
let n = "";
for (let i = e; i < r; ++i) n += tt[t[i]];
return n;
}
function x(t, e, r) {
const i = t.slice(e, r);
let n = "";
for (let t = 0; t < i.length - 1; t += 2) n += String.fromCharCode(i[t] + 256 * i[t + 1]);
return n;
}
function N(t, e, r) {
if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
}
function B(t, e, r, i, n, o) {
if (!l.isBuffer(t)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
if (e > n || e < o) throw new RangeError("\"value\" argument is out of bounds");
if (r + i > t.length) throw new RangeError("Index out of range");
}
function j(t, e, r, i, n) {
K(e, i, n, t, r, 7);
let o = Number(e & BigInt(4294967295));
t[r++] = o, o >>= 8, t[r++] = o, o >>= 8, t[r++] = o, o >>= 8, t[r++] = o;
let s = Number(e >> BigInt(32) & BigInt(4294967295));
return t[r++] = s, s >>= 8, t[r++] = s, s >>= 8, t[r++] = s, s >>= 8, t[r++] = s, r;
}
function L(t, e, r, i, n) {
K(e, i, n, t, r, 7);
let o = Number(e & BigInt(4294967295));
t[r + 7] = o, o >>= 8, t[r + 6] = o, o >>= 8, t[r + 5] = o, o >>= 8, t[r + 4] = o;
let s = Number(e >> BigInt(32) & BigInt(4294967295));
return t[r + 3] = s, s >>= 8, t[r + 2] = s, s >>= 8, t[r + 1] = s, s >>= 8, t[r] = s, r + 8;
}
function D(t, e, r, i, n, o) {
if (r + i > t.length) throw new RangeError("Index out of range");
if (r < 0) throw new RangeError("Index out of range");
}
function U(t, e, r, n, o) {
return e = +e, r >>>= 0, o || D(t, 0, r, 4), i.write(t, e, r, n, 23, 4), r + 4;
}
function $(t, e, r, n, o) {
return e = +e, r >>>= 0, o || D(t, 0, r, 8), i.write(t, e, r, n, 52, 8), r + 8;
}
l.prototype.slice = function(t, e) {
const r = this.length;
(t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t);
const i = this.subarray(t, e);
return Object.setPrototypeOf(i, l.prototype), i;
}, l.prototype.readUintLE = l.prototype.readUIntLE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || N(t, e, this.length);
let i = this[t], n = 1, o = 0;
for (; ++o < e && (n *= 256);) i += this[t + o] * n;
return i;
}, l.prototype.readUintBE = l.prototype.readUIntBE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || N(t, e, this.length);
let i = this[t + --e], n = 1;
for (; e > 0 && (n *= 256);) i += this[t + --e] * n;
return i;
}, l.prototype.readUint8 = l.prototype.readUInt8 = function(t, e) {
return t >>>= 0, e || N(t, 1, this.length), this[t];
}, l.prototype.readUint16LE = l.prototype.readUInt16LE = function(t, e) {
return t >>>= 0, e || N(t, 2, this.length), this[t] | this[t + 1] << 8;
}, l.prototype.readUint16BE = l.prototype.readUInt16BE = function(t, e) {
return t >>>= 0, e || N(t, 2, this.length), this[t] << 8 | this[t + 1];
}, l.prototype.readUint32LE = l.prototype.readUInt32LE = function(t, e) {
return t >>>= 0, e || N(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3];
}, l.prototype.readUint32BE = l.prototype.readUInt32BE = function(t, e) {
return t >>>= 0, e || N(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
}, l.prototype.readBigUInt64LE = et((function(t) {
W(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || V(t, this.length - 8);
const i = e + 256 * this[++t] + 65536 * this[++t] + this[++t] * 2 ** 24, n = this[++t] + 256 * this[++t] + 65536 * this[++t] + r * 2 ** 24;
return BigInt(i) + (BigInt(n) << BigInt(32));
})), l.prototype.readBigUInt64BE = et((function(t) {
W(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || V(t, this.length - 8);
const i = e * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + this[++t], n = this[++t] * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + r;
return (BigInt(i) << BigInt(32)) + BigInt(n);
})), l.prototype.readIntLE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || N(t, e, this.length);
let i = this[t], n = 1, o = 0;
for (; ++o < e && (n *= 256);) i += this[t + o] * n;
return n *= 128, i >= n && (i -= Math.pow(2, 8 * e)), i;
}, l.prototype.readIntBE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || N(t, e, this.length);
let i = e, n = 1, o = this[t + --i];
for (; i > 0 && (n *= 256);) o += this[t + --i] * n;
return n *= 128, o >= n && (o -= Math.pow(2, 8 * e)), o;
}, l.prototype.readInt8 = function(t, e) {
return t >>>= 0, e || N(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t];
}, l.prototype.readInt16LE = function(t, e) {
t >>>= 0, e || N(t, 2, this.length);
const r = this[t] | this[t + 1] << 8;
return 32768 & r ? 4294901760 | r : r;
}, l.prototype.readInt16BE = function(t, e) {
t >>>= 0, e || N(t, 2, this.length);
const r = this[t + 1] | this[t] << 8;
return 32768 & r ? 4294901760 | r : r;
}, l.prototype.readInt32LE = function(t, e) {
return t >>>= 0, e || N(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
}, l.prototype.readInt32BE = function(t, e) {
return t >>>= 0, e || N(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
}, l.prototype.readBigInt64LE = et((function(t) {
W(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || V(t, this.length - 8);
const i = this[t + 4] + 256 * this[t + 5] + 65536 * this[t + 6] + (r << 24);
return (BigInt(i) << BigInt(32)) + BigInt(e + 256 * this[++t] + 65536 * this[++t] + this[++t] * 2 ** 24);
})), l.prototype.readBigInt64BE = et((function(t) {
W(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || V(t, this.length - 8);
const i = (e << 24) + 65536 * this[++t] + 256 * this[++t] + this[++t];
return (BigInt(i) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + r);
})), l.prototype.readFloatLE = function(t, e) {
return t >>>= 0, e || N(t, 4, this.length), i.read(this, t, !0, 23, 4);
}, l.prototype.readFloatBE = function(t, e) {
return t >>>= 0, e || N(t, 4, this.length), i.read(this, t, !1, 23, 4);
}, l.prototype.readDoubleLE = function(t, e) {
return t >>>= 0, e || N(t, 8, this.length), i.read(this, t, !0, 52, 8);
}, l.prototype.readDoubleBE = function(t, e) {
return t >>>= 0, e || N(t, 8, this.length), i.read(this, t, !1, 52, 8);
}, l.prototype.writeUintLE = l.prototype.writeUIntLE = function(t, e, r, i) {
if (t = +t, e >>>= 0, r >>>= 0, !i) B(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
let n = 1, o = 0;
for (this[e] = 255 & t; ++o < r && (n *= 256);) this[e + o] = t / n & 255;
return e + r;
}, l.prototype.writeUintBE = l.prototype.writeUIntBE = function(t, e, r, i) {
if (t = +t, e >>>= 0, r >>>= 0, !i) B(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
let n = r - 1, o = 1;
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256);) this[e + n] = t / o & 255;
return e + r;
}, l.prototype.writeUint8 = l.prototype.writeUInt8 = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1;
}, l.prototype.writeUint16LE = l.prototype.writeUInt16LE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
}, l.prototype.writeUint16BE = l.prototype.writeUInt16BE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
}, l.prototype.writeUint32LE = l.prototype.writeUInt32LE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t, e + 4;
}, l.prototype.writeUint32BE = l.prototype.writeUInt32BE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
}, l.prototype.writeBigUInt64LE = et((function(t, e = 0) {
return j(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
})), l.prototype.writeBigUInt64BE = et((function(t, e = 0) {
return L(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
})), l.prototype.writeIntLE = function(t, e, r, i) {
if (t = +t, e >>>= 0, !i) {
const i = Math.pow(2, 8 * r - 1);
B(this, t, e, r, i - 1, -i);
}
let n = 0, o = 1, s = 0;
for (this[e] = 255 & t; ++n < r && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + n - 1] && (s = 1), this[e + n] = (t / o | 0) - s & 255;
return e + r;
}, l.prototype.writeIntBE = function(t, e, r, i) {
if (t = +t, e >>>= 0, !i) {
const i = Math.pow(2, 8 * r - 1);
B(this, t, e, r, i - 1, -i);
}
let n = r - 1, o = 1, s = 0;
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + n + 1] && (s = 1), this[e + n] = (t / o | 0) - s & 255;
return e + r;
}, l.prototype.writeInt8 = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1;
}, l.prototype.writeInt16LE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 2, 32767, -32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
}, l.prototype.writeInt16BE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
}, l.prototype.writeInt32LE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 4, 2147483647, -2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
}, l.prototype.writeInt32BE = function(t, e, r) {
return t = +t, e >>>= 0, r || B(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
}, l.prototype.writeBigInt64LE = et((function(t, e = 0) {
return j(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
})), l.prototype.writeBigInt64BE = et((function(t, e = 0) {
return L(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
})), l.prototype.writeFloatLE = function(t, e, r) {
return U(this, t, e, !0, r);
}, l.prototype.writeFloatBE = function(t, e, r) {
return U(this, t, e, !1, r);
}, l.prototype.writeDoubleLE = function(t, e, r) {
return $(this, t, e, !0, r);
}, l.prototype.writeDoubleBE = function(t, e, r) {
return $(this, t, e, !1, r);
}, l.prototype.copy = function(t, e, r, i) {
if (!l.isBuffer(t)) throw new TypeError("argument should be a Buffer");
if (r || (r = 0), i || 0 === i || (i = this.length), e >= t.length && (e = t.length), e || (e = 0), i > 0 && i < r && (i = r), i === r) return 0;
if (0 === t.length || 0 === this.length) return 0;
if (e < 0) throw new RangeError("targetStart out of bounds");
if (r < 0 || r >= this.length) throw new RangeError("Index out of range");
if (i < 0) throw new RangeError("sourceEnd out of bounds");
i > this.length && (i = this.length), t.length - e < i - r && (i = t.length - e + r);
const n = i - r;
return this === t && "function" == typeof s.prototype.copyWithin ? this.copyWithin(e, r, i) : s.prototype.set.call(t, this.subarray(r, i), e), n;
}, l.prototype.fill = function(t, e, r, i) {
if ("string" == typeof t) {
if ("string" == typeof e ? (i = e, e = 0, r = this.length) : "string" == typeof r && (i = r, r = this.length), void 0 !== i && "string" != typeof i) throw new TypeError("encoding must be a string");
if ("string" == typeof i && !l.isEncoding(i)) throw new TypeError("Unknown encoding: " + i);
if (1 === t.length) {
const e = t.charCodeAt(0);
("utf8" === i && e < 128 || "latin1" === i) && (t = e);
}
} else "number" == typeof t ? t &= 255 : "boolean" == typeof t && (t = Number(t));
if (e < 0 || this.length < e || this.length < r) throw new RangeError("Out of range index");
if (r <= e) return this;
let n;
if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, t || (t = 0), "number" == typeof t) for (n = e; n < r; ++n) this[n] = t;
else {
const o = l.isBuffer(t) ? t : l.from(t, i), s = o.length;
if (0 === s) throw new TypeError("The value \"" + t + "\" is invalid for argument \"value\"");
for (n = 0; n < r - e; ++n) this[n + e] = o[n % s];
}
return this;
};
const F = {};
function J(t, e, r) {
F[t] = class extends r {
constructor() {
super(), Object.defineProperty(this, "message", {
value: e.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${t}]`, this.stack, delete this.name;
}
get code() {
return t;
}
set code(t) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: t,
writable: !0
});
}
toString() {
return `${this.name} [${t}]: ${this.message}`;
}
};
}
function z(t) {
let e = "", r = t.length;
const i = "-" === t[0] ? 1 : 0;
for (; r >= i + 4; r -= 3) e = `_${t.slice(r - 3, r)}${e}`;
return `${t.slice(0, r)}${e}`;
}
function K(t, e, r, i, n, o) {
if (t > r || t < e) {
const i = "bigint" == typeof e ? "n" : "";
let n;
throw n = o > 3 ? 0 === e || e === BigInt(0) ? `>= 0${i} and < 2${i} ** ${8 * (o + 1)}${i}` : `>= -(2${i} ** ${8 * (o + 1) - 1}${i}) and < 2 ** ${8 * (o + 1) - 1}${i}` : `>= ${e}${i} and <= ${r}${i}`, new F.ERR_OUT_OF_RANGE("value", n, t);
}
(function(t, e, r) {
W(e, "offset"), void 0 !== t[e] && void 0 !== t[e + r] || V(e, t.length - (r + 1));
})(i, n, o);
}
function W(t, e) {
if ("number" != typeof t) throw new F.ERR_INVALID_ARG_TYPE(e, "number", t);
}
function V(t, e, r) {
if (Math.floor(t) !== t) throw W(t, r), new F.ERR_OUT_OF_RANGE(r || "offset", "an integer", t);
if (e < 0) throw new F.ERR_BUFFER_OUT_OF_BOUNDS();
throw new F.ERR_OUT_OF_RANGE(r || "offset", `>= ${r ? 1 : 0} and <= ${e}`, t);
}
J("ERR_BUFFER_OUT_OF_BOUNDS", (function(t) {
return t ? `${t} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
}), RangeError), J("ERR_INVALID_ARG_TYPE", (function(t, e) {
return `The "${t}" argument must be of type number. Received type ${typeof e}`;
}), TypeError), J("ERR_OUT_OF_RANGE", (function(t, e, r) {
let i = `The value of "${t}" is out of range.`, n = r;
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? n = z(String(r)) : "bigint" == typeof r && (n = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (n = z(n)), n += "n"), i += ` It must be ${e}. Received ${n}`, i;
}), RangeError);
const H = /[^+/0-9A-Za-z-_]/g;
function Z(t, e) {
let r;
e = e || Infinity;
const i = t.length;
let n = null;
const o = [];
for (let s = 0; s < i; ++s) {
if (r = t.charCodeAt(s), r > 55295 && r < 57344) {
if (!n) {
if (r > 56319) {
(e -= 3) > -1 && o.push(239, 191, 189);
continue;
}
if (s + 1 === i) {
(e -= 3) > -1 && o.push(239, 191, 189);
continue;
}
n = r;
continue;
}
if (r < 56320) {
(e -= 3) > -1 && o.push(239, 191, 189), n = r;
continue;
}
r = 65536 + (n - 55296 << 10 | r - 56320);
} else n && (e -= 3) > -1 && o.push(239, 191, 189);
if (n = null, r < 128) {
if ((e -= 1) < 0) break;
o.push(r);
} else if (r < 2048) {
if ((e -= 2) < 0) break;
o.push(r >> 6 | 192, 63 & r | 128);
} else if (r < 65536) {
if ((e -= 3) < 0) break;
o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128);
} else {
if (!(r < 1114112)) throw new Error("Invalid code point");
if ((e -= 4) < 0) break;
o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);
}
}
return o;
}
function Q(t) {
return e.toByteArray(function(t) {
if ((t = (t = t.split("=")[0]).trim().replace(H, "")).length < 2) return "";
for (; t.length % 4 != 0;) t += "=";
return t;
}(t));
}
function Y(t, e, r, i) {
let n;
for (n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) e[n + r] = t[n];
return n;
}
function G(t, e) {
return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name;
}
function X(t) {
return t != t;
}
const tt = function() {
const t = "0123456789abcdef", e = new Array(256);
for (let r = 0; r < 16; ++r) {
const i = 16 * r;
for (let n = 0; n < 16; ++n) e[i + n] = t[r] + t[n];
}
return e;
}();
function et(t) {
return "undefined" == typeof BigInt ? rt : t;
}
function rt() {
throw new Error("BigInt not supported");
}
})(e);
var l = e.Buffer;
t.Blob = e.Blob, t.BlobOptions = e.BlobOptions, t.Buffer = e.Buffer, t.File = e.File, t.FileOptions = e.FileOptions, t.INSPECT_MAX_BYTES = e.INSPECT_MAX_BYTES, t.SlowBuffer = e.SlowBuffer, t.TranscodeEncoding = e.TranscodeEncoding, t.atob = e.atob, t.btoa = e.btoa, t.constants = e.constants, t.default = l, t.isAscii = e.isAscii, t.isUtf8 = e.isUtf8, t.kMaxLength = e.kMaxLength, t.kStringMaxLength = e.kStringMaxLength, t.resolveObjectURL = e.resolveObjectURL, t.transcode = e.transcode;
})), require_shams$1 = __commonJSMin(((t, e) => {
e.exports = function() {
if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) return !1;
if ("symbol" == typeof Symbol.iterator) return !0;
var t = {}, e = Symbol("test"), r = Object(e);
if ("string" == typeof e) return !1;
if ("[object Symbol]" !== Object.prototype.toString.call(e)) return !1;
if ("[object Symbol]" !== Object.prototype.toString.call(r)) return !1;
for (var i in t[e] = 42, t) return !1;
if ("function" == typeof Object.keys && 0 !== Object.keys(t).length) return !1;
if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(t).length) return !1;
var n = Object.getOwnPropertySymbols(t);
if (1 !== n.length || n[0] !== e) return !1;
if (!Object.prototype.propertyIsEnumerable.call(t, e)) return !1;
if ("function" == typeof Object.getOwnPropertyDescriptor) {
var o = Object.getOwnPropertyDescriptor(t, e);
if (42 !== o.value || !0 !== o.enumerable) return !1;
}
return !0;
};
})), require_shams = __commonJSMin(((t, e) => {
var r = require_shams$1();
e.exports = function() {
return r() && !!Symbol.toStringTag;
};
})), require_es_object_atoms = __commonJSMin(((t, e) => {
e.exports = Object;
})), require_es_errors = __commonJSMin(((t, e) => {
e.exports = Error;
})), require_eval = __commonJSMin(((t, e) => {
e.exports = EvalError;
})), require_range = __commonJSMin(((t, e) => {
e.exports = RangeError;
})), require_ref = __commonJSMin(((t, e) => {
e.exports = ReferenceError;
})), require_syntax = __commonJSMin(((t, e) => {
e.exports = SyntaxError;
})), require_type = __commonJSMin(((t, e) => {
e.exports = TypeError;
})), require_uri = __commonJSMin(((t, e) => {
e.exports = URIError;
})), require_abs = __commonJSMin(((t, e) => {
e.exports = Math.abs;
})), require_floor = __commonJSMin(((t, e) => {
e.exports = Math.floor;
})), require_max = __commonJSMin(((t, e) => {
e.exports = Math.max;
})), require_min = __commonJSMin(((t, e) => {
e.exports = Math.min;
})), require_pow = __commonJSMin(((t, e) => {
e.exports = Math.pow;
})), require_round = __commonJSMin(((t, e) => {
e.exports = Math.round;
})), require_isNaN = __commonJSMin(((t, e) => {
e.exports = Number.isNaN || function(t) {
return t != t;
};
})), require_sign$1 = __commonJSMin(((t, e) => {
var r = require_isNaN();
e.exports = function(t) {
return r(t) || 0 === t ? t : t < 0 ? -1 : 1;
};
})), require_gOPD = __commonJSMin(((t, e) => {
e.exports = Object.getOwnPropertyDescriptor;
})), require_gopd = __commonJSMin(((t, e) => {
var r = require_gOPD();
if (r) try {
r([], "length");
} catch (t) {
r = null;
}
e.exports = r;
})), require_es_define_property = __commonJSMin(((t, e) => {
var r = Object.defineProperty || !1;
if (r) try {
r({}, "a", { value: 1 });
} catch (t) {
r = !1;
}
e.exports = r;
})), require_has_symbols = __commonJSMin(((t, e) => {
var r = "undefined" != typeof Symbol && Symbol, i = require_shams$1();
e.exports = function() {
return "function" == typeof r && "function" == typeof Symbol && "symbol" == typeof r("foo") && "symbol" == typeof Symbol("bar") && i();
};
})), require_Reflect_getPrototypeOf = __commonJSMin(((t, e) => {
e.exports = "undefined" != typeof Reflect && Reflect.getPrototypeOf || null;
})), require_Object_getPrototypeOf = __commonJSMin(((t, e) => {
e.exports = require_es_object_atoms().getPrototypeOf || null;
})), require_implementation = __commonJSMin(((t, e) => {
var r = Object.prototype.toString, i = Math.max, n = function(t, e) {
for (var r = [], i = 0; i < t.length; i += 1) r[i] = t[i];
for (var n = 0; n < e.length; n += 1) r[n + t.length] = e[n];
return r;
};
e.exports = function(t) {
var e = this;
if ("function" != typeof e || "[object Function]" !== r.apply(e)) throw new TypeError("Function.prototype.bind called on incompatible " + e);
for (var o, s = function(t, e) {
for (var r = [], i = e || 0, n = 0; i < t.length; i += 1, n += 1) r[n] = t[i];
return r;
}(arguments, 1), a = i(0, e.length - s.length), h = [], u = 0; u < a; u++) h[u] = "$" + u;
if (o = Function("binder", "return function (" + function(t, e) {
for (var r = "", i = 0; i < t.length; i += 1) r += t[i], i + 1 < t.length && (r += e);
return r;
}(h, ",") + "){ return binder.apply(this,arguments); }")((function() {
if (this instanceof o) {
var r = e.apply(this, n(s, arguments));
return Object(r) === r ? r : this;
}
return e.apply(t, n(s, arguments));
})), e.prototype) {
var f = function() {};
f.prototype = e.prototype, o.prototype = new f(), f.prototype = null;
}
return o;
};
})), require_function_bind = __commonJSMin(((t, e) => {
var r = require_implementation();
e.exports = Function.prototype.bind || r;
})), require_functionCall = __commonJSMin(((t, e) => {
e.exports = Function.prototype.call;
})), require_functionApply = __commonJSMin(((t, e) => {
e.exports = Function.prototype.apply;
})), require_reflectApply = __commonJSMin(((t, e) => {
e.exports = "undefined" != typeof Reflect && Reflect && Reflect.apply;
})), require_actualApply = __commonJSMin(((t, e) => {
var r = require_function_bind(), i = require_functionApply(), n = require_functionCall();
e.exports = require_reflectApply() || r.call(n, i);
})), require_call_bind_apply_helpers = __commonJSMin(((t, e) => {
var r = require_function_bind(), i = require_type(), n = require_functionCall(), o = require_actualApply();
e.exports = function(t) {
if (t.length < 1 || "function" != typeof t[0]) throw new i("a function is required");
return o(r, n, t);
};
})), require_get = __commonJSMin(((t, e) => {
var r, i = require_call_bind_apply_helpers(), n = require_gopd();
try {
r = [].__proto__ === Array.prototype;
} catch (t) {
if (!t || "object" != typeof t || !("code" in t) || "ERR_PROTO_ACCESS" !== t.code) throw t;
}
var o = !!r && n && n(Object.prototype, "__proto__"), s = Object, a = s.getPrototypeOf;
e.exports = o && "function" == typeof o.get ? i([o.get]) : "function" == typeof a && function(t) {
return a(null == t ? t : s(t));
};
})), require_get_proto = __commonJSMin(((t, e) => {
var r = require_Reflect_getPrototypeOf(), i = require_Object_getPrototypeOf(), n = require_get();
e.exports = r ? function(t) {
return r(t);
} : i ? function(t) {
if (!t || "object" != typeof t && "function" != typeof t) throw new TypeError("getProto: not an object");
return i(t);
} : n ? function(t) {
return n(t);
} : null;
})), require_hasown = __commonJSMin(((t, e) => {
var r = Function.prototype.call, i = Object.prototype.hasOwnProperty;
e.exports = require_function_bind().call(r, i);
})), require_get_intrinsic = __commonJSMin(((t, e) => {
var r, i = require_es_object_atoms(), n = require_es_errors(), o = require_eval(), s = require_range(), a = require_ref(), h = require_syntax(), u = require_type(), f = require_uri(), l = require_abs(), c = require_floor(), d = require_max(), p = require_min(), m = require_pow(), g = require_round(), y = require_sign$1(), b = Function, v = function(t) {
try {
return b("\"use strict\"; return (" + t + ").constructor;")();
} catch (t) {}
}, _ = require_gopd(), w = require_es_define_property(), M = function() {
throw new u();
}, S = _ ? function() {
try {
return M;
} catch (t) {
try {
return _(arguments, "callee").get;
} catch (t) {
return M;
}
}
}() : M, E = require_has_symbols()(), A = require_get_proto(), C = require_Object_getPrototypeOf(), O = require_Reflect_getPrototypeOf(), P = require_functionApply(), I = require_functionCall(), k = {}, R = "undefined" != typeof Uint8Array && A ? A(Uint8Array) : r, q = {
__proto__: null,
"%AggregateError%": "undefined" == typeof AggregateError ? r : AggregateError,
"%Array%": Array,
"%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? r : ArrayBuffer,
"%ArrayIteratorPrototype%": E && A ? A([][Symbol.iterator]()) : r,
"%AsyncFromSyncIteratorPrototype%": r,
"%AsyncFunction%": k,
"%AsyncGenerator%": k,
"%AsyncGeneratorFunction%": k,
"%AsyncIteratorPrototype%": k,
"%Atomics%": "undefined" == typeof Atomics ? r : Atomics,
"%BigInt%": "undefined" == typeof BigInt ? r : BigInt,
"%BigInt64Array%": "undefined" == typeof BigInt64Array ? r : BigInt64Array,
"%BigUint64Array%": "undefined" == typeof BigUint64Array ? r : BigUint64Array,
"%Boolean%": Boolean,
"%DataView%": "undefined" == typeof DataView ? r : DataView,
"%Date%": Date,
"%decodeURI%": decodeURI,
"%decodeURIComponent%": decodeURIComponent,
"%encodeURI%": encodeURI,
"%encodeURIComponent%": encodeURIComponent,
"%Error%": n,
"%eval%": eval,
"%EvalError%": o,
"%Float16Array%": "undefined" == typeof Float16Array ? r : Float16Array,
"%Float32Array%": "undefined" == typeof Float32Array ? r : Float32Array,
"%Float64Array%": "undefined" == typeof Float64Array ? r : Float64Array,
"%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ? r : FinalizationRegistry,
"%Function%": b,
"%GeneratorFunction%": k,
"%Int8Array%": "undefined" == typeof Int8Array ? r : Int8Array,
"%Int16Array%": "undefined" == typeof Int16Array ? r : Int16Array,
"%Int32Array%": "undefined" == typeof Int32Array ? r : Int32Array,
"%isFinite%": isFinite,
"%isNaN%": isNaN,
"%IteratorPrototype%": E && A ? A(A([][Symbol.iterator]())) : r,
"%JSON%": "object" == typeof JSON ? JSON : r,
"%Map%": "undefined" == typeof Map ? r : Map,
"%MapIteratorPrototype%": "undefined" != typeof Map && E && A ? A((/* @__PURE__ */ new Map())[Symbol.iterator]()) : r,
"%Math%": Math,
"%Number%": Number,
"%Object%": i,
"%Object.getOwnPropertyDescriptor%": _,
"%parseFloat%": parseFloat,
"%parseInt%": parseInt,
"%Promise%": "undefined" == typeof Promise ? r : Promise,
"%Proxy%": "undefined" == typeof Proxy ? r : Proxy,
"%RangeError%": s,
"%ReferenceError%": a,
"%Reflect%": "undefined" == typeof Reflect ? r : Reflect,
"%RegExp%": RegExp,
"%Set%": "undefined" == typeof Set ? r : Set,
"%SetIteratorPrototype%": "undefined" != typeof Set && E && A ? A((/* @__PURE__ */ new Set())[Symbol.iterator]()) : r,
"%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? r : SharedArrayBuffer,
"%String%": String,
"%StringIteratorPrototype%": E && A ? A(""[Symbol.iterator]()) : r,
"%Symbol%": E ? Symbol : r,
"%SyntaxError%": h,
"%ThrowTypeError%": S,
"%TypedArray%": R,
"%TypeError%": u,
"%Uint8Array%": "undefined" == typeof Uint8Array ? r : Uint8Array,
"%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? r : Uint8ClampedArray,
"%Uint16Array%": "undefined" == typeof Uint16Array ? r : Uint16Array,
"%Uint32Array%": "undefined" == typeof Uint32Array ? r : Uint32Array,
"%URIError%": f,
"%WeakMap%": "undefined" == typeof WeakMap ? r : WeakMap,
"%WeakRef%": "undefined" == typeof WeakRef ? r : WeakRef,
"%WeakSet%": "undefined" == typeof WeakSet ? r : WeakSet,
"%Function.prototype.call%": I,
"%Function.prototype.apply%": P,
"%Object.defineProperty%": w,
"%Object.getPrototypeOf%": C,
"%Math.abs%": l,
"%Math.floor%": c,
"%Math.max%": d,
"%Math.min%": p,
"%Math.pow%": m,
"%Math.round%": g,
"%Math.sign%": y,
"%Reflect.getPrototypeOf%": O
};
if (A) try {
null.error;
} catch (t) {
q["%Error.prototype%"] = A(A(t));
}
var T = function t(e) {
var r;
if ("%AsyncFunction%" === e) r = v("async function () {}");
else if ("%GeneratorFunction%" === e) r = v("function* () {}");
else if ("%AsyncGeneratorFunction%" === e) r = v("async function* () {}");
else if ("%AsyncGenerator%" === e) {
var i = t("%AsyncGeneratorFunction%");
i && (r = i.prototype);
} else if ("%AsyncIteratorPrototype%" === e) {
var n = t("%AsyncGenerator%");
n && A && (r = A(n.prototype));
}
return q[e] = r, r;
}, x = {
__proto__: null,
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
"%ArrayPrototype%": ["Array", "prototype"],
"%ArrayProto_entries%": [
"Array",
"prototype",
"entries"
],
"%ArrayProto_forEach%": [
"Array",
"prototype",
"forEach"
],
"%ArrayProto_keys%": [
"Array",
"prototype",
"keys"
],
"%ArrayProto_values%": [
"Array",
"prototype",
"values"
],
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
"%AsyncGeneratorPrototype%": [
"AsyncGeneratorFunction",
"prototype",
"prototype"
],
"%BooleanPrototype%": ["Boolean", "prototype"],
"%DataViewPrototype%": ["DataView", "prototype"],
"%DatePrototype%": ["Date", "prototype"],
"%ErrorPrototype%": ["Error", "prototype"],
"%EvalErrorPrototype%": ["EvalError", "prototype"],
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
"%FunctionPrototype%": ["Function", "prototype"],
"%Generator%": ["GeneratorFunction", "prototype"],
"%GeneratorPrototype%": [
"GeneratorFunction",
"prototype",
"prototype"
],
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
"%JSONParse%": ["JSON", "parse"],
"%JSONStringify%": ["JSON", "stringify"],
"%MapPrototype%": ["Map", "prototype"],
"%NumberPrototype%": ["Number", "prototype"],
"%ObjectPrototype%": ["Object", "prototype"],
"%ObjProto_toString%": [
"Object",
"prototype",
"toString"
],
"%ObjProto_valueOf%": [
"Object",
"prototype",
"valueOf"
],
"%PromisePrototype%": ["Promise", "prototype"],
"%PromiseProto_then%": [
"Promise",
"prototype",
"then"
],
"%Promise_all%": ["Promise", "all"],
"%Promise_reject%": ["Promise", "reject"],
"%Promise_resolve%": ["Promise", "resolve"],
"%RangeErrorPrototype%": ["RangeError", "prototype"],
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
"%RegExpPrototype%": ["RegExp", "prototype"],
"%SetPrototype%": ["Set", "prototype"],
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
"%StringPrototype%": ["String", "prototype"],
"%SymbolPrototype%": ["Symbol", "prototype"],
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
"%TypeErrorPrototype%": ["TypeError", "prototype"],
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
"%URIErrorPrototype%": ["URIError", "prototype"],
"%WeakMapPrototype%": ["WeakMap", "prototype"],
"%WeakSetPrototype%": ["WeakSet", "prototype"]
}, N = require_function_bind(), B = require_hasown(), j = N.call(I, Array.prototype.concat), L = N.call(P, Array.prototype.splice), D = N.call(I, String.prototype.replace), U = N.call(I, String.prototype.slice), $ = N.call(I, RegExp.prototype.exec), F = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, J = /\\(\\)?/g, z = function(t, e) {
var r, i = t;
if (B(x, i) && (i = "%" + (r = x[i])[0] + "%"), B(q, i)) {
var n = q[i];
if (n === k && (n = T(i)), void 0 === n && !e) throw new u("intrinsic " + t + " exists, but is not available. Please file an issue!");
return {
alias: r,
name: i,
value: n
};
}
throw new h("intrinsic " + t + " does not exist!");
};
e.exports = function(t, e) {
if ("string" != typeof t || 0 === t.length) throw new u("intrinsic name must be a non-empty string");
if (arguments.length > 1 && "boolean" != typeof e) throw new u("\"allowMissing\" argument must be a boolean");
if (null === $(/^%?[^%]*%?$/, t)) throw new h("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
var r = function(t) {
var e = U(t, 0, 1), r = U(t, -1);
if ("%" === e && "%" !== r) throw new h("invalid intrinsic syntax, expected closing `%`");
if ("%" === r && "%" !== e) throw new h("invalid intrinsic syntax, expected opening `%`");
var i = [];
return D(t, F, (function(t, e, r, n) {
i[i.length] = r ? D(n, J, "$1") : e || t;
})), i;
}(t), i = r.length > 0 ? r[0] : "", n = z("%" + i + "%", e), o = n.name, s = n.value, a = !1, f = n.alias;
f && (i = f[0], L(r, j([0, 1], f)));
for (var l = 1, c = !0; l < r.length; l += 1) {
var d = r[l], p = U(d, 0, 1), m = U(d, -1);
if (("\"" === p || "'" === p || "`" === p || "\"" === m || "'" === m || "`" === m) && p !== m) throw new h("property names with quotes must have matching quotes");
if ("constructor" !== d && c || (a = !0), B(q, o = "%" + (i += "." + d) + "%")) s = q[o];
else if (null != s) {
if (!(d in s)) {
if (!e) throw new u("base intrinsic for " + t + " exists, but the property is not available.");
return;
}
if (_ && l + 1 >= r.length) {
var g = _(s, d);
s = (c = !!g) && "get" in g && !("originalValue" in g.get) ? g.get : s[d];
} else c = B(s, d), s = s[d];
c && !a && (q[o] = s);
}
}
return s;
};
})), require_call_bound = __commonJSMin(((t, e) => {
var r = require_get_intrinsic(), i = require_call_bind_apply_helpers(), n = i([r("%String.prototype.indexOf%")]);
e.exports = function(t, e) {
var o = r(t, !!e);
return "function" == typeof o && n(t, ".prototype.") > -1 ? i([o]) : o;
};
})), require_is_arguments = __commonJSMin(((t, e) => {
var r = require_shams()(), i = require_call_bound()("Object.prototype.toString"), n = function(t) {
return !(r && t && "object" == typeof t && Symbol.toStringTag in t) && "[object Arguments]" === i(t);
}, o = function(t) {
return !!n(t) || null !== t && "object" == typeof t && "length" in t && "number" == typeof t.length && t.length >= 0 && "[object Array]" !== i(t) && "callee" in t && "[object Function]" === i(t.callee);
}, s = function() {
return n(arguments);
}();
n.isLegacyArguments = o, e.exports = s ? n : o;
})), require_is_regex = __commonJSMin(((t, e) => {
var r, i = require_call_bound(), n = require_shams()(), o = require_hasown(), s = require_gopd();
if (n) {
var a = i("RegExp.prototype.exec"), h = {}, u = function() {
throw h;
}, f = {
toString: u,
valueOf: u
};
"symbol" == typeof Symbol.toPrimitive && (f[Symbol.toPrimitive] = u), r = function(t) {
if (!t || "object" != typeof t) return !1;
var e = s(t, "lastIndex");
if (!e || !o(e, "value")) return !1;
try {
a(t, f);
} catch (t) {
return t === h;
}
};
} else {
var l = i("Object.prototype.toString");
r = function(t) {
return !(!t || "object" != typeof t && "function" != typeof t) && "[object RegExp]" === l(t);
};
}
e.exports = r;
})), require_safe_regex_test = __commonJSMin(((t, e) => {
var r = require_call_bound(), i = require_is_regex(), n = r("RegExp.prototype.exec"), o = require_type();
e.exports = function(t) {
if (!i(t)) throw new o("`regex` must be a RegExp");
return function(e) {
return null !== n(t, e);
};
};
})), require_is_generator_function = __commonJSMin(((t, e) => {
var r, i = require_call_bound(), n = require_safe_regex_test()(/^\s*(?:function)?\*/), o = require_shams()(), s = require_get_proto(), a = i("Object.prototype.toString"), h = i("Function.prototype.toString");
e.exports = function(t) {
if ("function" != typeof t) return !1;
if (n(h(t))) return !0;
if (!o) return "[object GeneratorFunction]" === a(t);
if (!s) return !1;
if (void 0 === r) {
var e = function() {
if (!o) return !1;
try {
return Function("return function*() {}")();
} catch (t) {}
}();
r = !!e && s(e);
}
return s(t) === r;
};
})), require_is_callable = __commonJSMin(((t, e) => {
var r, i, n = Function.prototype.toString, o = "object" == typeof Reflect && null !== Reflect && Reflect.apply;
if ("function" == typeof o && "function" == typeof Object.defineProperty) try {
r = Object.defineProperty({}, "length", { get: function() {
throw i;
} }), i = {}, o((function() {
throw 42;
}), null, r);
} catch (t) {
t !== i && (o = null);
}
else o = null;
var s = /^\s*class\b/, a = function(t) {
try {
var e = n.call(t);
return s.test(e);
} catch (t) {
return !1;
}
}, h = function(t) {
try {
return !a(t) && (n.call(t), !0);
} catch (t) {
return !1;
}
}, u = Object.prototype.toString, f = "function" == typeof Symbol && !!Symbol.toStringTag, l = !(0 in [,]), c = function() {
return !1;
};
if ("object" == typeof document) {
var d = document.all;
u.call(d) === u.call(document.all) && (c = function(t) {
if ((l || !t) && (void 0 === t || "object" == typeof t)) try {
var e = u.call(t);
return ("[object HTMLAllCollection]" === e || "[object HTML document.all class]" === e || "[object HTMLCollection]" === e || "[object Object]" === e) && null == t("");
} catch (t) {}
return !1;
});
}
e.exports = o ? function(t) {
if (c(t)) return !0;
if (!t) return !1;
if ("function" != typeof t && "object" != typeof t) return !1;
try {
o(t, null, r);
} catch (t) {
if (t !== i) return !1;
}
return !a(t) && h(t);
} : function(t) {
if (c(t)) return !0;
if (!t) return !1;
if ("function" != typeof t && "object" != typeof t) return !1;
if (f) return h(t);
if (a(t)) return !1;
var e = u.call(t);
return !("[object Function]" !== e && "[object GeneratorFunction]" !== e && !/^\[object HTML/.test(e)) && h(t);
};
})), require_for_each = __commonJSMin(((t, e) => {
var r = require_is_callable(), i = Object.prototype.toString, n = Object.prototype.hasOwnProperty;
e.exports = function(t, e, o) {
if (!r(e)) throw new TypeError("iterator must be a function");
var s, a;
arguments.length >= 3 && (s = o), a = t, "[object Array]" === i.call(a) ? function(t, e, r) {
for (var i = 0, o = t.length; i < o; i++) n.call(t, i) && (null == r ? e(t[i], i, t) : e.call(r, t[i], i, t));
}(t, e, s) : "string" == typeof t ? function(t, e, r) {
for (var i = 0, n = t.length; i < n; i++) null == r ? e(t.charAt(i), i, t) : e.call(r, t.charAt(i), i, t);
}(t, e, s) : function(t, e, r) {
for (var i in t) n.call(t, i) && (null == r ? e(t[i], i, t) : e.call(r, t[i], i, t));
}(t, e, s);
};
})), require_possible_typed_array_names = __commonJSMin(((t, e) => {
e.exports = [
"Float16Array",
"Float32Array",
"Float64Array",
"Int8Array",
"Int16Array",
"Int32Array",
"Uint8Array",
"Uint8ClampedArray",
"Uint16Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array"
];
})), require_available_typed_arrays = __commonJSMin(((t, e) => {
init_dist();
var r = require_possible_typed_array_names(), i = "undefined" == typeof globalThis ? global : globalThis;
e.exports = function() {
for (var t = [], e = 0; e < r.length; e++) "function" == typeof i[r[e]] && (t[t.length] = r[e]);
return t;
};
})), require_define_data_property = __commonJSMin(((t, e) => {
var r = require_es_define_property(), i = require_syntax(), n = require_type(), o = require_gopd();
e.exports = function(t, e, s) {
if (!t || "object" != typeof t && "function" != typeof t) throw new n("`obj` must be an object or a function`");
if ("string" != typeof e && "symbol" != typeof e) throw new n("`property` must be a string or a symbol`");
if (arguments.length > 3 && "boolean" != typeof arguments[3] && null !== arguments[3]) throw new n("`nonEnumerable`, if provided, must be a boolean or null");
if (arguments.length > 4 && "boolean" != typeof arguments[4] && null !== arguments[4]) throw new n("`nonWritable`, if provided, must be a boolean or null");
if (arguments.length > 5 && "boolean" != typeof arguments[5] && null !== arguments[5]) throw new n("`nonConfigurable`, if provided, must be a boolean or null");
if (arguments.length > 6 && "boolean" != typeof arguments[6]) throw new n("`loose`, if provided, must be a boolean");
var a = arguments.length > 3 ? arguments[3] : null, h = arguments.length > 4 ? arguments[4] : null, u = arguments.length > 5 ? arguments[5] : null, f = arguments.length > 6 && arguments[6], l = !!o && o(t, e);
if (r) r(t, e, {
configurable: null === u && l ? l.configurable : !u,
enumerable: null === a && l ? l.enumerable : !a,
value: s,
writable: null === h && l ? l.writable : !h
});
else {
if (!f && (a || h || u)) throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
t[e] = s;
}
};
})), require_has_property_descriptors = __commonJSMin(((t, e) => {
var r = require_es_define_property(), i = function() {
return !!r;
};
i.hasArrayLengthDefineBug = function() {
if (!r) return null;
try {
return 1 !== r([], "length", { value: 1 }).length;
} catch (t) {
return !0;
}
}, e.exports = i;
})), require_set_function_length = __commonJSMin(((t, e) => {
var r = require_get_intrinsic(), i = require_define_data_property(), n = require_has_property_descriptors()(), o = require_gopd(), s = require_type(), a = r("%Math.floor%");
e.exports = function(t, e) {
if ("function" != typeof t) throw new s("`fn` is not a function");
if ("number" != typeof e || e < 0 || e > 4294967295 || a(e) !== e) throw new s("`length` must be a positive 32-bit integer");
var r = arguments.length > 2 && !!arguments[2], h = !0, u = !0;
if ("length" in t && o) {
var f = o(t, "length");
f && !f.configurable && (h = !1), f && !f.writable && (u = !1);
}
return (h || u || !r) && (n ? i(t, "length", e, !0, !0) : i(t, "length", e)), t;
};
})), require_applyBind = __commonJSMin(((t, e) => {
var r = require_function_bind(), i = require_functionApply(), n = require_actualApply();
e.exports = function() {
return n(r, i, arguments);
};
})), require_call_bind = __commonJSMin(((t, e) => {
var r = require_set_function_length(), i = require_es_define_property(), n = require_call_bind_apply_helpers(), o = require_applyBind();
e.exports = function(t) {
var e = n(arguments), i = t.length - (arguments.length - 1);
return r(e, 1 + (i > 0 ? i : 0), !0);
}, i ? i(e.exports, "apply", { value: o }) : e.exports.apply = o;
})), require_which_typed_array = __commonJSMin(((t, e) => {
init_dist();
var r = require_for_each(), i = require_available_typed_arrays(), n = require_call_bind(), o = require_call_bound(), s = require_gopd(), a = require_get_proto(), h = o("Object.prototype.toString"), u = require_shams()(), f = "undefined" == typeof globalThis ? global : globalThis, l = i(), c = o("String.prototype.slice"), d = o("Array.prototype.indexOf", !0) || function(t, e) {
for (var r = 0; r < t.length; r += 1) if (t[r] === e) return r;
return -1;
}, p = { __proto__: null };
r(l, u && s && a ? function(t) {
var e = new f[t]();
if (Symbol.toStringTag in e && a) {
var r = a(e), i = s(r, Symbol.toStringTag);
!i && r && (i = s(a(r), Symbol.toStringTag)), p["$" + t] = n(i.get);
}
} : function(t) {
var e = new f[t](), r = e.slice || e.set;
r && (p["$" + t] = n(r));
});
e.exports = function(t) {
if (!t || "object" != typeof t) return !1;
if (!u) {
var e = c(h(t), 8, -1);
return d(l, e) > -1 ? e : "Object" === e && function(t) {
var e = !1;
return r(p, (function(r, i) {
if (!e) try {
r(t), e = c(i, 1);
} catch (t) {}
})), e;
}(t);
}
return s ? function(t) {
var e = !1;
return r(p, (function(r, i) {
if (!e) try {
"$" + r(t) === i && (e = c(i, 1));
} catch (t) {}
})), e;
}(t) : null;
};
})), require_is_typed_array = __commonJSMin(((t, e) => {
var r = require_which_typed_array();
e.exports = function(t) {
return !!r(t);
};
})), require_types = __commonJSMin(((t) => {
var e = require_is_arguments(), r = require_is_generator_function(), i = require_which_typed_array(), n = require_is_typed_array();
function o(t) {
return t.call.bind(t);
}
var s = "undefined" != typeof BigInt, a = "undefined" != typeof Symbol, h = o(Object.prototype.toString), u = o(Number.prototype.valueOf), f = o(String.prototype.valueOf), l = o(Boolean.prototype.valueOf);
if (s) var c = o(BigInt.prototype.valueOf);
if (a) var d = o(Symbol.prototype.valueOf);
function p(t, e) {
if ("object" != typeof t) return !1;
try {
return e(t), !0;
} catch (t) {
return !1;
}
}
function m(t) {
return "[object Map]" === h(t);
}
function g(t) {
return "[object Set]" === h(t);
}
function y(t) {
return "[object WeakMap]" === h(t);
}
function b(t) {
return "[object WeakSet]" === h(t);
}
function v(t) {
return "[object ArrayBuffer]" === h(t);
}
function _(t) {
return "undefined" != typeof ArrayBuffer && (v.working ? v(t) : t instanceof ArrayBuffer);
}
function w(t) {
return "[object DataView]" === h(t);
}
function M(t) {
return "undefined" != typeof DataView && (w.working ? w(t) : t instanceof DataView);
}
t.isArgumentsObject = e, t.isGeneratorFunction = r, t.isTypedArray = n, t.isPromise = function(t) {
return "undefined" != typeof Promise && t instanceof Promise || null !== t && "object" == typeof t && "function" == typeof t.then && "function" == typeof t.catch;
}, t.isArrayBufferView = function(t) {
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(t) : n(t) || M(t);
}, t.isUint8Array = function(t) {
return "Uint8Array" === i(t);
}, t.isUint8ClampedArray = function(t) {
return "Uint8ClampedArray" === i(t);
}, t.isUint16Array = function(t) {
return "Uint16Array" === i(t);
}, t.isUint32Array = function(t) {
return "Uint32Array" === i(t);
}, t.isInt8Array = function(t) {
return "Int8Array" === i(t);
}, t.isInt16Array = function(t) {
return "Int16Array" === i(t);
}, t.isInt32Array = function(t) {
return "Int32Array" === i(t);
}, t.isFloat32Array = function(t) {
return "Float32Array" === i(t);
}, t.isFloat64Array = function(t) {
return "Float64Array" === i(t);
}, t.isBigInt64Array = function(t) {
return "BigInt64Array" === i(t);
}, t.isBigUint64Array = function(t) {
return "BigUint64Array" === i(t);
}, m.working = "undefined" != typeof Map && m(/* @__PURE__ */ new Map()), t.isMap = function(t) {
return "undefined" != typeof Map && (m.working ? m(t) : t instanceof Map);
}, g.working = "undefined" != typeof Set && g(/* @__PURE__ */ new Set()), t.isSet = function(t) {
return "undefined" != typeof Set && (g.working ? g(t) : t instanceof Set);
}, y.working = "undefined" != typeof WeakMap && y(/* @__PURE__ */ new WeakMap()), t.isWeakMap = function(t) {
return "undefined" != typeof WeakMap && (y.working ? y(t) : t instanceof WeakMap);
}, b.working = "undefined" != typeof WeakSet && b(/* @__PURE__ */ new WeakSet()), t.isWeakSet = function(t) {
return b(t);
}, v.working = "undefined" != typeof ArrayBuffer && v(/* @__PURE__ */ new ArrayBuffer()), t.isArrayBuffer = _, w.working = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView && w(new DataView(/* @__PURE__ */ new ArrayBuffer(1), 0, 1)), t.isDataView = M;
var S = "undefined" != typeof SharedArrayBuffer ? SharedArrayBuffer : void 0;
function E(t) {
return "[object SharedArrayBuffer]" === h(t);
}
function A(t) {
return void 0 !== S && (void 0 === E.working && (E.working = E(new S())), E.working ? E(t) : t instanceof S);
}
function C(t) {
return p(t, u);
}
function O(t) {
return p(t, f);
}
function P(t) {
return p(t, l);
}
function I(t) {
return s && p(t, c);
}
function k(t) {
return a && p(t, d);
}
t.isSharedArrayBuffer = A, t.isAsyncFunction = function(t) {
return "[object AsyncFunction]" === h(t);
}, t.isMapIterator = function(t) {
return "[object Map Iterator]" === h(t);
}, t.isSetIterator = function(t) {
return "[object Set Iterator]" === h(t);
}, t.isGeneratorObject = function(t) {
return "[object Generator]" === h(t);
}, t.isWebAssemblyCompiledModule = function(t) {
return "[object WebAssembly.Module]" === h(t);
}, t.isNumberObject = C, t.isStringObject = O, t.isBooleanObject = P, t.isBigIntObject = I, t.isSymbolObject = k, t.isBoxedPrimitive = function(t) {
return C(t) || O(t) || P(t) || I(t) || k(t);
}, t.isAnyArrayBuffer = function(t) {
return "undefined" != typeof Uint8Array && (_(t) || A(t));
}, [
"isProxy",
"isExternal",
"isModuleNamespaceObject"
].forEach((function(e) {
Object.defineProperty(t, e, {
enumerable: !1,
value: function() {
throw new Error(e + " is not supported in userland");
}
});
}));
})), require_isBufferBrowser = __commonJSMin(((t, e) => {
e.exports = function(t) {
return t && "object" == typeof t && "function" == typeof t.copy && "function" == typeof t.fill && "function" == typeof t.readUInt8;
};
})), require_util$1 = __commonJSMin(((t) => {
init_dist$2();
var e = Object.getOwnPropertyDescriptors || function(t) {
for (var e = Object.keys(t), r = {}, i = 0; i < e.length; i++) r[e[i]] = Object.getOwnPropertyDescriptor(t, e[i]);
return r;
}, r = /%[sdj%]/g;
t.format = function(t) {
if (!g(t)) {
for (var e = [], i = 0; i < arguments.length; i++) e.push(s(arguments[i]));
return e.join(" ");
}
i = 1;
for (var n = arguments, o = n.length, a = String(t).replace(r, (function(t) {
if ("%%" === t) return "%";
if (i >= o) return t;
switch (t) {
case "%s": return String(n[i++]);
case "%d": return Number(n[i++]);
case "%j": try {
return JSON.stringify(n[i++]);
} catch (t) {
return "[Circular]";
}
default: return t;
}
})), h = n[i]; i < o; h = n[++i]) p(h) || !v(h) ? a += " " + h : a += " " + s(h);
return a;
}, t.deprecate = function(e, r) {
if (void 0 !== process$1 && !0 === process$1.noDeprecation) return e;
if (void 0 === process$1) return function() {
return t.deprecate(e, r).apply(this, arguments);
};
var i = !1;
return function() {
if (!i) {
if (process$1.throwDeprecation) throw new Error(r);
process$1.traceDeprecation ? console.trace(r) : console.error(r), i = !0;
}
return e.apply(this, arguments);
};
};
var i = {}, n = /^$/;
if ({}.NODE_DEBUG) {
var o = {}.NODE_DEBUG;
o = o.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), n = new RegExp("^" + o + "$", "i");
}
function s(e, r) {
var i = {
seen: [],
stylize: h
};
return arguments.length >= 3 && (i.depth = arguments[2]), arguments.length >= 4 && (i.colors = arguments[3]), d(r) ? i.showHidden = r : r && t._extend(i, r), y(i.showHidden) && (i.showHidden = !1), y(i.depth) && (i.depth = 2), y(i.colors) && (i.colors = !1), y(i.customInspect) && (i.customInspect = !0), i.colors && (i.stylize = a), u(i, e, i.depth);
}
function a(t, e) {
var r = s.styles[e];
return r ? "\x1B[" + s.colors[r][0] + "m" + t + "\x1B[" + s.colors[r][1] + "m" : t;
}
function h(t, e) {
return t;
}
function u(e, r, i) {
if (e.customInspect && r && M(r.inspect) && r.inspect !== t.inspect && (!r.constructor || r.constructor.prototype !== r)) {
var n = r.inspect(i, e);
return g(n) || (n = u(e, n, i)), n;
}
var o = function(t, e) {
if (y(e)) return t.stylize("undefined", "undefined");
if (g(e)) {
var r = "'" + JSON.stringify(e).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, "\"") + "'";
return t.stylize(r, "string");
}
if (m(e)) return t.stylize("" + e, "number");
if (d(e)) return t.stylize("" + e, "boolean");
if (p(e)) return t.stylize("null", "null");
}(e, r);
if (o) return o;
var s = Object.keys(r), a = function(t) {
var e = {};
return t.forEach((function(t, r) {
e[t] = !0;
})), e;
}(s);
if (e.showHidden && (s = Object.getOwnPropertyNames(r)), w(r) && (s.indexOf("message") >= 0 || s.indexOf("description") >= 0)) return f(r);
if (0 === s.length) {
if (M(r)) {
var h = r.name ? ": " + r.name : "";
return e.stylize("[Function" + h + "]", "special");
}
if (b(r)) return e.stylize(RegExp.prototype.toString.call(r), "regexp");
if (_(r)) return e.stylize(Date.prototype.toString.call(r), "date");
if (w(r)) return f(r);
}
var v, S = "", E = !1, A = ["{", "}"];
return c(r) && (E = !0, A = ["[", "]"]), M(r) && (S = " [Function" + (r.name ? ": " + r.name : "") + "]"), b(r) && (S = " " + RegExp.prototype.toString.call(r)), _(r) && (S = " " + Date.prototype.toUTCString.call(r)), w(r) && (S = " " + f(r)), 0 !== s.length || E && 0 != r.length ? i < 0 ? b(r) ? e.stylize(RegExp.prototype.toString.call(r), "regexp") : e.stylize("[Object]", "special") : (e.seen.push(r), v = E ? function(t, e, r, i, n) {
for (var o = [], s = 0, a = e.length; s < a; ++s) C(e, String(s)) ? o.push(l(t, e, r, i, String(s), !0)) : o.push("");
return n.forEach((function(n) {
n.match(/^\d+$/) || o.push(l(t, e, r, i, n, !0));
})), o;
}(e, r, i, a, s) : s.map((function(t) {
return l(e, r, i, a, t, E);
})), e.seen.pop(), function(t, e, r) {
return t.reduce((function(t, e) {
return e.indexOf("\n"), t + e.replace(/\u001b\[\d\d?m/g, "").length + 1;
}), 0) > 60 ? r[0] + ("" === e ? "" : e + "\n ") + " " + t.join(",\n ") + " " + r[1] : r[0] + e + " " + t.join(", ") + " " + r[1];
}(v, S, A)) : A[0] + S + A[1];
}
function f(t) {
return "[" + Error.prototype.toString.call(t) + "]";
}
function l(t, e, r, i, n, o) {
var s, a, h = Object.getOwnPropertyDescriptor(e, n) || { value: e[n] };
if (h.get ? a = h.set ? t.stylize("[Getter/Setter]", "special") : t.stylize("[Getter]", "special") : h.set && (a = t.stylize("[Setter]", "special")), C(i, n) || (s = "[" + n + "]"), a || (t.seen.indexOf(h.value) < 0 ? (a = p(r) ? u(t, h.value, null) : u(t, h.value, r - 1)).indexOf("\n") > -1 && (a = o ? a.split("\n").map((function(t) {
return " " + t;
})).join("\n").slice(2) : "\n" + a.split("\n").map((function(t) {
return " " + t;
})).join("\n")) : a = t.stylize("[Circular]", "special")), y(s)) {
if (o && n.match(/^\d+$/)) return a;
(s = JSON.stringify("" + n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (s = s.slice(1, -1), s = t.stylize(s, "name")) : (s = s.replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'"), s = t.stylize(s, "string"));
}
return s + ": " + a;
}
function c(t) {
return Array.isArray(t);
}
function d(t) {
return "boolean" == typeof t;
}
function p(t) {
return null === t;
}
function m(t) {
return "number" == typeof t;
}
function g(t) {
return "string" == typeof t;
}
function y(t) {
return void 0 === t;
}
function b(t) {
return v(t) && "[object RegExp]" === S(t);
}
function v(t) {
return "object" == typeof t && null !== t;
}
function _(t) {
return v(t) && "[object Date]" === S(t);
}
function w(t) {
return v(t) && ("[object Error]" === S(t) || t instanceof Error);
}
function M(t) {
return "function" == typeof t;
}
function S(t) {
return Object.prototype.toString.call(t);
}
function E(t) {
return t < 10 ? "0" + t.toString(10) : t.toString(10);
}
t.debuglog = function(e) {
if (e = e.toUpperCase(), !i[e]) if (n.test(e)) {
var r = process$1.pid;
i[e] = function() {
var i = t.format.apply(t, arguments);
console.error("%s %d: %s", e, r, i);
};
} else i[e] = function() {};
return i[e];
}, t.inspect = s, s.colors = {
bold: [1, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
white: [37, 39],
grey: [90, 39],
black: [30, 39],
blue: [34, 39],
cyan: [36, 39],
green: [32, 39],
magenta: [35, 39],
red: [31, 39],
yellow: [33, 39]
}, s.styles = {
special: "cyan",
number: "yellow",
boolean: "yellow",
undefined: "grey",
null: "bold",
string: "green",
date: "magenta",
regexp: "red"
}, t.types = require_types(), t.isArray = c, t.isBoolean = d, t.isNull = p, t.isNullOrUndefined = function(t) {
return null == t;
}, t.isNumber = m, t.isString = g, t.isSymbol = function(t) {
return "symbol" == typeof t;
}, t.isUndefined = y, t.isRegExp = b, t.types.isRegExp = b, t.isObject = v, t.isDate = _, t.types.isDate = _, t.isError = w, t.types.isNativeError = w, t.isFunction = M, t.isPrimitive = function(t) {
return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" == typeof t || void 0 === t;
}, t.isBuffer = require_isBufferBrowser();
var A = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
];
function C(t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}
t.log = function() {
var e, r;
console.log("%s - %s", (r = [
E((e = /* @__PURE__ */ new Date()).getHours()),
E(e.getMinutes()),
E(e.getSeconds())
].join(":"), [
e.getDate(),
A[e.getMonth()],
r
].join(" ")), t.format.apply(t, arguments));
}, t.inherits = require_inherits_browser(), t._extend = function(t, e) {
if (!e || !v(e)) return t;
for (var r = Object.keys(e), i = r.length; i--;) t[r[i]] = e[r[i]];
return t;
};
var O = "undefined" != typeof Symbol ? Symbol("util.promisify.custom") : void 0;
function P(t, e) {
if (!t) {
var r = /* @__PURE__ */ new Error("Promise was rejected with a falsy value");
r.reason = t, t = r;
}
return e(t);
}
t.promisify = function(t) {
if ("function" != typeof t) throw new TypeError("The \"original\" argument must be of type Function");
if (O && t[O]) {
var r;
if ("function" != typeof (r = t[O])) throw new TypeError("The \"util.promisify.custom\" argument must be of type Function");
return Object.defineProperty(r, O, {
value: r,
enumerable: !1,
writable: !1,
configurable: !0
}), r;
}
function r() {
for (var e, r, i = new Promise((function(t, i) {
e = t, r = i;
})), n = [], o = 0; o < arguments.length; o++) n.push(arguments[o]);
n.push((function(t, i) {
t ? r(t) : e(i);
}));
try {
t.apply(this, n);
} catch (t) {
r(t);
}
return i;
}
return Object.setPrototypeOf(r, Object.getPrototypeOf(t)), O && Object.defineProperty(r, O, {
value: r,
enumerable: !1,
writable: !1,
configurable: !0
}), Object.defineProperties(r, e(t));
}, t.promisify.custom = O, t.callbackify = function(t) {
if ("function" != typeof t) throw new TypeError("The \"original\" argument must be of type Function");
function r() {
for (var e = [], r = 0; r < arguments.length; r++) e.push(arguments[r]);
var i = e.pop();
if ("function" != typeof i) throw new TypeError("The last argument must be of type Function");
var n = this, o = function() {
return i.apply(n, arguments);
};
t.apply(this, e).then((function(t) {
process$1.nextTick(o.bind(null, null, t));
}), (function(t) {
process$1.nextTick(P.bind(null, t, o));
}));
}
return Object.setPrototypeOf(r, Object.getPrototypeOf(t)), Object.defineProperties(r, e(t)), r;
};
})), require_buffer_list = __commonJSMin(((t, e) => {
function r(t, e) {
var r = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(t);
e && (i = i.filter((function(e) {
return Object.getOwnPropertyDescriptor(t, e).enumerable;
}))), r.push.apply(r, i);
}
return r;
}
function i(t) {
for (var e = 1; e < arguments.length; e++) {
var i = null != arguments[e] ? arguments[e] : {};
e % 2 ? r(Object(i), !0).forEach((function(e) {
n(t, e, i[e]);
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : r(Object(i)).forEach((function(e) {
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(i, e));
}));
}
return t;
}
function n(t, e, r) {
return (e = s(e)) in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t;
}
function o(t, e) {
for (var r = 0; r < e.length; r++) {
var i = e[r];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, s(i.key), i);
}
}
function s(t) {
var e = function(t, e) {
if ("object" != typeof t || null === t) return t;
var r = t[Symbol.toPrimitive];
if (void 0 !== r) {
var i = r.call(t, e || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === e ? String : Number)(t);
}(t, "string");
return "symbol" == typeof e ? e : String(e);
}
var a = require_dist().Buffer, h = require_util$1().inspect, u = h && h.custom || "inspect";
e.exports = function() {
function t() {
(function(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
})(this, t), this.head = null, this.tail = null, this.length = 0;
}
var e, r, n;
return e = t, r = [
{
key: "push",
value: function(t) {
var e = {
data: t,
next: null
};
this.length > 0 ? this.tail.next = e : this.head = e, this.tail = e, ++this.length;
}
},
{
key: "unshift",
value: function(t) {
var e = {
data: t,
next: this.head
};
0 === this.length && (this.tail = e), this.head = e, ++this.length;
}
},
{
key: "shift",
value: function() {
if (0 !== this.length) {
var t = this.head.data;
return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, t;
}
}
},
{
key: "clear",
value: function() {
this.head = this.tail = null, this.length = 0;
}
},
{
key: "join",
value: function(t) {
if (0 === this.length) return "";
for (var e = this.head, r = "" + e.data; e = e.next;) r += t + e.data;
return r;
}
},
{
key: "concat",
value: function(t) {
if (0 === this.length) return a.alloc(0);
for (var e, r, i, n = a.allocUnsafe(t >>> 0), o = this.head, s = 0; o;) e = o.data, r = n, i = s, a.prototype.copy.call(e, r, i), s += o.data.length, o = o.next;
return n;
}
},
{
key: "consume",
value: function(t, e) {
var r;
return t < this.head.data.length ? (r = this.head.data.slice(0, t), this.head.data = this.head.data.slice(t)) : r = t === this.head.data.length ? this.shift() : e ? this._getString(t) : this._getBuffer(t), r;
}
},
{
key: "first",
value: function() {
return this.head.data;
}
},
{
key: "_getString",
value: function(t) {
var e = this.head, r = 1, i = e.data;
for (t -= i.length; e = e.next;) {
var n = e.data, o = t > n.length ? n.length : t;
if (o === n.length ? i += n : i += n.slice(0, t), 0 == (t -= o)) {
o === n.length ? (++r, e.next ? this.head = e.next : this.head = this.tail = null) : (this.head = e, e.data = n.slice(o));
break;
}
++r;
}
return this.length -= r, i;
}
},
{
key: "_getBuffer",
value: function(t) {
var e = a.allocUnsafe(t), r = this.head, i = 1;
for (r.data.copy(e), t -= r.data.length; r = r.next;) {
var n = r.data, o = t > n.length ? n.length : t;
if (n.copy(e, e.length - t, 0, o), 0 == (t -= o)) {
o === n.length ? (++i, r.next ? this.head = r.next : this.head = this.tail = null) : (this.head = r, r.data = n.slice(o));
break;
}
++i;
}
return this.length -= i, e;
}
},
{
key: u,
value: function(t, e) {
return h(this, i(i({}, e), {}, {
depth: 0,
customInspect: !1
}));
}
}
], r && o(e.prototype, r), n && o(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), t;
}();
})), require_destroy$1 = __commonJSMin(((t, e) => {
function r(t, e) {
n(t, e), i(t);
}
function i(t) {
t._writableState && !t._writableState.emitClose || t._readableState && !t._readableState.emitClose || t.emit("close");
}
function n(t, e) {
t.emit("error", e);
}
init_dist$2(), e.exports = {
destroy: function(t, e) {
var o = this, s = this._readableState && this._readableState.destroyed, a = this._writableState && this._writableState.destroyed;
return s || a ? (e ? e(t) : t && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process$1.nextTick(n, this, t)) : process$1.nextTick(n, this, t)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(t || null, (function(t) {
!e && t ? o._writableState ? o._writableState.errorEmitted ? process$1.nextTick(i, o) : (o._writableState.errorEmitted = !0, process$1.nextTick(r, o, t)) : process$1.nextTick(r, o, t) : e ? (process$1.nextTick(i, o), e(t)) : process$1.nextTick(i, o);
})), this);
},
undestroy: function() {
this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
},
errorOrDestroy: function(t, e) {
var r = t._readableState, i = t._writableState;
r && r.autoDestroy || i && i.autoDestroy ? t.destroy(e) : t.emit("error", e);
}
};
})), require_errors_browser = __commonJSMin(((t, e) => {
var r = {};
function i(t, e, i) {
i || (i = Error);
var n = function(t) {
var r, i;
function n(r, i, n) {
return t.call(this, function(t, r, i) {
return "string" == typeof e ? e : e(t, r, i);
}(r, i, n)) || this;
}
return i = t, (r = n).prototype = Object.create(i.prototype), r.prototype.constructor = r, r.__proto__ = i, n;
}(i);
n.prototype.name = i.name, n.prototype.code = t, r[t] = n;
}
function n(t, e) {
if (Array.isArray(t)) {
var r = t.length;
return t = t.map((function(t) {
return String(t);
})), r > 2 ? "one of ".concat(e, " ").concat(t.slice(0, r - 1).join(", "), ", or ") + t[r - 1] : 2 === r ? "one of ".concat(e, " ").concat(t[0], " or ").concat(t[1]) : "of ".concat(e, " ").concat(t[0]);
}
return "of ".concat(e, " ").concat(String(t));
}
i("ERR_INVALID_OPT_VALUE", (function(t, e) {
return "The value \"" + e + "\" is invalid for option \"" + t + "\"";
}), TypeError), i("ERR_INVALID_ARG_TYPE", (function(t, e, r) {
var i, o, s, a;
if ("string" == typeof e && (o = "not ", e.substr(!s || s < 0 ? 0 : +s, o.length) === o) ? (i = "must not be", e = e.replace(/^not /, "")) : i = "must be", function(t, e, r) {
return (void 0 === r || r > t.length) && (r = t.length), t.substring(r - e.length, r) === e;
}(t, " argument")) a = "The ".concat(t, " ").concat(i, " ").concat(n(e, "type"));
else {
var h = function(t, e, r) {
return "number" != typeof r && (r = 0), !(r + e.length > t.length) && -1 !== t.indexOf(e, r);
}(t, ".") ? "property" : "argument";
a = "The \"".concat(t, "\" ").concat(h, " ").concat(i, " ").concat(n(e, "type"));
}
return a += ". Received type ".concat(typeof r);
}), TypeError), i("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), i("ERR_METHOD_NOT_IMPLEMENTED", (function(t) {
return "The " + t + " method is not implemented";
})), i("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), i("ERR_STREAM_DESTROYED", (function(t) {
return "Cannot call " + t + " after a stream was destroyed";
})), i("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), i("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), i("ERR_STREAM_WRITE_AFTER_END", "write after end"), i("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), i("ERR_UNKNOWN_ENCODING", (function(t) {
return "Unknown encoding: " + t;
}), TypeError), i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), e.exports.codes = r;
})), require_state = __commonJSMin(((t, e) => {
var r = require_errors_browser().codes.ERR_INVALID_OPT_VALUE;
e.exports = { getHighWaterMark: function(t, e, i, n) {
var o = function(t, e, r) {
return null != t.highWaterMark ? t.highWaterMark : e ? t[r] : null;
}(e, n, i);
if (null != o) {
if (!isFinite(o) || Math.floor(o) !== o || o < 0) throw new r(n ? i : "highWaterMark", o);
return Math.floor(o);
}
return t.objectMode ? 16 : 16384;
} };
})), require_browser$12 = __commonJSMin(((t, e) => {
function r(t) {
try {
if (!global.localStorage) return !1;
} catch (t) {
return !1;
}
var e = global.localStorage[t];
return null != e && "true" === String(e).toLowerCase();
}
init_dist(), e.exports = function(t, e) {
if (r("noDeprecation")) return t;
var i = !1;
return function() {
if (!i) {
if (r("throwDeprecation")) throw new Error(e);
r("traceDeprecation") ? console.trace(e) : console.warn(e), i = !0;
}
return t.apply(this, arguments);
};
};
})), require__stream_writable$1 = __commonJSMin(((t, e) => {
function r(t) {
var e = this;
this.next = null, this.entry = null, this.finish = function() {
(function(t, e, r) {
var i = t.entry;
t.entry = null;
for (; i;) {
var n = i.callback;
e.pendingcb--, n(r), i = i.next;
}
e.corkedRequestsFree.next = t;
})(e, t);
};
}
var i;
init_dist(), init_dist$2(), e.exports = S, S.WritableState = M;
var n = { deprecate: require_browser$12() }, o = require_stream_browser$1(), s = require_dist().Buffer, a = (void 0 !== global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() {};
var h, u = require_destroy$1(), f = require_state().getHighWaterMark, l = require_errors_browser().codes, c = l.ERR_INVALID_ARG_TYPE, d = l.ERR_METHOD_NOT_IMPLEMENTED, p = l.ERR_MULTIPLE_CALLBACK, m = l.ERR_STREAM_CANNOT_PIPE, g = l.ERR_STREAM_DESTROYED, y = l.ERR_STREAM_NULL_VALUES, b = l.ERR_STREAM_WRITE_AFTER_END, v = l.ERR_UNKNOWN_ENCODING, _ = u.errorOrDestroy;
function w() {}
function M(t, e, n) {
i = i || require__stream_duplex$1(), t = t || {}, "boolean" != typeof n && (n = e instanceof i), this.objectMode = !!t.objectMode, n && (this.objectMode = this.objectMode || !!t.writableObjectMode), this.highWaterMark = f(this, t, "writableHighWaterMark", n), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
var o = !1 === t.decodeStrings;
this.decodeStrings = !o, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(t) {
(function(t, e) {
var r = t._writableState, i = r.sync, n = r.writecb;
if ("function" != typeof n) throw new p();
if (function(t) {
t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;
}(r), e) (function(t, e, r, i, n) {
--e.pendingcb, r ? (process$1.nextTick(n, i), process$1.nextTick(I, t, e), t._writableState.errorEmitted = !0, _(t, i)) : (n(i), t._writableState.errorEmitted = !0, _(t, i), I(t, e));
})(t, r, i, e, n);
else {
var o = O(r) || t.destroyed;
o || r.corked || r.bufferProcessing || !r.bufferedRequest || C(t, r), i ? process$1.nextTick(A, t, r, o, n) : A(t, r, o, n);
}
})(e, t);
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !1 !== t.emitClose, this.autoDestroy = !!t.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new r(this);
}
function S(t) {
var e = this instanceof (i = i || require__stream_duplex$1());
if (!e && !h.call(S, this)) return new S(t);
this._writableState = new M(t, this, e), this.writable = !0, t && ("function" == typeof t.write && (this._write = t.write), "function" == typeof t.writev && (this._writev = t.writev), "function" == typeof t.destroy && (this._destroy = t.destroy), "function" == typeof t.final && (this._final = t.final)), o.call(this);
}
function E(t, e, r, i, n, o, s) {
e.writelen = i, e.writecb = s, e.writing = !0, e.sync = !0, e.destroyed ? e.onwrite(new g("write")) : r ? t._writev(n, e.onwrite) : t._write(n, o, e.onwrite), e.sync = !1;
}
function A(t, e, r, i) {
r || function(t, e) {
0 === e.length && e.needDrain && (e.needDrain = !1, t.emit("drain"));
}(t, e), e.pendingcb--, i(), I(t, e);
}
function C(t, e) {
e.bufferProcessing = !0;
var i = e.bufferedRequest;
if (t._writev && i && i.next) {
var n = e.bufferedRequestCount, o = new Array(n), s = e.corkedRequestsFree;
s.entry = i;
for (var a = 0, h = !0; i;) o[a] = i, i.isBuf || (h = !1), i = i.next, a += 1;
o.allBuffers = h, E(t, e, !0, e.length, o, "", s.finish), e.pendingcb++, e.lastBufferedRequest = null, s.next ? (e.corkedRequestsFree = s.next, s.next = null) : e.corkedRequestsFree = new r(e), e.bufferedRequestCount = 0;
} else {
for (; i;) {
var u = i.chunk, f = i.encoding, l = i.callback;
if (E(t, e, !1, e.objectMode ? 1 : u.length, u, f, l), i = i.next, e.bufferedRequestCount--, e.writing) break;
}
null === i && (e.lastBufferedRequest = null);
}
e.bufferedRequest = i, e.bufferProcessing = !1;
}
function O(t) {
return t.ending && 0 === t.length && null === t.bufferedRequest && !t.finished && !t.writing;
}
function P(t, e) {
t._final((function(r) {
e.pendingcb--, r && _(t, r), e.prefinished = !0, t.emit("prefinish"), I(t, e);
}));
}
function I(t, e) {
var r = O(e);
if (r && (function(t, e) {
e.prefinished || e.finalCalled || ("function" != typeof t._final || e.destroyed ? (e.prefinished = !0, t.emit("prefinish")) : (e.pendingcb++, e.finalCalled = !0, process$1.nextTick(P, t, e)));
}(t, e), 0 === e.pendingcb && (e.finished = !0, t.emit("finish"), e.autoDestroy))) {
var i = t._readableState;
(!i || i.autoDestroy && i.endEmitted) && t.destroy();
}
return r;
}
require_inherits_browser()(S, o), M.prototype.getBuffer = function() {
for (var t = this.bufferedRequest, e = []; t;) e.push(t), t = t.next;
return e;
}, function() {
try {
Object.defineProperty(M.prototype, "buffer", { get: n.deprecate((function() {
return this.getBuffer();
}), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") });
} catch (t) {}
}(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (h = Function.prototype[Symbol.hasInstance], Object.defineProperty(S, Symbol.hasInstance, { value: function(t) {
return !!h.call(this, t) || this === S && t && t._writableState instanceof M;
} })) : h = function(t) {
return t instanceof this;
}, S.prototype.pipe = function() {
_(this, new m());
}, S.prototype.write = function(t, e, r) {
var i, n = this._writableState, o = !1, h = !n.objectMode && (i = t, s.isBuffer(i) || i instanceof a);
return h && !s.isBuffer(t) && (t = function(t) {
return s.from(t);
}(t)), "function" == typeof e && (r = e, e = null), h ? e = "buffer" : e || (e = n.defaultEncoding), "function" != typeof r && (r = w), n.ending ? function(t, e) {
var r = new b();
_(t, r), process$1.nextTick(e, r);
}(this, r) : (h || function(t, e, r, i) {
var n;
return null === r ? n = new y() : "string" == typeof r || e.objectMode || (n = new c("chunk", ["string", "Buffer"], r)), !n || (_(t, n), process$1.nextTick(i, n), !1);
}(this, n, t, r)) && (n.pendingcb++, o = function(t, e, r, i, n, o) {
if (!r) {
var a = function(t, e, r) {
t.objectMode || !1 === t.decodeStrings || "string" != typeof e || (e = s.from(e, r));
return e;
}(e, i, n);
i !== a && (r = !0, n = "buffer", i = a);
}
var h = e.objectMode ? 1 : i.length;
e.length += h;
var u = e.length < e.highWaterMark;
u || (e.needDrain = !0);
if (e.writing || e.corked) {
var f = e.lastBufferedRequest;
e.lastBufferedRequest = {
chunk: i,
encoding: n,
isBuf: r,
callback: o,
next: null
}, f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
} else E(t, e, !1, h, i, n, o);
return u;
}(this, n, h, t, e, r)), o;
}, S.prototype.cork = function() {
this._writableState.corked++;
}, S.prototype.uncork = function() {
var t = this._writableState;
t.corked && (t.corked--, t.writing || t.corked || t.bufferProcessing || !t.bufferedRequest || C(this, t));
}, S.prototype.setDefaultEncoding = function(t) {
if ("string" == typeof t && (t = t.toLowerCase()), !([
"hex",
"utf8",
"utf-8",
"ascii",
"binary",
"base64",
"ucs2",
"ucs-2",
"utf16le",
"utf-16le",
"raw"
].indexOf((t + "").toLowerCase()) > -1)) throw new v(t);
return this._writableState.defaultEncoding = t, this;
}, Object.defineProperty(S.prototype, "writableBuffer", {
enumerable: !1,
get: function() {
return this._writableState && this._writableState.getBuffer();
}
}), Object.defineProperty(S.prototype, "writableHighWaterMark", {
enumerable: !1,
get: function() {
return this._writableState.highWaterMark;
}
}), S.prototype._write = function(t, e, r) {
r(new d("_write()"));
}, S.prototype._writev = null, S.prototype.end = function(t, e, r) {
var i = this._writableState;
return "function" == typeof t ? (r = t, t = null, e = null) : "function" == typeof e && (r = e, e = null), null != t && this.write(t, e), i.corked && (i.corked = 1, this.uncork()), i.ending || function(t, e, r) {
e.ending = !0, I(t, e), r && (e.finished ? process$1.nextTick(r) : t.once("finish", r));
e.ended = !0, t.writable = !1;
}(this, i, r), this;
}, Object.defineProperty(S.prototype, "writableLength", {
enumerable: !1,
get: function() {
return this._writableState.length;
}
}), Object.defineProperty(S.prototype, "destroyed", {
enumerable: !1,
get: function() {
return void 0 !== this._writableState && this._writableState.destroyed;
},
set: function(t) {
this._writableState && (this._writableState.destroyed = t);
}
}), S.prototype.destroy = u.destroy, S.prototype._undestroy = u.undestroy, S.prototype._destroy = function(t, e) {
e(t);
};
})), require__stream_duplex$1 = __commonJSMin(((t, e) => {
init_dist$2();
var r = Object.keys || function(t) {
var e = [];
for (var r in t) e.push(r);
return e;
};
e.exports = h;
var i = require__stream_readable$1(), n = require__stream_writable$1();
require_inherits_browser()(h, i);
for (var o = r(n.prototype), s = 0; s < o.length; s++) {
var a = o[s];
h.prototype[a] || (h.prototype[a] = n.prototype[a]);
}
function h(t) {
if (!(this instanceof h)) return new h(t);
i.call(this, t), n.call(this, t), this.allowHalfOpen = !0, t && (!1 === t.readable && (this.readable = !1), !1 === t.writable && (this.writable = !1), !1 === t.allowHalfOpen && (this.allowHalfOpen = !1, this.once("end", u)));
}
function u() {
this._writableState.ended || process$1.nextTick(f, this);
}
function f(t) {
t.end();
}
Object.defineProperty(h.prototype, "writableHighWaterMark", {
enumerable: !1,
get: function() {
return this._writableState.highWaterMark;
}
}), Object.defineProperty(h.prototype, "writableBuffer", {
enumerable: !1,
get: function() {
return this._writableState && this._writableState.getBuffer();
}
}), Object.defineProperty(h.prototype, "writableLength", {
enumerable: !1,
get: function() {
return this._writableState.length;
}
}), Object.defineProperty(h.prototype, "destroyed", {
enumerable: !1,
get: function() {
return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed;
},
set: function(t) {
void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = t, this._writableState.destroyed = t);
}
});
})), require_safe_buffer$10 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_string_decoder = __commonJSMin(((t) => {
var e = require_safe_buffer$10().Buffer, r = e.isEncoding || function(t) {
switch ((t = "" + t) && t.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 !0;
default: return !1;
}
};
function i(t) {
var i;
switch (this.encoding = function(t) {
var i = function(t) {
if (!t) return "utf8";
for (var e;;) switch (t) {
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 t;
default:
if (e) return;
t = ("" + t).toLowerCase(), e = !0;
}
}(t);
if ("string" != typeof i && (e.isEncoding === r || !r(t))) throw new Error("Unknown encoding: " + t);
return i || t;
}(t), this.encoding) {
case "utf16le":
this.text = s, this.end = a, i = 4;
break;
case "utf8":
this.fillLast = o, i = 4;
break;
case "base64":
this.text = h, this.end = u, i = 3;
break;
default:
this.write = f, this.end = l;
return;
}
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = e.allocUnsafe(i);
}
function n(t) {
return t <= 127 ? 0 : t >> 5 == 6 ? 2 : t >> 4 == 14 ? 3 : t >> 3 == 30 ? 4 : t >> 6 == 2 ? -1 : -2;
}
function o(t) {
var e = this.lastTotal - this.lastNeed, r = function(t, e) {
if (128 != (192 & e[0])) return t.lastNeed = 0, "�";
if (t.lastNeed > 1 && e.length > 1) {
if (128 != (192 & e[1])) return t.lastNeed = 1, "�";
if (t.lastNeed > 2 && e.length > 2 && 128 != (192 & e[2])) return t.lastNeed = 2, "�";
}
}(this, t);
return void 0 !== r ? r : this.lastNeed <= t.length ? (t.copy(this.lastChar, e, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (t.copy(this.lastChar, e, 0, t.length), void (this.lastNeed -= t.length));
}
function s(t, e) {
if ((t.length - e) % 2 == 0) {
var r = t.toString("utf16le", e);
if (r) {
var i = r.charCodeAt(r.length - 1);
if (i >= 55296 && i <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = t[t.length - 2], this.lastChar[1] = t[t.length - 1], r.slice(0, -1);
}
return r;
}
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = t[t.length - 1], t.toString("utf16le", e, t.length - 1);
}
function a(t) {
var e = t && t.length ? this.write(t) : "";
if (this.lastNeed) {
var r = this.lastTotal - this.lastNeed;
return e + this.lastChar.toString("utf16le", 0, r);
}
return e;
}
function h(t, e) {
var r = (t.length - e) % 3;
return 0 === r ? t.toString("base64", e) : (this.lastNeed = 3 - r, this.lastTotal = 3, 1 === r ? this.lastChar[0] = t[t.length - 1] : (this.lastChar[0] = t[t.length - 2], this.lastChar[1] = t[t.length - 1]), t.toString("base64", e, t.length - r));
}
function u(t) {
var e = t && t.length ? this.write(t) : "";
return this.lastNeed ? e + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : e;
}
function f(t) {
return t.toString(this.encoding);
}
function l(t) {
return t && t.length ? this.write(t) : "";
}
t.StringDecoder = i, i.prototype.write = function(t) {
if (0 === t.length) return "";
var e, r;
if (this.lastNeed) {
if (void 0 === (e = this.fillLast(t))) return "";
r = this.lastNeed, this.lastNeed = 0;
} else r = 0;
return r < t.length ? e ? e + this.text(t, r) : this.text(t, r) : e || "";
}, i.prototype.end = function(t) {
var e = t && t.length ? this.write(t) : "";
return this.lastNeed ? e + "�" : e;
}, i.prototype.text = function(t, e) {
var r = function(t, e, r) {
var i = e.length - 1;
if (i < r) return 0;
var o = n(e[i]);
if (o >= 0) return o > 0 && (t.lastNeed = o - 1), o;
if (--i < r || -2 === o) return 0;
if (o = n(e[i]), o >= 0) return o > 0 && (t.lastNeed = o - 2), o;
if (--i < r || -2 === o) return 0;
if (o = n(e[i]), o >= 0) return o > 0 && (2 === o ? o = 0 : t.lastNeed = o - 3), o;
return 0;
}(this, t, e);
if (!this.lastNeed) return t.toString("utf8", e);
this.lastTotal = r;
var i = t.length - (r - this.lastNeed);
return t.copy(this.lastChar, 0, i), t.toString("utf8", e, i);
}, i.prototype.fillLast = function(t) {
if (this.lastNeed <= t.length) return t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length), this.lastNeed -= t.length;
};
})), require_end_of_stream = __commonJSMin(((t, e) => {
var r = require_errors_browser().codes.ERR_STREAM_PREMATURE_CLOSE;
function i() {}
e.exports = function t(e, n, o) {
if ("function" == typeof n) return t(e, null, n);
n || (n = {}), o = function(t) {
var e = !1;
return function() {
if (!e) {
e = !0;
for (var r = arguments.length, i = new Array(r), n = 0; n < r; n++) i[n] = arguments[n];
t.apply(this, i);
}
};
}(o || i);
var s = n.readable || !1 !== n.readable && e.readable, a = n.writable || !1 !== n.writable && e.writable, h = function() {
e.writable || f();
}, u = e._writableState && e._writableState.finished, f = function() {
a = !1, u = !0, s || o.call(e);
}, l = e._readableState && e._readableState.endEmitted, c = function() {
s = !1, l = !0, a || o.call(e);
}, d = function(t) {
o.call(e, t);
}, p = function() {
var t;
return s && !l ? (e._readableState && e._readableState.ended || (t = new r()), o.call(e, t)) : a && !u ? (e._writableState && e._writableState.ended || (t = new r()), o.call(e, t)) : void 0;
}, m = function() {
e.req.on("finish", f);
};
return !function(t) {
return t.setHeader && "function" == typeof t.abort;
}(e) ? a && !e._writableState && (e.on("end", h), e.on("close", h)) : (e.on("complete", f), e.on("abort", p), e.req ? m() : e.on("request", m)), e.on("end", c), e.on("finish", f), !1 !== n.error && e.on("error", d), e.on("close", p), function() {
e.removeListener("complete", f), e.removeListener("abort", p), e.removeListener("request", m), e.req && e.req.removeListener("finish", f), e.removeListener("end", h), e.removeListener("close", h), e.removeListener("finish", f), e.removeListener("end", c), e.removeListener("error", d), e.removeListener("close", p);
};
};
})), require_async_iterator = __commonJSMin(((t, e) => {
var r;
function i(t, e, r) {
return (e = function(t) {
var e = function(t, e) {
if ("object" != typeof t || null === t) return t;
var r = t[Symbol.toPrimitive];
if (void 0 !== r) {
var i = r.call(t, e || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === e ? String : Number)(t);
}(t, "string");
return "symbol" == typeof e ? e : String(e);
}(e)) in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t;
}
init_dist$2();
var n = require_end_of_stream(), o = Symbol("lastResolve"), s = Symbol("lastReject"), a = Symbol("error"), h = Symbol("ended"), u = Symbol("lastPromise"), f = Symbol("handlePromise"), l = Symbol("stream");
function c(t, e) {
return {
value: t,
done: e
};
}
function d(t) {
var e = t[o];
if (null !== e) {
var r = t[l].read();
null !== r && (t[u] = null, t[o] = null, t[s] = null, e(c(r, !1)));
}
}
function p(t) {
process$1.nextTick(d, t);
}
var m = Object.getPrototypeOf((function() {})), g = Object.setPrototypeOf((i(r = {
get stream() {
return this[l];
},
next: function() {
var t = this, e = this[a];
if (null !== e) return Promise.reject(e);
if (this[h]) return Promise.resolve(c(void 0, !0));
if (this[l].destroyed) return new Promise((function(e, r) {
process$1.nextTick((function() {
t[a] ? r(t[a]) : e(c(void 0, !0));
}));
}));
var r, i = this[u];
if (i) r = new Promise(function(t, e) {
return function(r, i) {
t.then((function() {
e[h] ? r(c(void 0, !0)) : e[f](r, i);
}), i);
};
}(i, this));
else {
var n = this[l].read();
if (null !== n) return Promise.resolve(c(n, !1));
r = new Promise(this[f]);
}
return this[u] = r, r;
}
}, Symbol.asyncIterator, (function() {
return this;
})), i(r, "return", (function() {
var t = this;
return new Promise((function(e, r) {
t[l].destroy(null, (function(t) {
t ? r(t) : e(c(void 0, !0));
}));
}));
})), r), m);
e.exports = function(t) {
var e, r = Object.create(g, (i(e = {}, l, {
value: t,
writable: !0
}), i(e, o, {
value: null,
writable: !0
}), i(e, s, {
value: null,
writable: !0
}), i(e, a, {
value: null,
writable: !0
}), i(e, h, {
value: t._readableState.endEmitted,
writable: !0
}), i(e, f, {
value: function(t, e) {
var i = r[l].read();
i ? (r[u] = null, r[o] = null, r[s] = null, t(c(i, !1))) : (r[o] = t, r[s] = e);
},
writable: !0
}), e));
return r[u] = null, n(t, (function(t) {
if (t && "ERR_STREAM_PREMATURE_CLOSE" !== t.code) {
var e = r[s];
null !== e && (r[u] = null, r[o] = null, r[s] = null, e(t)), r[a] = t;
return;
}
var i = r[o];
null !== i && (r[u] = null, r[o] = null, r[s] = null, i(c(void 0, !0))), r[h] = !0;
})), t.on("readable", p.bind(null, r)), r;
};
})), require_from_browser = __commonJSMin(((t, e) => {
e.exports = function() {
throw new Error("Readable.from is not available in the browser");
};
})), require__stream_readable$1 = __commonJSMin(((t, e) => {
var r;
init_dist(), init_dist$2(), e.exports = S, S.ReadableState = M, require_events().EventEmitter;
var i = function(t, e) {
return t.listeners(e).length;
}, n = require_stream_browser$1(), o = require_dist().Buffer, s = (void 0 !== global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() {};
var a, h = require_util$1();
a = h && h.debuglog ? h.debuglog("stream") : function() {};
var u, f, l, c = require_buffer_list(), d = require_destroy$1(), p = require_state().getHighWaterMark, m = require_errors_browser().codes, g = m.ERR_INVALID_ARG_TYPE, y = m.ERR_STREAM_PUSH_AFTER_EOF, b = m.ERR_METHOD_NOT_IMPLEMENTED, v = m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
require_inherits_browser()(S, n);
var _ = d.errorOrDestroy, w = [
"error",
"close",
"destroy",
"pause",
"resume"
];
function M(t, e, i) {
r = r || require__stream_duplex$1(), t = t || {}, "boolean" != typeof i && (i = e instanceof r), this.objectMode = !!t.objectMode, i && (this.objectMode = this.objectMode || !!t.readableObjectMode), this.highWaterMark = p(this, t, "readableHighWaterMark", i), this.buffer = new c(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = !1 !== t.emitClose, this.autoDestroy = !!t.autoDestroy, this.destroyed = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (u || (u = require_string_decoder().StringDecoder), this.decoder = new u(t.encoding), this.encoding = t.encoding);
}
function S(t) {
if (r = r || require__stream_duplex$1(), !(this instanceof S)) return new S(t);
var e = this instanceof r;
this._readableState = new M(t, this, e), this.readable = !0, t && ("function" == typeof t.read && (this._read = t.read), "function" == typeof t.destroy && (this._destroy = t.destroy)), n.call(this);
}
function E(t, e, r, i, n) {
a("readableAddChunk", e);
var h, u = t._readableState;
if (null === e) u.reading = !1, function(t, e) {
if (a("onEofChunk"), e.ended) return;
if (e.decoder) {
var r = e.decoder.end();
r && r.length && (e.buffer.push(r), e.length += e.objectMode ? 1 : r.length);
}
e.ended = !0, e.sync ? P(t) : (e.needReadable = !1, e.emittedReadable || (e.emittedReadable = !0, I(t)));
}(t, u);
else if (n || (h = function(t, e) {
var r;
i = e, o.isBuffer(i) || i instanceof s || "string" == typeof e || void 0 === e || t.objectMode || (r = new g("chunk", [
"string",
"Buffer",
"Uint8Array"
], e));
var i;
return r;
}(u, e)), h) _(t, h);
else if (u.objectMode || e && e.length > 0) if ("string" == typeof e || u.objectMode || Object.getPrototypeOf(e) === o.prototype || (e = function(t) {
return o.from(t);
}(e)), i) u.endEmitted ? _(t, new v()) : A(t, u, e, !0);
else if (u.ended) _(t, new y());
else {
if (u.destroyed) return !1;
u.reading = !1, u.decoder && !r ? (e = u.decoder.write(e), u.objectMode || 0 !== e.length ? A(t, u, e, !1) : k(t, u)) : A(t, u, e, !1);
}
else i || (u.reading = !1, k(t, u));
return !u.ended && (u.length < u.highWaterMark || 0 === u.length);
}
function A(t, e, r, i) {
e.flowing && 0 === e.length && !e.sync ? (e.awaitDrain = 0, t.emit("data", r)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && P(t)), k(t, e);
}
Object.defineProperty(S.prototype, "destroyed", {
enumerable: !1,
get: function() {
return void 0 !== this._readableState && this._readableState.destroyed;
},
set: function(t) {
this._readableState && (this._readableState.destroyed = t);
}
}), S.prototype.destroy = d.destroy, S.prototype._undestroy = d.undestroy, S.prototype._destroy = function(t, e) {
e(t);
}, S.prototype.push = function(t, e) {
var r, i = this._readableState;
return i.objectMode ? r = !0 : "string" == typeof t && ((e = e || i.defaultEncoding) !== i.encoding && (t = o.from(t, e), e = ""), r = !0), E(this, t, e, !1, r);
}, S.prototype.unshift = function(t) {
return E(this, t, null, !0, !1);
}, S.prototype.isPaused = function() {
return !1 === this._readableState.flowing;
}, S.prototype.setEncoding = function(t) {
u || (u = require_string_decoder().StringDecoder);
var e = new u(t);
this._readableState.decoder = e, this._readableState.encoding = this._readableState.decoder.encoding;
for (var r = this._readableState.buffer.head, i = ""; null !== r;) i += e.write(r.data), r = r.next;
return this._readableState.buffer.clear(), "" !== i && this._readableState.buffer.push(i), this._readableState.length = i.length, this;
};
var C = 1073741824;
function O(t, e) {
return t <= 0 || 0 === e.length && e.ended ? 0 : e.objectMode ? 1 : t != t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = function(t) {
return t >= C ? t = C : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
}(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
}
function P(t) {
var e = t._readableState;
a("emitReadable", e.needReadable, e.emittedReadable), e.needReadable = !1, e.emittedReadable || (a("emitReadable", e.flowing), e.emittedReadable = !0, process$1.nextTick(I, t));
}
function I(t) {
var e = t._readableState;
a("emitReadable_", e.destroyed, e.length, e.ended), e.destroyed || !e.length && !e.ended || (t.emit("readable"), e.emittedReadable = !1), e.needReadable = !e.flowing && !e.ended && e.length <= e.highWaterMark, N(t);
}
function k(t, e) {
e.readingMore || (e.readingMore = !0, process$1.nextTick(R, t, e));
}
function R(t, e) {
for (; !e.reading && !e.ended && (e.length < e.highWaterMark || e.flowing && 0 === e.length);) {
var r = e.length;
if (a("maybeReadMore read 0"), t.read(0), r === e.length) break;
}
e.readingMore = !1;
}
function q(t) {
var e = t._readableState;
e.readableListening = t.listenerCount("readable") > 0, e.resumeScheduled && !e.paused ? e.flowing = !0 : t.listenerCount("data") > 0 && t.resume();
}
function T(t) {
a("readable nexttick read 0"), t.read(0);
}
function x(t, e) {
a("resume", e.reading), e.reading || t.read(0), e.resumeScheduled = !1, t.emit("resume"), N(t), e.flowing && !e.reading && t.read(0);
}
function N(t) {
var e = t._readableState;
for (a("flow", e.flowing); e.flowing && null !== t.read(););
}
function B(t, e) {
return 0 === e.length ? null : (e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (r = e.decoder ? e.buffer.join("") : 1 === e.buffer.length ? e.buffer.first() : e.buffer.concat(e.length), e.buffer.clear()) : r = e.buffer.consume(t, e.decoder), r);
var r;
}
function j(t) {
var e = t._readableState;
a("endReadable", e.endEmitted), e.endEmitted || (e.ended = !0, process$1.nextTick(L, e, t));
}
function L(t, e) {
if (a("endReadableNT", t.endEmitted, t.length), !t.endEmitted && 0 === t.length && (t.endEmitted = !0, e.readable = !1, e.emit("end"), t.autoDestroy)) {
var r = e._writableState;
(!r || r.autoDestroy && r.finished) && e.destroy();
}
}
function D(t, e) {
for (var r = 0, i = t.length; r < i; r++) if (t[r] === e) return r;
return -1;
}
S.prototype.read = function(t) {
a("read", t), t = parseInt(t, 10);
var e = this._readableState, r = t;
if (0 !== t && (e.emittedReadable = !1), 0 === t && e.needReadable && ((0 !== e.highWaterMark ? e.length >= e.highWaterMark : e.length > 0) || e.ended)) return a("read: emitReadable", e.length, e.ended), 0 === e.length && e.ended ? j(this) : P(this), null;
if (0 === (t = O(t, e)) && e.ended) return 0 === e.length && j(this), null;
var i, n = e.needReadable;
return a("need readable", n), (0 === e.length || e.length - t < e.highWaterMark) && a("length less than watermark", n = !0), e.ended || e.reading ? a("reading or ended", n = !1) : n && (a("do read"), e.reading = !0, e.sync = !0, 0 === e.length && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = O(r, e))), null === (i = t > 0 ? B(t, e) : null) ? (e.needReadable = e.length <= e.highWaterMark, t = 0) : (e.length -= t, e.awaitDrain = 0), 0 === e.length && (e.ended || (e.needReadable = !0), r !== t && e.ended && j(this)), null !== i && this.emit("data", i), i;
}, S.prototype._read = function(t) {
_(this, new b("_read()"));
}, S.prototype.pipe = function(t, e) {
var r = this, n = this._readableState;
switch (n.pipesCount) {
case 0:
n.pipes = t;
break;
case 1:
n.pipes = [n.pipes, t];
break;
default: n.pipes.push(t);
}
n.pipesCount += 1, a("pipe count=%d opts=%j", n.pipesCount, e);
var o = e && !1 === e.end || t === process$1.stdout || t === process$1.stderr ? m : h;
function s(e, i) {
a("onunpipe"), e === r && i && !1 === i.hasUnpiped && (i.hasUnpiped = !0, a("cleanup"), t.removeListener("close", d), t.removeListener("finish", p), t.removeListener("drain", u), t.removeListener("error", c), t.removeListener("unpipe", s), r.removeListener("end", h), r.removeListener("end", m), r.removeListener("data", l), f = !0, !n.awaitDrain || t._writableState && !t._writableState.needDrain || u());
}
function h() {
a("onend"), t.end();
}
n.endEmitted ? process$1.nextTick(o) : r.once("end", o), t.on("unpipe", s);
var u = function(t) {
return function() {
var e = t._readableState;
a("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, 0 === e.awaitDrain && i(t, "data") && (e.flowing = !0, N(t));
};
}(r);
t.on("drain", u);
var f = !1;
function l(e) {
a("ondata");
var i = t.write(e);
a("dest.write", i), !1 === i && ((1 === n.pipesCount && n.pipes === t || n.pipesCount > 1 && -1 !== D(n.pipes, t)) && !f && (a("false write response, pause", n.awaitDrain), n.awaitDrain++), r.pause());
}
function c(e) {
a("onerror", e), m(), t.removeListener("error", c), 0 === i(t, "error") && _(t, e);
}
function d() {
t.removeListener("finish", p), m();
}
function p() {
a("onfinish"), t.removeListener("close", d), m();
}
function m() {
a("unpipe"), r.unpipe(t);
}
return r.on("data", l), function(t, e, r) {
if ("function" == typeof t.prependListener) return t.prependListener(e, r);
t._events && t._events[e] ? Array.isArray(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]] : t.on(e, r);
}(t, "error", c), t.once("close", d), t.once("finish", p), t.emit("pipe", r), n.flowing || (a("pipe resume"), r.resume()), t;
}, S.prototype.unpipe = function(t) {
var e = this._readableState, r = { hasUnpiped: !1 };
if (0 === e.pipesCount) return this;
if (1 === e.pipesCount) return t && t !== e.pipes || (t || (t = e.pipes), e.pipes = null, e.pipesCount = 0, e.flowing = !1, t && t.emit("unpipe", this, r)), this;
if (!t) {
var i = e.pipes, n = e.pipesCount;
e.pipes = null, e.pipesCount = 0, e.flowing = !1;
for (var o = 0; o < n; o++) i[o].emit("unpipe", this, { hasUnpiped: !1 });
return this;
}
var s = D(e.pipes, t);
return -1 === s || (e.pipes.splice(s, 1), e.pipesCount -= 1, 1 === e.pipesCount && (e.pipes = e.pipes[0]), t.emit("unpipe", this, r)), this;
}, S.prototype.on = function(t, e) {
var r = n.prototype.on.call(this, t, e), i = this._readableState;
return "data" === t ? (i.readableListening = this.listenerCount("readable") > 0, !1 !== i.flowing && this.resume()) : "readable" === t && (i.endEmitted || i.readableListening || (i.readableListening = i.needReadable = !0, i.flowing = !1, i.emittedReadable = !1, a("on readable", i.length, i.reading), i.length ? P(this) : i.reading || process$1.nextTick(T, this))), r;
}, S.prototype.addListener = S.prototype.on, S.prototype.removeListener = function(t, e) {
var r = n.prototype.removeListener.call(this, t, e);
return "readable" === t && process$1.nextTick(q, this), r;
}, S.prototype.removeAllListeners = function(t) {
var e = n.prototype.removeAllListeners.apply(this, arguments);
return "readable" !== t && void 0 !== t || process$1.nextTick(q, this), e;
}, S.prototype.resume = function() {
var t = this._readableState;
return t.flowing || (a("resume"), t.flowing = !t.readableListening, function(t, e) {
e.resumeScheduled || (e.resumeScheduled = !0, process$1.nextTick(x, t, e));
}(this, t)), t.paused = !1, this;
}, S.prototype.pause = function() {
return a("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (a("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this;
}, S.prototype.wrap = function(t) {
var e = this, r = this._readableState, i = !1;
for (var n in t.on("end", (function() {
if (a("wrapped end"), r.decoder && !r.ended) {
var t = r.decoder.end();
t && t.length && e.push(t);
}
e.push(null);
})), t.on("data", (function(n) {
a("wrapped data"), r.decoder && (n = r.decoder.write(n)), r.objectMode && null == n || (r.objectMode || n && n.length) && (e.push(n) || (i = !0, t.pause()));
})), t) void 0 === this[n] && "function" == typeof t[n] && (this[n] = function(e) {
return function() {
return t[e].apply(t, arguments);
};
}(n));
for (var o = 0; o < w.length; o++) t.on(w[o], this.emit.bind(this, w[o]));
return this._read = function(e) {
a("wrapped _read", e), i && (i = !1, t.resume());
}, this;
}, "function" == typeof Symbol && (S.prototype[Symbol.asyncIterator] = function() {
return void 0 === f && (f = require_async_iterator()), f(this);
}), Object.defineProperty(S.prototype, "readableHighWaterMark", {
enumerable: !1,
get: function() {
return this._readableState.highWaterMark;
}
}), Object.defineProperty(S.prototype, "readableBuffer", {
enumerable: !1,
get: function() {
return this._readableState && this._readableState.buffer;
}
}), Object.defineProperty(S.prototype, "readableFlowing", {
enumerable: !1,
get: function() {
return this._readableState.flowing;
},
set: function(t) {
this._readableState && (this._readableState.flowing = t);
}
}), S._fromList = B, Object.defineProperty(S.prototype, "readableLength", {
enumerable: !1,
get: function() {
return this._readableState.length;
}
}), "function" == typeof Symbol && (S.from = function(t, e) {
return void 0 === l && (l = require_from_browser()), l(S, t, e);
});
})), require__stream_transform$1 = __commonJSMin(((t, e) => {
e.exports = u;
var r = require_errors_browser().codes, i = r.ERR_METHOD_NOT_IMPLEMENTED, n = r.ERR_MULTIPLE_CALLBACK, o = r.ERR_TRANSFORM_ALREADY_TRANSFORMING, s = r.ERR_TRANSFORM_WITH_LENGTH_0, a = require__stream_duplex$1();
function h(t, e) {
var r = this._transformState;
r.transforming = !1;
var i = r.writecb;
if (null === i) return this.emit("error", new n());
r.writechunk = null, r.writecb = null, null != e && this.push(e), i(t);
var o = this._readableState;
o.reading = !1, (o.needReadable || o.length < o.highWaterMark) && this._read(o.highWaterMark);
}
function u(t) {
if (!(this instanceof u)) return new u(t);
a.call(this, t), this._transformState = {
afterTransform: h.bind(this),
needTransform: !1,
transforming: !1,
writecb: null,
writechunk: null,
writeencoding: null
}, this._readableState.needReadable = !0, this._readableState.sync = !1, t && ("function" == typeof t.transform && (this._transform = t.transform), "function" == typeof t.flush && (this._flush = t.flush)), this.on("prefinish", f);
}
function f() {
var t = this;
"function" != typeof this._flush || this._readableState.destroyed ? l(this, null, null) : this._flush((function(e, r) {
l(t, e, r);
}));
}
function l(t, e, r) {
if (e) return t.emit("error", e);
if (null != r && t.push(r), t._writableState.length) throw new s();
if (t._transformState.transforming) throw new o();
return t.push(null);
}
require_inherits_browser()(u, a), u.prototype.push = function(t, e) {
return this._transformState.needTransform = !1, a.prototype.push.call(this, t, e);
}, u.prototype._transform = function(t, e, r) {
r(new i("_transform()"));
}, u.prototype._write = function(t, e, r) {
var i = this._transformState;
if (i.writecb = r, i.writechunk = t, i.writeencoding = e, !i.transforming) {
var n = this._readableState;
(i.needTransform || n.needReadable || n.length < n.highWaterMark) && this._read(n.highWaterMark);
}
}, u.prototype._read = function(t) {
var e = this._transformState;
null === e.writechunk || e.transforming ? e.needTransform = !0 : (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform));
}, u.prototype._destroy = function(t, e) {
a.prototype._destroy.call(this, t, (function(t) {
e(t);
}));
};
})), require__stream_passthrough$1 = __commonJSMin(((t, e) => {
e.exports = i;
var r = require__stream_transform$1();
function i(t) {
if (!(this instanceof i)) return new i(t);
r.call(this, t);
}
require_inherits_browser()(i, r), i.prototype._transform = function(t, e, r) {
r(null, t);
};
})), require_pipeline = __commonJSMin(((t, e) => {
var r;
var i = require_errors_browser().codes, n = i.ERR_MISSING_ARGS, o = i.ERR_STREAM_DESTROYED;
function s(t) {
if (t) throw t;
}
function a(t) {
t();
}
function h(t, e) {
return t.pipe(e);
}
e.exports = function() {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
var u, f = function(t) {
return t.length ? "function" != typeof t[t.length - 1] ? s : t.pop() : s;
}(e);
if (Array.isArray(e[0]) && (e = e[0]), e.length < 2) throw new n("streams");
var l = e.map((function(t, i) {
var n = i < e.length - 1;
return function(t, e, i, n) {
n = function(t) {
var e = !1;
return function() {
e || (e = !0, t.apply(void 0, arguments));
};
}(n);
var s = !1;
t.on("close", (function() {
s = !0;
})), void 0 === r && (r = require_end_of_stream()), r(t, {
readable: e,
writable: i
}, (function(t) {
if (t) return n(t);
s = !0, n();
}));
var a = !1;
return function(e) {
if (!s && !a) return a = !0, function(t) {
return t.setHeader && "function" == typeof t.abort;
}(t) ? t.abort() : "function" == typeof t.destroy ? t.destroy() : void n(e || new o("pipe"));
};
}(t, n, i > 0, (function(t) {
u || (u = t), t && l.forEach(a), n || (l.forEach(a), f(u));
}));
}));
return e.reduce(h);
};
})), require_stream_browserify = __commonJSMin(((t, e) => {
e.exports = i;
var r = require_events().EventEmitter;
function i() {
r.call(this);
}
require_inherits_browser()(i, r), i.Readable = require__stream_readable$1(), i.Writable = require__stream_writable$1(), i.Duplex = require__stream_duplex$1(), i.Transform = require__stream_transform$1(), i.PassThrough = require__stream_passthrough$1(), i.finished = require_end_of_stream(), i.pipeline = require_pipeline(), i.Stream = i, i.prototype.pipe = function(t, e) {
var i = this;
function n(e) {
t.writable && !1 === t.write(e) && i.pause && i.pause();
}
function o() {
i.readable && i.resume && i.resume();
}
i.on("data", n), t.on("drain", o), t._isStdio || e && !1 === e.end || (i.on("end", a), i.on("close", h));
var s = !1;
function a() {
s || (s = !0, t.end());
}
function h() {
s || (s = !0, "function" == typeof t.destroy && t.destroy());
}
function u(t) {
if (f(), 0 === r.listenerCount(this, "error")) throw t;
}
function f() {
i.removeListener("data", n), t.removeListener("drain", o), i.removeListener("end", a), i.removeListener("close", h), i.removeListener("error", u), t.removeListener("error", u), i.removeListener("end", f), i.removeListener("close", f), t.removeListener("close", f);
}
return i.on("error", u), t.on("error", u), i.on("end", f), i.on("close", f), t.on("close", f), t.emit("pipe", i), t;
};
}));
init_dist$1();
var import_stream_browserify = __toESM(require_stream_browserify()), ParseError = class extends Error {
constructor(t, e) {
super(e), this.code = t;
let r = e;
CoreManager.get("PARSE_ERRORS").forEach(((e) => {
e.code === t && e.code && (r = e.message);
})), Object.defineProperty(this, "message", {
enumerable: !0,
value: r
});
}
toString() {
return "ParseError: " + this.code + " " + this.message;
}
static {
this.OTHER_CAUSE = -1;
}
static {
this.INTERNAL_SERVER_ERROR = 1;
}
static {
this.CONNECTION_FAILED = 100;
}
static {
this.OBJECT_NOT_FOUND = 101;
}
static {
this.INVALID_QUERY = 102;
}
static {
this.INVALID_CLASS_NAME = 103;
}
static {
this.MISSING_OBJECT_ID = 104;
}
static {
this.INVALID_KEY_NAME = 105;
}
static {
this.INVALID_POINTER = 106;
}
static {
this.INVALID_JSON = 107;
}
static {
this.COMMAND_UNAVAILABLE = 108;
}
static {
this.NOT_INITIALIZED = 109;
}
static {
this.INCORRECT_TYPE = 111;
}
static {
this.INVALID_CHANNEL_NAME = 112;
}
static {
this.PUSH_MISCONFIGURED = 115;
}
static {
this.OBJECT_TOO_LARGE = 116;
}
static {
this.OPERATION_FORBIDDEN = 119;
}
static {
this.CACHE_MISS = 120;
}
static {
this.INVALID_NESTED_KEY = 121;
}
static {
this.INVALID_FILE_NAME = 122;
}
static {
this.INVALID_ACL = 123;
}
static {
this.TIMEOUT = 124;
}
static {
this.INVALID_EMAIL_ADDRESS = 125;
}
static {
this.MISSING_CONTENT_TYPE = 126;
}
static {
this.MISSING_CONTENT_LENGTH = 127;
}
static {
this.INVALID_CONTENT_LENGTH = 128;
}
static {
this.FILE_TOO_LARGE = 129;
}
static {
this.FILE_SAVE_ERROR = 130;
}
static {
this.DUPLICATE_VALUE = 137;
}
static {
this.INVALID_ROLE_NAME = 139;
}
static {
this.EXCEEDED_QUOTA = 140;
}
static {
this.SCRIPT_FAILED = 141;
}
static {
this.VALIDATION_ERROR = 142;
}
static {
this.INVALID_IMAGE_DATA = 143;
}
static {
this.UNSAVED_FILE_ERROR = 151;
}
static {
this.INVALID_PUSH_TIME_ERROR = 152;
}
static {
this.FILE_DELETE_ERROR = 153;
}
static {
this.FILE_DELETE_UNNAMED_ERROR = 161;
}
static {
this.REQUEST_LIMIT_EXCEEDED = 155;
}
static {
this.DUPLICATE_REQUEST = 159;
}
static {
this.INVALID_EVENT_NAME = 160;
}
static {
this.INVALID_VALUE = 162;
}
static {
this.USERNAME_MISSING = 200;
}
static {
this.PASSWORD_MISSING = 201;
}
static {
this.USERNAME_TAKEN = 202;
}
static {
this.EMAIL_TAKEN = 203;
}
static {
this.EMAIL_MISSING = 204;
}
static {
this.EMAIL_NOT_FOUND = 205;
}
static {
this.SESSION_MISSING = 206;
}
static {
this.MUST_CREATE_USER_THROUGH_SIGNUP = 207;
}
static {
this.ACCOUNT_ALREADY_LINKED = 208;
}
static {
this.INVALID_SESSION_TOKEN = 209;
}
static {
this.MFA_ERROR = 210;
}
static {
this.MFA_TOKEN_REQUIRED = 211;
}
static {
this.LINKED_ID_MISSING = 250;
}
static {
this.INVALID_LINKED_SESSION = 251;
}
static {
this.UNSUPPORTED_SERVICE = 252;
}
static {
this.INVALID_SCHEMA_OPERATION = 255;
}
static {
this.AGGREGATE_ERROR = 600;
}
static {
this.FILE_READ_ERROR = 601;
}
static {
this.X_DOMAIN_REQUEST = 602;
}
}, NodeReadable;
function b64Digit(t) {
if (t < 26) return String.fromCharCode(65 + t);
if (t < 52) return String.fromCharCode(t - 26 + 97);
if (t < 62) return String.fromCharCode(t - 52 + 48);
if (62 === t) return "+";
if (63 === t) return "/";
throw new TypeError("Tried to encode large digit " + t + " in base64.");
}
var ParseFile = class t {
constructor(e, r, i, n, o) {
const s = i || "";
if (this._name = e, this._metadata = n || {}, this._tags = o || {}, void 0 !== r) if (void 0 !== Buffer$1 && Buffer$1.isBuffer(r)) this._source = {
format: "buffer",
buffer: r,
type: s
};
else if (null !== r && "object" == typeof r && "function" == typeof r.pipe && "function" == typeof r.read) this._source = {
format: "stream",
stream: r,
type: s
};
else if ("undefined" != typeof ReadableStream && r instanceof ReadableStream) this._source = {
format: "stream",
stream: r,
type: s
};
else if (Array.isArray(r) || r instanceof Uint8Array) this._data = t.encodeBase64(r), this._source = {
format: "base64",
base64: this._data,
type: s
};
else if ("undefined" != typeof Blob && r instanceof Blob) this._source = {
format: "file",
file: r,
type: s
};
else if (r && "string" == typeof r.uri && void 0 !== r.uri) this._source = {
format: "uri",
uri: r.uri,
type: s
};
else {
if (!r || "string" != typeof r.base64) throw new TypeError("Cannot create a Parse.File with that data.");
{
const t = r.base64.split(",").slice(-1)[0], e = s || r.base64.split(";").slice(0, 1)[0].split(":").slice(1, 2)[0] || "text/plain";
this._data = t, this._source = {
format: "base64",
base64: t,
type: e
};
}
}
}
async getData(t) {
if (t = t || {}, this._data) return this._data;
if ("buffer" === this._source?.format) return this._data = this._source.buffer.toString("base64"), this._data;
if (!this._url) throw new Error("Cannot retrieve data for unsaved ParseFile.");
t.requestTask = (t) => this._requestTask = t;
const e = await CoreManager.getFileController().download(this._url, t);
return this._data = e.base64, this._data;
}
name() {
return this._name;
}
url(t) {
if (t = t || {}, this._url) return t.forceSecure ? this._url.replace(/^http:\/\//i, "https://") : this._url;
}
metadata() {
return this._metadata;
}
tags() {
return this._tags;
}
directory() {
return this._directory;
}
save(t) {
(t = t || {}).requestTask = (t) => this._requestTask = t, t.metadata = this._metadata, t.tags = this._tags, t.directory = this._directory;
const e = CoreManager.getFileController();
if (!this._previousSave) if ("buffer" === this._source.format || "stream" === this._source.format) {
if ("stream" === this._source.format && !e.saveBinary) throw new Error("Cannot save a stream-based file without saveBinary support on the FileController.");
const r = this._metadata && Object.keys(this._metadata).length > 0 || this._tags && Object.keys(this._tags).length > 0 || !!this._directory;
if (!e.saveBinary || "stream" !== this._source.format && r && !t.maxUploadSize) {
if ("buffer" === this._source.format) {
const r = {
format: "base64",
base64: this._source.buffer.toString("base64"),
type: this._source.type
};
this._previousSave = e.saveBase64(this._name, r, t).then(((t) => (this._name = t.name, this._url = t.url, this._requestTask = null, this)));
}
} else this._previousSave = e.saveBinary(this._name, this._source, t).then(((t) => (this._name = t.name, this._url = t.url, this._data = null, this._requestTask = null, this)));
} else "file" === this._source.format ? this._previousSave = e.saveFile(this._name, this._source, t).then(((t) => (this._name = t.name, this._url = t.url, this._data = null, this._requestTask = null, this))) : "uri" === this._source.format ? this._previousSave = e.download(this._source.uri, t).then(((r) => {
if (!r || !r.base64) return {};
const i = {
format: "base64",
base64: r.base64,
type: r.contentType
};
return this._data = r.base64, this._requestTask = null, e.saveBase64(this._name, i, t);
})).then(((t) => (this._name = t.name, this._url = t.url, this._requestTask = null, this))) : this._previousSave = e.saveBase64(this._name, this._source, t).then(((t) => (this._name = t.name, this._url = t.url, this._requestTask = null, this)));
if (this._previousSave) return this._previousSave;
}
cancel() {
this._requestTask && "function" == typeof this._requestTask.abort && (this._requestTask._aborted = !0, this._requestTask.abort()), this._requestTask = null;
}
destroy(t = {}) {
if (!this._name) throw new ParseError(ParseError.FILE_DELETE_UNNAMED_ERROR, "Cannot delete an unnamed file.");
const e = { useMasterKey: !0 };
return Object.hasOwn(t, "useMasterKey") && (e.useMasterKey = !!t.useMasterKey), CoreManager.getFileController().deleteFile(this._name, e).then((() => (this._data = void 0, this._requestTask = null, this)));
}
toJSON() {
return {
__type: "File",
name: this._name,
url: this._url
};
}
equals(e) {
return this === e || e instanceof t && this.name() === e.name() && this.url() === e.url() && void 0 !== this.url();
}
setMetadata(t) {
t && "object" == typeof t && Object.keys(t).forEach(((e) => {
this.addMetadata(e, t[e]);
}));
}
addMetadata(t, e) {
"string" == typeof t && (this._metadata[t] = e);
}
setTags(t) {
t && "object" == typeof t && Object.keys(t).forEach(((e) => {
this.addTag(e, t[e]);
}));
}
addTag(t, e) {
"string" == typeof t && (this._tags[t] = e);
}
setDirectory(t) {
"string" == typeof t && t.length > 0 && (this._directory = t);
}
static fromJSON(e) {
if ("File" !== e.__type) throw new TypeError("JSON object does not represent a ParseFile");
const r = new t(e.name);
return r._url = e.url, r;
}
static encodeBase64(t) {
const e = [];
e.length = Math.ceil(t.length / 3);
for (let r = 0; r < e.length; r++) {
const i = t[3 * r], n = t[3 * r + 1] || 0, o = t[3 * r + 2] || 0, s = 3 * r + 1 < t.length, a = 3 * r + 2 < t.length;
e[r] = [
b64Digit(i >> 2 & 63),
b64Digit(i << 4 & 48 | n >> 4 & 15),
s ? b64Digit(n << 2 & 60 | o >> 6 & 3) : "=",
a ? b64Digit(63 & o) : "="
].join("");
}
return e.join("");
}
}, DefaultController$3 = {
saveFile: async function(t, e, r) {
if ("file" !== e.format) throw new Error("saveFile can only be used with File-type sources.");
const [i, n] = (await new Promise(((t, r) => {
const i = new FileReader();
i.onload = () => t(i.result), i.onerror = (t) => r(t), i.readAsDataURL(e.file);
}))).split(","), o = {
format: "base64",
base64: n || i,
type: e.type || (e.file ? e.file.type : void 0)
};
return await DefaultController$3.saveBase64(t, o, r);
},
saveBase64: function(t, e, r = {}) {
if ("base64" !== e.format) throw new Error("saveBase64 can only be used with Base64-type sources.");
const i = {
base64: e.base64,
fileData: {
metadata: { ...r.metadata },
tags: { ...r.tags },
...r.directory ? { directory: r.directory } : {}
}
};
delete r.metadata, delete r.tags, delete r.directory, e.type && (i._ContentType = e.type);
const n = "files/" + t;
return CoreManager.getRESTController().request("POST", n, i, r);
},
saveBinary: async function(t, e, r = {}) {
if ("buffer" !== e.format && "stream" !== e.format) throw new Error("saveBinary can only be used with Buffer or Stream sources.");
const i = {
"X-Parse-Application-ID": CoreManager.get("APPLICATION_ID"),
"X-Parse-Upload-Mode": "stream"
};
i["Content-Type"] = (e.type || "application/octet-stream").replace(/[\r\n]/g, ""), r.directory && (i["X-Parse-File-Directory"] = r.directory.replace(/[\r\n]/g, "")), r.metadata && Object.keys(r.metadata).length > 0 && (i["X-Parse-File-Metadata"] = JSON.stringify(r.metadata)), r.tags && Object.keys(r.tags).length > 0 && (i["X-Parse-File-Tags"] = JSON.stringify(r.tags)), r.maxUploadSize && (i["X-Parse-File-Max-Upload-Size"] = r.maxUploadSize.replace(/[\r\n]/g, ""));
const n = CoreManager.get("JAVASCRIPT_KEY");
n && (i["X-Parse-JavaScript-Key"] = n);
let o, s = r.useMasterKey;
if (void 0 === s && (s = CoreManager.get("USE_MASTER_KEY")), s) {
if (!CoreManager.get("MASTER_KEY")) throw new Error("Cannot use the Master Key, it has not been provided.");
delete i["X-Parse-JavaScript-Key"], i["X-Parse-Master-Key"] = CoreManager.get("MASTER_KEY");
}
if (r.sessionToken) i["X-Parse-Session-Token"] = r.sessionToken;
else {
const t = CoreManager.getUserController();
if (t) {
const e = await t.currentUserAsync();
if (e) {
const t = e.getSessionToken();
t && (i["X-Parse-Session-Token"] = t);
}
}
}
if ("buffer" === e.format) o = e.buffer;
else if ("stream" === e.format) {
const t = e.stream;
o = "function" == typeof t.pipe && "function" == typeof t.read ? NodeReadable.toWeb(t) : t;
}
let a = CoreManager.get("SERVER_URL");
return "/" !== a[a.length - 1] && (a += "/"), a += "files/" + encodeURIComponent(t), CoreManager.getRESTController().ajax("POST", a, o, i, r).then((({ response: t }) => t));
},
download: async function(t, e) {
const r = new AbortController();
e.requestTask(r);
const { signal: i } = r;
try {
const r = await fetch(t, { signal: i }), n = r.body.getReader(), o = +r.headers.get("Content-Length") || 0, s = r.headers.get("Content-Type");
if (0 === o) return e.progress?.(null, null, null), {
base64: "",
contentType: s
};
let a = 0;
const h = [];
for (;;) {
const { done: t, value: r } = await n.read();
if (t) break;
h.push(r), a += r?.length || 0, e.progress?.(a / o, a, o);
}
const u = new Uint8Array(a);
let f = 0;
for (const t of h) u.set(t, f), f += t.length;
return {
base64: ParseFile.encodeBase64(u),
contentType: s
};
} catch (t) {
if ("AbortError" === t.name) return {};
throw t;
}
},
deleteFile: function(t, e) {
const r = { "X-Parse-Application-ID": CoreManager.get("APPLICATION_ID") };
e.useMasterKey && (r["X-Parse-Master-Key"] = CoreManager.get("MASTER_KEY"));
let i = CoreManager.get("SERVER_URL");
return "/" !== i[i.length - 1] && (i += "/"), i += "files/" + t, CoreManager.getRESTController().ajax("DELETE", i, "", r).catch(((t) => t && "SyntaxError: Unexpected end of JSON input" !== t.toString() ? CoreManager.getRESTController().handleError(t) : Promise.resolve()));
}
};
CoreManager.setFileController(DefaultController$3);
var ParseGeoPoint = class t {
constructor(e, r) {
Array.isArray(e) ? (t._validate(e[0], e[1]), this._latitude = e[0], this._longitude = e[1]) : "object" == typeof e ? (t._validate(e.latitude, e.longitude), this._latitude = e.latitude, this._longitude = e.longitude) : void 0 !== e && void 0 !== r ? (t._validate(e, r), this._latitude = e, this._longitude = r) : (this._latitude = 0, this._longitude = 0);
}
get latitude() {
return this._latitude;
}
set latitude(e) {
t._validate(e, this.longitude), this._latitude = e;
}
get longitude() {
return this._longitude;
}
set longitude(e) {
t._validate(this.latitude, e), this._longitude = e;
}
toJSON() {
return t._validate(this._latitude, this._longitude), {
__type: "GeoPoint",
latitude: this._latitude,
longitude: this._longitude
};
}
equals(e) {
return e instanceof t && this.latitude === e.latitude && this.longitude === e.longitude;
}
radiansTo(t) {
const e = Math.PI / 180, r = this.latitude * e, i = this.longitude * e, n = t.latitude * e, o = r - n, s = i - t.longitude * e, a = Math.sin(o / 2), h = Math.sin(s / 2);
let u = a * a + Math.cos(r) * Math.cos(n) * h * h;
return u = Math.min(1, u), 2 * Math.asin(Math.sqrt(u));
}
kilometersTo(t) {
return 6371 * this.radiansTo(t);
}
milesTo(t) {
return 3958.8 * this.radiansTo(t);
}
static _validate(t, e) {
if (isNaN(t) || isNaN(e) || "number" != typeof t || "number" != typeof e) throw new TypeError("GeoPoint latitude and longitude must be valid numbers");
if (t < -90) throw new TypeError("GeoPoint latitude out of bounds: " + t + " < -90.0.");
if (t > 90) throw new TypeError("GeoPoint latitude out of bounds: " + t + " > 90.0.");
if (e < -180) throw new TypeError("GeoPoint longitude out of bounds: " + e + " < -180.0.");
if (e > 180) throw new TypeError("GeoPoint longitude out of bounds: " + e + " > 180.0.");
}
static current(e) {
return new Promise(((r, i) => {
navigator.geolocation.getCurrentPosition(((e) => {
r(new t(e.coords.latitude, e.coords.longitude));
}), i, e);
}));
}
}, ParsePolygon = class t {
constructor(e) {
this._coordinates = t._validate(e);
}
get coordinates() {
return this._coordinates;
}
set coordinates(e) {
this._coordinates = t._validate(e);
}
toJSON() {
return t._validate(this._coordinates), {
__type: "Polygon",
coordinates: this._coordinates
};
}
equals(e) {
if (!(e instanceof t) || this.coordinates.length !== e.coordinates.length) return !1;
let r = !0;
for (let t = 1; t < this._coordinates.length; t += 1) if (this._coordinates[t][0] != e.coordinates[t][0] || this._coordinates[t][1] != e.coordinates[t][1]) {
r = !1;
break;
}
return r;
}
containsPoint(t) {
let e = this._coordinates[0][0], r = this._coordinates[0][0], i = this._coordinates[0][1], n = this._coordinates[0][1];
for (let t = 1; t < this._coordinates.length; t += 1) {
const o = this._coordinates[t];
e = Math.min(o[0], e), r = Math.max(o[0], r), i = Math.min(o[1], i), n = Math.max(o[1], n);
}
if (t.latitude < e || t.latitude > r || t.longitude < i || t.longitude > n) return !1;
let o = !1;
for (let e = 0, r = this._coordinates.length - 1; e < this._coordinates.length; r = e++) {
const i = this._coordinates[e][0], n = this._coordinates[e][1], s = this._coordinates[r][0], a = this._coordinates[r][1];
n > t.longitude != a > t.longitude && t.latitude < (s - i) * (t.longitude - n) / (a - n) + i && (o = !o);
}
return o;
}
static _validate(t) {
if (!Array.isArray(t)) throw new TypeError("Coordinates must be an Array");
if (t.length < 3) throw new TypeError("Polygon must have at least 3 GeoPoints or Points");
const e = [];
for (let r = 0; r < t.length; r += 1) {
const i = t[r];
let n;
if (i instanceof ParseGeoPoint) n = i;
else {
if (!Array.isArray(i) || 2 !== i.length) throw new TypeError("Coordinates must be an Array of GeoPoints or Points");
n = new ParseGeoPoint(i[0], i[1]);
}
e.push([n.latitude, n.longitude]);
}
return e;
}
}, ParseRelation = class {
constructor(t, e) {
this.parent = t, this.key = e, this.targetClassName = null;
}
_ensureParentAndKey(t, e) {
if (this.key = this.key || e, this.key !== e) throw new Error("Internal Error. Relation retrieved from two different keys.");
if (this.parent) {
if (this.parent.className !== t.className) throw new Error("Internal Error. Relation retrieved from two different Objects.");
if (this.parent.id) {
if (this.parent.id !== t.id) throw new Error("Internal Error. Relation retrieved from two different Objects.");
} else t.id && (this.parent = t);
} else this.parent = t;
}
add(t) {
Array.isArray(t) || (t = [t]);
const { RelationOp: e } = CoreManager.getParseOp(), r = new e(t, []), i = this.parent;
if (!i) throw new Error("Cannot add to a Relation without a parent");
return 0 === t.length || (i.set(this.key, r), this.targetClassName = r._targetClassName), i;
}
remove(t) {
Array.isArray(t) || (t = [t]);
const { RelationOp: e } = CoreManager.getParseOp(), r = new e([], t);
if (!this.parent) throw new Error("Cannot remove from a Relation without a parent");
0 !== t.length && (this.parent.set(this.key, r), this.targetClassName = r._targetClassName);
}
toJSON() {
return {
__type: "Relation",
className: this.targetClassName
};
}
query() {
let t;
const e = this.parent;
if (!e) throw new Error("Cannot construct a query for a Relation without a parent");
const r = CoreManager.getParseQuery();
return this.targetClassName ? t = new r(this.targetClassName) : (t = new r(e.className), t._extraOptions.redirectClassNameForKey = this.key), t._addCondition("$relatedTo", "object", {
__type: "Pointer",
className: e.className,
objectId: e.id
}), t._addCondition("$relatedTo", "key", this.key), t;
}
};
function isDangerousKey(t) {
const e = [
"__proto__",
"constructor",
"prototype"
];
return !!e.includes(t) || !!t.includes(".") && t.split(".").some(((t) => e.includes(t)));
}
function decode(t) {
if (null === t || "object" != typeof t || t instanceof Date) return t;
if (Array.isArray(t)) {
const e = [];
return t.forEach(((t, r) => {
e[r] = decode(t);
})), e;
}
if ("string" == typeof t.__op) {
const { opFromJSON: e } = CoreManager.getParseOp();
return e(t);
}
const e = CoreManager.getParseObject();
if ("Pointer" === t.__type && t.className) return e.fromJSON(t);
if ("Object" === t.__type && t.className) return e.fromJSON(t);
if ("Relation" === t.__type) {
const e = new ParseRelation(null, null);
return e.targetClassName = t.className, e;
}
if ("Date" === t.__type) return new Date(t.iso);
if ("File" === t.__type) return ParseFile.fromJSON(t);
if ("GeoPoint" === t.__type) return new ParseGeoPoint({
latitude: t.latitude,
longitude: t.longitude
});
if ("Polygon" === t.__type) return new ParsePolygon(t.coordinates);
const r = {};
for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) {
if (isDangerousKey(e)) continue;
r[e] = decode(t[e]);
}
return r;
}
var PUBLIC_KEY$1 = "*", ParseACL = class t {
constructor(t) {
if (this.permissionsById = {}, t && "object" == typeof t) if (t instanceof CoreManager.getParseUser()) this.setReadAccess(t, !0), this.setWriteAccess(t, !0);
else for (const e in t) {
const r = t[e];
this.permissionsById[e] = {};
for (const t in r) {
const i = r[t];
if ("read" !== t && "write" !== t) throw new TypeError("Tried to create an ACL with an invalid permission type.");
if ("boolean" != typeof i) throw new TypeError("Tried to create an ACL with an invalid permission value.");
this.permissionsById[e][t] = i;
}
}
else if ("function" == typeof t) throw new TypeError("ParseACL constructed with a function. Did you forget ()?");
}
toJSON() {
const t = {};
for (const e in this.permissionsById) t[e] = this.permissionsById[e];
return t;
}
equals(e) {
if (!(e instanceof t)) return !1;
const r = Object.keys(this.permissionsById), i = Object.keys(e.permissionsById);
if (r.length !== i.length) return !1;
for (const t in this.permissionsById) {
if (!e.permissionsById[t]) return !1;
if (this.permissionsById[t].read !== e.permissionsById[t].read) return !1;
if (this.permissionsById[t].write !== e.permissionsById[t].write) return !1;
}
return !0;
}
_setAccess(t, e, r) {
const i = CoreManager.getParseRole();
if (e instanceof CoreManager.getParseUser()) e = e.id;
else if (e instanceof i) {
const t = e.getName();
if (!t) throw new TypeError("Role must have a name");
e = "role:" + t;
}
if ("string" != typeof e) throw new TypeError("userId must be a string.");
if ("boolean" != typeof r) throw new TypeError("allowed must be either true or false.");
let n = this.permissionsById[e];
if (!n) {
if (!r) return;
n = {}, this.permissionsById[e] = n;
}
r ? this.permissionsById[e][t] = !0 : (delete n[t], 0 === Object.keys(n).length && delete this.permissionsById[e]);
}
_getAccess(t, e) {
const r = CoreManager.getParseRole();
if (e instanceof CoreManager.getParseUser()) {
if (!(e = e.id)) throw new Error("Cannot get access for a ParseUser without an ID");
} else if (e instanceof r) {
const t = e.getName();
if (!t) throw new TypeError("Role must have a name");
e = "role:" + t;
}
const i = this.permissionsById[e];
return !!i && !!i[t];
}
setReadAccess(t, e) {
this._setAccess("read", t, e);
}
getReadAccess(t) {
return this._getAccess("read", t);
}
setWriteAccess(t, e) {
this._setAccess("write", t, e);
}
getWriteAccess(t) {
return this._getAccess("write", t);
}
setPublicReadAccess(t) {
this.setReadAccess(PUBLIC_KEY$1, t);
}
getPublicReadAccess() {
return this.getReadAccess(PUBLIC_KEY$1);
}
setPublicWriteAccess(t) {
this.setWriteAccess(PUBLIC_KEY$1, t);
}
getPublicWriteAccess() {
return this.getWriteAccess(PUBLIC_KEY$1);
}
getRoleReadAccess(t) {
if (t instanceof CoreManager.getParseRole() && (t = t.getName()), "string" != typeof t) throw new TypeError("role must be a ParseRole or a String");
return this.getReadAccess("role:" + t);
}
getRoleWriteAccess(t) {
if (t instanceof CoreManager.getParseRole() && (t = t.getName()), "string" != typeof t) throw new TypeError("role must be a ParseRole or a String");
return this.getWriteAccess("role:" + t);
}
setRoleReadAccess(t, e) {
if (t instanceof CoreManager.getParseRole() && (t = t.getName()), "string" != typeof t) throw new TypeError("role must be a ParseRole or a String");
this.setReadAccess("role:" + t, e);
}
setRoleWriteAccess(t, e) {
if (t instanceof CoreManager.getParseRole() && (t = t.getName()), "string" != typeof t) throw new TypeError("role must be a ParseRole or a String");
this.setWriteAccess("role:" + t, e);
}
};
function encode(t, e, r, i, n) {
if (t instanceof CoreManager.getParseObject()) {
if (e) throw new Error("Parse Objects not allowed here");
const o = t.id ? t.className + ":" + t.id : t;
return r || !i || i.indexOf(o) > -1 || t.dirty() || Object.keys(t._getServerData()).length < 1 ? n && t._getId().startsWith("local") ? t.toOfflinePointer() : t.toPointer() : (i = i.concat(o), t._toFullJSON(i, n));
}
const { Op: o } = CoreManager.getParseOp();
if (t instanceof o || t instanceof ParseACL || t instanceof ParseGeoPoint || t instanceof ParsePolygon || t instanceof ParseRelation) return t.toJSON();
if (t instanceof ParseFile) {
if (!t.url()) throw new Error("Tried to encode an unsaved file.");
return t.toJSON();
}
if ("[object Date]" === Object.prototype.toString.call(t)) {
if (isNaN(t)) throw new Error("Tried to encode an invalid date.");
return {
__type: "Date",
iso: t.toJSON()
};
}
if ("[object RegExp]" === Object.prototype.toString.call(t) && "string" == typeof t.source) return t.source;
if (Array.isArray(t)) return t.map(((t) => encode(t, e, r, i, n)));
if (t && "object" == typeof t) {
const o = {};
for (const s in t) if (Object.prototype.hasOwnProperty.call(t, s)) {
if (isDangerousKey(s)) continue;
o[s] = encode(t[s], e, r, i, n);
}
return o;
}
return t;
}
function encode_default(t, e, r, i, n) {
return encode(t, !!e, !!r, i || [], n);
}
var require_CryptoJS = __commonJSMin(((t, e) => {
var r, i, n = function(t) {
var e = {}, r = e.lib = {}, i = function() {}, n = r.Base = {
extend: function(t) {
i.prototype = this;
var e = new i();
return t && e.mixIn(t), e.hasOwnProperty("init") || (e.init = function() {
e.$super.init.apply(this, arguments);
}), e.init.prototype = e, e.$super = this, e;
},
create: function() {
var t = this.extend();
return t.init.apply(t, arguments), t;
},
init: function() {},
mixIn: function(t) {
for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e]);
t.hasOwnProperty("toString") && (this.toString = t.toString);
},
clone: function() {
return this.init.prototype.extend(this);
}
}, o = r.WordArray = n.extend({
init: function(t, e) {
t = this.words = t || [], this.sigBytes = null != e ? e : 4 * t.length;
},
toString: function(t) {
return (t || a).stringify(this);
},
concat: function(t) {
var e = this.words, r = t.words, i = this.sigBytes;
if (t = t.sigBytes, this.clamp(), i % 4) for (var n = 0; n < t; n++) e[i + n >>> 2] |= (r[n >>> 2] >>> 24 - n % 4 * 8 & 255) << 24 - (i + n) % 4 * 8;
else if (65535 < r.length) for (n = 0; n < t; n += 4) e[i + n >>> 2] = r[n >>> 2];
else e.push.apply(e, r);
return this.sigBytes += t, this;
},
clamp: function() {
var e = this.words, r = this.sigBytes;
e[r >>> 2] &= 4294967295 << 32 - r % 4 * 8, e.length = t.ceil(r / 4);
},
clone: function() {
var t = n.clone.call(this);
return t.words = this.words.slice(0), t;
},
random: function(e) {
for (var r = [], i = 0; i < e; i += 4) r.push(4294967296 * t.random() | 0);
return new o.init(r, e);
}
}), s = e.enc = {}, a = s.Hex = {
stringify: function(t) {
var e = t.words;
t = t.sigBytes;
for (var r = [], i = 0; i < t; i++) {
var n = e[i >>> 2] >>> 24 - i % 4 * 8 & 255;
r.push((n >>> 4).toString(16)), r.push((15 & n).toString(16));
}
return r.join("");
},
parse: function(t) {
for (var e = t.length, r = [], i = 0; i < e; i += 2) r[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4;
return new o.init(r, e / 2);
}
}, h = s.Latin1 = {
stringify: function(t) {
var e = t.words;
t = t.sigBytes;
for (var r = [], i = 0; i < t; i++) r.push(String.fromCharCode(e[i >>> 2] >>> 24 - i % 4 * 8 & 255));
return r.join("");
},
parse: function(t) {
for (var e = t.length, r = [], i = 0; i < e; i++) r[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8;
return new o.init(r, e);
}
}, u = s.Utf8 = {
stringify: function(t) {
try {
return decodeURIComponent(escape(h.stringify(t)));
} catch (t) {
throw Error("Malformed UTF-8 data");
}
},
parse: function(t) {
return h.parse(unescape(encodeURIComponent(t)));
}
}, f = r.BufferedBlockAlgorithm = n.extend({
reset: function() {
this._data = new o.init(), this._nDataBytes = 0;
},
_append: function(t) {
"string" == typeof t && (t = u.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes;
},
_process: function(e) {
var r = this._data, i = r.words, n = r.sigBytes, s = this.blockSize, a = n / (4 * s);
if (e = (a = e ? t.ceil(a) : t.max((0 | a) - this._minBufferSize, 0)) * s, n = t.min(4 * e, n), e) {
for (var h = 0; h < e; h += s) this._doProcessBlock(i, h);
h = i.splice(0, e), r.sigBytes -= n;
}
return new o.init(h, n);
},
clone: function() {
var t = n.clone.call(this);
return t._data = this._data.clone(), t;
},
_minBufferSize: 0
});
r.Hasher = f.extend({
cfg: n.extend(),
init: function(t) {
this.cfg = this.cfg.extend(t), this.reset();
},
reset: function() {
f.reset.call(this), this._doReset();
},
update: function(t) {
return this._append(t), this._process(), this;
},
finalize: function(t) {
return t && this._append(t), this._doFinalize();
},
blockSize: 16,
_createHelper: function(t) {
return function(e, r) {
return new t.init(r).finalize(e);
};
},
_createHmacHelper: function(t) {
return function(e, r) {
return new l.HMAC.init(t, r).finalize(e);
};
}
});
var l = e.algo = {};
return e;
}(Math);
i = (r = n).lib.WordArray, r.enc.Base64 = {
stringify: function(t) {
var e = t.words, r = t.sigBytes, i = this._map;
t.clamp(), t = [];
for (var n = 0; n < r; n += 3) for (var o = (e[n >>> 2] >>> 24 - n % 4 * 8 & 255) << 16 | (e[n + 1 >>> 2] >>> 24 - (n + 1) % 4 * 8 & 255) << 8 | e[n + 2 >>> 2] >>> 24 - (n + 2) % 4 * 8 & 255, s = 0; 4 > s && n + .75 * s < r; s++) t.push(i.charAt(o >>> 6 * (3 - s) & 63));
if (e = i.charAt(64)) for (; t.length % 4;) t.push(e);
return t.join("");
},
parse: function(t) {
var e = t.length, r = this._map;
(n = r.charAt(64)) && -1 != (n = t.indexOf(n)) && (e = n);
for (var n = [], o = 0, s = 0; s < e; s++) if (s % 4) {
var a = r.indexOf(t.charAt(s - 1)) << s % 4 * 2, h = r.indexOf(t.charAt(s)) >>> 6 - s % 4 * 2;
n[o >>> 2] |= (a | h) << 24 - o % 4 * 8, o++;
}
return i.create(n, o);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}, function(t) {
function e(t, e, r, i, n, o, s) {
return ((t = t + (e & r | ~e & i) + n + s) << o | t >>> 32 - o) + e;
}
function r(t, e, r, i, n, o, s) {
return ((t = t + (e & i | r & ~i) + n + s) << o | t >>> 32 - o) + e;
}
function i(t, e, r, i, n, o, s) {
return ((t = t + (e ^ r ^ i) + n + s) << o | t >>> 32 - o) + e;
}
function o(t, e, r, i, n, o, s) {
return ((t = t + (r ^ (e | ~i)) + n + s) << o | t >>> 32 - o) + e;
}
for (var s = n, a = (u = s.lib).WordArray, h = u.Hasher, u = s.algo, f = [], l = 0; 64 > l; l++) f[l] = 4294967296 * t.abs(t.sin(l + 1)) | 0;
u = u.MD5 = h.extend({
_doReset: function() {
this._hash = new a.init([
1732584193,
4023233417,
2562383102,
271733878
]);
},
_doProcessBlock: function(t, n) {
for (var s = 0; 16 > s; s++) {
var a = t[h = n + s];
t[h] = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8);
}
s = this._hash.words;
var h = t[n + 0], u = (a = t[n + 1], t[n + 2]), l = t[n + 3], c = t[n + 4], d = t[n + 5], p = t[n + 6], m = t[n + 7], g = t[n + 8], y = t[n + 9], b = t[n + 10], v = t[n + 11], _ = t[n + 12], w = t[n + 13], M = t[n + 14], S = t[n + 15], E = e(E = s[0], O = s[1], C = s[2], A = s[3], h, 7, f[0]), A = e(A, E, O, C, a, 12, f[1]), C = e(C, A, E, O, u, 17, f[2]), O = e(O, C, A, E, l, 22, f[3]);
E = e(E, O, C, A, c, 7, f[4]), A = e(A, E, O, C, d, 12, f[5]), C = e(C, A, E, O, p, 17, f[6]), O = e(O, C, A, E, m, 22, f[7]), E = e(E, O, C, A, g, 7, f[8]), A = e(A, E, O, C, y, 12, f[9]), C = e(C, A, E, O, b, 17, f[10]), O = e(O, C, A, E, v, 22, f[11]), E = e(E, O, C, A, _, 7, f[12]), A = e(A, E, O, C, w, 12, f[13]), C = e(C, A, E, O, M, 17, f[14]), E = r(E, O = e(O, C, A, E, S, 22, f[15]), C, A, a, 5, f[16]), A = r(A, E, O, C, p, 9, f[17]), C = r(C, A, E, O, v, 14, f[18]), O = r(O, C, A, E, h, 20, f[19]), E = r(E, O, C, A, d, 5, f[20]), A = r(A, E, O, C, b, 9, f[21]), C = r(C, A, E, O, S, 14, f[22]), O = r(O, C, A, E, c, 20, f[23]), E = r(E, O, C, A, y, 5, f[24]), A = r(A, E, O, C, M, 9, f[25]), C = r(C, A, E, O, l, 14, f[26]), O = r(O, C, A, E, g, 20, f[27]), E = r(E, O, C, A, w, 5, f[28]), A = r(A, E, O, C, u, 9, f[29]), C = r(C, A, E, O, m, 14, f[30]), E = i(E, O = r(O, C, A, E, _, 20, f[31]), C, A, d, 4, f[32]), A = i(A, E, O, C, g, 11, f[33]), C = i(C, A, E, O, v, 16, f[34]), O = i(O, C, A, E, M, 23, f[35]), E = i(E, O, C, A, a, 4, f[36]), A = i(A, E, O, C, c, 11, f[37]), C = i(C, A, E, O, m, 16, f[38]), O = i(O, C, A, E, b, 23, f[39]), E = i(E, O, C, A, w, 4, f[40]), A = i(A, E, O, C, h, 11, f[41]), C = i(C, A, E, O, l, 16, f[42]), O = i(O, C, A, E, p, 23, f[43]), E = i(E, O, C, A, y, 4, f[44]), A = i(A, E, O, C, _, 11, f[45]), C = i(C, A, E, O, S, 16, f[46]), E = o(E, O = i(O, C, A, E, u, 23, f[47]), C, A, h, 6, f[48]), A = o(A, E, O, C, m, 10, f[49]), C = o(C, A, E, O, M, 15, f[50]), O = o(O, C, A, E, d, 21, f[51]), E = o(E, O, C, A, _, 6, f[52]), A = o(A, E, O, C, l, 10, f[53]), C = o(C, A, E, O, b, 15, f[54]), O = o(O, C, A, E, a, 21, f[55]), E = o(E, O, C, A, g, 6, f[56]), A = o(A, E, O, C, S, 10, f[57]), C = o(C, A, E, O, p, 15, f[58]), O = o(O, C, A, E, w, 21, f[59]), E = o(E, O, C, A, c, 6, f[60]), A = o(A, E, O, C, v, 10, f[61]), C = o(C, A, E, O, u, 15, f[62]), O = o(O, C, A, E, y, 21, f[63]);
s[0] = s[0] + E | 0, s[1] = s[1] + O | 0, s[2] = s[2] + C | 0, s[3] = s[3] + A | 0;
},
_doFinalize: function() {
var e = this._data, r = e.words, i = 8 * this._nDataBytes, n = 8 * e.sigBytes;
r[n >>> 5] |= 128 << 24 - n % 32;
var o = t.floor(i / 4294967296);
for (r[15 + (n + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), r[14 + (n + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), e.sigBytes = 4 * (r.length + 1), this._process(), r = (e = this._hash).words, i = 0; 4 > i; i++) n = r[i], r[i] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8);
return e;
},
clone: function() {
var t = h.clone.call(this);
return t._hash = this._hash.clone(), t;
}
}), s.MD5 = h._createHelper(u), s.HmacMD5 = h._createHmacHelper(u);
}(Math), function() {
var t, e = n, r = (t = e.lib).Base, i = t.WordArray, o = (t = e.algo).EvpKDF = r.extend({
cfg: r.extend({
keySize: 4,
hasher: t.MD5,
iterations: 1
}),
init: function(t) {
this.cfg = this.cfg.extend(t);
},
compute: function(t, e) {
for (var r = (a = this.cfg).hasher.create(), n = i.create(), o = n.words, s = a.keySize, a = a.iterations; o.length < s;) {
h && r.update(h);
var h = r.update(t).finalize(e);
r.reset();
for (var u = 1; u < a; u++) h = r.finalize(h), r.reset();
n.concat(h);
}
return n.sigBytes = 4 * s, n;
}
});
e.EvpKDF = function(t, e, r) {
return o.create(r).compute(t, e);
};
}(), n.lib.Cipher || function() {
var t = (d = n).lib, e = t.Base, r = t.WordArray, i = t.BufferedBlockAlgorithm, o = d.enc.Base64, s = d.algo.EvpKDF, a = t.Cipher = i.extend({
cfg: e.extend(),
createEncryptor: function(t, e) {
return this.create(this._ENC_XFORM_MODE, t, e);
},
createDecryptor: function(t, e) {
return this.create(this._DEC_XFORM_MODE, t, e);
},
init: function(t, e, r) {
this.cfg = this.cfg.extend(r), this._xformMode = t, this._key = e, this.reset();
},
reset: function() {
i.reset.call(this), this._doReset();
},
process: function(t) {
return this._append(t), this._process();
},
finalize: function(t) {
return t && this._append(t), this._doFinalize();
},
keySize: 4,
ivSize: 4,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
_createHelper: function(t) {
return {
encrypt: function(e, r, i) {
return ("string" == typeof r ? p : c).encrypt(t, e, r, i);
},
decrypt: function(e, r, i) {
return ("string" == typeof r ? p : c).decrypt(t, e, r, i);
}
};
}
});
t.StreamCipher = a.extend({
_doFinalize: function() {
return this._process(!0);
},
blockSize: 1
});
var h = d.mode = {}, u = function(t, e, r) {
var i = this._iv;
i ? this._iv = void 0 : i = this._prevBlock;
for (var n = 0; n < r; n++) t[e + n] ^= i[n];
}, f = (t.BlockCipherMode = e.extend({
createEncryptor: function(t, e) {
return this.Encryptor.create(t, e);
},
createDecryptor: function(t, e) {
return this.Decryptor.create(t, e);
},
init: function(t, e) {
this._cipher = t, this._iv = e;
}
})).extend();
f.Encryptor = f.extend({ processBlock: function(t, e) {
var r = this._cipher, i = r.blockSize;
u.call(this, t, e, i), r.encryptBlock(t, e), this._prevBlock = t.slice(e, e + i);
} }), f.Decryptor = f.extend({ processBlock: function(t, e) {
var r = this._cipher, i = r.blockSize, n = t.slice(e, e + i);
r.decryptBlock(t, e), u.call(this, t, e, i), this._prevBlock = n;
} }), h = h.CBC = f, f = (d.pad = {}).Pkcs7 = {
pad: function(t, e) {
for (var i, n = (i = (i = 4 * e) - t.sigBytes % i) << 24 | i << 16 | i << 8 | i, o = [], s = 0; s < i; s += 4) o.push(n);
i = r.create(o, i), t.concat(i);
},
unpad: function(t) {
t.sigBytes -= 255 & t.words[t.sigBytes - 1 >>> 2];
}
}, t.BlockCipher = a.extend({
cfg: a.cfg.extend({
mode: h,
padding: f
}),
reset: function() {
a.reset.call(this);
var t = (e = this.cfg).iv, e = e.mode;
if (this._xformMode == this._ENC_XFORM_MODE) var r = e.createEncryptor;
else r = e.createDecryptor, this._minBufferSize = 1;
this._mode = r.call(e, this, t && t.words);
},
_doProcessBlock: function(t, e) {
this._mode.processBlock(t, e);
},
_doFinalize: function() {
var t = this.cfg.padding;
if (this._xformMode == this._ENC_XFORM_MODE) {
t.pad(this._data, this.blockSize);
var e = this._process(!0);
} else e = this._process(!0), t.unpad(e);
return e;
},
blockSize: 4
});
var l = t.CipherParams = e.extend({
init: function(t) {
this.mixIn(t);
},
toString: function(t) {
return (t || this.formatter).stringify(this);
}
}), c = (h = (d.format = {}).OpenSSL = {
stringify: function(t) {
var e = t.ciphertext;
return ((t = t.salt) ? r.create([1398893684, 1701076831]).concat(t).concat(e) : e).toString(o);
},
parse: function(t) {
var e = (t = o.parse(t)).words;
if (1398893684 == e[0] && 1701076831 == e[1]) {
var i = r.create(e.slice(2, 4));
e.splice(0, 4), t.sigBytes -= 16;
}
return l.create({
ciphertext: t,
salt: i
});
}
}, t.SerializableCipher = e.extend({
cfg: e.extend({ format: h }),
encrypt: function(t, e, r, i) {
i = this.cfg.extend(i);
var n = t.createEncryptor(r, i);
return e = n.finalize(e), n = n.cfg, l.create({
ciphertext: e,
key: r,
iv: n.iv,
algorithm: t,
mode: n.mode,
padding: n.padding,
blockSize: t.blockSize,
formatter: i.format
});
},
decrypt: function(t, e, r, i) {
return i = this.cfg.extend(i), e = this._parse(e, i.format), t.createDecryptor(r, i).finalize(e.ciphertext);
},
_parse: function(t, e) {
return "string" == typeof t ? e.parse(t, this) : t;
}
})), d = (d.kdf = {}).OpenSSL = { execute: function(t, e, i, n) {
return n || (n = r.random(8)), t = s.create({ keySize: e + i }).compute(t, n), i = r.create(t.words.slice(e), 4 * i), t.sigBytes = 4 * e, l.create({
key: t,
iv: i,
salt: n
});
} }, p = t.PasswordBasedCipher = c.extend({
cfg: c.cfg.extend({ kdf: d }),
encrypt: function(t, e, r, i) {
return r = (i = this.cfg.extend(i)).kdf.execute(r, t.keySize, t.ivSize), i.iv = r.iv, (t = c.encrypt.call(this, t, e, r.key, i)).mixIn(r), t;
},
decrypt: function(t, e, r, i) {
return i = this.cfg.extend(i), e = this._parse(e, i.format), r = i.kdf.execute(r, t.keySize, t.ivSize, e.salt), i.iv = r.iv, c.decrypt.call(this, t, e, r.key, i);
}
});
}(), function() {
for (var t = n, e = t.lib.BlockCipher, r = t.algo, i = [], o = [], s = [], a = [], h = [], u = [], f = [], l = [], c = [], d = [], p = [], m = 0; 256 > m; m++) p[m] = 128 > m ? m << 1 : m << 1 ^ 283;
var g = 0, y = 0;
for (m = 0; 256 > m; m++) {
var b = (b = y ^ y << 1 ^ y << 2 ^ y << 3 ^ y << 4) >>> 8 ^ 255 & b ^ 99;
i[g] = b, o[b] = g;
var v = p[g], _ = p[v], w = p[_], M = 257 * p[b] ^ 16843008 * b;
s[g] = M << 24 | M >>> 8, a[g] = M << 16 | M >>> 16, h[g] = M << 8 | M >>> 24, u[g] = M, M = 16843009 * w ^ 65537 * _ ^ 257 * v ^ 16843008 * g, f[b] = M << 24 | M >>> 8, l[b] = M << 16 | M >>> 16, c[b] = M << 8 | M >>> 24, d[b] = M, g ? (g = v ^ p[p[p[w ^ v]]], y ^= p[p[y]]) : g = y = 1;
}
var S = [
0,
1,
2,
4,
8,
16,
32,
64,
128,
27,
54
];
r = r.AES = e.extend({
_doReset: function() {
for (var t = (r = this._key).words, e = r.sigBytes / 4, r = 4 * ((this._nRounds = e + 6) + 1), n = this._keySchedule = [], o = 0; o < r; o++) if (o < e) n[o] = t[o];
else {
var s = n[o - 1];
o % e ? 6 < e && 4 == o % e && (s = i[s >>> 24] << 24 | i[s >>> 16 & 255] << 16 | i[s >>> 8 & 255] << 8 | i[255 & s]) : (s = i[(s = s << 8 | s >>> 24) >>> 24] << 24 | i[s >>> 16 & 255] << 16 | i[s >>> 8 & 255] << 8 | i[255 & s], s ^= S[o / e | 0] << 24), n[o] = n[o - e] ^ s;
}
for (t = this._invKeySchedule = [], e = 0; e < r; e++) o = r - e, s = e % 4 ? n[o] : n[o - 4], t[e] = 4 > e || 4 >= o ? s : f[i[s >>> 24]] ^ l[i[s >>> 16 & 255]] ^ c[i[s >>> 8 & 255]] ^ d[i[255 & s]];
},
encryptBlock: function(t, e) {
this._doCryptBlock(t, e, this._keySchedule, s, a, h, u, i);
},
decryptBlock: function(t, e) {
var r = t[e + 1];
t[e + 1] = t[e + 3], t[e + 3] = r, this._doCryptBlock(t, e, this._invKeySchedule, f, l, c, d, o), r = t[e + 1], t[e + 1] = t[e + 3], t[e + 3] = r;
},
_doCryptBlock: function(t, e, r, i, n, o, s, a) {
for (var h = this._nRounds, u = t[e] ^ r[0], f = t[e + 1] ^ r[1], l = t[e + 2] ^ r[2], c = t[e + 3] ^ r[3], d = 4, p = 1; p < h; p++) {
var m = i[u >>> 24] ^ n[f >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & c] ^ r[d++], g = i[f >>> 24] ^ n[l >>> 16 & 255] ^ o[c >>> 8 & 255] ^ s[255 & u] ^ r[d++], y = i[l >>> 24] ^ n[c >>> 16 & 255] ^ o[u >>> 8 & 255] ^ s[255 & f] ^ r[d++];
c = i[c >>> 24] ^ n[u >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & l] ^ r[d++], u = m, f = g, l = y;
}
m = (a[u >>> 24] << 24 | a[f >>> 16 & 255] << 16 | a[l >>> 8 & 255] << 8 | a[255 & c]) ^ r[d++], g = (a[f >>> 24] << 24 | a[l >>> 16 & 255] << 16 | a[c >>> 8 & 255] << 8 | a[255 & u]) ^ r[d++], y = (a[l >>> 24] << 24 | a[c >>> 16 & 255] << 16 | a[u >>> 8 & 255] << 8 | a[255 & f]) ^ r[d++], c = (a[c >>> 24] << 24 | a[u >>> 16 & 255] << 16 | a[f >>> 8 & 255] << 8 | a[255 & l]) ^ r[d++], t[e] = m, t[e + 1] = g, t[e + 2] = y, t[e + 3] = c;
},
keySize: 8
});
t.AES = e._createHelper(r);
}(), e.exports = n;
})), require_safe_buffer$9 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_browser$11 = __commonJSMin(((t, e) => {
init_dist(), init_dist$2();
var r = 65536;
var i = require_safe_buffer$9().Buffer, n = global.crypto || global.msCrypto;
n && n.getRandomValues ? e.exports = function(t, e) {
if (t > 4294967295) throw new RangeError("requested too many random bytes");
var o = i.allocUnsafe(t);
if (t > 0) if (t > r) for (var s = 0; s < t; s += r) n.getRandomValues(o.slice(s, s + r));
else n.getRandomValues(o);
return "function" == typeof e ? process$1.nextTick((function() {
e(null, o);
})) : o;
} : e.exports = function() {
throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11");
};
})), require_safe_buffer$8 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_hash_base$1 = __commonJSMin(((t, e) => {
var r = require_safe_buffer$8().Buffer, i = require_stream_browserify().Transform;
function n(t) {
i.call(this), this._block = r.allocUnsafe(t), this._blockSize = t, this._blockOffset = 0, this._length = [
0,
0,
0,
0
], this._finalized = !1;
}
require_inherits_browser()(n, i), n.prototype._transform = function(t, e, r) {
var i = null;
try {
this.update(t, e);
} catch (t) {
i = t;
}
r(i);
}, n.prototype._flush = function(t) {
var e = null;
try {
this.push(this.digest());
} catch (t) {
e = t;
}
t(e);
};
var o = "undefined" != typeof Uint8Array, s = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array && ArrayBuffer.isView && (r.prototype instanceof Uint8Array || r.TYPED_ARRAY_SUPPORT);
n.prototype.update = function(t, e) {
if (this._finalized) throw new Error("Digest already called");
t = function(t, e) {
if (t instanceof r) return t;
if ("string" == typeof t) return r.from(t, e);
if (s && ArrayBuffer.isView(t)) {
if (0 === t.byteLength) return r.alloc(0);
var i = r.from(t.buffer, t.byteOffset, t.byteLength);
if (i.byteLength === t.byteLength) return i;
}
if (o && t instanceof Uint8Array) return r.from(t);
if (r.isBuffer(t) && t.constructor && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t)) return r.from(t);
throw new TypeError("The \"data\" argument must be of type string or an instance of Buffer, TypedArray, or DataView.");
}(t, e);
for (var i = this._block, n = 0; this._blockOffset + t.length - n >= this._blockSize;) {
for (var a = this._blockOffset; a < this._blockSize;) i[a++] = t[n++];
this._update(), this._blockOffset = 0;
}
for (; n < t.length;) i[this._blockOffset++] = t[n++];
for (var h = 0, u = 8 * t.length; u > 0; ++h) this._length[h] += u, (u = this._length[h] / 4294967296 | 0) > 0 && (this._length[h] -= 4294967296 * u);
return this;
}, n.prototype._update = function() {
throw new Error("_update is not implemented");
}, n.prototype.digest = function(t) {
if (this._finalized) throw new Error("Digest already called");
this._finalized = !0;
var e = this._digest();
void 0 !== t && (e = e.toString(t)), this._block.fill(0), this._blockOffset = 0;
for (var r = 0; r < 4; ++r) this._length[r] = 0;
return e;
}, n.prototype._digest = function() {
throw new Error("_digest is not implemented");
}, e.exports = n;
})), require_md5_js = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_hash_base$1(), n = require_safe_buffer$9().Buffer, o = new Array(16);
function s() {
i.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;
}
function a(t, e) {
return t << e | t >>> 32 - e;
}
function h(t, e, r, i, n, o, s) {
return a(t + (e & r | ~e & i) + n + o | 0, s) + e | 0;
}
function u(t, e, r, i, n, o, s) {
return a(t + (e & i | r & ~i) + n + o | 0, s) + e | 0;
}
function f(t, e, r, i, n, o, s) {
return a(t + (e ^ r ^ i) + n + o | 0, s) + e | 0;
}
function l(t, e, r, i, n, o, s) {
return a(t + (r ^ (e | ~i)) + n + o | 0, s) + e | 0;
}
r(s, i), s.prototype._update = function() {
for (var t = o, e = 0; e < 16; ++e) t[e] = this._block.readInt32LE(4 * e);
var r = this._a, i = this._b, n = this._c, s = this._d;
r = h(r, i, n, s, t[0], 3614090360, 7), s = h(s, r, i, n, t[1], 3905402710, 12), n = h(n, s, r, i, t[2], 606105819, 17), i = h(i, n, s, r, t[3], 3250441966, 22), r = h(r, i, n, s, t[4], 4118548399, 7), s = h(s, r, i, n, t[5], 1200080426, 12), n = h(n, s, r, i, t[6], 2821735955, 17), i = h(i, n, s, r, t[7], 4249261313, 22), r = h(r, i, n, s, t[8], 1770035416, 7), s = h(s, r, i, n, t[9], 2336552879, 12), n = h(n, s, r, i, t[10], 4294925233, 17), i = h(i, n, s, r, t[11], 2304563134, 22), r = h(r, i, n, s, t[12], 1804603682, 7), s = h(s, r, i, n, t[13], 4254626195, 12), n = h(n, s, r, i, t[14], 2792965006, 17), r = u(r, i = h(i, n, s, r, t[15], 1236535329, 22), n, s, t[1], 4129170786, 5), s = u(s, r, i, n, t[6], 3225465664, 9), n = u(n, s, r, i, t[11], 643717713, 14), i = u(i, n, s, r, t[0], 3921069994, 20), r = u(r, i, n, s, t[5], 3593408605, 5), s = u(s, r, i, n, t[10], 38016083, 9), n = u(n, s, r, i, t[15], 3634488961, 14), i = u(i, n, s, r, t[4], 3889429448, 20), r = u(r, i, n, s, t[9], 568446438, 5), s = u(s, r, i, n, t[14], 3275163606, 9), n = u(n, s, r, i, t[3], 4107603335, 14), i = u(i, n, s, r, t[8], 1163531501, 20), r = u(r, i, n, s, t[13], 2850285829, 5), s = u(s, r, i, n, t[2], 4243563512, 9), n = u(n, s, r, i, t[7], 1735328473, 14), r = f(r, i = u(i, n, s, r, t[12], 2368359562, 20), n, s, t[5], 4294588738, 4), s = f(s, r, i, n, t[8], 2272392833, 11), n = f(n, s, r, i, t[11], 1839030562, 16), i = f(i, n, s, r, t[14], 4259657740, 23), r = f(r, i, n, s, t[1], 2763975236, 4), s = f(s, r, i, n, t[4], 1272893353, 11), n = f(n, s, r, i, t[7], 4139469664, 16), i = f(i, n, s, r, t[10], 3200236656, 23), r = f(r, i, n, s, t[13], 681279174, 4), s = f(s, r, i, n, t[0], 3936430074, 11), n = f(n, s, r, i, t[3], 3572445317, 16), i = f(i, n, s, r, t[6], 76029189, 23), r = f(r, i, n, s, t[9], 3654602809, 4), s = f(s, r, i, n, t[12], 3873151461, 11), n = f(n, s, r, i, t[15], 530742520, 16), r = l(r, i = f(i, n, s, r, t[2], 3299628645, 23), n, s, t[0], 4096336452, 6), s = l(s, r, i, n, t[7], 1126891415, 10), n = l(n, s, r, i, t[14], 2878612391, 15), i = l(i, n, s, r, t[5], 4237533241, 21), r = l(r, i, n, s, t[12], 1700485571, 6), s = l(s, r, i, n, t[3], 2399980690, 10), n = l(n, s, r, i, t[10], 4293915773, 15), i = l(i, n, s, r, t[1], 2240044497, 21), r = l(r, i, n, s, t[8], 1873313359, 6), s = l(s, r, i, n, t[15], 4264355552, 10), n = l(n, s, r, i, t[6], 2734768916, 15), i = l(i, n, s, r, t[13], 1309151649, 21), r = l(r, i, n, s, t[4], 4149444226, 6), s = l(s, r, i, n, t[11], 3174756917, 10), n = l(n, s, r, i, t[2], 718787259, 15), i = l(i, n, s, r, t[9], 3951481745, 21), this._a = this._a + r | 0, this._b = this._b + i | 0, this._c = this._c + n | 0, this._d = this._d + s | 0;
}, s.prototype._digest = function() {
this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
var t = n.allocUnsafe(16);
return t.writeInt32LE(this._a, 0), t.writeInt32LE(this._b, 4), t.writeInt32LE(this._c, 8), t.writeInt32LE(this._d, 12), t;
}, e.exports = s;
})), require_ripemd160$1 = __commonJSMin(((t, e) => {
var r = require_dist().Buffer, i = require_inherits_browser(), n = require_hash_base$1(), o = new Array(16), s = [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
7,
4,
13,
1,
10,
6,
15,
3,
12,
0,
9,
5,
2,
14,
11,
8,
3,
10,
14,
4,
9,
15,
8,
1,
2,
7,
0,
6,
13,
11,
5,
12,
1,
9,
11,
10,
0,
8,
12,
4,
13,
3,
7,
15,
14,
5,
6,
2,
4,
0,
5,
9,
7,
12,
2,
10,
14,
1,
3,
8,
11,
6,
15,
13
], a = [
5,
14,
7,
0,
9,
2,
11,
4,
13,
6,
15,
8,
1,
10,
3,
12,
6,
11,
3,
7,
0,
13,
5,
10,
14,
15,
8,
12,
4,
9,
1,
2,
15,
5,
1,
3,
7,
14,
6,
9,
11,
8,
12,
2,
10,
0,
4,
13,
8,
6,
4,
1,
3,
11,
15,
0,
5,
12,
2,
13,
9,
7,
10,
14,
12,
15,
10,
4,
1,
5,
8,
7,
6,
2,
13,
14,
0,
3,
9,
11
], h = [
11,
14,
15,
12,
5,
8,
7,
9,
11,
13,
14,
15,
6,
7,
9,
8,
7,
6,
8,
13,
11,
9,
7,
15,
7,
12,
15,
9,
11,
7,
13,
12,
11,
13,
6,
7,
14,
9,
13,
15,
14,
8,
13,
6,
5,
12,
7,
5,
11,
12,
14,
15,
14,
15,
9,
8,
9,
14,
5,
6,
8,
6,
5,
12,
9,
15,
5,
11,
6,
8,
13,
12,
5,
12,
13,
14,
11,
8,
5,
6
], u = [
8,
9,
9,
11,
13,
15,
15,
5,
7,
7,
8,
11,
14,
14,
12,
6,
9,
13,
15,
7,
12,
8,
9,
11,
7,
7,
12,
7,
6,
15,
13,
11,
9,
7,
15,
11,
8,
6,
6,
14,
12,
13,
5,
14,
13,
13,
7,
5,
15,
5,
8,
11,
14,
14,
6,
14,
6,
9,
12,
9,
12,
5,
15,
8,
8,
5,
12,
9,
12,
5,
14,
6,
8,
13,
6,
5,
15,
13,
11,
11
], f = [
0,
1518500249,
1859775393,
2400959708,
2840853838
], l = [
1352829926,
1548603684,
1836072691,
2053994217,
0
];
function c() {
n.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;
}
function d(t, e) {
return t << e | t >>> 32 - e;
}
function p(t, e, r, i, n, o, s, a) {
return d(t + (e ^ r ^ i) + o + s | 0, a) + n | 0;
}
function m(t, e, r, i, n, o, s, a) {
return d(t + (e & r | ~e & i) + o + s | 0, a) + n | 0;
}
function g(t, e, r, i, n, o, s, a) {
return d(t + ((e | ~r) ^ i) + o + s | 0, a) + n | 0;
}
function y(t, e, r, i, n, o, s, a) {
return d(t + (e & i | r & ~i) + o + s | 0, a) + n | 0;
}
function b(t, e, r, i, n, o, s, a) {
return d(t + (e ^ (r | ~i)) + o + s | 0, a) + n | 0;
}
i(c, n), c.prototype._update = function() {
for (var t = o, e = 0; e < 16; ++e) t[e] = this._block.readInt32LE(4 * e);
for (var r = 0 | this._a, i = 0 | this._b, n = 0 | this._c, c = 0 | this._d, v = 0 | this._e, _ = 0 | this._a, w = 0 | this._b, M = 0 | this._c, S = 0 | this._d, E = 0 | this._e, A = 0; A < 80; A += 1) {
var C, O;
A < 16 ? (C = p(r, i, n, c, v, t[s[A]], f[0], h[A]), O = b(_, w, M, S, E, t[a[A]], l[0], u[A])) : A < 32 ? (C = m(r, i, n, c, v, t[s[A]], f[1], h[A]), O = y(_, w, M, S, E, t[a[A]], l[1], u[A])) : A < 48 ? (C = g(r, i, n, c, v, t[s[A]], f[2], h[A]), O = g(_, w, M, S, E, t[a[A]], l[2], u[A])) : A < 64 ? (C = y(r, i, n, c, v, t[s[A]], f[3], h[A]), O = m(_, w, M, S, E, t[a[A]], l[3], u[A])) : (C = b(r, i, n, c, v, t[s[A]], f[4], h[A]), O = p(_, w, M, S, E, t[a[A]], l[4], u[A])), r = v, v = c, c = d(n, 10), n = i, i = C, _ = E, E = S, S = d(M, 10), M = w, w = O;
}
var P = this._b + n + S | 0;
this._b = this._c + c + E | 0, this._c = this._d + v + _ | 0, this._d = this._e + r + w | 0, this._e = this._a + i + M | 0, this._a = P;
}, c.prototype._digest = function() {
this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
var t = r.alloc ? r.alloc(20) : new r(20);
return t.writeInt32LE(this._a, 0), t.writeInt32LE(this._b, 4), t.writeInt32LE(this._c, 8), t.writeInt32LE(this._d, 12), t.writeInt32LE(this._e, 16), t;
}, e.exports = c;
})), require_safe_buffer$7 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_safe_buffer$6 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_isarray$1 = __commonJSMin(((t, e) => {
var r = {}.toString;
e.exports = Array.isArray || function(t) {
return "[object Array]" == r.call(t);
};
})), require_typed_array_buffer = __commonJSMin(((t, e) => {
var r = require_type(), i = require_call_bound()("TypedArray.prototype.buffer", !0), n = require_is_typed_array();
e.exports = i || function(t) {
if (!n(t)) throw new r("Not a Typed Array");
return t.buffer;
};
})), require_to_buffer$1 = __commonJSMin(((t, e) => {
var r = require_safe_buffer$6().Buffer, i = require_isarray$1(), n = require_typed_array_buffer(), o = ArrayBuffer.isView || function(t) {
try {
return n(t), !0;
} catch (t) {
return !1;
}
}, s = "undefined" != typeof Uint8Array, a = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, h = a && (r.prototype instanceof Uint8Array || r.TYPED_ARRAY_SUPPORT);
e.exports = function(t, e) {
if (t instanceof r) return t;
if ("string" == typeof t) return r.from(t, e);
if (a && o(t)) {
if (0 === t.byteLength) return r.alloc(0);
if (h) {
var n = r.from(t.buffer, t.byteOffset, t.byteLength);
if (n.byteLength === t.byteLength) return n;
}
var u = t instanceof Uint8Array ? t : new Uint8Array(t.buffer, t.byteOffset, t.byteLength), f = r.from(u);
if (f.length === t.byteLength) return f;
}
if (s && t instanceof Uint8Array) return r.from(t);
var l = i(t);
if (l) for (var c = 0; c < t.length; c += 1) {
var d = t[c];
if ("number" != typeof d || d < 0 || d > 255 || ~~d !== d) throw new RangeError("Array items must be numbers in the range 0-255.");
}
if (l || r.isBuffer(t) && t.constructor && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t)) return r.from(t);
throw new TypeError("The \"data\" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.");
};
})), require_hash$1 = __commonJSMin(((t, e) => {
var r = require_safe_buffer$7().Buffer, i = require_to_buffer$1();
function n(t, e) {
this._block = r.alloc(t), this._finalSize = e, this._blockSize = t, this._len = 0;
}
n.prototype.update = function(t, e) {
t = i(t, e || "utf8");
for (var r = this._block, n = this._blockSize, o = t.length, s = this._len, a = 0; a < o;) {
for (var h = s % n, u = Math.min(o - a, n - h), f = 0; f < u; f++) r[h + f] = t[a + f];
a += u, (s += u) % n == 0 && this._update(r);
}
return this._len += o, this;
}, n.prototype.digest = function(t) {
var e = this._len % this._blockSize;
this._block[e] = 128, this._block.fill(0, e + 1), e >= this._finalSize && (this._update(this._block), this._block.fill(0));
var r = 8 * this._len;
if (r <= 4294967295) this._block.writeUInt32BE(r, this._blockSize - 4);
else {
var i = (4294967295 & r) >>> 0, n = (r - i) / 4294967296;
this._block.writeUInt32BE(n, this._blockSize - 8), this._block.writeUInt32BE(i, this._blockSize - 4);
}
this._update(this._block);
var o = this._hash();
return t ? o.toString(t) : o;
}, n.prototype._update = function() {
throw new Error("_update must be implemented by subclass");
}, e.exports = n;
})), require_sha$1 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_hash$1(), n = require_safe_buffer$7().Buffer, o = [
1518500249,
1859775393,
-1894007588,
-899497514
], s = new Array(80);
function a() {
this.init(), this._w = s, i.call(this, 64, 56);
}
function h(t) {
return t << 30 | t >>> 2;
}
function u(t, e, r, i) {
return 0 === t ? e & r | ~e & i : 2 === t ? e & r | e & i | r & i : e ^ r ^ i;
}
r(a, i), a.prototype.init = function() {
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
}, a.prototype._update = function(t) {
for (var e, r = this._w, i = 0 | this._a, n = 0 | this._b, s = 0 | this._c, a = 0 | this._d, f = 0 | this._e, l = 0; l < 16; ++l) r[l] = t.readInt32BE(4 * l);
for (; l < 80; ++l) r[l] = r[l - 3] ^ r[l - 8] ^ r[l - 14] ^ r[l - 16];
for (var c = 0; c < 80; ++c) {
var d = ~~(c / 20), p = 0 | ((e = i) << 5 | e >>> 27) + u(d, n, s, a) + f + r[c] + o[d];
f = a, a = s, s = h(n), n = i, i = p;
}
this._a = i + this._a | 0, this._b = n + this._b | 0, this._c = s + this._c | 0, this._d = a + this._d | 0, this._e = f + this._e | 0;
}, a.prototype._hash = function() {
var t = n.allocUnsafe(20);
return t.writeInt32BE(0 | this._a, 0), t.writeInt32BE(0 | this._b, 4), t.writeInt32BE(0 | this._c, 8), t.writeInt32BE(0 | this._d, 12), t.writeInt32BE(0 | this._e, 16), t;
}, e.exports = a;
})), require_sha1$1 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_hash$1(), n = require_safe_buffer$7().Buffer, o = [
1518500249,
1859775393,
-1894007588,
-899497514
], s = new Array(80);
function a() {
this.init(), this._w = s, i.call(this, 64, 56);
}
function h(t) {
return t << 5 | t >>> 27;
}
function u(t) {
return t << 30 | t >>> 2;
}
function f(t, e, r, i) {
return 0 === t ? e & r | ~e & i : 2 === t ? e & r | e & i | r & i : e ^ r ^ i;
}
r(a, i), a.prototype.init = function() {
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
}, a.prototype._update = function(t) {
for (var e, r = this._w, i = 0 | this._a, n = 0 | this._b, s = 0 | this._c, a = 0 | this._d, l = 0 | this._e, c = 0; c < 16; ++c) r[c] = t.readInt32BE(4 * c);
for (; c < 80; ++c) r[c] = (e = r[c - 3] ^ r[c - 8] ^ r[c - 14] ^ r[c - 16]) << 1 | e >>> 31;
for (var d = 0; d < 80; ++d) {
var p = ~~(d / 20), m = h(i) + f(p, n, s, a) + l + r[d] + o[p] | 0;
l = a, a = s, s = u(n), n = i, i = m;
}
this._a = i + this._a | 0, this._b = n + this._b | 0, this._c = s + this._c | 0, this._d = a + this._d | 0, this._e = l + this._e | 0;
}, a.prototype._hash = function() {
var t = n.allocUnsafe(20);
return t.writeInt32BE(0 | this._a, 0), t.writeInt32BE(0 | this._b, 4), t.writeInt32BE(0 | this._c, 8), t.writeInt32BE(0 | this._d, 12), t.writeInt32BE(0 | this._e, 16), t;
}, e.exports = a;
})), require_sha256 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_hash$1(), n = require_safe_buffer$7().Buffer, o = [
1116352408,
1899447441,
3049323471,
3921009573,
961987163,
1508970993,
2453635748,
2870763221,
3624381080,
310598401,
607225278,
1426881987,
1925078388,
2162078206,
2614888103,
3248222580,
3835390401,
4022224774,
264347078,
604807628,
770255983,
1249150122,
1555081692,
1996064986,
2554220882,
2821834349,
2952996808,
3210313671,
3336571891,
3584528711,
113926993,
338241895,
666307205,
773529912,
1294757372,
1396182291,
1695183700,
1986661051,
2177026350,
2456956037,
2730485921,
2820302411,
3259730800,
3345764771,
3516065817,
3600352804,
4094571909,
275423344,
430227734,
506948616,
659060556,
883997877,
958139571,
1322822218,
1537002063,
1747873779,
1955562222,
2024104815,
2227730452,
2361852424,
2428436474,
2756734187,
3204031479,
3329325298
], s = new Array(64);
function a() {
this.init(), this._w = s, i.call(this, 64, 56);
}
function h(t, e, r) {
return r ^ t & (e ^ r);
}
function u(t, e, r) {
return t & e | r & (t | e);
}
function f(t) {
return (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10);
}
function l(t) {
return (t >>> 6 | t << 26) ^ (t >>> 11 | t << 21) ^ (t >>> 25 | t << 7);
}
function c(t) {
return (t >>> 7 | t << 25) ^ (t >>> 18 | t << 14) ^ t >>> 3;
}
r(a, i), a.prototype.init = function() {
return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;
}, a.prototype._update = function(t) {
for (var e, r = this._w, i = 0 | this._a, n = 0 | this._b, s = 0 | this._c, a = 0 | this._d, d = 0 | this._e, p = 0 | this._f, m = 0 | this._g, g = 0 | this._h, y = 0; y < 16; ++y) r[y] = t.readInt32BE(4 * y);
for (; y < 64; ++y) r[y] = 0 | (((e = r[y - 2]) >>> 17 | e << 15) ^ (e >>> 19 | e << 13) ^ e >>> 10) + r[y - 7] + c(r[y - 15]) + r[y - 16];
for (var b = 0; b < 64; ++b) {
var v = g + l(d) + h(d, p, m) + o[b] + r[b] | 0, _ = f(i) + u(i, n, s) | 0;
g = m, m = p, p = d, d = a + v | 0, a = s, s = n, n = i, i = v + _ | 0;
}
this._a = i + this._a | 0, this._b = n + this._b | 0, this._c = s + this._c | 0, this._d = a + this._d | 0, this._e = d + this._e | 0, this._f = p + this._f | 0, this._g = m + this._g | 0, this._h = g + this._h | 0;
}, a.prototype._hash = function() {
var t = n.allocUnsafe(32);
return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t.writeInt32BE(this._h, 28), t;
}, e.exports = a;
})), require_sha224 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_sha256(), n = require_hash$1(), o = require_safe_buffer$7().Buffer, s = new Array(64);
function a() {
this.init(), this._w = s, n.call(this, 64, 56);
}
r(a, i), a.prototype.init = function() {
return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;
}, a.prototype._hash = function() {
var t = o.allocUnsafe(28);
return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t;
}, e.exports = a;
})), require_sha512 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_hash$1(), n = require_safe_buffer$7().Buffer, o = [
1116352408,
3609767458,
1899447441,
602891725,
3049323471,
3964484399,
3921009573,
2173295548,
961987163,
4081628472,
1508970993,
3053834265,
2453635748,
2937671579,
2870763221,
3664609560,
3624381080,
2734883394,
310598401,
1164996542,
607225278,
1323610764,
1426881987,
3590304994,
1925078388,
4068182383,
2162078206,
991336113,
2614888103,
633803317,
3248222580,
3479774868,
3835390401,
2666613458,
4022224774,
944711139,
264347078,
2341262773,
604807628,
2007800933,
770255983,
1495990901,
1249150122,
1856431235,
1555081692,
3175218132,
1996064986,
2198950837,
2554220882,
3999719339,
2821834349,
766784016,
2952996808,
2566594879,
3210313671,
3203337956,
3336571891,
1034457026,
3584528711,
2466948901,
113926993,
3758326383,
338241895,
168717936,
666307205,
1188179964,
773529912,
1546045734,
1294757372,
1522805485,
1396182291,
2643833823,
1695183700,
2343527390,
1986661051,
1014477480,
2177026350,
1206759142,
2456956037,
344077627,
2730485921,
1290863460,
2820302411,
3158454273,
3259730800,
3505952657,
3345764771,
106217008,
3516065817,
3606008344,
3600352804,
1432725776,
4094571909,
1467031594,
275423344,
851169720,
430227734,
3100823752,
506948616,
1363258195,
659060556,
3750685593,
883997877,
3785050280,
958139571,
3318307427,
1322822218,
3812723403,
1537002063,
2003034995,
1747873779,
3602036899,
1955562222,
1575990012,
2024104815,
1125592928,
2227730452,
2716904306,
2361852424,
442776044,
2428436474,
593698344,
2756734187,
3733110249,
3204031479,
2999351573,
3329325298,
3815920427,
3391569614,
3928383900,
3515267271,
566280711,
3940187606,
3454069534,
4118630271,
4000239992,
116418474,
1914138554,
174292421,
2731055270,
289380356,
3203993006,
460393269,
320620315,
685471733,
587496836,
852142971,
1086792851,
1017036298,
365543100,
1126000580,
2618297676,
1288033470,
3409855158,
1501505948,
4234509866,
1607167915,
987167468,
1816402316,
1246189591
], s = new Array(160);
function a() {
this.init(), this._w = s, i.call(this, 128, 112);
}
function h(t, e, r) {
return r ^ t & (e ^ r);
}
function u(t, e, r) {
return t & e | r & (t | e);
}
function f(t, e) {
return (t >>> 28 | e << 4) ^ (e >>> 2 | t << 30) ^ (e >>> 7 | t << 25);
}
function l(t, e) {
return (t >>> 14 | e << 18) ^ (t >>> 18 | e << 14) ^ (e >>> 9 | t << 23);
}
function c(t, e) {
return (t >>> 1 | e << 31) ^ (t >>> 8 | e << 24) ^ t >>> 7;
}
function d(t, e) {
return (t >>> 1 | e << 31) ^ (t >>> 8 | e << 24) ^ (t >>> 7 | e << 25);
}
function p(t, e) {
return (t >>> 19 | e << 13) ^ (e >>> 29 | t << 3) ^ t >>> 6;
}
function m(t, e) {
return (t >>> 19 | e << 13) ^ (e >>> 29 | t << 3) ^ (t >>> 6 | e << 26);
}
function g(t, e) {
return t >>> 0 < e >>> 0 ? 1 : 0;
}
r(a, i), a.prototype.init = function() {
return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;
}, a.prototype._update = function(t) {
for (var e = this._w, r = 0 | this._ah, i = 0 | this._bh, n = 0 | this._ch, s = 0 | this._dh, a = 0 | this._eh, y = 0 | this._fh, b = 0 | this._gh, v = 0 | this._hh, _ = 0 | this._al, w = 0 | this._bl, M = 0 | this._cl, S = 0 | this._dl, E = 0 | this._el, A = 0 | this._fl, C = 0 | this._gl, O = 0 | this._hl, P = 0; P < 32; P += 2) e[P] = t.readInt32BE(4 * P), e[P + 1] = t.readInt32BE(4 * P + 4);
for (; P < 160; P += 2) {
var I = e[P - 30], k = e[P - 30 + 1], R = c(I, k), q = d(k, I), T = p(I = e[P - 4], k = e[P - 4 + 1]), x = m(k, I), N = e[P - 14], B = e[P - 14 + 1], j = e[P - 32], L = e[P - 32 + 1], D = q + B | 0, U = R + N + g(D, q) | 0;
U = (U = U + T + g(D = D + x | 0, x) | 0) + j + g(D = D + L | 0, L) | 0, e[P] = U, e[P + 1] = D;
}
for (var $ = 0; $ < 160; $ += 2) {
U = e[$], D = e[$ + 1];
var F = u(r, i, n), J = u(_, w, M), z = f(r, _), K = f(_, r), W = l(a, E), V = l(E, a), H = o[$], Z = o[$ + 1], Q = h(a, y, b), Y = h(E, A, C), G = O + V | 0, X = v + W + g(G, O) | 0;
X = (X = (X = X + Q + g(G = G + Y | 0, Y) | 0) + H + g(G = G + Z | 0, Z) | 0) + U + g(G = G + D | 0, D) | 0;
var tt = K + J | 0, et = z + F + g(tt, K) | 0;
v = b, O = C, b = y, C = A, y = a, A = E, a = s + X + g(E = S + G | 0, S) | 0, s = n, S = M, n = i, M = w, i = r, w = _, r = X + et + g(_ = G + tt | 0, G) | 0;
}
this._al = this._al + _ | 0, this._bl = this._bl + w | 0, this._cl = this._cl + M | 0, this._dl = this._dl + S | 0, this._el = this._el + E | 0, this._fl = this._fl + A | 0, this._gl = this._gl + C | 0, this._hl = this._hl + O | 0, this._ah = this._ah + r + g(this._al, _) | 0, this._bh = this._bh + i + g(this._bl, w) | 0, this._ch = this._ch + n + g(this._cl, M) | 0, this._dh = this._dh + s + g(this._dl, S) | 0, this._eh = this._eh + a + g(this._el, E) | 0, this._fh = this._fh + y + g(this._fl, A) | 0, this._gh = this._gh + b + g(this._gl, C) | 0, this._hh = this._hh + v + g(this._hl, O) | 0;
}, a.prototype._hash = function() {
var t = n.allocUnsafe(64);
function e(e, r, i) {
t.writeInt32BE(e, i), t.writeInt32BE(r, i + 4);
}
return e(this._ah, this._al, 0), e(this._bh, this._bl, 8), e(this._ch, this._cl, 16), e(this._dh, this._dl, 24), e(this._eh, this._el, 32), e(this._fh, this._fl, 40), e(this._gh, this._gl, 48), e(this._hh, this._hl, 56), t;
}, e.exports = a;
})), require_sha384 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_sha512(), n = require_hash$1(), o = require_safe_buffer$7().Buffer, s = new Array(160);
function a() {
this.init(), this._w = s, n.call(this, 128, 112);
}
r(a, i), a.prototype.init = function() {
return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;
}, a.prototype._hash = function() {
var t = o.allocUnsafe(48);
function e(e, r, i) {
t.writeInt32BE(e, i), t.writeInt32BE(r, i + 4);
}
return e(this._ah, this._al, 0), e(this._bh, this._bl, 8), e(this._ch, this._cl, 16), e(this._dh, this._dl, 24), e(this._eh, this._el, 32), e(this._fh, this._fl, 40), t;
}, e.exports = a;
})), require_sha_js = __commonJSMin(((t, e) => {
e.exports = function(t) {
var r = t.toLowerCase(), i = e.exports[r];
if (!i) throw new Error(r + " is not supported (we accept pull requests)");
return new i();
}, e.exports.sha = require_sha$1(), e.exports.sha1 = require_sha1$1(), e.exports.sha224 = require_sha224(), e.exports.sha256 = require_sha256(), e.exports.sha384 = require_sha384(), e.exports.sha512 = require_sha512();
})), require_safe_buffer$5 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_cipher_base = __commonJSMin(((t, e) => {
var r = require_safe_buffer$5().Buffer, i = require_stream_browserify().Transform, n = require_string_decoder().StringDecoder;
function o(t) {
i.call(this), this.hashMode = "string" == typeof t, this.hashMode ? this[t] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
}
require_inherits_browser()(o, i);
var s = "undefined" != typeof Uint8Array, a = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array && ArrayBuffer.isView && (r.prototype instanceof Uint8Array || r.TYPED_ARRAY_SUPPORT);
o.prototype.update = function(t, e, i) {
var n = function(t, e) {
if (t instanceof r) return t;
if ("string" == typeof t) return r.from(t, e);
if (a && ArrayBuffer.isView(t)) {
if (0 === t.byteLength) return r.alloc(0);
var i = r.from(t.buffer, t.byteOffset, t.byteLength);
if (i.byteLength === t.byteLength) return i;
}
if (s && t instanceof Uint8Array) return r.from(t);
if (r.isBuffer(t) && t.constructor && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t)) return r.from(t);
throw new TypeError("The \"data\" argument must be of type string or an instance of Buffer, TypedArray, or DataView.");
}(t, e), o = this._update(n);
return this.hashMode ? this : (i && (o = this._toString(o, i)), o);
}, 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(t, e, r) {
var i;
try {
this.hashMode ? this._update(t) : this.push(this._update(t));
} catch (t) {
i = t;
} finally {
r(i);
}
}, o.prototype._flush = function(t) {
var e;
try {
this.push(this.__final());
} catch (t) {
e = t;
}
t(e);
}, o.prototype._finalOrDigest = function(t) {
var e = this.__final() || r.alloc(0);
return t && (e = this._toString(e, t, !0)), e;
}, o.prototype._toString = function(t, e, r) {
if (this._decoder || (this._decoder = new n(e), this._encoding = e), this._encoding !== e) throw new Error("can’t switch encodings");
var i = this._decoder.write(t);
return r && (i += this._decoder.end()), i;
}, e.exports = o;
})), require_browser$10 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_md5_js(), n = require_ripemd160$1(), o = require_sha_js(), s = require_cipher_base();
function a(t) {
s.call(this, "digest"), this._hash = t;
}
r(a, s), a.prototype._update = function(t) {
this._hash.update(t);
}, a.prototype._final = function() {
return this._hash.digest();
}, e.exports = function(t) {
return "md5" === (t = t.toLowerCase()) ? new i() : "rmd160" === t || "ripemd160" === t ? new n() : new a(o(t));
};
})), require_legacy = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_safe_buffer$9().Buffer, n = require_cipher_base(), o = i.alloc(128), s = 64;
function a(t, e) {
n.call(this, "digest"), "string" == typeof e && (e = i.from(e)), this._alg = t, this._key = e, e.length > s ? e = t(e) : e.length < s && (e = i.concat([e, o], s));
for (var r = this._ipad = i.allocUnsafe(s), a = this._opad = i.allocUnsafe(s), h = 0; h < s; h++) r[h] = 54 ^ e[h], a[h] = 92 ^ e[h];
this._hash = [r];
}
r(a, n), a.prototype._update = function(t) {
this._hash.push(t);
}, a.prototype._final = function() {
var t = this._alg(i.concat(this._hash));
return this._alg(i.concat([this._opad, t]));
}, e.exports = a;
})), require_md5$2 = __commonJSMin(((t, e) => {
var r = require_md5_js();
e.exports = function(t) {
return new r().update(t).digest();
};
})), require_browser$9 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_legacy(), n = require_cipher_base(), o = require_safe_buffer$9().Buffer, s = require_md5$2(), a = require_ripemd160$1(), h = require_sha_js(), u = o.alloc(128);
function f(t, e) {
n.call(this, "digest"), "string" == typeof e && (e = o.from(e));
var r = "sha512" === t || "sha384" === t ? 128 : 64;
this._alg = t, this._key = e, e.length > r ? e = ("rmd160" === t ? new a() : h(t)).update(e).digest() : e.length < r && (e = o.concat([e, u], r));
for (var i = this._ipad = o.allocUnsafe(r), s = this._opad = o.allocUnsafe(r), f = 0; f < r; f++) i[f] = 54 ^ e[f], s[f] = 92 ^ e[f];
this._hash = "rmd160" === t ? new a() : h(t), this._hash.update(i);
}
r(f, n), f.prototype._update = function(t) {
this._hash.update(t);
}, f.prototype._final = function() {
var t = this._hash.digest();
return ("rmd160" === this._alg ? new a() : h(this._alg)).update(this._opad).update(t).digest();
}, e.exports = function(t, e) {
return "rmd160" === (t = t.toLowerCase()) || "ripemd160" === t ? new f("rmd160", e) : "md5" === t ? new i(s, e) : new f(t, e);
};
})), algorithms_exports = __exportAll({
DSA: () => DSA,
default: () => algorithms_default,
md5WithRSAEncryption: () => md5WithRSAEncryption,
ripemd160WithRSA: () => ripemd160WithRSA,
sha224: () => sha224,
sha224WithRSAEncryption: () => sha224WithRSAEncryption,
sha256: () => sha256,
sha256WithRSAEncryption: () => sha256WithRSAEncryption,
sha384: () => sha384,
sha384WithRSAEncryption: () => sha384WithRSAEncryption,
sha512: () => sha512,
sha512WithRSAEncryption: () => sha512WithRSAEncryption
}), sha224WithRSAEncryption, sha256WithRSAEncryption, sha384WithRSAEncryption, sha512WithRSAEncryption, sha256, sha224, sha384, sha512, DSA, ripemd160WithRSA, md5WithRSAEncryption, algorithms_default, init_algorithms = __esmMin((() => {
algorithms_default = {
sha224WithRSAEncryption: sha224WithRSAEncryption = {
sign: "rsa",
hash: "sha224",
id: "302d300d06096086480165030402040500041c"
},
"RSA-SHA224": {
sign: "ecdsa/rsa",
hash: "sha224",
id: "302d300d06096086480165030402040500041c"
},
sha256WithRSAEncryption: sha256WithRSAEncryption = {
sign: "rsa",
hash: "sha256",
id: "3031300d060960864801650304020105000420"
},
"RSA-SHA256": {
sign: "ecdsa/rsa",
hash: "sha256",
id: "3031300d060960864801650304020105000420"
},
sha384WithRSAEncryption: sha384WithRSAEncryption = {
sign: "rsa",
hash: "sha384",
id: "3041300d060960864801650304020205000430"
},
"RSA-SHA384": {
sign: "ecdsa/rsa",
hash: "sha384",
id: "3041300d060960864801650304020205000430"
},
sha512WithRSAEncryption: 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: sha256 = {
sign: "ecdsa",
hash: "sha256",
id: ""
},
sha224: sha224 = {
sign: "ecdsa",
hash: "sha224",
id: ""
},
sha384: sha384 = {
sign: "ecdsa",
hash: "sha384",
id: ""
},
sha512: sha512 = {
sign: "ecdsa",
hash: "sha512",
id: ""
},
"DSA-SHA": {
sign: "dsa",
hash: "sha1",
id: ""
},
"DSA-SHA1": {
sign: "dsa",
hash: "sha1",
id: ""
},
DSA: 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: ripemd160WithRSA = {
sign: "rsa",
hash: "rmd160",
id: "3021300906052b2403020105000414"
},
"RSA-RIPEMD160": {
sign: "rsa",
hash: "rmd160",
id: "3021300906052b2403020105000414"
},
md5WithRSAEncryption: md5WithRSAEncryption = {
sign: "rsa",
hash: "md5",
id: "3020300c06082a864886f70d020505000410"
},
"RSA-MD5": {
sign: "rsa",
hash: "md5",
id: "3020300c06082a864886f70d020505000410"
}
};
})), require_algos = __commonJSMin(((t, e) => {
e.exports = (init_algorithms(), __toCommonJS(algorithms_exports).default);
})), require_safe_buffer$4 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_precondition = __commonJSMin(((t, e) => {
var r = Math.pow(2, 30) - 1;
e.exports = function(t, e) {
if ("number" != typeof t) throw new TypeError("Iterations not a number");
if (t < 0) throw new TypeError("Bad iterations");
if ("number" != typeof e) throw new TypeError("Key length not a number");
if (e < 0 || e > r || e != e) throw new TypeError("Bad key length");
};
})), require_default_encoding = __commonJSMin(((t, e) => {
var r;
init_dist(), init_dist$2(), r = global.process && global.process.browser ? "utf-8" : global.process && global.process.version ? parseInt(process$1.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary" : "utf-8", e.exports = r;
})), require_make_hash = __commonJSMin(((t, e) => {
init_dist$1();
var r = new Buffer$1(4);
r.fill(0);
e.exports = function(t, e) {
var i = e(function(t) {
if (t.length % 4 != 0) {
var e = t.length + (4 - t.length % 4);
t = Buffer$1.concat([t, r], e);
}
for (var i = new Array(t.length >>> 2), n = 0, o = 0; n < t.length; n += 4, o++) i[o] = t.readInt32LE(n);
return i;
}(t), 8 * t.length);
t = new Buffer$1(16);
for (var n = 0; n < i.length; n++) t.writeInt32LE(i[n], n << 2, !0);
return t;
};
})), require_md5$1 = __commonJSMin(((t, e) => {
var r = require_make_hash();
function i(t, e) {
t[e >> 5] |= 128 << e % 32, t[14 + (e + 64 >>> 9 << 4)] = e;
for (var r = 1732584193, i = -271733879, n = -1732584194, f = 271733878, l = 0; l < t.length; l += 16) {
var c = r, d = i, p = n, m = f;
r = o(r, i, n, f, t[l + 0], 7, -680876936), f = o(f, r, i, n, t[l + 1], 12, -389564586), n = o(n, f, r, i, t[l + 2], 17, 606105819), i = o(i, n, f, r, t[l + 3], 22, -1044525330), r = o(r, i, n, f, t[l + 4], 7, -176418897), f = o(f, r, i, n, t[l + 5], 12, 1200080426), n = o(n, f, r, i, t[l + 6], 17, -1473231341), i = o(i, n, f, r, t[l + 7], 22, -45705983), r = o(r, i, n, f, t[l + 8], 7, 1770035416), f = o(f, r, i, n, t[l + 9], 12, -1958414417), n = o(n, f, r, i, t[l + 10], 17, -42063), i = o(i, n, f, r, t[l + 11], 22, -1990404162), r = o(r, i, n, f, t[l + 12], 7, 1804603682), f = o(f, r, i, n, t[l + 13], 12, -40341101), n = o(n, f, r, i, t[l + 14], 17, -1502002290), r = s(r, i = o(i, n, f, r, t[l + 15], 22, 1236535329), n, f, t[l + 1], 5, -165796510), f = s(f, r, i, n, t[l + 6], 9, -1069501632), n = s(n, f, r, i, t[l + 11], 14, 643717713), i = s(i, n, f, r, t[l + 0], 20, -373897302), r = s(r, i, n, f, t[l + 5], 5, -701558691), f = s(f, r, i, n, t[l + 10], 9, 38016083), n = s(n, f, r, i, t[l + 15], 14, -660478335), i = s(i, n, f, r, t[l + 4], 20, -405537848), r = s(r, i, n, f, t[l + 9], 5, 568446438), f = s(f, r, i, n, t[l + 14], 9, -1019803690), n = s(n, f, r, i, t[l + 3], 14, -187363961), i = s(i, n, f, r, t[l + 8], 20, 1163531501), r = s(r, i, n, f, t[l + 13], 5, -1444681467), f = s(f, r, i, n, t[l + 2], 9, -51403784), n = s(n, f, r, i, t[l + 7], 14, 1735328473), r = a(r, i = s(i, n, f, r, t[l + 12], 20, -1926607734), n, f, t[l + 5], 4, -378558), f = a(f, r, i, n, t[l + 8], 11, -2022574463), n = a(n, f, r, i, t[l + 11], 16, 1839030562), i = a(i, n, f, r, t[l + 14], 23, -35309556), r = a(r, i, n, f, t[l + 1], 4, -1530992060), f = a(f, r, i, n, t[l + 4], 11, 1272893353), n = a(n, f, r, i, t[l + 7], 16, -155497632), i = a(i, n, f, r, t[l + 10], 23, -1094730640), r = a(r, i, n, f, t[l + 13], 4, 681279174), f = a(f, r, i, n, t[l + 0], 11, -358537222), n = a(n, f, r, i, t[l + 3], 16, -722521979), i = a(i, n, f, r, t[l + 6], 23, 76029189), r = a(r, i, n, f, t[l + 9], 4, -640364487), f = a(f, r, i, n, t[l + 12], 11, -421815835), n = a(n, f, r, i, t[l + 15], 16, 530742520), r = h(r, i = a(i, n, f, r, t[l + 2], 23, -995338651), n, f, t[l + 0], 6, -198630844), f = h(f, r, i, n, t[l + 7], 10, 1126891415), n = h(n, f, r, i, t[l + 14], 15, -1416354905), i = h(i, n, f, r, t[l + 5], 21, -57434055), r = h(r, i, n, f, t[l + 12], 6, 1700485571), f = h(f, r, i, n, t[l + 3], 10, -1894986606), n = h(n, f, r, i, t[l + 10], 15, -1051523), i = h(i, n, f, r, t[l + 1], 21, -2054922799), r = h(r, i, n, f, t[l + 8], 6, 1873313359), f = h(f, r, i, n, t[l + 15], 10, -30611744), n = h(n, f, r, i, t[l + 6], 15, -1560198380), i = h(i, n, f, r, t[l + 13], 21, 1309151649), r = h(r, i, n, f, t[l + 4], 6, -145523070), f = h(f, r, i, n, t[l + 11], 10, -1120210379), n = h(n, f, r, i, t[l + 2], 15, 718787259), i = h(i, n, f, r, t[l + 9], 21, -343485551), r = u(r, c), i = u(i, d), n = u(n, p), f = u(f, m);
}
return [
r,
i,
n,
f
];
}
function n(t, e, r, i, n, o) {
return u((s = u(u(e, t), u(i, o))) << (a = n) | s >>> 32 - a, r);
var s, a;
}
function o(t, e, r, i, o, s, a) {
return n(e & r | ~e & i, t, e, o, s, a);
}
function s(t, e, r, i, o, s, a) {
return n(e & i | r & ~i, t, e, o, s, a);
}
function a(t, e, r, i, o, s, a) {
return n(e ^ r ^ i, t, e, o, s, a);
}
function h(t, e, r, i, o, s, a) {
return n(r ^ (e | ~i), t, e, o, s, a);
}
function u(t, e) {
var r = (65535 & t) + (65535 & e);
return (t >> 16) + (e >> 16) + (r >> 16) << 16 | 65535 & r;
}
e.exports = function(t) {
return r(t, i);
};
})), require_hash_base = __commonJSMin(((t, e) => {
init_dist$1();
var r = require_stream_browserify().Transform;
function i(t) {
r.call(this), this._block = new Buffer$1(t), this._blockSize = t, this._blockOffset = 0, this._length = [
0,
0,
0,
0
], this._finalized = !1;
}
require_inherits_browser()(i, r), i.prototype._transform = function(t, e, r) {
var i = null;
try {
"buffer" !== e && (t = new Buffer$1(t, e)), this.update(t);
} catch (t) {
i = t;
}
r(i);
}, i.prototype._flush = function(t) {
var e = null;
try {
this.push(this._digest());
} catch (t) {
e = t;
}
t(e);
}, i.prototype.update = function(t, e) {
if (!Buffer$1.isBuffer(t) && "string" != typeof t) throw new TypeError("Data must be a string or a buffer");
if (this._finalized) throw new Error("Digest already called");
Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e || "binary"));
for (var r = this._block, i = 0; this._blockOffset + t.length - i >= this._blockSize;) {
for (var n = this._blockOffset; n < this._blockSize;) r[n++] = t[i++];
this._update(), this._blockOffset = 0;
}
for (; i < t.length;) r[this._blockOffset++] = t[i++];
for (var o = 0, s = 8 * t.length; s > 0; ++o) this._length[o] += s, (s = this._length[o] / 4294967296 | 0) > 0 && (this._length[o] -= 4294967296 * s);
return this;
}, i.prototype._update = function(t) {
throw new Error("_update is not implemented");
}, i.prototype.digest = function(t) {
if (this._finalized) throw new Error("Digest already called");
this._finalized = !0;
var e = this._digest();
return void 0 !== t && (e = e.toString(t)), e;
}, i.prototype._digest = function() {
throw new Error("_digest is not implemented");
}, e.exports = i;
})), require_ripemd160 = __commonJSMin(((t, e) => {
init_dist$1();
var r = require_inherits_browser(), i = require_hash_base();
function n() {
i.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;
}
function o(t, e) {
return t << e | t >>> 32 - e;
}
function s(t, e, r, i, n, s, a, h) {
return o(t + (e ^ r ^ i) + s + a | 0, h) + n | 0;
}
function a(t, e, r, i, n, s, a, h) {
return o(t + (e & r | ~e & i) + s + a | 0, h) + n | 0;
}
function h(t, e, r, i, n, s, a, h) {
return o(t + ((e | ~r) ^ i) + s + a | 0, h) + n | 0;
}
function u(t, e, r, i, n, s, a, h) {
return o(t + (e & i | r & ~i) + s + a | 0, h) + n | 0;
}
function f(t, e, r, i, n, s, a, h) {
return o(t + (e ^ (r | ~i)) + s + a | 0, h) + n | 0;
}
r(n, i), n.prototype._update = function() {
for (var t = new Array(16), e = 0; e < 16; ++e) t[e] = this._block.readInt32LE(4 * e);
var r = this._a, i = this._b, n = this._c, l = this._d, c = this._e;
r = s(r, i, n, l, c, t[0], 0, 11), c = s(c, r, i, n = o(n, 10), l, t[1], 0, 14), l = s(l, c, r, i = o(i, 10), n, t[2], 0, 15), n = s(n, l, c, r = o(r, 10), i, t[3], 0, 12), i = s(i, n, l, c = o(c, 10), r, t[4], 0, 5), r = s(r, i, n, l = o(l, 10), c, t[5], 0, 8), c = s(c, r, i, n = o(n, 10), l, t[6], 0, 7), l = s(l, c, r, i = o(i, 10), n, t[7], 0, 9), n = s(n, l, c, r = o(r, 10), i, t[8], 0, 11), i = s(i, n, l, c = o(c, 10), r, t[9], 0, 13), r = s(r, i, n, l = o(l, 10), c, t[10], 0, 14), c = s(c, r, i, n = o(n, 10), l, t[11], 0, 15), l = s(l, c, r, i = o(i, 10), n, t[12], 0, 6), n = s(n, l, c, r = o(r, 10), i, t[13], 0, 7), i = s(i, n, l, c = o(c, 10), r, t[14], 0, 9), c = a(c, r = s(r, i, n, l = o(l, 10), c, t[15], 0, 8), i, n = o(n, 10), l, t[7], 1518500249, 7), l = a(l, c, r, i = o(i, 10), n, t[4], 1518500249, 6), n = a(n, l, c, r = o(r, 10), i, t[13], 1518500249, 8), i = a(i, n, l, c = o(c, 10), r, t[1], 1518500249, 13), r = a(r, i, n, l = o(l, 10), c, t[10], 1518500249, 11), c = a(c, r, i, n = o(n, 10), l, t[6], 1518500249, 9), l = a(l, c, r, i = o(i, 10), n, t[15], 1518500249, 7), n = a(n, l, c, r = o(r, 10), i, t[3], 1518500249, 15), i = a(i, n, l, c = o(c, 10), r, t[12], 1518500249, 7), r = a(r, i, n, l = o(l, 10), c, t[0], 1518500249, 12), c = a(c, r, i, n = o(n, 10), l, t[9], 1518500249, 15), l = a(l, c, r, i = o(i, 10), n, t[5], 1518500249, 9), n = a(n, l, c, r = o(r, 10), i, t[2], 1518500249, 11), i = a(i, n, l, c = o(c, 10), r, t[14], 1518500249, 7), r = a(r, i, n, l = o(l, 10), c, t[11], 1518500249, 13), l = h(l, c = a(c, r, i, n = o(n, 10), l, t[8], 1518500249, 12), r, i = o(i, 10), n, t[3], 1859775393, 11), n = h(n, l, c, r = o(r, 10), i, t[10], 1859775393, 13), i = h(i, n, l, c = o(c, 10), r, t[14], 1859775393, 6), r = h(r, i, n, l = o(l, 10), c, t[4], 1859775393, 7), c = h(c, r, i, n = o(n, 10), l, t[9], 1859775393, 14), l = h(l, c, r, i = o(i, 10), n, t[15], 1859775393, 9), n = h(n, l, c, r = o(r, 10), i, t[8], 1859775393, 13), i = h(i, n, l, c = o(c, 10), r, t[1], 1859775393, 15), r = h(r, i, n, l = o(l, 10), c, t[2], 1859775393, 14), c = h(c, r, i, n = o(n, 10), l, t[7], 1859775393, 8), l = h(l, c, r, i = o(i, 10), n, t[0], 1859775393, 13), n = h(n, l, c, r = o(r, 10), i, t[6], 1859775393, 6), i = h(i, n, l, c = o(c, 10), r, t[13], 1859775393, 5), r = h(r, i, n, l = o(l, 10), c, t[11], 1859775393, 12), c = h(c, r, i, n = o(n, 10), l, t[5], 1859775393, 7), n = u(n, l = h(l, c, r, i = o(i, 10), n, t[12], 1859775393, 5), c, r = o(r, 10), i, t[1], 2400959708, 11), i = u(i, n, l, c = o(c, 10), r, t[9], 2400959708, 12), r = u(r, i, n, l = o(l, 10), c, t[11], 2400959708, 14), c = u(c, r, i, n = o(n, 10), l, t[10], 2400959708, 15), l = u(l, c, r, i = o(i, 10), n, t[0], 2400959708, 14), n = u(n, l, c, r = o(r, 10), i, t[8], 2400959708, 15), i = u(i, n, l, c = o(c, 10), r, t[12], 2400959708, 9), r = u(r, i, n, l = o(l, 10), c, t[4], 2400959708, 8), c = u(c, r, i, n = o(n, 10), l, t[13], 2400959708, 9), l = u(l, c, r, i = o(i, 10), n, t[3], 2400959708, 14), n = u(n, l, c, r = o(r, 10), i, t[7], 2400959708, 5), i = u(i, n, l, c = o(c, 10), r, t[15], 2400959708, 6), r = u(r, i, n, l = o(l, 10), c, t[14], 2400959708, 8), c = u(c, r, i, n = o(n, 10), l, t[5], 2400959708, 6), l = u(l, c, r, i = o(i, 10), n, t[6], 2400959708, 5), i = f(i, n = u(n, l, c, r = o(r, 10), i, t[2], 2400959708, 12), l, c = o(c, 10), r, t[4], 2840853838, 9), r = f(r, i, n, l = o(l, 10), c, t[0], 2840853838, 15), c = f(c, r, i, n = o(n, 10), l, t[5], 2840853838, 5), l = f(l, c, r, i = o(i, 10), n, t[9], 2840853838, 11), n = f(n, l, c, r = o(r, 10), i, t[7], 2840853838, 6), i = f(i, n, l, c = o(c, 10), r, t[12], 2840853838, 8), r = f(r, i, n, l = o(l, 10), c, t[2], 2840853838, 13), c = f(c, r, i, n = o(n, 10), l, t[10], 2840853838, 12), l = f(l, c, r, i = o(i, 10), n, t[14], 2840853838, 5), n = f(n, l, c, r = o(r, 10), i, t[1], 2840853838, 12), i = f(i, n, l, c = o(c, 10), r, t[3], 2840853838, 13), r = f(r, i, n, l = o(l, 10), c, t[8], 2840853838, 14), c = f(c, r, i, n = o(n, 10), l, t[11], 2840853838, 11), l = f(l, c, r, i = o(i, 10), n, t[6], 2840853838, 8), n = f(n, l, c, r = o(r, 10), i, t[15], 2840853838, 5), i = f(i, n, l, c = o(c, 10), r, t[13], 2840853838, 6), l = o(l, 10);
var d = this._a, p = this._b, m = this._c, g = this._d, y = this._e;
d = f(d, p, m, g, y, t[5], 1352829926, 8), y = f(y, d, p, m = o(m, 10), g, t[14], 1352829926, 9), g = f(g, y, d, p = o(p, 10), m, t[7], 1352829926, 9), m = f(m, g, y, d = o(d, 10), p, t[0], 1352829926, 11), p = f(p, m, g, y = o(y, 10), d, t[9], 1352829926, 13), d = f(d, p, m, g = o(g, 10), y, t[2], 1352829926, 15), y = f(y, d, p, m = o(m, 10), g, t[11], 1352829926, 15), g = f(g, y, d, p = o(p, 10), m, t[4], 1352829926, 5), m = f(m, g, y, d = o(d, 10), p, t[13], 1352829926, 7), p = f(p, m, g, y = o(y, 10), d, t[6], 1352829926, 7), d = f(d, p, m, g = o(g, 10), y, t[15], 1352829926, 8), y = f(y, d, p, m = o(m, 10), g, t[8], 1352829926, 11), g = f(g, y, d, p = o(p, 10), m, t[1], 1352829926, 14), m = f(m, g, y, d = o(d, 10), p, t[10], 1352829926, 14), p = f(p, m, g, y = o(y, 10), d, t[3], 1352829926, 12), y = u(y, d = f(d, p, m, g = o(g, 10), y, t[12], 1352829926, 6), p, m = o(m, 10), g, t[6], 1548603684, 9), g = u(g, y, d, p = o(p, 10), m, t[11], 1548603684, 13), m = u(m, g, y, d = o(d, 10), p, t[3], 1548603684, 15), p = u(p, m, g, y = o(y, 10), d, t[7], 1548603684, 7), d = u(d, p, m, g = o(g, 10), y, t[0], 1548603684, 12), y = u(y, d, p, m = o(m, 10), g, t[13], 1548603684, 8), g = u(g, y, d, p = o(p, 10), m, t[5], 1548603684, 9), m = u(m, g, y, d = o(d, 10), p, t[10], 1548603684, 11), p = u(p, m, g, y = o(y, 10), d, t[14], 1548603684, 7), d = u(d, p, m, g = o(g, 10), y, t[15], 1548603684, 7), y = u(y, d, p, m = o(m, 10), g, t[8], 1548603684, 12), g = u(g, y, d, p = o(p, 10), m, t[12], 1548603684, 7), m = u(m, g, y, d = o(d, 10), p, t[4], 1548603684, 6), p = u(p, m, g, y = o(y, 10), d, t[9], 1548603684, 15), d = u(d, p, m, g = o(g, 10), y, t[1], 1548603684, 13), g = h(g, y = u(y, d, p, m = o(m, 10), g, t[2], 1548603684, 11), d, p = o(p, 10), m, t[15], 1836072691, 9), m = h(m, g, y, d = o(d, 10), p, t[5], 1836072691, 7), p = h(p, m, g, y = o(y, 10), d, t[1], 1836072691, 15), d = h(d, p, m, g = o(g, 10), y, t[3], 1836072691, 11), y = h(y, d, p, m = o(m, 10), g, t[7], 1836072691, 8), g = h(g, y, d, p = o(p, 10), m, t[14], 1836072691, 6), m = h(m, g, y, d = o(d, 10), p, t[6], 1836072691, 6), p = h(p, m, g, y = o(y, 10), d, t[9], 1836072691, 14), d = h(d, p, m, g = o(g, 10), y, t[11], 1836072691, 12), y = h(y, d, p, m = o(m, 10), g, t[8], 1836072691, 13), g = h(g, y, d, p = o(p, 10), m, t[12], 1836072691, 5), m = h(m, g, y, d = o(d, 10), p, t[2], 1836072691, 14), p = h(p, m, g, y = o(y, 10), d, t[10], 1836072691, 13), d = h(d, p, m, g = o(g, 10), y, t[0], 1836072691, 13), y = h(y, d, p, m = o(m, 10), g, t[4], 1836072691, 7), m = a(m, g = h(g, y, d, p = o(p, 10), m, t[13], 1836072691, 5), y, d = o(d, 10), p, t[8], 2053994217, 15), p = a(p, m, g, y = o(y, 10), d, t[6], 2053994217, 5), d = a(d, p, m, g = o(g, 10), y, t[4], 2053994217, 8), y = a(y, d, p, m = o(m, 10), g, t[1], 2053994217, 11), g = a(g, y, d, p = o(p, 10), m, t[3], 2053994217, 14), m = a(m, g, y, d = o(d, 10), p, t[11], 2053994217, 14), p = a(p, m, g, y = o(y, 10), d, t[15], 2053994217, 6), d = a(d, p, m, g = o(g, 10), y, t[0], 2053994217, 14), y = a(y, d, p, m = o(m, 10), g, t[5], 2053994217, 6), g = a(g, y, d, p = o(p, 10), m, t[12], 2053994217, 9), m = a(m, g, y, d = o(d, 10), p, t[2], 2053994217, 12), p = a(p, m, g, y = o(y, 10), d, t[13], 2053994217, 9), d = a(d, p, m, g = o(g, 10), y, t[9], 2053994217, 12), y = a(y, d, p, m = o(m, 10), g, t[7], 2053994217, 5), g = a(g, y, d, p = o(p, 10), m, t[10], 2053994217, 15), p = s(p, m = a(m, g, y, d = o(d, 10), p, t[14], 2053994217, 8), g, y = o(y, 10), d, t[12], 0, 8), d = s(d, p, m, g = o(g, 10), y, t[15], 0, 5), y = s(y, d, p, m = o(m, 10), g, t[10], 0, 12), g = s(g, y, d, p = o(p, 10), m, t[4], 0, 9), m = s(m, g, y, d = o(d, 10), p, t[1], 0, 12), p = s(p, m, g, y = o(y, 10), d, t[5], 0, 5), d = s(d, p, m, g = o(g, 10), y, t[8], 0, 14), y = s(y, d, p, m = o(m, 10), g, t[7], 0, 6), g = s(g, y, d, p = o(p, 10), m, t[6], 0, 8), m = s(m, g, y, d = o(d, 10), p, t[2], 0, 13), p = s(p, m, g, y = o(y, 10), d, t[13], 0, 6), d = s(d, p, m, g = o(g, 10), y, t[14], 0, 5), y = s(y, d, p, m = o(m, 10), g, t[0], 0, 15), g = s(g, y, d, p = o(p, 10), m, t[3], 0, 13), m = s(m, g, y, d = o(d, 10), p, t[9], 0, 11), p = s(p, m, g, y = o(y, 10), d, t[11], 0, 11), g = o(g, 10);
var b = this._b + n + g | 0;
this._b = this._c + l + y | 0, this._c = this._d + c + d | 0, this._d = this._e + r + p | 0, this._e = this._a + i + m | 0, this._a = b;
}, n.prototype._digest = function() {
this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
var t = new Buffer$1(20);
return t.writeInt32LE(this._a, 0), t.writeInt32LE(this._b, 4), t.writeInt32LE(this._c, 8), t.writeInt32LE(this._d, 12), t.writeInt32LE(this._e, 16), t;
}, e.exports = n;
})), require_to_buffer = __commonJSMin(((t, e) => {
var r = require_safe_buffer$4().Buffer, i = require_to_buffer$1(), n = "undefined" != typeof Uint8Array, o = n && "undefined" != typeof ArrayBuffer && ArrayBuffer.isView;
e.exports = function(t, e, s) {
if ("string" == typeof t || r.isBuffer(t) || n && t instanceof Uint8Array || o && o(t)) return i(t, e);
throw new TypeError(s + " must be a string, a Buffer, a Uint8Array, or a DataView");
};
})), require_sync_browser = __commonJSMin(((t, e) => {
var r = require_md5$1(), i = require_ripemd160(), n = require_sha_js(), o = require_safe_buffer$4().Buffer, s = require_precondition(), a = require_default_encoding(), h = require_to_buffer(), u = o.alloc(128), f = {
__proto__: null,
md5: 16,
sha1: 20,
sha224: 28,
sha256: 32,
sha384: 48,
sha512: 64,
"sha512-256": 32,
ripemd160: 20,
rmd160: 20
}, l = {
__proto__: null,
"sha-1": "sha1",
"sha-224": "sha224",
"sha-256": "sha256",
"sha-384": "sha384",
"sha-512": "sha512",
"ripemd-160": "ripemd160"
};
function c(t) {
return new i().update(t).digest();
}
function d(t, e, i) {
var s = function(t) {
return "rmd160" === t || "ripemd160" === t ? c : "md5" === t ? r : function(e) {
return n(t).update(e).digest();
};
}(t), a = "sha512" === t || "sha384" === t ? 128 : 64;
e.length > a ? e = s(e) : e.length < a && (e = o.concat([e, u], a));
for (var h = o.allocUnsafe(a + f[t]), l = o.allocUnsafe(a + f[t]), d = 0; d < a; d++) h[d] = 54 ^ e[d], l[d] = 92 ^ e[d];
var p = o.allocUnsafe(a + i + 4);
h.copy(p, 0, 0, a), this.ipad1 = p, this.ipad2 = h, this.opad = l, this.alg = t, this.blocksize = a, this.hash = s, this.size = f[t];
}
d.prototype.run = function(t, e) {
return t.copy(e, this.blocksize), this.hash(e).copy(this.opad, this.blocksize), this.hash(this.opad);
}, e.exports = function(t, e, r, i, n) {
s(r, i), t = h(t, a, "Password"), e = h(e, a, "Salt");
var u = (n || "sha1").toLowerCase(), c = l[u] || u, p = f[c];
if ("number" != typeof p || !p) throw new TypeError("Digest algorithm not supported: " + n);
var m = new d(c, t, e.length), g = o.allocUnsafe(i), y = o.allocUnsafe(e.length + 4);
e.copy(y, 0, 0, e.length);
for (var b = 0, v = p, _ = Math.ceil(i / v), w = 1; w <= _; w++) {
y.writeUInt32BE(w, e.length);
for (var M = m.run(y, m.ipad1), S = M, E = 1; E < r; E++) {
S = m.run(S, m.ipad2);
for (var A = 0; A < v; A++) M[A] ^= S[A];
}
M.copy(g, b), b += v;
}
return g;
};
})), require_async = __commonJSMin(((t, e) => {
init_dist();
var r, i, n = require_safe_buffer$4().Buffer, o = require_precondition(), s = require_default_encoding(), a = require_sync_browser(), h = require_to_buffer(), u = global.crypto && global.crypto.subtle, f = {
sha: "SHA-1",
"sha-1": "SHA-1",
sha1: "SHA-1",
sha256: "SHA-256",
"sha-256": "SHA-256",
sha384: "SHA-384",
"sha-384": "SHA-384",
"sha-512": "SHA-512",
sha512: "SHA-512"
}, l = [];
function c() {
return i || (i = global.process && global.process.nextTick ? global.process.nextTick : global.queueMicrotask ? global.queueMicrotask : global.setImmediate ? global.setImmediate : global.setTimeout);
}
function d(t, e, r, i, o) {
return u.importKey("raw", t, { name: "PBKDF2" }, !1, ["deriveBits"]).then((function(t) {
return u.deriveBits({
name: "PBKDF2",
salt: e,
iterations: r,
hash: { name: o }
}, t, i << 3);
})).then((function(t) {
return n.from(t);
}));
}
e.exports = function(t, e, i, p, m, g) {
"function" == typeof m && (g = m, m = void 0);
var y = f[(m = m || "sha1").toLowerCase()];
if (y && "function" == typeof global.Promise) {
if (o(i, p), t = h(t, s, "Password"), e = h(e, s, "Salt"), "function" != typeof g) throw new Error("No callback provided to pbkdf2");
(function(t, e) {
t.then((function(t) {
c()((function() {
e(null, t);
}));
}), (function(t) {
c()((function() {
e(t);
}));
}));
})(function(t) {
if (global.process && !global.process.browser) return Promise.resolve(!1);
if (!u || !u.importKey || !u.deriveBits) return Promise.resolve(!1);
if (void 0 !== l[t]) return l[t];
var e = d(r = r || n.alloc(8), r, 10, 128, t).then((function() {
return !0;
}), (function() {
return !1;
}));
return l[t] = e, e;
}(y).then((function(r) {
return r ? d(t, e, i, p, y) : a(t, e, i, p, m);
})), g);
} else c()((function() {
var r;
try {
r = a(t, e, i, p, m);
} catch (t) {
g(t);
return;
}
g(null, r);
}));
};
})), require_browser$8 = __commonJSMin(((t) => {
t.pbkdf2 = require_async(), t.pbkdf2Sync = require_sync_browser();
})), require_utils$3 = __commonJSMin(((t) => {
t.readUInt32BE = function(t, e) {
return (t[0 + e] << 24 | t[1 + e] << 16 | t[2 + e] << 8 | t[3 + e]) >>> 0;
}, t.writeUInt32BE = function(t, e, r) {
t[0 + r] = e >>> 24, t[1 + r] = e >>> 16 & 255, t[2 + r] = e >>> 8 & 255, t[3 + r] = 255 & e;
}, t.ip = function(t, e, r, i) {
for (var n = 0, o = 0, s = 6; s >= 0; s -= 2) {
for (var a = 0; a <= 24; a += 8) n <<= 1, n |= e >>> a + s & 1;
for (a = 0; a <= 24; a += 8) n <<= 1, n |= t >>> a + s & 1;
}
for (s = 6; s >= 0; s -= 2) {
for (a = 1; a <= 25; a += 8) o <<= 1, o |= e >>> a + s & 1;
for (a = 1; a <= 25; a += 8) o <<= 1, o |= t >>> a + s & 1;
}
r[i + 0] = n >>> 0, r[i + 1] = o >>> 0;
}, t.rip = function(t, e, r, i) {
for (var n = 0, o = 0, s = 0; s < 4; s++) for (var a = 24; a >= 0; a -= 8) n <<= 1, n |= e >>> a + s & 1, n <<= 1, n |= t >>> a + s & 1;
for (s = 4; s < 8; s++) for (a = 24; a >= 0; a -= 8) o <<= 1, o |= e >>> a + s & 1, o <<= 1, o |= t >>> a + s & 1;
r[i + 0] = n >>> 0, r[i + 1] = o >>> 0;
}, t.pc1 = function(t, e, r, i) {
for (var n = 0, o = 0, s = 7; s >= 5; s--) {
for (var a = 0; a <= 24; a += 8) n <<= 1, n |= e >> a + s & 1;
for (a = 0; a <= 24; a += 8) n <<= 1, n |= t >> a + s & 1;
}
for (a = 0; a <= 24; a += 8) n <<= 1, n |= e >> a + s & 1;
for (s = 1; s <= 3; s++) {
for (a = 0; a <= 24; a += 8) o <<= 1, o |= e >> a + s & 1;
for (a = 0; a <= 24; a += 8) o <<= 1, o |= t >> a + s & 1;
}
for (a = 0; a <= 24; a += 8) o <<= 1, o |= t >> a + s & 1;
r[i + 0] = n >>> 0, r[i + 1] = o >>> 0;
}, t.r28shl = function(t, e) {
return t << e & 268435455 | t >>> 28 - e;
};
var e = [
14,
11,
17,
4,
27,
23,
25,
0,
13,
22,
7,
18,
5,
9,
16,
24,
2,
20,
12,
21,
1,
8,
15,
26,
15,
4,
25,
19,
9,
1,
26,
16,
5,
11,
23,
8,
12,
7,
17,
0,
22,
3,
10,
14,
6,
20,
27,
24
];
t.pc2 = function(t, r, i, n) {
for (var o = 0, s = 0, a = e.length >>> 1, h = 0; h < a; h++) o <<= 1, o |= t >>> e[h] & 1;
for (h = a; h < e.length; h++) s <<= 1, s |= r >>> e[h] & 1;
i[n + 0] = o >>> 0, i[n + 1] = s >>> 0;
}, t.expand = function(t, e, r) {
var i = 0, n = 0;
i = (1 & t) << 5 | t >>> 27;
for (var o = 23; o >= 15; o -= 4) i <<= 6, i |= t >>> o & 63;
for (o = 11; o >= 3; o -= 4) n |= t >>> o & 63, n <<= 6;
n |= (31 & t) << 1 | t >>> 31, e[r + 0] = i >>> 0, e[r + 1] = n >>> 0;
};
var r = [
14,
0,
4,
15,
13,
7,
1,
4,
2,
14,
15,
2,
11,
13,
8,
1,
3,
10,
10,
6,
6,
12,
12,
11,
5,
9,
9,
5,
0,
3,
7,
8,
4,
15,
1,
12,
14,
8,
8,
2,
13,
4,
6,
9,
2,
1,
11,
7,
15,
5,
12,
11,
9,
3,
7,
14,
3,
10,
10,
0,
5,
6,
0,
13,
15,
3,
1,
13,
8,
4,
14,
7,
6,
15,
11,
2,
3,
8,
4,
14,
9,
12,
7,
0,
2,
1,
13,
10,
12,
6,
0,
9,
5,
11,
10,
5,
0,
13,
14,
8,
7,
10,
11,
1,
10,
3,
4,
15,
13,
4,
1,
2,
5,
11,
8,
6,
12,
7,
6,
12,
9,
0,
3,
5,
2,
14,
15,
9,
10,
13,
0,
7,
9,
0,
14,
9,
6,
3,
3,
4,
15,
6,
5,
10,
1,
2,
13,
8,
12,
5,
7,
14,
11,
12,
4,
11,
2,
15,
8,
1,
13,
1,
6,
10,
4,
13,
9,
0,
8,
6,
15,
9,
3,
8,
0,
7,
11,
4,
1,
15,
2,
14,
12,
3,
5,
11,
10,
5,
14,
2,
7,
12,
7,
13,
13,
8,
14,
11,
3,
5,
0,
6,
6,
15,
9,
0,
10,
3,
1,
4,
2,
7,
8,
2,
5,
12,
11,
1,
12,
10,
4,
14,
15,
9,
10,
3,
6,
15,
9,
0,
0,
6,
12,
10,
11,
1,
7,
13,
13,
8,
15,
9,
1,
4,
3,
5,
14,
11,
5,
12,
2,
7,
8,
2,
4,
14,
2,
14,
12,
11,
4,
2,
1,
12,
7,
4,
10,
7,
11,
13,
6,
1,
8,
5,
5,
0,
3,
15,
15,
10,
13,
3,
0,
9,
14,
8,
9,
6,
4,
11,
2,
8,
1,
12,
11,
7,
10,
1,
13,
14,
7,
2,
8,
13,
15,
6,
9,
15,
12,
0,
5,
9,
6,
10,
3,
4,
0,
5,
14,
3,
12,
10,
1,
15,
10,
4,
15,
2,
9,
7,
2,
12,
6,
9,
8,
5,
0,
6,
13,
1,
3,
13,
4,
14,
14,
0,
7,
11,
5,
3,
11,
8,
9,
4,
14,
3,
15,
2,
5,
12,
2,
9,
8,
5,
12,
15,
3,
10,
7,
11,
0,
14,
4,
1,
10,
7,
1,
6,
13,
0,
11,
8,
6,
13,
4,
13,
11,
0,
2,
11,
14,
7,
15,
4,
0,
9,
8,
1,
13,
10,
3,
14,
12,
3,
9,
5,
7,
12,
5,
2,
10,
15,
6,
8,
1,
6,
1,
6,
4,
11,
11,
13,
13,
8,
12,
1,
3,
4,
7,
10,
14,
7,
10,
9,
15,
5,
6,
0,
8,
15,
0,
14,
5,
2,
9,
3,
2,
12,
13,
1,
2,
15,
8,
13,
4,
8,
6,
10,
15,
3,
11,
7,
1,
4,
10,
12,
9,
5,
3,
6,
14,
11,
5,
0,
0,
14,
12,
9,
7,
2,
7,
2,
11,
1,
4,
14,
1,
7,
9,
4,
12,
10,
14,
8,
2,
13,
0,
15,
6,
12,
10,
9,
13,
0,
15,
3,
3,
5,
5,
6,
8,
11
];
t.substitute = function(t, e) {
for (var i = 0, n = 0; n < 4; n++) i <<= 4, i |= r[64 * n + (t >>> 18 - 6 * n & 63)];
for (n = 0; n < 4; n++) i <<= 4, i |= r[256 + 64 * n + (e >>> 18 - 6 * n & 63)];
return i >>> 0;
};
var i = [
16,
25,
12,
11,
3,
20,
4,
15,
31,
17,
9,
6,
27,
14,
1,
22,
30,
24,
8,
18,
0,
5,
29,
23,
13,
19,
2,
26,
10,
21,
28,
7
];
t.permute = function(t) {
for (var e = 0, r = 0; r < i.length; r++) e <<= 1, e |= t >>> i[r] & 1;
return e >>> 0;
}, t.padSplit = function(t, e, r) {
for (var i = t.toString(2); i.length < e;) i = "0" + i;
for (var n = [], o = 0; o < e; o += r) n.push(i.slice(o, o + r));
return n.join(" ");
};
})), require_minimalistic_assert = __commonJSMin(((t, e) => {
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
e.exports = r, r.equal = function(t, e, r) {
if (t != e) throw new Error(r || "Assertion failed: " + t + " != " + e);
};
})), require_cipher = __commonJSMin(((t, e) => {
var r = require_minimalistic_assert();
function i(t) {
this.options = t, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0, this.padding = !1 !== t.padding;
}
e.exports = i, i.prototype._init = function() {}, i.prototype.update = function(t) {
return 0 === t.length ? [] : "decrypt" === this.type ? this._updateDecrypt(t) : this._updateEncrypt(t);
}, i.prototype._buffer = function(t, e) {
for (var r = Math.min(this.buffer.length - this.bufferOff, t.length - e), i = 0; i < r; i++) this.buffer[this.bufferOff + i] = t[e + i];
return this.bufferOff += r, r;
}, i.prototype._flushBuffer = function(t, e) {
return this._update(this.buffer, 0, t, e), this.bufferOff = 0, this.blockSize;
}, i.prototype._updateEncrypt = function(t) {
var e = 0, r = 0, i = (this.bufferOff + t.length) / this.blockSize | 0, n = new Array(i * this.blockSize);
0 !== this.bufferOff && (e += this._buffer(t, e), this.bufferOff === this.buffer.length && (r += this._flushBuffer(n, r)));
for (var o = t.length - (t.length - e) % this.blockSize; e < o; e += this.blockSize) this._update(t, e, n, r), r += this.blockSize;
for (; e < t.length; e++, this.bufferOff++) this.buffer[this.bufferOff] = t[e];
return n;
}, i.prototype._updateDecrypt = function(t) {
for (var e = 0, r = 0, i = Math.ceil((this.bufferOff + t.length) / this.blockSize) - 1, n = new Array(i * this.blockSize); i > 0; i--) e += this._buffer(t, e), r += this._flushBuffer(n, r);
return e += this._buffer(t, e), n;
}, i.prototype.final = function(t) {
var e, r;
return t && (e = this.update(t)), r = "encrypt" === this.type ? this._finalEncrypt() : this._finalDecrypt(), e ? e.concat(r) : r;
}, i.prototype._pad = function(t, e) {
if (0 === e) return !1;
for (; e < t.length;) t[e++] = 0;
return !0;
}, i.prototype._finalEncrypt = function() {
if (!this._pad(this.buffer, this.bufferOff)) return [];
var t = new Array(this.blockSize);
return this._update(this.buffer, 0, t, 0), t;
}, i.prototype._unpad = function(t) {
return t;
}, i.prototype._finalDecrypt = function() {
r.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt");
var t = new Array(this.blockSize);
return this._flushBuffer(t, 0), this._unpad(t);
};
})), require_des$1 = __commonJSMin(((t, e) => {
var r = require_minimalistic_assert(), i = require_inherits_browser(), n = require_utils$3(), o = require_cipher();
function s() {
this.tmp = new Array(2), this.keys = null;
}
function a(t) {
o.call(this, t);
var e = new s();
this._desState = e, this.deriveKeys(e, t.key);
}
i(a, o), e.exports = a, a.create = function(t) {
return new a(t);
};
var h = [
1,
1,
2,
2,
2,
2,
2,
2,
1,
2,
2,
2,
2,
2,
2,
1
];
a.prototype.deriveKeys = function(t, e) {
t.keys = new Array(32), r.equal(e.length, this.blockSize, "Invalid key length");
var i = n.readUInt32BE(e, 0), o = n.readUInt32BE(e, 4);
n.pc1(i, o, t.tmp, 0), i = t.tmp[0], o = t.tmp[1];
for (var s = 0; s < t.keys.length; s += 2) {
var a = h[s >>> 1];
i = n.r28shl(i, a), o = n.r28shl(o, a), n.pc2(i, o, t.keys, s);
}
}, a.prototype._update = function(t, e, r, i) {
var o = this._desState, s = n.readUInt32BE(t, e), a = n.readUInt32BE(t, e + 4);
n.ip(s, a, o.tmp, 0), s = o.tmp[0], a = o.tmp[1], "encrypt" === this.type ? this._encrypt(o, s, a, o.tmp, 0) : this._decrypt(o, s, a, o.tmp, 0), s = o.tmp[0], a = o.tmp[1], n.writeUInt32BE(r, s, i), n.writeUInt32BE(r, a, i + 4);
}, a.prototype._pad = function(t, e) {
if (!1 === this.padding) return !1;
for (var r = t.length - e, i = e; i < t.length; i++) t[i] = r;
return !0;
}, a.prototype._unpad = function(t) {
if (!1 === this.padding) return t;
for (var e = t[t.length - 1], i = t.length - e; i < t.length; i++) r.equal(t[i], e);
return t.slice(0, t.length - e);
}, a.prototype._encrypt = function(t, e, r, i, o) {
for (var s = e, a = r, h = 0; h < t.keys.length; h += 2) {
var u = t.keys[h], f = t.keys[h + 1];
n.expand(a, t.tmp, 0), u ^= t.tmp[0], f ^= t.tmp[1];
var l = n.substitute(u, f), c = a;
a = (s ^ n.permute(l)) >>> 0, s = c;
}
n.rip(a, s, i, o);
}, a.prototype._decrypt = function(t, e, r, i, o) {
for (var s = r, a = e, h = t.keys.length - 2; h >= 0; h -= 2) {
var u = t.keys[h], f = t.keys[h + 1];
n.expand(s, t.tmp, 0), u ^= t.tmp[0], f ^= t.tmp[1];
var l = n.substitute(u, f), c = s;
s = (a ^ n.permute(l)) >>> 0, a = c;
}
n.rip(s, a, i, o);
};
})), require_cbc$1 = __commonJSMin(((t) => {
var e = require_minimalistic_assert(), r = require_inherits_browser(), i = {};
function n(t) {
e.equal(t.length, 8, "Invalid IV length"), this.iv = new Array(8);
for (var r = 0; r < this.iv.length; r++) this.iv[r] = t[r];
}
t.instantiate = function(t) {
function e(e) {
t.call(this, e), this._cbcInit();
}
r(e, t);
for (var n = Object.keys(i), o = 0; o < n.length; o++) {
var s = n[o];
e.prototype[s] = i[s];
}
return e.create = function(t) {
return new e(t);
}, e;
}, i._cbcInit = function() {
var t = new n(this.options.iv);
this._cbcState = t;
}, i._update = function(t, e, r, i) {
var n = this._cbcState, o = this.constructor.super_.prototype, s = n.iv;
if ("encrypt" === this.type) {
for (var a = 0; a < this.blockSize; a++) s[a] ^= t[e + a];
o._update.call(this, s, 0, r, i);
for (a = 0; a < this.blockSize; a++) s[a] = r[i + a];
} else {
o._update.call(this, t, e, r, i);
for (a = 0; a < this.blockSize; a++) r[i + a] ^= s[a];
for (a = 0; a < this.blockSize; a++) s[a] = t[e + a];
}
};
})), require_ede = __commonJSMin(((t, e) => {
var r = require_minimalistic_assert(), i = require_inherits_browser(), n = require_cipher(), o = require_des$1();
function s(t, e) {
r.equal(e.length, 24, "Invalid key length");
var i = e.slice(0, 8), n = e.slice(8, 16), s = e.slice(16, 24);
this.ciphers = "encrypt" === t ? [
o.create({
type: "encrypt",
key: i
}),
o.create({
type: "decrypt",
key: n
}),
o.create({
type: "encrypt",
key: s
})
] : [
o.create({
type: "decrypt",
key: s
}),
o.create({
type: "encrypt",
key: n
}),
o.create({
type: "decrypt",
key: i
})
];
}
function a(t) {
n.call(this, t);
var e = new s(this.type, this.options.key);
this._edeState = e;
}
i(a, n), e.exports = a, a.create = function(t) {
return new a(t);
}, a.prototype._update = function(t, e, r, i) {
var n = this._edeState;
n.ciphers[0]._update(t, e, r, i), n.ciphers[1]._update(r, i, r, i), n.ciphers[2]._update(r, i, r, i);
}, a.prototype._pad = o.prototype._pad, a.prototype._unpad = o.prototype._unpad;
})), require_des = __commonJSMin(((t) => {
t.utils = require_utils$3(), t.Cipher = require_cipher(), t.DES = require_des$1(), t.CBC = require_cbc$1(), t.EDE = require_ede();
})), require_browserify_des = __commonJSMin(((t, e) => {
var r = require_cipher_base(), i = require_des(), n = require_inherits_browser(), o = require_safe_buffer$9().Buffer, s = {
"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 a(t) {
r.call(this);
var e, i = t.mode.toLowerCase(), n = s[i];
e = t.decrypt ? "decrypt" : "encrypt";
var a = t.key;
o.isBuffer(a) || (a = o.from(a)), "des-ede" !== i && "des-ede-cbc" !== i || (a = o.concat([a, a.slice(0, 8)]));
var h = t.iv;
o.isBuffer(h) || (h = o.from(h)), this._des = n.create({
key: a,
iv: h,
type: e
});
}
s.des = s["des-cbc"], s.des3 = s["des-ede3-cbc"], e.exports = a, n(a, r), a.prototype._update = function(t) {
return o.from(this._des.update(t));
}, a.prototype._final = function() {
return o.from(this._des.final());
};
})), require_ecb = __commonJSMin(((t) => {
t.encrypt = function(t, e) {
return t._cipher.encryptBlock(e);
}, t.decrypt = function(t, e) {
return t._cipher.decryptBlock(e);
};
})), require_buffer_xor = __commonJSMin(((t, e) => {
init_dist$1(), e.exports = function(t, e) {
for (var r = Math.min(t.length, e.length), i = new Buffer$1(r), n = 0; n < r; ++n) i[n] = t[n] ^ e[n];
return i;
};
})), require_cbc = __commonJSMin(((t) => {
var e = require_buffer_xor();
t.encrypt = function(t, r) {
var i = e(r, t._prev);
return t._prev = t._cipher.encryptBlock(i), t._prev;
}, t.decrypt = function(t, r) {
var i = t._prev;
return t._prev = r, e(t._cipher.decryptBlock(r), i);
};
})), require_cfb = __commonJSMin(((t) => {
var e = require_safe_buffer$9().Buffer, r = require_buffer_xor();
function i(t, i, n) {
var o = i.length, s = r(i, t._cache);
return t._cache = t._cache.slice(o), t._prev = e.concat([t._prev, n ? i : s]), s;
}
t.encrypt = function(t, r, n) {
for (var o, s = e.allocUnsafe(0); r.length;) {
if (0 === t._cache.length && (t._cache = t._cipher.encryptBlock(t._prev), t._prev = e.allocUnsafe(0)), !(t._cache.length <= r.length)) {
s = e.concat([s, i(t, r, n)]);
break;
}
o = t._cache.length, s = e.concat([s, i(t, r.slice(0, o), n)]), r = r.slice(o);
}
return s;
};
})), require_cfb8 = __commonJSMin(((t) => {
var e = require_safe_buffer$9().Buffer;
function r(t, r, i) {
var n = t._cipher.encryptBlock(t._prev)[0] ^ r;
return t._prev = e.concat([t._prev.slice(1), e.from([i ? r : n])]), n;
}
t.encrypt = function(t, i, n) {
for (var o = i.length, s = e.allocUnsafe(o), a = -1; ++a < o;) s[a] = r(t, i[a], n);
return s;
};
})), require_cfb1 = __commonJSMin(((t) => {
var e = require_safe_buffer$9().Buffer;
function r(t, e, r) {
for (var n, o, s = -1, a = 0; ++s < 8;) n = e & 1 << 7 - s ? 128 : 0, a += (128 & (o = t._cipher.encryptBlock(t._prev)[0] ^ n)) >> s % 8, t._prev = i(t._prev, r ? n : o);
return a;
}
function i(t, r) {
var i = t.length, n = -1, o = e.allocUnsafe(t.length);
for (t = e.concat([t, e.from([r])]); ++n < i;) o[n] = t[n] << 1 | t[n + 1] >> 7;
return o;
}
t.encrypt = function(t, i, n) {
for (var o = i.length, s = e.allocUnsafe(o), a = -1; ++a < o;) s[a] = r(t, i[a], n);
return s;
};
})), require_ofb = __commonJSMin(((t) => {
init_dist$1();
var e = require_buffer_xor();
function r(t) {
return t._prev = t._cipher.encryptBlock(t._prev), t._prev;
}
t.encrypt = function(t, i) {
for (; t._cache.length < i.length;) t._cache = Buffer$1.concat([t._cache, r(t)]);
var n = t._cache.slice(0, i.length);
return t._cache = t._cache.slice(i.length), e(i, n);
};
})), require_incr32 = __commonJSMin(((t, e) => {
e.exports = function(t) {
for (var e, r = t.length; r--;) {
if (255 !== (e = t.readUInt8(r))) {
e++, t.writeUInt8(e, r);
break;
}
t.writeUInt8(0, r);
}
};
})), require_ctr = __commonJSMin(((t) => {
var e = require_buffer_xor(), r = require_safe_buffer$9().Buffer, i = require_incr32();
function n(t) {
var e = t._cipher.encryptBlockRaw(t._prev);
return i(t._prev), e;
}
t.encrypt = function(t, i) {
var o = Math.ceil(i.length / 16), s = t._cache.length;
t._cache = r.concat([t._cache, r.allocUnsafe(16 * o)]);
for (var a = 0; a < o; a++) {
var h = n(t), u = s + 16 * a;
t._cache.writeUInt32BE(h[0], u + 0), t._cache.writeUInt32BE(h[1], u + 4), t._cache.writeUInt32BE(h[2], u + 8), t._cache.writeUInt32BE(h[3], u + 12);
}
var f = t._cache.slice(0, i.length);
return t._cache = t._cache.slice(i.length), e(i, f);
};
})), list_exports = __exportAll({
aes128: () => aes128,
aes192: () => aes192,
aes256: () => aes256,
default: () => list_default
}), aes128, aes192, aes256, list_default, init_list = __esmMin((() => {
list_default = {
"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: aes128 = {
cipher: "AES",
key: 128,
iv: 16,
mode: "CBC",
type: "block"
},
aes192: aes192 = {
cipher: "AES",
key: 192,
iv: 16,
mode: "CBC",
type: "block"
},
aes256: 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"
}
};
})), require_modes$1 = __commonJSMin(((t, e) => {
var r = {
ECB: require_ecb(),
CBC: require_cbc(),
CFB: require_cfb(),
CFB8: require_cfb8(),
CFB1: require_cfb1(),
OFB: require_ofb(),
CTR: require_ctr(),
GCM: require_ctr()
}, i = (init_list(), __toCommonJS(list_exports).default);
for (var n in i) i[n].module = r[i[n].mode];
e.exports = i;
})), require_aes$1 = __commonJSMin(((t, e) => {
var r = require_safe_buffer$9().Buffer;
function i(t) {
r.isBuffer(t) || (t = r.from(t));
for (var e = t.length / 4 | 0, i = new Array(e), n = 0; n < e; n++) i[n] = t.readUInt32BE(4 * n);
return i;
}
function n(t) {
for (; 0 < t.length; t++) t[0] = 0;
}
function o(t, e, r, i, n) {
for (var o, s, a, h, u = r[0], f = r[1], l = r[2], c = r[3], d = t[0] ^ e[0], p = t[1] ^ e[1], m = t[2] ^ e[2], g = t[3] ^ e[3], y = 4, b = 1; b < n; b++) o = u[d >>> 24] ^ f[p >>> 16 & 255] ^ l[m >>> 8 & 255] ^ c[255 & g] ^ e[y++], s = u[p >>> 24] ^ f[m >>> 16 & 255] ^ l[g >>> 8 & 255] ^ c[255 & d] ^ e[y++], a = u[m >>> 24] ^ f[g >>> 16 & 255] ^ l[d >>> 8 & 255] ^ c[255 & p] ^ e[y++], h = u[g >>> 24] ^ f[d >>> 16 & 255] ^ l[p >>> 8 & 255] ^ c[255 & m] ^ e[y++], d = o, p = s, m = a, g = h;
return o = (i[d >>> 24] << 24 | i[p >>> 16 & 255] << 16 | i[m >>> 8 & 255] << 8 | i[255 & g]) ^ e[y++], s = (i[p >>> 24] << 24 | i[m >>> 16 & 255] << 16 | i[g >>> 8 & 255] << 8 | i[255 & d]) ^ e[y++], a = (i[m >>> 24] << 24 | i[g >>> 16 & 255] << 16 | i[d >>> 8 & 255] << 8 | i[255 & p]) ^ e[y++], h = (i[g >>> 24] << 24 | i[d >>> 16 & 255] << 16 | i[p >>> 8 & 255] << 8 | i[255 & m]) ^ e[y++], [
o >>>= 0,
s >>>= 0,
a >>>= 0,
h >>>= 0
];
}
var s = [
0,
1,
2,
4,
8,
16,
32,
64,
128,
27,
54
], a = function() {
for (var t = new Array(256), e = 0; e < 256; e++) t[e] = e < 128 ? e << 1 : e << 1 ^ 283;
for (var r = [], i = [], n = [
[],
[],
[],
[]
], o = [
[],
[],
[],
[]
], s = 0, a = 0, h = 0; h < 256; ++h) {
var u = a ^ a << 1 ^ a << 2 ^ a << 3 ^ a << 4;
u = u >>> 8 ^ 255 & u ^ 99, r[s] = u, i[u] = s;
var f = t[s], l = t[f], c = t[l], d = 257 * t[u] ^ 16843008 * u;
n[0][s] = d << 24 | d >>> 8, n[1][s] = d << 16 | d >>> 16, n[2][s] = d << 8 | d >>> 24, n[3][s] = d, d = 16843009 * c ^ 65537 * l ^ 257 * f ^ 16843008 * s, o[0][u] = d << 24 | d >>> 8, o[1][u] = d << 16 | d >>> 16, o[2][u] = d << 8 | d >>> 24, o[3][u] = d, 0 === s ? s = a = 1 : (s = f ^ t[t[t[c ^ f]]], a ^= t[t[a]]);
}
return {
SBOX: r,
INV_SBOX: i,
SUB_MIX: n,
INV_SUB_MIX: o
};
}();
function h(t) {
this._key = i(t), this._reset();
}
h.blockSize = 16, h.keySize = 32, h.prototype.blockSize = h.blockSize, h.prototype.keySize = h.keySize, h.prototype._reset = function() {
for (var t = this._key, e = t.length, r = e + 6, i = 4 * (r + 1), n = [], o = 0; o < e; o++) n[o] = t[o];
for (o = e; o < i; o++) {
var h = n[o - 1];
o % e == 0 ? (h = h << 8 | h >>> 24, h = a.SBOX[h >>> 24] << 24 | a.SBOX[h >>> 16 & 255] << 16 | a.SBOX[h >>> 8 & 255] << 8 | a.SBOX[255 & h], h ^= s[o / e | 0] << 24) : e > 6 && o % e == 4 && (h = a.SBOX[h >>> 24] << 24 | a.SBOX[h >>> 16 & 255] << 16 | a.SBOX[h >>> 8 & 255] << 8 | a.SBOX[255 & h]), n[o] = n[o - e] ^ h;
}
for (var u = [], f = 0; f < i; f++) {
var l = i - f, c = n[l - (f % 4 ? 0 : 4)];
u[f] = f < 4 || l <= 4 ? c : a.INV_SUB_MIX[0][a.SBOX[c >>> 24]] ^ a.INV_SUB_MIX[1][a.SBOX[c >>> 16 & 255]] ^ a.INV_SUB_MIX[2][a.SBOX[c >>> 8 & 255]] ^ a.INV_SUB_MIX[3][a.SBOX[255 & c]];
}
this._nRounds = r, this._keySchedule = n, this._invKeySchedule = u;
}, h.prototype.encryptBlockRaw = function(t) {
return o(t = i(t), this._keySchedule, a.SUB_MIX, a.SBOX, this._nRounds);
}, h.prototype.encryptBlock = function(t) {
var e = this.encryptBlockRaw(t), i = r.allocUnsafe(16);
return i.writeUInt32BE(e[0], 0), i.writeUInt32BE(e[1], 4), i.writeUInt32BE(e[2], 8), i.writeUInt32BE(e[3], 12), i;
}, h.prototype.decryptBlock = function(t) {
var e = (t = i(t))[1];
t[1] = t[3], t[3] = e;
var n = o(t, this._invKeySchedule, a.INV_SUB_MIX, a.INV_SBOX, this._nRounds), s = r.allocUnsafe(16);
return s.writeUInt32BE(n[0], 0), s.writeUInt32BE(n[3], 4), s.writeUInt32BE(n[2], 8), s.writeUInt32BE(n[1], 12), s;
}, h.prototype.scrub = function() {
n(this._keySchedule), n(this._invKeySchedule), n(this._key);
}, e.exports.AES = h;
})), require_ghash = __commonJSMin(((t, e) => {
var r = require_safe_buffer$9().Buffer, i = r.alloc(16, 0);
function n(t) {
var e = r.allocUnsafe(16);
return e.writeUInt32BE(t[0] >>> 0, 0), e.writeUInt32BE(t[1] >>> 0, 4), e.writeUInt32BE(t[2] >>> 0, 8), e.writeUInt32BE(t[3] >>> 0, 12), e;
}
function o(t) {
this.h = t, this.state = r.alloc(16, 0), this.cache = r.allocUnsafe(0);
}
o.prototype.ghash = function(t) {
for (var e = -1; ++e < t.length;) this.state[e] ^= t[e];
this._multiply();
}, o.prototype._multiply = function() {
for (var t, e, r, i = [
(t = this.h).readUInt32BE(0),
t.readUInt32BE(4),
t.readUInt32BE(8),
t.readUInt32BE(12)
], o = [
0,
0,
0,
0
], s = -1; ++s < 128;) {
for (this.state[~~(s / 8)] & 1 << 7 - s % 8 && (o[0] ^= i[0], o[1] ^= i[1], o[2] ^= i[2], o[3] ^= i[3]), r = !!(1 & i[3]), e = 3; e > 0; e--) i[e] = i[e] >>> 1 | (1 & i[e - 1]) << 31;
i[0] = i[0] >>> 1, r && (i[0] = i[0] ^ 225 << 24);
}
this.state = n(o);
}, o.prototype.update = function(t) {
var e;
for (this.cache = r.concat([this.cache, t]); this.cache.length >= 16;) e = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(e);
}, o.prototype.final = function(t, e) {
return this.cache.length && this.ghash(r.concat([this.cache, i], 16)), this.ghash(n([
0,
t,
0,
e
])), this.state;
}, e.exports = o;
})), require_authCipher = __commonJSMin(((t, e) => {
var r = require_aes$1(), i = require_safe_buffer$9().Buffer, n = require_cipher_base(), o = require_inherits_browser(), s = require_ghash(), a = require_buffer_xor(), h = require_incr32();
function u(t, e, o, a) {
n.call(this);
var u = i.alloc(4, 0);
this._cipher = new r.AES(e);
var f = this._cipher.encryptBlock(u);
this._ghash = new s(f), o = function(t, e, r) {
if (12 === e.length) return t._finID = i.concat([e, i.from([
0,
0,
0,
1
])]), i.concat([e, i.from([
0,
0,
0,
2
])]);
var n = new s(r), o = e.length, a = o % 16;
n.update(e), a && (a = 16 - a, n.update(i.alloc(a, 0))), n.update(i.alloc(8, 0));
var u = 8 * o, f = i.alloc(8);
f.writeUIntBE(u, 0, 8), n.update(f), t._finID = n.state;
var l = i.from(t._finID);
return h(l), l;
}(this, o, f), this._prev = i.from(o), this._cache = i.allocUnsafe(0), this._secCache = i.allocUnsafe(0), this._decrypt = a, this._alen = 0, this._len = 0, this._mode = t, this._authTag = null, this._called = !1;
}
o(u, n), u.prototype._update = function(t) {
if (!this._called && this._alen) {
var e = 16 - this._alen % 16;
e < 16 && (e = i.alloc(e, 0), this._ghash.update(e));
}
this._called = !0;
var r = this._mode.encrypt(this, t);
return this._decrypt ? this._ghash.update(t) : this._ghash.update(r), this._len += t.length, r;
}, u.prototype._final = function() {
if (this._decrypt && !this._authTag) throw new Error("Unsupported state or unable to authenticate data");
var t = a(this._ghash.final(8 * this._alen, 8 * this._len), this._cipher.encryptBlock(this._finID));
if (this._decrypt && function(t, e) {
var r = 0;
t.length !== e.length && r++;
for (var i = Math.min(t.length, e.length), n = 0; n < i; ++n) r += t[n] ^ e[n];
return r;
}(t, this._authTag)) throw new Error("Unsupported state or unable to authenticate data");
this._authTag = t, 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(t) {
if (!this._decrypt) throw new Error("Attempting to set auth tag in unsupported state");
this._authTag = t;
}, u.prototype.setAAD = function(t) {
if (this._called) throw new Error("Attempting to set AAD in unsupported state");
this._ghash.update(t), this._alen += t.length;
}, e.exports = u;
})), require_streamCipher = __commonJSMin(((t, e) => {
var r = require_aes$1(), i = require_safe_buffer$9().Buffer, n = require_cipher_base();
function o(t, e, o, s) {
n.call(this), this._cipher = new r.AES(e), this._prev = i.from(o), this._cache = i.allocUnsafe(0), this._secCache = i.allocUnsafe(0), this._decrypt = s, this._mode = t;
}
require_inherits_browser()(o, n), o.prototype._update = function(t) {
return this._mode.encrypt(this, t, this._decrypt);
}, o.prototype._final = function() {
this._cipher.scrub();
}, e.exports = o;
})), require_evp_bytestokey = __commonJSMin(((t, e) => {
var r = require_safe_buffer$9().Buffer, i = require_md5_js();
e.exports = function(t, e, n, o) {
if (r.isBuffer(t) || (t = r.from(t, "binary")), e && (r.isBuffer(e) || (e = r.from(e, "binary")), 8 !== e.length)) throw new RangeError("salt should be Buffer with 8 byte length");
for (var s = n / 8, a = r.alloc(s), h = r.alloc(o || 0), u = r.alloc(0); s > 0 || o > 0;) {
var f = new i();
f.update(u), f.update(t), e && f.update(e), u = f.digest();
var l = 0;
if (s > 0) {
var c = a.length - s;
l = Math.min(s, u.length), u.copy(a, c, 0, l), s -= l;
}
if (l < u.length && o > 0) {
var d = h.length - o, p = Math.min(o, u.length - l);
u.copy(h, d, l, l + p), o -= p;
}
}
return u.fill(0), {
key: a,
iv: h
};
};
})), require_encrypter = __commonJSMin(((t) => {
var e = require_modes$1(), r = require_authCipher(), i = require_safe_buffer$9().Buffer, n = require_streamCipher(), o = require_cipher_base(), s = require_aes$1(), a = require_evp_bytestokey();
function h(t, e, r) {
o.call(this), this._cache = new f(), this._cipher = new s.AES(e), this._prev = i.from(r), this._mode = t, this._autopadding = !0;
}
require_inherits_browser()(h, o), h.prototype._update = function(t) {
var e, r;
this._cache.add(t);
for (var n = []; e = this._cache.get();) r = this._mode.encrypt(this, e), n.push(r);
return i.concat(n);
};
var u = i.alloc(16, 16);
function f() {
this.cache = i.allocUnsafe(0);
}
function l(t, o, s) {
var a = e[t.toLowerCase()];
if (!a) throw new TypeError("invalid suite type");
if ("string" == typeof o && (o = i.from(o)), o.length !== a.key / 8) throw new TypeError("invalid key length " + o.length);
if ("string" == typeof s && (s = i.from(s)), "GCM" !== a.mode && s.length !== a.iv) throw new TypeError("invalid iv length " + s.length);
return "stream" === a.type ? new n(a.module, o, s) : "auth" === a.type ? new r(a.module, o, s) : new h(a.module, o, s);
}
h.prototype._final = function() {
var t = this._cache.flush();
if (this._autopadding) return t = this._mode.encrypt(this, t), this._cipher.scrub(), t;
if (!t.equals(u)) throw this._cipher.scrub(), /* @__PURE__ */ new Error("data not multiple of block length");
}, h.prototype.setAutoPadding = function(t) {
return this._autopadding = !!t, this;
}, f.prototype.add = function(t) {
this.cache = i.concat([this.cache, t]);
}, f.prototype.get = function() {
if (this.cache.length > 15) {
var t = this.cache.slice(0, 16);
return this.cache = this.cache.slice(16), t;
}
return null;
}, f.prototype.flush = function() {
for (var t = 16 - this.cache.length, e = i.allocUnsafe(t), r = -1; ++r < t;) e.writeUInt8(t, r);
return i.concat([this.cache, e]);
}, t.createCipheriv = l, t.createCipher = function(t, r) {
var i = e[t.toLowerCase()];
if (!i) throw new TypeError("invalid suite type");
var n = a(r, !1, i.key, i.iv);
return l(t, n.key, n.iv);
};
})), require_decrypter = __commonJSMin(((t) => {
var e = require_authCipher(), r = require_safe_buffer$9().Buffer, i = require_modes$1(), n = require_streamCipher(), o = require_cipher_base(), s = require_aes$1(), a = require_evp_bytestokey();
function h(t, e, i) {
o.call(this), this._cache = new u(), this._last = void 0, this._cipher = new s.AES(e), this._prev = r.from(i), this._mode = t, this._autopadding = !0;
}
function u() {
this.cache = r.allocUnsafe(0);
}
function f(t, o, s) {
var a = i[t.toLowerCase()];
if (!a) throw new TypeError("invalid suite type");
if ("string" == typeof s && (s = r.from(s)), "GCM" !== a.mode && s.length !== a.iv) throw new TypeError("invalid iv length " + s.length);
if ("string" == typeof o && (o = r.from(o)), o.length !== a.key / 8) throw new TypeError("invalid key length " + o.length);
return "stream" === a.type ? new n(a.module, o, s, !0) : "auth" === a.type ? new e(a.module, o, s, !0) : new h(a.module, o, s);
}
require_inherits_browser()(h, o), h.prototype._update = function(t) {
var e, i;
this._cache.add(t);
for (var n = []; e = this._cache.get(this._autopadding);) i = this._mode.decrypt(this, e), n.push(i);
return r.concat(n);
}, h.prototype._final = function() {
var t = this._cache.flush();
if (this._autopadding) return function(t) {
var e = t[15];
if (e < 1 || e > 16) throw new Error("unable to decrypt data");
var r = -1;
for (; ++r < e;) if (t[r + (16 - e)] !== e) throw new Error("unable to decrypt data");
if (16 === e) return;
return t.slice(0, 16 - e);
}(this._mode.decrypt(this, t));
if (t) throw new Error("data not multiple of block length");
}, h.prototype.setAutoPadding = function(t) {
return this._autopadding = !!t, this;
}, u.prototype.add = function(t) {
this.cache = r.concat([this.cache, t]);
}, u.prototype.get = function(t) {
var e;
if (t) {
if (this.cache.length > 16) return e = this.cache.slice(0, 16), this.cache = this.cache.slice(16), e;
} else if (this.cache.length >= 16) return e = this.cache.slice(0, 16), this.cache = this.cache.slice(16), e;
return null;
}, u.prototype.flush = function() {
if (this.cache.length) return this.cache;
}, t.createDecipher = function(t, e) {
var r = i[t.toLowerCase()];
if (!r) throw new TypeError("invalid suite type");
var n = a(e, !1, r.key, r.iv);
return f(t, n.key, n.iv);
}, t.createDecipheriv = f;
})), require_browser$7 = __commonJSMin(((t) => {
var e = require_encrypter(), r = require_decrypter(), i = (init_list(), __toCommonJS(list_exports).default);
t.createCipher = t.Cipher = e.createCipher, t.createCipheriv = t.Cipheriv = e.createCipheriv, t.createDecipher = t.Decipher = r.createDecipher, t.createDecipheriv = t.Decipheriv = r.createDecipheriv, t.listCiphers = t.getCiphers = function() {
return Object.keys(i);
};
})), require_modes = __commonJSMin(((t) => {
t["des-ecb"] = {
key: 8,
iv: 0
}, t["des-cbc"] = t.des = {
key: 8,
iv: 8
}, t["des-ede3-cbc"] = t.des3 = {
key: 24,
iv: 8
}, t["des-ede3"] = {
key: 24,
iv: 0
}, t["des-ede-cbc"] = {
key: 16,
iv: 8
}, t["des-ede"] = {
key: 16,
iv: 0
};
})), require_browser$6 = __commonJSMin(((t) => {
var e = require_browserify_des(), r = require_browser$7(), i = require_modes$1(), n = require_modes(), o = require_evp_bytestokey();
function s(t, o, s) {
if (t = t.toLowerCase(), i[t]) return r.createCipheriv(t, o, s);
if (n[t]) return new e({
key: o,
iv: s,
mode: t
});
throw new TypeError("invalid suite type");
}
function a(t, o, s) {
if (t = t.toLowerCase(), i[t]) return r.createDecipheriv(t, o, s);
if (n[t]) return new e({
key: o,
iv: s,
mode: t,
decrypt: !0
});
throw new TypeError("invalid suite type");
}
t.createCipher = t.Cipher = function(t, e) {
var r, a;
if (t = t.toLowerCase(), i[t]) r = i[t].key, a = i[t].iv;
else {
if (!n[t]) throw new TypeError("invalid suite type");
r = 8 * n[t].key, a = n[t].iv;
}
var h = o(e, !1, r, a);
return s(t, h.key, h.iv);
}, t.createCipheriv = t.Cipheriv = s, t.createDecipher = t.Decipher = function(t, e) {
var r, s;
if (t = t.toLowerCase(), i[t]) r = i[t].key, s = i[t].iv;
else {
if (!n[t]) throw new TypeError("invalid suite type");
r = 8 * n[t].key, s = n[t].iv;
}
var h = o(e, !1, r, s);
return a(t, h.key, h.iv);
}, t.createDecipheriv = t.Decipheriv = a, t.listCiphers = t.getCiphers = function() {
return Object.keys(n).concat(r.getCiphers());
};
})), require_bn$6 = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var r = t.charCodeAt(e);
return r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : r - 48 & 15;
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, r, i) {
for (var n = 0, o = Math.min(t.length, r), s = e; s < o; s++) {
var a = t.charCodeAt(s) - 48;
n *= i, n += a >= 49 ? a - 49 + 10 : a >= 17 ? a - 17 + 10 : a;
}
return n;
}
n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this.strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this.strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this.strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, n.prototype.inspect = function() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
};
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"
], f = [
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
], l = [
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 c(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r.strip();
}
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? u[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var c = f[t], d = l[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modn(d).toString(t);
i = (p = p.idivn(d)).isZero() ? m + i : u[c - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16);
}, n.prototype.toBuffer = function(t, e) {
return r(void 0 !== o), this.toArrayLike(o, t, e);
}, n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
}, n.prototype.toArrayLike = function(t, e, i) {
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0"), this.strip();
var s, a, h = "le" === e, u = new t(o), f = this.clone();
if (h) {
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[a] = s;
for (; a < o; a++) u[a] = 0;
} else {
for (a = 0; a < o - n; a++) u[a] = 0;
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[o - a - 1] = s;
}
return u;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this.strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this.strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this.strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this.strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this.strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this.strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var d = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function p(t, e, r) {
return new m().mulp(t, e, r);
}
function m(t, e) {
this.x = t, this.y = e;
}
Math.imul || (d = c), n.prototype.mulTo = function(t, e) {
var r, i = this.length + t.length;
return r = 10 === this.length && 10 === t.length ? d(this, t, e) : i < 63 ? c(this, t, e) : i < 1024 ? function(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r.strip();
}(this, t, e) : p(this, t, e), r;
}, m.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, m.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, m.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, m.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, m.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, m.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, m.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, m.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, m.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, m.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r.strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), p(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
r("number" == typeof t), r(t < 67108864);
for (var e = 0, i = 0; i < this.length; i++) {
var n = (0 | this.words[i]) * t, o = (67108863 & n) + (67108863 & e);
e >>= 26, e += n / 67108864 | 0, e += o >>> 26, this.words[i] = 67108863 & o;
}
return 0 !== e && (this.words[i] = e, this.length++), this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = (t.words[i] & 1 << n) >>> n;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this.strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this.strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this.strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this.strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this.strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a.strip(), i.strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modn = function(t) {
r(t <= 67108863);
for (var e = (1 << 26) % t, i = 0, n = this.length - 1; n >= 0; n--) i = (e * i + (0 | this.words[n])) % t;
return i;
}, n.prototype.idivn = function(t) {
r(t <= 67108863);
for (var e = 0, i = this.length - 1; i >= 0; i--) {
var n = (0 | this.words[i]) + 67108864 * e;
this.words[i] = n / t | 0, e = n % t;
}
return this.strip();
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this.strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new M(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var g = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function y(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function b() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function v() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function w() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function M(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function S(t) {
M.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, y.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, y.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, y.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(b, y), b.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, b.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(v, y), i(_, y), i(w, y), w.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (g[t]) return g[t];
var e;
if ("k256" === t) e = new b();
else if ("p224" === t) e = new v();
else if ("p192" === t) e = new _();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new w();
}
return g[t] = e, e;
}, M.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, M.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, M.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : t.umod(this.m)._forceRed(this);
}, M.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, M.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, M.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, M.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, M.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, M.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, M.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, M.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, M.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, M.prototype.sqr = function(t) {
return this.mul(t, t);
}, M.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, M.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, M.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, M.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, M.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new S(t);
}, i(S, M), S.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, S.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, S.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, S.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, S.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_bn$5 = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var r = t.charCodeAt(e);
return r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : r - 48 & 15;
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, r, i) {
for (var n = 0, o = Math.min(t.length, r), s = e; s < o; s++) {
var a = t.charCodeAt(s) - 48;
n *= i, n += a >= 49 ? a - 49 + 10 : a >= 17 ? a - 17 + 10 : a;
}
return n;
}
n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this.strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this.strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this.strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, n.prototype.inspect = function() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
};
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"
], f = [
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
], l = [
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 c(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r.strip();
}
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? u[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var c = f[t], d = l[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modn(d).toString(t);
i = (p = p.idivn(d)).isZero() ? m + i : u[c - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16);
}, n.prototype.toBuffer = function(t, e) {
return r(void 0 !== o), this.toArrayLike(o, t, e);
}, n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
}, n.prototype.toArrayLike = function(t, e, i) {
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0"), this.strip();
var s, a, h = "le" === e, u = new t(o), f = this.clone();
if (h) {
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[a] = s;
for (; a < o; a++) u[a] = 0;
} else {
for (a = 0; a < o - n; a++) u[a] = 0;
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[o - a - 1] = s;
}
return u;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this.strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this.strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this.strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this.strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this.strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this.strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var d = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function p(t, e, r) {
return new m().mulp(t, e, r);
}
function m(t, e) {
this.x = t, this.y = e;
}
Math.imul || (d = c), n.prototype.mulTo = function(t, e) {
var r, i = this.length + t.length;
return r = 10 === this.length && 10 === t.length ? d(this, t, e) : i < 63 ? c(this, t, e) : i < 1024 ? function(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r.strip();
}(this, t, e) : p(this, t, e), r;
}, m.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, m.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, m.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, m.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, m.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, m.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, m.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, m.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, m.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, m.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r.strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), p(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
r("number" == typeof t), r(t < 67108864);
for (var e = 0, i = 0; i < this.length; i++) {
var n = (0 | this.words[i]) * t, o = (67108863 & n) + (67108863 & e);
e >>= 26, e += n / 67108864 | 0, e += o >>> 26, this.words[i] = 67108863 & o;
}
return 0 !== e && (this.words[i] = e, this.length++), this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = (t.words[i] & 1 << n) >>> n;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this.strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this.strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this.strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this.strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this.strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a.strip(), i.strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modn = function(t) {
r(t <= 67108863);
for (var e = (1 << 26) % t, i = 0, n = this.length - 1; n >= 0; n--) i = (e * i + (0 | this.words[n])) % t;
return i;
}, n.prototype.idivn = function(t) {
r(t <= 67108863);
for (var e = 0, i = this.length - 1; i >= 0; i--) {
var n = (0 | this.words[i]) + 67108864 * e;
this.words[i] = n / t | 0, e = n % t;
}
return this.strip();
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this.strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new M(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var g = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function y(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function b() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function v() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function w() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function M(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function S(t) {
M.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, y.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, y.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, y.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(b, y), b.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, b.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(v, y), i(_, y), i(w, y), w.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (g[t]) return g[t];
var e;
if ("k256" === t) e = new b();
else if ("p224" === t) e = new v();
else if ("p192" === t) e = new _();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new w();
}
return g[t] = e, e;
}, M.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, M.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, M.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : t.umod(this.m)._forceRed(this);
}, M.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, M.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, M.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, M.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, M.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, M.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, M.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, M.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, M.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, M.prototype.sqr = function(t) {
return this.mul(t, t);
}, M.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, M.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, M.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, M.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, M.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new S(t);
}, i(S, M), S.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, S.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, S.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, S.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, S.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_brorand = __commonJSMin(((t, e) => {
var r;
function i(t) {
this.rand = t;
}
if (e.exports = function(t) {
return r || (r = new i(null)), r.generate(t);
}, e.exports.Rand = i, i.prototype.generate = function(t) {
return this._rand(t);
}, i.prototype._rand = function(t) {
if (this.rand.getBytes) return this.rand.getBytes(t);
for (var e = new Uint8Array(t), r = 0; r < e.length; r++) e[r] = this.rand.getByte();
return e;
}, "object" == typeof self) self.crypto && self.crypto.getRandomValues ? i.prototype._rand = function(t) {
var e = new Uint8Array(t);
return self.crypto.getRandomValues(e), e;
} : self.msCrypto && self.msCrypto.getRandomValues ? i.prototype._rand = function(t) {
var e = new Uint8Array(t);
return self.msCrypto.getRandomValues(e), e;
} : "object" == typeof window && (i.prototype._rand = function() {
throw new Error("Not implemented yet");
});
else try {
var n = require_crypto_browserify();
if ("function" != typeof n.randomBytes) throw new Error("Not supported");
i.prototype._rand = function(t) {
return n.randomBytes(t);
};
} catch (t) {}
})), require_mr = __commonJSMin(((t, e) => {
var r = require_bn$5(), i = require_brorand();
function n(t) {
this.rand = t || new i.Rand();
}
e.exports = n, n.create = function(t) {
return new n(t);
}, n.prototype._randbelow = function(t) {
var e = t.bitLength(), i = Math.ceil(e / 8);
do
var n = new r(this.rand.generate(i));
while (n.cmp(t) >= 0);
return n;
}, n.prototype._randrange = function(t, e) {
var r = e.sub(t);
return t.add(this._randbelow(r));
}, n.prototype.test = function(t, e, i) {
var n = t.bitLength(), o = r.mont(t), s = new r(1).toRed(o);
e || (e = Math.max(1, n / 48 | 0));
for (var a = t.subn(1), h = 0; !a.testn(h); h++);
for (var u = t.shrn(h), f = a.toRed(o); e > 0; e--) {
var l = this._randrange(new r(2), a);
i && i(l);
var c = l.toRed(o).redPow(u);
if (0 !== c.cmp(s) && 0 !== c.cmp(f)) {
for (var d = 1; d < h; d++) {
if (0 === (c = c.redSqr()).cmp(s)) return !1;
if (0 === c.cmp(f)) break;
}
if (d === h) return !1;
}
}
return !0;
}, n.prototype.getDivisor = function(t, e) {
var i = t.bitLength(), n = r.mont(t), o = new r(1).toRed(n);
e || (e = Math.max(1, i / 48 | 0));
for (var s = t.subn(1), a = 0; !s.testn(a); a++);
for (var h = t.shrn(a), u = s.toRed(n); e > 0; e--) {
var f = this._randrange(new r(2), s), l = t.gcd(f);
if (0 !== l.cmpn(1)) return l;
var c = f.toRed(n).redPow(h);
if (0 !== c.cmp(o) && 0 !== c.cmp(u)) {
for (var d = 1; d < a; d++) {
if (0 === (c = c.redSqr()).cmp(o)) return c.fromRed().subn(1).gcd(t);
if (0 === c.cmp(u)) break;
}
if (d === a) return (c = c.redSqr()).fromRed().subn(1).gcd(t);
}
}
return !1;
};
})), require_generatePrime = __commonJSMin(((t, e) => {
var r = require_browser$11();
e.exports = y, y.simpleSieve = m, y.fermatTest = g;
var i = require_bn$6(), n = new i(24), o = new (require_mr())(), s = new i(1), a = new i(2), h = new i(5);
new i(16), new i(8);
var u = new i(10), f = new i(3);
new i(7);
var l = new i(11), c = new i(4);
new i(12);
var d = null;
function p() {
if (null !== d) return d;
var t = [];
t[0] = 2;
for (var e = 1, r = 3; r < 1048576; r += 2) {
for (var i = Math.ceil(Math.sqrt(r)), n = 0; n < e && t[n] <= i && r % t[n] != 0; n++);
e !== n && t[n] <= i || (t[e++] = r);
}
return d = t, t;
}
function m(t) {
for (var e = p(), r = 0; r < e.length; r++) if (0 === t.modn(e[r])) return 0 === t.cmpn(e[r]);
return !0;
}
function g(t) {
var e = i.mont(t);
return 0 === a.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1);
}
function y(t, e) {
if (t < 16) return new i(2 === e || 5 === e ? [140, 123] : [140, 39]);
var d, p;
for (e = new i(e);;) {
for (d = new i(r(Math.ceil(t / 8))); d.bitLength() > t;) d.ishrn(1);
if (d.isEven() && d.iadd(s), d.testn(1) || d.iadd(a), e.cmp(a)) {
if (!e.cmp(h)) for (; d.mod(u).cmp(f);) d.iadd(c);
} else for (; d.mod(n).cmp(l);) d.iadd(c);
if (m(p = d.shrn(1)) && m(d) && g(p) && g(d) && o.test(p) && o.test(d)) return d;
}
}
})), primes_exports = __exportAll({
default: () => primes_default,
modp1: () => modp1,
modp14: () => modp14,
modp15: () => modp15,
modp16: () => modp16,
modp17: () => modp17,
modp18: () => modp18,
modp2: () => modp2,
modp5: () => modp5
}), modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, primes_default, init_primes = __esmMin((() => {
primes_default = {
modp1: modp1 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"
},
modp2: modp2 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"
},
modp5: modp5 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"
},
modp14: modp14 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"
},
modp15: modp15 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"
},
modp16: modp16 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"
},
modp17: modp17 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"
},
modp18: modp18 = {
gen: "02",
prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"
}
};
})), require_dh = __commonJSMin(((t, e) => {
init_dist$1();
var r = require_bn$6(), i = new (require_mr())(), n = new r(24), o = new r(11), s = new r(10), a = new r(3), h = new r(7), u = require_generatePrime(), f = require_browser$11();
function l(t, e) {
return e = e || "utf8", Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e)), this._pub = new r(t), this;
}
function c(t, e) {
return e = e || "utf8", Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e)), this._priv = new r(t), this;
}
e.exports = p;
var d = {};
function p(t, e, i) {
this.setGenerator(e), this.__prime = new r(t), this._prime = r.mont(this.__prime), this._primeLen = t.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, i ? (this.setPublicKey = l, this.setPrivateKey = c) : this._primeCode = 8;
}
function m(t, e) {
var r = new Buffer$1(t.toArray());
return e ? r.toString(e) : r;
}
Object.defineProperty(p.prototype, "verifyError", {
enumerable: !0,
get: function() {
return "number" != typeof this._primeCode && (this._primeCode = function(t, e) {
var r = e.toString("hex"), f = [r, t.toString(16)].join("_");
if (f in d) return d[f];
var l, c = 0;
if (t.isEven() || !u.simpleSieve || !u.fermatTest(t) || !i.test(t)) return c += 1, c += "02" === r || "05" === r ? 8 : 4, d[f] = c, c;
switch (i.test(t.shrn(1)) || (c += 2), r) {
case "02":
t.mod(n).cmp(o) && (c += 8);
break;
case "05":
(l = t.mod(s)).cmp(a) && l.cmp(h) && (c += 8);
break;
default: c += 4;
}
return d[f] = c, c;
}(this.__prime, this.__gen)), this._primeCode;
}
}), p.prototype.generateKeys = function() {
return this._priv || (this._priv = new r(f(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();
}, p.prototype.computeSecret = function(t) {
t = (t = new r(t)).toRed(this._prime);
var e = new Buffer$1(t.redPow(this._priv).fromRed().toArray()), i = this.getPrime();
if (e.length < i.length) {
var n = new Buffer$1(i.length - e.length);
n.fill(0), e = Buffer$1.concat([n, e]);
}
return e;
}, p.prototype.getPublicKey = function(t) {
return m(this._pub, t);
}, p.prototype.getPrivateKey = function(t) {
return m(this._priv, t);
}, p.prototype.getPrime = function(t) {
return m(this.__prime, t);
}, p.prototype.getGenerator = function(t) {
return m(this._gen, t);
}, p.prototype.setGenerator = function(t, e) {
return e = e || "utf8", Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e)), this.__gen = t, this._gen = new r(t), this;
};
})), require_browser$5 = __commonJSMin(((t) => {
init_dist$1();
var e = require_generatePrime(), r = (init_primes(), __toCommonJS(primes_exports).default), i = require_dh();
var n = {
binary: !0,
hex: !0,
base64: !0
};
t.DiffieHellmanGroup = t.createDiffieHellmanGroup = t.getDiffieHellman = function(t) {
return new i(new Buffer$1(r[t].prime, "hex"), new Buffer$1(r[t].gen, "hex"));
}, t.createDiffieHellman = t.DiffieHellman = function t(r, o, s, a) {
return Buffer$1.isBuffer(o) || void 0 === n[o] ? t(r, "binary", o, s) : (o = o || "binary", a = a || "binary", s = s || new Buffer$1([2]), Buffer$1.isBuffer(s) || (s = new Buffer$1(s, a)), "number" == typeof r ? new i(e(r, s), s, !0) : (Buffer$1.isBuffer(r) || (r = new Buffer$1(r, o)), new i(r, s, !0)));
};
})), require_safe_buffer$3 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_process_nextick_args = __commonJSMin(((t, e) => {
init_dist$2(), void 0 === process$1 || !process$1.version || 0 === process$1.version.indexOf("v0.") || 0 === process$1.version.indexOf("v1.") && 0 !== process$1.version.indexOf("v1.8.") ? e.exports = { nextTick: function(t, e, r, i) {
if ("function" != typeof t) throw new TypeError("\"callback\" argument must be a function");
var n, o, s = arguments.length;
switch (s) {
case 0:
case 1: return process$1.nextTick(t);
case 2: return process$1.nextTick((function() {
t.call(null, e);
}));
case 3: return process$1.nextTick((function() {
t.call(null, e, r);
}));
case 4: return process$1.nextTick((function() {
t.call(null, e, r, i);
}));
default:
for (n = new Array(s - 1), o = 0; o < n.length;) n[o++] = arguments[o];
return process$1.nextTick((function() {
t.apply(null, n);
}));
}
} } : e.exports = process$1;
})), require_isarray = __commonJSMin(((t, e) => {
var r = {}.toString;
e.exports = Array.isArray || function(t) {
return "[object Array]" == r.call(t);
};
})), require_stream_browser = __commonJSMin(((t, e) => {
e.exports = require_events().EventEmitter;
})), require_safe_buffer$2 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_util = __commonJSMin(((t) => {
function e(t) {
return Object.prototype.toString.call(t);
}
t.isArray = function(t) {
return Array.isArray ? Array.isArray(t) : "[object Array]" === e(t);
}, t.isBoolean = function(t) {
return "boolean" == typeof t;
}, t.isNull = function(t) {
return null === t;
}, t.isNullOrUndefined = function(t) {
return null == t;
}, t.isNumber = function(t) {
return "number" == typeof t;
}, t.isString = function(t) {
return "string" == typeof t;
}, t.isSymbol = function(t) {
return "symbol" == typeof t;
}, t.isUndefined = function(t) {
return void 0 === t;
}, t.isRegExp = function(t) {
return "[object RegExp]" === e(t);
}, t.isObject = function(t) {
return "object" == typeof t && null !== t;
}, t.isDate = function(t) {
return "[object Date]" === e(t);
}, t.isError = function(t) {
return "[object Error]" === e(t) || t instanceof Error;
}, t.isFunction = function(t) {
return "function" == typeof t;
}, t.isPrimitive = function(t) {
return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" == typeof t || void 0 === t;
}, t.isBuffer = require_dist().Buffer.isBuffer;
})), require_BufferList = __commonJSMin(((t, e) => {
var r = require_safe_buffer$2().Buffer, i = require_util$1();
e.exports = function() {
function t() {
(function(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
})(this, t), this.head = null, this.tail = null, this.length = 0;
}
return t.prototype.push = function(t) {
var e = {
data: t,
next: null
};
this.length > 0 ? this.tail.next = e : this.head = e, this.tail = e, ++this.length;
}, t.prototype.unshift = function(t) {
var e = {
data: t,
next: this.head
};
0 === this.length && (this.tail = e), this.head = e, ++this.length;
}, t.prototype.shift = function() {
if (0 !== this.length) {
var t = this.head.data;
return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, t;
}
}, t.prototype.clear = function() {
this.head = this.tail = null, this.length = 0;
}, t.prototype.join = function(t) {
if (0 === this.length) return "";
for (var e = this.head, r = "" + e.data; e = e.next;) r += t + e.data;
return r;
}, t.prototype.concat = function(t) {
if (0 === this.length) return r.alloc(0);
for (var e, i, n, o = r.allocUnsafe(t >>> 0), s = this.head, a = 0; s;) e = s.data, i = o, n = a, e.copy(i, n), a += s.data.length, s = s.next;
return o;
}, t;
}(), i && i.inspect && i.inspect.custom && (e.exports.prototype[i.inspect.custom] = function() {
var t = i.inspect({ length: this.length });
return this.constructor.name + " " + t;
});
})), require_destroy = __commonJSMin(((t, e) => {
var r = require_process_nextick_args();
function i(t, e) {
t.emit("error", e);
}
e.exports = {
destroy: function(t, e) {
var n = this, o = this._readableState && this._readableState.destroyed, s = this._writableState && this._writableState.destroyed;
return o || s ? (e ? e(t) : t && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, r.nextTick(i, this, t)) : r.nextTick(i, this, t)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(t || null, (function(t) {
!e && t ? n._writableState ? n._writableState.errorEmitted || (n._writableState.errorEmitted = !0, r.nextTick(i, n, t)) : r.nextTick(i, n, t) : e && e(t);
})), this);
},
undestroy: function() {
this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
}
};
})), require__stream_writable = __commonJSMin(((t, e) => {
init_dist(), init_dist$2();
var r = require_process_nextick_args();
function i(t) {
var e = this;
this.next = null, this.entry = null, this.finish = function() {
(function(t, e, r) {
var i = t.entry;
t.entry = null;
for (; i;) {
var n = i.callback;
e.pendingcb--, n(r), i = i.next;
}
e.corkedRequestsFree.next = t;
})(e, t);
};
}
e.exports = m;
var n, o = !process$1.browser && ["v0.10", "v0.9."].indexOf(process$1.version.slice(0, 5)) > -1 ? setImmediate : r.nextTick;
m.WritableState = p;
var s = Object.create(require_util());
s.inherits = require_inherits_browser();
var a = { deprecate: require_browser$12() }, h = require_stream_browser(), u = require_safe_buffer$2().Buffer, f = (void 0 !== global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() {};
var l, c = require_destroy();
function d() {}
function p(t, e) {
n = n || require__stream_duplex(), t = t || {};
var s = e instanceof n;
this.objectMode = !!t.objectMode, s && (this.objectMode = this.objectMode || !!t.writableObjectMode);
var a = t.highWaterMark, h = t.writableHighWaterMark, u = this.objectMode ? 16 : 16384;
this.highWaterMark = a || 0 === a ? a : s && (h || 0 === h) ? h : u, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
var f = !1 === t.decodeStrings;
this.decodeStrings = !f, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(t) {
(function(t, e) {
var i = t._writableState, n = i.sync, s = i.writecb;
if (function(t) {
t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;
}(i), e) (function(t, e, i, n, o) {
--e.pendingcb, i ? (r.nextTick(o, n), r.nextTick(w, t, e), t._writableState.errorEmitted = !0, t.emit("error", n)) : (o(n), t._writableState.errorEmitted = !0, t.emit("error", n), w(t, e));
})(t, i, n, e, s);
else {
var a = v(i);
a || i.corked || i.bufferProcessing || !i.bufferedRequest || b(t, i), n ? o(y, t, i, a, s) : y(t, i, a, s);
}
})(e, t);
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new i(this);
}
function m(t) {
if (n = n || require__stream_duplex(), !(l.call(m, this) || this instanceof n)) return new m(t);
this._writableState = new p(t, this), this.writable = !0, t && ("function" == typeof t.write && (this._write = t.write), "function" == typeof t.writev && (this._writev = t.writev), "function" == typeof t.destroy && (this._destroy = t.destroy), "function" == typeof t.final && (this._final = t.final)), h.call(this);
}
function g(t, e, r, i, n, o, s) {
e.writelen = i, e.writecb = s, e.writing = !0, e.sync = !0, r ? t._writev(n, e.onwrite) : t._write(n, o, e.onwrite), e.sync = !1;
}
function y(t, e, r, i) {
r || function(t, e) {
0 === e.length && e.needDrain && (e.needDrain = !1, t.emit("drain"));
}(t, e), e.pendingcb--, i(), w(t, e);
}
function b(t, e) {
e.bufferProcessing = !0;
var r = e.bufferedRequest;
if (t._writev && r && r.next) {
var n = e.bufferedRequestCount, o = new Array(n), s = e.corkedRequestsFree;
s.entry = r;
for (var a = 0, h = !0; r;) o[a] = r, r.isBuf || (h = !1), r = r.next, a += 1;
o.allBuffers = h, g(t, e, !0, e.length, o, "", s.finish), e.pendingcb++, e.lastBufferedRequest = null, s.next ? (e.corkedRequestsFree = s.next, s.next = null) : e.corkedRequestsFree = new i(e), e.bufferedRequestCount = 0;
} else {
for (; r;) {
var u = r.chunk, f = r.encoding, l = r.callback;
if (g(t, e, !1, e.objectMode ? 1 : u.length, u, f, l), r = r.next, e.bufferedRequestCount--, e.writing) break;
}
null === r && (e.lastBufferedRequest = null);
}
e.bufferedRequest = r, e.bufferProcessing = !1;
}
function v(t) {
return t.ending && 0 === t.length && null === t.bufferedRequest && !t.finished && !t.writing;
}
function _(t, e) {
t._final((function(r) {
e.pendingcb--, r && t.emit("error", r), e.prefinished = !0, t.emit("prefinish"), w(t, e);
}));
}
function w(t, e) {
var i = v(e);
return i && (function(t, e) {
e.prefinished || e.finalCalled || ("function" == typeof t._final ? (e.pendingcb++, e.finalCalled = !0, r.nextTick(_, t, e)) : (e.prefinished = !0, t.emit("prefinish")));
}(t, e), 0 === e.pendingcb && (e.finished = !0, t.emit("finish"))), i;
}
s.inherits(m, h), p.prototype.getBuffer = function() {
for (var t = this.bufferedRequest, e = []; t;) e.push(t), t = t.next;
return e;
}, function() {
try {
Object.defineProperty(p.prototype, "buffer", { get: a.deprecate((function() {
return this.getBuffer();
}), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") });
} catch (t) {}
}(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (l = Function.prototype[Symbol.hasInstance], Object.defineProperty(m, Symbol.hasInstance, { value: function(t) {
return !!l.call(this, t) || this === m && t && t._writableState instanceof p;
} })) : l = function(t) {
return t instanceof this;
}, m.prototype.pipe = function() {
this.emit("error", /* @__PURE__ */ new Error("Cannot pipe, not readable"));
}, m.prototype.write = function(t, e, i) {
var n, o = this._writableState, s = !1, a = !o.objectMode && (n = t, u.isBuffer(n) || n instanceof f);
return a && !u.isBuffer(t) && (t = function(t) {
return u.from(t);
}(t)), "function" == typeof e && (i = e, e = null), a ? e = "buffer" : e || (e = o.defaultEncoding), "function" != typeof i && (i = d), o.ended ? function(t, e) {
var i = /* @__PURE__ */ new Error("write after end");
t.emit("error", i), r.nextTick(e, i);
}(this, i) : (a || function(t, e, i, n) {
var o = !0, s = !1;
return null === i ? s = /* @__PURE__ */ new TypeError("May not write null values to stream") : "string" == typeof i || void 0 === i || e.objectMode || (s = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk")), s && (t.emit("error", s), r.nextTick(n, s), o = !1), o;
}(this, o, t, i)) && (o.pendingcb++, s = function(t, e, r, i, n, o) {
if (!r) {
var s = function(t, e, r) {
t.objectMode || !1 === t.decodeStrings || "string" != typeof e || (e = u.from(e, r));
return e;
}(e, i, n);
i !== s && (r = !0, n = "buffer", i = s);
}
var a = e.objectMode ? 1 : i.length;
e.length += a;
var h = e.length < e.highWaterMark;
h || (e.needDrain = !0);
if (e.writing || e.corked) {
var f = e.lastBufferedRequest;
e.lastBufferedRequest = {
chunk: i,
encoding: n,
isBuf: r,
callback: o,
next: null
}, f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
} else g(t, e, !1, a, i, n, o);
return h;
}(this, o, a, t, e, i)), s;
}, m.prototype.cork = function() {
this._writableState.corked++;
}, m.prototype.uncork = function() {
var t = this._writableState;
t.corked && (t.corked--, t.writing || t.corked || t.bufferProcessing || !t.bufferedRequest || b(this, t));
}, m.prototype.setDefaultEncoding = function(t) {
if ("string" == typeof t && (t = t.toLowerCase()), !([
"hex",
"utf8",
"utf-8",
"ascii",
"binary",
"base64",
"ucs2",
"ucs-2",
"utf16le",
"utf-16le",
"raw"
].indexOf((t + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + t);
return this._writableState.defaultEncoding = t, this;
}, Object.defineProperty(m.prototype, "writableHighWaterMark", {
enumerable: !1,
get: function() {
return this._writableState.highWaterMark;
}
}), m.prototype._write = function(t, e, r) {
r(/* @__PURE__ */ new Error("_write() is not implemented"));
}, m.prototype._writev = null, m.prototype.end = function(t, e, i) {
var n = this._writableState;
"function" == typeof t ? (i = t, t = null, e = null) : "function" == typeof e && (i = e, e = null), null != t && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), n.ending || function(t, e, i) {
e.ending = !0, w(t, e), i && (e.finished ? r.nextTick(i) : t.once("finish", i));
e.ended = !0, t.writable = !1;
}(this, n, i);
}, Object.defineProperty(m.prototype, "destroyed", {
get: function() {
return void 0 !== this._writableState && this._writableState.destroyed;
},
set: function(t) {
this._writableState && (this._writableState.destroyed = t);
}
}), m.prototype.destroy = c.destroy, m.prototype._undestroy = c.undestroy, m.prototype._destroy = function(t, e) {
this.end(), e(t);
};
})), require__stream_duplex = __commonJSMin(((t, e) => {
var r = require_process_nextick_args(), i = Object.keys || function(t) {
var e = [];
for (var r in t) e.push(r);
return e;
};
e.exports = f;
var n = Object.create(require_util());
n.inherits = require_inherits_browser();
var o = require__stream_readable(), s = require__stream_writable();
n.inherits(f, o);
for (var a = i(s.prototype), h = 0; h < a.length; h++) {
var u = a[h];
f.prototype[u] || (f.prototype[u] = s.prototype[u]);
}
function f(t) {
if (!(this instanceof f)) return new f(t);
o.call(this, t), s.call(this, t), t && !1 === t.readable && (this.readable = !1), t && !1 === t.writable && (this.writable = !1), this.allowHalfOpen = !0, t && !1 === t.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", l);
}
function l() {
this.allowHalfOpen || this._writableState.ended || r.nextTick(c, this);
}
function c(t) {
t.end();
}
Object.defineProperty(f.prototype, "writableHighWaterMark", {
enumerable: !1,
get: function() {
return this._writableState.highWaterMark;
}
}), Object.defineProperty(f.prototype, "destroyed", {
get: function() {
return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed;
},
set: function(t) {
void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = t, this._writableState.destroyed = t);
}
}), f.prototype._destroy = function(t, e) {
this.push(null), this.end(), r.nextTick(e, t);
};
})), require__stream_readable = __commonJSMin(((t, e) => {
init_dist(), init_dist$2();
var r = require_process_nextick_args();
e.exports = y;
var i, n = require_isarray();
y.ReadableState = g, require_events().EventEmitter;
var o = function(t, e) {
return t.listeners(e).length;
}, s = require_stream_browser(), a = require_safe_buffer$2().Buffer, h = (void 0 !== global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() {};
var u = Object.create(require_util());
u.inherits = require_inherits_browser();
var f = require_util$1(), l = void 0;
l = f && f.debuglog ? f.debuglog("stream") : function() {};
var c, d = require_BufferList(), p = require_destroy();
u.inherits(y, s);
var m = [
"error",
"close",
"destroy",
"pause",
"resume"
];
function g(t, e) {
t = t || {};
var r = e instanceof (i = i || require__stream_duplex());
this.objectMode = !!t.objectMode, r && (this.objectMode = this.objectMode || !!t.readableObjectMode);
var n = t.highWaterMark, o = t.readableHighWaterMark, s = this.objectMode ? 16 : 16384;
this.highWaterMark = n || 0 === n ? n : r && (o || 0 === o) ? o : s, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new d(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.destroyed = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (c || (c = require_string_decoder().StringDecoder), this.decoder = new c(t.encoding), this.encoding = t.encoding);
}
function y(t) {
if (i = i || require__stream_duplex(), !(this instanceof y)) return new y(t);
this._readableState = new g(t, this), this.readable = !0, t && ("function" == typeof t.read && (this._read = t.read), "function" == typeof t.destroy && (this._destroy = t.destroy)), s.call(this);
}
function b(t, e, r, i, n) {
var o, s = t._readableState;
null === e ? (s.reading = !1, function(t, e) {
if (e.ended) return;
if (e.decoder) {
var r = e.decoder.end();
r && r.length && (e.buffer.push(r), e.length += e.objectMode ? 1 : r.length);
}
e.ended = !0, M(t);
}(t, s)) : (n || (o = function(t, e) {
var r;
i = e, a.isBuffer(i) || i instanceof h || "string" == typeof e || void 0 === e || t.objectMode || (r = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk"));
var i;
return r;
}(s, e)), o ? t.emit("error", o) : s.objectMode || e && e.length > 0 ? ("string" == typeof e || s.objectMode || Object.getPrototypeOf(e) === a.prototype || (e = function(t) {
return a.from(t);
}(e)), i ? s.endEmitted ? t.emit("error", /* @__PURE__ */ new Error("stream.unshift() after end event")) : v(t, s, e, !0) : s.ended ? t.emit("error", /* @__PURE__ */ new Error("stream.push() after EOF")) : (s.reading = !1, s.decoder && !r ? (e = s.decoder.write(e), s.objectMode || 0 !== e.length ? v(t, s, e, !1) : E(t, s)) : v(t, s, e, !1))) : i || (s.reading = !1));
return function(t) {
return !t.ended && (t.needReadable || t.length < t.highWaterMark || 0 === t.length);
}(s);
}
function v(t, e, r, i) {
e.flowing && 0 === e.length && !e.sync ? (t.emit("data", r), t.read(0)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && M(t)), E(t, e);
}
Object.defineProperty(y.prototype, "destroyed", {
get: function() {
return void 0 !== this._readableState && this._readableState.destroyed;
},
set: function(t) {
this._readableState && (this._readableState.destroyed = t);
}
}), y.prototype.destroy = p.destroy, y.prototype._undestroy = p.undestroy, y.prototype._destroy = function(t, e) {
this.push(null), e(t);
}, y.prototype.push = function(t, e) {
var r, i = this._readableState;
return i.objectMode ? r = !0 : "string" == typeof t && ((e = e || i.defaultEncoding) !== i.encoding && (t = a.from(t, e), e = ""), r = !0), b(this, t, e, !1, r);
}, y.prototype.unshift = function(t) {
return b(this, t, null, !0, !1);
}, y.prototype.isPaused = function() {
return !1 === this._readableState.flowing;
}, y.prototype.setEncoding = function(t) {
return c || (c = require_string_decoder().StringDecoder), this._readableState.decoder = new c(t), this._readableState.encoding = t, this;
};
var _ = 8388608;
function w(t, e) {
return t <= 0 || 0 === e.length && e.ended ? 0 : e.objectMode ? 1 : t != t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = function(t) {
return t >= _ ? t = _ : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
}(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
}
function M(t) {
var e = t._readableState;
e.needReadable = !1, e.emittedReadable || (l("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? r.nextTick(S, t) : S(t));
}
function S(t) {
l("emit readable"), t.emit("readable"), P(t);
}
function E(t, e) {
e.readingMore || (e.readingMore = !0, r.nextTick(A, t, e));
}
function A(t, e) {
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (l("maybeReadMore read 0"), t.read(0), r !== e.length);) r = e.length;
e.readingMore = !1;
}
function C(t) {
l("readable nexttick read 0"), t.read(0);
}
function O(t, e) {
e.reading || (l("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), P(t), e.flowing && !e.reading && t.read(0);
}
function P(t) {
var e = t._readableState;
for (l("flow", e.flowing); e.flowing && null !== t.read(););
}
function I(t, e) {
return 0 === e.length ? null : (e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (r = e.decoder ? e.buffer.join("") : 1 === e.buffer.length ? e.buffer.head.data : e.buffer.concat(e.length), e.buffer.clear()) : r = function(t, e, r) {
var i;
t < e.head.data.length ? (i = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : i = t === e.head.data.length ? e.shift() : r ? function(t, e) {
var r = e.head, i = 1, n = r.data;
t -= n.length;
for (; r = r.next;) {
var o = r.data, s = t > o.length ? o.length : t;
if (s === o.length ? n += o : n += o.slice(0, t), 0 === (t -= s)) {
s === o.length ? (++i, r.next ? e.head = r.next : e.head = e.tail = null) : (e.head = r, r.data = o.slice(s));
break;
}
++i;
}
return e.length -= i, n;
}(t, e) : function(t, e) {
var r = a.allocUnsafe(t), i = e.head, n = 1;
i.data.copy(r), t -= i.data.length;
for (; i = i.next;) {
var o = i.data, s = t > o.length ? o.length : t;
if (o.copy(r, r.length - t, 0, s), 0 === (t -= s)) {
s === o.length ? (++n, i.next ? e.head = i.next : e.head = e.tail = null) : (e.head = i, i.data = o.slice(s));
break;
}
++n;
}
return e.length -= n, r;
}(t, e);
return i;
}(t, e.buffer, e.decoder), r);
var r;
}
function k(t) {
var e = t._readableState;
if (e.length > 0) throw new Error("\"endReadable()\" called on non-empty stream");
e.endEmitted || (e.ended = !0, r.nextTick(R, e, t));
}
function R(t, e) {
t.endEmitted || 0 !== t.length || (t.endEmitted = !0, e.readable = !1, e.emit("end"));
}
function q(t, e) {
for (var r = 0, i = t.length; r < i; r++) if (t[r] === e) return r;
return -1;
}
y.prototype.read = function(t) {
l("read", t), t = parseInt(t, 10);
var e = this._readableState, r = t;
if (0 !== t && (e.emittedReadable = !1), 0 === t && e.needReadable && (e.length >= e.highWaterMark || e.ended)) return l("read: emitReadable", e.length, e.ended), 0 === e.length && e.ended ? k(this) : M(this), null;
if (0 === (t = w(t, e)) && e.ended) return 0 === e.length && k(this), null;
var i, n = e.needReadable;
return l("need readable", n), (0 === e.length || e.length - t < e.highWaterMark) && l("length less than watermark", n = !0), e.ended || e.reading ? l("reading or ended", n = !1) : n && (l("do read"), e.reading = !0, e.sync = !0, 0 === e.length && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = w(r, e))), null === (i = t > 0 ? I(t, e) : null) ? (e.needReadable = !0, t = 0) : e.length -= t, 0 === e.length && (e.ended || (e.needReadable = !0), r !== t && e.ended && k(this)), null !== i && this.emit("data", i), i;
}, y.prototype._read = function(t) {
this.emit("error", /* @__PURE__ */ new Error("_read() is not implemented"));
}, y.prototype.pipe = function(t, e) {
var i = this, s = this._readableState;
switch (s.pipesCount) {
case 0:
s.pipes = t;
break;
case 1:
s.pipes = [s.pipes, t];
break;
default: s.pipes.push(t);
}
s.pipesCount += 1, l("pipe count=%d opts=%j", s.pipesCount, e);
var a = e && !1 === e.end || t === process$1.stdout || t === process$1.stderr ? b : u;
function h(e, r) {
l("onunpipe"), e === i && r && !1 === r.hasUnpiped && (r.hasUnpiped = !0, l("cleanup"), t.removeListener("close", g), t.removeListener("finish", y), t.removeListener("drain", f), t.removeListener("error", m), t.removeListener("unpipe", h), i.removeListener("end", u), i.removeListener("end", b), i.removeListener("data", p), c = !0, !s.awaitDrain || t._writableState && !t._writableState.needDrain || f());
}
function u() {
l("onend"), t.end();
}
s.endEmitted ? r.nextTick(a) : i.once("end", a), t.on("unpipe", h);
var f = function(t) {
return function() {
var e = t._readableState;
l("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, 0 === e.awaitDrain && o(t, "data") && (e.flowing = !0, P(t));
};
}(i);
t.on("drain", f);
var c = !1;
var d = !1;
function p(e) {
l("ondata"), d = !1, !1 !== t.write(e) || d || ((1 === s.pipesCount && s.pipes === t || s.pipesCount > 1 && -1 !== q(s.pipes, t)) && !c && (l("false write response, pause", s.awaitDrain), s.awaitDrain++, d = !0), i.pause());
}
function m(e) {
l("onerror", e), b(), t.removeListener("error", m), 0 === o(t, "error") && t.emit("error", e);
}
function g() {
t.removeListener("finish", y), b();
}
function y() {
l("onfinish"), t.removeListener("close", g), b();
}
function b() {
l("unpipe"), i.unpipe(t);
}
return i.on("data", p), function(t, e, r) {
if ("function" == typeof t.prependListener) return t.prependListener(e, r);
t._events && t._events[e] ? n(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]] : t.on(e, r);
}(t, "error", m), t.once("close", g), t.once("finish", y), t.emit("pipe", i), s.flowing || (l("pipe resume"), i.resume()), t;
}, y.prototype.unpipe = function(t) {
var e = this._readableState, r = { hasUnpiped: !1 };
if (0 === e.pipesCount) return this;
if (1 === e.pipesCount) return t && t !== e.pipes || (t || (t = e.pipes), e.pipes = null, e.pipesCount = 0, e.flowing = !1, t && t.emit("unpipe", this, r)), this;
if (!t) {
var i = e.pipes, n = e.pipesCount;
e.pipes = null, e.pipesCount = 0, e.flowing = !1;
for (var o = 0; o < n; o++) i[o].emit("unpipe", this, { hasUnpiped: !1 });
return this;
}
var s = q(e.pipes, t);
return -1 === s || (e.pipes.splice(s, 1), e.pipesCount -= 1, 1 === e.pipesCount && (e.pipes = e.pipes[0]), t.emit("unpipe", this, r)), this;
}, y.prototype.on = function(t, e) {
var i = s.prototype.on.call(this, t, e);
if ("data" === t) !1 !== this._readableState.flowing && this.resume();
else if ("readable" === t) {
var n = this._readableState;
n.endEmitted || n.readableListening || (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && M(this) : r.nextTick(C, this));
}
return i;
}, y.prototype.addListener = y.prototype.on, y.prototype.resume = function() {
var t = this._readableState;
return t.flowing || (l("resume"), t.flowing = !0, function(t, e) {
e.resumeScheduled || (e.resumeScheduled = !0, r.nextTick(O, t, e));
}(this, t)), this;
}, y.prototype.pause = function() {
return l("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (l("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
}, y.prototype.wrap = function(t) {
var e = this, r = this._readableState, i = !1;
for (var n in t.on("end", (function() {
if (l("wrapped end"), r.decoder && !r.ended) {
var t = r.decoder.end();
t && t.length && e.push(t);
}
e.push(null);
})), t.on("data", (function(n) {
l("wrapped data"), r.decoder && (n = r.decoder.write(n)), r.objectMode && null == n || (r.objectMode || n && n.length) && (e.push(n) || (i = !0, t.pause()));
})), t) void 0 === this[n] && "function" == typeof t[n] && (this[n] = function(e) {
return function() {
return t[e].apply(t, arguments);
};
}(n));
for (var o = 0; o < m.length; o++) t.on(m[o], this.emit.bind(this, m[o]));
return this._read = function(e) {
l("wrapped _read", e), i && (i = !1, t.resume());
}, this;
}, Object.defineProperty(y.prototype, "readableHighWaterMark", {
enumerable: !1,
get: function() {
return this._readableState.highWaterMark;
}
}), y._fromList = I;
})), require__stream_transform = __commonJSMin(((t, e) => {
e.exports = o;
var r = require__stream_duplex(), i = Object.create(require_util());
function n(t, e) {
var r = this._transformState;
r.transforming = !1;
var i = r.writecb;
if (!i) return this.emit("error", /* @__PURE__ */ new Error("write callback called multiple times"));
r.writechunk = null, r.writecb = null, null != e && this.push(e), i(t);
var n = this._readableState;
n.reading = !1, (n.needReadable || n.length < n.highWaterMark) && this._read(n.highWaterMark);
}
function o(t) {
if (!(this instanceof o)) return new o(t);
r.call(this, t), this._transformState = {
afterTransform: n.bind(this),
needTransform: !1,
transforming: !1,
writecb: null,
writechunk: null,
writeencoding: null
}, this._readableState.needReadable = !0, this._readableState.sync = !1, t && ("function" == typeof t.transform && (this._transform = t.transform), "function" == typeof t.flush && (this._flush = t.flush)), this.on("prefinish", s);
}
function s() {
var t = this;
"function" == typeof this._flush ? this._flush((function(e, r) {
a(t, e, r);
})) : a(this, null, null);
}
function a(t, e, r) {
if (e) return t.emit("error", e);
if (null != r && t.push(r), t._writableState.length) throw new Error("Calling transform done when ws.length != 0");
if (t._transformState.transforming) throw new Error("Calling transform done when still transforming");
return t.push(null);
}
i.inherits = require_inherits_browser(), i.inherits(o, r), o.prototype.push = function(t, e) {
return this._transformState.needTransform = !1, r.prototype.push.call(this, t, e);
}, o.prototype._transform = function(t, e, r) {
throw new Error("_transform() is not implemented");
}, o.prototype._write = function(t, e, r) {
var i = this._transformState;
if (i.writecb = r, i.writechunk = t, i.writeencoding = e, !i.transforming) {
var n = this._readableState;
(i.needTransform || n.needReadable || n.length < n.highWaterMark) && this._read(n.highWaterMark);
}
}, o.prototype._read = function(t) {
var e = this._transformState;
null !== e.writechunk && e.writecb && !e.transforming ? (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0;
}, o.prototype._destroy = function(t, e) {
var i = this;
r.prototype._destroy.call(this, t, (function(t) {
e(t), i.emit("close");
}));
};
})), require__stream_passthrough = __commonJSMin(((t, e) => {
e.exports = n;
var r = require__stream_transform(), i = Object.create(require_util());
function n(t) {
if (!(this instanceof n)) return new n(t);
r.call(this, t);
}
i.inherits = require_inherits_browser(), i.inherits(n, r), n.prototype._transform = function(t, e, r) {
r(null, t);
};
})), require_readable_browser = __commonJSMin(((t, e) => {
(t = e.exports = require__stream_readable()).Stream = t, t.Readable = t, t.Writable = require__stream_writable(), t.Duplex = require__stream_duplex(), t.Transform = require__stream_transform(), t.PassThrough = require__stream_passthrough();
})), require_bn$4 = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var i = t.charCodeAt(e);
return i >= 48 && i <= 57 ? i - 48 : i >= 65 && i <= 70 ? i - 55 : i >= 97 && i <= 102 ? i - 87 : void r(!1, "Invalid character in " + t);
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, i, n) {
for (var o = 0, s = 0, a = Math.min(t.length, i), h = e; h < a; h++) {
var u = t.charCodeAt(h) - 48;
o *= n, s = u >= 49 ? u - 49 + 10 : u >= 17 ? u - 17 + 10 : u, r(u >= 0 && s < n, "Invalid character"), o += s;
}
return o;
}
function u(t, e) {
t.words = e.words, t.length = e.length, t.negative = e.negative, t.red = e.red;
}
if (n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this._strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this._strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this._strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype._move = function(t) {
u(t, this);
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype._strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, "undefined" != typeof Symbol && "function" == typeof Symbol.for) try {
n.prototype[Symbol.for("nodejs.util.inspect.custom")] = f;
} catch (t) {
n.prototype.inspect = f;
}
else n.prototype.inspect = f;
function f() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
}
var l = [
"",
"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"
], c = [
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
], d = [
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
];
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? l[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var u = c[t], f = d[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modrn(f).toString(t);
i = (p = p.idivn(f)).isZero() ? m + i : l[u - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16, 2);
}, o && (n.prototype.toBuffer = function(t, e) {
return this.toArrayLike(o, t, e);
}), n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
};
function p(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r._strip();
}
n.prototype.toArrayLike = function(t, e, i) {
this._strip();
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0");
var s = function(t, e) {
return t.allocUnsafe ? t.allocUnsafe(e) : new t(e);
}(t, o);
return this["_toArrayLike" + ("le" === e ? "LE" : "BE")](s, n), s;
}, n.prototype._toArrayLikeLE = function(t, e) {
for (var r = 0, i = 0, n = 0, o = 0; n < this.length; n++) {
var s = this.words[n] << o | i;
t[r++] = 255 & s, r < t.length && (t[r++] = s >> 8 & 255), r < t.length && (t[r++] = s >> 16 & 255), 6 === o ? (r < t.length && (t[r++] = s >> 24 & 255), i = 0, o = 0) : (i = s >>> 24, o += 2);
}
if (r < t.length) for (t[r++] = i; r < t.length;) t[r++] = 0;
}, n.prototype._toArrayLikeBE = function(t, e) {
for (var r = t.length - 1, i = 0, n = 0, o = 0; n < this.length; n++) {
var s = this.words[n] << o | i;
t[r--] = 255 & s, r >= 0 && (t[r--] = s >> 8 & 255), r >= 0 && (t[r--] = s >> 16 & 255), 6 === o ? (r >= 0 && (t[r--] = s >> 24 & 255), i = 0, o = 0) : (i = s >>> 24, o += 2);
}
if (r >= 0) for (t[r--] = i; r >= 0;) t[r--] = 0;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this._strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this._strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this._strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this._strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this._strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this._strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var m = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function g(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r._strip();
}
function y(t, e, r) {
return g(t, e, r);
}
function b(t, e) {
this.x = t, this.y = e;
}
Math.imul || (m = p), n.prototype.mulTo = function(t, e) {
var r = this.length + t.length;
return 10 === this.length && 10 === t.length ? m(this, t, e) : r < 63 ? p(this, t, e) : r < 1024 ? g(this, t, e) : y(this, t, e);
}, b.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, b.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, b.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, b.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, b.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, b.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, b.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, b.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, b.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, b.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r._strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), y(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
var e = t < 0;
e && (t = -t), r("number" == typeof t), r(t < 67108864);
for (var i = 0, n = 0; n < this.length; n++) {
var o = (0 | this.words[n]) * t, s = (67108863 & o) + (67108863 & i);
i >>= 26, i += o / 67108864 | 0, i += s >>> 26, this.words[n] = 67108863 & s;
}
return 0 !== i && (this.words[n] = i, this.length++), e ? this.ineg() : this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = t.words[i] >>> n & 1;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this._strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this._strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this._strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) <= t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this._strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this._strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this._strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a._strip(), i._strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modrn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modrn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modrn = function(t) {
var e = t < 0;
e && (t = -t), r(t <= 67108863);
for (var i = (1 << 26) % t, n = 0, o = this.length - 1; o >= 0; o--) n = (i * n + (0 | this.words[o])) % t;
return e ? -n : n;
}, n.prototype.modn = function(t) {
return this.modrn(t);
}, n.prototype.idivn = function(t) {
var e = t < 0;
e && (t = -t), r(t <= 67108863);
for (var i = 0, n = this.length - 1; n >= 0; n--) {
var o = (0 | this.words[n]) + 67108864 * i;
this.words[n] = o / t | 0, i = o % t;
}
return this._strip(), e ? this.ineg() : this;
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this._strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new A(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var v = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function _(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function w() {
_.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function M() {
_.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function S() {
_.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function E() {
_.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function A(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function C(t) {
A.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, _.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, _.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, _.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(w, _), w.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, w.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(M, _), i(S, _), i(E, _), E.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (v[t]) return v[t];
var e;
if ("k256" === t) e = new w();
else if ("p224" === t) e = new M();
else if ("p192" === t) e = new S();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new E();
}
return v[t] = e, e;
}, A.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, A.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, A.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : (u(t, t.umod(this.m)._forceRed(this)), t);
}, A.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, A.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, A.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, A.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, A.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, A.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, A.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, A.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, A.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, A.prototype.sqr = function(t) {
return this.mul(t, t);
}, A.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, A.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, A.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, A.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, A.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new C(t);
}, i(C, A), C.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, C.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, C.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, C.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, C.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_safe_buffer$1 = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_browserify_rsa = __commonJSMin(((t, e) => {
var r = require_bn$4(), i = require_browser$11(), n = require_safe_buffer$1().Buffer;
function o(t) {
var e, n = t.modulus.byteLength();
do
e = new r(i(n));
while (e.cmp(t.modulus) >= 0 || !e.umod(t.prime1) || !e.umod(t.prime2));
return e;
}
function s(t, e) {
var i = function(t) {
var e = o(t);
return {
blinder: e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed(),
unblinder: e.invm(t.modulus)
};
}(e), s = e.modulus.byteLength(), a = new r(t).mul(i.blinder).umod(e.modulus), h = a.toRed(r.mont(e.prime1)), u = a.toRed(r.mont(e.prime2)), f = e.coefficient, l = e.prime1, c = e.prime2, d = h.redPow(e.exponent1).fromRed(), p = u.redPow(e.exponent2).fromRed(), m = d.isub(p).imul(f).umod(l).imul(c);
return p.iadd(m).imul(i.unblinder).umod(e.modulus).toArrayLike(n, "be", s);
}
s.getr = o, e.exports = s;
})), package_exports = __exportAll({
author: () => author,
bugs: () => bugs,
default: () => package_default,
dependencies: () => dependencies,
description: () => description,
devDependencies: () => devDependencies,
files: () => files,
homepage: () => homepage,
keywords: () => keywords,
license: () => "MIT",
main: () => main,
name: () => name,
repository: () => repository,
scripts: () => scripts,
version: () => version
}), name, version, description, main, files, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, dependencies, package_default, init_package = __esmMin((() => {
package_default = {
name: name = "elliptic",
version: version = "6.6.1",
description: description = "EC cryptography",
main: main = "lib/elliptic.js",
files: files = ["lib"],
scripts: scripts = {
lint: "eslint lib test",
"lint:fix": "npm run lint -- --fix",
unit: "istanbul test _mocha --reporter=spec test/index.js",
test: "npm run lint && npm run unit",
version: "grunt dist && git add dist/"
},
repository: repository = {
type: "git",
url: "git@github.com:indutny/elliptic"
},
keywords: keywords = [
"EC",
"Elliptic",
"curve",
"Cryptography"
],
author: author = "Fedor Indutny <fedor@indutny.com>",
license: "MIT",
bugs: bugs = { url: "https://github.com/indutny/elliptic/issues" },
homepage: homepage = "https://github.com/indutny/elliptic",
devDependencies: devDependencies = {
brfs: "^2.0.2",
coveralls: "^3.1.0",
eslint: "^7.6.0",
grunt: "^1.2.1",
"grunt-browserify": "^5.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^5.0.0",
"grunt-mocha-istanbul": "^5.0.2",
"grunt-saucelabs": "^9.0.1",
istanbul: "^0.4.5",
mocha: "^8.0.1"
},
dependencies: dependencies = {
"bn.js": "^4.11.9",
brorand: "^1.1.0",
"hash.js": "^1.0.0",
"hmac-drbg": "^1.0.1",
inherits: "^2.0.4",
"minimalistic-assert": "^1.0.1",
"minimalistic-crypto-utils": "^1.0.1"
}
};
})), require_bn$3 = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var r = t.charCodeAt(e);
return r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : r - 48 & 15;
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, r, i) {
for (var n = 0, o = Math.min(t.length, r), s = e; s < o; s++) {
var a = t.charCodeAt(s) - 48;
n *= i, n += a >= 49 ? a - 49 + 10 : a >= 17 ? a - 17 + 10 : a;
}
return n;
}
n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this.strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this.strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this.strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, n.prototype.inspect = function() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
};
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"
], f = [
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
], l = [
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 c(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r.strip();
}
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? u[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var c = f[t], d = l[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modn(d).toString(t);
i = (p = p.idivn(d)).isZero() ? m + i : u[c - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16);
}, n.prototype.toBuffer = function(t, e) {
return r(void 0 !== o), this.toArrayLike(o, t, e);
}, n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
}, n.prototype.toArrayLike = function(t, e, i) {
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0"), this.strip();
var s, a, h = "le" === e, u = new t(o), f = this.clone();
if (h) {
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[a] = s;
for (; a < o; a++) u[a] = 0;
} else {
for (a = 0; a < o - n; a++) u[a] = 0;
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[o - a - 1] = s;
}
return u;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this.strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this.strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this.strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this.strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this.strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this.strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var d = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function p(t, e, r) {
return new m().mulp(t, e, r);
}
function m(t, e) {
this.x = t, this.y = e;
}
Math.imul || (d = c), n.prototype.mulTo = function(t, e) {
var r, i = this.length + t.length;
return r = 10 === this.length && 10 === t.length ? d(this, t, e) : i < 63 ? c(this, t, e) : i < 1024 ? function(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r.strip();
}(this, t, e) : p(this, t, e), r;
}, m.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, m.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, m.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, m.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, m.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, m.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, m.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, m.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, m.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, m.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r.strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), p(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
r("number" == typeof t), r(t < 67108864);
for (var e = 0, i = 0; i < this.length; i++) {
var n = (0 | this.words[i]) * t, o = (67108863 & n) + (67108863 & e);
e >>= 26, e += n / 67108864 | 0, e += o >>> 26, this.words[i] = 67108863 & o;
}
return 0 !== e && (this.words[i] = e, this.length++), this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = (t.words[i] & 1 << n) >>> n;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this.strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this.strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this.strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this.strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this.strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a.strip(), i.strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modn = function(t) {
r(t <= 67108863);
for (var e = (1 << 26) % t, i = 0, n = this.length - 1; n >= 0; n--) i = (e * i + (0 | this.words[n])) % t;
return i;
}, n.prototype.idivn = function(t) {
r(t <= 67108863);
for (var e = 0, i = this.length - 1; i >= 0; i--) {
var n = (0 | this.words[i]) + 67108864 * e;
this.words[i] = n / t | 0, e = n % t;
}
return this.strip();
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this.strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new M(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var g = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function y(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function b() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function v() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function w() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function M(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function S(t) {
M.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, y.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, y.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, y.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(b, y), b.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, b.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(v, y), i(_, y), i(w, y), w.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (g[t]) return g[t];
var e;
if ("k256" === t) e = new b();
else if ("p224" === t) e = new v();
else if ("p192" === t) e = new _();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new w();
}
return g[t] = e, e;
}, M.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, M.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, M.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : t.umod(this.m)._forceRed(this);
}, M.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, M.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, M.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, M.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, M.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, M.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, M.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, M.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, M.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, M.prototype.sqr = function(t) {
return this.mul(t, t);
}, M.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, M.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, M.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, M.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, M.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new S(t);
}, i(S, M), S.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, S.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, S.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, S.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, S.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_utils$2 = __commonJSMin(((t) => {
var e = t;
function r(t) {
return 1 === t.length ? "0" + t : t;
}
function i(t) {
for (var e = "", i = 0; i < t.length; i++) e += r(t[i].toString(16));
return e;
}
e.toArray = function(t, e) {
if (Array.isArray(t)) return t.slice();
if (!t) return [];
var r = [];
if ("string" != typeof t) {
for (var i = 0; i < t.length; i++) r[i] = 0 | t[i];
return r;
}
if ("hex" === e) {
(t = t.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (t = "0" + t);
for (i = 0; i < t.length; i += 2) r.push(parseInt(t[i] + t[i + 1], 16));
} else for (i = 0; i < t.length; i++) {
var n = t.charCodeAt(i), o = n >> 8, s = 255 & n;
o ? r.push(o, s) : r.push(s);
}
return r;
}, e.zero2 = r, e.toHex = i, e.encode = function(t, e) {
return "hex" === e ? i(t) : t;
};
})), require_utils$1 = __commonJSMin(((t) => {
var e = t, r = require_bn$3(), i = require_minimalistic_assert(), n = require_utils$2();
e.assert = i, e.toArray = n.toArray, e.zero2 = n.zero2, e.toHex = n.toHex, e.encode = n.encode, e.getNAF = function(t, e, r) {
var i, n = new Array(Math.max(t.bitLength(), r) + 1);
for (i = 0; i < n.length; i += 1) n[i] = 0;
var o = 1 << e + 1, s = t.clone();
for (i = 0; i < n.length; i++) {
var a, h = s.andln(o - 1);
s.isOdd() ? (a = h > (o >> 1) - 1 ? (o >> 1) - h : h, s.isubn(a)) : a = 0, n[i] = a, s.iushrn(1);
}
return n;
}, e.getJSF = function(t, e) {
var r = [[], []];
t = t.clone(), e = e.clone();
for (var i, n = 0, o = 0; t.cmpn(-n) > 0 || e.cmpn(-o) > 0;) {
var s, a, h = t.andln(3) + n & 3, u = e.andln(3) + o & 3;
3 === h && (h = -1), 3 === u && (u = -1), s = 1 & h ? 3 !== (i = t.andln(7) + n & 7) && 5 !== i || 2 !== u ? h : -h : 0, r[0].push(s), a = 1 & u ? 3 !== (i = e.andln(7) + o & 7) && 5 !== i || 2 !== h ? u : -u : 0, r[1].push(a), 2 * n === s + 1 && (n = 1 - n), 2 * o === a + 1 && (o = 1 - o), t.iushrn(1), e.iushrn(1);
}
return r;
}, e.cachedProperty = function(t, e, r) {
var i = "_" + e;
t.prototype[e] = function() {
return void 0 !== this[i] ? this[i] : this[i] = r.call(this);
};
}, e.parseBytes = function(t) {
return "string" == typeof t ? e.toArray(t, "hex") : t;
}, e.intFromLE = function(t) {
return new r(t, "hex", "le");
};
})), require_base$1 = __commonJSMin(((t, e) => {
var r = require_bn$3(), i = require_utils$1(), n = i.getNAF, o = i.getJSF, s = i.assert;
function a(t, e) {
this.type = t, this.p = new r(e.p, 16), this.red = e.prime ? r.red(e.prime) : r.mont(this.p), this.zero = new r(0).toRed(this.red), this.one = new r(1).toRed(this.red), this.two = new r(2).toRed(this.red), this.n = e.n && new r(e.n, 16), this.g = e.g && this.pointFromJSON(e.g, e.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n ? this.n.bitLength() : 0;
var i = this.n && this.p.div(this.n);
!i || i.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));
}
function h(t, e) {
this.curve = t, this.type = e, this.precomputed = null;
}
e.exports = a, a.prototype.point = function() {
throw new Error("Not implemented");
}, a.prototype.validate = function() {
throw new Error("Not implemented");
}, a.prototype._fixedNafMul = function(t, e) {
s(t.precomputed);
var r = t._getDoubles(), i = n(e, 1, this._bitLength), o = (1 << r.step + 1) - (r.step % 2 == 0 ? 2 : 1);
o /= 3;
var a, h, u = [];
for (a = 0; a < i.length; a += r.step) {
h = 0;
for (var f = a + r.step - 1; f >= a; f--) h = (h << 1) + i[f];
u.push(h);
}
for (var l = this.jpoint(null, null, null), c = this.jpoint(null, null, null), d = o; d > 0; d--) {
for (a = 0; a < u.length; a++) (h = u[a]) === d ? c = c.mixedAdd(r.points[a]) : h === -d && (c = c.mixedAdd(r.points[a].neg()));
l = l.add(c);
}
return l.toP();
}, a.prototype._wnafMul = function(t, e) {
var r = 4, i = t._getNAFPoints(r);
r = i.wnd;
for (var o = i.points, a = n(e, r, this._bitLength), h = this.jpoint(null, null, null), u = a.length - 1; u >= 0; u--) {
for (var f = 0; u >= 0 && 0 === a[u]; u--) f++;
if (u >= 0 && f++, h = h.dblp(f), u < 0) break;
var l = a[u];
s(0 !== l), h = "affine" === t.type ? l > 0 ? h.mixedAdd(o[l - 1 >> 1]) : h.mixedAdd(o[-l - 1 >> 1].neg()) : l > 0 ? h.add(o[l - 1 >> 1]) : h.add(o[-l - 1 >> 1].neg());
}
return "affine" === t.type ? h.toP() : h;
}, a.prototype._wnafMulAdd = function(t, e, r, i, s) {
var a, h, u, f = this._wnafT1, l = this._wnafT2, c = this._wnafT3, d = 0;
for (a = 0; a < i; a++) {
var p = (u = e[a])._getNAFPoints(t);
f[a] = p.wnd, l[a] = p.points;
}
for (a = i - 1; a >= 1; a -= 2) {
var m = a - 1, g = a;
if (1 === f[m] && 1 === f[g]) {
var y = [
e[m],
null,
null,
e[g]
];
0 === e[m].y.cmp(e[g].y) ? (y[1] = e[m].add(e[g]), y[2] = e[m].toJ().mixedAdd(e[g].neg())) : 0 === e[m].y.cmp(e[g].y.redNeg()) ? (y[1] = e[m].toJ().mixedAdd(e[g]), y[2] = e[m].add(e[g].neg())) : (y[1] = e[m].toJ().mixedAdd(e[g]), y[2] = e[m].toJ().mixedAdd(e[g].neg()));
var b = [
-3,
-1,
-5,
-7,
0,
7,
5,
1,
3
], v = o(r[m], r[g]);
for (d = Math.max(v[0].length, d), c[m] = new Array(d), c[g] = new Array(d), h = 0; h < d; h++) {
var _ = 0 | v[0][h], w = 0 | v[1][h];
c[m][h] = b[3 * (_ + 1) + (w + 1)], c[g][h] = 0, l[m] = y;
}
} else c[m] = n(r[m], f[m], this._bitLength), c[g] = n(r[g], f[g], this._bitLength), d = Math.max(c[m].length, d), d = Math.max(c[g].length, d);
}
var M = this.jpoint(null, null, null), S = this._wnafT4;
for (a = d; a >= 0; a--) {
for (var E = 0; a >= 0;) {
var A = !0;
for (h = 0; h < i; h++) S[h] = 0 | c[h][a], 0 !== S[h] && (A = !1);
if (!A) break;
E++, a--;
}
if (a >= 0 && E++, M = M.dblp(E), a < 0) break;
for (h = 0; h < i; h++) {
var C = S[h];
0 !== C && (C > 0 ? u = l[h][C - 1 >> 1] : C < 0 && (u = l[h][-C - 1 >> 1].neg()), M = "affine" === u.type ? M.mixedAdd(u) : M.add(u));
}
}
for (a = 0; a < i; a++) l[a] = null;
return s ? M : M.toP();
}, a.BasePoint = h, h.prototype.eq = function() {
throw new Error("Not implemented");
}, h.prototype.validate = function() {
return this.curve.validate(this);
}, a.prototype.decodePoint = function(t, e) {
t = i.toArray(t, e);
var r = this.p.byteLength();
if ((4 === t[0] || 6 === t[0] || 7 === t[0]) && t.length - 1 == 2 * r) return 6 === t[0] ? s(t[t.length - 1] % 2 == 0) : 7 === t[0] && s(t[t.length - 1] % 2 == 1), this.point(t.slice(1, 1 + r), t.slice(1 + r, 1 + 2 * r));
if ((2 === t[0] || 3 === t[0]) && t.length - 1 === r) return this.pointFromX(t.slice(1, 1 + r), 3 === t[0]);
throw new Error("Unknown point format");
}, h.prototype.encodeCompressed = function(t) {
return this.encode(t, !0);
}, h.prototype._encode = function(t) {
var e = this.curve.p.byteLength(), r = this.getX().toArray("be", e);
return t ? [this.getY().isEven() ? 2 : 3].concat(r) : [4].concat(r, this.getY().toArray("be", e));
}, h.prototype.encode = function(t, e) {
return i.encode(this._encode(e), t);
}, h.prototype.precompute = function(t) {
if (this.precomputed) return this;
var e = {
doubles: null,
naf: null,
beta: null
};
return e.naf = this._getNAFPoints(8), e.doubles = this._getDoubles(4, t), e.beta = this._getBeta(), this.precomputed = e, this;
}, h.prototype._hasDoubles = function(t) {
if (!this.precomputed) return !1;
var e = this.precomputed.doubles;
return !!e && e.points.length >= Math.ceil((t.bitLength() + 1) / e.step);
}, h.prototype._getDoubles = function(t, e) {
if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;
for (var r = [this], i = this, n = 0; n < e; n += t) {
for (var o = 0; o < t; o++) i = i.dbl();
r.push(i);
}
return {
step: t,
points: r
};
}, h.prototype._getNAFPoints = function(t) {
if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;
for (var e = [this], r = (1 << t) - 1, i = 1 === r ? null : this.dbl(), n = 1; n < r; n++) e[n] = e[n - 1].add(i);
return {
wnd: t,
points: e
};
}, h.prototype._getBeta = function() {
return null;
}, h.prototype.dblp = function(t) {
for (var e = this, r = 0; r < t; r++) e = e.dbl();
return e;
};
})), require_short = __commonJSMin(((t, e) => {
var r = require_utils$1(), i = require_bn$3(), n = require_inherits_browser(), o = require_base$1(), s = r.assert;
function a(t) {
o.call(this, "short", t), this.a = new i(t.a, 16).toRed(this.red), this.b = new i(t.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = 0 === this.a.fromRed().cmpn(0), this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3), this.endo = this._getEndomorphism(t), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4);
}
function h(t, e, r, n) {
o.BasePoint.call(this, t, "affine"), null === e && null === r ? (this.x = null, this.y = null, this.inf = !0) : (this.x = new i(e, 16), this.y = new i(r, 16), n && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);
}
function u(t, e, r, n) {
o.BasePoint.call(this, t, "jacobian"), null === e && null === r && null === n ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new i(0)) : (this.x = new i(e, 16), this.y = new i(r, 16), this.z = new i(n, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;
}
n(a, o), e.exports = a, a.prototype._getEndomorphism = function(t) {
if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) {
var e, r;
if (t.beta) e = new i(t.beta, 16).toRed(this.red);
else {
var n = this._getEndoRoots(this.p);
e = (e = n[0].cmp(n[1]) < 0 ? n[0] : n[1]).toRed(this.red);
}
if (t.lambda) r = new i(t.lambda, 16);
else {
var o = this._getEndoRoots(this.n);
0 === this.g.mul(o[0]).x.cmp(this.g.x.redMul(e)) ? r = o[0] : (r = o[1], s(0 === this.g.mul(r).x.cmp(this.g.x.redMul(e))));
}
return {
beta: e,
lambda: r,
basis: t.basis ? t.basis.map((function(t) {
return {
a: new i(t.a, 16),
b: new i(t.b, 16)
};
})) : this._getEndoBasis(r)
};
}
}, a.prototype._getEndoRoots = function(t) {
var e = t === this.p ? this.red : i.mont(t), r = new i(2).toRed(e).redInvm(), n = r.redNeg(), o = new i(3).toRed(e).redNeg().redSqrt().redMul(r);
return [n.redAdd(o).fromRed(), n.redSub(o).fromRed()];
}, a.prototype._getEndoBasis = function(t) {
for (var e, r, n, o, s, a, h, u, f, l = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), c = t, d = this.n.clone(), p = new i(1), m = new i(0), g = new i(0), y = new i(1), b = 0; 0 !== c.cmpn(0);) {
var v = d.div(c);
u = d.sub(v.mul(c)), f = g.sub(v.mul(p));
var _ = y.sub(v.mul(m));
if (!n && u.cmp(l) < 0) e = h.neg(), r = p, n = u.neg(), o = f;
else if (n && 2 == ++b) break;
h = u, d = c, c = u, g = p, p = f, y = m, m = _;
}
s = u.neg(), a = f;
var w = n.sqr().add(o.sqr());
return s.sqr().add(a.sqr()).cmp(w) >= 0 && (s = e, a = r), n.negative && (n = n.neg(), o = o.neg()), s.negative && (s = s.neg(), a = a.neg()), [{
a: n,
b: o
}, {
a: s,
b: a
}];
}, a.prototype._endoSplit = function(t) {
var e = this.endo.basis, r = e[0], i = e[1], n = i.b.mul(t).divRound(this.n), o = r.b.neg().mul(t).divRound(this.n), s = n.mul(r.a), a = o.mul(i.a), h = n.mul(r.b), u = o.mul(i.b);
return {
k1: t.sub(s).sub(a),
k2: h.add(u).neg()
};
}, a.prototype.pointFromX = function(t, e) {
(t = new i(t, 16)).red || (t = t.toRed(this.red));
var r = t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b), n = r.redSqrt();
if (0 !== n.redSqr().redSub(r).cmp(this.zero)) throw new Error("invalid point");
var o = n.fromRed().isOdd();
return (e && !o || !e && o) && (n = n.redNeg()), this.point(t, n);
}, a.prototype.validate = function(t) {
if (t.inf) return !0;
var e = t.x, r = t.y, i = this.a.redMul(e), n = e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);
return 0 === r.redSqr().redISub(n).cmpn(0);
}, a.prototype._endoWnafMulAdd = function(t, e, r) {
for (var i = this._endoWnafT1, n = this._endoWnafT2, o = 0; o < t.length; o++) {
var s = this._endoSplit(e[o]), a = t[o], h = a._getBeta();
s.k1.negative && (s.k1.ineg(), a = a.neg(!0)), s.k2.negative && (s.k2.ineg(), h = h.neg(!0)), i[2 * o] = a, i[2 * o + 1] = h, n[2 * o] = s.k1, n[2 * o + 1] = s.k2;
}
for (var u = this._wnafMulAdd(1, i, n, 2 * o, r), f = 0; f < 2 * o; f++) i[f] = null, n[f] = null;
return u;
}, n(h, o.BasePoint), a.prototype.point = function(t, e, r) {
return new h(this, t, e, r);
}, a.prototype.pointFromJSON = function(t, e) {
return h.fromJSON(this, t, e);
}, h.prototype._getBeta = function() {
if (this.curve.endo) {
var t = this.precomputed;
if (t && t.beta) return t.beta;
var e = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
if (t) {
var r = this.curve, i = function(t) {
return r.point(t.x.redMul(r.endo.beta), t.y);
};
t.beta = e, e.precomputed = {
beta: null,
naf: t.naf && {
wnd: t.naf.wnd,
points: t.naf.points.map(i)
},
doubles: t.doubles && {
step: t.doubles.step,
points: t.doubles.points.map(i)
}
};
}
return e;
}
}, h.prototype.toJSON = function() {
return this.precomputed ? [
this.x,
this.y,
this.precomputed && {
doubles: this.precomputed.doubles && {
step: this.precomputed.doubles.step,
points: this.precomputed.doubles.points.slice(1)
},
naf: this.precomputed.naf && {
wnd: this.precomputed.naf.wnd,
points: this.precomputed.naf.points.slice(1)
}
}
] : [this.x, this.y];
}, h.fromJSON = function(t, e, r) {
"string" == typeof e && (e = JSON.parse(e));
var i = t.point(e[0], e[1], r);
if (!e[2]) return i;
function n(e) {
return t.point(e[0], e[1], r);
}
var o = e[2];
return i.precomputed = {
beta: null,
doubles: o.doubles && {
step: o.doubles.step,
points: [i].concat(o.doubles.points.map(n))
},
naf: o.naf && {
wnd: o.naf.wnd,
points: [i].concat(o.naf.points.map(n))
}
}, i;
}, h.prototype.inspect = function() {
return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">";
}, h.prototype.isInfinity = function() {
return this.inf;
}, h.prototype.add = function(t) {
if (this.inf) return t;
if (t.inf) return this;
if (this.eq(t)) return this.dbl();
if (this.neg().eq(t)) return this.curve.point(null, null);
if (0 === this.x.cmp(t.x)) return this.curve.point(null, null);
var e = this.y.redSub(t.y);
0 !== e.cmpn(0) && (e = e.redMul(this.x.redSub(t.x).redInvm()));
var r = e.redSqr().redISub(this.x).redISub(t.x), i = e.redMul(this.x.redSub(r)).redISub(this.y);
return this.curve.point(r, i);
}, h.prototype.dbl = function() {
if (this.inf) return this;
var t = this.y.redAdd(this.y);
if (0 === t.cmpn(0)) return this.curve.point(null, null);
var e = this.curve.a, r = this.x.redSqr(), i = t.redInvm(), n = r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i), o = n.redSqr().redISub(this.x.redAdd(this.x)), s = n.redMul(this.x.redSub(o)).redISub(this.y);
return this.curve.point(o, s);
}, h.prototype.getX = function() {
return this.x.fromRed();
}, h.prototype.getY = function() {
return this.y.fromRed();
}, h.prototype.mul = function(t) {
return t = new i(t, 16), this.isInfinity() ? this : this._hasDoubles(t) ? this.curve._fixedNafMul(this, t) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [t]) : this.curve._wnafMul(this, t);
}, h.prototype.mulAdd = function(t, e, r) {
var i = [this, e], n = [t, r];
return this.curve.endo ? this.curve._endoWnafMulAdd(i, n) : this.curve._wnafMulAdd(1, i, n, 2);
}, h.prototype.jmulAdd = function(t, e, r) {
var i = [this, e], n = [t, r];
return this.curve.endo ? this.curve._endoWnafMulAdd(i, n, !0) : this.curve._wnafMulAdd(1, i, n, 2, !0);
}, h.prototype.eq = function(t) {
return this === t || this.inf === t.inf && (this.inf || 0 === this.x.cmp(t.x) && 0 === this.y.cmp(t.y));
}, h.prototype.neg = function(t) {
if (this.inf) return this;
var e = this.curve.point(this.x, this.y.redNeg());
if (t && this.precomputed) {
var r = this.precomputed, i = function(t) {
return t.neg();
};
e.precomputed = {
naf: r.naf && {
wnd: r.naf.wnd,
points: r.naf.points.map(i)
},
doubles: r.doubles && {
step: r.doubles.step,
points: r.doubles.points.map(i)
}
};
}
return e;
}, h.prototype.toJ = function() {
return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one);
}, n(u, o.BasePoint), a.prototype.jpoint = function(t, e, r) {
return new u(this, t, e, r);
}, u.prototype.toP = function() {
if (this.isInfinity()) return this.curve.point(null, null);
var t = this.z.redInvm(), e = t.redSqr(), r = this.x.redMul(e), i = this.y.redMul(e).redMul(t);
return this.curve.point(r, i);
}, u.prototype.neg = function() {
return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
}, u.prototype.add = function(t) {
if (this.isInfinity()) return t;
if (t.isInfinity()) return this;
var e = t.z.redSqr(), r = this.z.redSqr(), i = this.x.redMul(e), n = t.x.redMul(r), o = this.y.redMul(e.redMul(t.z)), s = t.y.redMul(r.redMul(this.z)), a = i.redSub(n), h = o.redSub(s);
if (0 === a.cmpn(0)) return 0 !== h.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl();
var u = a.redSqr(), f = u.redMul(a), l = i.redMul(u), c = h.redSqr().redIAdd(f).redISub(l).redISub(l), d = h.redMul(l.redISub(c)).redISub(o.redMul(f)), p = this.z.redMul(t.z).redMul(a);
return this.curve.jpoint(c, d, p);
}, u.prototype.mixedAdd = function(t) {
if (this.isInfinity()) return t.toJ();
if (t.isInfinity()) return this;
var e = this.z.redSqr(), r = this.x, i = t.x.redMul(e), n = this.y, o = t.y.redMul(e).redMul(this.z), s = r.redSub(i), a = n.redSub(o);
if (0 === s.cmpn(0)) return 0 !== a.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl();
var h = s.redSqr(), u = h.redMul(s), f = r.redMul(h), l = a.redSqr().redIAdd(u).redISub(f).redISub(f), c = a.redMul(f.redISub(l)).redISub(n.redMul(u)), d = this.z.redMul(s);
return this.curve.jpoint(l, c, d);
}, u.prototype.dblp = function(t) {
if (0 === t) return this;
if (this.isInfinity()) return this;
if (!t) return this.dbl();
var e;
if (this.curve.zeroA || this.curve.threeA) {
var r = this;
for (e = 0; e < t; e++) r = r.dbl();
return r;
}
var i = this.curve.a, n = this.curve.tinv, o = this.x, s = this.y, a = this.z, h = a.redSqr().redSqr(), u = s.redAdd(s);
for (e = 0; e < t; e++) {
var f = o.redSqr(), l = u.redSqr(), c = l.redSqr(), d = f.redAdd(f).redIAdd(f).redIAdd(i.redMul(h)), p = o.redMul(l), m = d.redSqr().redISub(p.redAdd(p)), g = p.redISub(m), y = d.redMul(g);
y = y.redIAdd(y).redISub(c);
var b = u.redMul(a);
e + 1 < t && (h = h.redMul(c)), o = m, a = b, u = y;
}
return this.curve.jpoint(o, u.redMul(n), a);
}, u.prototype.dbl = function() {
return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl();
}, u.prototype._zeroDbl = function() {
var t, e, r;
if (this.zOne) {
var i = this.x.redSqr(), n = this.y.redSqr(), o = n.redSqr(), s = this.x.redAdd(n).redSqr().redISub(i).redISub(o);
s = s.redIAdd(s);
var a = i.redAdd(i).redIAdd(i), h = a.redSqr().redISub(s).redISub(s), u = o.redIAdd(o);
u = (u = u.redIAdd(u)).redIAdd(u), t = h, e = a.redMul(s.redISub(h)).redISub(u), r = this.y.redAdd(this.y);
} else {
var f = this.x.redSqr(), l = this.y.redSqr(), c = l.redSqr(), d = this.x.redAdd(l).redSqr().redISub(f).redISub(c);
d = d.redIAdd(d);
var p = f.redAdd(f).redIAdd(f), m = p.redSqr(), g = c.redIAdd(c);
g = (g = g.redIAdd(g)).redIAdd(g), t = m.redISub(d).redISub(d), e = p.redMul(d.redISub(t)).redISub(g), r = (r = this.y.redMul(this.z)).redIAdd(r);
}
return this.curve.jpoint(t, e, r);
}, u.prototype._threeDbl = function() {
var t, e, r;
if (this.zOne) {
var i = this.x.redSqr(), n = this.y.redSqr(), o = n.redSqr(), s = this.x.redAdd(n).redSqr().redISub(i).redISub(o);
s = s.redIAdd(s);
var a = i.redAdd(i).redIAdd(i).redIAdd(this.curve.a), h = a.redSqr().redISub(s).redISub(s);
t = h;
var u = o.redIAdd(o);
u = (u = u.redIAdd(u)).redIAdd(u), e = a.redMul(s.redISub(h)).redISub(u), r = this.y.redAdd(this.y);
} else {
var f = this.z.redSqr(), l = this.y.redSqr(), c = this.x.redMul(l), d = this.x.redSub(f).redMul(this.x.redAdd(f));
d = d.redAdd(d).redIAdd(d);
var p = c.redIAdd(c), m = (p = p.redIAdd(p)).redAdd(p);
t = d.redSqr().redISub(m), r = this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);
var g = l.redSqr();
g = (g = (g = g.redIAdd(g)).redIAdd(g)).redIAdd(g), e = d.redMul(p.redISub(t)).redISub(g);
}
return this.curve.jpoint(t, e, r);
}, u.prototype._dbl = function() {
var t = this.curve.a, e = this.x, r = this.y, i = this.z, n = i.redSqr().redSqr(), o = e.redSqr(), s = r.redSqr(), a = o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)), h = e.redAdd(e), u = (h = h.redIAdd(h)).redMul(s), f = a.redSqr().redISub(u.redAdd(u)), l = u.redISub(f), c = s.redSqr();
c = (c = (c = c.redIAdd(c)).redIAdd(c)).redIAdd(c);
var d = a.redMul(l).redISub(c), p = r.redAdd(r).redMul(i);
return this.curve.jpoint(f, d, p);
}, u.prototype.trpl = function() {
if (!this.curve.zeroA) return this.dbl().add(this);
var t = this.x.redSqr(), e = this.y.redSqr(), r = this.z.redSqr(), i = e.redSqr(), n = t.redAdd(t).redIAdd(t), o = n.redSqr(), s = this.x.redAdd(e).redSqr().redISub(t).redISub(i), a = (s = (s = (s = s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(), h = i.redIAdd(i);
h = (h = (h = h.redIAdd(h)).redIAdd(h)).redIAdd(h);
var u = n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(h), f = e.redMul(u);
f = (f = f.redIAdd(f)).redIAdd(f);
var l = this.x.redMul(a).redISub(f);
l = (l = l.redIAdd(l)).redIAdd(l);
var c = this.y.redMul(u.redMul(h.redISub(u)).redISub(s.redMul(a)));
c = (c = (c = c.redIAdd(c)).redIAdd(c)).redIAdd(c);
var d = this.z.redAdd(s).redSqr().redISub(r).redISub(a);
return this.curve.jpoint(l, c, d);
}, u.prototype.mul = function(t, e) {
return t = new i(t, e), this.curve._wnafMul(this, t);
}, u.prototype.eq = function(t) {
if ("affine" === t.type) return this.eq(t.toJ());
if (this === t) return !0;
var e = this.z.redSqr(), r = t.z.redSqr();
if (0 !== this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0)) return !1;
var i = e.redMul(this.z), n = r.redMul(t.z);
return 0 === this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0);
}, u.prototype.eqXToP = function(t) {
var e = this.z.redSqr(), r = t.toRed(this.curve.red).redMul(e);
if (0 === this.x.cmp(r)) return !0;
for (var i = t.clone(), n = this.curve.redN.redMul(e);;) {
if (i.iadd(this.curve.n), i.cmp(this.curve.p) >= 0) return !1;
if (r.redIAdd(n), 0 === this.x.cmp(r)) return !0;
}
}, u.prototype.inspect = function() {
return this.isInfinity() ? "<EC JPoint Infinity>" : "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">";
}, u.prototype.isInfinity = function() {
return 0 === this.z.cmpn(0);
};
})), require_mont = __commonJSMin(((t, e) => {
var r = require_bn$3(), i = require_inherits_browser(), n = require_base$1(), o = require_utils$1();
function s(t) {
n.call(this, "mont", t), this.a = new r(t.a, 16).toRed(this.red), this.b = new r(t.b, 16).toRed(this.red), this.i4 = new r(4).toRed(this.red).redInvm(), this.two = new r(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));
}
function a(t, e, i) {
n.BasePoint.call(this, t, "projective"), null === e && null === i ? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new r(e, 16), this.z = new r(i, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));
}
i(s, n), e.exports = s, s.prototype.validate = function(t) {
var e = t.normalize().x, r = e.redSqr(), i = r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);
return 0 === i.redSqrt().redSqr().cmp(i);
}, i(a, n.BasePoint), s.prototype.decodePoint = function(t, e) {
return this.point(o.toArray(t, e), 1);
}, s.prototype.point = function(t, e) {
return new a(this, t, e);
}, s.prototype.pointFromJSON = function(t) {
return a.fromJSON(this, t);
}, a.prototype.precompute = function() {}, a.prototype._encode = function() {
return this.getX().toArray("be", this.curve.p.byteLength());
}, a.fromJSON = function(t, e) {
return new a(t, e[0], e[1] || t.one);
}, a.prototype.inspect = function() {
return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
}, a.prototype.isInfinity = function() {
return 0 === this.z.cmpn(0);
}, a.prototype.dbl = function() {
var t = this.x.redAdd(this.z).redSqr(), e = this.x.redSub(this.z).redSqr(), r = t.redSub(e), i = t.redMul(e), n = r.redMul(e.redAdd(this.curve.a24.redMul(r)));
return this.curve.point(i, n);
}, a.prototype.add = function() {
throw new Error("Not supported on Montgomery curve");
}, a.prototype.diffAdd = function(t, e) {
var r = this.x.redAdd(this.z), i = this.x.redSub(this.z), n = t.x.redAdd(t.z), o = t.x.redSub(t.z).redMul(r), s = n.redMul(i), a = e.z.redMul(o.redAdd(s).redSqr()), h = e.x.redMul(o.redISub(s).redSqr());
return this.curve.point(a, h);
}, a.prototype.mul = function(t) {
for (var e = t.clone(), r = this, i = this.curve.point(null, null), n = []; 0 !== e.cmpn(0); e.iushrn(1)) n.push(e.andln(1));
for (var o = n.length - 1; o >= 0; o--) 0 === n[o] ? (r = r.diffAdd(i, this), i = i.dbl()) : (i = r.diffAdd(i, this), r = r.dbl());
return i;
}, a.prototype.mulAdd = function() {
throw new Error("Not supported on Montgomery curve");
}, a.prototype.jumlAdd = function() {
throw new Error("Not supported on Montgomery curve");
}, a.prototype.eq = function(t) {
return 0 === this.getX().cmp(t.getX());
}, a.prototype.normalize = function() {
return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;
}, a.prototype.getX = function() {
return this.normalize(), this.x.fromRed();
};
})), require_edwards = __commonJSMin(((t, e) => {
var r = require_utils$1(), i = require_bn$3(), n = require_inherits_browser(), o = require_base$1(), s = r.assert;
function a(t) {
this.twisted = 1 != (0 | t.a), this.mOneA = this.twisted && -1 == (0 | t.a), this.extended = this.mOneA, o.call(this, "edwards", t), this.a = new i(t.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new i(t.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new i(t.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), s(!this.twisted || 0 === this.c.fromRed().cmpn(1)), this.oneC = 1 == (0 | t.c);
}
function h(t, e, r, n, s) {
o.BasePoint.call(this, t, "projective"), null === e && null === r && null === n ? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new i(e, 16), this.y = new i(r, 16), this.z = n ? new i(n, 16) : this.curve.one, this.t = s && new i(s, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));
}
n(a, o), e.exports = a, a.prototype._mulA = function(t) {
return this.mOneA ? t.redNeg() : this.a.redMul(t);
}, a.prototype._mulC = function(t) {
return this.oneC ? t : this.c.redMul(t);
}, a.prototype.jpoint = function(t, e, r, i) {
return this.point(t, e, r, i);
}, a.prototype.pointFromX = function(t, e) {
(t = new i(t, 16)).red || (t = t.toRed(this.red));
var r = t.redSqr(), n = this.c2.redSub(this.a.redMul(r)), o = this.one.redSub(this.c2.redMul(this.d).redMul(r)), s = n.redMul(o.redInvm()), a = s.redSqrt();
if (0 !== a.redSqr().redSub(s).cmp(this.zero)) throw new Error("invalid point");
var h = a.fromRed().isOdd();
return (e && !h || !e && h) && (a = a.redNeg()), this.point(t, a);
}, a.prototype.pointFromY = function(t, e) {
(t = new i(t, 16)).red || (t = t.toRed(this.red));
var r = t.redSqr(), n = r.redSub(this.c2), o = r.redMul(this.d).redMul(this.c2).redSub(this.a), s = n.redMul(o.redInvm());
if (0 === s.cmp(this.zero)) {
if (e) throw new Error("invalid point");
return this.point(this.zero, t);
}
var a = s.redSqrt();
if (0 !== a.redSqr().redSub(s).cmp(this.zero)) throw new Error("invalid point");
return a.fromRed().isOdd() !== e && (a = a.redNeg()), this.point(a, t);
}, a.prototype.validate = function(t) {
if (t.isInfinity()) return !0;
t.normalize();
var e = t.x.redSqr(), r = t.y.redSqr(), i = e.redMul(this.a).redAdd(r), n = this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));
return 0 === i.cmp(n);
}, n(h, o.BasePoint), a.prototype.pointFromJSON = function(t) {
return h.fromJSON(this, t);
}, a.prototype.point = function(t, e, r, i) {
return new h(this, t, e, r, i);
}, h.fromJSON = function(t, e) {
return new h(t, e[0], e[1], e[2]);
}, h.prototype.inspect = function() {
return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
}, h.prototype.isInfinity = function() {
return 0 === this.x.cmpn(0) && (0 === this.y.cmp(this.z) || this.zOne && 0 === this.y.cmp(this.curve.c));
}, h.prototype._extDbl = function() {
var t = this.x.redSqr(), e = this.y.redSqr(), r = this.z.redSqr();
r = r.redIAdd(r);
var i = this.curve._mulA(t), n = this.x.redAdd(this.y).redSqr().redISub(t).redISub(e), o = i.redAdd(e), s = o.redSub(r), a = i.redSub(e), h = n.redMul(s), u = o.redMul(a), f = n.redMul(a), l = s.redMul(o);
return this.curve.point(h, u, l, f);
}, h.prototype._projDbl = function() {
var t, e, r, i, n, o, s = this.x.redAdd(this.y).redSqr(), a = this.x.redSqr(), h = this.y.redSqr();
if (this.curve.twisted) {
var u = (i = this.curve._mulA(a)).redAdd(h);
this.zOne ? (t = s.redSub(a).redSub(h).redMul(u.redSub(this.curve.two)), e = u.redMul(i.redSub(h)), r = u.redSqr().redSub(u).redSub(u)) : (n = this.z.redSqr(), o = u.redSub(n).redISub(n), t = s.redSub(a).redISub(h).redMul(o), e = u.redMul(i.redSub(h)), r = u.redMul(o));
} else i = a.redAdd(h), n = this.curve._mulC(this.z).redSqr(), o = i.redSub(n).redSub(n), t = this.curve._mulC(s.redISub(i)).redMul(o), e = this.curve._mulC(i).redMul(a.redISub(h)), r = i.redMul(o);
return this.curve.point(t, e, r);
}, h.prototype.dbl = function() {
return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl();
}, h.prototype._extAdd = function(t) {
var e = this.y.redSub(this.x).redMul(t.y.redSub(t.x)), r = this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)), i = this.t.redMul(this.curve.dd).redMul(t.t), n = this.z.redMul(t.z.redAdd(t.z)), o = r.redSub(e), s = n.redSub(i), a = n.redAdd(i), h = r.redAdd(e), u = o.redMul(s), f = a.redMul(h), l = o.redMul(h), c = s.redMul(a);
return this.curve.point(u, f, c, l);
}, h.prototype._projAdd = function(t) {
var e, r, i = this.z.redMul(t.z), n = i.redSqr(), o = this.x.redMul(t.x), s = this.y.redMul(t.y), a = this.curve.d.redMul(o).redMul(s), h = n.redSub(a), u = n.redAdd(a), f = this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s), l = i.redMul(h).redMul(f);
return this.curve.twisted ? (e = i.redMul(u).redMul(s.redSub(this.curve._mulA(o))), r = h.redMul(u)) : (e = i.redMul(u).redMul(s.redSub(o)), r = this.curve._mulC(h).redMul(u)), this.curve.point(l, e, r);
}, h.prototype.add = function(t) {
return this.isInfinity() ? t : t.isInfinity() ? this : this.curve.extended ? this._extAdd(t) : this._projAdd(t);
}, h.prototype.mul = function(t) {
return this._hasDoubles(t) ? this.curve._fixedNafMul(this, t) : this.curve._wnafMul(this, t);
}, h.prototype.mulAdd = function(t, e, r) {
return this.curve._wnafMulAdd(1, [this, e], [t, r], 2, !1);
}, h.prototype.jmulAdd = function(t, e, r) {
return this.curve._wnafMulAdd(1, [this, e], [t, r], 2, !0);
}, h.prototype.normalize = function() {
if (this.zOne) return this;
var t = this.z.redInvm();
return this.x = this.x.redMul(t), this.y = this.y.redMul(t), this.t && (this.t = this.t.redMul(t)), this.z = this.curve.one, this.zOne = !0, this;
}, h.prototype.neg = function() {
return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());
}, h.prototype.getX = function() {
return this.normalize(), this.x.fromRed();
}, h.prototype.getY = function() {
return this.normalize(), this.y.fromRed();
}, h.prototype.eq = function(t) {
return this === t || 0 === this.getX().cmp(t.getX()) && 0 === this.getY().cmp(t.getY());
}, h.prototype.eqXToP = function(t) {
var e = t.toRed(this.curve.red).redMul(this.z);
if (0 === this.x.cmp(e)) return !0;
for (var r = t.clone(), i = this.curve.redN.redMul(this.z);;) {
if (r.iadd(this.curve.n), r.cmp(this.curve.p) >= 0) return !1;
if (e.redIAdd(i), 0 === this.x.cmp(e)) return !0;
}
}, h.prototype.toP = h.prototype.normalize, h.prototype.mixedAdd = h.prototype.add;
})), require_curve = __commonJSMin(((t) => {
var e = t;
e.base = require_base$1(), e.short = require_short(), e.mont = require_mont(), e.edwards = require_edwards();
})), require_utils = __commonJSMin(((t) => {
var e = require_minimalistic_assert(), r = require_inherits_browser();
function i(t, e) {
return 55296 == (64512 & t.charCodeAt(e)) && !(e < 0 || e + 1 >= t.length) && 56320 == (64512 & t.charCodeAt(e + 1));
}
function n(t) {
return (t >>> 24 | t >>> 8 & 65280 | t << 8 & 16711680 | (255 & t) << 24) >>> 0;
}
function o(t) {
return 1 === t.length ? "0" + t : t;
}
function s(t) {
return 7 === t.length ? "0" + t : 6 === t.length ? "00" + t : 5 === t.length ? "000" + t : 4 === t.length ? "0000" + t : 3 === t.length ? "00000" + t : 2 === t.length ? "000000" + t : 1 === t.length ? "0000000" + t : t;
}
t.inherits = r, t.toArray = function(t, e) {
if (Array.isArray(t)) return t.slice();
if (!t) return [];
var r = [];
if ("string" == typeof t) if (e) {
if ("hex" === e) for ((t = t.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (t = "0" + t), o = 0; o < t.length; o += 2) r.push(parseInt(t[o] + t[o + 1], 16));
} else for (var n = 0, o = 0; o < t.length; o++) {
var s = t.charCodeAt(o);
s < 128 ? r[n++] = s : s < 2048 ? (r[n++] = s >> 6 | 192, r[n++] = 63 & s | 128) : i(t, o) ? (s = 65536 + ((1023 & s) << 10) + (1023 & t.charCodeAt(++o)), r[n++] = s >> 18 | 240, r[n++] = s >> 12 & 63 | 128, r[n++] = s >> 6 & 63 | 128, r[n++] = 63 & s | 128) : (r[n++] = s >> 12 | 224, r[n++] = s >> 6 & 63 | 128, r[n++] = 63 & s | 128);
}
else for (o = 0; o < t.length; o++) r[o] = 0 | t[o];
return r;
}, t.toHex = function(t) {
for (var e = "", r = 0; r < t.length; r++) e += o(t[r].toString(16));
return e;
}, t.htonl = n, t.toHex32 = function(t, e) {
for (var r = "", i = 0; i < t.length; i++) {
var o = t[i];
"little" === e && (o = n(o)), r += s(o.toString(16));
}
return r;
}, t.zero2 = o, t.zero8 = s, t.join32 = function(t, r, i, n) {
var o = i - r;
e(o % 4 == 0);
for (var s = new Array(o / 4), a = 0, h = r; a < s.length; a++, h += 4) s[a] = ("big" === n ? t[h] << 24 | t[h + 1] << 16 | t[h + 2] << 8 | t[h + 3] : t[h + 3] << 24 | t[h + 2] << 16 | t[h + 1] << 8 | t[h]) >>> 0;
return s;
}, t.split32 = function(t, e) {
for (var r = new Array(4 * t.length), i = 0, n = 0; i < t.length; i++, n += 4) {
var o = t[i];
"big" === e ? (r[n] = o >>> 24, r[n + 1] = o >>> 16 & 255, r[n + 2] = o >>> 8 & 255, r[n + 3] = 255 & o) : (r[n + 3] = o >>> 24, r[n + 2] = o >>> 16 & 255, r[n + 1] = o >>> 8 & 255, r[n] = 255 & o);
}
return r;
}, t.rotr32 = function(t, e) {
return t >>> e | t << 32 - e;
}, t.rotl32 = function(t, e) {
return t << e | t >>> 32 - e;
}, t.sum32 = function(t, e) {
return t + e >>> 0;
}, t.sum32_3 = function(t, e, r) {
return t + e + r >>> 0;
}, t.sum32_4 = function(t, e, r, i) {
return t + e + r + i >>> 0;
}, t.sum32_5 = function(t, e, r, i, n) {
return t + e + r + i + n >>> 0;
}, t.sum64 = function(t, e, r, i) {
var n = t[e], o = i + t[e + 1] >>> 0;
t[e] = (o < i ? 1 : 0) + r + n >>> 0, t[e + 1] = o;
}, t.sum64_hi = function(t, e, r, i) {
return (e + i >>> 0 < e ? 1 : 0) + t + r >>> 0;
}, t.sum64_lo = function(t, e, r, i) {
return e + i >>> 0;
}, t.sum64_4_hi = function(t, e, r, i, n, o, s, a) {
var h = 0, u = e;
return h += (u = u + i >>> 0) < e ? 1 : 0, h += (u = u + o >>> 0) < o ? 1 : 0, t + r + n + s + (h += (u = u + a >>> 0) < a ? 1 : 0) >>> 0;
}, t.sum64_4_lo = function(t, e, r, i, n, o, s, a) {
return e + i + o + a >>> 0;
}, t.sum64_5_hi = function(t, e, r, i, n, o, s, a, h, u) {
var f = 0, l = e;
return f += (l = l + i >>> 0) < e ? 1 : 0, f += (l = l + o >>> 0) < o ? 1 : 0, f += (l = l + a >>> 0) < a ? 1 : 0, t + r + n + s + h + (f += (l = l + u >>> 0) < u ? 1 : 0) >>> 0;
}, t.sum64_5_lo = function(t, e, r, i, n, o, s, a, h, u) {
return e + i + o + a + u >>> 0;
}, t.rotr64_hi = function(t, e, r) {
return (e << 32 - r | t >>> r) >>> 0;
}, t.rotr64_lo = function(t, e, r) {
return (t << 32 - r | e >>> r) >>> 0;
}, t.shr64_hi = function(t, e, r) {
return t >>> r;
}, t.shr64_lo = function(t, e, r) {
return (t << 32 - r | e >>> r) >>> 0;
};
})), require_common$1 = __commonJSMin(((t) => {
var e = require_utils(), r = require_minimalistic_assert();
function i() {
this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = "big", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;
}
t.BlockHash = i, i.prototype.update = function(t, r) {
if (t = e.toArray(t, r), this.pending ? this.pending = this.pending.concat(t) : this.pending = t, this.pendingTotal += t.length, this.pending.length >= this._delta8) {
var i = (t = this.pending).length % this._delta8;
this.pending = t.slice(t.length - i, t.length), 0 === this.pending.length && (this.pending = null), t = e.join32(t, 0, t.length - i, this.endian);
for (var n = 0; n < t.length; n += this._delta32) this._update(t, n, n + this._delta32);
}
return this;
}, i.prototype.digest = function(t) {
return this.update(this._pad()), r(null === this.pending), this._digest(t);
}, i.prototype._pad = function() {
var t = this.pendingTotal, e = this._delta8, r = e - (t + this.padLength) % e, i = new Array(r + this.padLength);
i[0] = 128;
for (var n = 1; n < r; n++) i[n] = 0;
if (t <<= 3, "big" === this.endian) {
for (var o = 8; o < this.padLength; o++) i[n++] = 0;
i[n++] = 0, i[n++] = 0, i[n++] = 0, i[n++] = 0, i[n++] = t >>> 24 & 255, i[n++] = t >>> 16 & 255, i[n++] = t >>> 8 & 255, i[n++] = 255 & t;
} else for (i[n++] = 255 & t, i[n++] = t >>> 8 & 255, i[n++] = t >>> 16 & 255, i[n++] = t >>> 24 & 255, i[n++] = 0, i[n++] = 0, i[n++] = 0, i[n++] = 0, o = 8; o < this.padLength; o++) i[n++] = 0;
return i;
};
})), require_common = __commonJSMin(((t) => {
var e = require_utils().rotr32;
function r(t, e, r) {
return t & e ^ ~t & r;
}
function i(t, e, r) {
return t & e ^ t & r ^ e & r;
}
function n(t, e, r) {
return t ^ e ^ r;
}
t.ft_1 = function(t, e, o, s) {
return 0 === t ? r(e, o, s) : 1 === t || 3 === t ? n(e, o, s) : 2 === t ? i(e, o, s) : void 0;
}, t.ch32 = r, t.maj32 = i, t.p32 = n, t.s0_256 = function(t) {
return e(t, 2) ^ e(t, 13) ^ e(t, 22);
}, t.s1_256 = function(t) {
return e(t, 6) ^ e(t, 11) ^ e(t, 25);
}, t.g0_256 = function(t) {
return e(t, 7) ^ e(t, 18) ^ t >>> 3;
}, t.g1_256 = function(t) {
return e(t, 17) ^ e(t, 19) ^ t >>> 10;
};
})), require__1 = __commonJSMin(((t, e) => {
var r = require_utils(), i = require_common$1(), n = require_common(), o = r.rotl32, s = r.sum32, a = r.sum32_5, h = n.ft_1, u = i.BlockHash, f = [
1518500249,
1859775393,
2400959708,
3395469782
];
function l() {
if (!(this instanceof l)) return new l();
u.call(this), this.h = [
1732584193,
4023233417,
2562383102,
271733878,
3285377520
], this.W = new Array(80);
}
r.inherits(l, u), e.exports = l, l.blockSize = 512, l.outSize = 160, l.hmacStrength = 80, l.padLength = 64, l.prototype._update = function(t, e) {
for (var r = this.W, i = 0; i < 16; i++) r[i] = t[e + i];
for (; i < r.length; i++) r[i] = o(r[i - 3] ^ r[i - 8] ^ r[i - 14] ^ r[i - 16], 1);
var n = this.h[0], u = this.h[1], l = this.h[2], c = this.h[3], d = this.h[4];
for (i = 0; i < r.length; i++) {
var p = ~~(i / 20), m = a(o(n, 5), h(p, u, l, c), d, r[i], f[p]);
d = c, c = l, l = o(u, 30), u = n, n = m;
}
this.h[0] = s(this.h[0], n), this.h[1] = s(this.h[1], u), this.h[2] = s(this.h[2], l), this.h[3] = s(this.h[3], c), this.h[4] = s(this.h[4], d);
}, l.prototype._digest = function(t) {
return "hex" === t ? r.toHex32(this.h, "big") : r.split32(this.h, "big");
};
})), require__256 = __commonJSMin(((t, e) => {
var r = require_utils(), i = require_common$1(), n = require_common(), o = require_minimalistic_assert(), s = r.sum32, a = r.sum32_4, h = r.sum32_5, u = n.ch32, f = n.maj32, l = n.s0_256, c = n.s1_256, d = n.g0_256, p = n.g1_256, m = i.BlockHash, g = [
1116352408,
1899447441,
3049323471,
3921009573,
961987163,
1508970993,
2453635748,
2870763221,
3624381080,
310598401,
607225278,
1426881987,
1925078388,
2162078206,
2614888103,
3248222580,
3835390401,
4022224774,
264347078,
604807628,
770255983,
1249150122,
1555081692,
1996064986,
2554220882,
2821834349,
2952996808,
3210313671,
3336571891,
3584528711,
113926993,
338241895,
666307205,
773529912,
1294757372,
1396182291,
1695183700,
1986661051,
2177026350,
2456956037,
2730485921,
2820302411,
3259730800,
3345764771,
3516065817,
3600352804,
4094571909,
275423344,
430227734,
506948616,
659060556,
883997877,
958139571,
1322822218,
1537002063,
1747873779,
1955562222,
2024104815,
2227730452,
2361852424,
2428436474,
2756734187,
3204031479,
3329325298
];
function y() {
if (!(this instanceof y)) return new y();
m.call(this), this.h = [
1779033703,
3144134277,
1013904242,
2773480762,
1359893119,
2600822924,
528734635,
1541459225
], this.k = g, this.W = new Array(64);
}
r.inherits(y, m), e.exports = y, y.blockSize = 512, y.outSize = 256, y.hmacStrength = 192, y.padLength = 64, y.prototype._update = function(t, e) {
for (var r = this.W, i = 0; i < 16; i++) r[i] = t[e + i];
for (; i < r.length; i++) r[i] = a(p(r[i - 2]), r[i - 7], d(r[i - 15]), r[i - 16]);
var n = this.h[0], m = this.h[1], g = this.h[2], y = this.h[3], b = this.h[4], v = this.h[5], _ = this.h[6], w = this.h[7];
for (o(this.k.length === r.length), i = 0; i < r.length; i++) {
var M = h(w, c(b), u(b, v, _), this.k[i], r[i]), S = s(l(n), f(n, m, g));
w = _, _ = v, v = b, b = s(y, M), y = g, g = m, m = n, n = s(M, S);
}
this.h[0] = s(this.h[0], n), this.h[1] = s(this.h[1], m), this.h[2] = s(this.h[2], g), this.h[3] = s(this.h[3], y), this.h[4] = s(this.h[4], b), this.h[5] = s(this.h[5], v), this.h[6] = s(this.h[6], _), this.h[7] = s(this.h[7], w);
}, y.prototype._digest = function(t) {
return "hex" === t ? r.toHex32(this.h, "big") : r.split32(this.h, "big");
};
})), require__224 = __commonJSMin(((t, e) => {
var r = require_utils(), i = require__256();
function n() {
if (!(this instanceof n)) return new n();
i.call(this), this.h = [
3238371032,
914150663,
812702999,
4144912697,
4290775857,
1750603025,
1694076839,
3204075428
];
}
r.inherits(n, i), e.exports = n, n.blockSize = 512, n.outSize = 224, n.hmacStrength = 192, n.padLength = 64, n.prototype._digest = function(t) {
return "hex" === t ? r.toHex32(this.h.slice(0, 7), "big") : r.split32(this.h.slice(0, 7), "big");
};
})), require__512 = __commonJSMin(((t, e) => {
var r = require_utils(), i = require_common$1(), n = require_minimalistic_assert(), o = r.rotr64_hi, s = r.rotr64_lo, a = r.shr64_hi, h = r.shr64_lo, u = r.sum64, f = r.sum64_hi, l = r.sum64_lo, c = r.sum64_4_hi, d = r.sum64_4_lo, p = r.sum64_5_hi, m = r.sum64_5_lo, g = i.BlockHash, y = [
1116352408,
3609767458,
1899447441,
602891725,
3049323471,
3964484399,
3921009573,
2173295548,
961987163,
4081628472,
1508970993,
3053834265,
2453635748,
2937671579,
2870763221,
3664609560,
3624381080,
2734883394,
310598401,
1164996542,
607225278,
1323610764,
1426881987,
3590304994,
1925078388,
4068182383,
2162078206,
991336113,
2614888103,
633803317,
3248222580,
3479774868,
3835390401,
2666613458,
4022224774,
944711139,
264347078,
2341262773,
604807628,
2007800933,
770255983,
1495990901,
1249150122,
1856431235,
1555081692,
3175218132,
1996064986,
2198950837,
2554220882,
3999719339,
2821834349,
766784016,
2952996808,
2566594879,
3210313671,
3203337956,
3336571891,
1034457026,
3584528711,
2466948901,
113926993,
3758326383,
338241895,
168717936,
666307205,
1188179964,
773529912,
1546045734,
1294757372,
1522805485,
1396182291,
2643833823,
1695183700,
2343527390,
1986661051,
1014477480,
2177026350,
1206759142,
2456956037,
344077627,
2730485921,
1290863460,
2820302411,
3158454273,
3259730800,
3505952657,
3345764771,
106217008,
3516065817,
3606008344,
3600352804,
1432725776,
4094571909,
1467031594,
275423344,
851169720,
430227734,
3100823752,
506948616,
1363258195,
659060556,
3750685593,
883997877,
3785050280,
958139571,
3318307427,
1322822218,
3812723403,
1537002063,
2003034995,
1747873779,
3602036899,
1955562222,
1575990012,
2024104815,
1125592928,
2227730452,
2716904306,
2361852424,
442776044,
2428436474,
593698344,
2756734187,
3733110249,
3204031479,
2999351573,
3329325298,
3815920427,
3391569614,
3928383900,
3515267271,
566280711,
3940187606,
3454069534,
4118630271,
4000239992,
116418474,
1914138554,
174292421,
2731055270,
289380356,
3203993006,
460393269,
320620315,
685471733,
587496836,
852142971,
1086792851,
1017036298,
365543100,
1126000580,
2618297676,
1288033470,
3409855158,
1501505948,
4234509866,
1607167915,
987167468,
1816402316,
1246189591
];
function b() {
if (!(this instanceof b)) return new b();
g.call(this), this.h = [
1779033703,
4089235720,
3144134277,
2227873595,
1013904242,
4271175723,
2773480762,
1595750129,
1359893119,
2917565137,
2600822924,
725511199,
528734635,
4215389547,
1541459225,
327033209
], this.k = y, this.W = new Array(160);
}
function v(t, e, r, i, n) {
var o = t & r ^ ~t & n;
return o < 0 && (o += 4294967296), o;
}
function _(t, e, r, i, n, o) {
var s = e & i ^ ~e & o;
return s < 0 && (s += 4294967296), s;
}
function w(t, e, r, i, n) {
var o = t & r ^ t & n ^ r & n;
return o < 0 && (o += 4294967296), o;
}
function M(t, e, r, i, n, o) {
var s = e & i ^ e & o ^ i & o;
return s < 0 && (s += 4294967296), s;
}
function S(t, e) {
var r = o(t, e, 28) ^ o(e, t, 2) ^ o(e, t, 7);
return r < 0 && (r += 4294967296), r;
}
function E(t, e) {
var r = s(t, e, 28) ^ s(e, t, 2) ^ s(e, t, 7);
return r < 0 && (r += 4294967296), r;
}
function A(t, e) {
var r = o(t, e, 14) ^ o(t, e, 18) ^ o(e, t, 9);
return r < 0 && (r += 4294967296), r;
}
function C(t, e) {
var r = s(t, e, 14) ^ s(t, e, 18) ^ s(e, t, 9);
return r < 0 && (r += 4294967296), r;
}
function O(t, e) {
var r = o(t, e, 1) ^ o(t, e, 8) ^ a(t, e, 7);
return r < 0 && (r += 4294967296), r;
}
function P(t, e) {
var r = s(t, e, 1) ^ s(t, e, 8) ^ h(t, e, 7);
return r < 0 && (r += 4294967296), r;
}
function I(t, e) {
var r = o(t, e, 19) ^ o(e, t, 29) ^ a(t, e, 6);
return r < 0 && (r += 4294967296), r;
}
function k(t, e) {
var r = s(t, e, 19) ^ s(e, t, 29) ^ h(t, e, 6);
return r < 0 && (r += 4294967296), r;
}
r.inherits(b, g), e.exports = b, b.blockSize = 1024, b.outSize = 512, b.hmacStrength = 192, b.padLength = 128, b.prototype._prepareBlock = function(t, e) {
for (var r = this.W, i = 0; i < 32; i++) r[i] = t[e + i];
for (; i < r.length; i += 2) {
var n = I(r[i - 4], r[i - 3]), o = k(r[i - 4], r[i - 3]), s = r[i - 14], a = r[i - 13], h = O(r[i - 30], r[i - 29]), u = P(r[i - 30], r[i - 29]), f = r[i - 32], l = r[i - 31];
r[i] = c(n, o, s, a, h, u, f, l), r[i + 1] = d(n, o, s, a, h, u, f, l);
}
}, b.prototype._update = function(t, e) {
this._prepareBlock(t, e);
var r = this.W, i = this.h[0], o = this.h[1], s = this.h[2], a = this.h[3], h = this.h[4], c = this.h[5], d = this.h[6], g = this.h[7], y = this.h[8], b = this.h[9], O = this.h[10], P = this.h[11], I = this.h[12], k = this.h[13], R = this.h[14], q = this.h[15];
n(this.k.length === r.length);
for (var T = 0; T < r.length; T += 2) {
var x = R, N = q, B = A(y, b), j = C(y, b), L = v(y, b, O, P, I), D = _(y, b, O, P, I, k), U = this.k[T], $ = this.k[T + 1], F = r[T], J = r[T + 1], z = p(x, N, B, j, L, D, U, $, F, J), K = m(x, N, B, j, L, D, U, $, F, J);
x = S(i, o), N = E(i, o), B = w(i, o, s, a, h), j = M(i, o, s, a, h, c);
var W = f(x, N, B, j), V = l(x, N, B, j);
R = I, q = k, I = O, k = P, O = y, P = b, y = f(d, g, z, K), b = l(g, g, z, K), d = h, g = c, h = s, c = a, s = i, a = o, i = f(z, K, W, V), o = l(z, K, W, V);
}
u(this.h, 0, i, o), u(this.h, 2, s, a), u(this.h, 4, h, c), u(this.h, 6, d, g), u(this.h, 8, y, b), u(this.h, 10, O, P), u(this.h, 12, I, k), u(this.h, 14, R, q);
}, b.prototype._digest = function(t) {
return "hex" === t ? r.toHex32(this.h, "big") : r.split32(this.h, "big");
};
})), require__384 = __commonJSMin(((t, e) => {
var r = require_utils(), i = require__512();
function n() {
if (!(this instanceof n)) return new n();
i.call(this), this.h = [
3418070365,
3238371032,
1654270250,
914150663,
2438529370,
812702999,
355462360,
4144912697,
1731405415,
4290775857,
2394180231,
1750603025,
3675008525,
1694076839,
1203062813,
3204075428
];
}
r.inherits(n, i), e.exports = n, n.blockSize = 1024, n.outSize = 384, n.hmacStrength = 192, n.padLength = 128, n.prototype._digest = function(t) {
return "hex" === t ? r.toHex32(this.h.slice(0, 12), "big") : r.split32(this.h.slice(0, 12), "big");
};
})), require_sha = __commonJSMin(((t) => {
t.sha1 = require__1(), t.sha224 = require__224(), t.sha256 = require__256(), t.sha384 = require__384(), t.sha512 = require__512();
})), require_ripemd = __commonJSMin(((t) => {
var e = require_utils(), r = require_common$1(), i = e.rotl32, n = e.sum32, o = e.sum32_3, s = e.sum32_4, a = r.BlockHash;
function h() {
if (!(this instanceof h)) return new h();
a.call(this), this.h = [
1732584193,
4023233417,
2562383102,
271733878,
3285377520
], this.endian = "little";
}
function u(t, e, r, i) {
return t <= 15 ? e ^ r ^ i : t <= 31 ? e & r | ~e & i : t <= 47 ? (e | ~r) ^ i : t <= 63 ? e & i | r & ~i : e ^ (r | ~i);
}
function f(t) {
return t <= 15 ? 0 : t <= 31 ? 1518500249 : t <= 47 ? 1859775393 : t <= 63 ? 2400959708 : 2840853838;
}
function l(t) {
return t <= 15 ? 1352829926 : t <= 31 ? 1548603684 : t <= 47 ? 1836072691 : t <= 63 ? 2053994217 : 0;
}
e.inherits(h, a), t.ripemd160 = h, h.blockSize = 512, h.outSize = 160, h.hmacStrength = 192, h.padLength = 64, h.prototype._update = function(t, e) {
for (var r = this.h[0], a = this.h[1], h = this.h[2], g = this.h[3], y = this.h[4], b = r, v = a, _ = h, w = g, M = y, S = 0; S < 80; S++) {
var E = n(i(s(r, u(S, a, h, g), t[c[S] + e], f(S)), p[S]), y);
r = y, y = g, g = i(h, 10), h = a, a = E, E = n(i(s(b, u(79 - S, v, _, w), t[d[S] + e], l(S)), m[S]), M), b = M, M = w, w = i(_, 10), _ = v, v = E;
}
E = o(this.h[1], h, w), this.h[1] = o(this.h[2], g, M), this.h[2] = o(this.h[3], y, b), this.h[3] = o(this.h[4], r, v), this.h[4] = o(this.h[0], a, _), this.h[0] = E;
}, h.prototype._digest = function(t) {
return "hex" === t ? e.toHex32(this.h, "little") : e.split32(this.h, "little");
};
var c = [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
7,
4,
13,
1,
10,
6,
15,
3,
12,
0,
9,
5,
2,
14,
11,
8,
3,
10,
14,
4,
9,
15,
8,
1,
2,
7,
0,
6,
13,
11,
5,
12,
1,
9,
11,
10,
0,
8,
12,
4,
13,
3,
7,
15,
14,
5,
6,
2,
4,
0,
5,
9,
7,
12,
2,
10,
14,
1,
3,
8,
11,
6,
15,
13
], d = [
5,
14,
7,
0,
9,
2,
11,
4,
13,
6,
15,
8,
1,
10,
3,
12,
6,
11,
3,
7,
0,
13,
5,
10,
14,
15,
8,
12,
4,
9,
1,
2,
15,
5,
1,
3,
7,
14,
6,
9,
11,
8,
12,
2,
10,
0,
4,
13,
8,
6,
4,
1,
3,
11,
15,
0,
5,
12,
2,
13,
9,
7,
10,
14,
12,
15,
10,
4,
1,
5,
8,
7,
6,
2,
13,
14,
0,
3,
9,
11
], p = [
11,
14,
15,
12,
5,
8,
7,
9,
11,
13,
14,
15,
6,
7,
9,
8,
7,
6,
8,
13,
11,
9,
7,
15,
7,
12,
15,
9,
11,
7,
13,
12,
11,
13,
6,
7,
14,
9,
13,
15,
14,
8,
13,
6,
5,
12,
7,
5,
11,
12,
14,
15,
14,
15,
9,
8,
9,
14,
5,
6,
8,
6,
5,
12,
9,
15,
5,
11,
6,
8,
13,
12,
5,
12,
13,
14,
11,
8,
5,
6
], m = [
8,
9,
9,
11,
13,
15,
15,
5,
7,
7,
8,
11,
14,
14,
12,
6,
9,
13,
15,
7,
12,
8,
9,
11,
7,
7,
12,
7,
6,
15,
13,
11,
9,
7,
15,
11,
8,
6,
6,
14,
12,
13,
5,
14,
13,
13,
7,
5,
15,
5,
8,
11,
14,
14,
6,
14,
6,
9,
12,
9,
12,
5,
15,
8,
8,
5,
12,
9,
12,
5,
14,
6,
8,
13,
6,
5,
15,
13,
11,
11
];
})), require_hmac$1 = __commonJSMin(((t, e) => {
var r = require_utils(), i = require_minimalistic_assert();
function n(t, e, i) {
if (!(this instanceof n)) return new n(t, e, i);
this.Hash = t, this.blockSize = t.blockSize / 8, this.outSize = t.outSize / 8, this.inner = null, this.outer = null, this._init(r.toArray(e, i));
}
e.exports = n, n.prototype._init = function(t) {
t.length > this.blockSize && (t = new this.Hash().update(t).digest()), i(t.length <= this.blockSize);
for (var e = t.length; e < this.blockSize; e++) t.push(0);
for (e = 0; e < t.length; e++) t[e] ^= 54;
for (this.inner = new this.Hash().update(t), e = 0; e < t.length; e++) t[e] ^= 106;
this.outer = new this.Hash().update(t);
}, n.prototype.update = function(t, e) {
return this.inner.update(t, e), this;
}, n.prototype.digest = function(t) {
return this.outer.update(this.inner.digest()), this.outer.digest(t);
};
})), require_hash = __commonJSMin(((t) => {
var e = t;
e.utils = require_utils(), e.common = require_common$1(), e.sha = require_sha(), e.ripemd = require_ripemd(), e.hmac = require_hmac$1(), e.sha1 = e.sha.sha1, e.sha256 = e.sha.sha256, e.sha224 = e.sha.sha224, e.sha384 = e.sha.sha384, e.sha512 = e.sha.sha512, e.ripemd160 = e.ripemd.ripemd160;
})), require_secp256k1 = __commonJSMin(((t, e) => {
e.exports = {
doubles: {
step: 4,
points: [
["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],
["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],
["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],
["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],
["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],
["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],
["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],
["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],
["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],
["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],
["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],
["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],
["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],
["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],
["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],
["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],
["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],
["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],
["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],
["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],
["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],
["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],
["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],
["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],
["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],
["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],
["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],
["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],
["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],
["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],
["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],
["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],
["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],
["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],
["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],
["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],
["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],
["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],
["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],
["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],
["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],
["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],
["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],
["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],
["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],
["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],
["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],
["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],
["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],
["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],
["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],
["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],
["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],
["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],
["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],
["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],
["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],
["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],
["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],
["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],
["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],
["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],
["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],
["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],
["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]
]
},
naf: {
wnd: 7,
points: [
["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],
["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],
["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],
["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],
["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],
["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],
["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],
["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],
["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],
["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],
["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],
["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],
["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],
["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],
["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],
["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],
["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],
["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],
["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],
["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],
["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],
["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],
["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],
["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],
["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],
["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],
["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],
["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],
["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],
["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],
["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],
["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],
["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],
["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],
["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],
["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],
["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],
["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],
["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],
["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],
["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],
["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],
["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],
["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],
["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],
["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],
["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],
["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],
["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],
["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],
["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],
["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],
["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],
["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],
["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],
["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],
["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],
["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],
["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],
["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],
["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],
["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],
["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],
["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],
["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],
["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],
["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],
["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],
["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],
["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],
["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],
["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],
["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],
["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],
["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],
["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],
["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],
["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],
["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],
["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],
["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],
["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],
["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],
["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],
["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],
["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],
["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],
["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],
["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],
["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],
["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],
["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],
["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],
["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],
["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],
["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],
["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],
["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],
["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],
["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],
["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],
["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],
["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],
["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],
["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],
["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],
["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],
["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],
["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],
["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],
["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],
["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],
["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],
["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],
["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],
["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],
["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],
["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],
["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],
["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],
["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],
["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],
["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],
["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],
["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],
["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],
["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]
]
}
};
})), require_curves = __commonJSMin(((t) => {
var e, r = t, i = require_hash(), n = require_curve(), o = require_utils$1().assert;
function s(t) {
"short" === t.type ? this.curve = new n.short(t) : "edwards" === t.type ? this.curve = new n.edwards(t) : this.curve = new n.mont(t), this.g = this.curve.g, this.n = this.curve.n, this.hash = t.hash, o(this.g.validate(), "Invalid curve"), o(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O");
}
function a(t, e) {
Object.defineProperty(r, t, {
configurable: !0,
enumerable: !0,
get: function() {
var i = new s(e);
return Object.defineProperty(r, t, {
configurable: !0,
enumerable: !0,
value: i
}), i;
}
});
}
r.PresetCurve = s, a("p192", {
type: "short",
prime: "p192",
p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",
a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",
b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",
n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",
hash: i.sha256,
gRed: !1,
g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]
}), a("p224", {
type: "short",
prime: "p224",
p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",
a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",
b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",
n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",
hash: i.sha256,
gRed: !1,
g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]
}), a("p256", {
type: "short",
prime: null,
p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",
a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",
b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",
n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",
hash: i.sha256,
gRed: !1,
g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]
}), a("p384", {
type: "short",
prime: null,
p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",
a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",
b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",
n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",
hash: i.sha384,
gRed: !1,
g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]
}), a("p521", {
type: "short",
prime: null,
p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",
a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",
b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",
n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",
hash: i.sha512,
gRed: !1,
g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]
}), a("curve25519", {
type: "mont",
prime: "p25519",
p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
a: "76d06",
b: "1",
n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
hash: i.sha256,
gRed: !1,
g: ["9"]
}), a("ed25519", {
type: "edwards",
prime: "p25519",
p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
a: "-1",
c: "1",
d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",
n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
hash: i.sha256,
gRed: !1,
g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"]
});
try {
e = require_secp256k1();
} catch (t) {
e = void 0;
}
a("secp256k1", {
type: "short",
prime: "k256",
p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",
a: "0",
b: "7",
n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",
h: "1",
hash: i.sha256,
beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",
lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",
basis: [{
a: "3086d221a7d46bcde86c90e49284eb15",
b: "-e4437ed6010e88286f547fa90abfe4c3"
}, {
a: "114ca50f7a8e2f3f657c1108d9d44cfd8",
b: "3086d221a7d46bcde86c90e49284eb15"
}],
gRed: !1,
g: [
"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
e
]
});
})), require_hmac_drbg = __commonJSMin(((t, e) => {
var r = require_hash(), i = require_utils$2(), n = require_minimalistic_assert();
function o(t) {
if (!(this instanceof o)) return new o(t);
this.hash = t.hash, this.predResist = !!t.predResist, this.outLen = this.hash.outSize, this.minEntropy = t.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;
var e = i.toArray(t.entropy, t.entropyEnc || "hex"), r = i.toArray(t.nonce, t.nonceEnc || "hex"), s = i.toArray(t.pers, t.persEnc || "hex");
n(e.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(e, r, s);
}
e.exports = o, o.prototype._init = function(t, e, r) {
var i = t.concat(e).concat(r);
this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);
for (var n = 0; n < this.V.length; n++) this.K[n] = 0, this.V[n] = 1;
this._update(i), this._reseed = 1, this.reseedInterval = 281474976710656;
}, o.prototype._hmac = function() {
return new r.hmac(this.hash, this.K);
}, o.prototype._update = function(t) {
var e = this._hmac().update(this.V).update([0]);
t && (e = e.update(t)), this.K = e.digest(), this.V = this._hmac().update(this.V).digest(), t && (this.K = this._hmac().update(this.V).update([1]).update(t).digest(), this.V = this._hmac().update(this.V).digest());
}, o.prototype.reseed = function(t, e, r, o) {
"string" != typeof e && (o = r, r = e, e = null), t = i.toArray(t, e), r = i.toArray(r, o), n(t.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t.concat(r || [])), this._reseed = 1;
}, o.prototype.generate = function(t, e, r, n) {
if (this._reseed > this.reseedInterval) throw new Error("Reseed is required");
"string" != typeof e && (n = r, r = e, e = null), r && (r = i.toArray(r, n || "hex"), this._update(r));
for (var o = []; o.length < t;) this.V = this._hmac().update(this.V).digest(), o = o.concat(this.V);
var s = o.slice(0, t);
return this._update(r), this._reseed++, i.encode(s, e);
};
})), require_key$1 = __commonJSMin(((t, e) => {
var r = require_bn$3(), i = require_utils$1().assert;
function n(t, e) {
this.ec = t, this.priv = null, this.pub = null, e.priv && this._importPrivate(e.priv, e.privEnc), e.pub && this._importPublic(e.pub, e.pubEnc);
}
e.exports = n, n.fromPublic = function(t, e, r) {
return e instanceof n ? e : new n(t, {
pub: e,
pubEnc: r
});
}, n.fromPrivate = function(t, e, r) {
return e instanceof n ? e : new n(t, {
priv: e,
privEnc: r
});
}, n.prototype.validate = function() {
var t = this.getPublic();
return t.isInfinity() ? {
result: !1,
reason: "Invalid public key"
} : t.validate() ? t.mul(this.ec.curve.n).isInfinity() ? {
result: !0,
reason: null
} : {
result: !1,
reason: "Public key * N != O"
} : {
result: !1,
reason: "Public key is not a point"
};
}, n.prototype.getPublic = function(t, e) {
return "string" == typeof t && (e = t, t = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), e ? this.pub.encode(e, t) : this.pub;
}, n.prototype.getPrivate = function(t) {
return "hex" === t ? this.priv.toString(16, 2) : this.priv;
}, n.prototype._importPrivate = function(t, e) {
this.priv = new r(t, e || 16), this.priv = this.priv.umod(this.ec.curve.n);
}, n.prototype._importPublic = function(t, e) {
if (t.x || t.y) return "mont" === this.ec.curve.type ? i(t.x, "Need x coordinate") : "short" !== this.ec.curve.type && "edwards" !== this.ec.curve.type || i(t.x && t.y, "Need both x and y coordinate"), void (this.pub = this.ec.curve.point(t.x, t.y));
this.pub = this.ec.curve.decodePoint(t, e);
}, n.prototype.derive = function(t) {
return t.validate() || i(t.validate(), "public point not validated"), t.mul(this.priv).getX();
}, n.prototype.sign = function(t, e, r) {
return this.ec.sign(t, this, e, r);
}, n.prototype.verify = function(t, e, r) {
return this.ec.verify(t, e, this, void 0, r);
}, n.prototype.inspect = function() {
return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >";
};
})), require_signature$1 = __commonJSMin(((t, e) => {
var r = require_bn$3(), i = require_utils$1(), n = i.assert;
function o(t, e) {
if (t instanceof o) return t;
this._importDER(t, e) || (n(t.r && t.s, "Signature without r or s"), this.r = new r(t.r, 16), this.s = new r(t.s, 16), void 0 === t.recoveryParam ? this.recoveryParam = null : this.recoveryParam = t.recoveryParam);
}
function s() {
this.place = 0;
}
function a(t, e) {
var r = t[e.place++];
if (!(128 & r)) return r;
var i = 15 & r;
if (0 === i || i > 4) return !1;
if (0 === t[e.place]) return !1;
for (var n = 0, o = 0, s = e.place; o < i; o++, s++) n <<= 8, n |= t[s], n >>>= 0;
return !(n <= 127) && (e.place = s, n);
}
function h(t) {
for (var e = 0, r = t.length - 1; !t[e] && !(128 & t[e + 1]) && e < r;) e++;
return 0 === e ? t : t.slice(e);
}
function u(t, e) {
if (e < 128) t.push(e);
else {
var r = 1 + (Math.log(e) / Math.LN2 >>> 3);
for (t.push(128 | r); --r;) t.push(e >>> (r << 3) & 255);
t.push(e);
}
}
e.exports = o, o.prototype._importDER = function(t, e) {
t = i.toArray(t, e);
var n = new s();
if (48 !== t[n.place++]) return !1;
var o = a(t, n);
if (!1 === o) return !1;
if (o + n.place !== t.length) return !1;
if (2 !== t[n.place++]) return !1;
var h = a(t, n);
if (!1 === h) return !1;
if (128 & t[n.place]) return !1;
var u = t.slice(n.place, h + n.place);
if (n.place += h, 2 !== t[n.place++]) return !1;
var f = a(t, n);
if (!1 === f) return !1;
if (t.length !== f + n.place) return !1;
if (128 & t[n.place]) return !1;
var l = t.slice(n.place, f + n.place);
if (0 === u[0]) {
if (!(128 & u[1])) return !1;
u = u.slice(1);
}
if (0 === l[0]) {
if (!(128 & l[1])) return !1;
l = l.slice(1);
}
return this.r = new r(u), this.s = new r(l), this.recoveryParam = null, !0;
}, o.prototype.toDER = function(t) {
var e = this.r.toArray(), r = this.s.toArray();
for (128 & e[0] && (e = [0].concat(e)), 128 & r[0] && (r = [0].concat(r)), e = h(e), r = h(r); !(r[0] || 128 & r[1]);) r = r.slice(1);
var n = [2];
u(n, e.length), (n = n.concat(e)).push(2), u(n, r.length);
var o = n.concat(r), s = [48];
return u(s, o.length), s = s.concat(o), i.encode(s, t);
};
})), require_ec = __commonJSMin(((t, e) => {
var r = require_bn$3(), i = require_hmac_drbg(), n = require_utils$1(), o = require_curves(), s = require_brorand(), a = n.assert, h = require_key$1(), u = require_signature$1();
function f(t) {
if (!(this instanceof f)) return new f(t);
"string" == typeof t && (a(Object.prototype.hasOwnProperty.call(o, t), "Unknown curve " + t), t = o[t]), t instanceof o.PresetCurve && (t = { curve: t }), this.curve = t.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = t.curve.g, this.g.precompute(t.curve.n.bitLength() + 1), this.hash = t.hash || t.curve.hash;
}
e.exports = f, f.prototype.keyPair = function(t) {
return new h(this, t);
}, f.prototype.keyFromPrivate = function(t, e) {
return h.fromPrivate(this, t, e);
}, f.prototype.keyFromPublic = function(t, e) {
return h.fromPublic(this, t, e);
}, f.prototype.genKeyPair = function(t) {
t || (t = {});
for (var e = new i({
hash: this.hash,
pers: t.pers,
persEnc: t.persEnc || "utf8",
entropy: t.entropy || s(this.hash.hmacStrength),
entropyEnc: t.entropy && t.entropyEnc || "utf8",
nonce: this.n.toArray()
}), n = this.n.byteLength(), o = this.n.sub(new r(2));;) {
var a = new r(e.generate(n));
if (!(a.cmp(o) > 0)) return a.iaddn(1), this.keyFromPrivate(a);
}
}, f.prototype._truncateToN = function(t, e, i) {
var n;
if (r.isBN(t) || "number" == typeof t) n = (t = new r(t, 16)).byteLength();
else if ("object" == typeof t) n = t.length, t = new r(t, 16);
else {
var o = t.toString();
n = o.length + 1 >>> 1, t = new r(o, 16);
}
"number" != typeof i && (i = 8 * n);
var s = i - this.n.bitLength();
return s > 0 && (t = t.ushrn(s)), !e && t.cmp(this.n) >= 0 ? t.sub(this.n) : t;
}, f.prototype.sign = function(t, e, n, o) {
if ("object" == typeof n && (o = n, n = null), o || (o = {}), "string" != typeof t && "number" != typeof t && !r.isBN(t)) {
a("object" == typeof t && t && "number" == typeof t.length, "Expected message to be an array-like, a hex string, or a BN instance"), a(t.length >>> 0 === t.length);
for (var s = 0; s < t.length; s++) a((255 & t[s]) === t[s]);
}
e = this.keyFromPrivate(e, n), t = this._truncateToN(t, !1, o.msgBitLength), a(!t.isNeg(), "Can not sign a negative message");
var h = this.n.byteLength(), f = e.getPrivate().toArray("be", h), l = t.toArray("be", h);
a(new r(l).eq(t), "Can not sign message");
for (var c = new i({
hash: this.hash,
entropy: f,
nonce: l,
pers: o.pers,
persEnc: o.persEnc || "utf8"
}), d = this.n.sub(new r(1)), p = 0;; p++) {
var m = o.k ? o.k(p) : new r(c.generate(this.n.byteLength()));
if (!((m = this._truncateToN(m, !0)).cmpn(1) <= 0 || m.cmp(d) >= 0)) {
var g = this.g.mul(m);
if (!g.isInfinity()) {
var y = g.getX(), b = y.umod(this.n);
if (0 !== b.cmpn(0)) {
var v = m.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));
if (0 !== (v = v.umod(this.n)).cmpn(0)) {
var _ = (g.getY().isOdd() ? 1 : 0) | (0 !== y.cmp(b) ? 2 : 0);
return o.canonical && v.cmp(this.nh) > 0 && (v = this.n.sub(v), _ ^= 1), new u({
r: b,
s: v,
recoveryParam: _
});
}
}
}
}
}
}, f.prototype.verify = function(t, e, r, i, n) {
n || (n = {}), t = this._truncateToN(t, !1, n.msgBitLength), r = this.keyFromPublic(r, i);
var o = (e = new u(e, "hex")).r, s = e.s;
if (o.cmpn(1) < 0 || o.cmp(this.n) >= 0) return !1;
if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return !1;
var a, h = s.invm(this.n), f = h.mul(t).umod(this.n), l = h.mul(o).umod(this.n);
return this.curve._maxwellTrick ? !(a = this.g.jmulAdd(f, r.getPublic(), l)).isInfinity() && a.eqXToP(o) : !(a = this.g.mulAdd(f, r.getPublic(), l)).isInfinity() && 0 === a.getX().umod(this.n).cmp(o);
}, f.prototype.recoverPubKey = function(t, e, i, n) {
a((3 & i) === i, "The recovery param is more than two bits"), e = new u(e, n);
var o = this.n, s = new r(t), h = e.r, f = e.s, l = 1 & i, c = i >> 1;
if (h.cmp(this.curve.p.umod(this.curve.n)) >= 0 && c) throw new Error("Unable to find sencond key candinate");
h = c ? this.curve.pointFromX(h.add(this.curve.n), l) : this.curve.pointFromX(h, l);
var d = e.r.invm(o), p = o.sub(s).mul(d).umod(o), m = f.mul(d).umod(o);
return this.g.mulAdd(p, h, m);
}, f.prototype.getKeyRecoveryParam = function(t, e, r, i) {
if (null !== (e = new u(e, i)).recoveryParam) return e.recoveryParam;
for (var n = 0; n < 4; n++) {
var o;
try {
o = this.recoverPubKey(t, e, n);
} catch (t) {
continue;
}
if (o.eq(r)) return n;
}
throw new Error("Unable to find valid recovery factor");
};
})), require_key = __commonJSMin(((t, e) => {
var r = require_utils$1(), i = r.assert, n = r.parseBytes, o = r.cachedProperty;
function s(t, e) {
this.eddsa = t, this._secret = n(e.secret), t.isPoint(e.pub) ? this._pub = e.pub : this._pubBytes = n(e.pub);
}
s.fromPublic = function(t, e) {
return e instanceof s ? e : new s(t, { pub: e });
}, s.fromSecret = function(t, e) {
return e instanceof s ? e : new s(t, { secret: e });
}, s.prototype.secret = function() {
return this._secret;
}, o(s, "pubBytes", (function() {
return this.eddsa.encodePoint(this.pub());
})), o(s, "pub", (function() {
return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());
})), o(s, "privBytes", (function() {
var t = this.eddsa, e = this.hash(), r = t.encodingLength - 1, i = e.slice(0, t.encodingLength);
return i[0] &= 248, i[r] &= 127, i[r] |= 64, i;
})), o(s, "priv", (function() {
return this.eddsa.decodeInt(this.privBytes());
})), o(s, "hash", (function() {
return this.eddsa.hash().update(this.secret()).digest();
})), o(s, "messagePrefix", (function() {
return this.hash().slice(this.eddsa.encodingLength);
})), s.prototype.sign = function(t) {
return i(this._secret, "KeyPair can only verify"), this.eddsa.sign(t, this);
}, s.prototype.verify = function(t, e) {
return this.eddsa.verify(t, e, this);
}, s.prototype.getSecret = function(t) {
return i(this._secret, "KeyPair is public only"), r.encode(this.secret(), t);
}, s.prototype.getPublic = function(t) {
return r.encode(this.pubBytes(), t);
}, e.exports = s;
})), require_signature = __commonJSMin(((t, e) => {
var r = require_bn$3(), i = require_utils$1(), n = i.assert, o = i.cachedProperty, s = i.parseBytes;
function a(t, e) {
this.eddsa = t, "object" != typeof e && (e = s(e)), Array.isArray(e) && (n(e.length === 2 * t.encodingLength, "Signature has invalid size"), e = {
R: e.slice(0, t.encodingLength),
S: e.slice(t.encodingLength)
}), n(e.R && e.S, "Signature without R or S"), t.isPoint(e.R) && (this._R = e.R), e.S instanceof r && (this._S = e.S), this._Rencoded = Array.isArray(e.R) ? e.R : e.Rencoded, this._Sencoded = Array.isArray(e.S) ? e.S : e.Sencoded;
}
o(a, "S", (function() {
return this.eddsa.decodeInt(this.Sencoded());
})), o(a, "R", (function() {
return this.eddsa.decodePoint(this.Rencoded());
})), o(a, "Rencoded", (function() {
return this.eddsa.encodePoint(this.R());
})), o(a, "Sencoded", (function() {
return this.eddsa.encodeInt(this.S());
})), a.prototype.toBytes = function() {
return this.Rencoded().concat(this.Sencoded());
}, a.prototype.toHex = function() {
return i.encode(this.toBytes(), "hex").toUpperCase();
}, e.exports = a;
})), require_eddsa = __commonJSMin(((t, e) => {
var r = require_hash(), i = require_curves(), n = require_utils$1(), o = n.assert, s = n.parseBytes, a = require_key(), h = require_signature();
function u(t) {
if (o("ed25519" === t, "only tested with ed25519 so far"), !(this instanceof u)) return new u(t);
t = i[t].curve, this.curve = t, this.g = t.g, this.g.precompute(t.n.bitLength() + 1), this.pointClass = t.point().constructor, this.encodingLength = Math.ceil(t.n.bitLength() / 8), this.hash = r.sha512;
}
e.exports = u, u.prototype.sign = function(t, e) {
t = s(t);
var r = this.keyFromSecret(e), i = this.hashInt(r.messagePrefix(), t), n = this.g.mul(i), o = this.encodePoint(n), a = this.hashInt(o, r.pubBytes(), t).mul(r.priv()), h = i.add(a).umod(this.curve.n);
return this.makeSignature({
R: n,
S: h,
Rencoded: o
});
}, u.prototype.verify = function(t, e, r) {
if (t = s(t), (e = this.makeSignature(e)).S().gte(e.eddsa.curve.n) || e.S().isNeg()) return !1;
var i = this.keyFromPublic(r), n = this.hashInt(e.Rencoded(), i.pubBytes(), t), o = this.g.mul(e.S());
return e.R().add(i.pub().mul(n)).eq(o);
}, u.prototype.hashInt = function() {
for (var t = this.hash(), e = 0; e < arguments.length; e++) t.update(arguments[e]);
return n.intFromLE(t.digest()).umod(this.curve.n);
}, u.prototype.keyFromPublic = function(t) {
return a.fromPublic(this, t);
}, u.prototype.keyFromSecret = function(t) {
return a.fromSecret(this, t);
}, u.prototype.makeSignature = function(t) {
return t instanceof h ? t : new h(this, t);
}, u.prototype.encodePoint = function(t) {
var e = t.getY().toArray("le", this.encodingLength);
return e[this.encodingLength - 1] |= t.getX().isOdd() ? 128 : 0, e;
}, u.prototype.decodePoint = function(t) {
var e = (t = n.parseBytes(t)).length - 1, r = t.slice(0, e).concat(-129 & t[e]), i = !!(128 & t[e]), o = n.intFromLE(r);
return this.curve.pointFromY(o, i);
}, u.prototype.encodeInt = function(t) {
return t.toArray("le", this.encodingLength);
}, u.prototype.decodeInt = function(t) {
return n.intFromLE(t);
}, u.prototype.isPoint = function(t) {
return t instanceof this.pointClass;
};
})), require_elliptic = __commonJSMin(((t) => {
var e = t;
e.version = (init_package(), __toCommonJS(package_exports).default).version, e.utils = require_utils$1(), e.rand = require_brorand(), e.curve = require_curve(), e.curves = require_curves(), e.ec = require_ec(), e.eddsa = require_eddsa();
})), require_bn$2 = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var r = t.charCodeAt(e);
return r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : r - 48 & 15;
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, r, i) {
for (var n = 0, o = Math.min(t.length, r), s = e; s < o; s++) {
var a = t.charCodeAt(s) - 48;
n *= i, n += a >= 49 ? a - 49 + 10 : a >= 17 ? a - 17 + 10 : a;
}
return n;
}
n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this.strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this.strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this.strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, n.prototype.inspect = function() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
};
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"
], f = [
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
], l = [
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 c(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r.strip();
}
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? u[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var c = f[t], d = l[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modn(d).toString(t);
i = (p = p.idivn(d)).isZero() ? m + i : u[c - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16);
}, n.prototype.toBuffer = function(t, e) {
return r(void 0 !== o), this.toArrayLike(o, t, e);
}, n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
}, n.prototype.toArrayLike = function(t, e, i) {
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0"), this.strip();
var s, a, h = "le" === e, u = new t(o), f = this.clone();
if (h) {
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[a] = s;
for (; a < o; a++) u[a] = 0;
} else {
for (a = 0; a < o - n; a++) u[a] = 0;
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[o - a - 1] = s;
}
return u;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this.strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this.strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this.strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this.strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this.strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this.strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var d = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function p(t, e, r) {
return new m().mulp(t, e, r);
}
function m(t, e) {
this.x = t, this.y = e;
}
Math.imul || (d = c), n.prototype.mulTo = function(t, e) {
var r, i = this.length + t.length;
return r = 10 === this.length && 10 === t.length ? d(this, t, e) : i < 63 ? c(this, t, e) : i < 1024 ? function(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r.strip();
}(this, t, e) : p(this, t, e), r;
}, m.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, m.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, m.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, m.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, m.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, m.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, m.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, m.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, m.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, m.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r.strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), p(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
r("number" == typeof t), r(t < 67108864);
for (var e = 0, i = 0; i < this.length; i++) {
var n = (0 | this.words[i]) * t, o = (67108863 & n) + (67108863 & e);
e >>= 26, e += n / 67108864 | 0, e += o >>> 26, this.words[i] = 67108863 & o;
}
return 0 !== e && (this.words[i] = e, this.length++), this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = (t.words[i] & 1 << n) >>> n;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this.strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this.strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this.strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this.strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this.strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a.strip(), i.strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modn = function(t) {
r(t <= 67108863);
for (var e = (1 << 26) % t, i = 0, n = this.length - 1; n >= 0; n--) i = (e * i + (0 | this.words[n])) % t;
return i;
}, n.prototype.idivn = function(t) {
r(t <= 67108863);
for (var e = 0, i = this.length - 1; i >= 0; i--) {
var n = (0 | this.words[i]) + 67108864 * e;
this.words[i] = n / t | 0, e = n % t;
}
return this.strip();
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this.strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new M(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var g = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function y(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function b() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function v() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function w() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function M(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function S(t) {
M.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, y.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, y.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, y.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(b, y), b.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, b.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(v, y), i(_, y), i(w, y), w.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (g[t]) return g[t];
var e;
if ("k256" === t) e = new b();
else if ("p224" === t) e = new v();
else if ("p192" === t) e = new _();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new w();
}
return g[t] = e, e;
}, M.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, M.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, M.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : t.umod(this.m)._forceRed(this);
}, M.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, M.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, M.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, M.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, M.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, M.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, M.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, M.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, M.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, M.prototype.sqr = function(t) {
return this.mul(t, t);
}, M.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, M.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, M.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, M.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, M.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new S(t);
}, i(S, M), S.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, S.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, S.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, S.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, S.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_vm_browserify = __commonJSMin(((exports) => {
var indexOf = function(t, e) {
if (t.indexOf) return t.indexOf(e);
for (var r = 0; r < t.length; r++) if (t[r] === e) return r;
return -1;
}, Object_keys = function(t) {
if (Object.keys) return Object.keys(t);
var e = [];
for (var r in t) e.push(r);
return e;
}, forEach = function(t, e) {
if (t.forEach) return t.forEach(e);
for (var r = 0; r < t.length; r++) e(t[r], r, t);
}, defineProp = function() {
try {
return Object.defineProperty({}, "_", {}), function(t, e, r) {
Object.defineProperty(t, e, {
writable: !0,
enumerable: !1,
configurable: !0,
value: r
});
};
} catch (t) {
return function(t, e, r) {
t[e] = r;
};
}
}(), globals = [
"Array",
"Boolean",
"Date",
"Error",
"EvalError",
"Function",
"Infinity",
"JSON",
"Math",
"NaN",
"Number",
"Object",
"RangeError",
"ReferenceError",
"RegExp",
"String",
"SyntaxError",
"TypeError",
"URIError",
"decodeURI",
"decodeURIComponent",
"encodeURI",
"encodeURIComponent",
"escape",
"eval",
"isFinite",
"isNaN",
"parseFloat",
"parseInt",
"undefined",
"unescape"
];
function Context() {}
Context.prototype = {};
var Script = exports.Script = function(t) {
if (!(this instanceof Script)) return new Script(t);
this.code = t;
};
Script.prototype.runInContext = function(t) {
if (!(t instanceof Context)) throw new TypeError("needs a 'context' argument.");
var e = document.createElement("iframe");
e.style || (e.style = {}), e.style.display = "none", document.body.appendChild(e);
var r = e.contentWindow, i = r.eval, n = r.execScript;
!i && n && (n.call(r, "null"), i = r.eval), forEach(Object_keys(t), (function(e) {
r[e] = t[e];
})), forEach(globals, (function(e) {
t[e] && (r[e] = t[e]);
}));
var o = Object_keys(r), s = i.call(r, this.code);
return forEach(Object_keys(r), (function(e) {
(e in t || -1 === indexOf(o, e)) && (t[e] = r[e]);
})), forEach(globals, (function(e) {
e in t || defineProp(t, e, r[e]);
})), document.body.removeChild(e), s;
}, Script.prototype.runInThisContext = function() {
return eval(this.code);
}, Script.prototype.runInNewContext = function(t) {
var e = Script.createContext(t), r = this.runInContext(e);
return t && forEach(Object_keys(e), (function(r) {
t[r] = e[r];
})), r;
}, forEach(Object_keys(Script.prototype), (function(t) {
exports[t] = Script[t] = function(e) {
var r = Script(e);
return r[t].apply(r, [].slice.call(arguments, 1));
};
})), exports.isContext = function(t) {
return t instanceof Context;
}, exports.createScript = function(t) {
return exports.Script(t);
}, exports.createContext = Script.createContext = function(t) {
var e = new Context();
return "object" == typeof t && forEach(Object_keys(t), (function(r) {
e[r] = t[r];
})), e;
};
})), require_api = __commonJSMin(((t) => {
var e = require_asn1$1(), r = require_inherits_browser();
function i(t, e) {
this.name = t, this.body = e, this.decoders = {}, this.encoders = {};
}
t.define = function(t, e) {
return new i(t, e);
}, i.prototype._createNamed = function(t) {
var e;
try {
e = require_vm_browserify().runInThisContext("(function " + this.name + "(entity) {\n this._initNamed(entity);\n})");
} catch (t) {
e = function(t) {
this._initNamed(t);
};
}
return r(e, t), e.prototype._initNamed = function(e) {
t.call(this, e);
}, new e(this);
}, i.prototype._getDecoder = function(t) {
return t = t || "der", this.decoders.hasOwnProperty(t) || (this.decoders[t] = this._createNamed(e.decoders[t])), this.decoders[t];
}, i.prototype.decode = function(t, e, r) {
return this._getDecoder(e).decode(t, r);
}, i.prototype._getEncoder = function(t) {
return t = t || "der", this.encoders.hasOwnProperty(t) || (this.encoders[t] = this._createNamed(e.encoders[t])), this.encoders[t];
}, i.prototype.encode = function(t, e, r) {
return this._getEncoder(e).encode(t, r);
};
})), require_reporter = __commonJSMin(((t) => {
var e = require_inherits_browser();
function r(t) {
this._reporterState = {
obj: null,
path: [],
options: t || {},
errors: []
};
}
function i(t, e) {
this.path = t, this.rethrow(e);
}
t.Reporter = r, r.prototype.isError = function(t) {
return t instanceof i;
}, r.prototype.save = function() {
var t = this._reporterState;
return {
obj: t.obj,
pathLen: t.path.length
};
}, r.prototype.restore = function(t) {
var e = this._reporterState;
e.obj = t.obj, e.path = e.path.slice(0, t.pathLen);
}, r.prototype.enterKey = function(t) {
return this._reporterState.path.push(t);
}, r.prototype.exitKey = function(t) {
var e = this._reporterState;
e.path = e.path.slice(0, t - 1);
}, r.prototype.leaveKey = function(t, e, r) {
var i = this._reporterState;
this.exitKey(t), null !== i.obj && (i.obj[e] = r);
}, r.prototype.path = function() {
return this._reporterState.path.join("/");
}, r.prototype.enterObject = function() {
var t = this._reporterState, e = t.obj;
return t.obj = {}, e;
}, r.prototype.leaveObject = function(t) {
var e = this._reporterState, r = e.obj;
return e.obj = t, r;
}, r.prototype.error = function(t) {
var e, r = this._reporterState, n = t instanceof i;
if (e = n ? t : new i(r.path.map((function(t) {
return "[" + JSON.stringify(t) + "]";
})).join(""), t.message || t, t.stack), !r.options.partial) throw e;
return n || r.errors.push(e), e;
}, r.prototype.wrapResult = function(t) {
var e = this._reporterState;
return e.options.partial ? {
result: this.isError(t) ? null : t,
errors: e.errors
} : t;
}, e(i, Error), i.prototype.rethrow = function(t) {
if (this.message = t + " at: " + (this.path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this, i), !this.stack) try {
throw new Error(this.message);
} catch (t) {
this.stack = t.stack;
}
return this;
};
})), require_buffer = __commonJSMin(((t) => {
var e = require_inherits_browser(), r = require_base().Reporter, i = require_dist().Buffer;
function n(t, e) {
r.call(this, e), i.isBuffer(t) ? (this.base = t, this.offset = 0, this.length = t.length) : this.error("Input not Buffer");
}
function o(t, e) {
if (Array.isArray(t)) this.length = 0, this.value = t.map((function(t) {
return t instanceof o || (t = new o(t, e)), this.length += t.length, t;
}), this);
else if ("number" == typeof t) {
if (!(0 <= t && t <= 255)) return e.error("non-byte EncoderBuffer value");
this.value = t, this.length = 1;
} else if ("string" == typeof t) this.value = t, this.length = i.byteLength(t);
else {
if (!i.isBuffer(t)) return e.error("Unsupported type: " + typeof t);
this.value = t, this.length = t.length;
}
}
e(n, r), t.DecoderBuffer = n, n.prototype.save = function() {
return {
offset: this.offset,
reporter: r.prototype.save.call(this)
};
}, n.prototype.restore = function(t) {
var e = new n(this.base);
return e.offset = t.offset, e.length = this.offset, this.offset = t.offset, r.prototype.restore.call(this, t.reporter), e;
}, n.prototype.isEmpty = function() {
return this.offset === this.length;
}, n.prototype.readUInt8 = function(t) {
return this.offset + 1 <= this.length ? this.base.readUInt8(this.offset++, !0) : this.error(t || "DecoderBuffer overrun");
}, n.prototype.skip = function(t, e) {
if (!(this.offset + t <= this.length)) return this.error(e || "DecoderBuffer overrun");
var r = new n(this.base);
return r._reporterState = this._reporterState, r.offset = this.offset, r.length = this.offset + t, this.offset += t, r;
}, n.prototype.raw = function(t) {
return this.base.slice(t ? t.offset : this.offset, this.length);
}, t.EncoderBuffer = o, o.prototype.join = function(t, e) {
return t || (t = new i(this.length)), e || (e = 0), 0 === this.length || (Array.isArray(this.value) ? this.value.forEach((function(r) {
r.join(t, e), e += r.length;
})) : ("number" == typeof this.value ? t[e] = this.value : "string" == typeof this.value ? t.write(this.value, e) : i.isBuffer(this.value) && this.value.copy(t, e), e += this.length)), t;
};
})), require_node = __commonJSMin(((t, e) => {
var r = require_base().Reporter, i = require_base().EncoderBuffer, n = require_base().DecoderBuffer, o = require_minimalistic_assert(), s = [
"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"
], a = [
"key",
"obj",
"use",
"optional",
"explicit",
"implicit",
"def",
"choice",
"any",
"contains"
].concat(s);
function h(t, e) {
var r = {};
this._baseState = r, r.enc = t, r.parent = e || null, r.children = null, r.tag = null, r.args = null, r.reverseArgs = null, r.choice = null, r.optional = !1, r.any = !1, r.obj = !1, r.use = null, r.useDecoder = null, r.key = null, r.default = null, r.explicit = null, r.implicit = null, r.contains = null, r.parent || (r.children = [], this._wrap());
}
e.exports = h;
var u = [
"enc",
"parent",
"children",
"tag",
"args",
"reverseArgs",
"choice",
"optional",
"any",
"obj",
"use",
"alteredUse",
"key",
"default",
"explicit",
"implicit",
"contains"
];
h.prototype.clone = function() {
var t = this._baseState, e = {};
u.forEach((function(r) {
e[r] = t[r];
}));
var r = new this.constructor(e.parent);
return r._baseState = e, r;
}, h.prototype._wrap = function() {
var t = this._baseState;
a.forEach((function(e) {
this[e] = function() {
var r = new this.constructor(this);
return t.children.push(r), r[e].apply(r, arguments);
};
}), this);
}, h.prototype._init = function(t) {
var e = this._baseState;
o(null === e.parent), t.call(this), e.children = e.children.filter((function(t) {
return t._baseState.parent === this;
}), this), o.equal(e.children.length, 1, "Root node can have only one child");
}, h.prototype._useArgs = function(t) {
var e = this._baseState, r = t.filter((function(t) {
return t instanceof this.constructor;
}), this);
t = t.filter((function(t) {
return !(t instanceof this.constructor);
}), this), 0 !== r.length && (o(null === e.children), e.children = r, r.forEach((function(t) {
t._baseState.parent = this;
}), this)), 0 !== t.length && (o(null === e.args), e.args = t, e.reverseArgs = t.map((function(t) {
if ("object" != typeof t || t.constructor !== Object) return t;
var e = {};
return Object.keys(t).forEach((function(r) {
r == (0 | r) && (r |= 0);
var i = t[r];
e[i] = r;
})), e;
})));
}, [
"_peekTag",
"_decodeTag",
"_use",
"_decodeStr",
"_decodeObjid",
"_decodeTime",
"_decodeNull",
"_decodeInt",
"_decodeBool",
"_decodeList",
"_encodeComposite",
"_encodeStr",
"_encodeObjid",
"_encodeTime",
"_encodeNull",
"_encodeInt",
"_encodeBool"
].forEach((function(t) {
h.prototype[t] = function() {
var e = this._baseState;
throw new Error(t + " not implemented for encoding: " + e.enc);
};
})), s.forEach((function(t) {
h.prototype[t] = function() {
var e = this._baseState, r = Array.prototype.slice.call(arguments);
return o(null === e.tag), e.tag = t, this._useArgs(r), this;
};
})), h.prototype.use = function(t) {
o(t);
var e = this._baseState;
return o(null === e.use), e.use = t, this;
}, h.prototype.optional = function() {
return this._baseState.optional = !0, this;
}, h.prototype.def = function(t) {
var e = this._baseState;
return o(null === e.default), e.default = t, e.optional = !0, this;
}, h.prototype.explicit = function(t) {
var e = this._baseState;
return o(null === e.explicit && null === e.implicit), e.explicit = t, this;
}, h.prototype.implicit = function(t) {
var e = this._baseState;
return o(null === e.explicit && null === e.implicit), e.implicit = t, this;
}, h.prototype.obj = function() {
var t = this._baseState, e = Array.prototype.slice.call(arguments);
return t.obj = !0, 0 !== e.length && this._useArgs(e), this;
}, h.prototype.key = function(t) {
var e = this._baseState;
return o(null === e.key), e.key = t, this;
}, h.prototype.any = function() {
return this._baseState.any = !0, this;
}, h.prototype.choice = function(t) {
var e = this._baseState;
return o(null === e.choice), e.choice = t, this._useArgs(Object.keys(t).map((function(e) {
return t[e];
}))), this;
}, h.prototype.contains = function(t) {
var e = this._baseState;
return o(null === e.use), e.contains = t, this;
}, h.prototype._decode = function(t, e) {
var r = this._baseState;
if (null === r.parent) return t.wrapResult(r.children[0]._decode(t, e));
var i, o = r.default, s = !0, a = null;
if (null !== r.key && (a = t.enterKey(r.key)), r.optional) {
var h = null;
if (null !== r.explicit ? h = r.explicit : null !== r.implicit ? h = r.implicit : null !== r.tag && (h = r.tag), null !== h || r.any) {
if (s = this._peekTag(t, h, r.any), t.isError(s)) return s;
} else {
var u = t.save();
try {
null === r.choice ? this._decodeGeneric(r.tag, t, e) : this._decodeChoice(t, e), s = !0;
} catch (t) {
s = !1;
}
t.restore(u);
}
}
if (r.obj && s && (i = t.enterObject()), s) {
if (null !== r.explicit) {
var f = this._decodeTag(t, r.explicit);
if (t.isError(f)) return f;
t = f;
}
var l = t.offset;
if (null === r.use && null === r.choice) {
if (r.any) u = t.save();
var c = this._decodeTag(t, null !== r.implicit ? r.implicit : r.tag, r.any);
if (t.isError(c)) return c;
r.any ? o = t.raw(u) : t = c;
}
if (e && e.track && null !== r.tag && e.track(t.path(), l, t.length, "tagged"), e && e.track && null !== r.tag && e.track(t.path(), t.offset, t.length, "content"), r.any || (o = null === r.choice ? this._decodeGeneric(r.tag, t, e) : this._decodeChoice(t, e)), t.isError(o)) return o;
if (r.any || null !== r.choice || null === r.children || r.children.forEach((function(r) {
r._decode(t, e);
})), r.contains && ("octstr" === r.tag || "bitstr" === r.tag)) {
var d = new n(o);
o = this._getUse(r.contains, t._reporterState.obj)._decode(d, e);
}
}
return r.obj && s && (o = t.leaveObject(i)), null === r.key || null === o && !0 !== s ? null !== a && t.exitKey(a) : t.leaveKey(a, r.key, o), o;
}, h.prototype._decodeGeneric = function(t, e, r) {
var i = this._baseState;
return "seq" === t || "set" === t ? null : "seqof" === t || "setof" === t ? this._decodeList(e, t, i.args[0], r) : /str$/.test(t) ? this._decodeStr(e, t, r) : "objid" === t && i.args ? this._decodeObjid(e, i.args[0], i.args[1], r) : "objid" === t ? this._decodeObjid(e, null, null, r) : "gentime" === t || "utctime" === t ? this._decodeTime(e, t, r) : "null_" === t ? this._decodeNull(e, r) : "bool" === t ? this._decodeBool(e, r) : "objDesc" === t ? this._decodeStr(e, t, r) : "int" === t || "enum" === t ? this._decodeInt(e, i.args && i.args[0], r) : null !== i.use ? this._getUse(i.use, e._reporterState.obj)._decode(e, r) : e.error("unknown tag: " + t);
}, h.prototype._getUse = function(t, e) {
var r = this._baseState;
return r.useDecoder = this._use(t, e), o(null === r.useDecoder._baseState.parent), r.useDecoder = r.useDecoder._baseState.children[0], r.implicit !== r.useDecoder._baseState.implicit && (r.useDecoder = r.useDecoder.clone(), r.useDecoder._baseState.implicit = r.implicit), r.useDecoder;
}, h.prototype._decodeChoice = function(t, e) {
var r = this._baseState, i = null, n = !1;
return Object.keys(r.choice).some((function(o) {
var s = t.save(), a = r.choice[o];
try {
var h = a._decode(t, e);
if (t.isError(h)) return !1;
i = {
type: o,
value: h
}, n = !0;
} catch (e) {
return t.restore(s), !1;
}
return !0;
}), this), n ? i : t.error("Choice not matched");
}, h.prototype._createEncoderBuffer = function(t) {
return new i(t, this.reporter);
}, h.prototype._encode = function(t, e, r) {
var i = this._baseState;
if (null === i.default || i.default !== t) {
var n = this._encodeValue(t, e, r);
if (void 0 !== n && !this._skipDefault(n, e, r)) return n;
}
}, h.prototype._encodeValue = function(t, e, i) {
var n = this._baseState;
if (null === n.parent) return n.children[0]._encode(t, e || new r());
var o = null;
if (this.reporter = e, n.optional && void 0 === t) {
if (null === n.default) return;
t = n.default;
}
var s = null, a = !1;
if (n.any) o = this._createEncoderBuffer(t);
else if (n.choice) o = this._encodeChoice(t, e);
else if (n.contains) s = this._getUse(n.contains, i)._encode(t, e), a = !0;
else if (n.children) s = n.children.map((function(r) {
if ("null_" === r._baseState.tag) return r._encode(null, e, t);
if (null === r._baseState.key) return e.error("Child should have a key");
var i = e.enterKey(r._baseState.key);
if ("object" != typeof t) return e.error("Child expected, but input is not object");
var n = r._encode(t[r._baseState.key], e, t);
return e.leaveKey(i), n;
}), this).filter((function(t) {
return t;
})), s = this._createEncoderBuffer(s);
else if ("seqof" === n.tag || "setof" === n.tag) {
if (!n.args || 1 !== n.args.length) return e.error("Too many args for : " + n.tag);
if (!Array.isArray(t)) return e.error("seqof/setof, but data is not Array");
var h = this.clone();
h._baseState.implicit = null, s = this._createEncoderBuffer(t.map((function(r) {
var i = this._baseState;
return this._getUse(i.args[0], t)._encode(r, e);
}), h));
} else null !== n.use ? o = this._getUse(n.use, i)._encode(t, e) : (s = this._encodePrimitive(n.tag, t), a = !0);
if (!n.any && null === n.choice) {
var u = null !== n.implicit ? n.implicit : n.tag, f = null === n.implicit ? "universal" : "context";
null === u ? null === n.use && e.error("Tag could be omitted only for .use()") : null === n.use && (o = this._encodeComposite(u, a, f, s));
}
return null !== n.explicit && (o = this._encodeComposite(n.explicit, !1, "context", o)), o;
}, h.prototype._encodeChoice = function(t, e) {
var r = this._baseState, i = r.choice[t.type];
return i || o(!1, t.type + " not found in " + JSON.stringify(Object.keys(r.choice))), i._encode(t.value, e);
}, h.prototype._encodePrimitive = function(t, e) {
var r = this._baseState;
if (/str$/.test(t)) return this._encodeStr(e, t);
if ("objid" === t && r.args) return this._encodeObjid(e, r.reverseArgs[0], r.args[1]);
if ("objid" === t) return this._encodeObjid(e, null, null);
if ("gentime" === t || "utctime" === t) return this._encodeTime(e, t);
if ("null_" === t) return this._encodeNull();
if ("int" === t || "enum" === t) return this._encodeInt(e, r.args && r.reverseArgs[0]);
if ("bool" === t) return this._encodeBool(e);
if ("objDesc" === t) return this._encodeStr(e, t);
throw new Error("Unsupported tag: " + t);
}, h.prototype._isNumstr = function(t) {
return /^[0-9 ]*$/.test(t);
}, h.prototype._isPrintstr = function(t) {
return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t);
};
})), require_base = __commonJSMin(((t) => {
var e = t;
e.Reporter = require_reporter().Reporter, e.DecoderBuffer = require_buffer().DecoderBuffer, e.EncoderBuffer = require_buffer().EncoderBuffer, e.Node = require_node();
})), require_der$2 = __commonJSMin(((t) => {
var e = require_constants();
t.tagClass = {
0: "universal",
1: "application",
2: "context",
3: "private"
}, t.tagClassByName = e._reverse(t.tagClass), t.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"
}, t.tagByName = e._reverse(t.tag);
})), require_constants = __commonJSMin(((t) => {
var e = t;
e._reverse = function(t) {
var e = {};
return Object.keys(t).forEach((function(r) {
(0 | r) == r && (r |= 0);
var i = t[r];
e[i] = r;
})), e;
}, e.der = require_der$2();
})), require_der$1 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_asn1$1(), n = i.base, o = i.bignum, s = i.constants.der;
function a(t) {
this.enc = "der", this.name = t.name, this.entity = t, this.tree = new h(), this.tree._init(t.body);
}
function h(t) {
n.Node.call(this, "der", t);
}
function u(t, e) {
var r = t.readUInt8(e);
if (t.isError(r)) return r;
var i = s.tagClass[r >> 6], n = !(32 & r);
if (31 & ~r) r &= 31;
else {
var o = r;
for (r = 0; !(128 & ~o);) {
if (o = t.readUInt8(e), t.isError(o)) return o;
r <<= 7, r |= 127 & o;
}
}
return {
cls: i,
primitive: n,
tag: r,
tagStr: s.tag[r]
};
}
function f(t, e, r) {
var i = t.readUInt8(r);
if (t.isError(i)) return i;
if (!e && 128 === i) return null;
if (!(128 & i)) return i;
var n = 127 & i;
if (n > 4) return t.error("length octect is too long");
i = 0;
for (var o = 0; o < n; o++) {
i <<= 8;
var s = t.readUInt8(r);
if (t.isError(s)) return s;
i |= s;
}
return i;
}
e.exports = a, a.prototype.decode = function(t, e) {
return t instanceof n.DecoderBuffer || (t = new n.DecoderBuffer(t, e)), this.tree._decode(t, e);
}, r(h, n.Node), h.prototype._peekTag = function(t, e, r) {
if (t.isEmpty()) return !1;
var i = t.save(), n = u(t, "Failed to peek tag: \"" + e + "\"");
return t.isError(n) ? n : (t.restore(i), n.tag === e || n.tagStr === e || n.tagStr + "of" === e || r);
}, h.prototype._decodeTag = function(t, e, r) {
var i = u(t, "Failed to decode tag of \"" + e + "\"");
if (t.isError(i)) return i;
var n = f(t, i.primitive, "Failed to get length of \"" + e + "\"");
if (t.isError(n)) return n;
if (!r && i.tag !== e && i.tagStr !== e && i.tagStr + "of" !== e) return t.error("Failed to match tag: \"" + e + "\"");
if (i.primitive || null !== n) return t.skip(n, "Failed to match body of: \"" + e + "\"");
var o = t.save(), s = this._skipUntilEnd(t, "Failed to skip indefinite length body: \"" + this.tag + "\"");
return t.isError(s) ? s : (n = t.offset - o.offset, t.restore(o), t.skip(n, "Failed to match body of: \"" + e + "\""));
}, h.prototype._skipUntilEnd = function(t, e) {
for (;;) {
var r = u(t, e);
if (t.isError(r)) return r;
var i, n = f(t, r.primitive, e);
if (t.isError(n)) return n;
if (i = r.primitive || null !== n ? t.skip(n) : this._skipUntilEnd(t, e), t.isError(i)) return i;
if ("end" === r.tagStr) break;
}
}, h.prototype._decodeList = function(t, e, r, i) {
for (var n = []; !t.isEmpty();) {
var o = this._peekTag(t, "end");
if (t.isError(o)) return o;
var s = r.decode(t, "der", i);
if (t.isError(s) && o) break;
n.push(s);
}
return n;
}, h.prototype._decodeStr = function(t, e) {
if ("bitstr" === e) {
var r = t.readUInt8();
return t.isError(r) ? r : {
unused: r,
data: t.raw()
};
}
if ("bmpstr" === e) {
var i = t.raw();
if (i.length % 2 == 1) return t.error("Decoding of string type: bmpstr length mismatch");
for (var n = "", o = 0; o < i.length / 2; o++) n += String.fromCharCode(i.readUInt16BE(2 * o));
return n;
}
if ("numstr" === e) {
var s = t.raw().toString("ascii");
return this._isNumstr(s) ? s : t.error("Decoding of string type: numstr unsupported characters");
}
if ("octstr" === e) return t.raw();
if ("objDesc" === e) return t.raw();
if ("printstr" === e) {
var a = t.raw().toString("ascii");
return this._isPrintstr(a) ? a : t.error("Decoding of string type: printstr unsupported characters");
}
return /str$/.test(e) ? t.raw().toString() : t.error("Decoding of string type: " + e + " unsupported");
}, h.prototype._decodeObjid = function(t, e, r) {
for (var i, n = [], o = 0; !t.isEmpty();) {
var s = t.readUInt8();
o <<= 7, o |= 127 & s, 128 & s || (n.push(o), o = 0);
}
128 & s && n.push(o);
var a = n[0] / 40 | 0, h = n[0] % 40;
if (i = r ? n : [a, h].concat(n.slice(1)), e) {
var u = e[i.join(" ")];
void 0 === u && (u = e[i.join(".")]), void 0 !== u && (i = u);
}
return i;
}, h.prototype._decodeTime = function(t, e) {
var r = t.raw().toString();
if ("gentime" === e) var i = 0 | r.slice(0, 4), n = 0 | r.slice(4, 6), o = 0 | r.slice(6, 8), s = 0 | r.slice(8, 10), a = 0 | r.slice(10, 12), h = 0 | r.slice(12, 14);
else {
if ("utctime" !== e) return t.error("Decoding " + e + " time is not supported yet");
i = 0 | r.slice(0, 2), n = 0 | r.slice(2, 4), o = 0 | r.slice(4, 6), s = 0 | r.slice(6, 8), a = 0 | r.slice(8, 10), h = 0 | r.slice(10, 12);
i = i < 70 ? 2e3 + i : 1900 + i;
}
return Date.UTC(i, n - 1, o, s, a, h, 0);
}, h.prototype._decodeNull = function(t) {
return null;
}, h.prototype._decodeBool = function(t) {
var e = t.readUInt8();
return t.isError(e) ? e : 0 !== e;
}, h.prototype._decodeInt = function(t, e) {
var r = new o(t.raw());
return e && (r = e[r.toString(10)] || r), r;
}, h.prototype._use = function(t, e) {
return "function" == typeof t && (t = t(e)), t._getDecoder("der").tree;
};
})), require_pem$1 = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_dist().Buffer, n = require_der$1();
function o(t) {
n.call(this, t), this.enc = "pem";
}
r(o, n), e.exports = o, o.prototype.decode = function(t, e) {
for (var r = t.toString().split(/[\r\n]+/g), o = e.label.toUpperCase(), s = /^-----(BEGIN|END) ([^-]+)-----$/, a = -1, h = -1, u = 0; u < r.length; u++) {
var f = r[u].match(s);
if (null !== f && f[2] === o) {
if (-1 !== a) {
if ("END" !== f[1]) break;
h = u;
break;
}
if ("BEGIN" !== f[1]) break;
a = u;
}
}
if (-1 === a || -1 === h) throw new Error("PEM section not found for: " + o);
var l = r.slice(a + 1, h).join("");
l.replace(/[^a-z0-9\+\/=]+/gi, "");
var c = new i(l, "base64");
return n.prototype.decode.call(this, c, e);
};
})), require_decoders = __commonJSMin(((t) => {
var e = t;
e.der = require_der$1(), e.pem = require_pem$1();
})), require_der = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_dist().Buffer, n = require_asn1$1(), o = n.base, s = n.constants.der;
function a(t) {
this.enc = "der", this.name = t.name, this.entity = t, this.tree = new h(), this.tree._init(t.body);
}
function h(t) {
o.Node.call(this, "der", t);
}
function u(t) {
return t < 10 ? "0" + t : t;
}
e.exports = a, a.prototype.encode = function(t, e) {
return this.tree._encode(t, e).join();
}, r(h, o.Node), h.prototype._encodeComposite = function(t, e, r, n) {
var o, a = function(t, e, r, i) {
var n;
"seqof" === t ? t = "seq" : "setof" === t && (t = "set");
if (s.tagByName.hasOwnProperty(t)) n = s.tagByName[t];
else {
if ("number" != typeof t || (0 | t) !== t) return i.error("Unknown tag: " + t);
n = t;
}
if (n >= 31) return i.error("Multi-octet tag encoding unsupported");
e || (n |= 32);
return n |= s.tagClassByName[r || "universal"] << 6, n;
}(t, e, r, this.reporter);
if (n.length < 128) return (o = new i(2))[0] = a, o[1] = n.length, this._createEncoderBuffer([o, n]);
for (var h = 1, u = n.length; u >= 256; u >>= 8) h++;
(o = new i(2 + h))[0] = a, o[1] = 128 | h;
u = 1 + h;
for (var f = n.length; f > 0; u--, f >>= 8) o[u] = 255 & f;
return this._createEncoderBuffer([o, n]);
}, h.prototype._encodeStr = function(t, e) {
if ("bitstr" === e) return this._createEncoderBuffer([0 | t.unused, t.data]);
if ("bmpstr" === e) {
for (var r = new i(2 * t.length), n = 0; n < t.length; n++) r.writeUInt16BE(t.charCodeAt(n), 2 * n);
return this._createEncoderBuffer(r);
}
return "numstr" === e ? this._isNumstr(t) ? this._createEncoderBuffer(t) : this.reporter.error("Encoding of string type: numstr supports only digits and space") : "printstr" === e ? this._isPrintstr(t) ? this._createEncoderBuffer(t) : 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(e) || "objDesc" === e ? this._createEncoderBuffer(t) : this.reporter.error("Encoding of string type: " + e + " unsupported");
}, h.prototype._encodeObjid = function(t, e, r) {
if ("string" == typeof t) {
if (!e) return this.reporter.error("string objid given, but no values map found");
if (!e.hasOwnProperty(t)) return this.reporter.error("objid not found in values map");
t = e[t].split(/[\s\.]+/g);
for (var n = 0; n < t.length; n++) t[n] |= 0;
} else if (Array.isArray(t)) {
t = t.slice();
for (n = 0; n < t.length; n++) t[n] |= 0;
}
if (!Array.isArray(t)) return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(t));
if (!r) {
if (t[1] >= 40) return this.reporter.error("Second objid identifier OOB");
t.splice(0, 2, 40 * t[0] + t[1]);
}
var o = 0;
for (n = 0; n < t.length; n++) {
var s = t[n];
for (o++; s >= 128; s >>= 7) o++;
}
var a = new i(o), h = a.length - 1;
for (n = t.length - 1; n >= 0; n--) {
s = t[n];
for (a[h--] = 127 & s; (s >>= 7) > 0;) a[h--] = 128 | 127 & s;
}
return this._createEncoderBuffer(a);
}, h.prototype._encodeTime = function(t, e) {
var r, i = new Date(t);
return "gentime" === e ? r = [
u(i.getFullYear()),
u(i.getUTCMonth() + 1),
u(i.getUTCDate()),
u(i.getUTCHours()),
u(i.getUTCMinutes()),
u(i.getUTCSeconds()),
"Z"
].join("") : "utctime" === e ? r = [
u(i.getFullYear() % 100),
u(i.getUTCMonth() + 1),
u(i.getUTCDate()),
u(i.getUTCHours()),
u(i.getUTCMinutes()),
u(i.getUTCSeconds()),
"Z"
].join("") : this.reporter.error("Encoding " + e + " time is not supported yet"), this._encodeStr(r, "octstr");
}, h.prototype._encodeNull = function() {
return this._createEncoderBuffer("");
}, h.prototype._encodeInt = function(t, e) {
if ("string" == typeof t) {
if (!e) return this.reporter.error("String int or enum given, but no values map");
if (!e.hasOwnProperty(t)) return this.reporter.error("Values map doesn't contain: " + JSON.stringify(t));
t = e[t];
}
if ("number" != typeof t && !i.isBuffer(t)) {
var r = t.toArray();
!t.sign && 128 & r[0] && r.unshift(0), t = new i(r);
}
if (i.isBuffer(t)) {
var n = t.length;
0 === t.length && n++;
var o = new i(n);
return t.copy(o), 0 === t.length && (o[0] = 0), this._createEncoderBuffer(o);
}
if (t < 128) return this._createEncoderBuffer(t);
if (t < 256) return this._createEncoderBuffer([0, t]);
n = 1;
for (var s = t; s >= 256; s >>= 8) n++;
for (s = (o = new Array(n)).length - 1; s >= 0; s--) o[s] = 255 & t, t >>= 8;
return 128 & o[0] && o.unshift(0), this._createEncoderBuffer(new i(o));
}, h.prototype._encodeBool = function(t) {
return this._createEncoderBuffer(t ? 255 : 0);
}, h.prototype._use = function(t, e) {
return "function" == typeof t && (t = t(e)), t._getEncoder("der").tree;
}, h.prototype._skipDefault = function(t, e, r) {
var i, n = this._baseState;
if (null === n.default) return !1;
var o = t.join();
if (void 0 === n.defaultBuffer && (n.defaultBuffer = this._encodeValue(n.default, e, r).join()), o.length !== n.defaultBuffer.length) return !1;
for (i = 0; i < o.length; i++) if (o[i] !== n.defaultBuffer[i]) return !1;
return !0;
};
})), require_pem = __commonJSMin(((t, e) => {
var r = require_inherits_browser(), i = require_der();
function n(t) {
i.call(this, t), this.enc = "pem";
}
r(n, i), e.exports = n, n.prototype.encode = function(t, e) {
for (var r = i.prototype.encode.call(this, t).toString("base64"), n = ["-----BEGIN " + e.label + "-----"], o = 0; o < r.length; o += 64) n.push(r.slice(o, o + 64));
return n.push("-----END " + e.label + "-----"), n.join("\n");
};
})), require_encoders = __commonJSMin(((t) => {
var e = t;
e.der = require_der(), e.pem = require_pem();
})), require_asn1$1 = __commonJSMin(((t) => {
var e = t;
e.bignum = require_bn$2(), e.define = require_api().define, e.base = require_base(), e.constants = require_constants(), e.decoders = require_decoders(), e.encoders = require_encoders();
})), require_certificate = __commonJSMin(((t, e) => {
var r = require_asn1$1(), i = r.define("Time", (function() {
this.choice({
utcTime: this.utctime(),
generalTime: this.gentime()
});
})), n = r.define("AttributeTypeValue", (function() {
this.seq().obj(this.key("type").objid(), this.key("value").any());
})), o = r.define("AlgorithmIdentifier", (function() {
this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional());
})), s = r.define("SubjectPublicKeyInfo", (function() {
this.seq().obj(this.key("algorithm").use(o), this.key("subjectPublicKey").bitstr());
})), a = r.define("RelativeDistinguishedName", (function() {
this.setof(n);
})), h = r.define("RDNSequence", (function() {
this.seqof(a);
})), u = r.define("Name", (function() {
this.choice({ rdnSequence: this.use(h) });
})), f = r.define("Validity", (function() {
this.seq().obj(this.key("notBefore").use(i), this.key("notAfter").use(i));
})), l = r.define("Extension", (function() {
this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(!1), this.key("extnValue").octstr());
})), c = r.define("TBSCertificate", (function() {
this.seq().obj(this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(o), this.key("issuer").use(u), this.key("validity").use(f), this.key("subject").use(u), this.key("subjectPublicKeyInfo").use(s), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(l).optional());
}));
e.exports = r.define("X509Certificate", (function() {
this.seq().obj(this.key("tbsCertificate").use(c), this.key("signatureAlgorithm").use(o), this.key("signatureValue").bitstr());
}));
})), require_asn1 = __commonJSMin(((t) => {
var e = require_asn1$1();
t.certificate = require_certificate();
t.RSAPrivateKey = e.define("RSAPrivateKey", (function() {
this.seq().obj(this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int());
}));
t.RSAPublicKey = e.define("RSAPublicKey", (function() {
this.seq().obj(this.key("modulus").int(), this.key("publicExponent").int());
}));
var n = e.define("AlgorithmIdentifier", (function() {
this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p").int(), this.key("q").int(), this.key("g").int()).optional());
}));
t.PublicKey = e.define("SubjectPublicKeyInfo", (function() {
this.seq().obj(this.key("algorithm").use(n), this.key("subjectPublicKey").bitstr());
}));
t.PrivateKey = e.define("PrivateKeyInfo", (function() {
this.seq().obj(this.key("version").int(), this.key("algorithm").use(n), this.key("subjectPrivateKey").octstr());
}));
t.EncryptedPrivateKey = e.define("EncryptedPrivateKeyInfo", (function() {
this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters").int())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr());
}));
t.DSAPrivateKey = e.define("DSAPrivateKey", (function() {
this.seq().obj(this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int());
})), t.DSAparam = e.define("DSAparam", (function() {
this.int();
}));
var u = e.define("ECParameters", (function() {
this.choice({ namedCurve: this.objid() });
}));
t.ECPrivateKey = e.define("ECPrivateKey", (function() {
this.seq().obj(this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(u), this.key("publicKey").optional().explicit(1).bitstr());
})), t.signature = e.define("signature", (function() {
this.seq().obj(this.key("r").int(), this.key("s").int());
}));
})), aesid_exports = __exportAll({ default: () => aesid_default }), aesid_default, init_aesid = __esmMin((() => {
aesid_default = {
"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
"2.16.840.1.101.3.4.1.2": "aes-128-cbc",
"2.16.840.1.101.3.4.1.3": "aes-128-ofb",
"2.16.840.1.101.3.4.1.4": "aes-128-cfb",
"2.16.840.1.101.3.4.1.21": "aes-192-ecb",
"2.16.840.1.101.3.4.1.22": "aes-192-cbc",
"2.16.840.1.101.3.4.1.23": "aes-192-ofb",
"2.16.840.1.101.3.4.1.24": "aes-192-cfb",
"2.16.840.1.101.3.4.1.41": "aes-256-ecb",
"2.16.840.1.101.3.4.1.42": "aes-256-cbc",
"2.16.840.1.101.3.4.1.43": "aes-256-ofb",
"2.16.840.1.101.3.4.1.44": "aes-256-cfb"
};
})), require_safe_buffer = __commonJSMin(((t, e) => {
var r = require_dist(), i = r.Buffer;
function n(t, e) {
for (var r in t) e[r] = t[r];
}
function o(t, e, r) {
return i(t, e, r);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? e.exports = r : (n(r, t), t.Buffer = o), o.prototype = Object.create(i.prototype), n(i, o), o.from = function(t, e, r) {
if ("number" == typeof t) throw new TypeError("Argument must not be a number");
return i(t, e, r);
}, o.alloc = function(t, e, r) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
var n = i(t);
return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0), n;
}, o.allocUnsafe = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return i(t);
}, o.allocUnsafeSlow = function(t) {
if ("number" != typeof t) throw new TypeError("Argument must be a number");
return r.SlowBuffer(t);
};
})), require_fixProc = __commonJSMin(((t, e) => {
var r = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, i = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, n = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, o = require_evp_bytestokey(), s = require_browser$7(), a = require_safe_buffer().Buffer;
e.exports = function(t, e) {
var h, u = t.toString(), f = u.match(r);
if (f) {
var l = "aes" + f[1], c = a.from(f[2], "hex"), d = a.from(f[3].replace(/[\r\n]/g, ""), "base64"), p = o(e, c.slice(0, 8), parseInt(f[1], 10)).key, m = [], g = s.createDecipheriv(l, p, c);
m.push(g.update(d)), m.push(g.final()), h = a.concat(m);
} else {
var y = u.match(n);
h = a.from(y[2].replace(/[\r\n]/g, ""), "base64");
}
return {
tag: u.match(i)[1],
data: h
};
};
})), require_parse_asn1 = __commonJSMin(((t, e) => {
var r = require_asn1(), i = (init_aesid(), __toCommonJS(aesid_exports).default), n = require_fixProc(), o = require_browser$7(), s = require_browser$8(), a = require_safe_buffer().Buffer;
function h(t) {
var e;
"object" != typeof t || a.isBuffer(t) || (e = t.passphrase, t = t.key), "string" == typeof t && (t = a.from(t));
var h, u, f = n(t, e), l = f.tag, c = f.data;
switch (l) {
case "CERTIFICATE": u = r.certificate.decode(c, "der").tbsCertificate.subjectPublicKeyInfo;
case "PUBLIC KEY": switch (u || (u = r.PublicKey.decode(c, "der")), h = u.algorithm.algorithm.join(".")) {
case "1.2.840.113549.1.1.1": return r.RSAPublicKey.decode(u.subjectPublicKey.data, "der");
case "1.2.840.10045.2.1": return u.subjectPrivateKey = u.subjectPublicKey, {
type: "ec",
data: u
};
case "1.2.840.10040.4.1": return u.algorithm.params.pub_key = r.DSAparam.decode(u.subjectPublicKey.data, "der"), {
type: "dsa",
data: u.algorithm.params
};
default: throw new Error("unknown key id " + h);
}
case "ENCRYPTED PRIVATE KEY": c = function(t, e) {
var r = t.algorithm.decrypt.kde.kdeparams.salt, n = parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), h = i[t.algorithm.decrypt.cipher.algo.join(".")], u = t.algorithm.decrypt.cipher.iv, f = t.subjectPrivateKey, l = parseInt(h.split("-")[1], 10) / 8, c = s.pbkdf2Sync(e, r, n, l, "sha1"), d = o.createDecipheriv(h, c, u), p = [];
return p.push(d.update(f)), p.push(d.final()), a.concat(p);
}(c = r.EncryptedPrivateKey.decode(c, "der"), e);
case "PRIVATE KEY": switch (h = (u = r.PrivateKey.decode(c, "der")).algorithm.algorithm.join(".")) {
case "1.2.840.113549.1.1.1": return r.RSAPrivateKey.decode(u.subjectPrivateKey, "der");
case "1.2.840.10045.2.1": return {
curve: u.algorithm.curve,
privateKey: r.ECPrivateKey.decode(u.subjectPrivateKey, "der").privateKey
};
case "1.2.840.10040.4.1": return u.algorithm.params.priv_key = r.DSAparam.decode(u.subjectPrivateKey, "der"), {
type: "dsa",
params: u.algorithm.params
};
default: throw new Error("unknown key id " + h);
}
case "RSA PUBLIC KEY": return r.RSAPublicKey.decode(c, "der");
case "RSA PRIVATE KEY": return r.RSAPrivateKey.decode(c, "der");
case "DSA PRIVATE KEY": return {
type: "dsa",
params: r.DSAPrivateKey.decode(c, "der")
};
case "EC PRIVATE KEY": return {
curve: (c = r.ECPrivateKey.decode(c, "der")).parameters.value,
privateKey: c.privateKey
};
default: throw new Error("unknown key type " + l);
}
}
h.signature = r.signature, e.exports = h;
})), curves_exports = __exportAll({ default: () => curves_default }), curves_default, init_curves = __esmMin((() => {
curves_default = {
"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"
};
})), require_sign = __commonJSMin(((t, e) => {
var r = require_safe_buffer$3().Buffer, i = require_browser$9(), n = require_browserify_rsa(), o = require_elliptic().ec, s = require_bn$4(), a = require_parse_asn1(), h = (init_curves(), __toCommonJS(curves_exports).default);
function u(t, e, n, o) {
if ((t = r.from(t.toArray())).length < e.byteLength()) {
var s = r.alloc(e.byteLength() - t.length);
t = r.concat([s, t]);
}
var a = n.length, h = function(t, e) {
t = f(t, e), t = t.mod(e);
var i = r.from(t.toArray());
if (i.length < e.byteLength()) {
var n = r.alloc(e.byteLength() - i.length);
i = r.concat([n, i]);
}
return i;
}(n, e), u = r.alloc(a);
u.fill(1);
var l = r.alloc(a);
return l = i(o, l).update(u).update(r.from([0])).update(t).update(h).digest(), u = i(o, l).update(u).digest(), {
k: l = i(o, l).update(u).update(r.from([1])).update(t).update(h).digest(),
v: u = i(o, l).update(u).digest()
};
}
function f(t, e) {
var r = new s(t), i = (t.length << 3) - e.bitLength();
return i > 0 && r.ishrn(i), r;
}
function l(t, e, n) {
var o, s;
do {
for (o = r.alloc(0); 8 * o.length < t.bitLength();) e.v = i(n, e.k).update(e.v).digest(), o = r.concat([o, e.v]);
s = f(o, t), e.k = i(n, e.k).update(e.v).update(r.from([0])).digest(), e.v = i(n, e.k).update(e.v).digest();
} while (-1 !== s.cmp(t));
return s;
}
function c(t, e, r, i) {
return t.toRed(s.mont(r)).redPow(e).fromRed().mod(i);
}
e.exports = function(t, e, i, d, p) {
var m = a(e);
if (m.curve) {
if ("ecdsa" !== d && "ecdsa/rsa" !== d) throw new Error("wrong private key type");
return function(t, e) {
var i = h[e.curve.join(".")];
if (!i) throw new Error("unknown curve " + e.curve.join("."));
var n = new o(i).keyFromPrivate(e.privateKey).sign(t);
return r.from(n.toDER());
}(t, m);
}
if ("dsa" === m.type) {
if ("dsa" !== d) throw new Error("wrong private key type");
return function(t, e, i) {
var n, o = e.params.priv_key, a = e.params.p, h = e.params.q, d = e.params.g, p = new s(0), m = f(t, h).mod(h), g = !1, y = u(o, h, t, i);
for (; !1 === g;) p = c(d, n = l(h, y, i), a, h), 0 === (g = n.invm(h).imul(m.add(o.mul(p))).mod(h)).cmpn(0) && (g = !1, p = new s(0));
return function(t, e) {
t = t.toArray(), e = e.toArray(), 128 & t[0] && (t = [0].concat(t));
128 & e[0] && (e = [0].concat(e));
var i = [
48,
t.length + e.length + 4,
2,
t.length
];
return i = i.concat(t, [2, e.length], e), r.from(i);
}(p, g);
}(t, m, i);
}
if ("rsa" !== d && "ecdsa/rsa" !== d) throw new Error("wrong private key type");
if (void 0 !== e.padding && 1 !== e.padding) throw new Error("illegal or unsupported padding mode");
t = r.concat([p, t]);
for (var g = m.modulus.byteLength(), y = [0, 1]; t.length + y.length + 1 < g;) y.push(255);
y.push(0);
for (var b = -1; ++b < t.length;) y.push(t[b]);
return n(y, m);
}, e.exports.getKey = u, e.exports.makeKey = l;
})), require_verify = __commonJSMin(((t, e) => {
var r = require_safe_buffer$3().Buffer, i = require_bn$4(), n = require_elliptic().ec, o = require_parse_asn1(), s = (init_curves(), __toCommonJS(curves_exports).default);
function a(t, e) {
if (t.cmpn(0) <= 0) throw new Error("invalid sig");
if (t.cmp(e) >= 0) throw new Error("invalid sig");
}
e.exports = function(t, e, h, u, f) {
var l = o(h);
if ("ec" === l.type) {
if ("ecdsa" !== u && "ecdsa/rsa" !== u) throw new Error("wrong public key type");
return function(t, e, r) {
var i = s[r.data.algorithm.curve.join(".")];
if (!i) throw new Error("unknown curve " + r.data.algorithm.curve.join("."));
var o = new n(i), a = r.data.subjectPrivateKey.data;
return o.verify(e, t, a);
}(t, e, l);
}
if ("dsa" === l.type) {
if ("dsa" !== u) throw new Error("wrong public key type");
return function(t, e, r) {
var n = r.data.p, s = r.data.q, h = r.data.g, u = r.data.pub_key, f = o.signature.decode(t, "der"), l = f.s, c = f.r;
a(l, s), a(c, s);
var d = i.mont(n), p = l.invm(s);
return 0 === h.toRed(d).redPow(new i(e).mul(p).mod(s)).fromRed().mul(u.toRed(d).redPow(c.mul(p).mod(s)).fromRed()).mod(n).mod(s).cmp(c);
}(t, e, l);
}
if ("rsa" !== u && "ecdsa/rsa" !== u) throw new Error("wrong public key type");
e = r.concat([f, e]);
for (var c = l.modulus.byteLength(), d = [1], p = 0; e.length + d.length + 2 < c;) d.push(255), p += 1;
d.push(0);
for (var m = -1; ++m < e.length;) d.push(e[m]);
d = r.from(d);
var g = i.mont(l.modulus);
t = (t = new i(t).toRed(g)).redPow(new i(l.publicExponent)), t = r.from(t.fromRed().toArray());
var y = p < 8 ? 1 : 0;
for (c = Math.min(t.length, d.length), t.length !== d.length && (y = 1), m = -1; ++m < c;) y |= t[m] ^ d[m];
return 0 === y;
};
})), require_browser$4 = __commonJSMin(((t, e) => {
var r = require_safe_buffer$3().Buffer, i = require_browser$10(), n = require_readable_browser(), o = require_inherits_browser(), s = require_sign(), a = require_verify(), h = (init_algorithms(), __toCommonJS(algorithms_exports).default);
function u(t) {
n.Writable.call(this);
var e = h[t];
if (!e) throw new Error("Unknown message digest");
this._hashType = e.hash, this._hash = i(e.hash), this._tag = e.id, this._signType = e.sign;
}
function f(t) {
n.Writable.call(this);
var e = h[t];
if (!e) throw new Error("Unknown message digest");
this._hash = i(e.hash), this._tag = e.id, this._signType = e.sign;
}
function l(t) {
return new u(t);
}
function c(t) {
return new f(t);
}
Object.keys(h).forEach((function(t) {
h[t].id = r.from(h[t].id, "hex"), h[t.toLowerCase()] = h[t];
})), o(u, n.Writable), u.prototype._write = function(t, e, r) {
this._hash.update(t), r();
}, u.prototype.update = function(t, e) {
return this._hash.update("string" == typeof t ? r.from(t, e) : t), this;
}, u.prototype.sign = function(t, e) {
this.end();
var r = s(this._hash.digest(), t, this._hashType, this._signType, this._tag);
return e ? r.toString(e) : r;
}, o(f, n.Writable), f.prototype._write = function(t, e, r) {
this._hash.update(t), r();
}, f.prototype.update = function(t, e) {
return this._hash.update("string" == typeof t ? r.from(t, e) : t), this;
}, f.prototype.verify = function(t, e, i) {
var n = "string" == typeof e ? r.from(e, i) : e;
return this.end(), a(n, this._hash.digest(), t, this._signType, this._tag);
}, e.exports = {
Sign: l,
Verify: c,
createSign: l,
createVerify: c
};
})), require_bn$1 = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var r = t.charCodeAt(e);
return r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : r - 48 & 15;
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, r, i) {
for (var n = 0, o = Math.min(t.length, r), s = e; s < o; s++) {
var a = t.charCodeAt(s) - 48;
n *= i, n += a >= 49 ? a - 49 + 10 : a >= 17 ? a - 17 + 10 : a;
}
return n;
}
n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this.strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this.strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this.strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, n.prototype.inspect = function() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
};
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"
], f = [
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
], l = [
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 c(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r.strip();
}
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? u[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var c = f[t], d = l[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modn(d).toString(t);
i = (p = p.idivn(d)).isZero() ? m + i : u[c - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16);
}, n.prototype.toBuffer = function(t, e) {
return r(void 0 !== o), this.toArrayLike(o, t, e);
}, n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
}, n.prototype.toArrayLike = function(t, e, i) {
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0"), this.strip();
var s, a, h = "le" === e, u = new t(o), f = this.clone();
if (h) {
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[a] = s;
for (; a < o; a++) u[a] = 0;
} else {
for (a = 0; a < o - n; a++) u[a] = 0;
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[o - a - 1] = s;
}
return u;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this.strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this.strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this.strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this.strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this.strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this.strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var d = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function p(t, e, r) {
return new m().mulp(t, e, r);
}
function m(t, e) {
this.x = t, this.y = e;
}
Math.imul || (d = c), n.prototype.mulTo = function(t, e) {
var r, i = this.length + t.length;
return r = 10 === this.length && 10 === t.length ? d(this, t, e) : i < 63 ? c(this, t, e) : i < 1024 ? function(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r.strip();
}(this, t, e) : p(this, t, e), r;
}, m.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, m.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, m.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, m.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, m.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, m.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, m.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, m.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, m.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, m.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r.strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), p(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
r("number" == typeof t), r(t < 67108864);
for (var e = 0, i = 0; i < this.length; i++) {
var n = (0 | this.words[i]) * t, o = (67108863 & n) + (67108863 & e);
e >>= 26, e += n / 67108864 | 0, e += o >>> 26, this.words[i] = 67108863 & o;
}
return 0 !== e && (this.words[i] = e, this.length++), this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = (t.words[i] & 1 << n) >>> n;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this.strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this.strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this.strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this.strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this.strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a.strip(), i.strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modn = function(t) {
r(t <= 67108863);
for (var e = (1 << 26) % t, i = 0, n = this.length - 1; n >= 0; n--) i = (e * i + (0 | this.words[n])) % t;
return i;
}, n.prototype.idivn = function(t) {
r(t <= 67108863);
for (var e = 0, i = this.length - 1; i >= 0; i--) {
var n = (0 | this.words[i]) + 67108864 * e;
this.words[i] = n / t | 0, e = n % t;
}
return this.strip();
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this.strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new M(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var g = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function y(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function b() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function v() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function w() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function M(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function S(t) {
M.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, y.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, y.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, y.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(b, y), b.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, b.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(v, y), i(_, y), i(w, y), w.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (g[t]) return g[t];
var e;
if ("k256" === t) e = new b();
else if ("p224" === t) e = new v();
else if ("p192" === t) e = new _();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new w();
}
return g[t] = e, e;
}, M.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, M.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, M.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : t.umod(this.m)._forceRed(this);
}, M.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, M.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, M.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, M.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, M.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, M.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, M.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, M.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, M.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, M.prototype.sqr = function(t) {
return this.mul(t, t);
}, M.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, M.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, M.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, M.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, M.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new S(t);
}, i(S, M), S.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, S.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, S.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, S.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, S.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_browser$3 = __commonJSMin(((t, e) => {
init_dist$1();
var r = require_elliptic(), i = require_bn$1();
e.exports = function(t) {
return new o(t);
};
var n = {
secp256k1: {
name: "secp256k1",
byteLength: 32
},
secp224r1: {
name: "p224",
byteLength: 28
},
prime256v1: {
name: "p256",
byteLength: 32
},
prime192v1: {
name: "p192",
byteLength: 24
},
ed25519: {
name: "ed25519",
byteLength: 32
},
secp384r1: {
name: "p384",
byteLength: 48
},
secp521r1: {
name: "p521",
byteLength: 66
}
};
function o(t) {
this.curveType = n[t], this.curveType || (this.curveType = { name: t }), this.curve = new r.ec(this.curveType.name), this.keys = void 0;
}
function s(t, e, r) {
Array.isArray(t) || (t = t.toArray());
var i = new Buffer$1(t);
if (r && i.length < r) {
var n = new Buffer$1(r - i.length);
n.fill(0), i = Buffer$1.concat([n, i]);
}
return e ? i.toString(e) : i;
}
n.p224 = n.secp224r1, n.p256 = n.secp256r1 = n.prime256v1, n.p192 = n.secp192r1 = n.prime192v1, n.p384 = n.secp384r1, n.p521 = n.secp521r1, o.prototype.generateKeys = function(t, e) {
return this.keys = this.curve.genKeyPair(), this.getPublicKey(t, e);
}, o.prototype.computeSecret = function(t, e, r) {
return e = e || "utf8", Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e)), s(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(), r, this.curveType.byteLength);
}, o.prototype.getPublicKey = function(t, e) {
var r = this.keys.getPublic("compressed" === e, !0);
return "hybrid" === e && (r[r.length - 1] % 2 ? r[0] = 7 : r[0] = 6), s(r, t);
}, o.prototype.getPrivateKey = function(t) {
return s(this.keys.getPrivate(), t);
}, o.prototype.setPublicKey = function(t, e) {
return e = e || "utf8", Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e)), this.keys._importPublic(t), this;
}, o.prototype.setPrivateKey = function(t, e) {
e = e || "utf8", Buffer$1.isBuffer(t) || (t = new Buffer$1(t, e));
var r = new i(t);
return r = r.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(r), this;
};
})), require_mgf = __commonJSMin(((t, e) => {
var r = require_browser$10(), i = require_safe_buffer$9().Buffer;
function n(t) {
var e = i.allocUnsafe(4);
return e.writeUInt32BE(t, 0), e;
}
e.exports = function(t, e) {
for (var o, s = i.alloc(0), a = 0; s.length < e;) o = n(a++), s = i.concat([s, r("sha1").update(t).update(o).digest()]);
return s.slice(0, e);
};
})), require_xor = __commonJSMin(((t, e) => {
e.exports = function(t, e) {
for (var r = t.length, i = -1; ++i < r;) t[i] ^= e[i];
return t;
};
})), require_bn = __commonJSMin(((t, e) => {
(function(t, e) {
"use strict";
function r(t, e) {
if (!t) throw new Error(e || "Assertion failed");
}
function i(t, e) {
t.super_ = e;
var r = function() {};
r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;
}
function n(t, e, r) {
if (n.isBN(t)) return t;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== t && ("le" !== e && "be" !== e || (r = e, e = 10), this._init(t || 0, e || 10, r || "be"));
}
var o;
"object" == typeof t ? t.exports = n : e.BN = n, n.BN = n, n.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : require_dist().Buffer;
} catch (t) {}
function s(t, e) {
var r = t.charCodeAt(e);
return r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : r - 48 & 15;
}
function a(t, e, r) {
var i = s(t, r);
return r - 1 >= e && (i |= s(t, r - 1) << 4), i;
}
function h(t, e, r, i) {
for (var n = 0, o = Math.min(t.length, r), s = e; s < o; s++) {
var a = t.charCodeAt(s) - 48;
n *= i, n += a >= 49 ? a - 49 + 10 : a >= 17 ? a - 17 + 10 : a;
}
return n;
}
n.isBN = function(t) {
return t instanceof n || null !== t && "object" == typeof t && t.constructor.wordSize === n.wordSize && Array.isArray(t.words);
}, n.max = function(t, e) {
return t.cmp(e) > 0 ? t : e;
}, n.min = function(t, e) {
return t.cmp(e) < 0 ? t : e;
}, n.prototype._init = function(t, e, i) {
if ("number" == typeof t) return this._initNumber(t, e, i);
if ("object" == typeof t) return this._initArray(t, e, i);
"hex" === e && (e = 16), r(e === (0 | e) && e >= 2 && e <= 36);
var n = 0;
"-" === (t = t.toString().replace(/\s+/g, ""))[0] && (n++, this.negative = 1), n < t.length && (16 === e ? this._parseHex(t, n, i) : (this._parseBase(t, e, n), "le" === i && this._initArray(this.toArray(), e, i)));
}, n.prototype._initNumber = function(t, e, i) {
t < 0 && (this.negative = 1, t = -t), t < 67108864 ? (this.words = [67108863 & t], this.length = 1) : t < 4503599627370496 ? (this.words = [67108863 & t, t / 67108864 & 67108863], this.length = 2) : (r(t < 9007199254740992), this.words = [
67108863 & t,
t / 67108864 & 67108863,
1
], this.length = 3), "le" === i && this._initArray(this.toArray(), e, i);
}, n.prototype._initArray = function(t, e, i) {
if (r("number" == typeof t.length), t.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(t.length / 3), this.words = new Array(this.length);
for (var n = 0; n < this.length; n++) this.words[n] = 0;
var o, s, a = 0;
if ("be" === i) for (n = t.length - 1, o = 0; n >= 0; n -= 3) s = t[n] | t[n - 1] << 8 | t[n - 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
else if ("le" === i) for (n = 0, o = 0; n < t.length; n += 3) s = t[n] | t[n + 1] << 8 | t[n + 2] << 16, this.words[o] |= s << a & 67108863, this.words[o + 1] = s >>> 26 - a & 67108863, (a += 24) >= 26 && (a -= 26, o++);
return this.strip();
}, n.prototype._parseHex = function(t, e, r) {
this.length = Math.ceil((t.length - e) / 6), this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) this.words[i] = 0;
var n, o = 0, s = 0;
if ("be" === r) for (i = t.length - 1; i >= e; i -= 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
else for (i = (t.length - e) % 2 == 0 ? e + 1 : e; i < t.length; i += 2) n = a(t, e, i) << o, this.words[s] |= 67108863 & n, o >= 18 ? (o -= 18, s += 1, this.words[s] |= n >>> 26) : o += 8;
this.strip();
}, n.prototype._parseBase = function(t, e, r) {
this.words = [0], this.length = 1;
for (var i = 0, n = 1; n <= 67108863; n *= e) i++;
i--, n = n / e | 0;
for (var o = t.length - r, s = o % i, a = Math.min(o, o - s) + r, u = 0, f = r; f < a; f += i) u = h(t, f, f + i, e), this.imuln(n), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
if (0 !== s) {
var l = 1;
for (u = h(t, f, t.length, e), f = 0; f < s; f++) l *= e;
this.imuln(l), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
}
this.strip();
}, n.prototype.copy = function(t) {
t.words = new Array(this.length);
for (var e = 0; e < this.length; e++) t.words[e] = this.words[e];
t.length = this.length, t.negative = this.negative, t.red = this.red;
}, n.prototype.clone = function() {
var t = new n(null);
return this.copy(t), t;
}, n.prototype._expand = function(t) {
for (; this.length < t;) this.words[this.length++] = 0;
return this;
}, n.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1];) this.length--;
return this._normSign();
}, n.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, n.prototype.inspect = function() {
return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
};
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"
], f = [
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
], l = [
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 c(t, e, r) {
r.negative = e.negative ^ t.negative;
var i = t.length + e.length | 0;
r.length = i, i = i - 1 | 0;
var n = 0 | t.words[0], o = 0 | e.words[0], s = n * o, a = 67108863 & s, h = s / 67108864 | 0;
r.words[0] = a;
for (var u = 1; u < i; u++) {
for (var f = h >>> 26, l = 67108863 & h, c = Math.min(u, e.length - 1), d = Math.max(0, u - t.length + 1); d <= c; d++) {
var p = u - d | 0;
f += (s = (n = 0 | t.words[p]) * (o = 0 | e.words[d]) + l) / 67108864 | 0, l = 67108863 & s;
}
r.words[u] = 0 | l, h = 0 | f;
}
return 0 !== h ? r.words[u] = 0 | h : r.length--, r.strip();
}
n.prototype.toString = function(t, e) {
var i;
if (e = 0 | e || 1, 16 === (t = t || 10) || "hex" === t) {
i = "";
for (var n = 0, o = 0, s = 0; s < this.length; s++) {
var a = this.words[s], h = (16777215 & (a << n | o)).toString(16);
o = a >>> 24 - n & 16777215, (n += 2) >= 26 && (n -= 26, s--), i = 0 !== o || s !== this.length - 1 ? u[6 - h.length] + h + i : h + i;
}
for (0 !== o && (i = o.toString(16) + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
if (t === (0 | t) && t >= 2 && t <= 36) {
var c = f[t], d = l[t];
i = "";
var p = this.clone();
for (p.negative = 0; !p.isZero();) {
var m = p.modn(d).toString(t);
i = (p = p.idivn(d)).isZero() ? m + i : u[c - m.length] + m + i;
}
for (this.isZero() && (i = "0" + i); i.length % e != 0;) i = "0" + i;
return 0 !== this.negative && (i = "-" + i), i;
}
r(!1, "Base should be between 2 and 36");
}, n.prototype.toNumber = function() {
var t = this.words[0];
return 2 === this.length ? t += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? t += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -t : t;
}, n.prototype.toJSON = function() {
return this.toString(16);
}, n.prototype.toBuffer = function(t, e) {
return r(void 0 !== o), this.toArrayLike(o, t, e);
}, n.prototype.toArray = function(t, e) {
return this.toArrayLike(Array, t, e);
}, n.prototype.toArrayLike = function(t, e, i) {
var n = this.byteLength(), o = i || Math.max(1, n);
r(n <= o, "byte array longer than desired length"), r(o > 0, "Requested array length <= 0"), this.strip();
var s, a, h = "le" === e, u = new t(o), f = this.clone();
if (h) {
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[a] = s;
for (; a < o; a++) u[a] = 0;
} else {
for (a = 0; a < o - n; a++) u[a] = 0;
for (a = 0; !f.isZero(); a++) s = f.andln(255), f.iushrn(8), u[o - a - 1] = s;
}
return u;
}, Math.clz32 ? n.prototype._countBits = function(t) {
return 32 - Math.clz32(t);
} : n.prototype._countBits = function(t) {
var e = t, r = 0;
return e >= 4096 && (r += 13, e >>>= 13), e >= 64 && (r += 7, e >>>= 7), e >= 8 && (r += 4, e >>>= 4), e >= 2 && (r += 2, e >>>= 2), r + e;
}, n.prototype._zeroBits = function(t) {
if (0 === t) return 26;
var e = t, r = 0;
return 8191 & e || (r += 13, e >>>= 13), 127 & e || (r += 7, e >>>= 7), 15 & e || (r += 4, e >>>= 4), 3 & e || (r += 2, e >>>= 2), 1 & e || r++, r;
}, n.prototype.bitLength = function() {
var t = this.words[this.length - 1], e = this._countBits(t);
return 26 * (this.length - 1) + e;
}, n.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var t = 0, e = 0; e < this.length; e++) {
var r = this._zeroBits(this.words[e]);
if (t += r, 26 !== r) break;
}
return t;
}, n.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, n.prototype.toTwos = function(t) {
return 0 !== this.negative ? this.abs().inotn(t).iaddn(1) : this.clone();
}, n.prototype.fromTwos = function(t) {
return this.testn(t - 1) ? this.notn(t).iaddn(1).ineg() : this.clone();
}, n.prototype.isNeg = function() {
return 0 !== this.negative;
}, n.prototype.neg = function() {
return this.clone().ineg();
}, n.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, n.prototype.iuor = function(t) {
for (; this.length < t.length;) this.words[this.length++] = 0;
for (var e = 0; e < t.length; e++) this.words[e] = this.words[e] | t.words[e];
return this.strip();
}, n.prototype.ior = function(t) {
return r(!(this.negative | t.negative)), this.iuor(t);
}, n.prototype.or = function(t) {
return this.length > t.length ? this.clone().ior(t) : t.clone().ior(this);
}, n.prototype.uor = function(t) {
return this.length > t.length ? this.clone().iuor(t) : t.clone().iuor(this);
}, n.prototype.iuand = function(t) {
var e = this.length > t.length ? t : this;
for (var r = 0; r < e.length; r++) this.words[r] = this.words[r] & t.words[r];
return this.length = e.length, this.strip();
}, n.prototype.iand = function(t) {
return r(!(this.negative | t.negative)), this.iuand(t);
}, n.prototype.and = function(t) {
return this.length > t.length ? this.clone().iand(t) : t.clone().iand(this);
}, n.prototype.uand = function(t) {
return this.length > t.length ? this.clone().iuand(t) : t.clone().iuand(this);
}, n.prototype.iuxor = function(t) {
var e, r;
this.length > t.length ? (e = this, r = t) : (e = t, r = this);
for (var i = 0; i < r.length; i++) this.words[i] = e.words[i] ^ r.words[i];
if (this !== e) for (; i < e.length; i++) this.words[i] = e.words[i];
return this.length = e.length, this.strip();
}, n.prototype.ixor = function(t) {
return r(!(this.negative | t.negative)), this.iuxor(t);
}, n.prototype.xor = function(t) {
return this.length > t.length ? this.clone().ixor(t) : t.clone().ixor(this);
}, n.prototype.uxor = function(t) {
return this.length > t.length ? this.clone().iuxor(t) : t.clone().iuxor(this);
}, n.prototype.inotn = function(t) {
r("number" == typeof t && t >= 0);
var e = 0 | Math.ceil(t / 26), i = t % 26;
this._expand(e), i > 0 && e--;
for (var n = 0; n < e; n++) this.words[n] = 67108863 & ~this.words[n];
return i > 0 && (this.words[n] = ~this.words[n] & 67108863 >> 26 - i), this.strip();
}, n.prototype.notn = function(t) {
return this.clone().inotn(t);
}, n.prototype.setn = function(t, e) {
r("number" == typeof t && t >= 0);
var i = t / 26 | 0, n = t % 26;
return this._expand(i + 1), this.words[i] = e ? this.words[i] | 1 << n : this.words[i] & ~(1 << n), this.strip();
}, n.prototype.iadd = function(t) {
var e, r, i;
if (0 !== this.negative && 0 === t.negative) return this.negative = 0, e = this.isub(t), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== t.negative) return t.negative = 0, e = this.isub(t), t.negative = 1, e._normSign();
this.length > t.length ? (r = this, i = t) : (r = t, i = this);
for (var n = 0, o = 0; o < i.length; o++) e = (0 | r.words[o]) + (0 | i.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
for (; 0 !== n && o < r.length; o++) e = (0 | r.words[o]) + n, this.words[o] = 67108863 & e, n = e >>> 26;
if (this.length = r.length, 0 !== n) this.words[this.length] = n, this.length++;
else if (r !== this) for (; o < r.length; o++) this.words[o] = r.words[o];
return this;
}, n.prototype.add = function(t) {
var e;
return 0 !== t.negative && 0 === this.negative ? (t.negative = 0, e = this.sub(t), t.negative ^= 1, e) : 0 === t.negative && 0 !== this.negative ? (this.negative = 0, e = t.sub(this), this.negative = 1, e) : this.length > t.length ? this.clone().iadd(t) : t.clone().iadd(this);
}, n.prototype.isub = function(t) {
if (0 !== t.negative) {
t.negative = 0;
var e = this.iadd(t);
return t.negative = 1, e._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(t), this.negative = 1, this._normSign();
var r, i, n = this.cmp(t);
if (0 === n) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
n > 0 ? (r = this, i = t) : (r = t, i = this);
for (var o = 0, s = 0; s < i.length; s++) o = (e = (0 | r.words[s]) - (0 | i.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
for (; 0 !== o && s < r.length; s++) o = (e = (0 | r.words[s]) + o) >> 26, this.words[s] = 67108863 & e;
if (0 === o && s < r.length && r !== this) for (; s < r.length; s++) this.words[s] = r.words[s];
return this.length = Math.max(this.length, s), r !== this && (this.negative = 1), this.strip();
}, n.prototype.sub = function(t) {
return this.clone().isub(t);
};
var d = function(t, e, r) {
var i, n, o, s = t.words, a = e.words, h = r.words, u = 0, f = 0 | s[0], l = 8191 & f, c = f >>> 13, d = 0 | s[1], p = 8191 & d, m = d >>> 13, g = 0 | s[2], y = 8191 & g, b = g >>> 13, v = 0 | s[3], _ = 8191 & v, w = v >>> 13, M = 0 | s[4], S = 8191 & M, E = M >>> 13, A = 0 | s[5], C = 8191 & A, O = A >>> 13, P = 0 | s[6], I = 8191 & P, k = P >>> 13, R = 0 | s[7], q = 8191 & R, T = R >>> 13, x = 0 | s[8], N = 8191 & x, B = x >>> 13, j = 0 | s[9], L = 8191 & j, D = j >>> 13, U = 0 | a[0], $ = 8191 & U, F = U >>> 13, J = 0 | a[1], z = 8191 & J, K = J >>> 13, W = 0 | a[2], V = 8191 & W, H = W >>> 13, Z = 0 | a[3], Q = 8191 & Z, Y = Z >>> 13, G = 0 | a[4], X = 8191 & G, tt = G >>> 13, et = 0 | a[5], rt = 8191 & et, it = et >>> 13, nt = 0 | a[6], ot = 8191 & nt, st = nt >>> 13, at = 0 | a[7], ht = 8191 & at, ut = at >>> 13, ft = 0 | a[8], lt = 8191 & ft, ct = ft >>> 13, dt = 0 | a[9], pt = 8191 & dt, mt = dt >>> 13;
r.negative = t.negative ^ e.negative, r.length = 19;
var gt = (u + (i = Math.imul(l, $)) | 0) + ((8191 & (n = (n = Math.imul(l, F)) + Math.imul(c, $) | 0)) << 13) | 0;
u = ((o = Math.imul(c, F)) + (n >>> 13) | 0) + (gt >>> 26) | 0, gt &= 67108863, i = Math.imul(p, $), n = (n = Math.imul(p, F)) + Math.imul(m, $) | 0, o = Math.imul(m, F);
var yt = (u + (i = i + Math.imul(l, z) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, K) | 0) + Math.imul(c, z) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, K) | 0) + (n >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, i = Math.imul(y, $), n = (n = Math.imul(y, F)) + Math.imul(b, $) | 0, o = Math.imul(b, F), i = i + Math.imul(p, z) | 0, n = (n = n + Math.imul(p, K) | 0) + Math.imul(m, z) | 0, o = o + Math.imul(m, K) | 0;
var bt = (u + (i = i + Math.imul(l, V) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, H) | 0) + Math.imul(c, V) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, H) | 0) + (n >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, i = Math.imul(_, $), n = (n = Math.imul(_, F)) + Math.imul(w, $) | 0, o = Math.imul(w, F), i = i + Math.imul(y, z) | 0, n = (n = n + Math.imul(y, K) | 0) + Math.imul(b, z) | 0, o = o + Math.imul(b, K) | 0, i = i + Math.imul(p, V) | 0, n = (n = n + Math.imul(p, H) | 0) + Math.imul(m, V) | 0, o = o + Math.imul(m, H) | 0;
var vt = (u + (i = i + Math.imul(l, Q) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, Y) | 0) + Math.imul(c, Q) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, Y) | 0) + (n >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, i = Math.imul(S, $), n = (n = Math.imul(S, F)) + Math.imul(E, $) | 0, o = Math.imul(E, F), i = i + Math.imul(_, z) | 0, n = (n = n + Math.imul(_, K) | 0) + Math.imul(w, z) | 0, o = o + Math.imul(w, K) | 0, i = i + Math.imul(y, V) | 0, n = (n = n + Math.imul(y, H) | 0) + Math.imul(b, V) | 0, o = o + Math.imul(b, H) | 0, i = i + Math.imul(p, Q) | 0, n = (n = n + Math.imul(p, Y) | 0) + Math.imul(m, Q) | 0, o = o + Math.imul(m, Y) | 0;
var _t = (u + (i = i + Math.imul(l, X) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, tt) | 0) + Math.imul(c, X) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, tt) | 0) + (n >>> 13) | 0) + (_t >>> 26) | 0, _t &= 67108863, i = Math.imul(C, $), n = (n = Math.imul(C, F)) + Math.imul(O, $) | 0, o = Math.imul(O, F), i = i + Math.imul(S, z) | 0, n = (n = n + Math.imul(S, K) | 0) + Math.imul(E, z) | 0, o = o + Math.imul(E, K) | 0, i = i + Math.imul(_, V) | 0, n = (n = n + Math.imul(_, H) | 0) + Math.imul(w, V) | 0, o = o + Math.imul(w, H) | 0, i = i + Math.imul(y, Q) | 0, n = (n = n + Math.imul(y, Y) | 0) + Math.imul(b, Q) | 0, o = o + Math.imul(b, Y) | 0, i = i + Math.imul(p, X) | 0, n = (n = n + Math.imul(p, tt) | 0) + Math.imul(m, X) | 0, o = o + Math.imul(m, tt) | 0;
var wt = (u + (i = i + Math.imul(l, rt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, it) | 0) + Math.imul(c, rt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, it) | 0) + (n >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, i = Math.imul(I, $), n = (n = Math.imul(I, F)) + Math.imul(k, $) | 0, o = Math.imul(k, F), i = i + Math.imul(C, z) | 0, n = (n = n + Math.imul(C, K) | 0) + Math.imul(O, z) | 0, o = o + Math.imul(O, K) | 0, i = i + Math.imul(S, V) | 0, n = (n = n + Math.imul(S, H) | 0) + Math.imul(E, V) | 0, o = o + Math.imul(E, H) | 0, i = i + Math.imul(_, Q) | 0, n = (n = n + Math.imul(_, Y) | 0) + Math.imul(w, Q) | 0, o = o + Math.imul(w, Y) | 0, i = i + Math.imul(y, X) | 0, n = (n = n + Math.imul(y, tt) | 0) + Math.imul(b, X) | 0, o = o + Math.imul(b, tt) | 0, i = i + Math.imul(p, rt) | 0, n = (n = n + Math.imul(p, it) | 0) + Math.imul(m, rt) | 0, o = o + Math.imul(m, it) | 0;
var Mt = (u + (i = i + Math.imul(l, ot) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, st) | 0) + Math.imul(c, ot) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, st) | 0) + (n >>> 13) | 0) + (Mt >>> 26) | 0, Mt &= 67108863, i = Math.imul(q, $), n = (n = Math.imul(q, F)) + Math.imul(T, $) | 0, o = Math.imul(T, F), i = i + Math.imul(I, z) | 0, n = (n = n + Math.imul(I, K) | 0) + Math.imul(k, z) | 0, o = o + Math.imul(k, K) | 0, i = i + Math.imul(C, V) | 0, n = (n = n + Math.imul(C, H) | 0) + Math.imul(O, V) | 0, o = o + Math.imul(O, H) | 0, i = i + Math.imul(S, Q) | 0, n = (n = n + Math.imul(S, Y) | 0) + Math.imul(E, Q) | 0, o = o + Math.imul(E, Y) | 0, i = i + Math.imul(_, X) | 0, n = (n = n + Math.imul(_, tt) | 0) + Math.imul(w, X) | 0, o = o + Math.imul(w, tt) | 0, i = i + Math.imul(y, rt) | 0, n = (n = n + Math.imul(y, it) | 0) + Math.imul(b, rt) | 0, o = o + Math.imul(b, it) | 0, i = i + Math.imul(p, ot) | 0, n = (n = n + Math.imul(p, st) | 0) + Math.imul(m, ot) | 0, o = o + Math.imul(m, st) | 0;
var St = (u + (i = i + Math.imul(l, ht) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ut) | 0) + Math.imul(c, ht) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ut) | 0) + (n >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, i = Math.imul(N, $), n = (n = Math.imul(N, F)) + Math.imul(B, $) | 0, o = Math.imul(B, F), i = i + Math.imul(q, z) | 0, n = (n = n + Math.imul(q, K) | 0) + Math.imul(T, z) | 0, o = o + Math.imul(T, K) | 0, i = i + Math.imul(I, V) | 0, n = (n = n + Math.imul(I, H) | 0) + Math.imul(k, V) | 0, o = o + Math.imul(k, H) | 0, i = i + Math.imul(C, Q) | 0, n = (n = n + Math.imul(C, Y) | 0) + Math.imul(O, Q) | 0, o = o + Math.imul(O, Y) | 0, i = i + Math.imul(S, X) | 0, n = (n = n + Math.imul(S, tt) | 0) + Math.imul(E, X) | 0, o = o + Math.imul(E, tt) | 0, i = i + Math.imul(_, rt) | 0, n = (n = n + Math.imul(_, it) | 0) + Math.imul(w, rt) | 0, o = o + Math.imul(w, it) | 0, i = i + Math.imul(y, ot) | 0, n = (n = n + Math.imul(y, st) | 0) + Math.imul(b, ot) | 0, o = o + Math.imul(b, st) | 0, i = i + Math.imul(p, ht) | 0, n = (n = n + Math.imul(p, ut) | 0) + Math.imul(m, ht) | 0, o = o + Math.imul(m, ut) | 0;
var Et = (u + (i = i + Math.imul(l, lt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, ct) | 0) + Math.imul(c, lt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, ct) | 0) + (n >>> 13) | 0) + (Et >>> 26) | 0, Et &= 67108863, i = Math.imul(L, $), n = (n = Math.imul(L, F)) + Math.imul(D, $) | 0, o = Math.imul(D, F), i = i + Math.imul(N, z) | 0, n = (n = n + Math.imul(N, K) | 0) + Math.imul(B, z) | 0, o = o + Math.imul(B, K) | 0, i = i + Math.imul(q, V) | 0, n = (n = n + Math.imul(q, H) | 0) + Math.imul(T, V) | 0, o = o + Math.imul(T, H) | 0, i = i + Math.imul(I, Q) | 0, n = (n = n + Math.imul(I, Y) | 0) + Math.imul(k, Q) | 0, o = o + Math.imul(k, Y) | 0, i = i + Math.imul(C, X) | 0, n = (n = n + Math.imul(C, tt) | 0) + Math.imul(O, X) | 0, o = o + Math.imul(O, tt) | 0, i = i + Math.imul(S, rt) | 0, n = (n = n + Math.imul(S, it) | 0) + Math.imul(E, rt) | 0, o = o + Math.imul(E, it) | 0, i = i + Math.imul(_, ot) | 0, n = (n = n + Math.imul(_, st) | 0) + Math.imul(w, ot) | 0, o = o + Math.imul(w, st) | 0, i = i + Math.imul(y, ht) | 0, n = (n = n + Math.imul(y, ut) | 0) + Math.imul(b, ht) | 0, o = o + Math.imul(b, ut) | 0, i = i + Math.imul(p, lt) | 0, n = (n = n + Math.imul(p, ct) | 0) + Math.imul(m, lt) | 0, o = o + Math.imul(m, ct) | 0;
var At = (u + (i = i + Math.imul(l, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(l, mt) | 0) + Math.imul(c, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(c, mt) | 0) + (n >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, i = Math.imul(L, z), n = (n = Math.imul(L, K)) + Math.imul(D, z) | 0, o = Math.imul(D, K), i = i + Math.imul(N, V) | 0, n = (n = n + Math.imul(N, H) | 0) + Math.imul(B, V) | 0, o = o + Math.imul(B, H) | 0, i = i + Math.imul(q, Q) | 0, n = (n = n + Math.imul(q, Y) | 0) + Math.imul(T, Q) | 0, o = o + Math.imul(T, Y) | 0, i = i + Math.imul(I, X) | 0, n = (n = n + Math.imul(I, tt) | 0) + Math.imul(k, X) | 0, o = o + Math.imul(k, tt) | 0, i = i + Math.imul(C, rt) | 0, n = (n = n + Math.imul(C, it) | 0) + Math.imul(O, rt) | 0, o = o + Math.imul(O, it) | 0, i = i + Math.imul(S, ot) | 0, n = (n = n + Math.imul(S, st) | 0) + Math.imul(E, ot) | 0, o = o + Math.imul(E, st) | 0, i = i + Math.imul(_, ht) | 0, n = (n = n + Math.imul(_, ut) | 0) + Math.imul(w, ht) | 0, o = o + Math.imul(w, ut) | 0, i = i + Math.imul(y, lt) | 0, n = (n = n + Math.imul(y, ct) | 0) + Math.imul(b, lt) | 0, o = o + Math.imul(b, ct) | 0;
var Ct = (u + (i = i + Math.imul(p, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(p, mt) | 0) + Math.imul(m, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(m, mt) | 0) + (n >>> 13) | 0) + (Ct >>> 26) | 0, Ct &= 67108863, i = Math.imul(L, V), n = (n = Math.imul(L, H)) + Math.imul(D, V) | 0, o = Math.imul(D, H), i = i + Math.imul(N, Q) | 0, n = (n = n + Math.imul(N, Y) | 0) + Math.imul(B, Q) | 0, o = o + Math.imul(B, Y) | 0, i = i + Math.imul(q, X) | 0, n = (n = n + Math.imul(q, tt) | 0) + Math.imul(T, X) | 0, o = o + Math.imul(T, tt) | 0, i = i + Math.imul(I, rt) | 0, n = (n = n + Math.imul(I, it) | 0) + Math.imul(k, rt) | 0, o = o + Math.imul(k, it) | 0, i = i + Math.imul(C, ot) | 0, n = (n = n + Math.imul(C, st) | 0) + Math.imul(O, ot) | 0, o = o + Math.imul(O, st) | 0, i = i + Math.imul(S, ht) | 0, n = (n = n + Math.imul(S, ut) | 0) + Math.imul(E, ht) | 0, o = o + Math.imul(E, ut) | 0, i = i + Math.imul(_, lt) | 0, n = (n = n + Math.imul(_, ct) | 0) + Math.imul(w, lt) | 0, o = o + Math.imul(w, ct) | 0;
var Ot = (u + (i = i + Math.imul(y, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(y, mt) | 0) + Math.imul(b, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(b, mt) | 0) + (n >>> 13) | 0) + (Ot >>> 26) | 0, Ot &= 67108863, i = Math.imul(L, Q), n = (n = Math.imul(L, Y)) + Math.imul(D, Q) | 0, o = Math.imul(D, Y), i = i + Math.imul(N, X) | 0, n = (n = n + Math.imul(N, tt) | 0) + Math.imul(B, X) | 0, o = o + Math.imul(B, tt) | 0, i = i + Math.imul(q, rt) | 0, n = (n = n + Math.imul(q, it) | 0) + Math.imul(T, rt) | 0, o = o + Math.imul(T, it) | 0, i = i + Math.imul(I, ot) | 0, n = (n = n + Math.imul(I, st) | 0) + Math.imul(k, ot) | 0, o = o + Math.imul(k, st) | 0, i = i + Math.imul(C, ht) | 0, n = (n = n + Math.imul(C, ut) | 0) + Math.imul(O, ht) | 0, o = o + Math.imul(O, ut) | 0, i = i + Math.imul(S, lt) | 0, n = (n = n + Math.imul(S, ct) | 0) + Math.imul(E, lt) | 0, o = o + Math.imul(E, ct) | 0;
var Pt = (u + (i = i + Math.imul(_, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(_, mt) | 0) + Math.imul(w, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(w, mt) | 0) + (n >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, i = Math.imul(L, X), n = (n = Math.imul(L, tt)) + Math.imul(D, X) | 0, o = Math.imul(D, tt), i = i + Math.imul(N, rt) | 0, n = (n = n + Math.imul(N, it) | 0) + Math.imul(B, rt) | 0, o = o + Math.imul(B, it) | 0, i = i + Math.imul(q, ot) | 0, n = (n = n + Math.imul(q, st) | 0) + Math.imul(T, ot) | 0, o = o + Math.imul(T, st) | 0, i = i + Math.imul(I, ht) | 0, n = (n = n + Math.imul(I, ut) | 0) + Math.imul(k, ht) | 0, o = o + Math.imul(k, ut) | 0, i = i + Math.imul(C, lt) | 0, n = (n = n + Math.imul(C, ct) | 0) + Math.imul(O, lt) | 0, o = o + Math.imul(O, ct) | 0;
var It = (u + (i = i + Math.imul(S, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(S, mt) | 0) + Math.imul(E, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(E, mt) | 0) + (n >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863, i = Math.imul(L, rt), n = (n = Math.imul(L, it)) + Math.imul(D, rt) | 0, o = Math.imul(D, it), i = i + Math.imul(N, ot) | 0, n = (n = n + Math.imul(N, st) | 0) + Math.imul(B, ot) | 0, o = o + Math.imul(B, st) | 0, i = i + Math.imul(q, ht) | 0, n = (n = n + Math.imul(q, ut) | 0) + Math.imul(T, ht) | 0, o = o + Math.imul(T, ut) | 0, i = i + Math.imul(I, lt) | 0, n = (n = n + Math.imul(I, ct) | 0) + Math.imul(k, lt) | 0, o = o + Math.imul(k, ct) | 0;
var kt = (u + (i = i + Math.imul(C, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(C, mt) | 0) + Math.imul(O, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(O, mt) | 0) + (n >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, i = Math.imul(L, ot), n = (n = Math.imul(L, st)) + Math.imul(D, ot) | 0, o = Math.imul(D, st), i = i + Math.imul(N, ht) | 0, n = (n = n + Math.imul(N, ut) | 0) + Math.imul(B, ht) | 0, o = o + Math.imul(B, ut) | 0, i = i + Math.imul(q, lt) | 0, n = (n = n + Math.imul(q, ct) | 0) + Math.imul(T, lt) | 0, o = o + Math.imul(T, ct) | 0;
var Rt = (u + (i = i + Math.imul(I, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(I, mt) | 0) + Math.imul(k, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(k, mt) | 0) + (n >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, i = Math.imul(L, ht), n = (n = Math.imul(L, ut)) + Math.imul(D, ht) | 0, o = Math.imul(D, ut), i = i + Math.imul(N, lt) | 0, n = (n = n + Math.imul(N, ct) | 0) + Math.imul(B, lt) | 0, o = o + Math.imul(B, ct) | 0;
var qt = (u + (i = i + Math.imul(q, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(q, mt) | 0) + Math.imul(T, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(T, mt) | 0) + (n >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, i = Math.imul(L, lt), n = (n = Math.imul(L, ct)) + Math.imul(D, lt) | 0, o = Math.imul(D, ct);
var Tt = (u + (i = i + Math.imul(N, pt) | 0) | 0) + ((8191 & (n = (n = n + Math.imul(N, mt) | 0) + Math.imul(B, pt) | 0)) << 13) | 0;
u = ((o = o + Math.imul(B, mt) | 0) + (n >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863;
var xt = (u + (i = Math.imul(L, pt)) | 0) + ((8191 & (n = (n = Math.imul(L, mt)) + Math.imul(D, pt) | 0)) << 13) | 0;
return u = ((o = Math.imul(D, mt)) + (n >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h[0] = gt, h[1] = yt, h[2] = bt, h[3] = vt, h[4] = _t, h[5] = wt, h[6] = Mt, h[7] = St, h[8] = Et, h[9] = At, h[10] = Ct, h[11] = Ot, h[12] = Pt, h[13] = It, h[14] = kt, h[15] = Rt, h[16] = qt, h[17] = Tt, h[18] = xt, 0 !== u && (h[19] = u, r.length++), r;
};
function p(t, e, r) {
return new m().mulp(t, e, r);
}
function m(t, e) {
this.x = t, this.y = e;
}
Math.imul || (d = c), n.prototype.mulTo = function(t, e) {
var r, i = this.length + t.length;
return r = 10 === this.length && 10 === t.length ? d(this, t, e) : i < 63 ? c(this, t, e) : i < 1024 ? function(t, e, r) {
r.negative = e.negative ^ t.negative, r.length = t.length + e.length;
for (var i = 0, n = 0, o = 0; o < r.length - 1; o++) {
var s = n;
n = 0;
for (var a = 67108863 & i, h = Math.min(o, e.length - 1), u = Math.max(0, o - t.length + 1); u <= h; u++) {
var f = o - u, l = (0 | t.words[f]) * (0 | e.words[u]), c = 67108863 & l;
a = 67108863 & (c = c + a | 0), n += (s = (s = s + (l / 67108864 | 0) | 0) + (c >>> 26) | 0) >>> 26, s &= 67108863;
}
r.words[o] = a, i = s, s = n;
}
return 0 !== i ? r.words[o] = i : r.length--, r.strip();
}(this, t, e) : p(this, t, e), r;
}, m.prototype.makeRBT = function(t) {
for (var e = new Array(t), r = n.prototype._countBits(t) - 1, i = 0; i < t; i++) e[i] = this.revBin(i, r, t);
return e;
}, m.prototype.revBin = function(t, e, r) {
if (0 === t || t === r - 1) return t;
for (var i = 0, n = 0; n < e; n++) i |= (1 & t) << e - n - 1, t >>= 1;
return i;
}, m.prototype.permute = function(t, e, r, i, n, o) {
for (var s = 0; s < o; s++) i[s] = e[t[s]], n[s] = r[t[s]];
}, m.prototype.transform = function(t, e, r, i, n, o) {
this.permute(o, t, e, r, i, n);
for (var s = 1; s < n; s <<= 1) for (var a = s << 1, h = Math.cos(2 * Math.PI / a), u = Math.sin(2 * Math.PI / a), f = 0; f < n; f += a) for (var l = h, c = u, d = 0; d < s; d++) {
var p = r[f + d], m = i[f + d], g = r[f + d + s], y = i[f + d + s], b = l * g - c * y;
y = l * y + c * g, g = b, r[f + d] = p + g, i[f + d] = m + y, r[f + d + s] = p - g, i[f + d + s] = m - y, d !== a && (b = h * l - u * c, c = h * c + u * l, l = b);
}
}, m.prototype.guessLen13b = function(t, e) {
var r = 1 | Math.max(e, t), i = 1 & r, n = 0;
for (r = r / 2 | 0; r; r >>>= 1) n++;
return 1 << n + 1 + i;
}, m.prototype.conjugate = function(t, e, r) {
if (!(r <= 1)) for (var i = 0; i < r / 2; i++) {
var n = t[i];
t[i] = t[r - i - 1], t[r - i - 1] = n, n = e[i], e[i] = -e[r - i - 1], e[r - i - 1] = -n;
}
}, m.prototype.normalize13b = function(t, e) {
for (var r = 0, i = 0; i < e / 2; i++) {
var n = 8192 * Math.round(t[2 * i + 1] / e) + Math.round(t[2 * i] / e) + r;
t[i] = 67108863 & n, r = n < 67108864 ? 0 : n / 67108864 | 0;
}
return t;
}, m.prototype.convert13b = function(t, e, i, n) {
for (var o = 0, s = 0; s < e; s++) o += 0 | t[s], i[2 * s] = 8191 & o, o >>>= 13, i[2 * s + 1] = 8191 & o, o >>>= 13;
for (s = 2 * e; s < n; ++s) i[s] = 0;
r(0 === o), r(!(-8192 & o));
}, m.prototype.stub = function(t) {
for (var e = new Array(t), r = 0; r < t; r++) e[r] = 0;
return e;
}, m.prototype.mulp = function(t, e, r) {
var i = 2 * this.guessLen13b(t.length, e.length), n = this.makeRBT(i), o = this.stub(i), s = new Array(i), a = new Array(i), h = new Array(i), u = new Array(i), f = new Array(i), l = new Array(i), c = r.words;
c.length = i, this.convert13b(t.words, t.length, s, i), this.convert13b(e.words, e.length, u, i), this.transform(s, o, a, h, i, n), this.transform(u, o, f, l, i, n);
for (var d = 0; d < i; d++) {
var p = a[d] * f[d] - h[d] * l[d];
h[d] = a[d] * l[d] + h[d] * f[d], a[d] = p;
}
return this.conjugate(a, h, i), this.transform(a, h, c, o, i, n), this.conjugate(c, o, i), this.normalize13b(c, i), r.negative = t.negative ^ e.negative, r.length = t.length + e.length, r.strip();
}, n.prototype.mul = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), this.mulTo(t, e);
}, n.prototype.mulf = function(t) {
var e = new n(null);
return e.words = new Array(this.length + t.length), p(this, t, e);
}, n.prototype.imul = function(t) {
return this.clone().mulTo(t, this);
}, n.prototype.imuln = function(t) {
r("number" == typeof t), r(t < 67108864);
for (var e = 0, i = 0; i < this.length; i++) {
var n = (0 | this.words[i]) * t, o = (67108863 & n) + (67108863 & e);
e >>= 26, e += n / 67108864 | 0, e += o >>> 26, this.words[i] = 67108863 & o;
}
return 0 !== e && (this.words[i] = e, this.length++), this;
}, n.prototype.muln = function(t) {
return this.clone().imuln(t);
}, n.prototype.sqr = function() {
return this.mul(this);
}, n.prototype.isqr = function() {
return this.imul(this.clone());
}, n.prototype.pow = function(t) {
var e = function(t) {
for (var e = new Array(t.bitLength()), r = 0; r < e.length; r++) {
var i = r / 26 | 0, n = r % 26;
e[r] = (t.words[i] & 1 << n) >>> n;
}
return e;
}(t);
if (0 === e.length) return new n(1);
for (var r = this, i = 0; i < e.length && 0 === e[i]; i++, r = r.sqr());
if (++i < e.length) for (var o = r.sqr(); i < e.length; i++, o = o.sqr()) 0 !== e[i] && (r = r.mul(o));
return r;
}, n.prototype.iushln = function(t) {
r("number" == typeof t && t >= 0);
var e, i = t % 26, n = (t - i) / 26, o = 67108863 >>> 26 - i << 26 - i;
if (0 !== i) {
var s = 0;
for (e = 0; e < this.length; e++) {
var a = this.words[e] & o, h = (0 | this.words[e]) - a << i;
this.words[e] = h | s, s = a >>> 26 - i;
}
s && (this.words[e] = s, this.length++);
}
if (0 !== n) {
for (e = this.length - 1; e >= 0; e--) this.words[e + n] = this.words[e];
for (e = 0; e < n; e++) this.words[e] = 0;
this.length += n;
}
return this.strip();
}, n.prototype.ishln = function(t) {
return r(0 === this.negative), this.iushln(t);
}, n.prototype.iushrn = function(t, e, i) {
var n;
r("number" == typeof t && t >= 0), n = e ? (e - e % 26) / 26 : 0;
var o = t % 26, s = Math.min((t - o) / 26, this.length), a = 67108863 ^ 67108863 >>> o << o, h = i;
if (n -= s, n = Math.max(0, n), h) {
for (var u = 0; u < s; u++) h.words[u] = this.words[u];
h.length = s;
}
if (0 === s);
else if (this.length > s) for (this.length -= s, u = 0; u < this.length; u++) this.words[u] = this.words[u + s];
else this.words[0] = 0, this.length = 1;
var f = 0;
for (u = this.length - 1; u >= 0 && (0 !== f || u >= n); u--) {
var l = 0 | this.words[u];
this.words[u] = f << 26 - o | l >>> o, f = l & a;
}
return h && 0 !== f && (h.words[h.length++] = f), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, n.prototype.ishrn = function(t, e, i) {
return r(0 === this.negative), this.iushrn(t, e, i);
}, n.prototype.shln = function(t) {
return this.clone().ishln(t);
}, n.prototype.ushln = function(t) {
return this.clone().iushln(t);
}, n.prototype.shrn = function(t) {
return this.clone().ishrn(t);
}, n.prototype.ushrn = function(t) {
return this.clone().iushrn(t);
}, n.prototype.testn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
return !(this.length <= i) && !!(this.words[i] & n);
}, n.prototype.imaskn = function(t) {
r("number" == typeof t && t >= 0);
var e = t % 26, i = (t - e) / 26;
if (r(0 === this.negative, "imaskn works only with positive numbers"), this.length <= i) return this;
if (0 !== e && i++, this.length = Math.min(i, this.length), 0 !== e) {
var n = 67108863 ^ 67108863 >>> e << e;
this.words[this.length - 1] &= n;
}
return this.strip();
}, n.prototype.maskn = function(t) {
return this.clone().imaskn(t);
}, n.prototype.iaddn = function(t) {
return r("number" == typeof t), r(t < 67108864), t < 0 ? this.isubn(-t) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < t ? (this.words[0] = t - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(t), this.negative = 1, this) : this._iaddn(t);
}, n.prototype._iaddn = function(t) {
this.words[0] += t;
for (var e = 0; e < this.length && this.words[e] >= 67108864; e++) this.words[e] -= 67108864, e === this.length - 1 ? this.words[e + 1] = 1 : this.words[e + 1]++;
return this.length = Math.max(this.length, e + 1), this;
}, n.prototype.isubn = function(t) {
if (r("number" == typeof t), r(t < 67108864), t < 0) return this.iaddn(-t);
if (0 !== this.negative) return this.negative = 0, this.iaddn(t), this.negative = 1, this;
if (this.words[0] -= t, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var e = 0; e < this.length && this.words[e] < 0; e++) this.words[e] += 67108864, this.words[e + 1] -= 1;
return this.strip();
}, n.prototype.addn = function(t) {
return this.clone().iaddn(t);
}, n.prototype.subn = function(t) {
return this.clone().isubn(t);
}, n.prototype.iabs = function() {
return this.negative = 0, this;
}, n.prototype.abs = function() {
return this.clone().iabs();
}, n.prototype._ishlnsubmul = function(t, e, i) {
var n, o, s = t.length + i;
this._expand(s);
var a = 0;
for (n = 0; n < t.length; n++) {
o = (0 | this.words[n + i]) + a;
var h = (0 | t.words[n]) * e;
a = ((o -= 67108863 & h) >> 26) - (h / 67108864 | 0), this.words[n + i] = 67108863 & o;
}
for (; n < this.length - i; n++) a = (o = (0 | this.words[n + i]) + a) >> 26, this.words[n + i] = 67108863 & o;
if (0 === a) return this.strip();
for (r(-1 === a), a = 0, n = 0; n < this.length; n++) a = (o = -(0 | this.words[n]) + a) >> 26, this.words[n] = 67108863 & o;
return this.negative = 1, this.strip();
}, n.prototype._wordDiv = function(t, e) {
var r = (this.length, t.length), i = this.clone(), o = t, s = 0 | o.words[o.length - 1];
0 !== (r = 26 - this._countBits(s)) && (o = o.ushln(r), i.iushln(r), s = 0 | o.words[o.length - 1]);
var a, h = i.length - o.length;
if ("mod" !== e) {
(a = new n(null)).length = h + 1, a.words = new Array(a.length);
for (var u = 0; u < a.length; u++) a.words[u] = 0;
}
var f = i.clone()._ishlnsubmul(o, 1, h);
0 === f.negative && (i = f, a && (a.words[h] = 1));
for (var l = h - 1; l >= 0; l--) {
var c = 67108864 * (0 | i.words[o.length + l]) + (0 | i.words[o.length + l - 1]);
for (c = Math.min(c / s | 0, 67108863), i._ishlnsubmul(o, c, l); 0 !== i.negative;) c--, i.negative = 0, i._ishlnsubmul(o, 1, l), i.isZero() || (i.negative ^= 1);
a && (a.words[l] = c);
}
return a && a.strip(), i.strip(), "div" !== e && 0 !== r && i.iushrn(r), {
div: a || null,
mod: i
};
}, n.prototype.divmod = function(t, e, i) {
return r(!t.isZero()), this.isZero() ? {
div: new n(0),
mod: new n(0)
} : 0 !== this.negative && 0 === t.negative ? (a = this.neg().divmod(t, e), "mod" !== e && (o = a.div.neg()), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.iadd(t)), {
div: o,
mod: s
}) : 0 === this.negative && 0 !== t.negative ? (a = this.divmod(t.neg(), e), "mod" !== e && (o = a.div.neg()), {
div: o,
mod: a.mod
}) : this.negative & t.negative ? (a = this.neg().divmod(t.neg(), e), "div" !== e && (s = a.mod.neg(), i && 0 !== s.negative && s.isub(t)), {
div: a.div,
mod: s
}) : t.length > this.length || this.cmp(t) < 0 ? {
div: new n(0),
mod: this
} : 1 === t.length ? "div" === e ? {
div: this.divn(t.words[0]),
mod: null
} : "mod" === e ? {
div: null,
mod: new n(this.modn(t.words[0]))
} : {
div: this.divn(t.words[0]),
mod: new n(this.modn(t.words[0]))
} : this._wordDiv(t, e);
var o, s, a;
}, n.prototype.div = function(t) {
return this.divmod(t, "div", !1).div;
}, n.prototype.mod = function(t) {
return this.divmod(t, "mod", !1).mod;
}, n.prototype.umod = function(t) {
return this.divmod(t, "mod", !0).mod;
}, n.prototype.divRound = function(t) {
var e = this.divmod(t);
if (e.mod.isZero()) return e.div;
var r = 0 !== e.div.negative ? e.mod.isub(t) : e.mod, i = t.ushrn(1), n = t.andln(1), o = r.cmp(i);
return o < 0 || 1 === n && 0 === o ? e.div : 0 !== e.div.negative ? e.div.isubn(1) : e.div.iaddn(1);
}, n.prototype.modn = function(t) {
r(t <= 67108863);
for (var e = (1 << 26) % t, i = 0, n = this.length - 1; n >= 0; n--) i = (e * i + (0 | this.words[n])) % t;
return i;
}, n.prototype.idivn = function(t) {
r(t <= 67108863);
for (var e = 0, i = this.length - 1; i >= 0; i--) {
var n = (0 | this.words[i]) + 67108864 * e;
this.words[i] = n / t | 0, e = n % t;
}
return this.strip();
}, n.prototype.divn = function(t) {
return this.clone().idivn(t);
}, n.prototype.egcd = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o = new n(1), s = new n(0), a = new n(0), h = new n(1), u = 0; e.isEven() && i.isEven();) e.iushrn(1), i.iushrn(1), ++u;
for (var f = i.clone(), l = e.clone(); !e.isZero();) {
for (var c = 0, d = 1; !(e.words[0] & d) && c < 26; ++c, d <<= 1);
if (c > 0) for (e.iushrn(c); c-- > 0;) (o.isOdd() || s.isOdd()) && (o.iadd(f), s.isub(l)), o.iushrn(1), s.iushrn(1);
for (var p = 0, m = 1; !(i.words[0] & m) && p < 26; ++p, m <<= 1);
if (p > 0) for (i.iushrn(p); p-- > 0;) (a.isOdd() || h.isOdd()) && (a.iadd(f), h.isub(l)), a.iushrn(1), h.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), o.isub(a), s.isub(h)) : (i.isub(e), a.isub(o), h.isub(s));
}
return {
a,
b: h,
gcd: i.iushln(u)
};
}, n.prototype._invmp = function(t) {
r(0 === t.negative), r(!t.isZero());
var e = this, i = t.clone();
e = 0 !== e.negative ? e.umod(t) : e.clone();
for (var o, s = new n(1), a = new n(0), h = i.clone(); e.cmpn(1) > 0 && i.cmpn(1) > 0;) {
for (var u = 0, f = 1; !(e.words[0] & f) && u < 26; ++u, f <<= 1);
if (u > 0) for (e.iushrn(u); u-- > 0;) s.isOdd() && s.iadd(h), s.iushrn(1);
for (var l = 0, c = 1; !(i.words[0] & c) && l < 26; ++l, c <<= 1);
if (l > 0) for (i.iushrn(l); l-- > 0;) a.isOdd() && a.iadd(h), a.iushrn(1);
e.cmp(i) >= 0 ? (e.isub(i), s.isub(a)) : (i.isub(e), a.isub(s));
}
return (o = 0 === e.cmpn(1) ? s : a).cmpn(0) < 0 && o.iadd(t), o;
}, n.prototype.gcd = function(t) {
if (this.isZero()) return t.abs();
if (t.isZero()) return this.abs();
var e = this.clone(), r = t.clone();
e.negative = 0, r.negative = 0;
for (var i = 0; e.isEven() && r.isEven(); i++) e.iushrn(1), r.iushrn(1);
for (;;) {
for (; e.isEven();) e.iushrn(1);
for (; r.isEven();) r.iushrn(1);
var n = e.cmp(r);
if (n < 0) {
var o = e;
e = r, r = o;
} else if (0 === n || 0 === r.cmpn(1)) break;
e.isub(r);
}
return r.iushln(i);
}, n.prototype.invm = function(t) {
return this.egcd(t).a.umod(t);
}, n.prototype.isEven = function() {
return !(1 & this.words[0]);
}, n.prototype.isOdd = function() {
return !(1 & ~this.words[0]);
}, n.prototype.andln = function(t) {
return this.words[0] & t;
}, n.prototype.bincn = function(t) {
r("number" == typeof t);
var e = t % 26, i = (t - e) / 26, n = 1 << e;
if (this.length <= i) return this._expand(i + 1), this.words[i] |= n, this;
for (var o = n, s = i; 0 !== o && s < this.length; s++) {
var a = 0 | this.words[s];
o = (a += o) >>> 26, a &= 67108863, this.words[s] = a;
}
return 0 !== o && (this.words[s] = o, this.length++), this;
}, n.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, n.prototype.cmpn = function(t) {
var e, i = t < 0;
if (0 !== this.negative && !i) return -1;
if (0 === this.negative && i) return 1;
if (this.strip(), this.length > 1) e = 1;
else {
i && (t = -t), r(t <= 67108863, "Number is too big");
var n = 0 | this.words[0];
e = n === t ? 0 : n < t ? -1 : 1;
}
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.cmp = function(t) {
if (0 !== this.negative && 0 === t.negative) return -1;
if (0 === this.negative && 0 !== t.negative) return 1;
var e = this.ucmp(t);
return 0 !== this.negative ? 0 | -e : e;
}, n.prototype.ucmp = function(t) {
if (this.length > t.length) return 1;
if (this.length < t.length) return -1;
for (var e = 0, r = this.length - 1; r >= 0; r--) {
var i = 0 | this.words[r], n = 0 | t.words[r];
if (i !== n) {
i < n ? e = -1 : i > n && (e = 1);
break;
}
}
return e;
}, n.prototype.gtn = function(t) {
return 1 === this.cmpn(t);
}, n.prototype.gt = function(t) {
return 1 === this.cmp(t);
}, n.prototype.gten = function(t) {
return this.cmpn(t) >= 0;
}, n.prototype.gte = function(t) {
return this.cmp(t) >= 0;
}, n.prototype.ltn = function(t) {
return -1 === this.cmpn(t);
}, n.prototype.lt = function(t) {
return -1 === this.cmp(t);
}, n.prototype.lten = function(t) {
return this.cmpn(t) <= 0;
}, n.prototype.lte = function(t) {
return this.cmp(t) <= 0;
}, n.prototype.eqn = function(t) {
return 0 === this.cmpn(t);
}, n.prototype.eq = function(t) {
return 0 === this.cmp(t);
}, n.red = function(t) {
return new M(t);
}, n.prototype.toRed = function(t) {
return r(!this.red, "Already a number in reduction context"), r(0 === this.negative, "red works only with positives"), t.convertTo(this)._forceRed(t);
}, n.prototype.fromRed = function() {
return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, n.prototype._forceRed = function(t) {
return this.red = t, this;
}, n.prototype.forceRed = function(t) {
return r(!this.red, "Already a number in reduction context"), this._forceRed(t);
}, n.prototype.redAdd = function(t) {
return r(this.red, "redAdd works only with red numbers"), this.red.add(this, t);
}, n.prototype.redIAdd = function(t) {
return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, t);
}, n.prototype.redSub = function(t) {
return r(this.red, "redSub works only with red numbers"), this.red.sub(this, t);
}, n.prototype.redISub = function(t) {
return r(this.red, "redISub works only with red numbers"), this.red.isub(this, t);
}, n.prototype.redShl = function(t) {
return r(this.red, "redShl works only with red numbers"), this.red.shl(this, t);
}, n.prototype.redMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.mul(this, t);
}, n.prototype.redIMul = function(t) {
return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, t), this.red.imul(this, t);
}, n.prototype.redSqr = function() {
return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, n.prototype.redISqr = function() {
return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, n.prototype.redSqrt = function() {
return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, n.prototype.redInvm = function() {
return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, n.prototype.redNeg = function() {
return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, n.prototype.redPow = function(t) {
return r(this.red && !t.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, t);
};
var g = {
k256: null,
p224: null,
p192: null,
p25519: null
};
function y(t, e) {
this.name = t, this.p = new n(e, 16), this.n = this.p.bitLength(), this.k = new n(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function b() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function v() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function w() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function M(t) {
if ("string" == typeof t) {
var e = n._prime(t);
this.m = e.p, this.prime = e;
} else r(t.gtn(1), "modulus must be greater than 1"), this.m = t, this.prime = null;
}
function S(t) {
M.call(this, t), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new n(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 t = new n(null);
return t.words = new Array(Math.ceil(this.n / 13)), t;
}, y.prototype.ireduce = function(t) {
var e, r = t;
do
this.split(r, this.tmp), e = (r = (r = this.imulK(r)).iadd(this.tmp)).bitLength();
while (e > this.n);
var i = e < this.n ? -1 : r.ucmp(this.p);
return 0 === i ? (r.words[0] = 0, r.length = 1) : i > 0 ? r.isub(this.p) : void 0 !== r.strip ? r.strip() : r._strip(), r;
}, y.prototype.split = function(t, e) {
t.iushrn(this.n, 0, e);
}, y.prototype.imulK = function(t) {
return t.imul(this.k);
}, i(b, y), b.prototype.split = function(t, e) {
for (var r = 4194303, i = Math.min(t.length, 9), n = 0; n < i; n++) e.words[n] = t.words[n];
if (e.length = i, t.length <= 9) return t.words[0] = 0, void (t.length = 1);
var o = t.words[9];
for (e.words[e.length++] = o & r, n = 10; n < t.length; n++) {
var s = 0 | t.words[n];
t.words[n - 10] = (s & r) << 4 | o >>> 22, o = s;
}
o >>>= 22, t.words[n - 10] = o, 0 === o && t.length > 10 ? t.length -= 10 : t.length -= 9;
}, b.prototype.imulK = function(t) {
t.words[t.length] = 0, t.words[t.length + 1] = 0, t.length += 2;
for (var e = 0, r = 0; r < t.length; r++) {
var i = 0 | t.words[r];
e += 977 * i, t.words[r] = 67108863 & e, e = 64 * i + (e / 67108864 | 0);
}
return 0 === t.words[t.length - 1] && (t.length--, 0 === t.words[t.length - 1] && t.length--), t;
}, i(v, y), i(_, y), i(w, y), w.prototype.imulK = function(t) {
for (var e = 0, r = 0; r < t.length; r++) {
var i = 19 * (0 | t.words[r]) + e, n = 67108863 & i;
i >>>= 26, t.words[r] = n, e = i;
}
return 0 !== e && (t.words[t.length++] = e), t;
}, n._prime = function(t) {
if (g[t]) return g[t];
var e;
if ("k256" === t) e = new b();
else if ("p224" === t) e = new v();
else if ("p192" === t) e = new _();
else {
if ("p25519" !== t) throw new Error("Unknown prime " + t);
e = new w();
}
return g[t] = e, e;
}, M.prototype._verify1 = function(t) {
r(0 === t.negative, "red works only with positives"), r(t.red, "red works only with red numbers");
}, M.prototype._verify2 = function(t, e) {
r(!(t.negative | e.negative), "red works only with positives"), r(t.red && t.red === e.red, "red works only with red numbers");
}, M.prototype.imod = function(t) {
return this.prime ? this.prime.ireduce(t)._forceRed(this) : t.umod(this.m)._forceRed(this);
}, M.prototype.neg = function(t) {
return t.isZero() ? t.clone() : this.m.sub(t)._forceRed(this);
}, M.prototype.add = function(t, e) {
this._verify2(t, e);
var r = t.add(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r._forceRed(this);
}, M.prototype.iadd = function(t, e) {
this._verify2(t, e);
var r = t.iadd(e);
return r.cmp(this.m) >= 0 && r.isub(this.m), r;
}, M.prototype.sub = function(t, e) {
this._verify2(t, e);
var r = t.sub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r._forceRed(this);
}, M.prototype.isub = function(t, e) {
this._verify2(t, e);
var r = t.isub(e);
return r.cmpn(0) < 0 && r.iadd(this.m), r;
}, M.prototype.shl = function(t, e) {
return this._verify1(t), this.imod(t.ushln(e));
}, M.prototype.imul = function(t, e) {
return this._verify2(t, e), this.imod(t.imul(e));
}, M.prototype.mul = function(t, e) {
return this._verify2(t, e), this.imod(t.mul(e));
}, M.prototype.isqr = function(t) {
return this.imul(t, t.clone());
}, M.prototype.sqr = function(t) {
return this.mul(t, t);
}, M.prototype.sqrt = function(t) {
if (t.isZero()) return t.clone();
var e = this.m.andln(3);
if (r(e % 2 == 1), 3 === e) {
var i = this.m.add(new n(1)).iushrn(2);
return this.pow(t, i);
}
for (var o = this.m.subn(1), s = 0; !o.isZero() && 0 === o.andln(1);) s++, o.iushrn(1);
r(!o.isZero());
var a = new n(1).toRed(this), h = a.redNeg(), u = this.m.subn(1).iushrn(1), f = this.m.bitLength();
for (f = new n(2 * f * f).toRed(this); 0 !== this.pow(f, u).cmp(h);) f.redIAdd(h);
for (var l = this.pow(f, o), c = this.pow(t, o.addn(1).iushrn(1)), d = this.pow(t, o), p = s; 0 !== d.cmp(a);) {
for (var m = d, g = 0; 0 !== m.cmp(a); g++) m = m.redSqr();
r(g < p);
var y = this.pow(l, new n(1).iushln(p - g - 1));
c = c.redMul(y), l = y.redSqr(), d = d.redMul(l), p = g;
}
return c;
}, M.prototype.invm = function(t) {
var e = t._invmp(this.m);
return 0 !== e.negative ? (e.negative = 0, this.imod(e).redNeg()) : this.imod(e);
}, M.prototype.pow = function(t, e) {
if (e.isZero()) return new n(1).toRed(this);
if (0 === e.cmpn(1)) return t.clone();
var r = new Array(16);
r[0] = new n(1).toRed(this), r[1] = t;
for (var i = 2; i < r.length; i++) r[i] = this.mul(r[i - 1], t);
var o = r[0], s = 0, a = 0, h = e.bitLength() % 26;
for (0 === h && (h = 26), i = e.length - 1; i >= 0; i--) {
for (var u = e.words[i], f = h - 1; f >= 0; f--) {
var l = u >> f & 1;
o !== r[0] && (o = this.sqr(o)), 0 !== l || 0 !== s ? (s <<= 1, s |= l, (4 === ++a || 0 === i && 0 === f) && (o = this.mul(o, r[s]), a = 0, s = 0)) : a = 0;
}
h = 26;
}
return o;
}, M.prototype.convertTo = function(t) {
var e = t.umod(this.m);
return e === t ? e.clone() : e;
}, M.prototype.convertFrom = function(t) {
var e = t.clone();
return e.red = null, e;
}, n.mont = function(t) {
return new S(t);
}, i(S, M), S.prototype.convertTo = function(t) {
return this.imod(t.ushln(this.shift));
}, S.prototype.convertFrom = function(t) {
var e = this.imod(t.mul(this.rinv));
return e.red = null, e;
}, S.prototype.imul = function(t, e) {
if (t.isZero() || e.isZero()) return t.words[0] = 0, t.length = 1, t;
var r = t.imul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), n = r.isub(i).iushrn(this.shift), o = n;
return n.cmp(this.m) >= 0 ? o = n.isub(this.m) : n.cmpn(0) < 0 && (o = n.iadd(this.m)), o._forceRed(this);
}, S.prototype.mul = function(t, e) {
if (t.isZero() || e.isZero()) return new n(0)._forceRed(this);
var r = t.mul(e), i = r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o = r.isub(i).iushrn(this.shift), s = o;
return o.cmp(this.m) >= 0 ? s = o.isub(this.m) : o.cmpn(0) < 0 && (s = o.iadd(this.m)), s._forceRed(this);
}, S.prototype.invm = function(t) {
return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === e || e, t);
})), require_withPublic = __commonJSMin(((t, e) => {
var r = require_bn(), i = require_safe_buffer$9().Buffer;
e.exports = function(t, e) {
return i.from(t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed().toArray());
};
})), require_publicEncrypt = __commonJSMin(((t, e) => {
var r = require_parse_asn1(), i = require_browser$11(), n = require_browser$10(), o = require_mgf(), s = require_xor(), a = require_bn(), h = require_withPublic(), u = require_browserify_rsa(), f = require_safe_buffer$9().Buffer;
e.exports = function(t, e, l) {
var c = t.padding ? t.padding : l ? 1 : 4;
var d, p = r(t);
if (4 === c) d = function(t, e) {
var r = t.modulus.byteLength(), h = e.length, u = n("sha1").update(f.alloc(0)).digest(), l = u.length, c = 2 * l;
if (h > r - c - 2) throw new Error("message too long");
var d = f.alloc(r - h - c - 2), p = r - l - 1, m = i(l), g = s(f.concat([
u,
d,
f.alloc(1, 1),
e
], p), o(m, p)), y = s(m, o(g, l));
return new a(f.concat([
f.alloc(1),
y,
g
], r));
}(p, e);
else if (1 === c) d = function(t, e, r) {
var n, o = e.length, s = t.modulus.byteLength();
if (o > s - 11) throw new Error("message too long");
n = r ? f.alloc(s - o - 3, 255) : function(t) {
var e, r = f.allocUnsafe(t), n = 0, o = i(2 * t), s = 0;
for (; n < t;) s === o.length && (o = i(2 * t), s = 0), (e = o[s++]) && (r[n++] = e);
return r;
}(s - o - 3);
return new a(f.concat([
f.from([0, r ? 1 : 2]),
n,
f.alloc(1),
e
], s));
}(p, e, l);
else {
if (3 !== c) throw new Error("unknown padding");
if ((d = new a(e)).cmp(p.modulus) >= 0) throw new Error("data too long for modulus");
}
return l ? u(d, p) : h(d, p);
};
})), require_privateDecrypt = __commonJSMin(((t, e) => {
var r = require_parse_asn1(), i = require_mgf(), n = require_xor(), o = require_bn(), s = require_browserify_rsa(), a = require_browser$10(), h = require_withPublic(), u = require_safe_buffer$9().Buffer;
e.exports = function(t, e, f) {
var l = t.padding ? t.padding : f ? 1 : 4;
var c, d = r(t), p = d.modulus.byteLength();
if (e.length > p || new o(e).cmp(d.modulus) >= 0) throw new Error("decryption error");
c = f ? h(new o(e), d) : s(e, d);
var m = u.alloc(p - c.length);
if (c = u.concat([m, c], p), 4 === l) return function(t, e) {
var r = t.modulus.byteLength(), o = a("sha1").update(u.alloc(0)).digest(), s = o.length;
if (0 !== e[0]) throw new Error("decryption error");
var h = e.slice(1, s + 1), f = e.slice(s + 1), l = n(f, i(n(h, i(f, s)), r - s - 1));
if (function(t, e) {
t = u.from(t), e = u.from(e);
var r = 0, i = t.length;
t.length !== e.length && (r++, i = Math.min(t.length, e.length));
var n = -1;
for (; ++n < i;) r += t[n] ^ e[n];
return r;
}(o, l.slice(0, s))) throw new Error("decryption error");
var c = s;
for (; 0 === l[c];) c++;
if (1 !== l[c++]) throw new Error("decryption error");
return l.slice(c);
}(d, c);
if (1 === l) return function(t, e, r) {
var i = e.slice(0, 2), n = 2, o = 0;
for (; 0 !== e[n++];) if (n >= e.length) {
o++;
break;
}
var s = e.slice(2, n - 1);
("0002" !== i.toString("hex") && !r || "0001" !== i.toString("hex") && r) && o++;
s.length < 8 && o++;
if (o) throw new Error("decryption error");
return e.slice(n);
}(0, c, f);
if (3 === l) return c;
throw new Error("unknown padding");
};
})), require_browser$2 = __commonJSMin(((t) => {
t.publicEncrypt = require_publicEncrypt(), t.privateDecrypt = require_privateDecrypt(), t.privateEncrypt = function(e, r) {
return t.publicEncrypt(e, r, !0);
}, t.publicDecrypt = function(e, r) {
return t.privateDecrypt(e, r, !0);
};
})), require_browser$1 = __commonJSMin(((t) => {
function e() {
throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11");
}
init_dist(), init_dist$2();
var r = require_safe_buffer$9(), i = require_browser$11(), n = r.Buffer, o = r.kMaxLength, s = global.crypto || global.msCrypto, a = Math.pow(2, 32) - 1;
function h(t, e) {
if ("number" != typeof t || t != t) throw new TypeError("offset must be a number");
if (t > a || t < 0) throw new TypeError("offset must be a uint32");
if (t > o || t > e) throw new RangeError("offset out of range");
}
function u(t, e, r) {
if ("number" != typeof t || t != t) throw new TypeError("size must be a number");
if (t > a || t < 0) throw new TypeError("size must be a uint32");
if (t + e > r || t > o) throw new RangeError("buffer too small");
}
function f(t, e, r, n) {
if (process$1.browser) {
var o = t.buffer, a = new Uint8Array(o, e, r);
return s.getRandomValues(a), n ? void process$1.nextTick((function() {
n(null, t);
})) : t;
}
if (!n) return i(r).copy(t, e), t;
i(r, (function(r, i) {
if (r) return n(r);
i.copy(t, e), n(null, t);
}));
}
s && s.getRandomValues || !process$1.browser ? (t.randomFill = function(t, e, r, i) {
if (!(n.isBuffer(t) || t instanceof global.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");
if ("function" == typeof e) i = e, e = 0, r = t.length;
else if ("function" == typeof r) i = r, r = t.length - e;
else if ("function" != typeof i) throw new TypeError("\"cb\" argument must be a function");
return h(e, t.length), u(r, e, t.length), f(t, e, r, i);
}, t.randomFillSync = function(t, e, r) {
void 0 === e && (e = 0);
if (!(n.isBuffer(t) || t instanceof global.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");
h(e, t.length), void 0 === r && (r = t.length - e);
return u(r, e, t.length), f(t, e, r);
}) : (t.randomFill = e, t.randomFillSync = e);
})), require_crypto_browserify = __commonJSMin(((t) => {
t.randomBytes = t.rng = t.pseudoRandomBytes = t.prng = require_browser$11(), t.createHash = t.Hash = require_browser$10(), t.createHmac = t.Hmac = require_browser$9();
var e = require_algos(), r = Object.keys(e), i = [
"sha1",
"sha224",
"sha256",
"sha384",
"sha512",
"md5",
"rmd160"
].concat(r);
t.getHashes = function() {
return i;
};
var n = require_browser$8();
t.pbkdf2 = n.pbkdf2, t.pbkdf2Sync = n.pbkdf2Sync;
var o = require_browser$6();
t.Cipher = o.Cipher, t.createCipher = o.createCipher, t.Cipheriv = o.Cipheriv, t.createCipheriv = o.createCipheriv, t.Decipher = o.Decipher, t.createDecipher = o.createDecipher, t.Decipheriv = o.Decipheriv, t.createDecipheriv = o.createDecipheriv, t.getCiphers = o.getCiphers, t.listCiphers = o.listCiphers;
var s = require_browser$5();
t.DiffieHellmanGroup = s.DiffieHellmanGroup, t.createDiffieHellmanGroup = s.createDiffieHellmanGroup, t.getDiffieHellman = s.getDiffieHellman, t.createDiffieHellman = s.createDiffieHellman, t.DiffieHellman = s.DiffieHellman;
var a = require_browser$4();
t.createSign = a.createSign, t.Sign = a.Sign, t.createVerify = a.createVerify, t.Verify = a.Verify, t.createECDH = require_browser$3();
var h = require_browser$2();
t.publicEncrypt = h.publicEncrypt, t.privateEncrypt = h.privateEncrypt, t.publicDecrypt = h.publicDecrypt, t.privateDecrypt = h.privateDecrypt;
var u = require_browser$1();
t.randomFill = u.randomFill, t.randomFillSync = u.randomFillSync, t.createCredentials = function() {
throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify");
}, t.constants = {
DH_CHECK_P_NOT_SAFE_PRIME: 2,
DH_CHECK_P_NOT_PRIME: 1,
DH_UNABLE_TO_CHECK_GENERATOR: 4,
DH_NOT_SUITABLE_GENERATOR: 8,
NPN_ENABLED: 1,
ALPN_ENABLED: 1,
RSA_PKCS1_PADDING: 1,
RSA_SSLV23_PADDING: 2,
RSA_NO_PADDING: 3,
RSA_PKCS1_OAEP_PADDING: 4,
RSA_X931_PADDING: 5,
RSA_PKCS1_PSS_PADDING: 6,
POINT_CONVERSION_COMPRESSED: 2,
POINT_CONVERSION_UNCOMPRESSED: 4,
POINT_CONVERSION_HYBRID: 6
};
})), require_core = __commonJSMin(((t, e) => {
var r, i;
init_dist(), r = t, i = function() {
var t = t || function(t) {
var e;
if ("undefined" != typeof window && window.crypto && (e = window.crypto), "undefined" != typeof self && self.crypto && (e = self.crypto), "undefined" != typeof globalThis && globalThis.crypto && (e = globalThis.crypto), !e && "undefined" != typeof window && window.msCrypto && (e = window.msCrypto), !e && void 0 !== global && global.crypto && (e = global.crypto), !e && "function" == typeof require) try {
e = require_crypto_browserify();
} catch (t) {}
var r = function() {
if (e) {
if ("function" == typeof e.getRandomValues) try {
return e.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0];
} catch (t) {}
if ("function" == typeof e.randomBytes) try {
return e.randomBytes(4).readInt32LE();
} catch (t) {}
}
throw new Error("Native crypto module could not be used to get secure random number.");
}, i = Object.create || function() {
function t() {}
return function(e) {
var r;
return t.prototype = e, r = new t(), t.prototype = null, r;
};
}(), n = {}, o = n.lib = {}, s = o.Base = {
extend: function(t) {
var e = i(this);
return t && e.mixIn(t), e.hasOwnProperty("init") && this.init !== e.init || (e.init = function() {
e.$super.init.apply(this, arguments);
}), e.init.prototype = e, e.$super = this, e;
},
create: function() {
var t = this.extend();
return t.init.apply(t, arguments), t;
},
init: function() {},
mixIn: function(t) {
for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e]);
t.hasOwnProperty("toString") && (this.toString = t.toString);
},
clone: function() {
return this.init.prototype.extend(this);
}
}, a = o.WordArray = s.extend({
init: function(t, e) {
t = this.words = t || [], this.sigBytes = null != e ? e : 4 * t.length;
},
toString: function(t) {
return (t || u).stringify(this);
},
concat: function(t) {
var e = this.words, r = t.words, i = this.sigBytes, n = t.sigBytes;
if (this.clamp(), i % 4) for (var o = 0; o < n; o++) {
var s = r[o >>> 2] >>> 24 - o % 4 * 8 & 255;
e[i + o >>> 2] |= s << 24 - (i + o) % 4 * 8;
}
else for (var a = 0; a < n; a += 4) e[i + a >>> 2] = r[a >>> 2];
return this.sigBytes += n, this;
},
clamp: function() {
var e = this.words, r = this.sigBytes;
e[r >>> 2] &= 4294967295 << 32 - r % 4 * 8, e.length = t.ceil(r / 4);
},
clone: function() {
var t = s.clone.call(this);
return t.words = this.words.slice(0), t;
},
random: function(t) {
for (var e = [], i = 0; i < t; i += 4) e.push(r());
return new a.init(e, t);
}
}), h = n.enc = {}, u = h.Hex = {
stringify: function(t) {
for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) {
var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255;
i.push((o >>> 4).toString(16)), i.push((15 & o).toString(16));
}
return i.join("");
},
parse: function(t) {
for (var e = t.length, r = [], i = 0; i < e; i += 2) r[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4;
return new a.init(r, e / 2);
}
}, f = h.Latin1 = {
stringify: function(t) {
for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) {
var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255;
i.push(String.fromCharCode(o));
}
return i.join("");
},
parse: function(t) {
for (var e = t.length, r = [], i = 0; i < e; i++) r[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8;
return new a.init(r, e);
}
}, l = h.Utf8 = {
stringify: function(t) {
try {
return decodeURIComponent(escape(f.stringify(t)));
} catch (t) {
throw new Error("Malformed UTF-8 data");
}
},
parse: function(t) {
return f.parse(unescape(encodeURIComponent(t)));
}
}, c = o.BufferedBlockAlgorithm = s.extend({
reset: function() {
this._data = new a.init(), this._nDataBytes = 0;
},
_append: function(t) {
"string" == typeof t && (t = l.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes;
},
_process: function(e) {
var r, i = this._data, n = i.words, o = i.sigBytes, s = this.blockSize, h = o / (4 * s), u = (h = e ? t.ceil(h) : t.max((0 | h) - this._minBufferSize, 0)) * s, f = t.min(4 * u, o);
if (u) {
for (var l = 0; l < u; l += s) this._doProcessBlock(n, l);
r = n.splice(0, u), i.sigBytes -= f;
}
return new a.init(r, f);
},
clone: function() {
var t = s.clone.call(this);
return t._data = this._data.clone(), t;
},
_minBufferSize: 0
});
o.Hasher = c.extend({
cfg: s.extend(),
init: function(t) {
this.cfg = this.cfg.extend(t), this.reset();
},
reset: function() {
c.reset.call(this), this._doReset();
},
update: function(t) {
return this._append(t), this._process(), this;
},
finalize: function(t) {
return t && this._append(t), this._doFinalize();
},
blockSize: 16,
_createHelper: function(t) {
return function(e, r) {
return new t.init(r).finalize(e);
};
},
_createHmacHelper: function(t) {
return function(e, r) {
return new d.HMAC.init(t, r).finalize(e);
};
}
});
var d = n.algo = {};
return n;
}(Math);
return t;
}, "object" == typeof t ? e.exports = t = i() : "function" == typeof define && define.amd ? define([], i) : r.CryptoJS = i();
})), require_enc_base64 = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
var e, r;
return r = (e = t).lib.WordArray, e.enc.Base64 = {
stringify: function(t) {
var e = t.words, r = t.sigBytes, i = this._map;
t.clamp();
for (var n = [], o = 0; o < r; o += 3) for (var s = (e[o >>> 2] >>> 24 - o % 4 * 8 & 255) << 16 | (e[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255) << 8 | e[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, a = 0; a < 4 && o + .75 * a < r; a++) n.push(i.charAt(s >>> 6 * (3 - a) & 63));
var h = i.charAt(64);
if (h) for (; n.length % 4;) n.push(h);
return n.join("");
},
parse: function(t) {
var e = t.length, i = this._map, n = this._reverseMap;
if (!n) {
n = this._reverseMap = [];
for (var o = 0; o < i.length; o++) n[i.charCodeAt(o)] = o;
}
var s = i.charAt(64);
if (s) {
var a = t.indexOf(s);
-1 !== a && (e = a);
}
return function(t, e, i) {
for (var n = [], o = 0, s = 0; s < e; s++) if (s % 4) {
var a = i[t.charCodeAt(s - 1)] << s % 4 * 2 | i[t.charCodeAt(s)] >>> 6 - s % 4 * 2;
n[o >>> 2] |= a << 24 - o % 4 * 8, o++;
}
return r.create(n, o);
}(t, e, n);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}, t.enc.Base64;
};
"object" == typeof t ? e.exports = t = i(require_core()) : "function" == typeof define && define.amd ? define(["./core"], i) : i(r.CryptoJS);
})), require_md5 = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
return function(e) {
var r = t, i = r.lib, n = i.WordArray, o = i.Hasher, s = r.algo, a = [];
(function() {
for (var t = 0; t < 64; t++) a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
})();
var h = s.MD5 = o.extend({
_doReset: function() {
this._hash = new n.init([
1732584193,
4023233417,
2562383102,
271733878
]);
},
_doProcessBlock: function(t, e) {
for (var r = 0; r < 16; r++) {
var i = e + r, n = t[i];
t[i] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8);
}
var o = this._hash.words, s = t[e + 0], h = t[e + 1], d = t[e + 2], p = t[e + 3], m = t[e + 4], g = t[e + 5], y = t[e + 6], b = t[e + 7], v = t[e + 8], _ = t[e + 9], w = t[e + 10], M = t[e + 11], S = t[e + 12], E = t[e + 13], A = t[e + 14], C = t[e + 15], O = o[0], P = o[1], I = o[2], k = o[3];
O = u(O, P, I, k, s, 7, a[0]), k = u(k, O, P, I, h, 12, a[1]), I = u(I, k, O, P, d, 17, a[2]), P = u(P, I, k, O, p, 22, a[3]), O = u(O, P, I, k, m, 7, a[4]), k = u(k, O, P, I, g, 12, a[5]), I = u(I, k, O, P, y, 17, a[6]), P = u(P, I, k, O, b, 22, a[7]), O = u(O, P, I, k, v, 7, a[8]), k = u(k, O, P, I, _, 12, a[9]), I = u(I, k, O, P, w, 17, a[10]), P = u(P, I, k, O, M, 22, a[11]), O = u(O, P, I, k, S, 7, a[12]), k = u(k, O, P, I, E, 12, a[13]), I = u(I, k, O, P, A, 17, a[14]), O = f(O, P = u(P, I, k, O, C, 22, a[15]), I, k, h, 5, a[16]), k = f(k, O, P, I, y, 9, a[17]), I = f(I, k, O, P, M, 14, a[18]), P = f(P, I, k, O, s, 20, a[19]), O = f(O, P, I, k, g, 5, a[20]), k = f(k, O, P, I, w, 9, a[21]), I = f(I, k, O, P, C, 14, a[22]), P = f(P, I, k, O, m, 20, a[23]), O = f(O, P, I, k, _, 5, a[24]), k = f(k, O, P, I, A, 9, a[25]), I = f(I, k, O, P, p, 14, a[26]), P = f(P, I, k, O, v, 20, a[27]), O = f(O, P, I, k, E, 5, a[28]), k = f(k, O, P, I, d, 9, a[29]), I = f(I, k, O, P, b, 14, a[30]), O = l(O, P = f(P, I, k, O, S, 20, a[31]), I, k, g, 4, a[32]), k = l(k, O, P, I, v, 11, a[33]), I = l(I, k, O, P, M, 16, a[34]), P = l(P, I, k, O, A, 23, a[35]), O = l(O, P, I, k, h, 4, a[36]), k = l(k, O, P, I, m, 11, a[37]), I = l(I, k, O, P, b, 16, a[38]), P = l(P, I, k, O, w, 23, a[39]), O = l(O, P, I, k, E, 4, a[40]), k = l(k, O, P, I, s, 11, a[41]), I = l(I, k, O, P, p, 16, a[42]), P = l(P, I, k, O, y, 23, a[43]), O = l(O, P, I, k, _, 4, a[44]), k = l(k, O, P, I, S, 11, a[45]), I = l(I, k, O, P, C, 16, a[46]), O = c(O, P = l(P, I, k, O, d, 23, a[47]), I, k, s, 6, a[48]), k = c(k, O, P, I, b, 10, a[49]), I = c(I, k, O, P, A, 15, a[50]), P = c(P, I, k, O, g, 21, a[51]), O = c(O, P, I, k, S, 6, a[52]), k = c(k, O, P, I, p, 10, a[53]), I = c(I, k, O, P, w, 15, a[54]), P = c(P, I, k, O, h, 21, a[55]), O = c(O, P, I, k, v, 6, a[56]), k = c(k, O, P, I, C, 10, a[57]), I = c(I, k, O, P, y, 15, a[58]), P = c(P, I, k, O, E, 21, a[59]), O = c(O, P, I, k, m, 6, a[60]), k = c(k, O, P, I, M, 10, a[61]), I = c(I, k, O, P, d, 15, a[62]), P = c(P, I, k, O, _, 21, a[63]), o[0] = o[0] + O | 0, o[1] = o[1] + P | 0, o[2] = o[2] + I | 0, o[3] = o[3] + k | 0;
},
_doFinalize: function() {
var t = this._data, r = t.words, i = 8 * this._nDataBytes, n = 8 * t.sigBytes;
r[n >>> 5] |= 128 << 24 - n % 32;
var o = e.floor(i / 4294967296), s = i;
r[15 + (n + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), r[14 + (n + 64 >>> 9 << 4)] = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8), t.sigBytes = 4 * (r.length + 1), this._process();
for (var a = this._hash, h = a.words, u = 0; u < 4; u++) {
var f = h[u];
h[u] = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8);
}
return a;
},
clone: function() {
var t = o.clone.call(this);
return t._hash = this._hash.clone(), t;
}
});
function u(t, e, r, i, n, o, s) {
var a = t + (e & r | ~e & i) + n + s;
return (a << o | a >>> 32 - o) + e;
}
function f(t, e, r, i, n, o, s) {
var a = t + (e & i | r & ~i) + n + s;
return (a << o | a >>> 32 - o) + e;
}
function l(t, e, r, i, n, o, s) {
var a = t + (e ^ r ^ i) + n + s;
return (a << o | a >>> 32 - o) + e;
}
function c(t, e, r, i, n, o, s) {
var a = t + (r ^ (e | ~i)) + n + s;
return (a << o | a >>> 32 - o) + e;
}
r.MD5 = o._createHelper(h), r.HmacMD5 = o._createHmacHelper(h);
}(Math), t.MD5;
};
"object" == typeof t ? e.exports = t = i(require_core()) : "function" == typeof define && define.amd ? define(["./core"], i) : i(r.CryptoJS);
})), require_sha1 = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
var e, r, i, n, o, s, a;
return r = (e = t).lib, i = r.WordArray, n = r.Hasher, o = e.algo, s = [], a = o.SHA1 = n.extend({
_doReset: function() {
this._hash = new i.init([
1732584193,
4023233417,
2562383102,
271733878,
3285377520
]);
},
_doProcessBlock: function(t, e) {
for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], a = r[3], h = r[4], u = 0; u < 80; u++) {
if (u < 16) s[u] = 0 | t[e + u];
else {
var f = s[u - 3] ^ s[u - 8] ^ s[u - 14] ^ s[u - 16];
s[u] = f << 1 | f >>> 31;
}
var l = (i << 5 | i >>> 27) + h + s[u];
l += u < 20 ? 1518500249 + (n & o | ~n & a) : u < 40 ? 1859775393 + (n ^ o ^ a) : u < 60 ? (n & o | n & a | o & a) - 1894007588 : (n ^ o ^ a) - 899497514, h = a, a = o, o = n << 30 | n >>> 2, n = i, i = l;
}
r[0] = r[0] + i | 0, r[1] = r[1] + n | 0, r[2] = r[2] + o | 0, r[3] = r[3] + a | 0, r[4] = r[4] + h | 0;
},
_doFinalize: function() {
var t = this._data, e = t.words, r = 8 * this._nDataBytes, i = 8 * t.sigBytes;
return e[i >>> 5] |= 128 << 24 - i % 32, e[14 + (i + 64 >>> 9 << 4)] = Math.floor(r / 4294967296), e[15 + (i + 64 >>> 9 << 4)] = r, t.sigBytes = 4 * e.length, this._process(), this._hash;
},
clone: function() {
var t = n.clone.call(this);
return t._hash = this._hash.clone(), t;
}
}), e.SHA1 = n._createHelper(a), e.HmacSHA1 = n._createHmacHelper(a), t.SHA1;
};
"object" == typeof t ? e.exports = t = i(require_core()) : "function" == typeof define && define.amd ? define(["./core"], i) : i(r.CryptoJS);
})), require_hmac = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
var e, r = (e = t).lib.Base, i = e.enc.Utf8;
e.algo.HMAC = r.extend({
init: function(t, e) {
t = this._hasher = new t.init(), "string" == typeof e && (e = i.parse(e));
var r = t.blockSize, n = 4 * r;
e.sigBytes > n && (e = t.finalize(e)), e.clamp();
for (var o = this._oKey = e.clone(), s = this._iKey = e.clone(), a = o.words, h = s.words, u = 0; u < r; u++) a[u] ^= 1549556828, h[u] ^= 909522486;
o.sigBytes = s.sigBytes = n, this.reset();
},
reset: function() {
var t = this._hasher;
t.reset(), t.update(this._iKey);
},
update: function(t) {
return this._hasher.update(t), this;
},
finalize: function(t) {
var e = this._hasher, r = e.finalize(t);
return e.reset(), e.finalize(this._oKey.clone().concat(r));
}
});
};
"object" == typeof t ? e.exports = t = i(require_core()) : "function" == typeof define && define.amd ? define(["./core"], i) : i(r.CryptoJS);
})), require_evpkdf = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
var e, r, i, n, o, s, a;
return r = (e = t).lib, i = r.Base, n = r.WordArray, o = e.algo, s = o.MD5, a = o.EvpKDF = i.extend({
cfg: i.extend({
keySize: 4,
hasher: s,
iterations: 1
}),
init: function(t) {
this.cfg = this.cfg.extend(t);
},
compute: function(t, e) {
for (var r, i = this.cfg, o = i.hasher.create(), s = n.create(), a = s.words, h = i.keySize, u = i.iterations; a.length < h;) {
r && o.update(r), r = o.update(t).finalize(e), o.reset();
for (var f = 1; f < u; f++) r = o.finalize(r), o.reset();
s.concat(r);
}
return s.sigBytes = 4 * h, s;
}
}), e.EvpKDF = function(t, e, r) {
return a.create(r).compute(t, e);
}, t.EvpKDF;
};
"object" == typeof t ? e.exports = t = i(require_core(), require_sha1(), require_hmac()) : "function" == typeof define && define.amd ? define([
"./core",
"./sha1",
"./hmac"
], i) : i(r.CryptoJS);
})), require_cipher_core = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
t.lib.Cipher || function() {
var e = t, r = e.lib, i = r.Base, n = r.WordArray, o = r.BufferedBlockAlgorithm, s = e.enc;
s.Utf8;
var a = s.Base64, h = e.algo.EvpKDF, u = r.Cipher = o.extend({
cfg: i.extend(),
createEncryptor: function(t, e) {
return this.create(this._ENC_XFORM_MODE, t, e);
},
createDecryptor: function(t, e) {
return this.create(this._DEC_XFORM_MODE, t, e);
},
init: function(t, e, r) {
this.cfg = this.cfg.extend(r), this._xformMode = t, this._key = e, this.reset();
},
reset: function() {
o.reset.call(this), this._doReset();
},
process: function(t) {
return this._append(t), this._process();
},
finalize: function(t) {
return t && this._append(t), this._doFinalize();
},
keySize: 4,
ivSize: 4,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
_createHelper: function() {
function t(t) {
return "string" == typeof t ? b : g;
}
return function(e) {
return {
encrypt: function(r, i, n) {
return t(i).encrypt(e, r, i, n);
},
decrypt: function(r, i, n) {
return t(i).decrypt(e, r, i, n);
}
};
};
}()
});
r.StreamCipher = u.extend({
_doFinalize: function() {
return this._process(!0);
},
blockSize: 1
});
var f = e.mode = {}, l = r.BlockCipherMode = i.extend({
createEncryptor: function(t, e) {
return this.Encryptor.create(t, e);
},
createDecryptor: function(t, e) {
return this.Decryptor.create(t, e);
},
init: function(t, e) {
this._cipher = t, this._iv = e;
}
}), c = f.CBC = function() {
var t = l.extend();
function e(t, e, r) {
var i, n = this._iv;
n ? (i = n, this._iv = void 0) : i = this._prevBlock;
for (var o = 0; o < r; o++) t[e + o] ^= i[o];
}
return t.Encryptor = t.extend({ processBlock: function(t, r) {
var i = this._cipher, n = i.blockSize;
e.call(this, t, r, n), i.encryptBlock(t, r), this._prevBlock = t.slice(r, r + n);
} }), t.Decryptor = t.extend({ processBlock: function(t, r) {
var i = this._cipher, n = i.blockSize, o = t.slice(r, r + n);
i.decryptBlock(t, r), e.call(this, t, r, n), this._prevBlock = o;
} }), t;
}(), d = (e.pad = {}).Pkcs7 = {
pad: function(t, e) {
for (var r = 4 * e, i = r - t.sigBytes % r, o = i << 24 | i << 16 | i << 8 | i, s = [], a = 0; a < i; a += 4) s.push(o);
var h = n.create(s, i);
t.concat(h);
},
unpad: function(t) {
var e = 255 & t.words[t.sigBytes - 1 >>> 2];
t.sigBytes -= e;
}
};
r.BlockCipher = u.extend({
cfg: u.cfg.extend({
mode: c,
padding: d
}),
reset: function() {
var t;
u.reset.call(this);
var e = this.cfg, r = e.iv, i = e.mode;
this._xformMode == this._ENC_XFORM_MODE ? t = i.createEncryptor : (t = i.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == t ? this._mode.init(this, r && r.words) : (this._mode = t.call(i, this, r && r.words), this._mode.__creator = t);
},
_doProcessBlock: function(t, e) {
this._mode.processBlock(t, e);
},
_doFinalize: function() {
var t, e = this.cfg.padding;
return this._xformMode == this._ENC_XFORM_MODE ? (e.pad(this._data, this.blockSize), t = this._process(!0)) : (t = this._process(!0), e.unpad(t)), t;
},
blockSize: 4
});
var p = r.CipherParams = i.extend({
init: function(t) {
this.mixIn(t);
},
toString: function(t) {
return (t || this.formatter).stringify(this);
}
}), m = (e.format = {}).OpenSSL = {
stringify: function(t) {
var e = t.ciphertext, r = t.salt;
return (r ? n.create([1398893684, 1701076831]).concat(r).concat(e) : e).toString(a);
},
parse: function(t) {
var e, r = a.parse(t), i = r.words;
return 1398893684 == i[0] && 1701076831 == i[1] && (e = n.create(i.slice(2, 4)), i.splice(0, 4), r.sigBytes -= 16), p.create({
ciphertext: r,
salt: e
});
}
}, g = r.SerializableCipher = i.extend({
cfg: i.extend({ format: m }),
encrypt: function(t, e, r, i) {
i = this.cfg.extend(i);
var n = t.createEncryptor(r, i), o = n.finalize(e), s = n.cfg;
return p.create({
ciphertext: o,
key: r,
iv: s.iv,
algorithm: t,
mode: s.mode,
padding: s.padding,
blockSize: t.blockSize,
formatter: i.format
});
},
decrypt: function(t, e, r, i) {
return i = this.cfg.extend(i), e = this._parse(e, i.format), t.createDecryptor(r, i).finalize(e.ciphertext);
},
_parse: function(t, e) {
return "string" == typeof t ? e.parse(t, this) : t;
}
}), y = (e.kdf = {}).OpenSSL = { execute: function(t, e, r, i, o) {
if (i || (i = n.random(8)), o) s = h.create({
keySize: e + r,
hasher: o
}).compute(t, i);
else var s = h.create({ keySize: e + r }).compute(t, i);
var a = n.create(s.words.slice(e), 4 * r);
return s.sigBytes = 4 * e, p.create({
key: s,
iv: a,
salt: i
});
} }, b = r.PasswordBasedCipher = g.extend({
cfg: g.cfg.extend({ kdf: y }),
encrypt: function(t, e, r, i) {
var n = (i = this.cfg.extend(i)).kdf.execute(r, t.keySize, t.ivSize, i.salt, i.hasher);
i.iv = n.iv;
var o = g.encrypt.call(this, t, e, n.key, i);
return o.mixIn(n), o;
},
decrypt: function(t, e, r, i) {
i = this.cfg.extend(i), e = this._parse(e, i.format);
var n = i.kdf.execute(r, t.keySize, t.ivSize, e.salt, i.hasher);
return i.iv = n.iv, g.decrypt.call(this, t, e, n.key, i);
}
});
}();
};
"object" == typeof t ? e.exports = t = i(require_core(), require_evpkdf()) : "function" == typeof define && define.amd ? define(["./core", "./evpkdf"], i) : i(r.CryptoJS);
})), require_aes = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
return function() {
var e = t, r = e.lib.BlockCipher, i = e.algo, n = [], o = [], s = [], a = [], h = [], u = [], f = [], l = [], c = [], d = [];
(function() {
for (var t = [], e = 0; e < 256; e++) t[e] = e < 128 ? e << 1 : e << 1 ^ 283;
var r = 0, i = 0;
for (e = 0; e < 256; e++) {
var p = i ^ i << 1 ^ i << 2 ^ i << 3 ^ i << 4;
p = p >>> 8 ^ 255 & p ^ 99, n[r] = p, o[p] = r;
var m = t[r], g = t[m], y = t[g], b = 257 * t[p] ^ 16843008 * p;
s[r] = b << 24 | b >>> 8, a[r] = b << 16 | b >>> 16, h[r] = b << 8 | b >>> 24, u[r] = b, b = 16843009 * y ^ 65537 * g ^ 257 * m ^ 16843008 * r, f[p] = b << 24 | b >>> 8, l[p] = b << 16 | b >>> 16, c[p] = b << 8 | b >>> 24, d[p] = b, r ? (r = m ^ t[t[t[y ^ m]]], i ^= t[t[i]]) : r = i = 1;
}
})();
var p = [
0,
1,
2,
4,
8,
16,
32,
64,
128,
27,
54
], m = i.AES = r.extend({
_doReset: function() {
if (!this._nRounds || this._keyPriorReset !== this._key) {
for (var t = this._keyPriorReset = this._key, e = t.words, r = t.sigBytes / 4, i = 4 * ((this._nRounds = r + 6) + 1), o = this._keySchedule = [], s = 0; s < i; s++) s < r ? o[s] = e[s] : (u = o[s - 1], s % r ? r > 6 && s % r == 4 && (u = n[u >>> 24] << 24 | n[u >>> 16 & 255] << 16 | n[u >>> 8 & 255] << 8 | n[255 & u]) : (u = n[(u = u << 8 | u >>> 24) >>> 24] << 24 | n[u >>> 16 & 255] << 16 | n[u >>> 8 & 255] << 8 | n[255 & u], u ^= p[s / r | 0] << 24), o[s] = o[s - r] ^ u);
for (var a = this._invKeySchedule = [], h = 0; h < i; h++) {
if (s = i - h, h % 4) var u = o[s];
else u = o[s - 4];
a[h] = h < 4 || s <= 4 ? u : f[n[u >>> 24]] ^ l[n[u >>> 16 & 255]] ^ c[n[u >>> 8 & 255]] ^ d[n[255 & u]];
}
}
},
encryptBlock: function(t, e) {
this._doCryptBlock(t, e, this._keySchedule, s, a, h, u, n);
},
decryptBlock: function(t, e) {
var r = t[e + 1];
t[e + 1] = t[e + 3], t[e + 3] = r, this._doCryptBlock(t, e, this._invKeySchedule, f, l, c, d, o), r = t[e + 1], t[e + 1] = t[e + 3], t[e + 3] = r;
},
_doCryptBlock: function(t, e, r, i, n, o, s, a) {
for (var h = this._nRounds, u = t[e] ^ r[0], f = t[e + 1] ^ r[1], l = t[e + 2] ^ r[2], c = t[e + 3] ^ r[3], d = 4, p = 1; p < h; p++) {
var m = i[u >>> 24] ^ n[f >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & c] ^ r[d++], g = i[f >>> 24] ^ n[l >>> 16 & 255] ^ o[c >>> 8 & 255] ^ s[255 & u] ^ r[d++], y = i[l >>> 24] ^ n[c >>> 16 & 255] ^ o[u >>> 8 & 255] ^ s[255 & f] ^ r[d++], b = i[c >>> 24] ^ n[u >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & l] ^ r[d++];
u = m, f = g, l = y, c = b;
}
m = (a[u >>> 24] << 24 | a[f >>> 16 & 255] << 16 | a[l >>> 8 & 255] << 8 | a[255 & c]) ^ r[d++], g = (a[f >>> 24] << 24 | a[l >>> 16 & 255] << 16 | a[c >>> 8 & 255] << 8 | a[255 & u]) ^ r[d++], y = (a[l >>> 24] << 24 | a[c >>> 16 & 255] << 16 | a[u >>> 8 & 255] << 8 | a[255 & f]) ^ r[d++], b = (a[c >>> 24] << 24 | a[u >>> 16 & 255] << 16 | a[f >>> 8 & 255] << 8 | a[255 & l]) ^ r[d++], t[e] = m, t[e + 1] = g, t[e + 2] = y, t[e + 3] = b;
},
keySize: 8
});
e.AES = r._createHelper(m);
}(), t.AES;
};
"object" == typeof t ? e.exports = t = i(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()) : "function" == typeof define && define.amd ? define([
"./core",
"./enc-base64",
"./md5",
"./evpkdf",
"./cipher-core"
], i) : i(r.CryptoJS);
})), require_enc_utf8 = __commonJSMin(((t, e) => {
var r = t, i = function(t) {
return t.enc.Utf8;
};
"object" == typeof t ? e.exports = t = i(require_core()) : "function" == typeof define && define.amd ? define(["./core"], i) : i(r.CryptoJS);
})), import_CryptoJS = __toESM(require_CryptoJS()), import_aes = __toESM(require_aes()), import_enc_utf8 = __toESM(require_enc_utf8()), AES = import_aes.default || import_aes, ENC = import_enc_utf8.default || import_enc_utf8;
var CryptoController = {
encrypt: (t, e) => AES.encrypt(JSON.stringify(t), e).toString(),
decrypt: (t, e) => AES.decrypt(t, e).toString(ENC)
};
function canBeSerialized(t) {
if (!(t instanceof CoreManager.getParseObject())) return !0;
const e = t.attributes;
for (const t in e) if (!canBeSerializedHelper(e[t])) return !1;
return !0;
}
function canBeSerializedHelper(t) {
if ("object" != typeof t) return !0;
if (t instanceof ParseRelation) return !0;
if (t instanceof CoreManager.getParseObject()) return !!t.id;
if (t instanceof ParseFile) return !!t.url();
if (Array.isArray(t)) {
for (let e = 0; e < t.length; e++) if (!canBeSerializedHelper(t[e])) return !1;
return !0;
}
for (const e in t) if (!canBeSerializedHelper(t[e])) return !1;
return !0;
}
var encoded = {
"&": "&",
"<": "<",
">": ">",
"/": "/",
"'": "'",
"\"": """
};
function escape$1(t) {
return t.replace(/[&<>\/'"]/g, (function(t) {
return encoded[t];
}));
}
function parseDate(t) {
const e = (/* @__PURE__ */ new RegExp("^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(.([0-9]+))?Z$")).exec(t);
if (!e) return null;
const r = parseInt(e[1]) || 0, i = (parseInt(e[2]) || 1) - 1, n = parseInt(e[3]) || 0, o = parseInt(e[4]) || 0, s = parseInt(e[5]) || 0, a = parseInt(e[6]) || 0, h = parseInt(e[8]) || 0;
return new Date(Date.UTC(r, i, n, o, s, a, h));
}
function resolvingPromise() {
let t, e;
const r = new Promise(((r, i) => {
t = r, e = i;
}));
return r.resolve = t, r.reject = e, r;
}
function when(t) {
let e;
const r = Array.isArray(t);
e = r ? t : arguments;
let i = e.length, n = !1;
const o = [], s = r ? [o] : o, a = [];
if (o.length = e.length, a.length = e.length, 0 === i) return Promise.resolve(s);
const h = resolvingPromise(), u = function() {
i--, i <= 0 && (n ? h.reject(a) : h.resolve(s));
}, f = function(t, e) {
t && "function" == typeof t.then ? t.then((function(t) {
o[e] = t, u();
}), (function(t) {
a[e] = t, n = !0, u();
})) : (o[e] = t, u());
};
for (let t = 0; t < e.length; t++) f(e[t], t);
return h;
}
function continueWhile(t, e) {
return t() ? e().then((() => continueWhile(t, e))) : Promise.resolve();
}
var DEFAULT_PIN = "_default", PIN_PREFIX = "parsePin_", OBJECT_PREFIX = "Parse_LDS_";
function isLocalDatastoreKey(t) {
return !(!t || "_default" !== t && !t.startsWith("parsePin_") && !t.startsWith("Parse_LDS_"));
}
var uuid = function() {
const t = [], e = "0123456789abcdef";
for (let r = 0; r < 36; r++) t[r] = e.substr(Math.floor(16 * Math.random()), 1);
return t[14] = "4", t[19] = e.substr(3 & Number(t[19]) | 8, 1), t[8] = t[13] = t[18] = t[23] = "-", t.join("");
};
function arrayContainsObject(t, e) {
if (t.indexOf(e) > -1) return !0;
const r = CoreManager.getParseObject();
for (let i = 0; i < t.length; i++) if (t[i] instanceof r && t[i].className === e.className && t[i]._getId() === e._getId()) return !0;
return !1;
}
function unique(t) {
const e = [];
return t.forEach(((t) => {
t instanceof CoreManager.getParseObject() ? arrayContainsObject(e, t) || e.push(t) : e.indexOf(t) < 0 && e.push(t);
})), e;
}
function opFromJSON(t) {
if (!t || !t.__op) return null;
switch (t.__op) {
case "Delete": return new UnsetOp();
case "Increment": return new IncrementOp(t.amount);
case "Add": return new AddOp(decode(t.objects));
case "AddUnique": return new AddUniqueOp(decode(t.objects));
case "Remove": return new RemoveOp(decode(t.objects));
case "AddRelation": {
const e = decode(t.objects);
return Array.isArray(e) ? new RelationOp(e, []) : new RelationOp([], []);
}
case "RemoveRelation": {
const e = decode(t.objects);
return Array.isArray(e) ? new RelationOp([], e) : new RelationOp([], []);
}
case "Batch": {
let e = [], r = [];
for (let i = 0; i < t.ops.length; i++) "AddRelation" === t.ops[i].__op ? e = e.concat(decode(t.ops[i].objects)) : "RemoveRelation" === t.ops[i].__op && (r = r.concat(decode(t.ops[i].objects)));
return new RelationOp(e, r);
}
}
return null;
}
var Op = class {
applyTo(t) {}
mergeWith(t) {}
toJSON(t) {}
}, SetOp = class t extends Op {
constructor(t) {
super(), this._value = t;
}
applyTo() {
return this._value;
}
mergeWith() {
return new t(this._value);
}
toJSON(t) {
return encode_default(this._value, !1, !0, void 0, t);
}
}, UnsetOp = class t extends Op {
applyTo() {}
mergeWith() {
return new t();
}
toJSON() {
return { __op: "Delete" };
}
}, IncrementOp = class t extends Op {
constructor(t) {
if (super(), "number" != typeof t) throw new TypeError("Increment Op must be initialized with a numeric amount.");
this._amount = t;
}
applyTo(t) {
if (void 0 === t) return this._amount;
if ("number" != typeof t) throw new TypeError("Cannot increment a non-numeric value.");
return this._amount + t;
}
mergeWith(e) {
if (!e) return this;
if (e instanceof SetOp) return new SetOp(this.applyTo(e._value));
if (e instanceof UnsetOp) return new SetOp(this._amount);
if (e instanceof t) return new t(this.applyTo(e._amount));
throw new Error("Cannot merge Increment Op with the previous Op");
}
toJSON() {
return {
__op: "Increment",
amount: this._amount
};
}
}, AddOp = class t extends Op {
constructor(t) {
super(), this._value = Array.isArray(t) ? t : [t];
}
applyTo(t) {
if (null == t) return this._value;
if (Array.isArray(t)) return t.concat(this._value);
throw new Error("Cannot add elements to a non-array value");
}
mergeWith(e) {
if (!e) return this;
if (e instanceof SetOp) return new SetOp(this.applyTo(e._value));
if (e instanceof UnsetOp) return new SetOp(this._value);
if (e instanceof t) return new t(this.applyTo(e._value));
throw new Error("Cannot merge Add Op with the previous Op");
}
toJSON() {
return {
__op: "Add",
objects: encode_default(this._value, !1, !0)
};
}
}, AddUniqueOp = class t extends Op {
constructor(t) {
super(), this._value = unique(Array.isArray(t) ? t : [t]);
}
applyTo(t) {
if (null == t) return this._value || [];
if (Array.isArray(t)) {
const e = CoreManager.getParseObject(), r = [];
return this._value.forEach(((i) => {
i instanceof e ? arrayContainsObject(t, i) || r.push(i) : t.indexOf(i) < 0 && r.push(i);
})), t.concat(r);
}
throw new Error("Cannot add elements to a non-array value");
}
mergeWith(e) {
if (!e) return this;
if (e instanceof SetOp) return new SetOp(this.applyTo(e._value));
if (e instanceof UnsetOp) return new SetOp(this._value);
if (e instanceof t) return new t(this.applyTo(e._value));
throw new Error("Cannot merge AddUnique Op with the previous Op");
}
toJSON() {
return {
__op: "AddUnique",
objects: encode_default(this._value, !1, !0)
};
}
}, RemoveOp = class t extends Op {
constructor(t) {
super(), this._value = unique(Array.isArray(t) ? t : [t]);
}
applyTo(t) {
if (null == t) return [];
if (Array.isArray(t)) {
const e = CoreManager.getParseObject(), r = t.concat([]);
for (let t = 0; t < this._value.length; t++) {
let i = r.indexOf(this._value[t]);
for (; i > -1;) r.splice(i, 1), i = r.indexOf(this._value[t]);
if (this._value[t] instanceof e && this._value[t].id) for (let i = 0; i < r.length; i++) r[i] instanceof e && this._value[t].id === r[i].id && (r.splice(i, 1), i--);
}
return r;
}
throw new Error("Cannot remove elements from a non-array value");
}
mergeWith(e) {
if (!e) return this;
if (e instanceof SetOp) return new SetOp(this.applyTo(e._value));
if (e instanceof UnsetOp) return new UnsetOp();
if (e instanceof t) {
const r = CoreManager.getParseObject(), i = e._value.concat([]);
for (let t = 0; t < this._value.length; t++) this._value[t] instanceof r ? arrayContainsObject(i, this._value[t]) || i.push(this._value[t]) : i.indexOf(this._value[t]) < 0 && i.push(this._value[t]);
return new t(i);
}
throw new Error("Cannot merge Remove Op with the previous Op");
}
toJSON() {
return {
__op: "Remove",
objects: encode_default(this._value, !1, !0)
};
}
}, RelationOp = class t extends Op {
constructor(t, e) {
super(), this._targetClassName = null, Array.isArray(t) && (this.relationsToAdd = unique(t.map(this._extractId, this))), Array.isArray(e) && (this.relationsToRemove = unique(e.map(this._extractId, this)));
}
_extractId(t) {
if ("string" == typeof t) return t;
if (!t.id) throw new Error("You cannot add or remove an unsaved Parse Object from a relation");
if (this._targetClassName || (this._targetClassName = t.className), this._targetClassName !== t.className) throw new Error("Tried to create a Relation with 2 different object types: " + this._targetClassName + " and " + t.className + ".");
return t.id;
}
applyTo(t, e, r) {
if (!t) {
if (!e || !r) throw new Error("Cannot apply a RelationOp without either a previous value, or an object and a key");
const t = new ParseRelation(e, r);
return t.targetClassName = this._targetClassName, t;
}
if (t instanceof ParseRelation) {
if (this._targetClassName) if (t.targetClassName) {
if (this._targetClassName !== t.targetClassName) throw new Error("Related object must be a " + t.targetClassName + ", but a " + this._targetClassName + " was passed in.");
} else t.targetClassName = this._targetClassName;
return t;
}
throw new Error("Relation cannot be applied to a non-relation field");
}
mergeWith(e) {
if (!e) return this;
if (e instanceof UnsetOp) throw new Error("You cannot modify a relation after deleting it.");
if (e instanceof SetOp && e._value instanceof ParseRelation) return this;
if (e instanceof t) {
if (e._targetClassName && e._targetClassName !== this._targetClassName) throw new Error("Related object must be of class " + e._targetClassName + ", but " + (this._targetClassName || "null") + " was passed in.");
const r = e.relationsToAdd.concat([]);
this.relationsToRemove.forEach(((t) => {
const e = r.indexOf(t);
e > -1 && r.splice(e, 1);
})), this.relationsToAdd.forEach(((t) => {
r.indexOf(t) < 0 && r.push(t);
}));
const i = e.relationsToRemove.concat([]);
this.relationsToAdd.forEach(((t) => {
const e = i.indexOf(t);
e > -1 && i.splice(e, 1);
})), this.relationsToRemove.forEach(((t) => {
i.indexOf(t) < 0 && i.push(t);
}));
const n = new t(r, i);
return n._targetClassName = this._targetClassName, n;
}
throw new Error("Cannot merge Relation Op with the previous Op");
}
toJSON() {
const t = (t) => ({
__type: "Pointer",
className: this._targetClassName,
objectId: t
});
let e = null, r = null, i = null;
return this.relationsToAdd.length > 0 && (e = this.relationsToAdd.map(t), r = {
__op: "AddRelation",
objects: e
}), this.relationsToRemove.length > 0 && (e = this.relationsToRemove.map(t), i = {
__op: "RemoveRelation",
objects: e
}), r && i ? {
__op: "Batch",
ops: [r, i]
} : r || i || {};
}
};
CoreManager.setParseOp({
Op,
opFromJSON,
SetOp,
UnsetOp,
IncrementOp,
AddOp,
RelationOp,
RemoveOp,
AddUniqueOp
});
var TaskQueue = class {
constructor() {
this.queue = [];
}
enqueue(t) {
const e = resolvingPromise();
return this.queue.push({
task: t,
_completion: e
}), 1 === this.queue.length && t().then((() => {
this._dequeue(), e.resolve();
}), ((t) => {
this._dequeue(), e.reject(t);
})), e;
}
_dequeue() {
if (this.queue.shift(), this.queue.length) {
const t = this.queue[0];
t.task().then((() => {
this._dequeue(), t._completion.resolve();
}), ((e) => {
this._dequeue(), t._completion.reject(e);
}));
}
}
};
function defaultState() {
return {
serverData: Object.create(null),
pendingOps: [Object.create(null)],
objectCache: Object.create(null),
tasks: new TaskQueue(),
existed: !1
};
}
function setServerData$2(t, e) {
for (const r in e) Object.prototype.hasOwnProperty.call(e, r) && (isDangerousKey(r) || (void 0 !== e[r] ? t[r] = e[r] : delete t[r]));
}
function setPendingOp$2(t, e, r) {
if (isDangerousKey(e)) return;
const i = t.length - 1;
r ? t[i][e] = r : delete t[i][e];
}
function pushPendingState$2(t) {
t.push(Object.create(null));
}
function popPendingState$2(t) {
const e = t.shift();
return t.length || (t[0] = Object.create(null)), e;
}
function mergeFirstPendingState$2(t) {
const e = popPendingState$2(t), r = t[0];
for (const t in e) if (Object.prototype.hasOwnProperty.call(e, t) && !isDangerousKey(t)) if (r[t] && e[t]) {
const i = r[t].mergeWith(e[t]);
i && (r[t] = i);
} else r[t] = e[t];
}
function estimateAttribute$2(t, e, r, i) {
if (isDangerousKey(i)) return;
let n = t[i];
for (let t = 0; t < e.length; t++) e[t][i] && (e[t][i] instanceof RelationOp ? r.id && (n = e[t][i].applyTo(n, r, i)) : n = e[t][i].applyTo(n));
return n;
}
function estimateAttributes$2(t, e, r) {
const i = Object.create(null);
let n;
for (n in t) i[n] = t[n];
for (let t = 0; t < e.length; t++) for (n in e[t]) if (Object.prototype.hasOwnProperty.call(e[t], n) && !isDangerousKey(n)) if (e[t][n] instanceof RelationOp) r.id && (i[n] = e[t][n].applyTo(i[n], r, n));
else if (n.includes(".")) {
const r = n.split("."), o = r[r.length - 1];
let s = i;
for (let t = 0; t < r.length - 1; t++) {
const e = r[t];
if (e in s) Array.isArray(s[e]) ? s[e] = [...s[e]] : s[e] = { ...s[e] };
else {
const i = r[t + 1];
isNaN(i) ? s[e] = Object.create(null) : s[e] = [];
}
s = s[e];
}
s[o] = e[t][n].applyTo(s[o]);
} else i[n] = e[t][n].applyTo(i[n]);
return i;
}
function nestedSet(t, e, r) {
const i = e.split(".");
for (let e = 0; e < i.length - 1; e++) {
const r = i[e];
if (!(r in t)) {
const n = i[e + 1];
isNaN(n) ? t[r] = Object.create(null) : t[r] = [];
}
t = t[r];
}
void 0 === r ? delete t[i[i.length - 1]] : t[i[i.length - 1]] = r;
}
function commitServerChanges$2(t, e, r) {
const i = CoreManager.getParseObject();
for (const n in r) {
if (!Object.prototype.hasOwnProperty.call(r, n)) continue;
if (isDangerousKey(n)) continue;
const o = r[n];
if (nestedSet(t, n, o), o && "object" == typeof o && !(o instanceof i) && !(o instanceof ParseFile) && !(o instanceof ParseRelation)) {
const t = encode_default(o, !1, !0);
e[n] = JSON.stringify(t);
}
}
}
var SingleInstanceStateController_exports = __exportAll({
clearAllState: () => clearAllState$1,
commitServerChanges: () => commitServerChanges$1,
duplicateState: () => duplicateState$1,
enqueueTask: () => enqueueTask$1,
estimateAttribute: () => estimateAttribute$1,
estimateAttributes: () => estimateAttributes$1,
getObjectCache: () => getObjectCache$1,
getPendingOps: () => getPendingOps$1,
getServerData: () => getServerData$1,
getState: () => getState$1,
initializeState: () => initializeState$1,
mergeFirstPendingState: () => mergeFirstPendingState$1,
popPendingState: () => popPendingState$1,
pushPendingState: () => pushPendingState$1,
removeState: () => removeState$1,
setPendingOp: () => setPendingOp$1,
setServerData: () => setServerData$1
}), objectState$1 = Object.create(null);
function getState$1(t) {
const e = objectState$1[t.className];
return e && e[t.id] || null;
}
function initializeState$1(t, e) {
let r = getState$1(t);
return r || (objectState$1[t.className] || (objectState$1[t.className] = Object.create(null)), e || (e = defaultState()), r = objectState$1[t.className][t.id] = e, r);
}
function removeState$1(t) {
const e = getState$1(t);
return null === e ? null : (delete objectState$1[t.className][t.id], e);
}
function getServerData$1(t) {
const e = getState$1(t);
return e ? e.serverData : {};
}
function setServerData$1(t, e) {
setServerData$2(initializeState$1(t).serverData, e);
}
function getPendingOps$1(t) {
const e = getState$1(t);
return e ? e.pendingOps : [{}];
}
function setPendingOp$1(t, e, r) {
setPendingOp$2(initializeState$1(t).pendingOps, e, r);
}
function pushPendingState$1(t) {
pushPendingState$2(initializeState$1(t).pendingOps);
}
function popPendingState$1(t) {
return popPendingState$2(initializeState$1(t).pendingOps);
}
function mergeFirstPendingState$1(t) {
mergeFirstPendingState$2(getPendingOps$1(t));
}
function getObjectCache$1(t) {
const e = getState$1(t);
return e ? e.objectCache : {};
}
function estimateAttribute$1(t, e) {
return estimateAttribute$2(getServerData$1(t), getPendingOps$1(t), t, e);
}
function estimateAttributes$1(t) {
return estimateAttributes$2(getServerData$1(t), getPendingOps$1(t), t);
}
function commitServerChanges$1(t, e) {
const r = initializeState$1(t);
commitServerChanges$2(r.serverData, r.objectCache, e);
}
function enqueueTask$1(t, e) {
return initializeState$1(t).tasks.enqueue(e);
}
function clearAllState$1() {
objectState$1 = Object.create(null);
}
function duplicateState$1(t, e) {
e.id = t.id;
}
var UniqueInstanceStateController_exports = __exportAll({
clearAllState: () => clearAllState,
commitServerChanges: () => commitServerChanges,
duplicateState: () => duplicateState,
enqueueTask: () => enqueueTask,
estimateAttribute: () => estimateAttribute,
estimateAttributes: () => estimateAttributes,
getObjectCache: () => getObjectCache,
getPendingOps: () => getPendingOps,
getServerData: () => getServerData,
getState: () => getState,
initializeState: () => initializeState,
mergeFirstPendingState: () => mergeFirstPendingState,
popPendingState: () => popPendingState,
pushPendingState: () => pushPendingState,
removeState: () => removeState,
setPendingOp: () => setPendingOp,
setServerData: () => setServerData
}), objectState = /* @__PURE__ */ new WeakMap();
function getState(t) {
return objectState.get(t) || null;
}
function initializeState(t, e) {
let r = getState(t);
return r || (e || (e = {
serverData: {},
pendingOps: [{}],
objectCache: {},
tasks: new TaskQueue(),
existed: !1
}), r = e, objectState.set(t, r), r);
}
function removeState(t) {
const e = getState(t);
return null === e ? null : (objectState.delete(t), e);
}
function getServerData(t) {
const e = getState(t);
return e ? e.serverData : {};
}
function setServerData(t, e) {
setServerData$2(initializeState(t).serverData, e);
}
function getPendingOps(t) {
const e = getState(t);
return e ? e.pendingOps : [{}];
}
function setPendingOp(t, e, r) {
setPendingOp$2(initializeState(t).pendingOps, e, r);
}
function pushPendingState(t) {
pushPendingState$2(initializeState(t).pendingOps);
}
function popPendingState(t) {
return popPendingState$2(initializeState(t).pendingOps);
}
function mergeFirstPendingState(t) {
mergeFirstPendingState$2(getPendingOps(t));
}
function getObjectCache(t) {
const e = getState(t);
return e ? e.objectCache : {};
}
function estimateAttribute(t, e) {
return estimateAttribute$2(getServerData(t), getPendingOps(t), t, e);
}
function estimateAttributes(t) {
return estimateAttributes$2(getServerData(t), getPendingOps(t), t);
}
function commitServerChanges(t, e) {
const r = initializeState(t);
commitServerChanges$2(r.serverData, r.objectCache, e);
}
function enqueueTask(t, e) {
return initializeState(t).tasks.enqueue(e);
}
function duplicateState(t, e) {
const r = initializeState(t), i = initializeState(e);
for (const t in r.serverData) i.serverData[t] = r.serverData[t];
for (let t = 0; t < r.pendingOps.length; t++) for (const e in r.pendingOps[t]) i.pendingOps[t][e] = r.pendingOps[t][e];
for (const t in r.objectCache) i.objectCache[t] = r.objectCache[t];
i.existed = r.existed;
}
function clearAllState() {
objectState = /* @__PURE__ */ new WeakMap();
}
function unsavedChildren(t, e) {
const r = {
objects: {},
files: []
}, i = t.className + ":" + t._getId();
r.objects[i] = !t.dirty() || t;
const n = t.attributes;
for (const t in n) "object" == typeof n[t] && traverse(n[t], r, !1, !!e);
const o = [];
for (const t in r.objects) t !== i && !0 !== r.objects[t] && o.push(r.objects[t]);
return o.concat(r.files);
}
function traverse(t, e, r, i) {
if (t instanceof CoreManager.getParseObject()) {
if (!t.id && r) throw new Error("Cannot create a pointer to an unsaved Object.");
const n = t.className + ":" + t._getId();
if (!e.objects[n]) {
e.objects[n] = !t.dirty() || t;
const r = t.attributes;
for (const t in r) "object" == typeof r[t] && traverse(r[t], e, !i, i);
}
} else if (t instanceof ParseFile) !t.url() && e.files.indexOf(t) < 0 && e.files.push(t);
else if (!(t instanceof ParseRelation)) {
Array.isArray(t) && t.forEach(((t) => {
"object" == typeof t && traverse(t, e, r, i);
}));
for (const n in t) "object" == typeof t[n] && traverse(t[n], e, r, i);
}
}
var classMap = Object.create(null), objectCount = 0, singleInstance = !CoreManager.get("IS_NODE");
function getServerUrlPath() {
let t = CoreManager.get("SERVER_URL");
"/" !== t[t.length - 1] && (t += "/");
const e = t.replace(/https?:\/\//, "");
return e.substr(e.indexOf("/"));
}
singleInstance ? CoreManager.setObjectStateController(SingleInstanceStateController_exports) : CoreManager.setObjectStateController(UniqueInstanceStateController_exports);
var ParseObject = class t {
constructor(t, e, r) {
"function" == typeof this.initialize && this.initialize.apply(this, arguments);
let i = null;
if (this._objCount = objectCount++, "string" == typeof t) this.className = t, e && "object" == typeof e && (i = e);
else if (t && "object" == typeof t) {
this.className = t.className, i = {};
for (const e in t) "className" !== e && (i[e] = t[e]);
e && "object" == typeof e && (r = e);
}
if (i) try {
this.set(i, r);
} catch (t) {
throw new Error("Can't create an invalid Parse Object");
}
CoreManager.get("NODE_LOGGING") && (this[Symbol.for("nodejs.util.inspect.custom")] = function() {
return `ParseObject: className: ${this.className}, id: ${this.id}\nAttributes: ${JSON.stringify(this.attributes, null, 2)}`;
});
}
get attributes() {
const t = CoreManager.getObjectStateController();
return Object.freeze(t.estimateAttributes(this._getStateIdentifier()));
}
get createdAt() {
return this._getServerData().createdAt;
}
get updatedAt() {
return this._getServerData().updatedAt;
}
_getId() {
if ("string" == typeof this.id) return this.id;
if ("string" == typeof this._localId) return this._localId;
const t = "local" + uuid();
return this._localId = t, t;
}
_getStateIdentifier() {
if (singleInstance) {
let t = this.id;
return t || (t = this._getId()), {
id: t,
className: this.className
};
}
return this;
}
_getServerData() {
return CoreManager.getObjectStateController().getServerData(this._getStateIdentifier());
}
_clearServerData() {
const t = this._getServerData(), e = {};
for (const r in t) e[r] = void 0;
CoreManager.getObjectStateController().setServerData(this._getStateIdentifier(), e);
}
_getPendingOps() {
return CoreManager.getObjectStateController().getPendingOps(this._getStateIdentifier());
}
_clearPendingOps(t) {
const e = this._getPendingOps(), r = e[e.length - 1];
(t || Object.keys(r)).forEach(((t) => {
delete r[t];
}));
}
_getDirtyObjectAttributes() {
const e = this.attributes, r = CoreManager.getObjectStateController().getObjectCache(this._getStateIdentifier()), i = {};
for (const n in e) {
const o = e[n];
if (o && "object" == typeof o && !(o instanceof t) && !(o instanceof ParseFile) && !(o instanceof ParseRelation)) try {
const t = encode_default(o, !1, !0), e = JSON.stringify(t);
r[n] !== e && (i[n] = o);
} catch (t) {
i[n] = o;
}
}
return i;
}
_toFullJSON(t, e) {
const r = this.toJSON(t, e);
return r.__type = "Object", r.className = this.className, r;
}
_getSaveJSON() {
const t = this._getPendingOps(), e = this._getDirtyObjectAttributes(), r = {};
let i;
for (i in e) {
let n = !1;
for (let e = 0; e < t.length; e += 1) for (const r in t[e]) if (r.includes(".") && r.split(".")[0] === i) {
n = !0;
break;
}
n || (r[i] = new SetOp(e[i]).toJSON());
}
for (i in t[0]) r[i] = t[0][i].toJSON();
return r;
}
_getSaveParams() {
let t = this.id ? "PUT" : "POST";
const e = this._getSaveJSON();
let r = "classes/" + this.className;
return CoreManager.get("ALLOW_CUSTOM_OBJECT_ID") ? this.createdAt ? (t = "PUT", r += "/" + this.id) : (t = "POST", e.objectId = this.id) : this.id ? r += "/" + this.id : "_User" === this.className && (r = "users"), {
method: t,
body: e,
path: r
};
}
_finishFetch(t) {
!this.id && t.objectId && (this.id = t.objectId);
const e = CoreManager.getObjectStateController();
e.initializeState(this._getStateIdentifier());
const r = {};
for (const e in t) "ACL" === e ? r[e] = new ParseACL(t[e]) : "objectId" !== e && (r[e] = decode(t[e]), r[e] instanceof ParseRelation && r[e]._ensureParentAndKey(this, e));
r.createdAt && "string" == typeof r.createdAt && (r.createdAt = parseDate(r.createdAt)), r.updatedAt && "string" == typeof r.updatedAt && (r.updatedAt = parseDate(r.updatedAt)), !r.updatedAt && r.createdAt && (r.updatedAt = r.createdAt), e.commitServerChanges(this._getStateIdentifier(), r);
}
_setExisted(t) {
const e = CoreManager.getObjectStateController().getState(this._getStateIdentifier());
e && (e.existed = t);
}
_migrateId(t) {
if (this._localId && t) if (singleInstance) {
const e = CoreManager.getObjectStateController(), r = e.removeState(this._getStateIdentifier());
this.id = t, delete this._localId, r && e.initializeState(this._getStateIdentifier(), r);
} else this.id = t, delete this._localId;
}
_handleSaveResponse(t, e) {
const r = {};
let i;
const n = CoreManager.getObjectStateController(), o = n.popPendingState(this._getStateIdentifier());
for (i in o) o[i] instanceof RelationOp ? r[i] = o[i].applyTo(void 0, this, i) : i in t || (r[i] = o[i].applyTo(void 0));
for (i in t) if ("createdAt" !== i && "updatedAt" !== i || "string" != typeof t[i]) {
if ("ACL" === i) r[i] = new ParseACL(t[i]);
else if ("objectId" !== i) {
const e = decode(t[i]);
e && Object.getPrototypeOf(e) === Object.prototype ? r[i] = {
...this.attributes[i],
...e
} : r[i] = e, r[i] instanceof UnsetOp && (r[i] = void 0);
}
} else r[i] = parseDate(t[i]);
r.createdAt && !r.updatedAt && (r.updatedAt = r.createdAt), this._migrateId(t.objectId), 201 !== e && this._setExisted(!0), n.commitServerChanges(this._getStateIdentifier(), r);
}
_handleSaveError() {
CoreManager.getObjectStateController().mergeFirstPendingState(this._getStateIdentifier());
}
static _getClassMap() {
return classMap;
}
static _getRequestOptions(e = {}) {
const r = {};
if ("[object Object]" !== Object.prototype.toString.call(e)) throw new Error("request options must be of type Object");
const { hasOwn: i } = Object;
return i(e, "useMasterKey") && (r.useMasterKey = !!e.useMasterKey), i(e, "useMaintenanceKey") && (r.useMaintenanceKey = !!e.useMaintenanceKey), i(e, "sessionToken") && "string" == typeof e.sessionToken && (r.sessionToken = e.sessionToken), i(e, "installationId") && "string" == typeof e.installationId && (r.installationId = e.installationId), i(e, "transaction") && "boolean" == typeof e.transaction && (r.transaction = e.transaction), i(e, "batchSize") && "number" == typeof e.batchSize && (r.batchSize = e.batchSize), i(e, "context") && "object" == typeof e.context && (r.context = e.context), i(e, "include") && (r.include = t.handleIncludeOptions(e)), i(e, "usePost") && (r.usePost = e.usePost), i(e, "json") && (r.json = e.json), r;
}
initialize() {}
toJSON(t, e) {
const r = this.id ? this.className + ":" + this.id : this;
t = t || [r];
const i = {}, n = this.attributes;
for (const r in n) "createdAt" !== r && "updatedAt" !== r || !n[r].toJSON ? i[r] = encode_default(n[r], !1, !1, t, e) : i[r] = n[r].toJSON();
const o = this._getPendingOps();
for (const t in o[0]) t.indexOf(".") < 0 && (i[t] = o[0][t].toJSON(e));
return this.id && (i.objectId = this.id), i;
}
equals(e) {
return this === e || e instanceof t && this.className === e.className && this.id === e.id && void 0 !== this.id;
}
dirty(t) {
if (!this.id) return !0;
const e = this._getPendingOps(), r = this._getDirtyObjectAttributes();
if (t) {
if (Object.hasOwn(r, t)) return !0;
for (let r = 0; r < e.length; r++) if (Object.hasOwn(e[r], t)) return !0;
return !1;
}
return 0 !== Object.keys(e[0]).length || 0 !== Object.keys(r).length;
}
dirtyKeys() {
const t = this._getPendingOps(), e = {};
for (let r = 0; r < t.length; r++) for (const i in t[r]) e[i] = !0;
const r = this._getDirtyObjectAttributes();
for (const t in r) e[t] = !0;
return Object.keys(e);
}
isDataAvailable() {
const t = this._getServerData();
return !!Object.keys(t).length;
}
toPointer() {
if (!this.id) throw new Error("Cannot create a pointer to an unsaved ParseObject");
return {
__type: "Pointer",
className: this.className,
objectId: this.id
};
}
toOfflinePointer() {
if (!this._localId) throw new Error("Cannot create a offline pointer to a saved ParseObject");
return {
__type: "Object",
className: this.className,
_localId: this._localId
};
}
get(t) {
return this.attributes[t];
}
relation(t) {
const e = this.get(t);
if (e) {
if (!(e instanceof ParseRelation)) throw new Error("Called relation() on non-relation field " + t);
return e._ensureParentAndKey(this, t), e;
}
return new ParseRelation(this, t);
}
escape(t) {
let e = this.attributes[t];
if (null == e) return "";
if ("string" != typeof e) {
if ("function" != typeof e.toString) return "";
e = e.toString();
}
return escape$1(e);
}
has(t) {
const e = this.attributes;
return !!Object.hasOwn(e, t) && null != e[t];
}
set(t, e, r) {
let i = {};
const n = {};
if (t && "object" == typeof t) i = t, r = e;
else {
if ("string" != typeof t) return this;
i[t] = e;
}
r = r || {};
let o = [];
"function" == typeof this.constructor.readOnlyAttributes && (o = o.concat(this.constructor.readOnlyAttributes()));
for (const t in i) if ("createdAt" !== t && "updatedAt" !== t) {
if (o.indexOf(t) > -1) throw new Error("Cannot modify readonly attribute: " + t);
if (r.unset) n[t] = new UnsetOp();
else if (i[t] instanceof Op) n[t] = i[t];
else if (i[t] && "object" == typeof i[t] && "string" == typeof i[t].__op) n[t] = opFromJSON(i[t]);
else if ("objectId" === t || "id" === t) "string" == typeof i[t] && (this.id = i[t]);
else if ("ACL" !== t || "object" != typeof i[t] || i[t] instanceof ParseACL) if (i[t] instanceof ParseRelation) {
const e = new ParseRelation(this, t);
e.targetClassName = i[t].targetClassName, n[t] = new SetOp(e);
} else n[t] = new SetOp(i[t]);
else n[t] = new SetOp(new ParseACL(i[t]));
}
const s = this.attributes, a = {};
for (const t in n) n[t] instanceof RelationOp ? a[t] = n[t].applyTo(s[t], this, t) : n[t] instanceof UnsetOp || (a[t] = n[t].applyTo(s[t]));
if (!r.ignoreValidation) {
const t = this.validate(a);
if (t) throw t;
}
const h = this._getPendingOps(), u = h.length - 1, f = CoreManager.getObjectStateController();
for (const t in n) {
const e = n[t].mergeWith(h[u][t]);
f.setPendingOp(this._getStateIdentifier(), t, e);
}
return this;
}
unset(t, e) {
return (e = e || {}).unset = !0, this.set(t, null, e);
}
increment(t, e) {
if (void 0 === e && (e = 1), "number" != typeof e) throw new Error("Cannot increment by a non-numeric amount.");
return this.set(t, new IncrementOp(e));
}
decrement(t, e) {
if (void 0 === e && (e = 1), "number" != typeof e) throw new Error("Cannot decrement by a non-numeric amount.");
return this.set(t, new IncrementOp(-1 * e));
}
add(t, e) {
return this.set(t, new AddOp([e]));
}
addAll(t, e) {
return this.set(t, new AddOp(e));
}
addUnique(t, e) {
return this.set(t, new AddUniqueOp([e]));
}
addAllUnique(t, e) {
return this.set(t, new AddUniqueOp(e));
}
remove(t, e) {
return this.set(t, new RemoveOp([e]));
}
removeAll(t, e) {
return this.set(t, new RemoveOp(e));
}
op(t) {
const e = this._getPendingOps();
for (let r = 0; r < e.length; r += 1) if (e[r][t]) return e[r][t];
}
clone() {
const t = new this.constructor(this.className);
let e = this.attributes;
if ("function" == typeof this.constructor.readOnlyAttributes) {
const t = this.constructor.readOnlyAttributes() || [], r = {};
for (const i in e) t.indexOf(i) < 0 && (r[i] = e[i]);
e = r;
}
return t.set && t.set(e), t;
}
newInstance() {
const t = new this.constructor(this.className);
if (t.id = this.id, singleInstance) return t;
const e = CoreManager.getObjectStateController();
return e && e.duplicateState(this._getStateIdentifier(), t._getStateIdentifier()), t;
}
isNew() {
return !this.id;
}
existed() {
if (!this.id) return !1;
const t = CoreManager.getObjectStateController().getState(this._getStateIdentifier());
return !!t && t.existed;
}
async exists(t) {
if (!this.id) return !1;
try {
return await new (CoreManager.getParseQuery())(this.className).get(this.id, t), !0;
} catch (t) {
if (t.code === ParseError.OBJECT_NOT_FOUND) return !1;
throw t;
}
}
isValid() {
return !this.validate(this.attributes);
}
validate(t) {
if (Object.hasOwn(t, "ACL") && !(t.ACL instanceof ParseACL)) return new ParseError(ParseError.OTHER_CAUSE, "ACL must be a Parse ACL.");
for (const e in t) if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(e)) return new ParseError(ParseError.INVALID_KEY_NAME, `Invalid key name: ${e}`);
return !1;
}
getACL() {
const t = this.get("ACL");
return t instanceof ParseACL ? t : null;
}
setACL(t, e) {
return this.set("ACL", t, e);
}
revert(...t) {
let e;
if (t.length) {
e = [];
for (const r of t) {
if ("string" != typeof r) throw new Error("Parse.Object#revert expects either no, or a list of string, arguments.");
e.push(r);
}
}
this._clearPendingOps(e);
}
clear() {
const t = this.attributes, e = {};
let r = ["createdAt", "updatedAt"];
"function" == typeof this.constructor.readOnlyAttributes && (r = r.concat(this.constructor.readOnlyAttributes()));
for (const i in t) r.indexOf(i) < 0 && (e[i] = !0);
return this.set(e, { unset: !0 });
}
fetch(e) {
const r = t._getRequestOptions(e);
return CoreManager.getObjectController().fetch(this, !0, r);
}
fetchWithInclude(t, e) {
return (e = e || {}).include = t, this.fetch(e);
}
async saveEventually(t) {
try {
await this.save(null, t);
} catch (e) {
e.code === ParseError.CONNECTION_FAILED && (await CoreManager.getEventuallyQueue().save(this, t), CoreManager.getEventuallyQueue().poll());
}
return this;
}
async save(e, r, i) {
let n, o;
"object" == typeof e || void 0 === e ? (n = e, "object" == typeof r && (o = r)) : (n = {}, n[e] = r, o = i), o = o || {}, n && this.set(n, o);
const s = t._getRequestOptions(o), a = CoreManager.getObjectController(), h = !1 !== o.cascadeSave ? unsavedChildren(this) : null;
if (h && h.length && !0 === o.transaction && h.some(((e) => e instanceof t))) {
const t = [], e = [];
return h.forEach(((r) => {
r instanceof ParseFile ? t.push(r) : e.push(r);
})), e.push(this), (t.length ? a.save(t, s) : Promise.resolve()).then((() => a.save(e, s))).then(((t) => t.pop()));
}
return await a.save(h, s), a.save(this, s);
}
async destroyEventually(t) {
try {
await this.destroy(t);
} catch (e) {
e.code === ParseError.CONNECTION_FAILED && (await CoreManager.getEventuallyQueue().destroy(this, t), CoreManager.getEventuallyQueue().poll());
}
return this;
}
destroy(e) {
if (!this.id) return Promise.resolve(void 0);
const r = t._getRequestOptions(e);
return CoreManager.getObjectController().destroy(this, r);
}
pin() {
return t.pinAllWithName(DEFAULT_PIN, [this]);
}
unPin() {
return t.unPinAllWithName(DEFAULT_PIN, [this]);
}
async isPinned() {
const t = CoreManager.getLocalDatastore();
if (!t.isEnabled) return Promise.reject("Parse.enableLocalDatastore() must be called first");
const e = t.getKeyForObject(this);
return (await t.fromPinWithName(e)).length > 0;
}
pinWithName(e) {
return t.pinAllWithName(e, [this]);
}
unPinWithName(e) {
return t.unPinAllWithName(e, [this]);
}
async fetchFromLocalDatastore() {
const e = CoreManager.getLocalDatastore();
if (!e.isEnabled) throw new Error("Parse.enableLocalDatastore() must be called first");
const r = e.getKeyForObject(this), i = await e._serializeObject(r);
if (!i) throw new Error("Cannot fetch an unsaved ParseObject");
const n = t.fromJSON(i);
return this._finishFetch(n.toJSON()), this;
}
static _clearAllState() {
CoreManager.getObjectStateController().clearAllState();
}
static fetchAll(e, r) {
const i = t._getRequestOptions(r);
return CoreManager.getObjectController().fetch(e, !0, i);
}
static fetchAllWithInclude(e, r, i) {
return (i = i || {}).include = r, t.fetchAll(e, i);
}
static fetchAllIfNeededWithInclude(e, r, i) {
return (i = i || {}).include = r, t.fetchAllIfNeeded(e, i);
}
static fetchAllIfNeeded(e, r) {
const i = t._getRequestOptions(r);
return CoreManager.getObjectController().fetch(e, !1, i);
}
static handleIncludeOptions(t) {
let e = [];
return Array.isArray(t.include) ? t.include.forEach(((t) => {
Array.isArray(t) ? e = e.concat(t) : e.push(t);
})) : e.push(t.include), e;
}
static destroyAll(e, r) {
const i = t._getRequestOptions(r);
return CoreManager.getObjectController().destroy(e, i);
}
static saveAll(e, r) {
const i = t._getRequestOptions(r);
return CoreManager.getObjectController().save(e, i);
}
static createWithoutData(t) {
const e = new this();
return e.id = t, e;
}
static fromJSON(e, r, i) {
if (!e.className) throw new Error("Cannot create an object without a className");
const n = classMap[e.className], o = n ? new n(e.className) : new t(e.className), s = {};
for (const t in e) "className" !== t && "__type" !== t && (s[t] = e[t], i && o.set(t, e[t]));
if (r) {
s.objectId && (o.id = s.objectId);
let t = null;
"function" == typeof o._preserveFieldsOnFetch && (t = o._preserveFieldsOnFetch()), o._clearServerData(), t && o._finishFetch(t);
}
return o._finishFetch(s), e.objectId && o._setExisted(!0), o;
}
static registerSubclass(t, e) {
if ("string" != typeof t) throw new TypeError("The first argument must be a valid class name.");
if (void 0 === e) throw new TypeError("You must supply a subclass constructor.");
if ("function" != typeof e) throw new TypeError("You must register the subclass constructor. Did you attempt to register an instance of the subclass?");
classMap[t] = e, e.className || (e.className = t);
}
static unregisterSubclass(t) {
if ("string" != typeof t) throw new TypeError("The first argument must be a valid class name.");
delete classMap[t];
}
static extend(e, r, i) {
if ("string" != typeof e) {
if (e && "string" == typeof e.className) return t.extend(e.className, e, r);
throw new Error("Parse.Object.extend's first argument should be the className.");
}
let n = e;
"User" === n && CoreManager.get("PERFORM_USER_REWRITE") && (n = "_User");
let o = t.prototype;
Object.hasOwn(this, "__super__") && this.__super__ && (o = this.prototype);
let s = function(t, e) {
if (this.className = n, this._objCount = objectCount++, "function" == typeof this.initialize && this.initialize.apply(this, arguments), this._initializers) for (const t of this._initializers) t.apply(this, arguments);
if (t && "object" == typeof t) try {
this.set(t || {}, e);
} catch (t) {
throw new Error("Can't create an invalid Parse Object");
}
};
if (classMap[n] ? s = classMap[n] : (s.extend = function(e, r, i) {
return "string" == typeof e ? t.extend.call(s, e, r, i) : t.extend.call(s, n, e, r);
}, s.createWithoutData = t.createWithoutData, s.className = n, s.__super__ = o, s.prototype = Object.create(o, { constructor: {
value: s,
enumerable: !1,
writable: !0,
configurable: !0
} })), r) for (const t in r) "initialize" !== t ? "className" !== t && Object.defineProperty(s.prototype, t, {
value: r[t],
enumerable: !1,
writable: !0,
configurable: !0
}) : Object.defineProperty(s.prototype, "_initializers", {
value: [...s.prototype._initializers || [], r[t]],
enumerable: !1,
writable: !0,
configurable: !0
});
if (i) for (const t in i) "className" !== t && Object.defineProperty(s, t, {
value: i[t],
enumerable: !1,
writable: !0,
configurable: !0
});
return classMap[n] = s, s;
}
static enableSingleInstance() {
singleInstance = !0, CoreManager.setObjectStateController(SingleInstanceStateController_exports);
}
static disableSingleInstance() {
singleInstance = !1, CoreManager.setObjectStateController(UniqueInstanceStateController_exports);
}
static pinAll(e) {
return CoreManager.getLocalDatastore().isEnabled ? t.pinAllWithName(DEFAULT_PIN, e) : Promise.reject("Parse.enableLocalDatastore() must be called first");
}
static pinAllWithName(t, e) {
const r = CoreManager.getLocalDatastore();
return r.isEnabled ? r._handlePinAllWithName(t, e) : Promise.reject("Parse.enableLocalDatastore() must be called first");
}
static unPinAll(e) {
return CoreManager.getLocalDatastore().isEnabled ? t.unPinAllWithName(DEFAULT_PIN, e) : Promise.reject("Parse.enableLocalDatastore() must be called first");
}
static unPinAllWithName(t, e) {
const r = CoreManager.getLocalDatastore();
return r.isEnabled ? r._handleUnPinAllWithName(t, e) : Promise.reject("Parse.enableLocalDatastore() must be called first");
}
static unPinAllObjects() {
const t = CoreManager.getLocalDatastore();
return t.isEnabled ? t.unPinWithName(DEFAULT_PIN) : Promise.reject("Parse.enableLocalDatastore() must be called first");
}
static unPinAllObjectsWithName(t) {
const e = CoreManager.getLocalDatastore();
return e.isEnabled ? e.unPinWithName(PIN_PREFIX + t) : Promise.reject("Parse.enableLocalDatastore() must be called first");
}
}, DefaultController$2 = {
fetch(t, e, r) {
const i = CoreManager.getLocalDatastore();
if (Array.isArray(t)) {
if (t.length < 1) return Promise.resolve([]);
const n = [], o = [];
let s = null;
const a = [];
let h = null;
if (t.forEach(((t) => {
h || (s || (s = t.className), s !== t.className && (h = new ParseError(ParseError.INVALID_CLASS_NAME, "All objects should be of the same class")), t.id || (h = new ParseError(ParseError.MISSING_OBJECT_ID, "All objects must have an ID")), !e && t.isDataAvailable() || (o.push(t.id), n.push(t)), a.push(t));
})), h) return Promise.reject(h);
const u = new (CoreManager.getParseQuery())(s);
return u.containedIn("objectId", o), r && r.include && u.include(r.include), u._limit = o.length, u.find(r).then((async (t) => {
const r = {};
t.forEach(((t) => {
r[t.id] = t;
}));
for (let t = 0; t < n.length; t++) {
const i = n[t];
if ((!i || !i.id || !r[i.id]) && e) return Promise.reject(new ParseError(ParseError.OBJECT_NOT_FOUND, "All objects must exist on the server."));
}
if (!singleInstance) for (let t = 0; t < a.length; t++) {
const e = a[t];
if (e && e.id && r[e.id]) {
const i = e.id;
e._finishFetch(r[i].toJSON()), a[t] = r[i];
}
}
for (const t of a) await i._updateObjectIfPinned(t);
return Promise.resolve(a);
}));
}
if (t instanceof ParseObject) {
if (!t.id) return Promise.reject(new ParseError(ParseError.MISSING_OBJECT_ID, "Object does not have an ID"));
const e = CoreManager.getRESTController(), n = {};
return r && r.include && (n.include = r.include.join()), e.request("GET", "classes/" + t.className + "/" + t._getId(), n, r).then((async (e) => (t._clearPendingOps(), t._clearServerData(), t._finishFetch(e), await i._updateObjectIfPinned(t), t)));
}
return Promise.resolve(void 0);
},
async destroy(t, e) {
if (e && e.batchSize && e.transaction) throw new ParseError(ParseError.OTHER_CAUSE, "You cannot use both transaction and batchSize options simultaneously.");
let r = e && e.batchSize ? e.batchSize : CoreManager.get("REQUEST_BATCH_SIZE");
const i = CoreManager.getLocalDatastore(), n = CoreManager.getRESTController();
if (Array.isArray(t)) {
if (e && e.transaction && t.length > 1 && (r = t.length), t.length < 1) return Promise.resolve([]);
const o = [[]];
t.forEach(((t) => {
t.id && (o[o.length - 1].push(t), o[o.length - 1].length >= r && o.push([]));
})), 0 === o[o.length - 1].length && o.pop();
let s = Promise.resolve();
const a = [];
return o.forEach(((t) => {
const r = t.map(((t) => ({
method: "DELETE",
path: getServerUrlPath() + "classes/" + t.className + "/" + t._getId(),
body: {}
}))), i = e && e.transaction && r.length > 1 ? {
requests: r,
transaction: !0
} : { requests: r };
s = s.then((() => n.request("POST", "batch", i, e).then(((e) => {
for (let r = 0; r < e.length; r++) if (e[r] && Object.hasOwn(e[r], "error")) {
const i = new ParseError(e[r].error.code, e[r].error.error);
i.object = t[r], a.push(i);
}
}))));
})), s.then((async () => {
if (a.length) {
const t = new ParseError(ParseError.AGGREGATE_ERROR);
return t.errors = a, Promise.reject(t);
}
for (const e of t) await i._destroyObjectIfPinned(e);
return Promise.resolve(t);
}));
}
return t instanceof ParseObject ? n.request("DELETE", "classes/" + t.className + "/" + t._getId(), {}, e).then((async () => (await i._destroyObjectIfPinned(t), Promise.resolve(t)))) : Promise.resolve(t);
},
save(t, e) {
if (e && e.batchSize && e.transaction) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "You cannot use both transaction and batchSize options simultaneously."));
let r = e && e.batchSize ? e.batchSize : CoreManager.get("REQUEST_BATCH_SIZE");
const i = CoreManager.getLocalDatastore(), n = {}, o = CoreManager.getRESTController(), s = CoreManager.getObjectStateController(), a = CoreManager.get("ALLOW_CUSTOM_OBJECT_ID");
if ((e = e || {}).returnStatus = e.returnStatus || !0, Array.isArray(t)) {
if (t.length < 1) return Promise.resolve([]);
let h = t.concat();
for (let e = 0; e < t.length; e++) {
const r = t[e];
r instanceof ParseObject && (h = h.concat(unsavedChildren(r, !0)));
}
h = unique(h);
const u = [];
let f = [];
if (h.forEach(((t) => {
t instanceof ParseFile ? u.push(t.save(e)) : t instanceof ParseObject && f.push(t);
})), e && e.transaction && f.length > 1) {
if (f.some(((t) => !canBeSerialized(t)))) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Tried to save a transactional batch containing an object with unserializable attributes."));
r = f.length;
}
return Promise.all(u).then((() => {
let h = null;
return continueWhile((() => f.length > 0), (() => {
const t = [], i = [];
if (f.forEach(((e) => {
if (a && Object.hasOwn(e, "id") && !e.id) throw new ParseError(ParseError.MISSING_OBJECT_ID, "objectId must not be empty or null");
t.length < r && canBeSerialized(e) ? t.push(e) : i.push(e);
})), f = i, t.length < 1) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Tried to save a batch with a cycle."));
const u = resolvingPromise(), l = [], c = [];
return t.forEach(((t, e) => {
const r = resolvingPromise();
l.push(r);
s.pushPendingState(t._getStateIdentifier()), c.push(s.enqueueTask(t._getStateIdentifier(), (function() {
return r.resolve(), u.then(((r) => {
if (Object.hasOwn(r[e], "success")) {
const i = r[e].success.objectId, o = r[e]._status;
delete r[e]._status, delete r[e]._headers, n[i] = t._localId, t._handleSaveResponse(r[e].success, o);
} else {
if (!h && Object.hasOwn(r[e], "error")) {
const t = r[e].error;
h = new ParseError(t.code, t.error), f = [];
}
t._handleSaveError();
}
}));
})));
})), when(l).then((() => {
const r = t.map(((t) => {
const e = t._getSaveParams();
return e.path = getServerUrlPath() + e.path, e;
})), i = e && e.transaction && r.length > 1 ? {
requests: r,
transaction: !0
} : { requests: r };
return o.request("POST", "batch", i, e);
})).then(u.resolve, ((t) => {
u.reject(new ParseError(ParseError.INCORRECT_TYPE, t.message));
})), when(c);
})).then((async () => {
if (h) return Promise.reject(h);
for (const e of t) e instanceof ParseObject && (await i._updateLocalIdForObject(n[e.id], e), await i._updateObjectIfPinned(e));
return Promise.resolve(t);
}));
}));
}
if (t instanceof ParseObject) {
if (a && Object.hasOwn(t, "id") && !t.id) throw new ParseError(ParseError.MISSING_OBJECT_ID, "objectId must not be empty or null");
t._getId();
const r = t._localId, n = t, h = function() {
const t = n._getSaveParams();
return o.request(t.method, t.path, t.body, e).then(((t) => {
const e = t._status;
delete t._status, delete t._headers, n._handleSaveResponse(t, e);
}), ((t) => (n._handleSaveError(), Promise.reject(t))));
};
return s.pushPendingState(t._getStateIdentifier()), s.enqueueTask(t._getStateIdentifier(), h).then((async () => (await i._updateLocalIdForObject(r, t), await i._updateObjectIfPinned(t), t)), ((t) => Promise.reject(t)));
}
return Promise.resolve(void 0);
}
};
function equals(t, e) {
const r = Object.prototype.toString;
if ("[object Date]" === r.call(t) || "[object Date]" === r.call(e)) return +new Date(t) == +new Date(e);
if (typeof t != typeof e) return !1;
if (!t || "object" != typeof t) return t === e;
if (Array.isArray(t) || Array.isArray(e)) {
if (!Array.isArray(t) || !Array.isArray(e)) return !1;
if (t.length !== e.length) return !1;
for (let r = 0; r < t.length; r += 1) if (!equals(t[r], e[r])) return !1;
return !0;
}
const i = CoreManager.getParseObject();
if (t instanceof ParseACL || t instanceof ParseFile || t instanceof ParseGeoPoint || t instanceof i) return t.equals(e);
if (e instanceof i && ("Object" === t.__type || "Pointer" === t.__type)) return t.objectId === e.id && t.className === e.className;
if (Object.keys(t).length !== Object.keys(e).length) return !1;
for (const r in t) if (!equals(t[r], e[r])) return !1;
return !0;
}
function contains(t, e) {
if (e && e.__type && ("Pointer" === e.__type || "Object" === e.__type)) {
for (const r in t) {
const i = t[r];
if ("string" == typeof i && i === e.objectId) return !0;
if (i.className === e.className && i.objectId === e.objectId) return !0;
}
return !1;
}
if (Array.isArray(e)) {
for (const r of e) if (contains(t, r)) return !0;
}
return t.indexOf(e) > -1;
}
function transformObject(t) {
return t._toFullJSON ? t._toFullJSON() : t;
}
function matchesQuery(t, e, r, i) {
if (e.className !== t) return !1;
let n = e, o = i;
e.toJSON && (n = e.toJSON()), i.toJSON && (o = i.toJSON().where), n.className = t;
for (const e in o) if (!matchesKeyConstraints(t, n, r, e, o[e])) return !1;
return !0;
}
function equalObjectsGeneric(t, e, r) {
if (Array.isArray(t)) {
for (let i = 0; i < t.length; i++) if (r(t[i], e)) return !0;
return !1;
}
return r(t, e);
}
function relativeTimeToDate(t, e = /* @__PURE__ */ new Date()) {
let r = (t = t.toLowerCase()).split(" ");
r = r.filter(((t) => "" !== t));
const i = "in" === r[0], n = "ago" === r[r.length - 1];
if (!i && !n && "now" !== t) return {
status: "error",
info: "Time should either start with 'in' or end with 'ago'"
};
if (i && n) return {
status: "error",
info: "Time cannot have both 'in' and 'ago'"
};
if (r = i ? r.slice(1) : r.slice(0, r.length - 1), r.length % 2 != 0 && "now" !== t) return {
status: "error",
info: "Invalid time string. Dangling unit or number."
};
const o = [];
for (; r.length;) o.push([r.shift(), r.shift()]);
let s = 0;
for (const [t, e] of o) {
const r = Number(t);
if (!Number.isInteger(r)) return {
status: "error",
info: `'${t}' is not an integer.`
};
switch (e) {
case "yr":
case "yrs":
case "year":
case "years":
s += 31536e3 * r;
break;
case "wk":
case "wks":
case "week":
case "weeks":
s += 604800 * r;
break;
case "d":
case "day":
case "days":
s += 86400 * r;
break;
case "hr":
case "hrs":
case "hour":
case "hours":
s += 3600 * r;
break;
case "min":
case "mins":
case "minute":
case "minutes":
s += 60 * r;
break;
case "sec":
case "secs":
case "second":
case "seconds":
s += r;
break;
default: return {
status: "error",
info: `Invalid interval: '${e}'`
};
}
}
const a = 1e3 * s;
return i ? {
status: "success",
info: "future",
result: new Date(e.valueOf() + a)
} : n ? {
status: "success",
info: "past",
result: new Date(e.valueOf() - a)
} : {
status: "success",
info: "present",
result: new Date(e.valueOf())
};
}
function matchesKeyConstraints(t, e, r, i, n) {
if (null === n) return !1;
if (i.indexOf(".") >= 0) {
const o = i.split("."), s = o[0], a = o.slice(1).join(".");
return matchesKeyConstraints(t, e[s] || {}, r, a, n);
}
let o, s;
if ("$or" === i) {
for (o = 0; o < n.length; o++) if (matchesQuery(t, e, r, n[o])) return !0;
return !1;
}
if ("$and" === i) {
for (o = 0; o < n.length; o++) if (!matchesQuery(t, e, r, n[o])) return !1;
return !0;
}
if ("$nor" === i) {
for (o = 0; o < n.length; o++) if (matchesQuery(t, e, r, n[o])) return !1;
return !0;
}
if ("$relatedTo" === i) return !1;
if (!/^[A-Za-z][0-9A-Za-z_]*$/.test(i)) throw new ParseError(ParseError.INVALID_KEY_NAME, `Invalid Key: ${i}`);
if ("object" != typeof n) return Array.isArray(e[i]) ? e[i].indexOf(n) > -1 : e[i] === n;
if (n.__type) return "Pointer" === n.__type ? equalObjectsGeneric(e[i], n, (function(t, e) {
return void 0 !== t && e.className === t.className && e.objectId === t.objectId;
})) : equalObjectsGeneric(decode(e[i]), decode(n), equals);
for (const t in n) {
if (s = n[t], s?.__type && (s = decode(s)), s?.$relativeTime) {
const t = relativeTimeToDate(s.$relativeTime);
if ("success" !== t.status) throw new ParseError(ParseError.INVALID_JSON, `bad $relativeTime (${i}) value. ${t.info}`);
s = t.result;
}
switch (("[object Date]" === toString.call(s) || "string" == typeof s && "Invalid Date" !== new Date(s).toString()) && (e[i] = new Date(e[i].iso ? e[i].iso : e[i])), t) {
case "$lt":
if (e[i] >= s) return !1;
break;
case "$lte":
if (e[i] > s) return !1;
break;
case "$gt":
if (e[i] <= s) return !1;
break;
case "$gte":
if (e[i] < s) return !1;
break;
case "$ne":
if (equals(e[i], s)) return !1;
break;
case "$in":
if (!contains(s, e[i])) return !1;
break;
case "$nin":
if (contains(s, e[i])) return !1;
break;
case "$all":
for (o = 0; o < s.length; o++) if (e[i].indexOf(s[o]) < 0) return !1;
break;
case "$exists": {
const t = void 0 !== e[i], r = n.$exists;
if ("boolean" != typeof n.$exists) break;
if (!t && r || t && !r) return !1;
break;
}
case "$regex": {
if ("object" == typeof s) return s.test(e[i]);
let t = "", r = -2, o = s.indexOf("\\Q");
for (; o > -1;) t += s.substring(r + 2, o), r = s.indexOf("\\E", o), r > -1 && (t += s.substring(o + 2, r).replace(/\\\\\\\\E/g, "\\E").replace(/\W/g, "\\$&")), o = s.indexOf("\\Q", r);
t += s.substring(Math.max(o, r + 2));
let a = n.$options || "";
if (a = a.replace("x", "").replace("s", ""), !new RegExp(t, a).test(e[i])) return !1;
break;
}
case "$nearSphere": return !(!s || !e[i]) && s.radiansTo(e[i]) <= (n.$maxDistance || Infinity);
case "$within": {
if (!s || !e[i]) return !1;
const t = s.$box[0], r = s.$box[1];
return !(t.latitude > r.latitude || t.longitude > r.longitude) && e[i].latitude > t.latitude && e[i].latitude < r.latitude && e[i].longitude > t.longitude && e[i].longitude < r.longitude;
}
case "$options":
case "$maxDistance": break;
case "$select": {
const t = r.filter(((t, e, r) => matchesQuery(s.query.className, t, r, s.query.where)));
for (let r = 0; r < t.length; r += 1) {
const n = transformObject(t[r]);
return equals(e[i], n[s.key]);
}
return !1;
}
case "$dontSelect": {
const t = r.filter(((t, e, r) => matchesQuery(s.query.className, t, r, s.query.where)));
for (let r = 0; r < t.length; r += 1) {
const n = transformObject(t[r]);
return !equals(e[i], n[s.key]);
}
return !1;
}
case "$inQuery": {
const t = r.filter(((t, e, r) => matchesQuery(s.className, t, r, s.where)));
for (let r = 0; r < t.length; r += 1) {
const n = transformObject(t[r]);
if (e[i].className === n.className && e[i].objectId === n.objectId) return !0;
}
return !1;
}
case "$notInQuery": {
const t = r.filter(((t, e, r) => matchesQuery(s.className, t, r, s.where)));
for (let r = 0; r < t.length; r += 1) {
const n = transformObject(t[r]);
if (e[i].className === n.className && e[i].objectId === n.objectId) return !1;
}
return !0;
}
case "$containedBy":
for (const t of e[i]) if (!contains(s, t)) return !1;
return !0;
case "$geoWithin":
if (s.$polygon) return new ParsePolygon(s.$polygon.map(((t) => [t.latitude, t.longitude]))).containsPoint(e[i]);
if (s.$centerSphere) {
const [t, r] = s.$centerSphere, n = new ParseGeoPoint({
latitude: t[1],
longitude: t[0]
});
return new ParseGeoPoint(e[i]).radiansTo(n) <= r;
}
return !1;
case "$geoIntersects": {
const t = new ParsePolygon(e[i].coordinates), r = new ParseGeoPoint(s.$point);
return t.containsPoint(r);
}
default: return !1;
}
}
return !0;
}
function validateQuery(t) {
let e = t;
t.toJSON && (e = t.toJSON().where);
const r = [
"$and",
"$or",
"$nor",
"_rperm",
"_wperm",
"_perishable_token",
"_email_verify_token",
"_email_verify_token_expires_at",
"_account_lockout_expires_at",
"_failed_login_count"
];
Object.keys(e).forEach(((t) => {
if (e && e[t] && e[t].$regex && "string" == typeof e[t].$options && !e[t].$options.match(/^[imxs]+$/)) throw new ParseError(ParseError.INVALID_QUERY, `Bad $options value for query: ${e[t].$options}`);
if (r.indexOf(t) < 0 && !t.match(/^[a-zA-Z][a-zA-Z0-9_\.]*$/)) throw new ParseError(ParseError.INVALID_KEY_NAME, `Invalid key name: ${t}`);
}));
}
CoreManager.setParseObject(ParseObject), CoreManager.setObjectController(DefaultController$2);
var OfflineQuery = {
matchesQuery,
validateQuery
};
function quote(t) {
return "\\Q" + t.replace("\\E", "\\E\\\\E\\Q") + "\\E";
}
function _getClassNameFromQueries(t) {
let e = null;
return t.forEach(((t) => {
if (e || (e = t.className), e !== t.className) throw new Error("All queries must be for the same class.");
})), e;
}
function handleSelectResult(t, e) {
const r = {};
e.forEach(((e) => {
const i = -1 !== e.indexOf(".");
if (i || Object.hasOwn(t, e)) {
if (i) {
const i = e.split(".");
let n = t, o = r;
i.forEach(((t, e, r) => {
n && !Object.hasOwn(n, t) && (n[t] = void 0), n && "object" == typeof n && (n = n[t]), e < r.length - 1 && (o[t] || (o[t] = {}), o = o[t]);
}));
}
} else t[e] = void 0;
})), Object.keys(r).length > 0 && copyMissingDataWithMask(CoreManager.getObjectStateController().getServerData({
id: t.objectId,
className: t.className
}), t, r, !1);
}
function copyMissingDataWithMask(t, e, r, i) {
if (i) for (const r in t) Object.hasOwn(t, r) && !Object.hasOwn(e, r) && (e[r] = t[r]);
for (const i in r) void 0 !== e[i] && null !== e[i] && null != t && copyMissingDataWithMask(t[i], e[i], r[i], !0);
}
function handleOfflineSort(t, e, r) {
let i = r[0];
const n = "-" === i.slice(0, 1);
if (n && (i = i.substring(1)), "_created_at" === i && (i = "createdAt"), "_updated_at" === i && (i = "updatedAt"), !/^[A-Za-z][0-9A-Za-z_]*$/.test(i) || "password" === i) throw new ParseError(ParseError.INVALID_KEY_NAME, `Invalid Key: ${i}`);
const o = t.get(i), s = e.get(i);
return o < s ? n ? 1 : -1 : o > s ? n ? -1 : 1 : r.length > 1 ? handleOfflineSort(t, e, r.slice(1)) : 0;
}
var ParseQuery = class t {
constructor(t) {
if ("string" == typeof t) "User" === t && CoreManager.get("PERFORM_USER_REWRITE") ? this.className = "_User" : this.className = t;
else if (t instanceof ParseObject) this.className = t.className;
else {
if ("function" != typeof t) throw new TypeError("A ParseQuery must be constructed with a ParseObject or class name.");
{
const e = t;
if ("string" == typeof e.className) this.className = e.className;
else {
const t = new e();
this.className = t.className;
}
}
}
this._where = {}, this._watch = [], this._include = [], this._exclude = [], this._count = !1, this._limit = -1, this._skip = 0, this._readPreference = null, this._includeReadPreference = null, this._subqueryReadPreference = null, this._queriesLocalDatastore = !1, this._localDatastorePinName = null, this._extraOptions = {}, this._xhrRequest = {
task: null,
onchange: () => {}
}, this._comment = null;
}
_orQuery(t) {
const e = t.map(((t) => t.toJSON().where));
return this._where.$or = e, this;
}
_andQuery(t) {
const e = t.map(((t) => t.toJSON().where));
return this._where.$and = e, this;
}
_norQuery(t) {
const e = t.map(((t) => t.toJSON().where));
return this._where.$nor = e, this;
}
_addCondition(t, e, r) {
return this._where[t] && "string" != typeof this._where[t] || (this._where[t] = {}), this._where[t][e] = encode_default(r, !1, !0), this;
}
_regexStartWith(t) {
return "^" + quote(t);
}
async _handleOfflineQuery(t) {
OfflineQuery.validateQuery(this);
let e, r = (await CoreManager.getLocalDatastore()._serializeObjectsFromPinName(this._localDatastorePinName)).map(((t, e, r) => {
const i = ParseObject.fromJSON(t, !1);
return t._localId && !t.objectId && (i._localId = t._localId), OfflineQuery.matchesQuery(this.className, i, r, this) ? i : null;
})).filter(((t) => null !== t));
if (t.keys) {
let e = t.keys.split(",");
e = e.concat([
"className",
"objectId",
"createdAt",
"updatedAt",
"ACL"
]), r = r.map(((t) => {
const r = t._toFullJSON();
return Object.keys(r).forEach(((t) => {
e.includes(t) || delete r[t];
})), ParseObject.fromJSON(r, !1);
}));
}
if (t.order) {
const e = t.order.split(",");
r.sort(((t, r) => handleOfflineSort(t, r, e)));
}
t.count && (e = r.length), t.skip && (r = t.skip >= r.length ? [] : r.splice(t.skip, r.length));
let i = r.length;
return 0 !== t.limit && t.limit < r.length && (i = t.limit), r = r.splice(0, i), "number" == typeof e ? {
results: r,
count: e
} : r;
}
toJSON() {
const t = { where: this._where };
this._watch.length && (t.watch = this._watch.join(",")), this._include.length && (t.include = this._include.join(",")), this._exclude.length && (t.excludeKeys = this._exclude.join(",")), this._select && (t.keys = this._select.join(",")), this._count && (t.count = 1), this._limit >= 0 && (t.limit = this._limit), this._skip > 0 && (t.skip = this._skip), this._order && (t.order = this._order.join(",")), this._readPreference && (t.readPreference = this._readPreference), this._includeReadPreference && (t.includeReadPreference = this._includeReadPreference), this._subqueryReadPreference && (t.subqueryReadPreference = this._subqueryReadPreference), this._hint && (t.hint = this._hint), this._explain && (t.explain = !0), this._comment && (t.comment = this._comment);
for (const e in this._extraOptions) t[e] = this._extraOptions[e];
return t;
}
withJSON(t) {
t.where && (this._where = t.where), t.watch && (this._watch = t.watch.split(",")), t.include && (this._include = t.include.split(",")), t.keys && (this._select = t.keys.split(",")), t.excludeKeys && (this._exclude = t.excludeKeys.split(",")), t.count && (this._count = 1 === t.count), t.limit && (this._limit = t.limit), t.skip && (this._skip = t.skip), t.order && (this._order = t.order.split(",")), t.readPreference && (this._readPreference = t.readPreference), t.includeReadPreference && (this._includeReadPreference = t.includeReadPreference), t.subqueryReadPreference && (this._subqueryReadPreference = t.subqueryReadPreference), t.hint && (this._hint = t.hint), t.explain && (this._explain = !!t.explain), t.comment && (this._comment = t.comment);
for (const e in t) Object.hasOwn(t, e) && -1 === [
"where",
"include",
"keys",
"count",
"limit",
"skip",
"order",
"readPreference",
"includeReadPreference",
"subqueryReadPreference",
"hint",
"explain",
"comment"
].indexOf(e) && (this._extraOptions[e] = t[e]);
return this;
}
static fromJSON(e, r) {
return new t(e).withJSON(r);
}
get(t, e) {
this.equalTo("objectId", t);
const r = ParseObject._getRequestOptions(e);
return this.first(r).then(((t) => {
if (t) return t;
const e = new ParseError(ParseError.OBJECT_NOT_FOUND, "Object not found.");
return Promise.reject(e);
}));
}
find(t) {
const e = ParseObject._getRequestOptions(t);
this._setRequestTask(e);
const r = CoreManager.getQueryController(), i = this._select;
return this._queriesLocalDatastore ? this._handleOfflineQuery(this.toJSON()) : r.find(this.className, this.toJSON(), e).then(((t) => {
if (this._explain) return t.results;
const r = t.results?.map(((r) => {
const n = t.className || this.className;
return r.className || (r.className = n), i && handleSelectResult(r, i), e.json ? r : ParseObject.fromJSON(r, !i);
})), n = t.count;
return "number" == typeof n ? {
results: r,
count: n
} : r;
}));
}
async findAll(t) {
let e = [];
return await this.eachBatch(((t) => {
e = [...e, ...t];
}), t), e;
}
count(t) {
t = t || {};
const e = ParseObject._getRequestOptions(t);
this._setRequestTask(e);
const r = CoreManager.getQueryController(), i = this.toJSON();
return i.limit = 0, i.count = 1, r.find(this.className, i, e).then(((t) => t.count));
}
distinct(t) {
const e = { useMasterKey: !0 };
this._setRequestTask(e);
const r = {
distinct: t,
where: this._where,
hint: this._hint
};
return CoreManager.getQueryController().aggregate(this.className, r, e).then(((t) => t.results));
}
aggregate(t, e) {
if (!Array.isArray(t) && "object" != typeof t) throw new Error("Invalid pipeline must be Array or Object");
Object.keys(this._where || {}).length && (Array.isArray(t) || (t = [t]), t.unshift({ $match: this._where }));
const r = {
pipeline: t,
hint: this._hint,
explain: this._explain,
readPreference: this._readPreference
};
void 0 !== e?.rawValues && (r.rawValues = e.rawValues), void 0 !== e?.rawFieldNames && (r.rawFieldNames = e.rawFieldNames);
const i = ParseObject._getRequestOptions(e);
return void 0 === i.useMasterKey && (i.useMasterKey = !0), this._setRequestTask(i), CoreManager.getQueryController().aggregate(this.className, r, i).then(((t) => t.results));
}
first(t = {}) {
const e = ParseObject._getRequestOptions(t);
this._setRequestTask(e);
const r = CoreManager.getQueryController(), i = this.toJSON();
i.limit = 1;
const n = this._select;
return this._queriesLocalDatastore ? this._handleOfflineQuery(i).then(((t) => {
if (t[0]) return t[0];
})) : r.find(this.className, i, e).then(((t) => {
const r = t.results;
if (r[0]) return r[0].className || (r[0].className = this.className), n && handleSelectResult(r[0], n), e.json ? r[0] : ParseObject.fromJSON(r[0], !n);
}));
}
eachBatch(e, r) {
if (r = r || {}, this._order || this._skip || this._limit >= 0) return Promise.reject("Cannot iterate on a query with sort, skip, or limit.");
const i = t.fromJSON(this.className, this.toJSON());
i.ascending("objectId"), i._limit = r.batchSize || 100;
const n = ParseObject._getRequestOptions(r);
let o = !1, s = [];
return continueWhile((() => !o), (async () => {
const [t] = await Promise.all([i.find(n), Promise.resolve(s.length > 0 && e(s))]);
t.length >= i._limit ? (n.json ? i.greaterThan("objectId", t[t.length - 1].objectId) : i.greaterThan("objectId", t[t.length - 1].id), s = t) : t.length > 0 ? (await Promise.resolve(e(t)), o = !0) : o = !0;
}));
}
each(t, e) {
return this.eachBatch(((e) => {
let r = Promise.resolve();
return e.forEach(((e) => {
r = r.then((() => t(e)));
})), r;
}), e);
}
hint(t) {
return void 0 === t && delete this._hint, this._hint = t, this;
}
explain(t = !0) {
if ("boolean" != typeof t) throw new Error("You can only set explain to a boolean value");
return this._explain = t, this;
}
async map(t, e) {
const r = [];
let i = 0;
return await this.each(((e) => Promise.resolve(t(e, i, this)).then(((t) => {
r.push(t), i += 1;
}))), e), r;
}
async reduce(t, e, r) {
let i = e, n = 0;
if (await this.each(((r) => 0 === n && void 0 === e ? (i = r, void (n += 1)) : Promise.resolve(t(i, r, n)).then(((t) => {
i = t, n += 1;
}))), r), 0 === n && void 0 === e) throw new TypeError("Reducing empty query result set with no initial value");
return i;
}
async filter(t, e) {
const r = [];
let i = 0;
return await this.each(((e) => Promise.resolve(t(e, i, this)).then(((t) => {
t && r.push(e), i += 1;
}))), e), r;
}
equalTo(t, e) {
return t && "object" == typeof t ? (Object.entries(t).forEach((([t, e]) => this.equalTo(t, e))), this) : void 0 === e ? this.doesNotExist(t) : (this._where[t] = encode_default(e, !1, !0), this);
}
notEqualTo(t, e) {
return t && "object" == typeof t ? (Object.entries(t).forEach((([t, e]) => this.notEqualTo(t, e))), this) : this._addCondition(t, "$ne", e);
}
lessThan(t, e) {
return this._addCondition(t, "$lt", e);
}
greaterThan(t, e) {
return this._addCondition(t, "$gt", e);
}
lessThanOrEqualTo(t, e) {
return this._addCondition(t, "$lte", e);
}
greaterThanOrEqualTo(t, e) {
return this._addCondition(t, "$gte", e);
}
containedIn(t, e) {
return this._addCondition(t, "$in", e);
}
notContainedIn(t, e) {
return this._addCondition(t, "$nin", e);
}
containedBy(t, e) {
return this._addCondition(t, "$containedBy", e);
}
containsAll(t, e) {
return this._addCondition(t, "$all", e);
}
containsAllStartingWith(t, e) {
Array.isArray(e) || (e = [e]);
const r = e.map(((t) => ({ $regex: this._regexStartWith(t) })));
return this.containsAll(t, r);
}
exists(t) {
return this._addCondition(t, "$exists", !0);
}
doesNotExist(t) {
return this._addCondition(t, "$exists", !1);
}
matches(t, e, r) {
return this._addCondition(t, "$regex", e), r || (r = ""), "string" != typeof e && (e.ignoreCase && (r += "i"), e.multiline && (r += "m")), r.length && this._addCondition(t, "$options", r), this;
}
matchesQuery(t, e) {
const r = e.toJSON();
return r.className = e.className, this._addCondition(t, "$inQuery", r);
}
doesNotMatchQuery(t, e) {
const r = e.toJSON();
return r.className = e.className, this._addCondition(t, "$notInQuery", r);
}
matchesKeyInQuery(t, e, r) {
const i = r.toJSON();
return i.className = r.className, this._addCondition(t, "$select", {
key: e,
query: i
});
}
doesNotMatchKeyInQuery(t, e, r) {
const i = r.toJSON();
return i.className = r.className, this._addCondition(t, "$dontSelect", {
key: e,
query: i
});
}
contains(t, e) {
if ("string" != typeof e) throw new Error("The value being searched for must be a string.");
return this._addCondition(t, "$regex", quote(e));
}
fullText(t, e, r) {
if (r = r || {}, !t) throw new Error("A key is required.");
if (!e) throw new Error("A search term is required");
if ("string" != typeof e) throw new Error("The value being searched for must be a string.");
const i = {};
i.$term = e;
for (const t in r) switch (t) {
case "language":
i.$language = r[t];
break;
case "caseSensitive":
i.$caseSensitive = r[t];
break;
case "diacriticSensitive":
i.$diacriticSensitive = r[t];
break;
default: throw new Error(`Unknown option: ${t}`);
}
return this._addCondition(t, "$text", { $search: i });
}
sortByTextScore() {
return this.ascending("$score"), this.select(["$score"]), this;
}
startsWith(t, e, r) {
if ("string" != typeof e) throw new Error("The value being searched for must be a string.");
return this.matches(t, this._regexStartWith(e), r);
}
endsWith(t, e, r) {
if ("string" != typeof e) throw new Error("The value being searched for must be a string.");
return this.matches(t, quote(e) + "$", r);
}
near(t, e) {
return e instanceof ParseGeoPoint || (e = new ParseGeoPoint(e)), this._addCondition(t, "$nearSphere", e);
}
withinRadians(t, e, r, i) {
return i || void 0 === i ? (this.near(t, e), this._addCondition(t, "$maxDistance", r)) : this._addCondition(t, "$geoWithin", { $centerSphere: [[e.longitude, e.latitude], r] });
}
withinMiles(t, e, r, i) {
return this.withinRadians(t, e, r / 3958.8, i);
}
withinKilometers(t, e, r, i) {
return this.withinRadians(t, e, r / 6371, i);
}
withinGeoBox(t, e, r) {
return e instanceof ParseGeoPoint || (e = new ParseGeoPoint(e)), r instanceof ParseGeoPoint || (r = new ParseGeoPoint(r)), this._addCondition(t, "$within", { $box: [e, r] }), this;
}
withinPolygon(t, e) {
return this._addCondition(t, "$geoWithin", { $polygon: e });
}
polygonContains(t, e) {
return this._addCondition(t, "$geoIntersects", { $point: e });
}
ascending(...t) {
return this._order = [], this.addAscending.apply(this, t);
}
addAscending(...t) {
return this._order || (this._order = []), t.forEach(((t) => {
Array.isArray(t) && (t = t.join()), this._order = this._order.concat(t.replace(/\s/g, "").split(","));
})), this;
}
descending(...t) {
return this._order = [], this.addDescending.apply(this, t);
}
addDescending(...t) {
return this._order || (this._order = []), t.forEach(((t) => {
Array.isArray(t) && (t = t.join()), this._order = this._order.concat(t.replace(/\s/g, "").split(",").map(((t) => "-" + t)));
})), this;
}
skip(t) {
if ("number" != typeof t || t < 0) throw new Error("You can only skip by a positive number");
return this._skip = t, this;
}
limit(t) {
if ("number" != typeof t) throw new Error("You can only set the limit to a numeric value");
return this._limit = t, this;
}
withCount(t = !0) {
if ("boolean" != typeof t) throw new Error("You can only set withCount to a boolean value");
return this._count = t, this;
}
include(...t) {
return t.forEach(((t) => {
Array.isArray(t) ? this._include = this._include.concat(t) : this._include.push(t);
})), this;
}
includeAll() {
return this.include("*");
}
select(...t) {
return this._select || (this._select = []), t.forEach(((t) => {
Array.isArray(t) ? this._select = this._select.concat(t) : this._select.push(t);
})), this;
}
exclude(...t) {
return t.forEach(((t) => {
Array.isArray(t) ? this._exclude = this._exclude.concat(t) : this._exclude.push(t);
})), this;
}
watch(...t) {
return t.forEach(((t) => {
Array.isArray(t) ? this._watch = this._watch.concat(t) : this._watch.push(t);
})), this;
}
readPreference(t, e, r) {
return this._readPreference = t, this._includeReadPreference = e || null, this._subqueryReadPreference = r || null, this;
}
async subscribe(t) {
const e = await CoreManager.getUserController().currentUserAsync();
t || (t = e && e.getSessionToken() || void 0);
const r = await CoreManager.getLiveQueryController().getDefaultLiveQueryClient();
r.shouldOpen() && r.open();
const i = r.subscribe(this, t);
return i.subscribePromise.then((() => i));
}
static or(...e) {
const r = _getClassNameFromQueries(e), i = new t(r);
return i._orQuery(e), i;
}
static and(...e) {
const r = _getClassNameFromQueries(e), i = new t(r);
return i._andQuery(e), i;
}
static nor(...e) {
const r = _getClassNameFromQueries(e), i = new t(r);
return i._norQuery(e), i;
}
fromNetwork() {
return this._queriesLocalDatastore = !1, this._localDatastorePinName = null, this;
}
fromLocalDatastore() {
return this.fromPinWithName(null);
}
fromPin() {
return this.fromPinWithName(DEFAULT_PIN);
}
fromPinWithName(t) {
return CoreManager.getLocalDatastore().checkIfEnabled() && (this._queriesLocalDatastore = !0, this._localDatastorePinName = t), this;
}
cancel() {
return this._xhrRequest.task && "function" == typeof this._xhrRequest.task.abort ? (this._xhrRequest.task._aborted = !0, this._xhrRequest.task.abort(), this._xhrRequest.task = null, this._xhrRequest.onchange = () => {}, this) : (this._xhrRequest.onchange = () => this.cancel(), this);
}
_setRequestTask(t) {
t.requestTask = (t) => {
this._xhrRequest.task = t, this._xhrRequest.onchange();
};
}
comment(t) {
if (null == t) return delete this._comment, this;
if ("string" != typeof t) throw new Error("The value of a comment to be sent with this query must be a string.");
return this._comment = t, this;
}
}, DefaultController$1 = {
find: (t, e, r) => CoreManager.getRESTController().request("GET", "classes/" + t, e, r),
aggregate: (t, e, r) => CoreManager.getRESTController().request("GET", "aggregate/" + t, e, r)
};
CoreManager.setParseQuery(ParseQuery), CoreManager.setQueryController(DefaultController$1);
var Storage = {
async: () => !!CoreManager.getStorageController().async,
getItem(t) {
const e = CoreManager.getStorageController();
if (1 === e.async) throw new Error("Synchronous storage is not supported by the current storage controller");
return e.getItem(t);
},
getItemAsync(t) {
const e = CoreManager.getStorageController();
return 1 === e.async ? e.getItemAsync(t) : Promise.resolve(e.getItem(t));
},
setItem(t, e) {
const r = CoreManager.getStorageController();
if (1 === r.async) throw new Error("Synchronous storage is not supported by the current storage controller");
return r.setItem(t, e);
},
setItemAsync(t, e) {
const r = CoreManager.getStorageController();
return 1 === r.async ? r.setItemAsync(t, e) : Promise.resolve(r.setItem(t, e));
},
removeItem(t) {
const e = CoreManager.getStorageController();
if (1 === e.async) throw new Error("Synchronous storage is not supported by the current storage controller");
return e.removeItem(t);
},
removeItemAsync(t) {
const e = CoreManager.getStorageController();
return 1 === e.async ? e.removeItemAsync(t) : Promise.resolve(e.removeItem(t));
},
getAllKeys() {
const t = CoreManager.getStorageController();
if (1 === t.async) throw new Error("Synchronous storage is not supported by the current storage controller");
return t.getAllKeys();
},
getAllKeysAsync() {
const t = CoreManager.getStorageController();
return 1 === t.async ? t.getAllKeysAsync() : Promise.resolve(t.getAllKeys());
},
generatePath(t) {
if (!CoreManager.get("APPLICATION_ID")) throw new Error("You need to call Parse.initialize before using Parse.");
if ("string" != typeof t) throw new Error("Tried to get a Storage path that was not a String.");
return "/" === t[0] && (t = t.substr(1)), "Parse/" + CoreManager.get("APPLICATION_ID") + "/" + t;
},
_clear() {
const t = CoreManager.getStorageController();
Object.hasOwn(t, "clear") && t.clear();
}
}, QUEUE_KEY = "Parse/Eventually/Queue", queueCache = [], dirtyCache = !0, polling = void 0, EventuallyQueue = {
save(t, e) {
return this.enqueue("save", t, e);
},
destroy(t, e) {
return this.enqueue("destroy", t, e);
},
generateQueueId(t, e) {
e._getId();
const { className: r, id: i, _localId: n } = e;
return [
t,
r,
i,
e.get("hash") || n
].join("_");
},
async enqueue(t, e, r) {
const i = await this.getQueue(), n = this.generateQueueId(t, e);
let o = this.queueItemExists(i, n);
if (o > -1) for (const t in i[o].object) void 0 === e.get(t) && e.set(t, i[o].object[t]);
else o = i.length;
return i[o] = {
queueId: n,
action: t,
object: e.toJSON(),
serverOptions: r || {},
id: e.id,
className: e.className,
hash: e.get("hash"),
createdAt: /* @__PURE__ */ new Date()
}, this.setQueue(i);
},
store: (t) => Storage.setItemAsync(QUEUE_KEY, JSON.stringify(t)),
load: () => Storage.getItemAsync(QUEUE_KEY),
async getQueue() {
return dirtyCache && (queueCache = JSON.parse(await this.load() || "[]"), dirtyCache = !1), queueCache;
},
setQueue(t) {
return queueCache = t, this.store(queueCache);
},
async remove(t) {
const e = await this.getQueue(), r = this.queueItemExists(e, t);
r > -1 && (e.splice(r, 1), await this.setQueue(e));
},
clear() {
return queueCache = [], this.store([]);
},
queueItemExists: (t, e) => t.findIndex(((t) => t.queueId === e)),
async length() {
return (await this.getQueue()).length;
},
async sendQueue() {
const t = [...await this.getQueue()];
if (0 === t.length) return !1;
for (let e = 0; e < t.length; e += 1) {
const r = t[e], { id: i, hash: n, className: o } = r, s = ParseObject.extend(o);
i ? await this.process.byId(s, r) : n ? await this.process.byHash(s, r) : await this.process.create(s, r);
}
return !0;
},
async sendQueueCallback(t, e) {
if (!t) return this.remove(e.queueId);
switch (e.action) {
case "save":
if (void 0 !== t.updatedAt && t.updatedAt > new Date(e.object.createdAt)) return this.remove(e.queueId);
try {
await t.save(e.object, e.serverOptions), await this.remove(e.queueId);
} catch (t) {
t.code !== ParseError.CONNECTION_FAILED && await this.remove(e.queueId);
}
break;
case "destroy": try {
await t.destroy(e.serverOptions), await this.remove(e.queueId);
} catch (t) {
t.code !== ParseError.CONNECTION_FAILED && await this.remove(e.queueId);
}
}
},
poll(t) {
polling || (polling = setInterval((() => {
CoreManager.getRESTController().request("GET", "health").then((({ status: t }) => {
if ("ok" === t) return this.stopPoll(), this.sendQueue();
})).catch(((t) => t));
}), t || 2e3));
},
stopPoll() {
clearInterval(polling), polling = void 0;
},
isPolling: () => !!polling,
_setPolling(t) {
polling = t;
},
process: {
create(t, e) {
const r = new t();
return EventuallyQueue.sendQueueCallback(r, e);
},
async byId(t, e) {
const { sessionToken: r } = e.serverOptions, i = new ParseQuery(t);
i.equalTo("objectId", e.id);
const n = await i.find({ sessionToken: r });
return EventuallyQueue.sendQueueCallback(n[0], e);
},
async byHash(t, e) {
const { sessionToken: r } = e.serverOptions, i = new ParseQuery(t);
i.equalTo("hash", e.hash);
const n = await i.find({ sessionToken: r });
return n.length > 0 ? EventuallyQueue.sendQueueCallback(n[0], e) : EventuallyQueue.process.create(t, e);
}
}
}, defaultGetStoreFunc, IndexedDBStorageController;
function promisifyRequest(t) {
return new Promise(((e, r) => {
t.oncomplete = t.onsuccess = () => e(t.result), t.onabort = t.onerror = () => r(t.error);
}));
}
function createStore(t, e) {
let r;
return (i, n) => (() => {
if (r) return r;
const i = indexedDB.open(t);
return i.onupgradeneeded = () => i.result.createObjectStore(e), r = promisifyRequest(i), r.then(((t) => {
t.onclose = () => r = void 0;
}), (() => {
r = void 0;
})), r;
})().then(((t) => n(t.transaction(e, i).objectStore(e))));
}
function defaultGetStore() {
return defaultGetStoreFunc || (defaultGetStoreFunc = createStore("keyval-store", "keyval")), defaultGetStoreFunc;
}
function get(t, e = defaultGetStore()) {
return e("readonly", ((e) => promisifyRequest(e.get(t))));
}
function set(t, e, r = defaultGetStore()) {
return r("readwrite", ((r) => (r.put(e, t), promisifyRequest(r.transaction))));
}
function del(t, e = defaultGetStore()) {
return e("readwrite", ((e) => (e.delete(t), promisifyRequest(e.transaction))));
}
function clear(t = defaultGetStore()) {
return t("readwrite", ((t) => (t.clear(), promisifyRequest(t.transaction))));
}
function eachCursor(t, e) {
return t.openCursor().onsuccess = function() {
this.result && (e(this.result), this.result.continue());
}, promisifyRequest(t.transaction);
}
function keys(t = defaultGetStore()) {
return t("readonly", ((t) => {
if (t.getAllKeys) return promisifyRequest(t.getAllKeys());
const e = [];
return eachCursor(t, ((t) => e.push(t.key))).then((() => e));
}));
}
if ("undefined" != typeof window && window.indexedDB) try {
const t = createStore("parseDB", "parseStore");
} catch (t) {}
else IndexedDBStorageController = void 0;
var DEVICE_TYPES = {
IOS: "ios",
MACOS: "macos",
TVOS: "tvos",
FCM: "fcm",
ANDROID: "android",
WEB: "web"
}, ParseInstallation = class extends ParseObject {
constructor(t) {
if (super("_Installation"), t && "object" == typeof t) try {
this.set(t || {});
} catch (t) {
throw new Error("Can't create an invalid Installation");
}
}
get appIdentifier() {
return this.get("appIdentifier");
}
get appVersion() {
return this.get("appVersion");
}
get appName() {
return this.get("appName");
}
get badge() {
return this.get("badge");
}
get channels() {
return this.get("channels");
}
get deviceToken() {
return this.get("deviceToken");
}
get deviceType() {
return this.get("deviceType");
}
get GCMSenderId() {
return this.get("GCMSenderId");
}
get installationId() {
return this.get("installationId");
}
get localeIdentifier() {
return this.get("localeIdentifier");
}
get parseVersion() {
return this.get("parseVersion");
}
get pushType() {
return this.get("pushType");
}
get timeZone() {
return this.get("timeZone");
}
static get DEVICE_TYPES() {
return DEVICE_TYPES;
}
async fetch(...t) {
try {
await super.fetch.apply(this, t);
} catch (e) {
if (e.code !== ParseError.OBJECT_NOT_FOUND) throw e;
delete this.id, this._getId(), this._markAllFieldsDirty(), await super.save.apply(this, t);
}
return await CoreManager.getInstallationController().updateInstallationOnDisk(this), this;
}
async save(...t) {
try {
await super.save.apply(this, t);
} catch (e) {
if (e.code !== ParseError.OBJECT_NOT_FOUND) throw e;
delete this.id, this._getId(), this._markAllFieldsDirty(), await super.save.apply(this, t);
}
return await CoreManager.getInstallationController().updateInstallationOnDisk(this), this;
}
_markAllFieldsDirty() {
for (const [t, e] of Object.entries(this.attributes)) this.set(t, e);
}
static currentInstallation() {
return CoreManager.getInstallationController().currentInstallation();
}
};
ParseObject.registerSubclass("_Installation", ParseInstallation);
var CURRENT_INSTALLATION_KEY = "currentInstallation", CURRENT_INSTALLATION_ID_KEY = "currentInstallationId", iidCache = null, currentInstallationCache = null, currentInstallationCacheMatchesDisk = !1, InstallationController = {
async updateInstallationOnDisk(t) {
const e = Storage.generatePath(CURRENT_INSTALLATION_KEY);
await Storage.setItemAsync(e, JSON.stringify(t.toJSON())), this._setCurrentInstallationCache(t);
},
async currentInstallationId() {
if ("string" == typeof iidCache) return iidCache;
const t = Storage.generatePath(CURRENT_INSTALLATION_ID_KEY);
let e = await Storage.getItemAsync(t);
return e ? (iidCache = e, e) : (e = uuid(), Storage.setItemAsync(t, e).then((() => (iidCache = e, e))));
},
async currentInstallation() {
if (currentInstallationCache) return currentInstallationCache;
if (currentInstallationCacheMatchesDisk) return null;
const t = Storage.generatePath(CURRENT_INSTALLATION_KEY);
let e = await Storage.getItemAsync(t);
if (currentInstallationCacheMatchesDisk = !0, e) {
e = JSON.parse(e), e.className = "_Installation";
const t = ParseInstallation.fromJSON(e);
return currentInstallationCache = t, t;
}
const r = await this.currentInstallationId(), i = new ParseInstallation();
return i.set("deviceType", ParseInstallation.DEVICE_TYPES.WEB), i.set("installationId", r), i.set("parseVersion", CoreManager.get("VERSION")), currentInstallationCache = i, await Storage.setItemAsync(t, JSON.stringify(i.toJSON())), i;
},
_clearCache() {
iidCache = null, currentInstallationCache = null, currentInstallationCacheMatchesDisk = !1;
},
_setInstallationIdCache(t) {
iidCache = t;
},
_setCurrentInstallationCache(t, e = !0) {
currentInstallationCache = t, currentInstallationCacheMatchesDisk = e;
}
};
function parseResponse(t) {
let e = t.header || {};
return e = Object.keys(e).reduce(((t, r) => (t[r.toLowerCase()] = e[r], t)), {}), {
status: t.statusCode,
json: () => {
if ("object" == typeof t.data) return Promise.resolve(t.data);
let e = {};
try {
e = JSON.parse(t.data);
} catch (t) {
console.error(t);
}
return Promise.resolve(e);
},
headers: {
keys: () => Object.keys(e),
get: (t) => e[t.toLowerCase()],
has: (t) => t.toLowerCase() in e,
entries: () => {
const t = [];
for (const r in e) e[r] && t.push([r, e[r]]);
return t;
}
}
};
}
function polyfillFetch() {
const t = global;
"function" != typeof t.fetch && (t.fetch = (t, e) => {
const r = t.match(/\.(txt|json|html|txt|csv)/) ? "text" : "arraybuffer";
return new Promise(((i, n) => {
wx.request({
url: t,
method: e.method || "GET",
data: e.body,
header: e.headers,
dataType: r,
responseType: r,
success: (t) => i(parseResponse(t)),
fail: (t) => n(t)
});
}));
});
}
init_dist(), init_dist$2(), polyfillFetch();
var useXDomainRequest = !1;
function getPath(t, e) {
return t.endsWith("/") && (t = t.slice(0, -1)), e.startsWith("/") || (e = "/" + e), t + e;
}
function ajaxIE9(t, e, r, i, n) {
return new Promise(((i, o) => {
const s = new XDomainRequest();
s.onload = function() {
let t;
try {
t = JSON.parse(s.responseText);
} catch (t) {
o(t);
}
t && i({ response: t });
}, s.onerror = s.ontimeout = function() {
o({ responseText: JSON.stringify({
code: ParseError.X_DOMAIN_REQUEST,
error: "IE's XDomainRequest does not supply error info."
}) });
}, s.onprogress = function() {
n && "function" == typeof n.progress && n.progress(s.responseText);
}, s.open(t, e), s.send(r), n && "function" == typeof n.requestTask && n.requestTask(s);
}));
}
"undefined" == typeof XDomainRequest || "withCredentials" in new XMLHttpRequest() || (useXDomainRequest = !0);
var RESTController = {
async ajax(t, e, r, i, n) {
if (useXDomainRequest) return ajaxIE9(t, e, r, i, n);
if ("function" != typeof fetch) throw new Error("Cannot make a request: Fetch API not found.");
const o = resolvingPromise(), s = CoreManager.get("IDEMPOTENCY") && ["POST", "PUT"].includes(t), a = s ? uuid() : "";
let h = 0;
const u = async function() {
const f = new AbortController(), { signal: l } = f;
"string" != typeof (i = i || {})["Content-Type"] && (i["Content-Type"] = "text/plain"), CoreManager.get("IS_NODE") && (i["User-Agent"] = "Parse/" + CoreManager.get("VERSION") + " (NodeJS " + process$1.versions.node + ")"), s && (i["X-Parse-Request-Id"] = a);
const c = CoreManager.get("REQUEST_HEADERS");
for (const t in c) i[t] = c[t];
n && "function" == typeof n.requestTask && n.requestTask(f);
try {
const s = {
method: t,
headers: i,
signal: l,
redirect: "manual"
};
r && (s.body = r, "undefined" != typeof ReadableStream && r instanceof ReadableStream && (s.duplex = "half"));
const a = await fetch(e, s), { status: f } = a;
if (f >= 200 && f < 300) {
let t;
const e = {};
if ((a.headers.get("access-control-expose-headers") || "").split(", ").forEach(((t) => {
t && a.headers.has(t) && (e[t] = a.headers.get(t));
})), n && "function" == typeof n.progress && a.body) {
const e = a.body.getReader(), r = +a.headers.get("Content-Length") || 0;
if (0 === r) n.progress(null, null, null), t = await a.json();
else {
let i = 0;
const o = [];
for (;;) {
const { done: t, value: s } = await e.read();
if (t) break;
o.push(s), i += s?.length || 0, n.progress(i / r, i, r);
}
const s = new Uint8Array(i);
let a = 0;
for (const t of o) s.set(t, a), a += t.length;
const h = new TextDecoder().decode(s);
t = JSON.parse(h);
}
} else t = await a.json();
o.resolve({
status: f,
response: t,
headers: e
});
} else if (f >= 400 && f < 500) {
const t = await a.json();
o.reject(t);
} else if ([
301,
302,
303,
307,
308
].includes(f)) {
const e = a.headers.get("location");
o.resolve({
status: f,
location: e,
method: 303 === f ? "GET" : t,
dropBody: 303 === f
});
} else if (f >= 500 || 0 === f) if (!("undefined" != typeof ReadableStream && r instanceof ReadableStream) && ++h < CoreManager.get("REQUEST_ATTEMPT_LIMIT")) {
const t = Math.round(125 * Math.random() * Math.pow(2, h));
setTimeout(u, t);
} else if (0 === f) o.reject("Unable to connect to the Parse API");
else {
const t = await a.json();
o.reject(t);
}
else o.reject(a);
} catch (t) {
"AbortError" === t.name ? o.resolve({
response: { results: [] },
status: 0
}) : "ECONNREFUSED" === t.cause?.code ? o.reject("Unable to connect to the Parse API") : o.reject(t);
}
};
return u(), o;
},
request(t, e, r, i) {
i = i || {};
const n = getPath(CoreManager.get("SERVER_URL"), e), o = {};
if (r && "object" == typeof r) for (const t in r) o[t] = r[t];
const s = i.context;
void 0 !== s && (o._context = s), "POST" !== t && (o._method = t, t = "POST"), o._ApplicationId = CoreManager.get("APPLICATION_ID");
const a = CoreManager.get("JAVASCRIPT_KEY");
a && (o._JavaScriptKey = a), o._ClientVersion = CoreManager.get("VERSION");
let h = i.useMasterKey;
if (void 0 === h && (h = CoreManager.get("USE_MASTER_KEY")), h) {
if (!CoreManager.get("MASTER_KEY")) throw new Error("Cannot use the Master Key, it has not been provided.");
delete o._JavaScriptKey, o._MasterKey = CoreManager.get("MASTER_KEY");
}
i.useMaintenanceKey && (o._MaintenanceKey = CoreManager.get("MAINTENANCE_KEY")), CoreManager.get("FORCE_REVOCABLE_SESSION") && (o._RevocableSession = "1");
const u = i.installationId;
let f;
return f = u && "string" == typeof u ? Promise.resolve(u) : CoreManager.getInstallationController().currentInstallationId(), f.then(((t) => {
o._InstallationId = t;
const e = CoreManager.getUserController();
return i && "string" == typeof i.sessionToken ? Promise.resolve(i.sessionToken) : e ? e.currentUserAsync().then(((t) => t ? Promise.resolve(t.getSessionToken()) : Promise.resolve(null))) : Promise.resolve(null);
})).then(((r) => {
r && (o._SessionToken = r);
const s = JSON.stringify(o);
return RESTController.ajax(t, n, s, {}, i).then((async (t) => {
if (t.location) {
let r = getPath(t.location, e), n = t.method, o = t.dropBody ? void 0 : s;
for (let a = 0; a < 5; a += 1) {
const a = await RESTController.ajax(n, r, o, {}, i);
if (!a.location) {
t = a;
break;
}
r = getPath(a.location, e), n = a.method, o = a.dropBody ? void 0 : s;
}
}
const { response: r, status: n, headers: o } = t;
return i.returnStatus ? {
...r,
_status: n,
_headers: o
} : r;
}));
})).catch(RESTController.handleError);
},
handleError(t) {
let e;
return e = t.code || t.error || t.message ? new ParseError(t.code, t.error || t.message) : new ParseError(ParseError.CONNECTION_FAILED, "XMLHttpRequest failed: " + JSON.stringify(t)), Promise.reject(e);
}
}, Analytics_exports = __exportAll({ track: () => track });
function track(t, e) {
if (0 === (t = (t = (t = t || "").replace(/^\s*/, "")).replace(/\s*$/, "")).length) throw new TypeError("A name for the custom event must be provided");
for (const t in e) if ("string" != typeof t || "string" != typeof e[t]) throw new TypeError("track() dimensions expects keys and values of type \"string\".");
return CoreManager.getAnalyticsController().track(t, e);
}
function isRevocableSession(t) {
return t.indexOf("r:") > -1;
}
CoreManager.setAnalyticsController({ track(t, e) {
const r = "events/" + t;
return CoreManager.getRESTController().request("POST", r, { dimensions: e });
} });
var CURRENT_USER_KEY = "currentUser", canUseCurrentUser = !CoreManager.get("IS_NODE"), currentUserCacheMatchesDisk = !1, currentUserCache = null, authProviders = {}, ParseUser = class t extends ParseObject {
constructor(t) {
if (super("_User"), t && "object" == typeof t) try {
this.set(t || {});
} catch (t) {
throw new Error("Can't create an invalid Parse User");
}
}
_upgradeToRevocableSession(t) {
const e = ParseObject._getRequestOptions(t);
return CoreManager.getUserController().upgradeToRevocableSession(this, e);
}
linkWith(t, e, r = {}) {
let i;
if (r.sessionToken = r.sessionToken || this.getSessionToken() || "", "string" == typeof t) if (i = t, authProviders[t]) t = authProviders[t];
else {
const e = {
restoreAuthentication: () => !0,
getAuthType: () => i
};
authProviders[e.getAuthType()] = e, t = e;
}
else i = t.getAuthType();
if (e && Object.hasOwn(e, "authData")) {
const t = this.get("authData") || {};
if ("object" != typeof t) throw new Error("Invalid type: authData field should be an object");
t[i] = e.authData;
const n = t.anonymous;
return this.stripAnonymity(), CoreManager.getUserController().linkWith(this, t, r).catch(((e) => {
throw delete t[i], this.restoreAnonimity(n), e;
}));
}
return new Promise(((e, i) => {
t.authenticate({
success: (t, n) => {
const o = {};
o.authData = n, this.linkWith(t, o, r).then((() => {
e(this);
}), ((t) => {
i(t);
}));
},
error: (t, e) => {
i(e);
}
});
}));
}
_linkWith(t, e, r = {}) {
return this.linkWith(t, e, r);
}
_synchronizeAuthData(t) {
if (!this.isCurrent() || !t) return;
let e;
"string" == typeof t ? (e = t, t = authProviders[e]) : e = t.getAuthType();
const r = this.get("authData");
t && r && "object" == typeof r && (t.restoreAuthentication(r[e]) || this._unlinkFrom(t));
}
_synchronizeAllAuthData() {
const t = this.get("authData");
if ("object" == typeof t) for (const e in t) this._synchronizeAuthData(e);
}
_cleanupAuthData() {
if (!this.isCurrent()) return;
const t = this.get("authData");
if ("object" == typeof t) for (const e in t) t[e] || delete t[e];
}
_unlinkFrom(t, e) {
return this.linkWith(t, { authData: null }, e).then((() => (this._synchronizeAuthData(t), Promise.resolve(this))));
}
_isLinked(t) {
let e;
e = "string" == typeof t ? t : t.getAuthType();
const r = this.get("authData") || {};
return "object" == typeof r && !!r[e];
}
_logOutWithAll() {
const t = this.get("authData");
if ("object" == typeof t) for (const e in t) this._logOutWith(e);
}
_logOutWith(t) {
this.isCurrent() && ("string" == typeof t && (t = authProviders[t]), t && t.deauthenticate && t.deauthenticate());
}
_preserveFieldsOnFetch() {
return { sessionToken: this.get("sessionToken") };
}
isCurrent() {
const e = t.current();
return !!e && e.id === this.id;
}
async isCurrentAsync() {
const e = await t.currentAsync();
return !!e && e.id === this.id;
}
stripAnonymity() {
const t = this.get("authData");
t && "object" == typeof t && Object.hasOwn(t, "anonymous") && (t.anonymous = null);
}
restoreAnonimity(t) {
if (t) this.get("authData").anonymous = t;
}
getUsername() {
const t = this.get("username");
return null == t || "string" == typeof t ? t : "";
}
setUsername(t) {
this.stripAnonymity(), this.set("username", t);
}
setPassword(t) {
this.set("password", t);
}
getEmail() {
const t = this.get("email");
return null == t || "string" == typeof t ? t : "";
}
setEmail(t) {
return this.set("email", t);
}
getSessionToken() {
const t = this.get("sessionToken");
return null == t || "string" == typeof t ? t : "";
}
authenticated() {
const e = t.current();
return !!this.get("sessionToken") && !!e && e.id === this.id;
}
signUp(t, e) {
const r = ParseObject._getRequestOptions(e);
return CoreManager.getUserController().signUp(this, t, r);
}
logIn(t = {}) {
const e = ParseObject._getRequestOptions(t);
return Object.hasOwn(e, "usePost") || (e.usePost = !0), CoreManager.getUserController().logIn(this, e);
}
async save(...t) {
return await super.save.apply(this, t), await this.isCurrentAsync() ? CoreManager.getUserController().updateUserOnDisk(this) : this;
}
async destroy(...t) {
return await super.destroy.apply(this, t), await this.isCurrentAsync() ? CoreManager.getUserController().removeUserFromDisk() : this;
}
async fetch(...t) {
return await super.fetch.apply(this, t), await this.isCurrentAsync() ? CoreManager.getUserController().updateUserOnDisk(this) : this;
}
async fetchWithInclude(...t) {
return await super.fetchWithInclude.apply(this, t), await this.isCurrentAsync() ? CoreManager.getUserController().updateUserOnDisk(this) : this;
}
verifyPassword(e, r) {
const i = this.getUsername() || "";
return t.verifyPassword(i, e, r);
}
static readOnlyAttributes() {
return ["sessionToken"];
}
static extend(e, r) {
if (e) for (const r in e) "className" !== r && Object.defineProperty(t.prototype, r, {
value: e[r],
enumerable: !1,
writable: !0,
configurable: !0
});
if (r) for (const e in r) "className" !== e && Object.defineProperty(t, e, {
value: r[e],
enumerable: !1,
writable: !0,
configurable: !0
});
return t;
}
static current() {
return canUseCurrentUser ? CoreManager.getUserController().currentUser() : null;
}
static currentAsync() {
return canUseCurrentUser ? CoreManager.getUserController().currentUserAsync() : Promise.resolve(null);
}
static signUp(t, e, r, i) {
return (r = r || {}).username = t, r.password = e, new this(r).signUp({}, i);
}
static logIn(t, e, r) {
if ("string" != typeof t) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Username must be a string."));
if ("string" != typeof e) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Password must be a string."));
const i = new this();
return i._finishFetch({
username: t,
password: e
}), i.logIn(r);
}
static logInWithAdditionalAuth(t, e, r, i) {
if ("string" != typeof t) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Username must be a string."));
if ("string" != typeof e) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Password must be a string."));
if ("[object Object]" !== Object.prototype.toString.call(r)) return Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Auth must be an object."));
const n = new this();
return n._finishFetch({
username: t,
password: e,
authData: r
}), n.logIn(i);
}
static loginAs(t) {
if (!t) throw new ParseError(ParseError.USERNAME_MISSING, "Cannot log in as user with an empty user id");
const e = CoreManager.getUserController(), r = new this();
return e.loginAs(r, t);
}
static become(t, e) {
if (!canUseCurrentUser) throw new Error("It is not memory-safe to become a user in a server environment");
const r = ParseObject._getRequestOptions(e);
r.sessionToken = t;
const i = CoreManager.getUserController(), n = new this();
return i.become(n, r);
}
static me(t, e) {
const r = CoreManager.getUserController(), i = ParseObject._getRequestOptions(e);
i.sessionToken = t;
const n = new this();
return r.me(n, i);
}
static hydrate(t) {
const e = CoreManager.getUserController(), r = new this();
return e.hydrate(r, t);
}
static logInWith(t, e, r) {
return new this().linkWith(t, e, r);
}
static logOut(t) {
return CoreManager.getUserController().logOut(t);
}
static requestPasswordReset(t, e) {
const r = ParseObject._getRequestOptions(e);
return CoreManager.getUserController().requestPasswordReset(t, r);
}
static requestEmailVerification(t, e) {
const r = ParseObject._getRequestOptions(e);
return CoreManager.getUserController().requestEmailVerification(t, r);
}
static verifyPassword(t, e, r) {
return "string" != typeof t ? Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Username must be a string.")) : "string" != typeof e ? Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Password must be a string.")) : CoreManager.getUserController().verifyPassword(t, e, r || {});
}
static allowCustomUserClass(t) {
CoreManager.set("PERFORM_USER_REWRITE", !t);
}
static enableRevocableSession(e) {
if (e = e || {}, CoreManager.set("FORCE_REVOCABLE_SESSION", !0), canUseCurrentUser) {
const r = t.current();
if (r) return r._upgradeToRevocableSession(e);
}
return Promise.resolve();
}
static enableUnsafeCurrentUser() {
canUseCurrentUser = !0;
}
static disableUnsafeCurrentUser() {
canUseCurrentUser = !1;
}
static _registerAuthenticationProvider(e) {
authProviders[e.getAuthType()] = e, t.currentAsync().then(((t) => {
t && t._synchronizeAuthData(e.getAuthType());
}));
}
static _logInWith(t, e, r) {
return new this().linkWith(t, e, r);
}
static _clearCache() {
currentUserCache = null, currentUserCacheMatchesDisk = !1;
}
static _setCurrentUserCache(t) {
currentUserCache = t;
}
};
ParseObject.registerSubclass("_User", ParseUser);
var DefaultController = {
updateUserOnDisk(t) {
const e = Storage.generatePath(CURRENT_USER_KEY), r = t.toJSON();
delete r.password, r.className = "_User";
let i = JSON.stringify(r);
return CoreManager.get("ENCRYPTED_USER") && (i = CoreManager.getCryptoController().encrypt(r, CoreManager.get("ENCRYPTED_KEY"))), Storage.setItemAsync(e, i).then((() => t));
},
removeUserFromDisk() {
const t = Storage.generatePath(CURRENT_USER_KEY);
return currentUserCacheMatchesDisk = !0, currentUserCache = null, Storage.removeItemAsync(t);
},
setCurrentUser: (t) => (currentUserCache = t, t._cleanupAuthData(), t._synchronizeAllAuthData(), DefaultController.updateUserOnDisk(t)),
currentUser() {
if (currentUserCache) return currentUserCache;
if (currentUserCacheMatchesDisk) return null;
if (Storage.async()) throw new Error("Cannot call currentUser() when using a platform with an async storage system. Call currentUserAsync() instead.");
const t = Storage.generatePath(CURRENT_USER_KEY);
let e = Storage.getItem(t);
if (currentUserCacheMatchesDisk = !0, !e) return currentUserCache = null, null;
CoreManager.get("ENCRYPTED_USER") && (e = CoreManager.getCryptoController().decrypt(e, CoreManager.get("ENCRYPTED_KEY"))), e = JSON.parse(e), e.className || (e.className = "_User"), e._id && (e.objectId !== e._id && (e.objectId = e._id), delete e._id), e._sessionToken && (e.sessionToken = e._sessionToken, delete e._sessionToken);
const r = ParseObject.fromJSON(e);
return currentUserCache = r, r._synchronizeAllAuthData(), r;
},
currentUserAsync() {
if (currentUserCache) return Promise.resolve(currentUserCache);
if (currentUserCacheMatchesDisk) return Promise.resolve(null);
const t = Storage.generatePath(CURRENT_USER_KEY);
return Storage.getItemAsync(t).then(((t) => {
if (currentUserCacheMatchesDisk = !0, !t) return currentUserCache = null, Promise.resolve(null);
CoreManager.get("ENCRYPTED_USER") && (t = CoreManager.getCryptoController().decrypt(t.toString(), CoreManager.get("ENCRYPTED_KEY"))), (t = JSON.parse(t)).className || (t.className = "_User"), t._id && (t.objectId !== t._id && (t.objectId = t._id), delete t._id), t._sessionToken && (t.sessionToken = t._sessionToken, delete t._sessionToken);
const e = ParseObject.fromJSON(t);
return currentUserCache = e, e._synchronizeAllAuthData(), Promise.resolve(e);
}));
},
signUp(t, e, r) {
const i = e && e.username || t.get("username"), n = e && e.password || t.get("password");
return i && i.length ? n && n.length ? t.save(e, r).then((() => (t._finishFetch({ password: void 0 }), canUseCurrentUser ? DefaultController.setCurrentUser(t) : t))) : Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Cannot sign up user with an empty password.")) : Promise.reject(new ParseError(ParseError.OTHER_CAUSE, "Cannot sign up user with an empty username."));
},
logIn(t, e) {
const r = CoreManager.getRESTController(), i = CoreManager.getObjectStateController(), n = {
username: t.get("username"),
password: t.get("password"),
authData: t.get("authData")
};
return r.request(e.usePost ? "POST" : "GET", "login", n, e).then(((e) => (t._migrateId(e.objectId), t._setExisted(!0), i.setPendingOp(t._getStateIdentifier(), "username", void 0), i.setPendingOp(t._getStateIdentifier(), "password", void 0), e.password = void 0, t._finishFetch(e), canUseCurrentUser ? DefaultController.setCurrentUser(t) : Promise.resolve(t))));
},
loginAs: (t, e) => CoreManager.getRESTController().request("POST", "loginAs", { userId: e }, { useMasterKey: !0 }).then(((e) => (t._finishFetch(e), t._setExisted(!0), canUseCurrentUser ? DefaultController.setCurrentUser(t) : Promise.resolve(t)))),
become: (t, e) => CoreManager.getRESTController().request("GET", "users/me", {}, e).then(((e) => (t._finishFetch(e), t._setExisted(!0), DefaultController.setCurrentUser(t)))),
hydrate: (t, e) => (t._finishFetch(e), t._setExisted(!0), e.sessionToken && canUseCurrentUser ? DefaultController.setCurrentUser(t) : Promise.resolve(t)),
me: (t, e) => CoreManager.getRESTController().request("GET", "users/me", {}, e).then(((e) => (t._finishFetch(e), t._setExisted(!0), t))),
logOut(t) {
const e = CoreManager.getRESTController();
return t?.sessionToken ? e.request("POST", "logout", {}, t) : DefaultController.currentUserAsync().then(((t) => {
const r = Storage.generatePath(CURRENT_USER_KEY);
let i = Storage.removeItemAsync(r);
if (null !== t) {
const r = t.getSessionToken();
r && isRevocableSession(r) && (i = i.then((() => e.request("POST", "logout", {}, { sessionToken: r })))), t._logOutWithAll(), t._finishFetch({ sessionToken: void 0 });
}
return currentUserCacheMatchesDisk = !0, currentUserCache = null, i;
}));
},
requestPasswordReset: (t, e) => CoreManager.getRESTController().request("POST", "requestPasswordReset", { email: t }, e),
async upgradeToRevocableSession(t, e) {
const r = t.getSessionToken();
if (!r) return Promise.reject(new ParseError(ParseError.SESSION_MISSING, "Cannot upgrade a user with no session token"));
e.sessionToken = r;
const i = await CoreManager.getRESTController().request("POST", "upgradeToRevocableSession", {}, e);
return t._finishFetch({ sessionToken: i?.sessionToken || "" }), await t.isCurrentAsync() ? DefaultController.setCurrentUser(t) : Promise.resolve(t);
},
linkWith: (t, e, r) => t.save({ authData: e }, r).then((() => canUseCurrentUser ? DefaultController.setCurrentUser(t) : t)),
verifyPassword(t, e, r) {
const i = CoreManager.getRESTController(), n = {
username: t,
password: e,
...void 0 !== r.ignoreEmailVerification && { ignoreEmailVerification: r.ignoreEmailVerification }
};
return i.request("GET", "verifyPassword", n, r);
},
requestEmailVerification: (t, e) => CoreManager.getRESTController().request("POST", "verificationEmailRequest", { email: t }, e)
};
CoreManager.setParseUser(ParseUser), CoreManager.setUserController(DefaultController);
var registered = !1, AnonymousUtils = {
isLinked(t) {
const e = this._getAuthProvider();
return t._isLinked(e.getAuthType());
},
logIn(t) {
const e = this._getAuthProvider();
return ParseUser.logInWith(e.getAuthType(), e.getAuthData(), t);
},
link(t, e) {
const r = this._getAuthProvider();
return t.linkWith(r.getAuthType(), r.getAuthData(), e);
},
isRegistered: () => registered,
_getAuthProvider() {
const t = {
restoreAuthentication: () => !0,
getAuthType: () => "anonymous",
getAuthData: () => ({ authData: { id: uuid() } })
};
return registered || (ParseUser._registerAuthenticationProvider(t), registered = !0), t;
}
}, Cloud_exports = __exportAll({
getJobStatus: () => getJobStatus,
getJobsData: () => getJobsData,
run: () => run,
startJob: () => startJob
});
function run(t, e, r) {
if ("string" != typeof t || 0 === t.length) throw new TypeError("Cloud function name must be a string.");
const i = ParseObject._getRequestOptions(r);
return CoreManager.getCloudController().run(t, e, i);
}
function getJobsData() {
return CoreManager.getCloudController().getJobsData({ useMasterKey: !0 });
}
function startJob(t, e) {
if ("string" != typeof t || 0 === t.length) throw new TypeError("Cloud job name must be a string.");
return CoreManager.getCloudController().startJob(t, e, { useMasterKey: !0 });
}
function getJobStatus(t) {
return new ParseQuery("_JobStatus").get(t, { useMasterKey: !0 });
}
CoreManager.setCloudController({
run(t, e, r) {
const i = CoreManager.getRESTController(), n = encode_default(e, !0);
return i.request("POST", "functions/" + t, n, r).then(((t) => {
if ("object" == typeof t && Object.keys(t).length > 0 && !Object.hasOwn(t, "result")) throw new ParseError(ParseError.INVALID_JSON, "The server returned an invalid response.");
const e = decode(t);
return e && Object.hasOwn(e, "result") ? Promise.resolve(e.result) : Promise.resolve(void 0);
}));
},
getJobsData: (t) => CoreManager.getRESTController().request("GET", "cloud_code/jobs/data", null, t),
async startJob(t, e, r) {
const i = CoreManager.getRESTController(), n = encode_default(e, !0);
return r.returnStatus = !0, (await i.request("POST", "jobs/" + t, n, r))._headers?.["X-Parse-Job-Status-Id"];
}
});
var ParseRole = class extends ParseObject {
constructor(t, e) {
super("_Role"), "string" == typeof t && e instanceof ParseACL && (this.setName(t), this.setACL(e));
}
getName() {
const t = this.get("name");
return null == t || "string" == typeof t ? t : "";
}
setName(t, e) {
return this._validateName(t), this.set("name", t, e);
}
getUsers() {
return this.relation("users");
}
getRoles() {
return this.relation("roles");
}
_validateName(t) {
if ("string" != typeof t) throw new ParseError(ParseError.OTHER_CAUSE, "A role's name must be a String.");
if (!/^[0-9a-zA-Z\-_ ]+$/.test(t)) throw new ParseError(ParseError.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, -, and spaces.");
}
validate(t, e) {
const r = super.validate(t, e);
if (r) return r;
if ("name" in t && t.name !== this.getName()) {
const e = t.name;
if (this.id && this.id !== t.objectId) return new ParseError(ParseError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
try {
this._validateName(e);
} catch (t) {
return t;
}
}
return !1;
}
};
CoreManager.setParseRole(ParseRole), ParseObject.registerSubclass("_Role", ParseRole);
var PUBLIC_KEY = "*", VALID_PERMISSIONS = /* @__PURE__ */ new Map();
VALID_PERMISSIONS.set("get", {}), VALID_PERMISSIONS.set("find", {}), VALID_PERMISSIONS.set("count", {}), VALID_PERMISSIONS.set("create", {}), VALID_PERMISSIONS.set("update", {}), VALID_PERMISSIONS.set("delete", {}), VALID_PERMISSIONS.set("addField", {});
var VALID_PERMISSIONS_EXTENDED = /* @__PURE__ */ new Map();
VALID_PERMISSIONS_EXTENDED.set("protectedFields", {});
var ParseCLP = class t {
constructor(t) {
this.permissionsMap = {};
for (const [t, e] of VALID_PERMISSIONS.entries()) {
this.permissionsMap[t] = Object.assign({}, e);
const r = t.charAt(0).toUpperCase() + t.slice(1);
this[`get${r}RequiresAuthentication`] = function() {
return this._getAccess(t, "requiresAuthentication");
}, this[`set${r}RequiresAuthentication`] = function(e) {
this._setAccess(t, "requiresAuthentication", e);
}, this[`get${r}PointerFields`] = function() {
return this._getAccess(t, "pointerFields", !1);
}, this[`set${r}PointerFields`] = function(e) {
this._setArrayAccess(t, "pointerFields", e);
}, this[`get${r}Access`] = function(e) {
return this._getAccess(t, e);
}, this[`set${r}Access`] = function(e, r) {
this._setAccess(t, e, r);
}, this[`getPublic${r}Access`] = function() {
return this[`get${r}Access`](PUBLIC_KEY);
}, this[`setPublic${r}Access`] = function(t) {
this[`set${r}Access`](PUBLIC_KEY, t);
}, this[`getRole${r}Access`] = function(t) {
return this[`get${r}Access`](this._getRoleName(t));
}, this[`setRole${r}Access`] = function(t, e) {
this[`set${r}Access`](this._getRoleName(t), e);
};
}
for (const [t, e] of VALID_PERMISSIONS_EXTENDED.entries()) this.permissionsMap[t] = Object.assign({}, e);
if (t && "object" == typeof t) if (t instanceof ParseUser) this.setReadAccess(t, !0), this.setWriteAccess(t, !0);
else if (t instanceof ParseRole) this.setRoleReadAccess(t, !0), this.setRoleWriteAccess(t, !0);
else for (const e in t) {
const r = t[e], i = !!VALID_PERMISSIONS.get(e), n = !!VALID_PERMISSIONS_EXTENDED.get(e), o = ["readUserFields", "writeUserFields"].includes(e);
if ("string" != typeof e || !(i || n || o)) throw new TypeError("Tried to create an CLP with an invalid permission type.");
if (o) {
if (r.every(((t) => "string" == typeof t))) {
this.permissionsMap[e] = r;
continue;
}
throw new TypeError("Tried to create an CLP with an invalid permission value.");
}
for (const t in r) {
const i = r[t];
if ("boolean" != typeof i && !n && "pointerFields" !== t) throw new TypeError("Tried to create an CLP with an invalid permission value.");
this.permissionsMap[e][t] = i;
}
}
else if ("function" == typeof t) throw new TypeError("ParseCLP constructed with a function. Did you forget ()?");
}
toJSON() {
return { ...this.permissionsMap };
}
equals(e) {
if (!(e instanceof t)) return !1;
const r = Object.keys(this.permissionsMap), i = Object.keys(e.permissionsMap);
if (r.length !== i.length) return !1;
for (const t in this.permissionsMap) {
if (!e.permissionsMap[t]) return !1;
const r = Object.keys(this.permissionsMap[t]), i = Object.keys(e.permissionsMap[t]);
if (r.length !== i.length) return !1;
for (const r in this.permissionsMap[t]) {
if (!e.permissionsMap[t][r]) return !1;
if (this.permissionsMap[t][r] !== e.permissionsMap[t][r]) return !1;
}
}
return !0;
}
_getRoleName(t) {
let e = t;
if (t instanceof ParseRole && (e = t.getName()), "string" != typeof e) throw new TypeError("role must be a Parse.Role or a String");
return `role:${e}`;
}
_parseEntity(t) {
let e = t;
if (e instanceof ParseUser) {
if (e = e.id, !e) throw new Error("Cannot get access for a Parse.User without an id.");
} else e instanceof ParseRole && (e = this._getRoleName(e));
if ("string" != typeof e) throw new TypeError("userId must be a string.");
return e;
}
_setAccess(t, e, r) {
if (e = this._parseEntity(e), "boolean" != typeof r) throw new TypeError("allowed must be either true or false.");
if (!this.permissionsMap[t][e]) {
if (!r) return;
this.permissionsMap[t][e] = {};
}
r ? this.permissionsMap[t][e] = !0 : delete this.permissionsMap[t][e];
}
_getAccess(t, e, r = !0) {
e = this._parseEntity(e);
const i = this.permissionsMap[t][e];
return r ? !!i && !!this.permissionsMap[t][e] : i;
}
_setArrayAccess(t, e, r) {
if (e = this._parseEntity(e), this.permissionsMap[t][e] || (this.permissionsMap[t][e] = []), !r || Array.isArray(r) && 0 === r.length) delete this.permissionsMap[t][e];
else {
if (!Array.isArray(r) || !r.every(((t) => "string" == typeof t))) throw new TypeError("fields must be an array of strings or undefined.");
this.permissionsMap[t][e] = r;
}
}
_setGroupPointerPermission(t, e) {
if (this.permissionsMap[t] || (this.permissionsMap[t] = []), !e || Array.isArray(e) && 0 === e.length) delete this.permissionsMap[t];
else {
if (!Array.isArray(e) || !e.every(((t) => "string" == typeof t))) throw new TypeError(`${t}.pointerFields must be an array of strings or undefined.`);
this.permissionsMap[t] = e;
}
}
_getGroupPointerPermissions(t) {
return this.permissionsMap[t] || [];
}
setReadUserFields(t) {
this._setGroupPointerPermission("readUserFields", t);
}
getReadUserFields() {
return this._getGroupPointerPermissions("readUserFields") || [];
}
setWriteUserFields(t) {
this._setGroupPointerPermission("writeUserFields", t);
}
getWriteUserFields() {
return this._getGroupPointerPermissions("writeUserFields") || [];
}
setProtectedFields(t, e) {
this._setArrayAccess("protectedFields", t, e);
}
getProtectedFields(t) {
return this._getAccess("protectedFields", t, !1);
}
setReadAccess(t, e) {
this._setAccess("find", t, e), this._setAccess("get", t, e), this._setAccess("count", t, e);
}
getReadAccess(t) {
return this._getAccess("find", t) && this._getAccess("get", t) && this._getAccess("count", t);
}
setWriteAccess(t, e) {
this._setAccess("create", t, e), this._setAccess("update", t, e), this._setAccess("delete", t, e), this._setAccess("addField", t, e);
}
getWriteAccess(t) {
return this._getAccess("create", t) && this._getAccess("update", t) && this._getAccess("delete", t) && this._getAccess("addField", t);
}
setPublicReadAccess(t) {
this.setReadAccess(PUBLIC_KEY, t);
}
getPublicReadAccess() {
return this.getReadAccess(PUBLIC_KEY);
}
setPublicWriteAccess(t) {
this.setWriteAccess(PUBLIC_KEY, t);
}
getPublicWriteAccess() {
return this.getWriteAccess(PUBLIC_KEY);
}
setPublicProtectedFields(t) {
this.setProtectedFields(PUBLIC_KEY, t);
}
getPublicProtectedFields() {
return this.getProtectedFields(PUBLIC_KEY);
}
getRoleReadAccess(t) {
return this.getReadAccess(this._getRoleName(t));
}
getRoleWriteAccess(t) {
return this.getWriteAccess(this._getRoleName(t));
}
setRoleReadAccess(t, e) {
this.setReadAccess(this._getRoleName(t), e);
}
setRoleWriteAccess(t, e) {
this.setWriteAccess(this._getRoleName(t), e);
}
getRoleProtectedFields(t) {
return this.getProtectedFields(this._getRoleName(t));
}
setRoleProtectedFields(t, e) {
this.setProtectedFields(this._getRoleName(t), e);
}
}, import_events = __toESM(require_events()), EventEmitter;
try {
EventEmitter = (import_events.default || import_events).EventEmitter;
} catch (t) {}
var EventEmitter_default = EventEmitter, ParseConfig = class {
constructor() {
this.attributes = {}, this._escapedAttributes = {};
}
get(t) {
return this.attributes[t];
}
escape(t) {
const e = this._escapedAttributes[t];
if (e) return e;
const r = this.attributes[t];
let i = "";
return null != r && (i = escape$1(r.toString())), this._escapedAttributes[t] = i, i;
}
static current() {
return CoreManager.getConfigController().current();
}
static get(t) {
return CoreManager.getConfigController().get(t);
}
static save(t, e) {
const r = CoreManager.getConfigController();
return r.save(t, e).then((() => r.get({ useMasterKey: !0 })), ((t) => Promise.reject(t)));
}
static _clearCache() {
currentConfig = null;
}
}, currentConfig = null, CURRENT_CONFIG_KEY = "currentConfig";
function decodePayload(t) {
try {
const e = JSON.parse(t);
if (e && "object" == typeof e) return decode(e);
} catch (t) {
return null;
}
}
CoreManager.setConfigController({
current() {
if (currentConfig) return currentConfig;
const t = new ParseConfig(), e = Storage.generatePath(CURRENT_CONFIG_KEY);
if (!Storage.async()) {
const r = Storage.getItem(e);
if (r) {
const e = decodePayload(r);
e && (t.attributes = e, currentConfig = t);
}
return t;
}
return Storage.getItemAsync(e).then(((e) => {
if (e) {
const r = decodePayload(e);
r && (t.attributes = r, currentConfig = t);
}
return t;
}));
},
get: (t) => CoreManager.getRESTController().request("GET", "config", {}, t).then(((t) => {
if (!t || !t.params) {
const t = new ParseError(ParseError.INVALID_JSON, "Config JSON response invalid.");
return Promise.reject(t);
}
const e = new ParseConfig();
e.attributes = {};
for (const r in t.params) e.attributes[r] = decode(t.params[r]);
return currentConfig = e, Storage.setItemAsync(Storage.generatePath(CURRENT_CONFIG_KEY), JSON.stringify(t.params)).then((() => e));
})),
save(t, e) {
const r = CoreManager.getRESTController(), i = {};
for (const e in t) i[e] = encode_default(t[e]);
return r.request("PUT", "config", {
params: i,
masterKeyOnly: e
}, { useMasterKey: !0 }).then(((t) => {
if (t && t.result) return Promise.resolve();
{
const t = new ParseError(ParseError.INTERNAL_SERVER_ERROR, "Error occured updating Config.");
return Promise.reject(t);
}
}));
}
});
var initialized = !1, requestedPermissions, initOptions, provider = {
authenticate(t) {
"undefined" == typeof FB && t.error(this, "Facebook SDK not found."), FB.login(((e) => {
e.authResponse ? t.success && t.success(this, {
id: e.authResponse.userID,
access_token: e.authResponse.accessToken,
expiration_date: new Date(1e3 * e.authResponse.expiresIn + (/* @__PURE__ */ new Date()).getTime()).toJSON()
}) : t.error && t.error(this, e);
}), { scope: requestedPermissions });
},
restoreAuthentication(t) {
if (t) {
const e = {};
if (initOptions) for (const t in initOptions) e[t] = initOptions[t];
e.status = !1;
const r = FB.getAuthResponse();
r && r.userID !== t.id && FB.logout(), FB.init(e);
}
return !0;
},
getAuthType: () => "facebook",
deauthenticate() {
this.restoreAuthentication(null);
}
}, FacebookUtils = {
init(t) {
if ("undefined" == typeof FB) throw new Error("The Facebook JavaScript SDK must be loaded before calling init.");
if (initOptions = {}, t) for (const e in t) initOptions[e] = t[e];
initOptions.status && "undefined" != typeof console && (console.warn || console.log || function() {}).call(console, "The \"status\" flag passed into FB.init, when set to true, can interfere with Parse Facebook integration, so it has been suppressed. Please call FB.getLoginStatus() explicitly if you require this behavior."), initOptions.status = !1, FB.init(initOptions), ParseUser._registerAuthenticationProvider(provider), initialized = !0;
},
isLinked: (t) => t._isLinked("facebook"),
logIn(t, e) {
if (!t || "string" == typeof t) {
if (!initialized) throw new Error("You must initialize FacebookUtils before calling logIn.");
return requestedPermissions = t, ParseUser.logInWith("facebook", e);
}
const r = { authData: t };
return ParseUser.logInWith("facebook", r, e);
},
link(t, e, r) {
if (!e || "string" == typeof e) {
if (!initialized) throw new Error("You must initialize FacebookUtils before calling link.");
return requestedPermissions = e, t.linkWith("facebook", r);
}
const i = { authData: e };
return t.linkWith("facebook", i, r);
},
unlink: function(t, e) {
if (!initialized) throw new Error("You must initialize FacebookUtils before calling unlink.");
return t._unlinkFrom("facebook", e);
},
_getAuthProvider: () => provider
};
CoreManager.setHooksController({
get(t, e, r) {
let i = "hooks/" + t;
return e && (i += "/" + e, r && (i += "/" + r)), this.sendRequest("GET", i);
},
create(t) {
let e;
if (t.functionName && t.url) e = "hooks/functions";
else {
if (!(t.className && t.triggerName && t.url)) return Promise.reject({
error: "invalid hook declaration",
code: 143
});
e = "hooks/triggers";
}
return this.sendRequest("POST", e, t);
},
remove(t) {
let e;
if (t.functionName) e = "hooks/functions/" + t.functionName, delete t.functionName;
else {
if (!t.className || !t.triggerName) return Promise.reject({
error: "invalid hook declaration",
code: 143
});
e = "hooks/triggers/" + t.className + "/" + t.triggerName, delete t.className, delete t.triggerName;
}
return this.sendRequest("PUT", e, { __op: "Delete" });
},
update(t) {
let e;
if (t.functionName && t.url) e = "hooks/functions/" + t.functionName, delete t.functionName;
else {
if (!(t.className && t.triggerName && t.url)) return Promise.reject({
error: "invalid hook declaration",
code: 143
});
e = "hooks/triggers/" + t.className + "/" + t.triggerName, delete t.className, delete t.triggerName;
}
return this.sendRequest("PUT", e, t);
},
sendRequest: (t, e, r) => CoreManager.getRESTController().request(t, e, r, { useMasterKey: !0 }).then(((t) => {
const e = decode(t);
return e ? Promise.resolve(e) : Promise.reject(new ParseError(ParseError.INVALID_JSON, "The server returned an invalid response."));
}))
});
var LocalDatastoreController$1 = {
async fromPinWithName(t) {
const e = await Storage.getItemAsync(t);
return e ? JSON.parse(e) : [];
},
pinWithName(t, e) {
const r = JSON.stringify(e);
return Storage.setItemAsync(t, r);
},
unPinWithName: (t) => Storage.removeItemAsync(t),
getAllContents: async () => (await Storage.getAllKeysAsync()).reduce((async (t, e) => {
const r = await t;
if (isLocalDatastoreKey(e)) {
const t = await Storage.getItemAsync(e);
try {
r[e] = JSON.parse(t);
} catch (t) {
console.error("Error getAllContents: ", t);
}
}
return r;
}), Promise.resolve({})),
getRawStorage: async () => (await Storage.getAllKeysAsync()).reduce((async (t, e) => {
const r = await t;
return r[e] = await Storage.getItemAsync(e), r;
}), Promise.resolve({})),
async clear() {
const t = await Storage.getAllKeysAsync(), e = [];
for (const r of t) isLocalDatastoreKey(r) && e.push(r);
const r = e.map(this.unPinWithName);
return Promise.all(r);
}
}, LocalDatastoreController = LocalDatastoreController$1, LocalDatastore = {
isEnabled: !1,
isSyncing: !1,
fromPinWithName: (t) => CoreManager.getLocalDatastoreController().fromPinWithName(t),
pinWithName: async (t, e) => CoreManager.getLocalDatastoreController().pinWithName(t, e),
unPinWithName: async (t) => CoreManager.getLocalDatastoreController().unPinWithName(t),
_getAllContents: () => CoreManager.getLocalDatastoreController().getAllContents(),
_getRawStorage: async () => CoreManager.getLocalDatastoreController().getRawStorage(),
_clear: async () => CoreManager.getLocalDatastoreController().clear(),
async _handlePinAllWithName(t, e) {
const r = this.getPinName(t), i = [], n = [];
for (const t of e) {
const e = this._getChildren(t), r = this.getKeyForObject(t), o = t._toFullJSON(void 0, !0);
t._localId && (o._localId = t._localId), e[r] = o;
for (const t in e) n.push(t), i.push(this.pinWithName(t, [e[t]]));
}
const o = this.fromPinWithName(r), [s] = await Promise.all([o, i]), a = [.../* @__PURE__ */ new Set([...s || [], ...n])];
return this.pinWithName(r, a);
},
async _handleUnPinAllWithName(t, e) {
const r = await this._getAllContents(), i = this.getPinName(t), n = [];
let o = [];
for (const t of e) {
const e = this._getChildren(t), r = this.getKeyForObject(t);
o.push(r, ...Object.keys(e));
}
o = [...new Set(o)];
let s = r[i] || [];
s = s.filter(((t) => !o.includes(t))), 0 == s.length ? (n.push(this.unPinWithName(i)), delete r[i]) : (n.push(this.pinWithName(i, s)), r[i] = s);
for (const t of o) {
let e = !1;
for (const i in r) if (("_default" === i || i.startsWith("parsePin_")) && (r[i] || []).includes(t)) {
e = !0;
break;
}
e || n.push(this.unPinWithName(t));
}
return Promise.all(n);
},
_getChildren(t) {
const e = {}, r = t._toFullJSON(void 0, !0);
for (const t in r) r[t] && r[t].__type && "Object" === r[t].__type && this._traverse(r[t], e);
return e;
},
_traverse(t, e) {
if (t.objectId) {
{
const r = this.getKeyForObject(t);
if (e[r]) return;
e[r] = t;
}
for (const r in t) {
let i = t[r];
t[r] || (i = t), i.__type && "Object" === i.__type && this._traverse(i, e);
}
}
},
async _serializeObjectsFromPinName(t) {
const e = await this._getAllContents(), r = [];
for (const t in e) t.startsWith("Parse_LDS_") && r.push(e[t][0]);
if (!t) return r;
const i = e[this.getPinName(t)];
if (!Array.isArray(i)) return [];
const n = i.map(((t) => this.fromPinWithName(t)));
let o = await Promise.all(n);
return o = [].concat(...o), o.filter(((t) => null != t));
},
async _serializeObject(t, e) {
let r = e;
if (r || (r = await this._getAllContents()), !r[t] || 0 === r[t].length) return null;
const i = r[t][0], n = [], o = {};
let s = 0;
for (o[s] = i, n.push(s); 0 !== n.length;) {
const t = o[n.shift()];
for (const e in t) {
const i = t[e];
if (i.__type && "Object" === i.__type) {
const a = this.getKeyForObject(i);
if (r[a] && r[a].length > 0) {
const i = r[a][0];
s++, o[s] = i, t[e] = i, n.push(s);
}
}
}
}
return i;
},
async _updateObjectIfPinned(t) {
if (!this.isEnabled) return;
const e = this.getKeyForObject(t), r = await this.fromPinWithName(e);
return r && 0 !== r.length ? this.pinWithName(e, [t._toFullJSON()]) : void 0;
},
async _destroyObjectIfPinned(t) {
if (!this.isEnabled) return;
const e = await this._getAllContents(), r = this.getKeyForObject(t);
if (!e[r]) return;
const i = [this.unPinWithName(r)];
delete e[r];
for (const t in e) if ("_default" === t || t.startsWith("parsePin_")) {
let n = e[t] || [];
n.includes(r) && (n = n.filter(((t) => t !== r)), 0 == n.length ? (i.push(this.unPinWithName(t)), delete e[t]) : (i.push(this.pinWithName(t, n)), e[t] = n));
}
return Promise.all(i);
},
async _updateLocalIdForObject(t, e) {
if (!this.isEnabled) return;
const r = `${OBJECT_PREFIX}${e.className}_${t}`, i = this.getKeyForObject(e), n = await this.fromPinWithName(r);
if (!n || 0 === n.length) return;
const o = [this.unPinWithName(r), this.pinWithName(i, n)], s = await this._getAllContents();
for (const t in s) if ("_default" === t || t.startsWith("parsePin_")) {
let e = s[t] || [];
e.includes(r) && (e = e.filter(((t) => t !== r)), e.push(i), o.push(this.pinWithName(t, e)), s[t] = e);
}
return Promise.all(o);
},
async updateFromServer() {
if (!this.checkIfEnabled() || this.isSyncing) return;
const t = await this._getAllContents(), e = [];
for (const r in t) r.startsWith("Parse_LDS_") && e.push(r);
if (0 === e.length) return;
this.isSyncing = !0;
const r = {};
for (const t of e) {
let [, , e, i] = t.split("_");
5 === t.split("_").length && "User" === t.split("_")[3] && (e = "_User", i = t.split("_")[4]), i.startsWith("local") || (e in r || (r[e] = /* @__PURE__ */ new Set()), r[e].add(i));
}
const i = Object.keys(r).map(((t) => {
const e = Array.from(r[t]), i = new ParseQuery(t);
return i.limit(e.length), 1 === e.length ? i.equalTo("objectId", e[0]) : i.containedIn("objectId", e), i.find();
}));
try {
const t = await Promise.all(i), e = [].concat.apply([], t).map(((t) => {
const e = this.getKeyForObject(t);
return this.pinWithName(e, t._toFullJSON());
}));
await Promise.all(e), this.isSyncing = !1;
} catch (t) {
console.error("Error syncing LocalDatastore: ", t), this.isSyncing = !1;
}
},
getKeyForObject(t) {
const e = t.objectId || t._getId();
return `${OBJECT_PREFIX}${t.className}_${e}`;
},
getPinName: (t) => t && "_default" !== t ? PIN_PREFIX + t : DEFAULT_PIN,
checkIfEnabled() {
return this.isEnabled || console.error("Parse.enableLocalDatastore() must be called first"), this.isEnabled;
}
};
CoreManager.setLocalDatastoreController(LocalDatastoreController), CoreManager.setLocalDatastore(LocalDatastore);
var Push_exports = __exportAll({
getPushStatus: () => getPushStatus,
send: () => send
});
function send(t, e = {}) {
if (t.where && t.where instanceof ParseQuery && (t.where = t.where.toJSON().where), t.push_time && "object" == typeof t.push_time && (t.push_time = t.push_time.toJSON()), t.expiration_time && "object" == typeof t.expiration_time && (t.expiration_time = t.expiration_time.toJSON()), t.expiration_time && t.expiration_interval) throw new Error("expiration_time and expiration_interval cannot both be set.");
const r = { useMasterKey: !0 };
return Object.hasOwn(e, "useMasterKey") && (r.useMasterKey = e.useMasterKey), CoreManager.getPushController().send(t, r);
}
function getPushStatus(t, e = {}) {
const r = { useMasterKey: !0 };
return Object.hasOwn(e, "useMasterKey") && (r.useMasterKey = e.useMasterKey), new ParseQuery("_PushStatus").get(t, r);
}
CoreManager.setPushController({ send: async (t, e) => (e.returnStatus = !0, (await CoreManager.getRESTController().request("POST", "push", t, e))._headers?.["X-Parse-Push-Status-Id"]) });
var FIELD_TYPES = [
"String",
"Number",
"Boolean",
"Bytes",
"Date",
"File",
"GeoPoint",
"Polygon",
"Array",
"Object",
"Pointer",
"Relation"
], ParseSchema = class {
constructor(t) {
"string" == typeof t && ("User" === t && CoreManager.get("PERFORM_USER_REWRITE") ? this.className = "_User" : this.className = t), this._fields = {}, this._indexes = {};
}
static all() {
return CoreManager.getSchemaController().get("").then(((t) => {
if (0 === t.results.length) throw new Error("Schema not found.");
return t.results;
}));
}
get() {
return this.assertClassName(), CoreManager.getSchemaController().get(this.className).then(((t) => {
if (!t) throw new Error("Schema not found.");
return t;
}));
}
save() {
this.assertClassName();
const t = CoreManager.getSchemaController(), e = {
className: this.className,
fields: this._fields,
indexes: this._indexes,
classLevelPermissions: this._clp
};
return t.create(this.className, e);
}
update() {
this.assertClassName();
const t = CoreManager.getSchemaController(), e = {
className: this.className,
fields: this._fields,
indexes: this._indexes,
classLevelPermissions: this._clp
};
return this._fields = {}, this._indexes = {}, t.update(this.className, e);
}
delete() {
return this.assertClassName(), CoreManager.getSchemaController().delete(this.className);
}
purge() {
return this.assertClassName(), CoreManager.getSchemaController().purge(this.className);
}
assertClassName() {
if (!this.className) throw new Error("You must set a Class Name before making any request.");
}
setCLP(t) {
return this._clp = t instanceof ParseCLP ? t.toJSON() : t, this;
}
addField(t, e, r) {
if (e = e || "String", r = r || {}, !t) throw new Error("field name may not be null.");
if (-1 === FIELD_TYPES.indexOf(e)) throw new Error(`${e} is not a valid type.`);
if ("Pointer" === e) return this.addPointer(t, r.targetClass, r);
if ("Relation" === e) return this.addRelation(t, r.targetClass);
const i = { type: e };
return "boolean" == typeof r.required && (i.required = r.required), void 0 !== r.defaultValue && (i.defaultValue = r.defaultValue), "Date" === e && r && r.defaultValue && (i.defaultValue = {
__type: "Date",
iso: new Date(r.defaultValue)
}), "Bytes" === e && r && r.defaultValue && (i.defaultValue = {
__type: "Bytes",
base64: r.defaultValue
}), this._fields[t] = i, this;
}
addIndex(t, e) {
if (!t) throw new Error("index name may not be null.");
if (!e) throw new Error("index may not be null.");
return this._indexes[t] = e, this;
}
addString(t, e) {
return this.addField(t, "String", e);
}
addNumber(t, e) {
return this.addField(t, "Number", e);
}
addBoolean(t, e) {
return this.addField(t, "Boolean", e);
}
addBytes(t, e) {
return this.addField(t, "Bytes", e);
}
addDate(t, e) {
return this.addField(t, "Date", e);
}
addFile(t, e) {
return this.addField(t, "File", e);
}
addGeoPoint(t, e) {
return this.addField(t, "GeoPoint", e);
}
addPolygon(t, e) {
return this.addField(t, "Polygon", e);
}
addArray(t, e) {
return this.addField(t, "Array", e);
}
addObject(t, e) {
return this.addField(t, "Object", e);
}
addPointer(t, e, r) {
if (!t) throw new Error("field name may not be null.");
if (!e) throw new Error("You need to set the targetClass of the Pointer.");
const i = {
type: "Pointer",
targetClass: e
};
return "boolean" == typeof r?.required && (i.required = r.required), void 0 !== r?.defaultValue && (i.defaultValue = r.defaultValue, r.defaultValue instanceof ParseObject && (i.defaultValue = r.defaultValue.toPointer())), this._fields[t] = i, this;
}
addRelation(t, e) {
if (!t) throw new Error("field name may not be null.");
if (!e) throw new Error("You need to set the targetClass of the Relation.");
return this._fields[t] = {
type: "Relation",
targetClass: e
}, this;
}
deleteField(t) {
return this._fields[t] = { __op: "Delete" }, this;
}
deleteIndex(t) {
return this._indexes[t] = { __op: "Delete" }, this;
}
};
CoreManager.setSchemaController({
send: (t, e, r = {}) => CoreManager.getRESTController().request(e, `schemas/${t}`, r, { useMasterKey: !0 }),
get(t) {
return this.send(t, "GET");
},
create(t, e) {
return this.send(t, "POST", e);
},
update(t, e) {
return this.send(t, "PUT", e);
},
delete(t) {
return this.send(t, "DELETE");
},
purge: (t) => CoreManager.getRESTController().request("DELETE", `purge/${t}`, {}, { useMasterKey: !0 })
});
var ParseSession = class extends ParseObject {
constructor(t) {
if (super("_Session"), t && "object" == typeof t) try {
this.set(t || {});
} catch (t) {
throw new Error("Can't create an invalid Session");
}
}
getSessionToken() {
const t = this.get("sessionToken");
return "string" == typeof t ? t : "";
}
static readOnlyAttributes() {
return [
"createdWith",
"expiresAt",
"installationId",
"restricted",
"sessionToken",
"user"
];
}
static current(t) {
const e = CoreManager.getSessionController(), r = ParseObject._getRequestOptions(t);
return ParseUser.currentAsync().then(((t) => t ? (r.sessionToken = t.getSessionToken(), e.getSession(r)) : Promise.reject("There is no current user.")));
}
static isCurrentSessionRevocable() {
const t = ParseUser.current();
return !!t && isRevocableSession(t.getSessionToken() || "");
}
};
ParseObject.registerSubclass("_Session", ParseSession), CoreManager.setSessionController({ getSession(t) {
const e = CoreManager.getRESTController(), r = new ParseSession();
return e.request("GET", "sessions/me", {}, t).then(((t) => (r._finishFetch(t), r._setExisted(!0), r)));
} });
var LiveQuerySubscription = class {
constructor(t, e, r, i) {
this.id = t, this.query = e, this.sessionToken = r, this.client = i, this.subscribePromise = resolvingPromise(), this.unsubscribePromise = resolvingPromise(), this.subscribed = !1;
const n = CoreManager.getEventEmitter();
this.emitter = new n(), this.on = (t, e) => this.emitter.on(t, e), this.emit = (t, ...e) => this.emitter.emit(t, ...e), this.on("error", (() => {}));
}
unsubscribe() {
return CoreManager.getLiveQueryController().getDefaultLiveQueryClient().then(((t) => (this.emit("close"), t.unsubscribe(this))));
}
find() {
this.client && this.client.connectPromise.then((() => {
this.client.socket.send(JSON.stringify({
op: "query",
requestId: this.id
}));
}));
}
}, CLIENT_STATE = {
INITIALIZED: "initialized",
CONNECTING: "connecting",
CONNECTED: "connected",
CLOSED: "closed",
RECONNECTING: "reconnecting",
DISCONNECTED: "disconnected"
}, OP_TYPES = {
CONNECT: "connect",
SUBSCRIBE: "subscribe",
UNSUBSCRIBE: "unsubscribe",
ERROR: "error",
QUERY: "query"
}, OP_EVENTS = {
CONNECTED: "connected",
SUBSCRIBED: "subscribed",
UNSUBSCRIBED: "unsubscribed",
ERROR: "error",
CREATE: "create",
UPDATE: "update",
ENTER: "enter",
LEAVE: "leave",
DELETE: "delete",
RESULT: "result"
}, CLIENT_EMMITER_TYPES = {
CLOSE: "close",
ERROR: "error",
OPEN: "open"
}, SUBSCRIPTION_EMMITER_TYPES = {
OPEN: "open",
CLOSE: "close",
ERROR: "error",
CREATE: "create",
UPDATE: "update",
ENTER: "enter",
LEAVE: "leave",
DELETE: "delete",
RESULT: "result"
}, generateInterval = (t) => Math.random() * Math.min(30, Math.pow(2, t) - 1) * 1e3, LiveQueryClient = class {
constructor({ applicationId: t, serverURL: e, javascriptKey: r, masterKey: i, sessionToken: n, installationId: o }) {
if (!e || 0 !== e.indexOf("ws")) throw new Error("You need to set a proper Parse LiveQuery server url before using LiveQueryClient");
this.reconnectHandle = null, this.attempts = 1, this.id = 0, this.requestId = 1, this.serverURL = e, this.applicationId = t, this.javascriptKey = r || void 0, this.masterKey = i || void 0, this.sessionToken = n || void 0, this.installationId = o || void 0, this.additionalProperties = !0, this.connectPromise = resolvingPromise(), this.subscriptions = /* @__PURE__ */ new Map(), this.state = CLIENT_STATE.INITIALIZED;
const s = CoreManager.getEventEmitter();
this.emitter = new s(), this.on = (t, e) => this.emitter.on(t, e), this.emit = (t, ...e) => this.emitter.emit(t, ...e), this.on("error", (() => {}));
}
shouldOpen() {
return this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED;
}
subscribe(t, e) {
if (!t) return;
const r = t.className, i = t.toJSON(), n = i.where, o = i.keys?.split(","), s = i.watch?.split(","), a = {
op: OP_TYPES.SUBSCRIBE,
requestId: this.requestId,
query: {
className: r,
where: n,
keys: o,
watch: s
},
sessionToken: void 0
};
e && (a.sessionToken = e);
const h = new LiveQuerySubscription(this.requestId, t, e, this);
return this.subscriptions.set(this.requestId, h), this.requestId += 1, this.connectPromise.then((() => {
this.socket.send(JSON.stringify(a));
})).catch(((t) => {
h.subscribePromise.reject(t);
})), h;
}
async unsubscribe(t) {
if (!t) return;
const e = {
op: OP_TYPES.UNSUBSCRIBE,
requestId: t.id
};
return this.connectPromise.then((() => this.socket.send(JSON.stringify(e)))).then((() => t.unsubscribePromise));
}
open() {
const t = CoreManager.getWebSocketController();
t ? (this.state !== CLIENT_STATE.RECONNECTING && (this.state = CLIENT_STATE.CONNECTING), this.socket = new t(this.serverURL), this.socket.closingPromise = resolvingPromise(), this.socket.onopen = () => {
this._handleWebSocketOpen();
}, this.socket.onmessage = (t) => {
this._handleWebSocketMessage(t);
}, this.socket.onclose = (t) => {
this.socket.closingPromise?.resolve(t), this._handleWebSocketClose();
}, this.socket.onerror = (t) => {
this._handleWebSocketError(t);
}) : this.emit(CLIENT_EMMITER_TYPES.ERROR, "Can not find WebSocket implementation");
}
resubscribe() {
this.subscriptions.forEach(((t, e) => {
const r = t.query, i = r.toJSON(), n = i.where, o = i.keys?.split(","), s = i.watch?.split(","), a = r.className, h = t.sessionToken, u = {
op: OP_TYPES.SUBSCRIBE,
requestId: e,
query: {
className: a,
where: n,
keys: o,
watch: s
},
sessionToken: void 0
};
h && (u.sessionToken = h), this.connectPromise.then((() => {
this.socket.send(JSON.stringify(u));
}));
}));
}
async close() {
if (this.state !== CLIENT_STATE.INITIALIZED && this.state !== CLIENT_STATE.DISCONNECTED) {
this.state = CLIENT_STATE.DISCONNECTED, this.socket?.close();
for (const t of this.subscriptions.values()) t.subscribed = !1, t.emit(SUBSCRIPTION_EMMITER_TYPES.CLOSE);
return this._handleReset(), this.emit(CLIENT_EMMITER_TYPES.CLOSE), this.socket?.closingPromise;
}
}
_handleReset() {
this.attempts = 1, this.id = 0, this.requestId = 1, this.connectPromise = resolvingPromise(), this.subscriptions = /* @__PURE__ */ new Map();
}
_handleWebSocketOpen() {
const t = {
op: OP_TYPES.CONNECT,
applicationId: this.applicationId,
javascriptKey: this.javascriptKey,
masterKey: this.masterKey,
sessionToken: this.sessionToken,
installationId: void 0
};
this.additionalProperties && (t.installationId = this.installationId), this.socket.send(JSON.stringify(t));
}
_handleWebSocketMessage(t) {
let e = t.data;
"string" == typeof e && (e = JSON.parse(e));
let r = null;
e.requestId && (r = this.subscriptions.get(e.requestId) || null);
const i = {
clientId: e.clientId,
installationId: e.installationId
};
switch (e.op) {
case OP_EVENTS.CONNECTED:
this.state === CLIENT_STATE.RECONNECTING && this.resubscribe(), this.emit(CLIENT_EMMITER_TYPES.OPEN), this.id = e.clientId, this.connectPromise.resolve(), this.state = CLIENT_STATE.CONNECTED;
break;
case OP_EVENTS.SUBSCRIBED:
r && (this.attempts = 1, r.subscribed = !0, r.subscribePromise.resolve(), setTimeout((() => r.emit(SUBSCRIPTION_EMMITER_TYPES.OPEN, i)), 200));
break;
case OP_EVENTS.ERROR: {
const t = new ParseError(e.code, e.error);
this.id || (this.connectPromise.reject(t), this.state = CLIENT_STATE.DISCONNECTED), e.requestId ? r && (r.subscribePromise.reject(t), setTimeout((() => r.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR, e.error)), 200)) : this.emit(CLIENT_EMMITER_TYPES.ERROR, e.error), "Additional properties not allowed" === e.error && (this.additionalProperties = !1), e.reconnect && this._handleReconnect();
break;
}
case OP_EVENTS.UNSUBSCRIBED:
r && (this.subscriptions.delete(e.requestId), r.subscribed = !1, r.unsubscribePromise.resolve());
break;
case OP_EVENTS.RESULT:
if (r) {
const t = e.results.map(((t) => (!t.className && r.query && (t.className = r.query.className), ParseObject.fromJSON(t, !1))));
r.emit(SUBSCRIPTION_EMMITER_TYPES.RESULT, t);
}
break;
default: {
if (!r) break;
let t = !1;
if (e.original) {
t = !0, delete e.original.__type;
for (const t in e.original) t in e.object || (e.object[t] = void 0);
e.original = ParseObject.fromJSON(e.original, !1);
}
delete e.object.__type;
const n = ParseObject.fromJSON(e.object, (!r.query || !r.query._select) && t);
e.original ? r.emit(e.op, n, e.original, i) : r.emit(e.op, n, i);
const o = CoreManager.getLocalDatastore();
t && o.isEnabled && o._updateObjectIfPinned(n).then((() => {}));
}
}
}
_handleWebSocketClose() {
if (this.state !== CLIENT_STATE.DISCONNECTED) {
this.state = CLIENT_STATE.CLOSED, this.emit(CLIENT_EMMITER_TYPES.CLOSE);
for (const t of this.subscriptions.values()) t.emit(SUBSCRIPTION_EMMITER_TYPES.CLOSE);
this._handleReconnect();
}
}
_handleWebSocketError(t) {
this.emit(CLIENT_EMMITER_TYPES.ERROR, t);
for (const e of this.subscriptions.values()) e.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR, t);
this._handleReconnect();
}
_handleReconnect() {
if (this.state === CLIENT_STATE.DISCONNECTED) return;
this.state = CLIENT_STATE.RECONNECTING;
const t = generateInterval(this.attempts);
this.reconnectHandle && clearTimeout(this.reconnectHandle), this.reconnectHandle = setTimeout((() => {
this.attempts++, this.connectPromise = resolvingPromise(), this.open();
}).bind(this), t);
}
};
function getLiveQueryClient() {
return CoreManager.getLiveQueryController().getDefaultLiveQueryClient();
}
var LiveQuery = class {
constructor() {
const t = CoreManager.getEventEmitter();
this.emitter = new t(), this.on = (t, e) => this.emitter.on(t, e), this.emit = (t, ...e) => this.emitter.emit(t, ...e), this.on("error", (() => {}));
}
async open() {
(await getLiveQueryClient()).open();
}
async close() {
(await getLiveQueryClient()).close();
}
}, defaultLiveQueryClient;
CoreManager.setLiveQueryController({
setDefaultLiveQueryClient(t) {
defaultLiveQueryClient = t;
},
async getDefaultLiveQueryClient() {
if (defaultLiveQueryClient) return defaultLiveQueryClient;
const [t, e] = await Promise.all([CoreManager.getUserController().currentUserAsync(), CoreManager.getInstallationController().currentInstallationId()]), r = t ? t.getSessionToken() : void 0;
let i = CoreManager.get("LIVEQUERY_SERVER_URL");
if (i && 0 !== i.indexOf("ws")) throw new Error("You need to set a proper Parse LiveQuery server url before using LiveQueryClient");
if (!i) {
const t = CoreManager.get("SERVER_URL");
i = (0 === t.indexOf("https") ? "wss://" : "ws://") + t.replace(/^https?:\/\//, ""), CoreManager.set("LIVEQUERY_SERVER_URL", i);
}
const n = CoreManager.get("APPLICATION_ID"), o = CoreManager.get("JAVASCRIPT_KEY"), s = CoreManager.get("MASTER_KEY");
defaultLiveQueryClient = new LiveQueryClient({
applicationId: n,
serverURL: i,
javascriptKey: o,
masterKey: s,
sessionToken: r,
installationId: e
});
const a = CoreManager.getLiveQuery();
return defaultLiveQueryClient.on("error", ((t) => {
a.emit("error", t);
})), defaultLiveQueryClient.on("open", (() => {
a.emit("open");
})), defaultLiveQueryClient.on("close", (() => {
a.emit("close");
})), defaultLiveQueryClient;
},
_clearCachedDefaultClient() {
defaultLiveQueryClient = null;
}
});
var StorageController$2 = {
async: 0,
getItem: (t) => wx.getStorageSync(t),
setItem(t, e) {
try {
wx.setStorageSync(t, e);
} catch (t) {}
},
removeItem(t) {
wx.removeStorageSync(t);
},
getAllKeys: () => wx.getStorageInfoSync().keys,
clear() {
wx.clearStorageSync();
}
}, memMap = {}, StorageController$1 = {
async: 0,
getItem: (t) => Object.hasOwn(memMap, t) ? memMap[t] : null,
setItem(t, e) {
memMap[t] = String(e);
},
removeItem(t) {
delete memMap[t];
},
getAllKeys: () => Object.keys(memMap),
clear() {
for (const t in memMap) Object.hasOwn(memMap, t) && delete memMap[t];
}
}, StorageController = StorageController$1;
StorageController = StorageController$2;
var StorageController_default = StorageController, require_browser = __commonJSMin(((t, e) => {
e.exports = function() {
throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object");
};
})), import_browser = __toESM(require_browser()), Socket_weapp_exports = __exportAll({ default: () => SocketWeapp }), SocketWeapp = class {
constructor(t) {
this.onopen = () => {}, this.onmessage = () => {}, this.onclose = () => {}, this.onerror = () => {}, wx.onSocketOpen((() => {
this.onopen();
})), wx.onSocketMessage(((t) => {
this.onmessage(t);
})), wx.onSocketClose(((t) => {
this.onclose(t);
})), wx.onSocketError(((t) => {
this.onerror(t);
})), wx.connectSocket({ url: t });
}
send(t) {
wx.sendSocketMessage({ data: t });
}
close() {
wx.closeSocket();
}
}, WebSocketController;
try {
WebSocketController = SocketWeapp || Socket_weapp_exports;
} catch (t) {}
var WebSocketController_default = WebSocketController, Parse = {
ACL: ParseACL,
Analytics: Analytics_exports,
AnonymousUtils,
Cloud: Cloud_exports,
CLP: ParseCLP,
CoreManager,
Config: ParseConfig,
Error: ParseError,
FacebookUtils,
File: ParseFile,
GeoPoint: ParseGeoPoint,
Polygon: ParsePolygon,
Installation: ParseInstallation,
LocalDatastore,
Object: ParseObject,
Op: {
Set: SetOp,
Unset: UnsetOp,
Increment: IncrementOp,
Add: AddOp,
Remove: RemoveOp,
AddUnique: AddUniqueOp,
Relation: RelationOp
},
Push: Push_exports,
Query: ParseQuery,
Relation: ParseRelation,
Role: ParseRole,
Schema: ParseSchema,
Session: ParseSession,
Storage,
User: ParseUser,
LiveQueryClient,
IndexedDB: void 0,
Hooks: void 0,
Parse: void 0,
set EventuallyQueue(t) {
CoreManager.setEventuallyQueue(t);
},
get EventuallyQueue() {
return CoreManager.getEventuallyQueue();
},
initialize(t, e) {
Parse._initialize(t, e);
},
_initialize(t, e, r, i) {
CoreManager.set("APPLICATION_ID", t), CoreManager.set("JAVASCRIPT_KEY", e), CoreManager.set("MAINTENANCE_KEY", i), CoreManager.set("MASTER_KEY", r), CoreManager.set("USE_MASTER_KEY", !1), CoreManager.setIfNeeded("EventEmitter", EventEmitter_default), CoreManager.setIfNeeded("LiveQuery", new LiveQuery()), CoreManager.setIfNeeded("CryptoController", CryptoController), CoreManager.setIfNeeded("EventuallyQueue", EventuallyQueue), CoreManager.setIfNeeded("InstallationController", InstallationController), CoreManager.setIfNeeded("LocalDatastoreController", LocalDatastoreController), CoreManager.setIfNeeded("StorageController", StorageController_default), CoreManager.setIfNeeded("WebSocketController", WebSocketController_default);
},
setAsyncStorage(t) {
CoreManager.setAsyncStorage(t);
},
setLocalDatastoreController(t) {
CoreManager.setLocalDatastoreController(t);
},
getServerHealth: () => CoreManager.getRESTController().request("GET", "health"),
set applicationId(t) {
CoreManager.set("APPLICATION_ID", t);
},
get applicationId() {
return CoreManager.get("APPLICATION_ID");
},
set javaScriptKey(t) {
CoreManager.set("JAVASCRIPT_KEY", t);
},
get javaScriptKey() {
return CoreManager.get("JAVASCRIPT_KEY");
},
set masterKey(t) {
CoreManager.set("MASTER_KEY", t);
},
get masterKey() {
return CoreManager.get("MASTER_KEY");
},
set maintenanceKey(t) {
CoreManager.set("MAINTENANCE_KEY", t);
},
get maintenanceKey() {
return CoreManager.get("MAINTENANCE_KEY");
},
set serverURL(t) {
CoreManager.set("SERVER_URL", t);
},
get serverURL() {
return CoreManager.get("SERVER_URL");
},
set LiveQuery(t) {
CoreManager.setLiveQuery(t);
},
get LiveQuery() {
return CoreManager.getLiveQuery();
},
set liveQueryServerURL(t) {
CoreManager.set("LIVEQUERY_SERVER_URL", t);
},
get liveQueryServerURL() {
return CoreManager.get("LIVEQUERY_SERVER_URL");
},
set encryptedUser(t) {
CoreManager.set("ENCRYPTED_USER", t);
},
get encryptedUser() {
return CoreManager.get("ENCRYPTED_USER");
},
set secret(t) {
CoreManager.set("ENCRYPTED_KEY", t);
},
get secret() {
return CoreManager.get("ENCRYPTED_KEY");
},
set idempotency(t) {
CoreManager.set("IDEMPOTENCY", t);
},
get idempotency() {
return CoreManager.get("IDEMPOTENCY");
},
set allowCustomObjectId(t) {
CoreManager.set("ALLOW_CUSTOM_OBJECT_ID", t);
},
get allowCustomObjectId() {
return CoreManager.get("ALLOW_CUSTOM_OBJECT_ID");
},
set nodeLogging(t) {
CoreManager.set("NODE_LOGGING", t);
},
get nodeLogging() {
return CoreManager.get("NODE_LOGGING");
},
_request: (...t) => CoreManager.getRESTController().request.apply(null, t),
_ajax: (...t) => CoreManager.getRESTController().ajax.apply(null, t),
_decode: (t, e) => decode(e),
_encode: (t, e, r) => encode_default(t, r),
_getInstallationId: () => CoreManager.getInstallationController().currentInstallationId(),
enableLocalDatastore(t, e) {
this.applicationId ? this.LocalDatastore.isEnabled || (this.LocalDatastore.isEnabled = !0, (t || void 0 === t) && CoreManager.getEventuallyQueue().poll(e || 2e3)) : console.log("'enableLocalDatastore' must be called after 'initialize'");
},
isLocalDatastoreEnabled() {
return this.LocalDatastore.isEnabled;
},
dumpLocalDatastore() {
return this.LocalDatastore.isEnabled ? Parse.LocalDatastore._getAllContents() : (console.log("Parse.enableLocalDatastore() must be called first"), Promise.resolve({}));
},
enableEncryptedUser() {
this.encryptedUser = !0;
},
isEncryptedUserEnabled() {
return this.encryptedUser;
}
};
CoreManager.setRESTController(RESTController), Parse.Parse = Parse;
}));