//#region rolldown:runtime
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function() {
	return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
	if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
		key = keys[i];
		if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
			get: ((k) => from[k]).bind(null, key),
			enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
		});
	}
	return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
	value: mod,
	enumerable: true
}) : target, mod));

//#endregion

//#region ../../node_modules/httpreq/lib/httpreq.js
var require_httpreq = /* @__PURE__ */ __commonJS({ "../../node_modules/httpreq/lib/httpreq.js": ((exports) => {
	var querystring = require("querystring");
	var https$1 = require("https");
	var http$1 = require("http");
	var url$1 = require("url");
	var fs = require("fs");
	var defaultCiphers = require("tls").DEFAULT_CIPHERS.split(":");
	/**
	* Generate multipart boundary
	*
	* @returns {string}
	*/
	function generateBoundary() {
		var boundary = "---------------------------";
		var charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
		for (var i = 0; i < 29; i++) boundary += charset.charAt(Math.floor(Math.random() * charset.length));
		return boundary;
	}
	/**
	* Extract cookies from headers
	*
	* @param headers {object} - Response headers
	* @returns {array} - Extracted cookie strings
	*/
	function extractCookies(headers) {
		var rawcookies = headers["set-cookie"];
		if (!rawcookies) return [];
		if (rawcookies == []) return [];
		var cookies = [];
		for (var i = 0; i < rawcookies.length; i++) {
			var rawcookie = rawcookies[i].split(";");
			if (rawcookie[0]) cookies.push(rawcookie[0]);
		}
		return cookies;
	}
	/**
	* Custom HTTP request
	*
	* @callback callback
	* @param o {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	function doRequest(o, callback) {
		if (callback === void 0) return new Promise((resolve, reject) => {
			doRequest(o, (err$1, res) => {
				err$1 ? reject(err$1) : resolve(res);
			});
		});
		var finalCallbackDone = false;
		function finalCallback(err$1, res) {
			if (!finalCallbackDone) {
				finalCallbackDone = true;
				callback(err$1, res);
			}
		}
		if (o.maxRedirects === void 0) o.maxRedirects = 10;
		if (o.encodePostParameters === void 0) o.encodePostParameters = true;
		var chunks = [];
		var body;
		var contentType;
		var port;
		var host;
		var path;
		var isHttps = false;
		if (o.proxy) {
			port = o.proxy.port;
			host = o.proxy.host;
			path = o.url;
			if (o.proxy.protocol && o.proxy.protocol.match(/https/)) isHttps = true;
		} else {
			var reqUrl = url$1.parse(o.url);
			host = reqUrl.hostname;
			path = reqUrl.path;
			if (reqUrl.protocol === "https:") isHttps = true;
			if (reqUrl.port) port = reqUrl.port;
			else if (isHttps) port = 443;
			else port = 80;
		}
		if (o.files && o.files.length > 0 && o.method === "GET") {
			var err = /* @__PURE__ */ new Error("Can't send files using GET");
			err.code = "CANT_SEND_FILES_USING_GET";
			return finalCallback(err);
		}
		if (o.parameters) if (o.method === "GET") path += "?" + querystring.stringify(o.parameters);
		else {
			body = Buffer.from(querystring.stringify(o.parameters), "utf8");
			contentType = "application/x-www-form-urlencoded; charset=UTF-8";
		}
		if (o.json) {
			body = Buffer.from(JSON.stringify(o.json), "utf8");
			contentType = "application/json";
		}
		if (o.files) {
			var crlf = "\r\n";
			var boundary = generateBoundary();
			var separator = "--" + boundary;
			var bodyArray = new Array();
			for (var key in o.parameters) {
				var headerKey = o.encodePostParameters ? encodeURIComponent(key) : key;
				var encodedParameter = separator + crlf + "Content-Disposition: form-data; name=\"" + headerKey + "\"" + crlf + crlf + o.parameters[key] + crlf;
				bodyArray.push(Buffer.from(encodedParameter));
			}
			var haveAlreadyAddedAFile = false;
			for (var name in o.files) {
				var files = o.files[name];
				if (!Array.isArray(files)) files = [files];
				for (var file of files) {
					var filename = file.replace(/\\/g, "/").replace(/.*\//, "");
					var encodedFile = separator + crlf + "Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + filename + "\"" + crlf + "Content-Type: application/octet-stream" + crlf + crlf;
					if (haveAlreadyAddedAFile) encodedFile = crlf + encodedFile;
					bodyArray.push(Buffer.from(encodedFile));
					bodyArray.push(require("fs").readFileSync(file));
					haveAlreadyAddedAFile = true;
				}
			}
			var footer = crlf + separator + "--" + crlf;
			bodyArray.push(Buffer.from(footer));
			body = Buffer.concat(bodyArray);
			contentType = "multipart/form-data; boundary=" + boundary;
		}
		if (o.body) {
			body = Buffer.from(o.body, "utf8");
			contentType = null;
		}
		var requestoptions = {
			host,
			port,
			path,
			method: o.method,
			headers: {}
		};
		if (!o.redirectCount) o.redirectCount = 0;
		if (body) requestoptions.headers["Content-Length"] = body.length;
		if (contentType) requestoptions.headers["Content-Type"] = contentType;
		if (o.cookies) requestoptions.headers.Cookie = o.cookies.join("; ");
		if (o.rejectUnauthorized !== void 0 && isHttps) requestoptions.rejectUnauthorized = o.rejectUnauthorized;
		if (isHttps && o.key) requestoptions.key = o.key;
		if (isHttps && o.cert) requestoptions.cert = o.cert;
		if (isHttps && o.secureProtocol) requestoptions.secureProtocol = o.secureProtocol;
		if (isHttps && o.ciphers) requestoptions.ciphers = o.ciphers;
		if (isHttps && o.shuffleCiphers) {
			var shuffledChiphers = defaultCiphers.slice(0);
			for (let i = shuffledChiphers.length - 1; i > 0; i--) {
				const j = Math.floor(Math.random() * (i + 1));
				[shuffledChiphers[i], shuffledChiphers[j]] = [shuffledChiphers[j], shuffledChiphers[i]];
			}
			requestoptions.ciphers = shuffledChiphers.join(":");
		}
		if (isHttps && o.passphrase) requestoptions.passphrase = o.passphrase;
		if (isHttps && o.pfx) requestoptions.pfx = o.pfx;
		if (isHttps && o.ca) requestoptions.ca = o.ca;
		if (o.headers) for (var headerkey in o.headers) requestoptions.headers[headerkey] = o.headers[headerkey];
		if (o.agent) requestoptions.agent = o.agent;
		if (o.auth) requestoptions.auth = o.auth;
		if (o.localAddress) requestoptions.localAddress = o.localAddress;
		if (o.secureOptions) requestoptions.secureOptions = o.secureOptions;
		/**
		* Process request response
		*
		* @param res {object} - Response details
		* @returns {void}
		*/
		function requestResponse(res) {
			var ended = false;
			var currentsize = 0;
			var downloadstream = null;
			if (o.downloadlocation) downloadstream = fs.createWriteStream(o.downloadlocation);
			res.on("data", function(chunk) {
				if (o.downloadlocation) downloadstream.write(chunk);
				else chunks.push(chunk);
				if (o.progressCallback) {
					var totalsize = res.headers["content-length"];
					if (totalsize) {
						currentsize += chunk.length;
						o.progressCallback(null, {
							url: o.url,
							totalsize,
							currentsize,
							percentage: currentsize * 100 / totalsize
						});
					} else o.progressCallback(/* @__PURE__ */ new Error("no content-length specified for file, so no progress monitoring possible"));
				}
			});
			res.on("end", function(err$1) {
				ended = true;
				if (res.headers.location && o.allowRedirects) {
					if (o.downloadlocation) downloadstream.end();
					if (o.redirectCount < o.maxRedirects) {
						o.redirectCount++;
						o.url = new URL(res.headers.location, o.url).href;
						o.cookies = extractCookies(res.headers);
						return doRequest(o, finalCallback);
					} else {
						var err$1 = /* @__PURE__ */ new Error("Too many redirects (> " + o.maxRedirects + ")");
						err$1.code = "TOOMANYREDIRECTS";
						err$1.redirects = o.maxRedirects;
						return finalCallback(err$1);
					}
				}
				if (!o.downloadlocation) {
					var responsebody = Buffer.concat(chunks);
					if (!o.binary) responsebody = responsebody.toString("utf8");
					finalCallback(null, {
						headers: res.headers,
						statusCode: res.statusCode,
						body: responsebody,
						cookies: extractCookies(res.headers)
					});
				} else downloadstream.end(null, null, function() {
					finalCallback(null, {
						headers: res.headers,
						statusCode: res.statusCode,
						downloadlocation: o.downloadlocation,
						cookies: extractCookies(res.headers)
					});
				});
			});
			res.on("close", function() {
				if (!ended) finalCallback(/* @__PURE__ */ new Error("Request aborted"));
			});
		}
		var request;
		for (var headerName in requestoptions.headers) {
			var headerValue = requestoptions.headers[headerName];
			if (!headerName || !headerValue) delete requestoptions.headers[headerName];
		}
		if (isHttps) request = https$1.request(requestoptions, requestResponse);
		else request = http$1.request(requestoptions, requestResponse);
		if (o.timeout) request.setTimeout(parseInt(o.timeout, 10), function() {
			var err$1 = /* @__PURE__ */ new Error("request timed out");
			err$1.code = "TIMEOUT";
			finalCallback(err$1);
			request.abort();
		});
		request.on("error", function(err$1) {
			finalCallback(err$1);
		});
		if (body) request.write(body);
		request.end();
	}
	exports.doRequest = doRequest;
	/**
	* HTTP GET method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.get = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "GET";
		if (moreOptions.allowRedirects === void 0) moreOptions.allowRedirects = true;
		return doRequest(moreOptions, callback);
	};
	/**
	* HTTP OPTIONS method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.options = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "OPTIONS";
		return doRequest(moreOptions, callback);
	};
	/**
	* HTTP POST method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.post = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "POST";
		return doRequest(moreOptions, callback);
	};
	/**
	* HTTP PUT method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.put = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "PUT";
		return doRequest(moreOptions, callback);
	};
	/**
	* HTTP PATCH method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.patch = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "PATCH";
		return doRequest(moreOptions, callback);
	};
	/**
	* HTTP DELETE method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.delete = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "DELETE";
		return doRequest(moreOptions, callback);
	};
	/**
	* HTTP HEAD method
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param [options] {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.head = function(url$2, options, callback) {
		if (callback === void 0 && options && typeof options === "function") callback = options;
		if (options === void 0) options = {};
		var moreOptions = options;
		moreOptions.url = url$2;
		moreOptions.method = "HEAD";
		if (moreOptions.allowRedirects === void 0) moreOptions.allowRedirects = true;
		return doRequest(moreOptions, callback);
	};
	/**
	* Download a file
	*
	* @callback callback
	* @param url {string} - Request URL
	* @param downloadlocation {string} - Path where to store file
	* @param [progressCallback] {function} - Called multiple times during download
	* @param callback {function} - Called once when download ends
	* @returns {void}
	*/
	exports.download = function(url$2, downloadlocation, progressCallback, callback) {
		var options = {};
		options.url = url$2;
		options.method = "GET";
		options.downloadlocation = downloadlocation;
		options.allowRedirects = true;
		if (callback === void 0 && progressCallback && typeof progressCallback === "function") callback = progressCallback;
		else options.progressCallback = progressCallback;
		return doRequest(options, callback);
	};
	/**
	* Upload files
	* old function, can still be used
	*
	* @callback callback
	* @param options {object} - Request options
	* @param callback [function] - Process response
	* @returns {void}
	*/
	exports.uploadFiles = function(options, callback) {
		var moreOptions = options;
		moreOptions.method = "POST";
		return doRequest(moreOptions, callback);
	};
}) });

//#endregion
//#region ../../node_modules/js-md4/src/md4.js
var require_md4 = /* @__PURE__ */ __commonJS({ "../../node_modules/js-md4/src/md4.js": ((exports, module) => {
	/**
	* [js-md4]{@link https://github.com/emn178/js-md4}
	*
	* @namespace md4
	* @version 0.3.2
	* @author Yi-Cyuan Chen [emn178@gmail.com]
	* @copyright Yi-Cyuan Chen 2015-2027
	* @license MIT
	*/
	(function() {
		var root = typeof window === "object" ? window : {};
		var NODE_JS = !root.JS_MD4_NO_NODE_JS && typeof process === "object" && process.versions && process.versions.node;
		if (NODE_JS) root = global;
		var COMMON_JS = !root.JS_MD4_NO_COMMON_JS && typeof module === "object" && module.exports;
		var AMD = typeof define === "function" && define.amd;
		var ARRAY_BUFFER = !root.JS_MD4_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined";
		var HEX_CHARS = "0123456789abcdef".split("");
		var EXTRA = [
			128,
			32768,
			8388608,
			-2147483648
		];
		var SHIFT = [
			0,
			8,
			16,
			24
		];
		var OUTPUT_TYPES = [
			"hex",
			"array",
			"digest",
			"buffer",
			"arrayBuffer"
		];
		var blocks = [], buffer8;
		if (ARRAY_BUFFER) {
			var buffer = /* @__PURE__ */ new ArrayBuffer(68);
			buffer8 = new Uint8Array(buffer);
			blocks = new Uint32Array(buffer);
		}
		/**
		* @method hex
		* @memberof md4
		* @description Output hash as hex string
		* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
		* @returns {String} Hex string
		* @example
		* md4.hex('The quick brown fox jumps over the lazy dog');
		* // equal to
		* md4('The quick brown fox jumps over the lazy dog');
		*/
		/**
		* @method digest
		* @memberof md4
		* @description Output hash as bytes array
		* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
		* @returns {Array} Bytes array
		* @example
		* md4.digest('The quick brown fox jumps over the lazy dog');
		*/
		/**
		* @method array
		* @memberof md4
		* @description Output hash as bytes array
		* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
		* @returns {Array} Bytes array
		* @example
		* md4.array('The quick brown fox jumps over the lazy dog');
		*/
		/**
		* @method buffer
		* @memberof md4
		* @description Output hash as ArrayBuffer
		* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
		* @returns {ArrayBuffer} ArrayBuffer
		* @example
		* md4.buffer('The quick brown fox jumps over the lazy dog');
		*/
		var createOutputMethod = function(outputType) {
			return function(message) {
				return new Md4(true).update(message)[outputType]();
			};
		};
		/**
		* @method create
		* @memberof md4
		* @description Create Md4 object
		* @returns {Md4} MD4 object.
		* @example
		* var hash = md4.create();
		*/
		/**
		* @method update
		* @memberof md4
		* @description Create and update Md4 object
		* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
		* @returns {Md4} MD4 object.
		* @example
		* var hash = md4.update('The quick brown fox jumps over the lazy dog');
		* // equal to
		* var hash = md4.create();
		* hash.update('The quick brown fox jumps over the lazy dog');
		*/
		var createMethod = function() {
			var method = createOutputMethod("hex");
			if (NODE_JS) method = nodeWrap(method);
			method.create = function() {
				return new Md4();
			};
			method.update = function(message) {
				return method.create().update(message);
			};
			for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
				var type = OUTPUT_TYPES[i];
				method[type] = createOutputMethod(type);
			}
			return method;
		};
		var nodeWrap = function(method) {
			var crypto$1 = require("crypto");
			var Buffer$1 = require("buffer").Buffer;
			var nodeMethod = function(message) {
				if (typeof message === "string") return crypto$1.createHash("md4").update(message, "utf8").digest("hex");
				else if (ARRAY_BUFFER && message instanceof ArrayBuffer) message = new Uint8Array(message);
				else if (message.length === void 0) return method(message);
				return crypto$1.createHash("md4").update(new Buffer$1(message)).digest("hex");
			};
			return nodeMethod;
		};
		/**
		* Md4 class
		* @class Md4
		* @description This is internal class.
		* @see {@link md4.create}
		*/
		function Md4(sharedMemory) {
			if (sharedMemory) {
				blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
				this.blocks = blocks;
				this.buffer8 = buffer8;
			} else if (ARRAY_BUFFER) {
				var buffer$1 = /* @__PURE__ */ new ArrayBuffer(68);
				this.buffer8 = new Uint8Array(buffer$1);
				this.blocks = new Uint32Array(buffer$1);
			} else this.blocks = [
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0
			];
			this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = 0;
			this.finalized = this.hashed = false;
			this.first = true;
		}
		/**
		* @method update
		* @memberof Md4
		* @instance
		* @description Update hash
		* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
		* @returns {Md4} MD4 object.
		* @see {@link md4.update}
		*/
		Md4.prototype.update = function(message) {
			if (this.finalized) return;
			var notString = typeof message !== "string";
			if (notString && ARRAY_BUFFER && message instanceof ArrayBuffer) message = new Uint8Array(message);
			var code, index = 0, i, length = message.length || 0, blocks$1 = this.blocks;
			var buffer8$1 = this.buffer8;
			while (index < length) {
				if (this.hashed) {
					this.hashed = false;
					blocks$1[0] = blocks$1[16];
					blocks$1[16] = blocks$1[1] = blocks$1[2] = blocks$1[3] = blocks$1[4] = blocks$1[5] = blocks$1[6] = blocks$1[7] = blocks$1[8] = blocks$1[9] = blocks$1[10] = blocks$1[11] = blocks$1[12] = blocks$1[13] = blocks$1[14] = blocks$1[15] = 0;
				}
				if (notString) if (ARRAY_BUFFER) for (i = this.start; index < length && i < 64; ++index) buffer8$1[i++] = message[index];
				else for (i = this.start; index < length && i < 64; ++index) blocks$1[i >> 2] |= message[index] << SHIFT[i++ & 3];
				else if (ARRAY_BUFFER) for (i = this.start; index < length && i < 64; ++index) {
					code = message.charCodeAt(index);
					if (code < 128) buffer8$1[i++] = code;
					else if (code < 2048) {
						buffer8$1[i++] = 192 | code >> 6;
						buffer8$1[i++] = 128 | code & 63;
					} else if (code < 55296 || code >= 57344) {
						buffer8$1[i++] = 224 | code >> 12;
						buffer8$1[i++] = 128 | code >> 6 & 63;
						buffer8$1[i++] = 128 | code & 63;
					} else {
						code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index) & 1023);
						buffer8$1[i++] = 240 | code >> 18;
						buffer8$1[i++] = 128 | code >> 12 & 63;
						buffer8$1[i++] = 128 | code >> 6 & 63;
						buffer8$1[i++] = 128 | code & 63;
					}
				}
				else for (i = this.start; index < length && i < 64; ++index) {
					code = message.charCodeAt(index);
					if (code < 128) blocks$1[i >> 2] |= code << SHIFT[i++ & 3];
					else if (code < 2048) {
						blocks$1[i >> 2] |= (192 | code >> 6) << SHIFT[i++ & 3];
						blocks$1[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
					} else if (code < 55296 || code >= 57344) {
						blocks$1[i >> 2] |= (224 | code >> 12) << SHIFT[i++ & 3];
						blocks$1[i >> 2] |= (128 | code >> 6 & 63) << SHIFT[i++ & 3];
						blocks$1[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
					} else {
						code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index) & 1023);
						blocks$1[i >> 2] |= (240 | code >> 18) << SHIFT[i++ & 3];
						blocks$1[i >> 2] |= (128 | code >> 12 & 63) << SHIFT[i++ & 3];
						blocks$1[i >> 2] |= (128 | code >> 6 & 63) << SHIFT[i++ & 3];
						blocks$1[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
					}
				}
				this.lastByteIndex = i;
				this.bytes += i - this.start;
				if (i >= 64) {
					this.start = i - 64;
					this.hash();
					this.hashed = true;
				} else this.start = i;
			}
			return this;
		};
		Md4.prototype.finalize = function() {
			if (this.finalized) return;
			this.finalized = true;
			var blocks$1 = this.blocks, i = this.lastByteIndex;
			blocks$1[i >> 2] |= EXTRA[i & 3];
			if (i >= 56) {
				if (!this.hashed) this.hash();
				blocks$1[0] = blocks$1[16];
				blocks$1[16] = blocks$1[1] = blocks$1[2] = blocks$1[3] = blocks$1[4] = blocks$1[5] = blocks$1[6] = blocks$1[7] = blocks$1[8] = blocks$1[9] = blocks$1[10] = blocks$1[11] = blocks$1[12] = blocks$1[13] = blocks$1[14] = blocks$1[15] = 0;
			}
			blocks$1[14] = this.bytes << 3;
			this.hash();
		};
		Md4.prototype.hash = function() {
			var a, b, c, d, ab, bc, cd, da, blocks$1 = this.blocks;
			if (this.first) {
				a = blocks$1[0] - 1;
				a = a << 3 | a >>> 29;
				d = (a & 4023233417 | ~a & 2562383102) + blocks$1[1] + 271733878;
				d = d << 7 | d >>> 25;
				c = (d & a | ~d & 4023233417) + blocks$1[2] - 1732584194;
				c = c << 11 | c >>> 21;
				b = (c & d | ~c & a) + blocks$1[3] - 271733879;
				b = b << 19 | b >>> 13;
			} else {
				a = this.h0;
				b = this.h1;
				c = this.h2;
				d = this.h3;
				a += (b & c | ~b & d) + blocks$1[0];
				a = a << 3 | a >>> 29;
				d += (a & b | ~a & c) + blocks$1[1];
				d = d << 7 | d >>> 25;
				c += (d & a | ~d & b) + blocks$1[2];
				c = c << 11 | c >>> 21;
				b += (c & d | ~c & a) + blocks$1[3];
				b = b << 19 | b >>> 13;
			}
			a += (b & c | ~b & d) + blocks$1[4];
			a = a << 3 | a >>> 29;
			d += (a & b | ~a & c) + blocks$1[5];
			d = d << 7 | d >>> 25;
			c += (d & a | ~d & b) + blocks$1[6];
			c = c << 11 | c >>> 21;
			b += (c & d | ~c & a) + blocks$1[7];
			b = b << 19 | b >>> 13;
			a += (b & c | ~b & d) + blocks$1[8];
			a = a << 3 | a >>> 29;
			d += (a & b | ~a & c) + blocks$1[9];
			d = d << 7 | d >>> 25;
			c += (d & a | ~d & b) + blocks$1[10];
			c = c << 11 | c >>> 21;
			b += (c & d | ~c & a) + blocks$1[11];
			b = b << 19 | b >>> 13;
			a += (b & c | ~b & d) + blocks$1[12];
			a = a << 3 | a >>> 29;
			d += (a & b | ~a & c) + blocks$1[13];
			d = d << 7 | d >>> 25;
			c += (d & a | ~d & b) + blocks$1[14];
			c = c << 11 | c >>> 21;
			b += (c & d | ~c & a) + blocks$1[15];
			b = b << 19 | b >>> 13;
			bc = b & c;
			a += (bc | b & d | c & d) + blocks$1[0] + 1518500249;
			a = a << 3 | a >>> 29;
			ab = a & b;
			d += (ab | a & c | bc) + blocks$1[4] + 1518500249;
			d = d << 5 | d >>> 27;
			da = d & a;
			c += (da | d & b | ab) + blocks$1[8] + 1518500249;
			c = c << 9 | c >>> 23;
			cd = c & d;
			b += (cd | c & a | da) + blocks$1[12] + 1518500249;
			b = b << 13 | b >>> 19;
			bc = b & c;
			a += (bc | b & d | cd) + blocks$1[1] + 1518500249;
			a = a << 3 | a >>> 29;
			ab = a & b;
			d += (ab | a & c | bc) + blocks$1[5] + 1518500249;
			d = d << 5 | d >>> 27;
			da = d & a;
			c += (da | d & b | ab) + blocks$1[9] + 1518500249;
			c = c << 9 | c >>> 23;
			cd = c & d;
			b += (cd | c & a | da) + blocks$1[13] + 1518500249;
			b = b << 13 | b >>> 19;
			bc = b & c;
			a += (bc | b & d | cd) + blocks$1[2] + 1518500249;
			a = a << 3 | a >>> 29;
			ab = a & b;
			d += (ab | a & c | bc) + blocks$1[6] + 1518500249;
			d = d << 5 | d >>> 27;
			da = d & a;
			c += (da | d & b | ab) + blocks$1[10] + 1518500249;
			c = c << 9 | c >>> 23;
			cd = c & d;
			b += (cd | c & a | da) + blocks$1[14] + 1518500249;
			b = b << 13 | b >>> 19;
			bc = b & c;
			a += (bc | b & d | cd) + blocks$1[3] + 1518500249;
			a = a << 3 | a >>> 29;
			ab = a & b;
			d += (ab | a & c | bc) + blocks$1[7] + 1518500249;
			d = d << 5 | d >>> 27;
			da = d & a;
			c += (da | d & b | ab) + blocks$1[11] + 1518500249;
			c = c << 9 | c >>> 23;
			b += (c & d | c & a | da) + blocks$1[15] + 1518500249;
			b = b << 13 | b >>> 19;
			bc = b ^ c;
			a += (bc ^ d) + blocks$1[0] + 1859775393;
			a = a << 3 | a >>> 29;
			d += (bc ^ a) + blocks$1[8] + 1859775393;
			d = d << 9 | d >>> 23;
			da = d ^ a;
			c += (da ^ b) + blocks$1[4] + 1859775393;
			c = c << 11 | c >>> 21;
			b += (da ^ c) + blocks$1[12] + 1859775393;
			b = b << 15 | b >>> 17;
			bc = b ^ c;
			a += (bc ^ d) + blocks$1[2] + 1859775393;
			a = a << 3 | a >>> 29;
			d += (bc ^ a) + blocks$1[10] + 1859775393;
			d = d << 9 | d >>> 23;
			da = d ^ a;
			c += (da ^ b) + blocks$1[6] + 1859775393;
			c = c << 11 | c >>> 21;
			b += (da ^ c) + blocks$1[14] + 1859775393;
			b = b << 15 | b >>> 17;
			bc = b ^ c;
			a += (bc ^ d) + blocks$1[1] + 1859775393;
			a = a << 3 | a >>> 29;
			d += (bc ^ a) + blocks$1[9] + 1859775393;
			d = d << 9 | d >>> 23;
			da = d ^ a;
			c += (da ^ b) + blocks$1[5] + 1859775393;
			c = c << 11 | c >>> 21;
			b += (da ^ c) + blocks$1[13] + 1859775393;
			b = b << 15 | b >>> 17;
			bc = b ^ c;
			a += (bc ^ d) + blocks$1[3] + 1859775393;
			a = a << 3 | a >>> 29;
			d += (bc ^ a) + blocks$1[11] + 1859775393;
			d = d << 9 | d >>> 23;
			da = d ^ a;
			c += (da ^ b) + blocks$1[7] + 1859775393;
			c = c << 11 | c >>> 21;
			b += (da ^ c) + blocks$1[15] + 1859775393;
			b = b << 15 | b >>> 17;
			if (this.first) {
				this.h0 = a + 1732584193 << 0;
				this.h1 = b - 271733879 << 0;
				this.h2 = c - 1732584194 << 0;
				this.h3 = d + 271733878 << 0;
				this.first = false;
			} else {
				this.h0 = this.h0 + a << 0;
				this.h1 = this.h1 + b << 0;
				this.h2 = this.h2 + c << 0;
				this.h3 = this.h3 + d << 0;
			}
		};
		/**
		* @method hex
		* @memberof Md4
		* @instance
		* @description Output hash as hex string
		* @returns {String} Hex string
		* @see {@link md4.hex}
		* @example
		* hash.hex();
		*/
		Md4.prototype.hex = function() {
			this.finalize();
			var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
			return HEX_CHARS[h0 >> 4 & 15] + HEX_CHARS[h0 & 15] + HEX_CHARS[h0 >> 12 & 15] + HEX_CHARS[h0 >> 8 & 15] + HEX_CHARS[h0 >> 20 & 15] + HEX_CHARS[h0 >> 16 & 15] + HEX_CHARS[h0 >> 28 & 15] + HEX_CHARS[h0 >> 24 & 15] + HEX_CHARS[h1 >> 4 & 15] + HEX_CHARS[h1 & 15] + HEX_CHARS[h1 >> 12 & 15] + HEX_CHARS[h1 >> 8 & 15] + HEX_CHARS[h1 >> 20 & 15] + HEX_CHARS[h1 >> 16 & 15] + HEX_CHARS[h1 >> 28 & 15] + HEX_CHARS[h1 >> 24 & 15] + HEX_CHARS[h2 >> 4 & 15] + HEX_CHARS[h2 & 15] + HEX_CHARS[h2 >> 12 & 15] + HEX_CHARS[h2 >> 8 & 15] + HEX_CHARS[h2 >> 20 & 15] + HEX_CHARS[h2 >> 16 & 15] + HEX_CHARS[h2 >> 28 & 15] + HEX_CHARS[h2 >> 24 & 15] + HEX_CHARS[h3 >> 4 & 15] + HEX_CHARS[h3 & 15] + HEX_CHARS[h3 >> 12 & 15] + HEX_CHARS[h3 >> 8 & 15] + HEX_CHARS[h3 >> 20 & 15] + HEX_CHARS[h3 >> 16 & 15] + HEX_CHARS[h3 >> 28 & 15] + HEX_CHARS[h3 >> 24 & 15];
		};
		/**
		* @method toString
		* @memberof Md4
		* @instance
		* @description Output hash as hex string
		* @returns {String} Hex string
		* @see {@link md4.hex}
		* @example
		* hash.toString();
		*/
		Md4.prototype.toString = Md4.prototype.hex;
		/**
		* @method digest
		* @memberof Md4
		* @instance
		* @description Output hash as bytes array
		* @returns {Array} Bytes array
		* @see {@link md4.digest}
		* @example
		* hash.digest();
		*/
		Md4.prototype.digest = function() {
			this.finalize();
			var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
			return [
				h0 & 255,
				h0 >> 8 & 255,
				h0 >> 16 & 255,
				h0 >> 24 & 255,
				h1 & 255,
				h1 >> 8 & 255,
				h1 >> 16 & 255,
				h1 >> 24 & 255,
				h2 & 255,
				h2 >> 8 & 255,
				h2 >> 16 & 255,
				h2 >> 24 & 255,
				h3 & 255,
				h3 >> 8 & 255,
				h3 >> 16 & 255,
				h3 >> 24 & 255
			];
		};
		/**
		* @method array
		* @memberof Md4
		* @instance
		* @description Output hash as bytes array
		* @returns {Array} Bytes array
		* @see {@link md4.array}
		* @example
		* hash.array();
		*/
		Md4.prototype.array = Md4.prototype.digest;
		/**
		* @method arrayBuffer
		* @memberof Md4
		* @instance
		* @description Output hash as ArrayBuffer
		* @returns {ArrayBuffer} ArrayBuffer
		* @see {@link md4.arrayBuffer}
		* @example
		* hash.arrayBuffer();
		*/
		Md4.prototype.arrayBuffer = function() {
			this.finalize();
			var buffer$1 = /* @__PURE__ */ new ArrayBuffer(16);
			var blocks$1 = new Uint32Array(buffer$1);
			blocks$1[0] = this.h0;
			blocks$1[1] = this.h1;
			blocks$1[2] = this.h2;
			blocks$1[3] = this.h3;
			return buffer$1;
		};
		/**
		* @method buffer
		* @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
		* @memberof Md4
		* @instance
		* @description Output hash as ArrayBuffer
		* @returns {ArrayBuffer} ArrayBuffer
		* @see {@link md4.buffer}
		* @example
		* hash.buffer();
		*/
		Md4.prototype.buffer = Md4.prototype.arrayBuffer;
		var exports$1 = createMethod();
		if (COMMON_JS) module.exports = exports$1;
		else {
			/**
			* @method md4
			* @description MD4 hash function, export to global in browsers.
			* @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
			* @returns {String} md4 hashes
			* @example
			* md4(''); // 31d6cfe0d16ae931b73c59d7e0c089c0
			* md4('The quick brown fox jumps over the lazy dog'); // 1bee69a46ba811185c194762abaeae90
			* md4('The quick brown fox jumps over the lazy dog.'); // 2812c6c7136898c51f6f6739ad08750e
			*
			* // It also supports UTF-8 encoding
			* md4('中文'); // 223088bf7bd45a16436b15360c5fc5a0
			*
			* // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
			* md4([]); // 31d6cfe0d16ae931b73c59d7e0c089c0
			* md4(new Uint8Array([])); // 31d6cfe0d16ae931b73c59d7e0c089c0
			*/
			root.md4 = exports$1;
			if (AMD) define(function() {
				return exports$1;
			});
		}
	})();
}) });

//#endregion
//#region ../../node_modules/des.js/lib/des/utils.js
var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/des.js/lib/des/utils.js": ((exports) => {
	exports.readUInt32BE = function readUInt32BE(bytes, off) {
		return (bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off]) >>> 0;
	};
	exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
		bytes[0 + off] = value >>> 24;
		bytes[1 + off] = value >>> 16 & 255;
		bytes[2 + off] = value >>> 8 & 255;
		bytes[3 + off] = value & 255;
	};
	exports.ip = function ip(inL, inR, out, off) {
		var outL = 0;
		var outR = 0;
		for (var i = 6; i >= 0; i -= 2) {
			for (var j = 0; j <= 24; j += 8) {
				outL <<= 1;
				outL |= inR >>> j + i & 1;
			}
			for (var j = 0; j <= 24; j += 8) {
				outL <<= 1;
				outL |= inL >>> j + i & 1;
			}
		}
		for (var i = 6; i >= 0; i -= 2) {
			for (var j = 1; j <= 25; j += 8) {
				outR <<= 1;
				outR |= inR >>> j + i & 1;
			}
			for (var j = 1; j <= 25; j += 8) {
				outR <<= 1;
				outR |= inL >>> j + i & 1;
			}
		}
		out[off + 0] = outL >>> 0;
		out[off + 1] = outR >>> 0;
	};
	exports.rip = function rip(inL, inR, out, off) {
		var outL = 0;
		var outR = 0;
		for (var i = 0; i < 4; i++) for (var j = 24; j >= 0; j -= 8) {
			outL <<= 1;
			outL |= inR >>> j + i & 1;
			outL <<= 1;
			outL |= inL >>> j + i & 1;
		}
		for (var i = 4; i < 8; i++) for (var j = 24; j >= 0; j -= 8) {
			outR <<= 1;
			outR |= inR >>> j + i & 1;
			outR <<= 1;
			outR |= inL >>> j + i & 1;
		}
		out[off + 0] = outL >>> 0;
		out[off + 1] = outR >>> 0;
	};
	exports.pc1 = function pc1(inL, inR, out, off) {
		var outL = 0;
		var outR = 0;
		for (var i = 7; i >= 5; i--) {
			for (var j = 0; j <= 24; j += 8) {
				outL <<= 1;
				outL |= inR >> j + i & 1;
			}
			for (var j = 0; j <= 24; j += 8) {
				outL <<= 1;
				outL |= inL >> j + i & 1;
			}
		}
		for (var j = 0; j <= 24; j += 8) {
			outL <<= 1;
			outL |= inR >> j + i & 1;
		}
		for (var i = 1; i <= 3; i++) {
			for (var j = 0; j <= 24; j += 8) {
				outR <<= 1;
				outR |= inR >> j + i & 1;
			}
			for (var j = 0; j <= 24; j += 8) {
				outR <<= 1;
				outR |= inL >> j + i & 1;
			}
		}
		for (var j = 0; j <= 24; j += 8) {
			outR <<= 1;
			outR |= inL >> j + i & 1;
		}
		out[off + 0] = outL >>> 0;
		out[off + 1] = outR >>> 0;
	};
	exports.r28shl = function r28shl(num, shift) {
		return num << shift & 268435455 | num >>> 28 - shift;
	};
	var pc2table = [
		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
	];
	exports.pc2 = function pc2(inL, inR, out, off) {
		var outL = 0;
		var outR = 0;
		var len = pc2table.length >>> 1;
		for (var i = 0; i < len; i++) {
			outL <<= 1;
			outL |= inL >>> pc2table[i] & 1;
		}
		for (var i = len; i < pc2table.length; i++) {
			outR <<= 1;
			outR |= inR >>> pc2table[i] & 1;
		}
		out[off + 0] = outL >>> 0;
		out[off + 1] = outR >>> 0;
	};
	exports.expand = function expand(r, out, off) {
		var outL = 0;
		var outR = 0;
		outL = (r & 1) << 5 | r >>> 27;
		for (var i = 23; i >= 15; i -= 4) {
			outL <<= 6;
			outL |= r >>> i & 63;
		}
		for (var i = 11; i >= 3; i -= 4) {
			outR |= r >>> i & 63;
			outR <<= 6;
		}
		outR |= (r & 31) << 1 | r >>> 31;
		out[off + 0] = outL >>> 0;
		out[off + 1] = outR >>> 0;
	};
	var sTable = [
		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
	];
	exports.substitute = function substitute(inL, inR) {
		var out = 0;
		for (var i = 0; i < 4; i++) {
			var b = inL >>> 18 - i * 6 & 63;
			var sb = sTable[i * 64 + b];
			out <<= 4;
			out |= sb;
		}
		for (var i = 0; i < 4; i++) {
			var b = inR >>> 18 - i * 6 & 63;
			var sb = sTable[256 + i * 64 + b];
			out <<= 4;
			out |= sb;
		}
		return out >>> 0;
	};
	var permuteTable = [
		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
	];
	exports.permute = function permute(num) {
		var out = 0;
		for (var i = 0; i < permuteTable.length; i++) {
			out <<= 1;
			out |= num >>> permuteTable[i] & 1;
		}
		return out >>> 0;
	};
	exports.padSplit = function padSplit(num, size, group) {
		var str = num.toString(2);
		while (str.length < size) str = "0" + str;
		var out = [];
		for (var i = 0; i < size; i += group) out.push(str.slice(i, i + group));
		return out.join(" ");
	};
}) });

//#endregion
//#region ../../node_modules/minimalistic-assert/index.js
var require_minimalistic_assert = /* @__PURE__ */ __commonJS({ "../../node_modules/minimalistic-assert/index.js": ((exports, module) => {
	module.exports = assert$4;
	function assert$4(val, msg) {
		if (!val) throw new Error(msg || "Assertion failed");
	}
	assert$4.equal = function assertEqual(l, r, msg) {
		if (l != r) throw new Error(msg || "Assertion failed: " + l + " != " + r);
	};
}) });

//#endregion
//#region ../../node_modules/des.js/lib/des/cipher.js
var require_cipher = /* @__PURE__ */ __commonJS({ "../../node_modules/des.js/lib/des/cipher.js": ((exports, module) => {
	var assert$3 = require_minimalistic_assert();
	function Cipher$2(options) {
		this.options = options;
		this.type = this.options.type;
		this.blockSize = 8;
		this._init();
		this.buffer = new Array(this.blockSize);
		this.bufferOff = 0;
		this.padding = options.padding !== false;
	}
	module.exports = Cipher$2;
	Cipher$2.prototype._init = function _init() {};
	Cipher$2.prototype.update = function update(data) {
		if (data.length === 0) return [];
		if (this.type === "decrypt") return this._updateDecrypt(data);
		else return this._updateEncrypt(data);
	};
	Cipher$2.prototype._buffer = function _buffer(data, off) {
		var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
		for (var i = 0; i < min; i++) this.buffer[this.bufferOff + i] = data[off + i];
		this.bufferOff += min;
		return min;
	};
	Cipher$2.prototype._flushBuffer = function _flushBuffer(out, off) {
		this._update(this.buffer, 0, out, off);
		this.bufferOff = 0;
		return this.blockSize;
	};
	Cipher$2.prototype._updateEncrypt = function _updateEncrypt(data) {
		var inputOff = 0;
		var outputOff = 0;
		var count = (this.bufferOff + data.length) / this.blockSize | 0;
		var out = new Array(count * this.blockSize);
		if (this.bufferOff !== 0) {
			inputOff += this._buffer(data, inputOff);
			if (this.bufferOff === this.buffer.length) outputOff += this._flushBuffer(out, outputOff);
		}
		var max = data.length - (data.length - inputOff) % this.blockSize;
		for (; inputOff < max; inputOff += this.blockSize) {
			this._update(data, inputOff, out, outputOff);
			outputOff += this.blockSize;
		}
		for (; inputOff < data.length; inputOff++, this.bufferOff++) this.buffer[this.bufferOff] = data[inputOff];
		return out;
	};
	Cipher$2.prototype._updateDecrypt = function _updateDecrypt(data) {
		var inputOff = 0;
		var outputOff = 0;
		var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
		var out = new Array(count * this.blockSize);
		for (; count > 0; count--) {
			inputOff += this._buffer(data, inputOff);
			outputOff += this._flushBuffer(out, outputOff);
		}
		inputOff += this._buffer(data, inputOff);
		return out;
	};
	Cipher$2.prototype.final = function final(buffer) {
		var first;
		if (buffer) first = this.update(buffer);
		var last;
		if (this.type === "encrypt") last = this._finalEncrypt();
		else last = this._finalDecrypt();
		if (first) return first.concat(last);
		else return last;
	};
	Cipher$2.prototype._pad = function _pad(buffer, off) {
		if (off === 0) return false;
		while (off < buffer.length) buffer[off++] = 0;
		return true;
	};
	Cipher$2.prototype._finalEncrypt = function _finalEncrypt() {
		if (!this._pad(this.buffer, this.bufferOff)) return [];
		var out = new Array(this.blockSize);
		this._update(this.buffer, 0, out, 0);
		return out;
	};
	Cipher$2.prototype._unpad = function _unpad(buffer) {
		return buffer;
	};
	Cipher$2.prototype._finalDecrypt = function _finalDecrypt() {
		assert$3.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt");
		var out = new Array(this.blockSize);
		this._flushBuffer(out, 0);
		return this._unpad(out);
	};
}) });

//#endregion
//#region ../../node_modules/inherits/inherits_browser.js
var require_inherits_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/inherits/inherits_browser.js": ((exports, module) => {
	if (typeof Object.create === "function") module.exports = function inherits$3(ctor, superCtor) {
		if (superCtor) {
			ctor.super_ = superCtor;
			ctor.prototype = Object.create(superCtor.prototype, { constructor: {
				value: ctor,
				enumerable: false,
				writable: true,
				configurable: true
			} });
		}
	};
	else module.exports = function inherits$3(ctor, superCtor) {
		if (superCtor) {
			ctor.super_ = superCtor;
			var TempCtor = function() {};
			TempCtor.prototype = superCtor.prototype;
			ctor.prototype = new TempCtor();
			ctor.prototype.constructor = ctor;
		}
	};
}) });

//#endregion
//#region ../../node_modules/inherits/inherits.js
var require_inherits = /* @__PURE__ */ __commonJS({ "../../node_modules/inherits/inherits.js": ((exports, module) => {
	try {
		var util = require("util");
		/* istanbul ignore next */
		if (typeof util.inherits !== "function") throw "";
		module.exports = util.inherits;
	} catch (e) {
		/* istanbul ignore next */
		module.exports = require_inherits_browser();
	}
}) });

//#endregion
//#region ../../node_modules/des.js/lib/des/des.js
var require_des$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/des.js/lib/des/des.js": ((exports, module) => {
	var assert$2 = require_minimalistic_assert();
	var inherits$2 = require_inherits();
	var utils = require_utils();
	var Cipher$1 = require_cipher();
	function DESState() {
		this.tmp = new Array(2);
		this.keys = null;
	}
	function DES$1(options) {
		Cipher$1.call(this, options);
		var state = new DESState();
		this._desState = state;
		this.deriveKeys(state, options.key);
	}
	inherits$2(DES$1, Cipher$1);
	module.exports = DES$1;
	DES$1.create = function create(options) {
		return new DES$1(options);
	};
	var shiftTable = [
		1,
		1,
		2,
		2,
		2,
		2,
		2,
		2,
		1,
		2,
		2,
		2,
		2,
		2,
		2,
		1
	];
	DES$1.prototype.deriveKeys = function deriveKeys(state, key) {
		state.keys = new Array(32);
		assert$2.equal(key.length, this.blockSize, "Invalid key length");
		var kL = utils.readUInt32BE(key, 0);
		var kR = utils.readUInt32BE(key, 4);
		utils.pc1(kL, kR, state.tmp, 0);
		kL = state.tmp[0];
		kR = state.tmp[1];
		for (var i = 0; i < state.keys.length; i += 2) {
			var shift = shiftTable[i >>> 1];
			kL = utils.r28shl(kL, shift);
			kR = utils.r28shl(kR, shift);
			utils.pc2(kL, kR, state.keys, i);
		}
	};
	DES$1.prototype._update = function _update(inp, inOff, out, outOff) {
		var state = this._desState;
		var l = utils.readUInt32BE(inp, inOff);
		var r = utils.readUInt32BE(inp, inOff + 4);
		utils.ip(l, r, state.tmp, 0);
		l = state.tmp[0];
		r = state.tmp[1];
		if (this.type === "encrypt") this._encrypt(state, l, r, state.tmp, 0);
		else this._decrypt(state, l, r, state.tmp, 0);
		l = state.tmp[0];
		r = state.tmp[1];
		utils.writeUInt32BE(out, l, outOff);
		utils.writeUInt32BE(out, r, outOff + 4);
	};
	DES$1.prototype._pad = function _pad(buffer, off) {
		if (this.padding === false) return false;
		var value = buffer.length - off;
		for (var i = off; i < buffer.length; i++) buffer[i] = value;
		return true;
	};
	DES$1.prototype._unpad = function _unpad(buffer) {
		if (this.padding === false) return buffer;
		var pad = buffer[buffer.length - 1];
		for (var i = buffer.length - pad; i < buffer.length; i++) assert$2.equal(buffer[i], pad);
		return buffer.slice(0, buffer.length - pad);
	};
	DES$1.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
		var l = lStart;
		var r = rStart;
		for (var i = 0; i < state.keys.length; i += 2) {
			var keyL = state.keys[i];
			var keyR = state.keys[i + 1];
			utils.expand(r, state.tmp, 0);
			keyL ^= state.tmp[0];
			keyR ^= state.tmp[1];
			var s = utils.substitute(keyL, keyR);
			var f = utils.permute(s);
			var t = r;
			r = (l ^ f) >>> 0;
			l = t;
		}
		utils.rip(r, l, out, off);
	};
	DES$1.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
		var l = rStart;
		var r = lStart;
		for (var i = state.keys.length - 2; i >= 0; i -= 2) {
			var keyL = state.keys[i];
			var keyR = state.keys[i + 1];
			utils.expand(l, state.tmp, 0);
			keyL ^= state.tmp[0];
			keyR ^= state.tmp[1];
			var s = utils.substitute(keyL, keyR);
			var f = utils.permute(s);
			var t = l;
			l = (r ^ f) >>> 0;
			r = t;
		}
		utils.rip(l, r, out, off);
	};
}) });

//#endregion
//#region ../../node_modules/des.js/lib/des/cbc.js
var require_cbc = /* @__PURE__ */ __commonJS({ "../../node_modules/des.js/lib/des/cbc.js": ((exports) => {
	var assert$1 = require_minimalistic_assert();
	var inherits$1 = require_inherits();
	var proto = {};
	function CBCState(iv) {
		assert$1.equal(iv.length, 8, "Invalid IV length");
		this.iv = new Array(8);
		for (var i = 0; i < this.iv.length; i++) this.iv[i] = iv[i];
	}
	function instantiate(Base) {
		function CBC(options) {
			Base.call(this, options);
			this._cbcInit();
		}
		inherits$1(CBC, Base);
		var keys = Object.keys(proto);
		for (var i = 0; i < keys.length; i++) {
			var key = keys[i];
			CBC.prototype[key] = proto[key];
		}
		CBC.create = function create(options) {
			return new CBC(options);
		};
		return CBC;
	}
	exports.instantiate = instantiate;
	proto._cbcInit = function _cbcInit() {
		this._cbcState = new CBCState(this.options.iv);
	};
	proto._update = function _update(inp, inOff, out, outOff) {
		var state = this._cbcState;
		var superProto = this.constructor.super_.prototype;
		var iv = state.iv;
		if (this.type === "encrypt") {
			for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i];
			superProto._update.call(this, iv, 0, out, outOff);
			for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i];
		} else {
			superProto._update.call(this, inp, inOff, out, outOff);
			for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i];
			for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i];
		}
	};
}) });

//#endregion
//#region ../../node_modules/des.js/lib/des/ede.js
var require_ede = /* @__PURE__ */ __commonJS({ "../../node_modules/des.js/lib/des/ede.js": ((exports, module) => {
	var assert = require_minimalistic_assert();
	var inherits = require_inherits();
	var Cipher = require_cipher();
	var DES = require_des$1();
	function EDEState(type, key) {
		assert.equal(key.length, 24, "Invalid key length");
		var k1 = key.slice(0, 8);
		var k2 = key.slice(8, 16);
		var k3 = key.slice(16, 24);
		if (type === "encrypt") this.ciphers = [
			DES.create({
				type: "encrypt",
				key: k1
			}),
			DES.create({
				type: "decrypt",
				key: k2
			}),
			DES.create({
				type: "encrypt",
				key: k3
			})
		];
		else this.ciphers = [
			DES.create({
				type: "decrypt",
				key: k3
			}),
			DES.create({
				type: "encrypt",
				key: k2
			}),
			DES.create({
				type: "decrypt",
				key: k1
			})
		];
	}
	function EDE(options) {
		Cipher.call(this, options);
		this._edeState = new EDEState(this.type, this.options.key);
	}
	inherits(EDE, Cipher);
	module.exports = EDE;
	EDE.create = function create(options) {
		return new EDE(options);
	};
	EDE.prototype._update = function _update(inp, inOff, out, outOff) {
		var state = this._edeState;
		state.ciphers[0]._update(inp, inOff, out, outOff);
		state.ciphers[1]._update(out, outOff, out, outOff);
		state.ciphers[2]._update(out, outOff, out, outOff);
	};
	EDE.prototype._pad = DES.prototype._pad;
	EDE.prototype._unpad = DES.prototype._unpad;
}) });

//#endregion
//#region ../../node_modules/des.js/lib/des.js
var require_des = /* @__PURE__ */ __commonJS({ "../../node_modules/des.js/lib/des.js": ((exports) => {
	exports.utils = require_utils();
	exports.Cipher = require_cipher();
	exports.DES = require_des$1();
	exports.CBC = require_cbc();
	exports.EDE = require_ede();
}) });

//#endregion
//#region ../../node_modules/httpntlm/ntlm.js
var require_ntlm = /* @__PURE__ */ __commonJS({ "../../node_modules/httpntlm/ntlm.js": ((exports) => {
	/**
	* Copyright (c) 2013 Sam Decrock https://github.com/SamDecrock/
	* All rights reserved.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var crypto = require("crypto");
	var jsmd4 = require_md4();
	var desjs = require_des();
	var flags = {
		NTLM_NegotiateUnicode: 1,
		NTLM_NegotiateOEM: 2,
		NTLM_RequestTarget: 4,
		NTLM_Unknown9: 8,
		NTLM_NegotiateSign: 16,
		NTLM_NegotiateSeal: 32,
		NTLM_NegotiateDatagram: 64,
		NTLM_NegotiateLanManagerKey: 128,
		NTLM_Unknown8: 256,
		NTLM_NegotiateNTLM: 512,
		NTLM_NegotiateNTOnly: 1024,
		NTLM_Anonymous: 2048,
		NTLM_NegotiateOemDomainSupplied: 4096,
		NTLM_NegotiateOemWorkstationSupplied: 8192,
		NTLM_Unknown6: 16384,
		NTLM_NegotiateAlwaysSign: 32768,
		NTLM_TargetTypeDomain: 65536,
		NTLM_TargetTypeServer: 131072,
		NTLM_TargetTypeShare: 262144,
		NTLM_NegotiateExtendedSecurity: 524288,
		NTLM_NegotiateIdentify: 1048576,
		NTLM_Unknown5: 2097152,
		NTLM_RequestNonNTSessionKey: 4194304,
		NTLM_NegotiateTargetInfo: 8388608,
		NTLM_Unknown4: 16777216,
		NTLM_NegotiateVersion: 33554432,
		NTLM_Unknown3: 67108864,
		NTLM_Unknown2: 134217728,
		NTLM_Unknown1: 268435456,
		NTLM_Negotiate128: 536870912,
		NTLM_NegotiateKeyExchange: 1073741824,
		NTLM_Negotiate56: 2147483648
	};
	var typeflags = {
		NTLM_TYPE1_FLAGS: flags.NTLM_NegotiateUnicode + flags.NTLM_NegotiateOEM + flags.NTLM_RequestTarget + flags.NTLM_NegotiateNTLM + flags.NTLM_NegotiateOemDomainSupplied + flags.NTLM_NegotiateOemWorkstationSupplied + flags.NTLM_NegotiateAlwaysSign + flags.NTLM_NegotiateExtendedSecurity + flags.NTLM_NegotiateVersion + flags.NTLM_Negotiate128 + flags.NTLM_Negotiate56,
		NTLM_TYPE2_FLAGS: flags.NTLM_NegotiateUnicode + flags.NTLM_RequestTarget + flags.NTLM_NegotiateNTLM + flags.NTLM_NegotiateAlwaysSign + flags.NTLM_NegotiateExtendedSecurity + flags.NTLM_NegotiateTargetInfo + flags.NTLM_NegotiateVersion + flags.NTLM_Negotiate128 + flags.NTLM_Negotiate56
	};
	function createType1Message(options) {
		if (!options.domain) options.domain = "";
		if (!options.workstation) options.workstation = "";
		var domain = escape(options.domain.toUpperCase());
		var workstation = escape(options.workstation.toUpperCase());
		var protocol = "NTLMSSP\0";
		var BODY_LENGTH = 40;
		var type1flags = typeflags.NTLM_TYPE1_FLAGS;
		if (!domain || domain === "") type1flags = type1flags - flags.NTLM_NegotiateOemDomainSupplied;
		var pos = 0;
		var buf = Buffer.alloc(BODY_LENGTH + domain.length + workstation.length);
		buf.write(protocol, pos, protocol.length);
		pos += protocol.length;
		buf.writeUInt32LE(1, pos);
		pos += 4;
		buf.writeUInt32LE(type1flags, pos);
		pos += 4;
		buf.writeUInt16LE(domain.length, pos);
		pos += 2;
		buf.writeUInt16LE(domain.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH + workstation.length, pos);
		pos += 4;
		buf.writeUInt16LE(workstation.length, pos);
		pos += 2;
		buf.writeUInt16LE(workstation.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH, pos);
		pos += 4;
		buf.writeUInt8(5, pos);
		pos += 1;
		buf.writeUInt8(1, pos);
		pos += 1;
		buf.writeUInt16LE(2600, pos);
		pos += 2;
		buf.writeUInt8(0, pos);
		pos += 1;
		buf.writeUInt8(0, pos);
		pos += 1;
		buf.writeUInt8(0, pos);
		pos += 1;
		buf.writeUInt8(15, pos);
		pos += 1;
		if (workstation.length != 0) buf.write(workstation, pos, workstation.length, "ascii");
		pos += workstation.length;
		if (domain.length != 0) buf.write(domain, pos, domain.length, "ascii");
		pos += domain.length;
		return "NTLM " + buf.toString("base64");
	}
	function parseType2Message(rawmsg, callback) {
		var match = rawmsg.match(/NTLM (.+)?/);
		if (!match || !match[1]) {
			callback(/* @__PURE__ */ new Error("Couldn't find NTLM in the message type2 coming from the server"));
			return null;
		}
		var buf = Buffer.from(match[1], "base64");
		var msg = {};
		msg.signature = buf.slice(0, 8);
		msg.type = buf.readInt16LE(8);
		if (msg.type != 2) {
			callback(/* @__PURE__ */ new Error("Server didn't return a type 2 message"));
			return null;
		}
		msg.targetNameLen = buf.readInt16LE(12);
		msg.targetNameMaxLen = buf.readInt16LE(14);
		msg.targetNameOffset = buf.readInt32LE(16);
		msg.targetName = buf.slice(msg.targetNameOffset, msg.targetNameOffset + msg.targetNameMaxLen);
		msg.negotiateFlags = buf.readInt32LE(20);
		msg.serverChallenge = buf.slice(24, 32);
		msg.reserved = buf.slice(32, 40);
		if (msg.negotiateFlags & flags.NTLM_NegotiateTargetInfo) {
			msg.targetInfoLen = buf.readInt16LE(40);
			msg.targetInfoMaxLen = buf.readInt16LE(42);
			msg.targetInfoOffset = buf.readInt32LE(44);
			msg.targetInfo = buf.slice(msg.targetInfoOffset, msg.targetInfoOffset + msg.targetInfoLen);
		}
		return msg;
	}
	function createType3Message(msg2, options) {
		if (!options.domain) options.domain = "";
		if (!options.workstation) options.workstation = "";
		if (!options.username) options.username = "";
		if (!options.password) options.password = "";
		var nonce = msg2.serverChallenge;
		var username = options.username;
		var password = options.password;
		var lm_password = options.lm_password;
		var nt_password = options.nt_password;
		var negotiateFlags = msg2.negotiateFlags;
		var isUnicode = negotiateFlags & flags.NTLM_NegotiateUnicode;
		var isNegotiateExtendedSecurity = negotiateFlags & flags.NTLM_NegotiateExtendedSecurity;
		var BODY_LENGTH = 72;
		var domainName = escape(options.domain.toUpperCase());
		var workstation = escape(options.workstation.toUpperCase());
		var workstationBytes, domainNameBytes, usernameBytes, encryptedRandomSessionKeyBytes;
		var encryptedRandomSessionKey = "";
		if (isUnicode) {
			workstationBytes = Buffer.from(workstation, "utf16le");
			domainNameBytes = Buffer.from(domainName, "utf16le");
			usernameBytes = Buffer.from(username, "utf16le");
			encryptedRandomSessionKeyBytes = Buffer.from(encryptedRandomSessionKey, "utf16le");
		} else {
			workstationBytes = Buffer.from(workstation, "ascii");
			domainNameBytes = Buffer.from(domainName, "ascii");
			usernameBytes = Buffer.from(username, "ascii");
			encryptedRandomSessionKeyBytes = Buffer.from(encryptedRandomSessionKey, "ascii");
		}
		var lmChallengeResponse = calc_resp(lm_password != null ? lm_password : create_LM_hashed_password_v1(password), nonce);
		var ntChallengeResponse = calc_resp(nt_password != null ? nt_password : create_NT_hashed_password_v1(password), nonce);
		if (isNegotiateExtendedSecurity) {
			var pwhash = nt_password != null ? nt_password : create_NT_hashed_password_v1(password);
			var clientChallenge = "";
			for (var i = 0; i < 8; i++) clientChallenge += String.fromCharCode(Math.floor(Math.random() * 256));
			var clientChallengeBytes = Buffer.from(clientChallenge, "ascii");
			var challenges = msg2.targetInfo ? calc_ntlmv2_resp(pwhash, username, domainName, msg2.targetInfo, nonce, clientChallengeBytes) : ntlm2sr_calc_resp(pwhash, nonce, clientChallengeBytes);
			lmChallengeResponse = challenges.lmChallengeResponse;
			ntChallengeResponse = challenges.ntChallengeResponse;
		}
		var signature = "NTLMSSP\0";
		var pos = 0;
		var buf = Buffer.alloc(BODY_LENGTH + domainNameBytes.length + usernameBytes.length + workstationBytes.length + lmChallengeResponse.length + ntChallengeResponse.length + encryptedRandomSessionKeyBytes.length);
		buf.write(signature, pos, signature.length);
		pos += signature.length;
		buf.writeUInt32LE(3, pos);
		pos += 4;
		buf.writeUInt16LE(lmChallengeResponse.length, pos);
		pos += 2;
		buf.writeUInt16LE(lmChallengeResponse.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH + domainNameBytes.length + usernameBytes.length + workstationBytes.length, pos);
		pos += 4;
		buf.writeUInt16LE(ntChallengeResponse.length, pos);
		pos += 2;
		buf.writeUInt16LE(ntChallengeResponse.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH + domainNameBytes.length + usernameBytes.length + workstationBytes.length + lmChallengeResponse.length, pos);
		pos += 4;
		buf.writeUInt16LE(domainNameBytes.length, pos);
		pos += 2;
		buf.writeUInt16LE(domainNameBytes.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH, pos);
		pos += 4;
		buf.writeUInt16LE(usernameBytes.length, pos);
		pos += 2;
		buf.writeUInt16LE(usernameBytes.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH + domainNameBytes.length, pos);
		pos += 4;
		buf.writeUInt16LE(workstationBytes.length, pos);
		pos += 2;
		buf.writeUInt16LE(workstationBytes.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH + domainNameBytes.length + usernameBytes.length, pos);
		pos += 4;
		buf.writeUInt16LE(encryptedRandomSessionKeyBytes.length, pos);
		pos += 2;
		buf.writeUInt16LE(encryptedRandomSessionKeyBytes.length, pos);
		pos += 2;
		buf.writeUInt32LE(BODY_LENGTH + domainNameBytes.length + usernameBytes.length + workstationBytes.length + lmChallengeResponse.length + ntChallengeResponse.length, pos);
		pos += 4;
		var flagsToWrite = isUnicode ? typeflags.NTLM_TYPE2_FLAGS : typeflags.NTLM_TYPE2_FLAGS - flags.NTLM_NegotiateUnicode;
		buf.writeUInt32LE(flagsToWrite, pos);
		pos += 4;
		buf.writeUInt8(5, pos);
		pos++;
		buf.writeUInt8(1, pos);
		pos++;
		buf.writeUInt16LE(2600, pos);
		pos += 2;
		buf.writeUInt8(0, pos);
		pos++;
		buf.writeUInt8(0, pos);
		pos++;
		buf.writeUInt8(0, pos);
		pos++;
		buf.writeUInt8(15, pos);
		pos++;
		domainNameBytes.copy(buf, pos);
		pos += domainNameBytes.length;
		usernameBytes.copy(buf, pos);
		pos += usernameBytes.length;
		workstationBytes.copy(buf, pos);
		pos += workstationBytes.length;
		lmChallengeResponse.copy(buf, pos);
		pos += lmChallengeResponse.length;
		ntChallengeResponse.copy(buf, pos);
		pos += ntChallengeResponse.length;
		encryptedRandomSessionKeyBytes.copy(buf, pos);
		pos += encryptedRandomSessionKeyBytes.length;
		return "NTLM " + buf.toString("base64");
	}
	function create_LM_hashed_password_v1(password) {
		password = password.toUpperCase();
		var passwordBytes = Buffer.from(password, "ascii");
		var passwordBytesPadded = Buffer.alloc(14);
		passwordBytesPadded.fill("\0");
		var sourceEnd = 14;
		if (passwordBytes.length < 14) sourceEnd = passwordBytes.length;
		passwordBytes.copy(passwordBytesPadded, 0, 0, sourceEnd);
		var firstPart = passwordBytesPadded.slice(0, 7);
		var secondPart = passwordBytesPadded.slice(7);
		function encrypt(buf) {
			var key = insertZerosEvery7Bits(buf);
			var des = desjs.DES.create({
				type: "encrypt",
				key
			});
			var magicKey = Buffer.from("KGS!@#$%", "ascii");
			var encrypted = des.update(magicKey);
			return Buffer.from(encrypted);
		}
		var firstPartEncrypted = encrypt(firstPart);
		var secondPartEncrypted = encrypt(secondPart);
		return Buffer.concat([firstPartEncrypted, secondPartEncrypted]);
	}
	function insertZerosEvery7Bits(buf) {
		var binaryArray = bytes2binaryArray(buf);
		var newBinaryArray = [];
		for (var i = 0; i < binaryArray.length; i++) {
			newBinaryArray.push(binaryArray[i]);
			if ((i + 1) % 7 === 0) newBinaryArray.push(0);
		}
		return binaryArray2bytes(newBinaryArray);
	}
	function bytes2binaryArray(buf) {
		var hex2binary = {
			0: [
				0,
				0,
				0,
				0
			],
			1: [
				0,
				0,
				0,
				1
			],
			2: [
				0,
				0,
				1,
				0
			],
			3: [
				0,
				0,
				1,
				1
			],
			4: [
				0,
				1,
				0,
				0
			],
			5: [
				0,
				1,
				0,
				1
			],
			6: [
				0,
				1,
				1,
				0
			],
			7: [
				0,
				1,
				1,
				1
			],
			8: [
				1,
				0,
				0,
				0
			],
			9: [
				1,
				0,
				0,
				1
			],
			A: [
				1,
				0,
				1,
				0
			],
			B: [
				1,
				0,
				1,
				1
			],
			C: [
				1,
				1,
				0,
				0
			],
			D: [
				1,
				1,
				0,
				1
			],
			E: [
				1,
				1,
				1,
				0
			],
			F: [
				1,
				1,
				1,
				1
			]
		};
		var hexString = buf.toString("hex").toUpperCase();
		var array = [];
		for (var i = 0; i < hexString.length; i++) {
			var hexchar = hexString.charAt(i);
			array = array.concat(hex2binary[hexchar]);
		}
		return array;
	}
	function binaryArray2bytes(array) {
		var binary2hex = {
			"0000": 0,
			"0001": 1,
			"0010": 2,
			"0011": 3,
			"0100": 4,
			"0101": 5,
			"0110": 6,
			"0111": 7,
			"1000": 8,
			"1001": 9,
			"1010": "A",
			"1011": "B",
			"1100": "C",
			"1101": "D",
			"1110": "E",
			"1111": "F"
		};
		var bufArray = [];
		for (var i = 0; i < array.length; i += 8) {
			if (i + 7 > array.length) break;
			var binString1 = "" + array[i] + array[i + 1] + array[i + 2] + array[i + 3];
			var binString2 = "" + array[i + 4] + array[i + 5] + array[i + 6] + array[i + 7];
			var hexchar1 = binary2hex[binString1];
			var hexchar2 = binary2hex[binString2];
			var buf = Buffer.from(hexchar1 + "" + hexchar2, "hex");
			bufArray.push(buf);
		}
		return Buffer.concat(bufArray);
	}
	function create_NT_hashed_password_v1(password) {
		var buf = Buffer.from(password, "utf16le");
		var md4 = jsmd4.create();
		md4.update(buf);
		return Buffer.from(md4.digest());
	}
	function calc_resp(password_hash, server_challenge) {
		var passHashPadded = Buffer.alloc(21);
		passHashPadded.fill("\0");
		password_hash.copy(passHashPadded, 0, 0, password_hash.length);
		var resArray = [];
		var des = desjs.DES.create({
			type: "encrypt",
			key: insertZerosEvery7Bits(passHashPadded.slice(0, 7))
		});
		resArray.push(Buffer.from(des.update(server_challenge.slice(0, 8))));
		des = desjs.DES.create({
			type: "encrypt",
			key: insertZerosEvery7Bits(passHashPadded.slice(7, 14))
		});
		resArray.push(Buffer.from(des.update(server_challenge.slice(0, 8))));
		des = desjs.DES.create({
			type: "encrypt",
			key: insertZerosEvery7Bits(passHashPadded.slice(14, 21))
		});
		resArray.push(Buffer.from(des.update(server_challenge.slice(0, 8))));
		return Buffer.concat(resArray);
	}
	function hmac_md5(key, data) {
		var hmac = crypto.createHmac("md5", key);
		hmac.update(data);
		return hmac.digest();
	}
	function ntlm2sr_calc_resp(responseKeyNT, serverChallenge, clientChallenge) {
		var lmChallengeResponse = Buffer.alloc(clientChallenge.length + 16);
		lmChallengeResponse.fill("\0");
		clientChallenge.copy(lmChallengeResponse, 0, 0, clientChallenge.length);
		var buf = Buffer.concat([serverChallenge, clientChallenge]);
		var md5 = crypto.createHash("md5");
		md5.update(buf);
		return {
			lmChallengeResponse,
			ntChallengeResponse: calc_resp(responseKeyNT, md5.digest().slice(0, 8))
		};
	}
	function calc_ntlmv2_resp(pwhash, username, domain, targetInfo, serverChallenge, clientChallenge) {
		var responseKeyNTLM = NTOWFv2(pwhash, username, domain);
		var lmV2ChallengeResponse = Buffer.concat([hmac_md5(responseKeyNTLM, Buffer.concat([serverChallenge, clientChallenge])), clientChallenge]);
		var now = Date.now();
		var timestamp = (BigInt(now) + BigInt(0xa9730b66800)) * BigInt(1e4);
		var timestampBuffer = Buffer.alloc(8);
		timestampBuffer.writeBigUInt64LE(timestamp);
		var zero32Bit = Buffer.alloc(4, 0);
		var temp = Buffer.concat([
			Buffer.from([
				1,
				1,
				0,
				0
			]),
			zero32Bit,
			timestampBuffer,
			clientChallenge,
			zero32Bit,
			targetInfo,
			zero32Bit
		]);
		var proofString = hmac_md5(responseKeyNTLM, Buffer.concat([serverChallenge, temp]));
		return {
			lmChallengeResponse: lmV2ChallengeResponse,
			ntChallengeResponse: Buffer.concat([proofString, temp])
		};
	}
	function NTOWFv2(pwhash, user, domain) {
		return hmac_md5(pwhash, Buffer.from(user.toUpperCase() + domain, "utf16le"));
	}
	exports.createType1Message = createType1Message;
	exports.parseType2Message = parseType2Message;
	exports.createType3Message = createType3Message;
	exports.create_NT_hashed_password = create_NT_hashed_password_v1;
	exports.create_LM_hashed_password = create_LM_hashed_password_v1;
}) });

//#endregion
//#region ../../node_modules/underscore/underscore.js
var require_underscore = /* @__PURE__ */ __commonJS({ "../../node_modules/underscore/underscore.js": ((exports, module) => {
	(function(global$1, factory) {
		typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define("underscore", factory) : (global$1 = global$1 || self, function() {
			var current = global$1._;
			var exports$1 = global$1._ = factory();
			exports$1.noConflict = function() {
				global$1._ = current;
				return exports$1;
			};
		}());
	})(exports, (function() {
		var VERSION = "1.12.1";
		var root = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || Function("return this")() || {};
		var ArrayProto = Array.prototype, ObjProto = Object.prototype;
		var SymbolProto = typeof Symbol !== "undefined" ? Symbol.prototype : null;
		var push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty;
		var supportsArrayBuffer = typeof ArrayBuffer !== "undefined", supportsDataView = typeof DataView !== "undefined";
		var nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeCreate = Object.create, nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
		var _isNaN = isNaN, _isFinite = isFinite;
		var hasEnumBug = !{ toString: null }.propertyIsEnumerable("toString");
		var nonEnumerableProps = [
			"valueOf",
			"isPrototypeOf",
			"toString",
			"propertyIsEnumerable",
			"hasOwnProperty",
			"toLocaleString"
		];
		var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
		function restArguments(func, startIndex) {
			startIndex = startIndex == null ? func.length - 1 : +startIndex;
			return function() {
				var length = Math.max(arguments.length - startIndex, 0), rest$1 = Array(length), index = 0;
				for (; index < length; index++) rest$1[index] = arguments[index + startIndex];
				switch (startIndex) {
					case 0: return func.call(this, rest$1);
					case 1: return func.call(this, arguments[0], rest$1);
					case 2: return func.call(this, arguments[0], arguments[1], rest$1);
				}
				var args = Array(startIndex + 1);
				for (index = 0; index < startIndex; index++) args[index] = arguments[index];
				args[startIndex] = rest$1;
				return func.apply(this, args);
			};
		}
		function isObject(obj) {
			var type = typeof obj;
			return type === "function" || type === "object" && !!obj;
		}
		function isNull(obj) {
			return obj === null;
		}
		function isUndefined(obj) {
			return obj === void 0;
		}
		function isBoolean(obj) {
			return obj === true || obj === false || toString.call(obj) === "[object Boolean]";
		}
		function isElement(obj) {
			return !!(obj && obj.nodeType === 1);
		}
		function tagTester(name) {
			var tag = "[object " + name + "]";
			return function(obj) {
				return toString.call(obj) === tag;
			};
		}
		var isString = tagTester("String");
		var isNumber = tagTester("Number");
		var isDate = tagTester("Date");
		var isRegExp = tagTester("RegExp");
		var isError = tagTester("Error");
		var isSymbol = tagTester("Symbol");
		var isArrayBuffer = tagTester("ArrayBuffer");
		var isFunction = tagTester("Function");
		var nodelist = root.document && root.document.childNodes;
		if (typeof /./ != "function" && typeof Int8Array != "object" && typeof nodelist != "function") isFunction = function(obj) {
			return typeof obj == "function" || false;
		};
		var isFunction$1 = isFunction;
		var hasObjectTag = tagTester("Object");
		var hasStringTagBug = supportsDataView && hasObjectTag(/* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8))), isIE11 = typeof Map !== "undefined" && hasObjectTag(/* @__PURE__ */ new Map());
		var isDataView = tagTester("DataView");
		function ie10IsDataView(obj) {
			return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer);
		}
		var isDataView$1 = hasStringTagBug ? ie10IsDataView : isDataView;
		var isArray = nativeIsArray || tagTester("Array");
		function has(obj, key) {
			return obj != null && hasOwnProperty.call(obj, key);
		}
		var isArguments = tagTester("Arguments");
		(function() {
			if (!isArguments(arguments)) isArguments = function(obj) {
				return has(obj, "callee");
			};
		})();
		var isArguments$1 = isArguments;
		function isFinite$1(obj) {
			return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
		}
		function isNaN$1(obj) {
			return isNumber(obj) && _isNaN(obj);
		}
		function constant(value) {
			return function() {
				return value;
			};
		}
		function createSizePropertyCheck(getSizeProperty) {
			return function(collection) {
				var sizeProperty = getSizeProperty(collection);
				return typeof sizeProperty == "number" && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
			};
		}
		function shallowProperty(key) {
			return function(obj) {
				return obj == null ? void 0 : obj[key];
			};
		}
		var getByteLength = shallowProperty("byteLength");
		var isBufferLike = createSizePropertyCheck(getByteLength);
		var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
		function isTypedArray(obj) {
			return nativeIsView ? nativeIsView(obj) && !isDataView$1(obj) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
		}
		var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
		var getLength = shallowProperty("length");
		function emulatedSet(keys$1) {
			var hash = {};
			for (var l = keys$1.length, i = 0; i < l; ++i) hash[keys$1[i]] = true;
			return {
				contains: function(key) {
					return hash[key];
				},
				push: function(key) {
					hash[key] = true;
					return keys$1.push(key);
				}
			};
		}
		function collectNonEnumProps(obj, keys$1) {
			keys$1 = emulatedSet(keys$1);
			var nonEnumIdx = nonEnumerableProps.length;
			var constructor = obj.constructor;
			var proto$1 = isFunction$1(constructor) && constructor.prototype || ObjProto;
			var prop = "constructor";
			if (has(obj, prop) && !keys$1.contains(prop)) keys$1.push(prop);
			while (nonEnumIdx--) {
				prop = nonEnumerableProps[nonEnumIdx];
				if (prop in obj && obj[prop] !== proto$1[prop] && !keys$1.contains(prop)) keys$1.push(prop);
			}
		}
		function keys(obj) {
			if (!isObject(obj)) return [];
			if (nativeKeys) return nativeKeys(obj);
			var keys$1 = [];
			for (var key in obj) if (has(obj, key)) keys$1.push(key);
			if (hasEnumBug) collectNonEnumProps(obj, keys$1);
			return keys$1;
		}
		function isEmpty(obj) {
			if (obj == null) return true;
			var length = getLength(obj);
			if (typeof length == "number" && (isArray(obj) || isString(obj) || isArguments$1(obj))) return length === 0;
			return getLength(keys(obj)) === 0;
		}
		function isMatch(object$1, attrs) {
			var _keys = keys(attrs), length = _keys.length;
			if (object$1 == null) return !length;
			var obj = Object(object$1);
			for (var i = 0; i < length; i++) {
				var key = _keys[i];
				if (attrs[key] !== obj[key] || !(key in obj)) return false;
			}
			return true;
		}
		function _$1(obj) {
			if (obj instanceof _$1) return obj;
			if (!(this instanceof _$1)) return new _$1(obj);
			this._wrapped = obj;
		}
		_$1.VERSION = VERSION;
		_$1.prototype.value = function() {
			return this._wrapped;
		};
		_$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value;
		_$1.prototype.toString = function() {
			return String(this._wrapped);
		};
		function toBufferView(bufferSource) {
			return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, getByteLength(bufferSource));
		}
		var tagDataView = "[object DataView]";
		function eq(a, b, aStack, bStack) {
			if (a === b) return a !== 0 || 1 / a === 1 / b;
			if (a == null || b == null) return false;
			if (a !== a) return b !== b;
			var type = typeof a;
			if (type !== "function" && type !== "object" && typeof b != "object") return false;
			return deepEq(a, b, aStack, bStack);
		}
		function deepEq(a, b, aStack, bStack) {
			if (a instanceof _$1) a = a._wrapped;
			if (b instanceof _$1) b = b._wrapped;
			var className = toString.call(a);
			if (className !== toString.call(b)) return false;
			if (hasStringTagBug && className == "[object Object]" && isDataView$1(a)) {
				if (!isDataView$1(b)) return false;
				className = tagDataView;
			}
			switch (className) {
				case "[object RegExp]":
				case "[object String]": return "" + a === "" + b;
				case "[object Number]":
					if (+a !== +a) return +b !== +b;
					return +a === 0 ? 1 / +a === 1 / b : +a === +b;
				case "[object Date]":
				case "[object Boolean]": return +a === +b;
				case "[object Symbol]": return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
				case "[object ArrayBuffer]":
				case tagDataView: return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);
			}
			var areArrays = className === "[object Array]";
			if (!areArrays && isTypedArray$1(a)) {
				if (getByteLength(a) !== getByteLength(b)) return false;
				if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
				areArrays = true;
			}
			if (!areArrays) {
				if (typeof a != "object" || typeof b != "object") return false;
				var aCtor = a.constructor, bCtor = b.constructor;
				if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && isFunction$1(bCtor) && bCtor instanceof bCtor) && "constructor" in a && "constructor" in b) return false;
			}
			aStack = aStack || [];
			bStack = bStack || [];
			var length = aStack.length;
			while (length--) if (aStack[length] === a) return bStack[length] === b;
			aStack.push(a);
			bStack.push(b);
			if (areArrays) {
				length = a.length;
				if (length !== b.length) return false;
				while (length--) if (!eq(a[length], b[length], aStack, bStack)) return false;
			} else {
				var _keys = keys(a), key;
				length = _keys.length;
				if (keys(b).length !== length) return false;
				while (length--) {
					key = _keys[length];
					if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
				}
			}
			aStack.pop();
			bStack.pop();
			return true;
		}
		function isEqual(a, b) {
			return eq(a, b);
		}
		function allKeys(obj) {
			if (!isObject(obj)) return [];
			var keys$1 = [];
			for (var key in obj) keys$1.push(key);
			if (hasEnumBug) collectNonEnumProps(obj, keys$1);
			return keys$1;
		}
		function ie11fingerprint(methods) {
			var length = getLength(methods);
			return function(obj) {
				if (obj == null) return false;
				if (getLength(allKeys(obj))) return false;
				for (var i = 0; i < length; i++) if (!isFunction$1(obj[methods[i]])) return false;
				return methods !== weakMapMethods || !isFunction$1(obj[forEachName]);
			};
		}
		var forEachName = "forEach", hasName = "has", commonInit = ["clear", "delete"], mapTail = [
			"get",
			hasName,
			"set"
		];
		var mapMethods = commonInit.concat(forEachName, mapTail), weakMapMethods = commonInit.concat(mapTail), setMethods = ["add"].concat(commonInit, forEachName, hasName);
		var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester("Map");
		var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester("WeakMap");
		var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester("Set");
		var isWeakSet = tagTester("WeakSet");
		function values(obj) {
			var _keys = keys(obj);
			var length = _keys.length;
			var values$1 = Array(length);
			for (var i = 0; i < length; i++) values$1[i] = obj[_keys[i]];
			return values$1;
		}
		function pairs(obj) {
			var _keys = keys(obj);
			var length = _keys.length;
			var pairs$1 = Array(length);
			for (var i = 0; i < length; i++) pairs$1[i] = [_keys[i], obj[_keys[i]]];
			return pairs$1;
		}
		function invert(obj) {
			var result$1 = {};
			var _keys = keys(obj);
			for (var i = 0, length = _keys.length; i < length; i++) result$1[obj[_keys[i]]] = _keys[i];
			return result$1;
		}
		function functions(obj) {
			var names = [];
			for (var key in obj) if (isFunction$1(obj[key])) names.push(key);
			return names.sort();
		}
		function createAssigner(keysFunc, defaults$1) {
			return function(obj) {
				var length = arguments.length;
				if (defaults$1) obj = Object(obj);
				if (length < 2 || obj == null) return obj;
				for (var index = 1; index < length; index++) {
					var source = arguments[index], keys$1 = keysFunc(source), l = keys$1.length;
					for (var i = 0; i < l; i++) {
						var key = keys$1[i];
						if (!defaults$1 || obj[key] === void 0) obj[key] = source[key];
					}
				}
				return obj;
			};
		}
		var extend = createAssigner(allKeys);
		var extendOwn = createAssigner(keys);
		var defaults = createAssigner(allKeys, true);
		function ctor() {
			return function() {};
		}
		function baseCreate(prototype) {
			if (!isObject(prototype)) return {};
			if (nativeCreate) return nativeCreate(prototype);
			var Ctor = ctor();
			Ctor.prototype = prototype;
			var result$1 = new Ctor();
			Ctor.prototype = null;
			return result$1;
		}
		function create(prototype, props) {
			var result$1 = baseCreate(prototype);
			if (props) extendOwn(result$1, props);
			return result$1;
		}
		function clone(obj) {
			if (!isObject(obj)) return obj;
			return isArray(obj) ? obj.slice() : extend({}, obj);
		}
		function tap(obj, interceptor) {
			interceptor(obj);
			return obj;
		}
		function toPath(path) {
			return isArray(path) ? path : [path];
		}
		_$1.toPath = toPath;
		function toPath$1(path) {
			return _$1.toPath(path);
		}
		function deepGet(obj, path) {
			var length = path.length;
			for (var i = 0; i < length; i++) {
				if (obj == null) return void 0;
				obj = obj[path[i]];
			}
			return length ? obj : void 0;
		}
		function get(object$1, path, defaultValue) {
			var value = deepGet(object$1, toPath$1(path));
			return isUndefined(value) ? defaultValue : value;
		}
		function has$1(obj, path) {
			path = toPath$1(path);
			var length = path.length;
			for (var i = 0; i < length; i++) {
				var key = path[i];
				if (!has(obj, key)) return false;
				obj = obj[key];
			}
			return !!length;
		}
		function identity(value) {
			return value;
		}
		function matcher(attrs) {
			attrs = extendOwn({}, attrs);
			return function(obj) {
				return isMatch(obj, attrs);
			};
		}
		function property(path) {
			path = toPath$1(path);
			return function(obj) {
				return deepGet(obj, path);
			};
		}
		function optimizeCb(func, context, argCount) {
			if (context === void 0) return func;
			switch (argCount == null ? 3 : argCount) {
				case 1: return function(value) {
					return func.call(context, value);
				};
				case 3: return function(value, index, collection) {
					return func.call(context, value, index, collection);
				};
				case 4: return function(accumulator, value, index, collection) {
					return func.call(context, accumulator, value, index, collection);
				};
			}
			return function() {
				return func.apply(context, arguments);
			};
		}
		function baseIteratee(value, context, argCount) {
			if (value == null) return identity;
			if (isFunction$1(value)) return optimizeCb(value, context, argCount);
			if (isObject(value) && !isArray(value)) return matcher(value);
			return property(value);
		}
		function iteratee(value, context) {
			return baseIteratee(value, context, Infinity);
		}
		_$1.iteratee = iteratee;
		function cb(value, context, argCount) {
			if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context);
			return baseIteratee(value, context, argCount);
		}
		function mapObject(obj, iteratee$1, context) {
			iteratee$1 = cb(iteratee$1, context);
			var _keys = keys(obj), length = _keys.length, results = {};
			for (var index = 0; index < length; index++) {
				var currentKey = _keys[index];
				results[currentKey] = iteratee$1(obj[currentKey], currentKey, obj);
			}
			return results;
		}
		function noop() {}
		function propertyOf(obj) {
			if (obj == null) return noop;
			return function(path) {
				return get(obj, path);
			};
		}
		function times(n, iteratee$1, context) {
			var accum = Array(Math.max(0, n));
			iteratee$1 = optimizeCb(iteratee$1, context, 1);
			for (var i = 0; i < n; i++) accum[i] = iteratee$1(i);
			return accum;
		}
		function random(min$1, max$1) {
			if (max$1 == null) {
				max$1 = min$1;
				min$1 = 0;
			}
			return min$1 + Math.floor(Math.random() * (max$1 - min$1 + 1));
		}
		var now = Date.now || function() {
			return (/* @__PURE__ */ new Date()).getTime();
		};
		function createEscaper(map$1) {
			var escaper = function(match) {
				return map$1[match];
			};
			var source = "(?:" + keys(map$1).join("|") + ")";
			var testRegexp = RegExp(source);
			var replaceRegexp = RegExp(source, "g");
			return function(string) {
				string = string == null ? "" : "" + string;
				return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
			};
		}
		var escapeMap = {
			"&": "&amp;",
			"<": "&lt;",
			">": "&gt;",
			"\"": "&quot;",
			"'": "&#x27;",
			"`": "&#x60;"
		};
		var _escape = createEscaper(escapeMap);
		var _unescape = createEscaper(invert(escapeMap));
		var templateSettings = _$1.templateSettings = {
			evaluate: /<%([\s\S]+?)%>/g,
			interpolate: /<%=([\s\S]+?)%>/g,
			escape: /<%-([\s\S]+?)%>/g
		};
		var noMatch = /(.)^/;
		var escapes = {
			"'": "'",
			"\\": "\\",
			"\r": "r",
			"\n": "n",
			"\u2028": "u2028",
			"\u2029": "u2029"
		};
		var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
		function escapeChar(match) {
			return "\\" + escapes[match];
		}
		var bareIdentifier = /^\s*(\w|\$)+\s*$/;
		function template(text, settings, oldSettings) {
			if (!settings && oldSettings) settings = oldSettings;
			settings = defaults({}, settings, _$1.templateSettings);
			var matcher$1 = RegExp([
				(settings.escape || noMatch).source,
				(settings.interpolate || noMatch).source,
				(settings.evaluate || noMatch).source
			].join("|") + "|$", "g");
			var index = 0;
			var source = "__p+='";
			text.replace(matcher$1, function(match, escape$1, interpolate, evaluate, offset) {
				source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
				index = offset + match.length;
				if (escape$1) source += "'+\n((__t=(" + escape$1 + "))==null?'':_.escape(__t))+\n'";
				else if (interpolate) source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
				else if (evaluate) source += "';\n" + evaluate + "\n__p+='";
				return match;
			});
			source += "';\n";
			var argument = settings.variable;
			if (argument) {
				if (!bareIdentifier.test(argument)) throw new Error(argument);
			} else {
				source = "with(obj||{}){\n" + source + "}\n";
				argument = "obj";
			}
			source = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n";
			var render;
			try {
				render = new Function(argument, "_", source);
			} catch (e) {
				e.source = source;
				throw e;
			}
			var template$1 = function(data) {
				return render.call(this, data, _$1);
			};
			template$1.source = "function(" + argument + "){\n" + source + "}";
			return template$1;
		}
		function result(obj, path, fallback) {
			path = toPath$1(path);
			var length = path.length;
			if (!length) return isFunction$1(fallback) ? fallback.call(obj) : fallback;
			for (var i = 0; i < length; i++) {
				var prop = obj == null ? void 0 : obj[path[i]];
				if (prop === void 0) {
					prop = fallback;
					i = length;
				}
				obj = isFunction$1(prop) ? prop.call(obj) : prop;
			}
			return obj;
		}
		var idCounter = 0;
		function uniqueId(prefix) {
			var id = ++idCounter + "";
			return prefix ? prefix + id : id;
		}
		function chain(obj) {
			var instance = _$1(obj);
			instance._chain = true;
			return instance;
		}
		function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
			if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
			var self$1 = baseCreate(sourceFunc.prototype);
			var result$1 = sourceFunc.apply(self$1, args);
			if (isObject(result$1)) return result$1;
			return self$1;
		}
		var partial = restArguments(function(func, boundArgs) {
			var placeholder = partial.placeholder;
			var bound = function() {
				var position = 0, length = boundArgs.length;
				var args = Array(length);
				for (var i = 0; i < length; i++) args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
				while (position < arguments.length) args.push(arguments[position++]);
				return executeBound(func, bound, this, this, args);
			};
			return bound;
		});
		partial.placeholder = _$1;
		var bind = restArguments(function(func, context, args) {
			if (!isFunction$1(func)) throw new TypeError("Bind must be called on a function");
			var bound = restArguments(function(callArgs) {
				return executeBound(func, bound, context, this, args.concat(callArgs));
			});
			return bound;
		});
		var isArrayLike = createSizePropertyCheck(getLength);
		function flatten(input, depth, strict, output) {
			output = output || [];
			if (!depth && depth !== 0) depth = Infinity;
			else if (depth <= 0) return output.concat(input);
			var idx = output.length;
			for (var i = 0, length = getLength(input); i < length; i++) {
				var value = input[i];
				if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) if (depth > 1) {
					flatten(value, depth - 1, strict, output);
					idx = output.length;
				} else {
					var j = 0, len = value.length;
					while (j < len) output[idx++] = value[j++];
				}
				else if (!strict) output[idx++] = value;
			}
			return output;
		}
		var bindAll = restArguments(function(obj, keys$1) {
			keys$1 = flatten(keys$1, false, false);
			var index = keys$1.length;
			if (index < 1) throw new Error("bindAll must be passed function names");
			while (index--) {
				var key = keys$1[index];
				obj[key] = bind(obj[key], obj);
			}
			return obj;
		});
		function memoize(func, hasher) {
			var memoize$1 = function(key) {
				var cache = memoize$1.cache;
				var address = "" + (hasher ? hasher.apply(this, arguments) : key);
				if (!has(cache, address)) cache[address] = func.apply(this, arguments);
				return cache[address];
			};
			memoize$1.cache = {};
			return memoize$1;
		}
		var delay = restArguments(function(func, wait, args) {
			return setTimeout(function() {
				return func.apply(null, args);
			}, wait);
		});
		var defer = partial(delay, _$1, 1);
		function throttle(func, wait, options) {
			var timeout, context, args, result$1;
			var previous = 0;
			if (!options) options = {};
			var later = function() {
				previous = options.leading === false ? 0 : now();
				timeout = null;
				result$1 = func.apply(context, args);
				if (!timeout) context = args = null;
			};
			var throttled = function() {
				var _now = now();
				if (!previous && options.leading === false) previous = _now;
				var remaining = wait - (_now - previous);
				context = this;
				args = arguments;
				if (remaining <= 0 || remaining > wait) {
					if (timeout) {
						clearTimeout(timeout);
						timeout = null;
					}
					previous = _now;
					result$1 = func.apply(context, args);
					if (!timeout) context = args = null;
				} else if (!timeout && options.trailing !== false) timeout = setTimeout(later, remaining);
				return result$1;
			};
			throttled.cancel = function() {
				clearTimeout(timeout);
				previous = 0;
				timeout = context = args = null;
			};
			return throttled;
		}
		function debounce(func, wait, immediate) {
			var timeout, previous, args, result$1, context;
			var later = function() {
				var passed = now() - previous;
				if (wait > passed) timeout = setTimeout(later, wait - passed);
				else {
					timeout = null;
					if (!immediate) result$1 = func.apply(context, args);
					if (!timeout) args = context = null;
				}
			};
			var debounced = restArguments(function(_args) {
				context = this;
				args = _args;
				previous = now();
				if (!timeout) {
					timeout = setTimeout(later, wait);
					if (immediate) result$1 = func.apply(context, args);
				}
				return result$1;
			});
			debounced.cancel = function() {
				clearTimeout(timeout);
				timeout = args = context = null;
			};
			return debounced;
		}
		function wrap(func, wrapper) {
			return partial(wrapper, func);
		}
		function negate(predicate) {
			return function() {
				return !predicate.apply(this, arguments);
			};
		}
		function compose() {
			var args = arguments;
			var start = args.length - 1;
			return function() {
				var i = start;
				var result$1 = args[start].apply(this, arguments);
				while (i--) result$1 = args[i].call(this, result$1);
				return result$1;
			};
		}
		function after(times$1, func) {
			return function() {
				if (--times$1 < 1) return func.apply(this, arguments);
			};
		}
		function before(times$1, func) {
			var memo;
			return function() {
				if (--times$1 > 0) memo = func.apply(this, arguments);
				if (times$1 <= 1) func = null;
				return memo;
			};
		}
		var once = partial(before, 2);
		function findKey(obj, predicate, context) {
			predicate = cb(predicate, context);
			var _keys = keys(obj), key;
			for (var i = 0, length = _keys.length; i < length; i++) {
				key = _keys[i];
				if (predicate(obj[key], key, obj)) return key;
			}
		}
		function createPredicateIndexFinder(dir) {
			return function(array, predicate, context) {
				predicate = cb(predicate, context);
				var length = getLength(array);
				var index = dir > 0 ? 0 : length - 1;
				for (; index >= 0 && index < length; index += dir) if (predicate(array[index], index, array)) return index;
				return -1;
			};
		}
		var findIndex = createPredicateIndexFinder(1);
		var findLastIndex = createPredicateIndexFinder(-1);
		function sortedIndex(array, obj, iteratee$1, context) {
			iteratee$1 = cb(iteratee$1, context, 1);
			var value = iteratee$1(obj);
			var low = 0, high = getLength(array);
			while (low < high) {
				var mid = Math.floor((low + high) / 2);
				if (iteratee$1(array[mid]) < value) low = mid + 1;
				else high = mid;
			}
			return low;
		}
		function createIndexFinder(dir, predicateFind, sortedIndex$1) {
			return function(array, item, idx) {
				var i = 0, length = getLength(array);
				if (typeof idx == "number") if (dir > 0) i = idx >= 0 ? idx : Math.max(idx + length, i);
				else length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
				else if (sortedIndex$1 && idx && length) {
					idx = sortedIndex$1(array, item);
					return array[idx] === item ? idx : -1;
				}
				if (item !== item) {
					idx = predicateFind(slice.call(array, i, length), isNaN$1);
					return idx >= 0 ? idx + i : -1;
				}
				for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) if (array[idx] === item) return idx;
				return -1;
			};
		}
		var indexOf = createIndexFinder(1, findIndex, sortedIndex);
		var lastIndexOf = createIndexFinder(-1, findLastIndex);
		function find(obj, predicate, context) {
			var key = (isArrayLike(obj) ? findIndex : findKey)(obj, predicate, context);
			if (key !== void 0 && key !== -1) return obj[key];
		}
		function findWhere(obj, attrs) {
			return find(obj, matcher(attrs));
		}
		function each(obj, iteratee$1, context) {
			iteratee$1 = optimizeCb(iteratee$1, context);
			var i, length;
			if (isArrayLike(obj)) for (i = 0, length = obj.length; i < length; i++) iteratee$1(obj[i], i, obj);
			else {
				var _keys = keys(obj);
				for (i = 0, length = _keys.length; i < length; i++) iteratee$1(obj[_keys[i]], _keys[i], obj);
			}
			return obj;
		}
		function map(obj, iteratee$1, context) {
			iteratee$1 = cb(iteratee$1, context);
			var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, results = Array(length);
			for (var index = 0; index < length; index++) {
				var currentKey = _keys ? _keys[index] : index;
				results[index] = iteratee$1(obj[currentKey], currentKey, obj);
			}
			return results;
		}
		function createReduce(dir) {
			var reducer = function(obj, iteratee$1, memo, initial$1) {
				var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = dir > 0 ? 0 : length - 1;
				if (!initial$1) {
					memo = obj[_keys ? _keys[index] : index];
					index += dir;
				}
				for (; index >= 0 && index < length; index += dir) {
					var currentKey = _keys ? _keys[index] : index;
					memo = iteratee$1(memo, obj[currentKey], currentKey, obj);
				}
				return memo;
			};
			return function(obj, iteratee$1, memo, context) {
				var initial$1 = arguments.length >= 3;
				return reducer(obj, optimizeCb(iteratee$1, context, 4), memo, initial$1);
			};
		}
		var reduce = createReduce(1);
		var reduceRight = createReduce(-1);
		function filter(obj, predicate, context) {
			var results = [];
			predicate = cb(predicate, context);
			each(obj, function(value, index, list) {
				if (predicate(value, index, list)) results.push(value);
			});
			return results;
		}
		function reject(obj, predicate, context) {
			return filter(obj, negate(cb(predicate)), context);
		}
		function every(obj, predicate, context) {
			predicate = cb(predicate, context);
			var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length;
			for (var index = 0; index < length; index++) {
				var currentKey = _keys ? _keys[index] : index;
				if (!predicate(obj[currentKey], currentKey, obj)) return false;
			}
			return true;
		}
		function some(obj, predicate, context) {
			predicate = cb(predicate, context);
			var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length;
			for (var index = 0; index < length; index++) {
				var currentKey = _keys ? _keys[index] : index;
				if (predicate(obj[currentKey], currentKey, obj)) return true;
			}
			return false;
		}
		function contains(obj, item, fromIndex, guard) {
			if (!isArrayLike(obj)) obj = values(obj);
			if (typeof fromIndex != "number" || guard) fromIndex = 0;
			return indexOf(obj, item, fromIndex) >= 0;
		}
		var invoke = restArguments(function(obj, path, args) {
			var contextPath, func;
			if (isFunction$1(path)) func = path;
			else {
				path = toPath$1(path);
				contextPath = path.slice(0, -1);
				path = path[path.length - 1];
			}
			return map(obj, function(context) {
				var method = func;
				if (!method) {
					if (contextPath && contextPath.length) context = deepGet(context, contextPath);
					if (context == null) return void 0;
					method = context[path];
				}
				return method == null ? method : method.apply(context, args);
			});
		});
		function pluck(obj, key) {
			return map(obj, property(key));
		}
		function where(obj, attrs) {
			return filter(obj, matcher(attrs));
		}
		function max(obj, iteratee$1, context) {
			var result$1 = -Infinity, lastComputed = -Infinity, value, computed;
			if (iteratee$1 == null || typeof iteratee$1 == "number" && typeof obj[0] != "object" && obj != null) {
				obj = isArrayLike(obj) ? obj : values(obj);
				for (var i = 0, length = obj.length; i < length; i++) {
					value = obj[i];
					if (value != null && value > result$1) result$1 = value;
				}
			} else {
				iteratee$1 = cb(iteratee$1, context);
				each(obj, function(v, index, list) {
					computed = iteratee$1(v, index, list);
					if (computed > lastComputed || computed === -Infinity && result$1 === -Infinity) {
						result$1 = v;
						lastComputed = computed;
					}
				});
			}
			return result$1;
		}
		function min(obj, iteratee$1, context) {
			var result$1 = Infinity, lastComputed = Infinity, value, computed;
			if (iteratee$1 == null || typeof iteratee$1 == "number" && typeof obj[0] != "object" && obj != null) {
				obj = isArrayLike(obj) ? obj : values(obj);
				for (var i = 0, length = obj.length; i < length; i++) {
					value = obj[i];
					if (value != null && value < result$1) result$1 = value;
				}
			} else {
				iteratee$1 = cb(iteratee$1, context);
				each(obj, function(v, index, list) {
					computed = iteratee$1(v, index, list);
					if (computed < lastComputed || computed === Infinity && result$1 === Infinity) {
						result$1 = v;
						lastComputed = computed;
					}
				});
			}
			return result$1;
		}
		function sample(obj, n, guard) {
			if (n == null || guard) {
				if (!isArrayLike(obj)) obj = values(obj);
				return obj[random(obj.length - 1)];
			}
			var sample$1 = isArrayLike(obj) ? clone(obj) : values(obj);
			var length = getLength(sample$1);
			n = Math.max(Math.min(n, length), 0);
			var last$1 = length - 1;
			for (var index = 0; index < n; index++) {
				var rand = random(index, last$1);
				var temp = sample$1[index];
				sample$1[index] = sample$1[rand];
				sample$1[rand] = temp;
			}
			return sample$1.slice(0, n);
		}
		function shuffle(obj) {
			return sample(obj, Infinity);
		}
		function sortBy(obj, iteratee$1, context) {
			var index = 0;
			iteratee$1 = cb(iteratee$1, context);
			return pluck(map(obj, function(value, key, list) {
				return {
					value,
					index: index++,
					criteria: iteratee$1(value, key, list)
				};
			}).sort(function(left, right) {
				var a = left.criteria;
				var b = right.criteria;
				if (a !== b) {
					if (a > b || a === void 0) return 1;
					if (a < b || b === void 0) return -1;
				}
				return left.index - right.index;
			}), "value");
		}
		function group(behavior, partition$1) {
			return function(obj, iteratee$1, context) {
				var result$1 = partition$1 ? [[], []] : {};
				iteratee$1 = cb(iteratee$1, context);
				each(obj, function(value, index) {
					behavior(result$1, value, iteratee$1(value, index, obj));
				});
				return result$1;
			};
		}
		var groupBy = group(function(result$1, value, key) {
			if (has(result$1, key)) result$1[key].push(value);
			else result$1[key] = [value];
		});
		var indexBy = group(function(result$1, value, key) {
			result$1[key] = value;
		});
		var countBy = group(function(result$1, value, key) {
			if (has(result$1, key)) result$1[key]++;
			else result$1[key] = 1;
		});
		var partition = group(function(result$1, value, pass) {
			result$1[pass ? 0 : 1].push(value);
		}, true);
		var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
		function toArray(obj) {
			if (!obj) return [];
			if (isArray(obj)) return slice.call(obj);
			if (isString(obj)) return obj.match(reStrSymbol);
			if (isArrayLike(obj)) return map(obj, identity);
			return values(obj);
		}
		function size(obj) {
			if (obj == null) return 0;
			return isArrayLike(obj) ? obj.length : keys(obj).length;
		}
		function keyInObj(value, key, obj) {
			return key in obj;
		}
		var pick = restArguments(function(obj, keys$1) {
			var result$1 = {}, iteratee$1 = keys$1[0];
			if (obj == null) return result$1;
			if (isFunction$1(iteratee$1)) {
				if (keys$1.length > 1) iteratee$1 = optimizeCb(iteratee$1, keys$1[1]);
				keys$1 = allKeys(obj);
			} else {
				iteratee$1 = keyInObj;
				keys$1 = flatten(keys$1, false, false);
				obj = Object(obj);
			}
			for (var i = 0, length = keys$1.length; i < length; i++) {
				var key = keys$1[i];
				var value = obj[key];
				if (iteratee$1(value, key, obj)) result$1[key] = value;
			}
			return result$1;
		});
		var omit = restArguments(function(obj, keys$1) {
			var iteratee$1 = keys$1[0], context;
			if (isFunction$1(iteratee$1)) {
				iteratee$1 = negate(iteratee$1);
				if (keys$1.length > 1) context = keys$1[1];
			} else {
				keys$1 = map(flatten(keys$1, false, false), String);
				iteratee$1 = function(value, key) {
					return !contains(keys$1, key);
				};
			}
			return pick(obj, iteratee$1, context);
		});
		function initial(array, n, guard) {
			return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
		}
		function first(array, n, guard) {
			if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
			if (n == null || guard) return array[0];
			return initial(array, array.length - n);
		}
		function rest(array, n, guard) {
			return slice.call(array, n == null || guard ? 1 : n);
		}
		function last(array, n, guard) {
			if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
			if (n == null || guard) return array[array.length - 1];
			return rest(array, Math.max(0, array.length - n));
		}
		function compact(array) {
			return filter(array, Boolean);
		}
		function flatten$1(array, depth) {
			return flatten(array, depth, false);
		}
		var difference = restArguments(function(array, rest$1) {
			rest$1 = flatten(rest$1, true, true);
			return filter(array, function(value) {
				return !contains(rest$1, value);
			});
		});
		var without = restArguments(function(array, otherArrays) {
			return difference(array, otherArrays);
		});
		function uniq(array, isSorted, iteratee$1, context) {
			if (!isBoolean(isSorted)) {
				context = iteratee$1;
				iteratee$1 = isSorted;
				isSorted = false;
			}
			if (iteratee$1 != null) iteratee$1 = cb(iteratee$1, context);
			var result$1 = [];
			var seen = [];
			for (var i = 0, length = getLength(array); i < length; i++) {
				var value = array[i], computed = iteratee$1 ? iteratee$1(value, i, array) : value;
				if (isSorted && !iteratee$1) {
					if (!i || seen !== computed) result$1.push(value);
					seen = computed;
				} else if (iteratee$1) {
					if (!contains(seen, computed)) {
						seen.push(computed);
						result$1.push(value);
					}
				} else if (!contains(result$1, value)) result$1.push(value);
			}
			return result$1;
		}
		var union = restArguments(function(arrays) {
			return uniq(flatten(arrays, true, true));
		});
		function intersection(array) {
			var result$1 = [];
			var argsLength = arguments.length;
			for (var i = 0, length = getLength(array); i < length; i++) {
				var item = array[i];
				if (contains(result$1, item)) continue;
				var j;
				for (j = 1; j < argsLength; j++) if (!contains(arguments[j], item)) break;
				if (j === argsLength) result$1.push(item);
			}
			return result$1;
		}
		function unzip(array) {
			var length = array && max(array, getLength).length || 0;
			var result$1 = Array(length);
			for (var index = 0; index < length; index++) result$1[index] = pluck(array, index);
			return result$1;
		}
		var zip = restArguments(unzip);
		function object(list, values$1) {
			var result$1 = {};
			for (var i = 0, length = getLength(list); i < length; i++) if (values$1) result$1[list[i]] = values$1[i];
			else result$1[list[i][0]] = list[i][1];
			return result$1;
		}
		function range(start, stop, step) {
			if (stop == null) {
				stop = start || 0;
				start = 0;
			}
			if (!step) step = stop < start ? -1 : 1;
			var length = Math.max(Math.ceil((stop - start) / step), 0);
			var range$1 = Array(length);
			for (var idx = 0; idx < length; idx++, start += step) range$1[idx] = start;
			return range$1;
		}
		function chunk(array, count) {
			if (count == null || count < 1) return [];
			var result$1 = [];
			var i = 0, length = array.length;
			while (i < length) result$1.push(slice.call(array, i, i += count));
			return result$1;
		}
		function chainResult(instance, obj) {
			return instance._chain ? _$1(obj).chain() : obj;
		}
		function mixin(obj) {
			each(functions(obj), function(name) {
				var func = _$1[name] = obj[name];
				_$1.prototype[name] = function() {
					var args = [this._wrapped];
					push.apply(args, arguments);
					return chainResult(this, func.apply(_$1, args));
				};
			});
			return _$1;
		}
		each([
			"pop",
			"push",
			"reverse",
			"shift",
			"sort",
			"splice",
			"unshift"
		], function(name) {
			var method = ArrayProto[name];
			_$1.prototype[name] = function() {
				var obj = this._wrapped;
				if (obj != null) {
					method.apply(obj, arguments);
					if ((name === "shift" || name === "splice") && obj.length === 0) delete obj[0];
				}
				return chainResult(this, obj);
			};
		});
		each([
			"concat",
			"join",
			"slice"
		], function(name) {
			var method = ArrayProto[name];
			_$1.prototype[name] = function() {
				var obj = this._wrapped;
				if (obj != null) obj = method.apply(obj, arguments);
				return chainResult(this, obj);
			};
		});
		var _$1$1 = mixin({
			__proto__: null,
			VERSION,
			restArguments,
			isObject,
			isNull,
			isUndefined,
			isBoolean,
			isElement,
			isString,
			isNumber,
			isDate,
			isRegExp,
			isError,
			isSymbol,
			isArrayBuffer,
			isDataView: isDataView$1,
			isArray,
			isFunction: isFunction$1,
			isArguments: isArguments$1,
			isFinite: isFinite$1,
			isNaN: isNaN$1,
			isTypedArray: isTypedArray$1,
			isEmpty,
			isMatch,
			isEqual,
			isMap,
			isWeakMap,
			isSet,
			isWeakSet,
			keys,
			allKeys,
			values,
			pairs,
			invert,
			functions,
			methods: functions,
			extend,
			extendOwn,
			assign: extendOwn,
			defaults,
			create,
			clone,
			tap,
			get,
			has: has$1,
			mapObject,
			identity,
			constant,
			noop,
			toPath,
			property,
			propertyOf,
			matcher,
			matches: matcher,
			times,
			random,
			now,
			escape: _escape,
			unescape: _unescape,
			templateSettings,
			template,
			result,
			uniqueId,
			chain,
			iteratee,
			partial,
			bind,
			bindAll,
			memoize,
			delay,
			defer,
			throttle,
			debounce,
			wrap,
			negate,
			compose,
			after,
			before,
			once,
			findKey,
			findIndex,
			findLastIndex,
			sortedIndex,
			indexOf,
			lastIndexOf,
			find,
			detect: find,
			findWhere,
			each,
			forEach: each,
			map,
			collect: map,
			reduce,
			foldl: reduce,
			inject: reduce,
			reduceRight,
			foldr: reduceRight,
			filter,
			select: filter,
			reject,
			every,
			all: every,
			some,
			any: some,
			contains,
			includes: contains,
			include: contains,
			invoke,
			pluck,
			where,
			max,
			min,
			shuffle,
			sample,
			sortBy,
			groupBy,
			indexBy,
			countBy,
			partition,
			toArray,
			size,
			pick,
			omit,
			first,
			head: first,
			take: first,
			initial,
			last,
			rest,
			tail: rest,
			drop: rest,
			compact,
			flatten: flatten$1,
			without,
			uniq,
			unique: uniq,
			union,
			intersection,
			difference,
			unzip,
			transpose: unzip,
			zip,
			object,
			range,
			chunk,
			mixin,
			"default": _$1
		});
		_$1$1._ = _$1$1;
		return _$1$1;
	}));
}) });

//#endregion
//#region ../../node_modules/httpntlm/httpntlm.js
var require_httpntlm = /* @__PURE__ */ __commonJS({ "../../node_modules/httpntlm/httpntlm.js": ((exports) => {
	var url = require("url");
	var httpreq = require_httpreq();
	var ntlm$1 = require_ntlm();
	var _ = require_underscore();
	var http = require("http");
	var https = require("https");
	exports.method = function(method, options, finalCallback) {
		if (!options.workstation) options.workstation = "";
		if (!options.domain) options.domain = "";
		var httpreqOptions = _.omit(options, "url", "username", "password", "workstation", "domain");
		var isHttps = false;
		if (url.parse(options.url).protocol == "https:") isHttps = true;
		var keepaliveAgent;
		if (options.agent) keepaliveAgent = options.agent;
		else if (isHttps) keepaliveAgent = new https.Agent({ keepAlive: true });
		else keepaliveAgent = new http.Agent({ keepAlive: true });
		function sendType1Message(callback) {
			var type1msg = ntlm$1.createType1Message(options);
			var type1options = {
				headers: {
					"Connection": "keep-alive",
					"Authorization": type1msg
				},
				timeout: options.timeout || 0,
				agent: keepaliveAgent,
				allowRedirects: false
			};
			type1options = _.extend({}, _.omit(httpreqOptions, "headers", "body"), type1options);
			httpreq[method](options.url, type1options, callback);
		}
		function sendType3Message(res, callback) {
			if (res.headers.location) {
				options.url = res.headers.location;
				return exports[method](options, finalCallback);
			}
			if (!res.headers["www-authenticate"]) return callback(/* @__PURE__ */ new Error("www-authenticate not found on response of second request"));
			var type2msg = ntlm$1.parseType2Message(res.headers["www-authenticate"], callback);
			if (!type2msg) return;
			var type3msg = ntlm$1.createType3Message(type2msg, options);
			var type3options = {
				headers: {
					"Connection": "Close",
					"Authorization": type3msg
				},
				allowRedirects: false,
				agent: keepaliveAgent
			};
			type3options = _.extend(type3options, _.omit(httpreqOptions, "headers"));
			if (httpreqOptions.headers) type3options.headers = _.extend(type3options.headers, _.omit(httpreqOptions.headers, "Connection", "Authorization"));
			httpreq[method](options.url, type3options, callback);
		}
		sendType1Message(function(err, res) {
			if (err) return finalCallback(err);
			setImmediate(function() {
				sendType3Message(res, finalCallback);
			});
		});
	};
	[
		"get",
		"put",
		"patch",
		"post",
		"delete",
		"options"
	].forEach(function(method) {
		exports[method] = exports.method.bind(exports, method);
	});
	exports.ntlm = ntlm$1;
}) });

//#endregion
//#region src/index.ts
var import_httpntlm = /* @__PURE__ */ __toESM(require_httpntlm());
function extractNtlmChallenge(headers) {
	return headers.filter((h) => h.name.toLowerCase() === "www-authenticate").flatMap((h) => h.value.split(",")).map((v) => v.trim()).filter(Boolean).find((v) => /^NTLM\s+\S+/i.test(v)) ?? null;
}
const plugin = { authentication: {
	name: "windows",
	label: "NTLM Auth",
	shortLabel: "NTLM",
	args: [
		{
			type: "banner",
			color: "info",
			inputs: [{
				type: "markdown",
				content: "NTLM is still in beta. Please submit any issues to [Feedback](https://yaak.app/feedback)."
			}]
		},
		{
			type: "text",
			name: "username",
			label: "Username",
			optional: true
		},
		{
			type: "text",
			name: "password",
			label: "Password",
			optional: true,
			password: true
		},
		{
			type: "accordion",
			label: "Advanced",
			inputs: [{
				name: "domain",
				label: "Domain",
				type: "text",
				optional: true
			}, {
				name: "workstation",
				label: "Workstation",
				type: "text",
				optional: true
			}]
		}
	],
	async onApply(ctx, { values, method, url: url$2 }) {
		const username = values.username ? String(values.username) : void 0;
		const password = values.password ? String(values.password) : void 0;
		const domain = values.domain ? String(values.domain) : void 0;
		const options = {
			url: url$2,
			username,
			password,
			workstation: values.workstation ? String(values.workstation) : void 0,
			domain
		};
		const type1 = import_httpntlm.ntlm.createType1Message(options);
		const ntlmChallenge = extractNtlmChallenge((await ctx.httpRequest.send({ httpRequest: {
			method,
			url: url$2,
			headers: [{
				name: "Authorization",
				value: type1
			}, {
				name: "Connection",
				value: "keep-alive"
			}]
		} })).headers);
		if (ntlmChallenge == null) throw new Error("Unable to find NTLM challenge in WWW-Authenticate response headers");
		const type2 = import_httpntlm.ntlm.parseType2Message(ntlmChallenge, (err) => {
			if (err != null) throw err;
		});
		return { setHeaders: [{
			name: "Authorization",
			value: import_httpntlm.ntlm.createType3Message(type2, options)
		}] };
	}
} };

//#endregion
exports.plugin = plugin;