/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

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 __esm = (fn2, res) => function __init() {
  return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
};
var __commonJS = (cb, mod2) => function __require() {
  return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
  mod2
));
var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);

// node_modules/telegram/inspect.js
var require_inspect = __commonJS({
  "node_modules/telegram/inspect.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.inspect = void 0;
    var util_1 = require("util");
    Object.defineProperty(exports2, "inspect", { enumerable: true, get: function() {
      return util_1.inspect;
    } });
  }
});

// node_modules/big-integer/BigInteger.js
var require_BigInteger = __commonJS({
  "node_modules/big-integer/BigInteger.js"(exports2, module2) {
    var bigInt4 = function(undefined2) {
      "use strict";
      var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
      var supportsNativeBigInt = typeof BigInt === "function";
      function Integer(v, radix, alphabet, caseSensitive) {
        if (typeof v === "undefined")
          return Integer[0];
        if (typeof radix !== "undefined")
          return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);
        return parseValue(v);
      }
      function BigInteger(value, sign) {
        this.value = value;
        this.sign = sign;
        this.isSmall = false;
      }
      BigInteger.prototype = Object.create(Integer.prototype);
      function SmallInteger(value) {
        this.value = value;
        this.sign = value < 0;
        this.isSmall = true;
      }
      SmallInteger.prototype = Object.create(Integer.prototype);
      function NativeBigInt(value) {
        this.value = value;
      }
      NativeBigInt.prototype = Object.create(Integer.prototype);
      function isPrecise(n) {
        return -MAX_INT < n && n < MAX_INT;
      }
      function smallToArray(n) {
        if (n < 1e7)
          return [n];
        if (n < 1e14)
          return [n % 1e7, Math.floor(n / 1e7)];
        return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
      }
      function arrayToSmall(arr) {
        trim(arr);
        var length = arr.length;
        if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
          switch (length) {
            case 0:
              return 0;
            case 1:
              return arr[0];
            case 2:
              return arr[0] + arr[1] * BASE;
            default:
              return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
          }
        }
        return arr;
      }
      function trim(v) {
        var i2 = v.length;
        while (v[--i2] === 0)
          ;
        v.length = i2 + 1;
      }
      function createArray(length) {
        var x = new Array(length);
        var i2 = -1;
        while (++i2 < length) {
          x[i2] = 0;
        }
        return x;
      }
      function truncate(n) {
        if (n > 0)
          return Math.floor(n);
        return Math.ceil(n);
      }
      function add(a, b) {
        var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i2;
        for (i2 = 0; i2 < l_b; i2++) {
          sum = a[i2] + b[i2] + carry;
          carry = sum >= base ? 1 : 0;
          r[i2] = sum - carry * base;
        }
        while (i2 < l_a) {
          sum = a[i2] + carry;
          carry = sum === base ? 1 : 0;
          r[i2++] = sum - carry * base;
        }
        if (carry > 0)
          r.push(carry);
        return r;
      }
      function addAny(a, b) {
        if (a.length >= b.length)
          return add(a, b);
        return add(b, a);
      }
      function addSmall(a, carry) {
        var l = a.length, r = new Array(l), base = BASE, sum, i2;
        for (i2 = 0; i2 < l; i2++) {
          sum = a[i2] - base + carry;
          carry = Math.floor(sum / base);
          r[i2] = sum - carry * base;
          carry += 1;
        }
        while (carry > 0) {
          r[i2++] = carry % base;
          carry = Math.floor(carry / base);
        }
        return r;
      }
      BigInteger.prototype.add = function(v) {
        var n = parseValue(v);
        if (this.sign !== n.sign) {
          return this.subtract(n.negate());
        }
        var a = this.value, b = n.value;
        if (n.isSmall) {
          return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
        }
        return new BigInteger(addAny(a, b), this.sign);
      };
      BigInteger.prototype.plus = BigInteger.prototype.add;
      SmallInteger.prototype.add = function(v) {
        var n = parseValue(v);
        var a = this.value;
        if (a < 0 !== n.sign) {
          return this.subtract(n.negate());
        }
        var b = n.value;
        if (n.isSmall) {
          if (isPrecise(a + b))
            return new SmallInteger(a + b);
          b = smallToArray(Math.abs(b));
        }
        return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
      };
      SmallInteger.prototype.plus = SmallInteger.prototype.add;
      NativeBigInt.prototype.add = function(v) {
        return new NativeBigInt(this.value + parseValue(v).value);
      };
      NativeBigInt.prototype.plus = NativeBigInt.prototype.add;
      function subtract(a, b) {
        var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i2, difference;
        for (i2 = 0; i2 < b_l; i2++) {
          difference = a[i2] - borrow - b[i2];
          if (difference < 0) {
            difference += base;
            borrow = 1;
          } else
            borrow = 0;
          r[i2] = difference;
        }
        for (i2 = b_l; i2 < a_l; i2++) {
          difference = a[i2] - borrow;
          if (difference < 0)
            difference += base;
          else {
            r[i2++] = difference;
            break;
          }
          r[i2] = difference;
        }
        for (; i2 < a_l; i2++) {
          r[i2] = a[i2];
        }
        trim(r);
        return r;
      }
      function subtractAny(a, b, sign) {
        var value;
        if (compareAbs(a, b) >= 0) {
          value = subtract(a, b);
        } else {
          value = subtract(b, a);
          sign = !sign;
        }
        value = arrayToSmall(value);
        if (typeof value === "number") {
          if (sign)
            value = -value;
          return new SmallInteger(value);
        }
        return new BigInteger(value, sign);
      }
      function subtractSmall(a, b, sign) {
        var l = a.length, r = new Array(l), carry = -b, base = BASE, i2, difference;
        for (i2 = 0; i2 < l; i2++) {
          difference = a[i2] + carry;
          carry = Math.floor(difference / base);
          difference %= base;
          r[i2] = difference < 0 ? difference + base : difference;
        }
        r = arrayToSmall(r);
        if (typeof r === "number") {
          if (sign)
            r = -r;
          return new SmallInteger(r);
        }
        return new BigInteger(r, sign);
      }
      BigInteger.prototype.subtract = function(v) {
        var n = parseValue(v);
        if (this.sign !== n.sign) {
          return this.add(n.negate());
        }
        var a = this.value, b = n.value;
        if (n.isSmall)
          return subtractSmall(a, Math.abs(b), this.sign);
        return subtractAny(a, b, this.sign);
      };
      BigInteger.prototype.minus = BigInteger.prototype.subtract;
      SmallInteger.prototype.subtract = function(v) {
        var n = parseValue(v);
        var a = this.value;
        if (a < 0 !== n.sign) {
          return this.add(n.negate());
        }
        var b = n.value;
        if (n.isSmall) {
          return new SmallInteger(a - b);
        }
        return subtractSmall(b, Math.abs(a), a >= 0);
      };
      SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
      NativeBigInt.prototype.subtract = function(v) {
        return new NativeBigInt(this.value - parseValue(v).value);
      };
      NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;
      BigInteger.prototype.negate = function() {
        return new BigInteger(this.value, !this.sign);
      };
      SmallInteger.prototype.negate = function() {
        var sign = this.sign;
        var small = new SmallInteger(-this.value);
        small.sign = !sign;
        return small;
      };
      NativeBigInt.prototype.negate = function() {
        return new NativeBigInt(-this.value);
      };
      BigInteger.prototype.abs = function() {
        return new BigInteger(this.value, false);
      };
      SmallInteger.prototype.abs = function() {
        return new SmallInteger(Math.abs(this.value));
      };
      NativeBigInt.prototype.abs = function() {
        return new NativeBigInt(this.value >= 0 ? this.value : -this.value);
      };
      function multiplyLong(a, b) {
        var a_l = a.length, b_l = b.length, l = a_l + b_l, r = createArray(l), base = BASE, product, carry, i2, a_i, b_j;
        for (i2 = 0; i2 < a_l; ++i2) {
          a_i = a[i2];
          for (var j = 0; j < b_l; ++j) {
            b_j = b[j];
            product = a_i * b_j + r[i2 + j];
            carry = Math.floor(product / base);
            r[i2 + j] = product - carry * base;
            r[i2 + j + 1] += carry;
          }
        }
        trim(r);
        return r;
      }
      function multiplySmall(a, b) {
        var l = a.length, r = new Array(l), base = BASE, carry = 0, product, i2;
        for (i2 = 0; i2 < l; i2++) {
          product = a[i2] * b + carry;
          carry = Math.floor(product / base);
          r[i2] = product - carry * base;
        }
        while (carry > 0) {
          r[i2++] = carry % base;
          carry = Math.floor(carry / base);
        }
        return r;
      }
      function shiftLeft(x, n) {
        var r = [];
        while (n-- > 0)
          r.push(0);
        return r.concat(x);
      }
      function multiplyKaratsuba(x, y) {
        var n = Math.max(x.length, y.length);
        if (n <= 30)
          return multiplyLong(x, y);
        n = Math.ceil(n / 2);
        var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n);
        var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
        var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
        trim(product);
        return product;
      }
      function useKaratsuba(l1, l2) {
        return -0.012 * l1 - 0.012 * l2 + 15e-6 * l1 * l2 > 0;
      }
      BigInteger.prototype.multiply = function(v) {
        var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs;
        if (n.isSmall) {
          if (b === 0)
            return Integer[0];
          if (b === 1)
            return this;
          if (b === -1)
            return this.negate();
          abs = Math.abs(b);
          if (abs < BASE) {
            return new BigInteger(multiplySmall(a, abs), sign);
          }
          b = smallToArray(abs);
        }
        if (useKaratsuba(a.length, b.length))
          return new BigInteger(multiplyKaratsuba(a, b), sign);
        return new BigInteger(multiplyLong(a, b), sign);
      };
      BigInteger.prototype.times = BigInteger.prototype.multiply;
      function multiplySmallAndArray(a, b, sign) {
        if (a < BASE) {
          return new BigInteger(multiplySmall(b, a), sign);
        }
        return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
      }
      SmallInteger.prototype._multiplyBySmall = function(a) {
        if (isPrecise(a.value * this.value)) {
          return new SmallInteger(a.value * this.value);
        }
        return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
      };
      BigInteger.prototype._multiplyBySmall = function(a) {
        if (a.value === 0)
          return Integer[0];
        if (a.value === 1)
          return this;
        if (a.value === -1)
          return this.negate();
        return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
      };
      SmallInteger.prototype.multiply = function(v) {
        return parseValue(v)._multiplyBySmall(this);
      };
      SmallInteger.prototype.times = SmallInteger.prototype.multiply;
      NativeBigInt.prototype.multiply = function(v) {
        return new NativeBigInt(this.value * parseValue(v).value);
      };
      NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;
      function square(a) {
        var l = a.length, r = createArray(l + l), base = BASE, product, carry, i2, a_i, a_j;
        for (i2 = 0; i2 < l; i2++) {
          a_i = a[i2];
          carry = 0 - a_i * a_i;
          for (var j = i2; j < l; j++) {
            a_j = a[j];
            product = 2 * (a_i * a_j) + r[i2 + j] + carry;
            carry = Math.floor(product / base);
            r[i2 + j] = product - carry * base;
          }
          r[i2 + l] = carry;
        }
        trim(r);
        return r;
      }
      BigInteger.prototype.square = function() {
        return new BigInteger(square(this.value), false);
      };
      SmallInteger.prototype.square = function() {
        var value = this.value * this.value;
        if (isPrecise(value))
          return new SmallInteger(value);
        return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
      };
      NativeBigInt.prototype.square = function(v) {
        return new NativeBigInt(this.value * this.value);
      };
      function divMod1(a, b) {
        var a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length), divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda), quotientDigit, shift, carry, borrow, i2, l, q2;
        if (remainder.length <= a_l)
          remainder.push(0);
        divisor.push(0);
        divisorMostSignificantDigit = divisor[b_l - 1];
        for (shift = a_l - b_l; shift >= 0; shift--) {
          quotientDigit = base - 1;
          if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
            quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
          }
          carry = 0;
          borrow = 0;
          l = divisor.length;
          for (i2 = 0; i2 < l; i2++) {
            carry += quotientDigit * divisor[i2];
            q2 = Math.floor(carry / base);
            borrow += remainder[shift + i2] - (carry - q2 * base);
            carry = q2;
            if (borrow < 0) {
              remainder[shift + i2] = borrow + base;
              borrow = -1;
            } else {
              remainder[shift + i2] = borrow;
              borrow = 0;
            }
          }
          while (borrow !== 0) {
            quotientDigit -= 1;
            carry = 0;
            for (i2 = 0; i2 < l; i2++) {
              carry += remainder[shift + i2] - base + divisor[i2];
              if (carry < 0) {
                remainder[shift + i2] = carry + base;
                carry = 0;
              } else {
                remainder[shift + i2] = carry;
                carry = 1;
              }
            }
            borrow += carry;
          }
          result[shift] = quotientDigit;
        }
        remainder = divModSmall(remainder, lambda)[0];
        return [arrayToSmall(result), arrayToSmall(remainder)];
      }
      function divMod2(a, b) {
        var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check2;
        while (a_l) {
          part.unshift(a[--a_l]);
          trim(part);
          if (compareAbs(part, b) < 0) {
            result.push(0);
            continue;
          }
          xlen = part.length;
          highx = part[xlen - 1] * base + part[xlen - 2];
          highy = b[b_l - 1] * base + b[b_l - 2];
          if (xlen > b_l) {
            highx = (highx + 1) * base;
          }
          guess = Math.ceil(highx / highy);
          do {
            check2 = multiplySmall(b, guess);
            if (compareAbs(check2, part) <= 0)
              break;
            guess--;
          } while (guess);
          result.push(guess);
          part = subtract(part, check2);
        }
        result.reverse();
        return [arrayToSmall(result), arrayToSmall(part)];
      }
      function divModSmall(value, lambda) {
        var length = value.length, quotient = createArray(length), base = BASE, i2, q2, remainder, divisor;
        remainder = 0;
        for (i2 = length - 1; i2 >= 0; --i2) {
          divisor = remainder * base + value[i2];
          q2 = truncate(divisor / lambda);
          remainder = divisor - q2 * lambda;
          quotient[i2] = q2 | 0;
        }
        return [quotient, remainder | 0];
      }
      function divModAny(self2, v) {
        var value, n = parseValue(v);
        if (supportsNativeBigInt) {
          return [new NativeBigInt(self2.value / n.value), new NativeBigInt(self2.value % n.value)];
        }
        var a = self2.value, b = n.value;
        var quotient;
        if (b === 0)
          throw new Error("Cannot divide by zero");
        if (self2.isSmall) {
          if (n.isSmall) {
            return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
          }
          return [Integer[0], self2];
        }
        if (n.isSmall) {
          if (b === 1)
            return [self2, Integer[0]];
          if (b == -1)
            return [self2.negate(), Integer[0]];
          var abs = Math.abs(b);
          if (abs < BASE) {
            value = divModSmall(a, abs);
            quotient = arrayToSmall(value[0]);
            var remainder = value[1];
            if (self2.sign)
              remainder = -remainder;
            if (typeof quotient === "number") {
              if (self2.sign !== n.sign)
                quotient = -quotient;
              return [new SmallInteger(quotient), new SmallInteger(remainder)];
            }
            return [new BigInteger(quotient, self2.sign !== n.sign), new SmallInteger(remainder)];
          }
          b = smallToArray(abs);
        }
        var comparison = compareAbs(a, b);
        if (comparison === -1)
          return [Integer[0], self2];
        if (comparison === 0)
          return [Integer[self2.sign === n.sign ? 1 : -1], Integer[0]];
        if (a.length + b.length <= 200)
          value = divMod1(a, b);
        else
          value = divMod2(a, b);
        quotient = value[0];
        var qSign = self2.sign !== n.sign, mod2 = value[1], mSign = self2.sign;
        if (typeof quotient === "number") {
          if (qSign)
            quotient = -quotient;
          quotient = new SmallInteger(quotient);
        } else
          quotient = new BigInteger(quotient, qSign);
        if (typeof mod2 === "number") {
          if (mSign)
            mod2 = -mod2;
          mod2 = new SmallInteger(mod2);
        } else
          mod2 = new BigInteger(mod2, mSign);
        return [quotient, mod2];
      }
      BigInteger.prototype.divmod = function(v) {
        var result = divModAny(this, v);
        return {
          quotient: result[0],
          remainder: result[1]
        };
      };
      NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
      BigInteger.prototype.divide = function(v) {
        return divModAny(this, v)[0];
      };
      NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function(v) {
        return new NativeBigInt(this.value / parseValue(v).value);
      };
      SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
      BigInteger.prototype.mod = function(v) {
        return divModAny(this, v)[1];
      };
      NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function(v) {
        return new NativeBigInt(this.value % parseValue(v).value);
      };
      SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
      BigInteger.prototype.pow = function(v) {
        var n = parseValue(v), a = this.value, b = n.value, value, x, y;
        if (b === 0)
          return Integer[1];
        if (a === 0)
          return Integer[0];
        if (a === 1)
          return Integer[1];
        if (a === -1)
          return n.isEven() ? Integer[1] : Integer[-1];
        if (n.sign) {
          return Integer[0];
        }
        if (!n.isSmall)
          throw new Error("The exponent " + n.toString() + " is too large.");
        if (this.isSmall) {
          if (isPrecise(value = Math.pow(a, b)))
            return new SmallInteger(truncate(value));
        }
        x = this;
        y = Integer[1];
        while (true) {
          if (b & true) {
            y = y.times(x);
            --b;
          }
          if (b === 0)
            break;
          b /= 2;
          x = x.square();
        }
        return y;
      };
      SmallInteger.prototype.pow = BigInteger.prototype.pow;
      NativeBigInt.prototype.pow = function(v) {
        var n = parseValue(v);
        var a = this.value, b = n.value;
        var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);
        if (b === _0)
          return Integer[1];
        if (a === _0)
          return Integer[0];
        if (a === _1)
          return Integer[1];
        if (a === BigInt(-1))
          return n.isEven() ? Integer[1] : Integer[-1];
        if (n.isNegative())
          return new NativeBigInt(_0);
        var x = this;
        var y = Integer[1];
        while (true) {
          if ((b & _1) === _1) {
            y = y.times(x);
            --b;
          }
          if (b === _0)
            break;
          b /= _2;
          x = x.square();
        }
        return y;
      };
      BigInteger.prototype.modPow = function(exp, mod2) {
        exp = parseValue(exp);
        mod2 = parseValue(mod2);
        if (mod2.isZero())
          throw new Error("Cannot take modPow with modulus 0");
        var r = Integer[1], base = this.mod(mod2);
        if (exp.isNegative()) {
          exp = exp.multiply(Integer[-1]);
          base = base.modInv(mod2);
        }
        while (exp.isPositive()) {
          if (base.isZero())
            return Integer[0];
          if (exp.isOdd())
            r = r.multiply(base).mod(mod2);
          exp = exp.divide(2);
          base = base.square().mod(mod2);
        }
        return r;
      };
      NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
      function compareAbs(a, b) {
        if (a.length !== b.length) {
          return a.length > b.length ? 1 : -1;
        }
        for (var i2 = a.length - 1; i2 >= 0; i2--) {
          if (a[i2] !== b[i2])
            return a[i2] > b[i2] ? 1 : -1;
        }
        return 0;
      }
      BigInteger.prototype.compareAbs = function(v) {
        var n = parseValue(v), a = this.value, b = n.value;
        if (n.isSmall)
          return 1;
        return compareAbs(a, b);
      };
      SmallInteger.prototype.compareAbs = function(v) {
        var n = parseValue(v), a = Math.abs(this.value), b = n.value;
        if (n.isSmall) {
          b = Math.abs(b);
          return a === b ? 0 : a > b ? 1 : -1;
        }
        return -1;
      };
      NativeBigInt.prototype.compareAbs = function(v) {
        var a = this.value;
        var b = parseValue(v).value;
        a = a >= 0 ? a : -a;
        b = b >= 0 ? b : -b;
        return a === b ? 0 : a > b ? 1 : -1;
      };
      BigInteger.prototype.compare = function(v) {
        if (v === Infinity) {
          return -1;
        }
        if (v === -Infinity) {
          return 1;
        }
        var n = parseValue(v), a = this.value, b = n.value;
        if (this.sign !== n.sign) {
          return n.sign ? 1 : -1;
        }
        if (n.isSmall) {
          return this.sign ? -1 : 1;
        }
        return compareAbs(a, b) * (this.sign ? -1 : 1);
      };
      BigInteger.prototype.compareTo = BigInteger.prototype.compare;
      SmallInteger.prototype.compare = function(v) {
        if (v === Infinity) {
          return -1;
        }
        if (v === -Infinity) {
          return 1;
        }
        var n = parseValue(v), a = this.value, b = n.value;
        if (n.isSmall) {
          return a == b ? 0 : a > b ? 1 : -1;
        }
        if (a < 0 !== n.sign) {
          return a < 0 ? -1 : 1;
        }
        return a < 0 ? 1 : -1;
      };
      SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
      NativeBigInt.prototype.compare = function(v) {
        if (v === Infinity) {
          return -1;
        }
        if (v === -Infinity) {
          return 1;
        }
        var a = this.value;
        var b = parseValue(v).value;
        return a === b ? 0 : a > b ? 1 : -1;
      };
      NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;
      BigInteger.prototype.equals = function(v) {
        return this.compare(v) === 0;
      };
      NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
      BigInteger.prototype.notEquals = function(v) {
        return this.compare(v) !== 0;
      };
      NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
      BigInteger.prototype.greater = function(v) {
        return this.compare(v) > 0;
      };
      NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
      BigInteger.prototype.lesser = function(v) {
        return this.compare(v) < 0;
      };
      NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
      BigInteger.prototype.greaterOrEquals = function(v) {
        return this.compare(v) >= 0;
      };
      NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
      BigInteger.prototype.lesserOrEquals = function(v) {
        return this.compare(v) <= 0;
      };
      NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
      BigInteger.prototype.isEven = function() {
        return (this.value[0] & 1) === 0;
      };
      SmallInteger.prototype.isEven = function() {
        return (this.value & 1) === 0;
      };
      NativeBigInt.prototype.isEven = function() {
        return (this.value & BigInt(1)) === BigInt(0);
      };
      BigInteger.prototype.isOdd = function() {
        return (this.value[0] & 1) === 1;
      };
      SmallInteger.prototype.isOdd = function() {
        return (this.value & 1) === 1;
      };
      NativeBigInt.prototype.isOdd = function() {
        return (this.value & BigInt(1)) === BigInt(1);
      };
      BigInteger.prototype.isPositive = function() {
        return !this.sign;
      };
      SmallInteger.prototype.isPositive = function() {
        return this.value > 0;
      };
      NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;
      BigInteger.prototype.isNegative = function() {
        return this.sign;
      };
      SmallInteger.prototype.isNegative = function() {
        return this.value < 0;
      };
      NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;
      BigInteger.prototype.isUnit = function() {
        return false;
      };
      SmallInteger.prototype.isUnit = function() {
        return Math.abs(this.value) === 1;
      };
      NativeBigInt.prototype.isUnit = function() {
        return this.abs().value === BigInt(1);
      };
      BigInteger.prototype.isZero = function() {
        return false;
      };
      SmallInteger.prototype.isZero = function() {
        return this.value === 0;
      };
      NativeBigInt.prototype.isZero = function() {
        return this.value === BigInt(0);
      };
      BigInteger.prototype.isDivisibleBy = function(v) {
        var n = parseValue(v);
        if (n.isZero())
          return false;
        if (n.isUnit())
          return true;
        if (n.compareAbs(2) === 0)
          return this.isEven();
        return this.mod(n).isZero();
      };
      NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
      function isBasicPrime(v) {
        var n = v.abs();
        if (n.isUnit())
          return false;
        if (n.equals(2) || n.equals(3) || n.equals(5))
          return true;
        if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5))
          return false;
        if (n.lesser(49))
          return true;
      }
      function millerRabinTest(n, a) {
        var nPrev = n.prev(), b = nPrev, r = 0, d, t, i2, x;
        while (b.isEven())
          b = b.divide(2), r++;
        next:
          for (i2 = 0; i2 < a.length; i2++) {
            if (n.lesser(a[i2]))
              continue;
            x = bigInt4(a[i2]).modPow(b, n);
            if (x.isUnit() || x.equals(nPrev))
              continue;
            for (d = r - 1; d != 0; d--) {
              x = x.square().mod(n);
              if (x.isUnit())
                return false;
              if (x.equals(nPrev))
                continue next;
            }
            return false;
          }
        return true;
      }
      BigInteger.prototype.isPrime = function(strict) {
        var isPrime = isBasicPrime(this);
        if (isPrime !== undefined2)
          return isPrime;
        var n = this.abs();
        var bits = n.bitLength();
        if (bits <= 64)
          return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
        var logN = Math.log(2) * bits.toJSNumber();
        var t = Math.ceil(strict === true ? 2 * Math.pow(logN, 2) : logN);
        for (var a = [], i2 = 0; i2 < t; i2++) {
          a.push(bigInt4(i2 + 2));
        }
        return millerRabinTest(n, a);
      };
      NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
      BigInteger.prototype.isProbablePrime = function(iterations, rng2) {
        var isPrime = isBasicPrime(this);
        if (isPrime !== undefined2)
          return isPrime;
        var n = this.abs();
        var t = iterations === undefined2 ? 5 : iterations;
        for (var a = [], i2 = 0; i2 < t; i2++) {
          a.push(bigInt4.randBetween(2, n.minus(2), rng2));
        }
        return millerRabinTest(n, a);
      };
      NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
      BigInteger.prototype.modInv = function(n) {
        var t = bigInt4.zero, newT = bigInt4.one, r = parseValue(n), newR = this.abs(), q2, lastT, lastR;
        while (!newR.isZero()) {
          q2 = r.divide(newR);
          lastT = t;
          lastR = r;
          t = newT;
          r = newR;
          newT = lastT.subtract(q2.multiply(newT));
          newR = lastR.subtract(q2.multiply(newR));
        }
        if (!r.isUnit())
          throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
        if (t.compare(0) === -1) {
          t = t.add(n);
        }
        if (this.isNegative()) {
          return t.negate();
        }
        return t;
      };
      NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
      BigInteger.prototype.next = function() {
        var value = this.value;
        if (this.sign) {
          return subtractSmall(value, 1, this.sign);
        }
        return new BigInteger(addSmall(value, 1), this.sign);
      };
      SmallInteger.prototype.next = function() {
        var value = this.value;
        if (value + 1 < MAX_INT)
          return new SmallInteger(value + 1);
        return new BigInteger(MAX_INT_ARR, false);
      };
      NativeBigInt.prototype.next = function() {
        return new NativeBigInt(this.value + BigInt(1));
      };
      BigInteger.prototype.prev = function() {
        var value = this.value;
        if (this.sign) {
          return new BigInteger(addSmall(value, 1), true);
        }
        return subtractSmall(value, 1, this.sign);
      };
      SmallInteger.prototype.prev = function() {
        var value = this.value;
        if (value - 1 > -MAX_INT)
          return new SmallInteger(value - 1);
        return new BigInteger(MAX_INT_ARR, true);
      };
      NativeBigInt.prototype.prev = function() {
        return new NativeBigInt(this.value - BigInt(1));
      };
      var powersOfTwo = [1];
      while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE)
        powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
      var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
      function shift_isSmall(n) {
        return Math.abs(n) <= BASE;
      }
      BigInteger.prototype.shiftLeft = function(v) {
        var n = parseValue(v).toJSNumber();
        if (!shift_isSmall(n)) {
          throw new Error(String(n) + " is too large for shifting.");
        }
        if (n < 0)
          return this.shiftRight(-n);
        var result = this;
        if (result.isZero())
          return result;
        while (n >= powers2Length) {
          result = result.multiply(highestPower2);
          n -= powers2Length - 1;
        }
        return result.multiply(powersOfTwo[n]);
      };
      NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
      BigInteger.prototype.shiftRight = function(v) {
        var remQuo;
        var n = parseValue(v).toJSNumber();
        if (!shift_isSmall(n)) {
          throw new Error(String(n) + " is too large for shifting.");
        }
        if (n < 0)
          return this.shiftLeft(-n);
        var result = this;
        while (n >= powers2Length) {
          if (result.isZero() || result.isNegative() && result.isUnit())
            return result;
          remQuo = divModAny(result, highestPower2);
          result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
          n -= powers2Length - 1;
        }
        remQuo = divModAny(result, powersOfTwo[n]);
        return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
      };
      NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
      function bitwise(x, y, fn2) {
        y = parseValue(y);
        var xSign = x.isNegative(), ySign = y.isNegative();
        var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y;
        var xDigit = 0, yDigit = 0;
        var xDivMod = null, yDivMod = null;
        var result = [];
        while (!xRem.isZero() || !yRem.isZero()) {
          xDivMod = divModAny(xRem, highestPower2);
          xDigit = xDivMod[1].toJSNumber();
          if (xSign) {
            xDigit = highestPower2 - 1 - xDigit;
          }
          yDivMod = divModAny(yRem, highestPower2);
          yDigit = yDivMod[1].toJSNumber();
          if (ySign) {
            yDigit = highestPower2 - 1 - yDigit;
          }
          xRem = xDivMod[0];
          yRem = yDivMod[0];
          result.push(fn2(xDigit, yDigit));
        }
        var sum = fn2(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt4(-1) : bigInt4(0);
        for (var i2 = result.length - 1; i2 >= 0; i2 -= 1) {
          sum = sum.multiply(highestPower2).add(bigInt4(result[i2]));
        }
        return sum;
      }
      BigInteger.prototype.not = function() {
        return this.negate().prev();
      };
      NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;
      BigInteger.prototype.and = function(n) {
        return bitwise(this, n, function(a, b) {
          return a & b;
        });
      };
      NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;
      BigInteger.prototype.or = function(n) {
        return bitwise(this, n, function(a, b) {
          return a | b;
        });
      };
      NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;
      BigInteger.prototype.xor = function(n) {
        return bitwise(this, n, function(a, b) {
          return a ^ b;
        });
      };
      NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;
      var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
      function roughLOB(n) {
        var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : typeof v === "bigint" ? v | BigInt(LOBMASK_I) : v[0] + v[1] * BASE | LOBMASK_BI;
        return x & -x;
      }
      function integerLogarithm(value, base) {
        if (base.compareTo(value) <= 0) {
          var tmp = integerLogarithm(value, base.square(base));
          var p = tmp.p;
          var e = tmp.e;
          var t = p.multiply(base);
          return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p, e: e * 2 };
        }
        return { p: bigInt4(1), e: 0 };
      }
      BigInteger.prototype.bitLength = function() {
        var n = this;
        if (n.compareTo(bigInt4(0)) < 0) {
          n = n.negate().subtract(bigInt4(1));
        }
        if (n.compareTo(bigInt4(0)) === 0) {
          return bigInt4(0);
        }
        return bigInt4(integerLogarithm(n, bigInt4(2)).e).add(bigInt4(1));
      };
      NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
      function max2(a, b) {
        a = parseValue(a);
        b = parseValue(b);
        return a.greater(b) ? a : b;
      }
      function min2(a, b) {
        a = parseValue(a);
        b = parseValue(b);
        return a.lesser(b) ? a : b;
      }
      function gcd(a, b) {
        a = parseValue(a).abs();
        b = parseValue(b).abs();
        if (a.equals(b))
          return a;
        if (a.isZero())
          return b;
        if (b.isZero())
          return a;
        var c = Integer[1], d, t;
        while (a.isEven() && b.isEven()) {
          d = min2(roughLOB(a), roughLOB(b));
          a = a.divide(d);
          b = b.divide(d);
          c = c.multiply(d);
        }
        while (a.isEven()) {
          a = a.divide(roughLOB(a));
        }
        do {
          while (b.isEven()) {
            b = b.divide(roughLOB(b));
          }
          if (a.greater(b)) {
            t = b;
            b = a;
            a = t;
          }
          b = b.subtract(a);
        } while (!b.isZero());
        return c.isUnit() ? a : a.multiply(c);
      }
      function lcm(a, b) {
        a = parseValue(a).abs();
        b = parseValue(b).abs();
        return a.divide(gcd(a, b)).multiply(b);
      }
      function randBetween(a, b, rng2) {
        a = parseValue(a);
        b = parseValue(b);
        var usedRNG = rng2 || Math.random;
        var low = min2(a, b), high = max2(a, b);
        var range = high.subtract(low).add(1);
        if (range.isSmall)
          return low.add(Math.floor(usedRNG() * range));
        var digits = toBase(range, BASE).value;
        var result = [], restricted = true;
        for (var i2 = 0; i2 < digits.length; i2++) {
          var top2 = restricted ? digits[i2] + (i2 + 1 < digits.length ? digits[i2 + 1] / BASE : 0) : BASE;
          var digit = truncate(usedRNG() * top2);
          result.push(digit);
          if (digit < digits[i2])
            restricted = false;
        }
        return low.add(Integer.fromArray(result, BASE, false));
      }
      var parseBase = function(text, base, alphabet, caseSensitive) {
        alphabet = alphabet || DEFAULT_ALPHABET;
        text = String(text);
        if (!caseSensitive) {
          text = text.toLowerCase();
          alphabet = alphabet.toLowerCase();
        }
        var length = text.length;
        var i2;
        var absBase = Math.abs(base);
        var alphabetValues = {};
        for (i2 = 0; i2 < alphabet.length; i2++) {
          alphabetValues[alphabet[i2]] = i2;
        }
        for (i2 = 0; i2 < length; i2++) {
          var c = text[i2];
          if (c === "-")
            continue;
          if (c in alphabetValues) {
            if (alphabetValues[c] >= absBase) {
              if (c === "1" && absBase === 1)
                continue;
              throw new Error(c + " is not a valid digit in base " + base + ".");
            }
          }
        }
        base = parseValue(base);
        var digits = [];
        var isNegative = text[0] === "-";
        for (i2 = isNegative ? 1 : 0; i2 < text.length; i2++) {
          var c = text[i2];
          if (c in alphabetValues)
            digits.push(parseValue(alphabetValues[c]));
          else if (c === "<") {
            var start2 = i2;
            do {
              i2++;
            } while (text[i2] !== ">" && i2 < text.length);
            digits.push(parseValue(text.slice(start2 + 1, i2)));
          } else
            throw new Error(c + " is not a valid character");
        }
        return parseBaseFromArray(digits, base, isNegative);
      };
      function parseBaseFromArray(digits, base, isNegative) {
        var val = Integer[0], pow = Integer[1], i2;
        for (i2 = digits.length - 1; i2 >= 0; i2--) {
          val = val.add(digits[i2].times(pow));
          pow = pow.times(base);
        }
        return isNegative ? val.negate() : val;
      }
      function stringify2(digit, alphabet) {
        alphabet = alphabet || DEFAULT_ALPHABET;
        if (digit < alphabet.length) {
          return alphabet[digit];
        }
        return "<" + digit + ">";
      }
      function toBase(n, base) {
        base = bigInt4(base);
        if (base.isZero()) {
          if (n.isZero())
            return { value: [0], isNegative: false };
          throw new Error("Cannot convert nonzero numbers to base 0.");
        }
        if (base.equals(-1)) {
          if (n.isZero())
            return { value: [0], isNegative: false };
          if (n.isNegative())
            return {
              value: [].concat.apply(
                [],
                Array.apply(null, Array(-n.toJSNumber())).map(Array.prototype.valueOf, [1, 0])
              ),
              isNegative: false
            };
          var arr = Array.apply(null, Array(n.toJSNumber() - 1)).map(Array.prototype.valueOf, [0, 1]);
          arr.unshift([1]);
          return {
            value: [].concat.apply([], arr),
            isNegative: false
          };
        }
        var neg = false;
        if (n.isNegative() && base.isPositive()) {
          neg = true;
          n = n.abs();
        }
        if (base.isUnit()) {
          if (n.isZero())
            return { value: [0], isNegative: false };
          return {
            value: Array.apply(null, Array(n.toJSNumber())).map(Number.prototype.valueOf, 1),
            isNegative: neg
          };
        }
        var out = [];
        var left2 = n, divmod;
        while (left2.isNegative() || left2.compareAbs(base) >= 0) {
          divmod = left2.divmod(base);
          left2 = divmod.quotient;
          var digit = divmod.remainder;
          if (digit.isNegative()) {
            digit = base.minus(digit).abs();
            left2 = left2.next();
          }
          out.push(digit.toJSNumber());
        }
        out.push(left2.toJSNumber());
        return { value: out.reverse(), isNegative: neg };
      }
      function toBaseString(n, base, alphabet) {
        var arr = toBase(n, base);
        return (arr.isNegative ? "-" : "") + arr.value.map(function(x) {
          return stringify2(x, alphabet);
        }).join("");
      }
      BigInteger.prototype.toArray = function(radix) {
        return toBase(this, radix);
      };
      SmallInteger.prototype.toArray = function(radix) {
        return toBase(this, radix);
      };
      NativeBigInt.prototype.toArray = function(radix) {
        return toBase(this, radix);
      };
      BigInteger.prototype.toString = function(radix, alphabet) {
        if (radix === undefined2)
          radix = 10;
        if (radix !== 10 || alphabet)
          return toBaseString(this, radix, alphabet);
        var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
        while (--l >= 0) {
          digit = String(v[l]);
          str += zeros.slice(digit.length) + digit;
        }
        var sign = this.sign ? "-" : "";
        return sign + str;
      };
      SmallInteger.prototype.toString = function(radix, alphabet) {
        if (radix === undefined2)
          radix = 10;
        if (radix != 10 || alphabet)
          return toBaseString(this, radix, alphabet);
        return String(this.value);
      };
      NativeBigInt.prototype.toString = SmallInteger.prototype.toString;
      NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() {
        return this.toString();
      };
      BigInteger.prototype.valueOf = function() {
        return parseInt(this.toString(), 10);
      };
      BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
      SmallInteger.prototype.valueOf = function() {
        return this.value;
      };
      SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
      NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function() {
        return parseInt(this.toString(), 10);
      };
      function parseStringValue(v) {
        if (isPrecise(+v)) {
          var x = +v;
          if (x === truncate(x))
            return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);
          throw new Error("Invalid integer: " + v);
        }
        var sign = v[0] === "-";
        if (sign)
          v = v.slice(1);
        var split = v.split(/e/i);
        if (split.length > 2)
          throw new Error("Invalid integer: " + split.join("e"));
        if (split.length === 2) {
          var exp = split[1];
          if (exp[0] === "+")
            exp = exp.slice(1);
          exp = +exp;
          if (exp !== truncate(exp) || !isPrecise(exp))
            throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
          var text = split[0];
          var decimalPlace = text.indexOf(".");
          if (decimalPlace >= 0) {
            exp -= text.length - decimalPlace - 1;
            text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
          }
          if (exp < 0)
            throw new Error("Cannot include negative exponent part for integers");
          text += new Array(exp + 1).join("0");
          v = text;
        }
        var isValid = /^([0-9][0-9]*)$/.test(v);
        if (!isValid)
          throw new Error("Invalid integer: " + v);
        if (supportsNativeBigInt) {
          return new NativeBigInt(BigInt(sign ? "-" + v : v));
        }
        var r = [], max3 = v.length, l = LOG_BASE, min3 = max3 - l;
        while (max3 > 0) {
          r.push(+v.slice(min3, max3));
          min3 -= l;
          if (min3 < 0)
            min3 = 0;
          max3 -= l;
        }
        trim(r);
        return new BigInteger(r, sign);
      }
      function parseNumberValue(v) {
        if (supportsNativeBigInt) {
          return new NativeBigInt(BigInt(v));
        }
        if (isPrecise(v)) {
          if (v !== truncate(v))
            throw new Error(v + " is not an integer.");
          return new SmallInteger(v);
        }
        return parseStringValue(v.toString());
      }
      function parseValue(v) {
        if (typeof v === "number") {
          return parseNumberValue(v);
        }
        if (typeof v === "string") {
          return parseStringValue(v);
        }
        if (typeof v === "bigint") {
          return new NativeBigInt(v);
        }
        return v;
      }
      for (var i = 0; i < 1e3; i++) {
        Integer[i] = parseValue(i);
        if (i > 0)
          Integer[-i] = parseValue(-i);
      }
      Integer.one = Integer[1];
      Integer.zero = Integer[0];
      Integer.minusOne = Integer[-1];
      Integer.max = max2;
      Integer.min = min2;
      Integer.gcd = gcd;
      Integer.lcm = lcm;
      Integer.isInstance = function(x) {
        return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt;
      };
      Integer.randBetween = randBetween;
      Integer.fromArray = function(digits, base, isNegative) {
        return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
      };
      return Integer;
    }();
    if (typeof module2 !== "undefined" && module2.hasOwnProperty("exports")) {
      module2.exports = bigInt4;
    }
    if (typeof define === "function" && define.amd) {
      define(function() {
        return bigInt4;
      });
    }
  }
});

// node_modules/telegram/CryptoFile.js
var require_CryptoFile = __commonJS({
  "node_modules/telegram/CryptoFile.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    var crypto3 = __importStar2(require("crypto"));
    exports2.default = crypto3;
  }
});

// node_modules/telegram/platform.js
var require_platform = __commonJS({
  "node_modules/telegram/platform.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isNode = exports2.isBrowser = exports2.isDeno = void 0;
    exports2.isDeno = "Deno" in globalThis;
    exports2.isBrowser = !exports2.isDeno && typeof window !== "undefined";
    exports2.isNode = !exports2.isBrowser;
  }
});

// node_modules/telegram/Helpers.js
var require_Helpers = __commonJS({
  "node_modules/telegram/Helpers.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod3) {
      return mod3 && mod3.__esModule ? mod3 : { "default": mod3 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2._entityType = exports2._EntityType = exports2.TotalList = exports2.crc32 = exports2.bufferXor = exports2.sleep = exports2.getRandomInt = exports2.getMinBigInt = exports2.returnBigInt = exports2.getByteArray = exports2.modExp = exports2.sha256 = exports2.sha1 = exports2.convertToLittle = exports2.generateKeyDataFromNonce = exports2.stripText = exports2.generateRandomBytes = exports2.bigIntMod = exports2.mod = exports2.generateRandomLong = exports2.readBufferFromBigInt = exports2.toSignedLittleBuffer = exports2.isArrayLike = exports2.betterConsoleLog = exports2.groupBy = exports2.escapeRegex = exports2.generateRandomBigInt = exports2.readBigIntFromBuffer = void 0;
    var big_integer_1 = __importDefault2(require_BigInteger());
    var CryptoFile_1 = __importDefault2(require_CryptoFile());
    var platform_1 = require_platform();
    function readBigIntFromBuffer(buffer, little = true, signed = false) {
      let randBuffer = Buffer.from(buffer);
      const bytesNumber = randBuffer.length;
      if (little) {
        randBuffer = randBuffer.reverse();
      }
      let bigIntVar = (0, big_integer_1.default)(randBuffer.toString("hex"), 16);
      if (signed && Math.floor(bigIntVar.toString(2).length / 8) >= bytesNumber) {
        bigIntVar = bigIntVar.subtract((0, big_integer_1.default)(2).pow((0, big_integer_1.default)(bytesNumber * 8)));
      }
      return bigIntVar;
    }
    exports2.readBigIntFromBuffer = readBigIntFromBuffer;
    function generateRandomBigInt() {
      return readBigIntFromBuffer(generateRandomBytes(8), false);
    }
    exports2.generateRandomBigInt = generateRandomBigInt;
    function escapeRegex(string) {
      return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
    }
    exports2.escapeRegex = escapeRegex;
    function groupBy(list, keyGetter) {
      const map = /* @__PURE__ */ new Map();
      list.forEach((item) => {
        const key = keyGetter(item);
        const collection = map.get(key);
        if (!collection) {
          map.set(key, [item]);
        } else {
          collection.push(item);
        }
      });
      return map;
    }
    exports2.groupBy = groupBy;
    function betterConsoleLog(object) {
      const toPrint = {};
      for (const key in object) {
        if (object.hasOwnProperty(key)) {
          if (!key.startsWith("_") && key != "originalArgs") {
            toPrint[key] = object[key];
          }
        }
      }
      return toPrint;
    }
    exports2.betterConsoleLog = betterConsoleLog;
    var isArrayLike = (x) => x && typeof x.length === "number" && typeof x !== "function" && typeof x !== "string";
    exports2.isArrayLike = isArrayLike;
    function toSignedLittleBuffer(big, number = 8) {
      const bigNumber = returnBigInt(big);
      const byteArray = [];
      for (let i = 0; i < number; i++) {
        byteArray[i] = bigNumber.shiftRight(8 * i).and(255);
      }
      return Buffer.from(byteArray);
    }
    exports2.toSignedLittleBuffer = toSignedLittleBuffer;
    function readBufferFromBigInt(bigIntVar, bytesNumber, little = true, signed = false) {
      bigIntVar = (0, big_integer_1.default)(bigIntVar);
      const bitLength = bigIntVar.bitLength().toJSNumber();
      const bytes = Math.ceil(bitLength / 8);
      if (bytesNumber < bytes) {
        throw new Error("OverflowError: int too big to convert");
      }
      if (!signed && bigIntVar.lesser((0, big_integer_1.default)(0))) {
        throw new Error("Cannot convert to unsigned");
      }
      if (signed && bigIntVar.lesser((0, big_integer_1.default)(0))) {
        bigIntVar = (0, big_integer_1.default)(2).pow((0, big_integer_1.default)(bytesNumber).multiply(8)).add(bigIntVar);
      }
      const hex = bigIntVar.toString(16).padStart(bytesNumber * 2, "0");
      let buffer = Buffer.from(hex, "hex");
      if (little) {
        buffer = buffer.reverse();
      }
      return buffer;
    }
    exports2.readBufferFromBigInt = readBufferFromBigInt;
    function generateRandomLong(signed = true) {
      return readBigIntFromBuffer(generateRandomBytes(8), true, signed);
    }
    exports2.generateRandomLong = generateRandomLong;
    function mod2(n, m) {
      return (n % m + m) % m;
    }
    exports2.mod = mod2;
    function bigIntMod(n, m) {
      return n.remainder(m).add(m).remainder(m);
    }
    exports2.bigIntMod = bigIntMod;
    function generateRandomBytes(count) {
      return Buffer.from(CryptoFile_1.default.randomBytes(count));
    }
    exports2.generateRandomBytes = generateRandomBytes;
    function stripText(text, entities) {
      if (!entities || !entities.length) {
        return text.trim();
      }
      while (text && text[text.length - 1].trim() === "") {
        const e = entities[entities.length - 1];
        if (e.offset + e.length == text.length) {
          if (e.length == 1) {
            entities.pop();
            if (!entities.length) {
              return text.trim();
            }
          } else {
            e.length -= 1;
          }
        }
        text = text.slice(0, -1);
      }
      while (text && text[0].trim() === "") {
        for (let i = 0; i < entities.length; i++) {
          const e = entities[i];
          if (e.offset != 0) {
            e.offset--;
            continue;
          }
          if (e.length == 1) {
            entities.shift();
            if (!entities.length) {
              return text.trimLeft();
            }
          } else {
            e.length -= 1;
          }
        }
        text = text.slice(1);
      }
      return text;
    }
    exports2.stripText = stripText;
    async function generateKeyDataFromNonce(serverNonceBigInt, newNonceBigInt) {
      const serverNonce = toSignedLittleBuffer(serverNonceBigInt, 16);
      const newNonce = toSignedLittleBuffer(newNonceBigInt, 32);
      const [hash1, hash22, hash3] = await Promise.all([
        sha12(Buffer.concat([newNonce, serverNonce])),
        sha12(Buffer.concat([serverNonce, newNonce])),
        sha12(Buffer.concat([newNonce, newNonce]))
      ]);
      const keyBuffer = Buffer.concat([hash1, hash22.slice(0, 12)]);
      const ivBuffer = Buffer.concat([
        hash22.slice(12, 20),
        hash3,
        newNonce.slice(0, 4)
      ]);
      return {
        key: keyBuffer,
        iv: ivBuffer
      };
    }
    exports2.generateKeyDataFromNonce = generateKeyDataFromNonce;
    function convertToLittle(buf) {
      const correct = Buffer.alloc(buf.length * 4);
      for (let i = 0; i < buf.length; i++) {
        correct.writeUInt32BE(buf[i], i * 4);
      }
      return correct;
    }
    exports2.convertToLittle = convertToLittle;
    function sha12(data) {
      const shaSum = CryptoFile_1.default.createHash("sha1");
      shaSum.update(data);
      return shaSum.digest();
    }
    exports2.sha1 = sha12;
    function sha256(data) {
      const shaSum = CryptoFile_1.default.createHash("sha256");
      shaSum.update(data);
      return shaSum.digest();
    }
    exports2.sha256 = sha256;
    function modExp(a, b, n) {
      a = a.remainder(n);
      let result = big_integer_1.default.one;
      let x = a;
      while (b.greater(big_integer_1.default.zero)) {
        const leastSignificantBit = b.remainder((0, big_integer_1.default)(2));
        b = b.divide((0, big_integer_1.default)(2));
        if (leastSignificantBit.eq(big_integer_1.default.one)) {
          result = result.multiply(x);
          result = result.remainder(n);
        }
        x = x.multiply(x);
        x = x.remainder(n);
      }
      return result;
    }
    exports2.modExp = modExp;
    function getByteArray(integer, signed = false) {
      const bits = integer.toString(2).length;
      const byteLength = Math.floor((bits + 8 - 1) / 8);
      return readBufferFromBigInt(typeof integer == "number" ? (0, big_integer_1.default)(integer) : integer, byteLength, false, signed);
    }
    exports2.getByteArray = getByteArray;
    function returnBigInt(num) {
      if (big_integer_1.default.isInstance(num)) {
        return num;
      }
      if (typeof num == "number") {
        return (0, big_integer_1.default)(num);
      }
      if (typeof num == "bigint") {
        return (0, big_integer_1.default)(num);
      }
      return (0, big_integer_1.default)(num);
    }
    exports2.returnBigInt = returnBigInt;
    function getMinBigInt(arrayOfBigInts) {
      if (arrayOfBigInts.length == 0) {
        return big_integer_1.default.zero;
      }
      if (arrayOfBigInts.length == 1) {
        return returnBigInt(arrayOfBigInts[0]);
      }
      let smallest = returnBigInt(arrayOfBigInts[0]);
      for (let i = 1; i < arrayOfBigInts.length; i++) {
        if (returnBigInt(arrayOfBigInts[i]).lesser(smallest)) {
          smallest = returnBigInt(arrayOfBigInts[i]);
        }
      }
      return smallest;
    }
    exports2.getMinBigInt = getMinBigInt;
    function getRandomInt(min2, max2) {
      min2 = Math.ceil(min2);
      max2 = Math.floor(max2);
      return Math.floor(Math.random() * (max2 - min2 + 1)) + min2;
    }
    exports2.getRandomInt = getRandomInt;
    var sleep = (ms, isUnref = false) => new Promise((resolve) => isUnref && platform_1.isNode ? setTimeout(resolve, ms).unref() : setTimeout(resolve, ms));
    exports2.sleep = sleep;
    function bufferXor(a, b) {
      const res = [];
      for (let i = 0; i < a.length; i++) {
        res.push(a[i] ^ b[i]);
      }
      return Buffer.from(res);
    }
    exports2.bufferXor = bufferXor;
    function makeCRCTable() {
      let c;
      const crcTable2 = [];
      for (let n = 0; n < 256; n++) {
        c = n;
        for (let k = 0; k < 8; k++) {
          c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
        }
        crcTable2[n] = c;
      }
      return crcTable2;
    }
    var crcTable = void 0;
    function crc32(buf) {
      if (!crcTable) {
        crcTable = makeCRCTable();
      }
      if (!Buffer.isBuffer(buf)) {
        buf = Buffer.from(buf);
      }
      let crc = -1;
      for (let index = 0; index < buf.length; index++) {
        const byte = buf[index];
        crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
      }
      return (crc ^ -1) >>> 0;
    }
    exports2.crc32 = crc32;
    var TotalList = class extends Array {
      constructor() {
        super();
        this.total = 0;
      }
    };
    exports2.TotalList = TotalList;
    exports2._EntityType = {
      USER: 0,
      CHAT: 1,
      CHANNEL: 2
    };
    Object.freeze(exports2._EntityType);
    function _entityType(entity) {
      if (typeof entity !== "object" || !("SUBCLASS_OF_ID" in entity)) {
        throw new Error(`${entity} is not a TLObject, cannot determine entity type`);
      }
      if (![
        47470215,
        3374092470,
        3865689926,
        1089602301,
        765557111,
        3316604308,
        524706233,
        3566872215
        // crc32('ChatFull')
      ].includes(entity.SUBCLASS_OF_ID)) {
        throw new Error(`${entity} does not have any entity type`);
      }
      const name = entity.className;
      if (name.includes("User")) {
        return exports2._EntityType.USER;
      } else if (name.includes("Chat")) {
        return exports2._EntityType.CHAT;
      } else if (name.includes("Channel")) {
        return exports2._EntityType.CHANNEL;
      } else if (name.includes("Self")) {
        return exports2._EntityType.USER;
      }
      throw new Error(`${entity} does not have any entity type`);
    }
    exports2._entityType = _entityType;
  }
});

// node_modules/telegram/tl/apiTl.js
var require_apiTl = __commonJS({
  "node_modules/telegram/tl/apiTl.js"(exports2, module2) {
    "use strict";
    module2.exports = `boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
true#3fedd339 = True;
vector#1cb5c415 {t:Type} # [ t ] = Vector t;
error#c4b9f9bb code:int text:string = Error;
null#56730bcc = Null;
inputPeerEmpty#7f3b18ea = InputPeer;
inputPeerSelf#7da07ec9 = InputPeer;
inputPeerChat#35a95cb9 chat_id:long = InputPeer;
inputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;
inputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;
inputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;
inputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;
inputUserEmpty#b98886cf = InputUser;
inputUserSelf#f7c1b13f = InputUser;
inputUser#f21158c6 user_id:long access_hash:long = InputUser;
inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;
inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
inputMediaEmpty#9664f57f = InputMedia;
inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaPhoto#b3ba0635 flags:# spoiler:flags.1?true id:InputPhoto ttl_seconds:flags.0?int = InputMedia;
inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;
inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true spoiler:flags.5?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaDocument#33473058 flags:# spoiler:flags.2?true id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;
inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
inputMediaPhotoExternal#e5bbfe1a flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;
inputMediaDocumentExternal#fb52dc99 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;
inputMediaGame#d33f43f3 id:InputGame = InputMedia;
inputMediaInvoice#405fef0d flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:flags.3?string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia;
inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;
inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
inputMediaDice#e66fbf7b emoticon:string = InputMedia;
inputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;
inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia;
inputMediaPaidMedia#aa661fc3 stars_amount:long extended_media:Vector<InputMedia> = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;
inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
inputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;
inputPhotoEmpty#1cd7bf0d = InputPhoto;
inputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;
inputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;
inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
inputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
inputTakeoutFileLocation#29be5899 = InputFileLocation;
inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
inputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;
inputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;
inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;
inputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;
peerUser#59511722 user_id:long = Peer;
peerChat#36c6019a chat_id:long = Peer;
peerChannel#a2a5371e channel_id:long = Peer;
storage.fileUnknown#aa963b05 = storage.FileType;
storage.filePartial#40bc6f52 = storage.FileType;
storage.fileJpeg#7efe0e = storage.FileType;
storage.fileGif#cae1aadf = storage.FileType;
storage.filePng#a4f63c0 = storage.FileType;
storage.filePdf#ae1e508d = storage.FileType;
storage.fileMp3#528a0677 = storage.FileType;
storage.fileMov#4b09ebbc = storage.FileType;
storage.fileMp4#b3cea0e4 = storage.FileType;
storage.fileWebp#1081464c = storage.FileType;
userEmpty#d3bc4b7a id:long = User;
user#215c4438 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
userStatusEmpty#9d05049 = UserStatus;
userStatusOnline#edb93949 expires:int = UserStatus;
userStatusOffline#8c703f was_online:int = UserStatus;
userStatusRecently#7b197dc8 flags:# by_me:flags.0?true = UserStatus;
userStatusLastWeek#541a1d1a flags:# by_me:flags.0?true = UserStatus;
userStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus;
chatEmpty#29562865 id:long = Chat;
chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
chatForbidden#6592a1a7 id:long title:string = Chat;
channel#aadfc8f flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int = Chat;
channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull;
channelFull#bbab348d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
chatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants;
chatParticipants#3cbc93f8 chat_id:long participants:Vector<ChatParticipant> version:int = ChatParticipants;
chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;
message#94345242 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck = Message;
messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
messageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;
messageMediaUnsupported#9f84f49e = MessageMedia;
messageMediaDocument#4cf4d72d flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_document:flags.5?Document ttl_seconds:flags.2?int = MessageMedia;
messageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true webpage:WebPage = MessageMedia;
messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
messageMediaGame#fdb19008 game:Game = MessageMedia;
messageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia;
messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;
messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
messageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia;
messageMediaGiveaway#daad85b0 flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.2?true channels:Vector<long> countries_iso2:flags.1?Vector<string> prize_description:flags.3?string quantity:int months:int until_date:int = MessageMedia;
messageMediaGiveawayResults#c6991068 flags:# only_new_subscribers:flags.0?true refunded:flags.2?true channel_id:long additional_peers_count:flags.3?int launch_msg_id:int winners_count:int unclaimed_count:int winners:Vector<long> months:int prize_description:flags.1?string until_date:int = MessageMedia;
messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
messageActionChatDeletePhoto#95e3fbef = MessageAction;
messageActionChatAddUser#15cefd00 users:Vector<long> = MessageAction;
messageActionChatDeleteUser#a43f30cc user_id:long = MessageAction;
messageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction;
messageActionChannelCreate#95d2ac92 title:string = MessageAction;
messageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction;
messageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction;
messageActionPinMessage#94bd38ed = MessageAction;
messageActionHistoryClear#9fbab604 = MessageAction;
messageActionGameScore#92a72876 game_id:long score:int = MessageAction;
messageActionPaymentSentMe#8f31b327 flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;
messageActionPaymentSent#96163f56 flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long invoice_slug:flags.0?string = MessageAction;
messageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;
messageActionScreenshotTaken#4792929b = MessageAction;
messageActionCustomAction#fae69f56 message:string = MessageAction;
messageActionBotAllowed#c516d679 flags:# attach_menu:flags.1?true from_request:flags.3?true domain:flags.0?string app:flags.2?BotApp = MessageAction;
messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction;
messageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction;
messageActionContactSignUp#f3f25f76 = MessageAction;
messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;
messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;
messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;
messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.0?long = MessageAction;
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
messageActionGiftPremium#c83d6aec flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long = MessageAction;
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;
messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction;
messageActionRequestedPeer#31518e9b button_id:int peers:Vector<Peer> = MessageAction;
messageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction;
messageActionGiftCode#678c2e09 flags:# via_giveaway:flags.0?true unclaimed:flags.2?true boost_peer:flags.1?Peer months:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long = MessageAction;
messageActionGiveawayLaunch#332ba9ed = MessageAction;
messageActionGiveawayResults#2a9fadc5 winners_count:int unclaimed_count:int = MessageAction;
messageActionBoostApply#cc02aa6d boosts:int = MessageAction;
messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction;
messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
photoEmpty#2331b22d id:long = Photo;
photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
photoSizeEmpty#e17e23c type:string = PhotoSize;
photoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;
photoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;
photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
photoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector<int> = PhotoSize;
photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
geoPointEmpty#1117dd5f = GeoPoint;
geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;
auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
auth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode;
auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;
inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
inputNotifyUsers#193b4417 = InputNotifyPeer;
inputNotifyChats#4a95e84e = InputNotifyPeer;
inputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;
inputNotifyForumTopic#5c467992 peer:InputPeer top_msg_id:int = InputNotifyPeer;
inputPeerNotifySettings#cacb6ae2 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_sound:flags.8?NotificationSound = InputPeerNotifySettings;
peerNotifySettings#99622c0c flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int ios_sound:flags.3?NotificationSound android_sound:flags.4?NotificationSound other_sound:flags.5?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_ios_sound:flags.8?NotificationSound stories_android_sound:flags.9?NotificationSound stories_other_sound:flags.10?NotificationSound = PeerNotifySettings;
peerSettings#acd66c5e flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true business_bot_paused:flags.11?true business_bot_can_reply:flags.12?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int business_bot_id:flags.13?long business_bot_manage_url:flags.13?string = PeerSettings;
wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
wallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
inputReportReasonSpam#58dbcab8 = ReportReason;
inputReportReasonViolence#1e22c78d = ReportReason;
inputReportReasonPornography#2e59d922 = ReportReason;
inputReportReasonChildAbuse#adf44ee3 = ReportReason;
inputReportReasonOther#c1e4a2b1 = ReportReason;
inputReportReasonCopyright#9b89f93a = ReportReason;
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
inputReportReasonFake#f5ddd6e7 = ReportReason;
inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
userFull#cc997720 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int = UserFull;
contact#145ade0b user_id:long mutual:Bool = Contact;
importedContact#c13e3c50 user_id:long client_id:long = ImportedContact;
contactStatus#16d9703b user_id:long status:UserStatus = ContactStatus;
contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
contacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;
contacts.importedContacts#77d01c3b imported:Vector<ImportedContact> popular_invites:Vector<PopularContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
contacts.blocked#ade1591 blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;
contacts.blockedSlice#e1664194 count:int blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;
messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesNotModified#74535f21 count:int = messages.Messages;
messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
messages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;
messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
inputMessagesFilterPhotos#9609a51c = MessagesFilter;
inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
inputMessagesFilterDocument#9eddf188 = MessagesFilter;
inputMessagesFilterUrl#7ef0dd87 = MessagesFilter;
inputMessagesFilterGif#ffc86587 = MessagesFilter;
inputMessagesFilterVoice#50f5c392 = MessagesFilter;
inputMessagesFilterMusic#3751b49e = MessagesFilter;
inputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;
inputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;
inputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;
inputMessagesFilterRoundVideo#b549da53 = MessagesFilter;
inputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;
inputMessagesFilterGeo#e7026d0d = MessagesFilter;
inputMessagesFilterContacts#e062db83 = MessagesFilter;
inputMessagesFilterPinned#1bb00451 = MessagesFilter;
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
updateMessageID#4e90bfd6 id:int random_id:long = Update;
updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;
updateChatParticipants#7761198 participants:ChatParticipants = Update;
updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update;
updateUserName#a7848924 user_id:long first_name:string last_name:string usernames:Vector<Username> = Update;
updateNewAuthorization#8951abef flags:# unconfirmed:flags.0?true hash:long date:flags.0?int device:flags.0?string location:flags.0?string = Update;
updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
updateEncryptedChatTyping#1710f156 chat_id:int = Update;
updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
updateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update;
updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;
updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
updateServiceNotification#ebe46819 flags:# popup:flags.0?true invert_media:flags.2?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;
updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
updateUserPhone#5492a13 user_id:long phone:string = Update;
updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;
updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;
updateReadMessagesContents#f8227181 flags:# messages:Vector<int> pts:int pts_count:int date:flags.0?int = Update;
updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;
updateChannel#635b4c09 channel_id:long = Update;
updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
updateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update;
updateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
updateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update;
updateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update;
updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;
updateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true emojis:flags.1?true order:Vector<long> = Update;
updateStickerSets#31c24808 flags:# masks:flags.0?true emojis:flags.1?true = Update;
updateSavedGifs#9375341e = Update;
updateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;
updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;
updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;
updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
updateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update;
updateDraftMessage#1b49ec6d flags:# peer:Peer top_msg_id:flags.0?int draft:DraftMessage = Update;
updateReadFeaturedStickers#571d2742 = Update;
updateRecentStickers#9a422c20 = Update;
updateConfig#a229dd06 = Update;
updatePtsChanged#3354678f = Update;
updateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update;
updateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;
updatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector<DialogPeer> = Update;
updateBotWebhookJSON#8317c0c3 data:DataJSON = Update;
updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;
updateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;
updateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;
updateLangPackTooLong#46560264 lang_code:string = Update;
updateLangPack#56022f4d difference:LangPackDifference = Update;
updateFavedStickers#e511996d = Update;
updateChannelReadMessagesContents#ea29055d flags:# channel_id:long top_msg_id:flags.0?int messages:Vector<int> = Update;
updateContactsReset#7084a7be = Update;
updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;
updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;
updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;
updateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;
updatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;
updatePeerLocated#b4afcfb0 peers:Vector<PeerLocated> = Update;
updateNewScheduledMessage#39a51dfb message:Message = Update;
updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
updateTheme#8216fba3 theme:Theme = Update;
updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
updateLoginToken#564fe691 = Update;
updateMessagePollVote#24f40e77 poll_id:long peer:Peer options:Vector<bytes> qts:int = Update;
updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
updateDialogFilters#3504914f = Update;
updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;
updateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update;
updateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update;
updateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update;
updatePeerBlocked#ebe07752 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer = Update;
updateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;
updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;
updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
updateChat#f89a6a4e chat_id:long = Update;
updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;
updateGroupCall#14b24500 chat_id:long call:GroupCall = Update;
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
updateChannelParticipant#985d3abb flags:# via_chatlist:flags.3?true channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
updatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector<long> = Update;
updateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update;
updateMessageReactions#5e1b3cb8 flags:# peer:Peer msg_id:int top_msg_id:flags.0?int reactions:MessageReactions = Update;
updateAttachMenuBots#17b7a20b = Update;
updateWebViewResultSent#1592b79d query_id:long = Update;
updateBotMenuButton#14b85813 bot_id:long button:BotMenuButton = Update;
updateSavedRingtones#74d8be99 = Update;
updateTranscribedAudio#84cd5a flags:# pending:flags.0?true peer:Peer msg_id:int transcription_id:long text:string = Update;
updateReadFeaturedEmojiStickers#fb4c496c = Update;
updateUserEmojiStatus#28373599 user_id:long emoji_status:EmojiStatus = Update;
updateRecentEmojiStatuses#30f443db = Update;
updateRecentReactions#6f7863f4 = Update;
updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update;
updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update;
updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;
updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;
updateUser#20529438 user_id:long = Update;
updateAutoSaveSettings#ec05b097 = Update;
updateStory#75b3b798 peer:Peer story:StoryItem = Update;
updateReadStories#f74e932b peer:Peer max_id:int = Update;
updateStoryID#1bf335b9 id:int random_id:long = Update;
updateStoriesStealthMode#2c084dc1 stealth_mode:StoriesStealthMode = Update;
updateSentStoryReaction#7d627683 peer:Peer story_id:int reaction:Reaction = Update;
updateBotChatBoost#904dd49c peer:Peer boost:Boost qts:int = Update;
updateChannelViewForumAsMessages#7b68920 channel_id:long enabled:Bool = Update;
updatePeerWallpaper#ae3f101d flags:# wallpaper_overridden:flags.1?true peer:Peer wallpaper:flags.0?WallPaper = Update;
updateBotMessageReaction#ac21d3ce peer:Peer msg_id:int date:int actor:Peer old_reactions:Vector<Reaction> new_reactions:Vector<Reaction> qts:int = Update;
updateBotMessageReactions#9cb7759 peer:Peer msg_id:int date:int reactions:Vector<ReactionCount> qts:int = Update;
updateSavedDialogPinned#aeaf9e74 flags:# pinned:flags.0?true peer:DialogPeer = Update;
updatePinnedSavedDialogs#686c85a6 flags:# order:flags.0?Vector<DialogPeer> = Update;
updateSavedReactionTags#39c67432 = Update;
updateSmsJob#f16269d4 job_id:string = Update;
updateQuickReplies#f9470ab2 quick_replies:Vector<QuickReply> = Update;
updateNewQuickReply#f53da717 quick_reply:QuickReply = Update;
updateDeleteQuickReply#53e6f1ec shortcut_id:int = Update;
updateQuickReplyMessage#3e050d0f message:Message = Update;
updateDeleteQuickReplyMessages#566fe7cd shortcut_id:int messages:Vector<int> = Update;
updateBotBusinessConnect#8ae5c97a connection:BotBusinessConnection qts:int = Update;
updateBotNewBusinessMessage#9ddb347c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;
updateBotEditBusinessMessage#7df587c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;
updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:Vector<int> qts:int = Update;
updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;
updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
updateStarsBalance#fb85198 balance:long = Update;
updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;
updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
updates.differenceTooLong#4afe8f6d pts:int = updates.Difference;
updatesTooLong#e317af7e = Updates;
updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;
dcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true this_port_only:flags.5?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;
config#cc1a241e flags:# default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true force_try_ipv6:flags.14?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int channels_read_media_period:int tmp_sessions:flags.0?int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int reactions_default:flags.15?Reaction autologin_token:flags.16?string = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
help.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;
help.noAppUpdate#c45a6536 = help.AppUpdate;
help.inviteText#18cb9f78 message:string = help.InviteText;
encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
encryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;
encryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;
encryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;
inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
encryptedFileEmpty#c21f497e = EncryptedFile;
encryptedFile#a8008cd8 id:long access_hash:long size:long dc_id:int key_fingerprint:int = EncryptedFile;
inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
inputDocumentEmpty#72f0eaae = InputDocument;
inputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;
documentEmpty#36f8c871 id:long = Document;
document#8fd4c4d8 flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:long thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
help.support#17c6b5f6 phone_number:string user:User = help.Support;
notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
notifyUsers#b4c83b4c = NotifyPeer;
notifyChats#c007cec3 = NotifyPeer;
notifyBroadcasts#d612e8ef = NotifyPeer;
notifyForumTopic#226e6308 peer:Peer top_msg_id:int = NotifyPeer;
sendMessageTypingAction#16bf744e = SendMessageAction;
sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
sendMessageRecordVideoAction#a187d66f = SendMessageAction;
sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;
sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
sendMessageChooseContactAction#628cbc6f = SendMessageAction;
sendMessageGamePlayAction#dd6a8f48 = SendMessageAction;
sendMessageRecordRoundAction#88f27fbc = SendMessageAction;
sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;
speakingInGroupCallAction#d92c2285 = SendMessageAction;
sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;
sendMessageChooseStickerAction#b05ac6b1 = SendMessageAction;
sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;
sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;
inputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;
inputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;
inputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;
inputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;
inputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;
inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;
inputPrivacyKeyVoiceMessages#aee69d68 = InputPrivacyKey;
inputPrivacyKeyAbout#3823cc40 = InputPrivacyKey;
inputPrivacyKeyBirthday#d65a11cc = InputPrivacyKey;
privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
privacyKeyChatInvite#500e6dfa = PrivacyKey;
privacyKeyPhoneCall#3d662b7b = PrivacyKey;
privacyKeyPhoneP2P#39491cc8 = PrivacyKey;
privacyKeyForwards#69ec56a3 = PrivacyKey;
privacyKeyProfilePhoto#96151fed = PrivacyKey;
privacyKeyPhoneNumber#d19ae46d = PrivacyKey;
privacyKeyAddedByPhone#42ffd42b = PrivacyKey;
privacyKeyVoiceMessages#697f414 = PrivacyKey;
privacyKeyAbout#a486b761 = PrivacyKey;
privacyKeyBirthday#2000a518 = PrivacyKey;
inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
inputPrivacyValueAllowChatParticipants#840649cf chats:Vector<long> = InputPrivacyRule;
inputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector<long> = InputPrivacyRule;
inputPrivacyValueAllowCloseFriends#2f453e49 = InputPrivacyRule;
inputPrivacyValueAllowPremium#77cdc9f1 = InputPrivacyRule;
privacyValueAllowContacts#fffe1bac = PrivacyRule;
privacyValueAllowAll#65427b82 = PrivacyRule;
privacyValueAllowUsers#b8905fb2 users:Vector<long> = PrivacyRule;
privacyValueDisallowContacts#f888fa1a = PrivacyRule;
privacyValueDisallowAll#8b73e763 = PrivacyRule;
privacyValueDisallowUsers#e4621141 users:Vector<long> = PrivacyRule;
privacyValueAllowChatParticipants#6b134e8e chats:Vector<long> = PrivacyRule;
privacyValueDisallowChatParticipants#41c87565 chats:Vector<long> = PrivacyRule;
privacyValueAllowCloseFriends#f7e8d89b = PrivacyRule;
privacyValueAllowPremium#ece9814b = PrivacyRule;
account.privacyRules#50a04e45 rules:Vector<PrivacyRule> chats:Vector<Chat> users:Vector<User> = account.PrivacyRules;
accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
documentAttributeAnimated#11b58939 = DocumentAttribute;
documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
documentAttributeVideo#d38ff1c2 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int = DocumentAttribute;
documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
documentAttributeCustomEmoji#fd149899 flags:# free:flags.0?true text_color:flags.1?true alt:string stickerset:InputStickerSet = DocumentAttribute;
messages.stickersNotModified#f1749a22 = messages.Stickers;
messages.stickers#30a6ec7e hash:long stickers:Vector<Document> = messages.Stickers;
stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
messages.allStickersNotModified#e86602c3 = messages.AllStickers;
messages.allStickers#cdbbcebb hash:long sets:Vector<StickerSet> = messages.AllStickers;
messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
webPageEmpty#211a1788 flags:# id:long url:flags.0?string = WebPage;
webPagePending#b0d13e47 flags:# id:long url:flags.0?string date:int = WebPage;
webPage#e89c45b2 flags:# has_large_media:flags.13?true id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage;
webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;
authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true unconfirmed:flags.5?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
account.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector<Authorization> = account.Authorizations;
account.password#957b50fb flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int login_email_pattern:flags.6?string = account.Password;
account.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;
account.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;
auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
chatInviteExported#ab4a819 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int title:flags.8?string = ExportedChatInvite;
chatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite;
chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
chatInvite#cde0ec40 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true verified:flags.7?true scam:flags.8?true fake:flags.9?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> color:int = ChatInvite;
chatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
inputStickerSetPremiumGifts#c88b3b02 = InputStickerSet;
inputStickerSetEmojiGenericAnimations#4c4d4ce = InputStickerSet;
inputStickerSetEmojiDefaultStatuses#29d0f5ee = InputStickerSet;
inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;
inputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;
stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;
messages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet;
messages.stickerSetNotModified#d3f924eb = messages.StickerSet;
botCommand#c27ac8c7 command:string description:string = BotCommand;
botInfo#8f300b57 flags:# user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton = BotInfo;
keyboardButton#a2fa4880 text:string = KeyboardButton;
keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;
keyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;
keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;
keyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;
keyboardButtonSwitchInline#93b9fbb5 flags:# same_peer:flags.0?true text:string query:string peer_types:flags.1?Vector<InlineQueryPeerType> = KeyboardButton;
keyboardButtonGame#50f41ccf text:string = KeyboardButton;
keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
keyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;
inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;
keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;
inputKeyboardButtonUserProfile#e988037b text:string user_id:InputUser = KeyboardButton;
keyboardButtonUserProfile#308660c1 text:string user_id:long = KeyboardButton;
keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;
keyboardButtonRequestPeer#53d7bfd8 text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;
inputKeyboardButtonRequestPeer#c9662d05 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;
replyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;
replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup;
replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;
messageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;
messageEntityMention#fa04579d offset:int length:int = MessageEntity;
messageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;
messageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;
messageEntityUrl#6ed02538 offset:int length:int = MessageEntity;
messageEntityEmail#64e475c2 offset:int length:int = MessageEntity;
messageEntityBold#bd610bc9 offset:int length:int = MessageEntity;
messageEntityItalic#826f8b60 offset:int length:int = MessageEntity;
messageEntityCode#28a20571 offset:int length:int = MessageEntity;
messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;
messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;
messageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity;
inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;
messageEntityPhone#9b69e34b offset:int length:int = MessageEntity;
messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;
messageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;
messageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;
messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;
messageEntitySpoiler#32ca960f offset:int length:int = MessageEntity;
messageEntityCustomEmoji#c8cf05f8 offset:int length:int document_id:long = MessageEntity;
messageEntityBlockquote#f1ccaaac flags:# collapsed:flags.0?true offset:int length:int = MessageEntity;
inputChannelEmpty#ee8c1e86 = InputChannel;
inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;
inputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;
contacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;
messageRange#ae30253 min_id:int max_id:int = MessageRange;
updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;
updates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;
channelParticipantSelf#35a8bfa7 flags:# via_request:flags.0?true user_id:long inviter_id:long date:int = ChannelParticipant;
channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;
channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;
channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;
channelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;
channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;
channelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;
channelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;
channelParticipantsBots#b0d1865b = ChannelParticipantsFilter;
channelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;
channelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;
channelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;
channelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;
channels.channelParticipants#9ab0feaf count:int participants:Vector<ChannelParticipant> chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipants;
channels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;
channels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipant;
help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;
messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
messages.savedGifs#84a02a0d hash:long gifs:Vector<Document> = messages.SavedGifs;
inputBotInlineMessageMediaAuto#3380c786 flags:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaWebPage#bddcc510 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true optional:flags.6?true message:string entities:flags.1?Vector<MessageEntity> url:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;
botInlineMessageMediaAuto#764cf810 flags:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaWebPage#809ad9a6 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true manual:flags.7?true safe:flags.8?true message:string entities:flags.1?Vector<MessageEntity> url:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;
botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;
messages.botResults#e021f2f6 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM switch_webview:flags.3?InlineBotWebView results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;
exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;
messageFwdHeader#4e4df4bb flags:# imported:flags.7?true saved_out:flags.11?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int saved_from_id:flags.8?Peer saved_from_name:flags.9?string saved_date:flags.10?int psa_type:flags.6?string = MessageFwdHeader;
auth.codeTypeSms#72a3158c = auth.CodeType;
auth.codeTypeCall#741cd3e3 = auth.CodeType;
auth.codeTypeFlashCall#226ccefb = auth.CodeType;
auth.codeTypeMissedCall#d61ad6ee = auth.CodeType;
auth.codeTypeFragmentSms#6ed998c = auth.CodeType;
auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;
auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;
auth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;
auth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;
auth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeType;
auth.sentCodeTypeEmailCode#f450f59b flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true email_pattern:string length:int reset_available_period:flags.3?int reset_pending_date:flags.4?int = auth.SentCodeType;
auth.sentCodeTypeSetUpEmailRequired#a5491dea flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true = auth.SentCodeType;
auth.sentCodeTypeFragmentSms#d9565c39 url:string length:int = auth.SentCodeType;
auth.sentCodeTypeFirebaseSms#9fd736 flags:# nonce:flags.0?bytes play_integrity_project_id:flags.2?long play_integrity_nonce:flags.2?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType;
auth.sentCodeTypeSmsWord#a416ac81 flags:# beginning:flags.0?string = auth.SentCodeType;
auth.sentCodeTypeSmsPhrase#b37794af flags:# beginning:flags.0?string = auth.SentCodeType;
messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;
messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;
inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
inputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID;
inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;
messages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;
topPeer#edcdc05b peer:Peer rating:double = TopPeer;
topPeerCategoryBotsPM#ab661b5b = TopPeerCategory;
topPeerCategoryBotsInline#148677e2 = TopPeerCategory;
topPeerCategoryCorrespondents#637b7ed = TopPeerCategory;
topPeerCategoryGroups#bd17a14a = TopPeerCategory;
topPeerCategoryChannels#161d9628 = TopPeerCategory;
topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;
topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;
topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;
topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;
contacts.topPeersNotModified#de266ef5 = contacts.TopPeers;
contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;
contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#2d65321f flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long = DraftMessage;
messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
messages.featuredStickers#be382906 flags:# premium:flags.0?true hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;
messages.recentStickersNotModified#b17f890 = messages.RecentStickers;
messages.recentStickers#88d37c56 hash:long packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;
messages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;
messages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;
messages.stickerSetInstallResultArchive#35e410a8 sets:Vector<StickerSetCovered> = messages.StickerSetInstallResult;
stickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;
stickerSetMultiCovered#3407e51b set:StickerSet covers:Vector<Document> = StickerSetCovered;
stickerSetFullCovered#40d13c0e set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = StickerSetCovered;
stickerSetNoCovered#77b15d1c set:StickerSet = StickerSetCovered;
maskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;
inputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;
inputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;
game#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;
inputGameID#32c3e77 id:long access_hash:long = InputGame;
inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;
highScore#73a379eb pos:int user_id:long score:int = HighScore;
messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
textEmpty#dc3d824f = RichText;
textPlain#744694e0 text:string = RichText;
textBold#6724abc4 text:RichText = RichText;
textItalic#d912a59c text:RichText = RichText;
textUnderline#c12622c4 text:RichText = RichText;
textStrike#9bf8bb95 text:RichText = RichText;
textFixed#6c3f19b9 text:RichText = RichText;
textUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;
textEmail#de5a0dd6 text:RichText email:string = RichText;
textConcat#7e6260d7 texts:Vector<RichText> = RichText;
textSubscript#ed6a8504 text:RichText = RichText;
textSuperscript#c7fb5e01 text:RichText = RichText;
textMarked#34b8621 text:RichText = RichText;
textPhone#1ccb966a text:RichText phone:string = RichText;
textImage#81ccf4f document_id:long w:int h:int = RichText;
textAnchor#35553762 text:RichText name:string = RichText;
pageBlockUnsupported#13567e8a = PageBlock;
pageBlockTitle#70abc3fd text:RichText = PageBlock;
pageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;
pageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;
pageBlockHeader#bfd064ec text:RichText = PageBlock;
pageBlockSubheader#f12bb6e1 text:RichText = PageBlock;
pageBlockParagraph#467a0766 text:RichText = PageBlock;
pageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;
pageBlockFooter#48870999 text:RichText = PageBlock;
pageBlockDivider#db20b188 = PageBlock;
pageBlockAnchor#ce0d37b0 name:string = PageBlock;
pageBlockList#e4e88011 items:Vector<PageListItem> = PageBlock;
pageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;
pageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;
pageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;
pageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;
pageBlockCover#39f23300 cover:PageBlock = PageBlock;
pageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;
pageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:PageCaption = PageBlock;
pageBlockCollage#65a0fa4d items:Vector<PageBlock> caption:PageCaption = PageBlock;
pageBlockSlideshow#31f9590 items:Vector<PageBlock> caption:PageCaption = PageBlock;
pageBlockChannel#ef1751b5 channel:Chat = PageBlock;
pageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;
pageBlockKicker#1e148390 text:RichText = PageBlock;
pageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector<PageTableRow> = PageBlock;
pageBlockOrderedList#9a8ae1e1 items:Vector<PageListOrderedItem> = PageBlock;
pageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector<PageBlock> title:RichText = PageBlock;
pageBlockRelatedArticles#16115a96 title:RichText articles:Vector<PageRelatedArticle> = PageBlock;
pageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;
phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;
phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;
phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;
phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;
dataJSON#7d748d04 data:string = DataJSON;
labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
invoice#5db95a15 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string = Invoice;
paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;
paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;
paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
webDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
webDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;
inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;
inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;
inputWebFileAudioAlbumThumbLocation#f46fe924 flags:# small:flags.2?true document:flags.0?InputDocument title:flags.1?string performer:flags.1?string = InputWebFileLocation;
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
payments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector<PaymentFormMethod> saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector<PaymentSavedCredentials> users:Vector<User> = payments.PaymentForm;
payments.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector<User> = payments.PaymentForm;
payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;
payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
payments.paymentReceiptStars#dabbf83a flags:# date:int bot_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice currency:string total_amount:long transaction_id:string users:Vector<User> = payments.PaymentReceipt;
payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;
account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
shippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;
inputStickerSetItem#32da9e9c flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords keywords:flags.1?string = InputStickerSetItem;
inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;
phoneCallEmpty#5366c915 id:long = PhoneCall;
phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCall#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int custom_parameters:flags.7?DataJSON = PhoneCall;
phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
phoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;
phoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;
phoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector<string> = PhoneCallProtocol;
phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;
upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;
upload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;
cdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;
cdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;
langPackString#cad181f6 key:string value:string = LangPackString;
langPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;
langPackStringDeleted#2979eeb2 key:string = LangPackString;
langPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;
langPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;
channelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;
channelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;
channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;
channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;
channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_chatlist:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatInvite approved_by:long = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleNoForwards#cb2ac766 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionSendMessage#278f2868 message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeAvailableReactions#be4e0ef8 prev_value:ChatReactions new_value:ChatReactions = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeUsernames#f04fb3a9 prev_value:Vector<string> new_value:Vector<string> = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleForum#2cc6383 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionCreateTopic#58707d28 topic:ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleAntiSpam#64f36dfc new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionChangePeerColor#5796e780 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeProfilePeerColor#5e477b25 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeWallpaper#31bb5d52 prev_value:WallPaper new_value:WallPaper = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_value:EmojiStatus = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;
channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true forums:flags.17?true = ChannelAdminLogEventsFilter;
popularContact#5ce14175 client_id:long importers:int = PopularContact;
messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;
messages.favedStickers#2cb51097 hash:long packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;
recentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;
recentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl;
recentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl;
recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;
recentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;
help.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;
inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;
webAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;
account.webAuthorizations#ed56c9fc authorizations:Vector<WebAuthorization> users:Vector<User> = account.WebAuthorizations;
inputMessageID#a676a322 id:int = InputMessage;
inputMessageReplyTo#bad88395 id:int = InputMessage;
inputMessagePinned#86872538 = InputMessage;
inputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;
inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;
inputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;
dialogPeer#e56dbf05 peer:Peer = DialogPeer;
dialogPeerFolder#514519e2 folder_id:int = DialogPeer;
messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;
messages.foundStickerSets#8af09dd2 hash:long sets:Vector<StickerSetCovered> = messages.FoundStickerSets;
fileHash#f39b035c offset:long limit:int hash:bytes = FileHash;
inputClientProxy#75588b3f address:string port:int = InputClientProxy;
help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;
help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;
inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;
inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;
secureFileEmpty#64199744 = SecureFile;
secureFile#7d09c27e id:long access_hash:long size:long dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;
secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
securePlainPhone#7d6099dd phone:string = SecurePlainData;
securePlainEmail#21ec5a5f email:string = SecurePlainData;
secureValueTypePersonalDetails#9d2a81e3 = SecureValueType;
secureValueTypePassport#3dac6a00 = SecureValueType;
secureValueTypeDriverLicense#6e425c4 = SecureValueType;
secureValueTypeIdentityCard#a0d0744b = SecureValueType;
secureValueTypeInternalPassport#99a48f23 = SecureValueType;
secureValueTypeAddress#cbe31e26 = SecureValueType;
secureValueTypeUtilityBill#fc36954e = SecureValueType;
secureValueTypeBankStatement#89137c0d = SecureValueType;
secureValueTypeRentalAgreement#8b883488 = SecureValueType;
secureValueTypePassportRegistration#99e3806a = SecureValueType;
secureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;
secureValueTypePhone#b320aadb = SecureValueType;
secureValueTypeEmail#8e3ca7ee = SecureValueType;
secureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector<SecureFile> files:flags.4?Vector<SecureFile> plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;
inputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector<InputSecureFile> files:flags.4?Vector<InputSecureFile> plain_data:flags.5?SecurePlainData = InputSecureValue;
secureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;
secureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;
secureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;
secureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;
secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;
secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;
secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;
secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;
secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
account.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;
help.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;
help.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = help.DeepLinkInfo;
savedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;
account.takeout#4dba4501 id:long = account.Takeout;
passwordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;
passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;
securePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;
securePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;
securePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;
secureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;
inputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;
inputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;
secureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;
secureRequiredTypeOneOf#27477b4 types:Vector<SecureRequiredType> = SecureRequiredType;
help.passportConfigNotModified#bfb9f457 = help.PassportConfig;
help.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;
inputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;
jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;
jsonNull#3f6d7b68 = JSONValue;
jsonBool#c7345e6a value:Bool = JSONValue;
jsonNumber#2be0dfa4 value:double = JSONValue;
jsonString#b71e767a value:string = JSONValue;
jsonArray#f7444763 value:Vector<JSONValue> = JSONValue;
jsonObject#99c1d49d value:Vector<JSONObjectValue> = JSONValue;
pageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;
pageTableRow#e0c0c5e5 cells:Vector<PageTableCell> = PageTableRow;
pageCaption#6f747657 text:RichText credit:RichText = PageCaption;
pageListItemText#b92fb6cd text:RichText = PageListItem;
pageListItemBlocks#25e073fc blocks:Vector<PageBlock> = PageListItem;
pageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;
pageListOrderedItemBlocks#98dd8936 num:string blocks:Vector<PageBlock> = PageListOrderedItem;
pageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;
page#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> views:flags.3?int = Page;
help.supportName#8c05f1c9 name:string = help.SupportName;
help.userInfoEmpty#f3ae2eed = help.UserInfo;
help.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:string date:int = help.UserInfo;
pollAnswer#ff16e2ca text:TextWithEntities option:bytes = PollAnswer;
poll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:TextWithEntities answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
pollResults#7adf2420 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<Peer> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
chatOnlines#f041e250 onlines:int = ChatOnlines;
statsURL#47a971e0 url:string = StatsURL;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;
inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;
inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
inputWallPaperNoFile#967a462e id:long = InputWallPaper;
account.wallPapersNotModified#1c199183 = account.WallPapers;
account.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers;
codeSettings#ad253d78 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true allow_firebase:flags.7?true unknown_number:flags.9?true logout_tokens:flags.6?Vector<bytes> token:flags.8?string app_sandbox:flags.8?Bool = CodeSettings;
wallPaperSettings#372efcd0 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int emoticon:flags.7?string = WallPaperSettings;
autoDownloadSettings#baa57628 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true stories_preload:flags.4?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int small_queue_active_operations_max:int large_queue_active_operations_max:int = AutoDownloadSettings;
account.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;
emojiKeyword#d5b3b9f9 keyword:string emoticons:Vector<string> = EmojiKeyword;
emojiKeywordDeleted#236df622 keyword:string emoticons:Vector<string> = EmojiKeyword;
emojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector<EmojiKeyword> = EmojiKeywordsDifference;
emojiURL#a575739d url:string = EmojiURL;
emojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;
folder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;
inputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;
folderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;
messages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;
urlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;
urlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;
urlAuthResultDefault#a9d6db1f = UrlAuthResult;
channelLocationEmpty#bfb5ad8b = ChannelLocation;
channelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;
peerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;
peerSelfLocated#f8ec284b expires:int = PeerLocated;
restrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;
inputTheme#3c5693e9 id:long access_hash:long = InputTheme;
inputThemeSlug#f5890df1 slug:string = InputTheme;
theme#a00e67d6 flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?Vector<ThemeSettings> emoticon:flags.6?string installs_count:flags.4?int = Theme;
account.themesNotModified#f41eb622 = account.Themes;
account.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;
auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;
account.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;
messages.inactiveChats#a927fec5 dates:Vector<int> chats:Vector<Chat> users:Vector<User> = messages.InactiveChats;
baseThemeClassic#c3a12462 = BaseTheme;
baseThemeDay#fbd81688 = BaseTheme;
baseThemeNight#b7b31ea8 = BaseTheme;
baseThemeTinted#6d5f77ee = BaseTheme;
baseThemeArctic#5b11125a = BaseTheme;
inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;
themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;
webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;
webPageAttributeStory#2e94c3e7 flags:# peer:Peer id:int story:flags.0?StoryItem = WebPageAttribute;
webPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags.1?true stickers:Vector<Document> = WebPageAttribute;
messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;
payments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData;
dialogFilter#5fb5523b flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter;
dialogFilterDefault#363293ae = DialogFilter;
dialogFilterChatlist#9fe28ea4 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter;
dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;
statsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;
statsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;
statsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;
statsGraphAsync#4a27eb2d token:string = StatsGraph;
statsGraphError#bedc9822 error:string = StatsGraph;
statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
stats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector<PostInteractionCounters> = stats.BroadcastStats;
help.promoDataEmpty#98f6ac75 expires:int = help.PromoData;
help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector<Chat> users:Vector<User> psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;
videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
videoSizeEmojiMarkup#f85c413c emoji_id:long background_colors:Vector<int> = VideoSize;
videoSizeStickerMarkup#da082fe stickerset:InputStickerSet sticker_id:long background_colors:Vector<int> = VideoSize;
statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;
statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;
statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;
stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;
globalPrivacySettings#734c4ccb flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true hide_read_marks:flags.3?true new_noncontact_peers_require_premium:flags.4?true = GlobalPrivacySettings;
help.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode;
help.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector<help.CountryCode> = help.Country;
help.countriesListNotModified#93cc1f32 = help.CountriesList;
help.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.CountriesList;
messageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;
messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;
messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
messageReplyHeader#afbc09db flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int = MessageReplyHeader;
messageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader;
messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats;
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
phone.groupParticipants#f47751b6 count:int participants:Vector<GroupCallParticipant> next_offset:string chats:Vector<Chat> users:Vector<User> version:int = phone.GroupParticipants;
inlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;
inlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;
inlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;
inlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;
inlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;
inlineQueryPeerTypeBotPM#e3b2d0c = InlineQueryPeerType;
messages.historyImport#1662af0b id:long = messages.HistoryImport;
messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;
messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;
chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_chatlist:flags.3?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;
messages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;
messages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;
messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;
messages.chatInviteImporters#81b6b00a count:int importers:Vector<ChatInviteImporter> users:Vector<User> = messages.ChatInviteImporters;
chatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites;
messages.chatAdminsWithInvites#b69b72d7 admins:Vector<ChatAdminWithInvites> users:Vector<User> = messages.ChatAdminsWithInvites;
messages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;
phone.joinAsPeers#afe5623f peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = phone.JoinAsPeers;
phone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;
groupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector<int> = GroupCallParticipantVideoSourceGroup;
groupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector<GroupCallParticipantVideoSourceGroup> audio_source:flags.1?int = GroupCallParticipantVideo;
stickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;
botCommandScopeDefault#2f6cb2ab = BotCommandScope;
botCommandScopeUsers#3c4f04d8 = BotCommandScope;
botCommandScopeChats#6fe1a881 = BotCommandScope;
botCommandScopeChatAdmins#b9aa606a = BotCommandScope;
botCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;
botCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;
botCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;
account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;
account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
sponsoredMessage#bdedf566 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;
searchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;
messages.searchResultsCalendar#147ee23c flags:# inexact:flags.0?true count:int min_date:int min_msg_id:int offset_id_offset:flags.1?int periods:Vector<SearchResultsCalendarPeriod> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SearchResultsCalendar;
searchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosition;
messages.searchResultsPositions#53b22baf count:int positions:Vector<SearchResultsPosition> = messages.SearchResultsPositions;
channels.sendAsPeers#f496b0c6 peers:Vector<SendAsPeer> chats:Vector<Chat> users:Vector<User> = channels.SendAsPeers;
users.userFull#3b6d152e full_user:UserFull chats:Vector<Chat> users:Vector<User> = users.UserFull;
messages.peerSettings#6880b94d settings:PeerSettings chats:Vector<Chat> users:Vector<User> = messages.PeerSettings;
auth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut;
reactionCount#a3d1cb80 flags:# chosen_order:flags.0?int reaction:Reaction count:int = ReactionCount;
messageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true reactions_as_tags:flags.3?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> = MessageReactions;
messages.messageReactionsList#31bd492d flags:# count:int reactions:Vector<MessagePeerReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.MessageReactionsList;
availableReaction#c077ec01 flags:# inactive:flags.0?true premium:flags.2?true reaction:string title:string static_icon:Document appear_animation:Document select_animation:Document activate_animation:Document effect_animation:Document around_animation:flags.1?Document center_icon:flags.1?Document = AvailableReaction;
messages.availableReactionsNotModified#9f071957 = messages.AvailableReactions;
messages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction> = messages.AvailableReactions;
messagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true my:flags.2?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction;
groupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;
phone.groupCallStreamChannels#d0e482b2 channels:Vector<GroupCallStreamChannel> = phone.GroupCallStreamChannels;
phone.groupCallStreamRtmpUrl#2dbf3432 url:string key:string = phone.GroupCallStreamRtmpUrl;
attachMenuBotIconColor#4576f3f0 name:string color:int = AttachMenuBotIconColor;
attachMenuBotIcon#b2a7386b flags:# name:string icon:Document colors:flags.0?Vector<AttachMenuBotIconColor> = AttachMenuBotIcon;
attachMenuBot#d90d8dfe flags:# inactive:flags.0?true has_settings:flags.1?true request_write_access:flags.2?true show_in_attach_menu:flags.3?true show_in_side_menu:flags.4?true side_menu_disclaimer_needed:flags.5?true bot_id:long short_name:string peer_types:flags.3?Vector<AttachMenuPeerType> icons:Vector<AttachMenuBotIcon> = AttachMenuBot;
attachMenuBotsNotModified#f1d88a5c = AttachMenuBots;
attachMenuBots#3c4301c0 hash:long bots:Vector<AttachMenuBot> users:Vector<User> = AttachMenuBots;
attachMenuBotsBot#93bf667f bot:AttachMenuBot users:Vector<User> = AttachMenuBotsBot;
webViewResultUrl#4d22ff98 flags:# fullsize:flags.1?true query_id:flags.0?long url:string = WebViewResult;
webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;
botMenuButtonDefault#7533a588 = BotMenuButton;
botMenuButtonCommands#4258c205 = BotMenuButton;
botMenuButton#c7b57ce6 text:string url:string = BotMenuButton;
account.savedRingtonesNotModified#fbf6e8b1 = account.SavedRingtones;
account.savedRingtones#c1e92cc5 hash:long ringtones:Vector<Document> = account.SavedRingtones;
notificationSoundDefault#97e8bebe = NotificationSound;
notificationSoundNone#6f0c34df = NotificationSound;
notificationSoundLocal#830b9ae4 title:string data:string = NotificationSound;
notificationSoundRingtone#ff6c8049 id:long = NotificationSound;
account.savedRingtone#b7263f6d = account.SavedRingtone;
account.savedRingtoneConverted#1f307eb7 document:Document = account.SavedRingtone;
attachMenuPeerTypeSameBotPM#7d6be90e = AttachMenuPeerType;
attachMenuPeerTypeBotPM#c32bfa1a = AttachMenuPeerType;
attachMenuPeerTypePM#f146d31f = AttachMenuPeerType;
attachMenuPeerTypeChat#509113f = AttachMenuPeerType;
attachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType;
inputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;
inputInvoiceSlug#c326caef slug:string = InputInvoice;
inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice;
inputInvoiceStars#1da33ad8 option:StarsTopupOption = InputInvoice;
payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
messages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = messages.TranscribedAudio;
help.premiumPromo#5334759c status_text:string status_entities:Vector<MessageEntity> video_sections:Vector<string> videos:Vector<Document> period_options:Vector<PremiumSubscriptionOption> users:Vector<User> = help.PremiumPromo;
inputStorePaymentPremiumSubscription#a6751e66 flags:# restore:flags.0?true upgrade:flags.1?true = InputStorePaymentPurpose;
inputStorePaymentGiftPremium#616f7fe8 user_id:InputUser currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentPremiumGiftCode#a3805f3f flags:# users:Vector<InputUser> boost_peer:flags.0?InputPeer currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStars#4f0ee8df flags:# stars:long currency:string amount:long = InputStorePaymentPurpose;
premiumGiftOption#74c34319 flags:# months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumGiftOption;
paymentFormMethod#88f8f21b url:string title:string = PaymentFormMethod;
emojiStatusEmpty#2de11aae = EmojiStatus;
emojiStatus#929b619d document_id:long = EmojiStatus;
emojiStatusUntil#fa30a8c7 document_id:long until:int = EmojiStatus;
account.emojiStatusesNotModified#d08ce645 = account.EmojiStatuses;
account.emojiStatuses#90c467d1 hash:long statuses:Vector<EmojiStatus> = account.EmojiStatuses;
reactionEmpty#79f5d419 = Reaction;
reactionEmoji#1b2286b8 emoticon:string = Reaction;
reactionCustomEmoji#8935fc73 document_id:long = Reaction;
chatReactionsNone#eafc32bc = ChatReactions;
chatReactionsAll#52928bca flags:# allow_custom:flags.0?true = ChatReactions;
chatReactionsSome#661d4037 reactions:Vector<Reaction> = ChatReactions;
messages.reactionsNotModified#b06fdbdf = messages.Reactions;
messages.reactions#eafdf716 hash:long reactions:Vector<Reaction> = messages.Reactions;
emailVerifyPurposeLoginSetup#4345be73 phone_number:string phone_code_hash:string = EmailVerifyPurpose;
emailVerifyPurposeLoginChange#527d22eb = EmailVerifyPurpose;
emailVerifyPurposePassport#bbf51685 = EmailVerifyPurpose;
emailVerificationCode#922e55a9 code:string = EmailVerification;
emailVerificationGoogle#db909ec2 token:string = EmailVerification;
emailVerificationApple#96d074fd token:string = EmailVerification;
account.emailVerified#2b96cd1b email:string = account.EmailVerified;
account.emailVerifiedLogin#e1bb0d61 email:string sent_code:auth.SentCode = account.EmailVerified;
premiumSubscriptionOption#5f2d1df2 flags:# current:flags.1?true can_purchase_upgrade:flags.2?true transaction:flags.3?string months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumSubscriptionOption;
sendAsPeer#b81c7034 flags:# premium_required:flags.0?true peer:Peer = SendAsPeer;
messageExtendedMediaPreview#ad628cc8 flags:# w:flags.0?int h:flags.0?int thumb:flags.1?PhotoSize video_duration:flags.2?int = MessageExtendedMedia;
messageExtendedMedia#ee479c64 media:MessageMedia = MessageExtendedMedia;
stickerKeyword#fcfeb29c document_id:long keyword:Vector<string> = StickerKeyword;
username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;
forumTopicDeleted#23f109b id:int = ForumTopic;
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
defaultHistoryTTL#43b46b20 period:int = DefaultHistoryTTL;
exportedContactToken#41bf109b url:string expires:int = ExportedContactToken;
requestPeerTypeUser#5f3b8a00 flags:# bot:flags.0?Bool premium:flags.1?Bool = RequestPeerType;
requestPeerTypeChat#c9f06e1b flags:# creator:flags.0?true bot_participant:flags.5?true has_username:flags.3?Bool forum:flags.4?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType;
requestPeerTypeBroadcast#339bef6c flags:# creator:flags.0?true has_username:flags.3?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType;
emojiListNotModified#481eadfa = EmojiList;
emojiList#7a1e11d1 hash:long document_id:Vector<long> = EmojiList;
emojiGroup#7a9abda9 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup;
emojiGroupGreeting#80d26cc7 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup;
emojiGroupPremium#93bcf34 title:string icon_emoji_id:long = EmojiGroup;
messages.emojiGroupsNotModified#6fb4ad87 = messages.EmojiGroups;
messages.emojiGroups#881fb94b hash:int groups:Vector<EmojiGroup> = messages.EmojiGroups;
textWithEntities#751f3146 text:string entities:Vector<MessageEntity> = TextWithEntities;
messages.translateResult#33db32f8 result:Vector<TextWithEntities> = messages.TranslatedText;
autoSaveSettings#c84834ce flags:# photos:flags.0?true videos:flags.1?true video_max_size:flags.2?long = AutoSaveSettings;
autoSaveException#81602d47 peer:Peer settings:AutoSaveSettings = AutoSaveException;
account.autoSaveSettings#4c3e069d users_settings:AutoSaveSettings chats_settings:AutoSaveSettings broadcasts_settings:AutoSaveSettings exceptions:Vector<AutoSaveException> chats:Vector<Chat> users:Vector<User> = account.AutoSaveSettings;
help.appConfigNotModified#7cde641d = help.AppConfig;
help.appConfig#dd18782e hash:int config:JSONValue = help.AppConfig;
inputBotAppID#a920bd7a id:long access_hash:long = InputBotApp;
inputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp;
botAppNotModified#5da674b7 = BotApp;
botApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp;
messages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true has_settings:flags.2?true app:BotApp = messages.BotApp;
inlineBotWebView#b57295d5 text:string url:string = InlineBotWebView;
readParticipantDate#4a4ff172 user_id:long date:int = ReadParticipantDate;
inputChatlistDialogFilter#f3e0da33 filter_id:int = InputChatlist;
exportedChatlistInvite#c5181ac flags:# title:string url:string peers:Vector<Peer> = ExportedChatlistInvite;
chatlists.exportedChatlistInvite#10e6e3a6 filter:DialogFilter invite:ExportedChatlistInvite = chatlists.ExportedChatlistInvite;
chatlists.exportedInvites#10ab6dc7 invites:Vector<ExportedChatlistInvite> chats:Vector<Chat> users:Vector<User> = chatlists.ExportedInvites;
chatlists.chatlistInviteAlready#fa87f659 filter_id:int missing_peers:Vector<Peer> already_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;
chatlists.chatlistInvite#1dcd839d flags:# title:string emoticon:flags.0?string peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;
chatlists.chatlistUpdates#93bd878d missing_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistUpdates;
bots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo;
messagePeerVote#b6cc2d5c peer:Peer option:bytes date:int = MessagePeerVote;
messagePeerVoteInputOption#74cda504 peer:Peer date:int = MessagePeerVote;
messagePeerVoteMultiple#4628f6e6 peer:Peer options:Vector<bytes> date:int = MessagePeerVote;
storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_count:flags.2?int reactions:flags.3?Vector<ReactionCount> reactions_count:flags.4?int recent_viewers:flags.0?Vector<long> = StoryViews;
storyItemDeleted#51e6ee4f id:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;
storyItem#79b26a24 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;
stories.allStories#6efc5e81 flags:# has_more:flags.0?true count:int state:string peer_stories:Vector<PeerStories> chats:Vector<Chat> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories;
stories.stories#63c3dd0a flags:# count:int stories:Vector<StoryItem> pinned_to_top:flags.0?Vector<int> chats:Vector<Chat> users:Vector<User> = stories.Stories;
storyView#b0bdeac5 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true user_id:long date:int reaction:flags.2?Reaction = StoryView;
storyViewPublicForward#9083670b flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true message:Message = StoryView;
storyViewPublicRepost#bd74cf49 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer story:StoryItem = StoryView;
stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count:int reactions_count:int views:Vector<StoryView> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryViewsList;
stories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;
inputReplyToMessage#22c0f6d5 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int = InputReplyTo;
inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;
exportedStoryLink#3fc9053b link:string = ExportedStoryLink;
storiesStealthMode#712e27fd flags:# active_until_date:flags.0?int cooldown_until_date:flags.1?int = StoriesStealthMode;
mediaAreaCoordinates#cfc9e002 flags:# x:double y:double w:double h:double rotation:double radius:flags.0?double = MediaAreaCoordinates;
mediaAreaVenue#be82db9c coordinates:MediaAreaCoordinates geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MediaArea;
inputMediaAreaVenue#b282217f coordinates:MediaAreaCoordinates query_id:long result_id:string = MediaArea;
mediaAreaGeoPoint#cad5452d flags:# coordinates:MediaAreaCoordinates geo:GeoPoint address:flags.0?GeoPointAddress = MediaArea;
mediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?true coordinates:MediaAreaCoordinates reaction:Reaction = MediaArea;
mediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long msg_id:int = MediaArea;
inputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea;
mediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea;
peerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;
stories.peerStories#cae68768 stories:PeerStories chats:Vector<Chat> users:Vector<User> = stories.PeerStories;
messages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User> = messages.WebPage;
premiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption;
payments.checkedGiftCode#284a1096 flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int months:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo;
payments.giveawayInfoResults#cd5570 flags:# winner:flags.0?true refunded:flags.1?true start_date:int gift_code_slug:flags.0?string finish_date:int winners_count:int activated_count:int = payments.GiveawayInfo;
prepaidGiveaway#b2539d54 id:long months:int quantity:int date:int = PrepaidGiveaway;
boost#2a1c8c71 flags:# gift:flags.1?true giveaway:flags.2?true unclaimed:flags.3?true id:string user_id:flags.0?long giveaway_msg_id:flags.2?int date:int expires:int used_gift_slug:flags.4?string multiplier:flags.5?int = Boost;
premium.boostsList#86f8613c flags:# count:int boosts:Vector<Boost> next_offset:flags.0?string users:Vector<User> = premium.BoostsList;
myBoost#c448415c flags:# slot:int peer:flags.0?Peer date:int expires:int cooldown_until_date:flags.1?int = MyBoost;
premium.myBoosts#9ae228e2 my_boosts:Vector<MyBoost> chats:Vector<Chat> users:Vector<User> = premium.MyBoosts;
premium.boostsStatus#4959427a flags:# my_boost:flags.2?true level:int current_level_boosts:int boosts:int gift_boosts:flags.4?int next_level_boosts:flags.0?int premium_audience:flags.1?StatsPercentValue boost_url:string prepaid_giveaways:flags.3?Vector<PrepaidGiveaway> my_boost_slots:flags.2?Vector<int> = premium.BoostsStatus;
storyFwdHeader#b826e150 flags:# modified:flags.3?true from:flags.0?Peer from_name:flags.1?string story_id:flags.2?int = StoryFwdHeader;
postInteractionCountersMessage#e7058e7f msg_id:int views:int forwards:int reactions:int = PostInteractionCounters;
postInteractionCountersStory#8a480e27 story_id:int views:int forwards:int reactions:int = PostInteractionCounters;
stats.storyStats#50cd067c views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.StoryStats;
publicForwardMessage#1f2bf4a message:Message = PublicForward;
publicForwardStory#edf3add0 peer:Peer story:StoryItem = PublicForward;
stats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stats.PublicForwards;
peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor;
help.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet;
help.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet;
help.peerColorOption#adec6ebe flags:# hidden:flags.0?true color_id:int colors:flags.1?help.PeerColorSet dark_colors:flags.2?help.PeerColorSet channel_min_level:flags.3?int group_min_level:flags.4?int = help.PeerColorOption;
help.peerColorsNotModified#2ba1f5ce = help.PeerColors;
help.peerColors#f8ed08 hash:int colors:Vector<help.PeerColorOption> = help.PeerColors;
storyReaction#6090d6d5 peer_id:Peer date:int reaction:Reaction = StoryReaction;
storyReactionPublicForward#bbab2643 message:Message = StoryReaction;
storyReactionPublicRepost#cfcd0f13 peer_id:Peer story:StoryItem = StoryReaction;
stories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryReactionsList;
savedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;
messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
messages.savedDialogsSlice#44ba9dd9 count:int dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
messages.savedDialogsNotModified#c01f6fe8 count:int = messages.SavedDialogs;
savedReactionTag#cb6ff828 flags:# reaction:Reaction title:flags.0?string count:int = SavedReactionTag;
messages.savedReactionTagsNotModified#889b59ef = messages.SavedReactionTags;
messages.savedReactionTags#3259950a tags:Vector<SavedReactionTag> hash:long = messages.SavedReactionTags;
outboxReadDate#3bb842ac date:int = OutboxReadDate;
smsjobs.eligibleToJoin#dc8b44cf terms_url:string monthly_sent_sms:int = smsjobs.EligibilityToJoin;
smsjobs.status#2aee9191 flags:# allow_international:flags.0?true recent_sent:int recent_since:int recent_remains:int total_sent:int total_since:int last_gift_slug:flags.1?string terms_url:string = smsjobs.Status;
smsJob#e6a1eeb8 job_id:string phone_number:string text:string = SmsJob;
businessWeeklyOpen#120b1ab9 start_minute:int end_minute:int = BusinessWeeklyOpen;
businessWorkHours#8c92b098 flags:# open_now:flags.0?true timezone_id:string weekly_open:Vector<BusinessWeeklyOpen> = BusinessWorkHours;
businessLocation#ac5c1af7 flags:# geo_point:flags.0?GeoPoint address:string = BusinessLocation;
inputBusinessRecipients#6f8b32aa flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> = InputBusinessRecipients;
businessRecipients#21108ff7 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> = BusinessRecipients;
businessAwayMessageScheduleAlways#c9b9e2b9 = BusinessAwayMessageSchedule;
businessAwayMessageScheduleOutsideWorkHours#c3f2f501 = BusinessAwayMessageSchedule;
businessAwayMessageScheduleCustom#cc4d9ecc start_date:int end_date:int = BusinessAwayMessageSchedule;
inputBusinessGreetingMessage#194cb3b shortcut_id:int recipients:InputBusinessRecipients no_activity_days:int = InputBusinessGreetingMessage;
businessGreetingMessage#e519abab shortcut_id:int recipients:BusinessRecipients no_activity_days:int = BusinessGreetingMessage;
inputBusinessAwayMessage#832175e0 flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:InputBusinessRecipients = InputBusinessAwayMessage;
businessAwayMessage#ef156a5c flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:BusinessRecipients = BusinessAwayMessage;
timezone#ff9289f5 id:string name:string utc_offset:int = Timezone;
help.timezonesListNotModified#970708cc = help.TimezonesList;
help.timezonesList#7b74ed71 timezones:Vector<Timezone> hash:int = help.TimezonesList;
quickReply#697102b shortcut_id:int shortcut:string top_message:int count:int = QuickReply;
inputQuickReplyShortcut#24596d41 shortcut:string = InputQuickReplyShortcut;
inputQuickReplyShortcutId#1190cf1 shortcut_id:int = InputQuickReplyShortcut;
messages.quickReplies#c68d6695 quick_replies:Vector<QuickReply> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.QuickReplies;
messages.quickRepliesNotModified#5f91eb5b = messages.QuickReplies;
connectedBot#bd068601 flags:# can_reply:flags.0?true bot_id:long recipients:BusinessBotRecipients = ConnectedBot;
account.connectedBots#17d7f87b connected_bots:Vector<ConnectedBot> users:Vector<User> = account.ConnectedBots;
messages.dialogFilters#2ad93719 flags:# tags_enabled:flags.0?true filters:Vector<DialogFilter> = messages.DialogFilters;
birthday#6c8e1e06 flags:# day:int month:int year:flags.0?int = Birthday;
botBusinessConnection#896433b4 flags:# can_reply:flags.0?true disabled:flags.1?true connection_id:string user_id:long dc_id:int date:int = BotBusinessConnection;
inputBusinessIntro#9c469cd flags:# title:string description:string sticker:flags.0?InputDocument = InputBusinessIntro;
businessIntro#5a0a066d flags:# title:string description:string sticker:flags.0?Document = BusinessIntro;
messages.myStickers#faff629d count:int sets:Vector<StickerSetCovered> = messages.MyStickers;
inputCollectibleUsername#e39460a9 username:string = InputCollectible;
inputCollectiblePhone#a2e214a4 phone:string = InputCollectible;
fragment.collectibleInfo#6ebdff91 purchase_date:int currency:string amount:long crypto_currency:string crypto_amount:long url:string = fragment.CollectibleInfo;
inputBusinessBotRecipients#c4e5921e flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> exclude_users:flags.6?Vector<InputUser> = InputBusinessBotRecipients;
businessBotRecipients#b88cf373 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> exclude_users:flags.6?Vector<long> = BusinessBotRecipients;
contactBirthday#1d998733 contact_id:long birthday:Birthday = ContactBirthday;
contacts.contactBirthdays#114ff30d contacts:Vector<ContactBirthday> users:Vector<User> = contacts.ContactBirthdays;
missingInvitee#628c9224 flags:# premium_would_allow_invite:flags.0?true premium_required_for_pm:flags.1?true user_id:long = MissingInvitee;
messages.invitedUsers#7f5defa6 updates:Updates missing_invitees:Vector<MissingInvitee> = messages.InvitedUsers;
inputBusinessChatLink#11679fa7 flags:# message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string = InputBusinessChatLink;
businessChatLink#b4ae666f flags:# link:string message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string views:int = BusinessChatLink;
account.businessChatLinks#ec43a2d1 links:Vector<BusinessChatLink> chats:Vector<Chat> users:Vector<User> = account.BusinessChatLinks;
account.resolvedBusinessChatLinks#9a23af21 flags:# peer:Peer message:string entities:flags.0?Vector<MessageEntity> chats:Vector<Chat> users:Vector<User> = account.ResolvedBusinessChatLinks;
requestedPeerUser#d62ff46a flags:# user_id:long first_name:flags.0?string last_name:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer;
requestedPeerChat#7307544f flags:# chat_id:long title:flags.0?string photo:flags.2?Photo = RequestedPeer;
requestedPeerChannel#8ba403e4 flags:# channel_id:long title:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer;
sponsoredMessageReportOption#430d3150 text:string option:bytes = SponsoredMessageReportOption;
channels.sponsoredMessageReportResultChooseOption#846f9e42 title:string options:Vector<SponsoredMessageReportOption> = channels.SponsoredMessageReportResult;
channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMessageReportResult;
channels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;
stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
reactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;
reactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;
reactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;
broadcastRevenueBalances#8438f1c6 current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
availableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;
messages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;
messages.availableEffects#bddb616e hash:int effects:Vector<AvailableEffect> documents:Vector<Document> = messages.AvailableEffects;
factCheck#b89bfccf flags:# need_check:flags.0?true country:flags.1?string text:flags.1?TextWithEntities hash:long = FactCheck;
starsTransactionPeerUnsupported#95f2bfe4 = StarsTransactionPeer;
starsTransactionPeerAppStore#b457b375 = StarsTransactionPeer;
starsTransactionPeerPlayMarket#7b560a0b = StarsTransactionPeer;
starsTransactionPeerPremiumBot#250dbaf8 = StarsTransactionPeer;
starsTransactionPeerFragment#e92fd902 = StarsTransactionPeer;
starsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer;
starsTransactionPeerAds#60682812 = StarsTransactionPeer;
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
starsTransaction#2db5418f flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> = StarsTransaction;
payments.starsStatus#8cf4ee60 flags:# balance:long history:Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
foundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory;
stories.foundStories#e2de7737 flags:# count:int stories:Vector<FoundStory> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stories.FoundStories;
geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:flags.1?string street:flags.2?string = GeoPointAddress;
starsRevenueStatus#79342946 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long next_withdrawal_at:flags.1?int = StarsRevenueStatus;
payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;
payments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAdsAccountUrl;
inputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;
invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X;
invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X;
invokeWithBusinessConnection#dd289f8e {X:Type} connection_id:string query:!X = X;
invokeWithGooglePlayIntegrity#1df92984 {X:Type} nonce:string token:string query:!X = X;
invokeWithApnsSecret#0dae54f8 {X:Type} nonce:string secret:string query:!X = X;
auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;
auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;
auth.signIn#8d52a951 flags:# phone_number:string phone_code_hash:string phone_code:flags.0?string email_verification:flags.1?EmailVerification = auth.Authorization;
auth.logOut#3e72ba19 = auth.LoggedOut;
auth.resetAuthorizations#9fab0d1a = Bool;
auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;
auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;
auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.PasswordInputSettings = auth.Authorization;
auth.resendCode#cae47523 flags:# phone_number:string phone_code_hash:string reason:flags.0?string = auth.SentCode;
auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
auth.checkRecoveryPassword#d36bf79 code:string = Bool;
auth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_token:string = auth.Authorization;
auth.requestFirebaseSms#8e39261e flags:# phone_number:string phone_code_hash:string safety_net_token:flags.0?string play_integrity_token:flags.2?string ios_push_secret:flags.1?string = Bool;
auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.SentCode;
auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
account.resetNotifySettings#db7e1747 = Bool;
account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;
account.updateStatus#6628562c offline:Bool = Bool;
account.getWallPapers#7967d36 hash:long = account.WallPapers;
account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;
account.checkUsername#2714d86c username:string = Bool;
account.updateUsername#3e0bdd7c username:string = User;
account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
account.deleteAccount#a2c0cf74 flags:# reason:string password:flags.0?InputCheckPasswordSRP = Bool;
account.getAccountTTL#8fc711d = AccountDaysTTL;
account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
account.sendChangePhoneCode#82574ae5 phone_number:string settings:CodeSettings = auth.SentCode;
account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
account.updateDeviceLocked#38df3532 period:int = Bool;
account.getAuthorizations#e320c158 = account.Authorizations;
account.resetAuthorization#df77f3bc hash:long = Bool;
account.getPassword#548a30f5 = account.Password;
account.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;
account.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;
account.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;
account.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;
account.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;
account.getWebAuthorizations#182e6d6f = account.WebAuthorizations;
account.resetWebAuthorization#2d01b9ef hash:long = Bool;
account.resetWebAuthorizations#682d2594 = Bool;
account.getAllSecureValues#b288bc7d = Vector<SecureValue>;
account.getSecureValue#73665bc2 types:Vector<SecureValueType> = Vector<SecureValue>;
account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = SecureValue;
account.deleteSecureValue#b880bc4b types:Vector<SecureValueType> = Bool;
account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm;
account.acceptAuthorization#f3ed4c73 bot_id:long scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;
account.verifyPhone#4dd3a7f6 phone_number:string phone_code_hash:string phone_code:string = Bool;
account.sendVerifyEmailCode#98e037bb purpose:EmailVerifyPurpose email:string = account.SentEmailCode;
account.verifyEmail#32da4cf purpose:EmailVerifyPurpose verification:EmailVerification = account.EmailVerified;
account.initTakeoutSession#8ef3eab0 flags:# contacts:flags.0?true message_users:flags.1?true message_chats:flags.2?true message_megagroups:flags.3?true message_channels:flags.4?true files:flags.5?true file_max_size:flags.5?long = account.Takeout;
account.finishTakeoutSession#1d2652ee flags:# success:flags.0?true = Bool;
account.confirmPasswordEmail#8fdf1920 code:string = Bool;
account.resendPasswordEmail#7a7f2a15 = Bool;
account.cancelPasswordEmail#c1cbd5b6 = Bool;
account.getContactSignUpNotification#9f07c728 = Bool;
account.setContactSignUpNotification#cff43f61 silent:Bool = Bool;
account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true compare_stories:flags.2?true peer:flags.0?InputNotifyPeer = Updates;
account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper;
account.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;
account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool;
account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSettings = Bool;
account.resetWallPapers#bb3b9804 = Bool;
account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings;
account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool;
account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document;
account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
account.updateTheme#2bf40ccc flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool;
account.installTheme#c727bb3b flags:# dark:flags.0?true theme:flags.1?InputTheme format:flags.2?string base_theme:flags.3?BaseTheme = Bool;
account.getTheme#3a5869ec format:string theme:InputTheme = Theme;
account.getThemes#7206e458 format:string hash:long = account.Themes;
account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;
account.getContentSettings#8b9b4dae = account.ContentSettings;
account.getMultiWallPapers#65ad71dc wallpapers:Vector<InputWallPaper> = Vector<WallPaper>;
account.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;
account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;
account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;
account.resetPassword#9308ce1b = account.ResetPasswordResult;
account.declinePasswordReset#4c9409f6 = Bool;
account.getChatThemes#d638de89 hash:long = account.Themes;
account.setAuthorizationTTL#bf899aa0 authorization_ttl_days:int = Bool;
account.changeAuthorizationSettings#40f48462 flags:# confirmed:flags.3?true hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool;
account.getSavedRingtones#e1902288 hash:long = account.SavedRingtones;
account.saveRingtone#3dea5b03 id:InputDocument unsave:Bool = account.SavedRingtone;
account.uploadRingtone#831a83a2 file:InputFile file_name:string mime_type:string = Document;
account.updateEmojiStatus#fbd3de6b emoji_status:EmojiStatus = Bool;
account.getDefaultEmojiStatuses#d6753386 hash:long = account.EmojiStatuses;
account.getRecentEmojiStatuses#f578105 hash:long = account.EmojiStatuses;
account.clearRecentEmojiStatuses#18201aae = Bool;
account.reorderUsernames#ef500eab order:Vector<string> = Bool;
account.toggleUsername#58d6b376 username:string active:Bool = Bool;
account.getDefaultProfilePhotoEmojis#e2750328 hash:long = EmojiList;
account.getDefaultGroupPhotoEmojis#915860ae hash:long = EmojiList;
account.getAutoSaveSettings#adcbbcda = account.AutoSaveSettings;
account.saveAutoSaveSettings#d69b8361 flags:# users:flags.0?true chats:flags.1?true broadcasts:flags.2?true peer:flags.3?InputPeer settings:AutoSaveSettings = Bool;
account.deleteAutoSaveExceptions#53bc0020 = Bool;
account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool;
account.updateColor#7cefa15d flags:# for_profile:flags.1?true color:flags.2?int background_emoji_id:flags.0?long = Bool;
account.getDefaultBackgroundEmojis#a60ab9ce hash:long = EmojiList;
account.getChannelDefaultEmojiStatuses#7727a7d5 hash:long = account.EmojiStatuses;
account.getChannelRestrictedStatusEmojis#35a9e0d5 hash:long = EmojiList;
account.updateBusinessWorkHours#4b00e066 flags:# business_work_hours:flags.0?BusinessWorkHours = Bool;
account.updateBusinessLocation#9e6b131a flags:# geo_point:flags.1?InputGeoPoint address:flags.0?string = Bool;
account.updateBusinessGreetingMessage#66cdafc4 flags:# message:flags.0?InputBusinessGreetingMessage = Bool;
account.updateBusinessAwayMessage#a26a7fa5 flags:# message:flags.0?InputBusinessAwayMessage = Bool;
account.updateConnectedBot#43d8521d flags:# can_reply:flags.0?true deleted:flags.1?true bot:InputUser recipients:InputBusinessBotRecipients = Updates;
account.getConnectedBots#4ea4c80f = account.ConnectedBots;
account.getBotBusinessConnection#76a86270 connection_id:string = Updates;
account.updateBusinessIntro#a614d034 flags:# intro:flags.0?InputBusinessIntro = Bool;
account.toggleConnectedBotPaused#646e1097 peer:InputPeer paused:Bool = Bool;
account.disablePeerConnectedBot#5e437ed9 peer:InputPeer = Bool;
account.updateBirthday#cc6e0c11 flags:# birthday:flags.0?Birthday = Bool;
account.createBusinessChatLink#8851e68e link:InputBusinessChatLink = BusinessChatLink;
account.editBusinessChatLink#8c3410af slug:string link:InputBusinessChatLink = BusinessChatLink;
account.deleteBusinessChatLink#60073674 slug:string = Bool;
account.getBusinessChatLinks#6f70dde1 = account.BusinessChatLinks;
account.resolveBusinessChatLink#5492e5ee slug:string = account.ResolvedBusinessChatLinks;
account.updatePersonalChannel#d94305e0 channel:InputChannel = Bool;
account.toggleSponsoredMessages#b9d9a38d enabled:Bool = Bool;
account.getReactionsNotifySettings#6dd654c = ReactionsNotifySettings;
account.setReactionsNotifySettings#316ce548 settings:ReactionsNotifySettings = ReactionsNotifySettings;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#b60f5918 id:InputUser = users.UserFull;
users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
users.getIsPremiumRequiredToContact#a622aa10 id:Vector<InputUser> = Vector<Bool>;
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
contacts.getContacts#5dd69e12 hash:long = contacts.Contacts;
contacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;
contacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates;
contacts.deleteByPhones#1013fd9e phones:Vector<string> = Bool;
contacts.block#2e2e8734 flags:# my_stories_from:flags.0?true id:InputPeer = Bool;
contacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bool;
contacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked;
contacts.search#11f812d8 q:string limit:int = contacts.Found;
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
contacts.resetSaved#879537f1 = Bool;
contacts.getSaved#82f1e39f = Vector<SavedContact>;
contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
contacts.acceptContact#f831a20f id:InputUser = Updates;
contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoPoint self_expires:flags.0?int = Updates;
contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;
contacts.exportContactToken#f8654027 = ExportedContactToken;
contacts.importContactToken#13005788 token:string = User;
contacts.editCloseFriends#ba6705f0 id:Vector<long> = Bool;
contacts.setBlocked#94c65c76 flags:# my_stories_from:flags.0?true id:Vector<InputPeer> limit:int = Bool;
contacts.getBirthdays#daeda864 = contacts.ContactBirthdays;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.search#29ee847a flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer saved_reaction:flags.3?Vector<Reaction> top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
messages.sendMessage#983f9745 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long = Updates;
messages.sendMedia#7852834e flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long = Updates;
messages.forwardMessages#d5039208 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;
messages.report#8953ab4e peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;
messages.getChats#49e9528f id:Vector<long> = messages.Chats;
messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;
messages.editChatTitle#73783ffd chat_id:long title:string = Updates;
messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;
messages.addChatUser#cbc6d107 chat_id:long user_id:InputUser fwd_limit:int = messages.InvitedUsers;
messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;
messages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers;
messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
messages.discardEncryption#f393aea0 flags:# delete_history:flags.0?true chat_id:int = Bool;
messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
messages.sendEncrypted#44fa7a15 flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool;
messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;
messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;
messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
messages.exportChatInvite#a02ce5d5 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string = ExportedChatInvite;
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
messages.importChatInvite#6c50051c hash:string = Updates;
messages.getStickerSet#c8a0ec74 stickerset:InputStickerSet hash:int = messages.StickerSet;
messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;
messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews;
messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool;
messages.migrateChat#a2875319 chat_id:long = Updates;
messages.searchGlobal#4bc6589a flags:# broadcasts_only:flags.1?true folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
messages.reorderStickerSets#78337739 flags:# masks:flags.0?true emojis:flags.1?true order:Vector<long> = Bool;
messages.getDocumentByHash#b1f2061f sha256:bytes size:long mime_type:string = Document;
messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;
messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;
messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;
messages.setInlineBotResults#bb12a419 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM switch_webview:flags.4?InlineBotWebView = Bool;
messages.sendInlineBotResult#3ebee86a flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut = Updates;
messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_media:flags.16?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool;
messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;
messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#d372c5ce flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;
messages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;
messages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers;
messages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;
messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;
messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true emojis:flags.1?true offset_id:long limit:int = messages.ArchivedStickers;
messages.getMaskStickers#640f82b8 hash:long = messages.AllStickers;
messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector<StickerSetCovered>;
messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates;
messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool;
messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;
messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores;
messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;
messages.getWebPage#8d9692a3 url:string hash:int = messages.WebPage;
messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector<InputDialogPeer> = Bool;
messages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;
messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool;
messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;
messages.uploadMedia#14967978 flags:# business_connection_id:flags.0?string peer:InputPeer media:InputMedia = MessageMedia;
messages.sendScreenshotNotification#a1405817 peer:InputPeer reply_to:InputReplyTo random_id:long = Updates;
messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers;
messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;
messages.getUnreadMentions#f107e790 flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.readMentions#36e5bf4d flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;
messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages;
messages.sendMultiMedia#37b74355 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long = Updates;
messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;
messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;
messages.getSplitRanges#1cff7e08 = Vector<MessageRange>;
messages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;
messages.getDialogUnreadMarks#22e24e22 = Vector<DialogPeer>;
messages.clearAllDrafts#7e58ee9c = Bool;
messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;
messages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;
messages.getPollResults#73bb643b peer:InputPeer msg_id:int = Updates;
messages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;
messages.editChatAbout#def60797 peer:InputPeer about:string = Bool;
messages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;
messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference;
messages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;
messages.getEmojiKeywordsLanguages#4e9963b2 lang_codes:Vector<string> = Vector<EmojiLanguage>;
messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL;
messages.getSearchCounters#1bbcf300 flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer top_msg_id:flags.0?int filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>;
messages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;
messages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;
messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;
messages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;
messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector<int> = messages.Messages;
messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;
messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;
messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;
messages.toggleStickerSets#b5052fea flags:# uninstall:flags.0?true archive:flags.1?true unarchive:flags.2?true stickersets:Vector<InputStickerSet> = Bool;
messages.getDialogFilters#efd48c89 = messages.DialogFilters;
messages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;
messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;
messages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool;
messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messages.FeaturedStickers;
messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;
messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;
messages.unpinAllMessages#ee22b9a8 flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;
messages.deleteChat#5bd0ee50 chat_id:long = Bool;
messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages;
messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImportParsed;
messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport;
messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia;
messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool;
messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;
messages.getExportedChatInvite#73746f5c peer:InputPeer link:string = messages.ExportedChatInvite;
messages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int request_needed:flags.3?Bool title:flags.4?string = messages.ExportedChatInvite;
messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;
messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;
messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites;
messages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>;
messages.getSearchResultsCalendar#6aa3f6bd flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer filter:MessagesFilter offset_id:int offset_date:int = messages.SearchResultsCalendar;
messages.getSearchResultsPositions#9c7f2f10 flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer filter:MessagesFilter offset_id:int limit:int = messages.SearchResultsPositions;
messages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates;
messages.hideAllChatJoinRequests#e085f4ea flags:# approved:flags.0?true peer:InputPeer link:flags.1?string = Updates;
messages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates;
messages.saveDefaultSendAs#ccfddf96 peer:InputPeer send_as:InputPeer = Bool;
messages.sendReaction#d30d78d4 flags:# big:flags.1?true add_to_recent:flags.2?true peer:InputPeer msg_id:int reaction:flags.0?Vector<Reaction> = Updates;
messages.getMessagesReactions#8bba90e6 peer:InputPeer id:Vector<int> = Updates;
messages.getMessageReactionsList#461b3f48 flags:# peer:InputPeer id:int reaction:flags.0?Reaction offset:flags.1?string limit:int = messages.MessageReactionsList;
messages.setChatAvailableReactions#5a150bd4 flags:# peer:InputPeer available_reactions:ChatReactions reactions_limit:flags.0?int = Updates;
messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions;
messages.setDefaultReaction#4f47a016 reaction:Reaction = Bool;
messages.translateText#63183030 flags:# peer:flags.0?InputPeer id:flags.0?Vector<int> text:flags.1?Vector<TextWithEntities> to_lang:string = messages.TranslatedText;
messages.getUnreadReactions#3223495b flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.readReactions#54aa7f8e flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;
messages.searchSentMedia#107e31a0 q:string filter:MessagesFilter limit:int = messages.Messages;
messages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots;
messages.getAttachMenuBot#77216192 bot:InputUser = AttachMenuBotsBot;
messages.toggleBotInAttachMenu#69f59d69 flags:# write_allowed:flags.0?true bot:InputUser enabled:Bool = Bool;
messages.requestWebView#269dc2c1 flags:# from_bot_menu:flags.4?true silent:flags.5?true compact:flags.7?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = WebViewResult;
messages.prolongWebView#b0d81a83 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = Bool;
messages.requestSimpleWebView#413a3e73 flags:# from_switch_webview:flags.1?true from_side_menu:flags.2?true compact:flags.7?true bot:InputUser url:flags.3?string start_param:flags.4?string theme_params:flags.0?DataJSON platform:string = WebViewResult;
messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;
messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;
messages.transcribeAudio#269e9a49 peer:InputPeer msg_id:int = messages.TranscribedAudio;
messages.rateTranscribedAudio#7f1d072f peer:InputPeer msg_id:int transcription_id:long good:Bool = Bool;
messages.getCustomEmojiDocuments#d9ab0f54 document_id:Vector<long> = Vector<Document>;
messages.getEmojiStickers#fbfca18f hash:long = messages.AllStickers;
messages.getFeaturedEmojiStickers#ecf6736 hash:long = messages.FeaturedStickers;
messages.reportReaction#3f64c076 peer:InputPeer id:int reaction_peer:InputPeer = Bool;
messages.getTopReactions#bb8125ba limit:int hash:long = messages.Reactions;
messages.getRecentReactions#39461db2 limit:int hash:long = messages.Reactions;
messages.clearRecentReactions#9dfeefb4 = Bool;
messages.getExtendedMedia#84f80814 peer:InputPeer id:Vector<int> = Updates;
messages.setDefaultHistoryTTL#9eb51445 period:int = Bool;
messages.getDefaultHistoryTTL#658b7188 = DefaultHistoryTTL;
messages.sendBotRequestedPeer#91b2d060 peer:InputPeer msg_id:int button_id:int requested_peers:Vector<InputPeer> = Updates;
messages.getEmojiGroups#7488ce5b hash:int = messages.EmojiGroups;
messages.getEmojiStatusGroups#2ecd56cd hash:int = messages.EmojiGroups;
messages.getEmojiProfilePhotoGroups#21a548f3 hash:int = messages.EmojiGroups;
messages.searchCustomEmoji#2c11c0d7 emoticon:string hash:long = EmojiList;
messages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool;
messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;
messages.requestAppWebView#53618bce flags:# write_allowed:flags.0?true compact:flags.7?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = WebViewResult;
messages.setChatWallPaper#8ffacae1 flags:# for_both:flags.3?true revert:flags.4?true peer:InputPeer wallpaper:flags.0?InputWallPaper settings:flags.2?WallPaperSettings id:flags.1?int = Updates;
messages.searchEmojiStickerSets#92b4494c flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;
messages.getSavedDialogs#5381d21a flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.SavedDialogs;
messages.getSavedHistory#3d9a414d peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.deleteSavedHistory#6e98102b flags:# peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;
messages.getPinnedSavedDialogs#d63d94e0 = messages.SavedDialogs;
messages.toggleSavedDialogPin#ac81bbde flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
messages.reorderPinnedSavedDialogs#8b716587 flags:# force:flags.0?true order:Vector<InputDialogPeer> = Bool;
messages.getSavedReactionTags#3637e05b flags:# peer:flags.0?InputPeer hash:long = messages.SavedReactionTags;
messages.updateSavedReactionTag#60297dec flags:# reaction:Reaction title:flags.0?string = Bool;
messages.getDefaultTagReactions#bdf93428 hash:long = messages.Reactions;
messages.getOutboxReadDate#8c4bfe5d peer:InputPeer msg_id:int = OutboxReadDate;
messages.getQuickReplies#d483f2a8 hash:long = messages.QuickReplies;
messages.reorderQuickReplies#60331907 order:Vector<int> = Bool;
messages.checkQuickReplyShortcut#f1d0fbd3 shortcut:string = Bool;
messages.editQuickReplyShortcut#5c003cef shortcut_id:int shortcut:string = Bool;
messages.deleteQuickReplyShortcut#3cc04740 shortcut_id:int = Bool;
messages.getQuickReplyMessages#94a495c3 flags:# shortcut_id:int id:flags.0?Vector<int> hash:long = messages.Messages;
messages.sendQuickReplyMessages#6c750de1 peer:InputPeer shortcut_id:int id:Vector<int> random_id:Vector<long> = Updates;
messages.deleteQuickReplyMessages#e105e910 shortcut_id:int id:Vector<int> = Updates;
messages.toggleDialogFilterTags#fd2dda49 enabled:Bool = Bool;
messages.getMyStickers#d0b5e1fc offset_id:long limit:int = messages.MyStickers;
messages.getEmojiStickerGroups#1dd840f5 hash:int = messages.EmojiGroups;
messages.getAvailableEffects#dea20a39 hash:int = messages.AvailableEffects;
messages.editFactCheck#589ee75 peer:InputPeer msg_id:int text:TextWithEntities = Updates;
messages.deleteFactCheck#d1da940c peer:InputPeer msg_id:int = Updates;
messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>;
updates.getState#edd4882a = updates.State;
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;
updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;
photos.updateProfilePhoto#9e82039 flags:# fallback:flags.0?true bot:flags.1?InputUser id:InputPhoto = photos.Photo;
photos.uploadProfilePhoto#388a3b5 flags:# fallback:flags.3?true bot:flags.5?InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.4?VideoSize = photos.Photo;
photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;
photos.uploadContactProfilePhoto#e14c4a71 flags:# suggest:flags.3?true save:flags.4?true user_id:InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.5?VideoSize = photos.Photo;
upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
upload.getFile#be5335be flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:long limit:int = upload.File;
upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
upload.getCdnFile#395f69da file_token:bytes offset:long limit:int = upload.CdnFile;
upload.reuploadCdnFile#9b2754a8 file_token:bytes request_token:bytes = Vector<FileHash>;
upload.getCdnFileHashes#91dc3f31 file_token:bytes offset:long = Vector<FileHash>;
upload.getFileHashes#9156982a location:InputFileLocation offset:long = Vector<FileHash>;
help.getConfig#c4f9186b = Config;
help.getNearestDc#1fb33026 = NearestDc;
help.getAppUpdate#522d5a7d source:string = help.AppUpdate;
help.getInviteText#4d392343 = help.InviteText;
help.getSupport#9cdf08cd = help.Support;
help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool;
help.getCdnConfig#52029342 = CdnConfig;
help.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls;
help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate;
help.acceptTermsOfService#ee72f79a id:DataJSON = Bool;
help.getDeepLinkInfo#3fedc75f path:string = help.DeepLinkInfo;
help.getAppConfig#61e3f854 hash:int = help.AppConfig;
help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
help.getPassportConfig#c661ad08 hash:int = help.PassportConfig;
help.getSupportName#d360e72c = help.SupportName;
help.getUserInfo#38a08d3 user_id:InputUser = help.UserInfo;
help.editUserInfo#66b91b70 user_id:InputUser message:string entities:Vector<MessageEntity> = help.UserInfo;
help.getPromoData#c0977421 = help.PromoData;
help.hidePromoData#1e251c95 peer:InputPeer = Bool;
help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool;
help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;
help.getPremiumPromo#b81b93d4 = help.PremiumPromo;
help.getPeerColors#da80f42f hash:int = help.PeerColors;
help.getPeerProfileColors#abcfa9fd hash:int = help.PeerColors;
help.getTimezonesList#49b30240 hash:int = help.TimezonesList;
channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;
channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;
channels.reportSpam#f44a8315 channel:InputChannel participant:InputPeer id:Vector<int> = Bool;
channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;
channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
channels.createChannel#91006707 flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true forum:flags.5?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string ttl_period:flags.4?int = Updates;
channels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;
channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
channels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;
channels.updateUsername#3514b3de channel:InputChannel username:string = Bool;
channels.joinChannel#24b524c5 channel:InputChannel = Updates;
channels.leaveChannel#f836aa95 channel:InputChannel = Updates;
channels.inviteToChannel#c9e33d54 channel:InputChannel users:Vector<InputUser> = messages.InvitedUsers;
channels.deleteChannel#c0111fe3 channel:InputChannel = Updates;
channels.exportMessageLink#e63fadeb flags:# grouped:flags.0?true thread:flags.1?true channel:InputChannel id:int = ExportedMessageLink;
channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;
channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true for_personal:flags.2?true = messages.Chats;
channels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;
channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults;
channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool;
channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;
channels.deleteHistory#9baa9647 flags:# for_everyone:flags.0?true channel:InputChannel max_id:int = Updates;
channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;
channels.getLeftChannels#8341ecc0 offset:int = messages.Chats;
channels.getGroupsForDiscussion#f5dad378 = messages.Chats;
channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:InputCheckPasswordSRP = Updates;
channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool;
channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates;
channels.getInactiveChannels#11e831ee = messages.InactiveChats;
channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
channels.viewSponsoredMessage#beaedb94 channel:InputChannel random_id:bytes = Bool;
channels.getSponsoredMessages#ec210fbf channel:InputChannel = messages.SponsoredMessages;
channels.getSendAs#dc770ee peer:InputPeer = channels.SendAsPeers;
channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;
channels.toggleJoinToSend#e4cb9580 channel:InputChannel enabled:Bool = Updates;
channels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates;
channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector<string> = Bool;
channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;
channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool;
channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates;
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;
channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;
channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector<int> = Updates;
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates;
channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool;
channels.updateColor#d8aa3671 flags:# for_profile:flags.1?true channel:InputChannel color:flags.2?int background_emoji_id:flags.0?long = Updates;
channels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates;
channels.getChannelRecommendations#25a71742 flags:# channel:flags.0?InputChannel = messages.Chats;
channels.updateEmojiStatus#f0d3e6a8 channel:InputChannel emoji_status:EmojiStatus = Updates;
channels.setBoostsToUnblockRestrictions#ad399cee channel:InputChannel boosts:int = Updates;
channels.setEmojiStickers#3cd930b7 channel:InputChannel stickerset:InputStickerSet = Bool;
channels.reportSponsoredMessage#af8ff6b9 channel:InputChannel random_id:bytes option:bytes = channels.SponsoredMessageReportResult;
channels.restrictSponsoredMessages#9ae91519 channel:InputChannel restricted:Bool = Updates;
channels.searchPosts#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
bots.setBotCommands#517165a scope:BotCommandScope lang_code:string commands:Vector<BotCommand> = Bool;
bots.resetBotCommands#3d8de0f9 scope:BotCommandScope lang_code:string = Bool;
bots.getBotCommands#e34c0dd6 scope:BotCommandScope lang_code:string = Vector<BotCommand>;
bots.setBotMenuButton#4504d54f user_id:InputUser button:BotMenuButton = Bool;
bots.getBotMenuButton#9c60eb28 user_id:InputUser = BotMenuButton;
bots.setBotBroadcastDefaultAdminRights#788464e1 admin_rights:ChatAdminRights = Bool;
bots.setBotGroupDefaultAdminRights#925ec9ea admin_rights:ChatAdminRights = Bool;
bots.setBotInfo#10cf3123 flags:# bot:flags.2?InputUser lang_code:string name:flags.3?string about:flags.0?string description:flags.1?string = Bool;
bots.getBotInfo#dcd914fd flags:# bot:flags.0?InputUser lang_code:string = bots.BotInfo;
bots.reorderUsernames#9709b1c2 bot:InputUser order:Vector<string> = Bool;
bots.toggleUsername#53ca973 bot:InputUser username:string active:Bool = Bool;
bots.canSendMessage#1359f4e6 bot:InputUser = Bool;
bots.allowSendMessage#f132e3ef bot:InputUser = Updates;
bots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON;
payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;
payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
payments.validateRequestedInfo#b6c8f12b flags:# save:flags.0?true invoice:InputInvoice info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
payments.sendPaymentForm#2d03522f flags:# form_id:long invoice:InputInvoice requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;
payments.getSavedInfo#227d824b = payments.SavedInfo;
payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
payments.getBankCardData#2e79d779 number:string = payments.BankCardData;
payments.exportInvoice#f91b065 invoice_media:InputMedia = payments.ExportedInvoice;
payments.assignAppStoreTransaction#80ed747d receipt:bytes purpose:InputStorePaymentPurpose = Updates;
payments.assignPlayMarketTransaction#dffd50d3 receipt:DataJSON purpose:InputStorePaymentPurpose = Updates;
payments.canPurchasePremium#9fc19eb6 purpose:InputStorePaymentPurpose = Bool;
payments.getPremiumGiftCodeOptions#2757ba54 flags:# boost_peer:flags.0?InputPeer = Vector<PremiumGiftCodeOption>;
payments.checkGiftCode#8e51b4c1 slug:string = payments.CheckedGiftCode;
payments.applyGiftCode#f6e26854 slug:string = Updates;
payments.getGiveawayInfo#f4239425 peer:InputPeer msg_id:int = payments.GiveawayInfo;
payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:InputStorePaymentPurpose = Updates;
payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#97938d5a flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.sendStarsForm#2bb731d flags:# form_id:long invoice:InputInvoice = payments.PaymentResult;
payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet;
stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet;
stickers.setStickerSetThumb#a76a5392 flags:# stickerset:InputStickerSet thumb:flags.0?InputDocument thumb_document_id:flags.1?long = messages.StickerSet;
stickers.checkShortName#284b3639 short_name:string = Bool;
stickers.suggestShortName#4dafc503 title:string = stickers.SuggestedShortName;
stickers.changeSticker#f5537ebc flags:# sticker:InputDocument emoji:flags.0?string mask_coords:flags.1?MaskCoords keywords:flags.2?string = messages.StickerSet;
stickers.renameStickerSet#124b1c00 stickerset:InputStickerSet title:string = messages.StickerSet;
stickers.deleteStickerSet#87704394 stickerset:InputStickerSet = Bool;
stickers.replaceSticker#4696459a sticker:InputDocument new_sticker:InputStickerSetItem = messages.StickerSet;
phone.getCallConfig#55451fa9 = DataJSON;
phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;
phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;
phone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;
phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;
phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;
phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates;
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;
phone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector<InputPeer> sources:Vector<int> offset:string limit:int = phone.GroupParticipants;
phone.checkGroupCall#b59cf977 call:InputGroupCall sources:Vector<int> = Vector<int>;
phone.toggleGroupCallRecord#f128c708 flags:# start:flags.0?true video:flags.2?true call:InputGroupCall title:flags.1?string video_portrait:flags.2?Bool = Updates;
phone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;
phone.editGroupCallTitle#1ca6ac0a call:InputGroupCall title:string = Updates;
phone.getGroupCallJoinAs#ef7c213a peer:InputPeer = phone.JoinAsPeers;
phone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;
phone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;
phone.startScheduledGroupCall#5680e342 call:InputGroupCall = Updates;
phone.saveDefaultGroupCallJoinAs#575e1f8c peer:InputPeer join_as:InputPeer = Bool;
phone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;
phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels;
phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool;
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
langpack.getDifference#cd984aa5 lang_pack:string lang_code:string from_version:int = LangPackDifference;
langpack.getLanguages#42c6978f lang_pack:string = Vector<LangPackLanguage>;
langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLanguage;
folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;
stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;
stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;
stats.getMessagePublicForwards#5f150144 channel:InputChannel msg_id:int offset:string limit:int = stats.PublicForwards;
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
stats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = stats.StoryStats;
stats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;
stats.getBroadcastRevenueStats#75dfb671 flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastRevenueStats;
stats.getBroadcastRevenueWithdrawalUrl#2a65ef73 channel:InputChannel password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
stats.getBroadcastRevenueTransactions#69280f channel:InputChannel offset:int limit:int = stats.BroadcastRevenueTransactions;
chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;
chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;
chatlists.editExportedInvite#653db63d flags:# chatlist:InputChatlist slug:string title:flags.1?string peers:flags.2?Vector<InputPeer> = ExportedChatlistInvite;
chatlists.getExportedInvites#ce03da83 chatlist:InputChatlist = chatlists.ExportedInvites;
chatlists.checkChatlistInvite#41c10fff slug:string = chatlists.ChatlistInvite;
chatlists.joinChatlistInvite#a6b1e39a slug:string peers:Vector<InputPeer> = Updates;
chatlists.getChatlistUpdates#89419521 chatlist:InputChatlist = chatlists.ChatlistUpdates;
chatlists.joinChatlistUpdates#e089f8f5 chatlist:InputChatlist peers:Vector<InputPeer> = Updates;
chatlists.hideChatlistUpdates#66e486fb chatlist:InputChatlist = Bool;
chatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector<Peer>;
chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer> = Updates;
stories.canSendStory#c7dfdfdd peer:InputPeer = Bool;
stories.sendStory#e4e6694b flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int = Updates;
stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;
stories.deleteStories#ae59db5f peer:InputPeer id:Vector<int> = Vector<int>;
stories.togglePinned#9a75a1ef peer:InputPeer id:Vector<int> pinned:Bool = Vector<int>;
stories.getAllStories#eeb0d625 flags:# next:flags.1?true hidden:flags.2?true state:flags.0?string = stories.AllStories;
stories.getPinnedStories#5821a5dc peer:InputPeer offset_id:int limit:int = stories.Stories;
stories.getStoriesArchive#b4352016 peer:InputPeer offset_id:int limit:int = stories.Stories;
stories.getStoriesByID#5774ca74 peer:InputPeer id:Vector<int> = stories.Stories;
stories.toggleAllStoriesHidden#7c2557c4 hidden:Bool = Bool;
stories.readStories#a556dac8 peer:InputPeer max_id:int = Vector<int>;
stories.incrementStoryViews#b2028afb peer:InputPeer id:Vector<int> = Bool;
stories.getStoryViewsList#7ed23c57 flags:# just_contacts:flags.0?true reactions_first:flags.2?true forwards_first:flags.3?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;
stories.getStoriesViews#28e16cc8 peer:InputPeer id:Vector<int> = stories.StoryViews;
stories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink;
stories.report#1923fa8c peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;
stories.activateStealthMode#57bbd166 flags:# past:flags.0?true future:flags.1?true = Updates;
stories.sendReaction#7fd736b2 flags:# add_to_recent:flags.0?true peer:InputPeer story_id:int reaction:Reaction = Updates;
stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;
stories.getAllReadPeerStories#9b5ae7f9 = Updates;
stories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;
stories.getChatsToSend#a56a8b60 = messages.Chats;
stories.togglePeerStoriesHidden#bd0415c4 peer:InputPeer hidden:Bool = Bool;
stories.getStoryReactionsList#b9b2881f flags:# forwards_first:flags.2?true peer:InputPeer id:int reaction:flags.0?Reaction offset:flags.1?string limit:int = stories.StoryReactionsList;
stories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool;
stories.searchPosts#6cea116a flags:# hashtag:flags.0?string area:flags.1?MediaArea offset:string limit:int = stories.FoundStories;
premium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList;
premium.getMyBoosts#be77b4a = premium.MyBoosts;
premium.applyBoost#6b7da746 flags:# slots:flags.0?Vector<int> peer:InputPeer = premium.MyBoosts;
premium.getBoostsStatus#42f1f61 peer:InputPeer = premium.BoostsStatus;
premium.getUserBoosts#39854d1f peer:InputPeer user_id:InputUser = premium.BoostsList;
smsjobs.isEligibleToJoin#edc39d0 = smsjobs.EligibilityToJoin;
smsjobs.join#a74ece2d = Bool;
smsjobs.leave#9898ad73 = Bool;
smsjobs.updateSettings#93fa0bf flags:# allow_international:flags.0?true = Bool;
smsjobs.getStatus#10a698e8 = smsjobs.Status;
smsjobs.getSmsJob#778d902f job_id:string = SmsJob;
smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
`;
  }
});

// node_modules/telegram/tl/schemaTl.js
var require_schemaTl = __commonJS({
  "node_modules/telegram/tl/schemaTl.js"(exports2, module2) {
    "use strict";
    module2.exports = `
resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;
p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;
p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;
p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;
p_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;
bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = BindAuthKeyInner;
server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;
dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;
dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;
destroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;
destroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;
destroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;
---functions---
req_pq#60469778 nonce:int128 = ResPQ;
req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;
req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;
set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
destroy_auth_key#d1435160 = DestroyAuthKeyRes;
---types---
msgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;
bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;
bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;
msgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;
msgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;
msgs_all_info#8cc0d131 msg_ids:Vector<long> info:string = MsgsAllInfo;
msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
msg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;
rpc_error#2144ca19 error_code:int error_message:string = RpcError;
rpc_answer_unknown#5e2ad36e = RpcDropAnswer;
rpc_answer_dropped_running#cd78e586 = RpcDropAnswer;
rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;
future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;
future_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;
pong#347773c5 msg_id:long ping_id:long = Pong;
destroy_session_ok#e22045fc session_id:long = DestroySessionRes;
destroy_session_none#62d350c9 session_id:long = DestroySessionRes;
new_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;
http_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;
ipPort#d433ad73 ipv4:int port:int = IpPort;
ipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort;
accessPointRule#4679b65f phone_prefix_rules:string dc_id:int ips:vector<IpPort> = AccessPointRule;
help.configSimple#5a592a6c date:int expires:int rules:vector<AccessPointRule> = help.ConfigSimple;
tlsClientHello blocks:vector<TlsBlock> = TlsClientHello;
tlsBlockString data:string = TlsBlock;
tlsBlockRandom length:int = TlsBlock;
tlsBlockZero length:int = TlsBlock;
tlsBlockDomain = TlsBlock;
tlsBlockGrease seed:int = TlsBlock;
tlsBlockPublicKey = TlsBlock;
tlsBlockScope entries:Vector<TlsBlock> = TlsBlock;
tlsBlockPermutation entries:Vector<Vector<TlsBlock>> = TlsBlock;
---functions---
rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer;
get_future_salts#b921bd04 num:int = FutureSalts;
ping#7abe77ec ping_id:long = Pong;
ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;
destroy_session#e7512126 session_id:long = DestroySessionRes;
`;
  }
});

// node_modules/telegram/tl/generationHelpers.js
var require_generationHelpers = __commonJS({
  "node_modules/telegram/tl/generationHelpers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.variableSnakeToCamelCase = exports2.snakeToCamelCase = exports2.CORE_TYPES = exports2.fromLine = exports2.buildArgConfig = exports2.parseTl = exports2.findAll = exports2.serializeDate = exports2.serializeBytes = void 0;
    var Helpers_1 = require_Helpers();
    var snakeToCamelCase = (name) => {
      const result = name.replace(/(?:^|_)([a-z])/g, (_, g) => g.toUpperCase());
      return result.replace(/_/g, "");
    };
    exports2.snakeToCamelCase = snakeToCamelCase;
    var variableSnakeToCamelCase = (str) => str.replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace("-", "").replace("_", ""));
    exports2.variableSnakeToCamelCase = variableSnakeToCamelCase;
    var CORE_TYPES = /* @__PURE__ */ new Set([
      3162085175,
      2574415285,
      1072550713,
      3300522427,
      1450380236
      // null#56730bcc = Null;
    ]);
    exports2.CORE_TYPES = CORE_TYPES;
    var AUTH_KEY_TYPES = /* @__PURE__ */ new Set([
      85337187,
      2211011308,
      2851430293,
      1013613780,
      1459478408,
      3504867164,
      3045658042,
      1715713620,
      3608339646,
      4110704415,
      812830625
      // gzip_packed
    ]);
    var fromLine = (line, isFunction) => {
      const match = line.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);
      if (!match) {
        throw new Error(`Cannot parse TLObject ${line}`);
      }
      const argsMatch = findAll(/({)?(\w+):([\w\d<>#.?!]+)}?/, line);
      const currentConfig = {
        name: match[1],
        constructorId: parseInt(match[2], 16),
        argsConfig: {},
        subclassOfId: (0, Helpers_1.crc32)(match[3]),
        result: match[3],
        isFunction,
        namespace: void 0
      };
      if (!currentConfig.constructorId) {
        const hexId = "";
        let args;
        if (Object.values(currentConfig.argsConfig).length) {
          args = ` ${Object.keys(currentConfig.argsConfig).map((arg) => arg.toString()).join(" ")}`;
        } else {
          args = "";
        }
        const representation = `${currentConfig.name}${hexId}${args} = ${currentConfig.result}`.replace(/(:|\?)bytes /g, "$1string ").replace(/</g, " ").replace(/>|{|}/g, "").replace(/ \w+:flags(\d+)?\.\d+\?true/g, "");
        if (currentConfig.name === "inputMediaInvoice") {
          if (currentConfig.name === "inputMediaInvoice") {
          }
        }
        currentConfig.constructorId = (0, Helpers_1.crc32)(Buffer.from(representation, "utf8"));
      }
      for (const [brace, name, argType] of argsMatch) {
        if (brace === void 0) {
          currentConfig.argsConfig[variableSnakeToCamelCase(name)] = buildArgConfig(name, argType);
        }
      }
      if (currentConfig.name.includes(".")) {
        [currentConfig.namespace, currentConfig.name] = currentConfig.name.split(/\.(.+)/);
      }
      currentConfig.name = snakeToCamelCase(currentConfig.name);
      return currentConfig;
    };
    exports2.fromLine = fromLine;
    function buildArgConfig(name, argType) {
      name = name === "self" ? "is_self" : name;
      const currentConfig = {
        isVector: false,
        isFlag: false,
        skipConstructorId: false,
        flagName: null,
        flagIndex: -1,
        flagIndicator: true,
        type: null,
        useVectorId: null
      };
      const canBeInferred = name === "random_id";
      if (argType !== "#") {
        currentConfig.flagIndicator = false;
        currentConfig.type = argType.replace(/^!+/, "");
        const flagMatch = currentConfig.type.match(/(flags(?:\d+)?).(\d+)\?([\w<>.]+)/);
        if (flagMatch) {
          currentConfig.isFlag = true;
          currentConfig.flagName = flagMatch[1];
          currentConfig.flagIndex = Number(flagMatch[2]);
          currentConfig.type = flagMatch[3];
        }
        const vectorMatch = currentConfig.type.match(/[Vv]ector<([\w\d.]+)>/);
        if (vectorMatch) {
          currentConfig.isVector = true;
          currentConfig.useVectorId = currentConfig.type.charAt(0) === "V";
          [, currentConfig.type] = vectorMatch;
        }
        if (/^[a-z]$/.test(currentConfig.type.split(".").pop().charAt(0))) {
          currentConfig.skipConstructorId = true;
        }
      }
      if (currentConfig.type == "future_salt") {
        currentConfig.type = "FutureSalt";
      }
      return currentConfig;
    }
    exports2.buildArgConfig = buildArgConfig;
    var parseTl = function* (content, layer, methods = [], ignoreIds = CORE_TYPES) {
      const methodInfo = (methods || []).reduce((o, m) => Object.assign(Object.assign({}, o), { [m.name]: m }), {});
      const objAll = [];
      const objByName = {};
      const objByType = {};
      const file = content;
      let isFunction = false;
      for (let line of file.split("\n")) {
        const commentIndex = line.indexOf("//");
        if (commentIndex !== -1) {
          line = line.slice(0, commentIndex);
        }
        line = line.trim();
        if (!line) {
          continue;
        }
        const match = line.match(/---(\w+)---/);
        if (match) {
          const [, followingTypes] = match;
          isFunction = followingTypes === "functions";
          continue;
        }
        try {
          const result = fromLine(line, isFunction);
          if (ignoreIds.has(result.constructorId)) {
            continue;
          }
          objAll.push(result);
          if (!result.isFunction) {
            if (!objByType[result.result]) {
              objByType[result.result] = [];
            }
            objByName[result.name] = result;
            objByType[result.result].push(result);
          }
        } catch (e) {
          if (!e.toString().includes("vector#1cb5c415")) {
            throw e;
          }
        }
      }
      for (const obj2 of objAll) {
        if (AUTH_KEY_TYPES.has(obj2.constructorId)) {
          for (const arg in obj2.argsConfig) {
            if (obj2.argsConfig[arg].type === "string") {
              obj2.argsConfig[arg].type = "bytes";
            }
          }
        }
      }
      for (const obj2 of objAll) {
        yield obj2;
      }
    };
    exports2.parseTl = parseTl;
    var findAll = (regex, str, matches = []) => {
      if (!regex.flags.includes("g")) {
        regex = new RegExp(regex.source, "g");
      }
      const res = regex.exec(str);
      if (res) {
        matches.push(res.slice(1));
        findAll(regex, str, matches);
      }
      return matches;
    };
    exports2.findAll = findAll;
    function serializeBytes(data) {
      if (!(data instanceof Buffer)) {
        if (typeof data == "string") {
          data = Buffer.from(data);
        } else {
          throw Error(`Bytes or str expected, not ${data.constructor.name}`);
        }
      }
      const r = [];
      let padding;
      if (data.length < 254) {
        padding = (data.length + 1) % 4;
        if (padding !== 0) {
          padding = 4 - padding;
        }
        r.push(Buffer.from([data.length]));
        r.push(data);
      } else {
        padding = data.length % 4;
        if (padding !== 0) {
          padding = 4 - padding;
        }
        r.push(Buffer.from([
          254,
          data.length % 256,
          (data.length >> 8) % 256,
          (data.length >> 16) % 256
        ]));
        r.push(data);
      }
      r.push(Buffer.alloc(padding).fill(0));
      return Buffer.concat(r);
    }
    exports2.serializeBytes = serializeBytes;
    function serializeDate(dt) {
      if (!dt) {
        return Buffer.alloc(4).fill(0);
      }
      if (dt instanceof Date) {
        dt = Math.floor((Date.now() - dt.getTime()) / 1e3);
      }
      if (typeof dt == "number") {
        const t = Buffer.alloc(4);
        t.writeInt32LE(dt, 0);
        return t;
      }
      throw Error(`Cannot interpret "${dt}" as a date`);
    }
    exports2.serializeDate = serializeDate;
  }
});

// node_modules/telegram/tl/api.js
var require_api = __commonJS({
  "node_modules/telegram/tl/api.js"(exports2, module2) {
    "use strict";
    var { inspect } = require_inspect();
    var bigInt4 = require_BigInteger();
    var { generateRandomBytes, readBigIntFromBuffer, isArrayLike, betterConsoleLog } = require_Helpers();
    var tlContent = require_apiTl();
    var schemeContent = require_schemaTl();
    function generateRandomBigInt() {
      return readBigIntFromBuffer(generateRandomBytes(8), false, true);
    }
    var { parseTl, serializeBytes, serializeDate } = require_generationHelpers();
    var { toSignedLittleBuffer } = require_Helpers();
    var NAMED_AUTO_CASTS = /* @__PURE__ */ new Set(["chatId,int"]);
    var AUTO_CASTS = /* @__PURE__ */ new Set([
      "InputPeer",
      "InputChannel",
      "InputUser",
      "InputDialogPeer",
      "InputNotifyPeer",
      "InputMedia",
      "InputPhoto",
      "InputMessage",
      "InputDocument",
      "InputChatPhoto"
    ]);
    var CastError = class extends Error {
      constructor(objectName, expected, actual, ...params) {
        const message = "Found wrong type for " + objectName + ". expected " + expected + " but received " + actual + ".If you think this is a mistake please report it.";
        super(message, ...params);
        if (Error.captureStackTrace) {
          Error.captureStackTrace(this, CastError);
        }
        this.name = "CastError";
      }
    };
    var CACHING_SUPPORTED = typeof self !== "undefined" && self.localStorage !== void 0;
    var CACHE_KEY = "GramJs:apiCache";
    function buildApiFromTlSchema() {
      let definitions;
      const fromCache = CACHING_SUPPORTED && loadFromCache();
      if (fromCache) {
        definitions = fromCache;
      } else {
        definitions = loadFromTlSchemas();
        if (CACHING_SUPPORTED) {
          localStorage.setItem(CACHE_KEY, JSON.stringify(definitions));
        }
      }
      return createClasses("all", definitions);
    }
    function loadFromCache() {
      const jsonCache = localStorage.getItem(CACHE_KEY);
      return jsonCache && JSON.parse(jsonCache);
    }
    function loadFromTlSchemas() {
      const [constructorParamsApi, functionParamsApi] = extractParams(tlContent);
      const [constructorParamsSchema, functionParamsSchema] = extractParams(schemeContent);
      const constructors = [].concat(constructorParamsApi, constructorParamsSchema);
      const requests = [].concat(functionParamsApi, functionParamsSchema);
      return [].concat(constructors, requests);
    }
    function extractParams(fileContent) {
      const f2 = parseTl(fileContent, 109);
      const constructors = [];
      const functions = [];
      for (const d of f2) {
        d.isFunction ? functions.push(d) : constructors.push(d);
      }
      return [constructors, functions];
    }
    function argToBytes(x, type, argName, requestName) {
      switch (type) {
        case "int":
          const i = Buffer.alloc(4);
          i.writeInt32LE(x, 0);
          return i;
        case "long":
          return toSignedLittleBuffer(x, 8);
        case "int128":
          return toSignedLittleBuffer(x, 16);
        case "int256":
          return toSignedLittleBuffer(x, 32);
        case "double":
          const d = Buffer.alloc(8);
          d.writeDoubleLE(x, 0);
          return d;
        case "string":
          return serializeBytes(x);
        case "Bool":
          return x ? Buffer.from("b5757299", "hex") : Buffer.from("379779bc", "hex");
        case "true":
          return Buffer.alloc(0);
        case "bytes":
          return serializeBytes(x);
        case "date":
          return serializeDate(x);
        default:
          if (x === void 0 || typeof x.getBytes !== "function") {
            throw new Error(`Required object ${argName} of ${requestName} is undefined`);
          }
          return x.getBytes();
      }
    }
    async function getInputFromResolve(utils, client2, peer, peerType) {
      switch (peerType) {
        case "InputPeer":
          return utils.getInputPeer(await client2.getInputEntity(peer));
        case "InputChannel":
          return utils.getInputChannel(await client2.getInputEntity(peer));
        case "InputUser":
          return utils.getInputUser(await client2.getInputEntity(peer));
        case "InputDialogPeer":
          return await client2._getInputDialog(peer);
        case "InputNotifyPeer":
          return await client2._getInputNotify(peer);
        case "InputMedia":
          return utils.getInputMedia(peer);
        case "InputPhoto":
          return utils.getInputPhoto(peer);
        case "InputMessage":
          return utils.getInputMessage(peer);
        case "InputDocument":
          return utils.getInputDocument(peer);
        case "InputChatPhoto":
          return utils.getInputChatPhoto(peer);
        case "chatId,int":
          return await client2.getPeerId(peer, false);
        default:
          throw new Error("unsupported peer type : " + peerType);
      }
    }
    function getArgFromReader(reader, arg) {
      if (arg.isVector) {
        if (arg.useVectorId) {
          reader.readInt();
        }
        const temp = [];
        const len = reader.readInt();
        arg.isVector = false;
        for (let i = 0; i < len; i++) {
          temp.push(getArgFromReader(reader, arg));
        }
        arg.isVector = true;
        return temp;
      } else if (arg.flagIndicator) {
        return reader.readInt();
      } else {
        switch (arg.type) {
          case "int":
            return reader.readInt();
          case "long":
            return reader.readLong();
          case "int128":
            return reader.readLargeInt(128);
          case "int256":
            return reader.readLargeInt(256);
          case "double":
            return reader.readDouble();
          case "string":
            return reader.tgReadString();
          case "Bool":
            return reader.tgReadBool();
          case "true":
            return true;
          case "bytes":
            return reader.tgReadBytes();
          case "date":
            return reader.tgReadDate();
          default:
            if (!arg.skipConstructorId) {
              return reader.tgReadObject();
            } else {
              return api.constructors[arg.type].fromReader(reader);
            }
        }
      }
    }
    function compareType(value, type) {
      let correct = true;
      switch (type) {
        case "number":
          correct = typeof value === "number" || value === void 0;
          break;
        case "string":
        case "boolean":
          correct = typeof value === type;
          break;
        case "bigInt":
          correct = bigInt4.isInstance(value) || typeof value === "bigint" || typeof value === "number" || typeof value === "string" || value === void 0;
          break;
        case "true":
          break;
        case "buffer":
          correct = Buffer.isBuffer(value);
          break;
        case "date":
          correct = value && Object.prototype.toString.call(value) === "[object Date]" && !isNaN(value) || typeof value === "number";
          break;
        default:
          console.error(new Error("Unknown type." + type));
      }
      return correct;
    }
    function createClasses(classesType, params) {
      const classes = {};
      for (const classParams of params) {
        const { name, constructorId, subclassOfId, argsConfig, namespace, isFunction, result } = classParams;
        const fullName = [namespace, name].join(".").replace(/^\./, "");
        class VirtualClass {
          constructor(args) {
            this.CONSTRUCTOR_ID = constructorId;
            this.SUBCLASS_OF_ID = subclassOfId;
            this.className = fullName;
            this.classType = isFunction ? "request" : "constructor";
            args = args || {};
            this.originalArgs = args;
            this.init(args);
            for (const argName in argsConfig) {
              if (argName === "randomId" && !args[argName]) {
                if (argsConfig[argName].isVector) {
                  const rands = [];
                  for (let i = 0; i < args["id"].length; i++) {
                    rands.push(generateRandomBigInt());
                  }
                  this[argName] = rands;
                } else {
                  this[argName] = generateRandomBigInt();
                }
              } else {
                this[argName] = args[argName];
              }
            }
          }
          init(args) {
          }
          static fromReader(reader) {
            const args = {};
            for (const argName in argsConfig) {
              if (argsConfig.hasOwnProperty(argName)) {
                const arg = argsConfig[argName];
                if (arg.isFlag) {
                  if (arg.type === "true") {
                    args[argName] = Boolean(args[arg.flagName] & 1 << arg.flagIndex);
                    continue;
                  }
                  if (args[arg.flagName] & 1 << arg.flagIndex) {
                    args[argName] = getArgFromReader(reader, arg);
                  } else {
                    args[argName] = null;
                  }
                } else {
                  if (arg.flagIndicator) {
                    arg.name = argName;
                  }
                  args[argName] = getArgFromReader(reader, arg);
                }
              }
            }
            return new this(args);
          }
          validate() {
            for (const arg in argsConfig) {
              if (argsConfig.hasOwnProperty(arg)) {
                if (argsConfig[arg].flagIndicator || argsConfig[arg].isFlag) {
                  continue;
                }
                const currentValue = this[arg];
                this.assertType(arg, argsConfig[arg], currentValue);
              }
            }
          }
          assertType(objectName, object, value) {
            let expected;
            if (object["isVector"]) {
              if (!isArrayLike(value)) {
                console.error(new CastError(objectName, "array", value));
              }
              if (value == void 0) {
                value = [];
              }
              for (const o of value) {
                this.assertType(objectName, Object.assign(Object.assign({}, object), { isVector: false }), o);
              }
            } else {
              switch (object["type"]) {
                case "int":
                  expected = "number";
                  break;
                case "long":
                case "int128":
                case "int256":
                  expected = "bigInt";
                  break;
                case "double":
                  expected = "number";
                  break;
                case "string":
                  expected = "string";
                  break;
                case "Bool":
                  expected = "boolean";
                  break;
                case "true":
                  expected = "true";
                  break;
                case "bytes":
                  expected = "buffer";
                  break;
                case "date":
                  expected = "date";
                  break;
                default:
                  expected = "object";
              }
              if (expected === "object") {
              } else {
                const isCorrectType = compareType(value, expected);
                if (isCorrectType !== true) {
                  console.error(new CastError(objectName, expected, value));
                }
              }
            }
          }
          getBytes() {
            try {
              this.validate();
            } catch (e) {
            }
            const idForBytes = this.CONSTRUCTOR_ID;
            const c = Buffer.alloc(4);
            c.writeUInt32LE(idForBytes, 0);
            const buffers = [c];
            for (const arg in argsConfig) {
              if (argsConfig.hasOwnProperty(arg)) {
                if (argsConfig[arg].isFlag) {
                  if (this[arg] === false && argsConfig[arg].type !== "Bool" || this[arg] === null || this[arg] === void 0 || argsConfig[arg].type === "true") {
                    continue;
                  }
                }
                if (argsConfig[arg].isVector) {
                  if (argsConfig[arg].useVectorId) {
                    buffers.push(Buffer.from("15c4b51c", "hex"));
                  }
                  const l = Buffer.alloc(4);
                  l.writeInt32LE(this[arg].length, 0);
                  buffers.push(l, Buffer.concat(this[arg].map((x) => argToBytes(x, argsConfig[arg].type, fullName))));
                } else if (argsConfig[arg].flagIndicator) {
                  if (!Object.values(argsConfig).some((f2) => f2.isFlag)) {
                    buffers.push(Buffer.alloc(4));
                  } else {
                    let flagCalculate = 0;
                    for (const f3 in argsConfig) {
                      if (argsConfig[f3].isFlag && arg === argsConfig[f3].flagName) {
                        if (this[f3] === false && argsConfig[f3].type !== "Bool" || this[f3] === void 0 || this[f3] === null) {
                          flagCalculate |= 0;
                        } else {
                          flagCalculate |= 1 << argsConfig[f3].flagIndex;
                        }
                      }
                    }
                    const f2 = Buffer.alloc(4);
                    f2.writeUInt32LE(flagCalculate, 0);
                    buffers.push(f2);
                  }
                } else {
                  buffers.push(argToBytes(this[arg], argsConfig[arg].type, arg, fullName));
                  if (this[arg] && typeof this[arg].getBytes === "function") {
                    let boxed = argsConfig[arg].type.charAt(argsConfig[arg].type.indexOf(".") + 1);
                    boxed = boxed === boxed.toUpperCase();
                    if (!boxed) {
                      buffers.shift();
                    }
                  }
                }
              }
            }
            return Buffer.concat(buffers);
          }
          readResult(reader) {
            if (!isFunction) {
              throw new Error("`readResult()` called for non-request instance");
            }
            const m = result.match(/Vector<(int|long)>/);
            if (m) {
              reader.readInt();
              const temp = [];
              const len = reader.readInt();
              if (m[1] === "int") {
                for (let i = 0; i < len; i++) {
                  temp.push(reader.readInt());
                }
              } else {
                for (let i = 0; i < len; i++) {
                  temp.push(reader.readLong());
                }
              }
              return temp;
            } else {
              return reader.tgReadObject();
            }
          }
          async resolve(client2, utils) {
            if (!isFunction) {
              throw new Error("`resolve()` called for non-request instance");
            }
            for (const arg in argsConfig) {
              if (argsConfig.hasOwnProperty(arg)) {
                if (!AUTO_CASTS.has(argsConfig[arg].type)) {
                  if (!NAMED_AUTO_CASTS.has(`${argsConfig[arg].name},${argsConfig[arg].type}`)) {
                    continue;
                  }
                }
                if (argsConfig[arg].isFlag) {
                  if (!this[arg]) {
                    continue;
                  }
                }
                if (argsConfig[arg].isVector) {
                  const temp = [];
                  for (const x of this[arg]) {
                    temp.push(await getInputFromResolve(utils, client2, x, argsConfig[arg].type));
                  }
                  this[arg] = temp;
                } else {
                  this[arg] = await getInputFromResolve(utils, client2, this[arg], argsConfig[arg].type);
                }
              }
            }
          }
          [inspect.custom]() {
            return betterConsoleLog(this);
          }
          toJSON() {
            return Object.assign(Object.assign({}, this.originalArgs), { className: fullName });
          }
        }
        VirtualClass.CONSTRUCTOR_ID = constructorId;
        VirtualClass.SUBCLASS_OF_ID = subclassOfId;
        VirtualClass.className = fullName;
        VirtualClass.classType = isFunction ? "request" : "constructor";
        if (namespace) {
          if (!classes[namespace]) {
            classes[namespace] = {};
          }
          classes[namespace][name] = VirtualClass;
        } else {
          classes[name] = VirtualClass;
        }
      }
      return classes;
    }
    var api = buildApiFromTlSchema();
    module2.exports = { Api: api };
  }
});

// node_modules/telegram/tl/custom/chatGetter.js
var require_chatGetter = __commonJS({
  "node_modules/telegram/tl/custom/chatGetter.js"(exports2) {
    "use strict";
    var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) {
      if (!Symbol.asyncIterator)
        throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
        return this;
      }, i);
      function verb(n) {
        i[n] = o[n] && function(v) {
          return new Promise(function(resolve, reject) {
            v = o[n](v), settle(resolve, reject, v.done, v.value);
          });
        };
      }
      function settle(resolve, reject, d, v) {
        Promise.resolve(v).then(function(v2) {
          resolve({ value: v2, done: d });
        }, reject);
      }
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ChatGetter = void 0;
    var __1 = require_telegram();
    var api_1 = require_api();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var ChatGetter = class {
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      static initChatClass(c, { chatPeer, inputChat, chat, broadcast }) {
        c._chatPeer = chatPeer;
        c._inputChat = inputChat;
        c._chat = chat;
        c._broadcast = broadcast;
        c._client = void 0;
      }
      get chat() {
        return this._chat;
      }
      async getChat() {
        var _a;
        if (!this._chat || "min" in this._chat && await this.getInputChat()) {
          try {
            if (this._inputChat) {
              this._chat = await ((_a = this._client) === null || _a === void 0 ? void 0 : _a.getEntity(this._inputChat));
            }
          } catch (e) {
            await this._refetchChat();
          }
        }
        return this._chat;
      }
      get inputChat() {
        if (!this._inputChat && this._chatPeer && this._client) {
          try {
            this._inputChat = this._client._entityCache.get(__1.utils.getPeerId(this._chatPeer));
          } catch (e) {
          }
        }
        return this._inputChat;
      }
      async getInputChat() {
        var e_1, _a;
        if (!this.inputChat && this.chatId && this._client) {
          try {
            const target = this.chatId;
            try {
              for (var _b = __asyncValues2(this._client.iterDialogs({
                limit: 100
              })), _c; _c = await _b.next(), !_c.done; ) {
                const dialog = _c.value;
                if (dialog.id.eq(target)) {
                  this._chat = dialog.entity;
                  this._inputChat = dialog.inputEntity;
                  break;
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a = _b.return))
                  await _a.call(_b);
              } finally {
                if (e_1)
                  throw e_1.error;
              }
            }
          } catch (e) {
          }
          return this._inputChat;
        }
        return this._inputChat;
      }
      get chatId() {
        return this._chatPeer ? (0, Helpers_1.returnBigInt)(__1.utils.getPeerId(this._chatPeer)) : void 0;
      }
      get isPrivate() {
        return this._chatPeer ? this._chatPeer instanceof api_1.Api.PeerUser : void 0;
      }
      get isGroup() {
        if (!this._broadcast && this.chat && "broadcast" in this.chat) {
          this._broadcast = Boolean(this.chat.broadcast);
        }
        if (this._chatPeer instanceof api_1.Api.PeerChannel) {
          if (this._broadcast === void 0) {
            return void 0;
          } else {
            return !this._broadcast;
          }
        }
        return this._chatPeer instanceof api_1.Api.PeerChat;
      }
      get isChannel() {
        return this._chatPeer instanceof api_1.Api.PeerChannel;
      }
      async _refetchChat() {
      }
    };
    exports2.ChatGetter = ChatGetter;
  }
});

// node_modules/telegram/tl/custom/senderGetter.js
var require_senderGetter = __commonJS({
  "node_modules/telegram/tl/custom/senderGetter.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SenderGetter = void 0;
    var api_1 = require_api();
    var Helpers_1 = require_Helpers();
    var chatGetter_1 = require_chatGetter();
    var inspect_1 = require_inspect();
    var SenderGetter = class extends chatGetter_1.ChatGetter {
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      static initSenderClass(c, { senderId, sender, inputSender }) {
        c._senderId = senderId;
        c._sender = sender;
        c._inputSender = inputSender;
        c._client = void 0;
      }
      get sender() {
        return this._sender;
      }
      async getSender() {
        if (this._client && (!this._sender || this._sender instanceof api_1.Api.Channel && this._sender.min) && await this.getInputSender()) {
          try {
            this._sender = await this._client.getEntity(this._inputSender);
          } catch (e) {
            await this._refetchSender();
          }
        }
        return this._sender;
      }
      get inputSender() {
        if (!this._inputSender && this._senderId && this._client) {
          try {
            this._inputSender = this._client._entityCache.get(this._senderId);
          } catch (e) {
          }
        }
        return this._inputSender;
      }
      async getInputSender() {
        if (!this.inputSender && this._senderId && this._client) {
          await this._refetchSender();
        }
        return this._inputSender;
      }
      get senderId() {
        return this._senderId;
      }
      async _refetchSender() {
      }
    };
    exports2.SenderGetter = SenderGetter;
  }
});

// node_modules/telegram/node_modules/mime/Mime.js
var require_Mime = __commonJS({
  "node_modules/telegram/node_modules/mime/Mime.js"(exports2, module2) {
    "use strict";
    function Mime() {
      this._types = /* @__PURE__ */ Object.create(null);
      this._extensions = /* @__PURE__ */ Object.create(null);
      for (let i = 0; i < arguments.length; i++) {
        this.define(arguments[i]);
      }
      this.define = this.define.bind(this);
      this.getType = this.getType.bind(this);
      this.getExtension = this.getExtension.bind(this);
    }
    Mime.prototype.define = function(typeMap, force) {
      for (let type in typeMap) {
        let extensions = typeMap[type].map(function(t) {
          return t.toLowerCase();
        });
        type = type.toLowerCase();
        for (let i = 0; i < extensions.length; i++) {
          const ext = extensions[i];
          if (ext[0] === "*") {
            continue;
          }
          if (!force && ext in this._types) {
            throw new Error(
              'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".'
            );
          }
          this._types[ext] = type;
        }
        if (force || !this._extensions[type]) {
          const ext = extensions[0];
          this._extensions[type] = ext[0] !== "*" ? ext : ext.substr(1);
        }
      }
    };
    Mime.prototype.getType = function(path4) {
      path4 = String(path4);
      let last = path4.replace(/^.*[/\\]/, "").toLowerCase();
      let ext = last.replace(/^.*\./, "").toLowerCase();
      let hasPath = last.length < path4.length;
      let hasDot = ext.length < last.length - 1;
      return (hasDot || !hasPath) && this._types[ext] || null;
    };
    Mime.prototype.getExtension = function(type) {
      type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
      return type && this._extensions[type.toLowerCase()] || null;
    };
    module2.exports = Mime;
  }
});

// node_modules/telegram/node_modules/mime/types/standard.js
var require_standard = __commonJS({
  "node_modules/telegram/node_modules/mime/types/standard.js"(exports2, module2) {
    module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
  }
});

// node_modules/telegram/node_modules/mime/types/other.js
var require_other = __commonJS({
  "node_modules/telegram/node_modules/mime/types/other.js"(exports2, module2) {
    module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
  }
});

// node_modules/telegram/node_modules/mime/index.js
var require_mime = __commonJS({
  "node_modules/telegram/node_modules/mime/index.js"(exports2, module2) {
    "use strict";
    var Mime = require_Mime();
    module2.exports = new Mime(require_standard(), require_other());
  }
});

// node_modules/telegram/client/messageParse.js
var require_messageParse = __commonJS({
  "node_modules/telegram/client/messageParse.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2._getResponseMessage = exports2._parseMessageText = exports2._replaceWithMention = exports2.DEFAULT_DELIMITERS = void 0;
    var Utils_1 = require_Utils();
    var api_1 = require_api();
    var index_1 = require_telegram();
    var Helpers_1 = require_Helpers();
    var big_integer_1 = __importDefault2(require_BigInteger());
    exports2.DEFAULT_DELIMITERS = {
      "**": api_1.Api.MessageEntityBold,
      __: api_1.Api.MessageEntityItalic,
      "~~": api_1.Api.MessageEntityStrike,
      "`": api_1.Api.MessageEntityCode,
      "```": api_1.Api.MessageEntityPre
    };
    async function _replaceWithMention(client2, entities, i, user) {
      try {
        entities[i] = new api_1.Api.InputMessageEntityMentionName({
          offset: entities[i].offset,
          length: entities[i].length,
          userId: await client2.getInputEntity(user)
        });
        return true;
      } catch (e) {
        return false;
      }
    }
    exports2._replaceWithMention = _replaceWithMention;
    async function _parseMessageText(client2, message, parseMode) {
      if (parseMode == false) {
        return [message, []];
      }
      if (parseMode == void 0) {
        if (client2.parseMode == void 0) {
          return [message, []];
        }
        parseMode = client2.parseMode;
      } else if (typeof parseMode === "string") {
        parseMode = (0, Utils_1.sanitizeParseMode)(parseMode);
      }
      const [rawMessage, msgEntities] = parseMode.parse(message);
      for (let i = msgEntities.length - 1; i >= 0; i--) {
        const e = msgEntities[i];
        if (e instanceof api_1.Api.MessageEntityTextUrl) {
          const m = /^@|\+|tg:\/\/user\?id=(\d+)/.exec(e.url);
          if (m) {
            const userIdOrUsername = m[1] ? Number(m[1]) : e.url;
            const isMention = await _replaceWithMention(client2, msgEntities, i, userIdOrUsername);
            if (!isMention) {
              msgEntities.splice(i, 1);
            }
          }
        }
      }
      return [rawMessage, msgEntities];
    }
    exports2._parseMessageText = _parseMessageText;
    function _getResponseMessage(client2, request, result, inputChat) {
      let updates = [];
      let entities = /* @__PURE__ */ new Map();
      if (result instanceof api_1.Api.UpdateShort) {
        updates = [result.update];
      } else if (result instanceof api_1.Api.Updates || result instanceof api_1.Api.UpdatesCombined) {
        updates = result.updates;
        for (const x of [...result.users, ...result.chats]) {
          entities.set(index_1.utils.getPeerId(x), x);
        }
      } else {
        return;
      }
      const randomToId = /* @__PURE__ */ new Map();
      const idToMessage = /* @__PURE__ */ new Map();
      let schedMessage;
      for (const update of updates) {
        if (update instanceof api_1.Api.UpdateMessageID) {
          randomToId.set(update.randomId.toString(), update.id);
        } else if (update instanceof api_1.Api.UpdateNewChannelMessage || update instanceof api_1.Api.UpdateNewMessage) {
          update.message._finishInit(client2, entities, inputChat);
          if ("randomId" in request || (0, Helpers_1.isArrayLike)(request)) {
            idToMessage.set(update.message.id, update.message);
          } else {
            return update.message;
          }
        } else if (update instanceof api_1.Api.UpdateEditMessage && "peer" in request && (0, Helpers_1._entityType)(request.peer) != Helpers_1._EntityType.CHANNEL) {
          update.message._finishInit(client2, entities, inputChat);
          if ("randomId" in request) {
            idToMessage.set(update.message.id, update.message);
          } else if ("id" in request && request.id === update.message.id) {
            return update.message;
          }
        } else if (update instanceof api_1.Api.UpdateEditChannelMessage && "peer" in request && (0, Utils_1.getPeerId)(request.peer) == (0, Utils_1.getPeerId)(update.message.peerId)) {
          if (request.id == update.message.id) {
            update.message._finishInit(client2, entities, inputChat);
            return update.message;
          }
        } else if (update instanceof api_1.Api.UpdateNewScheduledMessage) {
          update.message._finishInit(client2, entities, inputChat);
          schedMessage = update.message;
          idToMessage.set(update.message.id, update.message);
        } else if (update instanceof api_1.Api.UpdateMessagePoll) {
          if (request.media.poll.id == update.pollId) {
            const m = new api_1.Api.Message({
              id: request.id,
              peerId: index_1.utils.getPeerId(request.peer),
              media: new api_1.Api.MessageMediaPoll({
                poll: update.poll,
                results: update.results
              }),
              message: "",
              date: 0
            });
            m._finishInit(client2, entities, inputChat);
            return m;
          }
        }
      }
      if (request == void 0) {
        return idToMessage;
      }
      let randomId;
      if ((0, Helpers_1.isArrayLike)(request) || typeof request == "number" || big_integer_1.default.isInstance(request)) {
        randomId = request;
      } else {
        randomId = request.randomId;
      }
      if (!randomId) {
        if (schedMessage) {
          return schedMessage;
        }
        client2._log.warn(`No randomId in ${request} to map to. returning undefined for ${result}`);
        return void 0;
      }
      if (!(0, Helpers_1.isArrayLike)(randomId)) {
        let msg = idToMessage.get(randomToId.get(randomId.toString()));
        if (!msg) {
          client2._log.warn(`Request ${request.className} had missing message mapping ${result.className}`);
        }
        return msg;
      }
      const final = [];
      let warned = false;
      for (const rnd of randomId) {
        const tmp = randomToId.get(rnd.toString());
        if (!tmp) {
          warned = true;
          break;
        }
        const tmp2 = idToMessage.get(tmp);
        if (!tmp2) {
          warned = true;
          break;
        }
        final.push(tmp2);
      }
      if (warned) {
        client2._log.warn(`Request ${request.className} had missing message mapping ${result.className}`);
      }
      const finalToReturn = [];
      for (const rnd of randomId) {
        finalToReturn.push(idToMessage.get(randomToId.get(rnd.toString())));
      }
      return finalToReturn;
    }
    exports2._getResponseMessage = _getResponseMessage;
  }
});

// node_modules/telegram/extensions/markdown.js
var require_markdown = __commonJS({
  "node_modules/telegram/extensions/markdown.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MarkdownParser = void 0;
    var messageParse_1 = require_messageParse();
    var MarkdownParser = class {
      // TODO maybe there is a better way :shrug:
      static parse(message) {
        let i = 0;
        const keys = {};
        for (const k in messageParse_1.DEFAULT_DELIMITERS) {
          keys[k] = false;
        }
        const entities = [];
        const tempEntities = {};
        while (i < message.length) {
          let foundIndex = -1;
          let foundDelim = void 0;
          for (const key of Object.keys(messageParse_1.DEFAULT_DELIMITERS)) {
            const index = message.indexOf(key, i);
            if (index > -1 && (foundIndex === -1 || index < foundIndex)) {
              foundIndex = index;
              foundDelim = key;
            }
          }
          if (foundIndex === -1 || foundDelim == void 0) {
            break;
          }
          if (!keys[foundDelim]) {
            tempEntities[foundDelim] = new messageParse_1.DEFAULT_DELIMITERS[foundDelim]({
              offset: foundIndex,
              length: -1,
              language: ""
            });
            keys[foundDelim] = true;
          } else {
            keys[foundDelim] = false;
            tempEntities[foundDelim].length = foundIndex - tempEntities[foundDelim].offset;
            entities.push(tempEntities[foundDelim]);
          }
          message = message.toString().replace(foundDelim, "");
          i = foundIndex;
        }
        return [message, entities];
      }
      static unparse(text, entities) {
        const delimiters = messageParse_1.DEFAULT_DELIMITERS;
        if (!text || !entities) {
          return text;
        }
        let insertAt = [];
        const tempDelimiters = /* @__PURE__ */ new Map();
        Object.keys(delimiters).forEach((key) => {
          tempDelimiters.set(delimiters[key].className, key);
        });
        for (const entity of entities) {
          const s = entity.offset;
          const e = entity.offset + entity.length;
          const delimiter = tempDelimiters.get(entity.className);
          if (delimiter) {
            insertAt.push([s, delimiter]);
            insertAt.push([e, delimiter]);
          }
        }
        insertAt = insertAt.sort((a, b) => {
          return a[0] - b[0];
        });
        while (insertAt.length) {
          const [at, what] = insertAt.pop();
          text = text.slice(0, at) + what + text.slice(at);
        }
        return text;
      }
    };
    exports2.MarkdownParser = MarkdownParser;
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/maps/decode.json
var require_decode = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/maps/decode.json"(exports2, module2) {
    module2.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240, "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212, "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js
var require_decode_codepoint = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    var decode_json_1 = __importDefault2(require_decode());
    var fromCodePoint = (
      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
      String.fromCodePoint || function(codePoint) {
        var output = "";
        if (codePoint > 65535) {
          codePoint -= 65536;
          output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
          codePoint = 56320 | codePoint & 1023;
        }
        output += String.fromCharCode(codePoint);
        return output;
      }
    );
    function decodeCodePoint(codePoint) {
      if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
        return "\uFFFD";
      }
      if (codePoint in decode_json_1.default) {
        codePoint = decode_json_1.default[codePoint];
      }
      return fromCodePoint(codePoint);
    }
    exports2.default = decodeCodePoint;
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/maps/entities.json
var require_entities = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/maps/entities.json"(exports2, module2) {
    module2.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}", Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220", ange: "\u29A4", angle: "\u2220", angmsdaa: "\u29A8", angmsdab: "\u29A9", angmsdac: "\u29AA", angmsdad: "\u29AB", angmsdae: "\u29AC", angmsdaf: "\u29AD", angmsdag: "\u29AE", angmsdah: "\u29AF", angmsd: "\u2221", angrt: "\u221F", angrtvb: "\u22BE", angrtvbd: "\u299D", angsph: "\u2222", angst: "\xC5", angzarr: "\u237C", Aogon: "\u0104", aogon: "\u0105", Aopf: "\u{1D538}", aopf: "\u{1D552}", apacir: "\u2A6F", ap: "\u2248", apE: "\u2A70", ape: "\u224A", apid: "\u224B", apos: "'", ApplyFunction: "\u2061", approx: "\u2248", approxeq: "\u224A", Aring: "\xC5", aring: "\xE5", Ascr: "\u{1D49C}", ascr: "\u{1D4B6}", Assign: "\u2254", ast: "*", asymp: "\u2248", asympeq: "\u224D", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", awconint: "\u2233", awint: "\u2A11", backcong: "\u224C", backepsilon: "\u03F6", backprime: "\u2035", backsim: "\u223D", backsimeq: "\u22CD", Backslash: "\u2216", Barv: "\u2AE7", barvee: "\u22BD", barwed: "\u2305", Barwed: "\u2306", barwedge: "\u2305", bbrk: "\u23B5", bbrktbrk: "\u23B6", bcong: "\u224C", Bcy: "\u0411", bcy: "\u0431", bdquo: "\u201E", becaus: "\u2235", because: "\u2235", Because: "\u2235", bemptyv: "\u29B0", bepsi: "\u03F6", bernou: "\u212C", Bernoullis: "\u212C", Beta: "\u0392", beta: "\u03B2", beth: "\u2136", between: "\u226C", Bfr: "\u{1D505}", bfr: "\u{1D51F}", bigcap: "\u22C2", bigcirc: "\u25EF", bigcup: "\u22C3", bigodot: "\u2A00", bigoplus: "\u2A01", bigotimes: "\u2A02", bigsqcup: "\u2A06", bigstar: "\u2605", bigtriangledown: "\u25BD", bigtriangleup: "\u25B3", biguplus: "\u2A04", bigvee: "\u22C1", bigwedge: "\u22C0", bkarow: "\u290D", blacklozenge: "\u29EB", blacksquare: "\u25AA", blacktriangle: "\u25B4", blacktriangledown: "\u25BE", blacktriangleleft: "\u25C2", blacktriangleright: "\u25B8", blank: "\u2423", blk12: "\u2592", blk14: "\u2591", blk34: "\u2593", block: "\u2588", bne: "=\u20E5", bnequiv: "\u2261\u20E5", bNot: "\u2AED", bnot: "\u2310", Bopf: "\u{1D539}", bopf: "\u{1D553}", bot: "\u22A5", bottom: "\u22A5", bowtie: "\u22C8", boxbox: "\u29C9", boxdl: "\u2510", boxdL: "\u2555", boxDl: "\u2556", boxDL: "\u2557", boxdr: "\u250C", boxdR: "\u2552", boxDr: "\u2553", boxDR: "\u2554", boxh: "\u2500", boxH: "\u2550", boxhd: "\u252C", boxHd: "\u2564", boxhD: "\u2565", boxHD: "\u2566", boxhu: "\u2534", boxHu: "\u2567", boxhU: "\u2568", boxHU: "\u2569", boxminus: "\u229F", boxplus: "\u229E", boxtimes: "\u22A0", boxul: "\u2518", boxuL: "\u255B", boxUl: "\u255C", boxUL: "\u255D", boxur: "\u2514", boxuR: "\u2558", boxUr: "\u2559", boxUR: "\u255A", boxv: "\u2502", boxV: "\u2551", boxvh: "\u253C", boxvH: "\u256A", boxVh: "\u256B", boxVH: "\u256C", boxvl: "\u2524", boxvL: "\u2561", boxVl: "\u2562", boxVL: "\u2563", boxvr: "\u251C", boxvR: "\u255E", boxVr: "\u255F", boxVR: "\u2560", bprime: "\u2035", breve: "\u02D8", Breve: "\u02D8", brvbar: "\xA6", bscr: "\u{1D4B7}", Bscr: "\u212C", bsemi: "\u204F", bsim: "\u223D", bsime: "\u22CD", bsolb: "\u29C5", bsol: "\\", bsolhsub: "\u27C8", bull: "\u2022", bullet: "\u2022", bump: "\u224E", bumpE: "\u2AAE", bumpe: "\u224F", Bumpeq: "\u224E", bumpeq: "\u224F", Cacute: "\u0106", cacute: "\u0107", capand: "\u2A44", capbrcup: "\u2A49", capcap: "\u2A4B", cap: "\u2229", Cap: "\u22D2", capcup: "\u2A47", capdot: "\u2A40", CapitalDifferentialD: "\u2145", caps: "\u2229\uFE00", caret: "\u2041", caron: "\u02C7", Cayleys: "\u212D", ccaps: "\u2A4D", Ccaron: "\u010C", ccaron: "\u010D", Ccedil: "\xC7", ccedil: "\xE7", Ccirc: "\u0108", ccirc: "\u0109", Cconint: "\u2230", ccups: "\u2A4C", ccupssm: "\u2A50", Cdot: "\u010A", cdot: "\u010B", cedil: "\xB8", Cedilla: "\xB8", cemptyv: "\u29B2", cent: "\xA2", centerdot: "\xB7", CenterDot: "\xB7", cfr: "\u{1D520}", Cfr: "\u212D", CHcy: "\u0427", chcy: "\u0447", check: "\u2713", checkmark: "\u2713", Chi: "\u03A7", chi: "\u03C7", circ: "\u02C6", circeq: "\u2257", circlearrowleft: "\u21BA", circlearrowright: "\u21BB", circledast: "\u229B", circledcirc: "\u229A", circleddash: "\u229D", CircleDot: "\u2299", circledR: "\xAE", circledS: "\u24C8", CircleMinus: "\u2296", CirclePlus: "\u2295", CircleTimes: "\u2297", cir: "\u25CB", cirE: "\u29C3", cire: "\u2257", cirfnint: "\u2A10", cirmid: "\u2AEF", cirscir: "\u29C2", ClockwiseContourIntegral: "\u2232", CloseCurlyDoubleQuote: "\u201D", CloseCurlyQuote: "\u2019", clubs: "\u2663", clubsuit: "\u2663", colon: ":", Colon: "\u2237", Colone: "\u2A74", colone: "\u2254", coloneq: "\u2254", comma: ",", commat: "@", comp: "\u2201", compfn: "\u2218", complement: "\u2201", complexes: "\u2102", cong: "\u2245", congdot: "\u2A6D", Congruent: "\u2261", conint: "\u222E", Conint: "\u222F", ContourIntegral: "\u222E", copf: "\u{1D554}", Copf: "\u2102", coprod: "\u2210", Coproduct: "\u2210", copy: "\xA9", COPY: "\xA9", copysr: "\u2117", CounterClockwiseContourIntegral: "\u2233", crarr: "\u21B5", cross: "\u2717", Cross: "\u2A2F", Cscr: "\u{1D49E}", cscr: "\u{1D4B8}", csub: "\u2ACF", csube: "\u2AD1", csup: "\u2AD0", csupe: "\u2AD2", ctdot: "\u22EF", cudarrl: "\u2938", cudarrr: "\u2935", cuepr: "\u22DE", cuesc: "\u22DF", cularr: "\u21B6", cularrp: "\u293D", cupbrcap: "\u2A48", cupcap: "\u2A46", CupCap: "\u224D", cup: "\u222A", Cup: "\u22D3", cupcup: "\u2A4A", cupdot: "\u228D", cupor: "\u2A45", cups: "\u222A\uFE00", curarr: "\u21B7", curarrm: "\u293C", curlyeqprec: "\u22DE", curlyeqsucc: "\u22DF", curlyvee: "\u22CE", curlywedge: "\u22CF", curren: "\xA4", curvearrowleft: "\u21B6", curvearrowright: "\u21B7", cuvee: "\u22CE", cuwed: "\u22CF", cwconint: "\u2232", cwint: "\u2231", cylcty: "\u232D", dagger: "\u2020", Dagger: "\u2021", daleth: "\u2138", darr: "\u2193", Darr: "\u21A1", dArr: "\u21D3", dash: "\u2010", Dashv: "\u2AE4", dashv: "\u22A3", dbkarow: "\u290F", dblac: "\u02DD", Dcaron: "\u010E", dcaron: "\u010F", Dcy: "\u0414", dcy: "\u0434", ddagger: "\u2021", ddarr: "\u21CA", DD: "\u2145", dd: "\u2146", DDotrahd: "\u2911", ddotseq: "\u2A77", deg: "\xB0", Del: "\u2207", Delta: "\u0394", delta: "\u03B4", demptyv: "\u29B1", dfisht: "\u297F", Dfr: "\u{1D507}", dfr: "\u{1D521}", dHar: "\u2965", dharl: "\u21C3", dharr: "\u21C2", DiacriticalAcute: "\xB4", DiacriticalDot: "\u02D9", DiacriticalDoubleAcute: "\u02DD", DiacriticalGrave: "`", DiacriticalTilde: "\u02DC", diam: "\u22C4", diamond: "\u22C4", Diamond: "\u22C4", diamondsuit: "\u2666", diams: "\u2666", die: "\xA8", DifferentialD: "\u2146", digamma: "\u03DD", disin: "\u22F2", div: "\xF7", divide: "\xF7", divideontimes: "\u22C7", divonx: "\u22C7", DJcy: "\u0402", djcy: "\u0452", dlcorn: "\u231E", dlcrop: "\u230D", dollar: "$", Dopf: "\u{1D53B}", dopf: "\u{1D555}", Dot: "\xA8", dot: "\u02D9", DotDot: "\u20DC", doteq: "\u2250", doteqdot: "\u2251", DotEqual: "\u2250", dotminus: "\u2238", dotplus: "\u2214", dotsquare: "\u22A1", doublebarwedge: "\u2306", DoubleContourIntegral: "\u222F", DoubleDot: "\xA8", DoubleDownArrow: "\u21D3", DoubleLeftArrow: "\u21D0", DoubleLeftRightArrow: "\u21D4", DoubleLeftTee: "\u2AE4", DoubleLongLeftArrow: "\u27F8", DoubleLongLeftRightArrow: "\u27FA", DoubleLongRightArrow: "\u27F9", DoubleRightArrow: "\u21D2", DoubleRightTee: "\u22A8", DoubleUpArrow: "\u21D1", DoubleUpDownArrow: "\u21D5", DoubleVerticalBar: "\u2225", DownArrowBar: "\u2913", downarrow: "\u2193", DownArrow: "\u2193", Downarrow: "\u21D3", DownArrowUpArrow: "\u21F5", DownBreve: "\u0311", downdownarrows: "\u21CA", downharpoonleft: "\u21C3", downharpoonright: "\u21C2", DownLeftRightVector: "\u2950", DownLeftTeeVector: "\u295E", DownLeftVectorBar: "\u2956", DownLeftVector: "\u21BD", DownRightTeeVector: "\u295F", DownRightVectorBar: "\u2957", DownRightVector: "\u21C1", DownTeeArrow: "\u21A7", DownTee: "\u22A4", drbkarow: "\u2910", drcorn: "\u231F", drcrop: "\u230C", Dscr: "\u{1D49F}", dscr: "\u{1D4B9}", DScy: "\u0405", dscy: "\u0455", dsol: "\u29F6", Dstrok: "\u0110", dstrok: "\u0111", dtdot: "\u22F1", dtri: "\u25BF", dtrif: "\u25BE", duarr: "\u21F5", duhar: "\u296F", dwangle: "\u29A6", DZcy: "\u040F", dzcy: "\u045F", dzigrarr: "\u27FF", Eacute: "\xC9", eacute: "\xE9", easter: "\u2A6E", Ecaron: "\u011A", ecaron: "\u011B", Ecirc: "\xCA", ecirc: "\xEA", ecir: "\u2256", ecolon: "\u2255", Ecy: "\u042D", ecy: "\u044D", eDDot: "\u2A77", Edot: "\u0116", edot: "\u0117", eDot: "\u2251", ee: "\u2147", efDot: "\u2252", Efr: "\u{1D508}", efr: "\u{1D522}", eg: "\u2A9A", Egrave: "\xC8", egrave: "\xE8", egs: "\u2A96", egsdot: "\u2A98", el: "\u2A99", Element: "\u2208", elinters: "\u23E7", ell: "\u2113", els: "\u2A95", elsdot: "\u2A97", Emacr: "\u0112", emacr: "\u0113", empty: "\u2205", emptyset: "\u2205", EmptySmallSquare: "\u25FB", emptyv: "\u2205", EmptyVerySmallSquare: "\u25AB", emsp13: "\u2004", emsp14: "\u2005", emsp: "\u2003", ENG: "\u014A", eng: "\u014B", ensp: "\u2002", Eogon: "\u0118", eogon: "\u0119", Eopf: "\u{1D53C}", eopf: "\u{1D556}", epar: "\u22D5", eparsl: "\u29E3", eplus: "\u2A71", epsi: "\u03B5", Epsilon: "\u0395", epsilon: "\u03B5", epsiv: "\u03F5", eqcirc: "\u2256", eqcolon: "\u2255", eqsim: "\u2242", eqslantgtr: "\u2A96", eqslantless: "\u2A95", Equal: "\u2A75", equals: "=", EqualTilde: "\u2242", equest: "\u225F", Equilibrium: "\u21CC", equiv: "\u2261", equivDD: "\u2A78", eqvparsl: "\u29E5", erarr: "\u2971", erDot: "\u2253", escr: "\u212F", Escr: "\u2130", esdot: "\u2250", Esim: "\u2A73", esim: "\u2242", Eta: "\u0397", eta: "\u03B7", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", euro: "\u20AC", excl: "!", exist: "\u2203", Exists: "\u2203", expectation: "\u2130", exponentiale: "\u2147", ExponentialE: "\u2147", fallingdotseq: "\u2252", Fcy: "\u0424", fcy: "\u0444", female: "\u2640", ffilig: "\uFB03", fflig: "\uFB00", ffllig: "\uFB04", Ffr: "\u{1D509}", ffr: "\u{1D523}", filig: "\uFB01", FilledSmallSquare: "\u25FC", FilledVerySmallSquare: "\u25AA", fjlig: "fj", flat: "\u266D", fllig: "\uFB02", fltns: "\u25B1", fnof: "\u0192", Fopf: "\u{1D53D}", fopf: "\u{1D557}", forall: "\u2200", ForAll: "\u2200", fork: "\u22D4", forkv: "\u2AD9", Fouriertrf: "\u2131", fpartint: "\u2A0D", frac12: "\xBD", frac13: "\u2153", frac14: "\xBC", frac15: "\u2155", frac16: "\u2159", frac18: "\u215B", frac23: "\u2154", frac25: "\u2156", frac34: "\xBE", frac35: "\u2157", frac38: "\u215C", frac45: "\u2158", frac56: "\u215A", frac58: "\u215D", frac78: "\u215E", frasl: "\u2044", frown: "\u2322", fscr: "\u{1D4BB}", Fscr: "\u2131", gacute: "\u01F5", Gamma: "\u0393", gamma: "\u03B3", Gammad: "\u03DC", gammad: "\u03DD", gap: "\u2A86", Gbreve: "\u011E", gbreve: "\u011F", Gcedil: "\u0122", Gcirc: "\u011C", gcirc: "\u011D", Gcy: "\u0413", gcy: "\u0433", Gdot: "\u0120", gdot: "\u0121", ge: "\u2265", gE: "\u2267", gEl: "\u2A8C", gel: "\u22DB", geq: "\u2265", geqq: "\u2267", geqslant: "\u2A7E", gescc: "\u2AA9", ges: "\u2A7E", gesdot: "\u2A80", gesdoto: "\u2A82", gesdotol: "\u2A84", gesl: "\u22DB\uFE00", gesles: "\u2A94", Gfr: "\u{1D50A}", gfr: "\u{1D524}", gg: "\u226B", Gg: "\u22D9", ggg: "\u22D9", gimel: "\u2137", GJcy: "\u0403", gjcy: "\u0453", gla: "\u2AA5", gl: "\u2277", glE: "\u2A92", glj: "\u2AA4", gnap: "\u2A8A", gnapprox: "\u2A8A", gne: "\u2A88", gnE: "\u2269", gneq: "\u2A88", gneqq: "\u2269", gnsim: "\u22E7", Gopf: "\u{1D53E}", gopf: "\u{1D558}", grave: "`", GreaterEqual: "\u2265", GreaterEqualLess: "\u22DB", GreaterFullEqual: "\u2267", GreaterGreater: "\u2AA2", GreaterLess: "\u2277", GreaterSlantEqual: "\u2A7E", GreaterTilde: "\u2273", Gscr: "\u{1D4A2}", gscr: "\u210A", gsim: "\u2273", gsime: "\u2A8E", gsiml: "\u2A90", gtcc: "\u2AA7", gtcir: "\u2A7A", gt: ">", GT: ">", Gt: "\u226B", gtdot: "\u22D7", gtlPar: "\u2995", gtquest: "\u2A7C", gtrapprox: "\u2A86", gtrarr: "\u2978", gtrdot: "\u22D7", gtreqless: "\u22DB", gtreqqless: "\u2A8C", gtrless: "\u2277", gtrsim: "\u2273", gvertneqq: "\u2269\uFE00", gvnE: "\u2269\uFE00", Hacek: "\u02C7", hairsp: "\u200A", half: "\xBD", hamilt: "\u210B", HARDcy: "\u042A", hardcy: "\u044A", harrcir: "\u2948", harr: "\u2194", hArr: "\u21D4", harrw: "\u21AD", Hat: "^", hbar: "\u210F", Hcirc: "\u0124", hcirc: "\u0125", hearts: "\u2665", heartsuit: "\u2665", hellip: "\u2026", hercon: "\u22B9", hfr: "\u{1D525}", Hfr: "\u210C", HilbertSpace: "\u210B", hksearow: "\u2925", hkswarow: "\u2926", hoarr: "\u21FF", homtht: "\u223B", hookleftarrow: "\u21A9", hookrightarrow: "\u21AA", hopf: "\u{1D559}", Hopf: "\u210D", horbar: "\u2015", HorizontalLine: "\u2500", hscr: "\u{1D4BD}", Hscr: "\u210B", hslash: "\u210F", Hstrok: "\u0126", hstrok: "\u0127", HumpDownHump: "\u224E", HumpEqual: "\u224F", hybull: "\u2043", hyphen: "\u2010", Iacute: "\xCD", iacute: "\xED", ic: "\u2063", Icirc: "\xCE", icirc: "\xEE", Icy: "\u0418", icy: "\u0438", Idot: "\u0130", IEcy: "\u0415", iecy: "\u0435", iexcl: "\xA1", iff: "\u21D4", ifr: "\u{1D526}", Ifr: "\u2111", Igrave: "\xCC", igrave: "\xEC", ii: "\u2148", iiiint: "\u2A0C", iiint: "\u222D", iinfin: "\u29DC", iiota: "\u2129", IJlig: "\u0132", ijlig: "\u0133", Imacr: "\u012A", imacr: "\u012B", image: "\u2111", ImaginaryI: "\u2148", imagline: "\u2110", imagpart: "\u2111", imath: "\u0131", Im: "\u2111", imof: "\u22B7", imped: "\u01B5", Implies: "\u21D2", incare: "\u2105", in: "\u2208", infin: "\u221E", infintie: "\u29DD", inodot: "\u0131", intcal: "\u22BA", int: "\u222B", Int: "\u222C", integers: "\u2124", Integral: "\u222B", intercal: "\u22BA", Intersection: "\u22C2", intlarhk: "\u2A17", intprod: "\u2A3C", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "\u0401", iocy: "\u0451", Iogon: "\u012E", iogon: "\u012F", Iopf: "\u{1D540}", iopf: "\u{1D55A}", Iota: "\u0399", iota: "\u03B9", iprod: "\u2A3C", iquest: "\xBF", iscr: "\u{1D4BE}", Iscr: "\u2110", isin: "\u2208", isindot: "\u22F5", isinE: "\u22F9", isins: "\u22F4", isinsv: "\u22F3", isinv: "\u2208", it: "\u2062", Itilde: "\u0128", itilde: "\u0129", Iukcy: "\u0406", iukcy: "\u0456", Iuml: "\xCF", iuml: "\xEF", Jcirc: "\u0134", jcirc: "\u0135", Jcy: "\u0419", jcy: "\u0439", Jfr: "\u{1D50D}", jfr: "\u{1D527}", jmath: "\u0237", Jopf: "\u{1D541}", jopf: "\u{1D55B}", Jscr: "\u{1D4A5}", jscr: "\u{1D4BF}", Jsercy: "\u0408", jsercy: "\u0458", Jukcy: "\u0404", jukcy: "\u0454", Kappa: "\u039A", kappa: "\u03BA", kappav: "\u03F0", Kcedil: "\u0136", kcedil: "\u0137", Kcy: "\u041A", kcy: "\u043A", Kfr: "\u{1D50E}", kfr: "\u{1D528}", kgreen: "\u0138", KHcy: "\u0425", khcy: "\u0445", KJcy: "\u040C", kjcy: "\u045C", Kopf: "\u{1D542}", kopf: "\u{1D55C}", Kscr: "\u{1D4A6}", kscr: "\u{1D4C0}", lAarr: "\u21DA", Lacute: "\u0139", lacute: "\u013A", laemptyv: "\u29B4", lagran: "\u2112", Lambda: "\u039B", lambda: "\u03BB", lang: "\u27E8", Lang: "\u27EA", langd: "\u2991", langle: "\u27E8", lap: "\u2A85", Laplacetrf: "\u2112", laquo: "\xAB", larrb: "\u21E4", larrbfs: "\u291F", larr: "\u2190", Larr: "\u219E", lArr: "\u21D0", larrfs: "\u291D", larrhk: "\u21A9", larrlp: "\u21AB", larrpl: "\u2939", larrsim: "\u2973", larrtl: "\u21A2", latail: "\u2919", lAtail: "\u291B", lat: "\u2AAB", late: "\u2AAD", lates: "\u2AAD\uFE00", lbarr: "\u290C", lBarr: "\u290E", lbbrk: "\u2772", lbrace: "{", lbrack: "[", lbrke: "\u298B", lbrksld: "\u298F", lbrkslu: "\u298D", Lcaron: "\u013D", lcaron: "\u013E", Lcedil: "\u013B", lcedil: "\u013C", lceil: "\u2308", lcub: "{", Lcy: "\u041B", lcy: "\u043B", ldca: "\u2936", ldquo: "\u201C", ldquor: "\u201E", ldrdhar: "\u2967", ldrushar: "\u294B", ldsh: "\u21B2", le: "\u2264", lE: "\u2266", LeftAngleBracket: "\u27E8", LeftArrowBar: "\u21E4", leftarrow: "\u2190", LeftArrow: "\u2190", Leftarrow: "\u21D0", LeftArrowRightArrow: "\u21C6", leftarrowtail: "\u21A2", LeftCeiling: "\u2308", LeftDoubleBracket: "\u27E6", LeftDownTeeVector: "\u2961", LeftDownVectorBar: "\u2959", LeftDownVector: "\u21C3", LeftFloor: "\u230A", leftharpoondown: "\u21BD", leftharpoonup: "\u21BC", leftleftarrows: "\u21C7", leftrightarrow: "\u2194", LeftRightArrow: "\u2194", Leftrightarrow: "\u21D4", leftrightarrows: "\u21C6", leftrightharpoons: "\u21CB", leftrightsquigarrow: "\u21AD", LeftRightVector: "\u294E", LeftTeeArrow: "\u21A4", LeftTee: "\u22A3", LeftTeeVector: "\u295A", leftthreetimes: "\u22CB", LeftTriangleBar: "\u29CF", LeftTriangle: "\u22B2", LeftTriangleEqual: "\u22B4", LeftUpDownVector: "\u2951", LeftUpTeeVector: "\u2960", LeftUpVectorBar: "\u2958", LeftUpVector: "\u21BF", LeftVectorBar: "\u2952", LeftVector: "\u21BC", lEg: "\u2A8B", leg: "\u22DA", leq: "\u2264", leqq: "\u2266", leqslant: "\u2A7D", lescc: "\u2AA8", les: "\u2A7D", lesdot: "\u2A7F", lesdoto: "\u2A81", lesdotor: "\u2A83", lesg: "\u22DA\uFE00", lesges: "\u2A93", lessapprox: "\u2A85", lessdot: "\u22D6", lesseqgtr: "\u22DA", lesseqqgtr: "\u2A8B", LessEqualGreater: "\u22DA", LessFullEqual: "\u2266", LessGreater: "\u2276", lessgtr: "\u2276", LessLess: "\u2AA1", lesssim: "\u2272", LessSlantEqual: "\u2A7D", LessTilde: "\u2272", lfisht: "\u297C", lfloor: "\u230A", Lfr: "\u{1D50F}", lfr: "\u{1D529}", lg: "\u2276", lgE: "\u2A91", lHar: "\u2962", lhard: "\u21BD", lharu: "\u21BC", lharul: "\u296A", lhblk: "\u2584", LJcy: "\u0409", ljcy: "\u0459", llarr: "\u21C7", ll: "\u226A", Ll: "\u22D8", llcorner: "\u231E", Lleftarrow: "\u21DA", llhard: "\u296B", lltri: "\u25FA", Lmidot: "\u013F", lmidot: "\u0140", lmoustache: "\u23B0", lmoust: "\u23B0", lnap: "\u2A89", lnapprox: "\u2A89", lne: "\u2A87", lnE: "\u2268", lneq: "\u2A87", lneqq: "\u2268", lnsim: "\u22E6", loang: "\u27EC", loarr: "\u21FD", lobrk: "\u27E6", longleftarrow: "\u27F5", LongLeftArrow: "\u27F5", Longleftarrow: "\u27F8", longleftrightarrow: "\u27F7", LongLeftRightArrow: "\u27F7", Longleftrightarrow: "\u27FA", longmapsto: "\u27FC", longrightarrow: "\u27F6", LongRightArrow: "\u27F6", Longrightarrow: "\u27F9", looparrowleft: "\u21AB", looparrowright: "\u21AC", lopar: "\u2985", Lopf: "\u{1D543}", lopf: "\u{1D55D}", loplus: "\u2A2D", lotimes: "\u2A34", lowast: "\u2217", lowbar: "_", LowerLeftArrow: "\u2199", LowerRightArrow: "\u2198", loz: "\u25CA", lozenge: "\u25CA", lozf: "\u29EB", lpar: "(", lparlt: "\u2993", lrarr: "\u21C6", lrcorner: "\u231F", lrhar: "\u21CB", lrhard: "\u296D", lrm: "\u200E", lrtri: "\u22BF", lsaquo: "\u2039", lscr: "\u{1D4C1}", Lscr: "\u2112", lsh: "\u21B0", Lsh: "\u21B0", lsim: "\u2272", lsime: "\u2A8D", lsimg: "\u2A8F", lsqb: "[", lsquo: "\u2018", lsquor: "\u201A", Lstrok: "\u0141", lstrok: "\u0142", ltcc: "\u2AA6", ltcir: "\u2A79", lt: "<", LT: "<", Lt: "\u226A", ltdot: "\u22D6", lthree: "\u22CB", ltimes: "\u22C9", ltlarr: "\u2976", ltquest: "\u2A7B", ltri: "\u25C3", ltrie: "\u22B4", ltrif: "\u25C2", ltrPar: "\u2996", lurdshar: "\u294A", luruhar: "\u2966", lvertneqq: "\u2268\uFE00", lvnE: "\u2268\uFE00", macr: "\xAF", male: "\u2642", malt: "\u2720", maltese: "\u2720", Map: "\u2905", map: "\u21A6", mapsto: "\u21A6", mapstodown: "\u21A7", mapstoleft: "\u21A4", mapstoup: "\u21A5", marker: "\u25AE", mcomma: "\u2A29", Mcy: "\u041C", mcy: "\u043C", mdash: "\u2014", mDDot: "\u223A", measuredangle: "\u2221", MediumSpace: "\u205F", Mellintrf: "\u2133", Mfr: "\u{1D510}", mfr: "\u{1D52A}", mho: "\u2127", micro: "\xB5", midast: "*", midcir: "\u2AF0", mid: "\u2223", middot: "\xB7", minusb: "\u229F", minus: "\u2212", minusd: "\u2238", minusdu: "\u2A2A", MinusPlus: "\u2213", mlcp: "\u2ADB", mldr: "\u2026", mnplus: "\u2213", models: "\u22A7", Mopf: "\u{1D544}", mopf: "\u{1D55E}", mp: "\u2213", mscr: "\u{1D4C2}", Mscr: "\u2133", mstpos: "\u223E", Mu: "\u039C", mu: "\u03BC", multimap: "\u22B8", mumap: "\u22B8", nabla: "\u2207", Nacute: "\u0143", nacute: "\u0144", nang: "\u2220\u20D2", nap: "\u2249", napE: "\u2A70\u0338", napid: "\u224B\u0338", napos: "\u0149", napprox: "\u2249", natural: "\u266E", naturals: "\u2115", natur: "\u266E", nbsp: "\xA0", nbump: "\u224E\u0338", nbumpe: "\u224F\u0338", ncap: "\u2A43", Ncaron: "\u0147", ncaron: "\u0148", Ncedil: "\u0145", ncedil: "\u0146", ncong: "\u2247", ncongdot: "\u2A6D\u0338", ncup: "\u2A42", Ncy: "\u041D", ncy: "\u043D", ndash: "\u2013", nearhk: "\u2924", nearr: "\u2197", neArr: "\u21D7", nearrow: "\u2197", ne: "\u2260", nedot: "\u2250\u0338", NegativeMediumSpace: "\u200B", NegativeThickSpace: "\u200B", NegativeThinSpace: "\u200B", NegativeVeryThinSpace: "\u200B", nequiv: "\u2262", nesear: "\u2928", nesim: "\u2242\u0338", NestedGreaterGreater: "\u226B", NestedLessLess: "\u226A", NewLine: "\n", nexist: "\u2204", nexists: "\u2204", Nfr: "\u{1D511}", nfr: "\u{1D52B}", ngE: "\u2267\u0338", nge: "\u2271", ngeq: "\u2271", ngeqq: "\u2267\u0338", ngeqslant: "\u2A7E\u0338", nges: "\u2A7E\u0338", nGg: "\u22D9\u0338", ngsim: "\u2275", nGt: "\u226B\u20D2", ngt: "\u226F", ngtr: "\u226F", nGtv: "\u226B\u0338", nharr: "\u21AE", nhArr: "\u21CE", nhpar: "\u2AF2", ni: "\u220B", nis: "\u22FC", nisd: "\u22FA", niv: "\u220B", NJcy: "\u040A", njcy: "\u045A", nlarr: "\u219A", nlArr: "\u21CD", nldr: "\u2025", nlE: "\u2266\u0338", nle: "\u2270", nleftarrow: "\u219A", nLeftarrow: "\u21CD", nleftrightarrow: "\u21AE", nLeftrightarrow: "\u21CE", nleq: "\u2270", nleqq: "\u2266\u0338", nleqslant: "\u2A7D\u0338", nles: "\u2A7D\u0338", nless: "\u226E", nLl: "\u22D8\u0338", nlsim: "\u2274", nLt: "\u226A\u20D2", nlt: "\u226E", nltri: "\u22EA", nltrie: "\u22EC", nLtv: "\u226A\u0338", nmid: "\u2224", NoBreak: "\u2060", NonBreakingSpace: "\xA0", nopf: "\u{1D55F}", Nopf: "\u2115", Not: "\u2AEC", not: "\xAC", NotCongruent: "\u2262", NotCupCap: "\u226D", NotDoubleVerticalBar: "\u2226", NotElement: "\u2209", NotEqual: "\u2260", NotEqualTilde: "\u2242\u0338", NotExists: "\u2204", NotGreater: "\u226F", NotGreaterEqual: "\u2271", NotGreaterFullEqual: "\u2267\u0338", NotGreaterGreater: "\u226B\u0338", NotGreaterLess: "\u2279", NotGreaterSlantEqual: "\u2A7E\u0338", NotGreaterTilde: "\u2275", NotHumpDownHump: "\u224E\u0338", NotHumpEqual: "\u224F\u0338", notin: "\u2209", notindot: "\u22F5\u0338", notinE: "\u22F9\u0338", notinva: "\u2209", notinvb: "\u22F7", notinvc: "\u22F6", NotLeftTriangleBar: "\u29CF\u0338", NotLeftTriangle: "\u22EA", NotLeftTriangleEqual: "\u22EC", NotLess: "\u226E", NotLessEqual: "\u2270", NotLessGreater: "\u2278", NotLessLess: "\u226A\u0338", NotLessSlantEqual: "\u2A7D\u0338", NotLessTilde: "\u2274", NotNestedGreaterGreater: "\u2AA2\u0338", NotNestedLessLess: "\u2AA1\u0338", notni: "\u220C", notniva: "\u220C", notnivb: "\u22FE", notnivc: "\u22FD", NotPrecedes: "\u2280", NotPrecedesEqual: "\u2AAF\u0338", NotPrecedesSlantEqual: "\u22E0", NotReverseElement: "\u220C", NotRightTriangleBar: "\u29D0\u0338", NotRightTriangle: "\u22EB", NotRightTriangleEqual: "\u22ED", NotSquareSubset: "\u228F\u0338", NotSquareSubsetEqual: "\u22E2", NotSquareSuperset: "\u2290\u0338", NotSquareSupersetEqual: "\u22E3", NotSubset: "\u2282\u20D2", NotSubsetEqual: "\u2288", NotSucceeds: "\u2281", NotSucceedsEqual: "\u2AB0\u0338", NotSucceedsSlantEqual: "\u22E1", NotSucceedsTilde: "\u227F\u0338", NotSuperset: "\u2283\u20D2", NotSupersetEqual: "\u2289", NotTilde: "\u2241", NotTildeEqual: "\u2244", NotTildeFullEqual: "\u2247", NotTildeTilde: "\u2249", NotVerticalBar: "\u2224", nparallel: "\u2226", npar: "\u2226", nparsl: "\u2AFD\u20E5", npart: "\u2202\u0338", npolint: "\u2A14", npr: "\u2280", nprcue: "\u22E0", nprec: "\u2280", npreceq: "\u2AAF\u0338", npre: "\u2AAF\u0338", nrarrc: "\u2933\u0338", nrarr: "\u219B", nrArr: "\u21CF", nrarrw: "\u219D\u0338", nrightarrow: "\u219B", nRightarrow: "\u21CF", nrtri: "\u22EB", nrtrie: "\u22ED", nsc: "\u2281", nsccue: "\u22E1", nsce: "\u2AB0\u0338", Nscr: "\u{1D4A9}", nscr: "\u{1D4C3}", nshortmid: "\u2224", nshortparallel: "\u2226", nsim: "\u2241", nsime: "\u2244", nsimeq: "\u2244", nsmid: "\u2224", nspar: "\u2226", nsqsube: "\u22E2", nsqsupe: "\u22E3", nsub: "\u2284", nsubE: "\u2AC5\u0338", nsube: "\u2288", nsubset: "\u2282\u20D2", nsubseteq: "\u2288", nsubseteqq: "\u2AC5\u0338", nsucc: "\u2281", nsucceq: "\u2AB0\u0338", nsup: "\u2285", nsupE: "\u2AC6\u0338", nsupe: "\u2289", nsupset: "\u2283\u20D2", nsupseteq: "\u2289", nsupseteqq: "\u2AC6\u0338", ntgl: "\u2279", Ntilde: "\xD1", ntilde: "\xF1", ntlg: "\u2278", ntriangleleft: "\u22EA", ntrianglelefteq: "\u22EC", ntriangleright: "\u22EB", ntrianglerighteq: "\u22ED", Nu: "\u039D", nu: "\u03BD", num: "#", numero: "\u2116", numsp: "\u2007", nvap: "\u224D\u20D2", nvdash: "\u22AC", nvDash: "\u22AD", nVdash: "\u22AE", nVDash: "\u22AF", nvge: "\u2265\u20D2", nvgt: ">\u20D2", nvHarr: "\u2904", nvinfin: "\u29DE", nvlArr: "\u2902", nvle: "\u2264\u20D2", nvlt: "<\u20D2", nvltrie: "\u22B4\u20D2", nvrArr: "\u2903", nvrtrie: "\u22B5\u20D2", nvsim: "\u223C\u20D2", nwarhk: "\u2923", nwarr: "\u2196", nwArr: "\u21D6", nwarrow: "\u2196", nwnear: "\u2927", Oacute: "\xD3", oacute: "\xF3", oast: "\u229B", Ocirc: "\xD4", ocirc: "\xF4", ocir: "\u229A", Ocy: "\u041E", ocy: "\u043E", odash: "\u229D", Odblac: "\u0150", odblac: "\u0151", odiv: "\u2A38", odot: "\u2299", odsold: "\u29BC", OElig: "\u0152", oelig: "\u0153", ofcir: "\u29BF", Ofr: "\u{1D512}", ofr: "\u{1D52C}", ogon: "\u02DB", Ograve: "\xD2", ograve: "\xF2", ogt: "\u29C1", ohbar: "\u29B5", ohm: "\u03A9", oint: "\u222E", olarr: "\u21BA", olcir: "\u29BE", olcross: "\u29BB", oline: "\u203E", olt: "\u29C0", Omacr: "\u014C", omacr: "\u014D", Omega: "\u03A9", omega: "\u03C9", Omicron: "\u039F", omicron: "\u03BF", omid: "\u29B6", ominus: "\u2296", Oopf: "\u{1D546}", oopf: "\u{1D560}", opar: "\u29B7", OpenCurlyDoubleQuote: "\u201C", OpenCurlyQuote: "\u2018", operp: "\u29B9", oplus: "\u2295", orarr: "\u21BB", Or: "\u2A54", or: "\u2228", ord: "\u2A5D", order: "\u2134", orderof: "\u2134", ordf: "\xAA", ordm: "\xBA", origof: "\u22B6", oror: "\u2A56", orslope: "\u2A57", orv: "\u2A5B", oS: "\u24C8", Oscr: "\u{1D4AA}", oscr: "\u2134", Oslash: "\xD8", oslash: "\xF8", osol: "\u2298", Otilde: "\xD5", otilde: "\xF5", otimesas: "\u2A36", Otimes: "\u2A37", otimes: "\u2297", Ouml: "\xD6", ouml: "\xF6", ovbar: "\u233D", OverBar: "\u203E", OverBrace: "\u23DE", OverBracket: "\u23B4", OverParenthesis: "\u23DC", para: "\xB6", parallel: "\u2225", par: "\u2225", parsim: "\u2AF3", parsl: "\u2AFD", part: "\u2202", PartialD: "\u2202", Pcy: "\u041F", pcy: "\u043F", percnt: "%", period: ".", permil: "\u2030", perp: "\u22A5", pertenk: "\u2031", Pfr: "\u{1D513}", pfr: "\u{1D52D}", Phi: "\u03A6", phi: "\u03C6", phiv: "\u03D5", phmmat: "\u2133", phone: "\u260E", Pi: "\u03A0", pi: "\u03C0", pitchfork: "\u22D4", piv: "\u03D6", planck: "\u210F", planckh: "\u210E", plankv: "\u210F", plusacir: "\u2A23", plusb: "\u229E", pluscir: "\u2A22", plus: "+", plusdo: "\u2214", plusdu: "\u2A25", pluse: "\u2A72", PlusMinus: "\xB1", plusmn: "\xB1", plussim: "\u2A26", plustwo: "\u2A27", pm: "\xB1", Poincareplane: "\u210C", pointint: "\u2A15", popf: "\u{1D561}", Popf: "\u2119", pound: "\xA3", prap: "\u2AB7", Pr: "\u2ABB", pr: "\u227A", prcue: "\u227C", precapprox: "\u2AB7", prec: "\u227A", preccurlyeq: "\u227C", Precedes: "\u227A", PrecedesEqual: "\u2AAF", PrecedesSlantEqual: "\u227C", PrecedesTilde: "\u227E", preceq: "\u2AAF", precnapprox: "\u2AB9", precneqq: "\u2AB5", precnsim: "\u22E8", pre: "\u2AAF", prE: "\u2AB3", precsim: "\u227E", prime: "\u2032", Prime: "\u2033", primes: "\u2119", prnap: "\u2AB9", prnE: "\u2AB5", prnsim: "\u22E8", prod: "\u220F", Product: "\u220F", profalar: "\u232E", profline: "\u2312", profsurf: "\u2313", prop: "\u221D", Proportional: "\u221D", Proportion: "\u2237", propto: "\u221D", prsim: "\u227E", prurel: "\u22B0", Pscr: "\u{1D4AB}", pscr: "\u{1D4C5}", Psi: "\u03A8", psi: "\u03C8", puncsp: "\u2008", Qfr: "\u{1D514}", qfr: "\u{1D52E}", qint: "\u2A0C", qopf: "\u{1D562}", Qopf: "\u211A", qprime: "\u2057", Qscr: "\u{1D4AC}", qscr: "\u{1D4C6}", quaternions: "\u210D", quatint: "\u2A16", quest: "?", questeq: "\u225F", quot: '"', QUOT: '"', rAarr: "\u21DB", race: "\u223D\u0331", Racute: "\u0154", racute: "\u0155", radic: "\u221A", raemptyv: "\u29B3", rang: "\u27E9", Rang: "\u27EB", rangd: "\u2992", range: "\u29A5", rangle: "\u27E9", raquo: "\xBB", rarrap: "\u2975", rarrb: "\u21E5", rarrbfs: "\u2920", rarrc: "\u2933", rarr: "\u2192", Rarr: "\u21A0", rArr: "\u21D2", rarrfs: "\u291E", rarrhk: "\u21AA", rarrlp: "\u21AC", rarrpl: "\u2945", rarrsim: "\u2974", Rarrtl: "\u2916", rarrtl: "\u21A3", rarrw: "\u219D", ratail: "\u291A", rAtail: "\u291C", ratio: "\u2236", rationals: "\u211A", rbarr: "\u290D", rBarr: "\u290F", RBarr: "\u2910", rbbrk: "\u2773", rbrace: "}", rbrack: "]", rbrke: "\u298C", rbrksld: "\u298E", rbrkslu: "\u2990", Rcaron: "\u0158", rcaron: "\u0159", Rcedil: "\u0156", rcedil: "\u0157", rceil: "\u2309", rcub: "}", Rcy: "\u0420", rcy: "\u0440", rdca: "\u2937", rdldhar: "\u2969", rdquo: "\u201D", rdquor: "\u201D", rdsh: "\u21B3", real: "\u211C", realine: "\u211B", realpart: "\u211C", reals: "\u211D", Re: "\u211C", rect: "\u25AD", reg: "\xAE", REG: "\xAE", ReverseElement: "\u220B", ReverseEquilibrium: "\u21CB", ReverseUpEquilibrium: "\u296F", rfisht: "\u297D", rfloor: "\u230B", rfr: "\u{1D52F}", Rfr: "\u211C", rHar: "\u2964", rhard: "\u21C1", rharu: "\u21C0", rharul: "\u296C", Rho: "\u03A1", rho: "\u03C1", rhov: "\u03F1", RightAngleBracket: "\u27E9", RightArrowBar: "\u21E5", rightarrow: "\u2192", RightArrow: "\u2192", Rightarrow: "\u21D2", RightArrowLeftArrow: "\u21C4", rightarrowtail: "\u21A3", RightCeiling: "\u2309", RightDoubleBracket: "\u27E7", RightDownTeeVector: "\u295D", RightDownVectorBar: "\u2955", RightDownVector: "\u21C2", RightFloor: "\u230B", rightharpoondown: "\u21C1", rightharpoonup: "\u21C0", rightleftarrows: "\u21C4", rightleftharpoons: "\u21CC", rightrightarrows: "\u21C9", rightsquigarrow: "\u219D", RightTeeArrow: "\u21A6", RightTee: "\u22A2", RightTeeVector: "\u295B", rightthreetimes: "\u22CC", RightTriangleBar: "\u29D0", RightTriangle: "\u22B3", RightTriangleEqual: "\u22B5", RightUpDownVector: "\u294F", RightUpTeeVector: "\u295C", RightUpVectorBar: "\u2954", RightUpVector: "\u21BE", RightVectorBar: "\u2953", RightVector: "\u21C0", ring: "\u02DA", risingdotseq: "\u2253", rlarr: "\u21C4", rlhar: "\u21CC", rlm: "\u200F", rmoustache: "\u23B1", rmoust: "\u23B1", rnmid: "\u2AEE", roang: "\u27ED", roarr: "\u21FE", robrk: "\u27E7", ropar: "\u2986", ropf: "\u{1D563}", Ropf: "\u211D", roplus: "\u2A2E", rotimes: "\u2A35", RoundImplies: "\u2970", rpar: ")", rpargt: "\u2994", rppolint: "\u2A12", rrarr: "\u21C9", Rrightarrow: "\u21DB", rsaquo: "\u203A", rscr: "\u{1D4C7}", Rscr: "\u211B", rsh: "\u21B1", Rsh: "\u21B1", rsqb: "]", rsquo: "\u2019", rsquor: "\u2019", rthree: "\u22CC", rtimes: "\u22CA", rtri: "\u25B9", rtrie: "\u22B5", rtrif: "\u25B8", rtriltri: "\u29CE", RuleDelayed: "\u29F4", ruluhar: "\u2968", rx: "\u211E", Sacute: "\u015A", sacute: "\u015B", sbquo: "\u201A", scap: "\u2AB8", Scaron: "\u0160", scaron: "\u0161", Sc: "\u2ABC", sc: "\u227B", sccue: "\u227D", sce: "\u2AB0", scE: "\u2AB4", Scedil: "\u015E", scedil: "\u015F", Scirc: "\u015C", scirc: "\u015D", scnap: "\u2ABA", scnE: "\u2AB6", scnsim: "\u22E9", scpolint: "\u2A13", scsim: "\u227F", Scy: "\u0421", scy: "\u0441", sdotb: "\u22A1", sdot: "\u22C5", sdote: "\u2A66", searhk: "\u2925", searr: "\u2198", seArr: "\u21D8", searrow: "\u2198", sect: "\xA7", semi: ";", seswar: "\u2929", setminus: "\u2216", setmn: "\u2216", sext: "\u2736", Sfr: "\u{1D516}", sfr: "\u{1D530}", sfrown: "\u2322", sharp: "\u266F", SHCHcy: "\u0429", shchcy: "\u0449", SHcy: "\u0428", shcy: "\u0448", ShortDownArrow: "\u2193", ShortLeftArrow: "\u2190", shortmid: "\u2223", shortparallel: "\u2225", ShortRightArrow: "\u2192", ShortUpArrow: "\u2191", shy: "\xAD", Sigma: "\u03A3", sigma: "\u03C3", sigmaf: "\u03C2", sigmav: "\u03C2", sim: "\u223C", simdot: "\u2A6A", sime: "\u2243", simeq: "\u2243", simg: "\u2A9E", simgE: "\u2AA0", siml: "\u2A9D", simlE: "\u2A9F", simne: "\u2246", simplus: "\u2A24", simrarr: "\u2972", slarr: "\u2190", SmallCircle: "\u2218", smallsetminus: "\u2216", smashp: "\u2A33", smeparsl: "\u29E4", smid: "\u2223", smile: "\u2323", smt: "\u2AAA", smte: "\u2AAC", smtes: "\u2AAC\uFE00", SOFTcy: "\u042C", softcy: "\u044C", solbar: "\u233F", solb: "\u29C4", sol: "/", Sopf: "\u{1D54A}", sopf: "\u{1D564}", spades: "\u2660", spadesuit: "\u2660", spar: "\u2225", sqcap: "\u2293", sqcaps: "\u2293\uFE00", sqcup: "\u2294", sqcups: "\u2294\uFE00", Sqrt: "\u221A", sqsub: "\u228F", sqsube: "\u2291", sqsubset: "\u228F", sqsubseteq: "\u2291", sqsup: "\u2290", sqsupe: "\u2292", sqsupset: "\u2290", sqsupseteq: "\u2292", square: "\u25A1", Square: "\u25A1", SquareIntersection: "\u2293", SquareSubset: "\u228F", SquareSubsetEqual: "\u2291", SquareSuperset: "\u2290", SquareSupersetEqual: "\u2292", SquareUnion: "\u2294", squarf: "\u25AA", squ: "\u25A1", squf: "\u25AA", srarr: "\u2192", Sscr: "\u{1D4AE}", sscr: "\u{1D4C8}", ssetmn: "\u2216", ssmile: "\u2323", sstarf: "\u22C6", Star: "\u22C6", star: "\u2606", starf: "\u2605", straightepsilon: "\u03F5", straightphi: "\u03D5", strns: "\xAF", sub: "\u2282", Sub: "\u22D0", subdot: "\u2ABD", subE: "\u2AC5", sube: "\u2286", subedot: "\u2AC3", submult: "\u2AC1", subnE: "\u2ACB", subne: "\u228A", subplus: "\u2ABF", subrarr: "\u2979", subset: "\u2282", Subset: "\u22D0", subseteq: "\u2286", subseteqq: "\u2AC5", SubsetEqual: "\u2286", subsetneq: "\u228A", subsetneqq: "\u2ACB", subsim: "\u2AC7", subsub: "\u2AD5", subsup: "\u2AD3", succapprox: "\u2AB8", succ: "\u227B", succcurlyeq: "\u227D", Succeeds: "\u227B", SucceedsEqual: "\u2AB0", SucceedsSlantEqual: "\u227D", SucceedsTilde: "\u227F", succeq: "\u2AB0", succnapprox: "\u2ABA", succneqq: "\u2AB6", succnsim: "\u22E9", succsim: "\u227F", SuchThat: "\u220B", sum: "\u2211", Sum: "\u2211", sung: "\u266A", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", sup: "\u2283", Sup: "\u22D1", supdot: "\u2ABE", supdsub: "\u2AD8", supE: "\u2AC6", supe: "\u2287", supedot: "\u2AC4", Superset: "\u2283", SupersetEqual: "\u2287", suphsol: "\u27C9", suphsub: "\u2AD7", suplarr: "\u297B", supmult: "\u2AC2", supnE: "\u2ACC", supne: "\u228B", supplus: "\u2AC0", supset: "\u2283", Supset: "\u22D1", supseteq: "\u2287", supseteqq: "\u2AC6", supsetneq: "\u228B", supsetneqq: "\u2ACC", supsim: "\u2AC8", supsub: "\u2AD4", supsup: "\u2AD6", swarhk: "\u2926", swarr: "\u2199", swArr: "\u21D9", swarrow: "\u2199", swnwar: "\u292A", szlig: "\xDF", Tab: "	", target: "\u2316", Tau: "\u03A4", tau: "\u03C4", tbrk: "\u23B4", Tcaron: "\u0164", tcaron: "\u0165", Tcedil: "\u0162", tcedil: "\u0163", Tcy: "\u0422", tcy: "\u0442", tdot: "\u20DB", telrec: "\u2315", Tfr: "\u{1D517}", tfr: "\u{1D531}", there4: "\u2234", therefore: "\u2234", Therefore: "\u2234", Theta: "\u0398", theta: "\u03B8", thetasym: "\u03D1", thetav: "\u03D1", thickapprox: "\u2248", thicksim: "\u223C", ThickSpace: "\u205F\u200A", ThinSpace: "\u2009", thinsp: "\u2009", thkap: "\u2248", thksim: "\u223C", THORN: "\xDE", thorn: "\xFE", tilde: "\u02DC", Tilde: "\u223C", TildeEqual: "\u2243", TildeFullEqual: "\u2245", TildeTilde: "\u2248", timesbar: "\u2A31", timesb: "\u22A0", times: "\xD7", timesd: "\u2A30", tint: "\u222D", toea: "\u2928", topbot: "\u2336", topcir: "\u2AF1", top: "\u22A4", Topf: "\u{1D54B}", topf: "\u{1D565}", topfork: "\u2ADA", tosa: "\u2929", tprime: "\u2034", trade: "\u2122", TRADE: "\u2122", triangle: "\u25B5", triangledown: "\u25BF", triangleleft: "\u25C3", trianglelefteq: "\u22B4", triangleq: "\u225C", triangleright: "\u25B9", trianglerighteq: "\u22B5", tridot: "\u25EC", trie: "\u225C", triminus: "\u2A3A", TripleDot: "\u20DB", triplus: "\u2A39", trisb: "\u29CD", tritime: "\u2A3B", trpezium: "\u23E2", Tscr: "\u{1D4AF}", tscr: "\u{1D4C9}", TScy: "\u0426", tscy: "\u0446", TSHcy: "\u040B", tshcy: "\u045B", Tstrok: "\u0166", tstrok: "\u0167", twixt: "\u226C", twoheadleftarrow: "\u219E", twoheadrightarrow: "\u21A0", Uacute: "\xDA", uacute: "\xFA", uarr: "\u2191", Uarr: "\u219F", uArr: "\u21D1", Uarrocir: "\u2949", Ubrcy: "\u040E", ubrcy: "\u045E", Ubreve: "\u016C", ubreve: "\u016D", Ucirc: "\xDB", ucirc: "\xFB", Ucy: "\u0423", ucy: "\u0443", udarr: "\u21C5", Udblac: "\u0170", udblac: "\u0171", udhar: "\u296E", ufisht: "\u297E", Ufr: "\u{1D518}", ufr: "\u{1D532}", Ugrave: "\xD9", ugrave: "\xF9", uHar: "\u2963", uharl: "\u21BF", uharr: "\u21BE", uhblk: "\u2580", ulcorn: "\u231C", ulcorner: "\u231C", ulcrop: "\u230F", ultri: "\u25F8", Umacr: "\u016A", umacr: "\u016B", uml: "\xA8", UnderBar: "_", UnderBrace: "\u23DF", UnderBracket: "\u23B5", UnderParenthesis: "\u23DD", Union: "\u22C3", UnionPlus: "\u228E", Uogon: "\u0172", uogon: "\u0173", Uopf: "\u{1D54C}", uopf: "\u{1D566}", UpArrowBar: "\u2912", uparrow: "\u2191", UpArrow: "\u2191", Uparrow: "\u21D1", UpArrowDownArrow: "\u21C5", updownarrow: "\u2195", UpDownArrow: "\u2195", Updownarrow: "\u21D5", UpEquilibrium: "\u296E", upharpoonleft: "\u21BF", upharpoonright: "\u21BE", uplus: "\u228E", UpperLeftArrow: "\u2196", UpperRightArrow: "\u2197", upsi: "\u03C5", Upsi: "\u03D2", upsih: "\u03D2", Upsilon: "\u03A5", upsilon: "\u03C5", UpTeeArrow: "\u21A5", UpTee: "\u22A5", upuparrows: "\u21C8", urcorn: "\u231D", urcorner: "\u231D", urcrop: "\u230E", Uring: "\u016E", uring: "\u016F", urtri: "\u25F9", Uscr: "\u{1D4B0}", uscr: "\u{1D4CA}", utdot: "\u22F0", Utilde: "\u0168", utilde: "\u0169", utri: "\u25B5", utrif: "\u25B4", uuarr: "\u21C8", Uuml: "\xDC", uuml: "\xFC", uwangle: "\u29A7", vangrt: "\u299C", varepsilon: "\u03F5", varkappa: "\u03F0", varnothing: "\u2205", varphi: "\u03D5", varpi: "\u03D6", varpropto: "\u221D", varr: "\u2195", vArr: "\u21D5", varrho: "\u03F1", varsigma: "\u03C2", varsubsetneq: "\u228A\uFE00", varsubsetneqq: "\u2ACB\uFE00", varsupsetneq: "\u228B\uFE00", varsupsetneqq: "\u2ACC\uFE00", vartheta: "\u03D1", vartriangleleft: "\u22B2", vartriangleright: "\u22B3", vBar: "\u2AE8", Vbar: "\u2AEB", vBarv: "\u2AE9", Vcy: "\u0412", vcy: "\u0432", vdash: "\u22A2", vDash: "\u22A8", Vdash: "\u22A9", VDash: "\u22AB", Vdashl: "\u2AE6", veebar: "\u22BB", vee: "\u2228", Vee: "\u22C1", veeeq: "\u225A", vellip: "\u22EE", verbar: "|", Verbar: "\u2016", vert: "|", Vert: "\u2016", VerticalBar: "\u2223", VerticalLine: "|", VerticalSeparator: "\u2758", VerticalTilde: "\u2240", VeryThinSpace: "\u200A", Vfr: "\u{1D519}", vfr: "\u{1D533}", vltri: "\u22B2", vnsub: "\u2282\u20D2", vnsup: "\u2283\u20D2", Vopf: "\u{1D54D}", vopf: "\u{1D567}", vprop: "\u221D", vrtri: "\u22B3", Vscr: "\u{1D4B1}", vscr: "\u{1D4CB}", vsubnE: "\u2ACB\uFE00", vsubne: "\u228A\uFE00", vsupnE: "\u2ACC\uFE00", vsupne: "\u228B\uFE00", Vvdash: "\u22AA", vzigzag: "\u299A", Wcirc: "\u0174", wcirc: "\u0175", wedbar: "\u2A5F", wedge: "\u2227", Wedge: "\u22C0", wedgeq: "\u2259", weierp: "\u2118", Wfr: "\u{1D51A}", wfr: "\u{1D534}", Wopf: "\u{1D54E}", wopf: "\u{1D568}", wp: "\u2118", wr: "\u2240", wreath: "\u2240", Wscr: "\u{1D4B2}", wscr: "\u{1D4CC}", xcap: "\u22C2", xcirc: "\u25EF", xcup: "\u22C3", xdtri: "\u25BD", Xfr: "\u{1D51B}", xfr: "\u{1D535}", xharr: "\u27F7", xhArr: "\u27FA", Xi: "\u039E", xi: "\u03BE", xlarr: "\u27F5", xlArr: "\u27F8", xmap: "\u27FC", xnis: "\u22FB", xodot: "\u2A00", Xopf: "\u{1D54F}", xopf: "\u{1D569}", xoplus: "\u2A01", xotime: "\u2A02", xrarr: "\u27F6", xrArr: "\u27F9", Xscr: "\u{1D4B3}", xscr: "\u{1D4CD}", xsqcup: "\u2A06", xuplus: "\u2A04", xutri: "\u25B3", xvee: "\u22C1", xwedge: "\u22C0", Yacute: "\xDD", yacute: "\xFD", YAcy: "\u042F", yacy: "\u044F", Ycirc: "\u0176", ycirc: "\u0177", Ycy: "\u042B", ycy: "\u044B", yen: "\xA5", Yfr: "\u{1D51C}", yfr: "\u{1D536}", YIcy: "\u0407", yicy: "\u0457", Yopf: "\u{1D550}", yopf: "\u{1D56A}", Yscr: "\u{1D4B4}", yscr: "\u{1D4CE}", YUcy: "\u042E", yucy: "\u044E", yuml: "\xFF", Yuml: "\u0178", Zacute: "\u0179", zacute: "\u017A", Zcaron: "\u017D", zcaron: "\u017E", Zcy: "\u0417", zcy: "\u0437", Zdot: "\u017B", zdot: "\u017C", zeetrf: "\u2128", ZeroWidthSpace: "\u200B", Zeta: "\u0396", zeta: "\u03B6", zfr: "\u{1D537}", Zfr: "\u2128", ZHcy: "\u0416", zhcy: "\u0436", zigrarr: "\u21DD", zopf: "\u{1D56B}", Zopf: "\u2124", Zscr: "\u{1D4B5}", zscr: "\u{1D4CF}", zwj: "\u200D", zwnj: "\u200C" };
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/maps/legacy.json
var require_legacy = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/maps/legacy.json"(exports2, module2) {
    module2.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9", eacute: "\xE9", Ecirc: "\xCA", ecirc: "\xEA", Egrave: "\xC8", egrave: "\xE8", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", frac12: "\xBD", frac14: "\xBC", frac34: "\xBE", gt: ">", GT: ">", Iacute: "\xCD", iacute: "\xED", Icirc: "\xCE", icirc: "\xEE", iexcl: "\xA1", Igrave: "\xCC", igrave: "\xEC", iquest: "\xBF", Iuml: "\xCF", iuml: "\xEF", laquo: "\xAB", lt: "<", LT: "<", macr: "\xAF", micro: "\xB5", middot: "\xB7", nbsp: "\xA0", not: "\xAC", Ntilde: "\xD1", ntilde: "\xF1", Oacute: "\xD3", oacute: "\xF3", Ocirc: "\xD4", ocirc: "\xF4", Ograve: "\xD2", ograve: "\xF2", ordf: "\xAA", ordm: "\xBA", Oslash: "\xD8", oslash: "\xF8", Otilde: "\xD5", otilde: "\xF5", Ouml: "\xD6", ouml: "\xF6", para: "\xB6", plusmn: "\xB1", pound: "\xA3", quot: '"', QUOT: '"', raquo: "\xBB", reg: "\xAE", REG: "\xAE", sect: "\xA7", shy: "\xAD", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", szlig: "\xDF", THORN: "\xDE", thorn: "\xFE", times: "\xD7", Uacute: "\xDA", uacute: "\xFA", Ucirc: "\xDB", ucirc: "\xFB", Ugrave: "\xD9", ugrave: "\xF9", uml: "\xA8", Uuml: "\xDC", uuml: "\xFC", Yacute: "\xDD", yacute: "\xFD", yen: "\xA5", yuml: "\xFF" };
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/maps/xml.json
var require_xml = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/maps/xml.json"(exports2, module2) {
    module2.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
  }
});

// node_modules/htmlparser2/lib/Tokenizer.js
var require_Tokenizer = __commonJS({
  "node_modules/htmlparser2/lib/Tokenizer.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    var decode_codepoint_1 = __importDefault2(require_decode_codepoint());
    var entities_json_1 = __importDefault2(require_entities());
    var legacy_json_1 = __importDefault2(require_legacy());
    var xml_json_1 = __importDefault2(require_xml());
    function whitespace(c) {
      return c === " " || c === "\n" || c === "	" || c === "\f" || c === "\r";
    }
    function isASCIIAlpha(c) {
      return c >= "a" && c <= "z" || c >= "A" && c <= "Z";
    }
    function ifElseState(upper, SUCCESS, FAILURE) {
      var lower = upper.toLowerCase();
      if (upper === lower) {
        return function(t, c) {
          if (c === lower) {
            t._state = SUCCESS;
          } else {
            t._state = FAILURE;
            t._index--;
          }
        };
      }
      return function(t, c) {
        if (c === lower || c === upper) {
          t._state = SUCCESS;
        } else {
          t._state = FAILURE;
          t._index--;
        }
      };
    }
    function consumeSpecialNameChar(upper, NEXT_STATE) {
      var lower = upper.toLowerCase();
      return function(t, c) {
        if (c === lower || c === upper) {
          t._state = NEXT_STATE;
        } else {
          t._state = 3;
          t._index--;
        }
      };
    }
    var stateBeforeCdata1 = ifElseState(
      "C",
      24,
      16
      /* InDeclaration */
    );
    var stateBeforeCdata2 = ifElseState(
      "D",
      25,
      16
      /* InDeclaration */
    );
    var stateBeforeCdata3 = ifElseState(
      "A",
      26,
      16
      /* InDeclaration */
    );
    var stateBeforeCdata4 = ifElseState(
      "T",
      27,
      16
      /* InDeclaration */
    );
    var stateBeforeCdata5 = ifElseState(
      "A",
      28,
      16
      /* InDeclaration */
    );
    var stateBeforeScript1 = consumeSpecialNameChar(
      "R",
      35
      /* BeforeScript2 */
    );
    var stateBeforeScript2 = consumeSpecialNameChar(
      "I",
      36
      /* BeforeScript3 */
    );
    var stateBeforeScript3 = consumeSpecialNameChar(
      "P",
      37
      /* BeforeScript4 */
    );
    var stateBeforeScript4 = consumeSpecialNameChar(
      "T",
      38
      /* BeforeScript5 */
    );
    var stateAfterScript1 = ifElseState(
      "R",
      40,
      1
      /* Text */
    );
    var stateAfterScript2 = ifElseState(
      "I",
      41,
      1
      /* Text */
    );
    var stateAfterScript3 = ifElseState(
      "P",
      42,
      1
      /* Text */
    );
    var stateAfterScript4 = ifElseState(
      "T",
      43,
      1
      /* Text */
    );
    var stateBeforeStyle1 = consumeSpecialNameChar(
      "Y",
      45
      /* BeforeStyle2 */
    );
    var stateBeforeStyle2 = consumeSpecialNameChar(
      "L",
      46
      /* BeforeStyle3 */
    );
    var stateBeforeStyle3 = consumeSpecialNameChar(
      "E",
      47
      /* BeforeStyle4 */
    );
    var stateAfterStyle1 = ifElseState(
      "Y",
      49,
      1
      /* Text */
    );
    var stateAfterStyle2 = ifElseState(
      "L",
      50,
      1
      /* Text */
    );
    var stateAfterStyle3 = ifElseState(
      "E",
      51,
      1
      /* Text */
    );
    var stateBeforeSpecialT = consumeSpecialNameChar(
      "I",
      54
      /* BeforeTitle1 */
    );
    var stateBeforeTitle1 = consumeSpecialNameChar(
      "T",
      55
      /* BeforeTitle2 */
    );
    var stateBeforeTitle2 = consumeSpecialNameChar(
      "L",
      56
      /* BeforeTitle3 */
    );
    var stateBeforeTitle3 = consumeSpecialNameChar(
      "E",
      57
      /* BeforeTitle4 */
    );
    var stateAfterSpecialTEnd = ifElseState(
      "I",
      58,
      1
      /* Text */
    );
    var stateAfterTitle1 = ifElseState(
      "T",
      59,
      1
      /* Text */
    );
    var stateAfterTitle2 = ifElseState(
      "L",
      60,
      1
      /* Text */
    );
    var stateAfterTitle3 = ifElseState(
      "E",
      61,
      1
      /* Text */
    );
    var stateBeforeEntity = ifElseState(
      "#",
      63,
      64
      /* InNamedEntity */
    );
    var stateBeforeNumericEntity = ifElseState(
      "X",
      66,
      65
      /* InNumericEntity */
    );
    var Tokenizer = (
      /** @class */
      function() {
        function Tokenizer2(options, cbs) {
          var _a;
          this._state = 1;
          this.buffer = "";
          this.sectionStart = 0;
          this._index = 0;
          this.bufferOffset = 0;
          this.baseState = 1;
          this.special = 1;
          this.running = true;
          this.ended = false;
          this.cbs = cbs;
          this.xmlMode = !!(options === null || options === void 0 ? void 0 : options.xmlMode);
          this.decodeEntities = (_a = options === null || options === void 0 ? void 0 : options.decodeEntities) !== null && _a !== void 0 ? _a : true;
        }
        Tokenizer2.prototype.reset = function() {
          this._state = 1;
          this.buffer = "";
          this.sectionStart = 0;
          this._index = 0;
          this.bufferOffset = 0;
          this.baseState = 1;
          this.special = 1;
          this.running = true;
          this.ended = false;
        };
        Tokenizer2.prototype.write = function(chunk) {
          if (this.ended)
            this.cbs.onerror(Error(".write() after done!"));
          this.buffer += chunk;
          this.parse();
        };
        Tokenizer2.prototype.end = function(chunk) {
          if (this.ended)
            this.cbs.onerror(Error(".end() after done!"));
          if (chunk)
            this.write(chunk);
          this.ended = true;
          if (this.running)
            this.finish();
        };
        Tokenizer2.prototype.pause = function() {
          this.running = false;
        };
        Tokenizer2.prototype.resume = function() {
          this.running = true;
          if (this._index < this.buffer.length) {
            this.parse();
          }
          if (this.ended) {
            this.finish();
          }
        };
        Tokenizer2.prototype.getAbsoluteIndex = function() {
          return this.bufferOffset + this._index;
        };
        Tokenizer2.prototype.stateText = function(c) {
          if (c === "<") {
            if (this._index > this.sectionStart) {
              this.cbs.ontext(this.getSection());
            }
            this._state = 2;
            this.sectionStart = this._index;
          } else if (this.decodeEntities && c === "&" && (this.special === 1 || this.special === 4)) {
            if (this._index > this.sectionStart) {
              this.cbs.ontext(this.getSection());
            }
            this.baseState = 1;
            this._state = 62;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.isTagStartChar = function(c) {
          return isASCIIAlpha(c) || this.xmlMode && !whitespace(c) && c !== "/" && c !== ">";
        };
        Tokenizer2.prototype.stateBeforeTagName = function(c) {
          if (c === "/") {
            this._state = 5;
          } else if (c === "<") {
            this.cbs.ontext(this.getSection());
            this.sectionStart = this._index;
          } else if (c === ">" || this.special !== 1 || whitespace(c)) {
            this._state = 1;
          } else if (c === "!") {
            this._state = 15;
            this.sectionStart = this._index + 1;
          } else if (c === "?") {
            this._state = 17;
            this.sectionStart = this._index + 1;
          } else if (!this.isTagStartChar(c)) {
            this._state = 1;
          } else {
            this._state = !this.xmlMode && (c === "s" || c === "S") ? 32 : !this.xmlMode && (c === "t" || c === "T") ? 52 : 3;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.stateInTagName = function(c) {
          if (c === "/" || c === ">" || whitespace(c)) {
            this.emitToken("onopentagname");
            this._state = 8;
            this._index--;
          }
        };
        Tokenizer2.prototype.stateBeforeClosingTagName = function(c) {
          if (whitespace(c)) {
          } else if (c === ">") {
            this._state = 1;
          } else if (this.special !== 1) {
            if (this.special !== 4 && (c === "s" || c === "S")) {
              this._state = 33;
            } else if (this.special === 4 && (c === "t" || c === "T")) {
              this._state = 53;
            } else {
              this._state = 1;
              this._index--;
            }
          } else if (!this.isTagStartChar(c)) {
            this._state = 20;
            this.sectionStart = this._index;
          } else {
            this._state = 6;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.stateInClosingTagName = function(c) {
          if (c === ">" || whitespace(c)) {
            this.emitToken("onclosetag");
            this._state = 7;
            this._index--;
          }
        };
        Tokenizer2.prototype.stateAfterClosingTagName = function(c) {
          if (c === ">") {
            this._state = 1;
            this.sectionStart = this._index + 1;
          }
        };
        Tokenizer2.prototype.stateBeforeAttributeName = function(c) {
          if (c === ">") {
            this.cbs.onopentagend();
            this._state = 1;
            this.sectionStart = this._index + 1;
          } else if (c === "/") {
            this._state = 4;
          } else if (!whitespace(c)) {
            this._state = 9;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.stateInSelfClosingTag = function(c) {
          if (c === ">") {
            this.cbs.onselfclosingtag();
            this._state = 1;
            this.sectionStart = this._index + 1;
            this.special = 1;
          } else if (!whitespace(c)) {
            this._state = 8;
            this._index--;
          }
        };
        Tokenizer2.prototype.stateInAttributeName = function(c) {
          if (c === "=" || c === "/" || c === ">" || whitespace(c)) {
            this.cbs.onattribname(this.getSection());
            this.sectionStart = -1;
            this._state = 10;
            this._index--;
          }
        };
        Tokenizer2.prototype.stateAfterAttributeName = function(c) {
          if (c === "=") {
            this._state = 11;
          } else if (c === "/" || c === ">") {
            this.cbs.onattribend(void 0);
            this._state = 8;
            this._index--;
          } else if (!whitespace(c)) {
            this.cbs.onattribend(void 0);
            this._state = 9;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.stateBeforeAttributeValue = function(c) {
          if (c === '"') {
            this._state = 12;
            this.sectionStart = this._index + 1;
          } else if (c === "'") {
            this._state = 13;
            this.sectionStart = this._index + 1;
          } else if (!whitespace(c)) {
            this._state = 14;
            this.sectionStart = this._index;
            this._index--;
          }
        };
        Tokenizer2.prototype.handleInAttributeValue = function(c, quote) {
          if (c === quote) {
            this.emitToken("onattribdata");
            this.cbs.onattribend(quote);
            this._state = 8;
          } else if (this.decodeEntities && c === "&") {
            this.emitToken("onattribdata");
            this.baseState = this._state;
            this._state = 62;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.stateInAttributeValueDoubleQuotes = function(c) {
          this.handleInAttributeValue(c, '"');
        };
        Tokenizer2.prototype.stateInAttributeValueSingleQuotes = function(c) {
          this.handleInAttributeValue(c, "'");
        };
        Tokenizer2.prototype.stateInAttributeValueNoQuotes = function(c) {
          if (whitespace(c) || c === ">") {
            this.emitToken("onattribdata");
            this.cbs.onattribend(null);
            this._state = 8;
            this._index--;
          } else if (this.decodeEntities && c === "&") {
            this.emitToken("onattribdata");
            this.baseState = this._state;
            this._state = 62;
            this.sectionStart = this._index;
          }
        };
        Tokenizer2.prototype.stateBeforeDeclaration = function(c) {
          this._state = c === "[" ? 23 : c === "-" ? 18 : 16;
        };
        Tokenizer2.prototype.stateInDeclaration = function(c) {
          if (c === ">") {
            this.cbs.ondeclaration(this.getSection());
            this._state = 1;
            this.sectionStart = this._index + 1;
          }
        };
        Tokenizer2.prototype.stateInProcessingInstruction = function(c) {
          if (c === ">") {
            this.cbs.onprocessinginstruction(this.getSection());
            this._state = 1;
            this.sectionStart = this._index + 1;
          }
        };
        Tokenizer2.prototype.stateBeforeComment = function(c) {
          if (c === "-") {
            this._state = 19;
            this.sectionStart = this._index + 1;
          } else {
            this._state = 16;
          }
        };
        Tokenizer2.prototype.stateInComment = function(c) {
          if (c === "-")
            this._state = 21;
        };
        Tokenizer2.prototype.stateInSpecialComment = function(c) {
          if (c === ">") {
            this.cbs.oncomment(this.buffer.substring(this.sectionStart, this._index));
            this._state = 1;
            this.sectionStart = this._index + 1;
          }
        };
        Tokenizer2.prototype.stateAfterComment1 = function(c) {
          if (c === "-") {
            this._state = 22;
          } else {
            this._state = 19;
          }
        };
        Tokenizer2.prototype.stateAfterComment2 = function(c) {
          if (c === ">") {
            this.cbs.oncomment(this.buffer.substring(this.sectionStart, this._index - 2));
            this._state = 1;
            this.sectionStart = this._index + 1;
          } else if (c !== "-") {
            this._state = 19;
          }
        };
        Tokenizer2.prototype.stateBeforeCdata6 = function(c) {
          if (c === "[") {
            this._state = 29;
            this.sectionStart = this._index + 1;
          } else {
            this._state = 16;
            this._index--;
          }
        };
        Tokenizer2.prototype.stateInCdata = function(c) {
          if (c === "]")
            this._state = 30;
        };
        Tokenizer2.prototype.stateAfterCdata1 = function(c) {
          if (c === "]")
            this._state = 31;
          else
            this._state = 29;
        };
        Tokenizer2.prototype.stateAfterCdata2 = function(c) {
          if (c === ">") {
            this.cbs.oncdata(this.buffer.substring(this.sectionStart, this._index - 2));
            this._state = 1;
            this.sectionStart = this._index + 1;
          } else if (c !== "]") {
            this._state = 29;
          }
        };
        Tokenizer2.prototype.stateBeforeSpecialS = function(c) {
          if (c === "c" || c === "C") {
            this._state = 34;
          } else if (c === "t" || c === "T") {
            this._state = 44;
          } else {
            this._state = 3;
            this._index--;
          }
        };
        Tokenizer2.prototype.stateBeforeSpecialSEnd = function(c) {
          if (this.special === 2 && (c === "c" || c === "C")) {
            this._state = 39;
          } else if (this.special === 3 && (c === "t" || c === "T")) {
            this._state = 48;
          } else
            this._state = 1;
        };
        Tokenizer2.prototype.stateBeforeSpecialLast = function(c, special) {
          if (c === "/" || c === ">" || whitespace(c)) {
            this.special = special;
          }
          this._state = 3;
          this._index--;
        };
        Tokenizer2.prototype.stateAfterSpecialLast = function(c, sectionStartOffset) {
          if (c === ">" || whitespace(c)) {
            this.special = 1;
            this._state = 6;
            this.sectionStart = this._index - sectionStartOffset;
            this._index--;
          } else
            this._state = 1;
        };
        Tokenizer2.prototype.parseFixedEntity = function(map) {
          if (map === void 0) {
            map = this.xmlMode ? xml_json_1.default : entities_json_1.default;
          }
          if (this.sectionStart + 1 < this._index) {
            var entity = this.buffer.substring(this.sectionStart + 1, this._index);
            if (Object.prototype.hasOwnProperty.call(map, entity)) {
              this.emitPartial(map[entity]);
              this.sectionStart = this._index + 1;
            }
          }
        };
        Tokenizer2.prototype.parseLegacyEntity = function() {
          var start2 = this.sectionStart + 1;
          var limit = Math.min(this._index - start2, 6);
          while (limit >= 2) {
            var entity = this.buffer.substr(start2, limit);
            if (Object.prototype.hasOwnProperty.call(legacy_json_1.default, entity)) {
              this.emitPartial(legacy_json_1.default[entity]);
              this.sectionStart += limit + 1;
              return;
            }
            limit--;
          }
        };
        Tokenizer2.prototype.stateInNamedEntity = function(c) {
          if (c === ";") {
            this.parseFixedEntity();
            if (this.baseState === 1 && this.sectionStart + 1 < this._index && !this.xmlMode) {
              this.parseLegacyEntity();
            }
            this._state = this.baseState;
          } else if ((c < "0" || c > "9") && !isASCIIAlpha(c)) {
            if (this.xmlMode || this.sectionStart + 1 === this._index) {
            } else if (this.baseState !== 1) {
              if (c !== "=") {
                this.parseFixedEntity(legacy_json_1.default);
              }
            } else {
              this.parseLegacyEntity();
            }
            this._state = this.baseState;
            this._index--;
          }
        };
        Tokenizer2.prototype.decodeNumericEntity = function(offset2, base, strict) {
          var sectionStart = this.sectionStart + offset2;
          if (sectionStart !== this._index) {
            var entity = this.buffer.substring(sectionStart, this._index);
            var parsed = parseInt(entity, base);
            this.emitPartial(decode_codepoint_1.default(parsed));
            this.sectionStart = strict ? this._index + 1 : this._index;
          }
          this._state = this.baseState;
        };
        Tokenizer2.prototype.stateInNumericEntity = function(c) {
          if (c === ";") {
            this.decodeNumericEntity(2, 10, true);
          } else if (c < "0" || c > "9") {
            if (!this.xmlMode) {
              this.decodeNumericEntity(2, 10, false);
            } else {
              this._state = this.baseState;
            }
            this._index--;
          }
        };
        Tokenizer2.prototype.stateInHexEntity = function(c) {
          if (c === ";") {
            this.decodeNumericEntity(3, 16, true);
          } else if ((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")) {
            if (!this.xmlMode) {
              this.decodeNumericEntity(3, 16, false);
            } else {
              this._state = this.baseState;
            }
            this._index--;
          }
        };
        Tokenizer2.prototype.cleanup = function() {
          if (this.sectionStart < 0) {
            this.buffer = "";
            this.bufferOffset += this._index;
            this._index = 0;
          } else if (this.running) {
            if (this._state === 1) {
              if (this.sectionStart !== this._index) {
                this.cbs.ontext(this.buffer.substr(this.sectionStart));
              }
              this.buffer = "";
              this.bufferOffset += this._index;
              this._index = 0;
            } else if (this.sectionStart === this._index) {
              this.buffer = "";
              this.bufferOffset += this._index;
              this._index = 0;
            } else {
              this.buffer = this.buffer.substr(this.sectionStart);
              this._index -= this.sectionStart;
              this.bufferOffset += this.sectionStart;
            }
            this.sectionStart = 0;
          }
        };
        Tokenizer2.prototype.parse = function() {
          while (this._index < this.buffer.length && this.running) {
            var c = this.buffer.charAt(this._index);
            if (this._state === 1) {
              this.stateText(c);
            } else if (this._state === 12) {
              this.stateInAttributeValueDoubleQuotes(c);
            } else if (this._state === 9) {
              this.stateInAttributeName(c);
            } else if (this._state === 19) {
              this.stateInComment(c);
            } else if (this._state === 20) {
              this.stateInSpecialComment(c);
            } else if (this._state === 8) {
              this.stateBeforeAttributeName(c);
            } else if (this._state === 3) {
              this.stateInTagName(c);
            } else if (this._state === 6) {
              this.stateInClosingTagName(c);
            } else if (this._state === 2) {
              this.stateBeforeTagName(c);
            } else if (this._state === 10) {
              this.stateAfterAttributeName(c);
            } else if (this._state === 13) {
              this.stateInAttributeValueSingleQuotes(c);
            } else if (this._state === 11) {
              this.stateBeforeAttributeValue(c);
            } else if (this._state === 5) {
              this.stateBeforeClosingTagName(c);
            } else if (this._state === 7) {
              this.stateAfterClosingTagName(c);
            } else if (this._state === 32) {
              this.stateBeforeSpecialS(c);
            } else if (this._state === 21) {
              this.stateAfterComment1(c);
            } else if (this._state === 14) {
              this.stateInAttributeValueNoQuotes(c);
            } else if (this._state === 4) {
              this.stateInSelfClosingTag(c);
            } else if (this._state === 16) {
              this.stateInDeclaration(c);
            } else if (this._state === 15) {
              this.stateBeforeDeclaration(c);
            } else if (this._state === 22) {
              this.stateAfterComment2(c);
            } else if (this._state === 18) {
              this.stateBeforeComment(c);
            } else if (this._state === 33) {
              this.stateBeforeSpecialSEnd(c);
            } else if (this._state === 53) {
              stateAfterSpecialTEnd(this, c);
            } else if (this._state === 39) {
              stateAfterScript1(this, c);
            } else if (this._state === 40) {
              stateAfterScript2(this, c);
            } else if (this._state === 41) {
              stateAfterScript3(this, c);
            } else if (this._state === 34) {
              stateBeforeScript1(this, c);
            } else if (this._state === 35) {
              stateBeforeScript2(this, c);
            } else if (this._state === 36) {
              stateBeforeScript3(this, c);
            } else if (this._state === 37) {
              stateBeforeScript4(this, c);
            } else if (this._state === 38) {
              this.stateBeforeSpecialLast(
                c,
                2
                /* Script */
              );
            } else if (this._state === 42) {
              stateAfterScript4(this, c);
            } else if (this._state === 43) {
              this.stateAfterSpecialLast(c, 6);
            } else if (this._state === 44) {
              stateBeforeStyle1(this, c);
            } else if (this._state === 29) {
              this.stateInCdata(c);
            } else if (this._state === 45) {
              stateBeforeStyle2(this, c);
            } else if (this._state === 46) {
              stateBeforeStyle3(this, c);
            } else if (this._state === 47) {
              this.stateBeforeSpecialLast(
                c,
                3
                /* Style */
              );
            } else if (this._state === 48) {
              stateAfterStyle1(this, c);
            } else if (this._state === 49) {
              stateAfterStyle2(this, c);
            } else if (this._state === 50) {
              stateAfterStyle3(this, c);
            } else if (this._state === 51) {
              this.stateAfterSpecialLast(c, 5);
            } else if (this._state === 52) {
              stateBeforeSpecialT(this, c);
            } else if (this._state === 54) {
              stateBeforeTitle1(this, c);
            } else if (this._state === 55) {
              stateBeforeTitle2(this, c);
            } else if (this._state === 56) {
              stateBeforeTitle3(this, c);
            } else if (this._state === 57) {
              this.stateBeforeSpecialLast(
                c,
                4
                /* Title */
              );
            } else if (this._state === 58) {
              stateAfterTitle1(this, c);
            } else if (this._state === 59) {
              stateAfterTitle2(this, c);
            } else if (this._state === 60) {
              stateAfterTitle3(this, c);
            } else if (this._state === 61) {
              this.stateAfterSpecialLast(c, 5);
            } else if (this._state === 17) {
              this.stateInProcessingInstruction(c);
            } else if (this._state === 64) {
              this.stateInNamedEntity(c);
            } else if (this._state === 23) {
              stateBeforeCdata1(this, c);
            } else if (this._state === 62) {
              stateBeforeEntity(this, c);
            } else if (this._state === 24) {
              stateBeforeCdata2(this, c);
            } else if (this._state === 25) {
              stateBeforeCdata3(this, c);
            } else if (this._state === 30) {
              this.stateAfterCdata1(c);
            } else if (this._state === 31) {
              this.stateAfterCdata2(c);
            } else if (this._state === 26) {
              stateBeforeCdata4(this, c);
            } else if (this._state === 27) {
              stateBeforeCdata5(this, c);
            } else if (this._state === 28) {
              this.stateBeforeCdata6(c);
            } else if (this._state === 66) {
              this.stateInHexEntity(c);
            } else if (this._state === 65) {
              this.stateInNumericEntity(c);
            } else if (this._state === 63) {
              stateBeforeNumericEntity(this, c);
            } else {
              this.cbs.onerror(Error("unknown _state"), this._state);
            }
            this._index++;
          }
          this.cleanup();
        };
        Tokenizer2.prototype.finish = function() {
          if (this.sectionStart < this._index) {
            this.handleTrailingData();
          }
          this.cbs.onend();
        };
        Tokenizer2.prototype.handleTrailingData = function() {
          var data = this.buffer.substr(this.sectionStart);
          if (this._state === 29 || this._state === 30 || this._state === 31) {
            this.cbs.oncdata(data);
          } else if (this._state === 19 || this._state === 21 || this._state === 22) {
            this.cbs.oncomment(data);
          } else if (this._state === 64 && !this.xmlMode) {
            this.parseLegacyEntity();
            if (this.sectionStart < this._index) {
              this._state = this.baseState;
              this.handleTrailingData();
            }
          } else if (this._state === 65 && !this.xmlMode) {
            this.decodeNumericEntity(2, 10, false);
            if (this.sectionStart < this._index) {
              this._state = this.baseState;
              this.handleTrailingData();
            }
          } else if (this._state === 66 && !this.xmlMode) {
            this.decodeNumericEntity(3, 16, false);
            if (this.sectionStart < this._index) {
              this._state = this.baseState;
              this.handleTrailingData();
            }
          } else if (this._state !== 3 && this._state !== 8 && this._state !== 11 && this._state !== 10 && this._state !== 9 && this._state !== 13 && this._state !== 12 && this._state !== 14 && this._state !== 6) {
            this.cbs.ontext(data);
          }
        };
        Tokenizer2.prototype.getSection = function() {
          return this.buffer.substring(this.sectionStart, this._index);
        };
        Tokenizer2.prototype.emitToken = function(name) {
          this.cbs[name](this.getSection());
          this.sectionStart = -1;
        };
        Tokenizer2.prototype.emitPartial = function(value) {
          if (this.baseState !== 1) {
            this.cbs.onattribdata(value);
          } else {
            this.cbs.ontext(value);
          }
        };
        return Tokenizer2;
      }()
    );
    exports2.default = Tokenizer;
  }
});

// node_modules/htmlparser2/lib/Parser.js
var require_Parser = __commonJS({
  "node_modules/htmlparser2/lib/Parser.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Parser = void 0;
    var Tokenizer_1 = __importDefault2(require_Tokenizer());
    var formTags = /* @__PURE__ */ new Set([
      "input",
      "option",
      "optgroup",
      "select",
      "button",
      "datalist",
      "textarea"
    ]);
    var pTag = /* @__PURE__ */ new Set(["p"]);
    var openImpliesClose = {
      tr: /* @__PURE__ */ new Set(["tr", "th", "td"]),
      th: /* @__PURE__ */ new Set(["th"]),
      td: /* @__PURE__ */ new Set(["thead", "th", "td"]),
      body: /* @__PURE__ */ new Set(["head", "link", "script"]),
      li: /* @__PURE__ */ new Set(["li"]),
      p: pTag,
      h1: pTag,
      h2: pTag,
      h3: pTag,
      h4: pTag,
      h5: pTag,
      h6: pTag,
      select: formTags,
      input: formTags,
      output: formTags,
      button: formTags,
      datalist: formTags,
      textarea: formTags,
      option: /* @__PURE__ */ new Set(["option"]),
      optgroup: /* @__PURE__ */ new Set(["optgroup", "option"]),
      dd: /* @__PURE__ */ new Set(["dt", "dd"]),
      dt: /* @__PURE__ */ new Set(["dt", "dd"]),
      address: pTag,
      article: pTag,
      aside: pTag,
      blockquote: pTag,
      details: pTag,
      div: pTag,
      dl: pTag,
      fieldset: pTag,
      figcaption: pTag,
      figure: pTag,
      footer: pTag,
      form: pTag,
      header: pTag,
      hr: pTag,
      main: pTag,
      nav: pTag,
      ol: pTag,
      pre: pTag,
      section: pTag,
      table: pTag,
      ul: pTag,
      rt: /* @__PURE__ */ new Set(["rt", "rp"]),
      rp: /* @__PURE__ */ new Set(["rt", "rp"]),
      tbody: /* @__PURE__ */ new Set(["thead", "tbody"]),
      tfoot: /* @__PURE__ */ new Set(["thead", "tbody"])
    };
    var voidElements = /* @__PURE__ */ new Set([
      "area",
      "base",
      "basefont",
      "br",
      "col",
      "command",
      "embed",
      "frame",
      "hr",
      "img",
      "input",
      "isindex",
      "keygen",
      "link",
      "meta",
      "param",
      "source",
      "track",
      "wbr"
    ]);
    var foreignContextElements = /* @__PURE__ */ new Set(["math", "svg"]);
    var htmlIntegrationElements = /* @__PURE__ */ new Set([
      "mi",
      "mo",
      "mn",
      "ms",
      "mtext",
      "annotation-xml",
      "foreignObject",
      "desc",
      "title"
    ]);
    var reNameEnd = /\s|\//;
    var Parser = (
      /** @class */
      function() {
        function Parser2(cbs, options) {
          if (options === void 0) {
            options = {};
          }
          var _a, _b, _c, _d, _e;
          this.startIndex = 0;
          this.endIndex = null;
          this.tagname = "";
          this.attribname = "";
          this.attribvalue = "";
          this.attribs = null;
          this.stack = [];
          this.foreignContext = [];
          this.options = options;
          this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
          this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;
          this.lowerCaseAttributeNames = (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;
          this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer_1.default)(this.options, this);
          (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);
        }
        Parser2.prototype.updatePosition = function(initialOffset) {
          if (this.endIndex === null) {
            if (this.tokenizer.sectionStart <= initialOffset) {
              this.startIndex = 0;
            } else {
              this.startIndex = this.tokenizer.sectionStart - initialOffset;
            }
          } else {
            this.startIndex = this.endIndex + 1;
          }
          this.endIndex = this.tokenizer.getAbsoluteIndex();
        };
        Parser2.prototype.ontext = function(data) {
          var _a, _b;
          this.updatePosition(1);
          this.endIndex--;
          (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);
        };
        Parser2.prototype.onopentagname = function(name) {
          var _a, _b;
          if (this.lowerCaseTagNames) {
            name = name.toLowerCase();
          }
          this.tagname = name;
          if (!this.options.xmlMode && Object.prototype.hasOwnProperty.call(openImpliesClose, name)) {
            var el = void 0;
            while (this.stack.length > 0 && openImpliesClose[name].has(el = this.stack[this.stack.length - 1])) {
              this.onclosetag(el);
            }
          }
          if (this.options.xmlMode || !voidElements.has(name)) {
            this.stack.push(name);
            if (foreignContextElements.has(name)) {
              this.foreignContext.push(true);
            } else if (htmlIntegrationElements.has(name)) {
              this.foreignContext.push(false);
            }
          }
          (_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, name);
          if (this.cbs.onopentag)
            this.attribs = {};
        };
        Parser2.prototype.onopentagend = function() {
          var _a, _b;
          this.updatePosition(1);
          if (this.attribs) {
            (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs);
            this.attribs = null;
          }
          if (!this.options.xmlMode && this.cbs.onclosetag && voidElements.has(this.tagname)) {
            this.cbs.onclosetag(this.tagname);
          }
          this.tagname = "";
        };
        Parser2.prototype.onclosetag = function(name) {
          this.updatePosition(1);
          if (this.lowerCaseTagNames) {
            name = name.toLowerCase();
          }
          if (foreignContextElements.has(name) || htmlIntegrationElements.has(name)) {
            this.foreignContext.pop();
          }
          if (this.stack.length && (this.options.xmlMode || !voidElements.has(name))) {
            var pos = this.stack.lastIndexOf(name);
            if (pos !== -1) {
              if (this.cbs.onclosetag) {
                pos = this.stack.length - pos;
                while (pos--) {
                  this.cbs.onclosetag(this.stack.pop());
                }
              } else
                this.stack.length = pos;
            } else if (name === "p" && !this.options.xmlMode) {
              this.onopentagname(name);
              this.closeCurrentTag();
            }
          } else if (!this.options.xmlMode && (name === "br" || name === "p")) {
            this.onopentagname(name);
            this.closeCurrentTag();
          }
        };
        Parser2.prototype.onselfclosingtag = function() {
          if (this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1]) {
            this.closeCurrentTag();
          } else {
            this.onopentagend();
          }
        };
        Parser2.prototype.closeCurrentTag = function() {
          var _a, _b;
          var name = this.tagname;
          this.onopentagend();
          if (this.stack[this.stack.length - 1] === name) {
            (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name);
            this.stack.pop();
          }
        };
        Parser2.prototype.onattribname = function(name) {
          if (this.lowerCaseAttributeNames) {
            name = name.toLowerCase();
          }
          this.attribname = name;
        };
        Parser2.prototype.onattribdata = function(value) {
          this.attribvalue += value;
        };
        Parser2.prototype.onattribend = function(quote) {
          var _a, _b;
          (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote);
          if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
            this.attribs[this.attribname] = this.attribvalue;
          }
          this.attribname = "";
          this.attribvalue = "";
        };
        Parser2.prototype.getInstructionName = function(value) {
          var idx = value.search(reNameEnd);
          var name = idx < 0 ? value : value.substr(0, idx);
          if (this.lowerCaseTagNames) {
            name = name.toLowerCase();
          }
          return name;
        };
        Parser2.prototype.ondeclaration = function(value) {
          if (this.cbs.onprocessinginstruction) {
            var name_1 = this.getInstructionName(value);
            this.cbs.onprocessinginstruction("!" + name_1, "!" + value);
          }
        };
        Parser2.prototype.onprocessinginstruction = function(value) {
          if (this.cbs.onprocessinginstruction) {
            var name_2 = this.getInstructionName(value);
            this.cbs.onprocessinginstruction("?" + name_2, "?" + value);
          }
        };
        Parser2.prototype.oncomment = function(value) {
          var _a, _b, _c, _d;
          this.updatePosition(4);
          (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, value);
          (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
        };
        Parser2.prototype.oncdata = function(value) {
          var _a, _b, _c, _d, _e, _f;
          this.updatePosition(1);
          if (this.options.xmlMode || this.options.recognizeCDATA) {
            (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
            (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
            (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
          } else {
            this.oncomment("[CDATA[" + value + "]]");
          }
        };
        Parser2.prototype.onerror = function(err) {
          var _a, _b;
          (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, err);
        };
        Parser2.prototype.onend = function() {
          var _a, _b;
          if (this.cbs.onclosetag) {
            for (var i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i]))
              ;
          }
          (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
        };
        Parser2.prototype.reset = function() {
          var _a, _b, _c, _d;
          (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
          this.tokenizer.reset();
          this.tagname = "";
          this.attribname = "";
          this.attribs = null;
          this.stack = [];
          (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
        };
        Parser2.prototype.parseComplete = function(data) {
          this.reset();
          this.end(data);
        };
        Parser2.prototype.write = function(chunk) {
          this.tokenizer.write(chunk);
        };
        Parser2.prototype.end = function(chunk) {
          this.tokenizer.end(chunk);
        };
        Parser2.prototype.pause = function() {
          this.tokenizer.pause();
        };
        Parser2.prototype.resume = function() {
          this.tokenizer.resume();
        };
        Parser2.prototype.parseChunk = function(chunk) {
          this.write(chunk);
        };
        Parser2.prototype.done = function(chunk) {
          this.end(chunk);
        };
        return Parser2;
      }()
    );
    exports2.Parser = Parser;
  }
});

// node_modules/domelementtype/lib/index.js
var require_lib = __commonJS({
  "node_modules/domelementtype/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Doctype = exports2.CDATA = exports2.Tag = exports2.Style = exports2.Script = exports2.Comment = exports2.Directive = exports2.Text = exports2.Root = exports2.isTag = exports2.ElementType = void 0;
    var ElementType;
    (function(ElementType2) {
      ElementType2["Root"] = "root";
      ElementType2["Text"] = "text";
      ElementType2["Directive"] = "directive";
      ElementType2["Comment"] = "comment";
      ElementType2["Script"] = "script";
      ElementType2["Style"] = "style";
      ElementType2["Tag"] = "tag";
      ElementType2["CDATA"] = "cdata";
      ElementType2["Doctype"] = "doctype";
    })(ElementType = exports2.ElementType || (exports2.ElementType = {}));
    function isTag(elem) {
      return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
    }
    exports2.isTag = isTag;
    exports2.Root = ElementType.Root;
    exports2.Text = ElementType.Text;
    exports2.Directive = ElementType.Directive;
    exports2.Comment = ElementType.Comment;
    exports2.Script = ElementType.Script;
    exports2.Style = ElementType.Style;
    exports2.Tag = ElementType.Tag;
    exports2.CDATA = ElementType.CDATA;
    exports2.Doctype = ElementType.Doctype;
  }
});

// node_modules/htmlparser2/node_modules/domhandler/lib/node.js
var require_node = __commonJS({
  "node_modules/htmlparser2/node_modules/domhandler/lib/node.js"(exports2) {
    "use strict";
    var __extends2 = exports2 && exports2.__extends || function() {
      var extendStatics2 = function(d, b) {
        extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
          d2.__proto__ = b2;
        } || function(d2, b2) {
          for (var p in b2)
            if (Object.prototype.hasOwnProperty.call(b2, p))
              d2[p] = b2[p];
        };
        return extendStatics2(d, b);
      };
      return function(d, b) {
        if (typeof b !== "function" && b !== null)
          throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics2(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __assign2 = exports2 && exports2.__assign || function() {
      __assign2 = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s)
            if (Object.prototype.hasOwnProperty.call(s, p))
              t[p] = s[p];
        }
        return t;
      };
      return __assign2.apply(this, arguments);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.cloneNode = exports2.hasChildren = exports2.isDocument = exports2.isDirective = exports2.isComment = exports2.isText = exports2.isCDATA = exports2.isTag = exports2.Element = exports2.Document = exports2.NodeWithChildren = exports2.ProcessingInstruction = exports2.Comment = exports2.Text = exports2.DataNode = exports2.Node = void 0;
    var domelementtype_1 = require_lib();
    var nodeTypes = /* @__PURE__ */ new Map([
      [domelementtype_1.ElementType.Tag, 1],
      [domelementtype_1.ElementType.Script, 1],
      [domelementtype_1.ElementType.Style, 1],
      [domelementtype_1.ElementType.Directive, 1],
      [domelementtype_1.ElementType.Text, 3],
      [domelementtype_1.ElementType.CDATA, 4],
      [domelementtype_1.ElementType.Comment, 8],
      [domelementtype_1.ElementType.Root, 9]
    ]);
    var Node = (
      /** @class */
      function() {
        function Node2(type) {
          this.type = type;
          this.parent = null;
          this.prev = null;
          this.next = null;
          this.startIndex = null;
          this.endIndex = null;
        }
        Object.defineProperty(Node2.prototype, "nodeType", {
          // Read-only aliases
          /**
           * [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
           * node {@link type}.
           */
          get: function() {
            var _a;
            return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Node2.prototype, "parentNode", {
          // Read-write aliases for properties
          /**
           * Same as {@link parent}.
           * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
           */
          get: function() {
            return this.parent;
          },
          set: function(parent) {
            this.parent = parent;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Node2.prototype, "previousSibling", {
          /**
           * Same as {@link prev}.
           * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
           */
          get: function() {
            return this.prev;
          },
          set: function(prev) {
            this.prev = prev;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Node2.prototype, "nextSibling", {
          /**
           * Same as {@link next}.
           * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
           */
          get: function() {
            return this.next;
          },
          set: function(next) {
            this.next = next;
          },
          enumerable: false,
          configurable: true
        });
        Node2.prototype.cloneNode = function(recursive) {
          if (recursive === void 0) {
            recursive = false;
          }
          return cloneNode(this, recursive);
        };
        return Node2;
      }()
    );
    exports2.Node = Node;
    var DataNode = (
      /** @class */
      function(_super) {
        __extends2(DataNode2, _super);
        function DataNode2(type, data) {
          var _this = _super.call(this, type) || this;
          _this.data = data;
          return _this;
        }
        Object.defineProperty(DataNode2.prototype, "nodeValue", {
          /**
           * Same as {@link data}.
           * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
           */
          get: function() {
            return this.data;
          },
          set: function(data) {
            this.data = data;
          },
          enumerable: false,
          configurable: true
        });
        return DataNode2;
      }(Node)
    );
    exports2.DataNode = DataNode;
    var Text = (
      /** @class */
      function(_super) {
        __extends2(Text2, _super);
        function Text2(data) {
          return _super.call(this, domelementtype_1.ElementType.Text, data) || this;
        }
        return Text2;
      }(DataNode)
    );
    exports2.Text = Text;
    var Comment = (
      /** @class */
      function(_super) {
        __extends2(Comment2, _super);
        function Comment2(data) {
          return _super.call(this, domelementtype_1.ElementType.Comment, data) || this;
        }
        return Comment2;
      }(DataNode)
    );
    exports2.Comment = Comment;
    var ProcessingInstruction = (
      /** @class */
      function(_super) {
        __extends2(ProcessingInstruction2, _super);
        function ProcessingInstruction2(name, data) {
          var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this;
          _this.name = name;
          return _this;
        }
        return ProcessingInstruction2;
      }(DataNode)
    );
    exports2.ProcessingInstruction = ProcessingInstruction;
    var NodeWithChildren = (
      /** @class */
      function(_super) {
        __extends2(NodeWithChildren2, _super);
        function NodeWithChildren2(type, children) {
          var _this = _super.call(this, type) || this;
          _this.children = children;
          return _this;
        }
        Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
          // Aliases
          /** First child of the node. */
          get: function() {
            var _a;
            return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
          /** Last child of the node. */
          get: function() {
            return this.children.length > 0 ? this.children[this.children.length - 1] : null;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
          /**
           * Same as {@link children}.
           * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
           */
          get: function() {
            return this.children;
          },
          set: function(children) {
            this.children = children;
          },
          enumerable: false,
          configurable: true
        });
        return NodeWithChildren2;
      }(Node)
    );
    exports2.NodeWithChildren = NodeWithChildren;
    var Document = (
      /** @class */
      function(_super) {
        __extends2(Document2, _super);
        function Document2(children) {
          return _super.call(this, domelementtype_1.ElementType.Root, children) || this;
        }
        return Document2;
      }(NodeWithChildren)
    );
    exports2.Document = Document;
    var Element2 = (
      /** @class */
      function(_super) {
        __extends2(Element3, _super);
        function Element3(name, attribs, children, type) {
          if (children === void 0) {
            children = [];
          }
          if (type === void 0) {
            type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
          }
          var _this = _super.call(this, type, children) || this;
          _this.name = name;
          _this.attribs = attribs;
          return _this;
        }
        Object.defineProperty(Element3.prototype, "tagName", {
          // DOM Level 1 aliases
          /**
           * Same as {@link name}.
           * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
           */
          get: function() {
            return this.name;
          },
          set: function(name) {
            this.name = name;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Element3.prototype, "attributes", {
          get: function() {
            var _this = this;
            return Object.keys(this.attribs).map(function(name) {
              var _a, _b;
              return {
                name,
                value: _this.attribs[name],
                namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
                prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
              };
            });
          },
          enumerable: false,
          configurable: true
        });
        return Element3;
      }(NodeWithChildren)
    );
    exports2.Element = Element2;
    function isTag(node) {
      return (0, domelementtype_1.isTag)(node);
    }
    exports2.isTag = isTag;
    function isCDATA(node) {
      return node.type === domelementtype_1.ElementType.CDATA;
    }
    exports2.isCDATA = isCDATA;
    function isText(node) {
      return node.type === domelementtype_1.ElementType.Text;
    }
    exports2.isText = isText;
    function isComment(node) {
      return node.type === domelementtype_1.ElementType.Comment;
    }
    exports2.isComment = isComment;
    function isDirective(node) {
      return node.type === domelementtype_1.ElementType.Directive;
    }
    exports2.isDirective = isDirective;
    function isDocument(node) {
      return node.type === domelementtype_1.ElementType.Root;
    }
    exports2.isDocument = isDocument;
    function hasChildren(node) {
      return Object.prototype.hasOwnProperty.call(node, "children");
    }
    exports2.hasChildren = hasChildren;
    function cloneNode(node, recursive) {
      if (recursive === void 0) {
        recursive = false;
      }
      var result;
      if (isText(node)) {
        result = new Text(node.data);
      } else if (isComment(node)) {
        result = new Comment(node.data);
      } else if (isTag(node)) {
        var children = recursive ? cloneChildren(node.children) : [];
        var clone_1 = new Element2(node.name, __assign2({}, node.attribs), children);
        children.forEach(function(child) {
          return child.parent = clone_1;
        });
        if (node.namespace != null) {
          clone_1.namespace = node.namespace;
        }
        if (node["x-attribsNamespace"]) {
          clone_1["x-attribsNamespace"] = __assign2({}, node["x-attribsNamespace"]);
        }
        if (node["x-attribsPrefix"]) {
          clone_1["x-attribsPrefix"] = __assign2({}, node["x-attribsPrefix"]);
        }
        result = clone_1;
      } else if (isCDATA(node)) {
        var children = recursive ? cloneChildren(node.children) : [];
        var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);
        children.forEach(function(child) {
          return child.parent = clone_2;
        });
        result = clone_2;
      } else if (isDocument(node)) {
        var children = recursive ? cloneChildren(node.children) : [];
        var clone_3 = new Document(children);
        children.forEach(function(child) {
          return child.parent = clone_3;
        });
        if (node["x-mode"]) {
          clone_3["x-mode"] = node["x-mode"];
        }
        result = clone_3;
      } else if (isDirective(node)) {
        var instruction = new ProcessingInstruction(node.name, node.data);
        if (node["x-name"] != null) {
          instruction["x-name"] = node["x-name"];
          instruction["x-publicId"] = node["x-publicId"];
          instruction["x-systemId"] = node["x-systemId"];
        }
        result = instruction;
      } else {
        throw new Error("Not implemented yet: ".concat(node.type));
      }
      result.startIndex = node.startIndex;
      result.endIndex = node.endIndex;
      if (node.sourceCodeLocation != null) {
        result.sourceCodeLocation = node.sourceCodeLocation;
      }
      return result;
    }
    exports2.cloneNode = cloneNode;
    function cloneChildren(childs) {
      var children = childs.map(function(child) {
        return cloneNode(child, true);
      });
      for (var i = 1; i < children.length; i++) {
        children[i].prev = children[i - 1];
        children[i - 1].next = children[i];
      }
      return children;
    }
  }
});

// node_modules/htmlparser2/node_modules/domhandler/lib/index.js
var require_lib2 = __commonJS({
  "node_modules/htmlparser2/node_modules/domhandler/lib/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.DomHandler = void 0;
    var domelementtype_1 = require_lib();
    var node_1 = require_node();
    __exportStar2(require_node(), exports2);
    var reWhitespace = /\s+/g;
    var defaultOpts = {
      normalizeWhitespace: false,
      withStartIndices: false,
      withEndIndices: false,
      xmlMode: false
    };
    var DomHandler = (
      /** @class */
      function() {
        function DomHandler2(callback, options, elementCB) {
          this.dom = [];
          this.root = new node_1.Document(this.dom);
          this.done = false;
          this.tagStack = [this.root];
          this.lastNode = null;
          this.parser = null;
          if (typeof options === "function") {
            elementCB = options;
            options = defaultOpts;
          }
          if (typeof callback === "object") {
            options = callback;
            callback = void 0;
          }
          this.callback = callback !== null && callback !== void 0 ? callback : null;
          this.options = options !== null && options !== void 0 ? options : defaultOpts;
          this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
        }
        DomHandler2.prototype.onparserinit = function(parser) {
          this.parser = parser;
        };
        DomHandler2.prototype.onreset = function() {
          this.dom = [];
          this.root = new node_1.Document(this.dom);
          this.done = false;
          this.tagStack = [this.root];
          this.lastNode = null;
          this.parser = null;
        };
        DomHandler2.prototype.onend = function() {
          if (this.done)
            return;
          this.done = true;
          this.parser = null;
          this.handleCallback(null);
        };
        DomHandler2.prototype.onerror = function(error) {
          this.handleCallback(error);
        };
        DomHandler2.prototype.onclosetag = function() {
          this.lastNode = null;
          var elem = this.tagStack.pop();
          if (this.options.withEndIndices) {
            elem.endIndex = this.parser.endIndex;
          }
          if (this.elementCB)
            this.elementCB(elem);
        };
        DomHandler2.prototype.onopentag = function(name, attribs) {
          var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
          var element = new node_1.Element(name, attribs, void 0, type);
          this.addNode(element);
          this.tagStack.push(element);
        };
        DomHandler2.prototype.ontext = function(data) {
          var normalizeWhitespace = this.options.normalizeWhitespace;
          var lastNode = this.lastNode;
          if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
            if (normalizeWhitespace) {
              lastNode.data = (lastNode.data + data).replace(reWhitespace, " ");
            } else {
              lastNode.data += data;
            }
            if (this.options.withEndIndices) {
              lastNode.endIndex = this.parser.endIndex;
            }
          } else {
            if (normalizeWhitespace) {
              data = data.replace(reWhitespace, " ");
            }
            var node = new node_1.Text(data);
            this.addNode(node);
            this.lastNode = node;
          }
        };
        DomHandler2.prototype.oncomment = function(data) {
          if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
            this.lastNode.data += data;
            return;
          }
          var node = new node_1.Comment(data);
          this.addNode(node);
          this.lastNode = node;
        };
        DomHandler2.prototype.oncommentend = function() {
          this.lastNode = null;
        };
        DomHandler2.prototype.oncdatastart = function() {
          var text = new node_1.Text("");
          var node = new node_1.NodeWithChildren(domelementtype_1.ElementType.CDATA, [text]);
          this.addNode(node);
          text.parent = node;
          this.lastNode = text;
        };
        DomHandler2.prototype.oncdataend = function() {
          this.lastNode = null;
        };
        DomHandler2.prototype.onprocessinginstruction = function(name, data) {
          var node = new node_1.ProcessingInstruction(name, data);
          this.addNode(node);
        };
        DomHandler2.prototype.handleCallback = function(error) {
          if (typeof this.callback === "function") {
            this.callback(error, this.dom);
          } else if (error) {
            throw error;
          }
        };
        DomHandler2.prototype.addNode = function(node) {
          var parent = this.tagStack[this.tagStack.length - 1];
          var previousSibling = parent.children[parent.children.length - 1];
          if (this.options.withStartIndices) {
            node.startIndex = this.parser.startIndex;
          }
          if (this.options.withEndIndices) {
            node.endIndex = this.parser.endIndex;
          }
          parent.children.push(node);
          if (previousSibling) {
            node.prev = previousSibling;
            previousSibling.next = node;
          }
          node.parent = parent;
          this.lastNode = null;
        };
        return DomHandler2;
      }()
    );
    exports2.DomHandler = DomHandler;
    exports2.default = DomHandler;
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/decode.js
var require_decode2 = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/decode.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.decodeHTML = exports2.decodeHTMLStrict = exports2.decodeXML = void 0;
    var entities_json_1 = __importDefault2(require_entities());
    var legacy_json_1 = __importDefault2(require_legacy());
    var xml_json_1 = __importDefault2(require_xml());
    var decode_codepoint_1 = __importDefault2(require_decode_codepoint());
    var strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
    exports2.decodeXML = getStrictDecoder(xml_json_1.default);
    exports2.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);
    function getStrictDecoder(map) {
      var replace = getReplacer(map);
      return function(str) {
        return String(str).replace(strictEntityRe, replace);
      };
    }
    var sorter = function(a, b) {
      return a < b ? 1 : -1;
    };
    exports2.decodeHTML = function() {
      var legacy = Object.keys(legacy_json_1.default).sort(sorter);
      var keys = Object.keys(entities_json_1.default).sort(sorter);
      for (var i = 0, j = 0; i < keys.length; i++) {
        if (legacy[j] === keys[i]) {
          keys[i] += ";?";
          j++;
        } else {
          keys[i] += ";";
        }
      }
      var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g");
      var replace = getReplacer(entities_json_1.default);
      function replacer(str) {
        if (str.substr(-1) !== ";")
          str += ";";
        return replace(str);
      }
      return function(str) {
        return String(str).replace(re, replacer);
      };
    }();
    function getReplacer(map) {
      return function replace(str) {
        if (str.charAt(1) === "#") {
          var secondChar = str.charAt(2);
          if (secondChar === "X" || secondChar === "x") {
            return decode_codepoint_1.default(parseInt(str.substr(3), 16));
          }
          return decode_codepoint_1.default(parseInt(str.substr(2), 10));
        }
        return map[str.slice(1, -1)] || str;
      };
    }
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/encode.js
var require_encode = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/encode.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.escapeUTF8 = exports2.escape = exports2.encodeNonAsciiHTML = exports2.encodeHTML = exports2.encodeXML = void 0;
    var xml_json_1 = __importDefault2(require_xml());
    var inverseXML = getInverseObj(xml_json_1.default);
    var xmlReplacer = getInverseReplacer(inverseXML);
    exports2.encodeXML = getASCIIEncoder(inverseXML);
    var entities_json_1 = __importDefault2(require_entities());
    var inverseHTML = getInverseObj(entities_json_1.default);
    var htmlReplacer = getInverseReplacer(inverseHTML);
    exports2.encodeHTML = getInverse(inverseHTML, htmlReplacer);
    exports2.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);
    function getInverseObj(obj2) {
      return Object.keys(obj2).sort().reduce(function(inverse, name) {
        inverse[obj2[name]] = "&" + name + ";";
        return inverse;
      }, {});
    }
    function getInverseReplacer(inverse) {
      var single = [];
      var multiple = [];
      for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) {
        var k = _a[_i];
        if (k.length === 1) {
          single.push("\\" + k);
        } else {
          multiple.push(k);
        }
      }
      single.sort();
      for (var start2 = 0; start2 < single.length - 1; start2++) {
        var end2 = start2;
        while (end2 < single.length - 1 && single[end2].charCodeAt(1) + 1 === single[end2 + 1].charCodeAt(1)) {
          end2 += 1;
        }
        var count = 1 + end2 - start2;
        if (count < 3)
          continue;
        single.splice(start2, count, single[start2] + "-" + single[end2]);
      }
      multiple.unshift("[" + single.join("") + "]");
      return new RegExp(multiple.join("|"), "g");
    }
    var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
    var getCodePoint = (
      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
      String.prototype.codePointAt != null ? (
        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
        function(str) {
          return str.codePointAt(0);
        }
      ) : (
        // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
        function(c) {
          return (c.charCodeAt(0) - 55296) * 1024 + c.charCodeAt(1) - 56320 + 65536;
        }
      )
    );
    function singleCharReplacer(c) {
      return "&#x" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0)).toString(16).toUpperCase() + ";";
    }
    function getInverse(inverse, re) {
      return function(data) {
        return data.replace(re, function(name) {
          return inverse[name];
        }).replace(reNonASCII, singleCharReplacer);
      };
    }
    var reEscapeChars = new RegExp(xmlReplacer.source + "|" + reNonASCII.source, "g");
    function escape2(data) {
      return data.replace(reEscapeChars, singleCharReplacer);
    }
    exports2.escape = escape2;
    function escapeUTF8(data) {
      return data.replace(xmlReplacer, singleCharReplacer);
    }
    exports2.escapeUTF8 = escapeUTF8;
    function getASCIIEncoder(obj2) {
      return function(data) {
        return data.replace(reEscapeChars, function(c) {
          return obj2[c] || singleCharReplacer(c);
        });
      };
    }
  }
});

// node_modules/htmlparser2/node_modules/entities/lib/index.js
var require_lib3 = __commonJS({
  "node_modules/htmlparser2/node_modules/entities/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.decodeXMLStrict = exports2.decodeHTML5Strict = exports2.decodeHTML4Strict = exports2.decodeHTML5 = exports2.decodeHTML4 = exports2.decodeHTMLStrict = exports2.decodeHTML = exports2.decodeXML = exports2.encodeHTML5 = exports2.encodeHTML4 = exports2.escapeUTF8 = exports2.escape = exports2.encodeNonAsciiHTML = exports2.encodeHTML = exports2.encodeXML = exports2.encode = exports2.decodeStrict = exports2.decode = void 0;
    var decode_1 = require_decode2();
    var encode_1 = require_encode();
    function decode(data, level) {
      return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);
    }
    exports2.decode = decode;
    function decodeStrict(data, level) {
      return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);
    }
    exports2.decodeStrict = decodeStrict;
    function encode(data, level) {
      return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);
    }
    exports2.encode = encode;
    var encode_2 = require_encode();
    Object.defineProperty(exports2, "encodeXML", { enumerable: true, get: function() {
      return encode_2.encodeXML;
    } });
    Object.defineProperty(exports2, "encodeHTML", { enumerable: true, get: function() {
      return encode_2.encodeHTML;
    } });
    Object.defineProperty(exports2, "encodeNonAsciiHTML", { enumerable: true, get: function() {
      return encode_2.encodeNonAsciiHTML;
    } });
    Object.defineProperty(exports2, "escape", { enumerable: true, get: function() {
      return encode_2.escape;
    } });
    Object.defineProperty(exports2, "escapeUTF8", { enumerable: true, get: function() {
      return encode_2.escapeUTF8;
    } });
    Object.defineProperty(exports2, "encodeHTML4", { enumerable: true, get: function() {
      return encode_2.encodeHTML;
    } });
    Object.defineProperty(exports2, "encodeHTML5", { enumerable: true, get: function() {
      return encode_2.encodeHTML;
    } });
    var decode_2 = require_decode2();
    Object.defineProperty(exports2, "decodeXML", { enumerable: true, get: function() {
      return decode_2.decodeXML;
    } });
    Object.defineProperty(exports2, "decodeHTML", { enumerable: true, get: function() {
      return decode_2.decodeHTML;
    } });
    Object.defineProperty(exports2, "decodeHTMLStrict", { enumerable: true, get: function() {
      return decode_2.decodeHTMLStrict;
    } });
    Object.defineProperty(exports2, "decodeHTML4", { enumerable: true, get: function() {
      return decode_2.decodeHTML;
    } });
    Object.defineProperty(exports2, "decodeHTML5", { enumerable: true, get: function() {
      return decode_2.decodeHTML;
    } });
    Object.defineProperty(exports2, "decodeHTML4Strict", { enumerable: true, get: function() {
      return decode_2.decodeHTMLStrict;
    } });
    Object.defineProperty(exports2, "decodeHTML5Strict", { enumerable: true, get: function() {
      return decode_2.decodeHTMLStrict;
    } });
    Object.defineProperty(exports2, "decodeXMLStrict", { enumerable: true, get: function() {
      return decode_2.decodeXML;
    } });
  }
});

// node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js
var require_foreignNames = __commonJS({
  "node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.attributeNames = exports2.elementNames = void 0;
    exports2.elementNames = /* @__PURE__ */ new Map([
      ["altglyph", "altGlyph"],
      ["altglyphdef", "altGlyphDef"],
      ["altglyphitem", "altGlyphItem"],
      ["animatecolor", "animateColor"],
      ["animatemotion", "animateMotion"],
      ["animatetransform", "animateTransform"],
      ["clippath", "clipPath"],
      ["feblend", "feBlend"],
      ["fecolormatrix", "feColorMatrix"],
      ["fecomponenttransfer", "feComponentTransfer"],
      ["fecomposite", "feComposite"],
      ["feconvolvematrix", "feConvolveMatrix"],
      ["fediffuselighting", "feDiffuseLighting"],
      ["fedisplacementmap", "feDisplacementMap"],
      ["fedistantlight", "feDistantLight"],
      ["fedropshadow", "feDropShadow"],
      ["feflood", "feFlood"],
      ["fefunca", "feFuncA"],
      ["fefuncb", "feFuncB"],
      ["fefuncg", "feFuncG"],
      ["fefuncr", "feFuncR"],
      ["fegaussianblur", "feGaussianBlur"],
      ["feimage", "feImage"],
      ["femerge", "feMerge"],
      ["femergenode", "feMergeNode"],
      ["femorphology", "feMorphology"],
      ["feoffset", "feOffset"],
      ["fepointlight", "fePointLight"],
      ["fespecularlighting", "feSpecularLighting"],
      ["fespotlight", "feSpotLight"],
      ["fetile", "feTile"],
      ["feturbulence", "feTurbulence"],
      ["foreignobject", "foreignObject"],
      ["glyphref", "glyphRef"],
      ["lineargradient", "linearGradient"],
      ["radialgradient", "radialGradient"],
      ["textpath", "textPath"]
    ]);
    exports2.attributeNames = /* @__PURE__ */ new Map([
      ["definitionurl", "definitionURL"],
      ["attributename", "attributeName"],
      ["attributetype", "attributeType"],
      ["basefrequency", "baseFrequency"],
      ["baseprofile", "baseProfile"],
      ["calcmode", "calcMode"],
      ["clippathunits", "clipPathUnits"],
      ["diffuseconstant", "diffuseConstant"],
      ["edgemode", "edgeMode"],
      ["filterunits", "filterUnits"],
      ["glyphref", "glyphRef"],
      ["gradienttransform", "gradientTransform"],
      ["gradientunits", "gradientUnits"],
      ["kernelmatrix", "kernelMatrix"],
      ["kernelunitlength", "kernelUnitLength"],
      ["keypoints", "keyPoints"],
      ["keysplines", "keySplines"],
      ["keytimes", "keyTimes"],
      ["lengthadjust", "lengthAdjust"],
      ["limitingconeangle", "limitingConeAngle"],
      ["markerheight", "markerHeight"],
      ["markerunits", "markerUnits"],
      ["markerwidth", "markerWidth"],
      ["maskcontentunits", "maskContentUnits"],
      ["maskunits", "maskUnits"],
      ["numoctaves", "numOctaves"],
      ["pathlength", "pathLength"],
      ["patterncontentunits", "patternContentUnits"],
      ["patterntransform", "patternTransform"],
      ["patternunits", "patternUnits"],
      ["pointsatx", "pointsAtX"],
      ["pointsaty", "pointsAtY"],
      ["pointsatz", "pointsAtZ"],
      ["preservealpha", "preserveAlpha"],
      ["preserveaspectratio", "preserveAspectRatio"],
      ["primitiveunits", "primitiveUnits"],
      ["refx", "refX"],
      ["refy", "refY"],
      ["repeatcount", "repeatCount"],
      ["repeatdur", "repeatDur"],
      ["requiredextensions", "requiredExtensions"],
      ["requiredfeatures", "requiredFeatures"],
      ["specularconstant", "specularConstant"],
      ["specularexponent", "specularExponent"],
      ["spreadmethod", "spreadMethod"],
      ["startoffset", "startOffset"],
      ["stddeviation", "stdDeviation"],
      ["stitchtiles", "stitchTiles"],
      ["surfacescale", "surfaceScale"],
      ["systemlanguage", "systemLanguage"],
      ["tablevalues", "tableValues"],
      ["targetx", "targetX"],
      ["targety", "targetY"],
      ["textlength", "textLength"],
      ["viewbox", "viewBox"],
      ["viewtarget", "viewTarget"],
      ["xchannelselector", "xChannelSelector"],
      ["ychannelselector", "yChannelSelector"],
      ["zoomandpan", "zoomAndPan"]
    ]);
  }
});

// node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js
var require_lib4 = __commonJS({
  "node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js"(exports2) {
    "use strict";
    var __assign2 = exports2 && exports2.__assign || function() {
      __assign2 = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s)
            if (Object.prototype.hasOwnProperty.call(s, p))
              t[p] = s[p];
        }
        return t;
      };
      return __assign2.apply(this, arguments);
    };
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      Object.defineProperty(o, k2, { enumerable: true, get: function() {
        return m[k];
      } });
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    var ElementType = __importStar2(require_lib());
    var entities_1 = require_lib3();
    var foreignNames_1 = require_foreignNames();
    var unencodedElements = /* @__PURE__ */ new Set([
      "style",
      "script",
      "xmp",
      "iframe",
      "noembed",
      "noframes",
      "plaintext",
      "noscript"
    ]);
    function formatAttributes(attributes, opts) {
      if (!attributes)
        return;
      return Object.keys(attributes).map(function(key) {
        var _a, _b;
        var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
        if (opts.xmlMode === "foreign") {
          key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
        }
        if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
          return key;
        }
        return key + '="' + (opts.decodeEntities !== false ? entities_1.encodeXML(value) : value.replace(/"/g, "&quot;")) + '"';
      }).join(" ");
    }
    var singleTag = /* @__PURE__ */ new Set([
      "area",
      "base",
      "basefont",
      "br",
      "col",
      "command",
      "embed",
      "frame",
      "hr",
      "img",
      "input",
      "isindex",
      "keygen",
      "link",
      "meta",
      "param",
      "source",
      "track",
      "wbr"
    ]);
    function render(node, options) {
      if (options === void 0) {
        options = {};
      }
      var nodes = "length" in node ? node : [node];
      var output = "";
      for (var i = 0; i < nodes.length; i++) {
        output += renderNode(nodes[i], options);
      }
      return output;
    }
    exports2.default = render;
    function renderNode(node, options) {
      switch (node.type) {
        case ElementType.Root:
          return render(node.children, options);
        case ElementType.Directive:
        case ElementType.Doctype:
          return renderDirective(node);
        case ElementType.Comment:
          return renderComment(node);
        case ElementType.CDATA:
          return renderCdata(node);
        case ElementType.Script:
        case ElementType.Style:
        case ElementType.Tag:
          return renderTag(node, options);
        case ElementType.Text:
          return renderText(node, options);
      }
    }
    var foreignModeIntegrationPoints = /* @__PURE__ */ new Set([
      "mi",
      "mo",
      "mn",
      "ms",
      "mtext",
      "annotation-xml",
      "foreignObject",
      "desc",
      "title"
    ]);
    var foreignElements = /* @__PURE__ */ new Set(["svg", "math"]);
    function renderTag(elem, opts) {
      var _a;
      if (opts.xmlMode === "foreign") {
        elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
        if (elem.parent && foreignModeIntegrationPoints.has(elem.parent.name)) {
          opts = __assign2(__assign2({}, opts), { xmlMode: false });
        }
      }
      if (!opts.xmlMode && foreignElements.has(elem.name)) {
        opts = __assign2(__assign2({}, opts), { xmlMode: "foreign" });
      }
      var tag = "<" + elem.name;
      var attribs = formatAttributes(elem.attribs, opts);
      if (attribs) {
        tag += " " + attribs;
      }
      if (elem.children.length === 0 && (opts.xmlMode ? (
        // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
        opts.selfClosingTags !== false
      ) : (
        // User explicitly asked for self-closing tags, even in HTML mode
        opts.selfClosingTags && singleTag.has(elem.name)
      ))) {
        if (!opts.xmlMode)
          tag += " ";
        tag += "/>";
      } else {
        tag += ">";
        if (elem.children.length > 0) {
          tag += render(elem.children, opts);
        }
        if (opts.xmlMode || !singleTag.has(elem.name)) {
          tag += "</" + elem.name + ">";
        }
      }
      return tag;
    }
    function renderDirective(elem) {
      return "<" + elem.data + ">";
    }
    function renderText(elem, opts) {
      var data = elem.data || "";
      if (opts.decodeEntities !== false && !(!opts.xmlMode && elem.parent && unencodedElements.has(elem.parent.name))) {
        data = entities_1.encodeXML(data);
      }
      return data;
    }
    function renderCdata(elem) {
      return "<![CDATA[" + elem.children[0].data + "]]>";
    }
    function renderComment(elem) {
      return "<!--" + elem.data + "-->";
    }
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/stringify.js
var require_stringify = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/stringify.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.innerText = exports2.textContent = exports2.getText = exports2.getInnerHTML = exports2.getOuterHTML = void 0;
    var domhandler_1 = require_lib2();
    var dom_serializer_1 = __importDefault2(require_lib4());
    var domelementtype_1 = require_lib();
    function getOuterHTML(node, options) {
      return (0, dom_serializer_1.default)(node, options);
    }
    exports2.getOuterHTML = getOuterHTML;
    function getInnerHTML(node, options) {
      return (0, domhandler_1.hasChildren)(node) ? node.children.map(function(node2) {
        return getOuterHTML(node2, options);
      }).join("") : "";
    }
    exports2.getInnerHTML = getInnerHTML;
    function getText(node) {
      if (Array.isArray(node))
        return node.map(getText).join("");
      if ((0, domhandler_1.isTag)(node))
        return node.name === "br" ? "\n" : getText(node.children);
      if ((0, domhandler_1.isCDATA)(node))
        return getText(node.children);
      if ((0, domhandler_1.isText)(node))
        return node.data;
      return "";
    }
    exports2.getText = getText;
    function textContent(node) {
      if (Array.isArray(node))
        return node.map(textContent).join("");
      if ((0, domhandler_1.hasChildren)(node) && !(0, domhandler_1.isComment)(node)) {
        return textContent(node.children);
      }
      if ((0, domhandler_1.isText)(node))
        return node.data;
      return "";
    }
    exports2.textContent = textContent;
    function innerText(node) {
      if (Array.isArray(node))
        return node.map(innerText).join("");
      if ((0, domhandler_1.hasChildren)(node) && (node.type === domelementtype_1.ElementType.Tag || (0, domhandler_1.isCDATA)(node))) {
        return innerText(node.children);
      }
      if ((0, domhandler_1.isText)(node))
        return node.data;
      return "";
    }
    exports2.innerText = innerText;
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/traversal.js
var require_traversal = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/traversal.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.prevElementSibling = exports2.nextElementSibling = exports2.getName = exports2.hasAttrib = exports2.getAttributeValue = exports2.getSiblings = exports2.getParent = exports2.getChildren = void 0;
    var domhandler_1 = require_lib2();
    var emptyArray = [];
    function getChildren(elem) {
      var _a;
      return (_a = elem.children) !== null && _a !== void 0 ? _a : emptyArray;
    }
    exports2.getChildren = getChildren;
    function getParent(elem) {
      return elem.parent || null;
    }
    exports2.getParent = getParent;
    function getSiblings(elem) {
      var _a, _b;
      var parent = getParent(elem);
      if (parent != null)
        return getChildren(parent);
      var siblings = [elem];
      var prev = elem.prev, next = elem.next;
      while (prev != null) {
        siblings.unshift(prev);
        _a = prev, prev = _a.prev;
      }
      while (next != null) {
        siblings.push(next);
        _b = next, next = _b.next;
      }
      return siblings;
    }
    exports2.getSiblings = getSiblings;
    function getAttributeValue(elem, name) {
      var _a;
      return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];
    }
    exports2.getAttributeValue = getAttributeValue;
    function hasAttrib(elem, name) {
      return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name) && elem.attribs[name] != null;
    }
    exports2.hasAttrib = hasAttrib;
    function getName(elem) {
      return elem.name;
    }
    exports2.getName = getName;
    function nextElementSibling(elem) {
      var _a;
      var next = elem.next;
      while (next !== null && !(0, domhandler_1.isTag)(next))
        _a = next, next = _a.next;
      return next;
    }
    exports2.nextElementSibling = nextElementSibling;
    function prevElementSibling(elem) {
      var _a;
      var prev = elem.prev;
      while (prev !== null && !(0, domhandler_1.isTag)(prev))
        _a = prev, prev = _a.prev;
      return prev;
    }
    exports2.prevElementSibling = prevElementSibling;
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js
var require_manipulation = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.prepend = exports2.prependChild = exports2.append = exports2.appendChild = exports2.replaceElement = exports2.removeElement = void 0;
    function removeElement(elem) {
      if (elem.prev)
        elem.prev.next = elem.next;
      if (elem.next)
        elem.next.prev = elem.prev;
      if (elem.parent) {
        var childs = elem.parent.children;
        childs.splice(childs.lastIndexOf(elem), 1);
      }
    }
    exports2.removeElement = removeElement;
    function replaceElement(elem, replacement) {
      var prev = replacement.prev = elem.prev;
      if (prev) {
        prev.next = replacement;
      }
      var next = replacement.next = elem.next;
      if (next) {
        next.prev = replacement;
      }
      var parent = replacement.parent = elem.parent;
      if (parent) {
        var childs = parent.children;
        childs[childs.lastIndexOf(elem)] = replacement;
      }
    }
    exports2.replaceElement = replaceElement;
    function appendChild(elem, child) {
      removeElement(child);
      child.next = null;
      child.parent = elem;
      if (elem.children.push(child) > 1) {
        var sibling = elem.children[elem.children.length - 2];
        sibling.next = child;
        child.prev = sibling;
      } else {
        child.prev = null;
      }
    }
    exports2.appendChild = appendChild;
    function append(elem, next) {
      removeElement(next);
      var parent = elem.parent;
      var currNext = elem.next;
      next.next = currNext;
      next.prev = elem;
      elem.next = next;
      next.parent = parent;
      if (currNext) {
        currNext.prev = next;
        if (parent) {
          var childs = parent.children;
          childs.splice(childs.lastIndexOf(currNext), 0, next);
        }
      } else if (parent) {
        parent.children.push(next);
      }
    }
    exports2.append = append;
    function prependChild(elem, child) {
      removeElement(child);
      child.parent = elem;
      child.prev = null;
      if (elem.children.unshift(child) !== 1) {
        var sibling = elem.children[1];
        sibling.prev = child;
        child.next = sibling;
      } else {
        child.next = null;
      }
    }
    exports2.prependChild = prependChild;
    function prepend(elem, prev) {
      removeElement(prev);
      var parent = elem.parent;
      if (parent) {
        var childs = parent.children;
        childs.splice(childs.indexOf(elem), 0, prev);
      }
      if (elem.prev) {
        elem.prev.next = prev;
      }
      prev.parent = parent;
      prev.prev = elem.prev;
      prev.next = elem;
      elem.prev = prev;
    }
    exports2.prepend = prepend;
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/querying.js
var require_querying = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/querying.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.findAll = exports2.existsOne = exports2.findOne = exports2.findOneChild = exports2.find = exports2.filter = void 0;
    var domhandler_1 = require_lib2();
    function filter(test, node, recurse, limit) {
      if (recurse === void 0) {
        recurse = true;
      }
      if (limit === void 0) {
        limit = Infinity;
      }
      if (!Array.isArray(node))
        node = [node];
      return find(test, node, recurse, limit);
    }
    exports2.filter = filter;
    function find(test, nodes, recurse, limit) {
      var result = [];
      for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
        var elem = nodes_1[_i];
        if (test(elem)) {
          result.push(elem);
          if (--limit <= 0)
            break;
        }
        if (recurse && (0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) {
          var children = find(test, elem.children, recurse, limit);
          result.push.apply(result, children);
          limit -= children.length;
          if (limit <= 0)
            break;
        }
      }
      return result;
    }
    exports2.find = find;
    function findOneChild(test, nodes) {
      return nodes.find(test);
    }
    exports2.findOneChild = findOneChild;
    function findOne(test, nodes, recurse) {
      if (recurse === void 0) {
        recurse = true;
      }
      var elem = null;
      for (var i = 0; i < nodes.length && !elem; i++) {
        var checked = nodes[i];
        if (!(0, domhandler_1.isTag)(checked)) {
          continue;
        } else if (test(checked)) {
          elem = checked;
        } else if (recurse && checked.children.length > 0) {
          elem = findOne(test, checked.children);
        }
      }
      return elem;
    }
    exports2.findOne = findOne;
    function existsOne(test, nodes) {
      return nodes.some(function(checked) {
        return (0, domhandler_1.isTag)(checked) && (test(checked) || checked.children.length > 0 && existsOne(test, checked.children));
      });
    }
    exports2.existsOne = existsOne;
    function findAll(test, nodes) {
      var _a;
      var result = [];
      var stack = nodes.filter(domhandler_1.isTag);
      var elem;
      while (elem = stack.shift()) {
        var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag);
        if (children && children.length > 0) {
          stack.unshift.apply(stack, children);
        }
        if (test(elem))
          result.push(elem);
      }
      return result;
    }
    exports2.findAll = findAll;
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/legacy.js
var require_legacy2 = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/legacy.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getElementsByTagType = exports2.getElementsByTagName = exports2.getElementById = exports2.getElements = exports2.testElement = void 0;
    var domhandler_1 = require_lib2();
    var querying_1 = require_querying();
    var Checks = {
      tag_name: function(name) {
        if (typeof name === "function") {
          return function(elem) {
            return (0, domhandler_1.isTag)(elem) && name(elem.name);
          };
        } else if (name === "*") {
          return domhandler_1.isTag;
        }
        return function(elem) {
          return (0, domhandler_1.isTag)(elem) && elem.name === name;
        };
      },
      tag_type: function(type) {
        if (typeof type === "function") {
          return function(elem) {
            return type(elem.type);
          };
        }
        return function(elem) {
          return elem.type === type;
        };
      },
      tag_contains: function(data) {
        if (typeof data === "function") {
          return function(elem) {
            return (0, domhandler_1.isText)(elem) && data(elem.data);
          };
        }
        return function(elem) {
          return (0, domhandler_1.isText)(elem) && elem.data === data;
        };
      }
    };
    function getAttribCheck(attrib, value) {
      if (typeof value === "function") {
        return function(elem) {
          return (0, domhandler_1.isTag)(elem) && value(elem.attribs[attrib]);
        };
      }
      return function(elem) {
        return (0, domhandler_1.isTag)(elem) && elem.attribs[attrib] === value;
      };
    }
    function combineFuncs(a, b) {
      return function(elem) {
        return a(elem) || b(elem);
      };
    }
    function compileTest(options) {
      var funcs = Object.keys(options).map(function(key) {
        var value = options[key];
        return Object.prototype.hasOwnProperty.call(Checks, key) ? Checks[key](value) : getAttribCheck(key, value);
      });
      return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
    }
    function testElement(options, node) {
      var test = compileTest(options);
      return test ? test(node) : true;
    }
    exports2.testElement = testElement;
    function getElements(options, nodes, recurse, limit) {
      if (limit === void 0) {
        limit = Infinity;
      }
      var test = compileTest(options);
      return test ? (0, querying_1.filter)(test, nodes, recurse, limit) : [];
    }
    exports2.getElements = getElements;
    function getElementById(id, nodes, recurse) {
      if (recurse === void 0) {
        recurse = true;
      }
      if (!Array.isArray(nodes))
        nodes = [nodes];
      return (0, querying_1.findOne)(getAttribCheck("id", id), nodes, recurse);
    }
    exports2.getElementById = getElementById;
    function getElementsByTagName(tagName, nodes, recurse, limit) {
      if (recurse === void 0) {
        recurse = true;
      }
      if (limit === void 0) {
        limit = Infinity;
      }
      return (0, querying_1.filter)(Checks.tag_name(tagName), nodes, recurse, limit);
    }
    exports2.getElementsByTagName = getElementsByTagName;
    function getElementsByTagType(type, nodes, recurse, limit) {
      if (recurse === void 0) {
        recurse = true;
      }
      if (limit === void 0) {
        limit = Infinity;
      }
      return (0, querying_1.filter)(Checks.tag_type(type), nodes, recurse, limit);
    }
    exports2.getElementsByTagType = getElementsByTagType;
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/helpers.js
var require_helpers = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/helpers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.uniqueSort = exports2.compareDocumentPosition = exports2.removeSubsets = void 0;
    var domhandler_1 = require_lib2();
    function removeSubsets(nodes) {
      var idx = nodes.length;
      while (--idx >= 0) {
        var node = nodes[idx];
        if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
          nodes.splice(idx, 1);
          continue;
        }
        for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
          if (nodes.includes(ancestor)) {
            nodes.splice(idx, 1);
            break;
          }
        }
      }
      return nodes;
    }
    exports2.removeSubsets = removeSubsets;
    function compareDocumentPosition(nodeA, nodeB) {
      var aParents = [];
      var bParents = [];
      if (nodeA === nodeB) {
        return 0;
      }
      var current = (0, domhandler_1.hasChildren)(nodeA) ? nodeA : nodeA.parent;
      while (current) {
        aParents.unshift(current);
        current = current.parent;
      }
      current = (0, domhandler_1.hasChildren)(nodeB) ? nodeB : nodeB.parent;
      while (current) {
        bParents.unshift(current);
        current = current.parent;
      }
      var maxIdx = Math.min(aParents.length, bParents.length);
      var idx = 0;
      while (idx < maxIdx && aParents[idx] === bParents[idx]) {
        idx++;
      }
      if (idx === 0) {
        return 1;
      }
      var sharedParent = aParents[idx - 1];
      var siblings = sharedParent.children;
      var aSibling = aParents[idx];
      var bSibling = bParents[idx];
      if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
        if (sharedParent === nodeB) {
          return 4 | 16;
        }
        return 4;
      }
      if (sharedParent === nodeA) {
        return 2 | 8;
      }
      return 2;
    }
    exports2.compareDocumentPosition = compareDocumentPosition;
    function uniqueSort(nodes) {
      nodes = nodes.filter(function(node, i, arr) {
        return !arr.includes(node, i + 1);
      });
      nodes.sort(function(a, b) {
        var relative = compareDocumentPosition(a, b);
        if (relative & 2) {
          return -1;
        } else if (relative & 4) {
          return 1;
        }
        return 0;
      });
      return nodes;
    }
    exports2.uniqueSort = uniqueSort;
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/feeds.js
var require_feeds = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/feeds.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getFeed = void 0;
    var stringify_1 = require_stringify();
    var legacy_1 = require_legacy2();
    function getFeed(doc) {
      var feedRoot = getOneElement(isValidFeed, doc);
      return !feedRoot ? null : feedRoot.name === "feed" ? getAtomFeed(feedRoot) : getRssFeed(feedRoot);
    }
    exports2.getFeed = getFeed;
    function getAtomFeed(feedRoot) {
      var _a;
      var childs = feedRoot.children;
      var feed = {
        type: "atom",
        items: (0, legacy_1.getElementsByTagName)("entry", childs).map(function(item) {
          var _a2;
          var children = item.children;
          var entry = { media: getMediaElements(children) };
          addConditionally(entry, "id", "id", children);
          addConditionally(entry, "title", "title", children);
          var href2 = (_a2 = getOneElement("link", children)) === null || _a2 === void 0 ? void 0 : _a2.attribs.href;
          if (href2) {
            entry.link = href2;
          }
          var description = fetch("summary", children) || fetch("content", children);
          if (description) {
            entry.description = description;
          }
          var pubDate = fetch("updated", children);
          if (pubDate) {
            entry.pubDate = new Date(pubDate);
          }
          return entry;
        })
      };
      addConditionally(feed, "id", "id", childs);
      addConditionally(feed, "title", "title", childs);
      var href = (_a = getOneElement("link", childs)) === null || _a === void 0 ? void 0 : _a.attribs.href;
      if (href) {
        feed.link = href;
      }
      addConditionally(feed, "description", "subtitle", childs);
      var updated = fetch("updated", childs);
      if (updated) {
        feed.updated = new Date(updated);
      }
      addConditionally(feed, "author", "email", childs, true);
      return feed;
    }
    function getRssFeed(feedRoot) {
      var _a, _b;
      var childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
      var feed = {
        type: feedRoot.name.substr(0, 3),
        id: "",
        items: (0, legacy_1.getElementsByTagName)("item", feedRoot.children).map(function(item) {
          var children = item.children;
          var entry = { media: getMediaElements(children) };
          addConditionally(entry, "id", "guid", children);
          addConditionally(entry, "title", "title", children);
          addConditionally(entry, "link", "link", children);
          addConditionally(entry, "description", "description", children);
          var pubDate = fetch("pubDate", children);
          if (pubDate)
            entry.pubDate = new Date(pubDate);
          return entry;
        })
      };
      addConditionally(feed, "title", "title", childs);
      addConditionally(feed, "link", "link", childs);
      addConditionally(feed, "description", "description", childs);
      var updated = fetch("lastBuildDate", childs);
      if (updated) {
        feed.updated = new Date(updated);
      }
      addConditionally(feed, "author", "managingEditor", childs, true);
      return feed;
    }
    var MEDIA_KEYS_STRING = ["url", "type", "lang"];
    var MEDIA_KEYS_INT = [
      "fileSize",
      "bitrate",
      "framerate",
      "samplingrate",
      "channels",
      "duration",
      "height",
      "width"
    ];
    function getMediaElements(where) {
      return (0, legacy_1.getElementsByTagName)("media:content", where).map(function(elem) {
        var attribs = elem.attribs;
        var media = {
          medium: attribs.medium,
          isDefault: !!attribs.isDefault
        };
        for (var _i = 0, MEDIA_KEYS_STRING_1 = MEDIA_KEYS_STRING; _i < MEDIA_KEYS_STRING_1.length; _i++) {
          var attrib = MEDIA_KEYS_STRING_1[_i];
          if (attribs[attrib]) {
            media[attrib] = attribs[attrib];
          }
        }
        for (var _a = 0, MEDIA_KEYS_INT_1 = MEDIA_KEYS_INT; _a < MEDIA_KEYS_INT_1.length; _a++) {
          var attrib = MEDIA_KEYS_INT_1[_a];
          if (attribs[attrib]) {
            media[attrib] = parseInt(attribs[attrib], 10);
          }
        }
        if (attribs.expression) {
          media.expression = attribs.expression;
        }
        return media;
      });
    }
    function getOneElement(tagName, node) {
      return (0, legacy_1.getElementsByTagName)(tagName, node, true, 1)[0];
    }
    function fetch(tagName, where, recurse) {
      if (recurse === void 0) {
        recurse = false;
      }
      return (0, stringify_1.textContent)((0, legacy_1.getElementsByTagName)(tagName, where, recurse, 1)).trim();
    }
    function addConditionally(obj2, prop, tagName, where, recurse) {
      if (recurse === void 0) {
        recurse = false;
      }
      var val = fetch(tagName, where, recurse);
      if (val)
        obj2[prop] = val;
    }
    function isValidFeed(value) {
      return value === "rss" || value === "feed" || value === "rdf:RDF";
    }
  }
});

// node_modules/htmlparser2/node_modules/domutils/lib/index.js
var require_lib5 = __commonJS({
  "node_modules/htmlparser2/node_modules/domutils/lib/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      Object.defineProperty(o, k2, { enumerable: true, get: function() {
        return m[k];
      } });
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.hasChildren = exports2.isDocument = exports2.isComment = exports2.isText = exports2.isCDATA = exports2.isTag = void 0;
    __exportStar2(require_stringify(), exports2);
    __exportStar2(require_traversal(), exports2);
    __exportStar2(require_manipulation(), exports2);
    __exportStar2(require_querying(), exports2);
    __exportStar2(require_legacy2(), exports2);
    __exportStar2(require_helpers(), exports2);
    __exportStar2(require_feeds(), exports2);
    var domhandler_1 = require_lib2();
    Object.defineProperty(exports2, "isTag", { enumerable: true, get: function() {
      return domhandler_1.isTag;
    } });
    Object.defineProperty(exports2, "isCDATA", { enumerable: true, get: function() {
      return domhandler_1.isCDATA;
    } });
    Object.defineProperty(exports2, "isText", { enumerable: true, get: function() {
      return domhandler_1.isText;
    } });
    Object.defineProperty(exports2, "isComment", { enumerable: true, get: function() {
      return domhandler_1.isComment;
    } });
    Object.defineProperty(exports2, "isDocument", { enumerable: true, get: function() {
      return domhandler_1.isDocument;
    } });
    Object.defineProperty(exports2, "hasChildren", { enumerable: true, get: function() {
      return domhandler_1.hasChildren;
    } });
  }
});

// node_modules/htmlparser2/lib/FeedHandler.js
var require_FeedHandler = __commonJS({
  "node_modules/htmlparser2/lib/FeedHandler.js"(exports2) {
    "use strict";
    var __extends2 = exports2 && exports2.__extends || function() {
      var extendStatics2 = function(d, b) {
        extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
          d2.__proto__ = b2;
        } || function(d2, b2) {
          for (var p in b2)
            if (Object.prototype.hasOwnProperty.call(b2, p))
              d2[p] = b2[p];
        };
        return extendStatics2(d, b);
      };
      return function(d, b) {
        if (typeof b !== "function" && b !== null)
          throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics2(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      Object.defineProperty(o, k2, { enumerable: true, get: function() {
        return m[k];
      } });
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.parseFeed = exports2.FeedHandler = void 0;
    var domhandler_1 = __importDefault2(require_lib2());
    var DomUtils = __importStar2(require_lib5());
    var Parser_1 = require_Parser();
    var FeedItemMediaMedium;
    (function(FeedItemMediaMedium2) {
      FeedItemMediaMedium2[FeedItemMediaMedium2["image"] = 0] = "image";
      FeedItemMediaMedium2[FeedItemMediaMedium2["audio"] = 1] = "audio";
      FeedItemMediaMedium2[FeedItemMediaMedium2["video"] = 2] = "video";
      FeedItemMediaMedium2[FeedItemMediaMedium2["document"] = 3] = "document";
      FeedItemMediaMedium2[FeedItemMediaMedium2["executable"] = 4] = "executable";
    })(FeedItemMediaMedium || (FeedItemMediaMedium = {}));
    var FeedItemMediaExpression;
    (function(FeedItemMediaExpression2) {
      FeedItemMediaExpression2[FeedItemMediaExpression2["sample"] = 0] = "sample";
      FeedItemMediaExpression2[FeedItemMediaExpression2["full"] = 1] = "full";
      FeedItemMediaExpression2[FeedItemMediaExpression2["nonstop"] = 2] = "nonstop";
    })(FeedItemMediaExpression || (FeedItemMediaExpression = {}));
    var FeedHandler = (
      /** @class */
      function(_super) {
        __extends2(FeedHandler2, _super);
        function FeedHandler2(callback, options) {
          var _this = this;
          if (typeof callback === "object") {
            callback = void 0;
            options = callback;
          }
          _this = _super.call(this, callback, options) || this;
          return _this;
        }
        FeedHandler2.prototype.onend = function() {
          var _a, _b;
          var feedRoot = getOneElement(isValidFeed, this.dom);
          if (!feedRoot) {
            this.handleCallback(new Error("couldn't find root of feed"));
            return;
          }
          var feed = {};
          if (feedRoot.name === "feed") {
            var childs = feedRoot.children;
            feed.type = "atom";
            addConditionally(feed, "id", "id", childs);
            addConditionally(feed, "title", "title", childs);
            var href = getAttribute("href", getOneElement("link", childs));
            if (href) {
              feed.link = href;
            }
            addConditionally(feed, "description", "subtitle", childs);
            var updated = fetch("updated", childs);
            if (updated) {
              feed.updated = new Date(updated);
            }
            addConditionally(feed, "author", "email", childs, true);
            feed.items = getElements("entry", childs).map(function(item) {
              var entry = {};
              var children = item.children;
              addConditionally(entry, "id", "id", children);
              addConditionally(entry, "title", "title", children);
              var href2 = getAttribute("href", getOneElement("link", children));
              if (href2) {
                entry.link = href2;
              }
              var description = fetch("summary", children) || fetch("content", children);
              if (description) {
                entry.description = description;
              }
              var pubDate = fetch("updated", children);
              if (pubDate) {
                entry.pubDate = new Date(pubDate);
              }
              entry.media = getMediaElements(children);
              return entry;
            });
          } else {
            var childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
            feed.type = feedRoot.name.substr(0, 3);
            feed.id = "";
            addConditionally(feed, "title", "title", childs);
            addConditionally(feed, "link", "link", childs);
            addConditionally(feed, "description", "description", childs);
            var updated = fetch("lastBuildDate", childs);
            if (updated) {
              feed.updated = new Date(updated);
            }
            addConditionally(feed, "author", "managingEditor", childs, true);
            feed.items = getElements("item", feedRoot.children).map(function(item) {
              var entry = {};
              var children = item.children;
              addConditionally(entry, "id", "guid", children);
              addConditionally(entry, "title", "title", children);
              addConditionally(entry, "link", "link", children);
              addConditionally(entry, "description", "description", children);
              var pubDate = fetch("pubDate", children);
              if (pubDate)
                entry.pubDate = new Date(pubDate);
              entry.media = getMediaElements(children);
              return entry;
            });
          }
          this.feed = feed;
          this.handleCallback(null);
        };
        return FeedHandler2;
      }(domhandler_1.default)
    );
    exports2.FeedHandler = FeedHandler;
    function getMediaElements(where) {
      return getElements("media:content", where).map(function(elem) {
        var media = {
          medium: elem.attribs.medium,
          isDefault: !!elem.attribs.isDefault
        };
        if (elem.attribs.url) {
          media.url = elem.attribs.url;
        }
        if (elem.attribs.fileSize) {
          media.fileSize = parseInt(elem.attribs.fileSize, 10);
        }
        if (elem.attribs.type) {
          media.type = elem.attribs.type;
        }
        if (elem.attribs.expression) {
          media.expression = elem.attribs.expression;
        }
        if (elem.attribs.bitrate) {
          media.bitrate = parseInt(elem.attribs.bitrate, 10);
        }
        if (elem.attribs.framerate) {
          media.framerate = parseInt(elem.attribs.framerate, 10);
        }
        if (elem.attribs.samplingrate) {
          media.samplingrate = parseInt(elem.attribs.samplingrate, 10);
        }
        if (elem.attribs.channels) {
          media.channels = parseInt(elem.attribs.channels, 10);
        }
        if (elem.attribs.duration) {
          media.duration = parseInt(elem.attribs.duration, 10);
        }
        if (elem.attribs.height) {
          media.height = parseInt(elem.attribs.height, 10);
        }
        if (elem.attribs.width) {
          media.width = parseInt(elem.attribs.width, 10);
        }
        if (elem.attribs.lang) {
          media.lang = elem.attribs.lang;
        }
        return media;
      });
    }
    function getElements(tagName, where) {
      return DomUtils.getElementsByTagName(tagName, where, true);
    }
    function getOneElement(tagName, node) {
      return DomUtils.getElementsByTagName(tagName, node, true, 1)[0];
    }
    function fetch(tagName, where, recurse) {
      if (recurse === void 0) {
        recurse = false;
      }
      return DomUtils.getText(DomUtils.getElementsByTagName(tagName, where, recurse, 1)).trim();
    }
    function getAttribute(name, elem) {
      if (!elem) {
        return null;
      }
      var attribs = elem.attribs;
      return attribs[name];
    }
    function addConditionally(obj2, prop, what, where, recurse) {
      if (recurse === void 0) {
        recurse = false;
      }
      var tmp = fetch(what, where, recurse);
      if (tmp)
        obj2[prop] = tmp;
    }
    function isValidFeed(value) {
      return value === "rss" || value === "feed" || value === "rdf:RDF";
    }
    function parseFeed(feed, options) {
      if (options === void 0) {
        options = { xmlMode: true };
      }
      var handler = new FeedHandler(options);
      new Parser_1.Parser(handler, options).end(feed);
      return handler.feed;
    }
    exports2.parseFeed = parseFeed;
  }
});

// node_modules/htmlparser2/lib/index.js
var require_lib6 = __commonJS({
  "node_modules/htmlparser2/lib/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      Object.defineProperty(o, k2, { enumerable: true, get: function() {
        return m[k];
      } });
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RssHandler = exports2.DefaultHandler = exports2.DomUtils = exports2.ElementType = exports2.Tokenizer = exports2.createDomStream = exports2.parseDOM = exports2.parseDocument = exports2.DomHandler = exports2.Parser = void 0;
    var Parser_1 = require_Parser();
    Object.defineProperty(exports2, "Parser", { enumerable: true, get: function() {
      return Parser_1.Parser;
    } });
    var domhandler_1 = require_lib2();
    Object.defineProperty(exports2, "DomHandler", { enumerable: true, get: function() {
      return domhandler_1.DomHandler;
    } });
    Object.defineProperty(exports2, "DefaultHandler", { enumerable: true, get: function() {
      return domhandler_1.DomHandler;
    } });
    function parseDocument(data, options) {
      var handler = new domhandler_1.DomHandler(void 0, options);
      new Parser_1.Parser(handler, options).end(data);
      return handler.root;
    }
    exports2.parseDocument = parseDocument;
    function parseDOM(data, options) {
      return parseDocument(data, options).children;
    }
    exports2.parseDOM = parseDOM;
    function createDomStream(cb, options, elementCb) {
      var handler = new domhandler_1.DomHandler(cb, options, elementCb);
      return new Parser_1.Parser(handler, options);
    }
    exports2.createDomStream = createDomStream;
    var Tokenizer_1 = require_Tokenizer();
    Object.defineProperty(exports2, "Tokenizer", { enumerable: true, get: function() {
      return __importDefault2(Tokenizer_1).default;
    } });
    var ElementType = __importStar2(require_lib());
    exports2.ElementType = ElementType;
    __exportStar2(require_FeedHandler(), exports2);
    exports2.DomUtils = __importStar2(require_lib5());
    var FeedHandler_1 = require_FeedHandler();
    Object.defineProperty(exports2, "RssHandler", { enumerable: true, get: function() {
      return FeedHandler_1.FeedHandler;
    } });
  }
});

// node_modules/telegram/extensions/html.js
var require_html = __commonJS({
  "node_modules/telegram/extensions/html.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.HTMLParser = void 0;
    var htmlparser2_1 = require_lib6();
    var tl_1 = require_tl();
    var index_1 = require_telegram();
    var HTMLToTelegramParser = class {
      constructor() {
        this.text = "";
        this.entities = [];
        this._buildingEntities = /* @__PURE__ */ new Map();
        this._openTags = [];
        this._openTagsMeta = [];
      }
      onopentag(name, attributes) {
        this._openTags.unshift(name);
        this._openTagsMeta.unshift(void 0);
        let EntityType;
        const args = {};
        if (name == "strong" || name == "b") {
          EntityType = tl_1.Api.MessageEntityBold;
        } else if (name == "spoiler") {
          EntityType = tl_1.Api.MessageEntitySpoiler;
        } else if (name == "em" || name == "i") {
          EntityType = tl_1.Api.MessageEntityItalic;
        } else if (name == "u") {
          EntityType = tl_1.Api.MessageEntityUnderline;
        } else if (name == "del" || name == "s") {
          EntityType = tl_1.Api.MessageEntityStrike;
        } else if (name == "blockquote") {
          EntityType = tl_1.Api.MessageEntityBlockquote;
          if (attributes.expandable !== void 0) {
            args.collapsed = true;
          }
        } else if (name == "code") {
          const pre = this._buildingEntities.get("pre");
          if (pre && pre instanceof tl_1.Api.MessageEntityPre) {
            try {
              pre.language = attributes.class.slice("language-".length, attributes.class.length);
            } catch (e) {
            }
          } else {
            EntityType = tl_1.Api.MessageEntityCode;
          }
        } else if (name == "pre") {
          EntityType = tl_1.Api.MessageEntityPre;
          args["language"] = "";
        } else if (name == "a") {
          let url = attributes.href;
          if (!url) {
            return;
          }
          if (url.startsWith("mailto:")) {
            url = url.slice("mailto:".length, url.length);
            EntityType = tl_1.Api.MessageEntityEmail;
          } else {
            EntityType = tl_1.Api.MessageEntityTextUrl;
            args["url"] = url;
            url = void 0;
          }
          this._openTagsMeta.shift();
          this._openTagsMeta.unshift(url);
        } else if (name == "tg-emoji") {
          EntityType = tl_1.Api.MessageEntityCustomEmoji;
          args["documentId"] = attributes["emoji-id"];
        }
        if (EntityType && !this._buildingEntities.has(name)) {
          this._buildingEntities.set(name, new EntityType(Object.assign({ offset: this.text.length, length: 0 }, args)));
        }
      }
      ontext(text) {
        const previousTag = this._openTags.length > 0 ? this._openTags[0] : "";
        if (previousTag == "a") {
          const url = this._openTagsMeta[0];
          if (url) {
            text = url;
          }
        }
        for (let [tag, entity] of this._buildingEntities) {
          entity.length += text.length;
        }
        this.text += text;
      }
      onclosetag(tagname) {
        this._openTagsMeta.shift();
        this._openTags.shift();
        const entity = this._buildingEntities.get(tagname);
        if (entity) {
          this._buildingEntities.delete(tagname);
          this.entities.push(entity);
        }
      }
      onattribute(name, value, quote) {
      }
      oncdataend() {
      }
      oncdatastart() {
      }
      oncomment(data) {
      }
      oncommentend() {
      }
      onend() {
      }
      onerror(error) {
      }
      onopentagname(name) {
      }
      onparserinit(parser) {
      }
      onprocessinginstruction(name, data) {
      }
      onreset() {
      }
    };
    var HTMLParser = class {
      static parse(html) {
        if (!html) {
          return [html, []];
        }
        const handler = new HTMLToTelegramParser();
        const parser = new htmlparser2_1.Parser(handler);
        parser.write(html);
        parser.end();
        const text = index_1.helpers.stripText(handler.text, handler.entities);
        return [text, handler.entities];
      }
      static unparse(text, entities, _offset = 0, _length) {
        if (!text || !entities || !entities.length) {
          return text;
        }
        if (_length == void 0) {
          _length = text.length;
        }
        const html = [];
        let lastOffset = 0;
        for (let i = 0; i < entities.length; i++) {
          const entity = entities[i];
          if (entity.offset >= _offset + _length) {
            break;
          }
          let relativeOffset = entity.offset - _offset;
          if (relativeOffset > lastOffset) {
            html.push(text.slice(lastOffset, relativeOffset));
          } else if (relativeOffset < lastOffset) {
            continue;
          }
          let skipEntity = false;
          let length = entity.length;
          let entityText = this.unparse(text.slice(relativeOffset, relativeOffset + length), entities.slice(i + 1, entities.length), entity.offset, length);
          if (entity instanceof tl_1.Api.MessageEntityBold) {
            html.push(`<strong>${entityText}</strong>`);
          } else if (entity instanceof tl_1.Api.MessageEntitySpoiler) {
            html.push(`<spoiler>${entityText}</spoiler>`);
          } else if (entity instanceof tl_1.Api.MessageEntityItalic) {
            html.push(`<em>${entityText}</em>`);
          } else if (entity instanceof tl_1.Api.MessageEntityCode) {
            html.push(`<code>${entityText}</code>`);
          } else if (entity instanceof tl_1.Api.MessageEntityUnderline) {
            html.push(`<u>${entityText}</u>`);
          } else if (entity instanceof tl_1.Api.MessageEntityStrike) {
            html.push(`<del>${entityText}</del>`);
          } else if (entity instanceof tl_1.Api.MessageEntityBlockquote) {
            html.push(`<blockquote>${entityText}</blockquote>`);
          } else if (entity instanceof tl_1.Api.MessageEntityPre) {
            if (entity.language) {
              html.push(`<pre><code class="language-${entity.language}">${entityText}</code></pre>`);
            } else {
              html.push(`<pre>${entityText}</pre>`);
            }
          } else if (entity instanceof tl_1.Api.MessageEntityEmail) {
            html.push(`<a href="mailto:${entityText}">${entityText}</a>`);
          } else if (entity instanceof tl_1.Api.MessageEntityUrl) {
            html.push(`<a href="${entityText}">${entityText}</a>`);
          } else if (entity instanceof tl_1.Api.MessageEntityTextUrl) {
            html.push(`<a href="${entity.url}">${entityText}</a>`);
          } else if (entity instanceof tl_1.Api.MessageEntityMentionName) {
            html.push(`<a href="tg://user?id=${entity.userId}">${entityText}</a>`);
          } else if (entity instanceof tl_1.Api.MessageEntityCustomEmoji) {
            html.push(`<tg-emoji emoji-id="${entity.documentId}">${entityText}</tg-emoji>`);
          } else {
            skipEntity = true;
          }
          lastOffset = relativeOffset + (skipEntity ? 0 : length);
        }
        html.push(text.slice(lastOffset, text.length));
        return html.join("");
      }
    };
    exports2.HTMLParser = HTMLParser;
  }
});

// node_modules/telegram/extensions/markdownv2.js
var require_markdownv2 = __commonJS({
  "node_modules/telegram/extensions/markdownv2.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MarkdownV2Parser = void 0;
    var html_1 = require_html();
    var MarkdownV2Parser = class {
      static parse(message) {
        message = message.replace(/\*(.*?)\*/g, "<b>$1</b>");
        message = message.replace(/__(.*?)__/g, "<u>$1</u>");
        message = message.replace(/~(.*?)~/g, "<s>$1</s>");
        message = message.replace(/-(.*?)-/g, "<i>$1</i>");
        message = message.replace(/```([\s\S]*?)```/g, "<pre>$1</pre>");
        message = message.replace(/`(.*?)`/g, "<code>$1</code>");
        message = message.replace(/\|\|(.*?)\|\|/g, "<spoiler>$1</spoiler>");
        message = message.replace(/(?<!\!)\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>');
        message = message.replace(/!\[([^\]]+)\]\(tg:\/\/emoji\?id=(\d+)\)/g, '<tg-emoji emoji-id="$2">$1</tg-emoji>');
        return html_1.HTMLParser.parse(message);
      }
      static unparse(text, entities) {
        text = html_1.HTMLParser.unparse(text, entities);
        text = text.replace(/<b>(.*?)<\/b>/g, "*$1*");
        text = text.replace(/<u>(.*?)<\/u>/g, "__$1__");
        text = text.replace(/<code>(.*?)<\/code>/g, "`$1`");
        text = text.replace(/<pre>(.*?)<\/pre>/g, "```$1```");
        text = text.replace(/<s>(.*?)<\/s>/g, "~$1~");
        text = text.replace(/<i>(.*?)<\/i>/g, "-$1-");
        text = text.replace(/<spoiler>(.*?)<\/spoiler>/g, "||$1||");
        text = text.replace(/<a href="([^"]+)">([^<]+)<\/a>/g, "[$2]($1)");
        text = text.replace(/<tg-emoji emoji-id="(\d+)">([^<]+)<\/tg-emoji>/g, "![$2](tg://emoji?id=$1)");
        return text;
      }
    };
    exports2.MarkdownV2Parser = MarkdownV2Parser;
  }
});

// node_modules/telegram/Utils.js
var require_Utils = __commonJS({
  "node_modules/telegram/Utils.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getDisplayName = exports2.rtrim = exports2.parseUsername = exports2.resolveInviteLink = exports2.parseID = exports2.parsePhone = exports2.getMessageId = exports2.resolveId = exports2.getPeerId = exports2.sanitizeParseMode = exports2.getPeer = exports2.getAppropriatedPartSize = exports2.getInputMedia = exports2.getInputGeo = exports2.getAttributes = exports2.getExtension = exports2.isImage = exports2.isAudio = exports2.getInputDocument = exports2.getInputPhoto = exports2.strippedPhotoToJpg = exports2.getInputChatPhoto = exports2.getInputMessage = exports2.getInputUser = exports2.getInputChannel = exports2.getInnerText = exports2._getEntityPair = exports2._photoSizeByteCount = exports2.getInputPeer = exports2.chunks = exports2.getFileInfo = void 0;
    var tl_1 = require_tl();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var mime_1 = __importDefault2(require_mime());
    var markdown_1 = require_markdown();
    var markdownv2_1 = require_markdownv2();
    function getFileInfo(fileLocation) {
      if (!fileLocation || !fileLocation.SUBCLASS_OF_ID) {
        _raiseCastFail(fileLocation, "InputFileLocation");
      }
      if (fileLocation.SUBCLASS_OF_ID == 354669666) {
        return {
          dcId: void 0,
          location: fileLocation,
          size: void 0
        };
      }
      let location;
      if (fileLocation instanceof tl_1.Api.Message) {
        location = fileLocation.media;
      }
      if (fileLocation instanceof tl_1.Api.MessageMediaDocument) {
        location = fileLocation.document;
      } else if (fileLocation instanceof tl_1.Api.MessageMediaPhoto) {
        location = fileLocation.photo;
      }
      if (location instanceof tl_1.Api.Document) {
        return {
          dcId: location.dcId,
          location: new tl_1.Api.InputDocumentFileLocation({
            id: location.id,
            accessHash: location.accessHash,
            fileReference: location.fileReference,
            thumbSize: ""
          }),
          size: location.size
        };
      } else if (location instanceof tl_1.Api.Photo) {
        return {
          dcId: location.dcId,
          location: new tl_1.Api.InputPhotoFileLocation({
            id: location.id,
            accessHash: location.accessHash,
            fileReference: location.fileReference,
            thumbSize: location.sizes[location.sizes.length - 1].type
          }),
          size: (0, big_integer_1.default)(_photoSizeByteCount(location.sizes[location.sizes.length - 1]) || 0)
        };
      }
      _raiseCastFail(fileLocation, "InputFileLocation");
    }
    exports2.getFileInfo = getFileInfo;
    function* chunks(arr, size = 100) {
      for (let i = 0; i < arr.length; i += size) {
        yield arr.slice(i, i + size);
      }
    }
    exports2.chunks = chunks;
    var html_1 = require_html();
    var Helpers_1 = require_Helpers();
    var USERNAME_RE = new RegExp("@|(?:https?:\\/\\/)?(?:www\\.)?(?:telegram\\.(?:me|dog)|t\\.me)\\/(@|joinchat\\/)?", "i");
    var JPEG_HEADER = Buffer.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00", "hex");
    var JPEG_FOOTER = Buffer.from("ffd9", "hex");
    var TG_JOIN_RE = new RegExp("tg:\\/\\/(join)\\?invite=", "i");
    var VALID_USERNAME_RE = new RegExp("^([a-z]((?!__)[\\w\\d]){3,30}[a-z\\d]|gif|vid|pic|bing|wiki|imdb|bold|vote|like|coub)$", "i");
    function _raiseCastFail(entity, target) {
      let toWrite = entity;
      if (typeof entity === "object" && "className" in entity) {
        toWrite = entity.className;
      }
      throw new Error(`Cannot cast ${toWrite} to any kind of ${target}`);
    }
    function getInputPeer2(entity, allowSelf = true, checkHash = true) {
      if (entity.SUBCLASS_OF_ID === void 0) {
        if (allowSelf && "inputEntity" in entity) {
          return entity.inputEntity;
        } else if ("entity" in entity) {
          return getInputPeer2(entity.entity);
        } else {
          _raiseCastFail(entity, "InputPeer");
        }
      }
      if (entity.SUBCLASS_OF_ID === 3374092470) {
        return entity;
      }
      if (entity instanceof tl_1.Api.User) {
        if (entity.self && allowSelf) {
          return new tl_1.Api.InputPeerSelf();
        } else if (entity.accessHash !== void 0 && !entity.min || !checkHash) {
          return new tl_1.Api.InputPeerUser({
            userId: entity.id,
            accessHash: entity.accessHash || (0, big_integer_1.default)(0)
          });
        } else {
          throw new Error("User without accessHash or min cannot be input");
        }
      }
      if (entity instanceof tl_1.Api.Chat || entity instanceof tl_1.Api.ChatEmpty || entity instanceof tl_1.Api.ChatForbidden) {
        return new tl_1.Api.InputPeerChat({ chatId: entity.id });
      }
      if (entity instanceof tl_1.Api.Channel) {
        if (entity.accessHash !== void 0 && !entity.min || !checkHash) {
          return new tl_1.Api.InputPeerChannel({
            channelId: entity.id,
            accessHash: entity.accessHash || (0, big_integer_1.default)(0)
          });
        } else {
          throw new TypeError("Channel without accessHash or min info cannot be input");
        }
      }
      if (entity instanceof tl_1.Api.ChannelForbidden) {
        return new tl_1.Api.InputPeerChannel({
          channelId: entity.id,
          accessHash: entity.accessHash
        });
      }
      if (entity instanceof tl_1.Api.InputUser) {
        return new tl_1.Api.InputPeerUser({
          userId: entity.userId,
          accessHash: entity.accessHash
        });
      }
      if (entity instanceof tl_1.Api.InputChannel) {
        return new tl_1.Api.InputPeerChannel({
          channelId: entity.channelId,
          accessHash: entity.accessHash
        });
      }
      if (entity instanceof tl_1.Api.UserEmpty) {
        return new tl_1.Api.InputPeerEmpty();
      }
      if (entity instanceof tl_1.Api.UserFull) {
        return getInputPeer2(entity.id);
      }
      if (entity instanceof tl_1.Api.ChatFull) {
        return new tl_1.Api.InputPeerChat({ chatId: entity.id });
      }
      if (entity instanceof tl_1.Api.PeerChat) {
        return new tl_1.Api.InputPeerChat({
          chatId: entity.chatId
        });
      }
      _raiseCastFail(entity, "InputPeer");
    }
    exports2.getInputPeer = getInputPeer2;
    function _photoSizeByteCount(size) {
      if (size instanceof tl_1.Api.PhotoSize) {
        return size.size;
      } else if (size instanceof tl_1.Api.PhotoStrippedSize) {
        if (size.bytes.length < 3 || size.bytes[0] != 1) {
          return size.bytes.length;
        }
        return size.bytes.length + 622;
      } else if (size instanceof tl_1.Api.PhotoCachedSize) {
        return size.bytes.length;
      } else if (size instanceof tl_1.Api.PhotoSizeEmpty) {
        return 0;
      } else if (size instanceof tl_1.Api.PhotoSizeProgressive) {
        return size.sizes[size.sizes.length - 1];
      } else {
        return void 0;
      }
    }
    exports2._photoSizeByteCount = _photoSizeByteCount;
    function _getEntityPair(entityId, entities, cache, getInputPeerFunction = getInputPeer2) {
      const entity = entities.get(entityId);
      let inputEntity;
      try {
        inputEntity = cache.get(entityId);
      } catch (e) {
        try {
          inputEntity = getInputPeerFunction(inputEntity);
        } catch (e2) {
        }
      }
      return [entity, inputEntity];
    }
    exports2._getEntityPair = _getEntityPair;
    function getInnerText(text, entities) {
      const result = [];
      entities.forEach(function(value, key) {
        const start2 = value.offset;
        const end2 = value.offset + value.length;
        result.push(text.slice(start2, end2));
      });
      return result;
    }
    exports2.getInnerText = getInnerText;
    function getInputChannel(entity) {
      if (typeof entity === "string" || typeof entity == "number" || typeof entity == "bigint" || big_integer_1.default.isInstance(entity)) {
        _raiseCastFail(entity, "InputChannel");
      }
      if (entity.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(entity, "InputChannel");
      }
      if (entity.SUBCLASS_OF_ID === 1089602301) {
        return entity;
      }
      if (entity instanceof tl_1.Api.Channel || entity instanceof tl_1.Api.ChannelForbidden) {
        return new tl_1.Api.InputChannel({
          channelId: entity.id,
          accessHash: entity.accessHash || big_integer_1.default.zero
        });
      }
      if (entity instanceof tl_1.Api.InputPeerChannel) {
        return new tl_1.Api.InputChannel({
          channelId: entity.channelId,
          accessHash: entity.accessHash
        });
      }
      _raiseCastFail(entity, "InputChannel");
    }
    exports2.getInputChannel = getInputChannel;
    function getInputUser(entity) {
      if (typeof entity === "string" || typeof entity == "number" || typeof entity == "bigint" || big_integer_1.default.isInstance(entity)) {
        _raiseCastFail(entity, "InputUser");
      }
      if (entity.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(entity, "InputUser");
      }
      if (entity.SUBCLASS_OF_ID === 3865689926) {
        return entity;
      }
      if (entity instanceof tl_1.Api.User) {
        if (entity.self) {
          return new tl_1.Api.InputUserSelf();
        } else {
          return new tl_1.Api.InputUser({
            userId: entity.id,
            accessHash: entity.accessHash || big_integer_1.default.zero
          });
        }
      }
      if (entity instanceof tl_1.Api.InputPeerSelf) {
        return new tl_1.Api.InputUserSelf();
      }
      if (entity instanceof tl_1.Api.UserEmpty || entity instanceof tl_1.Api.InputPeerEmpty) {
        return new tl_1.Api.InputUserEmpty();
      }
      if (entity instanceof tl_1.Api.UserFull) {
        return getInputUser(entity);
      }
      if (entity instanceof tl_1.Api.InputPeerUser) {
        return new tl_1.Api.InputUser({
          userId: entity.userId,
          accessHash: entity.accessHash
        });
      }
      if (entity instanceof tl_1.Api.InputPeerUserFromMessage) {
        return new tl_1.Api.InputUserFromMessage({
          userId: entity.userId,
          peer: entity.peer,
          msgId: entity.msgId
        });
      }
      _raiseCastFail(entity, "InputUser");
    }
    exports2.getInputUser = getInputUser;
    function getInputMessage(message) {
      if (typeof message === "number") {
        return new tl_1.Api.InputMessageID({ id: message });
      }
      if (message === void 0 || message.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(message, "InputMessage");
      }
      if (message.SUBCLASS_OF_ID === 1421262021) {
        return message;
      } else if (message.SUBCLASS_OF_ID === 2030045667) {
        return new tl_1.Api.InputMessageID({ id: message.id });
      }
      _raiseCastFail(message, "InputMessage");
    }
    exports2.getInputMessage = getInputMessage;
    function getInputChatPhoto(photo) {
      if (photo === void 0 || photo.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(photo, "InputChatPhoto");
      }
      if (photo.SUBCLASS_OF_ID === 3572182388) {
        return photo;
      } else if (photo.SUBCLASS_OF_ID === 3882180383) {
        return new tl_1.Api.InputChatUploadedPhoto({
          file: photo
        });
      }
      photo = getInputPhoto(photo);
      if (photo instanceof tl_1.Api.InputPhoto) {
        return new tl_1.Api.InputChatPhoto({
          id: photo
        });
      } else if (photo instanceof tl_1.Api.InputPhotoEmpty) {
        return new tl_1.Api.InputChatPhotoEmpty();
      }
      _raiseCastFail(photo, "InputChatPhoto");
    }
    exports2.getInputChatPhoto = getInputChatPhoto;
    function strippedPhotoToJpg(stripped) {
      if (stripped.length < 3 || stripped[0] !== 1) {
        return stripped;
      }
      const header = Buffer.from(JPEG_HEADER);
      header[164] = stripped[1];
      header[166] = stripped[2];
      return Buffer.concat([header, stripped.slice(3), JPEG_FOOTER]);
    }
    exports2.strippedPhotoToJpg = strippedPhotoToJpg;
    function getInputPhoto(photo) {
      if (photo.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(photo, "InputPhoto");
      }
      if (photo.SUBCLASS_OF_ID === 2221106144) {
        return photo;
      }
      if (photo instanceof tl_1.Api.Message) {
        photo = photo.media;
      }
      if (photo instanceof tl_1.Api.photos.Photo || photo instanceof tl_1.Api.MessageMediaPhoto) {
        photo = photo.photo;
      }
      if (photo instanceof tl_1.Api.Photo) {
        return new tl_1.Api.InputPhoto({
          id: photo.id,
          accessHash: photo.accessHash,
          fileReference: photo.fileReference
        });
      }
      if (photo instanceof tl_1.Api.PhotoEmpty) {
        return new tl_1.Api.InputPhotoEmpty();
      }
      if (photo instanceof tl_1.Api.messages.ChatFull) {
        photo = photo.fullChat;
      }
      if (photo instanceof tl_1.Api.ChannelFull) {
        return getInputPhoto(photo.chatPhoto);
      } else {
        if (photo instanceof tl_1.Api.UserFull) {
          return getInputPhoto(photo.profilePhoto);
        } else {
          if (photo instanceof tl_1.Api.Channel || photo instanceof tl_1.Api.Chat || photo instanceof tl_1.Api.User) {
            return getInputPhoto(photo.photo);
          }
        }
      }
      if (photo instanceof tl_1.Api.UserEmpty || photo instanceof tl_1.Api.ChatEmpty || photo instanceof tl_1.Api.ChatForbidden || photo instanceof tl_1.Api.ChannelForbidden) {
        return new tl_1.Api.InputPhotoEmpty();
      }
      _raiseCastFail(photo, "InputPhoto");
    }
    exports2.getInputPhoto = getInputPhoto;
    function getInputDocument(document2) {
      if (document2.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(document2, "InputDocument");
      }
      if (document2.SUBCLASS_OF_ID === 4081048424) {
        return document2;
      }
      if (document2 instanceof tl_1.Api.Document) {
        return new tl_1.Api.InputDocument({
          id: document2.id,
          accessHash: document2.accessHash,
          fileReference: document2.fileReference
        });
      }
      if (document2 instanceof tl_1.Api.DocumentEmpty) {
        return new tl_1.Api.InputDocumentEmpty();
      }
      if (document2 instanceof tl_1.Api.MessageMediaDocument) {
        return getInputDocument(document2.document);
      }
      if (document2 instanceof tl_1.Api.Message) {
        return getInputDocument(document2.media);
      }
      _raiseCastFail(document2, "InputDocument");
    }
    exports2.getInputDocument = getInputDocument;
    function isAudio(file) {
      const ext = _getExtension(file);
      if (!ext) {
        const metadata = _getMetadata(file);
        return (metadata.get("mimeType") || "").startsWith("audio/");
      } else {
        file = "a" + ext;
        return (mime_1.default.getType(file) || "").startsWith("audio/");
      }
    }
    exports2.isAudio = isAudio;
    function isImage(file) {
      const ext = _getExtension(file).toLowerCase();
      return ext.endsWith(".png") || ext.endsWith(".jpg") || ext.endsWith(".jpeg");
    }
    exports2.isImage = isImage;
    function getExtension(media) {
      try {
        getInputPhoto(media);
        return ".jpg";
      } catch (e) {
      }
      if (media instanceof tl_1.Api.UserProfilePhoto || media instanceof tl_1.Api.ChatPhoto) {
        return ".jpg";
      }
      if (media instanceof tl_1.Api.MessageMediaDocument) {
        media = media.document;
      }
      if (media instanceof tl_1.Api.Document || media instanceof tl_1.Api.WebDocument || media instanceof tl_1.Api.WebDocumentNoProxy) {
        if (media.mimeType === "application/octet-stream") {
          return "";
        } else {
          return mime_1.default.getExtension(media.mimeType) || "";
        }
      }
      return "";
    }
    exports2.getExtension = getExtension;
    function _getExtension(file) {
      if (typeof file === "string") {
        return "." + file.split(".").pop();
      } else if ("name" in file) {
        return _getExtension(file.name);
      } else {
        return getExtension(file);
      }
    }
    function _getMetadata(file) {
      return /* @__PURE__ */ new Map();
    }
    function isVideo(file) {
      var _a;
      const ext = _getExtension(file);
      if (!ext) {
        const metadata = _getMetadata(file);
        if (metadata.has("mimeType")) {
          return ((_a = metadata.get("mimeType")) === null || _a === void 0 ? void 0 : _a.startsWith("video/")) || false;
        } else {
          return false;
        }
      } else {
        file = "a" + ext;
        return (mime_1.default.getType(file) || "").startsWith("video/");
      }
    }
    function getAttributes(file, { attributes = null, mimeType = void 0, forceDocument = false, voiceNote = false, videoNote = false, supportsStreaming = false, thumb = null }) {
      var _a, _b, _c, _d;
      const name = typeof file == "string" ? file : file.name || "unnamed";
      if (mimeType === void 0) {
        mimeType = mime_1.default.getType(name) || "application/octet-stream";
      }
      const attrObj = /* @__PURE__ */ new Map();
      attrObj.set(tl_1.Api.DocumentAttributeFilename, new tl_1.Api.DocumentAttributeFilename({
        fileName: name.split(/[\\/]/).pop() || ""
      }));
      if (isAudio(file)) {
        const m = _getMetadata(file);
        attrObj.set(tl_1.Api.DocumentAttributeAudio, new tl_1.Api.DocumentAttributeAudio({
          voice: voiceNote,
          title: m.has("title") ? m.get("title") : void 0,
          performer: m.has("author") ? m.get("author") : void 0,
          duration: Number.parseInt((_a = m.get("duration")) !== null && _a !== void 0 ? _a : "0")
        }));
      }
      if (!forceDocument && isVideo(file)) {
        let doc;
        if (thumb) {
          const t_m = _getMetadata(thumb);
          const width = Number.parseInt((t_m === null || t_m === void 0 ? void 0 : t_m.get("width")) || "1");
          const height = Number.parseInt((t_m === null || t_m === void 0 ? void 0 : t_m.get("height")) || "1");
          doc = new tl_1.Api.DocumentAttributeVideo({
            duration: 0,
            h: height,
            w: width,
            roundMessage: videoNote,
            supportsStreaming
          });
        } else {
          const m = _getMetadata(file);
          doc = new tl_1.Api.DocumentAttributeVideo({
            roundMessage: videoNote,
            w: Number.parseInt((_b = m.get("width")) !== null && _b !== void 0 ? _b : "1"),
            h: Number.parseInt((_c = m.get("height")) !== null && _c !== void 0 ? _c : "1"),
            duration: Number.parseInt((_d = m.get("duration")) !== null && _d !== void 0 ? _d : "0"),
            supportsStreaming
          });
        }
        attrObj.set(tl_1.Api.DocumentAttributeVideo, doc);
      }
      if (videoNote) {
        if (attrObj.has(tl_1.Api.DocumentAttributeAudio)) {
          attrObj.get(tl_1.Api.DocumentAttributeAudio).voice = true;
        } else {
          attrObj.set(tl_1.Api.DocumentAttributeAudio, new tl_1.Api.DocumentAttributeAudio({
            duration: 0,
            voice: true
          }));
        }
      }
      if (attributes) {
        for (const a of attributes) {
          attrObj.set(a.constructor, a);
        }
      }
      return {
        attrs: Array.from(attrObj.values()),
        mimeType
      };
    }
    exports2.getAttributes = getAttributes;
    function getInputGeo(geo) {
      if (geo === void 0 || geo.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(geo, "InputGeoPoint");
      }
      if (geo.SUBCLASS_OF_ID === 70308389) {
        return geo;
      }
      if (geo instanceof tl_1.Api.GeoPoint) {
        return new tl_1.Api.InputGeoPoint({ lat: geo.lat, long: geo.long });
      }
      if (geo instanceof tl_1.Api.GeoPointEmpty) {
        return new tl_1.Api.InputGeoPointEmpty();
      }
      if (geo instanceof tl_1.Api.MessageMediaGeo) {
        return getInputGeo(geo.geo);
      }
      if (geo instanceof tl_1.Api.Message) {
        return getInputGeo(geo.media);
      }
      _raiseCastFail(geo, "InputGeoPoint");
    }
    exports2.getInputGeo = getInputGeo;
    function getInputMedia(media, { isPhoto = false, attributes = void 0, forceDocument = false, voiceNote = false, videoNote = false, supportsStreaming = false } = {}) {
      if (media.SUBCLASS_OF_ID === void 0) {
        _raiseCastFail(media, "InputMedia");
      }
      if (media.SUBCLASS_OF_ID === 4210575092) {
        return media;
      } else {
        if (media.SUBCLASS_OF_ID === 2221106144) {
          return new tl_1.Api.InputMediaPhoto({ id: media });
        } else {
          if (media.SUBCLASS_OF_ID === 4081048424) {
            return new tl_1.Api.InputMediaDocument({ id: media });
          }
        }
      }
      if (media instanceof tl_1.Api.MessageMediaPhoto) {
        return new tl_1.Api.InputMediaPhoto({
          id: getInputPhoto(media.photo),
          ttlSeconds: media.ttlSeconds
        });
      }
      if (media instanceof tl_1.Api.Photo || media instanceof tl_1.Api.photos.Photo || media instanceof tl_1.Api.PhotoEmpty) {
        return new tl_1.Api.InputMediaPhoto({ id: getInputPhoto(media) });
      }
      if (media instanceof tl_1.Api.MessageMediaDocument) {
        return new tl_1.Api.InputMediaDocument({
          id: getInputDocument(media.document),
          ttlSeconds: media.ttlSeconds
        });
      }
      if (media instanceof tl_1.Api.Document || media instanceof tl_1.Api.DocumentEmpty) {
        return new tl_1.Api.InputMediaDocument({ id: getInputDocument(media) });
      }
      if (media instanceof tl_1.Api.InputFile || media instanceof tl_1.Api.InputFileBig) {
        if (isPhoto) {
          return new tl_1.Api.InputMediaUploadedPhoto({ file: media });
        } else {
          const { attrs, mimeType } = getAttributes(media, {
            attributes,
            forceDocument,
            voiceNote,
            videoNote,
            supportsStreaming
          });
          return new tl_1.Api.InputMediaUploadedDocument({
            file: media,
            mimeType,
            attributes: attrs,
            forceFile: forceDocument
          });
        }
      }
      if (media instanceof tl_1.Api.MessageMediaGame) {
        return new tl_1.Api.InputMediaGame({
          id: new tl_1.Api.InputGameID({
            id: media.game.id,
            accessHash: media.game.accessHash
          })
        });
      }
      if (media instanceof tl_1.Api.MessageMediaContact) {
        return new tl_1.Api.InputMediaContact({
          phoneNumber: media.phoneNumber,
          firstName: media.firstName,
          lastName: media.lastName,
          vcard: ""
        });
      }
      if (media instanceof tl_1.Api.MessageMediaGeo) {
        return new tl_1.Api.InputMediaGeoPoint({ geoPoint: getInputGeo(media.geo) });
      }
      if (media instanceof tl_1.Api.MessageMediaVenue) {
        return new tl_1.Api.InputMediaVenue({
          geoPoint: getInputGeo(media.geo),
          title: media.title,
          address: media.address,
          provider: media.provider,
          venueId: media.venueId,
          venueType: ""
        });
      }
      if (media instanceof tl_1.Api.MessageMediaDice) {
        return new tl_1.Api.InputMediaDice({
          emoticon: media.emoticon
        });
      }
      if (media instanceof tl_1.Api.MessageMediaEmpty || media instanceof tl_1.Api.MessageMediaUnsupported || media instanceof tl_1.Api.ChatPhotoEmpty || media instanceof tl_1.Api.UserProfilePhotoEmpty || media instanceof tl_1.Api.ChatPhoto || media instanceof tl_1.Api.UserProfilePhoto) {
        return new tl_1.Api.InputMediaEmpty();
      }
      if (media instanceof tl_1.Api.Message) {
        return getInputMedia(media.media, { isPhoto });
      }
      if (media instanceof tl_1.Api.MessageMediaPoll) {
        let correctAnswers;
        if (media.poll.quiz) {
          if (!media.results.results) {
            throw new Error("Cannot cast unanswered quiz to any kind of InputMedia.");
          }
          correctAnswers = [];
          for (const r of media.results.results) {
            if (r.correct) {
              correctAnswers.push(r.option);
            }
          }
        } else {
          correctAnswers = void 0;
        }
        return new tl_1.Api.InputMediaPoll({
          poll: media.poll,
          correctAnswers,
          solution: media.results.solution,
          solutionEntities: media.results.solutionEntities
        });
      }
      if (media instanceof tl_1.Api.Poll) {
        return new tl_1.Api.InputMediaPoll({
          poll: media
        });
      }
      _raiseCastFail(media, "InputMedia");
    }
    exports2.getInputMedia = getInputMedia;
    function getAppropriatedPartSize(fileSize) {
      if (fileSize.lesser(104857600)) {
        return 128;
      }
      if (fileSize.lesser(786432e3)) {
        return 256;
      }
      return 512;
    }
    exports2.getAppropriatedPartSize = getAppropriatedPartSize;
    function getPeer(peer) {
      if (!peer) {
        _raiseCastFail(peer, "undefined");
      }
      if (typeof peer === "string") {
        _raiseCastFail(peer, "peer");
      }
      if (typeof peer == "number" || typeof peer == "bigint") {
        peer = (0, Helpers_1.returnBigInt)(peer);
      }
      try {
        if (big_integer_1.default.isInstance(peer)) {
          const res = resolveId(peer);
          if (res[1] === tl_1.Api.PeerChannel) {
            return new tl_1.Api.PeerChannel({ channelId: res[0] });
          } else if (res[1] === tl_1.Api.PeerChat) {
            return new tl_1.Api.PeerChat({ chatId: res[0] });
          } else {
            return new tl_1.Api.PeerUser({ userId: res[0] });
          }
        }
        if (peer.SUBCLASS_OF_ID === void 0) {
          throw new Error();
        }
        if (peer.SUBCLASS_OF_ID === 47470215) {
          return peer;
        } else if (peer instanceof tl_1.Api.contacts.ResolvedPeer || peer instanceof tl_1.Api.InputNotifyPeer || peer instanceof tl_1.Api.TopPeer || peer instanceof tl_1.Api.Dialog || peer instanceof tl_1.Api.DialogPeer) {
          return peer.peer;
        } else if (peer instanceof tl_1.Api.ChannelFull) {
          return new tl_1.Api.PeerChannel({ channelId: peer.id });
        }
        if (peer.SUBCLASS_OF_ID === 2105307014 || peer.SUBCLASS_OF_ID === 3653762072) {
          if ("userId" in peer) {
            return new tl_1.Api.PeerUser({ userId: peer.userId });
          }
        }
        peer = getInputPeer2(peer, false, false);
        if (peer instanceof tl_1.Api.InputPeerUser) {
          return new tl_1.Api.PeerUser({ userId: peer.userId });
        } else if (peer instanceof tl_1.Api.InputPeerChat) {
          return new tl_1.Api.PeerChat({ chatId: peer.chatId });
        } else if (peer instanceof tl_1.Api.InputPeerChannel) {
          return new tl_1.Api.PeerChannel({ channelId: peer.channelId });
        }
      } catch (e) {
      }
      _raiseCastFail(peer, "peer");
    }
    exports2.getPeer = getPeer;
    function sanitizeParseMode(mode) {
      if (mode === "md" || mode === "markdown") {
        return markdown_1.MarkdownParser;
      }
      if (mode === "md2" || mode === "markdownv2") {
        return markdownv2_1.MarkdownV2Parser;
      }
      if (mode == "html") {
        return html_1.HTMLParser;
      }
      if (typeof mode == "object") {
        if ("parse" in mode && "unparse" in mode) {
          return mode;
        }
      }
      throw new Error(`Invalid parse mode type ${mode}`);
    }
    exports2.sanitizeParseMode = sanitizeParseMode;
    function getPeerId(peer, addMark = true) {
      if (typeof peer == "string" && parseID(peer)) {
        peer = (0, Helpers_1.returnBigInt)(peer);
      }
      if (big_integer_1.default.isInstance(peer)) {
        return addMark ? peer.toString() : resolveId(peer)[0].toString();
      }
      if (peer instanceof tl_1.Api.InputPeerSelf) {
        _raiseCastFail(peer, "int (you might want to use client.get_peer_id)");
      }
      try {
        peer = getPeer(peer);
      } catch (e) {
        _raiseCastFail(peer, "int");
      }
      if (peer instanceof tl_1.Api.PeerUser) {
        return peer.userId.toString();
      } else if (peer instanceof tl_1.Api.PeerChat) {
        peer.chatId = resolveId((0, Helpers_1.returnBigInt)(peer.chatId))[0];
        return addMark ? peer.chatId.negate().toString() : peer.chatId.toString();
      } else if (typeof peer == "object" && "channelId" in peer) {
        peer.channelId = resolveId((0, Helpers_1.returnBigInt)(peer.channelId))[0];
        if (!addMark) {
          return peer.channelId.toString();
        }
        return "-100" + peer.channelId.toString();
      }
      _raiseCastFail(peer, "int");
    }
    exports2.getPeerId = getPeerId;
    function resolveId(markedId) {
      if (markedId.greaterOrEquals(big_integer_1.default.zero)) {
        return [markedId, tl_1.Api.PeerUser];
      }
      const m = markedId.toString().match(/-100([^0]\d*)/);
      if (m) {
        return [(0, big_integer_1.default)(m[1]), tl_1.Api.PeerChannel];
      }
      return [markedId.negate(), tl_1.Api.PeerChat];
    }
    exports2.resolveId = resolveId;
    function getMessageId(message) {
      if (!message) {
        return void 0;
      } else if (typeof message === "number") {
        return message;
      } else if (message.SUBCLASS_OF_ID === 2030045667 || "id" in message) {
        return message.id;
      } else {
        throw new Error(`Invalid message type: ${message.constructor.name}`);
      }
    }
    exports2.getMessageId = getMessageId;
    function parsePhone(phone) {
      phone = phone.toString().replace(/[()\s-]/gm, "");
      if (phone.startsWith("+") && phone.split("+").length - 1 == 1) {
        return !isNaN(Number(phone)) ? phone.replace("+", "") : void 0;
      }
    }
    exports2.parsePhone = parsePhone;
    function parseID(id) {
      const isValid = /^(-?[0-9][0-9]*)$/.test(id);
      return isValid ? (0, big_integer_1.default)(id) : void 0;
    }
    exports2.parseID = parseID;
    function resolveInviteLink(link) {
      throw new Error("not implemented");
    }
    exports2.resolveInviteLink = resolveInviteLink;
    function parseUsername(username) {
      username = username.trim();
      const m = username.match(USERNAME_RE) || username.match(TG_JOIN_RE);
      if (m) {
        username = username.replace(m[0], "");
        if (m[1]) {
          return {
            username,
            isInvite: true
          };
        } else {
          username = rtrim(username, "/");
        }
      }
      if (username.match(VALID_USERNAME_RE)) {
        return {
          username: username.toLowerCase(),
          isInvite: false
        };
      } else {
        return {
          username: void 0,
          isInvite: false
        };
      }
    }
    exports2.parseUsername = parseUsername;
    function rtrim(s, mask) {
      while (~mask.indexOf(s[s.length - 1])) {
        s = s.slice(0, -1);
      }
      return s;
    }
    exports2.rtrim = rtrim;
    function getDisplayName(entity) {
      if (entity instanceof tl_1.Api.User) {
        if (entity.lastName && entity.firstName) {
          return `${entity.firstName} ${entity.lastName}`;
        } else if (entity.firstName) {
          return entity.firstName;
        } else if (entity.lastName) {
          return entity.lastName;
        } else {
          return "";
        }
      } else if (entity instanceof tl_1.Api.Chat || entity instanceof tl_1.Api.Channel) {
        return entity.title;
      }
      return "";
    }
    exports2.getDisplayName = getDisplayName;
  }
});

// node_modules/telegram/tl/custom/forward.js
var require_forward = __commonJS({
  "node_modules/telegram/tl/custom/forward.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Forward = void 0;
    var chatGetter_1 = require_chatGetter();
    var senderGetter_1 = require_senderGetter();
    var Helpers_1 = require_Helpers();
    var Utils_1 = require_Utils();
    var inspect_1 = require_inspect();
    var Forward = class extends senderGetter_1.SenderGetter {
      constructor(client2, original, entities) {
        super();
        this.originalFwd = original;
        let senderId = void 0;
        let sender = void 0;
        let inputSender = void 0;
        let peer = void 0;
        let chat = void 0;
        let inputChat = void 0;
        if (original.fromId) {
          const ty = (0, Helpers_1._entityType)(original.fromId);
          if (ty === Helpers_1._EntityType.USER) {
            senderId = (0, Utils_1.getPeerId)(original.fromId);
            [sender, inputSender] = (0, Utils_1._getEntityPair)(senderId, entities, client2._entityCache);
          } else if (ty === Helpers_1._EntityType.CHANNEL || ty === Helpers_1._EntityType.CHAT) {
            peer = original.fromId;
            [chat, inputChat] = (0, Utils_1._getEntityPair)((0, Utils_1.getPeerId)(peer), entities, client2._entityCache);
          }
        }
        chatGetter_1.ChatGetter.initChatClass(this, {
          chatPeer: peer,
          inputChat
        });
        senderGetter_1.SenderGetter.initSenderClass(this, {
          senderId: senderId ? (0, Helpers_1.returnBigInt)(senderId) : void 0,
          sender,
          inputSender
        });
        this._client = client2;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
    };
    exports2.Forward = Forward;
  }
});

// node_modules/telegram/tl/custom/file.js
var require_file = __commonJS({
  "node_modules/telegram/tl/custom/file.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.File = void 0;
    var api_1 = require_api();
    var Utils_1 = require_Utils();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var File2 = class {
      constructor(media) {
        this.media = media;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      get id() {
        throw new Error("Unsupported");
      }
      get name() {
        return this._fromAttr(api_1.Api.DocumentAttributeFilename, "fileName");
      }
      get mimeType() {
        if (this.media instanceof api_1.Api.Photo) {
          return "image/jpeg";
        } else if (this.media instanceof api_1.Api.Document) {
          return this.media.mimeType;
        }
      }
      get width() {
        return this._fromAttr([api_1.Api.DocumentAttributeImageSize, api_1.Api.DocumentAttributeVideo], "w");
      }
      get height() {
        return this._fromAttr([api_1.Api.DocumentAttributeImageSize, api_1.Api.DocumentAttributeVideo], "h");
      }
      get duration() {
        return this._fromAttr([api_1.Api.DocumentAttributeAudio, api_1.Api.DocumentAttributeVideo], "duration");
      }
      get title() {
        return this._fromAttr(api_1.Api.DocumentAttributeAudio, "title");
      }
      get performer() {
        return this._fromAttr(api_1.Api.DocumentAttributeAudio, "performer");
      }
      get emoji() {
        return this._fromAttr(api_1.Api.DocumentAttributeSticker, "alt");
      }
      get stickerSet() {
        return this._fromAttr(api_1.Api.DocumentAttributeSticker, "stickerset");
      }
      get size() {
        if (this.media instanceof api_1.Api.Photo) {
          return (0, Utils_1._photoSizeByteCount)(this.media.sizes[this.media.sizes.length - 1]);
        } else if (this.media instanceof api_1.Api.Document) {
          return this.media.size;
        }
      }
      _fromAttr(cls, field) {
        if (this.media instanceof api_1.Api.Document) {
          for (const attr of this.media.attributes) {
            if (attr instanceof cls) {
              return attr[field];
            }
          }
        }
      }
    };
    exports2.File = File2;
  }
});

// node_modules/telegram/extensions/Logger.js
var require_Logger = __commonJS({
  "node_modules/telegram/extensions/Logger.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Logger = exports2.LogLevel = void 0;
    var platform_1 = require_platform();
    var LogLevel2;
    (function(LogLevel3) {
      LogLevel3["NONE"] = "none";
      LogLevel3["ERROR"] = "error";
      LogLevel3["WARN"] = "warn";
      LogLevel3["INFO"] = "info";
      LogLevel3["DEBUG"] = "debug";
    })(LogLevel2 = exports2.LogLevel || (exports2.LogLevel = {}));
    var Logger2 = class {
      constructor(level) {
        this.levels = ["error", "warn", "info", "debug"];
        this._logLevel = level || LogLevel2.INFO;
        this.isBrowser = !platform_1.isNode;
        if (!this.isBrowser) {
          this.colors = {
            start: "\x1B[2m",
            warn: "\x1B[35m",
            info: "\x1B[33m",
            debug: "\x1B[36m",
            error: "\x1B[31m",
            end: "\x1B[0m"
          };
        } else {
          this.colors = {
            start: "%c",
            warn: "color : #ff00ff",
            info: "color : #ffff00",
            debug: "color : #00ffff",
            error: "color : #ff0000",
            end: ""
          };
        }
        this.messageFormat = "[%t] [%l] - [%m]";
        this.tzOffset = new Date().getTimezoneOffset() * 6e4;
      }
      /**
       *
       * @param level {string}
       * @returns {boolean}
       */
      canSend(level) {
        return this._logLevel ? this.levels.indexOf(this._logLevel) >= this.levels.indexOf(level) : false;
      }
      /**
       * @param message {string}
       */
      warn(message) {
        this._log(LogLevel2.WARN, message, this.colors.warn);
      }
      /**
       * @param message {string}
       */
      info(message) {
        this._log(LogLevel2.INFO, message, this.colors.info);
      }
      /**
       * @param message {string}
       */
      debug(message) {
        this._log(LogLevel2.DEBUG, message, this.colors.debug);
      }
      /**
       * @param message {string}
       */
      error(message) {
        this._log(LogLevel2.ERROR, message, this.colors.error);
      }
      format(message, level) {
        return this.messageFormat.replace("%t", this.getDateTime()).replace("%l", level.toUpperCase()).replace("%m", message);
      }
      get logLevel() {
        return this._logLevel;
      }
      setLevel(level) {
        this._logLevel = level;
      }
      static setLevel(level) {
        console.log("Logger.setLevel is deprecated, it will has no effect. Please, use client.setLogLevel instead.");
      }
      /**
       * @param level {string}
       * @param message {string}
       * @param color {string}
       */
      _log(level, message, color) {
        if (this.canSend(level)) {
          this.log(level, message, color);
        } else {
          return;
        }
      }
      /**
       * Override this function for custom Logger. <br />
       *
       * @remarks use `this.isBrowser` to check and handle for different environment.
       * @param level {string}
       * @param message {string}
       * @param color {string}
       */
      log(level, message, color) {
        if (!this.isBrowser) {
          console.log(color + this.format(message, level) + this.colors.end);
        } else {
          console.log(this.colors.start + this.format(message, level), color);
        }
      }
      getDateTime() {
        return new Date(Date.now() - this.tzOffset).toISOString().slice(0, -1);
      }
    };
    exports2.Logger = Logger2;
  }
});

// node_modules/telegram/extensions/Deferred.js
var require_Deferred = __commonJS({
  "node_modules/telegram/extensions/Deferred.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var Deferred = class {
      constructor() {
        this.promise = new Promise((resolve, reject) => {
          this.reject = reject;
          this.resolve = resolve;
        });
      }
      static resolved(value) {
        const deferred = new Deferred();
        deferred.resolve(value);
        return deferred;
      }
    };
    exports2.default = Deferred;
  }
});

// node_modules/telegram/network/RequestState.js
var require_RequestState = __commonJS({
  "node_modules/telegram/network/RequestState.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RequestState = void 0;
    var Deferred_1 = __importDefault2(require_Deferred());
    var RequestState = class {
      constructor(request) {
        this.containerId = void 0;
        this.msgId = void 0;
        this.request = request;
        this.data = request.getBytes();
        this.after = void 0;
        this.result = void 0;
        this.finished = new Deferred_1.default();
        this.resetPromise();
      }
      isReady() {
        if (!this.after) {
          return true;
        }
        return this.after.finished.promise;
      }
      resetPromise() {
        var _a;
        (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this);
        this.promise = new Promise((resolve, reject) => {
          this.resolve = resolve;
          this.reject = reject;
        });
      }
    };
    exports2.RequestState = RequestState;
  }
});

// node_modules/telegram/client/users.js
var require_users = __commonJS({
  "node_modules/telegram/client/users.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2._selfId = exports2._getInputNotify = exports2._getInputDialog = exports2._getPeer = exports2.getPeerId = exports2._getEntityFromString = exports2.getInputEntity = exports2.getEntity = exports2.isUserAuthorized = exports2.isBot = exports2.getMe = exports2.invoke = void 0;
    var tl_1 = require_tl();
    var Utils_1 = require_Utils();
    var Helpers_1 = require_Helpers();
    var __1 = require_telegram();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Logger_1 = require_Logger();
    var RequestState_1 = require_RequestState();
    async function invoke(client2, request, dcId, otherSender) {
      if (request.classType !== "request") {
        throw new Error("You can only invoke MTProtoRequests");
      }
      let sender = client2._sender;
      if (dcId) {
        sender = await client2.getSender(dcId);
      }
      if (otherSender != void 0) {
        sender = otherSender;
      }
      if (sender == void 0) {
        throw new Error("Cannot send requests while disconnected. You need to call .connect()");
      }
      await client2._connectedDeferred.promise;
      await request.resolve(client2, __1.utils);
      client2._lastRequest = new Date().getTime();
      const state = new RequestState_1.RequestState(request);
      let attempt = 0;
      for (attempt = 0; attempt < client2._requestRetries; attempt++) {
        sender.addStateToQueue(state);
        try {
          const result = await state.promise;
          state.finished.resolve();
          client2.session.processEntities(result);
          client2._entityCache.add(result);
          return result;
        } catch (e) {
          if (e instanceof __1.errors.ServerError || e.errorMessage === "RPC_CALL_FAIL" || e.errorMessage === "RPC_MCGET_FAIL") {
            client2._log.warn(`Telegram is having internal issues ${e.constructor.name}`);
            await (0, Helpers_1.sleep)(2e3);
          } else if (e instanceof __1.errors.FloodWaitError || e instanceof __1.errors.FloodTestPhoneWaitError) {
            if (e.seconds <= client2.floodSleepThreshold) {
              client2._log.info(`Sleeping for ${e.seconds}s on flood wait (Caused by ${request.className})`);
              await (0, Helpers_1.sleep)(e.seconds * 1e3);
            } else {
              state.finished.resolve();
              throw e;
            }
          } else if (e instanceof __1.errors.PhoneMigrateError || e instanceof __1.errors.NetworkMigrateError || e instanceof __1.errors.UserMigrateError) {
            client2._log.info(`Phone migrated to ${e.newDc}`);
            const shouldRaise = e instanceof __1.errors.PhoneMigrateError || e instanceof __1.errors.NetworkMigrateError;
            if (shouldRaise && await client2.isUserAuthorized()) {
              state.finished.resolve();
              throw e;
            }
            await client2._switchDC(e.newDc);
            sender = dcId === void 0 ? client2._sender : await client2.getSender(dcId);
          } else if (e instanceof __1.errors.MsgWaitError) {
            await state.isReady();
            state.after = void 0;
          } else if (e.message === "CONNECTION_NOT_INITED") {
            await client2.disconnect();
            await (0, Helpers_1.sleep)(2e3);
            await client2.connect();
          } else {
            state.finished.resolve();
            throw e;
          }
        }
        state.resetPromise();
      }
      throw new Error(`Request was unsuccessful ${attempt} time(s)`);
    }
    exports2.invoke = invoke;
    async function getMe(client2, inputPeer) {
      if (inputPeer && client2._selfInputPeer) {
        return client2._selfInputPeer;
      }
      const me = (await client2.invoke(new tl_1.Api.users.GetUsers({ id: [new tl_1.Api.InputUserSelf()] })))[0];
      client2._bot = me.bot;
      if (!client2._selfInputPeer) {
        client2._selfInputPeer = __1.utils.getInputPeer(me, false);
      }
      return inputPeer ? client2._selfInputPeer : me;
    }
    exports2.getMe = getMe;
    async function isBot(client2) {
      if (client2._bot === void 0) {
        const me = await client2.getMe();
        if (me) {
          return !(me instanceof tl_1.Api.InputPeerUser) ? me.bot : void 0;
        }
      }
      return client2._bot;
    }
    exports2.isBot = isBot;
    async function isUserAuthorized(client2) {
      try {
        await client2.invoke(new tl_1.Api.updates.GetState());
        return true;
      } catch (e) {
        return false;
      }
    }
    exports2.isUserAuthorized = isUserAuthorized;
    async function getEntity(client2, entity) {
      const single = !(0, Helpers_1.isArrayLike)(entity);
      let entityArray = [];
      if ((0, Helpers_1.isArrayLike)(entity)) {
        entityArray = entity;
      } else {
        entityArray.push(entity);
      }
      const inputs = [];
      for (const x of entityArray) {
        if (typeof x === "string") {
          const valid = (0, Utils_1.parseID)(x);
          if (valid) {
            inputs.push(await client2.getInputEntity(valid));
          } else {
            inputs.push(x);
          }
        } else {
          inputs.push(await client2.getInputEntity(x));
        }
      }
      const lists = /* @__PURE__ */ new Map([
        [Helpers_1._EntityType.USER, []],
        [Helpers_1._EntityType.CHAT, []],
        [Helpers_1._EntityType.CHANNEL, []]
      ]);
      for (const x of inputs) {
        try {
          lists.get((0, Helpers_1._entityType)(x)).push(x);
        } catch (e) {
        }
      }
      let users = lists.get(Helpers_1._EntityType.USER);
      let chats = lists.get(Helpers_1._EntityType.CHAT);
      let channels = lists.get(Helpers_1._EntityType.CHANNEL);
      if (users.length) {
        users = await client2.invoke(new tl_1.Api.users.GetUsers({
          id: users
        }));
      }
      if (chats.length) {
        const chatIds = chats.map((x) => x.chatId);
        chats = (await client2.invoke(new tl_1.Api.messages.GetChats({ id: chatIds }))).chats;
      }
      if (channels.length) {
        channels = (await client2.invoke(new tl_1.Api.channels.GetChannels({ id: channels }))).chats;
      }
      const idEntity = /* @__PURE__ */ new Map();
      for (const user of users) {
        idEntity.set((0, Utils_1.getPeerId)(user), user);
      }
      for (const channel of channels) {
        idEntity.set((0, Utils_1.getPeerId)(channel), channel);
      }
      for (const chat of chats) {
        idEntity.set((0, Utils_1.getPeerId)(chat), chat);
      }
      const result = [];
      for (const x of inputs) {
        if (typeof x === "string") {
          result.push(await _getEntityFromString(client2, x));
        } else if (!(x instanceof tl_1.Api.InputPeerSelf)) {
          result.push(idEntity.get((0, Utils_1.getPeerId)(x)));
        } else {
          for (const [key, u] of idEntity.entries()) {
            if (u instanceof tl_1.Api.User && u.self) {
              result.push(u);
              break;
            }
          }
        }
      }
      return single ? result[0] : result;
    }
    exports2.getEntity = getEntity;
    async function getInputEntity(client2, peer) {
      try {
        return __1.utils.getInputPeer(peer);
      } catch (e) {
      }
      try {
        if (typeof peer == "string") {
          const valid = (0, Utils_1.parseID)(peer);
          if (valid) {
            const res = client2._entityCache.get(peer);
            if (res) {
              return res;
            }
          }
        }
        if (typeof peer === "number" || typeof peer === "bigint" || big_integer_1.default.isInstance(peer)) {
          const res = client2._entityCache.get(peer.toString());
          if (res) {
            return res;
          }
        }
        if (typeof peer == "object" && !big_integer_1.default.isInstance(peer) && peer.SUBCLASS_OF_ID === 47470215) {
          const res = client2._entityCache.get(__1.utils.getPeerId(peer));
          if (res) {
            return res;
          }
        }
      } catch (e) {
      }
      if (typeof peer == "string") {
        if (["me", "this", "self"].includes(peer)) {
          return new tl_1.Api.InputPeerSelf();
        }
      }
      try {
        if (peer != void 0) {
          return client2.session.getInputEntity(peer);
        }
      } catch (e) {
      }
      if (typeof peer === "string") {
        return __1.utils.getInputPeer(await _getEntityFromString(client2, peer));
      }
      if (typeof peer === "number") {
        peer = (0, Helpers_1.returnBigInt)(peer);
      }
      peer = __1.utils.getPeer(peer);
      if (peer instanceof tl_1.Api.PeerUser) {
        const users = await client2.invoke(new tl_1.Api.users.GetUsers({
          id: [
            new tl_1.Api.InputUser({
              userId: peer.userId,
              accessHash: big_integer_1.default.zero
            })
          ]
        }));
        if (users.length && !(users[0] instanceof tl_1.Api.UserEmpty)) {
          return __1.utils.getInputPeer(users[0]);
        }
      } else if (peer instanceof tl_1.Api.PeerChat) {
        return new tl_1.Api.InputPeerChat({
          chatId: peer.chatId
        });
      } else if (peer instanceof tl_1.Api.PeerChannel) {
        try {
          const channels = await client2.invoke(new tl_1.Api.channels.GetChannels({
            id: [
              new tl_1.Api.InputChannel({
                channelId: peer.channelId,
                accessHash: big_integer_1.default.zero
              })
            ]
          }));
          return __1.utils.getInputPeer(channels.chats[0]);
        } catch (e) {
          if (client2._errorHandler) {
            await client2._errorHandler(e);
          }
          if (client2._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(e);
          }
        }
      }
      throw new Error(`Could not find the input entity for ${JSON.stringify(peer)}.
         Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.`);
    }
    exports2.getInputEntity = getInputEntity;
    async function _getEntityFromString(client2, string) {
      const phone = __1.utils.parsePhone(string);
      if (phone) {
        try {
          const result = await client2.invoke(new tl_1.Api.contacts.GetContacts({
            hash: big_integer_1.default.zero
          }));
          if (!(result instanceof tl_1.Api.contacts.ContactsNotModified)) {
            for (const user of result.users) {
              if (user instanceof tl_1.Api.User && user.phone === phone) {
                return user;
              }
            }
          }
        } catch (e) {
          if (e.errorMessage === "BOT_METHOD_INVALID") {
            throw new Error("Cannot get entity by phone number as a bot (try using integer IDs, not strings)");
          }
          throw e;
        }
      }
      const id = __1.utils.parseID(string);
      if (id != void 0) {
        return getInputEntity(client2, id);
      } else if (["me", "this"].includes(string.toLowerCase())) {
        return client2.getMe();
      } else {
        const { username, isInvite } = __1.utils.parseUsername(string);
        if (isInvite) {
          const invite = await client2.invoke(new tl_1.Api.messages.CheckChatInvite({
            hash: username
          }));
          if (invite instanceof tl_1.Api.ChatInvite) {
            throw new Error("Cannot get entity from a channel (or group) that you are not part of. Join the group and retry");
          } else if (invite instanceof tl_1.Api.ChatInviteAlready) {
            return invite.chat;
          }
        } else if (username) {
          try {
            const result = await client2.invoke(new tl_1.Api.contacts.ResolveUsername({ username }));
            const pid = __1.utils.getPeerId(result.peer, false);
            if (result.peer instanceof tl_1.Api.PeerUser) {
              for (const x of result.users) {
                if ((0, Helpers_1.returnBigInt)(x.id).equals((0, Helpers_1.returnBigInt)(pid))) {
                  return x;
                }
              }
            } else {
              for (const x of result.chats) {
                if ((0, Helpers_1.returnBigInt)(x.id).equals((0, Helpers_1.returnBigInt)(pid))) {
                  return x;
                }
              }
            }
          } catch (e) {
            if (e.errorMessage === "USERNAME_NOT_OCCUPIED") {
              throw new Error(`No user has "${username}" as username`);
            }
            throw e;
          }
        }
      }
      throw new Error(`Cannot find any entity corresponding to "${string}"`);
    }
    exports2._getEntityFromString = _getEntityFromString;
    async function getPeerId(client2, peer, addMark = true) {
      if (typeof peer == "string") {
        const valid = (0, Utils_1.parseID)(peer);
        if (valid) {
          return __1.utils.getPeerId(peer, addMark);
        } else {
          peer = await client2.getInputEntity(peer);
        }
      }
      if (typeof peer == "number" || typeof peer == "bigint" || big_integer_1.default.isInstance(peer)) {
        return __1.utils.getPeerId(peer, addMark);
      }
      if (peer.SUBCLASS_OF_ID == 47470215 || peer.SUBCLASS_OF_ID == 3374092470) {
        peer = await client2.getInputEntity(peer);
      }
      if (peer instanceof tl_1.Api.InputPeerSelf) {
        peer = await client2.getMe(true);
      }
      return __1.utils.getPeerId(peer, addMark);
    }
    exports2.getPeerId = getPeerId;
    async function _getPeer(client2, peer) {
      if (!peer) {
        return void 0;
      }
      const [i, cls] = __1.utils.resolveId((0, Helpers_1.returnBigInt)(await client2.getPeerId(peer)));
      return new cls({
        userId: i,
        channelId: i,
        chatId: i
      });
    }
    exports2._getPeer = _getPeer;
    async function _getInputDialog(client2, dialog) {
      try {
        if (dialog.SUBCLASS_OF_ID == 2719782805) {
          dialog.peer = await client2.getInputEntity(dialog.peer);
          return dialog;
        } else if (dialog.SUBCLASS_OF_ID == 3374092470) {
          return new tl_1.Api.InputDialogPeer({
            peer: dialog
          });
        }
      } catch (e) {
      }
      return new tl_1.Api.InputDialogPeer({
        peer: dialog
      });
    }
    exports2._getInputDialog = _getInputDialog;
    async function _getInputNotify(client2, notify) {
      try {
        if (notify.SUBCLASS_OF_ID == 1486362133) {
          if (notify instanceof tl_1.Api.InputNotifyPeer) {
            notify.peer = await client2.getInputEntity(notify.peer);
          }
          return notify;
        }
      } catch (e) {
      }
      return new tl_1.Api.InputNotifyPeer({
        peer: await client2.getInputEntity(notify)
      });
    }
    exports2._getInputNotify = _getInputNotify;
    function _selfId(client2) {
      return client2._selfInputPeer ? client2._selfInputPeer.userId : void 0;
    }
    exports2._selfId = _selfId;
  }
});

// node_modules/telegram/tl/custom/button.js
var require_button = __commonJS({
  "node_modules/telegram/tl/custom/button.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Button = void 0;
    var api_1 = require_api();
    var __1 = require_telegram();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var Button = class {
      constructor(button, resize, singleUse, selective) {
        this.button = button;
        this.resize = resize;
        this.singleUse = singleUse;
        this.selective = selective;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      static _isInline(button) {
        return button instanceof api_1.Api.KeyboardButtonCallback || button instanceof api_1.Api.KeyboardButtonSwitchInline || button instanceof api_1.Api.KeyboardButtonUrl || button instanceof api_1.Api.KeyboardButtonUrlAuth || button instanceof api_1.Api.InputKeyboardButtonUrlAuth;
      }
      static inline(text, data) {
        if (!data) {
          data = Buffer.from(text, "utf-8");
        }
        if (data.length > 64) {
          throw new Error("Too many bytes for the data");
        }
        return new api_1.Api.KeyboardButtonCallback({
          text,
          data
        });
      }
      static switchInline(text, query = "", samePeer = false) {
        return new api_1.Api.KeyboardButtonSwitchInline({
          text,
          query,
          samePeer
        });
      }
      static url(text, url) {
        return new api_1.Api.KeyboardButtonUrl({
          text,
          url: url || text
        });
      }
      static auth(text, url, bot, writeAccess, fwdText) {
        return new api_1.Api.InputKeyboardButtonUrlAuth({
          text,
          url: url || text,
          bot: __1.utils.getInputUser(bot || new api_1.Api.InputUserSelf()),
          requestWriteAccess: writeAccess,
          fwdText
        });
      }
      static text(text, resize, singleUse, selective) {
        return new this(new api_1.Api.KeyboardButton({ text }), resize, singleUse, selective);
      }
      static requestLocation(text, resize, singleUse, selective) {
        return new this(new api_1.Api.KeyboardButtonRequestGeoLocation({ text }), resize, singleUse, selective);
      }
      static requestPhone(text, resize, singleUse, selective) {
        return new this(new api_1.Api.KeyboardButtonRequestPhone({ text }), resize, singleUse, selective);
      }
      static requestPoll(text, resize, singleUse, selective) {
        return new this(new api_1.Api.KeyboardButtonRequestPoll({ text }), resize, singleUse, selective);
      }
      static clear() {
        return new api_1.Api.ReplyKeyboardHide({});
      }
      static forceReply() {
        return new api_1.Api.ReplyKeyboardForceReply({});
      }
    };
    exports2.Button = Button;
  }
});

// node_modules/telegram/Password.js
var require_Password = __commonJS({
  "node_modules/telegram/Password.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.computeDigest = exports2.computeCheck = void 0;
    var tl_1 = require_tl();
    var Helpers_1 = require_Helpers();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var CryptoFile_1 = __importDefault2(require_CryptoFile());
    var SIZE_FOR_HASH = 256;
    function checkPrimeAndGood(primeBytes, g) {
      const goodPrime = Buffer.from([
        199,
        28,
        174,
        185,
        198,
        177,
        201,
        4,
        142,
        108,
        82,
        47,
        112,
        241,
        63,
        115,
        152,
        13,
        64,
        35,
        142,
        62,
        33,
        193,
        73,
        52,
        208,
        55,
        86,
        61,
        147,
        15,
        72,
        25,
        138,
        10,
        167,
        193,
        64,
        88,
        34,
        148,
        147,
        210,
        37,
        48,
        244,
        219,
        250,
        51,
        111,
        110,
        10,
        201,
        37,
        19,
        149,
        67,
        174,
        212,
        76,
        206,
        124,
        55,
        32,
        253,
        81,
        246,
        148,
        88,
        112,
        90,
        198,
        140,
        212,
        254,
        107,
        107,
        19,
        171,
        220,
        151,
        70,
        81,
        41,
        105,
        50,
        132,
        84,
        241,
        143,
        175,
        140,
        89,
        95,
        100,
        36,
        119,
        254,
        150,
        187,
        42,
        148,
        29,
        91,
        205,
        29,
        74,
        200,
        204,
        73,
        136,
        7,
        8,
        250,
        155,
        55,
        142,
        60,
        79,
        58,
        144,
        96,
        190,
        230,
        124,
        249,
        164,
        164,
        166,
        149,
        129,
        16,
        81,
        144,
        126,
        22,
        39,
        83,
        181,
        107,
        15,
        107,
        65,
        13,
        186,
        116,
        216,
        168,
        75,
        42,
        20,
        179,
        20,
        78,
        14,
        241,
        40,
        71,
        84,
        253,
        23,
        237,
        149,
        13,
        89,
        101,
        180,
        185,
        221,
        70,
        88,
        45,
        177,
        23,
        141,
        22,
        156,
        107,
        196,
        101,
        176,
        214,
        255,
        156,
        163,
        146,
        143,
        239,
        91,
        154,
        228,
        228,
        24,
        252,
        21,
        232,
        62,
        190,
        160,
        248,
        127,
        169,
        255,
        94,
        237,
        112,
        5,
        13,
        237,
        40,
        73,
        244,
        123,
        249,
        89,
        217,
        86,
        133,
        12,
        233,
        41,
        133,
        31,
        13,
        129,
        21,
        246,
        53,
        177,
        5,
        238,
        46,
        78,
        21,
        208,
        75,
        36,
        84,
        191,
        111,
        79,
        173,
        240,
        52,
        177,
        4,
        3,
        17,
        156,
        216,
        227,
        185,
        47,
        204,
        91
      ]);
      if (goodPrime.equals(primeBytes)) {
        if ([3, 4, 5, 7].includes(g)) {
          return;
        }
      }
      throw new Error("Changing passwords unsupported");
    }
    function isGoodLarge(number, p) {
      return number.greater((0, big_integer_1.default)(0)) && p.subtract(number).greater((0, big_integer_1.default)(0));
    }
    function numBytesForHash(number) {
      return Buffer.concat([Buffer.alloc(SIZE_FOR_HASH - number.length), number]);
    }
    function bigNumForHash(g) {
      return (0, Helpers_1.readBufferFromBigInt)(g, SIZE_FOR_HASH, false);
    }
    function isGoodModExpFirst(modexp, prime) {
      const diff = prime.subtract(modexp);
      const minDiffBitsCount = 2048 - 64;
      const maxModExpSize = 256;
      return !(diff.lesser((0, big_integer_1.default)(0)) || diff.bitLength().toJSNumber() < minDiffBitsCount || modexp.bitLength().toJSNumber() < minDiffBitsCount || Math.floor((modexp.bitLength().toJSNumber() + 7) / 8) > maxModExpSize);
    }
    function xor(a, b) {
      const length = Math.min(a.length, b.length);
      for (let i = 0; i < length; i++) {
        a[i] = a[i] ^ b[i];
      }
      return a;
    }
    function pbkdf2sha512(password, salt, iterations) {
      return CryptoFile_1.default.pbkdf2Sync(password, salt, iterations, 64, "sha512");
    }
    async function computeHash(algo, password) {
      const hash1 = await (0, Helpers_1.sha256)(Buffer.concat([algo.salt1, Buffer.from(password, "utf-8"), algo.salt1]));
      const hash22 = await (0, Helpers_1.sha256)(Buffer.concat([algo.salt2, hash1, algo.salt2]));
      const hash3 = await pbkdf2sha512(hash22, algo.salt1, 1e5);
      return (0, Helpers_1.sha256)(Buffer.concat([algo.salt2, hash3, algo.salt2]));
    }
    async function computeDigest(algo, password) {
      try {
        checkPrimeAndGood(algo.p, algo.g);
      } catch (e) {
        throw new Error("bad p/g in password");
      }
      const value = (0, Helpers_1.modExp)((0, big_integer_1.default)(algo.g), (0, Helpers_1.readBigIntFromBuffer)(await computeHash(algo, password), false), (0, Helpers_1.readBigIntFromBuffer)(algo.p, false));
      return bigNumForHash(value);
    }
    exports2.computeDigest = computeDigest;
    async function computeCheck(request, password) {
      const algo = request.currentAlgo;
      if (!(algo instanceof tl_1.Api.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {
        throw new Error(`Unsupported password algorithm ${algo === null || algo === void 0 ? void 0 : algo.className}`);
      }
      const srp_B = request.srp_B;
      const srpId = request.srpId;
      if (!srp_B || !srpId) {
        throw new Error(`Undefined srp_b  ${request}`);
      }
      const pwHash = await computeHash(algo, password);
      const p = (0, Helpers_1.readBigIntFromBuffer)(algo.p, false);
      const g = algo.g;
      const B = (0, Helpers_1.readBigIntFromBuffer)(srp_B, false);
      try {
        checkPrimeAndGood(algo.p, g);
      } catch (e) {
        throw new Error("bad /g in password");
      }
      if (!isGoodLarge(B, p)) {
        throw new Error("bad b in check");
      }
      const x = (0, Helpers_1.readBigIntFromBuffer)(pwHash, false);
      const pForHash = numBytesForHash(algo.p);
      const gForHash = bigNumForHash((0, big_integer_1.default)(g));
      const bForHash = numBytesForHash(srp_B);
      const gX = (0, Helpers_1.modExp)((0, big_integer_1.default)(g), x, p);
      const k = (0, Helpers_1.readBigIntFromBuffer)(await (0, Helpers_1.sha256)(Buffer.concat([pForHash, gForHash])), false);
      const kgX = (0, Helpers_1.bigIntMod)(k.multiply(gX), p);
      const generateAndCheckRandom = async () => {
        const randomSize = 256;
        while (true) {
          const random = (0, Helpers_1.generateRandomBytes)(randomSize);
          const a2 = (0, Helpers_1.readBigIntFromBuffer)(random, false);
          const A = (0, Helpers_1.modExp)((0, big_integer_1.default)(g), a2, p);
          if (isGoodModExpFirst(A, p)) {
            const aForHash2 = bigNumForHash(A);
            const u2 = (0, Helpers_1.readBigIntFromBuffer)(await (0, Helpers_1.sha256)(Buffer.concat([aForHash2, bForHash])), false);
            if (u2.greater((0, big_integer_1.default)(0))) {
              return {
                a: a2,
                aForHash: aForHash2,
                u: u2
              };
            }
          }
        }
      };
      const { a, aForHash, u } = await generateAndCheckRandom();
      const gB = (0, Helpers_1.bigIntMod)(B.subtract(kgX), p);
      if (!isGoodModExpFirst(gB, p)) {
        throw new Error("bad gB");
      }
      const ux = u.multiply(x);
      const aUx = a.add(ux);
      const S = (0, Helpers_1.modExp)(gB, aUx, p);
      const [K, pSha, gSha, salt1Sha, salt2Sha] = await Promise.all([
        (0, Helpers_1.sha256)(bigNumForHash(S)),
        (0, Helpers_1.sha256)(pForHash),
        (0, Helpers_1.sha256)(gForHash),
        (0, Helpers_1.sha256)(algo.salt1),
        (0, Helpers_1.sha256)(algo.salt2)
      ]);
      const M1 = await (0, Helpers_1.sha256)(Buffer.concat([
        xor(pSha, gSha),
        salt1Sha,
        salt2Sha,
        aForHash,
        bForHash,
        K
      ]));
      return new tl_1.Api.InputCheckPasswordSRP({
        srpId,
        A: Buffer.from(aForHash),
        M1
      });
    }
    exports2.computeCheck = computeCheck;
  }
});

// node_modules/telegram/tl/custom/messageButton.js
var require_messageButton = __commonJS({
  "node_modules/telegram/tl/custom/messageButton.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MessageButton = void 0;
    var api_1 = require_api();
    var button_1 = require_button();
    var Helpers_1 = require_Helpers();
    var Password_1 = require_Password();
    var inspect_1 = require_inspect();
    var MessageButton = class {
      constructor(client2, original, chat, bot, msgId) {
        this.button = original;
        this._bot = bot;
        this._chat = chat;
        this._msgId = msgId;
        this._client = client2;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      get client() {
        return this._client;
      }
      get text() {
        return !(this.button instanceof button_1.Button) ? this.button.text : "";
      }
      get data() {
        if (this.button instanceof api_1.Api.KeyboardButtonCallback) {
          return this.button.data;
        }
      }
      get inlineQuery() {
        if (this.button instanceof api_1.Api.KeyboardButtonSwitchInline) {
          return this.button.query;
        }
      }
      get url() {
        if (this.button instanceof api_1.Api.KeyboardButtonUrl) {
          return this.button.url;
        }
      }
      /**
           * Emulates the behaviour of clicking this button.
      
           If it's a normal `KeyboardButton` with text, a message will be
           sent, and the sent `Message <Message>` returned.
      
           If it's an inline `KeyboardButtonCallback` with text and data,
           it will be "clicked" and the `BotCallbackAnswer` returned.
      
           If it's an inline `KeyboardButtonSwitchInline` button, the
           `StartBot` will be invoked and the resulting updates
           returned.
      
           If it's a `KeyboardButtonUrl`, the URL of the button will
           be returned.
      
           If it's a `KeyboardButtonRequestPhone`, you must indicate that you
           want to ``sharePhone=True`` in order to share it. Sharing it is not a
           default because it is a privacy concern and could happen accidentally.
      
           You may also use ``sharePhone=phone`` to share a specific number, in
           which case either `str` or `InputMediaContact` should be used.
      
           If it's a `KeyboardButtonRequestGeoLocation`, you must pass a
           tuple in ``shareGeo=[longitude, latitude]``. Note that Telegram seems
           to have some heuristics to determine impossible locations, so changing
           this value a lot quickly may not work as expected. You may also pass a
           `InputGeoPoint` if you find the order confusing.
           */
      async click({ sharePhone = false, shareGeo = [0, 0], password }) {
        if (this.button instanceof api_1.Api.KeyboardButton) {
          return this._client.sendMessage(this._chat, {
            message: this.button.text,
            parseMode: void 0
          });
        } else if (this.button instanceof api_1.Api.KeyboardButtonCallback) {
          let encryptedPassword;
          if (password != void 0) {
            const pwd = await this.client.invoke(new api_1.Api.account.GetPassword());
            encryptedPassword = await (0, Password_1.computeCheck)(pwd, password);
          }
          const request = new api_1.Api.messages.GetBotCallbackAnswer({
            peer: this._chat,
            msgId: this._msgId,
            data: this.button.data,
            password: encryptedPassword
          });
          try {
            return await this._client.invoke(request);
          } catch (e) {
            if (e.errorMessage == "BOT_RESPONSE_TIMEOUT") {
              return null;
            }
            throw e;
          }
        } else if (this.button instanceof api_1.Api.KeyboardButtonSwitchInline) {
          return this._client.invoke(new api_1.Api.messages.StartBot({
            bot: this._bot,
            peer: this._chat,
            startParam: this.button.query
          }));
        } else if (this.button instanceof api_1.Api.KeyboardButtonUrl) {
          return this.button.url;
        } else if (this.button instanceof api_1.Api.KeyboardButtonGame) {
          const request = new api_1.Api.messages.GetBotCallbackAnswer({
            peer: this._chat,
            msgId: this._msgId,
            game: true
          });
          try {
            return await this._client.invoke(request);
          } catch (e) {
            if (e.errorMessage == "BOT_RESPONSE_TIMEOUT") {
              return null;
            }
            throw e;
          }
        } else if (this.button instanceof api_1.Api.KeyboardButtonRequestPhone) {
          if (!sharePhone) {
            throw new Error("cannot click on phone buttons unless sharePhone=true");
          }
          if (sharePhone == true || typeof sharePhone == "string") {
            const me = await this._client.getMe();
            sharePhone = new api_1.Api.InputMediaContact({
              phoneNumber: (sharePhone == true ? me.phone : sharePhone) || "",
              firstName: me.firstName || "",
              lastName: me.lastName || "",
              vcard: ""
            });
          }
          throw new Error("Not supported for now");
        } else if (this.button instanceof api_1.Api.InputWebFileGeoPointLocation) {
          if (!shareGeo) {
            throw new Error("cannot click on geo buttons unless shareGeo=[longitude, latitude]");
          }
          throw new Error("Not supported for now");
        }
      }
    };
    exports2.MessageButton = MessageButton;
  }
});

// node_modules/telegram/tl/custom/message.js
var require_message = __commonJS({
  "node_modules/telegram/tl/custom/message.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.CustomMessage = void 0;
    var senderGetter_1 = require_senderGetter();
    var api_1 = require_api();
    var chatGetter_1 = require_chatGetter();
    var utils = __importStar2(require_Utils());
    var forward_1 = require_forward();
    var file_1 = require_file();
    var Helpers_1 = require_Helpers();
    var users_1 = require_users();
    var Logger_1 = require_Logger();
    var messageButton_1 = require_messageButton();
    var inspect_1 = require_inspect();
    var CustomMessage = class extends senderGetter_1.SenderGetter {
      constructor(args) {
        super();
        this.init(args);
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      init({ id, peerId = void 0, date = void 0, out = void 0, mentioned = void 0, mediaUnread = void 0, silent = void 0, post = void 0, fromId = void 0, replyTo = void 0, message = void 0, fwdFrom = void 0, viaBotId = void 0, media = void 0, replyMarkup = void 0, entities = void 0, views = void 0, editDate = void 0, postAuthor = void 0, groupedId = void 0, fromScheduled = void 0, legacy = void 0, editHide = void 0, pinned = void 0, restrictionReason = void 0, forwards = void 0, replies = void 0, action = void 0, reactions = void 0, noforwards = void 0, ttlPeriod = void 0, _entities = /* @__PURE__ */ new Map() }) {
        if (!id)
          throw new Error("id is a required attribute for Message");
        let senderId = void 0;
        if (fromId) {
          senderId = utils.getPeerId(fromId);
        } else if (peerId) {
          if (post || !out && peerId instanceof api_1.Api.PeerUser) {
            senderId = utils.getPeerId(peerId);
          }
        }
        this._entities = _entities;
        this.out = out;
        this.mentioned = mentioned;
        this.mediaUnread = mediaUnread;
        this.silent = silent;
        this.post = post;
        this.post = post;
        this.fromScheduled = fromScheduled;
        this.legacy = legacy;
        this.editHide = editHide;
        this.ttlPeriod = ttlPeriod;
        this.id = id;
        this.fromId = fromId;
        this.peerId = peerId;
        this.fwdFrom = fwdFrom;
        this.viaBotId = viaBotId;
        this.replyTo = replyTo;
        this.date = date;
        this.message = message;
        this.media = media instanceof api_1.Api.MessageMediaEmpty ? media : void 0;
        this.replyMarkup = replyMarkup;
        this.entities = entities;
        this.views = views;
        this.forwards = forwards;
        this.replies = replies;
        this.editDate = editDate;
        this.pinned = pinned;
        this.postAuthor = postAuthor;
        this.groupedId = groupedId;
        this.restrictionReason = restrictionReason;
        this.action = action;
        this.noforwards = noforwards;
        this.reactions = reactions;
        this._client = void 0;
        this._text = void 0;
        this._file = void 0;
        this._replyMessage = void 0;
        this._buttons = void 0;
        this._buttonsFlat = void 0;
        this._buttonsCount = 0;
        this._viaBot = void 0;
        this._viaInputBot = void 0;
        this._actionEntities = void 0;
        chatGetter_1.ChatGetter.initChatClass(this, { chatPeer: peerId, broadcast: post });
        senderGetter_1.SenderGetter.initSenderClass(this, {
          senderId: senderId ? (0, Helpers_1.returnBigInt)(senderId) : void 0
        });
        this._forward = void 0;
      }
      _finishInit(client2, entities, inputChat) {
        this._client = client2;
        const cache = client2._entityCache;
        if (this.senderId) {
          [this._sender, this._inputSender] = utils._getEntityPair(this.senderId.toString(), entities, cache);
        }
        if (this.chatId) {
          [this._chat, this._inputChat] = utils._getEntityPair(this.chatId.toString(), entities, cache);
        }
        if (inputChat) {
          this._inputChat = inputChat;
        }
        if (this.viaBotId) {
          [this._viaBot, this._viaInputBot] = utils._getEntityPair(this.viaBotId.toString(), entities, cache);
        }
        if (this.fwdFrom) {
          this._forward = new forward_1.Forward(this._client, this.fwdFrom, entities);
        }
        if (this.action) {
          if (this.action instanceof api_1.Api.MessageActionChatAddUser || this.action instanceof api_1.Api.MessageActionChatCreate) {
            this._actionEntities = this.action.users.map((i) => entities.get(i.toString()));
          } else if (this.action instanceof api_1.Api.MessageActionChatDeleteUser) {
            this._actionEntities = [
              entities.get(this.action.userId.toString())
            ];
          } else if (this.action instanceof api_1.Api.MessageActionChatJoinedByLink) {
            this._actionEntities = [
              entities.get(utils.getPeerId(new api_1.Api.PeerChannel({
                channelId: this.action.inviterId
              })))
            ];
          } else if (this.action instanceof api_1.Api.MessageActionChannelMigrateFrom) {
            this._actionEntities = [
              entities.get(utils.getPeerId(new api_1.Api.PeerChat({ chatId: this.action.chatId })))
            ];
          }
        }
      }
      get client() {
        return this._client;
      }
      get text() {
        if (this._text === void 0 && this._client) {
          if (!this._client.parseMode) {
            this._text = this.message;
          } else {
            this._text = this._client.parseMode.unparse(this.message || "", this.entities || []);
          }
        }
        return this._text || "";
      }
      set text(value) {
        this._text = value;
        if (this._client && this._client.parseMode) {
          [this.message, this.entities] = this._client.parseMode.parse(value);
        } else {
          this.message = value;
          this.entities = [];
        }
      }
      get rawText() {
        return this.message || "";
      }
      /**
       * @param {string} value
       */
      set rawText(value) {
        this.message = value;
        this.entities = [];
        this._text = "";
      }
      get isReply() {
        return !!this.replyTo;
      }
      get forward() {
        return this._forward;
      }
      async _refetchSender() {
        await this._reloadMessage();
      }
      /**
       * Re-fetches this message to reload the sender and chat entities,
       * along with their input versions.
       * @private
       */
      async _reloadMessage() {
        if (!this._client)
          return;
        let msg = void 0;
        try {
          const chat = this.isChannel ? await this.getInputChat() : void 0;
          let temp = await this._client.getMessages(chat, { ids: this.id });
          if (temp) {
            msg = temp[0];
          }
        } catch (e) {
          this._client._log.error("Got error while trying to finish init message with id " + this.id);
          if (this._client._errorHandler) {
            await this._client._errorHandler(e);
          }
          if (this._client._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(e);
          }
        }
        if (msg == void 0)
          return;
        this._sender = msg._sender;
        this._inputSender = msg._inputSender;
        this._chat = msg._chat;
        this._inputChat = msg._inputChat;
        this._viaBot = msg._viaBot;
        this._viaInputBot = msg._viaInputBot;
        this._forward = msg._forward;
        this._actionEntities = msg._actionEntities;
      }
      /**
       * Returns a list of lists of `MessageButton <MessageButton>`, if any.
       * Otherwise, it returns `undefined`.
       */
      get buttons() {
        if (!this._buttons && this.replyMarkup) {
          if (!this.inputChat) {
            return;
          }
          try {
            const bot = this._neededMarkupBot();
            this._setButtons(this.inputChat, bot);
          } catch (e) {
            return;
          }
        }
        return this._buttons;
      }
      /**
       * Returns `buttons` when that property fails (this is rarely needed).
       */
      async getButtons() {
        if (!this.buttons && this.replyMarkup) {
          const chat = await this.getInputChat();
          if (!chat)
            return;
          let bot;
          try {
            bot = this._neededMarkupBot();
          } catch (e) {
            await this._reloadMessage();
            bot = this._neededMarkupBot();
          }
          this._setButtons(chat, bot);
        }
        return this._buttons;
      }
      get buttonCount() {
        if (!this._buttonsCount) {
          if (this.replyMarkup instanceof api_1.Api.ReplyInlineMarkup || this.replyMarkup instanceof api_1.Api.ReplyKeyboardMarkup) {
            this._buttonsCount = this.replyMarkup.rows.map((r) => r.buttons.length).reduce(function(a, b) {
              return a + b;
            }, 0);
          } else {
            this._buttonsCount = 0;
          }
        }
        return this._buttonsCount;
      }
      get file() {
        if (!this._file) {
          const media = this.photo || this.document;
          if (media) {
            this._file = new file_1.File(media);
          }
        }
        return this._file;
      }
      get photo() {
        if (this.media instanceof api_1.Api.MessageMediaPhoto) {
          if (this.media.photo instanceof api_1.Api.Photo)
            return this.media.photo;
        } else if (this.action instanceof api_1.Api.MessageActionChatEditPhoto) {
          return this.action.photo;
        } else {
          return this.webPreview && this.webPreview.photo instanceof api_1.Api.Photo ? this.webPreview.photo : void 0;
        }
        return void 0;
      }
      get document() {
        if (this.media instanceof api_1.Api.MessageMediaDocument) {
          if (this.media.document instanceof api_1.Api.Document)
            return this.media.document;
        } else {
          const web = this.webPreview;
          return web && web.document instanceof api_1.Api.Document ? web.document : void 0;
        }
        return void 0;
      }
      get webPreview() {
        if (this.media instanceof api_1.Api.MessageMediaWebPage) {
          if (this.media.webpage instanceof api_1.Api.WebPage)
            return this.media.webpage;
        }
      }
      get audio() {
        return this._documentByAttribute(api_1.Api.DocumentAttributeAudio, (attr) => !attr.voice);
      }
      get voice() {
        return this._documentByAttribute(api_1.Api.DocumentAttributeAudio, (attr) => !!attr.voice);
      }
      get video() {
        return this._documentByAttribute(api_1.Api.DocumentAttributeVideo);
      }
      get videoNote() {
        return this._documentByAttribute(api_1.Api.DocumentAttributeVideo, (attr) => !!attr.roundMessage);
      }
      get gif() {
        return this._documentByAttribute(api_1.Api.DocumentAttributeAnimated);
      }
      get sticker() {
        return this._documentByAttribute(api_1.Api.DocumentAttributeSticker);
      }
      get contact() {
        if (this.media instanceof api_1.Api.MessageMediaContact) {
          return this.media;
        }
      }
      get game() {
        if (this.media instanceof api_1.Api.MessageMediaGame) {
          return this.media.game;
        }
      }
      get geo() {
        if (this.media instanceof api_1.Api.MessageMediaGeo || this.media instanceof api_1.Api.MessageMediaGeoLive || this.media instanceof api_1.Api.MessageMediaVenue) {
          return this.media.geo;
        }
      }
      get invoice() {
        if (this.media instanceof api_1.Api.MessageMediaInvoice) {
          return this.media;
        }
      }
      get poll() {
        if (this.media instanceof api_1.Api.MessageMediaPoll) {
          return this.media;
        }
      }
      get venue() {
        if (this.media instanceof api_1.Api.MessageMediaVenue) {
          return this.media;
        }
      }
      get dice() {
        if (this.media instanceof api_1.Api.MessageMediaDice) {
          return this.media;
        }
      }
      get actionEntities() {
        return this._actionEntities;
      }
      get viaBot() {
        return this._viaBot;
      }
      get viaInputBot() {
        return this._viaInputBot;
      }
      get replyToMsgId() {
        var _a;
        return (_a = this.replyTo) === null || _a === void 0 ? void 0 : _a.replyToMsgId;
      }
      get toId() {
        if (this._client && !this.out && this.isPrivate) {
          return new api_1.Api.PeerUser({
            userId: (0, users_1._selfId)(this._client)
          });
        }
        return this.peerId;
      }
      getEntitiesText(cls) {
        let ent = this.entities;
        if (!ent || ent.length == 0)
          return;
        if (cls) {
          ent = ent.filter((v) => v instanceof cls);
        }
        const texts = utils.getInnerText(this.message || "", ent);
        const zip = (rows) => rows[0].map((_, c) => rows.map((row) => row[c]));
        return zip([ent, texts]);
      }
      async getReplyMessage() {
        if (!this._replyMessage && this._client) {
          if (!this.replyTo)
            return void 0;
          this._replyMessage = (await this._client.getMessages(this.isChannel ? await this.getInputChat() : void 0, {
            ids: new api_1.Api.InputMessageReplyTo({ id: this.id })
          }))[0];
          if (!this._replyMessage) {
            this._replyMessage = (await this._client.getMessages(this.isChannel ? this._inputChat : void 0, {
              ids: this.replyToMsgId
            }))[0];
          }
        }
        return this._replyMessage;
      }
      async respond(params) {
        if (this._client) {
          return this._client.sendMessage(await this.getInputChat(), params);
        }
      }
      async reply(params) {
        if (this._client) {
          params.replyTo = this.id;
          return this._client.sendMessage(await this.getInputChat(), params);
        }
      }
      async forwardTo(entity) {
        if (this._client) {
          entity = await this._client.getInputEntity(entity);
          const params = {
            messages: [this.id],
            fromPeer: await this.getInputChat()
          };
          return this._client.forwardMessages(entity, params);
        }
      }
      async edit(params) {
        const param = params;
        if (this.fwdFrom || !this._client)
          return void 0;
        if (param.linkPreview == void 0) {
          param.linkPreview = !!this.webPreview;
        }
        if (param.buttons == void 0) {
          param.buttons = this.replyMarkup;
        }
        param.message = this.id;
        return this._client.editMessage(await this.getInputChat(), param);
      }
      async delete({ revoke } = { revoke: false }) {
        if (this._client) {
          return this._client.deleteMessages(await this.getInputChat(), [this.id], {
            revoke
          });
        }
      }
      async pin(params) {
        if (this._client) {
          const entity = await this.getInputChat();
          if (entity === void 0) {
            throw Error("Failed to pin message due to cannot get input chat.");
          }
          return this._client.pinMessage(entity, this.id, params);
        }
      }
      async unpin(params) {
        if (this._client) {
          const entity = await this.getInputChat();
          if (entity === void 0) {
            throw Error("Failed to unpin message due to cannot get input chat.");
          }
          return this._client.unpinMessage(entity, this.id, params);
        }
      }
      async downloadMedia(params) {
        if (this._client)
          return this._client.downloadMedia(this, params || {});
      }
      async markAsRead() {
        if (this._client) {
          const entity = await this.getInputChat();
          if (entity === void 0) {
            throw Error(`Failed to mark message id ${this.id} as read due to cannot get input chat.`);
          }
          return this._client.markAsRead(entity, this.id);
        }
      }
      async click({ i, j, text, filter, data, sharePhone, shareGeo, password }) {
        if (!this.client) {
          return;
        }
        if (data) {
          const chat = await this.getInputChat();
          if (!chat) {
            return;
          }
          const button2 = new api_1.Api.KeyboardButtonCallback({
            text: "",
            data
          });
          return await new messageButton_1.MessageButton(this.client, button2, chat, void 0, this.id).click({
            sharePhone,
            shareGeo,
            password
          });
        }
        if (this.poll) {
          let findPoll = function(answers) {
            if (i != void 0) {
              if (Array.isArray(i)) {
                const corrects = [];
                for (let x = 0; x < i.length; x++) {
                  corrects.push(answers[x].option);
                }
                return corrects;
              }
              return [answers[i].option];
            }
            if (text != void 0) {
              if (typeof text == "function") {
                for (const answer of answers) {
                  if (text(answer.text)) {
                    return [answer.option];
                  }
                }
              } else {
                for (const answer of answers) {
                  if (answer.text.text == text) {
                    return [answer.option];
                  }
                }
              }
              return;
            }
            if (filter != void 0) {
              for (const answer of answers) {
                if (filter(answer)) {
                  return [answer.option];
                }
              }
              return;
            }
          };
          const options = findPoll(this.poll.poll.answers) || [];
          return await this.client.invoke(new api_1.Api.messages.SendVote({
            peer: this.inputChat,
            msgId: this.id,
            options
          }));
        }
        if (!await this.getButtons()) {
          return;
        }
        function findButton(self2) {
          if (!self2._buttonsFlat || !self2._buttons) {
            return;
          }
          if (Array.isArray(i)) {
            i = i[0];
          }
          if (text != void 0) {
            if (typeof text == "function") {
              for (const button2 of self2._buttonsFlat) {
                if (text(button2.text)) {
                  return button2;
                }
              }
            } else {
              for (const button2 of self2._buttonsFlat) {
                if (button2.text == text) {
                  return button2;
                }
              }
            }
            return;
          }
          if (filter != void 0) {
            for (const button2 of self2._buttonsFlat) {
              if (filter(button2)) {
                return button2;
              }
            }
            return;
          }
          if (i == void 0) {
            i = 0;
          }
          if (j == void 0) {
            return self2._buttonsFlat[i];
          } else {
            return self2._buttons[i][j];
          }
        }
        const button = findButton(this);
        if (button) {
          return await button.click({
            sharePhone,
            shareGeo,
            password
          });
        }
      }
      /**
       * Helper methods to set the buttons given the input sender and chat.
       */
      _setButtons(chat, bot) {
        if (this.client && (this.replyMarkup instanceof api_1.Api.ReplyInlineMarkup || this.replyMarkup instanceof api_1.Api.ReplyKeyboardMarkup)) {
          this._buttons = [];
          this._buttonsFlat = [];
          for (const row of this.replyMarkup.rows) {
            const tmp = [];
            for (const button of row.buttons) {
              const btn = new messageButton_1.MessageButton(this.client, button, chat, bot, this.id);
              tmp.push(btn);
              this._buttonsFlat.push(btn);
            }
            this._buttons.push(tmp);
          }
        }
      }
      /**
           *Returns the input peer of the bot that's needed for the reply markup.
      
           This is necessary for `KeyboardButtonSwitchInline` since we need
           to know what bot we want to start. Raises ``Error`` if the bot
           cannot be found but is needed. Returns `None` if it's not needed.
           */
      _neededMarkupBot() {
        if (!this.client || this.replyMarkup == void 0) {
          return;
        }
        if (!(this.replyMarkup instanceof api_1.Api.ReplyInlineMarkup || this.replyMarkup instanceof api_1.Api.ReplyKeyboardMarkup)) {
          return;
        }
        for (const row of this.replyMarkup.rows) {
          for (const button of row.buttons) {
            if (button instanceof api_1.Api.KeyboardButtonSwitchInline) {
              if (button.samePeer || !this.viaBotId) {
                const bot = this._inputSender;
                if (!bot)
                  throw new Error("No input sender");
                return bot;
              } else {
                const ent = this.client._entityCache.get(this.viaBotId);
                if (!ent)
                  throw new Error("No input sender");
                return ent;
              }
            }
          }
        }
      }
      // TODO fix this
      _documentByAttribute(kind, condition) {
        const doc = this.document;
        if (doc) {
          for (const attr of doc.attributes) {
            if (attr instanceof kind) {
              if (condition == void 0 || typeof condition == "function" && condition(attr)) {
                return doc;
              }
              return void 0;
            }
          }
        }
      }
    };
    exports2.CustomMessage = CustomMessage;
  }
});

// node_modules/telegram/tl/patched/index.js
var require_patched = __commonJS({
  "node_modules/telegram/tl/patched/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.patchAll = void 0;
    var api_1 = require_api();
    var message_1 = require_message();
    function getGetter(obj2, prop) {
      while (obj2) {
        let getter = Object.getOwnPropertyDescriptor(obj2, prop);
        if (getter && getter.get) {
          return getter.get;
        }
        obj2 = Object.getPrototypeOf(obj2);
      }
    }
    function getSetter(obj2, prop) {
      while (obj2) {
        let getter = Object.getOwnPropertyDescriptor(obj2, prop);
        if (getter && getter.set) {
          return getter.set;
        }
        obj2 = Object.getPrototypeOf(obj2);
      }
    }
    var getInstanceMethods = (obj2) => {
      let keys = {
        methods: /* @__PURE__ */ new Set(),
        setters: /* @__PURE__ */ new Set(),
        getters: /* @__PURE__ */ new Set()
      };
      let topObject = obj2;
      const mapAllMethods = (property) => {
        const getter = getGetter(topObject, property);
        const setter = getSetter(topObject, property);
        if (getter) {
          keys["getters"].add(property);
        } else if (setter) {
          keys["setters"].add(property);
        } else {
          if (!(property == "constructor")) {
            keys["methods"].add(property);
          }
        }
      };
      do {
        Object.getOwnPropertyNames(obj2).map(mapAllMethods);
        obj2 = Object.getPrototypeOf(obj2);
      } while (
        // not the the Object prototype methods (hasOwnProperty, etc...)
        obj2 && Object.getPrototypeOf(obj2)
      );
      return keys;
    };
    function patchClass(clazz) {
      const { getters, setters, methods } = getInstanceMethods(message_1.CustomMessage.prototype);
      for (const getter of getters) {
        Object.defineProperty(clazz.prototype, getter, {
          get: getGetter(message_1.CustomMessage.prototype, getter)
        });
      }
      for (const setter of setters) {
        Object.defineProperty(clazz.prototype, setter, {
          set: getSetter(message_1.CustomMessage.prototype, setter)
        });
      }
      for (const method of methods) {
        clazz.prototype[method] = message_1.CustomMessage.prototype[method];
      }
    }
    function patchAll() {
      patchClass(api_1.Api.Message);
      patchClass(api_1.Api.MessageService);
    }
    exports2.patchAll = patchAll;
  }
});

// node_modules/telegram/tl/index.js
var require_tl = __commonJS({
  "node_modules/telegram/tl/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.serializeDate = exports2.serializeBytes = exports2.Api = void 0;
    var api_1 = require_api();
    Object.defineProperty(exports2, "Api", { enumerable: true, get: function() {
      return api_1.Api;
    } });
    var patched_1 = require_patched();
    (0, patched_1.patchAll)();
    var generationHelpers_1 = require_generationHelpers();
    Object.defineProperty(exports2, "serializeBytes", { enumerable: true, get: function() {
      return generationHelpers_1.serializeBytes;
    } });
    Object.defineProperty(exports2, "serializeDate", { enumerable: true, get: function() {
      return generationHelpers_1.serializeDate;
    } });
  }
});

// node_modules/telegram/extensions/BinaryWriter.js
var require_BinaryWriter = __commonJS({
  "node_modules/telegram/extensions/BinaryWriter.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.BinaryWriter = void 0;
    var BinaryWriter = class {
      constructor(stream) {
        this._buffers = [stream];
      }
      write(buffer) {
        this._buffers.push(buffer);
      }
      getValue() {
        return Buffer.concat(this._buffers);
      }
    };
    exports2.BinaryWriter = BinaryWriter;
  }
});

// node_modules/ts-custom-error/dist/custom-error.js
var require_custom_error = __commonJS({
  "node_modules/ts-custom-error/dist/custom-error.js"(exports2) {
    function fixProto(target, prototype) {
      var setPrototypeOf = Object.setPrototypeOf;
      setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;
    }
    function fixStack(target, fn2) {
      if (fn2 === void 0) {
        fn2 = target.constructor;
      }
      var captureStackTrace = Error.captureStackTrace;
      captureStackTrace && captureStackTrace(target, fn2);
    }
    var __extends2 = function() {
      var _extendStatics = function extendStatics2(d, b) {
        _extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d2, b2) {
          d2.__proto__ = b2;
        } || function(d2, b2) {
          for (var p in b2) {
            if (Object.prototype.hasOwnProperty.call(b2, p))
              d2[p] = b2[p];
          }
        };
        return _extendStatics(d, b);
      };
      return function(d, b) {
        if (typeof b !== "function" && b !== null)
          throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        _extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var CustomError = function(_super) {
      __extends2(CustomError2, _super);
      function CustomError2(message, options) {
        var _newTarget = this.constructor;
        var _this = _super.call(this, message, options) || this;
        Object.defineProperty(_this, "name", {
          value: _newTarget.name,
          enumerable: false,
          configurable: true
        });
        fixProto(_this, _newTarget.prototype);
        fixStack(_this);
        return _this;
      }
      return CustomError2;
    }(Error);
    var __spreadArray2 = function(to, from, pack) {
      if (pack || arguments.length === 2)
        for (var i = 0, l = from.length, ar; i < l; i++) {
          if (ar || !(i in from)) {
            if (!ar)
              ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
          }
        }
      return to.concat(ar || Array.prototype.slice.call(from));
    };
    function customErrorFactory(fn2, parent) {
      if (parent === void 0) {
        parent = Error;
      }
      function CustomError2() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        if (!(this instanceof CustomError2))
          return new (CustomError2.bind.apply(CustomError2, __spreadArray2([void 0], args, false)))();
        parent.apply(this, args);
        Object.defineProperty(this, "name", {
          value: fn2.name || parent.name,
          enumerable: false,
          configurable: true
        });
        fn2.apply(this, args);
        fixStack(this, CustomError2);
      }
      return Object.defineProperties(CustomError2, {
        prototype: {
          value: Object.create(parent.prototype, {
            constructor: {
              value: CustomError2,
              writable: true,
              configurable: true
            }
          })
        }
      });
    }
    exports2.CustomError = CustomError;
    exports2.customErrorFactory = customErrorFactory;
  }
});

// node_modules/telegram/errors/RPCBaseErrors.js
var require_RPCBaseErrors = __commonJS({
  "node_modules/telegram/errors/RPCBaseErrors.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.TimedOutError = exports2.ServerError = exports2.FloodError = exports2.AuthKeyError = exports2.NotFoundError = exports2.ForbiddenError = exports2.UnauthorizedError = exports2.BadRequestError = exports2.InvalidDCError = exports2.RPCError = void 0;
    var ts_custom_error_1 = require_custom_error();
    var RPCError = class extends ts_custom_error_1.CustomError {
      constructor(message, request, code) {
        super("{0}: {1}{2}".replace("{0}", (code === null || code === void 0 ? void 0 : code.toString()) || "").replace("{1}", message || "").replace("{2}", RPCError._fmtRequest(request)));
        this.code = code;
        this.errorMessage = message;
      }
      static _fmtRequest(request) {
        if (request) {
          return ` (caused by ${request.className})`;
        } else {
          return "";
        }
      }
    };
    exports2.RPCError = RPCError;
    var InvalidDCError = class extends RPCError {
      constructor(message, request, code) {
        super(message, request, code);
        this.code = code || 303;
        this.errorMessage = message || "ERROR_SEE_OTHER";
      }
    };
    exports2.InvalidDCError = InvalidDCError;
    var BadRequestError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 400;
        this.errorMessage = "BAD_REQUEST";
      }
    };
    exports2.BadRequestError = BadRequestError;
    var UnauthorizedError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 401;
        this.errorMessage = "UNAUTHORIZED";
      }
    };
    exports2.UnauthorizedError = UnauthorizedError;
    var ForbiddenError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 403;
        this.errorMessage = "FORBIDDEN";
      }
    };
    exports2.ForbiddenError = ForbiddenError;
    var NotFoundError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 404;
        this.errorMessage = "NOT_FOUND";
      }
    };
    exports2.NotFoundError = NotFoundError;
    var AuthKeyError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 406;
        this.errorMessage = "AUTH_KEY";
      }
    };
    exports2.AuthKeyError = AuthKeyError;
    var FloodError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 420;
        this.errorMessage = "FLOOD";
      }
    };
    exports2.FloodError = FloodError;
    var ServerError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 500;
        this.errorMessage = "INTERNAL";
      }
    };
    exports2.ServerError = ServerError;
    var TimedOutError = class extends RPCError {
      constructor() {
        super(...arguments);
        this.code = 503;
        this.errorMessage = "Timeout";
      }
    };
    exports2.TimedOutError = TimedOutError;
  }
});

// node_modules/telegram/errors/RPCErrorList.js
var require_RPCErrorList = __commonJS({
  "node_modules/telegram/errors/RPCErrorList.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.rpcErrorRe = exports2.MsgWaitError = exports2.EmailUnconfirmedError = exports2.NetworkMigrateError = exports2.FileMigrateError = exports2.FloodTestPhoneWaitError = exports2.FloodWaitError = exports2.SlowModeWaitError = exports2.PhoneMigrateError = exports2.UserMigrateError = void 0;
    var RPCBaseErrors_1 = require_RPCBaseErrors();
    var UserMigrateError = class extends RPCBaseErrors_1.InvalidDCError {
      constructor(args) {
        const newDc = Number(args.capture || 0);
        super(`The user whose identity is being used to execute queries is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `The user whose identity is being used to execute queries is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.newDc = newDc;
      }
    };
    exports2.UserMigrateError = UserMigrateError;
    var PhoneMigrateError = class extends RPCBaseErrors_1.InvalidDCError {
      constructor(args) {
        const newDc = Number(args.capture || 0);
        super(`The phone number a user is trying to use for authorization is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `The phone number a user is trying to use for authorization is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.newDc = newDc;
      }
    };
    exports2.PhoneMigrateError = PhoneMigrateError;
    var SlowModeWaitError = class extends RPCBaseErrors_1.FloodError {
      constructor(args) {
        const seconds = Number(args.capture || 0);
        super(`A wait of ${seconds} seconds is required before sending another message in this chat` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `A wait of ${seconds} seconds is required before sending another message in this chat` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.seconds = seconds;
      }
    };
    exports2.SlowModeWaitError = SlowModeWaitError;
    var FloodWaitError = class extends RPCBaseErrors_1.FloodError {
      constructor(args) {
        const seconds = Number(args.capture || 0);
        super(`A wait of ${seconds} seconds is required` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `A wait of ${seconds} seconds is required` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.seconds = seconds;
      }
    };
    exports2.FloodWaitError = FloodWaitError;
    var FloodTestPhoneWaitError = class extends RPCBaseErrors_1.FloodError {
      constructor(args) {
        const seconds = Number(args.capture || 0);
        super(`A wait of ${seconds} seconds is required in the test servers` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `A wait of ${seconds} seconds is required in the test servers` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.seconds = seconds;
      }
    };
    exports2.FloodTestPhoneWaitError = FloodTestPhoneWaitError;
    var FileMigrateError = class extends RPCBaseErrors_1.InvalidDCError {
      constructor(args) {
        const newDc = Number(args.capture || 0);
        super(`The file to be accessed is currently stored in DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `The file to be accessed is currently stored in DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.newDc = newDc;
      }
    };
    exports2.FileMigrateError = FileMigrateError;
    var NetworkMigrateError = class extends RPCBaseErrors_1.InvalidDCError {
      constructor(args) {
        const newDc = Number(args.capture || 0);
        super(`The source IP address is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);
        this.message = `The source IP address is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);
        this.newDc = newDc;
      }
    };
    exports2.NetworkMigrateError = NetworkMigrateError;
    var EmailUnconfirmedError = class extends RPCBaseErrors_1.BadRequestError {
      constructor(args) {
        const codeLength = Number(args.capture || 0);
        super(`Email unconfirmed, the length of the code must be ${codeLength}${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`, args.request, 400);
        this.message = `Email unconfirmed, the length of the code must be ${codeLength}${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`;
        this.codeLength = codeLength;
      }
    };
    exports2.EmailUnconfirmedError = EmailUnconfirmedError;
    var MsgWaitError = class extends RPCBaseErrors_1.FloodError {
      constructor(args) {
        super(`Message failed to be sent.${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`, args.request);
        this.message = `Message failed to be sent.${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`;
      }
    };
    exports2.MsgWaitError = MsgWaitError;
    exports2.rpcErrorRe = /* @__PURE__ */ new Map([
      [/FILE_MIGRATE_(\d+)/, FileMigrateError],
      [/FLOOD_TEST_PHONE_WAIT_(\d+)/, FloodTestPhoneWaitError],
      [/FLOOD_WAIT_(\d+)/, FloodWaitError],
      [/FLOOD_PREMIUM_WAIT_(\d+)/, FloodWaitError],
      [/MSG_WAIT_(.*)/, MsgWaitError],
      [/PHONE_MIGRATE_(\d+)/, PhoneMigrateError],
      [/SLOWMODE_WAIT_(\d+)/, SlowModeWaitError],
      [/USER_MIGRATE_(\d+)/, UserMigrateError],
      [/NETWORK_MIGRATE_(\d+)/, NetworkMigrateError],
      [/EMAIL_UNCONFIRMED_(\d+)/, EmailUnconfirmedError]
    ]);
  }
});

// node_modules/telegram/errors/Common.js
var require_Common = __commonJS({
  "node_modules/telegram/errors/Common.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.BadMessageError = exports2.CdnFileTamperedError = exports2.SecurityError = exports2.InvalidBufferError = exports2.InvalidChecksumError = exports2.TypeNotFoundError = exports2.ReadCancelledError = void 0;
    var ReadCancelledError = class extends Error {
      constructor() {
        super("The read operation was cancelled.");
      }
    };
    exports2.ReadCancelledError = ReadCancelledError;
    var TypeNotFoundError = class extends Error {
      constructor(invalidConstructorId, remaining) {
        super(`Could not find a matching Constructor ID for the TLObject that was supposed to be
        read with ID ${invalidConstructorId}. Most likely, a TLObject was trying to be read when
         it should not be read. Remaining bytes: ${remaining.length}`);
        if (typeof alert !== "undefined") {
          alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${invalidConstructorId}`);
        }
        this.invalidConstructorId = invalidConstructorId;
        this.remaining = remaining;
      }
    };
    exports2.TypeNotFoundError = TypeNotFoundError;
    var InvalidChecksumError = class extends Error {
      constructor(checksum, validChecksum) {
        super(`Invalid checksum (${checksum} when ${validChecksum} was expected). This packet should be skipped.`);
        this.checksum = checksum;
        this.validChecksum = validChecksum;
      }
    };
    exports2.InvalidChecksumError = InvalidChecksumError;
    var InvalidBufferError = class extends Error {
      constructor(payload) {
        let code = void 0;
        if (payload.length === 4) {
          code = -payload.readInt32LE(0);
          super(`Invalid response buffer (HTTP code ${code})`);
        } else {
          super(`Invalid response buffer (too short ${payload})`);
        }
        this.code = code;
        this.payload = payload;
      }
    };
    exports2.InvalidBufferError = InvalidBufferError;
    var SecurityError = class extends Error {
      constructor(...args) {
        if (!args.length) {
          args = ["A security check failed."];
        }
        super(...args);
      }
    };
    exports2.SecurityError = SecurityError;
    var CdnFileTamperedError = class extends SecurityError {
      constructor() {
        super("The CDN file has been altered and its download cancelled.");
      }
    };
    exports2.CdnFileTamperedError = CdnFileTamperedError;
    var BadMessageError = class extends Error {
      constructor(request, code) {
        let errorMessage = BadMessageError.ErrorMessages[code] || `Unknown error code (this should not happen): ${code}.`;
        errorMessage += `  Caused by ${request.className}`;
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.code = code;
      }
    };
    exports2.BadMessageError = BadMessageError;
    BadMessageError.ErrorMessages = {
      16: "msg_id too low (most likely, client time is wrong it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the \u201Ccorrect\u201D msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted).",
      17: "msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id).",
      18: "Incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4).",
      19: "Container msg_id is the same as msg_id of a previously received message (this must never happen).",
      20: "Message too old, and it cannot be verified whether the server has received a message with this msg_id or not.",
      32: "msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno).",
      33: "msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno).",
      34: "An even msg_seqno expected (irrelevant message), but odd received.",
      35: "Odd msg_seqno expected (relevant message), but even received.",
      48: "Incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it).",
      64: "Invalid container."
    };
  }
});

// node_modules/telegram/errors/index.js
var require_errors = __commonJS({
  "node_modules/telegram/errors/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RPCMessageToError = void 0;
    var RPCBaseErrors_1 = require_RPCBaseErrors();
    var RPCErrorList_1 = require_RPCErrorList();
    function RPCMessageToError(rpcError, request) {
      for (const [msgRegex, Cls] of RPCErrorList_1.rpcErrorRe) {
        const m = rpcError.errorMessage.match(msgRegex);
        if (m) {
          const capture = m.length === 2 ? parseInt(m[1]) : null;
          return new Cls({ request, capture });
        }
      }
      return new RPCBaseErrors_1.RPCError(rpcError.errorMessage, request, rpcError.errorCode);
    }
    exports2.RPCMessageToError = RPCMessageToError;
    __exportStar2(require_Common(), exports2);
    __exportStar2(require_RPCBaseErrors(), exports2);
    __exportStar2(require_RPCErrorList(), exports2);
  }
});

// node_modules/telegram/tl/core/TLMessage.js
var require_TLMessage = __commonJS({
  "node_modules/telegram/tl/core/TLMessage.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.TLMessage = void 0;
    var TLMessage = class {
      constructor(msgId, seqNo, obj2) {
        this.msgId = msgId;
        this.seqNo = seqNo;
        this.obj = obj2;
        this.classType = "constructor";
      }
    };
    exports2.TLMessage = TLMessage;
    TLMessage.SIZE_OVERHEAD = 12;
    TLMessage.classType = "constructor";
  }
});

// node_modules/telegram/tl/core/RPCResult.js
var require_RPCResult = __commonJS({
  "node_modules/telegram/tl/core/RPCResult.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RPCResult = void 0;
    var api_1 = require_api();
    var _1 = require_core();
    var RPCResult = class {
      constructor(reqMsgId, body, error) {
        this.CONSTRUCTOR_ID = 4082920705;
        this.reqMsgId = reqMsgId;
        this.body = body;
        this.error = error;
        this.classType = "constructor";
      }
      static async fromReader(reader) {
        const msgId = reader.readLong();
        const innerCode = reader.readInt(false);
        if (innerCode === api_1.Api.RpcError.CONSTRUCTOR_ID) {
          return new RPCResult(msgId, void 0, api_1.Api.RpcError.fromReader(reader));
        }
        if (innerCode === _1.GZIPPacked.CONSTRUCTOR_ID) {
          return new RPCResult(msgId, (await _1.GZIPPacked.fromReader(reader)).data);
        }
        reader.seek(-4);
        return new RPCResult(msgId, reader.read(), void 0);
      }
    };
    exports2.RPCResult = RPCResult;
    RPCResult.CONSTRUCTOR_ID = 4082920705;
    RPCResult.classType = "constructor";
  }
});

// node_modules/telegram/tl/core/MessageContainer.js
var require_MessageContainer = __commonJS({
  "node_modules/telegram/tl/core/MessageContainer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MessageContainer = void 0;
    var TLMessage_1 = require_TLMessage();
    var MessageContainer = class {
      constructor(messages) {
        this.CONSTRUCTOR_ID = 1945237724;
        this.messages = messages;
        this.classType = "constructor";
      }
      static async fromReader(reader) {
        const messages = [];
        const length = reader.readInt();
        for (let x = 0; x < length; x++) {
          const msgId = reader.readLong();
          const seqNo = reader.readInt();
          const length2 = reader.readInt();
          const before = reader.tellPosition();
          const obj2 = reader.tgReadObject();
          reader.setPosition(before + length2);
          const tlMessage = new TLMessage_1.TLMessage(msgId, seqNo, obj2);
          messages.push(tlMessage);
        }
        return new MessageContainer(messages);
      }
    };
    exports2.MessageContainer = MessageContainer;
    MessageContainer.CONSTRUCTOR_ID = 1945237724;
    MessageContainer.classType = "constructor";
    MessageContainer.MAXIMUM_SIZE = 1044456 - 8;
    MessageContainer.MAXIMUM_LENGTH = 100;
  }
});

// node_modules/pako/lib/zlib/trees.js
var require_trees = __commonJS({
  "node_modules/pako/lib/zlib/trees.js"(exports2, module2) {
    "use strict";
    var Z_FIXED = 4;
    var Z_BINARY = 0;
    var Z_TEXT = 1;
    var Z_UNKNOWN = 2;
    function zero(buf) {
      let len = buf.length;
      while (--len >= 0) {
        buf[len] = 0;
      }
    }
    var STORED_BLOCK = 0;
    var STATIC_TREES = 1;
    var DYN_TREES = 2;
    var MIN_MATCH = 3;
    var MAX_MATCH = 258;
    var LENGTH_CODES = 29;
    var LITERALS = 256;
    var L_CODES = LITERALS + 1 + LENGTH_CODES;
    var D_CODES = 30;
    var BL_CODES = 19;
    var HEAP_SIZE = 2 * L_CODES + 1;
    var MAX_BITS = 15;
    var Buf_size = 16;
    var MAX_BL_BITS = 7;
    var END_BLOCK = 256;
    var REP_3_6 = 16;
    var REPZ_3_10 = 17;
    var REPZ_11_138 = 18;
    var extra_lbits = (
      /* extra bits for each length code */
      new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0])
    );
    var extra_dbits = (
      /* extra bits for each distance code */
      new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13])
    );
    var extra_blbits = (
      /* extra bits for each bit length code */
      new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7])
    );
    var bl_order = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
    var DIST_CODE_LEN = 512;
    var static_ltree = new Array((L_CODES + 2) * 2);
    zero(static_ltree);
    var static_dtree = new Array(D_CODES * 2);
    zero(static_dtree);
    var _dist_code = new Array(DIST_CODE_LEN);
    zero(_dist_code);
    var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
    zero(_length_code);
    var base_length = new Array(LENGTH_CODES);
    zero(base_length);
    var base_dist = new Array(D_CODES);
    zero(base_dist);
    function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
      this.static_tree = static_tree;
      this.extra_bits = extra_bits;
      this.extra_base = extra_base;
      this.elems = elems;
      this.max_length = max_length;
      this.has_stree = static_tree && static_tree.length;
    }
    var static_l_desc;
    var static_d_desc;
    var static_bl_desc;
    function TreeDesc(dyn_tree, stat_desc) {
      this.dyn_tree = dyn_tree;
      this.max_code = 0;
      this.stat_desc = stat_desc;
    }
    var d_code = (dist) => {
      return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
    };
    var put_short = (s, w) => {
      s.pending_buf[s.pending++] = w & 255;
      s.pending_buf[s.pending++] = w >>> 8 & 255;
    };
    var send_bits = (s, value, length) => {
      if (s.bi_valid > Buf_size - length) {
        s.bi_buf |= value << s.bi_valid & 65535;
        put_short(s, s.bi_buf);
        s.bi_buf = value >> Buf_size - s.bi_valid;
        s.bi_valid += length - Buf_size;
      } else {
        s.bi_buf |= value << s.bi_valid & 65535;
        s.bi_valid += length;
      }
    };
    var send_code = (s, c, tree) => {
      send_bits(
        s,
        tree[c * 2],
        tree[c * 2 + 1]
        /*.Len*/
      );
    };
    var bi_reverse = (code, len) => {
      let res = 0;
      do {
        res |= code & 1;
        code >>>= 1;
        res <<= 1;
      } while (--len > 0);
      return res >>> 1;
    };
    var bi_flush = (s) => {
      if (s.bi_valid === 16) {
        put_short(s, s.bi_buf);
        s.bi_buf = 0;
        s.bi_valid = 0;
      } else if (s.bi_valid >= 8) {
        s.pending_buf[s.pending++] = s.bi_buf & 255;
        s.bi_buf >>= 8;
        s.bi_valid -= 8;
      }
    };
    var gen_bitlen = (s, desc) => {
      const tree = desc.dyn_tree;
      const max_code = desc.max_code;
      const stree = desc.stat_desc.static_tree;
      const has_stree = desc.stat_desc.has_stree;
      const extra = desc.stat_desc.extra_bits;
      const base = desc.stat_desc.extra_base;
      const max_length = desc.stat_desc.max_length;
      let h;
      let n, m;
      let bits;
      let xbits;
      let f2;
      let overflow = 0;
      for (bits = 0; bits <= MAX_BITS; bits++) {
        s.bl_count[bits] = 0;
      }
      tree[s.heap[s.heap_max] * 2 + 1] = 0;
      for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
        n = s.heap[h];
        bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
        if (bits > max_length) {
          bits = max_length;
          overflow++;
        }
        tree[n * 2 + 1] = bits;
        if (n > max_code) {
          continue;
        }
        s.bl_count[bits]++;
        xbits = 0;
        if (n >= base) {
          xbits = extra[n - base];
        }
        f2 = tree[n * 2];
        s.opt_len += f2 * (bits + xbits);
        if (has_stree) {
          s.static_len += f2 * (stree[n * 2 + 1] + xbits);
        }
      }
      if (overflow === 0) {
        return;
      }
      do {
        bits = max_length - 1;
        while (s.bl_count[bits] === 0) {
          bits--;
        }
        s.bl_count[bits]--;
        s.bl_count[bits + 1] += 2;
        s.bl_count[max_length]--;
        overflow -= 2;
      } while (overflow > 0);
      for (bits = max_length; bits !== 0; bits--) {
        n = s.bl_count[bits];
        while (n !== 0) {
          m = s.heap[--h];
          if (m > max_code) {
            continue;
          }
          if (tree[m * 2 + 1] !== bits) {
            s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
            tree[m * 2 + 1] = bits;
          }
          n--;
        }
      }
    };
    var gen_codes = (tree, max_code, bl_count) => {
      const next_code = new Array(MAX_BITS + 1);
      let code = 0;
      let bits;
      let n;
      for (bits = 1; bits <= MAX_BITS; bits++) {
        code = code + bl_count[bits - 1] << 1;
        next_code[bits] = code;
      }
      for (n = 0; n <= max_code; n++) {
        let len = tree[n * 2 + 1];
        if (len === 0) {
          continue;
        }
        tree[n * 2] = bi_reverse(next_code[len]++, len);
      }
    };
    var tr_static_init = () => {
      let n;
      let bits;
      let length;
      let code;
      let dist;
      const bl_count = new Array(MAX_BITS + 1);
      length = 0;
      for (code = 0; code < LENGTH_CODES - 1; code++) {
        base_length[code] = length;
        for (n = 0; n < 1 << extra_lbits[code]; n++) {
          _length_code[length++] = code;
        }
      }
      _length_code[length - 1] = code;
      dist = 0;
      for (code = 0; code < 16; code++) {
        base_dist[code] = dist;
        for (n = 0; n < 1 << extra_dbits[code]; n++) {
          _dist_code[dist++] = code;
        }
      }
      dist >>= 7;
      for (; code < D_CODES; code++) {
        base_dist[code] = dist << 7;
        for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {
          _dist_code[256 + dist++] = code;
        }
      }
      for (bits = 0; bits <= MAX_BITS; bits++) {
        bl_count[bits] = 0;
      }
      n = 0;
      while (n <= 143) {
        static_ltree[n * 2 + 1] = 8;
        n++;
        bl_count[8]++;
      }
      while (n <= 255) {
        static_ltree[n * 2 + 1] = 9;
        n++;
        bl_count[9]++;
      }
      while (n <= 279) {
        static_ltree[n * 2 + 1] = 7;
        n++;
        bl_count[7]++;
      }
      while (n <= 287) {
        static_ltree[n * 2 + 1] = 8;
        n++;
        bl_count[8]++;
      }
      gen_codes(static_ltree, L_CODES + 1, bl_count);
      for (n = 0; n < D_CODES; n++) {
        static_dtree[n * 2 + 1] = 5;
        static_dtree[n * 2] = bi_reverse(n, 5);
      }
      static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
      static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
      static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
    };
    var init_block = (s) => {
      let n;
      for (n = 0; n < L_CODES; n++) {
        s.dyn_ltree[n * 2] = 0;
      }
      for (n = 0; n < D_CODES; n++) {
        s.dyn_dtree[n * 2] = 0;
      }
      for (n = 0; n < BL_CODES; n++) {
        s.bl_tree[n * 2] = 0;
      }
      s.dyn_ltree[END_BLOCK * 2] = 1;
      s.opt_len = s.static_len = 0;
      s.sym_next = s.matches = 0;
    };
    var bi_windup = (s) => {
      if (s.bi_valid > 8) {
        put_short(s, s.bi_buf);
      } else if (s.bi_valid > 0) {
        s.pending_buf[s.pending++] = s.bi_buf;
      }
      s.bi_buf = 0;
      s.bi_valid = 0;
    };
    var smaller = (tree, n, m, depth) => {
      const _n2 = n * 2;
      const _m2 = m * 2;
      return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];
    };
    var pqdownheap = (s, tree, k) => {
      const v = s.heap[k];
      let j = k << 1;
      while (j <= s.heap_len) {
        if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
          j++;
        }
        if (smaller(tree, v, s.heap[j], s.depth)) {
          break;
        }
        s.heap[k] = s.heap[j];
        k = j;
        j <<= 1;
      }
      s.heap[k] = v;
    };
    var compress_block = (s, ltree, dtree) => {
      let dist;
      let lc;
      let sx = 0;
      let code;
      let extra;
      if (s.sym_next !== 0) {
        do {
          dist = s.pending_buf[s.sym_buf + sx++] & 255;
          dist += (s.pending_buf[s.sym_buf + sx++] & 255) << 8;
          lc = s.pending_buf[s.sym_buf + sx++];
          if (dist === 0) {
            send_code(s, lc, ltree);
          } else {
            code = _length_code[lc];
            send_code(s, code + LITERALS + 1, ltree);
            extra = extra_lbits[code];
            if (extra !== 0) {
              lc -= base_length[code];
              send_bits(s, lc, extra);
            }
            dist--;
            code = d_code(dist);
            send_code(s, code, dtree);
            extra = extra_dbits[code];
            if (extra !== 0) {
              dist -= base_dist[code];
              send_bits(s, dist, extra);
            }
          }
        } while (sx < s.sym_next);
      }
      send_code(s, END_BLOCK, ltree);
    };
    var build_tree = (s, desc) => {
      const tree = desc.dyn_tree;
      const stree = desc.stat_desc.static_tree;
      const has_stree = desc.stat_desc.has_stree;
      const elems = desc.stat_desc.elems;
      let n, m;
      let max_code = -1;
      let node;
      s.heap_len = 0;
      s.heap_max = HEAP_SIZE;
      for (n = 0; n < elems; n++) {
        if (tree[n * 2] !== 0) {
          s.heap[++s.heap_len] = max_code = n;
          s.depth[n] = 0;
        } else {
          tree[n * 2 + 1] = 0;
        }
      }
      while (s.heap_len < 2) {
        node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
        tree[node * 2] = 1;
        s.depth[node] = 0;
        s.opt_len--;
        if (has_stree) {
          s.static_len -= stree[node * 2 + 1];
        }
      }
      desc.max_code = max_code;
      for (n = s.heap_len >> 1; n >= 1; n--) {
        pqdownheap(s, tree, n);
      }
      node = elems;
      do {
        n = s.heap[
          1
          /*SMALLEST*/
        ];
        s.heap[
          1
          /*SMALLEST*/
        ] = s.heap[s.heap_len--];
        pqdownheap(
          s,
          tree,
          1
          /*SMALLEST*/
        );
        m = s.heap[
          1
          /*SMALLEST*/
        ];
        s.heap[--s.heap_max] = n;
        s.heap[--s.heap_max] = m;
        tree[node * 2] = tree[n * 2] + tree[m * 2];
        s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
        tree[n * 2 + 1] = tree[m * 2 + 1] = node;
        s.heap[
          1
          /*SMALLEST*/
        ] = node++;
        pqdownheap(
          s,
          tree,
          1
          /*SMALLEST*/
        );
      } while (s.heap_len >= 2);
      s.heap[--s.heap_max] = s.heap[
        1
        /*SMALLEST*/
      ];
      gen_bitlen(s, desc);
      gen_codes(tree, max_code, s.bl_count);
    };
    var scan_tree = (s, tree, max_code) => {
      let n;
      let prevlen = -1;
      let curlen;
      let nextlen = tree[0 * 2 + 1];
      let count = 0;
      let max_count = 7;
      let min_count = 4;
      if (nextlen === 0) {
        max_count = 138;
        min_count = 3;
      }
      tree[(max_code + 1) * 2 + 1] = 65535;
      for (n = 0; n <= max_code; n++) {
        curlen = nextlen;
        nextlen = tree[(n + 1) * 2 + 1];
        if (++count < max_count && curlen === nextlen) {
          continue;
        } else if (count < min_count) {
          s.bl_tree[curlen * 2] += count;
        } else if (curlen !== 0) {
          if (curlen !== prevlen) {
            s.bl_tree[curlen * 2]++;
          }
          s.bl_tree[REP_3_6 * 2]++;
        } else if (count <= 10) {
          s.bl_tree[REPZ_3_10 * 2]++;
        } else {
          s.bl_tree[REPZ_11_138 * 2]++;
        }
        count = 0;
        prevlen = curlen;
        if (nextlen === 0) {
          max_count = 138;
          min_count = 3;
        } else if (curlen === nextlen) {
          max_count = 6;
          min_count = 3;
        } else {
          max_count = 7;
          min_count = 4;
        }
      }
    };
    var send_tree = (s, tree, max_code) => {
      let n;
      let prevlen = -1;
      let curlen;
      let nextlen = tree[0 * 2 + 1];
      let count = 0;
      let max_count = 7;
      let min_count = 4;
      if (nextlen === 0) {
        max_count = 138;
        min_count = 3;
      }
      for (n = 0; n <= max_code; n++) {
        curlen = nextlen;
        nextlen = tree[(n + 1) * 2 + 1];
        if (++count < max_count && curlen === nextlen) {
          continue;
        } else if (count < min_count) {
          do {
            send_code(s, curlen, s.bl_tree);
          } while (--count !== 0);
        } else if (curlen !== 0) {
          if (curlen !== prevlen) {
            send_code(s, curlen, s.bl_tree);
            count--;
          }
          send_code(s, REP_3_6, s.bl_tree);
          send_bits(s, count - 3, 2);
        } else if (count <= 10) {
          send_code(s, REPZ_3_10, s.bl_tree);
          send_bits(s, count - 3, 3);
        } else {
          send_code(s, REPZ_11_138, s.bl_tree);
          send_bits(s, count - 11, 7);
        }
        count = 0;
        prevlen = curlen;
        if (nextlen === 0) {
          max_count = 138;
          min_count = 3;
        } else if (curlen === nextlen) {
          max_count = 6;
          min_count = 3;
        } else {
          max_count = 7;
          min_count = 4;
        }
      }
    };
    var build_bl_tree = (s) => {
      let max_blindex;
      scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
      scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
      build_tree(s, s.bl_desc);
      for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
        if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) {
          break;
        }
      }
      s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
      return max_blindex;
    };
    var send_all_trees = (s, lcodes, dcodes, blcodes) => {
      let rank;
      send_bits(s, lcodes - 257, 5);
      send_bits(s, dcodes - 1, 5);
      send_bits(s, blcodes - 4, 4);
      for (rank = 0; rank < blcodes; rank++) {
        send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);
      }
      send_tree(s, s.dyn_ltree, lcodes - 1);
      send_tree(s, s.dyn_dtree, dcodes - 1);
    };
    var detect_data_type = (s) => {
      let block_mask = 4093624447;
      let n;
      for (n = 0; n <= 31; n++, block_mask >>>= 1) {
        if (block_mask & 1 && s.dyn_ltree[n * 2] !== 0) {
          return Z_BINARY;
        }
      }
      if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) {
        return Z_TEXT;
      }
      for (n = 32; n < LITERALS; n++) {
        if (s.dyn_ltree[n * 2] !== 0) {
          return Z_TEXT;
        }
      }
      return Z_BINARY;
    };
    var static_init_done = false;
    var _tr_init = (s) => {
      if (!static_init_done) {
        tr_static_init();
        static_init_done = true;
      }
      s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
      s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
      s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
      s.bi_buf = 0;
      s.bi_valid = 0;
      init_block(s);
    };
    var _tr_stored_block = (s, buf, stored_len, last) => {
      send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);
      bi_windup(s);
      put_short(s, stored_len);
      put_short(s, ~stored_len);
      if (stored_len) {
        s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);
      }
      s.pending += stored_len;
    };
    var _tr_align = (s) => {
      send_bits(s, STATIC_TREES << 1, 3);
      send_code(s, END_BLOCK, static_ltree);
      bi_flush(s);
    };
    var _tr_flush_block = (s, buf, stored_len, last) => {
      let opt_lenb, static_lenb;
      let max_blindex = 0;
      if (s.level > 0) {
        if (s.strm.data_type === Z_UNKNOWN) {
          s.strm.data_type = detect_data_type(s);
        }
        build_tree(s, s.l_desc);
        build_tree(s, s.d_desc);
        max_blindex = build_bl_tree(s);
        opt_lenb = s.opt_len + 3 + 7 >>> 3;
        static_lenb = s.static_len + 3 + 7 >>> 3;
        if (static_lenb <= opt_lenb) {
          opt_lenb = static_lenb;
        }
      } else {
        opt_lenb = static_lenb = stored_len + 5;
      }
      if (stored_len + 4 <= opt_lenb && buf !== -1) {
        _tr_stored_block(s, buf, stored_len, last);
      } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
        send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
        compress_block(s, static_ltree, static_dtree);
      } else {
        send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
        send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
        compress_block(s, s.dyn_ltree, s.dyn_dtree);
      }
      init_block(s);
      if (last) {
        bi_windup(s);
      }
    };
    var _tr_tally = (s, dist, lc) => {
      s.pending_buf[s.sym_buf + s.sym_next++] = dist;
      s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;
      s.pending_buf[s.sym_buf + s.sym_next++] = lc;
      if (dist === 0) {
        s.dyn_ltree[lc * 2]++;
      } else {
        s.matches++;
        dist--;
        s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++;
        s.dyn_dtree[d_code(dist) * 2]++;
      }
      return s.sym_next === s.sym_end;
    };
    module2.exports._tr_init = _tr_init;
    module2.exports._tr_stored_block = _tr_stored_block;
    module2.exports._tr_flush_block = _tr_flush_block;
    module2.exports._tr_tally = _tr_tally;
    module2.exports._tr_align = _tr_align;
  }
});

// node_modules/pako/lib/zlib/adler32.js
var require_adler32 = __commonJS({
  "node_modules/pako/lib/zlib/adler32.js"(exports2, module2) {
    "use strict";
    var adler32 = (adler, buf, len, pos) => {
      let s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
      while (len !== 0) {
        n = len > 2e3 ? 2e3 : len;
        len -= n;
        do {
          s1 = s1 + buf[pos++] | 0;
          s2 = s2 + s1 | 0;
        } while (--n);
        s1 %= 65521;
        s2 %= 65521;
      }
      return s1 | s2 << 16 | 0;
    };
    module2.exports = adler32;
  }
});

// node_modules/pako/lib/zlib/crc32.js
var require_crc32 = __commonJS({
  "node_modules/pako/lib/zlib/crc32.js"(exports2, module2) {
    "use strict";
    var makeTable = () => {
      let c, table = [];
      for (var n = 0; n < 256; n++) {
        c = n;
        for (var k = 0; k < 8; k++) {
          c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
        }
        table[n] = c;
      }
      return table;
    };
    var crcTable = new Uint32Array(makeTable());
    var crc32 = (crc, buf, len, pos) => {
      const t = crcTable;
      const end2 = pos + len;
      crc ^= -1;
      for (let i = pos; i < end2; i++) {
        crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
      }
      return crc ^ -1;
    };
    module2.exports = crc32;
  }
});

// node_modules/pako/lib/zlib/messages.js
var require_messages = __commonJS({
  "node_modules/pako/lib/zlib/messages.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      2: "need dictionary",
      /* Z_NEED_DICT       2  */
      1: "stream end",
      /* Z_STREAM_END      1  */
      0: "",
      /* Z_OK              0  */
      "-1": "file error",
      /* Z_ERRNO         (-1) */
      "-2": "stream error",
      /* Z_STREAM_ERROR  (-2) */
      "-3": "data error",
      /* Z_DATA_ERROR    (-3) */
      "-4": "insufficient memory",
      /* Z_MEM_ERROR     (-4) */
      "-5": "buffer error",
      /* Z_BUF_ERROR     (-5) */
      "-6": "incompatible version"
      /* Z_VERSION_ERROR (-6) */
    };
  }
});

// node_modules/pako/lib/zlib/constants.js
var require_constants = __commonJS({
  "node_modules/pako/lib/zlib/constants.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      /* Allowed flush values; see deflate() and inflate() below for details */
      Z_NO_FLUSH: 0,
      Z_PARTIAL_FLUSH: 1,
      Z_SYNC_FLUSH: 2,
      Z_FULL_FLUSH: 3,
      Z_FINISH: 4,
      Z_BLOCK: 5,
      Z_TREES: 6,
      /* Return codes for the compression/decompression functions. Negative values
      * are errors, positive values are used for special but normal events.
      */
      Z_OK: 0,
      Z_STREAM_END: 1,
      Z_NEED_DICT: 2,
      Z_ERRNO: -1,
      Z_STREAM_ERROR: -2,
      Z_DATA_ERROR: -3,
      Z_MEM_ERROR: -4,
      Z_BUF_ERROR: -5,
      //Z_VERSION_ERROR: -6,
      /* compression levels */
      Z_NO_COMPRESSION: 0,
      Z_BEST_SPEED: 1,
      Z_BEST_COMPRESSION: 9,
      Z_DEFAULT_COMPRESSION: -1,
      Z_FILTERED: 1,
      Z_HUFFMAN_ONLY: 2,
      Z_RLE: 3,
      Z_FIXED: 4,
      Z_DEFAULT_STRATEGY: 0,
      /* Possible values of the data_type field (though see inflate()) */
      Z_BINARY: 0,
      Z_TEXT: 1,
      //Z_ASCII:                1, // = Z_TEXT (deprecated)
      Z_UNKNOWN: 2,
      /* The deflate compression method */
      Z_DEFLATED: 8
      //Z_NULL:                 null // Use -1 or null inline, depending on var type
    };
  }
});

// node_modules/pako/lib/zlib/deflate.js
var require_deflate = __commonJS({
  "node_modules/pako/lib/zlib/deflate.js"(exports2, module2) {
    "use strict";
    var { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = require_trees();
    var adler32 = require_adler32();
    var crc32 = require_crc32();
    var msg = require_messages();
    var {
      Z_NO_FLUSH,
      Z_PARTIAL_FLUSH,
      Z_FULL_FLUSH,
      Z_FINISH,
      Z_BLOCK,
      Z_OK,
      Z_STREAM_END,
      Z_STREAM_ERROR,
      Z_DATA_ERROR,
      Z_BUF_ERROR,
      Z_DEFAULT_COMPRESSION,
      Z_FILTERED,
      Z_HUFFMAN_ONLY,
      Z_RLE,
      Z_FIXED,
      Z_DEFAULT_STRATEGY,
      Z_UNKNOWN,
      Z_DEFLATED
    } = require_constants();
    var MAX_MEM_LEVEL = 9;
    var MAX_WBITS = 15;
    var DEF_MEM_LEVEL = 8;
    var LENGTH_CODES = 29;
    var LITERALS = 256;
    var L_CODES = LITERALS + 1 + LENGTH_CODES;
    var D_CODES = 30;
    var BL_CODES = 19;
    var HEAP_SIZE = 2 * L_CODES + 1;
    var MAX_BITS = 15;
    var MIN_MATCH = 3;
    var MAX_MATCH = 258;
    var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
    var PRESET_DICT = 32;
    var INIT_STATE = 42;
    var GZIP_STATE = 57;
    var EXTRA_STATE = 69;
    var NAME_STATE = 73;
    var COMMENT_STATE = 91;
    var HCRC_STATE = 103;
    var BUSY_STATE = 113;
    var FINISH_STATE = 666;
    var BS_NEED_MORE = 1;
    var BS_BLOCK_DONE = 2;
    var BS_FINISH_STARTED = 3;
    var BS_FINISH_DONE = 4;
    var OS_CODE = 3;
    var err = (strm, errorCode) => {
      strm.msg = msg[errorCode];
      return errorCode;
    };
    var rank = (f2) => {
      return f2 * 2 - (f2 > 4 ? 9 : 0);
    };
    var zero = (buf) => {
      let len = buf.length;
      while (--len >= 0) {
        buf[len] = 0;
      }
    };
    var slide_hash = (s) => {
      let n, m;
      let p;
      let wsize = s.w_size;
      n = s.hash_size;
      p = n;
      do {
        m = s.head[--p];
        s.head[p] = m >= wsize ? m - wsize : 0;
      } while (--n);
      n = wsize;
      p = n;
      do {
        m = s.prev[--p];
        s.prev[p] = m >= wsize ? m - wsize : 0;
      } while (--n);
    };
    var HASH_ZLIB = (s, prev, data) => (prev << s.hash_shift ^ data) & s.hash_mask;
    var HASH = HASH_ZLIB;
    var flush_pending = (strm) => {
      const s = strm.state;
      let len = s.pending;
      if (len > strm.avail_out) {
        len = strm.avail_out;
      }
      if (len === 0) {
        return;
      }
      strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);
      strm.next_out += len;
      s.pending_out += len;
      strm.total_out += len;
      strm.avail_out -= len;
      s.pending -= len;
      if (s.pending === 0) {
        s.pending_out = 0;
      }
    };
    var flush_block_only = (s, last) => {
      _tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);
      s.block_start = s.strstart;
      flush_pending(s.strm);
    };
    var put_byte = (s, b) => {
      s.pending_buf[s.pending++] = b;
    };
    var putShortMSB = (s, b) => {
      s.pending_buf[s.pending++] = b >>> 8 & 255;
      s.pending_buf[s.pending++] = b & 255;
    };
    var read_buf = (strm, buf, start2, size) => {
      let len = strm.avail_in;
      if (len > size) {
        len = size;
      }
      if (len === 0) {
        return 0;
      }
      strm.avail_in -= len;
      buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start2);
      if (strm.state.wrap === 1) {
        strm.adler = adler32(strm.adler, buf, len, start2);
      } else if (strm.state.wrap === 2) {
        strm.adler = crc32(strm.adler, buf, len, start2);
      }
      strm.next_in += len;
      strm.total_in += len;
      return len;
    };
    var longest_match = (s, cur_match) => {
      let chain_length = s.max_chain_length;
      let scan = s.strstart;
      let match;
      let len;
      let best_len = s.prev_length;
      let nice_match = s.nice_match;
      const limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;
      const _win = s.window;
      const wmask = s.w_mask;
      const prev = s.prev;
      const strend = s.strstart + MAX_MATCH;
      let scan_end1 = _win[scan + best_len - 1];
      let scan_end = _win[scan + best_len];
      if (s.prev_length >= s.good_match) {
        chain_length >>= 2;
      }
      if (nice_match > s.lookahead) {
        nice_match = s.lookahead;
      }
      do {
        match = cur_match;
        if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {
          continue;
        }
        scan += 2;
        match++;
        do {
        } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);
        len = MAX_MATCH - (strend - scan);
        scan = strend - MAX_MATCH;
        if (len > best_len) {
          s.match_start = cur_match;
          best_len = len;
          if (len >= nice_match) {
            break;
          }
          scan_end1 = _win[scan + best_len - 1];
          scan_end = _win[scan + best_len];
        }
      } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
      if (best_len <= s.lookahead) {
        return best_len;
      }
      return s.lookahead;
    };
    var fill_window = (s) => {
      const _w_size = s.w_size;
      let n, more, str;
      do {
        more = s.window_size - s.lookahead - s.strstart;
        if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
          s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);
          s.match_start -= _w_size;
          s.strstart -= _w_size;
          s.block_start -= _w_size;
          if (s.insert > s.strstart) {
            s.insert = s.strstart;
          }
          slide_hash(s);
          more += _w_size;
        }
        if (s.strm.avail_in === 0) {
          break;
        }
        n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
        s.lookahead += n;
        if (s.lookahead + s.insert >= MIN_MATCH) {
          str = s.strstart - s.insert;
          s.ins_h = s.window[str];
          s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);
          while (s.insert) {
            s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);
            s.prev[str & s.w_mask] = s.head[s.ins_h];
            s.head[s.ins_h] = str;
            str++;
            s.insert--;
            if (s.lookahead + s.insert < MIN_MATCH) {
              break;
            }
          }
        }
      } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
    };
    var deflate_stored = (s, flush) => {
      let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;
      let len, left2, have, last = 0;
      let used = s.strm.avail_in;
      do {
        len = 65535;
        have = s.bi_valid + 42 >> 3;
        if (s.strm.avail_out < have) {
          break;
        }
        have = s.strm.avail_out - have;
        left2 = s.strstart - s.block_start;
        if (len > left2 + s.strm.avail_in) {
          len = left2 + s.strm.avail_in;
        }
        if (len > have) {
          len = have;
        }
        if (len < min_block && (len === 0 && flush !== Z_FINISH || flush === Z_NO_FLUSH || len !== left2 + s.strm.avail_in)) {
          break;
        }
        last = flush === Z_FINISH && len === left2 + s.strm.avail_in ? 1 : 0;
        _tr_stored_block(s, 0, 0, last);
        s.pending_buf[s.pending - 4] = len;
        s.pending_buf[s.pending - 3] = len >> 8;
        s.pending_buf[s.pending - 2] = ~len;
        s.pending_buf[s.pending - 1] = ~len >> 8;
        flush_pending(s.strm);
        if (left2) {
          if (left2 > len) {
            left2 = len;
          }
          s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left2), s.strm.next_out);
          s.strm.next_out += left2;
          s.strm.avail_out -= left2;
          s.strm.total_out += left2;
          s.block_start += left2;
          len -= left2;
        }
        if (len) {
          read_buf(s.strm, s.strm.output, s.strm.next_out, len);
          s.strm.next_out += len;
          s.strm.avail_out -= len;
          s.strm.total_out += len;
        }
      } while (last === 0);
      used -= s.strm.avail_in;
      if (used) {
        if (used >= s.w_size) {
          s.matches = 2;
          s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);
          s.strstart = s.w_size;
          s.insert = s.strstart;
        } else {
          if (s.window_size - s.strstart <= used) {
            s.strstart -= s.w_size;
            s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);
            if (s.matches < 2) {
              s.matches++;
            }
            if (s.insert > s.strstart) {
              s.insert = s.strstart;
            }
          }
          s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);
          s.strstart += used;
          s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;
        }
        s.block_start = s.strstart;
      }
      if (s.high_water < s.strstart) {
        s.high_water = s.strstart;
      }
      if (last) {
        return BS_FINISH_DONE;
      }
      if (flush !== Z_NO_FLUSH && flush !== Z_FINISH && s.strm.avail_in === 0 && s.strstart === s.block_start) {
        return BS_BLOCK_DONE;
      }
      have = s.window_size - s.strstart;
      if (s.strm.avail_in > have && s.block_start >= s.w_size) {
        s.block_start -= s.w_size;
        s.strstart -= s.w_size;
        s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);
        if (s.matches < 2) {
          s.matches++;
        }
        have += s.w_size;
        if (s.insert > s.strstart) {
          s.insert = s.strstart;
        }
      }
      if (have > s.strm.avail_in) {
        have = s.strm.avail_in;
      }
      if (have) {
        read_buf(s.strm, s.window, s.strstart, have);
        s.strstart += have;
        s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;
      }
      if (s.high_water < s.strstart) {
        s.high_water = s.strstart;
      }
      have = s.bi_valid + 42 >> 3;
      have = s.pending_buf_size - have > 65535 ? 65535 : s.pending_buf_size - have;
      min_block = have > s.w_size ? s.w_size : have;
      left2 = s.strstart - s.block_start;
      if (left2 >= min_block || (left2 || flush === Z_FINISH) && flush !== Z_NO_FLUSH && s.strm.avail_in === 0 && left2 <= have) {
        len = left2 > have ? have : left2;
        last = flush === Z_FINISH && s.strm.avail_in === 0 && len === left2 ? 1 : 0;
        _tr_stored_block(s, s.block_start, len, last);
        s.block_start += len;
        flush_pending(s.strm);
      }
      return last ? BS_FINISH_STARTED : BS_NEED_MORE;
    };
    var deflate_fast = (s, flush) => {
      let hash_head;
      let bflush;
      for (; ; ) {
        if (s.lookahead < MIN_LOOKAHEAD) {
          fill_window(s);
          if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
            return BS_NEED_MORE;
          }
          if (s.lookahead === 0) {
            break;
          }
        }
        hash_head = 0;
        if (s.lookahead >= MIN_MATCH) {
          s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
        }
        if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
          s.match_length = longest_match(s, hash_head);
        }
        if (s.match_length >= MIN_MATCH) {
          bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
          s.lookahead -= s.match_length;
          if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {
            s.match_length--;
            do {
              s.strstart++;
              s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
              hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
              s.head[s.ins_h] = s.strstart;
            } while (--s.match_length !== 0);
            s.strstart++;
          } else {
            s.strstart += s.match_length;
            s.match_length = 0;
            s.ins_h = s.window[s.strstart];
            s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);
          }
        } else {
          bflush = _tr_tally(s, 0, s.window[s.strstart]);
          s.lookahead--;
          s.strstart++;
        }
        if (bflush) {
          flush_block_only(s, false);
          if (s.strm.avail_out === 0) {
            return BS_NEED_MORE;
          }
        }
      }
      s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
      if (flush === Z_FINISH) {
        flush_block_only(s, true);
        if (s.strm.avail_out === 0) {
          return BS_FINISH_STARTED;
        }
        return BS_FINISH_DONE;
      }
      if (s.sym_next) {
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
      }
      return BS_BLOCK_DONE;
    };
    var deflate_slow = (s, flush) => {
      let hash_head;
      let bflush;
      let max_insert;
      for (; ; ) {
        if (s.lookahead < MIN_LOOKAHEAD) {
          fill_window(s);
          if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
            return BS_NEED_MORE;
          }
          if (s.lookahead === 0) {
            break;
          }
        }
        hash_head = 0;
        if (s.lookahead >= MIN_MATCH) {
          s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
        }
        s.prev_length = s.match_length;
        s.prev_match = s.match_start;
        s.match_length = MIN_MATCH - 1;
        if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
          s.match_length = longest_match(s, hash_head);
          if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) {
            s.match_length = MIN_MATCH - 1;
          }
        }
        if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
          max_insert = s.strstart + s.lookahead - MIN_MATCH;
          bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
          s.lookahead -= s.prev_length - 1;
          s.prev_length -= 2;
          do {
            if (++s.strstart <= max_insert) {
              s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
              hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
              s.head[s.ins_h] = s.strstart;
            }
          } while (--s.prev_length !== 0);
          s.match_available = 0;
          s.match_length = MIN_MATCH - 1;
          s.strstart++;
          if (bflush) {
            flush_block_only(s, false);
            if (s.strm.avail_out === 0) {
              return BS_NEED_MORE;
            }
          }
        } else if (s.match_available) {
          bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);
          if (bflush) {
            flush_block_only(s, false);
          }
          s.strstart++;
          s.lookahead--;
          if (s.strm.avail_out === 0) {
            return BS_NEED_MORE;
          }
        } else {
          s.match_available = 1;
          s.strstart++;
          s.lookahead--;
        }
      }
      if (s.match_available) {
        bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);
        s.match_available = 0;
      }
      s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
      if (flush === Z_FINISH) {
        flush_block_only(s, true);
        if (s.strm.avail_out === 0) {
          return BS_FINISH_STARTED;
        }
        return BS_FINISH_DONE;
      }
      if (s.sym_next) {
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
      }
      return BS_BLOCK_DONE;
    };
    var deflate_rle = (s, flush) => {
      let bflush;
      let prev;
      let scan, strend;
      const _win = s.window;
      for (; ; ) {
        if (s.lookahead <= MAX_MATCH) {
          fill_window(s);
          if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
            return BS_NEED_MORE;
          }
          if (s.lookahead === 0) {
            break;
          }
        }
        s.match_length = 0;
        if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
          scan = s.strstart - 1;
          prev = _win[scan];
          if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
            strend = s.strstart + MAX_MATCH;
            do {
            } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);
            s.match_length = MAX_MATCH - (strend - scan);
            if (s.match_length > s.lookahead) {
              s.match_length = s.lookahead;
            }
          }
        }
        if (s.match_length >= MIN_MATCH) {
          bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);
          s.lookahead -= s.match_length;
          s.strstart += s.match_length;
          s.match_length = 0;
        } else {
          bflush = _tr_tally(s, 0, s.window[s.strstart]);
          s.lookahead--;
          s.strstart++;
        }
        if (bflush) {
          flush_block_only(s, false);
          if (s.strm.avail_out === 0) {
            return BS_NEED_MORE;
          }
        }
      }
      s.insert = 0;
      if (flush === Z_FINISH) {
        flush_block_only(s, true);
        if (s.strm.avail_out === 0) {
          return BS_FINISH_STARTED;
        }
        return BS_FINISH_DONE;
      }
      if (s.sym_next) {
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
      }
      return BS_BLOCK_DONE;
    };
    var deflate_huff = (s, flush) => {
      let bflush;
      for (; ; ) {
        if (s.lookahead === 0) {
          fill_window(s);
          if (s.lookahead === 0) {
            if (flush === Z_NO_FLUSH) {
              return BS_NEED_MORE;
            }
            break;
          }
        }
        s.match_length = 0;
        bflush = _tr_tally(s, 0, s.window[s.strstart]);
        s.lookahead--;
        s.strstart++;
        if (bflush) {
          flush_block_only(s, false);
          if (s.strm.avail_out === 0) {
            return BS_NEED_MORE;
          }
        }
      }
      s.insert = 0;
      if (flush === Z_FINISH) {
        flush_block_only(s, true);
        if (s.strm.avail_out === 0) {
          return BS_FINISH_STARTED;
        }
        return BS_FINISH_DONE;
      }
      if (s.sym_next) {
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
      }
      return BS_BLOCK_DONE;
    };
    function Config(good_length, max_lazy, nice_length, max_chain, func) {
      this.good_length = good_length;
      this.max_lazy = max_lazy;
      this.nice_length = nice_length;
      this.max_chain = max_chain;
      this.func = func;
    }
    var configuration_table = [
      /*      good lazy nice chain */
      new Config(0, 0, 0, 0, deflate_stored),
      /* 0 store only */
      new Config(4, 4, 8, 4, deflate_fast),
      /* 1 max speed, no lazy matches */
      new Config(4, 5, 16, 8, deflate_fast),
      /* 2 */
      new Config(4, 6, 32, 32, deflate_fast),
      /* 3 */
      new Config(4, 4, 16, 16, deflate_slow),
      /* 4 lazy matches */
      new Config(8, 16, 32, 32, deflate_slow),
      /* 5 */
      new Config(8, 16, 128, 128, deflate_slow),
      /* 6 */
      new Config(8, 32, 128, 256, deflate_slow),
      /* 7 */
      new Config(32, 128, 258, 1024, deflate_slow),
      /* 8 */
      new Config(32, 258, 258, 4096, deflate_slow)
      /* 9 max compression */
    ];
    var lm_init = (s) => {
      s.window_size = 2 * s.w_size;
      zero(s.head);
      s.max_lazy_match = configuration_table[s.level].max_lazy;
      s.good_match = configuration_table[s.level].good_length;
      s.nice_match = configuration_table[s.level].nice_length;
      s.max_chain_length = configuration_table[s.level].max_chain;
      s.strstart = 0;
      s.block_start = 0;
      s.lookahead = 0;
      s.insert = 0;
      s.match_length = s.prev_length = MIN_MATCH - 1;
      s.match_available = 0;
      s.ins_h = 0;
    };
    function DeflateState() {
      this.strm = null;
      this.status = 0;
      this.pending_buf = null;
      this.pending_buf_size = 0;
      this.pending_out = 0;
      this.pending = 0;
      this.wrap = 0;
      this.gzhead = null;
      this.gzindex = 0;
      this.method = Z_DEFLATED;
      this.last_flush = -1;
      this.w_size = 0;
      this.w_bits = 0;
      this.w_mask = 0;
      this.window = null;
      this.window_size = 0;
      this.prev = null;
      this.head = null;
      this.ins_h = 0;
      this.hash_size = 0;
      this.hash_bits = 0;
      this.hash_mask = 0;
      this.hash_shift = 0;
      this.block_start = 0;
      this.match_length = 0;
      this.prev_match = 0;
      this.match_available = 0;
      this.strstart = 0;
      this.match_start = 0;
      this.lookahead = 0;
      this.prev_length = 0;
      this.max_chain_length = 0;
      this.max_lazy_match = 0;
      this.level = 0;
      this.strategy = 0;
      this.good_match = 0;
      this.nice_match = 0;
      this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);
      this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);
      this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);
      zero(this.dyn_ltree);
      zero(this.dyn_dtree);
      zero(this.bl_tree);
      this.l_desc = null;
      this.d_desc = null;
      this.bl_desc = null;
      this.bl_count = new Uint16Array(MAX_BITS + 1);
      this.heap = new Uint16Array(2 * L_CODES + 1);
      zero(this.heap);
      this.heap_len = 0;
      this.heap_max = 0;
      this.depth = new Uint16Array(2 * L_CODES + 1);
      zero(this.depth);
      this.sym_buf = 0;
      this.lit_bufsize = 0;
      this.sym_next = 0;
      this.sym_end = 0;
      this.opt_len = 0;
      this.static_len = 0;
      this.matches = 0;
      this.insert = 0;
      this.bi_buf = 0;
      this.bi_valid = 0;
    }
    var deflateStateCheck = (strm) => {
      if (!strm) {
        return 1;
      }
      const s = strm.state;
      if (!s || s.strm !== strm || s.status !== INIT_STATE && //#ifdef GZIP
      s.status !== GZIP_STATE && //#endif
      s.status !== EXTRA_STATE && s.status !== NAME_STATE && s.status !== COMMENT_STATE && s.status !== HCRC_STATE && s.status !== BUSY_STATE && s.status !== FINISH_STATE) {
        return 1;
      }
      return 0;
    };
    var deflateResetKeep = (strm) => {
      if (deflateStateCheck(strm)) {
        return err(strm, Z_STREAM_ERROR);
      }
      strm.total_in = strm.total_out = 0;
      strm.data_type = Z_UNKNOWN;
      const s = strm.state;
      s.pending = 0;
      s.pending_out = 0;
      if (s.wrap < 0) {
        s.wrap = -s.wrap;
      }
      s.status = //#ifdef GZIP
      s.wrap === 2 ? GZIP_STATE : (
        //#endif
        s.wrap ? INIT_STATE : BUSY_STATE
      );
      strm.adler = s.wrap === 2 ? 0 : 1;
      s.last_flush = -2;
      _tr_init(s);
      return Z_OK;
    };
    var deflateReset = (strm) => {
      const ret2 = deflateResetKeep(strm);
      if (ret2 === Z_OK) {
        lm_init(strm.state);
      }
      return ret2;
    };
    var deflateSetHeader = (strm, head) => {
      if (deflateStateCheck(strm) || strm.state.wrap !== 2) {
        return Z_STREAM_ERROR;
      }
      strm.state.gzhead = head;
      return Z_OK;
    };
    var deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {
      if (!strm) {
        return Z_STREAM_ERROR;
      }
      let wrap = 1;
      if (level === Z_DEFAULT_COMPRESSION) {
        level = 6;
      }
      if (windowBits < 0) {
        wrap = 0;
        windowBits = -windowBits;
      } else if (windowBits > 15) {
        wrap = 2;
        windowBits -= 16;
      }
      if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED || windowBits === 8 && wrap !== 1) {
        return err(strm, Z_STREAM_ERROR);
      }
      if (windowBits === 8) {
        windowBits = 9;
      }
      const s = new DeflateState();
      strm.state = s;
      s.strm = strm;
      s.status = INIT_STATE;
      s.wrap = wrap;
      s.gzhead = null;
      s.w_bits = windowBits;
      s.w_size = 1 << s.w_bits;
      s.w_mask = s.w_size - 1;
      s.hash_bits = memLevel + 7;
      s.hash_size = 1 << s.hash_bits;
      s.hash_mask = s.hash_size - 1;
      s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
      s.window = new Uint8Array(s.w_size * 2);
      s.head = new Uint16Array(s.hash_size);
      s.prev = new Uint16Array(s.w_size);
      s.lit_bufsize = 1 << memLevel + 6;
      s.pending_buf_size = s.lit_bufsize * 4;
      s.pending_buf = new Uint8Array(s.pending_buf_size);
      s.sym_buf = s.lit_bufsize;
      s.sym_end = (s.lit_bufsize - 1) * 3;
      s.level = level;
      s.strategy = strategy;
      s.method = method;
      return deflateReset(strm);
    };
    var deflateInit = (strm, level) => {
      return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
    };
    var deflate = (strm, flush) => {
      if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
        return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
      }
      const s = strm.state;
      if (!strm.output || strm.avail_in !== 0 && !strm.input || s.status === FINISH_STATE && flush !== Z_FINISH) {
        return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);
      }
      const old_flush = s.last_flush;
      s.last_flush = flush;
      if (s.pending !== 0) {
        flush_pending(strm);
        if (strm.avail_out === 0) {
          s.last_flush = -1;
          return Z_OK;
        }
      } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) {
        return err(strm, Z_BUF_ERROR);
      }
      if (s.status === FINISH_STATE && strm.avail_in !== 0) {
        return err(strm, Z_BUF_ERROR);
      }
      if (s.status === INIT_STATE && s.wrap === 0) {
        s.status = BUSY_STATE;
      }
      if (s.status === INIT_STATE) {
        let header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8;
        let level_flags = -1;
        if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
          level_flags = 0;
        } else if (s.level < 6) {
          level_flags = 1;
        } else if (s.level === 6) {
          level_flags = 2;
        } else {
          level_flags = 3;
        }
        header |= level_flags << 6;
        if (s.strstart !== 0) {
          header |= PRESET_DICT;
        }
        header += 31 - header % 31;
        putShortMSB(s, header);
        if (s.strstart !== 0) {
          putShortMSB(s, strm.adler >>> 16);
          putShortMSB(s, strm.adler & 65535);
        }
        strm.adler = 1;
        s.status = BUSY_STATE;
        flush_pending(strm);
        if (s.pending !== 0) {
          s.last_flush = -1;
          return Z_OK;
        }
      }
      if (s.status === GZIP_STATE) {
        strm.adler = 0;
        put_byte(s, 31);
        put_byte(s, 139);
        put_byte(s, 8);
        if (!s.gzhead) {
          put_byte(s, 0);
          put_byte(s, 0);
          put_byte(s, 0);
          put_byte(s, 0);
          put_byte(s, 0);
          put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
          put_byte(s, OS_CODE);
          s.status = BUSY_STATE;
          flush_pending(strm);
          if (s.pending !== 0) {
            s.last_flush = -1;
            return Z_OK;
          }
        } else {
          put_byte(
            s,
            (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16)
          );
          put_byte(s, s.gzhead.time & 255);
          put_byte(s, s.gzhead.time >> 8 & 255);
          put_byte(s, s.gzhead.time >> 16 & 255);
          put_byte(s, s.gzhead.time >> 24 & 255);
          put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
          put_byte(s, s.gzhead.os & 255);
          if (s.gzhead.extra && s.gzhead.extra.length) {
            put_byte(s, s.gzhead.extra.length & 255);
            put_byte(s, s.gzhead.extra.length >> 8 & 255);
          }
          if (s.gzhead.hcrc) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
          }
          s.gzindex = 0;
          s.status = EXTRA_STATE;
        }
      }
      if (s.status === EXTRA_STATE) {
        if (s.gzhead.extra) {
          let beg = s.pending;
          let left2 = (s.gzhead.extra.length & 65535) - s.gzindex;
          while (s.pending + left2 > s.pending_buf_size) {
            let copy = s.pending_buf_size - s.pending;
            s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);
            s.pending = s.pending_buf_size;
            if (s.gzhead.hcrc && s.pending > beg) {
              strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
            }
            s.gzindex += copy;
            flush_pending(strm);
            if (s.pending !== 0) {
              s.last_flush = -1;
              return Z_OK;
            }
            beg = 0;
            left2 -= copy;
          }
          let gzhead_extra = new Uint8Array(s.gzhead.extra);
          s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left2), s.pending);
          s.pending += left2;
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          s.gzindex = 0;
        }
        s.status = NAME_STATE;
      }
      if (s.status === NAME_STATE) {
        if (s.gzhead.name) {
          let beg = s.pending;
          let val;
          do {
            if (s.pending === s.pending_buf_size) {
              if (s.gzhead.hcrc && s.pending > beg) {
                strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
              }
              flush_pending(strm);
              if (s.pending !== 0) {
                s.last_flush = -1;
                return Z_OK;
              }
              beg = 0;
            }
            if (s.gzindex < s.gzhead.name.length) {
              val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;
            } else {
              val = 0;
            }
            put_byte(s, val);
          } while (val !== 0);
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          s.gzindex = 0;
        }
        s.status = COMMENT_STATE;
      }
      if (s.status === COMMENT_STATE) {
        if (s.gzhead.comment) {
          let beg = s.pending;
          let val;
          do {
            if (s.pending === s.pending_buf_size) {
              if (s.gzhead.hcrc && s.pending > beg) {
                strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
              }
              flush_pending(strm);
              if (s.pending !== 0) {
                s.last_flush = -1;
                return Z_OK;
              }
              beg = 0;
            }
            if (s.gzindex < s.gzhead.comment.length) {
              val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;
            } else {
              val = 0;
            }
            put_byte(s, val);
          } while (val !== 0);
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
        }
        s.status = HCRC_STATE;
      }
      if (s.status === HCRC_STATE) {
        if (s.gzhead.hcrc) {
          if (s.pending + 2 > s.pending_buf_size) {
            flush_pending(strm);
            if (s.pending !== 0) {
              s.last_flush = -1;
              return Z_OK;
            }
          }
          put_byte(s, strm.adler & 255);
          put_byte(s, strm.adler >> 8 & 255);
          strm.adler = 0;
        }
        s.status = BUSY_STATE;
        flush_pending(strm);
        if (s.pending !== 0) {
          s.last_flush = -1;
          return Z_OK;
        }
      }
      if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {
        let bstate = s.level === 0 ? deflate_stored(s, flush) : s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);
        if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
          s.status = FINISH_STATE;
        }
        if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
          if (strm.avail_out === 0) {
            s.last_flush = -1;
          }
          return Z_OK;
        }
        if (bstate === BS_BLOCK_DONE) {
          if (flush === Z_PARTIAL_FLUSH) {
            _tr_align(s);
          } else if (flush !== Z_BLOCK) {
            _tr_stored_block(s, 0, 0, false);
            if (flush === Z_FULL_FLUSH) {
              zero(s.head);
              if (s.lookahead === 0) {
                s.strstart = 0;
                s.block_start = 0;
                s.insert = 0;
              }
            }
          }
          flush_pending(strm);
          if (strm.avail_out === 0) {
            s.last_flush = -1;
            return Z_OK;
          }
        }
      }
      if (flush !== Z_FINISH) {
        return Z_OK;
      }
      if (s.wrap <= 0) {
        return Z_STREAM_END;
      }
      if (s.wrap === 2) {
        put_byte(s, strm.adler & 255);
        put_byte(s, strm.adler >> 8 & 255);
        put_byte(s, strm.adler >> 16 & 255);
        put_byte(s, strm.adler >> 24 & 255);
        put_byte(s, strm.total_in & 255);
        put_byte(s, strm.total_in >> 8 & 255);
        put_byte(s, strm.total_in >> 16 & 255);
        put_byte(s, strm.total_in >> 24 & 255);
      } else {
        putShortMSB(s, strm.adler >>> 16);
        putShortMSB(s, strm.adler & 65535);
      }
      flush_pending(strm);
      if (s.wrap > 0) {
        s.wrap = -s.wrap;
      }
      return s.pending !== 0 ? Z_OK : Z_STREAM_END;
    };
    var deflateEnd = (strm) => {
      if (deflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      const status = strm.state.status;
      strm.state = null;
      return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
    };
    var deflateSetDictionary = (strm, dictionary) => {
      let dictLength = dictionary.length;
      if (deflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      const s = strm.state;
      const wrap = s.wrap;
      if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) {
        return Z_STREAM_ERROR;
      }
      if (wrap === 1) {
        strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
      }
      s.wrap = 0;
      if (dictLength >= s.w_size) {
        if (wrap === 0) {
          zero(s.head);
          s.strstart = 0;
          s.block_start = 0;
          s.insert = 0;
        }
        let tmpDict = new Uint8Array(s.w_size);
        tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);
        dictionary = tmpDict;
        dictLength = s.w_size;
      }
      const avail = strm.avail_in;
      const next = strm.next_in;
      const input = strm.input;
      strm.avail_in = dictLength;
      strm.next_in = 0;
      strm.input = dictionary;
      fill_window(s);
      while (s.lookahead >= MIN_MATCH) {
        let str = s.strstart;
        let n = s.lookahead - (MIN_MATCH - 1);
        do {
          s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);
          s.prev[str & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = str;
          str++;
        } while (--n);
        s.strstart = str;
        s.lookahead = MIN_MATCH - 1;
        fill_window(s);
      }
      s.strstart += s.lookahead;
      s.block_start = s.strstart;
      s.insert = s.lookahead;
      s.lookahead = 0;
      s.match_length = s.prev_length = MIN_MATCH - 1;
      s.match_available = 0;
      strm.next_in = next;
      strm.input = input;
      strm.avail_in = avail;
      s.wrap = wrap;
      return Z_OK;
    };
    module2.exports.deflateInit = deflateInit;
    module2.exports.deflateInit2 = deflateInit2;
    module2.exports.deflateReset = deflateReset;
    module2.exports.deflateResetKeep = deflateResetKeep;
    module2.exports.deflateSetHeader = deflateSetHeader;
    module2.exports.deflate = deflate;
    module2.exports.deflateEnd = deflateEnd;
    module2.exports.deflateSetDictionary = deflateSetDictionary;
    module2.exports.deflateInfo = "pako deflate (from Nodeca project)";
  }
});

// node_modules/pako/lib/utils/common.js
var require_common = __commonJS({
  "node_modules/pako/lib/utils/common.js"(exports2, module2) {
    "use strict";
    var _has = (obj2, key) => {
      return Object.prototype.hasOwnProperty.call(obj2, key);
    };
    module2.exports.assign = function(obj2) {
      const sources = Array.prototype.slice.call(arguments, 1);
      while (sources.length) {
        const source = sources.shift();
        if (!source) {
          continue;
        }
        if (typeof source !== "object") {
          throw new TypeError(source + "must be non-object");
        }
        for (const p in source) {
          if (_has(source, p)) {
            obj2[p] = source[p];
          }
        }
      }
      return obj2;
    };
    module2.exports.flattenChunks = (chunks) => {
      let len = 0;
      for (let i = 0, l = chunks.length; i < l; i++) {
        len += chunks[i].length;
      }
      const result = new Uint8Array(len);
      for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {
        let chunk = chunks[i];
        result.set(chunk, pos);
        pos += chunk.length;
      }
      return result;
    };
  }
});

// node_modules/pako/lib/utils/strings.js
var require_strings = __commonJS({
  "node_modules/pako/lib/utils/strings.js"(exports2, module2) {
    "use strict";
    var STR_APPLY_UIA_OK = true;
    try {
      String.fromCharCode.apply(null, new Uint8Array(1));
    } catch (__) {
      STR_APPLY_UIA_OK = false;
    }
    var _utf8len = new Uint8Array(256);
    for (let q2 = 0; q2 < 256; q2++) {
      _utf8len[q2] = q2 >= 252 ? 6 : q2 >= 248 ? 5 : q2 >= 240 ? 4 : q2 >= 224 ? 3 : q2 >= 192 ? 2 : 1;
    }
    _utf8len[254] = _utf8len[254] = 1;
    module2.exports.string2buf = (str) => {
      if (typeof TextEncoder === "function" && TextEncoder.prototype.encode) {
        return new TextEncoder().encode(str);
      }
      let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
      for (m_pos = 0; m_pos < str_len; m_pos++) {
        c = str.charCodeAt(m_pos);
        if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
          c2 = str.charCodeAt(m_pos + 1);
          if ((c2 & 64512) === 56320) {
            c = 65536 + (c - 55296 << 10) + (c2 - 56320);
            m_pos++;
          }
        }
        buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4;
      }
      buf = new Uint8Array(buf_len);
      for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
        c = str.charCodeAt(m_pos);
        if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
          c2 = str.charCodeAt(m_pos + 1);
          if ((c2 & 64512) === 56320) {
            c = 65536 + (c - 55296 << 10) + (c2 - 56320);
            m_pos++;
          }
        }
        if (c < 128) {
          buf[i++] = c;
        } else if (c < 2048) {
          buf[i++] = 192 | c >>> 6;
          buf[i++] = 128 | c & 63;
        } else if (c < 65536) {
          buf[i++] = 224 | c >>> 12;
          buf[i++] = 128 | c >>> 6 & 63;
          buf[i++] = 128 | c & 63;
        } else {
          buf[i++] = 240 | c >>> 18;
          buf[i++] = 128 | c >>> 12 & 63;
          buf[i++] = 128 | c >>> 6 & 63;
          buf[i++] = 128 | c & 63;
        }
      }
      return buf;
    };
    var buf2binstring = (buf, len) => {
      if (len < 65534) {
        if (buf.subarray && STR_APPLY_UIA_OK) {
          return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));
        }
      }
      let result = "";
      for (let i = 0; i < len; i++) {
        result += String.fromCharCode(buf[i]);
      }
      return result;
    };
    module2.exports.buf2string = (buf, max2) => {
      const len = max2 || buf.length;
      if (typeof TextDecoder === "function" && TextDecoder.prototype.decode) {
        return new TextDecoder().decode(buf.subarray(0, max2));
      }
      let i, out;
      const utf16buf = new Array(len * 2);
      for (out = 0, i = 0; i < len; ) {
        let c = buf[i++];
        if (c < 128) {
          utf16buf[out++] = c;
          continue;
        }
        let c_len = _utf8len[c];
        if (c_len > 4) {
          utf16buf[out++] = 65533;
          i += c_len - 1;
          continue;
        }
        c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7;
        while (c_len > 1 && i < len) {
          c = c << 6 | buf[i++] & 63;
          c_len--;
        }
        if (c_len > 1) {
          utf16buf[out++] = 65533;
          continue;
        }
        if (c < 65536) {
          utf16buf[out++] = c;
        } else {
          c -= 65536;
          utf16buf[out++] = 55296 | c >> 10 & 1023;
          utf16buf[out++] = 56320 | c & 1023;
        }
      }
      return buf2binstring(utf16buf, out);
    };
    module2.exports.utf8border = (buf, max2) => {
      max2 = max2 || buf.length;
      if (max2 > buf.length) {
        max2 = buf.length;
      }
      let pos = max2 - 1;
      while (pos >= 0 && (buf[pos] & 192) === 128) {
        pos--;
      }
      if (pos < 0) {
        return max2;
      }
      if (pos === 0) {
        return max2;
      }
      return pos + _utf8len[buf[pos]] > max2 ? pos : max2;
    };
  }
});

// node_modules/pako/lib/zlib/zstream.js
var require_zstream = __commonJS({
  "node_modules/pako/lib/zlib/zstream.js"(exports2, module2) {
    "use strict";
    function ZStream() {
      this.input = null;
      this.next_in = 0;
      this.avail_in = 0;
      this.total_in = 0;
      this.output = null;
      this.next_out = 0;
      this.avail_out = 0;
      this.total_out = 0;
      this.msg = "";
      this.state = null;
      this.data_type = 2;
      this.adler = 0;
    }
    module2.exports = ZStream;
  }
});

// node_modules/pako/lib/deflate.js
var require_deflate2 = __commonJS({
  "node_modules/pako/lib/deflate.js"(exports2, module2) {
    "use strict";
    var zlib_deflate = require_deflate();
    var utils = require_common();
    var strings = require_strings();
    var msg = require_messages();
    var ZStream = require_zstream();
    var toString = Object.prototype.toString;
    var {
      Z_NO_FLUSH,
      Z_SYNC_FLUSH,
      Z_FULL_FLUSH,
      Z_FINISH,
      Z_OK,
      Z_STREAM_END,
      Z_DEFAULT_COMPRESSION,
      Z_DEFAULT_STRATEGY,
      Z_DEFLATED
    } = require_constants();
    function Deflate(options) {
      this.options = utils.assign({
        level: Z_DEFAULT_COMPRESSION,
        method: Z_DEFLATED,
        chunkSize: 16384,
        windowBits: 15,
        memLevel: 8,
        strategy: Z_DEFAULT_STRATEGY
      }, options || {});
      let opt = this.options;
      if (opt.raw && opt.windowBits > 0) {
        opt.windowBits = -opt.windowBits;
      } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) {
        opt.windowBits += 16;
      }
      this.err = 0;
      this.msg = "";
      this.ended = false;
      this.chunks = [];
      this.strm = new ZStream();
      this.strm.avail_out = 0;
      let status = zlib_deflate.deflateInit2(
        this.strm,
        opt.level,
        opt.method,
        opt.windowBits,
        opt.memLevel,
        opt.strategy
      );
      if (status !== Z_OK) {
        throw new Error(msg[status]);
      }
      if (opt.header) {
        zlib_deflate.deflateSetHeader(this.strm, opt.header);
      }
      if (opt.dictionary) {
        let dict;
        if (typeof opt.dictionary === "string") {
          dict = strings.string2buf(opt.dictionary);
        } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
          dict = new Uint8Array(opt.dictionary);
        } else {
          dict = opt.dictionary;
        }
        status = zlib_deflate.deflateSetDictionary(this.strm, dict);
        if (status !== Z_OK) {
          throw new Error(msg[status]);
        }
        this._dict_set = true;
      }
    }
    Deflate.prototype.push = function(data, flush_mode) {
      const strm = this.strm;
      const chunkSize = this.options.chunkSize;
      let status, _flush_mode;
      if (this.ended) {
        return false;
      }
      if (flush_mode === ~~flush_mode)
        _flush_mode = flush_mode;
      else
        _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;
      if (typeof data === "string") {
        strm.input = strings.string2buf(data);
      } else if (toString.call(data) === "[object ArrayBuffer]") {
        strm.input = new Uint8Array(data);
      } else {
        strm.input = data;
      }
      strm.next_in = 0;
      strm.avail_in = strm.input.length;
      for (; ; ) {
        if (strm.avail_out === 0) {
          strm.output = new Uint8Array(chunkSize);
          strm.next_out = 0;
          strm.avail_out = chunkSize;
        }
        if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {
          this.onData(strm.output.subarray(0, strm.next_out));
          strm.avail_out = 0;
          continue;
        }
        status = zlib_deflate.deflate(strm, _flush_mode);
        if (status === Z_STREAM_END) {
          if (strm.next_out > 0) {
            this.onData(strm.output.subarray(0, strm.next_out));
          }
          status = zlib_deflate.deflateEnd(this.strm);
          this.onEnd(status);
          this.ended = true;
          return status === Z_OK;
        }
        if (strm.avail_out === 0) {
          this.onData(strm.output);
          continue;
        }
        if (_flush_mode > 0 && strm.next_out > 0) {
          this.onData(strm.output.subarray(0, strm.next_out));
          strm.avail_out = 0;
          continue;
        }
        if (strm.avail_in === 0)
          break;
      }
      return true;
    };
    Deflate.prototype.onData = function(chunk) {
      this.chunks.push(chunk);
    };
    Deflate.prototype.onEnd = function(status) {
      if (status === Z_OK) {
        this.result = utils.flattenChunks(this.chunks);
      }
      this.chunks = [];
      this.err = status;
      this.msg = this.strm.msg;
    };
    function deflate(input, options) {
      const deflator = new Deflate(options);
      deflator.push(input, true);
      if (deflator.err) {
        throw deflator.msg || msg[deflator.err];
      }
      return deflator.result;
    }
    function deflateRaw(input, options) {
      options = options || {};
      options.raw = true;
      return deflate(input, options);
    }
    function gzip(input, options) {
      options = options || {};
      options.gzip = true;
      return deflate(input, options);
    }
    module2.exports.Deflate = Deflate;
    module2.exports.deflate = deflate;
    module2.exports.deflateRaw = deflateRaw;
    module2.exports.gzip = gzip;
    module2.exports.constants = require_constants();
  }
});

// node_modules/pako/lib/zlib/inffast.js
var require_inffast = __commonJS({
  "node_modules/pako/lib/zlib/inffast.js"(exports2, module2) {
    "use strict";
    var BAD = 16209;
    var TYPE = 16191;
    module2.exports = function inflate_fast(strm, start2) {
      let _in;
      let last;
      let _out;
      let beg;
      let end2;
      let dmax;
      let wsize;
      let whave;
      let wnext;
      let s_window;
      let hold;
      let bits;
      let lcode;
      let dcode;
      let lmask;
      let dmask;
      let here;
      let op;
      let len;
      let dist;
      let from;
      let from_source;
      let input, output;
      const state = strm.state;
      _in = strm.next_in;
      input = strm.input;
      last = _in + (strm.avail_in - 5);
      _out = strm.next_out;
      output = strm.output;
      beg = _out - (start2 - strm.avail_out);
      end2 = _out + (strm.avail_out - 257);
      dmax = state.dmax;
      wsize = state.wsize;
      whave = state.whave;
      wnext = state.wnext;
      s_window = state.window;
      hold = state.hold;
      bits = state.bits;
      lcode = state.lencode;
      dcode = state.distcode;
      lmask = (1 << state.lenbits) - 1;
      dmask = (1 << state.distbits) - 1;
      top:
        do {
          if (bits < 15) {
            hold += input[_in++] << bits;
            bits += 8;
            hold += input[_in++] << bits;
            bits += 8;
          }
          here = lcode[hold & lmask];
          dolen:
            for (; ; ) {
              op = here >>> 24;
              hold >>>= op;
              bits -= op;
              op = here >>> 16 & 255;
              if (op === 0) {
                output[_out++] = here & 65535;
              } else if (op & 16) {
                len = here & 65535;
                op &= 15;
                if (op) {
                  if (bits < op) {
                    hold += input[_in++] << bits;
                    bits += 8;
                  }
                  len += hold & (1 << op) - 1;
                  hold >>>= op;
                  bits -= op;
                }
                if (bits < 15) {
                  hold += input[_in++] << bits;
                  bits += 8;
                  hold += input[_in++] << bits;
                  bits += 8;
                }
                here = dcode[hold & dmask];
                dodist:
                  for (; ; ) {
                    op = here >>> 24;
                    hold >>>= op;
                    bits -= op;
                    op = here >>> 16 & 255;
                    if (op & 16) {
                      dist = here & 65535;
                      op &= 15;
                      if (bits < op) {
                        hold += input[_in++] << bits;
                        bits += 8;
                        if (bits < op) {
                          hold += input[_in++] << bits;
                          bits += 8;
                        }
                      }
                      dist += hold & (1 << op) - 1;
                      if (dist > dmax) {
                        strm.msg = "invalid distance too far back";
                        state.mode = BAD;
                        break top;
                      }
                      hold >>>= op;
                      bits -= op;
                      op = _out - beg;
                      if (dist > op) {
                        op = dist - op;
                        if (op > whave) {
                          if (state.sane) {
                            strm.msg = "invalid distance too far back";
                            state.mode = BAD;
                            break top;
                          }
                        }
                        from = 0;
                        from_source = s_window;
                        if (wnext === 0) {
                          from += wsize - op;
                          if (op < len) {
                            len -= op;
                            do {
                              output[_out++] = s_window[from++];
                            } while (--op);
                            from = _out - dist;
                            from_source = output;
                          }
                        } else if (wnext < op) {
                          from += wsize + wnext - op;
                          op -= wnext;
                          if (op < len) {
                            len -= op;
                            do {
                              output[_out++] = s_window[from++];
                            } while (--op);
                            from = 0;
                            if (wnext < len) {
                              op = wnext;
                              len -= op;
                              do {
                                output[_out++] = s_window[from++];
                              } while (--op);
                              from = _out - dist;
                              from_source = output;
                            }
                          }
                        } else {
                          from += wnext - op;
                          if (op < len) {
                            len -= op;
                            do {
                              output[_out++] = s_window[from++];
                            } while (--op);
                            from = _out - dist;
                            from_source = output;
                          }
                        }
                        while (len > 2) {
                          output[_out++] = from_source[from++];
                          output[_out++] = from_source[from++];
                          output[_out++] = from_source[from++];
                          len -= 3;
                        }
                        if (len) {
                          output[_out++] = from_source[from++];
                          if (len > 1) {
                            output[_out++] = from_source[from++];
                          }
                        }
                      } else {
                        from = _out - dist;
                        do {
                          output[_out++] = output[from++];
                          output[_out++] = output[from++];
                          output[_out++] = output[from++];
                          len -= 3;
                        } while (len > 2);
                        if (len) {
                          output[_out++] = output[from++];
                          if (len > 1) {
                            output[_out++] = output[from++];
                          }
                        }
                      }
                    } else if ((op & 64) === 0) {
                      here = dcode[(here & 65535) + (hold & (1 << op) - 1)];
                      continue dodist;
                    } else {
                      strm.msg = "invalid distance code";
                      state.mode = BAD;
                      break top;
                    }
                    break;
                  }
              } else if ((op & 64) === 0) {
                here = lcode[(here & 65535) + (hold & (1 << op) - 1)];
                continue dolen;
              } else if (op & 32) {
                state.mode = TYPE;
                break top;
              } else {
                strm.msg = "invalid literal/length code";
                state.mode = BAD;
                break top;
              }
              break;
            }
        } while (_in < last && _out < end2);
      len = bits >> 3;
      _in -= len;
      bits -= len << 3;
      hold &= (1 << bits) - 1;
      strm.next_in = _in;
      strm.next_out = _out;
      strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);
      strm.avail_out = _out < end2 ? 257 + (end2 - _out) : 257 - (_out - end2);
      state.hold = hold;
      state.bits = bits;
      return;
    };
  }
});

// node_modules/pako/lib/zlib/inftrees.js
var require_inftrees = __commonJS({
  "node_modules/pako/lib/zlib/inftrees.js"(exports2, module2) {
    "use strict";
    var MAXBITS = 15;
    var ENOUGH_LENS = 852;
    var ENOUGH_DISTS = 592;
    var CODES = 0;
    var LENS = 1;
    var DISTS = 2;
    var lbase = new Uint16Array([
      /* Length codes 257..285 base */
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      13,
      15,
      17,
      19,
      23,
      27,
      31,
      35,
      43,
      51,
      59,
      67,
      83,
      99,
      115,
      131,
      163,
      195,
      227,
      258,
      0,
      0
    ]);
    var lext = new Uint8Array([
      /* Length codes 257..285 extra */
      16,
      16,
      16,
      16,
      16,
      16,
      16,
      16,
      17,
      17,
      17,
      17,
      18,
      18,
      18,
      18,
      19,
      19,
      19,
      19,
      20,
      20,
      20,
      20,
      21,
      21,
      21,
      21,
      16,
      72,
      78
    ]);
    var dbase = new Uint16Array([
      /* Distance codes 0..29 base */
      1,
      2,
      3,
      4,
      5,
      7,
      9,
      13,
      17,
      25,
      33,
      49,
      65,
      97,
      129,
      193,
      257,
      385,
      513,
      769,
      1025,
      1537,
      2049,
      3073,
      4097,
      6145,
      8193,
      12289,
      16385,
      24577,
      0,
      0
    ]);
    var dext = new Uint8Array([
      /* Distance codes 0..29 extra */
      16,
      16,
      16,
      16,
      17,
      17,
      18,
      18,
      19,
      19,
      20,
      20,
      21,
      21,
      22,
      22,
      23,
      23,
      24,
      24,
      25,
      25,
      26,
      26,
      27,
      27,
      28,
      28,
      29,
      29,
      64,
      64
    ]);
    var inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) => {
      const bits = opts.bits;
      let len = 0;
      let sym = 0;
      let min2 = 0, max2 = 0;
      let root = 0;
      let curr = 0;
      let drop = 0;
      let left2 = 0;
      let used = 0;
      let huff = 0;
      let incr;
      let fill;
      let low;
      let mask;
      let next;
      let base = null;
      let match;
      const count = new Uint16Array(MAXBITS + 1);
      const offs = new Uint16Array(MAXBITS + 1);
      let extra = null;
      let here_bits, here_op, here_val;
      for (len = 0; len <= MAXBITS; len++) {
        count[len] = 0;
      }
      for (sym = 0; sym < codes; sym++) {
        count[lens[lens_index + sym]]++;
      }
      root = bits;
      for (max2 = MAXBITS; max2 >= 1; max2--) {
        if (count[max2] !== 0) {
          break;
        }
      }
      if (root > max2) {
        root = max2;
      }
      if (max2 === 0) {
        table[table_index++] = 1 << 24 | 64 << 16 | 0;
        table[table_index++] = 1 << 24 | 64 << 16 | 0;
        opts.bits = 1;
        return 0;
      }
      for (min2 = 1; min2 < max2; min2++) {
        if (count[min2] !== 0) {
          break;
        }
      }
      if (root < min2) {
        root = min2;
      }
      left2 = 1;
      for (len = 1; len <= MAXBITS; len++) {
        left2 <<= 1;
        left2 -= count[len];
        if (left2 < 0) {
          return -1;
        }
      }
      if (left2 > 0 && (type === CODES || max2 !== 1)) {
        return -1;
      }
      offs[1] = 0;
      for (len = 1; len < MAXBITS; len++) {
        offs[len + 1] = offs[len] + count[len];
      }
      for (sym = 0; sym < codes; sym++) {
        if (lens[lens_index + sym] !== 0) {
          work[offs[lens[lens_index + sym]]++] = sym;
        }
      }
      if (type === CODES) {
        base = extra = work;
        match = 20;
      } else if (type === LENS) {
        base = lbase;
        extra = lext;
        match = 257;
      } else {
        base = dbase;
        extra = dext;
        match = 0;
      }
      huff = 0;
      sym = 0;
      len = min2;
      next = table_index;
      curr = root;
      drop = 0;
      low = -1;
      used = 1 << root;
      mask = used - 1;
      if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {
        return 1;
      }
      for (; ; ) {
        here_bits = len - drop;
        if (work[sym] + 1 < match) {
          here_op = 0;
          here_val = work[sym];
        } else if (work[sym] >= match) {
          here_op = extra[work[sym] - match];
          here_val = base[work[sym] - match];
        } else {
          here_op = 32 + 64;
          here_val = 0;
        }
        incr = 1 << len - drop;
        fill = 1 << curr;
        min2 = fill;
        do {
          fill -= incr;
          table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
        } while (fill !== 0);
        incr = 1 << len - 1;
        while (huff & incr) {
          incr >>= 1;
        }
        if (incr !== 0) {
          huff &= incr - 1;
          huff += incr;
        } else {
          huff = 0;
        }
        sym++;
        if (--count[len] === 0) {
          if (len === max2) {
            break;
          }
          len = lens[lens_index + work[sym]];
        }
        if (len > root && (huff & mask) !== low) {
          if (drop === 0) {
            drop = root;
          }
          next += min2;
          curr = len - drop;
          left2 = 1 << curr;
          while (curr + drop < max2) {
            left2 -= count[curr + drop];
            if (left2 <= 0) {
              break;
            }
            curr++;
            left2 <<= 1;
          }
          used += 1 << curr;
          if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {
            return 1;
          }
          low = huff & mask;
          table[low] = root << 24 | curr << 16 | next - table_index | 0;
        }
      }
      if (huff !== 0) {
        table[next + huff] = len - drop << 24 | 64 << 16 | 0;
      }
      opts.bits = root;
      return 0;
    };
    module2.exports = inflate_table;
  }
});

// node_modules/pako/lib/zlib/inflate.js
var require_inflate = __commonJS({
  "node_modules/pako/lib/zlib/inflate.js"(exports2, module2) {
    "use strict";
    var adler32 = require_adler32();
    var crc32 = require_crc32();
    var inflate_fast = require_inffast();
    var inflate_table = require_inftrees();
    var CODES = 0;
    var LENS = 1;
    var DISTS = 2;
    var {
      Z_FINISH,
      Z_BLOCK,
      Z_TREES,
      Z_OK,
      Z_STREAM_END,
      Z_NEED_DICT,
      Z_STREAM_ERROR,
      Z_DATA_ERROR,
      Z_MEM_ERROR,
      Z_BUF_ERROR,
      Z_DEFLATED
    } = require_constants();
    var HEAD = 16180;
    var FLAGS = 16181;
    var TIME = 16182;
    var OS = 16183;
    var EXLEN = 16184;
    var EXTRA = 16185;
    var NAME = 16186;
    var COMMENT = 16187;
    var HCRC = 16188;
    var DICTID = 16189;
    var DICT = 16190;
    var TYPE = 16191;
    var TYPEDO = 16192;
    var STORED = 16193;
    var COPY_ = 16194;
    var COPY = 16195;
    var TABLE = 16196;
    var LENLENS = 16197;
    var CODELENS = 16198;
    var LEN_ = 16199;
    var LEN = 16200;
    var LENEXT = 16201;
    var DIST = 16202;
    var DISTEXT = 16203;
    var MATCH = 16204;
    var LIT = 16205;
    var CHECK = 16206;
    var LENGTH = 16207;
    var DONE = 16208;
    var BAD = 16209;
    var MEM = 16210;
    var SYNC = 16211;
    var ENOUGH_LENS = 852;
    var ENOUGH_DISTS = 592;
    var MAX_WBITS = 15;
    var DEF_WBITS = MAX_WBITS;
    var zswap32 = (q2) => {
      return (q2 >>> 24 & 255) + (q2 >>> 8 & 65280) + ((q2 & 65280) << 8) + ((q2 & 255) << 24);
    };
    function InflateState() {
      this.strm = null;
      this.mode = 0;
      this.last = false;
      this.wrap = 0;
      this.havedict = false;
      this.flags = 0;
      this.dmax = 0;
      this.check = 0;
      this.total = 0;
      this.head = null;
      this.wbits = 0;
      this.wsize = 0;
      this.whave = 0;
      this.wnext = 0;
      this.window = null;
      this.hold = 0;
      this.bits = 0;
      this.length = 0;
      this.offset = 0;
      this.extra = 0;
      this.lencode = null;
      this.distcode = null;
      this.lenbits = 0;
      this.distbits = 0;
      this.ncode = 0;
      this.nlen = 0;
      this.ndist = 0;
      this.have = 0;
      this.next = null;
      this.lens = new Uint16Array(320);
      this.work = new Uint16Array(288);
      this.lendyn = null;
      this.distdyn = null;
      this.sane = 0;
      this.back = 0;
      this.was = 0;
    }
    var inflateStateCheck = (strm) => {
      if (!strm) {
        return 1;
      }
      const state = strm.state;
      if (!state || state.strm !== strm || state.mode < HEAD || state.mode > SYNC) {
        return 1;
      }
      return 0;
    };
    var inflateResetKeep = (strm) => {
      if (inflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      const state = strm.state;
      strm.total_in = strm.total_out = state.total = 0;
      strm.msg = "";
      if (state.wrap) {
        strm.adler = state.wrap & 1;
      }
      state.mode = HEAD;
      state.last = 0;
      state.havedict = 0;
      state.flags = -1;
      state.dmax = 32768;
      state.head = null;
      state.hold = 0;
      state.bits = 0;
      state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);
      state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);
      state.sane = 1;
      state.back = -1;
      return Z_OK;
    };
    var inflateReset = (strm) => {
      if (inflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      const state = strm.state;
      state.wsize = 0;
      state.whave = 0;
      state.wnext = 0;
      return inflateResetKeep(strm);
    };
    var inflateReset2 = (strm, windowBits) => {
      let wrap;
      if (inflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      const state = strm.state;
      if (windowBits < 0) {
        wrap = 0;
        windowBits = -windowBits;
      } else {
        wrap = (windowBits >> 4) + 5;
        if (windowBits < 48) {
          windowBits &= 15;
        }
      }
      if (windowBits && (windowBits < 8 || windowBits > 15)) {
        return Z_STREAM_ERROR;
      }
      if (state.window !== null && state.wbits !== windowBits) {
        state.window = null;
      }
      state.wrap = wrap;
      state.wbits = windowBits;
      return inflateReset(strm);
    };
    var inflateInit2 = (strm, windowBits) => {
      if (!strm) {
        return Z_STREAM_ERROR;
      }
      const state = new InflateState();
      strm.state = state;
      state.strm = strm;
      state.window = null;
      state.mode = HEAD;
      const ret2 = inflateReset2(strm, windowBits);
      if (ret2 !== Z_OK) {
        strm.state = null;
      }
      return ret2;
    };
    var inflateInit = (strm) => {
      return inflateInit2(strm, DEF_WBITS);
    };
    var virgin = true;
    var lenfix;
    var distfix;
    var fixedtables = (state) => {
      if (virgin) {
        lenfix = new Int32Array(512);
        distfix = new Int32Array(32);
        let sym = 0;
        while (sym < 144) {
          state.lens[sym++] = 8;
        }
        while (sym < 256) {
          state.lens[sym++] = 9;
        }
        while (sym < 280) {
          state.lens[sym++] = 7;
        }
        while (sym < 288) {
          state.lens[sym++] = 8;
        }
        inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
        sym = 0;
        while (sym < 32) {
          state.lens[sym++] = 5;
        }
        inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
        virgin = false;
      }
      state.lencode = lenfix;
      state.lenbits = 9;
      state.distcode = distfix;
      state.distbits = 5;
    };
    var updatewindow = (strm, src, end2, copy) => {
      let dist;
      const state = strm.state;
      if (state.window === null) {
        state.wsize = 1 << state.wbits;
        state.wnext = 0;
        state.whave = 0;
        state.window = new Uint8Array(state.wsize);
      }
      if (copy >= state.wsize) {
        state.window.set(src.subarray(end2 - state.wsize, end2), 0);
        state.wnext = 0;
        state.whave = state.wsize;
      } else {
        dist = state.wsize - state.wnext;
        if (dist > copy) {
          dist = copy;
        }
        state.window.set(src.subarray(end2 - copy, end2 - copy + dist), state.wnext);
        copy -= dist;
        if (copy) {
          state.window.set(src.subarray(end2 - copy, end2), 0);
          state.wnext = copy;
          state.whave = state.wsize;
        } else {
          state.wnext += dist;
          if (state.wnext === state.wsize) {
            state.wnext = 0;
          }
          if (state.whave < state.wsize) {
            state.whave += dist;
          }
        }
      }
      return 0;
    };
    var inflate = (strm, flush) => {
      let state;
      let input, output;
      let next;
      let put;
      let have, left2;
      let hold;
      let bits;
      let _in, _out;
      let copy;
      let from;
      let from_source;
      let here = 0;
      let here_bits, here_op, here_val;
      let last_bits, last_op, last_val;
      let len;
      let ret2;
      const hbuf = new Uint8Array(4);
      let opts;
      let n;
      const order2 = (
        /* permutation of code lengths */
        new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
      );
      if (inflateStateCheck(strm) || !strm.output || !strm.input && strm.avail_in !== 0) {
        return Z_STREAM_ERROR;
      }
      state = strm.state;
      if (state.mode === TYPE) {
        state.mode = TYPEDO;
      }
      put = strm.next_out;
      output = strm.output;
      left2 = strm.avail_out;
      next = strm.next_in;
      input = strm.input;
      have = strm.avail_in;
      hold = state.hold;
      bits = state.bits;
      _in = have;
      _out = left2;
      ret2 = Z_OK;
      inf_leave:
        for (; ; ) {
          switch (state.mode) {
            case HEAD:
              if (state.wrap === 0) {
                state.mode = TYPEDO;
                break;
              }
              while (bits < 16) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              if (state.wrap & 2 && hold === 35615) {
                if (state.wbits === 0) {
                  state.wbits = 15;
                }
                state.check = 0;
                hbuf[0] = hold & 255;
                hbuf[1] = hold >>> 8 & 255;
                state.check = crc32(state.check, hbuf, 2, 0);
                hold = 0;
                bits = 0;
                state.mode = FLAGS;
                break;
              }
              if (state.head) {
                state.head.done = false;
              }
              if (!(state.wrap & 1) || /* check if zlib header allowed */
              (((hold & 255) << 8) + (hold >> 8)) % 31) {
                strm.msg = "incorrect header check";
                state.mode = BAD;
                break;
              }
              if ((hold & 15) !== Z_DEFLATED) {
                strm.msg = "unknown compression method";
                state.mode = BAD;
                break;
              }
              hold >>>= 4;
              bits -= 4;
              len = (hold & 15) + 8;
              if (state.wbits === 0) {
                state.wbits = len;
              }
              if (len > 15 || len > state.wbits) {
                strm.msg = "invalid window size";
                state.mode = BAD;
                break;
              }
              state.dmax = 1 << state.wbits;
              state.flags = 0;
              strm.adler = state.check = 1;
              state.mode = hold & 512 ? DICTID : TYPE;
              hold = 0;
              bits = 0;
              break;
            case FLAGS:
              while (bits < 16) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              state.flags = hold;
              if ((state.flags & 255) !== Z_DEFLATED) {
                strm.msg = "unknown compression method";
                state.mode = BAD;
                break;
              }
              if (state.flags & 57344) {
                strm.msg = "unknown header flags set";
                state.mode = BAD;
                break;
              }
              if (state.head) {
                state.head.text = hold >> 8 & 1;
              }
              if (state.flags & 512 && state.wrap & 4) {
                hbuf[0] = hold & 255;
                hbuf[1] = hold >>> 8 & 255;
                state.check = crc32(state.check, hbuf, 2, 0);
              }
              hold = 0;
              bits = 0;
              state.mode = TIME;
            case TIME:
              while (bits < 32) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              if (state.head) {
                state.head.time = hold;
              }
              if (state.flags & 512 && state.wrap & 4) {
                hbuf[0] = hold & 255;
                hbuf[1] = hold >>> 8 & 255;
                hbuf[2] = hold >>> 16 & 255;
                hbuf[3] = hold >>> 24 & 255;
                state.check = crc32(state.check, hbuf, 4, 0);
              }
              hold = 0;
              bits = 0;
              state.mode = OS;
            case OS:
              while (bits < 16) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              if (state.head) {
                state.head.xflags = hold & 255;
                state.head.os = hold >> 8;
              }
              if (state.flags & 512 && state.wrap & 4) {
                hbuf[0] = hold & 255;
                hbuf[1] = hold >>> 8 & 255;
                state.check = crc32(state.check, hbuf, 2, 0);
              }
              hold = 0;
              bits = 0;
              state.mode = EXLEN;
            case EXLEN:
              if (state.flags & 1024) {
                while (bits < 16) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                state.length = hold;
                if (state.head) {
                  state.head.extra_len = hold;
                }
                if (state.flags & 512 && state.wrap & 4) {
                  hbuf[0] = hold & 255;
                  hbuf[1] = hold >>> 8 & 255;
                  state.check = crc32(state.check, hbuf, 2, 0);
                }
                hold = 0;
                bits = 0;
              } else if (state.head) {
                state.head.extra = null;
              }
              state.mode = EXTRA;
            case EXTRA:
              if (state.flags & 1024) {
                copy = state.length;
                if (copy > have) {
                  copy = have;
                }
                if (copy) {
                  if (state.head) {
                    len = state.head.extra_len - state.length;
                    if (!state.head.extra) {
                      state.head.extra = new Uint8Array(state.head.extra_len);
                    }
                    state.head.extra.set(
                      input.subarray(
                        next,
                        // extra field is limited to 65536 bytes
                        // - no need for additional size check
                        next + copy
                      ),
                      /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
                      len
                    );
                  }
                  if (state.flags & 512 && state.wrap & 4) {
                    state.check = crc32(state.check, input, copy, next);
                  }
                  have -= copy;
                  next += copy;
                  state.length -= copy;
                }
                if (state.length) {
                  break inf_leave;
                }
              }
              state.length = 0;
              state.mode = NAME;
            case NAME:
              if (state.flags & 2048) {
                if (have === 0) {
                  break inf_leave;
                }
                copy = 0;
                do {
                  len = input[next + copy++];
                  if (state.head && len && state.length < 65536) {
                    state.head.name += String.fromCharCode(len);
                  }
                } while (len && copy < have);
                if (state.flags & 512 && state.wrap & 4) {
                  state.check = crc32(state.check, input, copy, next);
                }
                have -= copy;
                next += copy;
                if (len) {
                  break inf_leave;
                }
              } else if (state.head) {
                state.head.name = null;
              }
              state.length = 0;
              state.mode = COMMENT;
            case COMMENT:
              if (state.flags & 4096) {
                if (have === 0) {
                  break inf_leave;
                }
                copy = 0;
                do {
                  len = input[next + copy++];
                  if (state.head && len && state.length < 65536) {
                    state.head.comment += String.fromCharCode(len);
                  }
                } while (len && copy < have);
                if (state.flags & 512 && state.wrap & 4) {
                  state.check = crc32(state.check, input, copy, next);
                }
                have -= copy;
                next += copy;
                if (len) {
                  break inf_leave;
                }
              } else if (state.head) {
                state.head.comment = null;
              }
              state.mode = HCRC;
            case HCRC:
              if (state.flags & 512) {
                while (bits < 16) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                if (state.wrap & 4 && hold !== (state.check & 65535)) {
                  strm.msg = "header crc mismatch";
                  state.mode = BAD;
                  break;
                }
                hold = 0;
                bits = 0;
              }
              if (state.head) {
                state.head.hcrc = state.flags >> 9 & 1;
                state.head.done = true;
              }
              strm.adler = state.check = 0;
              state.mode = TYPE;
              break;
            case DICTID:
              while (bits < 32) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              strm.adler = state.check = zswap32(hold);
              hold = 0;
              bits = 0;
              state.mode = DICT;
            case DICT:
              if (state.havedict === 0) {
                strm.next_out = put;
                strm.avail_out = left2;
                strm.next_in = next;
                strm.avail_in = have;
                state.hold = hold;
                state.bits = bits;
                return Z_NEED_DICT;
              }
              strm.adler = state.check = 1;
              state.mode = TYPE;
            case TYPE:
              if (flush === Z_BLOCK || flush === Z_TREES) {
                break inf_leave;
              }
            case TYPEDO:
              if (state.last) {
                hold >>>= bits & 7;
                bits -= bits & 7;
                state.mode = CHECK;
                break;
              }
              while (bits < 3) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              state.last = hold & 1;
              hold >>>= 1;
              bits -= 1;
              switch (hold & 3) {
                case 0:
                  state.mode = STORED;
                  break;
                case 1:
                  fixedtables(state);
                  state.mode = LEN_;
                  if (flush === Z_TREES) {
                    hold >>>= 2;
                    bits -= 2;
                    break inf_leave;
                  }
                  break;
                case 2:
                  state.mode = TABLE;
                  break;
                case 3:
                  strm.msg = "invalid block type";
                  state.mode = BAD;
              }
              hold >>>= 2;
              bits -= 2;
              break;
            case STORED:
              hold >>>= bits & 7;
              bits -= bits & 7;
              while (bits < 32) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {
                strm.msg = "invalid stored block lengths";
                state.mode = BAD;
                break;
              }
              state.length = hold & 65535;
              hold = 0;
              bits = 0;
              state.mode = COPY_;
              if (flush === Z_TREES) {
                break inf_leave;
              }
            case COPY_:
              state.mode = COPY;
            case COPY:
              copy = state.length;
              if (copy) {
                if (copy > have) {
                  copy = have;
                }
                if (copy > left2) {
                  copy = left2;
                }
                if (copy === 0) {
                  break inf_leave;
                }
                output.set(input.subarray(next, next + copy), put);
                have -= copy;
                next += copy;
                left2 -= copy;
                put += copy;
                state.length -= copy;
                break;
              }
              state.mode = TYPE;
              break;
            case TABLE:
              while (bits < 14) {
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              state.nlen = (hold & 31) + 257;
              hold >>>= 5;
              bits -= 5;
              state.ndist = (hold & 31) + 1;
              hold >>>= 5;
              bits -= 5;
              state.ncode = (hold & 15) + 4;
              hold >>>= 4;
              bits -= 4;
              if (state.nlen > 286 || state.ndist > 30) {
                strm.msg = "too many length or distance symbols";
                state.mode = BAD;
                break;
              }
              state.have = 0;
              state.mode = LENLENS;
            case LENLENS:
              while (state.have < state.ncode) {
                while (bits < 3) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                state.lens[order2[state.have++]] = hold & 7;
                hold >>>= 3;
                bits -= 3;
              }
              while (state.have < 19) {
                state.lens[order2[state.have++]] = 0;
              }
              state.lencode = state.lendyn;
              state.lenbits = 7;
              opts = { bits: state.lenbits };
              ret2 = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
              state.lenbits = opts.bits;
              if (ret2) {
                strm.msg = "invalid code lengths set";
                state.mode = BAD;
                break;
              }
              state.have = 0;
              state.mode = CODELENS;
            case CODELENS:
              while (state.have < state.nlen + state.ndist) {
                for (; ; ) {
                  here = state.lencode[hold & (1 << state.lenbits) - 1];
                  here_bits = here >>> 24;
                  here_op = here >>> 16 & 255;
                  here_val = here & 65535;
                  if (here_bits <= bits) {
                    break;
                  }
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                if (here_val < 16) {
                  hold >>>= here_bits;
                  bits -= here_bits;
                  state.lens[state.have++] = here_val;
                } else {
                  if (here_val === 16) {
                    n = here_bits + 2;
                    while (bits < n) {
                      if (have === 0) {
                        break inf_leave;
                      }
                      have--;
                      hold += input[next++] << bits;
                      bits += 8;
                    }
                    hold >>>= here_bits;
                    bits -= here_bits;
                    if (state.have === 0) {
                      strm.msg = "invalid bit length repeat";
                      state.mode = BAD;
                      break;
                    }
                    len = state.lens[state.have - 1];
                    copy = 3 + (hold & 3);
                    hold >>>= 2;
                    bits -= 2;
                  } else if (here_val === 17) {
                    n = here_bits + 3;
                    while (bits < n) {
                      if (have === 0) {
                        break inf_leave;
                      }
                      have--;
                      hold += input[next++] << bits;
                      bits += 8;
                    }
                    hold >>>= here_bits;
                    bits -= here_bits;
                    len = 0;
                    copy = 3 + (hold & 7);
                    hold >>>= 3;
                    bits -= 3;
                  } else {
                    n = here_bits + 7;
                    while (bits < n) {
                      if (have === 0) {
                        break inf_leave;
                      }
                      have--;
                      hold += input[next++] << bits;
                      bits += 8;
                    }
                    hold >>>= here_bits;
                    bits -= here_bits;
                    len = 0;
                    copy = 11 + (hold & 127);
                    hold >>>= 7;
                    bits -= 7;
                  }
                  if (state.have + copy > state.nlen + state.ndist) {
                    strm.msg = "invalid bit length repeat";
                    state.mode = BAD;
                    break;
                  }
                  while (copy--) {
                    state.lens[state.have++] = len;
                  }
                }
              }
              if (state.mode === BAD) {
                break;
              }
              if (state.lens[256] === 0) {
                strm.msg = "invalid code -- missing end-of-block";
                state.mode = BAD;
                break;
              }
              state.lenbits = 9;
              opts = { bits: state.lenbits };
              ret2 = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
              state.lenbits = opts.bits;
              if (ret2) {
                strm.msg = "invalid literal/lengths set";
                state.mode = BAD;
                break;
              }
              state.distbits = 6;
              state.distcode = state.distdyn;
              opts = { bits: state.distbits };
              ret2 = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
              state.distbits = opts.bits;
              if (ret2) {
                strm.msg = "invalid distances set";
                state.mode = BAD;
                break;
              }
              state.mode = LEN_;
              if (flush === Z_TREES) {
                break inf_leave;
              }
            case LEN_:
              state.mode = LEN;
            case LEN:
              if (have >= 6 && left2 >= 258) {
                strm.next_out = put;
                strm.avail_out = left2;
                strm.next_in = next;
                strm.avail_in = have;
                state.hold = hold;
                state.bits = bits;
                inflate_fast(strm, _out);
                put = strm.next_out;
                output = strm.output;
                left2 = strm.avail_out;
                next = strm.next_in;
                input = strm.input;
                have = strm.avail_in;
                hold = state.hold;
                bits = state.bits;
                if (state.mode === TYPE) {
                  state.back = -1;
                }
                break;
              }
              state.back = 0;
              for (; ; ) {
                here = state.lencode[hold & (1 << state.lenbits) - 1];
                here_bits = here >>> 24;
                here_op = here >>> 16 & 255;
                here_val = here & 65535;
                if (here_bits <= bits) {
                  break;
                }
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              if (here_op && (here_op & 240) === 0) {
                last_bits = here_bits;
                last_op = here_op;
                last_val = here_val;
                for (; ; ) {
                  here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
                  here_bits = here >>> 24;
                  here_op = here >>> 16 & 255;
                  here_val = here & 65535;
                  if (last_bits + here_bits <= bits) {
                    break;
                  }
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                hold >>>= last_bits;
                bits -= last_bits;
                state.back += last_bits;
              }
              hold >>>= here_bits;
              bits -= here_bits;
              state.back += here_bits;
              state.length = here_val;
              if (here_op === 0) {
                state.mode = LIT;
                break;
              }
              if (here_op & 32) {
                state.back = -1;
                state.mode = TYPE;
                break;
              }
              if (here_op & 64) {
                strm.msg = "invalid literal/length code";
                state.mode = BAD;
                break;
              }
              state.extra = here_op & 15;
              state.mode = LENEXT;
            case LENEXT:
              if (state.extra) {
                n = state.extra;
                while (bits < n) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                state.length += hold & (1 << state.extra) - 1;
                hold >>>= state.extra;
                bits -= state.extra;
                state.back += state.extra;
              }
              state.was = state.length;
              state.mode = DIST;
            case DIST:
              for (; ; ) {
                here = state.distcode[hold & (1 << state.distbits) - 1];
                here_bits = here >>> 24;
                here_op = here >>> 16 & 255;
                here_val = here & 65535;
                if (here_bits <= bits) {
                  break;
                }
                if (have === 0) {
                  break inf_leave;
                }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              if ((here_op & 240) === 0) {
                last_bits = here_bits;
                last_op = here_op;
                last_val = here_val;
                for (; ; ) {
                  here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
                  here_bits = here >>> 24;
                  here_op = here >>> 16 & 255;
                  here_val = here & 65535;
                  if (last_bits + here_bits <= bits) {
                    break;
                  }
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                hold >>>= last_bits;
                bits -= last_bits;
                state.back += last_bits;
              }
              hold >>>= here_bits;
              bits -= here_bits;
              state.back += here_bits;
              if (here_op & 64) {
                strm.msg = "invalid distance code";
                state.mode = BAD;
                break;
              }
              state.offset = here_val;
              state.extra = here_op & 15;
              state.mode = DISTEXT;
            case DISTEXT:
              if (state.extra) {
                n = state.extra;
                while (bits < n) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                state.offset += hold & (1 << state.extra) - 1;
                hold >>>= state.extra;
                bits -= state.extra;
                state.back += state.extra;
              }
              if (state.offset > state.dmax) {
                strm.msg = "invalid distance too far back";
                state.mode = BAD;
                break;
              }
              state.mode = MATCH;
            case MATCH:
              if (left2 === 0) {
                break inf_leave;
              }
              copy = _out - left2;
              if (state.offset > copy) {
                copy = state.offset - copy;
                if (copy > state.whave) {
                  if (state.sane) {
                    strm.msg = "invalid distance too far back";
                    state.mode = BAD;
                    break;
                  }
                }
                if (copy > state.wnext) {
                  copy -= state.wnext;
                  from = state.wsize - copy;
                } else {
                  from = state.wnext - copy;
                }
                if (copy > state.length) {
                  copy = state.length;
                }
                from_source = state.window;
              } else {
                from_source = output;
                from = put - state.offset;
                copy = state.length;
              }
              if (copy > left2) {
                copy = left2;
              }
              left2 -= copy;
              state.length -= copy;
              do {
                output[put++] = from_source[from++];
              } while (--copy);
              if (state.length === 0) {
                state.mode = LEN;
              }
              break;
            case LIT:
              if (left2 === 0) {
                break inf_leave;
              }
              output[put++] = state.length;
              left2--;
              state.mode = LEN;
              break;
            case CHECK:
              if (state.wrap) {
                while (bits < 32) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold |= input[next++] << bits;
                  bits += 8;
                }
                _out -= left2;
                strm.total_out += _out;
                state.total += _out;
                if (state.wrap & 4 && _out) {
                  strm.adler = state.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
                  state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);
                }
                _out = left2;
                if (state.wrap & 4 && (state.flags ? hold : zswap32(hold)) !== state.check) {
                  strm.msg = "incorrect data check";
                  state.mode = BAD;
                  break;
                }
                hold = 0;
                bits = 0;
              }
              state.mode = LENGTH;
            case LENGTH:
              if (state.wrap && state.flags) {
                while (bits < 32) {
                  if (have === 0) {
                    break inf_leave;
                  }
                  have--;
                  hold += input[next++] << bits;
                  bits += 8;
                }
                if (state.wrap & 4 && hold !== (state.total & 4294967295)) {
                  strm.msg = "incorrect length check";
                  state.mode = BAD;
                  break;
                }
                hold = 0;
                bits = 0;
              }
              state.mode = DONE;
            case DONE:
              ret2 = Z_STREAM_END;
              break inf_leave;
            case BAD:
              ret2 = Z_DATA_ERROR;
              break inf_leave;
            case MEM:
              return Z_MEM_ERROR;
            case SYNC:
            default:
              return Z_STREAM_ERROR;
          }
        }
      strm.next_out = put;
      strm.avail_out = left2;
      strm.next_in = next;
      strm.avail_in = have;
      state.hold = hold;
      state.bits = bits;
      if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {
        if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
          state.mode = MEM;
          return Z_MEM_ERROR;
        }
      }
      _in -= strm.avail_in;
      _out -= strm.avail_out;
      strm.total_in += _in;
      strm.total_out += _out;
      state.total += _out;
      if (state.wrap & 4 && _out) {
        strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
        state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);
      }
      strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
      if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret2 === Z_OK) {
        ret2 = Z_BUF_ERROR;
      }
      return ret2;
    };
    var inflateEnd = (strm) => {
      if (inflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      let state = strm.state;
      if (state.window) {
        state.window = null;
      }
      strm.state = null;
      return Z_OK;
    };
    var inflateGetHeader = (strm, head) => {
      if (inflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      const state = strm.state;
      if ((state.wrap & 2) === 0) {
        return Z_STREAM_ERROR;
      }
      state.head = head;
      head.done = false;
      return Z_OK;
    };
    var inflateSetDictionary = (strm, dictionary) => {
      const dictLength = dictionary.length;
      let state;
      let dictid;
      let ret2;
      if (inflateStateCheck(strm)) {
        return Z_STREAM_ERROR;
      }
      state = strm.state;
      if (state.wrap !== 0 && state.mode !== DICT) {
        return Z_STREAM_ERROR;
      }
      if (state.mode === DICT) {
        dictid = 1;
        dictid = adler32(dictid, dictionary, dictLength, 0);
        if (dictid !== state.check) {
          return Z_DATA_ERROR;
        }
      }
      ret2 = updatewindow(strm, dictionary, dictLength, dictLength);
      if (ret2) {
        state.mode = MEM;
        return Z_MEM_ERROR;
      }
      state.havedict = 1;
      return Z_OK;
    };
    module2.exports.inflateReset = inflateReset;
    module2.exports.inflateReset2 = inflateReset2;
    module2.exports.inflateResetKeep = inflateResetKeep;
    module2.exports.inflateInit = inflateInit;
    module2.exports.inflateInit2 = inflateInit2;
    module2.exports.inflate = inflate;
    module2.exports.inflateEnd = inflateEnd;
    module2.exports.inflateGetHeader = inflateGetHeader;
    module2.exports.inflateSetDictionary = inflateSetDictionary;
    module2.exports.inflateInfo = "pako inflate (from Nodeca project)";
  }
});

// node_modules/pako/lib/zlib/gzheader.js
var require_gzheader = __commonJS({
  "node_modules/pako/lib/zlib/gzheader.js"(exports2, module2) {
    "use strict";
    function GZheader() {
      this.text = 0;
      this.time = 0;
      this.xflags = 0;
      this.os = 0;
      this.extra = null;
      this.extra_len = 0;
      this.name = "";
      this.comment = "";
      this.hcrc = 0;
      this.done = false;
    }
    module2.exports = GZheader;
  }
});

// node_modules/pako/lib/inflate.js
var require_inflate2 = __commonJS({
  "node_modules/pako/lib/inflate.js"(exports2, module2) {
    "use strict";
    var zlib_inflate = require_inflate();
    var utils = require_common();
    var strings = require_strings();
    var msg = require_messages();
    var ZStream = require_zstream();
    var GZheader = require_gzheader();
    var toString = Object.prototype.toString;
    var {
      Z_NO_FLUSH,
      Z_FINISH,
      Z_OK,
      Z_STREAM_END,
      Z_NEED_DICT,
      Z_STREAM_ERROR,
      Z_DATA_ERROR,
      Z_MEM_ERROR
    } = require_constants();
    function Inflate(options) {
      this.options = utils.assign({
        chunkSize: 1024 * 64,
        windowBits: 15,
        to: ""
      }, options || {});
      const opt = this.options;
      if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) {
        opt.windowBits = -opt.windowBits;
        if (opt.windowBits === 0) {
          opt.windowBits = -15;
        }
      }
      if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) {
        opt.windowBits += 32;
      }
      if (opt.windowBits > 15 && opt.windowBits < 48) {
        if ((opt.windowBits & 15) === 0) {
          opt.windowBits |= 15;
        }
      }
      this.err = 0;
      this.msg = "";
      this.ended = false;
      this.chunks = [];
      this.strm = new ZStream();
      this.strm.avail_out = 0;
      let status = zlib_inflate.inflateInit2(
        this.strm,
        opt.windowBits
      );
      if (status !== Z_OK) {
        throw new Error(msg[status]);
      }
      this.header = new GZheader();
      zlib_inflate.inflateGetHeader(this.strm, this.header);
      if (opt.dictionary) {
        if (typeof opt.dictionary === "string") {
          opt.dictionary = strings.string2buf(opt.dictionary);
        } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
          opt.dictionary = new Uint8Array(opt.dictionary);
        }
        if (opt.raw) {
          status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
          if (status !== Z_OK) {
            throw new Error(msg[status]);
          }
        }
      }
    }
    Inflate.prototype.push = function(data, flush_mode) {
      const strm = this.strm;
      const chunkSize = this.options.chunkSize;
      const dictionary = this.options.dictionary;
      let status, _flush_mode, last_avail_out;
      if (this.ended)
        return false;
      if (flush_mode === ~~flush_mode)
        _flush_mode = flush_mode;
      else
        _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;
      if (toString.call(data) === "[object ArrayBuffer]") {
        strm.input = new Uint8Array(data);
      } else {
        strm.input = data;
      }
      strm.next_in = 0;
      strm.avail_in = strm.input.length;
      for (; ; ) {
        if (strm.avail_out === 0) {
          strm.output = new Uint8Array(chunkSize);
          strm.next_out = 0;
          strm.avail_out = chunkSize;
        }
        status = zlib_inflate.inflate(strm, _flush_mode);
        if (status === Z_NEED_DICT && dictionary) {
          status = zlib_inflate.inflateSetDictionary(strm, dictionary);
          if (status === Z_OK) {
            status = zlib_inflate.inflate(strm, _flush_mode);
          } else if (status === Z_DATA_ERROR) {
            status = Z_NEED_DICT;
          }
        }
        while (strm.avail_in > 0 && status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) {
          zlib_inflate.inflateReset(strm);
          status = zlib_inflate.inflate(strm, _flush_mode);
        }
        switch (status) {
          case Z_STREAM_ERROR:
          case Z_DATA_ERROR:
          case Z_NEED_DICT:
          case Z_MEM_ERROR:
            this.onEnd(status);
            this.ended = true;
            return false;
        }
        last_avail_out = strm.avail_out;
        if (strm.next_out) {
          if (strm.avail_out === 0 || status === Z_STREAM_END) {
            if (this.options.to === "string") {
              let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
              let tail = strm.next_out - next_out_utf8;
              let utf8str = strings.buf2string(strm.output, next_out_utf8);
              strm.next_out = tail;
              strm.avail_out = chunkSize - tail;
              if (tail)
                strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);
              this.onData(utf8str);
            } else {
              this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));
            }
          }
        }
        if (status === Z_OK && last_avail_out === 0)
          continue;
        if (status === Z_STREAM_END) {
          status = zlib_inflate.inflateEnd(this.strm);
          this.onEnd(status);
          this.ended = true;
          return true;
        }
        if (strm.avail_in === 0)
          break;
      }
      return true;
    };
    Inflate.prototype.onData = function(chunk) {
      this.chunks.push(chunk);
    };
    Inflate.prototype.onEnd = function(status) {
      if (status === Z_OK) {
        if (this.options.to === "string") {
          this.result = this.chunks.join("");
        } else {
          this.result = utils.flattenChunks(this.chunks);
        }
      }
      this.chunks = [];
      this.err = status;
      this.msg = this.strm.msg;
    };
    function inflate(input, options) {
      const inflator = new Inflate(options);
      inflator.push(input);
      if (inflator.err)
        throw inflator.msg || msg[inflator.err];
      return inflator.result;
    }
    function inflateRaw(input, options) {
      options = options || {};
      options.raw = true;
      return inflate(input, options);
    }
    module2.exports.Inflate = Inflate;
    module2.exports.inflate = inflate;
    module2.exports.inflateRaw = inflateRaw;
    module2.exports.ungzip = inflate;
    module2.exports.constants = require_constants();
  }
});

// node_modules/pako/index.js
var require_pako = __commonJS({
  "node_modules/pako/index.js"(exports2, module2) {
    "use strict";
    var { Deflate, deflate, deflateRaw, gzip } = require_deflate2();
    var { Inflate, inflate, inflateRaw, ungzip } = require_inflate2();
    var constants = require_constants();
    module2.exports.Deflate = Deflate;
    module2.exports.deflate = deflate;
    module2.exports.deflateRaw = deflateRaw;
    module2.exports.gzip = gzip;
    module2.exports.Inflate = Inflate;
    module2.exports.inflate = inflate;
    module2.exports.inflateRaw = inflateRaw;
    module2.exports.ungzip = ungzip;
    module2.exports.constants = constants;
  }
});

// node_modules/telegram/tl/core/GZIPPacked.js
var require_GZIPPacked = __commonJS({
  "node_modules/telegram/tl/core/GZIPPacked.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.GZIPPacked = void 0;
    var __1 = require_tl();
    var pako_1 = require_pako();
    var GZIPPacked = class {
      constructor(data) {
        this.data = data;
        this.CONSTRUCTOR_ID = 812830625;
        this.classType = "constructor";
      }
      static async gzipIfSmaller(contentRelated, data) {
        if (contentRelated && data.length > 512) {
          const gzipped = await new GZIPPacked(data).toBytes();
          if (gzipped.length < data.length) {
            return gzipped;
          }
        }
        return data;
      }
      static gzip(input) {
        return Buffer.from(input);
      }
      static ungzip(input) {
        return Buffer.from((0, pako_1.inflate)(input));
      }
      async toBytes() {
        const g = Buffer.alloc(4);
        g.writeUInt32LE(GZIPPacked.CONSTRUCTOR_ID, 0);
        return Buffer.concat([
          g,
          (0, __1.serializeBytes)(await GZIPPacked.gzip(this.data))
        ]);
      }
      static async read(reader) {
        const constructor = reader.readInt(false);
        if (constructor !== GZIPPacked.CONSTRUCTOR_ID) {
          throw new Error("not equal");
        }
        return GZIPPacked.gzip(reader.tgReadBytes());
      }
      static async fromReader(reader) {
        const data = reader.tgReadBytes();
        return new GZIPPacked(await GZIPPacked.ungzip(data));
      }
    };
    exports2.GZIPPacked = GZIPPacked;
    GZIPPacked.CONSTRUCTOR_ID = 812830625;
    GZIPPacked.classType = "constructor";
  }
});

// node_modules/telegram/tl/core/index.js
var require_core = __commonJS({
  "node_modules/telegram/tl/core/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.GZIPPacked = exports2.MessageContainer = exports2.TLMessage = exports2.RPCResult = exports2.coreObjects = void 0;
    var TLMessage_1 = require_TLMessage();
    Object.defineProperty(exports2, "TLMessage", { enumerable: true, get: function() {
      return TLMessage_1.TLMessage;
    } });
    var RPCResult_1 = require_RPCResult();
    Object.defineProperty(exports2, "RPCResult", { enumerable: true, get: function() {
      return RPCResult_1.RPCResult;
    } });
    var MessageContainer_1 = require_MessageContainer();
    Object.defineProperty(exports2, "MessageContainer", { enumerable: true, get: function() {
      return MessageContainer_1.MessageContainer;
    } });
    var GZIPPacked_1 = require_GZIPPacked();
    Object.defineProperty(exports2, "GZIPPacked", { enumerable: true, get: function() {
      return GZIPPacked_1.GZIPPacked;
    } });
    exports2.coreObjects = /* @__PURE__ */ new Map([
      [RPCResult_1.RPCResult.CONSTRUCTOR_ID, RPCResult_1.RPCResult],
      [GZIPPacked_1.GZIPPacked.CONSTRUCTOR_ID, GZIPPacked_1.GZIPPacked],
      [MessageContainer_1.MessageContainer.CONSTRUCTOR_ID, MessageContainer_1.MessageContainer]
    ]);
  }
});

// node_modules/telegram/tl/AllTLObjects.js
var require_AllTLObjects = __commonJS({
  "node_modules/telegram/tl/AllTLObjects.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.tlobjects = exports2.LAYER = void 0;
    exports2.LAYER = 184;
    var _1 = require_tl();
    var tlobjects = {};
    exports2.tlobjects = tlobjects;
    for (const tl of Object.values(_1.Api)) {
      if ("CONSTRUCTOR_ID" in tl) {
        tlobjects[tl.CONSTRUCTOR_ID] = tl;
      } else {
        for (const sub of Object.values(tl)) {
          tlobjects[sub.CONSTRUCTOR_ID] = sub;
        }
      }
    }
  }
});

// node_modules/telegram/extensions/BinaryReader.js
var require_BinaryReader = __commonJS({
  "node_modules/telegram/extensions/BinaryReader.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.BinaryReader = void 0;
    var errors_1 = require_errors();
    var core_1 = require_core();
    var AllTLObjects_1 = require_AllTLObjects();
    var Helpers_1 = require_Helpers();
    var BinaryReader = class {
      /**
       * Small utility class to read binary data.
       * @param data {Buffer}
       */
      constructor(data) {
        this.stream = data;
        this._last = void 0;
        this.offset = 0;
      }
      // region Reading
      // "All numbers are written as little endian."
      // https://core.telegram.org/mtproto
      /**
       * Reads a single byte value.
       */
      readByte() {
        return this.read(1)[0];
      }
      /**
       * Reads an integer (4 bytes or 32 bits) value.
       * @param signed {Boolean}
       */
      readInt(signed = true) {
        let res;
        if (signed) {
          res = this.stream.readInt32LE(this.offset);
        } else {
          res = this.stream.readUInt32LE(this.offset);
        }
        this.offset += 4;
        return res;
      }
      /**
       * Reads a long integer (8 bytes or 64 bits) value.
       * @param signed
       * @returns {BigInteger}
       */
      readLong(signed = true) {
        return this.readLargeInt(64, signed);
      }
      /**
       * Reads a real floating point (4 bytes) value.
       * @returns {number}
       */
      readFloat() {
        return this.read(4).readFloatLE(0);
      }
      /**
       * Reads a real floating point (8 bytes) value.
       * @returns {BigInteger}
       */
      readDouble() {
        return this.read(8).readDoubleLE(0);
      }
      /**
       * Reads a n-bits long integer value.
       * @param bits
       * @param signed {Boolean}
       */
      readLargeInt(bits, signed = true) {
        const buffer = this.read(Math.floor(bits / 8));
        return (0, Helpers_1.readBigIntFromBuffer)(buffer, true, signed);
      }
      /**
       * Read the given amount of bytes, or -1 to read all remaining.
       * @param length {number}
       * @param checkLength {boolean} whether to check if the length overflows or not.
       */
      read(length = -1, checkLength = true) {
        if (length === -1) {
          length = this.stream.length - this.offset;
        }
        const result = this.stream.slice(this.offset, this.offset + length);
        this.offset += length;
        if (checkLength && result.length !== length) {
          throw Error(`No more data left to read (need ${length}, got ${result.length}: ${result}); last read ${this._last}`);
        }
        this._last = result;
        return result;
      }
      /**
       * Gets the byte array representing the current buffer as a whole.
       * @returns {Buffer}
       */
      getBuffer() {
        return this.stream;
      }
      // endregion
      // region Telegram custom reading
      /**
       * Reads a Telegram-encoded byte array, without the need of
       * specifying its length.
       * @returns {Buffer}
       */
      tgReadBytes() {
        const firstByte = this.readByte();
        let padding;
        let length;
        if (firstByte === 254) {
          length = this.readByte() | this.readByte() << 8 | this.readByte() << 16;
          padding = length % 4;
        } else {
          length = firstByte;
          padding = (length + 1) % 4;
        }
        const data = this.read(length);
        if (padding > 0) {
          padding = 4 - padding;
          this.read(padding);
        }
        return data;
      }
      /**
       * Reads a Telegram-encoded string.
       * @returns {string}
       */
      tgReadString() {
        return this.tgReadBytes().toString("utf-8");
      }
      /**
       * Reads a Telegram boolean value.
       * @returns {boolean}
       */
      tgReadBool() {
        const value = this.readInt(false);
        if (value === 2574415285) {
          return true;
        } else if (value === 3162085175) {
          return false;
        } else {
          throw new Error(`Invalid boolean code ${value.toString(16)}`);
        }
      }
      /**
       * Reads and converts Unix time (used by Telegram)
       * into a Javascript {Date} object.
       * @returns {Date}
       */
      tgReadDate() {
        const value = this.readInt();
        return new Date(value * 1e3);
      }
      /**
       * Reads a Telegram object.
       */
      tgReadObject() {
        const constructorId = this.readInt(false);
        let clazz = AllTLObjects_1.tlobjects[constructorId];
        if (clazz === void 0) {
          const value = constructorId;
          if (value === 2574415285) {
            return true;
          } else if (value === 3162085175) {
            return false;
          } else if (value === 481674261) {
            const temp = [];
            const length = this.readInt();
            for (let i = 0; i < length; i++) {
              temp.push(this.tgReadObject());
            }
            return temp;
          }
          clazz = core_1.coreObjects.get(constructorId);
          if (clazz === void 0) {
            this.seek(-4);
            const pos = this.tellPosition();
            const error = new errors_1.TypeNotFoundError(constructorId, this.read());
            this.setPosition(pos);
            throw error;
          }
        }
        return clazz.fromReader(this);
      }
      /**
       * Reads a vector (a list) of Telegram objects.
       * @returns {[Buffer]}
       */
      tgReadVector() {
        if (this.readInt(false) !== 481674261) {
          throw new Error("Invalid constructor code, vector was expected");
        }
        const count = this.readInt();
        const temp = [];
        for (let i = 0; i < count; i++) {
          temp.push(this.tgReadObject());
        }
        return temp;
      }
      // endregion
      // region Position related
      /**
       * Tells the current position on the stream.
       * @returns {number}
       */
      tellPosition() {
        return this.offset;
      }
      /**
       * Sets the current position on the stream.
       * @param position
       */
      setPosition(position) {
        this.offset = position;
      }
      /**
       * Seeks the stream position given an offset from the current position.
       * The offset may be negative.
       * @param offset
       */
      seek(offset2) {
        this.offset += offset2;
      }
    };
    exports2.BinaryReader = BinaryReader;
  }
});

// node_modules/es5-ext/global.js
var require_global = __commonJS({
  "node_modules/es5-ext/global.js"(exports2, module2) {
    var naiveFallback = function() {
      if (typeof self === "object" && self)
        return self;
      if (typeof window === "object" && window)
        return window;
      throw new Error("Unable to resolve global `this`");
    };
    module2.exports = function() {
      if (this)
        return this;
      if (typeof globalThis === "object" && globalThis)
        return globalThis;
      try {
        Object.defineProperty(Object.prototype, "__global__", {
          get: function() {
            return this;
          },
          configurable: true
        });
      } catch (error) {
        return naiveFallback();
      }
      try {
        if (!__global__)
          return naiveFallback();
        return __global__;
      } finally {
        delete Object.prototype.__global__;
      }
    }();
  }
});

// node_modules/websocket/package.json
var require_package = __commonJS({
  "node_modules/websocket/package.json"(exports2, module2) {
    module2.exports = {
      name: "websocket",
      description: "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",
      keywords: [
        "websocket",
        "websockets",
        "socket",
        "networking",
        "comet",
        "push",
        "RFC-6455",
        "realtime",
        "server",
        "client"
      ],
      author: "Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)",
      contributors: [
        "I\xF1aki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)"
      ],
      version: "1.0.34",
      repository: {
        type: "git",
        url: "https://github.com/theturtle32/WebSocket-Node.git"
      },
      homepage: "https://github.com/theturtle32/WebSocket-Node",
      engines: {
        node: ">=4.0.0"
      },
      dependencies: {
        bufferutil: "^4.0.1",
        debug: "^2.2.0",
        "es5-ext": "^0.10.50",
        "typedarray-to-buffer": "^3.1.5",
        "utf-8-validate": "^5.0.2",
        yaeti: "^0.0.6"
      },
      devDependencies: {
        "buffer-equal": "^1.0.0",
        gulp: "^4.0.2",
        "gulp-jshint": "^2.0.4",
        "jshint-stylish": "^2.2.1",
        jshint: "^2.0.0",
        tape: "^4.9.1"
      },
      config: {
        verbose: false
      },
      scripts: {
        test: "tape test/unit/*.js",
        gulp: "gulp"
      },
      main: "index",
      directories: {
        lib: "./lib"
      },
      browser: "lib/browser.js",
      license: "Apache-2.0"
    };
  }
});

// node_modules/websocket/lib/version.js
var require_version = __commonJS({
  "node_modules/websocket/lib/version.js"(exports2, module2) {
    module2.exports = require_package().version;
  }
});

// node_modules/websocket/lib/browser.js
var require_browser = __commonJS({
  "node_modules/websocket/lib/browser.js"(exports2, module2) {
    var _globalThis;
    if (typeof globalThis === "object") {
      _globalThis = globalThis;
    } else {
      try {
        _globalThis = require_global();
      } catch (error) {
      } finally {
        if (!_globalThis && typeof window !== "undefined") {
          _globalThis = window;
        }
        if (!_globalThis) {
          throw new Error("Could not determine global this");
        }
      }
    }
    var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;
    var websocket_version = require_version();
    function W3CWebSocket(uri, protocols) {
      var native_instance;
      if (protocols) {
        native_instance = new NativeWebSocket(uri, protocols);
      } else {
        native_instance = new NativeWebSocket(uri);
      }
      return native_instance;
    }
    if (NativeWebSocket) {
      ["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function(prop) {
        Object.defineProperty(W3CWebSocket, prop, {
          get: function() {
            return NativeWebSocket[prop];
          }
        });
      });
    }
    module2.exports = {
      "w3cwebsocket": NativeWebSocket ? W3CWebSocket : null,
      "version": websocket_version
    };
  }
});

// node_modules/tslib/tslib.es6.js
var tslib_es6_exports = {};
__export(tslib_es6_exports, {
  __assign: () => __assign,
  __asyncDelegator: () => __asyncDelegator,
  __asyncGenerator: () => __asyncGenerator,
  __asyncValues: () => __asyncValues,
  __await: () => __await,
  __awaiter: () => __awaiter,
  __classPrivateFieldGet: () => __classPrivateFieldGet,
  __classPrivateFieldIn: () => __classPrivateFieldIn,
  __classPrivateFieldSet: () => __classPrivateFieldSet,
  __createBinding: () => __createBinding,
  __decorate: () => __decorate,
  __exportStar: () => __exportStar,
  __extends: () => __extends,
  __generator: () => __generator,
  __importDefault: () => __importDefault,
  __importStar: () => __importStar,
  __makeTemplateObject: () => __makeTemplateObject,
  __metadata: () => __metadata,
  __param: () => __param,
  __read: () => __read,
  __rest: () => __rest,
  __spread: () => __spread,
  __spreadArray: () => __spreadArray,
  __spreadArrays: () => __spreadArrays,
  __values: () => __values2
});
function __extends(d, b) {
  if (typeof b !== "function" && b !== null)
    throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  extendStatics(d, b);
  function __() {
    this.constructor = d;
  }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
function __rest(s, e) {
  var t = {};
  for (var p in s)
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
      t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
    for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
      if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
        t[p[i]] = s[p[i]];
    }
  return t;
}
function __decorate(decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
    r = Reflect.decorate(decorators, target, key, desc);
  else
    for (var i = decorators.length - 1; i >= 0; i--)
      if (d = decorators[i])
        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
  return function(target, key) {
    decorator(target, key, paramIndex);
  };
}
function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
    return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function(resolve) {
      resolve(value);
    });
  }
  return new (P || (P = Promise))(function(resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }
    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }
    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }
    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}
function __generator(thisArg, body) {
  var _ = { label: 0, sent: function() {
    if (t[0] & 1)
      throw t[1];
    return t[1];
  }, trys: [], ops: [] }, f2, y, t, g;
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
    return this;
  }), g;
  function verb(n) {
    return function(v) {
      return step([n, v]);
    };
  }
  function step(op) {
    if (f2)
      throw new TypeError("Generator is already executing.");
    while (_)
      try {
        if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
          return t;
        if (y = 0, t)
          op = [op[0] & 2, t.value];
        switch (op[0]) {
          case 0:
          case 1:
            t = op;
            break;
          case 4:
            _.label++;
            return { value: op[1], done: false };
          case 5:
            _.label++;
            y = op[1];
            op = [0];
            continue;
          case 7:
            op = _.ops.pop();
            _.trys.pop();
            continue;
          default:
            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
              _ = 0;
              continue;
            }
            if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
              _.label = op[1];
              break;
            }
            if (op[0] === 6 && _.label < t[1]) {
              _.label = t[1];
              t = op;
              break;
            }
            if (t && _.label < t[2]) {
              _.label = t[2];
              _.ops.push(op);
              break;
            }
            if (t[2])
              _.ops.pop();
            _.trys.pop();
            continue;
        }
        op = body.call(thisArg, _);
      } catch (e) {
        op = [6, e];
        y = 0;
      } finally {
        f2 = t = 0;
      }
    if (op[0] & 5)
      throw op[1];
    return { value: op[0] ? op[1] : void 0, done: true };
  }
}
function __exportStar(m, o) {
  for (var p in m)
    if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
      __createBinding(o, m, p);
}
function __values2(o) {
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  if (m)
    return m.call(o);
  if (o && typeof o.length === "number")
    return {
      next: function() {
        if (o && i >= o.length)
          o = void 0;
        return { value: o && o[i++], done: !o };
      }
    };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m)
    return o;
  var i = m.call(o), r, ar = [], e;
  try {
    while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
      ar.push(r.value);
  } catch (error) {
    e = { error };
  } finally {
    try {
      if (r && !r.done && (m = i["return"]))
        m.call(i);
    } finally {
      if (e)
        throw e.error;
    }
  }
  return ar;
}
function __spread() {
  for (var ar = [], i = 0; i < arguments.length; i++)
    ar = ar.concat(__read(arguments[i]));
  return ar;
}
function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++)
    s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
    for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
      r[k] = a[j];
  return r;
}
function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2)
    for (var i = 0, l = from.length, ar; i < l; i++) {
      if (ar || !(i in from)) {
        if (!ar)
          ar = Array.prototype.slice.call(from, 0, i);
        ar[i] = from[i];
      }
    }
  return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator)
    throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []), i, q2 = [];
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
    return this;
  }, i;
  function verb(n) {
    if (g[n])
      i[n] = function(v) {
        return new Promise(function(a, b) {
          q2.push([n, v, a, b]) > 1 || resume(n, v);
        });
      };
  }
  function resume(n, v) {
    try {
      step(g[n](v));
    } catch (e) {
      settle(q2[0][3], e);
    }
  }
  function step(r) {
    r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q2[0][2], r);
  }
  function fulfill(value) {
    resume("next", value);
  }
  function reject(value) {
    resume("throw", value);
  }
  function settle(f2, v) {
    if (f2(v), q2.shift(), q2.length)
      resume(q2[0][0], q2[0][1]);
  }
}
function __asyncDelegator(o) {
  var i, p;
  return i = {}, verb("next"), verb("throw", function(e) {
    throw e;
  }), verb("return"), i[Symbol.iterator] = function() {
    return this;
  }, i;
  function verb(n, f2) {
    i[n] = o[n] ? function(v) {
      return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f2 ? f2(v) : v;
    } : f2;
  }
}
function __asyncValues(o) {
  if (!Symbol.asyncIterator)
    throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator], i;
  return m ? m.call(o) : (o = typeof __values2 === "function" ? __values2(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
    return this;
  }, i);
  function verb(n) {
    i[n] = o[n] && function(v) {
      return new Promise(function(resolve, reject) {
        v = o[n](v), settle(resolve, reject, v.done, v.value);
      });
    };
  }
  function settle(resolve, reject, d, v) {
    Promise.resolve(v).then(function(v2) {
      resolve({ value: v2, done: d });
    }, reject);
  }
}
function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) {
    Object.defineProperty(cooked, "raw", { value: raw });
  } else {
    cooked.raw = raw;
  }
  return cooked;
}
function __importStar(mod2) {
  if (mod2 && mod2.__esModule)
    return mod2;
  var result = {};
  if (mod2 != null) {
    for (var k in mod2)
      if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
        __createBinding(result, mod2, k);
  }
  __setModuleDefault(result, mod2);
  return result;
}
function __importDefault(mod2) {
  return mod2 && mod2.__esModule ? mod2 : { default: mod2 };
}
function __classPrivateFieldGet(receiver2, state, kind, f2) {
  if (kind === "a" && !f2)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver2 !== state || !f2 : !state.has(receiver2))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f2 : kind === "a" ? f2.call(receiver2) : f2 ? f2.value : state.get(receiver2);
}
function __classPrivateFieldSet(receiver2, state, value, kind, f2) {
  if (kind === "m")
    throw new TypeError("Private method is not writable");
  if (kind === "a" && !f2)
    throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver2 !== state || !f2 : !state.has(receiver2))
    throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind === "a" ? f2.call(receiver2, value) : f2 ? f2.value = value : state.set(receiver2, value), value;
}
function __classPrivateFieldIn(state, receiver2) {
  if (receiver2 === null || typeof receiver2 !== "object" && typeof receiver2 !== "function")
    throw new TypeError("Cannot use 'in' operator on non-object");
  return typeof state === "function" ? receiver2 === state : state.has(receiver2);
}
var extendStatics, __assign, __createBinding, __setModuleDefault;
var init_tslib_es6 = __esm({
  "node_modules/tslib/tslib.es6.js"() {
    extendStatics = function(d, b) {
      extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
        d2.__proto__ = b2;
      } || function(d2, b2) {
        for (var p in b2)
          if (Object.prototype.hasOwnProperty.call(b2, p))
            d2[p] = b2[p];
      };
      return extendStatics(d, b);
    };
    __assign = function() {
      __assign = Object.assign || function __assign2(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s)
            if (Object.prototype.hasOwnProperty.call(s, p))
              t[p] = s[p];
        }
        return t;
      };
      return __assign.apply(this, arguments);
    };
    __createBinding = Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    };
    __setModuleDefault = Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    };
  }
});

// node_modules/async-mutex/lib/errors.js
var require_errors2 = __commonJS({
  "node_modules/async-mutex/lib/errors.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.E_CANCELED = exports2.E_ALREADY_LOCKED = exports2.E_TIMEOUT = void 0;
    exports2.E_TIMEOUT = new Error("timeout while waiting for mutex to become available");
    exports2.E_ALREADY_LOCKED = new Error("mutex already locked");
    exports2.E_CANCELED = new Error("request for lock canceled");
  }
});

// node_modules/async-mutex/lib/Semaphore.js
var require_Semaphore = __commonJS({
  "node_modules/async-mutex/lib/Semaphore.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var errors_1 = require_errors2();
    var Semaphore = (
      /** @class */
      function() {
        function Semaphore2(_maxConcurrency, _cancelError) {
          if (_cancelError === void 0) {
            _cancelError = errors_1.E_CANCELED;
          }
          this._maxConcurrency = _maxConcurrency;
          this._cancelError = _cancelError;
          this._queue = [];
          this._waiters = [];
          if (_maxConcurrency <= 0) {
            throw new Error("semaphore must be initialized to a positive value");
          }
          this._value = _maxConcurrency;
        }
        Semaphore2.prototype.acquire = function() {
          var _this = this;
          var locked = this.isLocked();
          var ticketPromise = new Promise(function(resolve, reject) {
            return _this._queue.push({ resolve, reject });
          });
          if (!locked)
            this._dispatch();
          return ticketPromise;
        };
        Semaphore2.prototype.runExclusive = function(callback) {
          return (0, tslib_1.__awaiter)(this, void 0, void 0, function() {
            var _a, value, release;
            return (0, tslib_1.__generator)(this, function(_b) {
              switch (_b.label) {
                case 0:
                  return [4, this.acquire()];
                case 1:
                  _a = _b.sent(), value = _a[0], release = _a[1];
                  _b.label = 2;
                case 2:
                  _b.trys.push([2, , 4, 5]);
                  return [4, callback(value)];
                case 3:
                  return [2, _b.sent()];
                case 4:
                  release();
                  return [
                    7
                    /*endfinally*/
                  ];
                case 5:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        Semaphore2.prototype.waitForUnlock = function() {
          return (0, tslib_1.__awaiter)(this, void 0, void 0, function() {
            var waitPromise;
            var _this = this;
            return (0, tslib_1.__generator)(this, function(_a) {
              if (!this.isLocked()) {
                return [2, Promise.resolve()];
              }
              waitPromise = new Promise(function(resolve) {
                return _this._waiters.push({ resolve });
              });
              return [2, waitPromise];
            });
          });
        };
        Semaphore2.prototype.isLocked = function() {
          return this._value <= 0;
        };
        Semaphore2.prototype.release = function() {
          if (this._maxConcurrency > 1) {
            throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");
          }
          if (this._currentReleaser) {
            var releaser = this._currentReleaser;
            this._currentReleaser = void 0;
            releaser();
          }
        };
        Semaphore2.prototype.cancel = function() {
          var _this = this;
          this._queue.forEach(function(ticket) {
            return ticket.reject(_this._cancelError);
          });
          this._queue = [];
        };
        Semaphore2.prototype._dispatch = function() {
          var _this = this;
          var nextTicket = this._queue.shift();
          if (!nextTicket)
            return;
          var released = false;
          this._currentReleaser = function() {
            if (released)
              return;
            released = true;
            _this._value++;
            _this._resolveWaiters();
            _this._dispatch();
          };
          nextTicket.resolve([this._value--, this._currentReleaser]);
        };
        Semaphore2.prototype._resolveWaiters = function() {
          this._waiters.forEach(function(waiter) {
            return waiter.resolve();
          });
          this._waiters = [];
        };
        return Semaphore2;
      }()
    );
    exports2.default = Semaphore;
  }
});

// node_modules/async-mutex/lib/Mutex.js
var require_Mutex = __commonJS({
  "node_modules/async-mutex/lib/Mutex.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var Semaphore_1 = require_Semaphore();
    var Mutex = (
      /** @class */
      function() {
        function Mutex2(cancelError) {
          this._semaphore = new Semaphore_1.default(1, cancelError);
        }
        Mutex2.prototype.acquire = function() {
          return (0, tslib_1.__awaiter)(this, void 0, void 0, function() {
            var _a, releaser;
            return (0, tslib_1.__generator)(this, function(_b) {
              switch (_b.label) {
                case 0:
                  return [4, this._semaphore.acquire()];
                case 1:
                  _a = _b.sent(), releaser = _a[1];
                  return [2, releaser];
              }
            });
          });
        };
        Mutex2.prototype.runExclusive = function(callback) {
          return this._semaphore.runExclusive(function() {
            return callback();
          });
        };
        Mutex2.prototype.isLocked = function() {
          return this._semaphore.isLocked();
        };
        Mutex2.prototype.waitForUnlock = function() {
          return this._semaphore.waitForUnlock();
        };
        Mutex2.prototype.release = function() {
          this._semaphore.release();
        };
        Mutex2.prototype.cancel = function() {
          return this._semaphore.cancel();
        };
        return Mutex2;
      }()
    );
    exports2.default = Mutex;
  }
});

// node_modules/async-mutex/lib/withTimeout.js
var require_withTimeout = __commonJS({
  "node_modules/async-mutex/lib/withTimeout.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.withTimeout = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var errors_1 = require_errors2();
    function withTimeout(sync, timeout, timeoutError) {
      var _this = this;
      if (timeoutError === void 0) {
        timeoutError = errors_1.E_TIMEOUT;
      }
      return {
        acquire: function() {
          return new Promise(function(resolve, reject) {
            return (0, tslib_1.__awaiter)(_this, void 0, void 0, function() {
              var isTimeout, handle, ticket, release, e_1;
              return (0, tslib_1.__generator)(this, function(_a) {
                switch (_a.label) {
                  case 0:
                    isTimeout = false;
                    handle = setTimeout(function() {
                      isTimeout = true;
                      reject(timeoutError);
                    }, timeout);
                    _a.label = 1;
                  case 1:
                    _a.trys.push([1, 3, , 4]);
                    return [4, sync.acquire()];
                  case 2:
                    ticket = _a.sent();
                    if (isTimeout) {
                      release = Array.isArray(ticket) ? ticket[1] : ticket;
                      release();
                    } else {
                      clearTimeout(handle);
                      resolve(ticket);
                    }
                    return [3, 4];
                  case 3:
                    e_1 = _a.sent();
                    if (!isTimeout) {
                      clearTimeout(handle);
                      reject(e_1);
                    }
                    return [3, 4];
                  case 4:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          });
        },
        runExclusive: function(callback) {
          return (0, tslib_1.__awaiter)(this, void 0, void 0, function() {
            var release, ticket;
            return (0, tslib_1.__generator)(this, function(_a) {
              switch (_a.label) {
                case 0:
                  release = function() {
                    return void 0;
                  };
                  _a.label = 1;
                case 1:
                  _a.trys.push([1, , 7, 8]);
                  return [4, this.acquire()];
                case 2:
                  ticket = _a.sent();
                  if (!Array.isArray(ticket))
                    return [3, 4];
                  release = ticket[1];
                  return [4, callback(ticket[0])];
                case 3:
                  return [2, _a.sent()];
                case 4:
                  release = ticket;
                  return [4, callback()];
                case 5:
                  return [2, _a.sent()];
                case 6:
                  return [3, 8];
                case 7:
                  release();
                  return [
                    7
                    /*endfinally*/
                  ];
                case 8:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        },
        /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */
        release: function() {
          sync.release();
        },
        cancel: function() {
          return sync.cancel();
        },
        waitForUnlock: function() {
          return sync.waitForUnlock();
        },
        isLocked: function() {
          return sync.isLocked();
        }
      };
    }
    exports2.withTimeout = withTimeout;
  }
});

// node_modules/async-mutex/lib/tryAcquire.js
var require_tryAcquire = __commonJS({
  "node_modules/async-mutex/lib/tryAcquire.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.tryAcquire = void 0;
    var errors_1 = require_errors2();
    var withTimeout_1 = require_withTimeout();
    function tryAcquire(sync, alreadyAcquiredError) {
      if (alreadyAcquiredError === void 0) {
        alreadyAcquiredError = errors_1.E_ALREADY_LOCKED;
      }
      return (0, withTimeout_1.withTimeout)(sync, 0, alreadyAcquiredError);
    }
    exports2.tryAcquire = tryAcquire;
  }
});

// node_modules/async-mutex/lib/index.js
var require_lib7 = __commonJS({
  "node_modules/async-mutex/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.tryAcquire = exports2.withTimeout = exports2.Semaphore = exports2.Mutex = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var Mutex_1 = require_Mutex();
    Object.defineProperty(exports2, "Mutex", { enumerable: true, get: function() {
      return Mutex_1.default;
    } });
    var Semaphore_1 = require_Semaphore();
    Object.defineProperty(exports2, "Semaphore", { enumerable: true, get: function() {
      return Semaphore_1.default;
    } });
    var withTimeout_1 = require_withTimeout();
    Object.defineProperty(exports2, "withTimeout", { enumerable: true, get: function() {
      return withTimeout_1.withTimeout;
    } });
    var tryAcquire_1 = require_tryAcquire();
    Object.defineProperty(exports2, "tryAcquire", { enumerable: true, get: function() {
      return tryAcquire_1.tryAcquire;
    } });
    (0, tslib_1.__exportStar)(require_errors2(), exports2);
  }
});

// node_modules/telegram/extensions/PromisedWebSockets.js
var require_PromisedWebSockets = __commonJS({
  "node_modules/telegram/extensions/PromisedWebSockets.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.PromisedWebSockets = void 0;
    var websocket_1 = require_browser();
    var async_mutex_1 = require_lib7();
    var platform_1 = require_platform();
    var mutex = new async_mutex_1.Mutex();
    var closeError = new Error("WebSocket was closed");
    var PromisedWebSockets2 = class {
      constructor() {
        this.client = void 0;
        this.stream = Buffer.alloc(0);
        this.closed = true;
      }
      async readExactly(number) {
        let readData = Buffer.alloc(0);
        while (true) {
          const thisTime = await this.read(number);
          readData = Buffer.concat([readData, thisTime]);
          number = number - thisTime.length;
          if (!number) {
            return readData;
          }
        }
      }
      async read(number) {
        if (this.closed) {
          throw closeError;
        }
        await this.canRead;
        if (this.closed) {
          throw closeError;
        }
        const toReturn = this.stream.slice(0, number);
        this.stream = this.stream.slice(number);
        if (this.stream.length === 0) {
          this.canRead = new Promise((resolve) => {
            this.resolveRead = resolve;
          });
        }
        return toReturn;
      }
      async readAll() {
        if (this.closed || !await this.canRead) {
          throw closeError;
        }
        const toReturn = this.stream;
        this.stream = Buffer.alloc(0);
        this.canRead = new Promise((resolve) => {
          this.resolveRead = resolve;
        });
        return toReturn;
      }
      getWebSocketLink(ip, port, testServers) {
        if (port === 443) {
          return `wss://${ip}:${port}/apiws${testServers ? "_test" : ""}`;
        } else {
          return `ws://${ip}:${port}/apiws${testServers ? "_test" : ""}`;
        }
      }
      async connect(port, ip, testServers = false) {
        this.stream = Buffer.alloc(0);
        this.canRead = new Promise((resolve) => {
          this.resolveRead = resolve;
        });
        this.closed = false;
        this.website = this.getWebSocketLink(ip, port, testServers);
        this.client = new websocket_1.w3cwebsocket(this.website, "binary");
        return new Promise((resolve, reject) => {
          if (this.client) {
            this.client.onopen = () => {
              this.receive();
              resolve(this);
            };
            this.client.onerror = (error) => {
              reject(error);
            };
            this.client.onclose = () => {
              if (this.resolveRead) {
                this.resolveRead(false);
              }
              this.closed = true;
            };
            if (platform_1.isBrowser) {
              window.addEventListener("offline", async () => {
                await this.close();
                if (this.resolveRead) {
                  this.resolveRead(false);
                }
              });
            }
          }
        });
      }
      write(data) {
        if (this.closed) {
          throw closeError;
        }
        if (this.client) {
          this.client.send(data);
        }
      }
      async close() {
        if (this.client) {
          await this.client.close();
        }
        this.closed = true;
      }
      async receive() {
        if (this.client) {
          this.client.onmessage = async (message) => {
            const release = await mutex.acquire();
            try {
              let data;
              data = Buffer.from(await new Response(message.data).arrayBuffer());
              this.stream = Buffer.concat([this.stream, data]);
              if (this.resolveRead) {
                this.resolveRead(true);
              }
            } finally {
              release();
            }
          };
        }
      }
      toString() {
        return "PromisedWebSocket";
      }
    };
    exports2.PromisedWebSockets = PromisedWebSockets2;
  }
});

// node_modules/telegram/extensions/net.js
var require_net = __commonJS({
  "node_modules/telegram/extensions/net.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    __exportStar2(require("net"), exports2);
  }
});

// node_modules/ip/lib/ip.js
var require_ip = __commonJS({
  "node_modules/ip/lib/ip.js"(exports2) {
    var ip = exports2;
    var { Buffer: Buffer3 } = require("buffer");
    var os3 = require("os");
    ip.toBuffer = function(ip2, buff, offset2) {
      offset2 = ~~offset2;
      let result;
      if (this.isV4Format(ip2)) {
        result = buff || Buffer3.alloc(offset2 + 4);
        ip2.split(/\./g).map((byte) => {
          result[offset2++] = parseInt(byte, 10) & 255;
        });
      } else if (this.isV6Format(ip2)) {
        const sections = ip2.split(":", 8);
        let i;
        for (i = 0; i < sections.length; i++) {
          const isv4 = this.isV4Format(sections[i]);
          let v4Buffer;
          if (isv4) {
            v4Buffer = this.toBuffer(sections[i]);
            sections[i] = v4Buffer.slice(0, 2).toString("hex");
          }
          if (v4Buffer && ++i < 8) {
            sections.splice(i, 0, v4Buffer.slice(2, 4).toString("hex"));
          }
        }
        if (sections[0] === "") {
          while (sections.length < 8)
            sections.unshift("0");
        } else if (sections[sections.length - 1] === "") {
          while (sections.length < 8)
            sections.push("0");
        } else if (sections.length < 8) {
          for (i = 0; i < sections.length && sections[i] !== ""; i++)
            ;
          const argv = [i, 1];
          for (i = 9 - sections.length; i > 0; i--) {
            argv.push("0");
          }
          sections.splice(...argv);
        }
        result = buff || Buffer3.alloc(offset2 + 16);
        for (i = 0; i < sections.length; i++) {
          const word = parseInt(sections[i], 16);
          result[offset2++] = word >> 8 & 255;
          result[offset2++] = word & 255;
        }
      }
      if (!result) {
        throw Error(`Invalid ip address: ${ip2}`);
      }
      return result;
    };
    ip.toString = function(buff, offset2, length) {
      offset2 = ~~offset2;
      length = length || buff.length - offset2;
      let result = [];
      if (length === 4) {
        for (let i = 0; i < length; i++) {
          result.push(buff[offset2 + i]);
        }
        result = result.join(".");
      } else if (length === 16) {
        for (let i = 0; i < length; i += 2) {
          result.push(buff.readUInt16BE(offset2 + i).toString(16));
        }
        result = result.join(":");
        result = result.replace(/(^|:)0(:0)*:0(:|$)/, "$1::$3");
        result = result.replace(/:{3,4}/, "::");
      }
      return result;
    };
    var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/;
    var ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;
    ip.isV4Format = function(ip2) {
      return ipv4Regex.test(ip2);
    };
    ip.isV6Format = function(ip2) {
      return ipv6Regex.test(ip2);
    };
    function _normalizeFamily(family) {
      if (family === 4) {
        return "ipv4";
      }
      if (family === 6) {
        return "ipv6";
      }
      return family ? family.toLowerCase() : "ipv4";
    }
    ip.fromPrefixLen = function(prefixlen, family) {
      if (prefixlen > 32) {
        family = "ipv6";
      } else {
        family = _normalizeFamily(family);
      }
      let len = 4;
      if (family === "ipv6") {
        len = 16;
      }
      const buff = Buffer3.alloc(len);
      for (let i = 0, n = buff.length; i < n; ++i) {
        let bits = 8;
        if (prefixlen < 8) {
          bits = prefixlen;
        }
        prefixlen -= bits;
        buff[i] = ~(255 >> bits) & 255;
      }
      return ip.toString(buff);
    };
    ip.mask = function(addr, mask) {
      addr = ip.toBuffer(addr);
      mask = ip.toBuffer(mask);
      const result = Buffer3.alloc(Math.max(addr.length, mask.length));
      let i;
      if (addr.length === mask.length) {
        for (i = 0; i < addr.length; i++) {
          result[i] = addr[i] & mask[i];
        }
      } else if (mask.length === 4) {
        for (i = 0; i < mask.length; i++) {
          result[i] = addr[addr.length - 4 + i] & mask[i];
        }
      } else {
        for (i = 0; i < result.length - 6; i++) {
          result[i] = 0;
        }
        result[10] = 255;
        result[11] = 255;
        for (i = 0; i < addr.length; i++) {
          result[i + 12] = addr[i] & mask[i + 12];
        }
        i += 12;
      }
      for (; i < result.length; i++) {
        result[i] = 0;
      }
      return ip.toString(result);
    };
    ip.cidr = function(cidrString) {
      const cidrParts = cidrString.split("/");
      const addr = cidrParts[0];
      if (cidrParts.length !== 2) {
        throw new Error(`invalid CIDR subnet: ${addr}`);
      }
      const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
      return ip.mask(addr, mask);
    };
    ip.subnet = function(addr, mask) {
      const networkAddress = ip.toLong(ip.mask(addr, mask));
      const maskBuffer = ip.toBuffer(mask);
      let maskLength = 0;
      for (let i = 0; i < maskBuffer.length; i++) {
        if (maskBuffer[i] === 255) {
          maskLength += 8;
        } else {
          let octet = maskBuffer[i] & 255;
          while (octet) {
            octet = octet << 1 & 255;
            maskLength++;
          }
        }
      }
      const numberOfAddresses = 2 ** (32 - maskLength);
      return {
        networkAddress: ip.fromLong(networkAddress),
        firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1),
        lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2),
        broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1),
        subnetMask: mask,
        subnetMaskLength: maskLength,
        numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2,
        length: numberOfAddresses,
        contains(other) {
          return networkAddress === ip.toLong(ip.mask(other, mask));
        }
      };
    };
    ip.cidrSubnet = function(cidrString) {
      const cidrParts = cidrString.split("/");
      const addr = cidrParts[0];
      if (cidrParts.length !== 2) {
        throw new Error(`invalid CIDR subnet: ${addr}`);
      }
      const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
      return ip.subnet(addr, mask);
    };
    ip.not = function(addr) {
      const buff = ip.toBuffer(addr);
      for (let i = 0; i < buff.length; i++) {
        buff[i] = 255 ^ buff[i];
      }
      return ip.toString(buff);
    };
    ip.or = function(a, b) {
      a = ip.toBuffer(a);
      b = ip.toBuffer(b);
      if (a.length === b.length) {
        for (let i = 0; i < a.length; ++i) {
          a[i] |= b[i];
        }
        return ip.toString(a);
      }
      let buff = a;
      let other = b;
      if (b.length > a.length) {
        buff = b;
        other = a;
      }
      const offset2 = buff.length - other.length;
      for (let i = offset2; i < buff.length; ++i) {
        buff[i] |= other[i - offset2];
      }
      return ip.toString(buff);
    };
    ip.isEqual = function(a, b) {
      a = ip.toBuffer(a);
      b = ip.toBuffer(b);
      if (a.length === b.length) {
        for (let i = 0; i < a.length; i++) {
          if (a[i] !== b[i])
            return false;
        }
        return true;
      }
      if (b.length === 4) {
        const t = b;
        b = a;
        a = t;
      }
      for (let i = 0; i < 10; i++) {
        if (b[i] !== 0)
          return false;
      }
      const word = b.readUInt16BE(10);
      if (word !== 0 && word !== 65535)
        return false;
      for (let i = 0; i < 4; i++) {
        if (a[i] !== b[i + 12])
          return false;
      }
      return true;
    };
    ip.isPrivate = function(addr) {
      return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^f[cd][0-9a-f]{2}:/i.test(addr) || /^fe80:/i.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr);
    };
    ip.isPublic = function(addr) {
      return !ip.isPrivate(addr);
    };
    ip.isLoopback = function(addr) {
      return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr);
    };
    ip.loopback = function(family) {
      family = _normalizeFamily(family);
      if (family !== "ipv4" && family !== "ipv6") {
        throw new Error("family must be ipv4 or ipv6");
      }
      return family === "ipv4" ? "127.0.0.1" : "fe80::1";
    };
    ip.address = function(name, family) {
      const interfaces = os3.networkInterfaces();
      family = _normalizeFamily(family);
      if (name && name !== "private" && name !== "public") {
        const res = interfaces[name].filter((details) => {
          const itemFamily = _normalizeFamily(details.family);
          return itemFamily === family;
        });
        if (res.length === 0) {
          return void 0;
        }
        return res[0].address;
      }
      const all = Object.keys(interfaces).map((nic) => {
        const addresses = interfaces[nic].filter((details) => {
          details.family = _normalizeFamily(details.family);
          if (details.family !== family || ip.isLoopback(details.address)) {
            return false;
          }
          if (!name) {
            return true;
          }
          return name === "public" ? ip.isPrivate(details.address) : ip.isPublic(details.address);
        });
        return addresses.length ? addresses[0].address : void 0;
      }).filter(Boolean);
      return !all.length ? ip.loopback(family) : all[0];
    };
    ip.toLong = function(ip2) {
      let ipl = 0;
      ip2.split(".").forEach((octet) => {
        ipl <<= 8;
        ipl += parseInt(octet);
      });
      return ipl >>> 0;
    };
    ip.fromLong = function(ipl) {
      return `${ipl >>> 24}.${ipl >> 16 & 255}.${ipl >> 8 & 255}.${ipl & 255}`;
    };
  }
});

// node_modules/smart-buffer/build/utils.js
var require_utils = __commonJS({
  "node_modules/smart-buffer/build/utils.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var buffer_1 = require("buffer");
    var ERRORS = {
      INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",
      INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.",
      INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.",
      INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",
      INVALID_OFFSET: "An invalid offset value was provided.",
      INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.",
      INVALID_LENGTH: "An invalid length value was provided.",
      INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.",
      INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.",
      INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",
      INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.",
      INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data."
    };
    exports2.ERRORS = ERRORS;
    function checkEncoding(encoding) {
      if (!buffer_1.Buffer.isEncoding(encoding)) {
        throw new Error(ERRORS.INVALID_ENCODING);
      }
    }
    exports2.checkEncoding = checkEncoding;
    function isFiniteInteger(value) {
      return typeof value === "number" && isFinite(value) && isInteger(value);
    }
    exports2.isFiniteInteger = isFiniteInteger;
    function checkOffsetOrLengthValue(value, offset2) {
      if (typeof value === "number") {
        if (!isFiniteInteger(value) || value < 0) {
          throw new Error(offset2 ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH);
        }
      } else {
        throw new Error(offset2 ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER);
      }
    }
    function checkLengthValue(length) {
      checkOffsetOrLengthValue(length, false);
    }
    exports2.checkLengthValue = checkLengthValue;
    function checkOffsetValue(offset2) {
      checkOffsetOrLengthValue(offset2, true);
    }
    exports2.checkOffsetValue = checkOffsetValue;
    function checkTargetOffset(offset2, buff) {
      if (offset2 < 0 || offset2 > buff.length) {
        throw new Error(ERRORS.INVALID_TARGET_OFFSET);
      }
    }
    exports2.checkTargetOffset = checkTargetOffset;
    function isInteger(value) {
      return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
    }
    function bigIntAndBufferInt64Check(bufferMethod) {
      if (typeof BigInt === "undefined") {
        throw new Error("Platform does not support JS BigInt type.");
      }
      if (typeof buffer_1.Buffer.prototype[bufferMethod] === "undefined") {
        throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`);
      }
    }
    exports2.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;
  }
});

// node_modules/smart-buffer/build/smartbuffer.js
var require_smartbuffer = __commonJS({
  "node_modules/smart-buffer/build/smartbuffer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var utils_1 = require_utils();
    var DEFAULT_SMARTBUFFER_SIZE = 4096;
    var DEFAULT_SMARTBUFFER_ENCODING = "utf8";
    var SmartBuffer = class {
      /**
       * Creates a new SmartBuffer instance.
       *
       * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance.
       */
      constructor(options) {
        this.length = 0;
        this._encoding = DEFAULT_SMARTBUFFER_ENCODING;
        this._writeOffset = 0;
        this._readOffset = 0;
        if (SmartBuffer.isSmartBufferOptions(options)) {
          if (options.encoding) {
            utils_1.checkEncoding(options.encoding);
            this._encoding = options.encoding;
          }
          if (options.size) {
            if (utils_1.isFiniteInteger(options.size) && options.size > 0) {
              this._buff = Buffer.allocUnsafe(options.size);
            } else {
              throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE);
            }
          } else if (options.buff) {
            if (Buffer.isBuffer(options.buff)) {
              this._buff = options.buff;
              this.length = options.buff.length;
            } else {
              throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER);
            }
          } else {
            this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
          }
        } else {
          if (typeof options !== "undefined") {
            throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT);
          }
          this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
        }
      }
      /**
       * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
       *
       * @param size { Number } The size of the internal Buffer.
       * @param encoding { String } The BufferEncoding to use for strings.
       *
       * @return { SmartBuffer }
       */
      static fromSize(size, encoding) {
        return new this({
          size,
          encoding
        });
      }
      /**
       * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.
       *
       * @param buffer { Buffer } The Buffer to use as the internal Buffer value.
       * @param encoding { String } The BufferEncoding to use for strings.
       *
       * @return { SmartBuffer }
       */
      static fromBuffer(buff, encoding) {
        return new this({
          buff,
          encoding
        });
      }
      /**
       * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.
       *
       * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.
       */
      static fromOptions(options) {
        return new this(options);
      }
      /**
       * Type checking function that determines if an object is a SmartBufferOptions object.
       */
      static isSmartBufferOptions(options) {
        const castOptions = options;
        return castOptions && (castOptions.encoding !== void 0 || castOptions.size !== void 0 || castOptions.buff !== void 0);
      }
      // Signed integers
      /**
       * Reads an Int8 value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt8(offset2) {
        return this._readNumberValue(Buffer.prototype.readInt8, 1, offset2);
      }
      /**
       * Reads an Int16BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt16BE(offset2) {
        return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset2);
      }
      /**
       * Reads an Int16LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt16LE(offset2) {
        return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset2);
      }
      /**
       * Reads an Int32BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt32BE(offset2) {
        return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset2);
      }
      /**
       * Reads an Int32LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt32LE(offset2) {
        return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset2);
      }
      /**
       * Reads a BigInt64BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigInt64BE(offset2) {
        utils_1.bigIntAndBufferInt64Check("readBigInt64BE");
        return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset2);
      }
      /**
       * Reads a BigInt64LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigInt64LE(offset2) {
        utils_1.bigIntAndBufferInt64Check("readBigInt64LE");
        return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset2);
      }
      /**
       * Writes an Int8 value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt8(value, offset2) {
        this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset2);
        return this;
      }
      /**
       * Inserts an Int8 value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt8(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset2);
      }
      /**
       * Writes an Int16BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt16BE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset2);
      }
      /**
       * Inserts an Int16BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt16BE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset2);
      }
      /**
       * Writes an Int16LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt16LE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset2);
      }
      /**
       * Inserts an Int16LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt16LE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset2);
      }
      /**
       * Writes an Int32BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt32BE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset2);
      }
      /**
       * Inserts an Int32BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt32BE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset2);
      }
      /**
       * Writes an Int32LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt32LE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset2);
      }
      /**
       * Inserts an Int32LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt32LE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset2);
      }
      /**
       * Writes a BigInt64BE value to the current write position (or at optional offset).
       *
       * @param value { BigInt } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigInt64BE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64BE");
        return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset2);
      }
      /**
       * Inserts a BigInt64BE value at the given offset value.
       *
       * @param value { BigInt } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigInt64BE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64BE");
        return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset2);
      }
      /**
       * Writes a BigInt64LE value to the current write position (or at optional offset).
       *
       * @param value { BigInt } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigInt64LE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64LE");
        return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset2);
      }
      /**
       * Inserts a Int64LE value at the given offset value.
       *
       * @param value { BigInt } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigInt64LE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64LE");
        return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset2);
      }
      // Unsigned Integers
      /**
       * Reads an UInt8 value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt8(offset2) {
        return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset2);
      }
      /**
       * Reads an UInt16BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt16BE(offset2) {
        return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset2);
      }
      /**
       * Reads an UInt16LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt16LE(offset2) {
        return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset2);
      }
      /**
       * Reads an UInt32BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt32BE(offset2) {
        return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset2);
      }
      /**
       * Reads an UInt32LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt32LE(offset2) {
        return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset2);
      }
      /**
       * Reads a BigUInt64BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigUInt64BE(offset2) {
        utils_1.bigIntAndBufferInt64Check("readBigUInt64BE");
        return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset2);
      }
      /**
       * Reads a BigUInt64LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigUInt64LE(offset2) {
        utils_1.bigIntAndBufferInt64Check("readBigUInt64LE");
        return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset2);
      }
      /**
       * Writes an UInt8 value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt8(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset2);
      }
      /**
       * Inserts an UInt8 value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt8(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset2);
      }
      /**
       * Writes an UInt16BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt16BE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset2);
      }
      /**
       * Inserts an UInt16BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt16BE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset2);
      }
      /**
       * Writes an UInt16LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt16LE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset2);
      }
      /**
       * Inserts an UInt16LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt16LE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset2);
      }
      /**
       * Writes an UInt32BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt32BE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset2);
      }
      /**
       * Inserts an UInt32BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt32BE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset2);
      }
      /**
       * Writes an UInt32LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt32LE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset2);
      }
      /**
       * Inserts an UInt32LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt32LE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset2);
      }
      /**
       * Writes a BigUInt64BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigUInt64BE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE");
        return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset2);
      }
      /**
       * Inserts a BigUInt64BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigUInt64BE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE");
        return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset2);
      }
      /**
       * Writes a BigUInt64LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigUInt64LE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE");
        return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset2);
      }
      /**
       * Inserts a BigUInt64LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigUInt64LE(value, offset2) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE");
        return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset2);
      }
      // Floating Point
      /**
       * Reads an FloatBE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readFloatBE(offset2) {
        return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset2);
      }
      /**
       * Reads an FloatLE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readFloatLE(offset2) {
        return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset2);
      }
      /**
       * Writes a FloatBE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeFloatBE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset2);
      }
      /**
       * Inserts a FloatBE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertFloatBE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset2);
      }
      /**
       * Writes a FloatLE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeFloatLE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset2);
      }
      /**
       * Inserts a FloatLE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertFloatLE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset2);
      }
      // Double Floating Point
      /**
       * Reads an DoublEBE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readDoubleBE(offset2) {
        return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset2);
      }
      /**
       * Reads an DoubleLE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readDoubleLE(offset2) {
        return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset2);
      }
      /**
       * Writes a DoubleBE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeDoubleBE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset2);
      }
      /**
       * Inserts a DoubleBE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertDoubleBE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset2);
      }
      /**
       * Writes a DoubleLE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeDoubleLE(value, offset2) {
        return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset2);
      }
      /**
       * Inserts a DoubleLE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertDoubleLE(value, offset2) {
        return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset2);
      }
      // Strings
      /**
       * Reads a String from the current read position.
       *
       * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for
       *             the string (Defaults to instance level encoding).
       * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
       *
       * @return { String }
       */
      readString(arg1, encoding) {
        let lengthVal;
        if (typeof arg1 === "number") {
          utils_1.checkLengthValue(arg1);
          lengthVal = Math.min(arg1, this.length - this._readOffset);
        } else {
          encoding = arg1;
          lengthVal = this.length - this._readOffset;
        }
        if (typeof encoding !== "undefined") {
          utils_1.checkEncoding(encoding);
        }
        const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding);
        this._readOffset += lengthVal;
        return value;
      }
      /**
       * Inserts a String
       *
       * @param value { String } The String value to insert.
       * @param offset { Number } The offset to insert the string at.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      insertString(value, offset2, encoding) {
        utils_1.checkOffsetValue(offset2);
        return this._handleString(value, true, offset2, encoding);
      }
      /**
       * Writes a String
       *
       * @param value { String } The String value to write.
       * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      writeString(value, arg2, encoding) {
        return this._handleString(value, false, arg2, encoding);
      }
      /**
       * Reads a null-terminated String from the current read position.
       *
       * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
       *
       * @return { String }
       */
      readStringNT(encoding) {
        if (typeof encoding !== "undefined") {
          utils_1.checkEncoding(encoding);
        }
        let nullPos = this.length;
        for (let i = this._readOffset; i < this.length; i++) {
          if (this._buff[i] === 0) {
            nullPos = i;
            break;
          }
        }
        const value = this._buff.slice(this._readOffset, nullPos);
        this._readOffset = nullPos + 1;
        return value.toString(encoding || this._encoding);
      }
      /**
       * Inserts a null-terminated String.
       *
       * @param value { String } The String value to write.
       * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      insertStringNT(value, offset2, encoding) {
        utils_1.checkOffsetValue(offset2);
        this.insertString(value, offset2, encoding);
        this.insertUInt8(0, offset2 + value.length);
        return this;
      }
      /**
       * Writes a null-terminated String.
       *
       * @param value { String } The String value to write.
       * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      writeStringNT(value, arg2, encoding) {
        this.writeString(value, arg2, encoding);
        this.writeUInt8(0, typeof arg2 === "number" ? arg2 + value.length : this.writeOffset);
        return this;
      }
      // Buffers
      /**
       * Reads a Buffer from the internal read position.
       *
       * @param length { Number } The length of data to read as a Buffer.
       *
       * @return { Buffer }
       */
      readBuffer(length) {
        if (typeof length !== "undefined") {
          utils_1.checkLengthValue(length);
        }
        const lengthVal = typeof length === "number" ? length : this.length;
        const endPoint = Math.min(this.length, this._readOffset + lengthVal);
        const value = this._buff.slice(this._readOffset, endPoint);
        this._readOffset = endPoint;
        return value;
      }
      /**
       * Writes a Buffer to the current write position.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      insertBuffer(value, offset2) {
        utils_1.checkOffsetValue(offset2);
        return this._handleBuffer(value, true, offset2);
      }
      /**
       * Writes a Buffer to the current write position.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      writeBuffer(value, offset2) {
        return this._handleBuffer(value, false, offset2);
      }
      /**
       * Reads a null-terminated Buffer from the current read poisiton.
       *
       * @return { Buffer }
       */
      readBufferNT() {
        let nullPos = this.length;
        for (let i = this._readOffset; i < this.length; i++) {
          if (this._buff[i] === 0) {
            nullPos = i;
            break;
          }
        }
        const value = this._buff.slice(this._readOffset, nullPos);
        this._readOffset = nullPos + 1;
        return value;
      }
      /**
       * Inserts a null-terminated Buffer.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      insertBufferNT(value, offset2) {
        utils_1.checkOffsetValue(offset2);
        this.insertBuffer(value, offset2);
        this.insertUInt8(0, offset2 + value.length);
        return this;
      }
      /**
       * Writes a null-terminated Buffer.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      writeBufferNT(value, offset2) {
        if (typeof offset2 !== "undefined") {
          utils_1.checkOffsetValue(offset2);
        }
        this.writeBuffer(value, offset2);
        this.writeUInt8(0, typeof offset2 === "number" ? offset2 + value.length : this._writeOffset);
        return this;
      }
      /**
       * Clears the SmartBuffer instance to its original empty state.
       */
      clear() {
        this._writeOffset = 0;
        this._readOffset = 0;
        this.length = 0;
        return this;
      }
      /**
       * Gets the remaining data left to be read from the SmartBuffer instance.
       *
       * @return { Number }
       */
      remaining() {
        return this.length - this._readOffset;
      }
      /**
       * Gets the current read offset value of the SmartBuffer instance.
       *
       * @return { Number }
       */
      get readOffset() {
        return this._readOffset;
      }
      /**
       * Sets the read offset value of the SmartBuffer instance.
       *
       * @param offset { Number } - The offset value to set.
       */
      set readOffset(offset2) {
        utils_1.checkOffsetValue(offset2);
        utils_1.checkTargetOffset(offset2, this);
        this._readOffset = offset2;
      }
      /**
       * Gets the current write offset value of the SmartBuffer instance.
       *
       * @return { Number }
       */
      get writeOffset() {
        return this._writeOffset;
      }
      /**
       * Sets the write offset value of the SmartBuffer instance.
       *
       * @param offset { Number } - The offset value to set.
       */
      set writeOffset(offset2) {
        utils_1.checkOffsetValue(offset2);
        utils_1.checkTargetOffset(offset2, this);
        this._writeOffset = offset2;
      }
      /**
       * Gets the currently set string encoding of the SmartBuffer instance.
       *
       * @return { BufferEncoding } The string Buffer encoding currently set.
       */
      get encoding() {
        return this._encoding;
      }
      /**
       * Sets the string encoding of the SmartBuffer instance.
       *
       * @param encoding { BufferEncoding } The string Buffer encoding to set.
       */
      set encoding(encoding) {
        utils_1.checkEncoding(encoding);
        this._encoding = encoding;
      }
      /**
       * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer)
       *
       * @return { Buffer } The Buffer value.
       */
      get internalBuffer() {
        return this._buff;
      }
      /**
       * Gets the value of the internal managed Buffer (Includes managed data only)
       *
       * @param { Buffer }
       */
      toBuffer() {
        return this._buff.slice(0, this.length);
      }
      /**
       * Gets the String value of the internal managed Buffer
       *
       * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
       */
      toString(encoding) {
        const encodingVal = typeof encoding === "string" ? encoding : this._encoding;
        utils_1.checkEncoding(encodingVal);
        return this._buff.toString(encodingVal, 0, this.length);
      }
      /**
       * Destroys the SmartBuffer instance.
       */
      destroy() {
        this.clear();
        return this;
      }
      /**
       * Handles inserting and writing strings.
       *
       * @param value { String } The String value to insert.
       * @param isInsert { Boolean } True if inserting a string, false if writing.
       * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       */
      _handleString(value, isInsert, arg3, encoding) {
        let offsetVal = this._writeOffset;
        let encodingVal = this._encoding;
        if (typeof arg3 === "number") {
          offsetVal = arg3;
        } else if (typeof arg3 === "string") {
          utils_1.checkEncoding(arg3);
          encodingVal = arg3;
        }
        if (typeof encoding === "string") {
          utils_1.checkEncoding(encoding);
          encodingVal = encoding;
        }
        const byteLength = Buffer.byteLength(value, encodingVal);
        if (isInsert) {
          this.ensureInsertable(byteLength, offsetVal);
        } else {
          this._ensureWriteable(byteLength, offsetVal);
        }
        this._buff.write(value, offsetVal, byteLength, encodingVal);
        if (isInsert) {
          this._writeOffset += byteLength;
        } else {
          if (typeof arg3 === "number") {
            this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength);
          } else {
            this._writeOffset += byteLength;
          }
        }
        return this;
      }
      /**
       * Handles writing or insert of a Buffer.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       */
      _handleBuffer(value, isInsert, offset2) {
        const offsetVal = typeof offset2 === "number" ? offset2 : this._writeOffset;
        if (isInsert) {
          this.ensureInsertable(value.length, offsetVal);
        } else {
          this._ensureWriteable(value.length, offsetVal);
        }
        value.copy(this._buff, offsetVal);
        if (isInsert) {
          this._writeOffset += value.length;
        } else {
          if (typeof offset2 === "number") {
            this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length);
          } else {
            this._writeOffset += value.length;
          }
        }
        return this;
      }
      /**
       * Ensures that the internal Buffer is large enough to read data.
       *
       * @param length { Number } The length of the data that needs to be read.
       * @param offset { Number } The offset of the data that needs to be read.
       */
      ensureReadable(length, offset2) {
        let offsetVal = this._readOffset;
        if (typeof offset2 !== "undefined") {
          utils_1.checkOffsetValue(offset2);
          offsetVal = offset2;
        }
        if (offsetVal < 0 || offsetVal + length > this.length) {
          throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS);
        }
      }
      /**
       * Ensures that the internal Buffer is large enough to insert data.
       *
       * @param dataLength { Number } The length of the data that needs to be written.
       * @param offset { Number } The offset of the data to be written.
       */
      ensureInsertable(dataLength, offset2) {
        utils_1.checkOffsetValue(offset2);
        this._ensureCapacity(this.length + dataLength);
        if (offset2 < this.length) {
          this._buff.copy(this._buff, offset2 + dataLength, offset2, this._buff.length);
        }
        if (offset2 + dataLength > this.length) {
          this.length = offset2 + dataLength;
        } else {
          this.length += dataLength;
        }
      }
      /**
       * Ensures that the internal Buffer is large enough to write data.
       *
       * @param dataLength { Number } The length of the data that needs to be written.
       * @param offset { Number } The offset of the data to be written (defaults to writeOffset).
       */
      _ensureWriteable(dataLength, offset2) {
        const offsetVal = typeof offset2 === "number" ? offset2 : this._writeOffset;
        this._ensureCapacity(offsetVal + dataLength);
        if (offsetVal + dataLength > this.length) {
          this.length = offsetVal + dataLength;
        }
      }
      /**
       * Ensures that the internal Buffer is large enough to write at least the given amount of data.
       *
       * @param minLength { Number } The minimum length of the data needs to be written.
       */
      _ensureCapacity(minLength) {
        const oldLength = this._buff.length;
        if (minLength > oldLength) {
          let data = this._buff;
          let newLength = oldLength * 3 / 2 + 1;
          if (newLength < minLength) {
            newLength = minLength;
          }
          this._buff = Buffer.allocUnsafe(newLength);
          data.copy(this._buff, 0, 0, oldLength);
        }
      }
      /**
       * Reads a numeric number value using the provided function.
       *
       * @typeparam T { number | bigint } The type of the value to be read
       *
       * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.
       * @param byteSize { Number } The number of bytes read.
       * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead.
       *
       * @returns { T } the number value
       */
      _readNumberValue(func, byteSize, offset2) {
        this.ensureReadable(byteSize, offset2);
        const value = func.call(this._buff, typeof offset2 === "number" ? offset2 : this._readOffset);
        if (typeof offset2 === "undefined") {
          this._readOffset += byteSize;
        }
        return value;
      }
      /**
       * Inserts a numeric number value based on the given offset and value.
       *
       * @typeparam T { number | bigint } The type of the value to be written
       *
       * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with.
       * @param byteSize { Number } The number of bytes written.
       * @param value { T } The number value to write.
       * @param offset { Number } the offset to write the number at (REQUIRED).
       *
       * @returns SmartBuffer this buffer
       */
      _insertNumberValue(func, byteSize, value, offset2) {
        utils_1.checkOffsetValue(offset2);
        this.ensureInsertable(byteSize, offset2);
        func.call(this._buff, value, offset2);
        this._writeOffset += byteSize;
        return this;
      }
      /**
       * Writes a numeric number value based on the given offset and value.
       *
       * @typeparam T { number | bigint } The type of the value to be written
       *
       * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with.
       * @param byteSize { Number } The number of bytes written.
       * @param value { T } The number value to write.
       * @param offset { Number } the offset to write the number at (REQUIRED).
       *
       * @returns SmartBuffer this buffer
       */
      _writeNumberValue(func, byteSize, value, offset2) {
        if (typeof offset2 === "number") {
          if (offset2 < 0) {
            throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);
          }
          utils_1.checkOffsetValue(offset2);
        }
        const offsetVal = typeof offset2 === "number" ? offset2 : this._writeOffset;
        this._ensureWriteable(byteSize, offsetVal);
        func.call(this._buff, value, offsetVal);
        if (typeof offset2 === "number") {
          this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize);
        } else {
          this._writeOffset += byteSize;
        }
        return this;
      }
    };
    exports2.SmartBuffer = SmartBuffer;
  }
});

// node_modules/socks/build/common/constants.js
var require_constants2 = __commonJS({
  "node_modules/socks/build/common/constants.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SOCKS5_NO_ACCEPTABLE_AUTH = exports2.SOCKS5_CUSTOM_AUTH_END = exports2.SOCKS5_CUSTOM_AUTH_START = exports2.SOCKS_INCOMING_PACKET_SIZES = exports2.SocksClientState = exports2.Socks5Response = exports2.Socks5HostType = exports2.Socks5Auth = exports2.Socks4Response = exports2.SocksCommand = exports2.ERRORS = exports2.DEFAULT_TIMEOUT = void 0;
    var DEFAULT_TIMEOUT = 3e4;
    exports2.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
    var ERRORS = {
      InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",
      InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",
      InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.",
      InvalidSocksClientOptionsDestination: "An invalid destination host was provided.",
      InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.",
      InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.",
      InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).",
      InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.",
      InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.",
      InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",
      NegotiationError: "Negotiation error",
      SocketClosed: "Socket closed",
      ProxyConnectionTimedOut: "Proxy connection timed out",
      InternalError: "SocksClient internal error (this should not happen)",
      InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response",
      Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection",
      InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response",
      Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection",
      InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response",
      InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)",
      InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)",
      InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)",
      Socks5AuthenticationFailed: "Socks5 Authentication failed",
      InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response",
      InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection",
      InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response",
      Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection"
    };
    exports2.ERRORS = ERRORS;
    var SOCKS_INCOMING_PACKET_SIZES = {
      Socks5InitialHandshakeResponse: 2,
      Socks5UserPassAuthenticationResponse: 2,
      // Command response + incoming connection (bind)
      Socks5ResponseHeader: 5,
      Socks5ResponseIPv4: 10,
      Socks5ResponseIPv6: 22,
      Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7,
      // Command response + incoming connection (bind)
      Socks4Response: 8
      // 2 header + 2 port + 4 ip
    };
    exports2.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES;
    var SocksCommand;
    (function(SocksCommand2) {
      SocksCommand2[SocksCommand2["connect"] = 1] = "connect";
      SocksCommand2[SocksCommand2["bind"] = 2] = "bind";
      SocksCommand2[SocksCommand2["associate"] = 3] = "associate";
    })(SocksCommand || (SocksCommand = {}));
    exports2.SocksCommand = SocksCommand;
    var Socks4Response;
    (function(Socks4Response2) {
      Socks4Response2[Socks4Response2["Granted"] = 90] = "Granted";
      Socks4Response2[Socks4Response2["Failed"] = 91] = "Failed";
      Socks4Response2[Socks4Response2["Rejected"] = 92] = "Rejected";
      Socks4Response2[Socks4Response2["RejectedIdent"] = 93] = "RejectedIdent";
    })(Socks4Response || (Socks4Response = {}));
    exports2.Socks4Response = Socks4Response;
    var Socks5Auth;
    (function(Socks5Auth2) {
      Socks5Auth2[Socks5Auth2["NoAuth"] = 0] = "NoAuth";
      Socks5Auth2[Socks5Auth2["GSSApi"] = 1] = "GSSApi";
      Socks5Auth2[Socks5Auth2["UserPass"] = 2] = "UserPass";
    })(Socks5Auth || (Socks5Auth = {}));
    exports2.Socks5Auth = Socks5Auth;
    var SOCKS5_CUSTOM_AUTH_START = 128;
    exports2.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START;
    var SOCKS5_CUSTOM_AUTH_END = 254;
    exports2.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END;
    var SOCKS5_NO_ACCEPTABLE_AUTH = 255;
    exports2.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH;
    var Socks5Response;
    (function(Socks5Response2) {
      Socks5Response2[Socks5Response2["Granted"] = 0] = "Granted";
      Socks5Response2[Socks5Response2["Failure"] = 1] = "Failure";
      Socks5Response2[Socks5Response2["NotAllowed"] = 2] = "NotAllowed";
      Socks5Response2[Socks5Response2["NetworkUnreachable"] = 3] = "NetworkUnreachable";
      Socks5Response2[Socks5Response2["HostUnreachable"] = 4] = "HostUnreachable";
      Socks5Response2[Socks5Response2["ConnectionRefused"] = 5] = "ConnectionRefused";
      Socks5Response2[Socks5Response2["TTLExpired"] = 6] = "TTLExpired";
      Socks5Response2[Socks5Response2["CommandNotSupported"] = 7] = "CommandNotSupported";
      Socks5Response2[Socks5Response2["AddressNotSupported"] = 8] = "AddressNotSupported";
    })(Socks5Response || (Socks5Response = {}));
    exports2.Socks5Response = Socks5Response;
    var Socks5HostType;
    (function(Socks5HostType2) {
      Socks5HostType2[Socks5HostType2["IPv4"] = 1] = "IPv4";
      Socks5HostType2[Socks5HostType2["Hostname"] = 3] = "Hostname";
      Socks5HostType2[Socks5HostType2["IPv6"] = 4] = "IPv6";
    })(Socks5HostType || (Socks5HostType = {}));
    exports2.Socks5HostType = Socks5HostType;
    var SocksClientState;
    (function(SocksClientState2) {
      SocksClientState2[SocksClientState2["Created"] = 0] = "Created";
      SocksClientState2[SocksClientState2["Connecting"] = 1] = "Connecting";
      SocksClientState2[SocksClientState2["Connected"] = 2] = "Connected";
      SocksClientState2[SocksClientState2["SentInitialHandshake"] = 3] = "SentInitialHandshake";
      SocksClientState2[SocksClientState2["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse";
      SocksClientState2[SocksClientState2["SentAuthentication"] = 5] = "SentAuthentication";
      SocksClientState2[SocksClientState2["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse";
      SocksClientState2[SocksClientState2["SentFinalHandshake"] = 7] = "SentFinalHandshake";
      SocksClientState2[SocksClientState2["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse";
      SocksClientState2[SocksClientState2["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection";
      SocksClientState2[SocksClientState2["Established"] = 10] = "Established";
      SocksClientState2[SocksClientState2["Disconnected"] = 11] = "Disconnected";
      SocksClientState2[SocksClientState2["Error"] = 99] = "Error";
    })(SocksClientState || (SocksClientState = {}));
    exports2.SocksClientState = SocksClientState;
  }
});

// node_modules/socks/build/common/util.js
var require_util = __commonJS({
  "node_modules/socks/build/common/util.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.shuffleArray = exports2.SocksClientError = void 0;
    var SocksClientError = class extends Error {
      constructor(message, options) {
        super(message);
        this.options = options;
      }
    };
    exports2.SocksClientError = SocksClientError;
    function shuffleArray(array) {
      for (let i = array.length - 1; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [array[i], array[j]] = [array[j], array[i]];
      }
    }
    exports2.shuffleArray = shuffleArray;
  }
});

// node_modules/socks/build/common/helpers.js
var require_helpers2 = __commonJS({
  "node_modules/socks/build/common/helpers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateSocksClientChainOptions = exports2.validateSocksClientOptions = void 0;
    var util_1 = require_util();
    var constants_1 = require_constants2();
    var stream = require("stream");
    function validateSocksClientOptions(options, acceptedCommands = ["connect", "bind", "associate"]) {
      if (!constants_1.SocksCommand[options.command]) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options);
      }
      if (acceptedCommands.indexOf(options.command) === -1) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options);
      }
      if (!isValidSocksRemoteHost(options.destination)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options);
      }
      if (!isValidSocksProxy(options.proxy)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options);
      }
      validateCustomProxyAuth(options.proxy, options);
      if (options.timeout && !isValidTimeoutValue(options.timeout)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options);
      }
      if (options.existing_socket && !(options.existing_socket instanceof stream.Duplex)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options);
      }
    }
    exports2.validateSocksClientOptions = validateSocksClientOptions;
    function validateSocksClientChainOptions(options) {
      if (options.command !== "connect") {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options);
      }
      if (!isValidSocksRemoteHost(options.destination)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options);
      }
      if (!(options.proxies && Array.isArray(options.proxies) && options.proxies.length >= 2)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options);
      }
      options.proxies.forEach((proxy) => {
        if (!isValidSocksProxy(proxy)) {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options);
        }
        validateCustomProxyAuth(proxy, options);
      });
      if (options.timeout && !isValidTimeoutValue(options.timeout)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options);
      }
    }
    exports2.validateSocksClientChainOptions = validateSocksClientChainOptions;
    function validateCustomProxyAuth(proxy, options) {
      if (proxy.custom_auth_method !== void 0) {
        if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options);
        }
        if (proxy.custom_auth_request_handler === void 0 || typeof proxy.custom_auth_request_handler !== "function") {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options);
        }
        if (proxy.custom_auth_response_size === void 0) {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options);
        }
        if (proxy.custom_auth_response_handler === void 0 || typeof proxy.custom_auth_response_handler !== "function") {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options);
        }
      }
    }
    function isValidSocksRemoteHost(remoteHost) {
      return remoteHost && typeof remoteHost.host === "string" && typeof remoteHost.port === "number" && remoteHost.port >= 0 && remoteHost.port <= 65535;
    }
    function isValidSocksProxy(proxy) {
      return proxy && (typeof proxy.host === "string" || typeof proxy.ipaddress === "string") && typeof proxy.port === "number" && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5);
    }
    function isValidTimeoutValue(value) {
      return typeof value === "number" && value > 0;
    }
  }
});

// node_modules/socks/build/common/receivebuffer.js
var require_receivebuffer = __commonJS({
  "node_modules/socks/build/common/receivebuffer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ReceiveBuffer = void 0;
    var ReceiveBuffer = class {
      constructor(size = 4096) {
        this.buffer = Buffer.allocUnsafe(size);
        this.offset = 0;
        this.originalSize = size;
      }
      get length() {
        return this.offset;
      }
      append(data) {
        if (!Buffer.isBuffer(data)) {
          throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");
        }
        if (this.offset + data.length >= this.buffer.length) {
          const tmp = this.buffer;
          this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length));
          tmp.copy(this.buffer);
        }
        data.copy(this.buffer, this.offset);
        return this.offset += data.length;
      }
      peek(length) {
        if (length > this.offset) {
          throw new Error("Attempted to read beyond the bounds of the managed internal data.");
        }
        return this.buffer.slice(0, length);
      }
      get(length) {
        if (length > this.offset) {
          throw new Error("Attempted to read beyond the bounds of the managed internal data.");
        }
        const value = Buffer.allocUnsafe(length);
        this.buffer.slice(0, length).copy(value);
        this.buffer.copyWithin(0, length, length + this.offset - length);
        this.offset -= length;
        return value;
      }
    };
    exports2.ReceiveBuffer = ReceiveBuffer;
  }
});

// node_modules/socks/build/client/socksclient.js
var require_socksclient = __commonJS({
  "node_modules/socks/build/client/socksclient.js"(exports2) {
    "use strict";
    var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
      function adopt(value) {
        return value instanceof P ? value : new P(function(resolve) {
          resolve(value);
        });
      }
      return new (P || (P = Promise))(function(resolve, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e) {
            reject(e);
          }
        }
        function step(result) {
          result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SocksClientError = exports2.SocksClient = void 0;
    var events_1 = require("events");
    var net = require("net");
    var ip = require_ip();
    var smart_buffer_1 = require_smartbuffer();
    var constants_1 = require_constants2();
    var helpers_1 = require_helpers2();
    var receivebuffer_1 = require_receivebuffer();
    var util_1 = require_util();
    Object.defineProperty(exports2, "SocksClientError", { enumerable: true, get: function() {
      return util_1.SocksClientError;
    } });
    var SocksClient = class extends events_1.EventEmitter {
      constructor(options) {
        super();
        this.options = Object.assign({}, options);
        (0, helpers_1.validateSocksClientOptions)(options);
        this.setState(constants_1.SocksClientState.Created);
      }
      /**
       * Creates a new SOCKS connection.
       *
       * Note: Supports callbacks and promises. Only supports the connect command.
       * @param options { SocksClientOptions } Options.
       * @param callback { Function } An optional callback function.
       * @returns { Promise }
       */
      static createConnection(options, callback) {
        return new Promise((resolve, reject) => {
          try {
            (0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
          } catch (err) {
            if (typeof callback === "function") {
              callback(err);
              return resolve(err);
            } else {
              return reject(err);
            }
          }
          const client2 = new SocksClient(options);
          client2.connect(options.existing_socket);
          client2.once("established", (info) => {
            client2.removeAllListeners();
            if (typeof callback === "function") {
              callback(null, info);
              resolve(info);
            } else {
              resolve(info);
            }
          });
          client2.once("error", (err) => {
            client2.removeAllListeners();
            if (typeof callback === "function") {
              callback(err);
              resolve(err);
            } else {
              reject(err);
            }
          });
        });
      }
      /**
       * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies.
       *
       * Note: Supports callbacks and promises. Only supports the connect method.
       * Note: Implemented via createConnection() factory function.
       * @param options { SocksClientChainOptions } Options
       * @param callback { Function } An optional callback function.
       * @returns { Promise }
       */
      static createConnectionChain(options, callback) {
        return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () {
          try {
            (0, helpers_1.validateSocksClientChainOptions)(options);
          } catch (err) {
            if (typeof callback === "function") {
              callback(err);
              return resolve(err);
            } else {
              return reject(err);
            }
          }
          if (options.randomizeChain) {
            (0, util_1.shuffleArray)(options.proxies);
          }
          try {
            let sock;
            for (let i = 0; i < options.proxies.length; i++) {
              const nextProxy = options.proxies[i];
              const nextDestination = i === options.proxies.length - 1 ? options.destination : {
                host: options.proxies[i + 1].host || options.proxies[i + 1].ipaddress,
                port: options.proxies[i + 1].port
              };
              const result = yield SocksClient.createConnection({
                command: "connect",
                proxy: nextProxy,
                destination: nextDestination,
                existing_socket: sock
              });
              sock = sock || result.socket;
            }
            if (typeof callback === "function") {
              callback(null, { socket: sock });
              resolve({ socket: sock });
            } else {
              resolve({ socket: sock });
            }
          } catch (err) {
            if (typeof callback === "function") {
              callback(err);
              resolve(err);
            } else {
              reject(err);
            }
          }
        }));
      }
      /**
       * Creates a SOCKS UDP Frame.
       * @param options
       */
      static createUDPFrame(options) {
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt16BE(0);
        buff.writeUInt8(options.frameNumber || 0);
        if (net.isIPv4(options.remoteHost.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv4);
          buff.writeUInt32BE(ip.toLong(options.remoteHost.host));
        } else if (net.isIPv6(options.remoteHost.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv6);
          buff.writeBuffer(ip.toBuffer(options.remoteHost.host));
        } else {
          buff.writeUInt8(constants_1.Socks5HostType.Hostname);
          buff.writeUInt8(Buffer.byteLength(options.remoteHost.host));
          buff.writeString(options.remoteHost.host);
        }
        buff.writeUInt16BE(options.remoteHost.port);
        buff.writeBuffer(options.data);
        return buff.toBuffer();
      }
      /**
       * Parses a SOCKS UDP frame.
       * @param data
       */
      static parseUDPFrame(data) {
        const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);
        buff.readOffset = 2;
        const frameNumber = buff.readUInt8();
        const hostType = buff.readUInt8();
        let remoteHost;
        if (hostType === constants_1.Socks5HostType.IPv4) {
          remoteHost = ip.fromLong(buff.readUInt32BE());
        } else if (hostType === constants_1.Socks5HostType.IPv6) {
          remoteHost = ip.toString(buff.readBuffer(16));
        } else {
          remoteHost = buff.readString(buff.readUInt8());
        }
        const remotePort = buff.readUInt16BE();
        return {
          frameNumber,
          remoteHost: {
            host: remoteHost,
            port: remotePort
          },
          data: buff.readBuffer()
        };
      }
      /**
       * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state.
       */
      setState(newState) {
        if (this.state !== constants_1.SocksClientState.Error) {
          this.state = newState;
        }
      }
      /**
       * Starts the connection establishment to the proxy and destination.
       * @param existingSocket Connected socket to use instead of creating a new one (internal use).
       */
      connect(existingSocket) {
        this.onDataReceived = (data) => this.onDataReceivedHandler(data);
        this.onClose = () => this.onCloseHandler();
        this.onError = (err) => this.onErrorHandler(err);
        this.onConnect = () => this.onConnectHandler();
        const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT);
        if (timer.unref && typeof timer.unref === "function") {
          timer.unref();
        }
        if (existingSocket) {
          this.socket = existingSocket;
        } else {
          this.socket = new net.Socket();
        }
        this.socket.once("close", this.onClose);
        this.socket.once("error", this.onError);
        this.socket.once("connect", this.onConnect);
        this.socket.on("data", this.onDataReceived);
        this.setState(constants_1.SocksClientState.Connecting);
        this.receiveBuffer = new receivebuffer_1.ReceiveBuffer();
        if (existingSocket) {
          this.socket.emit("connect");
        } else {
          this.socket.connect(this.getSocketOptions());
          if (this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null) {
            this.socket.setNoDelay(!!this.options.set_tcp_nodelay);
          }
        }
        this.prependOnceListener("established", (info) => {
          setImmediate(() => {
            if (this.receiveBuffer.length > 0) {
              const excessData = this.receiveBuffer.get(this.receiveBuffer.length);
              info.socket.emit("data", excessData);
            }
            info.socket.resume();
          });
        });
      }
      // Socket options (defaults host/port to options.proxy.host/options.proxy.port)
      getSocketOptions() {
        return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port });
      }
      /**
       * Handles internal Socks timeout callback.
       * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed.
       */
      onEstablishedTimeout() {
        if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) {
          this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut);
        }
      }
      /**
       * Handles Socket connect event.
       */
      onConnectHandler() {
        this.setState(constants_1.SocksClientState.Connected);
        if (this.options.proxy.type === 4) {
          this.sendSocks4InitialHandshake();
        } else {
          this.sendSocks5InitialHandshake();
        }
        this.setState(constants_1.SocksClientState.SentInitialHandshake);
      }
      /**
       * Handles Socket data event.
       * @param data
       */
      onDataReceivedHandler(data) {
        this.receiveBuffer.append(data);
        this.processData();
      }
      /**
       * Handles processing of the data we have received.
       */
      processData() {
        while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) {
          if (this.state === constants_1.SocksClientState.SentInitialHandshake) {
            if (this.options.proxy.type === 4) {
              this.handleSocks4FinalHandshakeResponse();
            } else {
              this.handleInitialSocks5HandshakeResponse();
            }
          } else if (this.state === constants_1.SocksClientState.SentAuthentication) {
            this.handleInitialSocks5AuthenticationHandshakeResponse();
          } else if (this.state === constants_1.SocksClientState.SentFinalHandshake) {
            this.handleSocks5FinalHandshakeResponse();
          } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) {
            if (this.options.proxy.type === 4) {
              this.handleSocks4IncomingConnectionResponse();
            } else {
              this.handleSocks5IncomingConnectionResponse();
            }
          } else {
            this.closeSocket(constants_1.ERRORS.InternalError);
            break;
          }
        }
      }
      /**
       * Handles Socket close event.
       * @param had_error
       */
      onCloseHandler() {
        this.closeSocket(constants_1.ERRORS.SocketClosed);
      }
      /**
       * Handles Socket error event.
       * @param err
       */
      onErrorHandler(err) {
        this.closeSocket(err.message);
      }
      /**
       * Removes internal event listeners on the underlying Socket.
       */
      removeInternalSocketHandlers() {
        this.socket.pause();
        this.socket.removeListener("data", this.onDataReceived);
        this.socket.removeListener("close", this.onClose);
        this.socket.removeListener("error", this.onError);
        this.socket.removeListener("connect", this.onConnect);
      }
      /**
       * Closes and destroys the underlying Socket. Emits an error event.
       * @param err { String } An error string to include in error event.
       */
      closeSocket(err) {
        if (this.state !== constants_1.SocksClientState.Error) {
          this.setState(constants_1.SocksClientState.Error);
          this.socket.destroy();
          this.removeInternalSocketHandlers();
          this.emit("error", new util_1.SocksClientError(err, this.options));
        }
      }
      /**
       * Sends initial Socks v4 handshake request.
       */
      sendSocks4InitialHandshake() {
        const userId = this.options.proxy.userId || "";
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt8(4);
        buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
        buff.writeUInt16BE(this.options.destination.port);
        if (net.isIPv4(this.options.destination.host)) {
          buff.writeBuffer(ip.toBuffer(this.options.destination.host));
          buff.writeStringNT(userId);
        } else {
          buff.writeUInt8(0);
          buff.writeUInt8(0);
          buff.writeUInt8(0);
          buff.writeUInt8(1);
          buff.writeStringNT(userId);
          buff.writeStringNT(this.options.destination.host);
        }
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response;
        this.socket.write(buff.toBuffer());
      }
      /**
       * Handles Socks v4 handshake response.
       * @param data
       */
      handleSocks4FinalHandshakeResponse() {
        const data = this.receiveBuffer.get(8);
        if (data[1] !== constants_1.Socks4Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`);
        } else {
          if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) {
            const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);
            buff.readOffset = 2;
            const remoteHost = {
              port: buff.readUInt16BE(),
              host: ip.fromLong(buff.readUInt32BE())
            };
            if (remoteHost.host === "0.0.0.0") {
              remoteHost.host = this.options.proxy.ipaddress;
            }
            this.setState(constants_1.SocksClientState.BoundWaitingForConnection);
            this.emit("bound", { remoteHost, socket: this.socket });
          } else {
            this.setState(constants_1.SocksClientState.Established);
            this.removeInternalSocketHandlers();
            this.emit("established", { socket: this.socket });
          }
        }
      }
      /**
       * Handles Socks v4 incoming connection request (BIND)
       * @param data
       */
      handleSocks4IncomingConnectionResponse() {
        const data = this.receiveBuffer.get(8);
        if (data[1] !== constants_1.Socks4Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`);
        } else {
          const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);
          buff.readOffset = 2;
          const remoteHost = {
            port: buff.readUInt16BE(),
            host: ip.fromLong(buff.readUInt32BE())
          };
          this.setState(constants_1.SocksClientState.Established);
          this.removeInternalSocketHandlers();
          this.emit("established", { remoteHost, socket: this.socket });
        }
      }
      /**
       * Sends initial Socks v5 handshake request.
       */
      sendSocks5InitialHandshake() {
        const buff = new smart_buffer_1.SmartBuffer();
        const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth];
        if (this.options.proxy.userId || this.options.proxy.password) {
          supportedAuthMethods.push(constants_1.Socks5Auth.UserPass);
        }
        if (this.options.proxy.custom_auth_method !== void 0) {
          supportedAuthMethods.push(this.options.proxy.custom_auth_method);
        }
        buff.writeUInt8(5);
        buff.writeUInt8(supportedAuthMethods.length);
        for (const authMethod of supportedAuthMethods) {
          buff.writeUInt8(authMethod);
        }
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse;
        this.socket.write(buff.toBuffer());
        this.setState(constants_1.SocksClientState.SentInitialHandshake);
      }
      /**
       * Handles initial Socks v5 handshake response.
       * @param data
       */
      handleInitialSocks5HandshakeResponse() {
        const data = this.receiveBuffer.get(2);
        if (data[0] !== 5) {
          this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion);
        } else if (data[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) {
          this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType);
        } else {
          if (data[1] === constants_1.Socks5Auth.NoAuth) {
            this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth;
            this.sendSocks5CommandRequest();
          } else if (data[1] === constants_1.Socks5Auth.UserPass) {
            this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass;
            this.sendSocks5UserPassAuthentication();
          } else if (data[1] === this.options.proxy.custom_auth_method) {
            this.socks5ChosenAuthType = this.options.proxy.custom_auth_method;
            this.sendSocks5CustomAuthentication();
          } else {
            this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType);
          }
        }
      }
      /**
       * Sends Socks v5 user & password auth handshake.
       *
       * Note: No auth and user/pass are currently supported.
       */
      sendSocks5UserPassAuthentication() {
        const userId = this.options.proxy.userId || "";
        const password = this.options.proxy.password || "";
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt8(1);
        buff.writeUInt8(Buffer.byteLength(userId));
        buff.writeString(userId);
        buff.writeUInt8(Buffer.byteLength(password));
        buff.writeString(password);
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse;
        this.socket.write(buff.toBuffer());
        this.setState(constants_1.SocksClientState.SentAuthentication);
      }
      sendSocks5CustomAuthentication() {
        return __awaiter2(this, void 0, void 0, function* () {
          this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size;
          this.socket.write(yield this.options.proxy.custom_auth_request_handler());
          this.setState(constants_1.SocksClientState.SentAuthentication);
        });
      }
      handleSocks5CustomAuthHandshakeResponse(data) {
        return __awaiter2(this, void 0, void 0, function* () {
          return yield this.options.proxy.custom_auth_response_handler(data);
        });
      }
      handleSocks5AuthenticationNoAuthHandshakeResponse(data) {
        return __awaiter2(this, void 0, void 0, function* () {
          return data[1] === 0;
        });
      }
      handleSocks5AuthenticationUserPassHandshakeResponse(data) {
        return __awaiter2(this, void 0, void 0, function* () {
          return data[1] === 0;
        });
      }
      /**
       * Handles Socks v5 auth handshake response.
       * @param data
       */
      handleInitialSocks5AuthenticationHandshakeResponse() {
        return __awaiter2(this, void 0, void 0, function* () {
          this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse);
          let authResult = false;
          if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) {
            authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2));
          } else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) {
            authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));
          } else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) {
            authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size));
          }
          if (!authResult) {
            this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed);
          } else {
            this.sendSocks5CommandRequest();
          }
        });
      }
      /**
       * Sends Socks v5 final handshake request.
       */
      sendSocks5CommandRequest() {
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt8(5);
        buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
        buff.writeUInt8(0);
        if (net.isIPv4(this.options.destination.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv4);
          buff.writeBuffer(ip.toBuffer(this.options.destination.host));
        } else if (net.isIPv6(this.options.destination.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv6);
          buff.writeBuffer(ip.toBuffer(this.options.destination.host));
        } else {
          buff.writeUInt8(constants_1.Socks5HostType.Hostname);
          buff.writeUInt8(this.options.destination.host.length);
          buff.writeString(this.options.destination.host);
        }
        buff.writeUInt16BE(this.options.destination.port);
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;
        this.socket.write(buff.toBuffer());
        this.setState(constants_1.SocksClientState.SentFinalHandshake);
      }
      /**
       * Handles Socks v5 final handshake response.
       * @param data
       */
      handleSocks5FinalHandshakeResponse() {
        const header = this.receiveBuffer.peek(5);
        if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`);
        } else {
          const addressType = header[3];
          let remoteHost;
          let buff;
          if (addressType === constants_1.Socks5HostType.IPv4) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: ip.fromLong(buff.readUInt32BE()),
              port: buff.readUInt16BE()
            };
            if (remoteHost.host === "0.0.0.0") {
              remoteHost.host = this.options.proxy.ipaddress;
            }
          } else if (addressType === constants_1.Socks5HostType.Hostname) {
            const hostLength = header[4];
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength);
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5));
            remoteHost = {
              host: buff.readString(hostLength),
              port: buff.readUInt16BE()
            };
          } else if (addressType === constants_1.Socks5HostType.IPv6) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: ip.toString(buff.readBuffer(16)),
              port: buff.readUInt16BE()
            };
          }
          this.setState(constants_1.SocksClientState.ReceivedFinalResponse);
          if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) {
            this.setState(constants_1.SocksClientState.Established);
            this.removeInternalSocketHandlers();
            this.emit("established", { remoteHost, socket: this.socket });
          } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) {
            this.setState(constants_1.SocksClientState.BoundWaitingForConnection);
            this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;
            this.emit("bound", { remoteHost, socket: this.socket });
          } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) {
            this.setState(constants_1.SocksClientState.Established);
            this.removeInternalSocketHandlers();
            this.emit("established", {
              remoteHost,
              socket: this.socket
            });
          }
        }
      }
      /**
       * Handles Socks v5 incoming connection request (BIND).
       */
      handleSocks5IncomingConnectionResponse() {
        const header = this.receiveBuffer.peek(5);
        if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`);
        } else {
          const addressType = header[3];
          let remoteHost;
          let buff;
          if (addressType === constants_1.Socks5HostType.IPv4) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: ip.fromLong(buff.readUInt32BE()),
              port: buff.readUInt16BE()
            };
            if (remoteHost.host === "0.0.0.0") {
              remoteHost.host = this.options.proxy.ipaddress;
            }
          } else if (addressType === constants_1.Socks5HostType.Hostname) {
            const hostLength = header[4];
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength);
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5));
            remoteHost = {
              host: buff.readString(hostLength),
              port: buff.readUInt16BE()
            };
          } else if (addressType === constants_1.Socks5HostType.IPv6) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: ip.toString(buff.readBuffer(16)),
              port: buff.readUInt16BE()
            };
          }
          this.setState(constants_1.SocksClientState.Established);
          this.removeInternalSocketHandlers();
          this.emit("established", { remoteHost, socket: this.socket });
        }
      }
      get socksClientOptions() {
        return Object.assign({}, this.options);
      }
    };
    exports2.SocksClient = SocksClient;
  }
});

// node_modules/socks/build/index.js
var require_build = __commonJS({
  "node_modules/socks/build/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    __exportStar2(require_socksclient(), exports2);
  }
});

// node_modules/telegram/extensions/socks.js
var require_socks = __commonJS({
  "node_modules/telegram/extensions/socks.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    __exportStar2(require_build(), exports2);
  }
});

// node_modules/telegram/extensions/PromisedNetSockets.js
var require_PromisedNetSockets = __commonJS({
  "node_modules/telegram/extensions/PromisedNetSockets.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.PromisedNetSockets = void 0;
    var net = __importStar2(require_net());
    var socks_1 = require_socks();
    var async_mutex_1 = require_lib7();
    var mutex = new async_mutex_1.Mutex();
    var closeError = new Error("NetSocket was closed");
    var PromisedNetSockets = class {
      constructor(proxy) {
        this.client = void 0;
        this.closed = true;
        this.stream = Buffer.alloc(0);
        if (proxy) {
          if (!("MTProxy" in proxy)) {
            if (!proxy.ip || !proxy.port || !proxy.socksType) {
              throw new Error(`Invalid sockets params: ip=${proxy.ip}, port=${proxy.port}, socksType=${proxy.socksType}`);
            }
            this.proxy = proxy;
          }
        }
      }
      async readExactly(number) {
        let readData = Buffer.alloc(0);
        while (true) {
          const thisTime = await this.read(number);
          readData = Buffer.concat([readData, thisTime]);
          number = number - thisTime.length;
          if (!number || number === -437) {
            return readData;
          }
        }
      }
      async read(number) {
        if (this.closed) {
          throw closeError;
        }
        await this.canRead;
        if (this.closed) {
          throw closeError;
        }
        const toReturn = this.stream.slice(0, number);
        this.stream = this.stream.slice(number);
        if (this.stream.length === 0) {
          this.canRead = new Promise((resolve) => {
            this.resolveRead = resolve;
          });
        }
        return toReturn;
      }
      async readAll() {
        if (this.closed || !await this.canRead) {
          throw closeError;
        }
        const toReturn = this.stream;
        this.stream = Buffer.alloc(0);
        this.canRead = new Promise((resolve) => {
          this.resolveRead = resolve;
        });
        return toReturn;
      }
      /**
       * Creates a new connection
       * @param port
       * @param ip
       * @returns {Promise<void>}
       */
      async connect(port, ip) {
        this.stream = Buffer.alloc(0);
        let connected = false;
        if (this.proxy) {
          const info = await socks_1.SocksClient.createConnection({
            proxy: {
              host: this.proxy.ip,
              port: this.proxy.port,
              type: this.proxy.socksType,
              userId: this.proxy.username,
              password: this.proxy.password
            },
            command: "connect",
            timeout: (this.proxy.timeout || 5) * 1e3,
            destination: {
              host: ip,
              port
            }
          });
          this.client = info.socket;
          connected = true;
        } else {
          this.client = new net.Socket();
        }
        this.canRead = new Promise((resolve) => {
          this.resolveRead = resolve;
        });
        this.closed = false;
        return new Promise((resolve, reject) => {
          if (this.client) {
            if (connected) {
              this.receive();
              resolve(this);
            } else {
              this.client.connect(port, ip, () => {
                this.receive();
                resolve(this);
              });
            }
            this.client.on("error", reject);
            this.client.on("close", () => {
              if (this.client && this.client.destroyed) {
                if (this.resolveRead) {
                  this.resolveRead(false);
                }
                this.closed = true;
              }
            });
          }
        });
      }
      write(data) {
        if (this.closed) {
          throw closeError;
        }
        if (this.client) {
          this.client.write(data);
        }
      }
      async close() {
        if (this.client) {
          await this.client.destroy();
          this.client.unref();
        }
        this.closed = true;
      }
      async receive() {
        if (this.client) {
          this.client.on("data", async (message) => {
            const release = await mutex.acquire();
            try {
              let data;
              this.stream = Buffer.concat([this.stream, message]);
              if (this.resolveRead) {
                this.resolveRead(true);
              }
            } finally {
              release();
            }
          });
        }
      }
      toString() {
        return "PromisedNetSocket";
      }
    };
    exports2.PromisedNetSockets = PromisedNetSockets;
  }
});

// node_modules/telegram/extensions/MessagePacker.js
var require_MessagePacker = __commonJS({
  "node_modules/telegram/extensions/MessagePacker.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MessagePacker = void 0;
    var core_1 = require_core();
    var core_2 = require_core();
    var BinaryWriter_1 = require_BinaryWriter();
    var USE_INVOKE_AFTER_WITH = /* @__PURE__ */ new Set([
      "messages.SendMessage",
      "messages.SendMedia",
      "messages.SendMultiMedia",
      "messages.ForwardMessages",
      "messages.SendInlineBotResult"
    ]);
    var MessagePacker = class {
      constructor(state, logger) {
        this._state = state;
        this._queue = [];
        this._pendingStates = [];
        this._ready = new Promise((resolve) => {
          this.setReady = resolve;
        });
        this._log = logger;
      }
      values() {
        return this._queue;
      }
      append(state, setReady = true, atStart = false) {
        var _a, _b;
        if (state && USE_INVOKE_AFTER_WITH.has(state.request.className)) {
          if (atStart) {
            for (let i = 0; i < this._queue.length; i++) {
              if (USE_INVOKE_AFTER_WITH.has((_a = this._queue[i]) === null || _a === void 0 ? void 0 : _a.request.className)) {
                this._queue[i].after = state;
                break;
              }
            }
          } else {
            for (let i = this._queue.length - 1; i >= 0; i--) {
              if (USE_INVOKE_AFTER_WITH.has((_b = this._queue[i]) === null || _b === void 0 ? void 0 : _b.request.className)) {
                state.after = this._queue[i];
                break;
              }
            }
          }
        }
        if (atStart) {
          this._queue.unshift(state);
        } else {
          this._queue.push(state);
        }
        if (setReady && this.setReady) {
          this.setReady(true);
        }
        if (state && state.request.CONSTRUCTOR_ID !== 1658238041) {
          this._pendingStates.push(state);
          state.promise.catch((err) => {
          }).finally(() => {
            this._pendingStates = this._pendingStates.filter((s) => s !== state);
          });
        }
      }
      prepend(states) {
        states.reverse().forEach((state) => {
          this.append(state, false, true);
        });
        if (this.setReady) {
          this.setReady(true);
        }
      }
      extend(states) {
        states.forEach((state) => {
          this.append(state, false);
        });
        if (this.setReady) {
          this.setReady(true);
        }
      }
      clear() {
        this._queue = [];
        this.append(void 0);
      }
      async wait() {
        if (!this._queue.length) {
          this._ready = new Promise((resolve) => {
            this.setReady = resolve;
          });
          await this._ready;
        }
      }
      async get() {
        if (!this._queue[this._queue.length - 1]) {
          this._queue = this._queue.filter(Boolean);
          return void 0;
        }
        let data;
        let buffer = new BinaryWriter_1.BinaryWriter(Buffer.alloc(0));
        const batch = [];
        let size = 0;
        while (this._queue.length && batch.length <= core_1.MessageContainer.MAXIMUM_LENGTH) {
          const state = this._queue.shift();
          if (!state) {
            continue;
          }
          size += state.data.length + core_2.TLMessage.SIZE_OVERHEAD;
          if (size <= core_1.MessageContainer.MAXIMUM_SIZE) {
            let afterId;
            if (state.after) {
              afterId = state.after.msgId;
            }
            if (state.after) {
              afterId = state.after.msgId;
            }
            state.msgId = await this._state.writeDataAsMessage(buffer, state.data, state.request.classType === "request", afterId);
            this._log.debug(`Assigned msgId = ${state.msgId} to ${state.request.className || state.request.constructor.name}`);
            batch.push(state);
            continue;
          }
          if (batch.length) {
            this._queue.unshift(state);
            break;
          }
          this._log.warn(`Message payload for ${state.request.className || state.request.constructor.name} is too long ${state.data.length} and cannot be sent`);
          state.promise.reject("Request Payload is too big");
          size = 0;
        }
        if (!batch.length) {
          return null;
        }
        if (batch.length > 1) {
          const b = Buffer.alloc(8);
          b.writeUInt32LE(core_1.MessageContainer.CONSTRUCTOR_ID, 0);
          b.writeInt32LE(batch.length, 4);
          data = Buffer.concat([b, buffer.getValue()]);
          buffer = new BinaryWriter_1.BinaryWriter(Buffer.alloc(0));
          const containerId = await this._state.writeDataAsMessage(buffer, data, false);
          for (const s of batch) {
            s.containerId = containerId;
          }
        }
        data = buffer.getValue();
        return { batch, data };
      }
    };
    exports2.MessagePacker = MessagePacker;
  }
});

// node_modules/telegram/extensions/AsyncQueue.js
var require_AsyncQueue = __commonJS({
  "node_modules/telegram/extensions/AsyncQueue.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsyncQueue = void 0;
    var AsyncQueue = class {
      constructor() {
        this._queue = [];
        this.canPush = true;
        this.resolvePush = (value) => {
        };
        this.resolveGet = (value) => {
        };
        this.canGet = new Promise((resolve) => {
          this.resolveGet = resolve;
        });
      }
      async push(value) {
        await this.canPush;
        this._queue.push(value);
        this.resolveGet(true);
        this.canPush = new Promise((resolve) => {
          this.resolvePush = resolve;
        });
      }
      async pop() {
        await this.canGet;
        const returned = this._queue.pop();
        this.resolvePush(true);
        this.canGet = new Promise((resolve) => {
          this.resolveGet = resolve;
        });
        return returned;
      }
    };
    exports2.AsyncQueue = AsyncQueue;
  }
});

// node_modules/telegram/extensions/index.js
var require_extensions = __commonJS({
  "node_modules/telegram/extensions/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsyncQueue = exports2.MessagePacker = exports2.PromisedNetSockets = exports2.PromisedWebSockets = exports2.BinaryReader = exports2.BinaryWriter = exports2.Logger = void 0;
    var Logger_1 = require_Logger();
    Object.defineProperty(exports2, "Logger", { enumerable: true, get: function() {
      return Logger_1.Logger;
    } });
    var BinaryWriter_1 = require_BinaryWriter();
    Object.defineProperty(exports2, "BinaryWriter", { enumerable: true, get: function() {
      return BinaryWriter_1.BinaryWriter;
    } });
    var BinaryReader_1 = require_BinaryReader();
    Object.defineProperty(exports2, "BinaryReader", { enumerable: true, get: function() {
      return BinaryReader_1.BinaryReader;
    } });
    var PromisedWebSockets_1 = require_PromisedWebSockets();
    Object.defineProperty(exports2, "PromisedWebSockets", { enumerable: true, get: function() {
      return PromisedWebSockets_1.PromisedWebSockets;
    } });
    var PromisedNetSockets_1 = require_PromisedNetSockets();
    Object.defineProperty(exports2, "PromisedNetSockets", { enumerable: true, get: function() {
      return PromisedNetSockets_1.PromisedNetSockets;
    } });
    var MessagePacker_1 = require_MessagePacker();
    Object.defineProperty(exports2, "MessagePacker", { enumerable: true, get: function() {
      return MessagePacker_1.MessagePacker;
    } });
    var AsyncQueue_1 = require_AsyncQueue();
    Object.defineProperty(exports2, "AsyncQueue", { enumerable: true, get: function() {
      return AsyncQueue_1.AsyncQueue;
    } });
  }
});

// node_modules/telegram/network/connection/Connection.js
var require_Connection = __commonJS({
  "node_modules/telegram/network/connection/Connection.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ObfuscatedConnection = exports2.PacketCodec = exports2.Connection = void 0;
    var extensions_1 = require_extensions();
    var Connection = class {
      constructor({ ip, port, dcId, loggers, proxy, socket, testServers }) {
        this._ip = ip;
        this._port = port;
        this._dcId = dcId;
        this._log = loggers;
        this._proxy = proxy;
        this._connected = false;
        this._sendTask = void 0;
        this._recvTask = void 0;
        this._codec = void 0;
        this._obfuscation = void 0;
        this._sendArray = new extensions_1.AsyncQueue();
        this._recvArray = new extensions_1.AsyncQueue();
        this.socket = new socket(proxy);
        this._testServers = testServers;
      }
      async _connect() {
        this._log.debug("Connecting");
        this._codec = new this.PacketCodecClass(this);
        await this.socket.connect(this._port, this._ip, this._testServers);
        this._log.debug("Finished connecting");
        await this._initConn();
      }
      async connect() {
        await this._connect();
        this._connected = true;
        if (!this._sendTask) {
          this._sendTask = this._sendLoop();
        }
        this._recvTask = this._recvLoop();
      }
      async disconnect() {
        if (!this._connected) {
          return;
        }
        this._connected = false;
        void this._recvArray.push(void 0);
        await this.socket.close();
      }
      async send(data) {
        if (!this._connected) {
          throw new Error("Not connected");
        }
        await this._sendArray.push(data);
      }
      async recv() {
        while (this._connected) {
          const result = await this._recvArray.pop();
          if (result) {
            return result;
          }
        }
        throw new Error("Not connected");
      }
      async _sendLoop() {
        try {
          while (this._connected) {
            const data = await this._sendArray.pop();
            if (!data) {
              this._sendTask = void 0;
              return;
            }
            await this._send(data);
          }
        } catch (e) {
          this._log.info("The server closed the connection while sending");
        }
      }
      isConnected() {
        return this._connected;
      }
      async _recvLoop() {
        let data;
        while (this._connected) {
          try {
            data = await this._recv();
            if (!data) {
              throw new Error("no data received");
            }
          } catch (e) {
            this._log.info("connection closed");
            this.disconnect();
            return;
          }
          await this._recvArray.push(data);
        }
      }
      async _initConn() {
        if (this._codec.tag) {
          await this.socket.write(this._codec.tag);
        }
      }
      async _send(data) {
        const encodedPacket = this._codec.encodePacket(data);
        this.socket.write(encodedPacket);
      }
      async _recv() {
        return await this._codec.readPacket(this.socket);
      }
      toString() {
        return `${this._ip}:${this._port}/${this.constructor.name.replace("Connection", "")}`;
      }
    };
    exports2.Connection = Connection;
    var ObfuscatedConnection = class extends Connection {
      constructor() {
        super(...arguments);
        this.ObfuscatedIO = void 0;
      }
      async _initConn() {
        this._obfuscation = new this.ObfuscatedIO(this);
        await this._obfuscation.initHeader();
        this.socket.write(this._obfuscation.header);
      }
      async _send(data) {
        this._obfuscation.write(this._codec.encodePacket(data));
      }
      async _recv() {
        return await this._codec.readPacket(this._obfuscation);
      }
    };
    exports2.ObfuscatedConnection = ObfuscatedConnection;
    var PacketCodec = class {
      constructor(connection) {
        this._conn = connection;
      }
      encodePacket(data) {
        throw new Error("Not Implemented");
      }
      async readPacket(reader) {
        throw new Error("Not Implemented");
      }
    };
    exports2.PacketCodec = PacketCodec;
  }
});

// node_modules/telegram/network/connection/TCPFull.js
var require_TCPFull = __commonJS({
  "node_modules/telegram/network/connection/TCPFull.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectionTCPFull = exports2.FullPacketCodec = void 0;
    var Connection_1 = require_Connection();
    var Helpers_1 = require_Helpers();
    var errors_1 = require_errors();
    var FullPacketCodec = class extends Connection_1.PacketCodec {
      constructor(connection) {
        super(connection);
        this._sendCounter = 0;
      }
      encodePacket(data) {
        const length = data.length + 12;
        const e = Buffer.alloc(8);
        e.writeInt32LE(length, 0);
        e.writeInt32LE(this._sendCounter, 4);
        data = Buffer.concat([e, data]);
        const crc = Buffer.alloc(4);
        crc.writeUInt32LE((0, Helpers_1.crc32)(data), 0);
        this._sendCounter += 1;
        return Buffer.concat([data, crc]);
      }
      /**
       *
       * @param reader {PromisedWebSockets}
       * @returns {Promise<*>}
       */
      async readPacket(reader) {
        const packetLenSeq = await reader.readExactly(8);
        if (packetLenSeq === void 0) {
          return Buffer.alloc(0);
        }
        const packetLen = packetLenSeq.readInt32LE(0);
        if (packetLen < 0) {
          const body2 = await reader.readExactly(4);
          throw new errors_1.InvalidBufferError(body2);
        }
        let body = await reader.readExactly(packetLen - 8);
        const checksum = body.slice(-4).readUInt32LE(0);
        body = body.slice(0, -4);
        const validChecksum = (0, Helpers_1.crc32)(Buffer.concat([packetLenSeq, body]));
        if (!(validChecksum === checksum)) {
          throw new errors_1.InvalidChecksumError(checksum, validChecksum);
        }
        return body;
      }
    };
    exports2.FullPacketCodec = FullPacketCodec;
    var ConnectionTCPFull = class extends Connection_1.Connection {
      constructor() {
        super(...arguments);
        this.PacketCodecClass = FullPacketCodec;
      }
    };
    exports2.ConnectionTCPFull = ConnectionTCPFull;
  }
});

// node_modules/telegram/network/connection/TCPAbridged.js
var require_TCPAbridged = __commonJS({
  "node_modules/telegram/network/connection/TCPAbridged.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectionTCPAbridged = exports2.AbridgedPacketCodec = void 0;
    var Helpers_1 = require_Helpers();
    var Connection_1 = require_Connection();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var AbridgedPacketCodec = class extends Connection_1.PacketCodec {
      constructor(props) {
        super(props);
        this.tag = AbridgedPacketCodec.tag;
        this.obfuscateTag = AbridgedPacketCodec.obfuscateTag;
      }
      encodePacket(data) {
        let length = data.length >> 2;
        let temp;
        if (length < 127) {
          const b = Buffer.alloc(1);
          b.writeUInt8(length, 0);
          temp = b;
        } else {
          temp = Buffer.concat([
            Buffer.from("7f", "hex"),
            (0, Helpers_1.readBufferFromBigInt)((0, big_integer_1.default)(length), 3)
          ]);
        }
        return Buffer.concat([temp, data]);
      }
      async readPacket(reader) {
        const readData = await reader.read(1);
        let length = readData[0];
        if (length >= 127) {
          length = Buffer.concat([
            await reader.read(3),
            Buffer.alloc(1)
          ]).readInt32LE(0);
        }
        return reader.read(length << 2);
      }
    };
    exports2.AbridgedPacketCodec = AbridgedPacketCodec;
    AbridgedPacketCodec.tag = Buffer.from("ef", "hex");
    AbridgedPacketCodec.obfuscateTag = Buffer.from("efefefef", "hex");
    var ConnectionTCPAbridged = class extends Connection_1.Connection {
      constructor() {
        super(...arguments);
        this.PacketCodecClass = AbridgedPacketCodec;
      }
    };
    exports2.ConnectionTCPAbridged = ConnectionTCPAbridged;
  }
});

// node_modules/@cryptography/aes/dist/cjs/aes.min.js
var require_aes_min = __commonJS({
  "node_modules/@cryptography/aes/dist/cjs/aes.min.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var t = new Uint8Array(256);
    var e = new Uint8Array(256);
    var r = new Uint32Array(256);
    var n = new Uint32Array(256);
    var i = new Uint32Array(256);
    var h = new Uint32Array(256);
    var o = new Uint32Array(256);
    var s = new Uint32Array(256);
    var c = new Uint32Array(256);
    var y = new Uint32Array(256);
    function a(t2) {
      if (t2 instanceof Uint32Array)
        return t2;
      if ("string" == typeof t2) {
        if (t2.length % 4 != 0)
          for (var e2 = t2.length % 4; e2 <= 4; e2++)
            t2 += "\0x00";
        var r2 = new Uint32Array(t2.length / 4);
        for (e2 = 0; e2 < t2.length; e2 += 4)
          r2[e2 / 4] = (i2 = e2, (n2 = t2).charCodeAt(i2) << 24 ^ n2.charCodeAt(i2 + 1) << 16 ^ n2.charCodeAt(i2 + 2) << 8 ^ n2.charCodeAt(i2 + 3));
        return r2;
      }
      var n2, i2;
      if (t2 instanceof Uint8Array) {
        for (r2 = new Uint32Array(t2.length / 4), e2 = 0; e2 < t2.length; e2 += 4)
          r2[e2 / 4] = t2[e2] << 24 ^ t2[e2 + 1] << 16 ^ t2[e2 + 2] << 8 ^ t2[e2 + 3];
        return r2;
      }
      throw new Error("Unable to create 32-bit words");
    }
    function l(t2, e2, r2) {
      void 0 === r2 && (r2 = t2);
      for (var n2 = 0; n2 < t2.length; n2++)
        r2[n2] = t2[n2] ^ e2[n2];
    }
    !function() {
      for (var a2, l2, f3, u2, g2, p = new Uint8Array(256), v = new Uint8Array(256), w = 0, A = 0, d = 0; d < 256; d++)
        p[d] = d << 1 ^ 283 * (d >> 7), v[p[d] ^ d] = d;
      for (; !t[w]; w ^= a2 || 1)
        f3 = (f3 = A ^ A << 1 ^ A << 2 ^ A << 3 ^ A << 4) >> 8 ^ 255 & f3 ^ 99, t[w] = f3, e[f3] = w, g2 = 16843009 * p[l2 = p[a2 = p[w]]] ^ 65537 * l2 ^ 257 * a2 ^ 16843008 * w, u2 = 257 * p[f3] ^ 16843008 * f3, r[w] = u2 = u2 << 24 ^ u2 >>> 8, n[w] = u2 = u2 << 24 ^ u2 >>> 8, i[w] = u2 = u2 << 24 ^ u2 >>> 8, h[w] = u2 = u2 << 24 ^ u2 >>> 8, o[f3] = g2 = g2 << 24 ^ g2 >>> 8, s[f3] = g2 = g2 << 24 ^ g2 >>> 8, c[f3] = g2 = g2 << 24 ^ g2 >>> 8, y[f3] = g2 = g2 << 24 ^ g2 >>> 8, A = v[A] || 1;
    }();
    var f2 = function() {
      function l2(e2) {
        var r2 = a(e2);
        if (4 !== r2.length && 6 !== r2.length && 8 !== r2.length)
          throw new Error("Invalid key size");
        this.encKey = new Uint32Array(4 * r2.length + 28), this.decKey = new Uint32Array(4 * r2.length + 28), this.encKey.set(r2);
        for (var n2, i2 = 1, h2 = r2.length; h2 < 4 * r2.length + 28; h2++)
          n2 = this.encKey[h2 - 1], (h2 % r2.length == 0 || 8 === r2.length && h2 % r2.length == 4) && (n2 = t[n2 >>> 24] << 24 ^ t[n2 >> 16 & 255] << 16 ^ t[n2 >> 8 & 255] << 8 ^ t[255 & n2], h2 % r2.length == 0 && (n2 = n2 << 8 ^ n2 >>> 24 ^ i2 << 24, i2 = i2 << 1 ^ 283 * (i2 >> 7))), this.encKey[h2] = this.encKey[h2 - r2.length] ^ n2;
        for (var l3 = 0; h2; l3++, h2--)
          n2 = this.encKey[3 & l3 ? h2 : h2 - 4], this.decKey[l3] = h2 <= 4 || l3 < 4 ? n2 : o[t[n2 >>> 24]] ^ s[t[n2 >> 16 & 255]] ^ c[t[n2 >> 8 & 255]] ^ y[t[255 & n2]];
      }
      return l2.prototype.encrypt = function(e2) {
        for (var o2, s2, c2, y2 = a(e2), l3 = new Uint32Array(4), f3 = y2[0] ^ this.encKey[0], u2 = y2[1] ^ this.encKey[1], g2 = y2[2] ^ this.encKey[2], p = y2[3] ^ this.encKey[3], v = this.encKey.length / 4 - 2, w = 4, A = 0; A < v; A++)
          o2 = r[f3 >>> 24] ^ n[u2 >> 16 & 255] ^ i[g2 >> 8 & 255] ^ h[255 & p] ^ this.encKey[w], s2 = r[u2 >>> 24] ^ n[g2 >> 16 & 255] ^ i[p >> 8 & 255] ^ h[255 & f3] ^ this.encKey[w + 1], c2 = r[g2 >>> 24] ^ n[p >> 16 & 255] ^ i[f3 >> 8 & 255] ^ h[255 & u2] ^ this.encKey[w + 2], p = r[p >>> 24] ^ n[f3 >> 16 & 255] ^ i[u2 >> 8 & 255] ^ h[255 & g2] ^ this.encKey[w + 3], f3 = o2, u2 = s2, g2 = c2, w += 4;
        for (A = 0; A < 4; A++)
          l3[A] = t[f3 >>> 24] << 24 ^ t[u2 >> 16 & 255] << 16 ^ t[g2 >> 8 & 255] << 8 ^ t[255 & p] ^ this.encKey[w++], o2 = f3, f3 = u2, u2 = g2, g2 = p, p = o2;
        return l3;
      }, l2.prototype.decrypt = function(t2) {
        for (var r2, n2, i2, h2 = a(t2), l3 = new Uint32Array(4), f3 = h2[0] ^ this.decKey[0], u2 = h2[3] ^ this.decKey[1], g2 = h2[2] ^ this.decKey[2], p = h2[1] ^ this.decKey[3], v = this.decKey.length / 4 - 2, w = 4, A = 0; A < v; A++)
          r2 = o[f3 >>> 24] ^ s[u2 >> 16 & 255] ^ c[g2 >> 8 & 255] ^ y[255 & p] ^ this.decKey[w], n2 = o[u2 >>> 24] ^ s[g2 >> 16 & 255] ^ c[p >> 8 & 255] ^ y[255 & f3] ^ this.decKey[w + 1], i2 = o[g2 >>> 24] ^ s[p >> 16 & 255] ^ c[f3 >> 8 & 255] ^ y[255 & u2] ^ this.decKey[w + 2], p = o[p >>> 24] ^ s[f3 >> 16 & 255] ^ c[u2 >> 8 & 255] ^ y[255 & g2] ^ this.decKey[w + 3], f3 = r2, u2 = n2, g2 = i2, w += 4;
        for (A = 0; A < 4; A++)
          l3[3 & -A] = e[f3 >>> 24] << 24 ^ e[u2 >> 16 & 255] << 16 ^ e[g2 >> 8 & 255] << 8 ^ e[255 & p] ^ this.decKey[w++], r2 = f3, f3 = u2, u2 = g2, g2 = p, p = r2;
        return l3;
      }, l2;
    }();
    var u = function() {
      function t2(t3, e2, r2) {
        void 0 === r2 && (r2 = 16), this.key = a(t3), this.iv = a(e2), this.cipher = new f2(t3), this.blockSize = r2 / 4;
      }
      return t2.prototype.encrypt = function(t3, e2) {
        for (var r2 = a(t3), n2 = e2 || new Uint32Array(r2.length), i2 = this.iv.subarray(this.blockSize, this.iv.length), h2 = this.iv.subarray(0, this.blockSize), o2 = new Uint32Array(this.blockSize), s2 = 0; s2 < r2.length; s2 += this.blockSize) {
          var c2 = r2.subarray(s2, s2 + this.blockSize);
          l(c2, h2, o2);
          var y2 = this.cipher.encrypt(o2);
          l(y2, i2), i2 = c2, h2 = y2;
          for (var f3 = s2, u2 = 0; f3 < r2.length && u2 < 4; f3++, u2++)
            n2[f3] = y2[u2];
        }
        return n2;
      }, t2.prototype.decrypt = function(t3, e2) {
        for (var r2 = a(t3), n2 = e2 || new Uint32Array(r2.length), i2 = this.iv.subarray(this.blockSize, this.iv.length), h2 = this.iv.subarray(0, this.blockSize), o2 = new Uint32Array(this.blockSize), s2 = 0; s2 < n2.length; s2 += this.blockSize) {
          var c2 = r2.subarray(s2, s2 + this.blockSize);
          l(c2, i2, o2);
          var y2 = this.cipher.decrypt(o2);
          l(y2, h2), h2 = c2, i2 = y2;
          for (var f3 = s2, u2 = 0; f3 < n2.length && u2 < 4; f3++, u2++)
            n2[f3] = y2[u2];
        }
        return n2;
      }, t2;
    }();
    var g = function() {
      function t2(t3, e2, r2) {
        if (void 0 === r2 && (r2 = 16), this.offset = 0, this.key = a(t3), this.counter = a(e2), this.cipher = new f2(t3), this.blockSize = r2 / 4, 4 !== this.counter.length)
          throw new Error("AES-CTR mode counter must be 16 bytes length");
      }
      return t2.prototype.encrypt = function(t3, e2) {
        for (var r2 = a(t3), n2 = e2 || new Uint32Array(r2.length), i2 = this.offset, h2 = 0; h2 < r2.length; h2 += this.blockSize) {
          for (var o2 = this.cipher.encrypt(this.counter), s2 = h2, c2 = i2; s2 < r2.length && c2 < this.blockSize; s2++, c2++)
            n2[s2] = o2[c2] ^ r2[s2];
          r2.length - h2 >= this.blockSize && this.incrementCounter(), i2 && (h2 -= i2, i2 = 0);
        }
        return this.offset = (this.offset + r2.length % 4) % 4, n2;
      }, t2.prototype.decrypt = function(t3, e2) {
        return this.encrypt(t3, e2);
      }, t2.prototype.incrementCounter = function() {
        for (var t3 = this.counter.length - 1; t3 >= 0 && !(++this.counter[t3] < 4294967295); t3--)
          ;
      }, t2;
    }();
    exports2.CTR = g, exports2.IGE = u, exports2.default = f2;
  }
});

// node_modules/telegram/crypto/converters.js
var require_converters = __commonJS({
  "node_modules/telegram/crypto/converters.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ab2i = exports2.i2ab = exports2.isBigEndian = exports2.ab2iBig = exports2.ab2iLow = exports2.i2abBig = exports2.i2abLow = void 0;
    function i2abLow(buf) {
      const uint8 = new Uint8Array(buf.length * 4);
      let i = 0;
      for (let j = 0; j < buf.length; j++) {
        const int = buf[j];
        uint8[i++] = int >>> 24;
        uint8[i++] = int >> 16 & 255;
        uint8[i++] = int >> 8 & 255;
        uint8[i++] = int & 255;
      }
      return uint8.buffer;
    }
    exports2.i2abLow = i2abLow;
    function i2abBig(buf) {
      return buf.buffer;
    }
    exports2.i2abBig = i2abBig;
    function ab2iLow(ab) {
      const uint8 = new Uint8Array(ab);
      const buf = new Uint32Array(uint8.length / 4);
      for (let i = 0; i < uint8.length; i += 4) {
        buf[i / 4] = uint8[i] << 24 ^ uint8[i + 1] << 16 ^ uint8[i + 2] << 8 ^ uint8[i + 3];
      }
      return buf;
    }
    exports2.ab2iLow = ab2iLow;
    function ab2iBig(ab) {
      return new Uint32Array(ab);
    }
    exports2.ab2iBig = ab2iBig;
    exports2.isBigEndian = new Uint8Array(new Uint32Array([16909060]))[0] === 1;
    exports2.i2ab = exports2.isBigEndian ? i2abBig : i2abLow;
    exports2.ab2i = exports2.isBigEndian ? ab2iBig : ab2iLow;
  }
});

// node_modules/telegram/crypto/words.js
var require_words = __commonJS({
  "node_modules/telegram/crypto/words.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.xor = exports2.getWords = exports2.s2i = void 0;
    function s2i(str, pos) {
      return str.charCodeAt(pos) << 24 ^ str.charCodeAt(pos + 1) << 16 ^ str.charCodeAt(pos + 2) << 8 ^ str.charCodeAt(pos + 3);
    }
    exports2.s2i = s2i;
    function getWords(key) {
      if (key instanceof Uint32Array) {
        return key;
      }
      if (typeof key === "string") {
        if (key.length % 4 !== 0)
          for (let i = key.length % 4; i <= 4; i++)
            key += "\0x00";
        const buf = new Uint32Array(key.length / 4);
        for (let i = 0; i < key.length; i += 4)
          buf[i / 4] = s2i(key, i);
        return buf;
      }
      if (key instanceof Uint8Array) {
        const buf = new Uint32Array(key.length / 4);
        for (let i = 0; i < key.length; i += 4) {
          buf[i / 4] = key[i] << 24 ^ key[i + 1] << 16 ^ key[i + 2] << 8 ^ key[i + 3];
        }
        return buf;
      }
      throw new Error("Unable to create 32-bit words");
    }
    exports2.getWords = getWords;
    function xor(left2, right2, to = left2) {
      for (let i = 0; i < left2.length; i++)
        to[i] = left2[i] ^ right2[i];
    }
    exports2.xor = xor;
  }
});

// node_modules/telegram/crypto/crypto.js
var require_crypto = __commonJS({
  "node_modules/telegram/crypto/crypto.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.createHash = exports2.pbkdf2Sync = exports2.Hash = exports2.randomBytes = exports2.createCipheriv = exports2.createDecipheriv = exports2.CTR = exports2.Counter = void 0;
    var aes_1 = __importDefault2(require_aes_min());
    var converters_1 = require_converters();
    var words_1 = require_words();
    var Counter = class {
      constructor(initialValue) {
        this._counter = Buffer.from(initialValue);
      }
      increment() {
        for (let i = 15; i >= 0; i--) {
          if (this._counter[i] === 255) {
            this._counter[i] = 0;
          } else {
            this._counter[i]++;
            break;
          }
        }
      }
    };
    exports2.Counter = Counter;
    var CTR = class {
      constructor(key, counter) {
        if (!(counter instanceof Counter)) {
          counter = new Counter(counter);
        }
        this._counter = counter;
        this._remainingCounter = void 0;
        this._remainingCounterIndex = 16;
        this._aes = new aes_1.default((0, words_1.getWords)(key));
      }
      update(plainText) {
        return this.encrypt(plainText);
      }
      encrypt(plainText) {
        const encrypted = Buffer.from(plainText);
        for (let i = 0; i < encrypted.length; i++) {
          if (this._remainingCounterIndex === 16) {
            this._remainingCounter = Buffer.from((0, converters_1.i2ab)(this._aes.encrypt((0, converters_1.ab2i)(this._counter._counter))));
            this._remainingCounterIndex = 0;
            this._counter.increment();
          }
          if (this._remainingCounter) {
            encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];
          }
        }
        return encrypted;
      }
    };
    exports2.CTR = CTR;
    function createDecipheriv(algorithm2, key, iv) {
      if (algorithm2.includes("ECB")) {
        throw new Error("Not supported");
      } else {
        return new CTR(key, iv);
      }
    }
    exports2.createDecipheriv = createDecipheriv;
    function createCipheriv(algorithm2, key, iv) {
      if (algorithm2.includes("ECB")) {
        throw new Error("Not supported");
      } else {
        return new CTR(key, iv);
      }
    }
    exports2.createCipheriv = createCipheriv;
    function randomBytes(count) {
      const bytes = new Uint8Array(count);
      crypto.getRandomValues(bytes);
      return bytes;
    }
    exports2.randomBytes = randomBytes;
    var Hash = class {
      constructor(algorithm2) {
        this.algorithm = algorithm2;
      }
      update(data) {
        this.data = new Uint8Array(data);
      }
      async digest() {
        if (this.data) {
          if (this.algorithm === "sha1") {
            return Buffer.from(await self.crypto.subtle.digest("SHA-1", this.data));
          } else if (this.algorithm === "sha256") {
            return Buffer.from(await self.crypto.subtle.digest("SHA-256", this.data));
          }
        }
        return Buffer.alloc(0);
      }
    };
    exports2.Hash = Hash;
    async function pbkdf2Sync(password, salt, iterations, ...args) {
      const passwordKey = await crypto.subtle.importKey("raw", password, { name: "PBKDF2" }, false, ["deriveBits"]);
      return Buffer.from(await crypto.subtle.deriveBits({
        name: "PBKDF2",
        hash: "SHA-512",
        salt,
        iterations
      }, passwordKey, 512));
    }
    exports2.pbkdf2Sync = pbkdf2Sync;
    function createHash(algorithm2) {
      return new Hash(algorithm2);
    }
    exports2.createHash = createHash;
  }
});

// node_modules/telegram/crypto/CTR.js
var require_CTR = __commonJS({
  "node_modules/telegram/crypto/CTR.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.CTR = void 0;
    var crypto3 = __importStar2(require_crypto());
    var CTR = class {
      constructor(key, iv) {
        if (!Buffer.isBuffer(key) || !Buffer.isBuffer(iv) || iv.length !== 16) {
          throw new Error("Key and iv need to be a buffer");
        }
        this.cipher = crypto3.createCipheriv("AES-256-CTR", key, iv);
      }
      encrypt(data) {
        return Buffer.from(this.cipher.update(data));
      }
    };
    exports2.CTR = CTR;
  }
});

// node_modules/telegram/network/connection/TCPObfuscated.js
var require_TCPObfuscated = __commonJS({
  "node_modules/telegram/network/connection/TCPObfuscated.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectionTCPObfuscated = void 0;
    var Helpers_1 = require_Helpers();
    var Connection_1 = require_Connection();
    var TCPAbridged_1 = require_TCPAbridged();
    var CTR_1 = require_CTR();
    var ObfuscatedIO = class {
      constructor(connection) {
        this.header = void 0;
        this.connection = connection.socket;
        this._packetClass = connection.PacketCodecClass;
      }
      async initHeader() {
        const keywords = [
          Buffer.from("50567247", "hex"),
          Buffer.from("474554", "hex"),
          Buffer.from("504f5354", "hex"),
          Buffer.from("eeeeeeee", "hex")
        ];
        let random;
        while (true) {
          random = (0, Helpers_1.generateRandomBytes)(64);
          if (random[0] !== 239 && !random.slice(4, 8).equals(Buffer.alloc(4))) {
            let ok = true;
            for (const key of keywords) {
              if (key.equals(random.slice(0, 4))) {
                ok = false;
                break;
              }
            }
            if (ok) {
              break;
            }
          }
        }
        random = random.toJSON().data;
        const randomReversed = Buffer.from(random.slice(8, 56)).reverse();
        const encryptKey = Buffer.from(random.slice(8, 40));
        const encryptIv = Buffer.from(random.slice(40, 56));
        const decryptKey = Buffer.from(randomReversed.slice(0, 32));
        const decryptIv = Buffer.from(randomReversed.slice(32, 48));
        const encryptor = new CTR_1.CTR(encryptKey, encryptIv);
        const decryptor = new CTR_1.CTR(decryptKey, decryptIv);
        random = Buffer.concat([
          Buffer.from(random.slice(0, 56)),
          this._packetClass.obfuscateTag,
          Buffer.from(random.slice(60))
        ]);
        random = Buffer.concat([
          Buffer.from(random.slice(0, 56)),
          Buffer.from(encryptor.encrypt(random).slice(56, 64)),
          Buffer.from(random.slice(64))
        ]);
        this.header = random;
        this._encrypt = encryptor;
        this._decrypt = decryptor;
      }
      async read(n) {
        const data = await this.connection.readExactly(n);
        return this._decrypt.encrypt(data);
      }
      write(data) {
        this.connection.write(this._encrypt.encrypt(data));
      }
    };
    var ConnectionTCPObfuscated = class extends Connection_1.ObfuscatedConnection {
      constructor() {
        super(...arguments);
        this.ObfuscatedIO = ObfuscatedIO;
        this.PacketCodecClass = TCPAbridged_1.AbridgedPacketCodec;
      }
    };
    exports2.ConnectionTCPObfuscated = ConnectionTCPObfuscated;
  }
});

// node_modules/telegram/network/connection/index.js
var require_connection = __commonJS({
  "node_modules/telegram/network/connection/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectionTCPObfuscated = exports2.ConnectionTCPAbridged = exports2.ConnectionTCPFull = exports2.Connection = void 0;
    var Connection_1 = require_Connection();
    Object.defineProperty(exports2, "Connection", { enumerable: true, get: function() {
      return Connection_1.Connection;
    } });
    var TCPFull_1 = require_TCPFull();
    Object.defineProperty(exports2, "ConnectionTCPFull", { enumerable: true, get: function() {
      return TCPFull_1.ConnectionTCPFull;
    } });
    var TCPAbridged_1 = require_TCPAbridged();
    Object.defineProperty(exports2, "ConnectionTCPAbridged", { enumerable: true, get: function() {
      return TCPAbridged_1.ConnectionTCPAbridged;
    } });
    var TCPObfuscated_1 = require_TCPObfuscated();
    Object.defineProperty(exports2, "ConnectionTCPObfuscated", { enumerable: true, get: function() {
      return TCPObfuscated_1.ConnectionTCPObfuscated;
    } });
  }
});

// node_modules/telegram/sessions/Abstract.js
var require_Abstract = __commonJS({
  "node_modules/telegram/sessions/Abstract.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Session = void 0;
    var Session = class {
    };
    exports2.Session = Session;
  }
});

// node_modules/telegram/sessions/Memory.js
var require_Memory = __commonJS({
  "node_modules/telegram/sessions/Memory.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MemorySession = void 0;
    var Abstract_1 = require_Abstract();
    var tl_1 = require_tl();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Utils_1 = require_Utils();
    var Helpers_1 = require_Helpers();
    var __1 = require_telegram();
    var MemorySession = class extends Abstract_1.Session {
      constructor() {
        super();
        this._serverAddress = void 0;
        this._dcId = 0;
        this._port = void 0;
        this._takeoutId = void 0;
        this._entities = /* @__PURE__ */ new Set();
        this._updateStates = {};
      }
      setDC(dcId, serverAddress, port) {
        this._dcId = dcId | 0;
        this._serverAddress = serverAddress;
        this._port = port;
      }
      get dcId() {
        return this._dcId;
      }
      get serverAddress() {
        return this._serverAddress;
      }
      get port() {
        return this._port;
      }
      get authKey() {
        return this._authKey;
      }
      set authKey(value) {
        this._authKey = value;
      }
      get takeoutId() {
        return this._takeoutId;
      }
      set takeoutId(value) {
        this._takeoutId = value;
      }
      getAuthKey(dcId) {
        if (dcId && dcId !== this.dcId) {
          return void 0;
        }
        return this.authKey;
      }
      setAuthKey(authKey, dcId) {
        if (dcId && dcId !== this.dcId) {
          return void 0;
        }
        this.authKey = authKey;
      }
      close() {
      }
      save() {
      }
      async load() {
      }
      delete() {
      }
      _entityValuesToRow(id, hash3, username, phone, name) {
        return [id, hash3, username, phone, name];
      }
      _entityToRow(e) {
        if (!(e.classType === "constructor")) {
          return;
        }
        let p;
        let markedId;
        try {
          p = (0, Utils_1.getInputPeer)(e, false);
          markedId = (0, Utils_1.getPeerId)(p);
        } catch (e2) {
          return;
        }
        let pHash;
        if (p instanceof tl_1.Api.InputPeerUser || p instanceof tl_1.Api.InputPeerChannel) {
          pHash = p.accessHash;
        } else if (p instanceof tl_1.Api.InputPeerChat) {
          pHash = big_integer_1.default.zero;
        } else {
          return;
        }
        let username = e.username;
        if (username) {
          username = username.toLowerCase();
        }
        const phone = e.phone;
        const name = (0, Utils_1.getDisplayName)(e);
        return this._entityValuesToRow(markedId, pHash, username, phone, name);
      }
      _entitiesToRows(tlo) {
        let entities = [];
        if (!(tlo.classType === "constructor") && (0, Helpers_1.isArrayLike)(tlo)) {
          entities = tlo;
        } else {
          if (typeof tlo === "object") {
            if ("user" in tlo) {
              entities.push(tlo.user);
            }
            if ("chat" in tlo) {
              entities.push(tlo.chat);
            }
            if ("channel" in tlo) {
              entities.push(tlo.channel);
            }
            if ("chats" in tlo && (0, Helpers_1.isArrayLike)(tlo.chats)) {
              entities = entities.concat(tlo.chats);
            }
            if ("users" in tlo && (0, Helpers_1.isArrayLike)(tlo.users)) {
              entities = entities.concat(tlo.users);
            }
          }
        }
        const rows = [];
        for (const e of entities) {
          const row = this._entityToRow(e);
          if (row) {
            rows.push(row);
          }
        }
        return rows;
      }
      processEntities(tlo) {
        const entitiesSet = this._entitiesToRows(tlo);
        for (const e of entitiesSet) {
          this._entities.add(e);
        }
      }
      getEntityRowsByPhone(phone) {
        for (const e of this._entities) {
          if (e[3] === phone) {
            return [e[0], e[1]];
          }
        }
      }
      getEntityRowsByUsername(username) {
        for (const e of this._entities) {
          if (e[2] === username) {
            return [e[0], e[1]];
          }
        }
      }
      getEntityRowsByName(name) {
        for (const e of this._entities) {
          if (e[4] === name) {
            return [e[0], e[1]];
          }
        }
      }
      getEntityRowsById(id, exact = true) {
        if (exact) {
          for (const e of this._entities) {
            if (e[0] === id) {
              return [e[0], e[1]];
            }
          }
        } else {
          const ids = [
            __1.utils.getPeerId(new tl_1.Api.PeerUser({ userId: (0, Helpers_1.returnBigInt)(id) })),
            __1.utils.getPeerId(new tl_1.Api.PeerChat({ chatId: (0, Helpers_1.returnBigInt)(id) })),
            __1.utils.getPeerId(new tl_1.Api.PeerChannel({ channelId: (0, Helpers_1.returnBigInt)(id) }))
          ];
          for (const e of this._entities) {
            if (ids.includes(e[0])) {
              return [e[0], e[1]];
            }
          }
        }
      }
      getInputEntity(key) {
        let exact;
        if (typeof key === "object" && !big_integer_1.default.isInstance(key) && key.SUBCLASS_OF_ID) {
          if (key.SUBCLASS_OF_ID == 3374092470 || key.SUBCLASS_OF_ID == 3865689926 || key.SUBCLASS_OF_ID == 1089602301) {
            return key;
          }
          return __1.utils.getInputPeer(key);
        } else {
          if (typeof key === "object") {
            key = __1.utils.getPeerId(key);
            exact = true;
          } else {
            exact = false;
          }
        }
        if (big_integer_1.default.isInstance(key) || typeof key == "bigint" || typeof key == "number") {
          key = key.toString();
        }
        let result = void 0;
        if (typeof key === "string") {
          const phone = __1.utils.parsePhone(key);
          if (phone) {
            result = this.getEntityRowsByPhone(phone);
          } else {
            const { username, isInvite } = __1.utils.parseUsername(key);
            if (username && !isInvite) {
              result = this.getEntityRowsByUsername(username);
            }
          }
          if (!result) {
            const id = __1.utils.parseID(key);
            if (id) {
              result = this.getEntityRowsById(id, exact);
            }
          }
          if (!result) {
            result = this.getEntityRowsByName(key);
          }
        }
        if (result) {
          let entityId = result[0];
          const entityHash = (0, big_integer_1.default)(result[1]);
          const resolved = __1.utils.resolveId((0, Helpers_1.returnBigInt)(entityId));
          entityId = resolved[0];
          const kind = resolved[1];
          if (kind === tl_1.Api.PeerUser) {
            return new tl_1.Api.InputPeerUser({
              userId: entityId,
              accessHash: entityHash
            });
          } else if (kind === tl_1.Api.PeerChat) {
            return new tl_1.Api.InputPeerChat({ chatId: entityId });
          } else if (kind === tl_1.Api.PeerChannel) {
            return new tl_1.Api.InputPeerChannel({
              channelId: entityId,
              accessHash: entityHash
            });
          }
        } else {
          throw new Error("Could not find input entity with key " + key);
        }
        throw new Error("Could not find input entity with key " + key);
      }
    };
    exports2.MemorySession = MemorySession;
  }
});

// node_modules/telegram/crypto/AuthKey.js
var require_AuthKey = __commonJS({
  "node_modules/telegram/crypto/AuthKey.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AuthKey = void 0;
    var Helpers_1 = require_Helpers();
    var extensions_1 = require_extensions();
    var Helpers_2 = require_Helpers();
    var AuthKey = class {
      constructor(value, hash3) {
        if (!hash3 || !value) {
          return;
        }
        this._key = value;
        this._hash = hash3;
        const reader = new extensions_1.BinaryReader(hash3);
        this.auxHash = reader.readLong(false);
        reader.read(4);
        this.keyId = reader.readLong(false);
      }
      async setKey(value) {
        if (!value) {
          this._key = this.auxHash = this.keyId = this._hash = void 0;
          return;
        }
        if (value instanceof AuthKey) {
          this._key = value._key;
          this.auxHash = value.auxHash;
          this.keyId = value.keyId;
          this._hash = value._hash;
          return;
        }
        this._key = value;
        this._hash = await (0, Helpers_1.sha1)(this._key);
        const reader = new extensions_1.BinaryReader(this._hash);
        this.auxHash = reader.readLong(false);
        reader.read(4);
        this.keyId = reader.readLong(false);
      }
      async waitForKey() {
        while (!this.keyId) {
          await (0, Helpers_2.sleep)(20);
        }
      }
      getKey() {
        return this._key;
      }
      // TODO : This doesn't really fit here, it's only used in authentication
      /**
       * Calculates the new nonce hash based on the current class fields' values
       * @param newNonce
       * @param number
       * @returns {bigInt.BigInteger}
       */
      async calcNewNonceHash(newNonce, number) {
        if (this.auxHash) {
          const nonce = (0, Helpers_1.toSignedLittleBuffer)(newNonce, 32);
          const n = Buffer.alloc(1);
          n.writeUInt8(number, 0);
          const data = Buffer.concat([
            nonce,
            Buffer.concat([n, (0, Helpers_1.readBufferFromBigInt)(this.auxHash, 8, true)])
          ]);
          const shaData = (await (0, Helpers_1.sha1)(data)).slice(4, 20);
          return (0, Helpers_1.readBigIntFromBuffer)(shaData, true, true);
        }
        throw new Error("Auth key not set");
      }
      equals(other) {
        var _a;
        return other instanceof this.constructor && this._key && Buffer.isBuffer(other.getKey()) && ((_a = other.getKey()) === null || _a === void 0 ? void 0 : _a.equals(this._key));
      }
    };
    exports2.AuthKey = AuthKey;
  }
});

// node_modules/telegram/sessions/StringSession.js
var require_StringSession = __commonJS({
  "node_modules/telegram/sessions/StringSession.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.StringSession = void 0;
    var Memory_1 = require_Memory();
    var extensions_1 = require_extensions();
    var AuthKey_1 = require_AuthKey();
    var CURRENT_VERSION = "1";
    var StringSession = class extends Memory_1.MemorySession {
      /**
           * This session file can be easily saved and loaded as a string. According
           * to the initial design, it contains only the data that is necessary for
           * successful connection and authentication, so takeout ID is not stored.
      
           * It is thought to be used where you don't want to create any on-disk
           * files but would still like to be able to save and load existing sessions
           * by other means.
      
           * You can use custom `encode` and `decode` functions, if present:
      
           * `encode` definition must be ``function encode(value: Buffer) -> string:``.
           * `decode` definition must be ``function decode(value: string) -> Buffer:``.
           * @param session {string|null}
           */
      constructor(session) {
        super();
        if (session) {
          if (session[0] !== CURRENT_VERSION) {
            throw new Error("Not a valid string");
          }
          session = session.slice(1);
          const r = StringSession.decode(session);
          const reader = new extensions_1.BinaryReader(r);
          this._dcId = reader.read(1).readUInt8(0);
          if (session.length == 352) {
            const ip_v4 = reader.read(4);
            this._serverAddress = ip_v4[0].toString() + "." + ip_v4[1].toString() + "." + ip_v4[2].toString() + "." + ip_v4[3].toString();
          } else {
            const serverAddressLen = reader.read(2).readInt16BE(0);
            if (serverAddressLen > 100) {
              reader.offset -= 2;
              this._serverAddress = reader.read(16).toString("hex").match(/.{1,4}/g).map((val) => val.replace(/^0+/, "")).join(":").replace(/0000\:/g, ":").replace(/:{2,}/g, "::");
            } else {
              this._serverAddress = reader.read(serverAddressLen).toString();
            }
          }
          this._port = reader.read(2).readInt16BE(0);
          this._key = reader.read(-1);
        }
      }
      /**
       * @param x {Buffer}
       * @returns {string}
       */
      static encode(x) {
        return x.toString("base64");
      }
      /**
       * @param x {string}
       * @returns {Buffer}
       */
      static decode(x) {
        return Buffer.from(x, "base64");
      }
      async load() {
        if (this._key) {
          this._authKey = new AuthKey_1.AuthKey();
          await this._authKey.setKey(this._key);
        }
      }
      save() {
        if (!this.authKey || !this.serverAddress || !this.port) {
          return "";
        }
        const key = this.authKey.getKey();
        if (!key) {
          return "";
        }
        const dcBuffer = Buffer.from([this.dcId]);
        const addressBuffer = Buffer.from(this.serverAddress);
        const addressLengthBuffer = Buffer.alloc(2);
        addressLengthBuffer.writeInt16BE(addressBuffer.length, 0);
        const portBuffer = Buffer.alloc(2);
        portBuffer.writeInt16BE(this.port, 0);
        return CURRENT_VERSION + StringSession.encode(Buffer.concat([
          dcBuffer,
          addressLengthBuffer,
          addressBuffer,
          portBuffer,
          key
        ]));
      }
    };
    exports2.StringSession = StringSession;
  }
});

// node_modules/store2/dist/store2.js
var require_store2 = __commonJS({
  "node_modules/store2/dist/store2.js"(exports2, module2) {
    (function(window2, define2) {
      var _ = {
        version: "2.14.2",
        areas: {},
        apis: {},
        nsdelim: ".",
        // utilities
        inherit: function(api, o) {
          for (var p in api) {
            if (!o.hasOwnProperty(p)) {
              Object.defineProperty(o, p, Object.getOwnPropertyDescriptor(api, p));
            }
          }
          return o;
        },
        stringify: function(d, fn2) {
          return d === void 0 || typeof d === "function" ? d + "" : JSON.stringify(d, fn2 || _.replace);
        },
        parse: function(s, fn2) {
          try {
            return JSON.parse(s, fn2 || _.revive);
          } catch (e) {
            return s;
          }
        },
        // extension hooks
        fn: function(name, fn2) {
          _.storeAPI[name] = fn2;
          for (var api in _.apis) {
            _.apis[api][name] = fn2;
          }
        },
        get: function(area, key) {
          return area.getItem(key);
        },
        set: function(area, key, string) {
          area.setItem(key, string);
        },
        remove: function(area, key) {
          area.removeItem(key);
        },
        key: function(area, i) {
          return area.key(i);
        },
        length: function(area) {
          return area.length;
        },
        clear: function(area) {
          area.clear();
        },
        // core functions
        Store: function(id, area, namespace) {
          var store2 = _.inherit(_.storeAPI, function(key, data, overwrite) {
            if (arguments.length === 0) {
              return store2.getAll();
            }
            if (typeof data === "function") {
              return store2.transact(key, data, overwrite);
            }
            if (data !== void 0) {
              return store2.set(key, data, overwrite);
            }
            if (typeof key === "string" || typeof key === "number") {
              return store2.get(key);
            }
            if (typeof key === "function") {
              return store2.each(key);
            }
            if (!key) {
              return store2.clear();
            }
            return store2.setAll(key, data);
          });
          store2._id = id;
          try {
            var testKey = "__store2_test";
            area.setItem(testKey, "ok");
            store2._area = area;
            area.removeItem(testKey);
          } catch (e) {
            store2._area = _.storage("fake");
          }
          store2._ns = namespace || "";
          if (!_.areas[id]) {
            _.areas[id] = store2._area;
          }
          if (!_.apis[store2._ns + store2._id]) {
            _.apis[store2._ns + store2._id] = store2;
          }
          return store2;
        },
        storeAPI: {
          // admin functions
          area: function(id, area) {
            var store2 = this[id];
            if (!store2 || !store2.area) {
              store2 = _.Store(id, area, this._ns);
              if (!this[id]) {
                this[id] = store2;
              }
            }
            return store2;
          },
          namespace: function(namespace, singleArea, delim) {
            delim = delim || this._delim || _.nsdelim;
            if (!namespace) {
              return this._ns ? this._ns.substring(0, this._ns.length - delim.length) : "";
            }
            var ns = namespace, store2 = this[ns];
            if (!store2 || !store2.namespace) {
              store2 = _.Store(this._id, this._area, this._ns + ns + delim);
              store2._delim = delim;
              if (!this[ns]) {
                this[ns] = store2;
              }
              if (!singleArea) {
                for (var name in _.areas) {
                  store2.area(name, _.areas[name]);
                }
              }
            }
            return store2;
          },
          isFake: function(force) {
            if (force) {
              this._real = this._area;
              this._area = _.storage("fake");
            } else if (force === false) {
              this._area = this._real || this._area;
            }
            return this._area.name === "fake";
          },
          toString: function() {
            return "store" + (this._ns ? "." + this.namespace() : "") + "[" + this._id + "]";
          },
          // storage functions
          has: function(key) {
            if (this._area.has) {
              return this._area.has(this._in(key));
            }
            return !!(this._in(key) in this._area);
          },
          size: function() {
            return this.keys().length;
          },
          each: function(fn2, fill) {
            for (var i = 0, m = _.length(this._area); i < m; i++) {
              var key = this._out(_.key(this._area, i));
              if (key !== void 0) {
                if (fn2.call(this, key, this.get(key), fill) === false) {
                  break;
                }
              }
              if (m > _.length(this._area)) {
                m--;
                i--;
              }
            }
            return fill || this;
          },
          keys: function(fillList) {
            return this.each(function(k, v, list) {
              list.push(k);
            }, fillList || []);
          },
          get: function(key, alt) {
            var s = _.get(this._area, this._in(key)), fn2;
            if (typeof alt === "function") {
              fn2 = alt;
              alt = null;
            }
            return s !== null ? _.parse(s, fn2) : alt != null ? alt : s;
          },
          getAll: function(fillObj) {
            return this.each(function(k, v, all) {
              all[k] = v;
            }, fillObj || {});
          },
          transact: function(key, fn2, alt) {
            var val = this.get(key, alt), ret2 = fn2(val);
            this.set(key, ret2 === void 0 ? val : ret2);
            return this;
          },
          set: function(key, data, overwrite) {
            var d = this.get(key), replacer;
            if (d != null && overwrite === false) {
              return data;
            }
            if (typeof overwrite === "function") {
              replacer = overwrite;
              overwrite = void 0;
            }
            return _.set(this._area, this._in(key), _.stringify(data, replacer), overwrite) || d;
          },
          setAll: function(data, overwrite) {
            var changed, val;
            for (var key in data) {
              val = data[key];
              if (this.set(key, val, overwrite) !== val) {
                changed = true;
              }
            }
            return changed;
          },
          add: function(key, data, replacer) {
            var d = this.get(key);
            if (d instanceof Array) {
              data = d.concat(data);
            } else if (d !== null) {
              var type = typeof d;
              if (type === typeof data && type === "object") {
                for (var k in data) {
                  d[k] = data[k];
                }
                data = d;
              } else {
                data = d + data;
              }
            }
            _.set(this._area, this._in(key), _.stringify(data, replacer));
            return data;
          },
          remove: function(key, alt) {
            var d = this.get(key, alt);
            _.remove(this._area, this._in(key));
            return d;
          },
          clear: function() {
            if (!this._ns) {
              _.clear(this._area);
            } else {
              this.each(function(k) {
                _.remove(this._area, this._in(k));
              }, 1);
            }
            return this;
          },
          clearAll: function() {
            var area = this._area;
            for (var id in _.areas) {
              if (_.areas.hasOwnProperty(id)) {
                this._area = _.areas[id];
                this.clear();
              }
            }
            this._area = area;
            return this;
          },
          // internal use functions
          _in: function(k) {
            if (typeof k !== "string") {
              k = _.stringify(k);
            }
            return this._ns ? this._ns + k : k;
          },
          _out: function(k) {
            return this._ns ? k && k.indexOf(this._ns) === 0 ? k.substring(this._ns.length) : void 0 : (
              // so each() knows to skip it
              k
            );
          }
        },
        // end _.storeAPI
        storage: function(name) {
          return _.inherit(_.storageAPI, { items: {}, name });
        },
        storageAPI: {
          length: 0,
          has: function(k) {
            return this.items.hasOwnProperty(k);
          },
          key: function(i) {
            var c = 0;
            for (var k in this.items) {
              if (this.has(k) && i === c++) {
                return k;
              }
            }
          },
          setItem: function(k, v) {
            if (!this.has(k)) {
              this.length++;
            }
            this.items[k] = v;
          },
          removeItem: function(k) {
            if (this.has(k)) {
              delete this.items[k];
              this.length--;
            }
          },
          getItem: function(k) {
            return this.has(k) ? this.items[k] : null;
          },
          clear: function() {
            for (var k in this.items) {
              this.removeItem(k);
            }
          }
        }
        // end _.storageAPI
      };
      var store = (
        // safely set this up (throws error in IE10/32bit mode for local files)
        _.Store("local", function() {
          try {
            return localStorage;
          } catch (e) {
          }
        }())
      );
      store.local = store;
      store._ = _;
      store.area("session", function() {
        try {
          return sessionStorage;
        } catch (e) {
        }
      }());
      store.area("page", _.storage("page"));
      if (typeof define2 === "function" && define2.amd !== void 0) {
        define2("store2", [], function() {
          return store;
        });
      } else if (typeof module2 !== "undefined" && module2.exports) {
        module2.exports = store;
      } else {
        if (window2.store) {
          _.conflict = window2.store;
        }
        window2.store = store;
      }
    })(exports2, exports2 && exports2.define);
  }
});

// node_modules/graceful-fs/polyfills.js
var require_polyfills = __commonJS({
  "node_modules/graceful-fs/polyfills.js"(exports2, module2) {
    var constants = require("constants");
    var origCwd = process.cwd;
    var cwd = null;
    var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
    process.cwd = function() {
      if (!cwd)
        cwd = origCwd.call(process);
      return cwd;
    };
    try {
      process.cwd();
    } catch (er) {
    }
    if (typeof process.chdir === "function") {
      chdir = process.chdir;
      process.chdir = function(d) {
        cwd = null;
        chdir.call(process, d);
      };
      if (Object.setPrototypeOf)
        Object.setPrototypeOf(process.chdir, chdir);
    }
    var chdir;
    module2.exports = patch;
    function patch(fs) {
      if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
        patchLchmod(fs);
      }
      if (!fs.lutimes) {
        patchLutimes(fs);
      }
      fs.chown = chownFix(fs.chown);
      fs.fchown = chownFix(fs.fchown);
      fs.lchown = chownFix(fs.lchown);
      fs.chmod = chmodFix(fs.chmod);
      fs.fchmod = chmodFix(fs.fchmod);
      fs.lchmod = chmodFix(fs.lchmod);
      fs.chownSync = chownFixSync(fs.chownSync);
      fs.fchownSync = chownFixSync(fs.fchownSync);
      fs.lchownSync = chownFixSync(fs.lchownSync);
      fs.chmodSync = chmodFixSync(fs.chmodSync);
      fs.fchmodSync = chmodFixSync(fs.fchmodSync);
      fs.lchmodSync = chmodFixSync(fs.lchmodSync);
      fs.stat = statFix(fs.stat);
      fs.fstat = statFix(fs.fstat);
      fs.lstat = statFix(fs.lstat);
      fs.statSync = statFixSync(fs.statSync);
      fs.fstatSync = statFixSync(fs.fstatSync);
      fs.lstatSync = statFixSync(fs.lstatSync);
      if (fs.chmod && !fs.lchmod) {
        fs.lchmod = function(path4, mode, cb) {
          if (cb)
            process.nextTick(cb);
        };
        fs.lchmodSync = function() {
        };
      }
      if (fs.chown && !fs.lchown) {
        fs.lchown = function(path4, uid, gid, cb) {
          if (cb)
            process.nextTick(cb);
        };
        fs.lchownSync = function() {
        };
      }
      if (platform === "win32") {
        fs.rename = typeof fs.rename !== "function" ? fs.rename : function(fs$rename) {
          function rename(from, to, cb) {
            var start2 = Date.now();
            var backoff = 0;
            fs$rename(from, to, function CB(er) {
              if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start2 < 6e4) {
                setTimeout(function() {
                  fs.stat(to, function(stater, st) {
                    if (stater && stater.code === "ENOENT")
                      fs$rename(from, to, CB);
                    else
                      cb(er);
                  });
                }, backoff);
                if (backoff < 100)
                  backoff += 10;
                return;
              }
              if (cb)
                cb(er);
            });
          }
          if (Object.setPrototypeOf)
            Object.setPrototypeOf(rename, fs$rename);
          return rename;
        }(fs.rename);
      }
      fs.read = typeof fs.read !== "function" ? fs.read : function(fs$read) {
        function read2(fd, buffer, offset2, length, position, callback_) {
          var callback;
          if (callback_ && typeof callback_ === "function") {
            var eagCounter = 0;
            callback = function(er, _, __) {
              if (er && er.code === "EAGAIN" && eagCounter < 10) {
                eagCounter++;
                return fs$read.call(fs, fd, buffer, offset2, length, position, callback);
              }
              callback_.apply(this, arguments);
            };
          }
          return fs$read.call(fs, fd, buffer, offset2, length, position, callback);
        }
        if (Object.setPrototypeOf)
          Object.setPrototypeOf(read2, fs$read);
        return read2;
      }(fs.read);
      fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : function(fs$readSync) {
        return function(fd, buffer, offset2, length, position) {
          var eagCounter = 0;
          while (true) {
            try {
              return fs$readSync.call(fs, fd, buffer, offset2, length, position);
            } catch (er) {
              if (er.code === "EAGAIN" && eagCounter < 10) {
                eagCounter++;
                continue;
              }
              throw er;
            }
          }
        };
      }(fs.readSync);
      function patchLchmod(fs2) {
        fs2.lchmod = function(path4, mode, callback) {
          fs2.open(
            path4,
            constants.O_WRONLY | constants.O_SYMLINK,
            mode,
            function(err, fd) {
              if (err) {
                if (callback)
                  callback(err);
                return;
              }
              fs2.fchmod(fd, mode, function(err2) {
                fs2.close(fd, function(err22) {
                  if (callback)
                    callback(err2 || err22);
                });
              });
            }
          );
        };
        fs2.lchmodSync = function(path4, mode) {
          var fd = fs2.openSync(path4, constants.O_WRONLY | constants.O_SYMLINK, mode);
          var threw = true;
          var ret2;
          try {
            ret2 = fs2.fchmodSync(fd, mode);
            threw = false;
          } finally {
            if (threw) {
              try {
                fs2.closeSync(fd);
              } catch (er) {
              }
            } else {
              fs2.closeSync(fd);
            }
          }
          return ret2;
        };
      }
      function patchLutimes(fs2) {
        if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
          fs2.lutimes = function(path4, at, mt, cb) {
            fs2.open(path4, constants.O_SYMLINK, function(er, fd) {
              if (er) {
                if (cb)
                  cb(er);
                return;
              }
              fs2.futimes(fd, at, mt, function(er2) {
                fs2.close(fd, function(er22) {
                  if (cb)
                    cb(er2 || er22);
                });
              });
            });
          };
          fs2.lutimesSync = function(path4, at, mt) {
            var fd = fs2.openSync(path4, constants.O_SYMLINK);
            var ret2;
            var threw = true;
            try {
              ret2 = fs2.futimesSync(fd, at, mt);
              threw = false;
            } finally {
              if (threw) {
                try {
                  fs2.closeSync(fd);
                } catch (er) {
                }
              } else {
                fs2.closeSync(fd);
              }
            }
            return ret2;
          };
        } else if (fs2.futimes) {
          fs2.lutimes = function(_a, _b, _c, cb) {
            if (cb)
              process.nextTick(cb);
          };
          fs2.lutimesSync = function() {
          };
        }
      }
      function chmodFix(orig) {
        if (!orig)
          return orig;
        return function(target, mode, cb) {
          return orig.call(fs, target, mode, function(er) {
            if (chownErOk(er))
              er = null;
            if (cb)
              cb.apply(this, arguments);
          });
        };
      }
      function chmodFixSync(orig) {
        if (!orig)
          return orig;
        return function(target, mode) {
          try {
            return orig.call(fs, target, mode);
          } catch (er) {
            if (!chownErOk(er))
              throw er;
          }
        };
      }
      function chownFix(orig) {
        if (!orig)
          return orig;
        return function(target, uid, gid, cb) {
          return orig.call(fs, target, uid, gid, function(er) {
            if (chownErOk(er))
              er = null;
            if (cb)
              cb.apply(this, arguments);
          });
        };
      }
      function chownFixSync(orig) {
        if (!orig)
          return orig;
        return function(target, uid, gid) {
          try {
            return orig.call(fs, target, uid, gid);
          } catch (er) {
            if (!chownErOk(er))
              throw er;
          }
        };
      }
      function statFix(orig) {
        if (!orig)
          return orig;
        return function(target, options, cb) {
          if (typeof options === "function") {
            cb = options;
            options = null;
          }
          function callback(er, stats) {
            if (stats) {
              if (stats.uid < 0)
                stats.uid += 4294967296;
              if (stats.gid < 0)
                stats.gid += 4294967296;
            }
            if (cb)
              cb.apply(this, arguments);
          }
          return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
        };
      }
      function statFixSync(orig) {
        if (!orig)
          return orig;
        return function(target, options) {
          var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
          if (stats) {
            if (stats.uid < 0)
              stats.uid += 4294967296;
            if (stats.gid < 0)
              stats.gid += 4294967296;
          }
          return stats;
        };
      }
      function chownErOk(er) {
        if (!er)
          return true;
        if (er.code === "ENOSYS")
          return true;
        var nonroot = !process.getuid || process.getuid() !== 0;
        if (nonroot) {
          if (er.code === "EINVAL" || er.code === "EPERM")
            return true;
        }
        return false;
      }
    }
  }
});

// node_modules/graceful-fs/legacy-streams.js
var require_legacy_streams = __commonJS({
  "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
    var Stream = require("stream").Stream;
    module2.exports = legacy;
    function legacy(fs) {
      return {
        ReadStream,
        WriteStream
      };
      function ReadStream(path4, options) {
        if (!(this instanceof ReadStream))
          return new ReadStream(path4, options);
        Stream.call(this);
        var self2 = this;
        this.path = path4;
        this.fd = null;
        this.readable = true;
        this.paused = false;
        this.flags = "r";
        this.mode = 438;
        this.bufferSize = 64 * 1024;
        options = options || {};
        var keys = Object.keys(options);
        for (var index = 0, length = keys.length; index < length; index++) {
          var key = keys[index];
          this[key] = options[key];
        }
        if (this.encoding)
          this.setEncoding(this.encoding);
        if (this.start !== void 0) {
          if ("number" !== typeof this.start) {
            throw TypeError("start must be a Number");
          }
          if (this.end === void 0) {
            this.end = Infinity;
          } else if ("number" !== typeof this.end) {
            throw TypeError("end must be a Number");
          }
          if (this.start > this.end) {
            throw new Error("start must be <= end");
          }
          this.pos = this.start;
        }
        if (this.fd !== null) {
          process.nextTick(function() {
            self2._read();
          });
          return;
        }
        fs.open(this.path, this.flags, this.mode, function(err, fd) {
          if (err) {
            self2.emit("error", err);
            self2.readable = false;
            return;
          }
          self2.fd = fd;
          self2.emit("open", fd);
          self2._read();
        });
      }
      function WriteStream(path4, options) {
        if (!(this instanceof WriteStream))
          return new WriteStream(path4, options);
        Stream.call(this);
        this.path = path4;
        this.fd = null;
        this.writable = true;
        this.flags = "w";
        this.encoding = "binary";
        this.mode = 438;
        this.bytesWritten = 0;
        options = options || {};
        var keys = Object.keys(options);
        for (var index = 0, length = keys.length; index < length; index++) {
          var key = keys[index];
          this[key] = options[key];
        }
        if (this.start !== void 0) {
          if ("number" !== typeof this.start) {
            throw TypeError("start must be a Number");
          }
          if (this.start < 0) {
            throw new Error("start must be >= zero");
          }
          this.pos = this.start;
        }
        this.busy = false;
        this._queue = [];
        if (this.fd === null) {
          this._open = fs.open;
          this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
          this.flush();
        }
      }
    }
  }
});

// node_modules/graceful-fs/clone.js
var require_clone = __commonJS({
  "node_modules/graceful-fs/clone.js"(exports2, module2) {
    "use strict";
    module2.exports = clone;
    var getPrototypeOf = Object.getPrototypeOf || function(obj2) {
      return obj2.__proto__;
    };
    function clone(obj2) {
      if (obj2 === null || typeof obj2 !== "object")
        return obj2;
      if (obj2 instanceof Object)
        var copy = { __proto__: getPrototypeOf(obj2) };
      else
        var copy = /* @__PURE__ */ Object.create(null);
      Object.getOwnPropertyNames(obj2).forEach(function(key) {
        Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj2, key));
      });
      return copy;
    }
  }
});

// node_modules/graceful-fs/graceful-fs.js
var require_graceful_fs = __commonJS({
  "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
    var fs = require("fs");
    var polyfills = require_polyfills();
    var legacy = require_legacy_streams();
    var clone = require_clone();
    var util = require("util");
    var gracefulQueue;
    var previousSymbol;
    if (typeof Symbol === "function" && typeof Symbol.for === "function") {
      gracefulQueue = Symbol.for("graceful-fs.queue");
      previousSymbol = Symbol.for("graceful-fs.previous");
    } else {
      gracefulQueue = "___graceful-fs.queue";
      previousSymbol = "___graceful-fs.previous";
    }
    function noop() {
    }
    function publishQueue(context, queue2) {
      Object.defineProperty(context, gracefulQueue, {
        get: function() {
          return queue2;
        }
      });
    }
    var debug = noop;
    if (util.debuglog)
      debug = util.debuglog("gfs4");
    else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
      debug = function() {
        var m = util.format.apply(util, arguments);
        m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
        console.error(m);
      };
    if (!fs[gracefulQueue]) {
      queue = global[gracefulQueue] || [];
      publishQueue(fs, queue);
      fs.close = function(fs$close) {
        function close(fd, cb) {
          return fs$close.call(fs, fd, function(err) {
            if (!err) {
              resetQueue();
            }
            if (typeof cb === "function")
              cb.apply(this, arguments);
          });
        }
        Object.defineProperty(close, previousSymbol, {
          value: fs$close
        });
        return close;
      }(fs.close);
      fs.closeSync = function(fs$closeSync) {
        function closeSync(fd) {
          fs$closeSync.apply(fs, arguments);
          resetQueue();
        }
        Object.defineProperty(closeSync, previousSymbol, {
          value: fs$closeSync
        });
        return closeSync;
      }(fs.closeSync);
      if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
        process.on("exit", function() {
          debug(fs[gracefulQueue]);
          require("assert").equal(fs[gracefulQueue].length, 0);
        });
      }
    }
    var queue;
    if (!global[gracefulQueue]) {
      publishQueue(global, fs[gracefulQueue]);
    }
    module2.exports = patch(clone(fs));
    if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
      module2.exports = patch(fs);
      fs.__patched = true;
    }
    function patch(fs2) {
      polyfills(fs2);
      fs2.gracefulify = patch;
      fs2.createReadStream = createReadStream;
      fs2.createWriteStream = createWriteStream;
      var fs$readFile = fs2.readFile;
      fs2.readFile = readFile;
      function readFile(path4, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        return go$readFile(path4, options, cb);
        function go$readFile(path5, options2, cb2, startTime) {
          return fs$readFile(path5, options2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue2([go$readFile, [path5, options2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$writeFile = fs2.writeFile;
      fs2.writeFile = writeFile;
      function writeFile(path4, data, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        return go$writeFile(path4, data, options, cb);
        function go$writeFile(path5, data2, options2, cb2, startTime) {
          return fs$writeFile(path5, data2, options2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue2([go$writeFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$appendFile = fs2.appendFile;
      if (fs$appendFile)
        fs2.appendFile = appendFile;
      function appendFile(path4, data, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        return go$appendFile(path4, data, options, cb);
        function go$appendFile(path5, data2, options2, cb2, startTime) {
          return fs$appendFile(path5, data2, options2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue2([go$appendFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$copyFile = fs2.copyFile;
      if (fs$copyFile)
        fs2.copyFile = copyFile;
      function copyFile(src, dest, flags, cb) {
        if (typeof flags === "function") {
          cb = flags;
          flags = 0;
        }
        return go$copyFile(src, dest, flags, cb);
        function go$copyFile(src2, dest2, flags2, cb2, startTime) {
          return fs$copyFile(src2, dest2, flags2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue2([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$readdir = fs2.readdir;
      fs2.readdir = readdir;
      var noReaddirOptionVersions = /^v[0-5]\./;
      function readdir(path4, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path5, options2, cb2, startTime) {
          return fs$readdir(path5, fs$readdirCallback(
            path5,
            options2,
            cb2,
            startTime
          ));
        } : function go$readdir2(path5, options2, cb2, startTime) {
          return fs$readdir(path5, options2, fs$readdirCallback(
            path5,
            options2,
            cb2,
            startTime
          ));
        };
        return go$readdir(path4, options, cb);
        function fs$readdirCallback(path5, options2, cb2, startTime) {
          return function(err, files) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue2([
                go$readdir,
                [path5, options2, cb2],
                err,
                startTime || Date.now(),
                Date.now()
              ]);
            else {
              if (files && files.sort)
                files.sort();
              if (typeof cb2 === "function")
                cb2.call(this, err, files);
            }
          };
        }
      }
      if (process.version.substr(0, 4) === "v0.8") {
        var legStreams = legacy(fs2);
        ReadStream = legStreams.ReadStream;
        WriteStream = legStreams.WriteStream;
      }
      var fs$ReadStream = fs2.ReadStream;
      if (fs$ReadStream) {
        ReadStream.prototype = Object.create(fs$ReadStream.prototype);
        ReadStream.prototype.open = ReadStream$open;
      }
      var fs$WriteStream = fs2.WriteStream;
      if (fs$WriteStream) {
        WriteStream.prototype = Object.create(fs$WriteStream.prototype);
        WriteStream.prototype.open = WriteStream$open;
      }
      Object.defineProperty(fs2, "ReadStream", {
        get: function() {
          return ReadStream;
        },
        set: function(val) {
          ReadStream = val;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(fs2, "WriteStream", {
        get: function() {
          return WriteStream;
        },
        set: function(val) {
          WriteStream = val;
        },
        enumerable: true,
        configurable: true
      });
      var FileReadStream = ReadStream;
      Object.defineProperty(fs2, "FileReadStream", {
        get: function() {
          return FileReadStream;
        },
        set: function(val) {
          FileReadStream = val;
        },
        enumerable: true,
        configurable: true
      });
      var FileWriteStream = WriteStream;
      Object.defineProperty(fs2, "FileWriteStream", {
        get: function() {
          return FileWriteStream;
        },
        set: function(val) {
          FileWriteStream = val;
        },
        enumerable: true,
        configurable: true
      });
      function ReadStream(path4, options) {
        if (this instanceof ReadStream)
          return fs$ReadStream.apply(this, arguments), this;
        else
          return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
      }
      function ReadStream$open() {
        var that = this;
        open(that.path, that.flags, that.mode, function(err, fd) {
          if (err) {
            if (that.autoClose)
              that.destroy();
            that.emit("error", err);
          } else {
            that.fd = fd;
            that.emit("open", fd);
            that.read();
          }
        });
      }
      function WriteStream(path4, options) {
        if (this instanceof WriteStream)
          return fs$WriteStream.apply(this, arguments), this;
        else
          return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
      }
      function WriteStream$open() {
        var that = this;
        open(that.path, that.flags, that.mode, function(err, fd) {
          if (err) {
            that.destroy();
            that.emit("error", err);
          } else {
            that.fd = fd;
            that.emit("open", fd);
          }
        });
      }
      function createReadStream(path4, options) {
        return new fs2.ReadStream(path4, options);
      }
      function createWriteStream(path4, options) {
        return new fs2.WriteStream(path4, options);
      }
      var fs$open = fs2.open;
      fs2.open = open;
      function open(path4, flags, mode, cb) {
        if (typeof mode === "function")
          cb = mode, mode = null;
        return go$open(path4, flags, mode, cb);
        function go$open(path5, flags2, mode2, cb2, startTime) {
          return fs$open(path5, flags2, mode2, function(err, fd) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue2([go$open, [path5, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      return fs2;
    }
    function enqueue2(elem) {
      debug("ENQUEUE", elem[0].name, elem[1]);
      fs[gracefulQueue].push(elem);
      retry();
    }
    var retryTimer;
    function resetQueue() {
      var now = Date.now();
      for (var i = 0; i < fs[gracefulQueue].length; ++i) {
        if (fs[gracefulQueue][i].length > 2) {
          fs[gracefulQueue][i][3] = now;
          fs[gracefulQueue][i][4] = now;
        }
      }
      retry();
    }
    function retry() {
      clearTimeout(retryTimer);
      retryTimer = void 0;
      if (fs[gracefulQueue].length === 0)
        return;
      var elem = fs[gracefulQueue].shift();
      var fn2 = elem[0];
      var args = elem[1];
      var err = elem[2];
      var startTime = elem[3];
      var lastTime = elem[4];
      if (startTime === void 0) {
        debug("RETRY", fn2.name, args);
        fn2.apply(null, args);
      } else if (Date.now() - startTime >= 6e4) {
        debug("TIMEOUT", fn2.name, args);
        var cb = args.pop();
        if (typeof cb === "function")
          cb.call(null, err);
      } else {
        var sinceAttempt = Date.now() - lastTime;
        var sinceStart = Math.max(lastTime - startTime, 1);
        var desiredDelay = Math.min(sinceStart * 1.2, 100);
        if (sinceAttempt >= desiredDelay) {
          debug("RETRY", fn2.name, args);
          fn2.apply(null, args.concat([startTime]));
        } else {
          fs[gracefulQueue].push(elem);
        }
      }
      if (retryTimer === void 0) {
        retryTimer = setTimeout(retry, 0);
      }
    }
  }
});

// node_modules/slide/lib/async-map.js
var require_async_map = __commonJS({
  "node_modules/slide/lib/async-map.js"(exports2, module2) {
    module2.exports = asyncMap;
    function asyncMap() {
      var steps = Array.prototype.slice.call(arguments), list = steps.shift() || [], cb_ = steps.pop();
      if (typeof cb_ !== "function")
        throw new Error(
          "No callback provided to asyncMap"
        );
      if (!list)
        return cb_(null, []);
      if (!Array.isArray(list))
        list = [list];
      var n = steps.length, data = [], errState = null, l = list.length, a = l * n;
      if (!a)
        return cb_(null, []);
      function cb(er) {
        if (er && !errState)
          errState = er;
        var argLen = arguments.length;
        for (var i = 1; i < argLen; i++)
          if (arguments[i] !== void 0) {
            data[i - 1] = (data[i - 1] || []).concat(arguments[i]);
          }
        if (list.length > l) {
          var newList = list.slice(l);
          a += (list.length - l) * n;
          l = list.length;
          process.nextTick(function() {
            newList.forEach(function(ar) {
              steps.forEach(function(fn2) {
                fn2(ar, cb);
              });
            });
          });
        }
        if (--a === 0)
          cb_.apply(null, [errState].concat(data));
      }
      list.forEach(function(ar) {
        steps.forEach(function(fn2) {
          fn2(ar, cb);
        });
      });
    }
  }
});

// node_modules/slide/lib/bind-actor.js
var require_bind_actor = __commonJS({
  "node_modules/slide/lib/bind-actor.js"(exports2, module2) {
    module2.exports = bindActor;
    function bindActor() {
      var args = Array.prototype.slice.call(arguments), obj2 = null, fn2;
      if (typeof args[0] === "object") {
        obj2 = args.shift();
        fn2 = args.shift();
        if (typeof fn2 === "string")
          fn2 = obj2[fn2];
      } else
        fn2 = args.shift();
      return function(cb) {
        fn2.apply(obj2, args.concat(cb));
      };
    }
  }
});

// node_modules/slide/lib/chain.js
var require_chain = __commonJS({
  "node_modules/slide/lib/chain.js"(exports2, module2) {
    module2.exports = chain;
    var bindActor = require_bind_actor();
    chain.first = {};
    chain.last = {};
    function chain(things, cb) {
      var res = [];
      (function LOOP(i, len) {
        if (i >= len)
          return cb(null, res);
        if (Array.isArray(things[i]))
          things[i] = bindActor.apply(
            null,
            things[i].map(function(i2) {
              return i2 === chain.first ? res[0] : i2 === chain.last ? res[res.length - 1] : i2;
            })
          );
        if (!things[i])
          return LOOP(i + 1, len);
        things[i](function(er, data) {
          if (er)
            return cb(er, res);
          if (data !== void 0)
            res = res.concat(data);
          LOOP(i + 1, len);
        });
      })(0, things.length);
    }
  }
});

// node_modules/slide/lib/slide.js
var require_slide = __commonJS({
  "node_modules/slide/lib/slide.js"(exports2) {
    exports2.asyncMap = require_async_map();
    exports2.bindActor = require_bind_actor();
    exports2.chain = require_chain();
  }
});

// node_modules/imurmurhash/imurmurhash.js
var require_imurmurhash = __commonJS({
  "node_modules/imurmurhash/imurmurhash.js"(exports2, module2) {
    (function() {
      var cache;
      function MurmurHash3(key, seed) {
        var m = this instanceof MurmurHash3 ? this : cache;
        m.reset(seed);
        if (typeof key === "string" && key.length > 0) {
          m.hash(key);
        }
        if (m !== this) {
          return m;
        }
      }
      ;
      MurmurHash3.prototype.hash = function(key) {
        var h1, k1, i, top2, len;
        len = key.length;
        this.len += len;
        k1 = this.k1;
        i = 0;
        switch (this.rem) {
          case 0:
            k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0;
          case 1:
            k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0;
          case 2:
            k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0;
          case 3:
            k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0;
            k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0;
        }
        this.rem = len + this.rem & 3;
        len -= this.rem;
        if (len > 0) {
          h1 = this.h1;
          while (1) {
            k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295;
            k1 = k1 << 15 | k1 >>> 17;
            k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295;
            h1 ^= k1;
            h1 = h1 << 13 | h1 >>> 19;
            h1 = h1 * 5 + 3864292196 & 4294967295;
            if (i >= len) {
              break;
            }
            k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16;
            top2 = key.charCodeAt(i++);
            k1 ^= (top2 & 255) << 24 ^ (top2 & 65280) >> 8;
          }
          k1 = 0;
          switch (this.rem) {
            case 3:
              k1 ^= (key.charCodeAt(i + 2) & 65535) << 16;
            case 2:
              k1 ^= (key.charCodeAt(i + 1) & 65535) << 8;
            case 1:
              k1 ^= key.charCodeAt(i) & 65535;
          }
          this.h1 = h1;
        }
        this.k1 = k1;
        return this;
      };
      MurmurHash3.prototype.result = function() {
        var k1, h1;
        k1 = this.k1;
        h1 = this.h1;
        if (k1 > 0) {
          k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295;
          k1 = k1 << 15 | k1 >>> 17;
          k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295;
          h1 ^= k1;
        }
        h1 ^= this.len;
        h1 ^= h1 >>> 16;
        h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295;
        h1 ^= h1 >>> 13;
        h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295;
        h1 ^= h1 >>> 16;
        return h1 >>> 0;
      };
      MurmurHash3.prototype.reset = function(seed) {
        this.h1 = typeof seed === "number" ? seed : 0;
        this.rem = this.k1 = this.len = 0;
        return this;
      };
      cache = new MurmurHash3();
      if (typeof module2 != "undefined") {
        module2.exports = MurmurHash3;
      } else {
        this.MurmurHash3 = MurmurHash3;
      }
    })();
  }
});

// node_modules/write-file-atomic/index.js
var require_write_file_atomic = __commonJS({
  "node_modules/write-file-atomic/index.js"(exports2, module2) {
    "use strict";
    module2.exports = writeFile;
    module2.exports.sync = writeFileSync;
    module2.exports._getTmpname = getTmpname;
    var fs = require_graceful_fs();
    var chain = require_slide().chain;
    var MurmurHash3 = require_imurmurhash();
    var extend = Object.assign || require("util")._extend;
    var invocations = 0;
    function getTmpname(filename) {
      return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(++invocations)).result();
    }
    function writeFile(filename, data, options, callback) {
      if (options instanceof Function) {
        callback = options;
        options = null;
      }
      if (!options)
        options = {};
      fs.realpath(filename, function(_, realname) {
        _writeFile(realname || filename, data, options, callback);
      });
    }
    function _writeFile(filename, data, options, callback) {
      var tmpfile = getTmpname(filename);
      if (options.mode && options.chown) {
        return thenWriteFile();
      } else {
        return fs.stat(filename, function(err, stats) {
          if (err || !stats)
            return thenWriteFile();
          options = extend({}, options);
          if (!options.mode) {
            options.mode = stats.mode;
          }
          if (!options.chown && process.getuid) {
            options.chown = { uid: stats.uid, gid: stats.gid };
          }
          return thenWriteFile();
        });
      }
      function thenWriteFile() {
        chain([
          [writeFileAsync, tmpfile, data, options.mode, options.encoding || "utf8"],
          options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid],
          options.mode && [fs, fs.chmod, tmpfile, options.mode],
          [fs, fs.rename, tmpfile, filename]
        ], function(err) {
          err ? fs.unlink(tmpfile, function() {
            callback(err);
          }) : callback();
        });
      }
      function writeFileAsync(file, data2, mode, encoding, cb) {
        fs.open(file, "w", options.mode, function(err, fd) {
          if (err)
            return cb(err);
          if (Buffer.isBuffer(data2)) {
            return fs.write(fd, data2, 0, data2.length, 0, syncAndClose);
          } else if (data2 != null) {
            return fs.write(fd, String(data2), 0, String(encoding), syncAndClose);
          } else {
            return syncAndClose();
          }
          function syncAndClose(err2) {
            if (err2)
              return cb(err2);
            fs.fsync(fd, function(err3) {
              if (err3)
                return cb(err3);
              fs.close(fd, cb);
            });
          }
        });
      }
    }
    function writeFileSync(filename, data, options) {
      if (!options)
        options = {};
      try {
        filename = fs.realpathSync(filename);
      } catch (ex) {
      }
      var tmpfile = getTmpname(filename);
      try {
        if (!options.mode || !options.chown) {
          try {
            var stats = fs.statSync(filename);
            options = extend({}, options);
            if (!options.mode) {
              options.mode = stats.mode;
            }
            if (!options.chown && process.getuid) {
              options.chown = { uid: stats.uid, gid: stats.gid };
            }
          } catch (ex) {
          }
        }
        var fd = fs.openSync(tmpfile, "w", options.mode);
        if (Buffer.isBuffer(data)) {
          fs.writeSync(fd, data, 0, data.length, 0);
        } else if (data != null) {
          fs.writeSync(fd, String(data), 0, String(options.encoding || "utf8"));
        }
        fs.fsyncSync(fd);
        fs.closeSync(fd);
        if (options.chown)
          fs.chownSync(tmpfile, options.chown.uid, options.chown.gid);
        if (options.mode)
          fs.chmodSync(tmpfile, options.mode);
        fs.renameSync(tmpfile, filename);
      } catch (err) {
        try {
          fs.unlinkSync(tmpfile);
        } catch (e) {
        }
        throw err;
      }
    }
  }
});

// node_modules/node-localstorage/LocalStorage.js
var require_LocalStorage = __commonJS({
  "node_modules/node-localstorage/LocalStorage.js"(exports2) {
    (function() {
      var JSONStorage, KEY_FOR_EMPTY_STRING, LocalStorage, MetaKey, QUOTA_EXCEEDED_ERR, StorageEvent, _emptyDirectory, _escapeKey, _rm, createMap, events, fs, path4, writeSync, extend = function(child, parent) {
        for (var key in parent) {
          if (hasProp.call(parent, key))
            child[key] = parent[key];
        }
        function ctor() {
          this.constructor = child;
        }
        ctor.prototype = parent.prototype;
        child.prototype = new ctor();
        child.__super__ = parent.prototype;
        return child;
      }, hasProp = {}.hasOwnProperty;
      path4 = require("path");
      fs = require("fs");
      events = require("events");
      writeSync = require_write_file_atomic().sync;
      KEY_FOR_EMPTY_STRING = "---.EMPTY_STRING.---";
      _emptyDirectory = function(target) {
        var i, len, p, ref, results;
        ref = fs.readdirSync(target);
        results = [];
        for (i = 0, len = ref.length; i < len; i++) {
          p = ref[i];
          results.push(_rm(path4.join(target, p)));
        }
        return results;
      };
      _rm = function(target) {
        if (fs.statSync(target).isDirectory()) {
          _emptyDirectory(target);
          return fs.rmdirSync(target);
        } else {
          return fs.unlinkSync(target);
        }
      };
      _escapeKey = function(key) {
        var newKey;
        if (key === "") {
          newKey = KEY_FOR_EMPTY_STRING;
        } else {
          newKey = "" + key;
        }
        return newKey;
      };
      QUOTA_EXCEEDED_ERR = function(superClass) {
        extend(QUOTA_EXCEEDED_ERR2, superClass);
        function QUOTA_EXCEEDED_ERR2(message) {
          this.message = message != null ? message : "Unknown error.";
          QUOTA_EXCEEDED_ERR2.__super__.constructor.call(this);
          if (Error.captureStackTrace != null) {
            Error.captureStackTrace(this, this.constructor);
          }
          this.name = this.constructor.name;
        }
        QUOTA_EXCEEDED_ERR2.prototype.toString = function() {
          return this.name + ": " + this.message;
        };
        return QUOTA_EXCEEDED_ERR2;
      }(Error);
      StorageEvent = function() {
        function StorageEvent2(key1, oldValue1, newValue1, url, storageArea) {
          this.key = key1;
          this.oldValue = oldValue1;
          this.newValue = newValue1;
          this.url = url;
          this.storageArea = storageArea != null ? storageArea : "localStorage";
        }
        return StorageEvent2;
      }();
      MetaKey = function() {
        function MetaKey2(key1, index1) {
          this.key = key1;
          this.index = index1;
          if (!(this instanceof MetaKey2)) {
            return new MetaKey2(this.key, this.index);
          }
        }
        return MetaKey2;
      }();
      createMap = function() {
        var Map2;
        Map2 = function() {
        };
        Map2.prototype = /* @__PURE__ */ Object.create(null);
        return new Map2();
      };
      LocalStorage = function(superClass) {
        var instanceMap;
        extend(LocalStorage2, superClass);
        instanceMap = {};
        function LocalStorage2(_location, quota) {
          var handler;
          this._location = _location;
          this.quota = quota != null ? quota : 5 * 1024 * 1024;
          LocalStorage2.__super__.constructor.call(this);
          if (!(this instanceof LocalStorage2)) {
            return new LocalStorage2(this._location, this.quota);
          }
          this._location = path4.resolve(this._location);
          if (instanceMap[this._location] != null) {
            return instanceMap[this._location];
          }
          this.length = 0;
          this._bytesInUse = 0;
          this._keys = [];
          this._metaKeyMap = createMap();
          this._eventUrl = "pid:" + process.pid;
          this._init();
          this._QUOTA_EXCEEDED_ERR = QUOTA_EXCEEDED_ERR;
          if (typeof Proxy !== "undefined" && Proxy !== null) {
            handler = {
              set: function(_this) {
                return function(receiver2, key, value) {
                  if (_this[key] != null) {
                    return _this[key] = value;
                  } else {
                    return _this.setItem(key, value);
                  }
                };
              }(this),
              get: function(_this) {
                return function(receiver2, key) {
                  if (_this[key] != null) {
                    return _this[key];
                  } else {
                    return _this.getItem(key);
                  }
                };
              }(this)
            };
            instanceMap[this._location] = new Proxy(this, handler);
            return instanceMap[this._location];
          }
          instanceMap[this._location] = this;
          return instanceMap[this._location];
        }
        LocalStorage2.prototype._init = function() {
          var _MetaKey, _decodedKey, _keys, e, i, index, k, len, stat;
          try {
            stat = fs.statSync(this._location);
            if (stat != null && !stat.isDirectory()) {
              throw new Error("A file exists at the location '" + this._location + "' when trying to create/open localStorage");
            }
            this._bytesInUse = 0;
            this.length = 0;
            _keys = fs.readdirSync(this._location);
            for (index = i = 0, len = _keys.length; i < len; index = ++i) {
              k = _keys[index];
              _decodedKey = decodeURIComponent(k);
              this._keys.push(_decodedKey);
              _MetaKey = new MetaKey(k, index);
              this._metaKeyMap[_decodedKey] = _MetaKey;
              stat = this._getStat(k);
              if ((stat != null ? stat.size : void 0) != null) {
                _MetaKey.size = stat.size;
                this._bytesInUse += stat.size;
              }
            }
            this.length = _keys.length;
          } catch (error) {
            e = error;
            if (e.code !== "ENOENT") {
              throw e;
            }
            try {
              fs.mkdirSync(this._location, {
                recursive: true
              });
            } catch (error2) {
              e = error2;
              if (e.code !== "EEXIST") {
                throw e;
              }
            }
          }
        };
        LocalStorage2.prototype.setItem = function(key, value) {
          var encodedKey, evnt, existsBeforeSet, filename, hasListeners, metaKey, oldLength, oldValue, valueString, valueStringLength;
          hasListeners = this.listenerCount("storage");
          oldValue = null;
          if (hasListeners) {
            oldValue = this.getItem(key);
          }
          key = _escapeKey(key);
          encodedKey = encodeURIComponent(key).replace(/[!'()]/g, escape).replace(/\*/g, "%2A");
          filename = path4.join(this._location, encodedKey);
          valueString = "" + value;
          valueStringLength = valueString.length;
          metaKey = this._metaKeyMap[key];
          existsBeforeSet = !!metaKey;
          if (existsBeforeSet) {
            oldLength = metaKey.size;
          } else {
            oldLength = 0;
          }
          if (this._bytesInUse - oldLength + valueStringLength > this.quota) {
            throw new QUOTA_EXCEEDED_ERR();
          }
          writeSync(filename, valueString, {
            encoding: "utf8"
          });
          if (!existsBeforeSet) {
            metaKey = new MetaKey(encodedKey, this._keys.push(key) - 1);
            metaKey.size = valueStringLength;
            this._metaKeyMap[key] = metaKey;
            this.length += 1;
            this._bytesInUse += valueStringLength;
          }
          if (hasListeners) {
            evnt = new StorageEvent(key, oldValue, value, this._eventUrl);
            return this.emit("storage", evnt);
          }
        };
        LocalStorage2.prototype.getItem = function(key) {
          var filename, metaKey;
          key = _escapeKey(key);
          metaKey = this._metaKeyMap[key];
          if (!!metaKey) {
            filename = path4.join(this._location, metaKey.key);
            return fs.readFileSync(filename, "utf8");
          } else {
            return null;
          }
        };
        LocalStorage2.prototype._getStat = function(key) {
          var filename;
          key = _escapeKey(key);
          filename = path4.join(this._location, encodeURIComponent(key));
          try {
            return fs.statSync(filename);
          } catch (error) {
            return null;
          }
        };
        LocalStorage2.prototype.removeItem = function(key) {
          var evnt, filename, hasListeners, k, meta, metaKey, oldValue, ref, v;
          key = _escapeKey(key);
          metaKey = this._metaKeyMap[key];
          if (!!metaKey) {
            hasListeners = this.listenerCount("storage");
            oldValue = null;
            if (hasListeners) {
              oldValue = this.getItem(key);
            }
            delete this._metaKeyMap[key];
            this.length -= 1;
            this._bytesInUse -= metaKey.size;
            filename = path4.join(this._location, metaKey.key);
            this._keys.splice(metaKey.index, 1);
            ref = this._metaKeyMap;
            for (k in ref) {
              v = ref[k];
              meta = this._metaKeyMap[k];
              if (meta.index > metaKey.index) {
                meta.index -= 1;
              }
            }
            _rm(filename);
            if (hasListeners) {
              evnt = new StorageEvent(key, oldValue, null, this._eventUrl);
              return this.emit("storage", evnt);
            }
          }
        };
        LocalStorage2.prototype.key = function(n) {
          var rawKey;
          rawKey = this._keys[n];
          if (rawKey === KEY_FOR_EMPTY_STRING) {
            return "";
          } else {
            return rawKey;
          }
        };
        LocalStorage2.prototype.clear = function() {
          var evnt;
          _emptyDirectory(this._location);
          this._metaKeyMap = createMap();
          this._keys = [];
          this.length = 0;
          this._bytesInUse = 0;
          if (this.listenerCount("storage")) {
            evnt = new StorageEvent(null, null, null, this._eventUrl);
            return this.emit("storage", evnt);
          }
        };
        LocalStorage2.prototype._getBytesInUse = function() {
          return this._bytesInUse;
        };
        LocalStorage2.prototype._deleteLocation = function() {
          delete instanceMap[this._location];
          _rm(this._location);
          this._metaKeyMap = {};
          this._keys = [];
          this.length = 0;
          return this._bytesInUse = 0;
        };
        return LocalStorage2;
      }(events.EventEmitter);
      JSONStorage = function(superClass) {
        extend(JSONStorage2, superClass);
        function JSONStorage2() {
          return JSONStorage2.__super__.constructor.apply(this, arguments);
        }
        JSONStorage2.prototype.setItem = function(key, value) {
          var newValue;
          newValue = JSON.stringify(value);
          return JSONStorage2.__super__.setItem.call(this, key, newValue);
        };
        JSONStorage2.prototype.getItem = function(key) {
          return JSON.parse(JSONStorage2.__super__.getItem.call(this, key));
        };
        return JSONStorage2;
      }(LocalStorage);
      exports2.LocalStorage = LocalStorage;
      exports2.JSONStorage = JSONStorage;
      exports2.QUOTA_EXCEEDED_ERR = QUOTA_EXCEEDED_ERR;
    }).call(exports2);
  }
});

// node_modules/telegram/sessions/localStorage.js
var require_localStorage = __commonJS({
  "node_modules/telegram/sessions/localStorage.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.LocalStorage = void 0;
    exports2.LocalStorage = require_LocalStorage().LocalStorage;
  }
});

// node_modules/telegram/sessions/StoreSession.js
var require_StoreSession = __commonJS({
  "node_modules/telegram/sessions/StoreSession.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.StoreSession = void 0;
    var Memory_1 = require_Memory();
    var store2_1 = __importDefault2(require_store2());
    var AuthKey_1 = require_AuthKey();
    var StoreSession2 = class extends Memory_1.MemorySession {
      constructor(sessionName, divider = ":") {
        super();
        if (sessionName === "session") {
          throw new Error("Session name can't be 'session'. Please use a different name.");
        }
        if (typeof localStorage === "undefined" || localStorage === null) {
          const LocalStorage = require_localStorage().LocalStorage;
          this.store = store2_1.default.area(sessionName, new LocalStorage("./" + sessionName));
        } else {
          this.store = store2_1.default.area(sessionName, localStorage);
        }
        if (divider == void 0) {
          divider = ":";
        }
        this.sessionName = sessionName + divider;
      }
      async load() {
        let authKey = this.store.get(this.sessionName + "authKey");
        if (authKey && typeof authKey === "object") {
          this._authKey = new AuthKey_1.AuthKey();
          if ("data" in authKey) {
            authKey = Buffer.from(authKey.data);
          }
          await this._authKey.setKey(authKey);
        }
        const dcId = this.store.get(this.sessionName + "dcId");
        if (dcId) {
          this._dcId = dcId;
        }
        const port = this.store.get(this.sessionName + "port");
        if (port) {
          this._port = port;
        }
        const serverAddress = this.store.get(this.sessionName + "serverAddress");
        if (serverAddress) {
          this._serverAddress = serverAddress;
        }
      }
      setDC(dcId, serverAddress, port) {
        this.store.set(this.sessionName + "dcId", dcId);
        this.store.set(this.sessionName + "port", port);
        this.store.set(this.sessionName + "serverAddress", serverAddress);
        super.setDC(dcId, serverAddress, port);
      }
      set authKey(value) {
        this._authKey = value;
        this.store.set(this.sessionName + "authKey", value === null || value === void 0 ? void 0 : value.getKey());
      }
      get authKey() {
        return this._authKey;
      }
      processEntities(tlo) {
        const rows = this._entitiesToRows(tlo);
        if (!rows) {
          return;
        }
        for (const row of rows) {
          row.push(new Date().getTime().toString());
          this.store.set(this.sessionName + row[0], row);
        }
      }
      getEntityRowsById(id, exact = true) {
        return this.store.get(this.sessionName + id.toString());
      }
    };
    exports2.StoreSession = StoreSession2;
  }
});

// node_modules/telegram/sessions/index.js
var require_sessions = __commonJS({
  "node_modules/telegram/sessions/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Session = exports2.StoreSession = exports2.StringSession = exports2.MemorySession = void 0;
    var Memory_1 = require_Memory();
    Object.defineProperty(exports2, "MemorySession", { enumerable: true, get: function() {
      return Memory_1.MemorySession;
    } });
    var StringSession_1 = require_StringSession();
    Object.defineProperty(exports2, "StringSession", { enumerable: true, get: function() {
      return StringSession_1.StringSession;
    } });
    var StoreSession_1 = require_StoreSession();
    Object.defineProperty(exports2, "StoreSession", { enumerable: true, get: function() {
      return StoreSession_1.StoreSession;
    } });
    var Abstract_1 = require_Abstract();
    Object.defineProperty(exports2, "Session", { enumerable: true, get: function() {
      return Abstract_1.Session;
    } });
  }
});

// node_modules/telegram/client/os.js
var require_os = __commonJS({
  "node_modules/telegram/client/os.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    var os3 = __importStar2(require("os"));
    exports2.default = os3;
  }
});

// node_modules/telegram/entityCache.js
var require_entityCache = __commonJS({
  "node_modules/telegram/entityCache.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.EntityCache = void 0;
    var Utils_1 = require_Utils();
    var Helpers_1 = require_Helpers();
    var tl_1 = require_tl();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var EntityCache = class {
      constructor() {
        this.cacheMap = /* @__PURE__ */ new Map();
      }
      add(entities) {
        const temp = [];
        if (!(0, Helpers_1.isArrayLike)(entities)) {
          if (entities != void 0) {
            if (typeof entities == "object") {
              if ("chats" in entities) {
                temp.push(...entities.chats);
              }
              if ("users" in entities) {
                temp.push(...entities.users);
              }
              if ("user" in entities) {
                temp.push(entities.user);
              }
            }
          }
          if (temp.length) {
            entities = temp;
          } else {
            return;
          }
        }
        for (const entity of entities) {
          try {
            const pid = (0, Utils_1.getPeerId)(entity);
            if (!this.cacheMap.has(pid.toString())) {
              this.cacheMap.set(pid.toString(), (0, Utils_1.getInputPeer)(entity));
            }
          } catch (e) {
          }
        }
      }
      get(item) {
        if (item == void 0) {
          throw new Error("No cached entity for the given key");
        }
        item = (0, Helpers_1.returnBigInt)(item);
        if (item.lesser(big_integer_1.default.zero)) {
          let res;
          try {
            res = this.cacheMap.get((0, Utils_1.getPeerId)(item).toString());
            if (res) {
              return res;
            }
          } catch (e) {
            throw new Error("Invalid key will not have entity");
          }
        }
        for (const cls of [tl_1.Api.PeerUser, tl_1.Api.PeerChat, tl_1.Api.PeerChannel]) {
          const result = this.cacheMap.get((0, Utils_1.getPeerId)(new cls({
            userId: item,
            chatId: item,
            channelId: item
          })).toString());
          if (result) {
            return result;
          }
        }
        throw new Error("No cached entity for the given key");
      }
    };
    exports2.EntityCache = EntityCache;
  }
});

// node_modules/telegram/crypto/IGE.js
var require_IGE = __commonJS({
  "node_modules/telegram/crypto/IGE.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.IGE = void 0;
    var Helpers = require_Helpers();
    var { IGE: aes_ige } = require_aes_min();
    var IGENEW = class {
      constructor(key, iv) {
        this.ige = new aes_ige(key, iv);
      }
      /**
       * Decrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector
       * @param cipherText {Buffer}
       * @returns {Buffer}
       */
      decryptIge(cipherText) {
        return Helpers.convertToLittle(this.ige.decrypt(cipherText));
      }
      /**
       * Encrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector
       * @param plainText {Buffer}
       * @returns {Buffer}
       */
      encryptIge(plainText) {
        const padding = plainText.length % 16;
        if (padding) {
          plainText = Buffer.concat([
            plainText,
            Helpers.generateRandomBytes(16 - padding)
          ]);
        }
        return Helpers.convertToLittle(this.ige.encrypt(plainText));
      }
    };
    exports2.IGE = IGENEW;
  }
});

// node_modules/telegram/network/MTProtoState.js
var require_MTProtoState = __commonJS({
  "node_modules/telegram/network/MTProtoState.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MTProtoState = void 0;
    var big_integer_1 = __importDefault2(require_BigInteger());
    var __1 = require_telegram();
    var tl_1 = require_tl();
    var Helpers_1 = require_Helpers();
    var core_1 = require_core();
    var extensions_1 = require_extensions();
    var IGE_1 = require_IGE();
    var errors_1 = require_errors();
    var MTProtoState = class {
      /**
           *
           `telethon.network.mtprotosender.MTProtoSender` needs to hold a state
           in order to be able to encrypt and decrypt incoming/outgoing messages,
           as well as generating the message IDs. Instances of this class hold
           together all the required information.
      
           It doesn't make sense to use `telethon.sessions.abstract.Session` for
           the sender because the sender should *not* be concerned about storing
           this information to disk, as one may create as many senders as they
           desire to any other data center, or some CDN. Using the same session
           for all these is not a good idea as each need their own authkey, and
           the concept of "copying" sessions with the unnecessary entities or
           updates state for these connections doesn't make sense.
      
           While it would be possible to have a `MTProtoPlainState` that does no
           encryption so that it was usable through the `MTProtoLayer` and thus
           avoid the need for a `MTProtoPlainSender`, the `MTProtoLayer` is more
           focused to efficiency and this state is also more advanced (since it
           supports gzipping and invoking after other message IDs). There are too
           many methods that would be needed to make it convenient to use for the
           authentication process, at which point the `MTProtoPlainSender` is better
           * @param authKey
           * @param loggers
           * @param securityChecks
           */
      constructor(authKey, loggers, securityChecks = true) {
        this.authKey = authKey;
        this._log = loggers;
        this.timeOffset = 0;
        this.salt = big_integer_1.default.zero;
        this._sequence = 0;
        this.id = this._lastMsgId = big_integer_1.default.zero;
        this.msgIds = [];
        this.securityChecks = securityChecks;
        this.reset();
      }
      /**
       * Resets the state
       */
      reset() {
        this.id = __1.helpers.generateRandomLong(true);
        this._sequence = 0;
        this._lastMsgId = big_integer_1.default.zero;
        this.msgIds = [];
      }
      /**
       * Updates the message ID to a new one,
       * used when the time offset changed.
       * @param message
       */
      updateMessageId(message) {
        message.msgId = this._getNewMsgId();
      }
      /**
       * Calculate the key based on Telegram guidelines, specifying whether it's the client or not
       * @param authKey
       * @param msgKey
       * @param client
       * @returns {{iv: Buffer, key: Buffer}}
       */
      async _calcKey(authKey, msgKey, client2) {
        const x = client2 ? 0 : 8;
        const [sha256a, sha256b] = await Promise.all([
          (0, Helpers_1.sha256)(Buffer.concat([msgKey, authKey.slice(x, x + 36)])),
          (0, Helpers_1.sha256)(Buffer.concat([authKey.slice(x + 40, x + 76), msgKey]))
        ]);
        const key = Buffer.concat([
          sha256a.slice(0, 8),
          sha256b.slice(8, 24),
          sha256a.slice(24, 32)
        ]);
        const iv = Buffer.concat([
          sha256b.slice(0, 8),
          sha256a.slice(8, 24),
          sha256b.slice(24, 32)
        ]);
        return { key, iv };
      }
      /**
       * Writes a message containing the given data into buffer.
       * Returns the message id.
       * @param buffer
       * @param data
       * @param contentRelated
       * @param afterId
       */
      async writeDataAsMessage(buffer, data, contentRelated, afterId) {
        const msgId = this._getNewMsgId();
        const seqNo = this._getSeqNo(contentRelated);
        let body;
        if (!afterId) {
          body = await core_1.GZIPPacked.gzipIfSmaller(contentRelated, data);
        } else {
          body = await core_1.GZIPPacked.gzipIfSmaller(contentRelated, new tl_1.Api.InvokeAfterMsg({
            msgId: afterId,
            query: {
              getBytes() {
                return data;
              }
            }
          }).getBytes());
        }
        const s = Buffer.alloc(4);
        s.writeInt32LE(seqNo, 0);
        const b = Buffer.alloc(4);
        b.writeInt32LE(body.length, 0);
        const m = (0, Helpers_1.toSignedLittleBuffer)(msgId, 8);
        buffer.write(Buffer.concat([m, s, b]));
        buffer.write(body);
        return msgId;
      }
      /**
       * Encrypts the given message data using the current authorization key
       * following MTProto 2.0 guidelines core.telegram.org/mtproto/description.
       * @param data
       */
      async encryptMessageData(data) {
        if (!this.authKey) {
          throw new Error("Auth key unset");
        }
        await this.authKey.waitForKey();
        const authKey = this.authKey.getKey();
        if (!authKey) {
          throw new Error("Auth key unset");
        }
        if (!this.salt || !this.id || !authKey || !this.authKey.keyId) {
          throw new Error("Unset params");
        }
        const s = (0, Helpers_1.toSignedLittleBuffer)(this.salt, 8);
        const i = (0, Helpers_1.toSignedLittleBuffer)(this.id, 8);
        data = Buffer.concat([Buffer.concat([s, i]), data]);
        const padding = __1.helpers.generateRandomBytes(__1.helpers.mod(-(data.length + 12), 16) + 12);
        const msgKeyLarge = await (0, Helpers_1.sha256)(Buffer.concat([authKey.slice(88, 88 + 32), data, padding]));
        const msgKey = msgKeyLarge.slice(8, 24);
        const { iv, key } = await this._calcKey(authKey, msgKey, true);
        const keyId = __1.helpers.readBufferFromBigInt(this.authKey.keyId, 8);
        return Buffer.concat([
          keyId,
          msgKey,
          new IGE_1.IGE(key, iv).encryptIge(Buffer.concat([data, padding]))
        ]);
      }
      /**
       * Inverse of `encrypt_message_data` for incoming server messages.
       * @param body
       */
      async decryptMessageData(body) {
        if (!this.authKey) {
          throw new Error("Auth key unset");
        }
        if (body.length < 8) {
          throw new errors_1.InvalidBufferError(body);
        }
        const keyId = __1.helpers.readBigIntFromBuffer(body.slice(0, 8));
        if (!this.authKey.keyId || keyId.neq(this.authKey.keyId)) {
          throw new errors_1.SecurityError("Server replied with an invalid auth key");
        }
        const authKey = this.authKey.getKey();
        if (!authKey) {
          throw new errors_1.SecurityError("Unset AuthKey");
        }
        const msgKey = body.slice(8, 24);
        const { iv, key } = await this._calcKey(authKey, msgKey, false);
        body = new IGE_1.IGE(key, iv).decryptIge(body.slice(24));
        const ourKey = await (0, Helpers_1.sha256)(Buffer.concat([authKey.slice(96, 96 + 32), body]));
        if (!msgKey.equals(ourKey.slice(8, 24))) {
          throw new errors_1.SecurityError("Received msg_key doesn't match with expected one");
        }
        const reader = new extensions_1.BinaryReader(body);
        reader.readLong();
        const serverId = reader.readLong();
        if (serverId.neq(this.id)) {
        }
        const remoteMsgId = reader.readLong();
        if (this.msgIds.includes(remoteMsgId.toString()) && this.securityChecks) {
          throw new errors_1.SecurityError("Duplicate msgIds");
        }
        if (this.msgIds.length > 500) {
          this.msgIds.shift();
        }
        this.msgIds.push(remoteMsgId.toString());
        const remoteSequence = reader.readInt();
        reader.readInt();
        const obj2 = reader.tgReadObject();
        return new core_1.TLMessage(remoteMsgId, remoteSequence, obj2);
      }
      /**
       * Generates a new unique message ID based on the current
       * time (in ms) since epoch, applying a known time offset.
       * @private
       */
      _getNewMsgId() {
        const now = new Date().getTime() / 1e3 + this.timeOffset;
        const nanoseconds = Math.floor((now - Math.floor(now)) * 1e9);
        let newMsgId = (0, big_integer_1.default)(Math.floor(now)).shiftLeft((0, big_integer_1.default)(32)).or((0, big_integer_1.default)(nanoseconds).shiftLeft((0, big_integer_1.default)(2)));
        if (this._lastMsgId.greaterOrEquals(newMsgId)) {
          newMsgId = this._lastMsgId.add((0, big_integer_1.default)(4));
        }
        this._lastMsgId = newMsgId;
        return newMsgId;
      }
      /**
       * Updates the time offset to the correct
       * one given a known valid message ID.
       * @param correctMsgId {BigInteger}
       */
      updateTimeOffset(correctMsgId) {
        const bad = this._getNewMsgId();
        const old = this.timeOffset;
        const now = Math.floor(new Date().getTime() / 1e3);
        const correct = correctMsgId.shiftRight((0, big_integer_1.default)(32)).toJSNumber();
        this.timeOffset = correct - now;
        if (this.timeOffset !== old) {
          this._lastMsgId = big_integer_1.default.zero;
          this._log.debug(`Updated time offset (old offset ${old}, bad ${bad}, good ${correctMsgId}, new ${this.timeOffset})`);
        }
        return this.timeOffset;
      }
      /**
       * Generates the next sequence number depending on whether
       * it should be for a content-related query or not.
       * @param contentRelated
       * @private
       */
      _getSeqNo(contentRelated) {
        if (contentRelated) {
          const result = this._sequence * 2 + 1;
          this._sequence += 1;
          return result;
        } else {
          return this._sequence * 2;
        }
      }
    };
    exports2.MTProtoState = MTProtoState;
  }
});

// node_modules/telegram/network/MTProtoPlainSender.js
var require_MTProtoPlainSender = __commonJS({
  "node_modules/telegram/network/MTProtoPlainSender.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MTProtoPlainSender = void 0;
    var big_integer_1 = __importDefault2(require_BigInteger());
    var MTProtoState_1 = require_MTProtoState();
    var Helpers_1 = require_Helpers();
    var errors_1 = require_errors();
    var extensions_1 = require_extensions();
    var MTProtoPlainSender = class {
      /**
       * Initializes the MTProto plain sender.
       * @param connection connection: the Connection to be used.
       * @param loggers
       */
      constructor(connection, loggers) {
        this._state = new MTProtoState_1.MTProtoState(void 0, loggers);
        this._connection = connection;
      }
      /**
       * Sends and receives the result for the given request.
       * @param request
       */
      async send(request) {
        let body = request.getBytes();
        let msgId = this._state._getNewMsgId();
        const m = (0, Helpers_1.toSignedLittleBuffer)(msgId, 8);
        const b = Buffer.alloc(4);
        b.writeInt32LE(body.length, 0);
        const res = Buffer.concat([
          Buffer.concat([Buffer.alloc(8), m, b]),
          body
        ]);
        await this._connection.send(res);
        body = await this._connection.recv();
        if (body.length < 8) {
          throw new errors_1.InvalidBufferError(body);
        }
        const reader = new extensions_1.BinaryReader(body);
        const authKeyId = reader.readLong();
        if (authKeyId.neq((0, big_integer_1.default)(0))) {
          throw new Error("Bad authKeyId");
        }
        msgId = reader.readLong();
        if (msgId.eq((0, big_integer_1.default)(0))) {
          throw new Error("Bad msgId");
        }
        const length = reader.readInt();
        if (length <= 0) {
          throw new Error("Bad length");
        }
        return reader.tgReadObject();
      }
    };
    exports2.MTProtoPlainSender = MTProtoPlainSender;
  }
});

// node_modules/telegram/crypto/Factorizator.js
var require_Factorizator = __commonJS({
  "node_modules/telegram/crypto/Factorizator.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Factorizator = void 0;
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Helpers_1 = require_Helpers();
    var Factorizator = class {
      /**
       * Calculates the greatest common divisor
       * @param a {BigInteger}
       * @param b {BigInteger}
       * @returns {BigInteger}
       */
      static gcd(a, b) {
        while (b.neq(big_integer_1.default.zero)) {
          const temp = b;
          b = a.remainder(b);
          a = temp;
        }
        return a;
      }
      /**
       * Factorizes the given number and returns both the divisor and the number divided by the divisor
       * @param pq {BigInteger}
       * @returns {{p: *, q: *}}
       */
      static factorize(pq) {
        if (pq.remainder(2).equals(big_integer_1.default.zero)) {
          return { p: (0, big_integer_1.default)(2), q: pq.divide((0, big_integer_1.default)(2)) };
        }
        let y = big_integer_1.default.randBetween((0, big_integer_1.default)(1), pq.minus(1));
        const c = big_integer_1.default.randBetween((0, big_integer_1.default)(1), pq.minus(1));
        const m = big_integer_1.default.randBetween((0, big_integer_1.default)(1), pq.minus(1));
        let g = big_integer_1.default.one;
        let r = big_integer_1.default.one;
        let q2 = big_integer_1.default.one;
        let x = big_integer_1.default.zero;
        let ys = big_integer_1.default.zero;
        let k;
        while (g.eq(big_integer_1.default.one)) {
          x = y;
          for (let i = 0; (0, big_integer_1.default)(i).lesser(r); i++) {
            y = (0, Helpers_1.modExp)(y, (0, big_integer_1.default)(2), pq).add(c).remainder(pq);
          }
          k = big_integer_1.default.zero;
          while (k.lesser(r) && g.eq(big_integer_1.default.one)) {
            ys = y;
            const condition = big_integer_1.default.min(m, r.minus(k));
            for (let i = 0; (0, big_integer_1.default)(i).lesser(condition); i++) {
              y = (0, Helpers_1.modExp)(y, (0, big_integer_1.default)(2), pq).add(c).remainder(pq);
              q2 = q2.multiply(x.minus(y).abs()).remainder(pq);
            }
            g = Factorizator.gcd(q2, pq);
            k = k.add(m);
          }
          r = r.multiply(2);
        }
        if (g.eq(pq)) {
          while (true) {
            ys = (0, Helpers_1.modExp)(ys, (0, big_integer_1.default)(2), pq).add(c).remainder(pq);
            g = Factorizator.gcd(x.minus(ys).abs(), pq);
            if (g.greater(1)) {
              break;
            }
          }
        }
        const p = g;
        q2 = pq.divide(g);
        return p < q2 ? { p, q: q2 } : { p: q2, q: p };
      }
    };
    exports2.Factorizator = Factorizator;
  }
});

// node_modules/telegram/crypto/RSA.js
var require_RSA = __commonJS({
  "node_modules/telegram/crypto/RSA.js"(exports2) {
    "use strict";
    var __rest2 = exports2 && exports2.__rest || function(s, e) {
      var t = {};
      for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
          t[p] = s[p];
      if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
            t[p[i]] = s[p[i]];
        }
      return t;
    };
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.encrypt = exports2._serverKeys = void 0;
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Helpers_1 = require_Helpers();
    var PUBLIC_KEYS = [
      {
        fingerprint: (0, big_integer_1.default)("-3414540481677951611"),
        n: (0, big_integer_1.default)("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),
        e: 65537
      },
      {
        fingerprint: (0, big_integer_1.default)("-5595554452916591101"),
        n: (0, big_integer_1.default)("25342889448840415564971689590713473206898847759084779052582026594546022463853940585885215951168491965708222649399180603818074200620463776135424884632162512403163793083921641631564740959529419359595852941166848940585952337613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951323237820036543581047826906120927972487366805292115792231423684261262330394324750785450942589751755390156647751460719351439969059949569615302809050721500330239005077889855323917509948255722081644689442127297605422579707142646660768825302832201908302295573257427896031830742328565032949"),
        e: 65537
      }
    ];
    exports2._serverKeys = /* @__PURE__ */ new Map();
    PUBLIC_KEYS.forEach((_a) => {
      var { fingerprint } = _a, keyInfo = __rest2(_a, ["fingerprint"]);
      exports2._serverKeys.set(fingerprint.toString(), keyInfo);
    });
    async function encrypt2(fingerprint, data) {
      const key = exports2._serverKeys.get(fingerprint.toString());
      if (!key) {
        return void 0;
      }
      const rand = (0, Helpers_1.generateRandomBytes)(235 - data.length);
      const toEncrypt = Buffer.concat([await (0, Helpers_1.sha1)(data), data, rand]);
      const payload = (0, Helpers_1.readBigIntFromBuffer)(toEncrypt, false);
      const encrypted = (0, Helpers_1.modExp)(payload, (0, big_integer_1.default)(key.e), key.n);
      return (0, Helpers_1.readBufferFromBigInt)(encrypted, 256, false);
    }
    exports2.encrypt = encrypt2;
  }
});

// node_modules/telegram/network/Authenticator.js
var require_Authenticator = __commonJS({
  "node_modules/telegram/network/Authenticator.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.doAuthentication = void 0;
    var Helpers_1 = require_Helpers();
    var tl_1 = require_tl();
    var errors_1 = require_errors();
    var Factorizator_1 = require_Factorizator();
    var RSA_1 = require_RSA();
    var IGE_1 = require_IGE();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var extensions_1 = require_extensions();
    var AuthKey_1 = require_AuthKey();
    var RETRIES = 20;
    async function doAuthentication(sender, log) {
      let bytes = (0, Helpers_1.generateRandomBytes)(16);
      const nonce = (0, Helpers_1.readBigIntFromBuffer)(bytes, false, true);
      const resPQ = await sender.send(new tl_1.Api.ReqPqMulti({ nonce }));
      log.debug("Starting authKey generation step 1");
      if (!(resPQ instanceof tl_1.Api.ResPQ)) {
        throw new errors_1.SecurityError(`Step 1 answer was ${resPQ}`);
      }
      if (resPQ.nonce.neq(nonce)) {
        throw new errors_1.SecurityError("Step 1 invalid nonce from server");
      }
      const pq = (0, Helpers_1.readBigIntFromBuffer)(resPQ.pq, false, true);
      log.debug("Finished authKey generation step 1");
      const { p, q: q2 } = Factorizator_1.Factorizator.factorize(pq);
      const pBuffer = (0, Helpers_1.getByteArray)(p);
      const qBuffer = (0, Helpers_1.getByteArray)(q2);
      bytes = (0, Helpers_1.generateRandomBytes)(32);
      const newNonce = (0, Helpers_1.readBigIntFromBuffer)(bytes, true, true);
      const pqInnerData = new tl_1.Api.PQInnerData({
        pq: (0, Helpers_1.getByteArray)(pq),
        p: pBuffer,
        q: qBuffer,
        nonce: resPQ.nonce,
        serverNonce: resPQ.serverNonce,
        newNonce
      }).getBytes();
      if (pqInnerData.length > 144) {
        throw new errors_1.SecurityError("Step 1 invalid nonce from server");
      }
      let targetFingerprint;
      let targetKey;
      for (const fingerprint of resPQ.serverPublicKeyFingerprints) {
        targetKey = RSA_1._serverKeys.get(fingerprint.toString());
        if (targetKey !== void 0) {
          targetFingerprint = fingerprint;
          break;
        }
      }
      if (targetFingerprint === void 0 || targetKey === void 0) {
        throw new errors_1.SecurityError("Step 2 could not find a valid key for fingerprints");
      }
      const padding = (0, Helpers_1.generateRandomBytes)(192 - pqInnerData.length);
      const dataWithPadding = Buffer.concat([pqInnerData, padding]);
      const dataPadReversed = Buffer.from(dataWithPadding).reverse();
      let encryptedData;
      for (let i = 0; i < RETRIES; i++) {
        const tempKey = (0, Helpers_1.generateRandomBytes)(32);
        const shaDigestKeyWithData = await (0, Helpers_1.sha256)(Buffer.concat([tempKey, dataWithPadding]));
        const dataWithHash = Buffer.concat([
          dataPadReversed,
          shaDigestKeyWithData
        ]);
        const ige2 = new IGE_1.IGE(tempKey, Buffer.alloc(32));
        const aesEncrypted = ige2.encryptIge(dataWithHash);
        const tempKeyXor = (0, Helpers_1.bufferXor)(tempKey, await (0, Helpers_1.sha256)(aesEncrypted));
        const keyAesEncrypted = Buffer.concat([tempKeyXor, aesEncrypted]);
        const keyAesEncryptedInt = (0, Helpers_1.readBigIntFromBuffer)(keyAesEncrypted, false, false);
        if (keyAesEncryptedInt.greaterOrEquals(targetKey.n)) {
          log.debug("Aes key greater than RSA. retrying");
          continue;
        }
        const encryptedDataBuffer = (0, Helpers_1.modExp)(keyAesEncryptedInt, (0, big_integer_1.default)(targetKey.e), targetKey.n);
        encryptedData = (0, Helpers_1.readBufferFromBigInt)(encryptedDataBuffer, 256, false, false);
        break;
      }
      if (encryptedData === void 0) {
        throw new errors_1.SecurityError("Step 2 could create a secure encrypted key");
      }
      log.debug("Step 2 : Generated a secure aes encrypted data");
      const serverDhParams = await sender.send(new tl_1.Api.ReqDHParams({
        nonce: resPQ.nonce,
        serverNonce: resPQ.serverNonce,
        p: pBuffer,
        q: qBuffer,
        publicKeyFingerprint: targetFingerprint,
        encryptedData
      }));
      if (!(serverDhParams instanceof tl_1.Api.ServerDHParamsOk || serverDhParams instanceof tl_1.Api.ServerDHParamsFail)) {
        throw new Error(`Step 2.1 answer was ${serverDhParams}`);
      }
      if (serverDhParams.nonce.neq(resPQ.nonce)) {
        throw new errors_1.SecurityError("Step 2 invalid nonce from server");
      }
      if (serverDhParams.serverNonce.neq(resPQ.serverNonce)) {
        throw new errors_1.SecurityError("Step 2 invalid server nonce from server");
      }
      if (serverDhParams instanceof tl_1.Api.ServerDHParamsFail) {
        const sh = await (0, Helpers_1.sha1)((0, Helpers_1.toSignedLittleBuffer)(newNonce, 32).slice(4, 20));
        const nnh = (0, Helpers_1.readBigIntFromBuffer)(sh, true, true);
        if (serverDhParams.newNonceHash.neq(nnh)) {
          throw new errors_1.SecurityError("Step 2 invalid DH fail nonce from server");
        }
      }
      if (!(serverDhParams instanceof tl_1.Api.ServerDHParamsOk)) {
        throw new Error(`Step 2.2 answer was ${serverDhParams}`);
      }
      log.debug("Finished authKey generation step 2");
      log.debug("Starting authKey generation step 3");
      const { key, iv } = await (0, Helpers_1.generateKeyDataFromNonce)(resPQ.serverNonce, newNonce);
      if (serverDhParams.encryptedAnswer.length % 16 !== 0) {
        throw new errors_1.SecurityError("Step 3 AES block size mismatch");
      }
      const ige = new IGE_1.IGE(key, iv);
      const plainTextAnswer = ige.decryptIge(serverDhParams.encryptedAnswer);
      const reader = new extensions_1.BinaryReader(plainTextAnswer);
      reader.read(20);
      const serverDhInner = reader.tgReadObject();
      if (!(serverDhInner instanceof tl_1.Api.ServerDHInnerData)) {
        throw new Error(`Step 3 answer was ${serverDhInner}`);
      }
      if (serverDhInner.nonce.neq(resPQ.nonce)) {
        throw new errors_1.SecurityError("Step 3 Invalid nonce in encrypted answer");
      }
      if (serverDhInner.serverNonce.neq(resPQ.serverNonce)) {
        throw new errors_1.SecurityError("Step 3 Invalid server nonce in encrypted answer");
      }
      const dhPrime = (0, Helpers_1.readBigIntFromBuffer)(serverDhInner.dhPrime, false, false);
      const ga = (0, Helpers_1.readBigIntFromBuffer)(serverDhInner.gA, false, false);
      const timeOffset = serverDhInner.serverTime - Math.floor(new Date().getTime() / 1e3);
      const b = (0, Helpers_1.readBigIntFromBuffer)((0, Helpers_1.generateRandomBytes)(256), false, false);
      const gb = (0, Helpers_1.modExp)((0, big_integer_1.default)(serverDhInner.g), b, dhPrime);
      const gab = (0, Helpers_1.modExp)(ga, b, dhPrime);
      const clientDhInner = new tl_1.Api.ClientDHInnerData({
        nonce: resPQ.nonce,
        serverNonce: resPQ.serverNonce,
        retryId: big_integer_1.default.zero,
        gB: (0, Helpers_1.getByteArray)(gb, false)
      }).getBytes();
      const clientDdhInnerHashed = Buffer.concat([
        await (0, Helpers_1.sha1)(clientDhInner),
        clientDhInner
      ]);
      const clientDhEncrypted = ige.encryptIge(clientDdhInnerHashed);
      const dhGen = await sender.send(new tl_1.Api.SetClientDHParams({
        nonce: resPQ.nonce,
        serverNonce: resPQ.serverNonce,
        encryptedData: clientDhEncrypted
      }));
      const nonceTypes = [tl_1.Api.DhGenOk, tl_1.Api.DhGenRetry, tl_1.Api.DhGenFail];
      const nonceTypesString = ["DhGenOk", "DhGenRetry", "DhGenFail"];
      if (!(dhGen instanceof nonceTypes[0] || dhGen instanceof nonceTypes[1] || dhGen instanceof nonceTypes[2])) {
        throw new Error(`Step 3.1 answer was ${dhGen}`);
      }
      const { name } = dhGen.constructor;
      if (dhGen.nonce.neq(resPQ.nonce)) {
        throw new errors_1.SecurityError(`Step 3 invalid ${name} nonce from server`);
      }
      if (dhGen.serverNonce.neq(resPQ.serverNonce)) {
        throw new errors_1.SecurityError(`Step 3 invalid ${name} server nonce from server`);
      }
      const authKey = new AuthKey_1.AuthKey();
      await authKey.setKey((0, Helpers_1.getByteArray)(gab));
      const nonceNumber = 1 + nonceTypesString.indexOf(dhGen.className);
      const newNonceHash = await authKey.calcNewNonceHash(newNonce, nonceNumber);
      const dhHash = dhGen[`newNonceHash${nonceNumber}`];
      if (dhHash.neq(newNonceHash)) {
        throw new errors_1.SecurityError("Step 3 invalid new nonce hash");
      }
      if (!(dhGen instanceof tl_1.Api.DhGenOk)) {
        throw new Error(`Step 3.2 answer was ${dhGen}`);
      }
      log.debug("Finished authKey generation step 3");
      return { authKey, timeOffset };
    }
    exports2.doAuthentication = doAuthentication;
  }
});

// node_modules/telegram/extensions/PendingState.js
var require_PendingState = __commonJS({
  "node_modules/telegram/extensions/PendingState.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.PendingState = void 0;
    var PendingState = class {
      constructor() {
        this._pending = /* @__PURE__ */ new Map();
      }
      set(msgId, state) {
        this._pending.set(msgId.toString(), state);
      }
      get(msgId) {
        return this._pending.get(msgId.toString());
      }
      getAndDelete(msgId) {
        const state = this.get(msgId);
        this.delete(msgId);
        return state;
      }
      values() {
        return Array.from(this._pending.values());
      }
      delete(msgId) {
        this._pending.delete(msgId.toString());
      }
      clear() {
        this._pending.clear();
      }
    };
    exports2.PendingState = PendingState;
  }
});

// node_modules/telegram/network/MTProtoSender.js
var require_MTProtoSender = __commonJS({
  "node_modules/telegram/network/MTProtoSender.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MTProtoSender = void 0;
    var AuthKey_1 = require_AuthKey();
    var MTProtoState_1 = require_MTProtoState();
    var extensions_1 = require_extensions();
    var core_1 = require_core();
    var tl_1 = require_tl();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Helpers_1 = require_Helpers();
    var RequestState_1 = require_RequestState();
    var Authenticator_1 = require_Authenticator();
    var MTProtoPlainSender_1 = require_MTProtoPlainSender();
    var errors_1 = require_errors();
    var _1 = require_network();
    var Logger_1 = require_Logger();
    var async_mutex_1 = require_lib7();
    var PendingState_1 = require_PendingState();
    var MsgsAck = tl_1.Api.MsgsAck;
    var MTProtoSender = class {
      /**
       * @param authKey
       * @param opts
       */
      constructor(authKey, opts) {
        this._exportedSenderPromises = /* @__PURE__ */ new Map();
        const args = Object.assign(Object.assign({}, MTProtoSender.DEFAULT_OPTIONS), opts);
        this._finishedConnecting = false;
        this._cancelSend = false;
        this._connection = void 0;
        this._log = args.logger;
        this._dcId = args.dcId;
        this._retries = args.retries;
        this._delay = args.delay;
        this._autoReconnect = args.autoReconnect;
        this._connectTimeout = args.connectTimeout;
        this._authKeyCallback = args.authKeyCallback;
        this._updateCallback = args.updateCallback;
        this._autoReconnectCallback = args.autoReconnectCallback;
        this._isMainSender = args.isMainSender;
        this._senderCallback = args.senderCallback;
        this._client = args.client;
        this._onConnectionBreak = args.onConnectionBreak;
        this._securityChecks = args.securityChecks;
        this._connectMutex = new async_mutex_1.Mutex();
        this._exportedSenderPromises = args._exportedSenderPromises;
        this.userDisconnected = false;
        this.isConnecting = false;
        this._authenticated = false;
        this._userConnected = false;
        this.isReconnecting = false;
        this._reconnecting = false;
        this._disconnected = true;
        this._sendLoopHandle = null;
        this._recvLoopHandle = null;
        this.authKey = authKey || new AuthKey_1.AuthKey();
        this._state = new MTProtoState_1.MTProtoState(this.authKey, this._log, this._securityChecks);
        this._sendQueue = new extensions_1.MessagePacker(this._state, this._log);
        this._pendingState = new PendingState_1.PendingState();
        this._pendingAck = /* @__PURE__ */ new Set();
        this._lastAcks = [];
        this._handlers = {
          [core_1.RPCResult.CONSTRUCTOR_ID.toString()]: this._handleRPCResult.bind(this),
          [core_1.MessageContainer.CONSTRUCTOR_ID.toString()]: this._handleContainer.bind(this),
          [core_1.GZIPPacked.CONSTRUCTOR_ID.toString()]: this._handleGzipPacked.bind(this),
          [tl_1.Api.Pong.CONSTRUCTOR_ID.toString()]: this._handlePong.bind(this),
          [tl_1.Api.BadServerSalt.CONSTRUCTOR_ID.toString()]: this._handleBadServerSalt.bind(this),
          [tl_1.Api.BadMsgNotification.CONSTRUCTOR_ID.toString()]: this._handleBadNotification.bind(this),
          [tl_1.Api.MsgDetailedInfo.CONSTRUCTOR_ID.toString()]: this._handleDetailedInfo.bind(this),
          [tl_1.Api.MsgNewDetailedInfo.CONSTRUCTOR_ID.toString()]: this._handleNewDetailedInfo.bind(this),
          [tl_1.Api.NewSessionCreated.CONSTRUCTOR_ID.toString()]: this._handleNewSessionCreated.bind(this),
          [tl_1.Api.MsgsAck.CONSTRUCTOR_ID.toString()]: this._handleAck.bind(this),
          [tl_1.Api.FutureSalts.CONSTRUCTOR_ID.toString()]: this._handleFutureSalts.bind(this),
          [tl_1.Api.MsgsStateReq.CONSTRUCTOR_ID.toString()]: this._handleStateForgotten.bind(this),
          [tl_1.Api.MsgResendReq.CONSTRUCTOR_ID.toString()]: this._handleStateForgotten.bind(this),
          [tl_1.Api.MsgsAllInfo.CONSTRUCTOR_ID.toString()]: this._handleMsgAll.bind(this)
        };
      }
      set dcId(dcId) {
        this._dcId = dcId;
      }
      get dcId() {
        return this._dcId;
      }
      // Public API
      /**
       * Connects to the specified given connection using the given auth key.
       */
      async connect(connection, force) {
        this.userDisconnected = false;
        if (this._userConnected && !force) {
          this._log.info("User is already connected!");
          return false;
        }
        this.isConnecting = true;
        this._connection = connection;
        this._finishedConnecting = false;
        for (let attempt = 0; attempt < this._retries; attempt++) {
          try {
            await this._connect();
            if (this._updateCallback) {
              this._updateCallback(this._client, new _1.UpdateConnectionState(_1.UpdateConnectionState.connected));
            }
            this._finishedConnecting = true;
            break;
          } catch (err) {
            if (this._updateCallback && attempt === 0) {
              this._updateCallback(this._client, new _1.UpdateConnectionState(_1.UpdateConnectionState.disconnected));
            }
            this._log.error(`WebSocket connection failed attempt: ${attempt + 1}`);
            if (this._client._errorHandler) {
              await this._client._errorHandler(err);
            }
            if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
              console.error(err);
            }
            await (0, Helpers_1.sleep)(this._delay);
          }
        }
        this.isConnecting = false;
        return this._finishedConnecting;
      }
      isConnected() {
        return this._userConnected;
      }
      _transportConnected() {
        return !this._reconnecting && this._connection && this._connection._connected;
      }
      /**
       * Cleanly disconnects the instance from the network, cancels
       * all pending requests, and closes the send and receive loops.
       */
      async disconnect() {
        this.userDisconnected = true;
        this._log.warn("Disconnecting...");
        await this._disconnect();
      }
      /**
           *
           This method enqueues the given request to be sent. Its send
           state will be saved until a response arrives, and a ``Future``
           that will be resolved when the response arrives will be returned:
      
           .. code-block:: javascript
      
           async def method():
           # Sending (enqueued for the send loop)
           future = sender.send(request)
           # Receiving (waits for the receive loop to read the result)
           result = await future
      
           Designed like this because Telegram may send the response at
           any point, and it can send other items while one waits for it.
           Once the response for this future arrives, it is set with the
           received result, quite similar to how a ``receive()`` call
           would otherwise work.
      
           Since the receiving part is "built in" the future, it's
           impossible to await receive a result that was never sent.
           * @param request
           * @returns {RequestState}
           */
      send(request) {
        const state = new RequestState_1.RequestState(request);
        this._log.debug(`Send ${request.className}`);
        this._sendQueue.append(state);
        return state.promise;
      }
      addStateToQueue(state) {
        this._sendQueue.append(state);
      }
      /**
       * Performs the actual connection, retrying, generating the
       * authorization key if necessary, and starting the send and
       * receive loops.
       * @returns {Promise<void>}
       * @private
       */
      async _connect() {
        const connection = this._connection;
        if (!connection.isConnected()) {
          this._log.info("Connecting to {0}...".replace("{0}", connection.toString()));
          await connection.connect();
          this._log.debug("Connection success!");
        }
        if (!this.authKey.getKey()) {
          const plain = new MTProtoPlainSender_1.MTProtoPlainSender(connection, this._log);
          this._log.debug("New auth_key attempt ...");
          const res = await (0, Authenticator_1.doAuthentication)(plain, this._log);
          this._log.debug("Generated new auth_key successfully");
          await this.authKey.setKey(res.authKey);
          this._state.timeOffset = res.timeOffset;
          if (this._authKeyCallback) {
            await this._authKeyCallback(this.authKey, this._dcId);
          }
        } else {
          this._authenticated = true;
          this._log.debug("Already have an auth key ...");
        }
        this._userConnected = true;
        this.isReconnecting = false;
        if (!this._sendLoopHandle) {
          this._log.debug("Starting send loop");
          this._sendLoopHandle = this._sendLoop();
        }
        if (!this._recvLoopHandle) {
          this._log.debug("Starting receive loop");
          this._recvLoopHandle = this._recvLoop();
        }
        this._log.info("Connection to %s complete!".replace("%s", connection.toString()));
      }
      async _disconnect() {
        const connection = this._connection;
        if (this._updateCallback) {
          this._updateCallback(this._client, new _1.UpdateConnectionState(_1.UpdateConnectionState.disconnected));
        }
        if (connection === void 0) {
          this._log.info("Not disconnecting (already have no connection)");
          return;
        }
        this._log.info("Disconnecting from %s...".replace("%s", connection.toString()));
        this._userConnected = false;
        this._log.debug("Closing current connection...");
        await connection.disconnect();
      }
      _cancelLoops() {
        this._cancelSend = true;
        this.cancellableRecvLoopPromise.cancel();
      }
      /**
       * This loop is responsible for popping items off the send
       * queue, encrypting them, and sending them over the network.
       * Besides `connect`, only this method ever sends data.
       * @returns {Promise<void>}
       * @private
       */
      async _sendLoop() {
        this._sendQueue.prepend(this._pendingState.values());
        this._pendingState.clear();
        while (this._userConnected && !this.isReconnecting) {
          const appendAcks = () => {
            if (this._pendingAck.size) {
              const ack = new RequestState_1.RequestState(new MsgsAck({ msgIds: Array(...this._pendingAck) }));
              this._sendQueue.append(ack);
              this._lastAcks.push(ack);
              if (this._lastAcks.length >= 10) {
                this._lastAcks.shift();
              }
              this._pendingAck.clear();
            }
          };
          appendAcks();
          this._log.debug(`Waiting for messages to send... ${this.isReconnecting}`);
          await this._sendQueue.wait();
          appendAcks();
          const res = await this._sendQueue.get();
          this._log.debug(`Got ${res === null || res === void 0 ? void 0 : res.batch.length} message(s) to send`);
          if (this.isReconnecting) {
            this._log.debug("Reconnecting");
            this._sendLoopHandle = void 0;
            return;
          }
          if (!res) {
            continue;
          }
          let { data } = res;
          const { batch } = res;
          this._log.debug(`Encrypting ${batch.length} message(s) in ${data.length} bytes for sending`);
          this._log.debug(`Sending   ${batch.map((m) => m.request.className)}`);
          data = await this._state.encryptMessageData(data);
          for (const state of batch) {
            if (!Array.isArray(state)) {
              if (state.request.classType === "request") {
                this._pendingState.set(state.msgId, state);
              }
            } else {
              for (const s of state) {
                if (s.request.classType === "request") {
                  this._pendingState.set(s.msgId, s);
                }
              }
            }
          }
          try {
            await this._connection.send(data);
          } catch (e) {
            if (!this.userDisconnected) {
              this._log.debug(`Connection closed while sending data ${e}`);
              if (this._log.canSend(Logger_1.LogLevel.DEBUG)) {
                console.error(e);
              }
              this.reconnect();
            }
            this._sendLoopHandle = void 0;
            return;
          }
          this._log.debug("Encrypted messages put in a queue to be sent");
        }
        this._sendLoopHandle = void 0;
      }
      async _recvLoop() {
        let body;
        let message;
        while (this._userConnected && !this.isReconnecting) {
          this._log.debug("Receiving items from the network...");
          try {
            body = await this._connection.recv();
          } catch (e) {
            if (!this.userDisconnected) {
              this._log.warn("Connection closed while receiving data");
              if (this._log.canSend(Logger_1.LogLevel.WARN)) {
                console.error(e);
              }
              this.reconnect();
            }
            this._recvLoopHandle = void 0;
            return;
          }
          try {
            message = await this._state.decryptMessageData(body);
          } catch (e) {
            this._log.debug(`Error while receiving items from the network ${e}`);
            if (e instanceof errors_1.TypeNotFoundError) {
              this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining}`);
              continue;
            } else if (e instanceof errors_1.SecurityError) {
              this._log.warn(`Security error while unpacking a received message: ${e}`);
              continue;
            } else if (e instanceof errors_1.InvalidBufferError) {
              if (e.code === 404) {
                this._handleBadAuthKey();
              } else {
                this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`);
                this.reconnect();
              }
              this._recvLoopHandle = void 0;
              return;
            } else {
              this._log.error("Unhandled error while receiving data");
              if (this._client._errorHandler) {
                await this._client._errorHandler(e);
              }
              if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
                console.log(e);
              }
              this.reconnect();
              this._recvLoopHandle = void 0;
              return;
            }
          }
          try {
            await this._processMessage(message);
          } catch (e) {
            if (e instanceof errors_1.RPCError) {
              if (e.message === "AUTH_KEY_UNREGISTERED" || e.message === "SESSION_REVOKED") {
                this._handleBadAuthKey(true);
              }
            } else {
              this._log.error("Unhandled error while receiving data");
              if (this._client._errorHandler) {
                await this._client._errorHandler(e);
              }
              if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
                console.log(e);
              }
            }
          }
        }
        this._recvLoopHandle = void 0;
      }
      // Response Handlers
      _handleBadAuthKey(shouldSkipForMain = false) {
        if (shouldSkipForMain && this._isMainSender) {
          return;
        }
        this._log.warn(`Broken authorization key for dc ${this._dcId}, resetting...`);
        if (this._isMainSender && this._updateCallback) {
          this._updateCallback(this._client, new _1.UpdateConnectionState(_1.UpdateConnectionState.broken));
        } else if (!this._isMainSender && this._onConnectionBreak) {
          this._onConnectionBreak(this._dcId);
        }
      }
      /**
       * Adds the given message to the list of messages that must be
       * acknowledged and dispatches control to different ``_handle_*``
       * method based on its type.
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _processMessage(message) {
        this._pendingAck.add(message.msgId);
        message.obj = await message.obj;
        let handler = this._handlers[message.obj.CONSTRUCTOR_ID.toString()];
        if (!handler) {
          handler = this._handleUpdate.bind(this);
        }
        await handler(message);
      }
      /**
       * Pops the states known to match the given ID from pending messages.
       * This method should be used when the response isn't specific.
       * @param msgId
       * @returns {*[]}
       * @private
       */
      _popStates(msgId) {
        var _a;
        const state = this._pendingState.getAndDelete(msgId);
        if (state) {
          return [state];
        }
        const toPop = [];
        for (const pendingState of this._pendingState.values()) {
          if ((_a = pendingState.containerId) === null || _a === void 0 ? void 0 : _a.equals(msgId)) {
            toPop.push(pendingState.msgId);
          }
        }
        if (toPop.length) {
          const temp = [];
          for (const x of toPop) {
            temp.push(this._pendingState.getAndDelete(x));
          }
          return temp;
        }
        for (const ack of this._lastAcks) {
          if (ack.msgId === msgId) {
            return [ack];
          }
        }
        return [];
      }
      /**
       * Handles the result for Remote Procedure Calls:
       * rpc_result#f35c6d01 req_msg_id:long result:bytes = RpcResult;
       * This is where the future results for sent requests are set.
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      _handleRPCResult(message) {
        const result = message.obj;
        const state = this._pendingState.getAndDelete(result.reqMsgId);
        this._log.debug(`Handling RPC result for message ${result.reqMsgId}`);
        if (!state) {
          try {
            const reader = new extensions_1.BinaryReader(result.body);
            if (!(reader.tgReadObject() instanceof tl_1.Api.upload.File)) {
              throw new errors_1.TypeNotFoundError(0, Buffer.alloc(0));
            }
          } catch (e) {
            if (e instanceof errors_1.TypeNotFoundError) {
              this._log.info(`Received response without parent request: ${result.body}`);
              return;
            }
            throw e;
          }
          return;
        }
        if (result.error) {
          const error = (0, errors_1.RPCMessageToError)(result.error, state.request);
          this._sendQueue.append(new RequestState_1.RequestState(new MsgsAck({ msgIds: [state.msgId] })));
          state.reject(error);
          throw error;
        } else {
          try {
            const reader = new extensions_1.BinaryReader(result.body);
            const read2 = state.request.readResult(reader);
            this._log.debug(`Handling RPC result ${read2 === null || read2 === void 0 ? void 0 : read2.className}`);
            state.resolve(read2);
          } catch (err) {
            state.reject(err);
            throw err;
          }
        }
      }
      /**
       * Processes the inner messages of a container with many of them:
       * msg_container#73f1f8dc messages:vector<%Message> = MessageContainer;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleContainer(message) {
        this._log.debug("Handling container");
        for (const innerMessage of message.obj.messages) {
          await this._processMessage(innerMessage);
        }
      }
      /**
       * Unpacks the data from a gzipped object and processes it:
       * gzip_packed#3072cfa1 packed_data:bytes = Object;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleGzipPacked(message) {
        this._log.debug("Handling gzipped data");
        const reader = new extensions_1.BinaryReader(message.obj.data);
        message.obj = reader.tgReadObject();
        await this._processMessage(message);
      }
      async _handleUpdate(message) {
        if (message.obj.SUBCLASS_OF_ID !== 2331323052) {
          this._log.warn(`Note: ${message.obj.className} is not an update, not dispatching it`);
          return;
        }
        this._log.debug("Handling update " + message.obj.className);
        if (this._updateCallback) {
          this._updateCallback(this._client, message.obj);
        }
      }
      /**
       * Handles pong results, which don't come inside a ``RPCResult``
       * but are still sent through a request:
       * pong#347773c5 msg_id:long ping_id:long = Pong;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handlePong(message) {
        const pong = message.obj;
        this._log.debug(`Handling pong for message ${pong.msgId}`);
        const state = this._pendingState.get(pong.msgId.toString());
        this._pendingState.delete(pong.msgId.toString());
        if (state) {
          state.resolve(pong);
        }
      }
      /**
       * Corrects the currently used server salt to use the right value
       * before enqueuing the rejected message to be re-sent:
       * bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int
       * error_code:int new_server_salt:long = BadMsgNotification;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleBadServerSalt(message) {
        const badSalt = message.obj;
        this._log.debug(`Handling bad salt for message ${badSalt.badMsgId}`);
        this._state.salt = badSalt.newServerSalt;
        const states = this._popStates(badSalt.badMsgId);
        this._sendQueue.extend(states);
        this._log.debug(`${states.length} message(s) will be resent`);
      }
      /**
       * Adjusts the current state to be correct based on the
       * received bad message notification whenever possible:
       * bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int
       * error_code:int = BadMsgNotification;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleBadNotification(message) {
        const badMsg = message.obj;
        const states = this._popStates(badMsg.badMsgId);
        this._log.debug(`Handling bad msg ${JSON.stringify(badMsg)}`);
        if ([16, 17].includes(badMsg.errorCode)) {
          const to = this._state.updateTimeOffset((0, big_integer_1.default)(message.msgId));
          this._log.info(`System clock is wrong, set time offset to ${to}s`);
        } else if (badMsg.errorCode === 32) {
          this._state._sequence += 64;
        } else if (badMsg.errorCode === 33) {
          this._state._sequence -= 16;
        } else {
          for (const state of states) {
            state.reject(new errors_1.BadMessageError(state.request, badMsg.errorCode));
          }
          return;
        }
        this._sendQueue.extend(states);
        this._log.debug(`${states.length} messages will be resent due to bad msg`);
      }
      /**
       * Updates the current status with the received detailed information:
       * msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long
       * bytes:int status:int = MsgDetailedInfo;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleDetailedInfo(message) {
        const msgId = message.obj.answerMsgId;
        this._log.debug(`Handling detailed info for message ${msgId}`);
        this._pendingAck.add(msgId);
      }
      /**
       * Updates the current status with the received detailed information:
       * msg_new_detailed_info#809db6df answer_msg_id:long
       * bytes:int status:int = MsgDetailedInfo;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleNewDetailedInfo(message) {
        const msgId = message.obj.answerMsgId;
        this._log.debug(`Handling new detailed info for message ${msgId}`);
        this._pendingAck.add(msgId);
      }
      /**
       * Updates the current status with the received session information:
       * new_session_created#9ec20908 first_msg_id:long unique_id:long
       * server_salt:long = NewSession;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleNewSessionCreated(message) {
        this._log.debug("Handling new session created");
        this._state.salt = message.obj.serverSalt;
      }
      /**
       * Handles a server acknowledge about our messages. Normally these can be ignored
       */
      _handleAck() {
      }
      /**
       * Handles future salt results, which don't come inside a
       * ``rpc_result`` but are still sent through a request:
       *     future_salts#ae500895 req_msg_id:long now:int
       *     salts:vector<future_salt> = FutureSalts;
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleFutureSalts(message) {
        this._log.debug(`Handling future salts for message ${message.msgId}`);
        const state = this._pendingState.getAndDelete(message.msgId);
        if (state) {
          state.resolve(message.obj);
        }
      }
      /**
       * Handles both :tl:`MsgsStateReq` and :tl:`MsgResendReq` by
       * enqueuing a :tl:`MsgsStateInfo` to be sent at a later point.
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleStateForgotten(message) {
        this._sendQueue.append(new RequestState_1.RequestState(new tl_1.Api.MsgsStateInfo({
          reqMsgId: message.msgId,
          info: String.fromCharCode(1).repeat(message.obj.msgIds)
        })));
      }
      /**
       * Handles :tl:`MsgsAllInfo` by doing nothing (yet).
       * @param message
       * @returns {Promise<void>}
       * @private
       */
      async _handleMsgAll(message) {
      }
      reconnect() {
        if (this._userConnected && !this.isReconnecting) {
          this.isReconnecting = true;
          if (this._isMainSender) {
            this._log.debug("Reconnecting all senders");
            for (const promise of this._exportedSenderPromises.values()) {
              promise.then((sender) => {
                if (sender && !sender._isMainSender) {
                  sender.reconnect();
                }
              }).catch((error) => {
                this._log.warn("Error getting sender to reconnect to");
              });
            }
          }
          (0, Helpers_1.sleep)(1e3).then(() => {
            this._log.info("Started reconnecting");
            this._reconnect();
          });
        }
      }
      async _reconnect() {
        try {
          this._log.warn("[Reconnect] Closing current connection...");
          await this._disconnect();
        } catch (err) {
          this._log.warn("Error happened while disconnecting");
          if (this._client._errorHandler) {
            await this._client._errorHandler(err);
          }
          if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(err);
          }
        }
        this._log.debug(`Adding ${this._sendQueue._pendingStates.length} old request to resend`);
        for (let i = 0; i < this._sendQueue._pendingStates.length; i++) {
          if (this._sendQueue._pendingStates[i].msgId != void 0) {
            this._pendingState.set(this._sendQueue._pendingStates[i].msgId, this._sendQueue._pendingStates[i]);
          }
        }
        this._sendQueue.clear();
        this._state.reset();
        const connection = this._connection;
        const newConnection = new connection.constructor({
          ip: connection._ip,
          port: connection._port,
          dcId: connection._dcId,
          loggers: connection._log,
          proxy: connection._proxy,
          testServers: connection._testServers,
          socket: this._client.networkSocket
        });
        await this.connect(newConnection, true);
        this.isReconnecting = false;
        this._sendQueue.prepend(this._pendingState.values());
        this._pendingState.clear();
        if (this._autoReconnectCallback) {
          await this._autoReconnectCallback();
        }
      }
    };
    exports2.MTProtoSender = MTProtoSender;
    MTProtoSender.DEFAULT_OPTIONS = {
      logger: null,
      retries: Infinity,
      delay: 2e3,
      autoReconnect: true,
      connectTimeout: null,
      authKeyCallback: null,
      updateCallback: null,
      autoReconnectCallback: null,
      isMainSender: null,
      senderCallback: null,
      onConnectionBreak: void 0,
      securityChecks: true
    };
  }
});

// node_modules/telegram/network/index.js
var require_network = __commonJS({
  "node_modules/telegram/network/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectionTCPObfuscated = exports2.ConnectionTCPAbridged = exports2.ConnectionTCPFull = exports2.Connection = exports2.UpdateConnectionState = exports2.MTProtoSender = exports2.doAuthentication = exports2.MTProtoPlainSender = void 0;
    var MTProtoPlainSender_1 = require_MTProtoPlainSender();
    Object.defineProperty(exports2, "MTProtoPlainSender", { enumerable: true, get: function() {
      return MTProtoPlainSender_1.MTProtoPlainSender;
    } });
    var Authenticator_1 = require_Authenticator();
    Object.defineProperty(exports2, "doAuthentication", { enumerable: true, get: function() {
      return Authenticator_1.doAuthentication;
    } });
    var MTProtoSender_1 = require_MTProtoSender();
    Object.defineProperty(exports2, "MTProtoSender", { enumerable: true, get: function() {
      return MTProtoSender_1.MTProtoSender;
    } });
    var UpdateConnectionState = class {
      constructor(state) {
        this.state = state;
      }
    };
    exports2.UpdateConnectionState = UpdateConnectionState;
    UpdateConnectionState.disconnected = -1;
    UpdateConnectionState.connected = 1;
    UpdateConnectionState.broken = 0;
    var connection_1 = require_connection();
    Object.defineProperty(exports2, "Connection", { enumerable: true, get: function() {
      return connection_1.Connection;
    } });
    Object.defineProperty(exports2, "ConnectionTCPFull", { enumerable: true, get: function() {
      return connection_1.ConnectionTCPFull;
    } });
    Object.defineProperty(exports2, "ConnectionTCPAbridged", { enumerable: true, get: function() {
      return connection_1.ConnectionTCPAbridged;
    } });
    Object.defineProperty(exports2, "ConnectionTCPObfuscated", { enumerable: true, get: function() {
      return connection_1.ConnectionTCPObfuscated;
    } });
  }
});

// node_modules/telegram/network/connection/TCPMTProxy.js
var require_TCPMTProxy = __commonJS({
  "node_modules/telegram/network/connection/TCPMTProxy.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectionTCPMTProxyAbridged = exports2.TCPMTProxy = void 0;
    var Connection_1 = require_Connection();
    var TCPAbridged_1 = require_TCPAbridged();
    var Helpers_1 = require_Helpers();
    var CTR_1 = require_CTR();
    var MTProxyIO = class {
      constructor(connection) {
        this.header = void 0;
        this.connection = connection.socket;
        this._packetClass = connection.PacketCodecClass;
        this._secret = connection._secret;
        this._dcId = connection._dcId;
      }
      async initHeader() {
        let secret = this._secret;
        const isDD = secret.length == 17 && secret[0] == 221;
        secret = isDD ? secret.slice(1) : secret;
        if (secret.length != 16) {
          throw new Error("MTProxy secret must be a hex-string representing 16 bytes");
        }
        const keywords = [
          Buffer.from("50567247", "hex"),
          Buffer.from("474554", "hex"),
          Buffer.from("504f5354", "hex"),
          Buffer.from("eeeeeeee", "hex")
        ];
        let random;
        while (true) {
          random = (0, Helpers_1.generateRandomBytes)(64);
          if (random[0] !== 239 && !random.slice(4, 8).equals(Buffer.alloc(4))) {
            let ok = true;
            for (const key of keywords) {
              if (key.equals(random.slice(0, 4))) {
                ok = false;
                break;
              }
            }
            if (ok) {
              break;
            }
          }
        }
        random = random.toJSON().data;
        const randomReversed = Buffer.from(random.slice(8, 56)).reverse();
        const encryptKey = await (0, Helpers_1.sha256)(Buffer.concat([Buffer.from(random.slice(8, 40)), secret]));
        const encryptIv = Buffer.from(random.slice(40, 56));
        const decryptKey = await (0, Helpers_1.sha256)(Buffer.concat([Buffer.from(randomReversed.slice(0, 32)), secret]));
        const decryptIv = Buffer.from(randomReversed.slice(32, 48));
        const encryptor = new CTR_1.CTR(encryptKey, encryptIv);
        const decryptor = new CTR_1.CTR(decryptKey, decryptIv);
        random = Buffer.concat([
          Buffer.from(random.slice(0, 56)),
          this._packetClass.obfuscateTag,
          Buffer.from(random.slice(60))
        ]);
        const dcIdBytes = Buffer.alloc(2);
        dcIdBytes.writeInt8(this._dcId, 0);
        random = Buffer.concat([
          Buffer.from(random.slice(0, 60)),
          dcIdBytes,
          Buffer.from(random.slice(62))
        ]);
        random = Buffer.concat([
          Buffer.from(random.slice(0, 56)),
          Buffer.from(encryptor.encrypt(random).slice(56, 64)),
          Buffer.from(random.slice(64))
        ]);
        this.header = random;
        this._encrypt = encryptor;
        this._decrypt = decryptor;
      }
      async read(n) {
        const data = await this.connection.readExactly(n);
        return this._decrypt.encrypt(data);
      }
      write(data) {
        this.connection.write(this._encrypt.encrypt(data));
      }
    };
    var TCPMTProxy = class extends Connection_1.ObfuscatedConnection {
      constructor({ ip, port, dcId, loggers, proxy, socket, testServers }) {
        super({
          ip: proxy.ip,
          port: proxy.port,
          dcId,
          loggers,
          socket,
          proxy,
          testServers
        });
        this.ObfuscatedIO = MTProxyIO;
        if (!("MTProxy" in proxy)) {
          throw new Error("This connection only supports MPTProxies");
        }
        if (!proxy.secret) {
          throw new Error("You need to provide the secret for the MTProxy");
        }
        if (proxy.secret && proxy.secret.match(/^[0-9a-f]+$/i)) {
          this._secret = Buffer.from(proxy.secret, "hex");
        } else {
          this._secret = Buffer.from(proxy.secret, "base64");
        }
      }
    };
    exports2.TCPMTProxy = TCPMTProxy;
    var ConnectionTCPMTProxyAbridged = class extends TCPMTProxy {
      constructor() {
        super(...arguments);
        this.PacketCodecClass = TCPAbridged_1.AbridgedPacketCodec;
      }
    };
    exports2.ConnectionTCPMTProxyAbridged = ConnectionTCPMTProxyAbridged;
  }
});

// node_modules/telegram/client/telegramBaseClient.js
var require_telegramBaseClient = __commonJS({
  "node_modules/telegram/client/telegramBaseClient.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.TelegramBaseClient = void 0;
    var __1 = require_telegram();
    var Helpers_1 = require_Helpers();
    var connection_1 = require_connection();
    var sessions_1 = require_sessions();
    var extensions_1 = require_extensions();
    var tl_1 = require_tl();
    var os_1 = __importDefault2(require_os());
    var entityCache_1 = require_entityCache();
    var markdown_1 = require_markdown();
    var network_1 = require_network();
    var AllTLObjects_1 = require_AllTLObjects();
    var TCPMTProxy_1 = require_TCPMTProxy();
    var async_mutex_1 = require_lib7();
    var Logger_1 = require_Logger();
    var platform_1 = require_platform();
    var Deferred_1 = __importDefault2(require_Deferred());
    var EXPORTED_SENDER_RECONNECT_TIMEOUT = 1e3;
    var EXPORTED_SENDER_RELEASE_TIMEOUT = 3e4;
    var DEFAULT_DC_ID = 4;
    var DEFAULT_IPV4_IP = platform_1.isNode ? "149.154.167.91" : "vesta.web.telegram.org";
    var DEFAULT_IPV6_IP = "2001:067c:04e8:f004:0000:0000:0000:000a";
    var clientParamsDefault = {
      connection: platform_1.isNode ? connection_1.ConnectionTCPFull : connection_1.ConnectionTCPObfuscated,
      networkSocket: platform_1.isNode ? extensions_1.PromisedNetSockets : extensions_1.PromisedWebSockets,
      useIPV6: false,
      timeout: 10,
      requestRetries: 5,
      connectionRetries: Infinity,
      retryDelay: 1e3,
      downloadRetries: 5,
      autoReconnect: true,
      sequentialUpdates: false,
      floodSleepThreshold: 60,
      deviceModel: "",
      systemVersion: "",
      appVersion: "",
      langCode: "en",
      systemLangCode: "en",
      _securityChecks: true,
      useWSS: platform_1.isBrowser ? window.location.protocol == "https:" : false,
      testServers: false
    };
    var TelegramBaseClient = class {
      constructor(session, apiId, apiHash, clientParams) {
        this.__version__ = __1.version;
        this._ALBUMS = /* @__PURE__ */ new Map();
        this._exportedSenderPromises = /* @__PURE__ */ new Map();
        this._exportedSenderReleaseTimeouts = /* @__PURE__ */ new Map();
        clientParams = Object.assign(Object.assign({}, clientParamsDefault), clientParams);
        if (!apiId || !apiHash) {
          throw new Error("Your API ID or Hash cannot be empty or undefined");
        }
        if (clientParams.baseLogger) {
          this._log = clientParams.baseLogger;
        } else {
          this._log = new extensions_1.Logger();
        }
        this._log.info("Running gramJS version " + __1.version);
        if (session && typeof session == "string") {
          session = new sessions_1.StoreSession(session);
        }
        if (!(session instanceof sessions_1.Session)) {
          throw new Error("Only StringSession and StoreSessions are supported currently :( ");
        }
        this._floodSleepThreshold = clientParams.floodSleepThreshold;
        this.session = session;
        this.apiId = apiId;
        this.apiHash = apiHash;
        this._useIPV6 = clientParams.useIPV6;
        this._requestRetries = clientParams.requestRetries;
        this._downloadRetries = clientParams.downloadRetries;
        this._connectionRetries = clientParams.connectionRetries;
        this._retryDelay = clientParams.retryDelay || 0;
        this._timeout = clientParams.timeout;
        this._autoReconnect = clientParams.autoReconnect;
        this._proxy = clientParams.proxy;
        this._semaphore = new async_mutex_1.Semaphore(clientParams.maxConcurrentDownloads || 1);
        this.testServers = clientParams.testServers || false;
        this.networkSocket = clientParams.networkSocket || extensions_1.PromisedNetSockets;
        if (!(clientParams.connection instanceof Function)) {
          throw new Error("Connection should be a class not an instance");
        }
        this._connection = clientParams.connection;
        let initProxy;
        if (this._proxy && "MTProxy" in this._proxy) {
          this._connection = TCPMTProxy_1.ConnectionTCPMTProxyAbridged;
          initProxy = new tl_1.Api.InputClientProxy({
            address: this._proxy.ip,
            port: this._proxy.port
          });
        }
        this._initRequest = new tl_1.Api.InitConnection({
          apiId: this.apiId,
          deviceModel: clientParams.deviceModel || os_1.default.type().toString() || "Unknown",
          systemVersion: clientParams.systemVersion || os_1.default.release().toString() || "1.0",
          appVersion: clientParams.appVersion || "1.0",
          langCode: clientParams.langCode,
          langPack: "",
          systemLangCode: clientParams.systemLangCode,
          proxy: initProxy
        });
        this._eventBuilders = [];
        this._floodWaitedRequests = {};
        this._borrowedSenderPromises = {};
        this._bot = void 0;
        this._selfInputPeer = void 0;
        this.useWSS = clientParams.useWSS;
        this._securityChecks = !!clientParams.securityChecks;
        if (this.useWSS && this._proxy) {
          throw new Error("Cannot use SSL with proxies. You need to disable the useWSS client param in TelegramClient");
        }
        this._entityCache = new entityCache_1.EntityCache();
        this._config = void 0;
        this._loopStarted = false;
        this._reconnecting = false;
        this._destroyed = false;
        this._isSwitchingDc = false;
        this._connectedDeferred = new Deferred_1.default();
        this._parseMode = markdown_1.MarkdownParser;
      }
      get floodSleepThreshold() {
        return this._floodSleepThreshold;
      }
      set floodSleepThreshold(value) {
        this._floodSleepThreshold = Math.min(value || 0, 24 * 60 * 60);
      }
      set maxConcurrentDownloads(value) {
        this._semaphore._value = value;
      }
      // region connecting
      async _initSession() {
        await this.session.load();
        if (!this.session.serverAddress) {
          this.session.setDC(DEFAULT_DC_ID, this._useIPV6 ? DEFAULT_IPV6_IP : DEFAULT_IPV4_IP, this.useWSS ? 443 : 80);
        } else {
          this._useIPV6 = this.session.serverAddress.includes(":");
        }
      }
      get connected() {
        return this._sender && this._sender.isConnected();
      }
      async disconnect() {
        await this._disconnect();
        await Promise.all(Object.values(this._exportedSenderPromises).map((promises) => {
          return Object.values(promises).map((promise) => {
            return promise && promise.then((sender) => {
              if (sender) {
                return sender.disconnect();
              }
              return void 0;
            });
          });
        }).flat());
        Object.values(this._exportedSenderReleaseTimeouts).forEach((timeouts) => {
          Object.values(timeouts).forEach((releaseTimeout) => {
            clearTimeout(releaseTimeout);
          });
        });
        this._exportedSenderPromises.clear();
      }
      get disconnected() {
        return !this._sender || this._sender._disconnected;
      }
      async _disconnect() {
        var _a;
        await ((_a = this._sender) === null || _a === void 0 ? void 0 : _a.disconnect());
      }
      /**
       * Disconnects all senders and removes all handlers
       * Disconnect is safer as it will not remove your event handlers
       */
      async destroy() {
        this._destroyed = true;
        await Promise.all([
          this.disconnect(),
          ...Object.values(this._borrowedSenderPromises).map((promise) => {
            return promise.then((sender) => sender.disconnect());
          })
        ]);
        this._eventBuilders = [];
      }
      /** @hidden */
      async _authKeyCallback(authKey, dcId) {
        this.session.setAuthKey(authKey, dcId);
        await this.session.save();
      }
      /** @hidden */
      async _cleanupExportedSender(dcId) {
        if (this.session.dcId !== dcId) {
          this.session.setAuthKey(void 0, dcId);
        }
        let sender = await this._exportedSenderPromises.get(dcId);
        this._exportedSenderPromises.delete(dcId);
        await (sender === null || sender === void 0 ? void 0 : sender.disconnect());
      }
      /** @hidden */
      async _connectSender(sender, dcId) {
        const dc = await this.getDC(dcId, !!sender.authKey.getKey());
        while (true) {
          try {
            await sender.connect(new this._connection({
              ip: dc.ipAddress,
              port: dc.port,
              dcId,
              loggers: this._log,
              proxy: this._proxy,
              testServers: this.testServers,
              socket: this.networkSocket
            }), false);
            if (this.session.dcId !== dcId && !sender._authenticated) {
              this._log.info(`Exporting authorization for data center ${dc.ipAddress} with layer ${AllTLObjects_1.LAYER}`);
              const auth = await this.invoke(new tl_1.Api.auth.ExportAuthorization({ dcId }));
              this._initRequest.query = new tl_1.Api.auth.ImportAuthorization({
                id: auth.id,
                bytes: auth.bytes
              });
              const req = new tl_1.Api.InvokeWithLayer({
                layer: AllTLObjects_1.LAYER,
                query: this._initRequest
              });
              await sender.send(req);
              sender._authenticated = true;
            }
            sender.dcId = dcId;
            sender.userDisconnected = false;
            return sender;
          } catch (err) {
            if (err.errorMessage === "DC_ID_INVALID") {
              sender._authenticated = true;
              sender.userDisconnected = false;
              return sender;
            }
            if (this._errorHandler) {
              await this._errorHandler(err);
            } else if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
              console.error(err);
            }
            await (0, Helpers_1.sleep)(1e3);
            await sender.disconnect();
          }
        }
      }
      /** @hidden */
      async _borrowExportedSender(dcId, shouldReconnect, existingSender) {
        if (!this._exportedSenderPromises.get(dcId) || shouldReconnect) {
          this._exportedSenderPromises.set(dcId, this._connectSender(existingSender || this._createExportedSender(dcId), dcId));
        }
        let sender;
        try {
          sender = await this._exportedSenderPromises.get(dcId);
          if (!sender.isConnected()) {
            if (sender.isConnecting) {
              await (0, Helpers_1.sleep)(EXPORTED_SENDER_RECONNECT_TIMEOUT);
              return this._borrowExportedSender(dcId, false, sender);
            } else {
              return this._borrowExportedSender(dcId, true, sender);
            }
          }
        } catch (err) {
          if (this._errorHandler) {
            await this._errorHandler(err);
          }
          if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(err);
          }
          return this._borrowExportedSender(dcId, true);
        }
        if (this._exportedSenderReleaseTimeouts.get(dcId)) {
          clearTimeout(this._exportedSenderReleaseTimeouts.get(dcId));
          this._exportedSenderReleaseTimeouts.delete(dcId);
        }
        this._exportedSenderReleaseTimeouts.set(dcId, setTimeout(() => {
          this._exportedSenderReleaseTimeouts.delete(dcId);
          if (sender._pendingState.values().length) {
            console.log("sender already has some hanging states. reconnecting");
            sender._reconnect();
            this._borrowExportedSender(dcId, false, sender);
          } else {
            sender.disconnect();
          }
        }, EXPORTED_SENDER_RELEASE_TIMEOUT));
        return sender;
      }
      /** @hidden */
      _createExportedSender(dcId) {
        return new network_1.MTProtoSender(this.session.getAuthKey(dcId), {
          logger: this._log,
          dcId,
          retries: this._connectionRetries,
          delay: this._retryDelay,
          autoReconnect: this._autoReconnect,
          connectTimeout: this._timeout,
          authKeyCallback: this._authKeyCallback.bind(this),
          isMainSender: dcId === this.session.dcId,
          onConnectionBreak: this._cleanupExportedSender.bind(this),
          client: this,
          securityChecks: this._securityChecks,
          _exportedSenderPromises: this._exportedSenderPromises
        });
      }
      /** @hidden */
      getSender(dcId) {
        return dcId ? this._borrowExportedSender(dcId) : Promise.resolve(this._sender);
      }
      // endregion
      async getDC(dcId, download) {
        throw new Error("Cannot be called from here!");
      }
      invoke(request) {
        throw new Error("Cannot be called from here!");
      }
      setLogLevel(level) {
        this._log.setLevel(level);
      }
      get logger() {
        return this._log;
      }
      /**
       * Custom error handler for the client
       * @example
       * ```ts
       * client.onError = async (error)=>{
       *         console.log("error is",error)
       *     }
       * ```
       */
      set onError(handler) {
        this._errorHandler = async (error) => {
          try {
            await handler(error);
          } catch (e) {
            if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
              e.message = `Error ${e.message} thrown while handling top-level error: ${error.message}`;
              console.error(e);
            }
          }
        };
      }
    };
    exports2.TelegramBaseClient = TelegramBaseClient;
  }
});

// node_modules/telegram/client/auth.js
var require_auth = __commonJS({
  "node_modules/telegram/client/auth.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2._authFlow = exports2.signInBot = exports2.signInWithPassword = exports2.sendCode = exports2.signInUserWithQrCode = exports2.signInUser = exports2.checkAuthorization = exports2.start = void 0;
    var tl_1 = require_tl();
    var utils = __importStar2(require_Utils());
    var Helpers_1 = require_Helpers();
    var Password_1 = require_Password();
    var QR_CODE_TIMEOUT = 3e4;
    async function start2(client2, authParams) {
      if (!client2.connected) {
        await client2.connect();
      }
      if (await client2.checkAuthorization()) {
        return;
      }
      const apiCredentials = {
        apiId: client2.apiId,
        apiHash: client2.apiHash
      };
      await _authFlow(client2, apiCredentials, authParams);
    }
    exports2.start = start2;
    async function checkAuthorization(client2) {
      try {
        await client2.invoke(new tl_1.Api.updates.GetState());
        return true;
      } catch (e) {
        return false;
      }
    }
    exports2.checkAuthorization = checkAuthorization;
    async function signInUser(client2, apiCredentials, authParams) {
      let phoneNumber;
      let phoneCodeHash;
      let isCodeViaApp = false;
      while (1) {
        try {
          if (typeof authParams.phoneNumber === "function") {
            try {
              phoneNumber = await authParams.phoneNumber();
            } catch (err) {
              if (err.errorMessage === "RESTART_AUTH_WITH_QR") {
                return client2.signInUserWithQrCode(apiCredentials, authParams);
              }
              throw err;
            }
          } else {
            phoneNumber = authParams.phoneNumber;
          }
          const sendCodeResult = await client2.sendCode(apiCredentials, phoneNumber, authParams.forceSMS);
          phoneCodeHash = sendCodeResult.phoneCodeHash;
          isCodeViaApp = sendCodeResult.isCodeViaApp;
          if (typeof phoneCodeHash !== "string") {
            throw new Error("Failed to retrieve phone code hash");
          }
          break;
        } catch (err) {
          if (typeof authParams.phoneNumber !== "function") {
            throw err;
          }
          const shouldWeStop = await authParams.onError(err);
          if (shouldWeStop) {
            throw new Error("AUTH_USER_CANCEL");
          }
        }
      }
      let phoneCode;
      let isRegistrationRequired = false;
      let termsOfService;
      while (1) {
        try {
          try {
            phoneCode = await authParams.phoneCode(isCodeViaApp);
          } catch (err) {
            if (err.errorMessage === "RESTART_AUTH") {
              return client2.signInUser(apiCredentials, authParams);
            }
          }
          if (!phoneCode) {
            throw new Error("Code is empty");
          }
          const result = await client2.invoke(new tl_1.Api.auth.SignIn({
            phoneNumber,
            phoneCodeHash,
            phoneCode
          }));
          if (result instanceof tl_1.Api.auth.AuthorizationSignUpRequired) {
            isRegistrationRequired = true;
            termsOfService = result.termsOfService;
            break;
          }
          return result.user;
        } catch (err) {
          if (err.errorMessage === "SESSION_PASSWORD_NEEDED") {
            return client2.signInWithPassword(apiCredentials, authParams);
          } else {
            const shouldWeStop = await authParams.onError(err);
            if (shouldWeStop) {
              throw new Error("AUTH_USER_CANCEL");
            }
          }
        }
      }
      if (isRegistrationRequired) {
        while (1) {
          try {
            let lastName;
            let firstName = "first name";
            if (authParams.firstAndLastNames) {
              const result = await authParams.firstAndLastNames();
              firstName = result[0];
              lastName = result[1];
            }
            if (!firstName) {
              throw new Error("First name is required");
            }
            const { user } = await client2.invoke(new tl_1.Api.auth.SignUp({
              phoneNumber,
              phoneCodeHash,
              firstName,
              lastName
            }));
            if (termsOfService) {
              await client2.invoke(new tl_1.Api.help.AcceptTermsOfService({
                id: termsOfService.id
              }));
            }
            return user;
          } catch (err) {
            const shouldWeStop = await authParams.onError(err);
            if (shouldWeStop) {
              throw new Error("AUTH_USER_CANCEL");
            }
          }
        }
      }
      await authParams.onError(new Error("Auth failed"));
      return client2.signInUser(apiCredentials, authParams);
    }
    exports2.signInUser = signInUser;
    async function signInUserWithQrCode(client2, apiCredentials, authParams) {
      let isScanningComplete = false;
      if (authParams.qrCode == void 0) {
        throw new Error("qrCode callback not defined");
      }
      const inputPromise = (async () => {
        while (1) {
          if (isScanningComplete) {
            break;
          }
          const result = await client2.invoke(new tl_1.Api.auth.ExportLoginToken({
            apiId: Number(apiCredentials.apiId),
            apiHash: apiCredentials.apiHash,
            exceptIds: []
          }));
          if (!(result instanceof tl_1.Api.auth.LoginToken)) {
            throw new Error("Unexpected");
          }
          const { token, expires } = result;
          await Promise.race([
            authParams.qrCode({ token, expires }),
            (0, Helpers_1.sleep)(QR_CODE_TIMEOUT)
          ]);
          await (0, Helpers_1.sleep)(QR_CODE_TIMEOUT);
        }
      })();
      const updatePromise = new Promise((resolve) => {
        client2.addEventHandler((update) => {
          if (update instanceof tl_1.Api.UpdateLoginToken) {
            resolve(void 0);
          }
        });
      });
      try {
        await Promise.race([updatePromise, inputPromise]);
      } catch (err) {
        throw err;
      } finally {
        isScanningComplete = true;
      }
      try {
        const result2 = await client2.invoke(new tl_1.Api.auth.ExportLoginToken({
          apiId: Number(apiCredentials.apiId),
          apiHash: apiCredentials.apiHash,
          exceptIds: []
        }));
        if (result2 instanceof tl_1.Api.auth.LoginTokenSuccess && result2.authorization instanceof tl_1.Api.auth.Authorization) {
          return result2.authorization.user;
        } else if (result2 instanceof tl_1.Api.auth.LoginTokenMigrateTo) {
          await client2._switchDC(result2.dcId);
          const migratedResult = await client2.invoke(new tl_1.Api.auth.ImportLoginToken({
            token: result2.token
          }));
          if (migratedResult instanceof tl_1.Api.auth.LoginTokenSuccess && migratedResult.authorization instanceof tl_1.Api.auth.Authorization) {
            return migratedResult.authorization.user;
          } else {
            client2._log.error(`Received unknown result while scanning QR ${result2.className}`);
            throw new Error(`Received unknown result while scanning QR ${result2.className}`);
          }
        } else {
          client2._log.error(`Received unknown result while scanning QR ${result2.className}`);
          throw new Error(`Received unknown result while scanning QR ${result2.className}`);
        }
      } catch (err) {
        if (err.errorMessage === "SESSION_PASSWORD_NEEDED") {
          return client2.signInWithPassword(apiCredentials, authParams);
        }
        throw err;
      }
      await authParams.onError(new Error("QR auth failed"));
      throw new Error("QR auth failed");
    }
    exports2.signInUserWithQrCode = signInUserWithQrCode;
    async function sendCode(client2, apiCredentials, phoneNumber, forceSMS = false) {
      try {
        const { apiId, apiHash } = apiCredentials;
        const sendResult = await client2.invoke(new tl_1.Api.auth.SendCode({
          phoneNumber,
          apiId,
          apiHash,
          settings: new tl_1.Api.CodeSettings({})
        }));
        if (sendResult instanceof tl_1.Api.auth.SentCodeSuccess)
          throw new Error("logged in right after sending the code");
        if (!forceSMS || sendResult.type instanceof tl_1.Api.auth.SentCodeTypeSms) {
          return {
            phoneCodeHash: sendResult.phoneCodeHash,
            isCodeViaApp: sendResult.type instanceof tl_1.Api.auth.SentCodeTypeApp
          };
        }
        const resendResult = await client2.invoke(new tl_1.Api.auth.ResendCode({
          phoneNumber,
          phoneCodeHash: sendResult.phoneCodeHash
        }));
        if (resendResult instanceof tl_1.Api.auth.SentCodeSuccess)
          throw new Error("logged in right after resending the code");
        return {
          phoneCodeHash: resendResult.phoneCodeHash,
          isCodeViaApp: resendResult.type instanceof tl_1.Api.auth.SentCodeTypeApp
        };
      } catch (err) {
        if (err.errorMessage === "AUTH_RESTART") {
          return client2.sendCode(apiCredentials, phoneNumber, forceSMS);
        } else {
          throw err;
        }
      }
    }
    exports2.sendCode = sendCode;
    async function signInWithPassword(client2, apiCredentials, authParams) {
      let emptyPassword = false;
      while (1) {
        try {
          const passwordSrpResult = await client2.invoke(new tl_1.Api.account.GetPassword());
          if (!authParams.password) {
            emptyPassword = true;
            break;
          }
          const password = await authParams.password(passwordSrpResult.hint);
          if (!password) {
            throw new Error("Password is empty");
          }
          const passwordSrpCheck = await (0, Password_1.computeCheck)(passwordSrpResult, password);
          const { user } = await client2.invoke(new tl_1.Api.auth.CheckPassword({
            password: passwordSrpCheck
          }));
          return user;
        } catch (err) {
          const shouldWeStop = await authParams.onError(err);
          if (shouldWeStop) {
            throw new Error("AUTH_USER_CANCEL");
          }
        }
      }
      if (emptyPassword) {
        throw new Error("Account has 2FA enabled.");
      }
      return void 0;
    }
    exports2.signInWithPassword = signInWithPassword;
    async function signInBot(client2, apiCredentials, authParams) {
      const { apiId, apiHash } = apiCredentials;
      let { botAuthToken } = authParams;
      if (!botAuthToken) {
        throw new Error("a valid BotToken is required");
      }
      if (typeof botAuthToken === "function") {
        let token;
        while (true) {
          token = await botAuthToken();
          if (token) {
            botAuthToken = token;
            break;
          }
        }
      }
      const { user } = await client2.invoke(new tl_1.Api.auth.ImportBotAuthorization({
        apiId,
        apiHash,
        botAuthToken
      }));
      return user;
    }
    exports2.signInBot = signInBot;
    async function _authFlow(client2, apiCredentials, authParams) {
      const me = "phoneNumber" in authParams ? await client2.signInUser(apiCredentials, authParams) : await client2.signInBot(apiCredentials, authParams);
      client2._log.info("Signed in successfully as " + utils.getDisplayName(me));
    }
    exports2._authFlow = _authFlow;
  }
});

// node_modules/telegram/tl/custom/inlineResult.js
var require_inlineResult = __commonJS({
  "node_modules/telegram/tl/custom/inlineResult.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.InlineResult = void 0;
    var api_1 = require_api();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var Utils_1 = require_Utils();
    var InlineResult = class {
      constructor(client2, original, queryId, entity) {
        this._ARTICLE = "article";
        this._PHOTO = "photo";
        this._GIF = "gif";
        this._VIDEO = "video";
        this._VIDEO_GIF = "mpeg4_gif";
        this._AUDIO = "audio";
        this._DOCUMENT = "document";
        this._LOCATION = "location";
        this._VENUE = "venue";
        this._CONTACT = "contact";
        this._GAME = "game";
        this._client = client2;
        this.result = original;
        this._queryId = queryId;
        this._entity = entity;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      get type() {
        return this.result.type;
      }
      get message() {
        return this.result.sendMessage;
      }
      get description() {
        return this.result.description;
      }
      get url() {
        if (this.result instanceof api_1.Api.BotInlineResult) {
          return this.result.url;
        }
      }
      get photo() {
        if (this.result instanceof api_1.Api.BotInlineResult) {
          return this.result.thumb;
        } else {
          return this.result.photo;
        }
      }
      get document() {
        if (this.result instanceof api_1.Api.BotInlineResult) {
          return this.result.content;
        } else {
          return this.result.document;
        }
      }
      async click(entity, replyTo, silent = false, clearDraft = false, hideVia = false) {
        if (entity) {
          entity = await this._client.getInputEntity(entity);
        } else if (this._entity) {
          entity = this._entity;
        } else {
          throw new Error("You must provide the entity where the result should be sent to");
        }
        let replyObject = void 0;
        if (replyTo != void 0) {
          replyObject = new api_1.Api.InputReplyToMessage({
            replyToMsgId: (0, Utils_1.getMessageId)(replyTo)
          });
        }
        const request = new api_1.Api.messages.SendInlineBotResult({
          peer: entity,
          queryId: this._queryId,
          id: this.result.id,
          silent,
          clearDraft,
          hideVia,
          replyTo: replyObject
        });
        return await this._client.invoke(request);
      }
    };
    exports2.InlineResult = InlineResult;
  }
});

// node_modules/telegram/tl/custom/inlineResults.js
var require_inlineResults = __commonJS({
  "node_modules/telegram/tl/custom/inlineResults.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.InlineResults = void 0;
    var inlineResult_1 = require_inlineResult();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var InlineResults = class extends Array {
      constructor(client2, original, entity) {
        super(...original.results.map((res) => new inlineResult_1.InlineResult(client2, res, original.queryId, entity)));
        this.result = original;
        this.queryId = original.queryId;
        this.cacheTime = original.cacheTime;
        this._validUntil = new Date().getTime() / 1e3 + this.cacheTime;
        this.users = original.users;
        this.gallery = Boolean(original.gallery);
        this.nextOffset = original.nextOffset;
        this.switchPm = original.switchPm;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      resultsValid() {
        return new Date().getTime() / 1e3 < this._validUntil;
      }
    };
    exports2.InlineResults = InlineResults;
  }
});

// node_modules/telegram/client/bots.js
var require_bots = __commonJS({
  "node_modules/telegram/client/bots.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.inlineQuery = void 0;
    var tl_1 = require_tl();
    var inlineResults_1 = require_inlineResults();
    var GetInlineBotResults = tl_1.Api.messages.GetInlineBotResults;
    async function inlineQuery(client2, bot, query, entity, offset2, geoPoint) {
      bot = await client2.getInputEntity(bot);
      let peer = new tl_1.Api.InputPeerSelf();
      if (entity) {
        peer = await client2.getInputEntity(entity);
      }
      const result = await client2.invoke(new GetInlineBotResults({
        bot,
        peer,
        query,
        offset: offset2 || "",
        geoPoint
      }));
      return new inlineResults_1.InlineResults(client2, result, entity ? peer : void 0);
    }
    exports2.inlineQuery = inlineQuery;
  }
});

// node_modules/telegram/client/buttons.js
var require_buttons = __commonJS({
  "node_modules/telegram/client/buttons.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.buildReplyMarkup = void 0;
    var tl_1 = require_tl();
    var button_1 = require_button();
    var messageButton_1 = require_messageButton();
    var Helpers_1 = require_Helpers();
    function buildReplyMarkup(buttons, inlineOnly = false) {
      if (buttons == void 0) {
        return void 0;
      }
      if ("SUBCLASS_OF_ID" in buttons) {
        if (buttons.SUBCLASS_OF_ID == 3806400242) {
          return buttons;
        }
      }
      if (!(0, Helpers_1.isArrayLike)(buttons)) {
        buttons = [[buttons]];
      } else if (!buttons || !(0, Helpers_1.isArrayLike)(buttons[0])) {
        buttons = [buttons];
      }
      let isInline = false;
      let isNormal = false;
      let resize = void 0;
      const singleUse = false;
      const selective = false;
      const rows = [];
      for (const row of buttons) {
        const current = [];
        for (let button of row) {
          if (button instanceof button_1.Button) {
            if (button.resize != void 0) {
              resize = button.resize;
            }
            if (button.singleUse != void 0) {
              resize = button.singleUse;
            }
            if (button.selective != void 0) {
              resize = button.selective;
            }
            button = button.button;
          } else if (button instanceof messageButton_1.MessageButton) {
            button = button.button;
          }
          const inline = button_1.Button._isInline(button);
          if (!isInline && inline) {
            isInline = true;
          }
          if (!isNormal && inline) {
            isNormal = false;
          }
          if (button.SUBCLASS_OF_ID == 195916963) {
            current.push(button);
          }
        }
        if (current) {
          rows.push(new tl_1.Api.KeyboardButtonRow({
            buttons: current
          }));
        }
      }
      if (inlineOnly && isNormal) {
        throw new Error("You cannot use non-inline buttons here");
      } else if (isInline === isNormal && isNormal) {
        throw new Error("You cannot mix inline with normal buttons");
      } else if (isInline) {
        return new tl_1.Api.ReplyInlineMarkup({
          rows
        });
      }
      return new tl_1.Api.ReplyKeyboardMarkup({
        rows,
        resize,
        singleUse,
        selective
      });
    }
    exports2.buildReplyMarkup = buildReplyMarkup;
  }
});

// node_modules/telegram/requestIter.js
var require_requestIter = __commonJS({
  "node_modules/telegram/requestIter.js"(exports2) {
    "use strict";
    var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) {
      if (!Symbol.asyncIterator)
        throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
        return this;
      }, i);
      function verb(n) {
        i[n] = o[n] && function(v) {
          return new Promise(function(resolve, reject) {
            v = o[n](v), settle(resolve, reject, v.done, v.value);
          });
        };
      }
      function settle(resolve, reject, d, v) {
        Promise.resolve(v).then(function(v2) {
          resolve({ value: v2, done: d });
        }, reject);
      }
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RequestIter = void 0;
    var Helpers_1 = require_Helpers();
    var _1 = require_telegram();
    var RequestIter = class {
      constructor(client2, limit, params = {}, args = {}) {
        this.client = client2;
        this.reverse = params.reverse;
        this.waitTime = params.waitTime;
        this.limit = Math.max(!limit ? Number.MAX_SAFE_INTEGER : limit, 0);
        this.left = this.limit;
        this.buffer = void 0;
        this.kwargs = args;
        this.index = 0;
        this.total = void 0;
        this.lastLoad = 0;
      }
      async _init(kwargs) {
      }
      [Symbol.asyncIterator]() {
        this.buffer = void 0;
        this.index = 0;
        this.lastLoad = 0;
        this.left = this.limit;
        return {
          next: async () => {
            if (this.buffer == void 0) {
              this.buffer = [];
              if (await this._init(this.kwargs)) {
                this.left = this.buffer.length;
              }
            }
            if (this.left <= 0) {
              return {
                value: void 0,
                done: true
              };
            }
            if (this.index == this.buffer.length) {
              if (this.waitTime) {
                await (0, Helpers_1.sleep)(this.waitTime - (new Date().getTime() / 1e3 - this.lastLoad));
              }
              this.lastLoad = new Date().getTime() / 1e3;
              this.index = 0;
              this.buffer = [];
              const nextChunk = await this._loadNextChunk();
              if (nextChunk === false) {
                return {
                  value: void 0,
                  done: true
                };
              }
              if (nextChunk) {
                this.left = this.buffer.length;
              }
            }
            if (!this.buffer || !this.buffer.length) {
              return {
                value: void 0,
                done: true
              };
            }
            const result = this.buffer[this.index];
            this.left -= 1;
            this.index += 1;
            return {
              value: result,
              done: false
            };
          }
        };
      }
      async collect() {
        var e_1, _a;
        const result = new _1.helpers.TotalList();
        try {
          for (var _b = __asyncValues2(this), _c; _c = await _b.next(), !_c.done; ) {
            const message = _c.value;
            result.push(message);
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a = _b.return))
              await _a.call(_b);
          } finally {
            if (e_1)
              throw e_1.error;
          }
        }
        result.total = this.total;
        return result;
      }
      async _loadNextChunk() {
        throw new Error("Not Implemented");
      }
    };
    exports2.RequestIter = RequestIter;
  }
});

// node_modules/telegram/client/fs.js
var require_fs = __commonJS({
  "node_modules/telegram/client/fs.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m)
        if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
          __createBinding2(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    __exportStar2(require("fs"), exports2);
  }
});

// node_modules/telegram/client/path.js
var require_path = __commonJS({
  "node_modules/telegram/client/path.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    var path_1 = __importDefault2(require("path"));
    exports2.default = path_1.default;
  }
});

// node_modules/telegram/client/downloads.js
var require_downloads = __commonJS({
  "node_modules/telegram/client/downloads.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) {
      if (!Symbol.asyncIterator)
        throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
        return this;
      }, i);
      function verb(n) {
        i[n] = o[n] && function(v) {
          return new Promise(function(resolve, reject) {
            v = o[n](v), settle(resolve, reject, v.done, v.value);
          });
        };
      }
      function settle(resolve, reject, d, v) {
        Promise.resolve(v).then(function(v2) {
          resolve({ value: v2, done: d });
        }, reject);
      }
    };
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.downloadProfilePhoto = exports2._downloadPhoto = exports2._downloadCachedPhotoSize = exports2._downloadWebDocument = exports2._downloadContact = exports2._downloadDocument = exports2.downloadMedia = exports2.downloadFileV2 = exports2.iterDownload = exports2.GenericDownloadIter = exports2.DirectDownloadIter = void 0;
    var tl_1 = require_tl();
    var Utils_1 = require_Utils();
    var Helpers_1 = require_Helpers();
    var __1 = require_telegram();
    var requestIter_1 = require_requestIter();
    var errors_1 = require_errors();
    var fs_1 = require_fs();
    var extensions_1 = require_extensions();
    var fs = __importStar2(require_fs());
    var path_1 = __importDefault2(require_path());
    var big_integer_1 = __importDefault2(require_BigInteger());
    var MIN_CHUNK_SIZE = 4096;
    var ONE_MB = 1024 * 1024;
    var TIMED_OUT_SLEEP = 1e3;
    var MAX_CHUNK_SIZE = 512 * 1024;
    var DirectDownloadIter = class extends requestIter_1.RequestIter {
      constructor() {
        super(...arguments);
        this._timedOut = false;
      }
      async _init({ fileLocation, dcId, offset: offset2, stride, chunkSize, requestSize, fileSize, msgData }) {
        this.request = new tl_1.Api.upload.GetFile({
          location: fileLocation,
          offset: offset2,
          limit: requestSize
        });
        this.total = fileSize;
        this._stride = stride;
        this._chunkSize = chunkSize;
        this._lastPart = void 0;
        this._timedOut = false;
        this._sender = await this.client.getSender(dcId);
      }
      async _loadNextChunk() {
        const current = await this._request();
        this.buffer.push(current);
        if (current.length < this.request.limit) {
          this.left = this.buffer.length;
          await this.close();
          return true;
        } else {
          this.request.offset = this.request.offset.add(this._stride);
        }
      }
      async _request() {
        try {
          this._sender = await this.client.getSender(this._sender.dcId);
          const result = await this.client.invokeWithSender(this.request, this._sender);
          this._timedOut = false;
          if (result instanceof tl_1.Api.upload.FileCdnRedirect) {
            throw new Error("CDN Not supported. Please Add an issue in github");
          }
          return result.bytes;
        } catch (e) {
          if (e.errorMessage == "TIMEOUT") {
            if (this._timedOut) {
              this.client._log.warn("Got two timeouts in a row while downloading file");
              throw e;
            }
            this._timedOut = true;
            this.client._log.info("Got timeout while downloading file, retrying once");
            await (0, Helpers_1.sleep)(TIMED_OUT_SLEEP);
            return await this._request();
          } else if (e instanceof errors_1.FileMigrateError) {
            this.client._log.info("File lives in another DC");
            this._sender = await this.client.getSender(e.newDc);
            return await this._request();
          } else if (e.errorMessage == "FILEREF_UPGRADE_NEEDED") {
            throw e;
          } else {
            throw e;
          }
        }
      }
      async close() {
        this.client._log.debug("Finished downloading file ...");
      }
      [Symbol.asyncIterator]() {
        return super[Symbol.asyncIterator]();
      }
    };
    exports2.DirectDownloadIter = DirectDownloadIter;
    var GenericDownloadIter = class extends DirectDownloadIter {
      async _loadNextChunk() {
        let data = Buffer.alloc(0);
        const bad = this.request.offset.mod(this.request.limit).toJSNumber();
        const before = this.request.offset;
        this.request.offset = this.request.offset.subtract(bad);
        let done = false;
        while (!done && data.length - bad < this._chunkSize) {
          const current = await this._request();
          this.request.offset = this.request.offset.add(this.request.limit);
          data = Buffer.concat([data, current]);
          done = current.length < this.request.limit;
        }
        this.request.offset = before;
        for (let i = bad; i < data.length; i += this._stride) {
          this.buffer.push(data.slice(i, i + this._chunkSize));
          this.request.offset = this.request.offset.add(this._stride);
        }
        if (done) {
          this.left = this.buffer.length;
          await this.close();
          return;
        }
        if (this.buffer[this.buffer.length - 1].length != this._chunkSize) {
          this._lastPart = this.buffer.pop();
          this.request.offset = this.request.offset.subtract(this._stride);
        }
      }
    };
    exports2.GenericDownloadIter = GenericDownloadIter;
    function iterDownload(client2, { file, offset: offset2 = big_integer_1.default.zero, stride, limit, chunkSize, requestSize = MAX_CHUNK_SIZE, fileSize, dcId, msgData }) {
      const info = __1.utils.getFileInfo(file);
      if (info.dcId != void 0) {
        dcId = info.dcId;
      }
      if (fileSize == void 0) {
        fileSize = info.size;
      }
      file = info.location;
      if (chunkSize == void 0) {
        chunkSize = requestSize;
      }
      if (limit == void 0 && fileSize != void 0) {
        limit = Math.floor(fileSize.add(chunkSize).subtract(1).divide(chunkSize).toJSNumber());
      }
      if (stride == void 0) {
        stride = chunkSize;
      } else if (stride < chunkSize) {
        throw new Error("Stride must be >= chunkSize");
      }
      requestSize -= requestSize % MIN_CHUNK_SIZE;
      if (requestSize < MIN_CHUNK_SIZE) {
        requestSize = MIN_CHUNK_SIZE;
      } else if (requestSize > MAX_CHUNK_SIZE) {
        requestSize = MAX_CHUNK_SIZE;
      }
      let cls;
      if (chunkSize == requestSize && offset2.divide(MAX_CHUNK_SIZE).eq(big_integer_1.default.zero) && stride % MIN_CHUNK_SIZE == 0 && (limit == void 0 || offset2.divide(limit).eq(big_integer_1.default.zero))) {
        cls = DirectDownloadIter;
        client2._log.info(`Starting direct file download in chunks of ${requestSize} at ${offset2}, stride ${stride}`);
      } else {
        cls = GenericDownloadIter;
        client2._log.info(`Starting indirect file download in chunks of ${requestSize} at ${offset2}, stride ${stride}`);
      }
      return new cls(client2, limit, {}, {
        fileLocation: file,
        dcId,
        offset: offset2,
        stride,
        chunkSize,
        requestSize,
        fileSize,
        msgData
      });
    }
    exports2.iterDownload = iterDownload;
    function getWriter(outputFile) {
      if (!outputFile || Buffer.isBuffer(outputFile)) {
        return new extensions_1.BinaryWriter(Buffer.alloc(0));
      } else if (typeof outputFile == "string") {
        return (0, fs_1.createWriteStream)(outputFile);
      } else {
        return outputFile;
      }
    }
    function closeWriter(writer) {
      if ("close" in writer && writer.close) {
        writer.close();
      }
    }
    function returnWriterValue(writer) {
      if (writer instanceof extensions_1.BinaryWriter) {
        return writer.getValue();
      }
      if (writer instanceof fs.WriteStream) {
        if (typeof writer.path == "string") {
          return path_1.default.resolve(writer.path);
        } else {
          return Buffer.from(writer.path);
        }
      }
    }
    async function downloadFileV2(client2, inputLocation, { outputFile = void 0, partSizeKb = void 0, fileSize = void 0, progressCallback = void 0, dcId = void 0, msgData = void 0 }) {
      var e_1, _a;
      if (!partSizeKb) {
        if (!fileSize) {
          partSizeKb = 64;
        } else {
          partSizeKb = __1.utils.getAppropriatedPartSize(fileSize);
        }
      }
      const partSize = Math.floor(partSizeKb * 1024);
      if (partSize % MIN_CHUNK_SIZE != 0) {
        throw new Error("The part size must be evenly divisible by 4096");
      }
      const writer = getWriter(outputFile);
      let downloaded = big_integer_1.default.zero;
      try {
        try {
          for (var _b = __asyncValues2(iterDownload(client2, {
            file: inputLocation,
            requestSize: partSize,
            dcId,
            msgData
          })), _c; _c = await _b.next(), !_c.done; ) {
            const chunk = _c.value;
            await writer.write(chunk);
            downloaded = downloaded.add(chunk.length);
            if (progressCallback) {
              await progressCallback(downloaded, (0, big_integer_1.default)(fileSize || big_integer_1.default.zero));
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a = _b.return))
              await _a.call(_b);
          } finally {
            if (e_1)
              throw e_1.error;
          }
        }
        return returnWriterValue(writer);
      } finally {
        closeWriter(writer);
      }
    }
    exports2.downloadFileV2 = downloadFileV2;
    async function downloadMedia2(client2, messageOrMedia, outputFile, thumb, progressCallback) {
      let msgData;
      let date;
      let media;
      if (messageOrMedia instanceof tl_1.Api.Message) {
        media = messageOrMedia.media;
        date = messageOrMedia.date;
        msgData = messageOrMedia.inputChat ? [messageOrMedia.inputChat, messageOrMedia.id] : void 0;
      } else {
        media = messageOrMedia;
        date = Date.now();
      }
      if (typeof media == "string") {
        throw new Error("not implemented");
      }
      if (media instanceof tl_1.Api.MessageMediaWebPage) {
        if (media.webpage instanceof tl_1.Api.WebPage) {
          media = media.webpage.document || media.webpage.photo;
        }
      }
      if (media instanceof tl_1.Api.MessageMediaPhoto || media instanceof tl_1.Api.Photo) {
        return _downloadPhoto(client2, media, outputFile, date, thumb, progressCallback);
      } else if (media instanceof tl_1.Api.MessageMediaDocument || media instanceof tl_1.Api.Document) {
        return _downloadDocument(client2, media, outputFile, date, thumb, progressCallback, msgData);
      } else if (media instanceof tl_1.Api.MessageMediaContact) {
        return _downloadContact(client2, media, {});
      } else if (media instanceof tl_1.Api.WebDocument || media instanceof tl_1.Api.WebDocumentNoProxy) {
        return _downloadWebDocument(client2, media, {});
      } else {
        return Buffer.alloc(0);
      }
    }
    exports2.downloadMedia = downloadMedia2;
    async function _downloadDocument(client2, doc, outputFile, date, thumb, progressCallback, msgData) {
      if (doc instanceof tl_1.Api.MessageMediaDocument) {
        if (!doc.document) {
          return Buffer.alloc(0);
        }
        doc = doc.document;
      }
      if (!(doc instanceof tl_1.Api.Document)) {
        return Buffer.alloc(0);
      }
      let size;
      if (thumb == void 0) {
        outputFile = getProperFilename(outputFile, "document", "." + (__1.utils.getExtension(doc) || "bin"), date);
      } else {
        outputFile = getProperFilename(outputFile, "photo", ".jpg", date);
        size = getThumb(doc.thumbs || [], thumb);
        if (size instanceof tl_1.Api.PhotoCachedSize || size instanceof tl_1.Api.PhotoStrippedSize) {
          return _downloadCachedPhotoSize(size, outputFile);
        }
      }
      return await downloadFileV2(client2, new tl_1.Api.InputDocumentFileLocation({
        id: doc.id,
        accessHash: doc.accessHash,
        fileReference: doc.fileReference,
        thumbSize: size && "type" in size ? size.type : ""
      }), {
        outputFile,
        fileSize: size && "size" in size ? (0, big_integer_1.default)(size.size) : doc.size,
        progressCallback,
        msgData
      });
    }
    exports2._downloadDocument = _downloadDocument;
    async function _downloadContact(client2, media, args) {
      throw new Error("not implemented");
    }
    exports2._downloadContact = _downloadContact;
    async function _downloadWebDocument(client2, media, args) {
      throw new Error("not implemented");
    }
    exports2._downloadWebDocument = _downloadWebDocument;
    function getThumb(thumbs, thumb) {
      function sortThumb(thumb2) {
        if (thumb2 instanceof tl_1.Api.PhotoStrippedSize) {
          return thumb2.bytes.length;
        }
        if (thumb2 instanceof tl_1.Api.PhotoCachedSize) {
          return thumb2.bytes.length;
        }
        if (thumb2 instanceof tl_1.Api.PhotoSize) {
          return thumb2.size;
        }
        if (thumb2 instanceof tl_1.Api.PhotoSizeProgressive) {
          return Math.max(...thumb2.sizes);
        }
        if (thumb2 instanceof tl_1.Api.VideoSize) {
          return thumb2.size;
        }
        return 0;
      }
      thumbs = thumbs.sort((a, b) => sortThumb(a) - sortThumb(b));
      const correctThumbs = [];
      for (const t of thumbs) {
        if (!(t instanceof tl_1.Api.PhotoPathSize)) {
          correctThumbs.push(t);
        }
      }
      if (thumb == void 0) {
        return correctThumbs.pop();
      } else if (typeof thumb == "number") {
        return correctThumbs[thumb];
      } else if (typeof thumb == "string") {
        for (const t of correctThumbs) {
          if ("type" in t && t.type == thumb) {
            return t;
          }
        }
      } else if (thumb instanceof tl_1.Api.PhotoSize || thumb instanceof tl_1.Api.PhotoCachedSize || thumb instanceof tl_1.Api.PhotoStrippedSize || thumb instanceof tl_1.Api.VideoSize) {
        return thumb;
      }
    }
    async function _downloadCachedPhotoSize(size, outputFile) {
      let data;
      if (size instanceof tl_1.Api.PhotoStrippedSize) {
        data = (0, Utils_1.strippedPhotoToJpg)(size.bytes);
      } else {
        data = size.bytes;
      }
      const writer = getWriter(outputFile);
      try {
        await writer.write(data);
      } finally {
        closeWriter(writer);
      }
      return returnWriterValue(writer);
    }
    exports2._downloadCachedPhotoSize = _downloadCachedPhotoSize;
    function getProperFilename(file, fileType, extension2, date) {
      if (!file || typeof file != "string") {
        return file;
      }
      if (fs.existsSync(file) && fs.lstatSync(file).isDirectory()) {
        let fullName = fileType + date + extension2;
        return path_1.default.join(file, fullName);
      }
      return file;
    }
    async function _downloadPhoto(client2, photo, file, date, thumb, progressCallback) {
      if (photo instanceof tl_1.Api.MessageMediaPhoto) {
        if (photo.photo instanceof tl_1.Api.PhotoEmpty || !photo.photo) {
          return Buffer.alloc(0);
        }
        photo = photo.photo;
      }
      if (!(photo instanceof tl_1.Api.Photo)) {
        return Buffer.alloc(0);
      }
      const photoSizes = [...photo.sizes || [], ...photo.videoSizes || []];
      const size = getThumb(photoSizes, thumb);
      if (!size || size instanceof tl_1.Api.PhotoSizeEmpty) {
        return Buffer.alloc(0);
      }
      if (!date) {
        date = Date.now();
      }
      file = getProperFilename(file, "photo", ".jpg", date);
      if (size instanceof tl_1.Api.PhotoCachedSize || size instanceof tl_1.Api.PhotoStrippedSize) {
        return _downloadCachedPhotoSize(size, file);
      }
      let fileSize;
      if (size instanceof tl_1.Api.PhotoSizeProgressive) {
        fileSize = Math.max(...size.sizes);
      } else {
        fileSize = "size" in size ? size.size : 512;
      }
      return downloadFileV2(client2, new tl_1.Api.InputPhotoFileLocation({
        id: photo.id,
        accessHash: photo.accessHash,
        fileReference: photo.fileReference,
        thumbSize: "type" in size ? size.type : ""
      }), {
        outputFile: file,
        fileSize: (0, big_integer_1.default)(fileSize),
        progressCallback,
        dcId: photo.dcId
      });
    }
    exports2._downloadPhoto = _downloadPhoto;
    async function downloadProfilePhoto(client2, entity, fileParams) {
      let photo;
      if (typeof entity == "object" && "photo" in entity) {
        photo = entity.photo;
      } else {
        entity = await client2.getEntity(entity);
        if ("photo" in entity) {
          photo = entity.photo;
        } else {
          throw new Error(`Could not get photo from ${entity ? entity.className : void 0}`);
        }
      }
      let dcId;
      let loc;
      if (photo instanceof tl_1.Api.UserProfilePhoto || photo instanceof tl_1.Api.ChatPhoto) {
        dcId = photo.dcId;
        loc = new tl_1.Api.InputPeerPhotoFileLocation({
          peer: __1.utils.getInputPeer(entity),
          photoId: photo.photoId,
          big: fileParams.isBig
        });
      } else {
        return Buffer.alloc(0);
      }
      return client2.downloadFile(loc, {
        outputFile: fileParams.outputFile,
        dcId
      });
    }
    exports2.downloadProfilePhoto = downloadProfilePhoto;
  }
});

// node_modules/telegram/client/uploads.js
var require_uploads = __commonJS({
  "node_modules/telegram/client/uploads.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.sendFile = exports2._sendAlbum = exports2._fileToMedia = exports2.uploadFile = exports2.CustomFile = void 0;
    var tl_1 = require_tl();
    var Helpers_1 = require_Helpers();
    var Utils_1 = require_Utils();
    var path_1 = __importDefault2(require_path());
    var fs_1 = require_fs();
    var index_1 = require_telegram();
    var messageParse_1 = require_messageParse();
    var messages_1 = require_messages2();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var CustomFile = class {
      constructor(name, size, path4, buffer) {
        this.name = name;
        this.size = size;
        this.path = path4;
        this.buffer = buffer;
      }
    };
    exports2.CustomFile = CustomFile;
    var CustomBuffer = class {
      constructor(options) {
        this.options = options;
        if (!options.buffer && !options.filePath) {
          throw new Error("Either one of `buffer` or `filePath` should be specified");
        }
      }
      async slice(begin, end2) {
        const { buffer, filePath } = this.options;
        if (buffer) {
          return buffer.slice(begin, end2);
        } else if (filePath) {
          const buffSize = end2 - begin;
          const buff = Buffer.alloc(buffSize);
          const fHandle = await fs_1.promises.open(filePath, "r");
          await fHandle.read(buff, 0, buffSize, begin);
          await fHandle.close();
          return Buffer.from(buff);
        }
        return Buffer.alloc(0);
      }
    };
    var KB_TO_BYTES = 1024;
    var LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;
    var UPLOAD_TIMEOUT = 15 * 1e3;
    var DISCONNECT_SLEEP = 1e3;
    var BUFFER_SIZE_2GB = 2 ** 31;
    var BUFFER_SIZE_20MB = 20 * 1024 * 1024;
    async function getFileBuffer(file, fileSize, maxBufferSize) {
      const options = {};
      if (fileSize > maxBufferSize && file instanceof CustomFile) {
        options.filePath = file.path;
      } else {
        options.buffer = Buffer.from(await fileToBuffer(file));
      }
      return new CustomBuffer(options);
    }
    async function uploadFile(client2, fileParams) {
      const { file, onProgress } = fileParams;
      let { workers } = fileParams;
      const { name, size } = file;
      const fileId = (0, Helpers_1.readBigIntFromBuffer)((0, Helpers_1.generateRandomBytes)(8), true, true);
      const isLarge = size > LARGE_FILE_THRESHOLD;
      const partSize = (0, Utils_1.getAppropriatedPartSize)((0, big_integer_1.default)(size)) * KB_TO_BYTES;
      const partCount = Math.floor((size + partSize - 1) / partSize);
      const buffer = await getFileBuffer(file, size, fileParams.maxBufferSize || BUFFER_SIZE_20MB - 1);
      await client2.getSender(client2.session.dcId);
      if (!workers || !size) {
        workers = 1;
      }
      if (workers >= partCount) {
        workers = partCount;
      }
      let progress = 0;
      if (onProgress) {
        onProgress(progress);
      }
      for (let i = 0; i < partCount; i += workers) {
        const sendingParts = [];
        let end2 = i + workers;
        if (end2 > partCount) {
          end2 = partCount;
        }
        for (let j = i; j < end2; j++) {
          let endPart = (j + 1) * partSize;
          if (endPart > size) {
            endPart = size;
          }
          if (endPart == j * partSize) {
            break;
          }
          const bytes = await buffer.slice(j * partSize, endPart);
          sendingParts.push((async (jMemo, bytesMemo) => {
            while (true) {
              let sender;
              try {
                sender = await client2.getSender(client2.session.dcId);
                await sender.send(isLarge ? new tl_1.Api.upload.SaveBigFilePart({
                  fileId,
                  filePart: jMemo,
                  fileTotalParts: partCount,
                  bytes: bytesMemo
                }) : new tl_1.Api.upload.SaveFilePart({
                  fileId,
                  filePart: jMemo,
                  bytes: bytesMemo
                }));
              } catch (err) {
                if (sender && !sender.isConnected()) {
                  await (0, Helpers_1.sleep)(DISCONNECT_SLEEP);
                  continue;
                } else if (err instanceof index_1.errors.FloodWaitError) {
                  await (0, Helpers_1.sleep)(err.seconds * 1e3);
                  continue;
                }
                throw err;
              }
              if (onProgress) {
                if (onProgress.isCanceled) {
                  throw new Error("USER_CANCELED");
                }
                progress += 1 / partCount;
                onProgress(progress);
              }
              break;
            }
          })(j, bytes));
        }
        await Promise.all(sendingParts);
      }
      return isLarge ? new tl_1.Api.InputFileBig({
        id: fileId,
        parts: partCount,
        name
      }) : new tl_1.Api.InputFile({
        id: fileId,
        parts: partCount,
        name,
        md5Checksum: ""
        // This is not a "flag", so not sure if we can make it optional.
      });
    }
    exports2.uploadFile = uploadFile;
    async function _fileToMedia(client2, { file, forceDocument, fileSize, progressCallback, attributes, thumb, voiceNote = false, videoNote = false, supportsStreaming = false, mimeType, asImage, workers = 1 }) {
      if (!file) {
        return { fileHandle: void 0, media: void 0, image: void 0 };
      }
      const isImage = index_1.utils.isImage(file);
      if (asImage == void 0) {
        asImage = isImage && !forceDocument;
      }
      if (typeof file == "object" && !Buffer.isBuffer(file) && !(file instanceof tl_1.Api.InputFile) && !(file instanceof tl_1.Api.InputFileBig) && !(file instanceof CustomFile) && !("read" in file)) {
        try {
          return {
            fileHandle: void 0,
            media: index_1.utils.getInputMedia(file, {
              isPhoto: asImage,
              attributes,
              forceDocument,
              voiceNote,
              videoNote,
              supportsStreaming
            }),
            image: asImage
          };
        } catch (e) {
          return {
            fileHandle: void 0,
            media: void 0,
            image: isImage
          };
        }
      }
      let media;
      let fileHandle;
      let createdFile;
      if (file instanceof tl_1.Api.InputFile || file instanceof tl_1.Api.InputFileBig) {
        fileHandle = file;
      } else if (typeof file == "string" && (file.startsWith("https://") || file.startsWith("http://"))) {
        if (asImage) {
          media = new tl_1.Api.InputMediaPhotoExternal({ url: file });
        } else {
          media = new tl_1.Api.InputMediaDocumentExternal({ url: file });
        }
      } else if (!(typeof file == "string") || (await fs_1.promises.lstat(file)).isFile()) {
        if (typeof file == "string") {
          createdFile = new CustomFile(path_1.default.basename(file), (await fs_1.promises.stat(file)).size, file);
        } else if (typeof File !== "undefined" && file instanceof File || file instanceof CustomFile) {
          createdFile = file;
        } else {
          let name;
          if ("name" in file) {
            name = file.name;
          } else {
            name = "unnamed";
          }
          if (Buffer.isBuffer(file)) {
            createdFile = new CustomFile(name, file.length, "", file);
          }
        }
        if (!createdFile) {
          throw new Error(`Could not create file from ${JSON.stringify(file)}`);
        }
        fileHandle = await uploadFile(client2, {
          file: createdFile,
          onProgress: progressCallback,
          workers
        });
      } else {
        throw new Error(`"Not a valid path nor a url ${file}`);
      }
      if (media != void 0) {
      } else if (fileHandle == void 0) {
        throw new Error(`Failed to convert ${file} to media. Not an existing file or an HTTP URL`);
      } else if (asImage) {
        media = new tl_1.Api.InputMediaUploadedPhoto({
          file: fileHandle
        });
      } else {
        let res = index_1.utils.getAttributes(file, {
          mimeType,
          attributes,
          forceDocument: forceDocument && !isImage,
          voiceNote,
          videoNote,
          supportsStreaming,
          thumb
        });
        attributes = res.attrs;
        mimeType = res.mimeType;
        let uploadedThumb;
        if (!thumb) {
          uploadedThumb = void 0;
        } else {
          if (typeof thumb == "string") {
            uploadedThumb = new CustomFile(path_1.default.basename(thumb), (await fs_1.promises.stat(thumb)).size, thumb);
          } else if (typeof File !== "undefined" && thumb instanceof File) {
            uploadedThumb = thumb;
          } else {
            let name;
            if ("name" in thumb) {
              name = thumb.name;
            } else {
              name = "unnamed";
            }
            if (Buffer.isBuffer(thumb)) {
              uploadedThumb = new CustomFile(name, thumb.length, "", thumb);
            }
          }
          if (!uploadedThumb) {
            throw new Error(`Could not create file from ${file}`);
          }
          uploadedThumb = await uploadFile(client2, {
            file: uploadedThumb,
            workers: 1
          });
        }
        media = new tl_1.Api.InputMediaUploadedDocument({
          file: fileHandle,
          mimeType,
          attributes,
          thumb: uploadedThumb,
          forceFile: forceDocument && !isImage
        });
      }
      return {
        fileHandle,
        media,
        image: asImage
      };
    }
    exports2._fileToMedia = _fileToMedia;
    async function _sendAlbum(client2, entity, { file, caption, forceDocument = false, fileSize, clearDraft = false, progressCallback, replyTo, attributes, thumb, parseMode, voiceNote = false, videoNote = false, silent, supportsStreaming = false, scheduleDate, workers = 1, noforwards, commentTo, topMsgId }) {
      entity = await client2.getInputEntity(entity);
      let files = [];
      if (!Array.isArray(file)) {
        files = [file];
      } else {
        files = file;
      }
      if (!Array.isArray(caption)) {
        if (!caption) {
          caption = "";
        }
        caption = [caption];
      }
      const captions = [];
      for (const c of caption) {
        captions.push(await (0, messageParse_1._parseMessageText)(client2, c, parseMode));
      }
      if (commentTo != void 0) {
        const discussionData = await (0, messages_1.getCommentData)(client2, entity, commentTo);
        entity = discussionData.entity;
        replyTo = discussionData.replyTo;
      } else {
        replyTo = index_1.utils.getMessageId(replyTo);
      }
      if (!attributes) {
        attributes = [];
      }
      let index = 0;
      const albumFiles = [];
      for (const file2 of files) {
        let { fileHandle, media, image } = await _fileToMedia(client2, {
          file: file2,
          forceDocument,
          fileSize,
          progressCallback,
          // @ts-ignore
          attributes: attributes[index],
          thumb,
          voiceNote,
          videoNote,
          supportsStreaming,
          workers
        });
        index++;
        if (media instanceof tl_1.Api.InputMediaUploadedPhoto || media instanceof tl_1.Api.InputMediaPhotoExternal) {
          const r = await client2.invoke(new tl_1.Api.messages.UploadMedia({
            peer: entity,
            media
          }));
          if (r instanceof tl_1.Api.MessageMediaPhoto) {
            media = (0, Utils_1.getInputMedia)(r.photo);
          }
        } else if (media instanceof tl_1.Api.InputMediaUploadedDocument) {
          const r = await client2.invoke(new tl_1.Api.messages.UploadMedia({
            peer: entity,
            media
          }));
          if (r instanceof tl_1.Api.MessageMediaDocument) {
            media = (0, Utils_1.getInputMedia)(r.document);
          }
        }
        let text = "";
        let msgEntities = [];
        if (captions.length) {
          [text, msgEntities] = captions.shift();
        }
        albumFiles.push(new tl_1.Api.InputSingleMedia({
          media,
          message: text,
          entities: msgEntities
        }));
      }
      let replyObject = void 0;
      if (replyTo != void 0) {
        replyObject = new tl_1.Api.InputReplyToMessage({
          replyToMsgId: (0, Utils_1.getMessageId)(replyTo),
          topMsgId: (0, Utils_1.getMessageId)(topMsgId)
        });
      }
      const result = await client2.invoke(new tl_1.Api.messages.SendMultiMedia({
        peer: entity,
        replyTo: replyObject,
        multiMedia: albumFiles,
        silent,
        scheduleDate,
        clearDraft,
        noforwards
      }));
      const randomIds = albumFiles.map((m) => m.randomId);
      return client2._getResponseMessage(randomIds, result, entity);
    }
    exports2._sendAlbum = _sendAlbum;
    async function sendFile(client2, entity, { file, caption, forceDocument = false, fileSize, clearDraft = false, progressCallback, replyTo, attributes, thumb, parseMode, formattingEntities, voiceNote = false, videoNote = false, buttons, silent, supportsStreaming = false, scheduleDate, workers = 1, noforwards, commentTo, topMsgId }) {
      if (!file) {
        throw new Error("You need to specify a file");
      }
      if (!caption) {
        caption = "";
      }
      entity = await client2.getInputEntity(entity);
      if (commentTo != void 0) {
        const discussionData = await (0, messages_1.getCommentData)(client2, entity, commentTo);
        entity = discussionData.entity;
        replyTo = discussionData.replyTo;
      } else {
        replyTo = index_1.utils.getMessageId(replyTo);
      }
      if (Array.isArray(file)) {
        return await _sendAlbum(client2, entity, {
          file,
          caption,
          replyTo,
          parseMode,
          attributes,
          silent,
          scheduleDate,
          supportsStreaming,
          clearDraft,
          forceDocument,
          noforwards,
          topMsgId
        });
      }
      if (Array.isArray(caption)) {
        caption = caption[0] || "";
      }
      let msgEntities;
      if (formattingEntities != void 0) {
        msgEntities = formattingEntities;
      } else {
        [caption, msgEntities] = await (0, messageParse_1._parseMessageText)(client2, caption, parseMode);
      }
      const { fileHandle, media, image } = await _fileToMedia(client2, {
        file,
        forceDocument,
        fileSize,
        progressCallback,
        // @ts-ignore
        attributes,
        thumb,
        voiceNote,
        videoNote,
        supportsStreaming,
        workers
      });
      if (media == void 0) {
        throw new Error(`Cannot use ${file} as file.`);
      }
      const markup = client2.buildReplyMarkup(buttons);
      let replyObject = void 0;
      if (replyTo != void 0) {
        replyObject = new tl_1.Api.InputReplyToMessage({
          replyToMsgId: (0, Utils_1.getMessageId)(replyTo),
          topMsgId: (0, Utils_1.getMessageId)(topMsgId)
        });
      }
      const request = new tl_1.Api.messages.SendMedia({
        peer: entity,
        media,
        replyTo: replyObject,
        message: caption,
        entities: msgEntities,
        replyMarkup: markup,
        silent,
        scheduleDate,
        clearDraft,
        noforwards
      });
      const result = await client2.invoke(request);
      return client2._getResponseMessage(request, result, entity);
    }
    exports2.sendFile = sendFile;
    function fileToBuffer(file) {
      if (typeof File !== "undefined" && file instanceof File) {
        return new Response(file).arrayBuffer();
      } else if (file instanceof CustomFile) {
        if (file.buffer != void 0) {
          return file.buffer;
        } else {
          return fs_1.promises.readFile(file.path);
        }
      } else {
        throw new Error("Could not create buffer from file " + file);
      }
    }
  }
});

// node_modules/telegram/client/messages.js
var require_messages2 = __commonJS({
  "node_modules/telegram/client/messages.js"(exports2) {
    "use strict";
    var __asyncValues2 = exports2 && exports2.__asyncValues || function(o) {
      if (!Symbol.asyncIterator)
        throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
        return this;
      }, i);
      function verb(n) {
        i[n] = o[n] && function(v) {
          return new Promise(function(resolve, reject) {
            v = o[n](v), settle(resolve, reject, v.done, v.value);
          });
        };
      }
      function settle(resolve, reject, d, v) {
        Promise.resolve(v).then(function(v2) {
          resolve({ value: v2, done: d });
        }, reject);
      }
    };
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getCommentData = exports2.markAsRead = exports2._pin = exports2.unpinMessage = exports2.pinMessage = exports2.deleteMessages = exports2.editMessage = exports2.forwardMessages = exports2.sendMessage = exports2.getMessages = exports2.iterMessages = exports2._IDsIter = exports2._MessagesIter = void 0;
    var tl_1 = require_tl();
    var requestIter_1 = require_requestIter();
    var Helpers_1 = require_Helpers();
    var Utils_1 = require_Utils();
    var __1 = require_telegram();
    var messageParse_1 = require_messageParse();
    var users_1 = require_users();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var uploads_1 = require_uploads();
    var _MAX_CHUNK_SIZE = 100;
    var _MessagesIter = class extends requestIter_1.RequestIter {
      async _init({ entity, offsetId, minId, maxId, fromUser, offsetDate, addOffset, filter, search, replyTo }) {
        var e_1, _a;
        if (entity) {
          this.entity = await this.client.getInputEntity(entity);
        } else {
          this.entity = void 0;
          if (this.reverse) {
            throw new Error("Cannot reverse global search");
          }
        }
        if (this.reverse) {
          offsetId = Math.max(offsetId, minId);
          if (offsetId && maxId) {
            if (maxId - offsetId <= 1) {
              return false;
            }
          }
          if (!maxId) {
            maxId = Number.MAX_SAFE_INTEGER;
          }
        } else {
          offsetId = Math.max(offsetId, maxId);
          if (offsetId && minId) {
            if (offsetId - minId <= 1) {
              return false;
            }
          }
        }
        if (this.reverse) {
          if (offsetId) {
            offsetId += 1;
          } else if (!offsetDate) {
            offsetId = 1;
          }
        }
        if (fromUser) {
          fromUser = await this.client.getInputEntity(fromUser);
        }
        if (!this.entity && fromUser) {
          this.entity = new tl_1.Api.InputPeerEmpty();
        }
        if (!filter) {
          filter = new tl_1.Api.InputMessagesFilterEmpty();
        }
        if (!this.entity) {
          this.request = new tl_1.Api.messages.SearchGlobal({
            q: search || "",
            filter,
            minDate: void 0,
            // TODO fix this smh
            maxDate: offsetDate,
            offsetRate: void 0,
            offsetPeer: new tl_1.Api.InputPeerEmpty(),
            offsetId,
            limit: 1
          });
        } else if (replyTo !== void 0) {
          this.request = new tl_1.Api.messages.GetReplies({
            peer: this.entity,
            msgId: replyTo,
            offsetId,
            offsetDate,
            addOffset,
            limit: 0,
            maxId: 0,
            minId: 0,
            hash: big_integer_1.default.zero
          });
        } else if (search !== void 0 || !(filter instanceof tl_1.Api.InputMessagesFilterEmpty) || fromUser !== void 0) {
          this.request = new tl_1.Api.messages.Search({
            peer: this.entity,
            q: search || "",
            filter: typeof filter === "function" ? new filter() : filter,
            minDate: void 0,
            maxDate: offsetDate,
            offsetId,
            addOffset,
            limit: 0,
            maxId: 0,
            minId: 0,
            hash: (0, Helpers_1.generateRandomBigInt)(),
            fromId: fromUser
          });
          if (!(filter instanceof tl_1.Api.InputMessagesFilterEmpty) && offsetDate && !search && !offsetId) {
            try {
              for (var _b = __asyncValues2(this.client.iterMessages(this.entity, {
                limit: 1,
                offsetDate
              })), _c; _c = await _b.next(), !_c.done; ) {
                const m = _c.value;
                this.request.offsetId = m.id + 1;
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a = _b.return))
                  await _a.call(_b);
              } finally {
                if (e_1)
                  throw e_1.error;
              }
            }
          }
        } else {
          this.request = new tl_1.Api.messages.GetHistory({
            peer: this.entity,
            limit: 1,
            offsetDate,
            offsetId,
            minId: 0,
            maxId: 0,
            addOffset,
            hash: big_integer_1.default.zero
          });
        }
        if (this.limit <= 0) {
          const result = await this.client.invoke(this.request);
          if (result instanceof tl_1.Api.messages.MessagesNotModified) {
            this.total = result.count;
          } else {
            if ("count" in result) {
              this.total = result.count;
            } else {
              this.total = result.messages.length;
            }
          }
          return false;
        }
        if (!this.waitTime) {
          this.waitTime = this.limit > 3e3 ? 1 : 0;
        }
        if (this.reverse && !(this.request instanceof tl_1.Api.messages.SearchGlobal)) {
          this.request.addOffset -= _MAX_CHUNK_SIZE;
        }
        this.addOffset = addOffset;
        this.maxId = maxId;
        this.minId = minId;
        this.lastId = this.reverse ? 0 : Number.MAX_SAFE_INTEGER;
      }
      async _loadNextChunk() {
        var _a;
        if (!this.request) {
          throw new Error("Request not set yet");
        }
        this.request.limit = Math.min(this.left, _MAX_CHUNK_SIZE);
        if (this.reverse && this.request.limit != _MAX_CHUNK_SIZE) {
          if (!(this.request instanceof tl_1.Api.messages.SearchGlobal)) {
            this.request.addOffset = this.addOffset - this.request.limit;
          }
        }
        const r = await this.client.invoke(this.request);
        if (r instanceof tl_1.Api.messages.MessagesNotModified) {
          return true;
        }
        if ("count" in r) {
          this.total = r.count;
        } else {
          this.total = r.messages.length;
        }
        const entities = /* @__PURE__ */ new Map();
        for (const x of [...r.users, ...r.chats]) {
          entities.set((0, Utils_1.getPeerId)(x), x);
        }
        const messages = this.reverse ? r.messages.reverse() : r.messages;
        for (const message of messages) {
          if (!this._messageInRange(message)) {
            return true;
          }
          this.lastId = message.id;
          try {
            message._finishInit(this.client, entities, this.entity);
          } catch (e) {
          }
          message._entities = entities;
          (_a = this.buffer) === null || _a === void 0 ? void 0 : _a.push(message);
        }
        if (r.messages.length < this.request.limit) {
          return true;
        }
        if (this.buffer) {
          this._updateOffset(this.buffer[this.buffer.length - 1], r);
        } else {
          return true;
        }
      }
      _messageInRange(message) {
        if (this.entity) {
          if (this.reverse) {
            if (message.id <= this.lastId || message.id >= this.maxId) {
              return false;
            }
          } else {
            if (message.id >= this.lastId || message.id <= this.minId) {
              return false;
            }
          }
        }
        return true;
      }
      [Symbol.asyncIterator]() {
        return super[Symbol.asyncIterator]();
      }
      _updateOffset(lastMessage, response) {
        if (!this.request) {
          throw new Error("Request not set yet");
        }
        this.request.offsetId = Number(lastMessage.id);
        if (this.reverse) {
          this.request.offsetId += 1;
        }
        if (this.request instanceof tl_1.Api.messages.Search) {
          this.request.maxDate = -1;
        } else {
          if (!(this.request instanceof tl_1.Api.messages.SearchGlobal)) {
            this.request.offsetDate = lastMessage.date;
          }
        }
        if (this.request instanceof tl_1.Api.messages.SearchGlobal) {
          if (lastMessage.inputChat) {
            this.request.offsetPeer = lastMessage.inputChat;
          } else {
            this.request.offsetPeer = new tl_1.Api.InputPeerEmpty();
          }
          this.request.offsetRate = response.nextRate;
        }
      }
    };
    exports2._MessagesIter = _MessagesIter;
    var _IDsIter = class extends requestIter_1.RequestIter {
      async _init({ entity, ids }) {
        this.total = ids.length;
        this._ids = this.reverse ? ids.reverse() : ids;
        this._offset = 0;
        this._entity = entity ? await this.client.getInputEntity(entity) : void 0;
        this._ty = this._entity ? (0, Helpers_1._entityType)(this._entity) : void 0;
        if (!this.waitTime) {
          this.waitTime = this.limit > 300 ? 10 : 0;
        }
      }
      [Symbol.asyncIterator]() {
        return super[Symbol.asyncIterator]();
      }
      async _loadNextChunk() {
        var _a, _b, _c;
        const ids = this._ids.slice(this._offset, this._offset + _MAX_CHUNK_SIZE);
        if (!ids.length) {
          return false;
        }
        this._offset += _MAX_CHUNK_SIZE;
        let fromId;
        let r;
        if (this._ty == Helpers_1._EntityType.CHANNEL) {
          try {
            r = await this.client.invoke(new tl_1.Api.channels.GetMessages({
              channel: this._entity,
              id: ids
            }));
          } catch (e) {
            if (e.errorMessage == "MESSAGE_IDS_EMPTY") {
              r = new tl_1.Api.messages.MessagesNotModified({
                count: ids.length
              });
            } else {
              throw e;
            }
          }
        } else {
          r = await this.client.invoke(new tl_1.Api.messages.GetMessages({
            id: ids
          }));
          if (this._entity) {
            fromId = await (0, users_1._getPeer)(this.client, this._entity);
          }
        }
        if (r instanceof tl_1.Api.messages.MessagesNotModified) {
          (_a = this.buffer) === null || _a === void 0 ? void 0 : _a.push(...Array(ids.length));
          return;
        }
        const entities = /* @__PURE__ */ new Map();
        for (const entity of [...r.users, ...r.chats]) {
          entities.set(__1.utils.getPeerId(entity), entity);
        }
        let message;
        for (message of r.messages) {
          if (message instanceof tl_1.Api.MessageEmpty || fromId && __1.utils.getPeerId(message.peerId) != __1.utils.getPeerId(fromId)) {
            (_b = this.buffer) === null || _b === void 0 ? void 0 : _b.push(void 0);
          } else {
            const temp = message;
            temp._finishInit(this.client, entities, this._entity);
            temp._entities = entities;
            (_c = this.buffer) === null || _c === void 0 ? void 0 : _c.push(temp);
          }
        }
      }
    };
    exports2._IDsIter = _IDsIter;
    var IterMessagesDefaults = {
      limit: void 0,
      offsetDate: void 0,
      offsetId: 0,
      maxId: 0,
      minId: 0,
      addOffset: 0,
      search: void 0,
      filter: void 0,
      fromUser: void 0,
      waitTime: void 0,
      ids: void 0,
      reverse: false,
      replyTo: void 0,
      scheduled: false
    };
    function iterMessages(client2, entity, options) {
      const { limit, offsetDate, offsetId, maxId, minId, addOffset, search, filter, fromUser, waitTime, ids, reverse, replyTo } = Object.assign(Object.assign({}, IterMessagesDefaults), options);
      if (ids) {
        let idsArray;
        if (!(0, Helpers_1.isArrayLike)(ids)) {
          idsArray = [ids];
        } else {
          idsArray = ids;
        }
        return new _IDsIter(client2, idsArray.length, {
          reverse,
          waitTime
        }, {
          entity,
          ids: idsArray
        });
      }
      return new _MessagesIter(client2, limit, {
        waitTime,
        reverse
      }, {
        entity,
        offsetId,
        minId,
        maxId,
        fromUser,
        offsetDate,
        addOffset,
        filter,
        search,
        replyTo
      });
    }
    exports2.iterMessages = iterMessages;
    async function getMessages(client2, entity, params) {
      var e_2, _a;
      if (Object.keys(params).length == 1 && params.limit === void 0) {
        if (params.minId === void 0 && params.maxId === void 0) {
          params.limit = void 0;
        } else {
          params.limit = 1;
        }
      }
      const it = client2.iterMessages(entity, params);
      const ids = params.ids;
      if (ids && !(0, Helpers_1.isArrayLike)(ids)) {
        try {
          for (var it_1 = __asyncValues2(it), it_1_1; it_1_1 = await it_1.next(), !it_1_1.done; ) {
            const message = it_1_1.value;
            return [message];
          }
        } catch (e_2_1) {
          e_2 = { error: e_2_1 };
        } finally {
          try {
            if (it_1_1 && !it_1_1.done && (_a = it_1.return))
              await _a.call(it_1);
          } finally {
            if (e_2)
              throw e_2.error;
          }
        }
        return [];
      }
      return await it.collect();
    }
    exports2.getMessages = getMessages;
    async function sendMessage(client2, entity, { message, replyTo, attributes, parseMode, formattingEntities, linkPreview = true, file, thumb, forceDocument, clearDraft, buttons, silent, supportStreaming, schedule, noforwards, commentTo, topMsgId } = {}) {
      if (file) {
        return client2.sendFile(entity, {
          file,
          caption: message ? typeof message == "string" ? message : message.message : "",
          forceDocument,
          clearDraft,
          replyTo,
          attributes,
          thumb,
          supportsStreaming: supportStreaming,
          parseMode,
          formattingEntities,
          silent,
          scheduleDate: schedule,
          buttons,
          noforwards,
          commentTo,
          topMsgId
        });
      }
      entity = await client2.getInputEntity(entity);
      if (commentTo != void 0) {
        const discussionData = await getCommentData(client2, entity, commentTo);
        entity = discussionData.entity;
        replyTo = discussionData.replyTo;
      }
      let markup, request;
      let replyObject = void 0;
      if (replyTo != void 0) {
        replyObject = new tl_1.Api.InputReplyToMessage({
          replyToMsgId: (0, Utils_1.getMessageId)(replyTo),
          topMsgId: (0, Utils_1.getMessageId)(topMsgId)
        });
      }
      if (message && message instanceof tl_1.Api.Message) {
        if (buttons == void 0) {
          markup = message.replyMarkup;
        } else {
          markup = client2.buildReplyMarkup(buttons);
        }
        if (silent == void 0) {
          silent = message.silent;
        }
        if (message.media && !(message.media instanceof tl_1.Api.MessageMediaWebPage)) {
          return client2.sendFile(entity, {
            file: message.media,
            caption: message.message,
            silent,
            replyTo,
            buttons: markup,
            formattingEntities: message.entities,
            scheduleDate: schedule
          });
        }
        request = new tl_1.Api.messages.SendMessage({
          peer: entity,
          message: message.message || "",
          silent,
          replyTo: replyObject,
          replyMarkup: markup,
          entities: message.entities,
          clearDraft,
          noWebpage: !(message.media instanceof tl_1.Api.MessageMediaWebPage),
          scheduleDate: schedule,
          noforwards
        });
        message = message.message;
      } else {
        if (formattingEntities == void 0) {
          [message, formattingEntities] = await (0, messageParse_1._parseMessageText)(client2, message || "", parseMode);
        }
        if (!message) {
          throw new Error("The message cannot be empty unless a file is provided");
        }
        request = new tl_1.Api.messages.SendMessage({
          peer: entity,
          message: message.toString(),
          entities: formattingEntities,
          noWebpage: !linkPreview,
          replyTo: replyObject,
          clearDraft,
          silent,
          replyMarkup: client2.buildReplyMarkup(buttons),
          scheduleDate: schedule,
          noforwards
        });
      }
      const result = await client2.invoke(request);
      if (result instanceof tl_1.Api.UpdateShortSentMessage) {
        const msg = new tl_1.Api.Message({
          id: result.id,
          peerId: await (0, users_1._getPeer)(client2, entity),
          message,
          date: result.date,
          out: result.out,
          media: result.media,
          entities: result.entities,
          replyMarkup: request.replyMarkup,
          ttlPeriod: result.ttlPeriod
        });
        msg._finishInit(client2, /* @__PURE__ */ new Map(), entity);
        return msg;
      }
      return client2._getResponseMessage(request, result, entity);
    }
    exports2.sendMessage = sendMessage;
    async function forwardMessages(client2, entity, { messages, fromPeer, silent, schedule, noforwards, dropAuthor }) {
      if (!(0, Helpers_1.isArrayLike)(messages)) {
        messages = [messages];
      }
      entity = await client2.getInputEntity(entity);
      let fromPeerId;
      if (fromPeer) {
        fromPeer = await client2.getInputEntity(fromPeer);
        fromPeerId = await client2.getPeerId(fromPeer);
      }
      const getKey = (m) => {
        if (m instanceof tl_1.Api.Message) {
          return m.chatId;
        }
        let msgId = (0, Utils_1.parseID)(m);
        if (msgId) {
          if (fromPeerId !== void 0) {
            return fromPeerId;
          }
          throw new Error("fromPeer must be given if integer IDs are used");
        } else {
          throw new Error(`Cannot forward ${m}`);
        }
      };
      const sent = [];
      for (let [chatId, chunk] of (0, Helpers_1.groupBy)(messages, getKey)) {
        let chat;
        let numbers = [];
        if (typeof chunk[0] == "number") {
          chat = fromPeer;
          numbers = chunk;
        } else {
          chat = await chunk[0].getInputChat();
          numbers = chunk.map((m) => m.id);
        }
        chunk.push();
        const request = new tl_1.Api.messages.ForwardMessages({
          fromPeer: chat,
          id: numbers,
          toPeer: entity,
          silent,
          scheduleDate: schedule,
          noforwards,
          dropAuthor
        });
        const result = await client2.invoke(request);
        sent.push(client2._getResponseMessage(request, result, entity));
      }
      return sent;
    }
    exports2.forwardMessages = forwardMessages;
    async function editMessage(client2, entity, { message, text, parseMode, formattingEntities, linkPreview = true, file, forceDocument, buttons, schedule }) {
      if (typeof message === "number" && typeof text === "undefined" && !file && !schedule) {
        throw Error("You have to provide either file or text or schedule property.");
      }
      entity = await client2.getInputEntity(entity);
      let id;
      let markup;
      let entities;
      let inputMedia;
      if (file) {
        const { fileHandle, media, image } = await (0, uploads_1._fileToMedia)(client2, {
          file,
          forceDocument
        });
        inputMedia = media;
      }
      if (message instanceof tl_1.Api.Message) {
        id = (0, Utils_1.getMessageId)(message);
        text = message.message;
        entities = message.entities;
        if (buttons == void 0) {
          markup = message.replyMarkup;
        } else {
          markup = client2.buildReplyMarkup(buttons);
        }
        if (message.media) {
          inputMedia = (0, Utils_1.getInputMedia)(message.media, { forceDocument });
        }
      } else {
        if (typeof message !== "number") {
          throw Error("editMessageParams.message must be either a number or a Api.Message type");
        }
        id = message;
        if (formattingEntities == void 0) {
          [text, entities] = await (0, messageParse_1._parseMessageText)(client2, text || "", parseMode);
        } else {
          entities = formattingEntities;
        }
        markup = client2.buildReplyMarkup(buttons);
      }
      const request = new tl_1.Api.messages.EditMessage({
        peer: entity,
        id,
        message: text,
        noWebpage: !linkPreview,
        entities,
        media: inputMedia,
        replyMarkup: markup,
        scheduleDate: schedule
      });
      const result = await client2.invoke(request);
      return client2._getResponseMessage(request, result, entity);
    }
    exports2.editMessage = editMessage;
    async function deleteMessages(client2, entity, messageIds, { revoke = false }) {
      let ty = Helpers_1._EntityType.USER;
      if (entity) {
        entity = await client2.getInputEntity(entity);
        ty = (0, Helpers_1._entityType)(entity);
      }
      const ids = [];
      for (const messageId of messageIds) {
        if (messageId instanceof tl_1.Api.Message || messageId instanceof tl_1.Api.MessageService || messageId instanceof tl_1.Api.MessageEmpty) {
          ids.push(messageId.id);
        } else if (typeof messageId === "number") {
          ids.push(messageId);
        } else {
          throw new Error(`Cannot convert ${messageId} to an integer`);
        }
      }
      const results = [];
      if (ty == Helpers_1._EntityType.CHANNEL) {
        for (const chunk of __1.utils.chunks(ids)) {
          results.push(client2.invoke(new tl_1.Api.channels.DeleteMessages({
            channel: entity,
            id: chunk
          })));
        }
      } else {
        for (const chunk of __1.utils.chunks(ids)) {
          results.push(client2.invoke(new tl_1.Api.messages.DeleteMessages({
            id: chunk,
            revoke
          })));
        }
      }
      return Promise.all(results);
    }
    exports2.deleteMessages = deleteMessages;
    async function pinMessage(client2, entity, message, pinMessageParams) {
      return await _pin(client2, entity, message, false, pinMessageParams === null || pinMessageParams === void 0 ? void 0 : pinMessageParams.notify, pinMessageParams === null || pinMessageParams === void 0 ? void 0 : pinMessageParams.pmOneSide);
    }
    exports2.pinMessage = pinMessage;
    async function unpinMessage(client2, entity, message, unpinMessageParams) {
      return await _pin(client2, entity, message, true, unpinMessageParams === null || unpinMessageParams === void 0 ? void 0 : unpinMessageParams.notify, unpinMessageParams === null || unpinMessageParams === void 0 ? void 0 : unpinMessageParams.pmOneSide);
    }
    exports2.unpinMessage = unpinMessage;
    async function _pin(client2, entity, message, unpin, notify = false, pmOneSide = false) {
      message = __1.utils.getMessageId(message) || 0;
      if (message === 0) {
        return await client2.invoke(new tl_1.Api.messages.UnpinAllMessages({
          peer: entity
        }));
      }
      entity = await client2.getInputEntity(entity);
      const request = new tl_1.Api.messages.UpdatePinnedMessage({
        silent: !notify,
        unpin,
        pmOneside: pmOneSide,
        peer: entity,
        id: message
      });
      const result = await client2.invoke(request);
      if (unpin || !("updates" in result) || "updates" in result && !result.updates) {
        return;
      }
      return client2._getResponseMessage(request, result, entity);
    }
    exports2._pin = _pin;
    async function markAsRead(client2, entity, message, markAsReadParams) {
      let maxId = (markAsReadParams === null || markAsReadParams === void 0 ? void 0 : markAsReadParams.maxId) || 0;
      const maxIdIsUndefined = (markAsReadParams === null || markAsReadParams === void 0 ? void 0 : markAsReadParams.maxId) === void 0;
      if (maxIdIsUndefined) {
        if (message) {
          if (Array.isArray(message)) {
            maxId = Math.max(...message.map((v) => __1.utils.getMessageId(v)));
          } else {
            maxId = __1.utils.getMessageId(message);
          }
        }
      }
      entity = await client2.getInputEntity(entity);
      if (markAsReadParams && !markAsReadParams.clearMentions) {
        await client2.invoke(new tl_1.Api.messages.ReadMentions({ peer: entity }));
        if (maxIdIsUndefined && message === void 0) {
          return true;
        }
      }
      if ((0, Helpers_1._entityType)(entity) === Helpers_1._EntityType.CHANNEL) {
        return await client2.invoke(new tl_1.Api.channels.ReadHistory({ channel: entity, maxId }));
      } else {
        await client2.invoke(new tl_1.Api.messages.ReadHistory({ peer: entity, maxId }));
        return true;
      }
    }
    exports2.markAsRead = markAsRead;
    async function getCommentData(client2, entity, message) {
      const result = await client2.invoke(new tl_1.Api.messages.GetDiscussionMessage({
        peer: entity,
        msgId: __1.utils.getMessageId(message)
      }));
      const relevantMessage = result.messages.reduce((p, c) => p && p.id < c.id ? p : c);
      let chat;
      for (const c of result.chats) {
        if (relevantMessage.peerId instanceof tl_1.Api.PeerChannel && c.id.eq(relevantMessage.peerId.channelId)) {
          chat = c;
          break;
        }
      }
      return {
        entity: __1.utils.getInputPeer(chat),
        replyTo: relevantMessage.id
      };
    }
    exports2.getCommentData = getCommentData;
  }
});

// node_modules/telegram/tl/custom/index.js
var require_custom = __commonJS({
  "node_modules/telegram/tl/custom/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ChatGetter = void 0;
    var chatGetter_1 = require_chatGetter();
    Object.defineProperty(exports2, "ChatGetter", { enumerable: true, get: function() {
      return chatGetter_1.ChatGetter;
    } });
  }
});

// node_modules/telegram/events/common.js
var require_common2 = __commonJS({
  "node_modules/telegram/events/common.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.EventCommonSender = exports2.EventCommon = exports2.EventBuilder = exports2._intoIdSet = void 0;
    var tl_1 = require_tl();
    var custom_1 = require_custom();
    var Helpers_1 = require_Helpers();
    var __1 = require_telegram();
    var senderGetter_1 = require_senderGetter();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Utils_1 = require_Utils();
    async function _intoIdSet(client2, chats) {
      if (chats == void 0) {
        return void 0;
      }
      if (!(0, Helpers_1.isArrayLike)(chats)) {
        chats = [chats];
      }
      const result = /* @__PURE__ */ new Set();
      for (let chat of chats) {
        if (typeof chat == "number" || typeof chat == "bigint" || typeof chat == "string" && (0, Utils_1.parseID)(chat) || big_integer_1.default.isInstance(chat)) {
          chat = (0, Helpers_1.returnBigInt)(chat);
          if (chat.lesser(0)) {
            result.add(chat.toString());
          } else {
            result.add(__1.utils.getPeerId(new tl_1.Api.PeerUser({
              userId: chat
            })));
            result.add(__1.utils.getPeerId(new tl_1.Api.PeerChat({
              chatId: chat
            })));
            result.add(__1.utils.getPeerId(new tl_1.Api.PeerChannel({
              channelId: chat
            })));
          }
        } else if (typeof chat == "object" && chat.SUBCLASS_OF_ID == 47470215) {
          result.add(__1.utils.getPeerId(chat));
        } else {
          chat = await client2.getInputEntity(chat);
          if (chat instanceof tl_1.Api.InputPeerSelf) {
            chat = await client2.getMe(true);
          }
          result.add(__1.utils.getPeerId(chat));
        }
      }
      return Array.from(result);
    }
    exports2._intoIdSet = _intoIdSet;
    var EventBuilder = class {
      constructor(eventParams) {
        var _a;
        this.chats = (_a = eventParams.chats) === null || _a === void 0 ? void 0 : _a.map((x) => x.toString());
        this.blacklistChats = eventParams.blacklistChats || false;
        this.resolved = false;
        this.func = eventParams.func;
      }
      build(update, callback, selfId) {
        if (update)
          return update;
      }
      async resolve(client2) {
        if (this.resolved) {
          return;
        }
        await this._resolve(client2);
        this.resolved = true;
      }
      async _resolve(client2) {
        this.chats = await _intoIdSet(client2, this.chats);
      }
      filter(event) {
        if (!this.resolved) {
          return;
        }
        if (this.chats != void 0) {
          if (event.chatId == void 0) {
            return;
          }
          const inside = this.chats.includes(event.chatId.toString());
          if (inside == this.blacklistChats) {
            return;
          }
        }
        if (this.func && !this.func(event)) {
          return;
        }
        return event;
      }
    };
    exports2.EventBuilder = EventBuilder;
    var EventCommon = class extends custom_1.ChatGetter {
      constructor({ chatPeer = void 0, msgId = void 0, broadcast = void 0 }) {
        super();
        this._eventName = "Event";
        custom_1.ChatGetter.initChatClass(this, { chatPeer, broadcast });
        this._entities = /* @__PURE__ */ new Map();
        this._client = void 0;
        this._messageId = msgId;
      }
      _setClient(client2) {
        this._client = client2;
      }
      get client() {
        return this._client;
      }
    };
    exports2.EventCommon = EventCommon;
    var EventCommonSender = class extends senderGetter_1.SenderGetter {
      constructor({ chatPeer = void 0, msgId = void 0, broadcast = void 0 }) {
        super();
        this._eventName = "Event";
        custom_1.ChatGetter.initChatClass(this, { chatPeer, broadcast });
        senderGetter_1.SenderGetter.initChatClass(this, { chatPeer, broadcast });
        this._entities = /* @__PURE__ */ new Map();
        this._client = void 0;
        this._messageId = msgId;
      }
      _setClient(client2) {
        this._client = client2;
      }
      get client() {
        return this._client;
      }
    };
    exports2.EventCommonSender = EventCommonSender;
  }
});

// node_modules/telegram/events/Raw.js
var require_Raw = __commonJS({
  "node_modules/telegram/events/Raw.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Raw = void 0;
    var common_1 = require_common2();
    var Raw = class extends common_1.EventBuilder {
      constructor(params) {
        super({ func: params.func });
        this.types = params.types;
      }
      async resolve(client2) {
        this.resolved = true;
      }
      build(update) {
        return update;
      }
      filter(event) {
        if (this.types) {
          let correct = false;
          for (const type of this.types) {
            if (event instanceof type) {
              correct = true;
              break;
            }
          }
          if (!correct) {
            return;
          }
        }
        return super.filter(event);
      }
    };
    exports2.Raw = Raw;
  }
});

// node_modules/telegram/client/updates.js
var require_updates = __commonJS({
  "node_modules/telegram/client/updates.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2._updateLoop = exports2._dispatchUpdate = exports2._processUpdate = exports2._handleUpdate = exports2.catchUp = exports2.listEventHandlers = exports2.removeEventHandler = exports2.addEventHandler = exports2.on = exports2.StopPropagation = void 0;
    var tl_1 = require_tl();
    var network_1 = require_network();
    var index_1 = require_telegram();
    var Helpers_1 = require_Helpers();
    var Logger_1 = require_Logger();
    var PING_INTERVAL = 9e3;
    var PING_TIMEOUT = 1e4;
    var PING_FAIL_ATTEMPTS = 3;
    var PING_FAIL_INTERVAL = 100;
    var PING_DISCONNECT_DELAY = 6e4;
    var PING_INTERVAL_TO_WAKE_UP = 5e3;
    var PING_WAKE_UP_TIMEOUT = 3e3;
    var PING_WAKE_UP_WARNING_TIMEOUT = 1e3;
    var StopPropagation = class extends Error {
    };
    exports2.StopPropagation = StopPropagation;
    function on(client2, event) {
      return (f2) => {
        client2.addEventHandler(f2, event);
        return f2;
      };
    }
    exports2.on = on;
    function addEventHandler(client2, callback, event) {
      if (event == void 0) {
        const raw = require_Raw().Raw;
        event = new raw({});
      }
      event.client = client2;
      client2._eventBuilders.push([event, callback]);
    }
    exports2.addEventHandler = addEventHandler;
    function removeEventHandler(client2, callback, event) {
      client2._eventBuilders = client2._eventBuilders.filter(function(item) {
        return item[0] !== event && item[1] !== callback;
      });
    }
    exports2.removeEventHandler = removeEventHandler;
    function listEventHandlers(client2) {
      return client2._eventBuilders;
    }
    exports2.listEventHandlers = listEventHandlers;
    function catchUp() {
    }
    exports2.catchUp = catchUp;
    function _handleUpdate(client2, update) {
      if (typeof update === "number") {
        if ([-1, 0, 1].includes(update)) {
          _dispatchUpdate(client2, {
            update: new network_1.UpdateConnectionState(update)
          });
          return;
        }
      }
      client2._entityCache.add(update);
      client2.session.processEntities(update);
      if (update instanceof tl_1.Api.Updates || update instanceof tl_1.Api.UpdatesCombined) {
        const entities = /* @__PURE__ */ new Map();
        for (const x of [...update.users, ...update.chats]) {
          entities.set(index_1.utils.getPeerId(x), x);
        }
        for (const u of update.updates) {
          _processUpdate(client2, u, update.updates, entities);
        }
      } else if (update instanceof tl_1.Api.UpdateShort) {
        _processUpdate(client2, update.update, null);
      } else {
        _processUpdate(client2, update, null);
      }
    }
    exports2._handleUpdate = _handleUpdate;
    function _processUpdate(client2, update, others, entities) {
      update._entities = entities || /* @__PURE__ */ new Map();
      const args = {
        update,
        others
      };
      _dispatchUpdate(client2, args);
    }
    exports2._processUpdate = _processUpdate;
    async function _dispatchUpdate(client2, args) {
      for (const [builder, callback] of client2._eventBuilders) {
        if (!builder || !callback) {
          continue;
        }
        if (!builder.resolved) {
          await builder.resolve(client2);
        }
        let event = args.update;
        if (event) {
          if (!client2._selfInputPeer) {
            try {
              await client2.getMe(true);
            } catch (e) {
            }
          }
          if (!(event instanceof network_1.UpdateConnectionState)) {
          }
          event = builder.build(event, callback, client2._selfInputPeer ? (0, Helpers_1.returnBigInt)(client2._selfInputPeer.userId) : void 0);
          if (event) {
            event._client = client2;
            if ("_eventName" in event) {
              event._setClient(client2);
              event.originalUpdate = args.update;
              event._entities = args.update._entities;
            }
            const filter = await builder.filter(event);
            if (!filter) {
              continue;
            }
            try {
              await callback(event);
            } catch (e) {
              if (e instanceof StopPropagation) {
                break;
              }
              if (client2._errorHandler) {
                await client2._errorHandler(e);
              }
              if (client2._log.canSend(Logger_1.LogLevel.ERROR)) {
                console.error(e);
              }
            }
          }
        }
      }
    }
    exports2._dispatchUpdate = _dispatchUpdate;
    async function _updateLoop(client2) {
      let lastPongAt;
      while (!client2._destroyed) {
        await (0, Helpers_1.sleep)(PING_INTERVAL, true);
        if (client2._destroyed)
          break;
        if (client2._sender.isReconnecting || client2._isSwitchingDc) {
          lastPongAt = void 0;
          continue;
        }
        try {
          const ping = () => {
            return client2._sender.send(new tl_1.Api.PingDelayDisconnect({
              pingId: (0, Helpers_1.returnBigInt)((0, Helpers_1.getRandomInt)(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)),
              disconnectDelay: PING_DISCONNECT_DELAY
            }));
          };
          const pingAt = Date.now();
          const lastInterval = lastPongAt ? pingAt - lastPongAt : void 0;
          if (!lastInterval || lastInterval < PING_INTERVAL_TO_WAKE_UP) {
            await attempts(() => timeout(ping, PING_TIMEOUT), PING_FAIL_ATTEMPTS, PING_FAIL_INTERVAL);
          } else {
            let wakeUpWarningTimeout = setTimeout(() => {
              _handleUpdate(client2, network_1.UpdateConnectionState.disconnected);
              wakeUpWarningTimeout = void 0;
            }, PING_WAKE_UP_WARNING_TIMEOUT);
            await timeout(ping, PING_WAKE_UP_TIMEOUT);
            if (wakeUpWarningTimeout) {
              clearTimeout(wakeUpWarningTimeout);
              wakeUpWarningTimeout = void 0;
            }
            _handleUpdate(client2, network_1.UpdateConnectionState.connected);
          }
          lastPongAt = Date.now();
        } catch (err) {
          if (client2._errorHandler) {
            await client2._errorHandler(err);
          }
          if (client2._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(err);
          }
          lastPongAt = void 0;
          if (client2._sender.isReconnecting || client2._isSwitchingDc) {
            continue;
          }
          client2._sender.reconnect();
        }
        if (Date.now() - (client2._lastRequest || 0) > 30 * 60 * 1e3) {
          try {
            await client2.invoke(new tl_1.Api.updates.GetState());
          } catch (e) {
          }
          lastPongAt = void 0;
        }
      }
      await client2.disconnect();
    }
    exports2._updateLoop = _updateLoop;
    async function attempts(cb, times, pause) {
      for (let i = 0; i < times; i++) {
        try {
          return await cb();
        } catch (err) {
          if (i === times - 1) {
            throw err;
          }
          await (0, Helpers_1.sleep)(pause);
        }
      }
      return void 0;
    }
    function timeout(cb, ms) {
      let isResolved = false;
      return Promise.race([
        cb(),
        (0, Helpers_1.sleep)(ms).then(() => isResolved ? void 0 : Promise.reject(new Error("TIMEOUT")))
      ]).finally(() => {
        isResolved = true;
      });
    }
  }
});

// node_modules/telegram/client/chats.js
var require_chats = __commonJS({
  "node_modules/telegram/client/chats.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.kickParticipant = exports2.getParticipants = exports2.iterParticipants = exports2._ParticipantsIter = void 0;
    var Helpers_1 = require_Helpers();
    var requestIter_1 = require_requestIter();
    var __1 = require_telegram();
    var tl_1 = require_tl();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var inspect_1 = require_inspect();
    var Utils_1 = require_Utils();
    var _MAX_PARTICIPANTS_CHUNK_SIZE = 200;
    var _MAX_ADMIN_LOG_CHUNK_SIZE = 100;
    var _ChatAction = class {
      constructor(client2, chat, action, params = {
        delay: 4,
        autoCancel: true
      }) {
        this._client = client2;
        this._chat = chat;
        this._action = action;
        this._delay = params.delay;
        this.autoCancel = params.autoCancel;
        this._request = void 0;
        this._task = null;
        this._running = false;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      async start() {
        this._request = new tl_1.Api.messages.SetTyping({
          peer: this._chat,
          action: this._action
        });
        this._running = true;
        this._update();
      }
      async stop() {
        this._running = false;
        if (this.autoCancel) {
          await this._client.invoke(new tl_1.Api.messages.SetTyping({
            peer: this._chat,
            action: new tl_1.Api.SendMessageCancelAction()
          }));
        }
      }
      async _update() {
        while (this._running) {
          if (this._request != void 0) {
            await this._client.invoke(this._request);
          }
          await (0, Helpers_1.sleep)(this._delay * 1e3);
        }
      }
      progress(current, total) {
        if ("progress" in this._action) {
          this._action.progress = 100 * Math.round(current / total);
        }
      }
    };
    _ChatAction._str_mapping = {
      typing: new tl_1.Api.SendMessageTypingAction(),
      contact: new tl_1.Api.SendMessageChooseContactAction(),
      game: new tl_1.Api.SendMessageGamePlayAction(),
      location: new tl_1.Api.SendMessageGeoLocationAction(),
      "record-audio": new tl_1.Api.SendMessageRecordAudioAction(),
      "record-voice": new tl_1.Api.SendMessageRecordAudioAction(),
      "record-round": new tl_1.Api.SendMessageRecordRoundAction(),
      "record-video": new tl_1.Api.SendMessageRecordVideoAction(),
      audio: new tl_1.Api.SendMessageUploadAudioAction({ progress: 1 }),
      voice: new tl_1.Api.SendMessageUploadAudioAction({ progress: 1 }),
      song: new tl_1.Api.SendMessageUploadAudioAction({ progress: 1 }),
      round: new tl_1.Api.SendMessageUploadRoundAction({ progress: 1 }),
      video: new tl_1.Api.SendMessageUploadVideoAction({ progress: 1 }),
      photo: new tl_1.Api.SendMessageUploadPhotoAction({ progress: 1 }),
      document: new tl_1.Api.SendMessageUploadDocumentAction({ progress: 1 }),
      file: new tl_1.Api.SendMessageUploadDocumentAction({ progress: 1 }),
      cancel: new tl_1.Api.SendMessageCancelAction()
    };
    var _ParticipantsIter = class extends requestIter_1.RequestIter {
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      async _init({ entity, filter, offset: offset2, search, showTotal }) {
        var _a, _b;
        if (!offset2) {
          offset2 = 0;
        }
        if (filter && filter.constructor === Function) {
          if ([
            tl_1.Api.ChannelParticipantsBanned,
            tl_1.Api.ChannelParticipantsKicked,
            tl_1.Api.ChannelParticipantsSearch,
            tl_1.Api.ChannelParticipantsContacts
          ].includes(filter)) {
            filter = new filter({
              q: ""
            });
          } else {
            filter = new filter();
          }
        }
        entity = await this.client.getInputEntity(entity);
        const ty = __1.helpers._entityType(entity);
        if (search && (filter || ty != __1.helpers._EntityType.CHANNEL)) {
          search = search.toLowerCase();
          this.filterEntity = (entity2) => {
            return __1.utils.getDisplayName(entity2).toLowerCase().includes(search) || ("username" in entity2 ? entity2.username || "" : "").toLowerCase().includes(search);
          };
        } else {
          this.filterEntity = (entity2) => true;
        }
        this.requests = [];
        if (ty == __1.helpers._EntityType.CHANNEL) {
          if (showTotal) {
            const channel = await this.client.invoke(new tl_1.Api.channels.GetFullChannel({
              channel: entity
            }));
            if (!(channel.fullChat instanceof tl_1.Api.ChatFull)) {
              this.total = channel.fullChat.participantsCount;
            }
          }
          if (this.total && this.total <= 0) {
            return false;
          }
          this.requests.push(new tl_1.Api.channels.GetParticipants({
            channel: entity,
            filter: filter || new tl_1.Api.ChannelParticipantsSearch({
              q: search || ""
            }),
            offset: offset2,
            limit: _MAX_PARTICIPANTS_CHUNK_SIZE,
            hash: big_integer_1.default.zero
          }));
        } else if (ty == __1.helpers._EntityType.CHAT) {
          if (!("chatId" in entity)) {
            throw new Error("Found chat without id " + JSON.stringify(entity));
          }
          const full = await this.client.invoke(new tl_1.Api.messages.GetFullChat({
            chatId: entity.chatId
          }));
          if (full.fullChat instanceof tl_1.Api.ChatFull) {
            if (!(full.fullChat.participants instanceof tl_1.Api.ChatParticipantsForbidden)) {
              this.total = full.fullChat.participants.participants.length;
            } else {
              this.total = 0;
              return false;
            }
            const users = /* @__PURE__ */ new Map();
            for (const user of full.users) {
              users.set(user.id.toString(), user);
            }
            for (const participant of full.fullChat.participants.participants) {
              const user = users.get(participant.userId.toString());
              if (!this.filterEntity(user)) {
                continue;
              }
              user.participant = participant;
              (_a = this.buffer) === null || _a === void 0 ? void 0 : _a.push(user);
            }
            return true;
          }
        } else {
          this.total = 1;
          if (this.limit != 0) {
            const user = await this.client.getEntity(entity);
            if (this.filterEntity(user)) {
              user.participant = void 0;
              (_b = this.buffer) === null || _b === void 0 ? void 0 : _b.push(user);
            }
          }
          return true;
        }
      }
      async _loadNextChunk() {
        var _a, _b;
        if (!((_a = this.requests) === null || _a === void 0 ? void 0 : _a.length)) {
          return true;
        }
        this.requests[0].limit = Math.min(this.limit - this.requests[0].offset, _MAX_PARTICIPANTS_CHUNK_SIZE);
        const results = [];
        for (const request of this.requests) {
          results.push(await this.client.invoke(request));
        }
        for (let i = this.requests.length - 1; i >= 0; i--) {
          const participants = results[i];
          if (participants instanceof tl_1.Api.channels.ChannelParticipantsNotModified || !participants.users.length) {
            this.requests.splice(i, 1);
            continue;
          }
          this.requests[i].offset += participants.participants.length;
          const users = /* @__PURE__ */ new Map();
          for (const user of participants.users) {
            users.set(user.id.toString(), user);
          }
          for (const participant of participants.participants) {
            if (!("userId" in participant)) {
              continue;
            }
            const user = users.get(participant.userId.toString());
            if (this.filterEntity && !this.filterEntity(user)) {
              continue;
            }
            user.participant = participant;
            (_b = this.buffer) === null || _b === void 0 ? void 0 : _b.push(user);
          }
        }
        return void 0;
      }
      [Symbol.asyncIterator]() {
        return super[Symbol.asyncIterator]();
      }
    };
    exports2._ParticipantsIter = _ParticipantsIter;
    var _AdminLogIter = class extends requestIter_1.RequestIter {
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      async _init(entity, searchArgs, filterArgs) {
        let eventsFilter = void 0;
        if (filterArgs && Object.values(filterArgs).find((element) => element === true)) {
          eventsFilter = new tl_1.Api.ChannelAdminLogEventsFilter(Object.assign({}, filterArgs));
        }
        this.entity = await this.client.getInputEntity(entity);
        const adminList = [];
        if (searchArgs && searchArgs.admins) {
          for (const admin of searchArgs.admins) {
            adminList.push(await this.client.getInputEntity(admin));
          }
        }
        this.request = new tl_1.Api.channels.GetAdminLog({
          channel: this.entity,
          q: (searchArgs === null || searchArgs === void 0 ? void 0 : searchArgs.search) || "",
          minId: searchArgs === null || searchArgs === void 0 ? void 0 : searchArgs.minId,
          maxId: searchArgs === null || searchArgs === void 0 ? void 0 : searchArgs.maxId,
          limit: 0,
          eventsFilter,
          admins: adminList || void 0
        });
      }
      async _loadNextChunk() {
        if (!this.request) {
          return true;
        }
        this.request.limit = Math.min(this.left, _MAX_ADMIN_LOG_CHUNK_SIZE);
        const r = await this.client.invoke(this.request);
        const entities = /* @__PURE__ */ new Map();
        for (const entity of [...r.users, ...r.chats]) {
          entities.set(__1.utils.getPeerId(entity), entity);
        }
        const eventIds = [];
        for (const e of r.events) {
          eventIds.push(e.id);
        }
        this.request.maxId = (0, Helpers_1.getMinBigInt)([big_integer_1.default.zero, ...eventIds]);
        for (const ev of r.events) {
          if (ev.action instanceof tl_1.Api.ChannelAdminLogEventActionEditMessage) {
          }
        }
      }
    };
    function iterParticipants(client2, entity, { limit, offset: offset2, search, filter, showTotal = true }) {
      return new _ParticipantsIter(client2, limit !== null && limit !== void 0 ? limit : Number.MAX_SAFE_INTEGER, {}, {
        entity,
        filter,
        offset: offset2 !== null && offset2 !== void 0 ? offset2 : 0,
        search,
        showTotal
      });
    }
    exports2.iterParticipants = iterParticipants;
    async function getParticipants(client2, entity, params) {
      const it = client2.iterParticipants(entity, params);
      return await it.collect();
    }
    exports2.getParticipants = getParticipants;
    async function kickParticipant(client2, entity, participant) {
      const peer = await client2.getInputEntity(entity);
      const user = await client2.getInputEntity(participant);
      let resp;
      let request;
      const type = __1.helpers._entityType(peer);
      if (type === __1.helpers._EntityType.CHAT) {
        request = new tl_1.Api.messages.DeleteChatUser({
          chatId: (0, Helpers_1.returnBigInt)((0, Utils_1.getPeerId)(entity)),
          userId: (0, Helpers_1.returnBigInt)((0, Utils_1.getPeerId)(participant))
        });
        resp = await client2.invoke(request);
      } else if (type === __1.helpers._EntityType.CHANNEL) {
        if (user instanceof tl_1.Api.InputPeerSelf) {
          request = new tl_1.Api.channels.LeaveChannel({
            channel: peer
          });
          resp = await client2.invoke(request);
        } else {
          request = new tl_1.Api.channels.EditBanned({
            channel: peer,
            participant: user,
            bannedRights: new tl_1.Api.ChatBannedRights({
              untilDate: 0,
              viewMessages: true
            })
          });
          resp = await client2.invoke(request);
          await (0, Helpers_1.sleep)(500);
          await client2.invoke(new tl_1.Api.channels.EditBanned({
            channel: peer,
            participant: user,
            bannedRights: new tl_1.Api.ChatBannedRights({ untilDate: 0 })
          }));
        }
      } else {
        throw new Error("You must pass either a channel or a chat");
      }
      return client2._getResponseMessage(request, resp, entity);
    }
    exports2.kickParticipant = kickParticipant;
  }
});

// node_modules/telegram/tl/custom/draft.js
var require_draft = __commonJS({
  "node_modules/telegram/tl/custom/draft.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Draft = void 0;
    var Utils_1 = require_Utils();
    var api_1 = require_api();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var Draft = class {
      constructor(client2, entity, draft) {
        this._client = client2;
        this._peer = (0, Utils_1.getPeer)(entity);
        this._entity = entity;
        this._inputEntity = entity ? (0, Utils_1.getInputPeer)(entity) : void 0;
        if (!draft || !(draft instanceof api_1.Api.DraftMessage)) {
          draft = new api_1.Api.DraftMessage({
            message: "",
            date: -1
          });
        }
        if (!(draft instanceof api_1.Api.DraftMessageEmpty)) {
          this.linkPreview = !draft.noWebpage;
          this._text = client2.parseMode ? client2.parseMode.unparse(draft.message, draft.entities || []) : draft.message;
          this._rawText = draft.message;
          this.date = draft.date;
          const replyTo = draft.replyTo;
          if (replyTo != void 0) {
            if ("replyToMsgId" in replyTo) {
              this.replyToMsgId = replyTo.replyToMsgId;
            }
          }
        }
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      get entity() {
        return this._entity;
      }
      get inputEntity() {
        if (!this._inputEntity) {
          this._inputEntity = this._client._entityCache.get(this._peer);
        }
        return this._inputEntity;
      }
    };
    exports2.Draft = Draft;
  }
});

// node_modules/telegram/tl/custom/dialog.js
var require_dialog = __commonJS({
  "node_modules/telegram/tl/custom/dialog.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Dialog = void 0;
    var api_1 = require_api();
    var Utils_1 = require_Utils();
    var draft_1 = require_draft();
    var Helpers_1 = require_Helpers();
    var inspect_1 = require_inspect();
    var Dialog = class {
      constructor(client2, dialog, entities, message) {
        this._client = client2;
        this.dialog = dialog;
        this.pinned = !!dialog.pinned;
        this.folderId = dialog.folderId;
        this.archived = dialog.folderId != void 0;
        this.message = message;
        this.date = this.message.date;
        this.entity = entities.get((0, Utils_1.getPeerId)(dialog.peer));
        this.inputEntity = (0, Utils_1.getInputPeer)(this.entity);
        if (this.entity) {
          this.id = (0, Helpers_1.returnBigInt)((0, Utils_1.getPeerId)(this.entity));
          this.name = this.title = (0, Utils_1.getDisplayName)(this.entity);
        }
        this.unreadCount = dialog.unreadCount;
        this.unreadMentionsCount = dialog.unreadMentionsCount;
        if (!this.entity) {
          throw new Error("Entity not found for dialog");
        }
        this.draft = new draft_1.Draft(client2, this.entity, this.dialog.draft);
        this.isUser = this.entity instanceof api_1.Api.User;
        this.isGroup = !!(this.entity instanceof api_1.Api.Chat || this.entity instanceof api_1.Api.ChatForbidden || this.entity instanceof api_1.Api.Channel && this.entity.megagroup);
        this.isChannel = this.entity instanceof api_1.Api.Channel;
      }
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
    };
    exports2.Dialog = Dialog;
  }
});

// node_modules/telegram/client/dialogs.js
var require_dialogs = __commonJS({
  "node_modules/telegram/client/dialogs.js"(exports2) {
    "use strict";
    var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getDialogs = exports2.iterDialogs = exports2._DialogsIter = void 0;
    var tl_1 = require_tl();
    var requestIter_1 = require_requestIter();
    var index_1 = require_telegram();
    var dialog_1 = require_dialog();
    var big_integer_1 = __importDefault2(require_BigInteger());
    var Logger_1 = require_Logger();
    var _MAX_CHUNK_SIZE = 100;
    function _dialogMessageKey(peer, messageId) {
      return "" + [
        peer instanceof tl_1.Api.PeerChannel ? peer.channelId : void 0,
        messageId
      ];
    }
    var _DialogsIter = class extends requestIter_1.RequestIter {
      async _init({ offsetDate, offsetId, offsetPeer, ignorePinned, ignoreMigrated, folder }) {
        this.request = new tl_1.Api.messages.GetDialogs({
          offsetDate,
          offsetId,
          offsetPeer,
          limit: 1,
          hash: big_integer_1.default.zero,
          excludePinned: ignorePinned,
          folderId: folder
        });
        if (this.limit <= 0) {
          const dialogs = await this.client.invoke(this.request);
          if ("count" in dialogs) {
            this.total = dialogs.count;
          } else {
            this.total = dialogs.dialogs.length;
          }
          return true;
        }
        this.seen = /* @__PURE__ */ new Set();
        this.offsetDate = offsetDate;
        this.ignoreMigrated = ignoreMigrated;
      }
      [Symbol.asyncIterator]() {
        return super[Symbol.asyncIterator]();
      }
      async _loadNextChunk() {
        var _a;
        if (!this.request || !this.seen || !this.buffer) {
          return;
        }
        this.request.limit = Math.min(this.left, _MAX_CHUNK_SIZE);
        const r = await this.client.invoke(this.request);
        if (r instanceof tl_1.Api.messages.DialogsNotModified) {
          return;
        }
        if ("count" in r) {
          this.total = r.count;
        } else {
          this.total = r.dialogs.length;
        }
        const entities = /* @__PURE__ */ new Map();
        const messages = /* @__PURE__ */ new Map();
        for (const entity of [...r.users, ...r.chats]) {
          if (entity instanceof tl_1.Api.UserEmpty || entity instanceof tl_1.Api.ChatEmpty) {
            continue;
          }
          entities.set(index_1.utils.getPeerId(entity), entity);
        }
        for (const m of r.messages) {
          let message = m;
          try {
            if (message && "_finishInit" in message) {
              message._finishInit(this.client, entities, void 0);
            }
          } catch (e) {
            console.log("msg", message);
            this.client._log.error("Got error while trying to finish init message with id " + m.id);
            if (this.client._log.canSend(Logger_1.LogLevel.ERROR)) {
              console.error(e);
            }
            if (this.client._errorHandler) {
              await this.client._errorHandler(e);
            }
          }
          messages.set(_dialogMessageKey(message.peerId, message.id), message);
        }
        for (const d of r.dialogs) {
          if (d instanceof tl_1.Api.DialogFolder) {
            continue;
          }
          const message = messages.get(_dialogMessageKey(d.peer, d.topMessage));
          if (this.offsetDate != void 0) {
            const date = message === null || message === void 0 ? void 0 : message.date;
            if (date == void 0 || date > this.offsetDate) {
              continue;
            }
          }
          const peerId = index_1.utils.getPeerId(d.peer);
          if (!this.seen.has(peerId)) {
            this.seen.add(peerId);
            if (!entities.has(peerId)) {
              continue;
            }
            const cd = new dialog_1.Dialog(this.client, d, entities, message);
            if (!this.ignoreMigrated || cd.entity != void 0 && "migratedTo" in cd.entity) {
              this.buffer.push(cd);
            }
          }
        }
        if (r.dialogs.length < this.request.limit || !(r instanceof tl_1.Api.messages.DialogsSlice)) {
          return true;
        }
        let lastMessage;
        for (let dialog of r.dialogs.reverse()) {
          lastMessage = messages.get(_dialogMessageKey(dialog.peer, dialog.topMessage));
          if (lastMessage) {
            break;
          }
        }
        this.request.excludePinned = true;
        this.request.offsetId = lastMessage ? lastMessage.id : 0;
        this.request.offsetDate = lastMessage ? lastMessage.date : 0;
        this.request.offsetPeer = (_a = this.buffer[this.buffer.length - 1]) === null || _a === void 0 ? void 0 : _a.inputEntity;
      }
    };
    exports2._DialogsIter = _DialogsIter;
    function iterDialogs(client2, { limit = void 0, offsetDate = void 0, offsetId = 0, offsetPeer = new tl_1.Api.InputPeerEmpty(), ignorePinned = false, ignoreMigrated = false, folder = void 0, archived = void 0 }) {
      if (archived != void 0) {
        folder = archived ? 1 : 0;
      }
      return new _DialogsIter(client2, limit, {}, {
        offsetDate,
        offsetId,
        offsetPeer,
        ignorePinned,
        ignoreMigrated,
        folder
      });
    }
    exports2.iterDialogs = iterDialogs;
    async function getDialogs(client2, params) {
      return await client2.iterDialogs(params).collect();
    }
    exports2.getDialogs = getDialogs;
  }
});

// node_modules/telegram/client/2fa.js
var require_fa = __commonJS({
  "node_modules/telegram/client/2fa.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.updateTwoFaSettings = void 0;
    var Helpers_1 = require_Helpers();
    var Password_1 = require_Password();
    var tl_1 = require_tl();
    var index_1 = require_telegram();
    async function updateTwoFaSettings(client2, { isCheckPassword, currentPassword, newPassword, hint = "", email, emailCodeCallback, onEmailCodeError }) {
      if (!newPassword && !currentPassword) {
        throw new Error("Neither `currentPassword` nor `newPassword` is present");
      }
      if (email && !(emailCodeCallback && onEmailCodeError)) {
        throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");
      }
      const pwd = await client2.invoke(new tl_1.Api.account.GetPassword());
      if (!(pwd.newAlgo instanceof tl_1.Api.PasswordKdfAlgoUnknown)) {
        pwd.newAlgo.salt1 = Buffer.concat([
          pwd.newAlgo.salt1,
          (0, Helpers_1.generateRandomBytes)(32)
        ]);
      }
      if (!pwd.hasPassword && currentPassword) {
        currentPassword = void 0;
      }
      const password = currentPassword ? await (0, Password_1.computeCheck)(pwd, currentPassword) : new tl_1.Api.InputCheckPasswordEmpty();
      if (isCheckPassword) {
        await client2.invoke(new tl_1.Api.auth.CheckPassword({ password }));
        return;
      }
      if (pwd.newAlgo instanceof tl_1.Api.PasswordKdfAlgoUnknown) {
        throw new Error("Unknown password encryption method");
      }
      try {
        await client2.invoke(new tl_1.Api.account.UpdatePasswordSettings({
          password,
          newSettings: new tl_1.Api.account.PasswordInputSettings({
            newAlgo: pwd.newAlgo,
            newPasswordHash: newPassword ? await (0, Password_1.computeDigest)(pwd.newAlgo, newPassword) : Buffer.alloc(0),
            hint,
            email,
            // not explained what it does and it seems to always be set to empty in tdesktop
            newSecureSettings: void 0
          })
        }));
      } catch (e) {
        if (e instanceof index_1.errors.EmailUnconfirmedError) {
          while (true) {
            try {
              const code = await emailCodeCallback(e.codeLength);
              if (!code) {
                throw new Error("Code is empty");
              }
              await client2.invoke(new tl_1.Api.account.ConfirmPasswordEmail({ code }));
              break;
            } catch (err) {
              onEmailCodeError(err);
            }
          }
        } else {
          throw e;
        }
      }
    }
    exports2.updateTwoFaSettings = updateTwoFaSettings;
  }
});

// node_modules/telegram/events/NewMessage.js
var require_NewMessage = __commonJS({
  "node_modules/telegram/events/NewMessage.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.NewMessageEvent = exports2.NewMessage = void 0;
    var common_1 = require_common2();
    var tl_1 = require_tl();
    var Logger_1 = require_Logger();
    var NewMessage = class extends common_1.EventBuilder {
      constructor(newMessageParams = {}) {
        let { chats, func, incoming, outgoing, fromUsers, forwards, pattern, blacklistChats = false } = newMessageParams;
        if (incoming && outgoing) {
          incoming = outgoing = void 0;
        } else if (incoming != void 0 && outgoing == void 0) {
          outgoing = !incoming;
        } else if (outgoing != void 0 && incoming == void 0) {
          incoming = !outgoing;
        } else if (outgoing == false && incoming == false) {
          throw new Error("Don't create an event handler if you don't want neither incoming nor outgoing!");
        }
        super({ chats, blacklistChats, func });
        this.incoming = incoming;
        this.outgoing = outgoing;
        this.fromUsers = fromUsers;
        this.forwards = forwards;
        this.pattern = pattern;
        this._noCheck = [
          incoming,
          outgoing,
          chats,
          pattern,
          fromUsers,
          forwards,
          func
        ].every((v) => v == void 0);
      }
      async _resolve(client2) {
        await super._resolve(client2);
        this.fromUsers = await (0, common_1._intoIdSet)(client2, this.fromUsers);
      }
      build(update, callback, selfId) {
        if (update instanceof tl_1.Api.UpdateNewMessage || update instanceof tl_1.Api.UpdateNewChannelMessage) {
          if (!(update.message instanceof tl_1.Api.Message)) {
            return void 0;
          }
          const event = new NewMessageEvent(update.message, update);
          this.addAttributes(event);
          return event;
        } else if (update instanceof tl_1.Api.UpdateShortMessage) {
          return new NewMessageEvent(new tl_1.Api.Message({
            out: update.out,
            mentioned: update.mentioned,
            mediaUnread: update.mediaUnread,
            silent: update.silent,
            id: update.id,
            peerId: new tl_1.Api.PeerUser({ userId: update.userId }),
            fromId: new tl_1.Api.PeerUser({
              userId: update.out ? selfId : update.userId
            }),
            message: update.message,
            date: update.date,
            fwdFrom: update.fwdFrom,
            viaBotId: update.viaBotId,
            replyTo: update.replyTo,
            entities: update.entities,
            ttlPeriod: update.ttlPeriod
          }), update);
        } else if (update instanceof tl_1.Api.UpdateShortChatMessage) {
          return new NewMessageEvent(new tl_1.Api.Message({
            out: update.out,
            mentioned: update.mentioned,
            mediaUnread: update.mediaUnread,
            silent: update.silent,
            id: update.id,
            peerId: new tl_1.Api.PeerChat({ chatId: update.chatId }),
            fromId: new tl_1.Api.PeerUser({
              userId: update.out ? selfId : update.fromId
            }),
            message: update.message,
            date: update.date,
            fwdFrom: update.fwdFrom,
            viaBotId: update.viaBotId,
            replyTo: update.replyTo,
            entities: update.entities,
            ttlPeriod: update.ttlPeriod
          }), update);
        }
      }
      filter(event) {
        var _a;
        if (this._noCheck) {
          return event;
        }
        if (this.incoming && event.message.out) {
          return;
        }
        if (this.outgoing && !event.message.out) {
          return;
        }
        if (this.forwards != void 0) {
          if (this.forwards != !!event.message.fwdFrom) {
            return;
          }
        }
        if (this.fromUsers != void 0) {
          if (!event.message.senderId || !this.fromUsers.includes(event.message.senderId.toString())) {
            return;
          }
        }
        if (this.pattern) {
          const match = (_a = event.message.message) === null || _a === void 0 ? void 0 : _a.match(this.pattern);
          if (!match) {
            return;
          }
          event.message.patternMatch = match;
        }
        return super.filter(event);
      }
      addAttributes(update) {
      }
    };
    exports2.NewMessage = NewMessage;
    var NewMessageEvent = class extends common_1.EventCommon {
      constructor(message, originalUpdate) {
        super({
          msgId: message.id,
          chatPeer: message.peerId,
          broadcast: message.post
        });
        this.originalUpdate = originalUpdate;
        this.message = message;
      }
      _setClient(client2) {
        super._setClient(client2);
        const m = this.message;
        try {
          m._finishInit(client2, this.originalUpdate._entities || /* @__PURE__ */ new Map(), void 0);
        } catch (e) {
          client2._log.error("Got error while trying to finish init message with id " + m.id);
          if (client2._errorHandler) {
            client2._errorHandler(e);
          }
          if (client2._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(e);
          }
        }
      }
    };
    exports2.NewMessageEvent = NewMessageEvent;
  }
});

// node_modules/telegram/events/index.js
var require_events = __commonJS({
  "node_modules/telegram/events/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.NewMessageEvent = exports2.NewMessage = exports2.Raw = void 0;
    var Raw_1 = require_Raw();
    Object.defineProperty(exports2, "Raw", { enumerable: true, get: function() {
      return Raw_1.Raw;
    } });
    var NewMessage_1 = require_NewMessage();
    Object.defineProperty(exports2, "NewMessage", { enumerable: true, get: function() {
      return NewMessage_1.NewMessage;
    } });
    Object.defineProperty(exports2, "NewMessageEvent", { enumerable: true, get: function() {
      return NewMessage_1.NewMessageEvent;
    } });
  }
});

// node_modules/telegram/client/TelegramClient.js
var require_TelegramClient = __commonJS({
  "node_modules/telegram/client/TelegramClient.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.TelegramClient = void 0;
    var telegramBaseClient_1 = require_telegramBaseClient();
    var authMethods = __importStar2(require_auth());
    var botMethods = __importStar2(require_bots());
    var buttonsMethods = __importStar2(require_buttons());
    var downloadMethods = __importStar2(require_downloads());
    var parseMethods = __importStar2(require_messageParse());
    var messageMethods = __importStar2(require_messages2());
    var updateMethods = __importStar2(require_updates());
    var uploadMethods = __importStar2(require_uploads());
    var userMethods = __importStar2(require_users());
    var chatMethods = __importStar2(require_chats());
    var dialogMethods = __importStar2(require_dialogs());
    var twoFA = __importStar2(require_fa());
    var tl_1 = require_tl();
    var Utils_1 = require_Utils();
    var network_1 = require_network();
    var AllTLObjects_1 = require_AllTLObjects();
    var Helpers_1 = require_Helpers();
    var updates_1 = require_updates();
    var Logger_1 = require_Logger();
    var inspect_1 = require_inspect();
    var platform_1 = require_platform();
    var TelegramClient3 = class extends telegramBaseClient_1.TelegramBaseClient {
      /**
       * @param session - a session to be used to save the connection and auth key to. This can be a custom session that inherits MemorySession.
       * @param apiId - The API ID you obtained from https://my.telegram.org.
       * @param apiHash - The API hash you obtained from https://my.telegram.org.
       * @param clientParams - see {@link TelegramClientParams}
       */
      constructor(session, apiId, apiHash, clientParams) {
        super(session, apiId, apiHash, clientParams);
      }
      // region auth
      /**
       * Used to handle all aspects of connecting to telegram.<br/>
       * This method will connect to the telegram servers and check if the user is already logged in.<br/>
       * in the case of a new connection this will sign in if the phone already exists or sign up otherwise<br/>
       * By using this method you are **agreeing to Telegram's Terms of Service** https://core.telegram.org/api/terms.<br/>
       * this method also calls {@link getMe} to tell telegram that we want to receive updates.<br/>
       * @param authParams - see UserAuthParams and BotAuthParams
       * @return nothing
       * @example
       * ```ts
       * // this example assumes you've installed and imported the input package. npm i input.
       * // This package uses CLI to receive input from the user. you can use your own callback function.
       * import { TelegramClient } from "telegram";
       * import { StringSession } from "telegram/sessions";
       *
       * const client = new TelegramClient(new StringSession(''), apiId, apiHash, {});
       * // logging in as a bot account
       * await client.start(botToken="123456:abcdfgh123456789);
       * // logging in as a user account
       * await client.start({
       *   phoneNumber: async () => await input.text("number ?"),
       *   password: async () => await input.text("password?"),
       *   phoneCode: async () => await input.text("Code ?"),
       *   onError: (err) => console.log(err),
       * });
       * >Number ? +1234567897
       * >Code ? 12345
       * >password ? 111111
       * Logged in as user...
       *
       * You can now use the client instance to call other api requests.
       */
      start(authParams) {
        return authMethods.start(this, authParams);
      }
      /**
       * Checks whether the current client is authorized or not. (logged in as a user)
       * @example
       * ```ts
       * await client.connect();
       * if (await client.checkAuthorization()){
       *     console.log("I am logged in!");
       * }else{
       *     console.log("I am connected to telegram servers but not logged in with any account/bot");
       * }
       * ```
       * @return boolean (true of authorized else false)
       */
      checkAuthorization() {
        return authMethods.checkAuthorization(this);
      }
      /**
       * Logs in as a user. Should only be used when not already logged in.<br/>
       * This method will send a code when needed.<br/>
       * This will also sign up if needed.
       * @example
       * ```ts
       * await client.connect();
       * // we should only use this when we are not already authorized.
       * // This function is very similar to `client.start`
       * // The minor difference that start checks if already authorized and supports bots as well.
       * if (!await client.checkAuthorization()){
       *     const phoneNumber = "+123456789";
       *     await client.signIn({
       *         apiId:132456,
       *         apiHash:"132456",
       *     },{
       *     phoneNumber: async () => await input.text("number ?"),
       *     password: async () => await input.text("password?"),
       *     phoneCode: async () => await input.text("Code ?"),
       *     onError: (err) => console.log(err),
       *     })
       *  }
       * ```
       * @param apiCredentials - credentials to be used.
       * @param authParams - user auth params.
       */
      signInUser(apiCredentials, authParams) {
        return authMethods.signInUser(this, apiCredentials, authParams);
      }
      /**
       * logs the user using a QR code to be scanned.<br/>
       * this function generates the QR code that needs to be scanned by mobile.
       * @example
       * '''ts
       * await client.connect();
       * const user = await client.signInUserWithQrCode({ apiId, apiHash },
       * {
       *       onError: async function(p1: Error) {
       *           console.log("error", p1);
       *           // true = stop the authentication processes
       *           return true;
       *       },
       *       qrCode: async (code) => {
       *           console.log("Convert the next string to a QR code and scan it");
       *           console.log(
       *               `tg://login?token=${code.token.toString("base64url")}`
       *           );
       *       },
       *       password: async (hint) => {
       *           // password if needed
       *           return "1111";
       *       }
       *   }
       * );
       * console.log("user is", user);
       *
       * '''
       * @param apiCredentials - credentials to be used.
       * @param authParams - user auth params.
       */
      signInUserWithQrCode(apiCredentials, authParams) {
        return authMethods.signInUserWithQrCode(this, apiCredentials, authParams);
      }
      /**
       * Sends a telegram authentication code to the phone number.
       * @example
       * ```ts
       * await client.connect();
       * const {phoneCodeHash,isCodeViaApp} = await client.sendCode({
       *     apiId:1234,
       *     apiHash:"123456789abcfghj",
       * },"+123456798"});
       * ```
       * @param apiCredentials - credentials to be used.
       * @param phoneNumber - the phone number to send the code to
       * @param forceSMS - whether to send it as an SMS or a normal in app message
       * @return the phone code hash and whether it was sent via app
       */
      sendCode(apiCredentials, phoneNumber, forceSMS = false) {
        return authMethods.sendCode(this, apiCredentials, phoneNumber, forceSMS);
      }
      /**
       * Uses the 2FA password to sign in the account.<br/>
       * This function should be used after the user has signed in with the code they received.
       * @param apiCredentials - credentials to be used.
       * @param authParams - user auth params.
       * @returns the logged in user.
       */
      signInWithPassword(apiCredentials, authParams) {
        return authMethods.signInWithPassword(this, apiCredentials, authParams);
      }
      /**
       * Used to sign in as a bot.
       * @example
       * ```ts
       * await client.connect();
       * const bot = await client.signInBot({
       *     apiId:1234,
       *     apiHash:"12345",
       * },{
       *     botToken:"123456:abcdfghae4fg654",
       * });
       * // we are now logged in as a bot
       * console.log("Logged in",bot);
       * ```
       * @param apiCredentials - credentials to be used.
       * @param authParams - user auth params.
       * @return instance User of the logged in bot.
       */
      signInBot(apiCredentials, authParams) {
        return authMethods.signInBot(this, apiCredentials, authParams);
      }
      /**
           * Changes the 2FA settings of the logged in user.
           Note that this method may be *incredibly* slow depending on the
           prime numbers that must be used during the process to make sure
           that everything is safe.
      
           Has no effect if both current and new password are omitted.
      
           * @param client: The telegram client instance
           * @param isCheckPassword: Must be ``true`` if you want to check the current password
           * @param currentPassword: The current password, to authorize changing to ``new_password``.
           Must be set if changing existing 2FA settings.
           Must **not** be set if 2FA is currently disabled.
           Passing this by itself will remove 2FA (if correct).
           * @param newPassword: The password to set as 2FA.
           If 2FA was already enabled, ``currentPassword`` **must** be set.
           Leaving this blank or `undefined` will remove the password.
           * @param hint: Hint to be displayed by Telegram when it asks for 2FA.
           Must be set when changing or creating a new password.
           Has no effect if ``newPassword`` is not set.
           * @param email: Recovery and verification email. If present, you must also
           set `emailCodeCallback`, else it raises an Error.
           * @param emailCodeCallback: If an email is provided, a callback that returns the code sent
           to it must also be set. This callback may be asynchronous.
           It should return a string with the code. The length of the
           code will be passed to the callback as an input parameter.
           * @param onEmailCodeError: Called when an error happens while sending an email.
      
           If the callback returns an invalid code, it will raise an rpc error with the message
           ``CODE_INVALID``
      
           * @returns Promise<void>
           * @throws this method can throw:
           "PASSWORD_HASH_INVALID" if you entered a wrong password (or set it to undefined).
           "EMAIL_INVALID" if the entered email is wrong
           "EMAIL_HASH_EXPIRED" if the user took too long to verify their email
           */
      async updateTwoFaSettings({ isCheckPassword, currentPassword, newPassword, hint = "", email, emailCodeCallback, onEmailCodeError }) {
        return twoFA.updateTwoFaSettings(this, {
          isCheckPassword,
          currentPassword,
          newPassword,
          hint,
          email,
          emailCodeCallback,
          onEmailCodeError
        });
      }
      //endregion auth
      //region bot
      /**
       * Makes an inline query to the specified  bot and gets the result list.<br/>
       * This is equivalent to writing `@pic something` in clients
       * @param bot - the bot entity to which the inline query should be made
       * @param query - the query string that should be made for that bot (up to 512 characters). can be empty
       * @param entity - The entity where the inline query is being made from.<br/>
       * Certain bots use this to display different results depending on where it's used, such as private chats, groups or channels.<br/>
       * If specified, it will also be the default entity where the message will be sent after clicked.<br/>
       * Otherwise, the “empty peer” will be used, which some bots may not handle correctly.
       * @param offset - String offset of the results to be returned. can be empty
       * @param geoPoint - The geo point location information to send to the bot for localised results. Available under some bots.
       * @return a list of InlineResults
       * @example
       * ```ts
       * // Makes the query to @pic
       * const results = await client.inlineQuery("pic", "something");
       * // clicks on the first result
       * await results[0].click();
       * ```
       */
      inlineQuery(bot, query, entity, offset2, geoPoint) {
        return botMethods.inlineQuery(this, bot, query, entity, offset2, geoPoint);
      }
      //endregion
      //region buttons
      /**
           * Builds a ReplyInlineMarkup or ReplyKeyboardMarkup for the given buttons.<br/><br/>
           * Does nothing if either no buttons are provided or the provided argument is already a reply markup.<br/><br/>
           * this function is called internally when passing an array of buttons.
      
           * @param buttons - The button, array of buttons, array of array of buttons or markup to convert into a markup.
           * @param inlineOnly - Whether the buttons **must** be inline buttons only or not.
           * @example
           * ```ts
           * import {Button} from "telegram/tl/custom/button";
           *  // PS this function is not async
           * const markup = client.buildReplyMarkup(Button.inline("Hello!"));
           *
           * await client.sendMessage(chat, {
           *     message: "click me!",
           *     buttons: markup,
           * }
           *
           * // The following example can also be used in a simpler way like so
           *
           * await client.sendMessage(chat, {
           *     message: "click me!",
           *     buttons: [Button.inline("Hello!")],
           * }
           * ```
           */
      buildReplyMarkup(buttons, inlineOnly = false) {
        return buttonsMethods.buildReplyMarkup(buttons, inlineOnly);
      }
      //endregion
      //region download
      /**
       * Low-level method to download files from their input location.
       * downloadMedia should generally be used over this.
       * @param inputLocation - The file location from which the file will be downloaded. See getInputLocation source for a complete list of supported types.
       * @param fileParams - {@link DownloadFileParams}
       * @return a Buffer downloaded from the inputFile.
       * @example
       * ```ts
       * const photo = message.photo;
       * const buffer = await client.downloadFile(
       *       new Api.InputPhotoFileLocation({
       *          id: photo.id,
       *          accessHash: photo.accessHash,
       *          fileReference: photo.fileReference,
       *          thumbSize: size.type
       *      }),
       *      {
       *          dcId: photo.dcId,
       *          fileSize: "m",
       *      }
       * );
       * ```
       */
      downloadFile(inputLocation, fileParams = {}) {
        return downloadMethods.downloadFileV2(this, inputLocation, fileParams);
      }
      /**
       * Iterates over a file download, yielding chunks of the file.
       * This method can be used to stream files in a more convenient way, since it offers more control (pausing, resuming, etc.)
       * @param iterFileParams - {@link IterDownloadFunction}
       * @return a Buffer downloaded from the inputFile.
       * @example
       * ```ts
       * const photo = message.photo;
       * for await (const chunk of client.iterDownload({
       *       file: new Api.InputPhotoFileLocation({
       *          id: photo.id,
       *          accessHash: photo.accessHash,
       *          fileReference: photo.fileReference,
       *          thumbSize: size.type
       *      }),
       *      offset: start,
       *      limit: end,
       *      requestSize:2048*1024
       * )){
       *     console.log("Downloaded chunk of size",chunk.length);
       * };
       * ```
       */
      iterDownload(iterFileParams) {
        return downloadMethods.iterDownload(this, iterFileParams);
      }
      //region download
      /**
       * Downloads the profile photo from the given user,chat or channel.<br/>
       * This method will return an empty buffer in case of no profile photo.
       * @param entity - where to download the photo from.
       * @param downloadProfilePhotoParams - {@link DownloadProfilePhotoParams}
       * @return buffer containing the profile photo. can be empty in case of no profile photo.
       * @example
       * ```ts
       * // Download your own profile photo
       * const buffer = await client.downloadProfilePhoto('me')
       * console.log("Downloaded image is",buffer);
       * // if you want to save it as a file you can use the fs module on node for that.
       * import { promises as fs } from 'fs';
       * await fs.writeFile("picture.jpg",buffer);
       * ```
       */
      downloadProfilePhoto(entity, downloadProfilePhotoParams = {
        isBig: false
      }) {
        return downloadMethods.downloadProfilePhoto(this, entity, downloadProfilePhotoParams);
      }
      /**
       * Downloads the given media from a message or a media object.<br/>
       * this will return an empty Buffer in case of wrong or empty media.
       * @param messageOrMedia - instance of a message or a media.
       * @param downloadParams {@link DownloadMediaInterface}
       * @return a buffer containing the downloaded data if outputFile is undefined else nothing.
       * @example ```ts
       * const buffer = await client.downloadMedia(message, {})
       * // to save it to a file later on using fs.
       * import { promises as fs } from 'fs';
       * await fs.writeFile("file",buffer);
       * // to use a progress callback you can pass it like so.
       * const buffer = await client.downloadMedia(message, {
       *     progressCallback : console.log
       * })
       * ```
       */
      downloadMedia(messageOrMedia, downloadParams) {
        return downloadMethods.downloadMedia(this, messageOrMedia, downloadParams === null || downloadParams === void 0 ? void 0 : downloadParams.outputFile, downloadParams === null || downloadParams === void 0 ? void 0 : downloadParams.thumb, downloadParams === null || downloadParams === void 0 ? void 0 : downloadParams.progressCallback);
      }
      //endregion
      //region message parse
      /**
       * This property is the default parse mode used when sending messages. Defaults to {@link MarkdownParser}.<br/>
       * It will always be either undefined or an object with parse and unparse methods.<br/>
       * When setting a different value it should be one of:<br/>
       *<br/>
       *  - Object with parse and unparse methods.<br/>
       *  - A str indicating the parse_mode. For Markdown 'md' or 'markdown' may be used. For HTML, 'html' may be used.<br/>
       * The parse method should be a function accepting a single parameter, the text to parse, and returning a tuple consisting of (parsed message str, [MessageEntity instances]).<br/>
       * <br/>
       * The unparse method should be the inverse of parse such that text == unparse(parse(text)).<br/>
       * <br/>
       * See {@link Api.TypeMessageEntity} for allowed message entities.
       * @example
       * ```ts
       * // gets the current parse mode.
       * console.log("parse mode is :",  client.parseMode)
       * ```
       */
      get parseMode() {
        return this._parseMode;
      }
      /** Setter for parseMode.
       * {@link parseMode}
       * @param mode can be md,markdown for Markdown or html for html. can also pass a custom mode.
       * pass undefined for no parsing.
       * @example
       * // sets the mode to HTML
       * client.setParseMode("html");
       * await client.sendMessage("me",{message:"<u>This is an underline text</u>"});
       * // disable formatting
       * client.setParseMode(undefined);
       * await client.sendMessage("me",{message:"<u> this will be sent as it is</u> ** with no formatting **});
       */
      setParseMode(mode) {
        if (mode) {
          this._parseMode = (0, Utils_1.sanitizeParseMode)(mode);
        } else {
          this._parseMode = void 0;
        }
      }
      //endregion
      // region messages
      /**
       * Iterates over the messages for a given chat.
       * <br/>
       * The default order is from newest to oldest but can be changed with the reverse param.<br/>
       * If either `search`, `filter` or `fromUser` are provided this will use {@link Api.messages.Search} instead of {@link Api.messages.GetHistory}.
       * @remarks
       * Telegram limits GetHistory requests every 10 requests (1 000 messages) therefore a sleep of 1 seconds will be the default for this limit.
       * @param entity - The entity from whom to retrieve the message history.<br/>
       * It may be undefined to perform a global search, or to get messages by their ID from no particular chat<br/>
       * **Note** that some of the offsets will not work if this is the case.<br/>
       * **Note** that if you want to perform a global search, you must set a non-empty search string, a filter. or fromUser.
       * @param iterParams - {@link IterMessagesParams}
       * @yield Instances of custom {@link Message}
       * @example
       * ```ts
       * // From most-recent to oldest
       * for await (const message of client.iterMessages(chat,{}){
       *    console.log(message.id, message.text)
       * }
       *
       * // From oldest to most-recent
       * for await (const message of client.iterMessages(chat,{reverse:true}){
       *    console.log(message.id, message.text)
       * }
       *
       * // Filter by sender
       * for await (const message of client.iterMessages(chat,{fromUser:"me"}){
       *    console.log(message.id, message.text)
       * }
       *
       * // Server-side search with fuzzy text
       * for await (const message of client.iterMessages(chat,{search:"hello"}){
       *    console.log(message.id, message.text)
       * }
       *
       * // Filter by message type:
       * import { Api } from "telegram";
       * for await (const message of client.iterMessages(chat,{filter: Api.InputMessagesFilterPhotos}){
       *    console.log(message.id, message.photo)
       * }
       *
       * // Getting comments from a post in a channel:
       *  * for await (const message of client.iterMessages(chat,{replyTo: 123}){
       *    console.log(message.chat.title,, message.text)
       * }
       * ```
       */
      iterMessages(entity, iterParams = {}) {
        return messageMethods.iterMessages(this, entity, iterParams);
      }
      /**
       * Same as iterMessages() but returns a TotalList instead.<br/>
       * if the `limit` is not set, it will be 1 by default unless both `minId` **and** `maxId` are set. in which case the entire  range will be returned.<br/>
       * @param entity - The entity from whom to retrieve the message history. see {@link iterMessages}.<br/>
       * @param getMessagesParams - see {@link IterMessagesParams}.
       * @return {@link TotalList} of messages.
       * @example
       * ```ts
       * // The totalList has a .total attribute which will show the complete number of messages even if none are fetched.
       * // Get 0 photos and print the total to show how many photos there are
       * import { Api } from "telegram";
       * const photos = await client.getMessages(chat, {limit: 0, filter:Api.InputMessagesFilterPhotos})
       * console.log(photos.total)
       *
       * // Get all the photos
       * const photos = await client.getMessages(chat, {limit: undefined, filter:Api.InputMessagesFilterPhotos})
       *
       // Get messages by ID:
       * const messages = await client.getMessages(chat, {ids:1337})
       * const message_1337 = messages[0];
       * ```
       */
      getMessages(entity, getMessagesParams = {}) {
        return messageMethods.getMessages(this, entity, getMessagesParams);
      }
      /**
       * Sends a message to the specified user, chat or channel.<br/>
       * The default parse mode is the same as the official applications (a custom flavour of markdown). **bold**, `code` or __italic__ are available.<br/>
       * In addition you can send [links](https://example.com) and [mentions](@username) (or using IDs like in the Bot API: [mention](tg://user?id=123456789)) and pre blocks with three backticks.<br/>
       * <br/>
       * Sending a /start command with a parameter (like ?start=data) is also done through this method. Simply send '/start data' to the bot.<br/>
       * <br/>
       * See also Message.respond() and Message.reply().
       *
       * @param entity - Who to sent the message to.
       * @param sendMessageParams - see {@link SendMessageParams}
       * @return
       * The sent custom Message.
       * @example
       * ```ts
       * // Markdown is the default.
       * await client.sendMessage("me",{message:"Hello **world!**});
       *
       * // Defaults to another parse mode.
       * client.setParseMode("HTML");
       *
       * await client.sendMessage('me', {message:'Some <b>bold</b> and <i>italic</i> text'})
       * await client.sendMessage('me', {message:'An <a href="https://example.com">URL</a>'})
       * await client.sendMessage('me', {message:'<a href="tg://user?id=me">Mentions</a>'})
       *
       * // Explicit parse mode.
       * //  No parse mode by default
       * client.setParseMode(undefined);
       * //...but here I want markdown
       * await client.sendMessage('me', {message:'Hello, **world**!', {parseMode:"md"}})
       *
       * // ...and here I need HTML
       * await client.sendMessage('me', {message:'Hello, <i>world</i>!', {parseMode='html'}})
       *
       *
       * // Scheduling a message to be sent after 5 minutes
       *
       * await client.sendMessage(chat, {message:'Hi, future!', schedule:(60 * 5) + (Date.now() / 1000)})
       *
       * ```
       */
      sendMessage(entity, sendMessageParams = {}) {
        return messageMethods.sendMessage(this, entity, sendMessageParams);
      }
      /**
       * Forwards the given messages to the specified entity.<br/>
       *<br/>
       * If you want to "forward" a message without the forward header
       * (the "forwarded from" text), you should use `sendMessage` with
       * the original message instead. This will send a copy of it.
       *<br/>
       * See also {@link Message.forwardTo}`.
       * @param entity - To which entity the message(s) will be forwarded.
       * @param forwardMessagesParams - see {@link ForwardMessagesParams}
       * @return The list of forwarded Message, Note.<br/>
       * if some messages failed to be forwarded the returned list will have them as undefined.
       * @example ```ts
       * // a single one
       * await client.forwardMessages(chat, {messages: message});
       * // or
       * await client.forwardMessages(chat, {messages:messageId,fromPeer:fromChat});
       * // or
       * await message.forwardTo(chat)
       *
       * // multiple
       * await client.forwardMessages(chat, {messages:messages});
       * // or
       * await client.forwardMessages(chat,  {messages:messageIds,fromPeer:fromChat});
       *
       * // Forwarding as a copy
       * await client.sendMessage(chat, {message:message});
       * ```
       */
      forwardMessages(entity, forwardMessagesParams) {
        return messageMethods.forwardMessages(this, entity, forwardMessagesParams);
      }
      /**
       *  Used to edit a message by changing it's text or media
       *  message refers to the message to be edited not what to edit
       *  text refers to the new text
       *  See also Message.edit()<br/>
       *  Notes: It is not possible to edit the media of a message that doesn't contain media.
       *  @param entity - From which chat to edit the message.<br/>
       *  This can also be the message to be edited, and the entity will be inferred from it, so the next parameter will be assumed to be the message text.<br/>
       *  You may also pass a InputBotInlineMessageID, which is the only way to edit messages that were sent after the user selects an inline query result. Not supported yet!
       *  @param editMessageParams - see {@link EditMessageParams}.
       *  @return The edited Message.
       *  @throws
       *  `MESSAGE_AUTHOR_REQUIRED` if you're not the author of the message but tried editing it anyway.
       *  `MESSAGE_NOT_MODIFIED` if the contents of the message were not modified at all.
       *  `MESSAGE_ID_INVALID` if the ID of the message is invalid (the ID itself may be correct, but the message with that ID cannot be edited).<br/>
       *  For example, when trying to edit messages with a reply markup (or clear markup) this error will be raised.
       *  @example
       *  ```ts
       *  const message = await client.sendMessage(chat,{message:"Hi!"});
       *
       *  await client.editMessage(chat,{message:message,text:"Hello!"}
       *  // or
       *  await client.editMessage(chat,{message:message.id,text:"Hello!"}
       *  ```
       */
      editMessage(entity, editMessageParams) {
        return messageMethods.editMessage(this, entity, editMessageParams);
      }
      /**
       * Deletes the given messages, optionally "for everyone".
       *
       * See also {@link Message.delete}`.
       *
       * @remarks This method does **not** validate that the message IDs belong to the chat that you passed! It's possible for the method to delete messages from different private chats and small group chats at once, so make sure to pass the right IDs.
       * @param entity - From who the message will be deleted. This can actually be `undefined` for normal chats, but **must** be present for channels and megagroups.
       * @param messageIds - The IDs (or ID) or messages to be deleted.
       * @param revoke - Whether the message should be deleted for everyone or not.
       * By default it has the opposite behaviour of official clients,
       * and it will delete the message for everyone.
       * Disabling this has no effect on channels or megagroups,
       * since it will unconditionally delete the message for everyone.
       * @return
       * A list of {@link AffectedMessages}, each item being the result for the delete calls of the messages in chunks of 100 each.
       * @example
       *  ```ts
       *  await client.deleteMessages(chat, messages);
       *
       *  await client.deleteMessages(chat, messages, {revoke:false});
       *  ```
       */
      deleteMessages(entity, messageIds, { revoke = true }) {
        return messageMethods.deleteMessages(this, entity, messageIds, {
          revoke
        });
      }
      pinMessage(entity, message, pinMessageParams) {
        return messageMethods.pinMessage(this, entity, message, pinMessageParams);
      }
      unpinMessage(entity, message, unpinMessageParams) {
        return messageMethods.unpinMessage(this, entity, message, unpinMessageParams);
      }
      /**
       * Marks messages as read and optionally clears mentions. <br/>
       * This effectively marks a message as read (or more than one) in the given conversation. <br />
       * If a message or maximum ID is provided, all the messages up to and
       * including such ID will be marked as read (for all messages whose ID ≤ max_id).
       *
       * See also {@link Message.markRead}`.
       *
       * @remarks If neither message nor maximum ID are provided, all messages will be marked as read by assuming that `max_id = 0`.
       * @param entity - The chat where the message should be pinned.
       * @param message - The message or the message ID to pin. If it's `undefined`, all messages will be unpinned instead.
       * @param markAsReadParams - see {@link MarkAsReadParams}.
       * @return boolean
       * @example
       *  ```ts
       *  // using a Message object
       *  const message = await client.sendMessage(chat, 'GramJS is awesome!');
       *  await client.markAsRead(chat, message)
       *  // ...or using the int ID of a Message
       *  await client.markAsRead(chat, message.id);
       *
       *  // ...or passing a list of messages to mark as read
       *  await client.markAsRead(chat, messages)
       *  ```
       */
      markAsRead(entity, message, markAsReadParams) {
        return messageMethods.markAsRead(this, entity, message, markAsReadParams);
      }
      //endregion
      //region dialogs
      /**
       * Iterator over the dialogs (open conversations/subscribed channels) sequentially.<br/>
       * The order is the same as the one seen in official applications. (dialogs that had recent messages come first)
       * @param iterDialogsParams - see {@link IterDialogsParams}
       * @yield instances of custom {@link Dialog}.
       * @example
       * ```ts
       * // logs all dialog IDs and their title.
       * for await (const dialog of client.iterDialogs({})){
       *     console.log(`${dialog.id}: ${dialog.title}`);
       * }
       * ```
       */
      iterDialogs(iterDialogsParams = {}) {
        return dialogMethods.iterDialogs(this, iterDialogsParams);
      }
      /**
       * Same as iterDialogs but returns a TotalList instead of an iterator.
       * @param params - {@link IterDialogsParams}
       * @example
       * ```ts
       * // Get all open conversation, print the title of the first
       * const dialogs = await client.getDialogs({});
       * const first = dialogs[0];
       * console.log(first.title);
       * <br/>
       * // Use the dialog somewhere else
       * await client.sendMessage(first, {message: "hi"});
       * <br/>
       * // Getting only non-archived dialogs (both equivalent)
       * non_archived = await client.get_dialogs({folder:0})
       * non_archived = await client.get_dialogs({archived:false})
       * <br/>
       * // Getting only archived dialogs (both equivalent)
       * archived = await client.get_dialogs({folder:1})
       * archived = await client.get_dialogs({archived:true})
       * ```
       */
      getDialogs(params = {}) {
        return dialogMethods.getDialogs(this, params);
      }
      //endregion
      //region chats
      /**
       * Iterates over the participants belonging to a specified chat , channel or supergroup.<br/>
       * <br/>
       * Channels can return a maximum of 200 users while supergroups can return up to 10 000.<br/>
       * You must be an admin to retrieve users from a channel.<br/>
       * @param entity - The entity from which to retrieve the participants list.
       * @param params - {@link IterParticipantsParams}
       * @remarks
       * The filter ChannelParticipantsBanned will return restricted users. If you want banned users you should use ChannelParticipantsKicked instead.
       * @yield The User objects returned by GetParticipants with an additional .participant attribute<br/>
       *     which is the matched ChannelParticipant type for channels/supergroup or ChatParticipants for normal chats.
       * @example
       * ```ts
       * // logs all user IDs in a chat.
       * for await (const user of client.iterParticipants(chat)){
       *     console.log("User id",user.id);
       * }
       *
       * // Searches by name.
       * for await (const user of client.iterParticipants(chat, {search: "name"})){
       *     console.log("Username is ",user.username); // Some users don't have a username so this can be undefined.
       * }
       *
       * // Filter by admins.
       * import { Api } from "telegram";
       *
       * for await (const user of client.iterParticipants(chat, {filter:  Api.ChannelParticipantsAdmins})){
       *     console.log("admin first name is ",user.firstName);
       * }
       * ```
       */
      iterParticipants(entity, params = {}) {
        return chatMethods.iterParticipants(this, entity, params);
      }
      /**
       * Exact same as iterParticipants but returns a TotalList instead.<br/>
       * This can be used if you want to retrieve a list instead of iterating over the users.
       * @param entity - entity to get users from.
       * @param params - {@link IterParticipantsParams}.
       * @return
       */
      getParticipants(entity, params = {}) {
        return chatMethods.getParticipants(this, entity, params);
      }
      /**
       * Kicks a user from a chat.
       *
       * Kicking yourself (`'me'`) will result in leaving the chat.
       *
       * @note
       * Attempting to kick someone who was banned will remove their
       * restrictions (and thus unbanning them), since kicking is just
       * ban + unban.
       *
       * @example
       * // Kick some user from some chat, and deleting the service message
       * const msg = await client.kickParticipant(chat, user);
       * await msg.delete();
       *
       * // Leaving chat
       * await client.kickParticipant(chat, 'me');
       */
      kickParticipant(entity, participant) {
        return chatMethods.kickParticipant(this, entity, participant);
      }
      //endregion
      //region updates
      /** TODO */
      on(event) {
        return updateMethods.on(this, event);
      }
      addEventHandler(callback, event) {
        return updateMethods.addEventHandler(this, callback, event);
      }
      /**
       * Inverse operation of addEventHandler().<br>
       *
       * @param callback - the callback function to be removed.
       * @param event - the type of the event.
       */
      removeEventHandler(callback, event) {
        return updateMethods.removeEventHandler(this, callback, event);
      }
      /**
       * Lists all registered event handlers.
       * @return pair of [eventBuilder,CallableFunction]
       */
      listEventHandlers() {
        return updateMethods.listEventHandlers(this);
      }
      // region uploads
      /**
       * Uploads a file to Telegram's servers, without sending it.
       * @remarks generally it's better to use {@link sendFile} instead.
       * This method returns a handle (an instance of InputFile or InputFileBig, as required) which can be later used before it expires (they are usable during less than a day).<br/>
       * Uploading a file will simply return a "handle" to the file stored remotely in the Telegram servers,
       * which can be later used on. This will not upload the file to your own chat or any chat at all.
       * This also can be used to update profile pictures
       * @param fileParams see {@link UploadFileParams}
       * @return {@link Api.InputFileBig} if the file size is larger than 10mb otherwise {@link Api.InputFile}
       * @example
       * ```ts
       * import { CustomFile } from "telegram/client/uploads";
       * const toUpload = new CustomFile("photo.jpg", fs.statSync("../photo.jpg").size, "../photo.jpg");
       * const file = await client.uploadFile({
       *  file: toUpload,
       *  workers: 1,
       *  });
       *  await client.invoke(new Api.photos.UploadProfilePhoto({
       *      file: file,
       *  }));
       * ```
       */
      uploadFile(fileParams) {
        return uploadMethods.uploadFile(this, fileParams);
      }
      /**
       * Sends message with the given file to the specified entity.
       * This uses {@link uploadFile} internally so if you want more control over uploads you can use that.
       * @param entity - who will receive the file.
       * @param sendFileParams - see {@link SendFileInterface}
       * @example
       * ```
       * // Normal files like photos
       * await client.sendFile(chat, {file:'/my/photos/me.jpg', caption:"It's me!"})
       * // or
       * await client.sendMessage(chat, {message:"It's me!", file:'/my/photos/me.jpg'})
       *
       * Voice notes or round videos
       * await client.sendFile(chat, {file: '/my/songs/song.mp3', voiceNote:True})
       * await client.sendFile(chat, {file: '/my/videos/video.mp4', videoNote:True})
       *
       * // Custom thumbnails
       * await client.sendFile(chat, {file:'/my/documents/doc.txt', thumb:'photo.jpg'})
       *
       * // Only documents
       * await client.sendFile(chat, {file:'/my/photos/photo.png', forceDocument:True})
       *
       * //logging progress
       * await client.sendFile(chat, {file: file, progressCallback=console.log})
       *
       * // Dices, including dart and other future emoji
       * await client.sendFile(chat, {file:new Api.InputMediaDice("")})
       * await client.sendFile(chat, {file:new Api.InputMediaDice("🎯")})
       *
       * // Contacts
       * await client.sendFile(chat, {file: new Api.InputMediaContact({
       *  phoneNumber:'+1 123 456 789',
       *  firstName:'Example',
       *  lastName:'',
       *  vcard:''
       *  }))
       * ```
       */
      sendFile(entity, sendFileParams) {
        return uploadMethods.sendFile(this, entity, sendFileParams);
      }
      // endregion
      //region user methods
      /**
       * invokes raw Telegram requests.<br/>
       * This is a low level method that can be used to call manually any Telegram API method.<br/>
       * Generally this should only be used when there isn't a friendly method that does what you need.<br/>
       * All available requests and types are found under the `Api.` namespace.
       * @param request - The request to send. this should be of type request.
       * @param dcId - Optional dc id to use when sending.
       * @return The response from Telegram.
       * @example
       * ```ts
       * //
       * const result = await client.invoke(new Api.account.CheckUsername({
       *      username: 'some string here'
       *   }));
       * console.log("does this username exist?",result);
       *
       * ```
       */
      invoke(request, dcId) {
        return userMethods.invoke(this, request, dcId);
      }
      invokeWithSender(request, sender) {
        return userMethods.invoke(this, request, void 0, sender);
      }
      getMe(inputPeer = false) {
        return userMethods.getMe(this, inputPeer);
      }
      /**
       * Return true if the signed-in user is a bot, false otherwise.
       * @example
       * ```ts
       * if (await client.isBot()){
       *     console.log("I am a bot. PI is 3.14159265359);
       * } else {
       *     console.log("I am a human. Pies are delicious);
       * }
       * ```
       */
      isBot() {
        return userMethods.isBot(this);
      }
      /**
       * Returns true if the user is authorized (logged in).
       * @example
       * if (await client.isUserAuthorized()){
       *     console.log("I am authorized. I can call functions and use requests");
       * }else{
       *     console.log("I am not logged in. I need to sign in first before being able to call methods");
       * }
       */
      isUserAuthorized() {
        return userMethods.isUserAuthorized(this);
      }
      getEntity(entity) {
        return userMethods.getEntity(this, entity);
      }
      /**
       * Turns the given entity into its input entity version.<br/>
       * Almost all requests use this kind of InputPeer, so this is the most suitable call to make for those cases.<br/>
       * **Generally you should let the library do its job** and don't worry about getting the input entity first, but if you're going to use an entity often, consider making the call.
       * @param entity - If a username or invite link is given, the library will use the cache.<br/>
       * This means that it's possible to be using a username that changed or an old invite link (this only happens if an invite link for a small group chat is used after it was upgraded to a mega-group).
       *<br/>
       *  - If the username or ID from the invite link is not found in the cache, it will be fetched. The same rules apply to phone numbers ('+34 123456789') from people in your contact list.
       *<br/>
       *  - If an exact name is given, it must be in the cache too. This is not reliable as different people can share the same name and which entity is returned is arbitrary,<br/>
       *  and should be used only for quick tests.
       *<br/>
       *  - If a positive integer ID is given, the entity will be searched in cached users, chats or channels, without making any call.
       *<br/>
       *  - If a negative integer ID is given, the entity will be searched exactly as either a chat (prefixed with -) or as a channel (prefixed with -100).
       *<br/>
       *  - If a Peer is given, it will be searched exactly in the cache as either a user, chat or channel.
       *<br/>
       *  - If the given object can be turned into an input entity directly, said operation will be done.
       *<br/>
       *  -If the entity can't be found, this will throw an error.
       * @return
       * {@link Api.InputPeerUser} , {@link Api.InputPeerChat} , {@link Api.InputPeerChannel} or {@link Api.InputPeerSelf} if the parameter  is "me" or "self"
       * @example
       * ```ts
       * // If you're going to use "username" often in your code
       * // (make a lot of calls), consider getting its input entity
       * // once, and then using the "user" everywhere instead.
       * user = await client.getInputEntity('username')
       *
       * // The same applies to IDs, chats or channels.
       * chat = await client.getInputEntity(-123456789)
       * ```
       */
      getInputEntity(entity) {
        return userMethods.getInputEntity(this, entity);
      }
      /**
       * Gets the ID for the given entity.<br/>
       * This method needs to be async because peer supports usernames, invite-links, phone numbers (from people in your contact list), etc.<br/>
       * <br/>
       * If addMark is false, then a positive ID will be returned instead. By default, bot-API style IDs (signed) are returned.
       * @param peer
       * @param addMark - whether to return a bot api style id.
       * @return the ID of the entity.
       * @example
       * ```ts
       * console.log(await client.getPeerId("me"));
       * ```
       */
      getPeerId(peer, addMark = true) {
        return userMethods.getPeerId(this, peer, addMark);
      }
      /** @hidden */
      _getInputDialog(peer) {
        return userMethods._getInputDialog(this, peer);
      }
      /** @hidden */
      _getInputNotify(notify) {
        return userMethods._getInputNotify(this, notify);
      }
      //endregion
      /** @hidden */
      async _handleReconnect() {
        this._log.info("Handling reconnect!");
        try {
          const res = await this.getMe();
        } catch (e) {
          this._log.error(`Error while trying to reconnect`);
          if (this._errorHandler) {
            await this._errorHandler(e);
          }
          if (this._log.canSend(Logger_1.LogLevel.ERROR)) {
            console.error(e);
          }
        }
      }
      //region base methods
      async connect() {
        await this._initSession();
        if (this._sender === void 0) {
          this._sender = new network_1.MTProtoSender(this.session.getAuthKey(), {
            logger: this._log,
            dcId: this.session.dcId || 4,
            retries: this._connectionRetries,
            delay: this._retryDelay,
            autoReconnect: this._autoReconnect,
            connectTimeout: this._timeout,
            authKeyCallback: this._authKeyCallback.bind(this),
            updateCallback: updates_1._handleUpdate.bind(this),
            isMainSender: true,
            client: this,
            securityChecks: this._securityChecks,
            autoReconnectCallback: this._handleReconnect.bind(this),
            _exportedSenderPromises: this._exportedSenderPromises
          });
        }
        const connection = new this._connection({
          ip: this.session.serverAddress,
          port: this.useWSS ? 443 : 80,
          dcId: this.session.dcId,
          loggers: this._log,
          proxy: this._proxy,
          socket: this.networkSocket,
          testServers: this.testServers
        });
        if (!await this._sender.connect(connection, false)) {
          if (!this._loopStarted) {
            (0, updates_1._updateLoop)(this);
            this._loopStarted = true;
          }
          return false;
        }
        this.session.setAuthKey(this._sender.authKey);
        this.session.save();
        this._initRequest.query = new tl_1.Api.help.GetConfig();
        this._log.info(`Using LAYER ${AllTLObjects_1.LAYER} for initial connect`);
        await this._sender.send(new tl_1.Api.InvokeWithLayer({
          layer: AllTLObjects_1.LAYER,
          query: this._initRequest
        }));
        if (!this._loopStarted) {
          (0, updates_1._updateLoop)(this);
          this._loopStarted = true;
        }
        this._connectedDeferred.resolve();
        this._isSwitchingDc = false;
        return true;
      }
      //endregion
      // region Working with different connections/Data Centers
      /** @hidden */
      async _switchDC(newDc) {
        this._log.info(`Reconnecting to new data center ${newDc}`);
        const DC = await this.getDC(newDc);
        this.session.setDC(newDc, DC.ipAddress, DC.port);
        await this._sender.authKey.setKey(void 0);
        this.session.setAuthKey(void 0);
        this.session.save();
        this._isSwitchingDc = true;
        await this._disconnect();
        this._sender = void 0;
        return await this.connect();
      }
      /**
       * Returns the DC ip in case of node or the DC web address in case of browser.<br/>
       * This will do an API request to fill the cache if it's the first time it's called.
       * @param dcId The DC ID.
       * @param downloadDC whether to use -1 DCs or not
       * @param web if true this will get the web DCs.
       * TODO, hardcode IPs.
       * (These only support downloading/uploading and not creating a new AUTH key)
       */
      async getDC(dcId, downloadDC = false, web = false) {
        this._log.debug(`Getting DC ${dcId}`);
        if (!platform_1.isNode || web) {
          switch (dcId) {
            case 1:
              return {
                id: 1,
                ipAddress: `pluto${downloadDC ? "-1" : ""}.web.telegram.org`,
                port: 443
              };
            case 2:
              return {
                id: 2,
                ipAddress: `venus${downloadDC ? "-1" : ""}.web.telegram.org`,
                port: 443
              };
            case 3:
              return {
                id: 3,
                ipAddress: `aurora${downloadDC ? "-1" : ""}.web.telegram.org`,
                port: 443
              };
            case 4:
              return {
                id: 4,
                ipAddress: `vesta${downloadDC ? "-1" : ""}.web.telegram.org`,
                port: 443
              };
            case 5:
              return {
                id: 5,
                ipAddress: `flora${downloadDC ? "-1" : ""}.web.telegram.org`,
                port: 443
              };
            default:
              throw new Error(`Cannot find the DC with the ID of ${dcId}`);
          }
        }
        if (!this._config) {
          this._config = await this.invoke(new tl_1.Api.help.GetConfig());
        }
        for (const DC of this._config.dcOptions) {
          if (DC.id === dcId && !!DC.ipv6 === this._useIPV6) {
            return {
              id: DC.id,
              ipAddress: DC.ipAddress,
              port: 443
            };
          }
        }
        throw new Error(`Cannot find the DC with the ID of ${dcId}`);
      }
      /** @hidden */
      _removeSender(dcId) {
        delete this._borrowedSenderPromises[dcId];
      }
      /** @hidden */
      _getResponseMessage(req, result, inputChat) {
        return parseMethods._getResponseMessage(this, req, result, inputChat);
      }
      /** @hidden */
      [inspect_1.inspect.custom]() {
        return (0, Helpers_1.betterConsoleLog)(this);
      }
      /**
       * Small hack for using it in browsers
       */
      static get events() {
        return require_events();
      }
    };
    exports2.TelegramClient = TelegramClient3;
  }
});

// node_modules/telegram/Version.js
var require_Version = __commonJS({
  "node_modules/telegram/Version.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.version = void 0;
    exports2.version = "2.25.10";
  }
});

// node_modules/telegram/client/index.js
var require_client = __commonJS({
  "node_modules/telegram/client/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.users = exports2.uploads = exports2.updates = exports2.tgClient = exports2.telegramBaseClient = exports2.message = exports2.messageParse = exports2.downloads = exports2.dialogs = exports2.chats = exports2.buttons = exports2.bots = exports2.auth = exports2.twoFA = void 0;
    var twoFA = __importStar2(require_fa());
    exports2.twoFA = twoFA;
    var auth = __importStar2(require_auth());
    exports2.auth = auth;
    var bots = __importStar2(require_bots());
    exports2.bots = bots;
    var buttons = __importStar2(require_buttons());
    exports2.buttons = buttons;
    var chats = __importStar2(require_chats());
    exports2.chats = chats;
    var dialogs = __importStar2(require_dialogs());
    exports2.dialogs = dialogs;
    var downloads = __importStar2(require_downloads());
    exports2.downloads = downloads;
    var messageParse = __importStar2(require_messageParse());
    exports2.messageParse = messageParse;
    var message = __importStar2(require_messages2());
    exports2.message = message;
    var telegramBaseClient = __importStar2(require_telegramBaseClient());
    exports2.telegramBaseClient = telegramBaseClient;
    var tgClient = __importStar2(require_TelegramClient());
    exports2.tgClient = tgClient;
    var updates = __importStar2(require_updates());
    exports2.updates = updates;
    var uploads = __importStar2(require_uploads());
    exports2.uploads = uploads;
    var users = __importStar2(require_users());
    exports2.users = users;
  }
});

// node_modules/telegram/index.js
var require_telegram = __commonJS({
  "node_modules/telegram/index.js"(exports2) {
    "use strict";
    var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    } : function(o, m, k, k2) {
      if (k2 === void 0)
        k2 = k;
      o[k2] = m[k];
    });
    var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    } : function(o, v) {
      o["default"] = v;
    });
    var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
      if (mod2 && mod2.__esModule)
        return mod2;
      var result = {};
      if (mod2 != null) {
        for (var k in mod2)
          if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
            __createBinding2(result, mod2, k);
      }
      __setModuleDefault2(result, mod2);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.client = exports2.password = exports2.tl = exports2.helpers = exports2.extensions = exports2.sessions = exports2.errors = exports2.utils = exports2.Logger = exports2.version = exports2.Connection = exports2.TelegramClient = exports2.Api = void 0;
    var tl_1 = require_tl();
    Object.defineProperty(exports2, "Api", { enumerable: true, get: function() {
      return tl_1.Api;
    } });
    var tl = __importStar2(require_tl());
    exports2.tl = tl;
    var TelegramClient_1 = require_TelegramClient();
    Object.defineProperty(exports2, "TelegramClient", { enumerable: true, get: function() {
      return TelegramClient_1.TelegramClient;
    } });
    var network_1 = require_network();
    Object.defineProperty(exports2, "Connection", { enumerable: true, get: function() {
      return network_1.Connection;
    } });
    var Version_1 = require_Version();
    Object.defineProperty(exports2, "version", { enumerable: true, get: function() {
      return Version_1.version;
    } });
    var Logger_1 = require_Logger();
    Object.defineProperty(exports2, "Logger", { enumerable: true, get: function() {
      return Logger_1.Logger;
    } });
    var utils = __importStar2(require_Utils());
    exports2.utils = utils;
    var errors = __importStar2(require_errors());
    exports2.errors = errors;
    var sessions = __importStar2(require_sessions());
    exports2.sessions = sessions;
    var extensions = __importStar2(require_extensions());
    exports2.extensions = extensions;
    var helpers = __importStar2(require_Helpers());
    exports2.helpers = helpers;
    var client2 = __importStar2(require_client());
    exports2.client = client2;
    var password = __importStar2(require_Password());
    exports2.password = password;
  }
});

// node_modules/qrcode/lib/can-promise.js
var require_can_promise = __commonJS({
  "node_modules/qrcode/lib/can-promise.js"(exports2, module2) {
    module2.exports = function() {
      return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
    };
  }
});

// node_modules/qrcode/lib/core/utils.js
var require_utils2 = __commonJS({
  "node_modules/qrcode/lib/core/utils.js"(exports2) {
    var toSJISFunction;
    var CODEWORDS_COUNT = [
      0,
      // Not used
      26,
      44,
      70,
      100,
      134,
      172,
      196,
      242,
      292,
      346,
      404,
      466,
      532,
      581,
      655,
      733,
      815,
      901,
      991,
      1085,
      1156,
      1258,
      1364,
      1474,
      1588,
      1706,
      1828,
      1921,
      2051,
      2185,
      2323,
      2465,
      2611,
      2761,
      2876,
      3034,
      3196,
      3362,
      3532,
      3706
    ];
    exports2.getSymbolSize = function getSymbolSize(version2) {
      if (!version2)
        throw new Error('"version" cannot be null or undefined');
      if (version2 < 1 || version2 > 40)
        throw new Error('"version" should be in range from 1 to 40');
      return version2 * 4 + 17;
    };
    exports2.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) {
      return CODEWORDS_COUNT[version2];
    };
    exports2.getBCHDigit = function(data) {
      let digit = 0;
      while (data !== 0) {
        digit++;
        data >>>= 1;
      }
      return digit;
    };
    exports2.setToSJISFunction = function setToSJISFunction(f2) {
      if (typeof f2 !== "function") {
        throw new Error('"toSJISFunc" is not a valid function.');
      }
      toSJISFunction = f2;
    };
    exports2.isKanjiModeEnabled = function() {
      return typeof toSJISFunction !== "undefined";
    };
    exports2.toSJIS = function toSJIS(kanji) {
      return toSJISFunction(kanji);
    };
  }
});

// node_modules/qrcode/lib/core/error-correction-level.js
var require_error_correction_level = __commonJS({
  "node_modules/qrcode/lib/core/error-correction-level.js"(exports2) {
    exports2.L = { bit: 1 };
    exports2.M = { bit: 0 };
    exports2.Q = { bit: 3 };
    exports2.H = { bit: 2 };
    function fromString(string) {
      if (typeof string !== "string") {
        throw new Error("Param is not a string");
      }
      const lcStr = string.toLowerCase();
      switch (lcStr) {
        case "l":
        case "low":
          return exports2.L;
        case "m":
        case "medium":
          return exports2.M;
        case "q":
        case "quartile":
          return exports2.Q;
        case "h":
        case "high":
          return exports2.H;
        default:
          throw new Error("Unknown EC Level: " + string);
      }
    }
    exports2.isValid = function isValid(level) {
      return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4;
    };
    exports2.from = function from(value, defaultValue) {
      if (exports2.isValid(value)) {
        return value;
      }
      try {
        return fromString(value);
      } catch (e) {
        return defaultValue;
      }
    };
  }
});

// node_modules/qrcode/lib/core/bit-buffer.js
var require_bit_buffer = __commonJS({
  "node_modules/qrcode/lib/core/bit-buffer.js"(exports2, module2) {
    function BitBuffer() {
      this.buffer = [];
      this.length = 0;
    }
    BitBuffer.prototype = {
      get: function(index) {
        const bufIndex = Math.floor(index / 8);
        return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1;
      },
      put: function(num, length) {
        for (let i = 0; i < length; i++) {
          this.putBit((num >>> length - i - 1 & 1) === 1);
        }
      },
      getLengthInBits: function() {
        return this.length;
      },
      putBit: function(bit) {
        const bufIndex = Math.floor(this.length / 8);
        if (this.buffer.length <= bufIndex) {
          this.buffer.push(0);
        }
        if (bit) {
          this.buffer[bufIndex] |= 128 >>> this.length % 8;
        }
        this.length++;
      }
    };
    module2.exports = BitBuffer;
  }
});

// node_modules/qrcode/lib/core/bit-matrix.js
var require_bit_matrix = __commonJS({
  "node_modules/qrcode/lib/core/bit-matrix.js"(exports2, module2) {
    function BitMatrix(size) {
      if (!size || size < 1) {
        throw new Error("BitMatrix size must be defined and greater than 0");
      }
      this.size = size;
      this.data = new Uint8Array(size * size);
      this.reservedBit = new Uint8Array(size * size);
    }
    BitMatrix.prototype.set = function(row, col, value, reserved) {
      const index = row * this.size + col;
      this.data[index] = value;
      if (reserved)
        this.reservedBit[index] = true;
    };
    BitMatrix.prototype.get = function(row, col) {
      return this.data[row * this.size + col];
    };
    BitMatrix.prototype.xor = function(row, col, value) {
      this.data[row * this.size + col] ^= value;
    };
    BitMatrix.prototype.isReserved = function(row, col) {
      return this.reservedBit[row * this.size + col];
    };
    module2.exports = BitMatrix;
  }
});

// node_modules/qrcode/lib/core/alignment-pattern.js
var require_alignment_pattern = __commonJS({
  "node_modules/qrcode/lib/core/alignment-pattern.js"(exports2) {
    var getSymbolSize = require_utils2().getSymbolSize;
    exports2.getRowColCoords = function getRowColCoords(version2) {
      if (version2 === 1)
        return [];
      const posCount = Math.floor(version2 / 7) + 2;
      const size = getSymbolSize(version2);
      const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2;
      const positions = [size - 7];
      for (let i = 1; i < posCount - 1; i++) {
        positions[i] = positions[i - 1] - intervals;
      }
      positions.push(6);
      return positions.reverse();
    };
    exports2.getPositions = function getPositions(version2) {
      const coords = [];
      const pos = exports2.getRowColCoords(version2);
      const posLength = pos.length;
      for (let i = 0; i < posLength; i++) {
        for (let j = 0; j < posLength; j++) {
          if (i === 0 && j === 0 || // top-left
          i === 0 && j === posLength - 1 || // bottom-left
          i === posLength - 1 && j === 0) {
            continue;
          }
          coords.push([pos[i], pos[j]]);
        }
      }
      return coords;
    };
  }
});

// node_modules/qrcode/lib/core/finder-pattern.js
var require_finder_pattern = __commonJS({
  "node_modules/qrcode/lib/core/finder-pattern.js"(exports2) {
    var getSymbolSize = require_utils2().getSymbolSize;
    var FINDER_PATTERN_SIZE = 7;
    exports2.getPositions = function getPositions(version2) {
      const size = getSymbolSize(version2);
      return [
        // top-left
        [0, 0],
        // top-right
        [size - FINDER_PATTERN_SIZE, 0],
        // bottom-left
        [0, size - FINDER_PATTERN_SIZE]
      ];
    };
  }
});

// node_modules/qrcode/lib/core/mask-pattern.js
var require_mask_pattern = __commonJS({
  "node_modules/qrcode/lib/core/mask-pattern.js"(exports2) {
    exports2.Patterns = {
      PATTERN000: 0,
      PATTERN001: 1,
      PATTERN010: 2,
      PATTERN011: 3,
      PATTERN100: 4,
      PATTERN101: 5,
      PATTERN110: 6,
      PATTERN111: 7
    };
    var PenaltyScores = {
      N1: 3,
      N2: 3,
      N3: 40,
      N4: 10
    };
    exports2.isValid = function isValid(mask) {
      return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7;
    };
    exports2.from = function from(value) {
      return exports2.isValid(value) ? parseInt(value, 10) : void 0;
    };
    exports2.getPenaltyN1 = function getPenaltyN1(data) {
      const size = data.size;
      let points = 0;
      let sameCountCol = 0;
      let sameCountRow = 0;
      let lastCol = null;
      let lastRow = null;
      for (let row = 0; row < size; row++) {
        sameCountCol = sameCountRow = 0;
        lastCol = lastRow = null;
        for (let col = 0; col < size; col++) {
          let module3 = data.get(row, col);
          if (module3 === lastCol) {
            sameCountCol++;
          } else {
            if (sameCountCol >= 5)
              points += PenaltyScores.N1 + (sameCountCol - 5);
            lastCol = module3;
            sameCountCol = 1;
          }
          module3 = data.get(col, row);
          if (module3 === lastRow) {
            sameCountRow++;
          } else {
            if (sameCountRow >= 5)
              points += PenaltyScores.N1 + (sameCountRow - 5);
            lastRow = module3;
            sameCountRow = 1;
          }
        }
        if (sameCountCol >= 5)
          points += PenaltyScores.N1 + (sameCountCol - 5);
        if (sameCountRow >= 5)
          points += PenaltyScores.N1 + (sameCountRow - 5);
      }
      return points;
    };
    exports2.getPenaltyN2 = function getPenaltyN2(data) {
      const size = data.size;
      let points = 0;
      for (let row = 0; row < size - 1; row++) {
        for (let col = 0; col < size - 1; col++) {
          const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1);
          if (last === 4 || last === 0)
            points++;
        }
      }
      return points * PenaltyScores.N2;
    };
    exports2.getPenaltyN3 = function getPenaltyN3(data) {
      const size = data.size;
      let points = 0;
      let bitsCol = 0;
      let bitsRow = 0;
      for (let row = 0; row < size; row++) {
        bitsCol = bitsRow = 0;
        for (let col = 0; col < size; col++) {
          bitsCol = bitsCol << 1 & 2047 | data.get(row, col);
          if (col >= 10 && (bitsCol === 1488 || bitsCol === 93))
            points++;
          bitsRow = bitsRow << 1 & 2047 | data.get(col, row);
          if (col >= 10 && (bitsRow === 1488 || bitsRow === 93))
            points++;
        }
      }
      return points * PenaltyScores.N3;
    };
    exports2.getPenaltyN4 = function getPenaltyN4(data) {
      let darkCount = 0;
      const modulesCount = data.data.length;
      for (let i = 0; i < modulesCount; i++)
        darkCount += data.data[i];
      const k = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10);
      return k * PenaltyScores.N4;
    };
    function getMaskAt(maskPattern, i, j) {
      switch (maskPattern) {
        case exports2.Patterns.PATTERN000:
          return (i + j) % 2 === 0;
        case exports2.Patterns.PATTERN001:
          return i % 2 === 0;
        case exports2.Patterns.PATTERN010:
          return j % 3 === 0;
        case exports2.Patterns.PATTERN011:
          return (i + j) % 3 === 0;
        case exports2.Patterns.PATTERN100:
          return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0;
        case exports2.Patterns.PATTERN101:
          return i * j % 2 + i * j % 3 === 0;
        case exports2.Patterns.PATTERN110:
          return (i * j % 2 + i * j % 3) % 2 === 0;
        case exports2.Patterns.PATTERN111:
          return (i * j % 3 + (i + j) % 2) % 2 === 0;
        default:
          throw new Error("bad maskPattern:" + maskPattern);
      }
    }
    exports2.applyMask = function applyMask(pattern, data) {
      const size = data.size;
      for (let col = 0; col < size; col++) {
        for (let row = 0; row < size; row++) {
          if (data.isReserved(row, col))
            continue;
          data.xor(row, col, getMaskAt(pattern, row, col));
        }
      }
    };
    exports2.getBestMask = function getBestMask(data, setupFormatFunc) {
      const numPatterns = Object.keys(exports2.Patterns).length;
      let bestPattern = 0;
      let lowerPenalty = Infinity;
      for (let p = 0; p < numPatterns; p++) {
        setupFormatFunc(p);
        exports2.applyMask(p, data);
        const penalty = exports2.getPenaltyN1(data) + exports2.getPenaltyN2(data) + exports2.getPenaltyN3(data) + exports2.getPenaltyN4(data);
        exports2.applyMask(p, data);
        if (penalty < lowerPenalty) {
          lowerPenalty = penalty;
          bestPattern = p;
        }
      }
      return bestPattern;
    };
  }
});

// node_modules/qrcode/lib/core/error-correction-code.js
var require_error_correction_code = __commonJS({
  "node_modules/qrcode/lib/core/error-correction-code.js"(exports2) {
    var ECLevel = require_error_correction_level();
    var EC_BLOCKS_TABLE = [
      // L  M  Q  H
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      2,
      2,
      1,
      2,
      2,
      4,
      1,
      2,
      4,
      4,
      2,
      4,
      4,
      4,
      2,
      4,
      6,
      5,
      2,
      4,
      6,
      6,
      2,
      5,
      8,
      8,
      4,
      5,
      8,
      8,
      4,
      5,
      8,
      11,
      4,
      8,
      10,
      11,
      4,
      9,
      12,
      16,
      4,
      9,
      16,
      16,
      6,
      10,
      12,
      18,
      6,
      10,
      17,
      16,
      6,
      11,
      16,
      19,
      6,
      13,
      18,
      21,
      7,
      14,
      21,
      25,
      8,
      16,
      20,
      25,
      8,
      17,
      23,
      25,
      9,
      17,
      23,
      34,
      9,
      18,
      25,
      30,
      10,
      20,
      27,
      32,
      12,
      21,
      29,
      35,
      12,
      23,
      34,
      37,
      12,
      25,
      34,
      40,
      13,
      26,
      35,
      42,
      14,
      28,
      38,
      45,
      15,
      29,
      40,
      48,
      16,
      31,
      43,
      51,
      17,
      33,
      45,
      54,
      18,
      35,
      48,
      57,
      19,
      37,
      51,
      60,
      19,
      38,
      53,
      63,
      20,
      40,
      56,
      66,
      21,
      43,
      59,
      70,
      22,
      45,
      62,
      74,
      24,
      47,
      65,
      77,
      25,
      49,
      68,
      81
    ];
    var EC_CODEWORDS_TABLE = [
      // L  M  Q  H
      7,
      10,
      13,
      17,
      10,
      16,
      22,
      28,
      15,
      26,
      36,
      44,
      20,
      36,
      52,
      64,
      26,
      48,
      72,
      88,
      36,
      64,
      96,
      112,
      40,
      72,
      108,
      130,
      48,
      88,
      132,
      156,
      60,
      110,
      160,
      192,
      72,
      130,
      192,
      224,
      80,
      150,
      224,
      264,
      96,
      176,
      260,
      308,
      104,
      198,
      288,
      352,
      120,
      216,
      320,
      384,
      132,
      240,
      360,
      432,
      144,
      280,
      408,
      480,
      168,
      308,
      448,
      532,
      180,
      338,
      504,
      588,
      196,
      364,
      546,
      650,
      224,
      416,
      600,
      700,
      224,
      442,
      644,
      750,
      252,
      476,
      690,
      816,
      270,
      504,
      750,
      900,
      300,
      560,
      810,
      960,
      312,
      588,
      870,
      1050,
      336,
      644,
      952,
      1110,
      360,
      700,
      1020,
      1200,
      390,
      728,
      1050,
      1260,
      420,
      784,
      1140,
      1350,
      450,
      812,
      1200,
      1440,
      480,
      868,
      1290,
      1530,
      510,
      924,
      1350,
      1620,
      540,
      980,
      1440,
      1710,
      570,
      1036,
      1530,
      1800,
      570,
      1064,
      1590,
      1890,
      600,
      1120,
      1680,
      1980,
      630,
      1204,
      1770,
      2100,
      660,
      1260,
      1860,
      2220,
      720,
      1316,
      1950,
      2310,
      750,
      1372,
      2040,
      2430
    ];
    exports2.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel) {
      switch (errorCorrectionLevel) {
        case ECLevel.L:
          return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0];
        case ECLevel.M:
          return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1];
        case ECLevel.Q:
          return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2];
        case ECLevel.H:
          return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3];
        default:
          return void 0;
      }
    };
    exports2.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel) {
      switch (errorCorrectionLevel) {
        case ECLevel.L:
          return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0];
        case ECLevel.M:
          return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1];
        case ECLevel.Q:
          return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2];
        case ECLevel.H:
          return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3];
        default:
          return void 0;
      }
    };
  }
});

// node_modules/qrcode/lib/core/galois-field.js
var require_galois_field = __commonJS({
  "node_modules/qrcode/lib/core/galois-field.js"(exports2) {
    var EXP_TABLE = new Uint8Array(512);
    var LOG_TABLE = new Uint8Array(256);
    (function initTables() {
      let x = 1;
      for (let i = 0; i < 255; i++) {
        EXP_TABLE[i] = x;
        LOG_TABLE[x] = i;
        x <<= 1;
        if (x & 256) {
          x ^= 285;
        }
      }
      for (let i = 255; i < 512; i++) {
        EXP_TABLE[i] = EXP_TABLE[i - 255];
      }
    })();
    exports2.log = function log(n) {
      if (n < 1)
        throw new Error("log(" + n + ")");
      return LOG_TABLE[n];
    };
    exports2.exp = function exp(n) {
      return EXP_TABLE[n];
    };
    exports2.mul = function mul(x, y) {
      if (x === 0 || y === 0)
        return 0;
      return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]];
    };
  }
});

// node_modules/qrcode/lib/core/polynomial.js
var require_polynomial = __commonJS({
  "node_modules/qrcode/lib/core/polynomial.js"(exports2) {
    var GF = require_galois_field();
    exports2.mul = function mul(p1, p2) {
      const coeff = new Uint8Array(p1.length + p2.length - 1);
      for (let i = 0; i < p1.length; i++) {
        for (let j = 0; j < p2.length; j++) {
          coeff[i + j] ^= GF.mul(p1[i], p2[j]);
        }
      }
      return coeff;
    };
    exports2.mod = function mod2(divident, divisor) {
      let result = new Uint8Array(divident);
      while (result.length - divisor.length >= 0) {
        const coeff = result[0];
        for (let i = 0; i < divisor.length; i++) {
          result[i] ^= GF.mul(divisor[i], coeff);
        }
        let offset2 = 0;
        while (offset2 < result.length && result[offset2] === 0)
          offset2++;
        result = result.slice(offset2);
      }
      return result;
    };
    exports2.generateECPolynomial = function generateECPolynomial(degree) {
      let poly = new Uint8Array([1]);
      for (let i = 0; i < degree; i++) {
        poly = exports2.mul(poly, new Uint8Array([1, GF.exp(i)]));
      }
      return poly;
    };
  }
});

// node_modules/qrcode/lib/core/reed-solomon-encoder.js
var require_reed_solomon_encoder = __commonJS({
  "node_modules/qrcode/lib/core/reed-solomon-encoder.js"(exports2, module2) {
    var Polynomial = require_polynomial();
    function ReedSolomonEncoder(degree) {
      this.genPoly = void 0;
      this.degree = degree;
      if (this.degree)
        this.initialize(this.degree);
    }
    ReedSolomonEncoder.prototype.initialize = function initialize(degree) {
      this.degree = degree;
      this.genPoly = Polynomial.generateECPolynomial(this.degree);
    };
    ReedSolomonEncoder.prototype.encode = function encode(data) {
      if (!this.genPoly) {
        throw new Error("Encoder not initialized");
      }
      const paddedData = new Uint8Array(data.length + this.degree);
      paddedData.set(data);
      const remainder = Polynomial.mod(paddedData, this.genPoly);
      const start2 = this.degree - remainder.length;
      if (start2 > 0) {
        const buff = new Uint8Array(this.degree);
        buff.set(remainder, start2);
        return buff;
      }
      return remainder;
    };
    module2.exports = ReedSolomonEncoder;
  }
});

// node_modules/qrcode/lib/core/version-check.js
var require_version_check = __commonJS({
  "node_modules/qrcode/lib/core/version-check.js"(exports2) {
    exports2.isValid = function isValid(version2) {
      return !isNaN(version2) && version2 >= 1 && version2 <= 40;
    };
  }
});

// node_modules/qrcode/lib/core/regex.js
var require_regex = __commonJS({
  "node_modules/qrcode/lib/core/regex.js"(exports2) {
    var numeric = "[0-9]+";
    var alphanumeric = "[A-Z $%*+\\-./:]+";
    var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
    kanji = kanji.replace(/u/g, "\\u");
    var byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+";
    exports2.KANJI = new RegExp(kanji, "g");
    exports2.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
    exports2.BYTE = new RegExp(byte, "g");
    exports2.NUMERIC = new RegExp(numeric, "g");
    exports2.ALPHANUMERIC = new RegExp(alphanumeric, "g");
    var TEST_KANJI = new RegExp("^" + kanji + "$");
    var TEST_NUMERIC = new RegExp("^" + numeric + "$");
    var TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
    exports2.testKanji = function testKanji(str) {
      return TEST_KANJI.test(str);
    };
    exports2.testNumeric = function testNumeric(str) {
      return TEST_NUMERIC.test(str);
    };
    exports2.testAlphanumeric = function testAlphanumeric(str) {
      return TEST_ALPHANUMERIC.test(str);
    };
  }
});

// node_modules/qrcode/lib/core/mode.js
var require_mode = __commonJS({
  "node_modules/qrcode/lib/core/mode.js"(exports2) {
    var VersionCheck = require_version_check();
    var Regex = require_regex();
    exports2.NUMERIC = {
      id: "Numeric",
      bit: 1 << 0,
      ccBits: [10, 12, 14]
    };
    exports2.ALPHANUMERIC = {
      id: "Alphanumeric",
      bit: 1 << 1,
      ccBits: [9, 11, 13]
    };
    exports2.BYTE = {
      id: "Byte",
      bit: 1 << 2,
      ccBits: [8, 16, 16]
    };
    exports2.KANJI = {
      id: "Kanji",
      bit: 1 << 3,
      ccBits: [8, 10, 12]
    };
    exports2.MIXED = {
      bit: -1
    };
    exports2.getCharCountIndicator = function getCharCountIndicator(mode, version2) {
      if (!mode.ccBits)
        throw new Error("Invalid mode: " + mode);
      if (!VersionCheck.isValid(version2)) {
        throw new Error("Invalid version: " + version2);
      }
      if (version2 >= 1 && version2 < 10)
        return mode.ccBits[0];
      else if (version2 < 27)
        return mode.ccBits[1];
      return mode.ccBits[2];
    };
    exports2.getBestModeForData = function getBestModeForData(dataStr) {
      if (Regex.testNumeric(dataStr))
        return exports2.NUMERIC;
      else if (Regex.testAlphanumeric(dataStr))
        return exports2.ALPHANUMERIC;
      else if (Regex.testKanji(dataStr))
        return exports2.KANJI;
      else
        return exports2.BYTE;
    };
    exports2.toString = function toString(mode) {
      if (mode && mode.id)
        return mode.id;
      throw new Error("Invalid mode");
    };
    exports2.isValid = function isValid(mode) {
      return mode && mode.bit && mode.ccBits;
    };
    function fromString(string) {
      if (typeof string !== "string") {
        throw new Error("Param is not a string");
      }
      const lcStr = string.toLowerCase();
      switch (lcStr) {
        case "numeric":
          return exports2.NUMERIC;
        case "alphanumeric":
          return exports2.ALPHANUMERIC;
        case "kanji":
          return exports2.KANJI;
        case "byte":
          return exports2.BYTE;
        default:
          throw new Error("Unknown mode: " + string);
      }
    }
    exports2.from = function from(value, defaultValue) {
      if (exports2.isValid(value)) {
        return value;
      }
      try {
        return fromString(value);
      } catch (e) {
        return defaultValue;
      }
    };
  }
});

// node_modules/qrcode/lib/core/version.js
var require_version2 = __commonJS({
  "node_modules/qrcode/lib/core/version.js"(exports2) {
    var Utils = require_utils2();
    var ECCode = require_error_correction_code();
    var ECLevel = require_error_correction_level();
    var Mode = require_mode();
    var VersionCheck = require_version_check();
    var G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
    var G18_BCH = Utils.getBCHDigit(G18);
    function getBestVersionForDataLength(mode, length, errorCorrectionLevel) {
      for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
        if (length <= exports2.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
          return currentVersion;
        }
      }
      return void 0;
    }
    function getReservedBitsCount(mode, version2) {
      return Mode.getCharCountIndicator(mode, version2) + 4;
    }
    function getTotalBitsFromDataArray(segments, version2) {
      let totalBits = 0;
      segments.forEach(function(data) {
        const reservedBits = getReservedBitsCount(data.mode, version2);
        totalBits += reservedBits + data.getBitsLength();
      });
      return totalBits;
    }
    function getBestVersionForMixedData(segments, errorCorrectionLevel) {
      for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
        const length = getTotalBitsFromDataArray(segments, currentVersion);
        if (length <= exports2.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
          return currentVersion;
        }
      }
      return void 0;
    }
    exports2.from = function from(value, defaultValue) {
      if (VersionCheck.isValid(value)) {
        return parseInt(value, 10);
      }
      return defaultValue;
    };
    exports2.getCapacity = function getCapacity(version2, errorCorrectionLevel, mode) {
      if (!VersionCheck.isValid(version2)) {
        throw new Error("Invalid QR Code version");
      }
      if (typeof mode === "undefined")
        mode = Mode.BYTE;
      const totalCodewords = Utils.getSymbolTotalCodewords(version2);
      const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel);
      const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
      if (mode === Mode.MIXED)
        return dataTotalCodewordsBits;
      const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version2);
      switch (mode) {
        case Mode.NUMERIC:
          return Math.floor(usableBits / 10 * 3);
        case Mode.ALPHANUMERIC:
          return Math.floor(usableBits / 11 * 2);
        case Mode.KANJI:
          return Math.floor(usableBits / 13);
        case Mode.BYTE:
        default:
          return Math.floor(usableBits / 8);
      }
    };
    exports2.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel) {
      let seg;
      const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
      if (Array.isArray(data)) {
        if (data.length > 1) {
          return getBestVersionForMixedData(data, ecl);
        }
        if (data.length === 0) {
          return 1;
        }
        seg = data[0];
      } else {
        seg = data;
      }
      return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl);
    };
    exports2.getEncodedBits = function getEncodedBits(version2) {
      if (!VersionCheck.isValid(version2) || version2 < 7) {
        throw new Error("Invalid QR Code version");
      }
      let d = version2 << 12;
      while (Utils.getBCHDigit(d) - G18_BCH >= 0) {
        d ^= G18 << Utils.getBCHDigit(d) - G18_BCH;
      }
      return version2 << 12 | d;
    };
  }
});

// node_modules/qrcode/lib/core/format-info.js
var require_format_info = __commonJS({
  "node_modules/qrcode/lib/core/format-info.js"(exports2) {
    var Utils = require_utils2();
    var G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
    var G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
    var G15_BCH = Utils.getBCHDigit(G15);
    exports2.getEncodedBits = function getEncodedBits(errorCorrectionLevel, mask) {
      const data = errorCorrectionLevel.bit << 3 | mask;
      let d = data << 10;
      while (Utils.getBCHDigit(d) - G15_BCH >= 0) {
        d ^= G15 << Utils.getBCHDigit(d) - G15_BCH;
      }
      return (data << 10 | d) ^ G15_MASK;
    };
  }
});

// node_modules/qrcode/lib/core/numeric-data.js
var require_numeric_data = __commonJS({
  "node_modules/qrcode/lib/core/numeric-data.js"(exports2, module2) {
    var Mode = require_mode();
    function NumericData(data) {
      this.mode = Mode.NUMERIC;
      this.data = data.toString();
    }
    NumericData.getBitsLength = function getBitsLength(length) {
      return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0);
    };
    NumericData.prototype.getLength = function getLength() {
      return this.data.length;
    };
    NumericData.prototype.getBitsLength = function getBitsLength() {
      return NumericData.getBitsLength(this.data.length);
    };
    NumericData.prototype.write = function write2(bitBuffer) {
      let i, group, value;
      for (i = 0; i + 3 <= this.data.length; i += 3) {
        group = this.data.substr(i, 3);
        value = parseInt(group, 10);
        bitBuffer.put(value, 10);
      }
      const remainingNum = this.data.length - i;
      if (remainingNum > 0) {
        group = this.data.substr(i);
        value = parseInt(group, 10);
        bitBuffer.put(value, remainingNum * 3 + 1);
      }
    };
    module2.exports = NumericData;
  }
});

// node_modules/qrcode/lib/core/alphanumeric-data.js
var require_alphanumeric_data = __commonJS({
  "node_modules/qrcode/lib/core/alphanumeric-data.js"(exports2, module2) {
    var Mode = require_mode();
    var ALPHA_NUM_CHARS = [
      "0",
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9",
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "G",
      "H",
      "I",
      "J",
      "K",
      "L",
      "M",
      "N",
      "O",
      "P",
      "Q",
      "R",
      "S",
      "T",
      "U",
      "V",
      "W",
      "X",
      "Y",
      "Z",
      " ",
      "$",
      "%",
      "*",
      "+",
      "-",
      ".",
      "/",
      ":"
    ];
    function AlphanumericData(data) {
      this.mode = Mode.ALPHANUMERIC;
      this.data = data;
    }
    AlphanumericData.getBitsLength = function getBitsLength(length) {
      return 11 * Math.floor(length / 2) + 6 * (length % 2);
    };
    AlphanumericData.prototype.getLength = function getLength() {
      return this.data.length;
    };
    AlphanumericData.prototype.getBitsLength = function getBitsLength() {
      return AlphanumericData.getBitsLength(this.data.length);
    };
    AlphanumericData.prototype.write = function write2(bitBuffer) {
      let i;
      for (i = 0; i + 2 <= this.data.length; i += 2) {
        let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45;
        value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1]);
        bitBuffer.put(value, 11);
      }
      if (this.data.length % 2) {
        bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6);
      }
    };
    module2.exports = AlphanumericData;
  }
});

// node_modules/encode-utf8/index.js
var require_encode_utf8 = __commonJS({
  "node_modules/encode-utf8/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function encodeUtf8(input) {
      var result = [];
      var size = input.length;
      for (var index = 0; index < size; index++) {
        var point = input.charCodeAt(index);
        if (point >= 55296 && point <= 56319 && size > index + 1) {
          var second = input.charCodeAt(index + 1);
          if (second >= 56320 && second <= 57343) {
            point = (point - 55296) * 1024 + second - 56320 + 65536;
            index += 1;
          }
        }
        if (point < 128) {
          result.push(point);
          continue;
        }
        if (point < 2048) {
          result.push(point >> 6 | 192);
          result.push(point & 63 | 128);
          continue;
        }
        if (point < 55296 || point >= 57344 && point < 65536) {
          result.push(point >> 12 | 224);
          result.push(point >> 6 & 63 | 128);
          result.push(point & 63 | 128);
          continue;
        }
        if (point >= 65536 && point <= 1114111) {
          result.push(point >> 18 | 240);
          result.push(point >> 12 & 63 | 128);
          result.push(point >> 6 & 63 | 128);
          result.push(point & 63 | 128);
          continue;
        }
        result.push(239, 191, 189);
      }
      return new Uint8Array(result).buffer;
    };
  }
});

// node_modules/qrcode/lib/core/byte-data.js
var require_byte_data = __commonJS({
  "node_modules/qrcode/lib/core/byte-data.js"(exports2, module2) {
    var encodeUtf8 = require_encode_utf8();
    var Mode = require_mode();
    function ByteData(data) {
      this.mode = Mode.BYTE;
      if (typeof data === "string") {
        data = encodeUtf8(data);
      }
      this.data = new Uint8Array(data);
    }
    ByteData.getBitsLength = function getBitsLength(length) {
      return length * 8;
    };
    ByteData.prototype.getLength = function getLength() {
      return this.data.length;
    };
    ByteData.prototype.getBitsLength = function getBitsLength() {
      return ByteData.getBitsLength(this.data.length);
    };
    ByteData.prototype.write = function(bitBuffer) {
      for (let i = 0, l = this.data.length; i < l; i++) {
        bitBuffer.put(this.data[i], 8);
      }
    };
    module2.exports = ByteData;
  }
});

// node_modules/qrcode/lib/core/kanji-data.js
var require_kanji_data = __commonJS({
  "node_modules/qrcode/lib/core/kanji-data.js"(exports2, module2) {
    var Mode = require_mode();
    var Utils = require_utils2();
    function KanjiData(data) {
      this.mode = Mode.KANJI;
      this.data = data;
    }
    KanjiData.getBitsLength = function getBitsLength(length) {
      return length * 13;
    };
    KanjiData.prototype.getLength = function getLength() {
      return this.data.length;
    };
    KanjiData.prototype.getBitsLength = function getBitsLength() {
      return KanjiData.getBitsLength(this.data.length);
    };
    KanjiData.prototype.write = function(bitBuffer) {
      let i;
      for (i = 0; i < this.data.length; i++) {
        let value = Utils.toSJIS(this.data[i]);
        if (value >= 33088 && value <= 40956) {
          value -= 33088;
        } else if (value >= 57408 && value <= 60351) {
          value -= 49472;
        } else {
          throw new Error(
            "Invalid SJIS character: " + this.data[i] + "\nMake sure your charset is UTF-8"
          );
        }
        value = (value >>> 8 & 255) * 192 + (value & 255);
        bitBuffer.put(value, 13);
      }
    };
    module2.exports = KanjiData;
  }
});

// node_modules/dijkstrajs/dijkstra.js
var require_dijkstra = __commonJS({
  "node_modules/dijkstrajs/dijkstra.js"(exports2, module2) {
    "use strict";
    var dijkstra = {
      single_source_shortest_paths: function(graph, s, d) {
        var predecessors = {};
        var costs = {};
        costs[s] = 0;
        var open = dijkstra.PriorityQueue.make();
        open.push(s, 0);
        var closest, u, v, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit;
        while (!open.empty()) {
          closest = open.pop();
          u = closest.value;
          cost_of_s_to_u = closest.cost;
          adjacent_nodes = graph[u] || {};
          for (v in adjacent_nodes) {
            if (adjacent_nodes.hasOwnProperty(v)) {
              cost_of_e = adjacent_nodes[v];
              cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
              cost_of_s_to_v = costs[v];
              first_visit = typeof costs[v] === "undefined";
              if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
                costs[v] = cost_of_s_to_u_plus_cost_of_e;
                open.push(v, cost_of_s_to_u_plus_cost_of_e);
                predecessors[v] = u;
              }
            }
          }
        }
        if (typeof d !== "undefined" && typeof costs[d] === "undefined") {
          var msg = ["Could not find a path from ", s, " to ", d, "."].join("");
          throw new Error(msg);
        }
        return predecessors;
      },
      extract_shortest_path_from_predecessor_list: function(predecessors, d) {
        var nodes = [];
        var u = d;
        var predecessor;
        while (u) {
          nodes.push(u);
          predecessor = predecessors[u];
          u = predecessors[u];
        }
        nodes.reverse();
        return nodes;
      },
      find_path: function(graph, s, d) {
        var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);
        return dijkstra.extract_shortest_path_from_predecessor_list(
          predecessors,
          d
        );
      },
      /**
       * A very naive priority queue implementation.
       */
      PriorityQueue: {
        make: function(opts) {
          var T = dijkstra.PriorityQueue, t = {}, key;
          opts = opts || {};
          for (key in T) {
            if (T.hasOwnProperty(key)) {
              t[key] = T[key];
            }
          }
          t.queue = [];
          t.sorter = opts.sorter || T.default_sorter;
          return t;
        },
        default_sorter: function(a, b) {
          return a.cost - b.cost;
        },
        /**
         * Add a new item to the queue and ensure the highest priority element
         * is at the front of the queue.
         */
        push: function(value, cost) {
          var item = { value, cost };
          this.queue.push(item);
          this.queue.sort(this.sorter);
        },
        /**
         * Return the highest priority element in the queue.
         */
        pop: function() {
          return this.queue.shift();
        },
        empty: function() {
          return this.queue.length === 0;
        }
      }
    };
    if (typeof module2 !== "undefined") {
      module2.exports = dijkstra;
    }
  }
});

// node_modules/qrcode/lib/core/segments.js
var require_segments = __commonJS({
  "node_modules/qrcode/lib/core/segments.js"(exports2) {
    var Mode = require_mode();
    var NumericData = require_numeric_data();
    var AlphanumericData = require_alphanumeric_data();
    var ByteData = require_byte_data();
    var KanjiData = require_kanji_data();
    var Regex = require_regex();
    var Utils = require_utils2();
    var dijkstra = require_dijkstra();
    function getStringByteLength(str) {
      return unescape(encodeURIComponent(str)).length;
    }
    function getSegments(regex, mode, str) {
      const segments = [];
      let result;
      while ((result = regex.exec(str)) !== null) {
        segments.push({
          data: result[0],
          index: result.index,
          mode,
          length: result[0].length
        });
      }
      return segments;
    }
    function getSegmentsFromString(dataStr) {
      const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr);
      const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr);
      let byteSegs;
      let kanjiSegs;
      if (Utils.isKanjiModeEnabled()) {
        byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr);
        kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr);
      } else {
        byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr);
        kanjiSegs = [];
      }
      const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs);
      return segs.sort(function(s1, s2) {
        return s1.index - s2.index;
      }).map(function(obj2) {
        return {
          data: obj2.data,
          mode: obj2.mode,
          length: obj2.length
        };
      });
    }
    function getSegmentBitsLength(length, mode) {
      switch (mode) {
        case Mode.NUMERIC:
          return NumericData.getBitsLength(length);
        case Mode.ALPHANUMERIC:
          return AlphanumericData.getBitsLength(length);
        case Mode.KANJI:
          return KanjiData.getBitsLength(length);
        case Mode.BYTE:
          return ByteData.getBitsLength(length);
      }
    }
    function mergeSegments(segs) {
      return segs.reduce(function(acc, curr) {
        const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
        if (prevSeg && prevSeg.mode === curr.mode) {
          acc[acc.length - 1].data += curr.data;
          return acc;
        }
        acc.push(curr);
        return acc;
      }, []);
    }
    function buildNodes(segs) {
      const nodes = [];
      for (let i = 0; i < segs.length; i++) {
        const seg = segs[i];
        switch (seg.mode) {
          case Mode.NUMERIC:
            nodes.push([
              seg,
              { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },
              { data: seg.data, mode: Mode.BYTE, length: seg.length }
            ]);
            break;
          case Mode.ALPHANUMERIC:
            nodes.push([
              seg,
              { data: seg.data, mode: Mode.BYTE, length: seg.length }
            ]);
            break;
          case Mode.KANJI:
            nodes.push([
              seg,
              { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
            ]);
            break;
          case Mode.BYTE:
            nodes.push([
              { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
            ]);
        }
      }
      return nodes;
    }
    function buildGraph(nodes, version2) {
      const table = {};
      const graph = { start: {} };
      let prevNodeIds = ["start"];
      for (let i = 0; i < nodes.length; i++) {
        const nodeGroup = nodes[i];
        const currentNodeIds = [];
        for (let j = 0; j < nodeGroup.length; j++) {
          const node = nodeGroup[j];
          const key = "" + i + j;
          currentNodeIds.push(key);
          table[key] = { node, lastCount: 0 };
          graph[key] = {};
          for (let n = 0; n < prevNodeIds.length; n++) {
            const prevNodeId = prevNodeIds[n];
            if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
              graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
              table[prevNodeId].lastCount += node.length;
            } else {
              if (table[prevNodeId])
                table[prevNodeId].lastCount = node.length;
              graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version2);
            }
          }
        }
        prevNodeIds = currentNodeIds;
      }
      for (let n = 0; n < prevNodeIds.length; n++) {
        graph[prevNodeIds[n]].end = 0;
      }
      return { map: graph, table };
    }
    function buildSingleSegment(data, modesHint) {
      let mode;
      const bestMode = Mode.getBestModeForData(data);
      mode = Mode.from(modesHint, bestMode);
      if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {
        throw new Error('"' + data + '" cannot be encoded with mode ' + Mode.toString(mode) + ".\n Suggested mode is: " + Mode.toString(bestMode));
      }
      if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {
        mode = Mode.BYTE;
      }
      switch (mode) {
        case Mode.NUMERIC:
          return new NumericData(data);
        case Mode.ALPHANUMERIC:
          return new AlphanumericData(data);
        case Mode.KANJI:
          return new KanjiData(data);
        case Mode.BYTE:
          return new ByteData(data);
      }
    }
    exports2.fromArray = function fromArray(array) {
      return array.reduce(function(acc, seg) {
        if (typeof seg === "string") {
          acc.push(buildSingleSegment(seg, null));
        } else if (seg.data) {
          acc.push(buildSingleSegment(seg.data, seg.mode));
        }
        return acc;
      }, []);
    };
    exports2.fromString = function fromString(data, version2) {
      const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
      const nodes = buildNodes(segs);
      const graph = buildGraph(nodes, version2);
      const path4 = dijkstra.find_path(graph.map, "start", "end");
      const optimizedSegs = [];
      for (let i = 1; i < path4.length - 1; i++) {
        optimizedSegs.push(graph.table[path4[i]].node);
      }
      return exports2.fromArray(mergeSegments(optimizedSegs));
    };
    exports2.rawSplit = function rawSplit(data) {
      return exports2.fromArray(
        getSegmentsFromString(data, Utils.isKanjiModeEnabled())
      );
    };
  }
});

// node_modules/qrcode/lib/core/qrcode.js
var require_qrcode = __commonJS({
  "node_modules/qrcode/lib/core/qrcode.js"(exports2) {
    var Utils = require_utils2();
    var ECLevel = require_error_correction_level();
    var BitBuffer = require_bit_buffer();
    var BitMatrix = require_bit_matrix();
    var AlignmentPattern = require_alignment_pattern();
    var FinderPattern = require_finder_pattern();
    var MaskPattern = require_mask_pattern();
    var ECCode = require_error_correction_code();
    var ReedSolomonEncoder = require_reed_solomon_encoder();
    var Version = require_version2();
    var FormatInfo = require_format_info();
    var Mode = require_mode();
    var Segments = require_segments();
    function setupFinderPattern(matrix, version2) {
      const size = matrix.size;
      const pos = FinderPattern.getPositions(version2);
      for (let i = 0; i < pos.length; i++) {
        const row = pos[i][0];
        const col = pos[i][1];
        for (let r = -1; r <= 7; r++) {
          if (row + r <= -1 || size <= row + r)
            continue;
          for (let c = -1; c <= 7; c++) {
            if (col + c <= -1 || size <= col + c)
              continue;
            if (r >= 0 && r <= 6 && (c === 0 || c === 6) || c >= 0 && c <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && c >= 2 && c <= 4) {
              matrix.set(row + r, col + c, true, true);
            } else {
              matrix.set(row + r, col + c, false, true);
            }
          }
        }
      }
    }
    function setupTimingPattern(matrix) {
      const size = matrix.size;
      for (let r = 8; r < size - 8; r++) {
        const value = r % 2 === 0;
        matrix.set(r, 6, value, true);
        matrix.set(6, r, value, true);
      }
    }
    function setupAlignmentPattern(matrix, version2) {
      const pos = AlignmentPattern.getPositions(version2);
      for (let i = 0; i < pos.length; i++) {
        const row = pos[i][0];
        const col = pos[i][1];
        for (let r = -2; r <= 2; r++) {
          for (let c = -2; c <= 2; c++) {
            if (r === -2 || r === 2 || c === -2 || c === 2 || r === 0 && c === 0) {
              matrix.set(row + r, col + c, true, true);
            } else {
              matrix.set(row + r, col + c, false, true);
            }
          }
        }
      }
    }
    function setupVersionInfo(matrix, version2) {
      const size = matrix.size;
      const bits = Version.getEncodedBits(version2);
      let row, col, mod2;
      for (let i = 0; i < 18; i++) {
        row = Math.floor(i / 3);
        col = i % 3 + size - 8 - 3;
        mod2 = (bits >> i & 1) === 1;
        matrix.set(row, col, mod2, true);
        matrix.set(col, row, mod2, true);
      }
    }
    function setupFormatInfo(matrix, errorCorrectionLevel, maskPattern) {
      const size = matrix.size;
      const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern);
      let i, mod2;
      for (i = 0; i < 15; i++) {
        mod2 = (bits >> i & 1) === 1;
        if (i < 6) {
          matrix.set(i, 8, mod2, true);
        } else if (i < 8) {
          matrix.set(i + 1, 8, mod2, true);
        } else {
          matrix.set(size - 15 + i, 8, mod2, true);
        }
        if (i < 8) {
          matrix.set(8, size - i - 1, mod2, true);
        } else if (i < 9) {
          matrix.set(8, 15 - i - 1 + 1, mod2, true);
        } else {
          matrix.set(8, 15 - i - 1, mod2, true);
        }
      }
      matrix.set(size - 8, 8, 1, true);
    }
    function setupData(matrix, data) {
      const size = matrix.size;
      let inc = -1;
      let row = size - 1;
      let bitIndex = 7;
      let byteIndex = 0;
      for (let col = size - 1; col > 0; col -= 2) {
        if (col === 6)
          col--;
        while (true) {
          for (let c = 0; c < 2; c++) {
            if (!matrix.isReserved(row, col - c)) {
              let dark = false;
              if (byteIndex < data.length) {
                dark = (data[byteIndex] >>> bitIndex & 1) === 1;
              }
              matrix.set(row, col - c, dark);
              bitIndex--;
              if (bitIndex === -1) {
                byteIndex++;
                bitIndex = 7;
              }
            }
          }
          row += inc;
          if (row < 0 || size <= row) {
            row -= inc;
            inc = -inc;
            break;
          }
        }
      }
    }
    function createData(version2, errorCorrectionLevel, segments) {
      const buffer = new BitBuffer();
      segments.forEach(function(data) {
        buffer.put(data.mode.bit, 4);
        buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version2));
        data.write(buffer);
      });
      const totalCodewords = Utils.getSymbolTotalCodewords(version2);
      const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel);
      const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
      if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {
        buffer.put(0, 4);
      }
      while (buffer.getLengthInBits() % 8 !== 0) {
        buffer.putBit(0);
      }
      const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8;
      for (let i = 0; i < remainingByte; i++) {
        buffer.put(i % 2 ? 17 : 236, 8);
      }
      return createCodewords(buffer, version2, errorCorrectionLevel);
    }
    function createCodewords(bitBuffer, version2, errorCorrectionLevel) {
      const totalCodewords = Utils.getSymbolTotalCodewords(version2);
      const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel);
      const dataTotalCodewords = totalCodewords - ecTotalCodewords;
      const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel);
      const blocksInGroup2 = totalCodewords % ecTotalBlocks;
      const blocksInGroup1 = ecTotalBlocks - blocksInGroup2;
      const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks);
      const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks);
      const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1;
      const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1;
      const rs = new ReedSolomonEncoder(ecCount);
      let offset2 = 0;
      const dcData = new Array(ecTotalBlocks);
      const ecData = new Array(ecTotalBlocks);
      let maxDataSize = 0;
      const buffer = new Uint8Array(bitBuffer.buffer);
      for (let b = 0; b < ecTotalBlocks; b++) {
        const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2;
        dcData[b] = buffer.slice(offset2, offset2 + dataSize);
        ecData[b] = rs.encode(dcData[b]);
        offset2 += dataSize;
        maxDataSize = Math.max(maxDataSize, dataSize);
      }
      const data = new Uint8Array(totalCodewords);
      let index = 0;
      let i, r;
      for (i = 0; i < maxDataSize; i++) {
        for (r = 0; r < ecTotalBlocks; r++) {
          if (i < dcData[r].length) {
            data[index++] = dcData[r][i];
          }
        }
      }
      for (i = 0; i < ecCount; i++) {
        for (r = 0; r < ecTotalBlocks; r++) {
          data[index++] = ecData[r][i];
        }
      }
      return data;
    }
    function createSymbol(data, version2, errorCorrectionLevel, maskPattern) {
      let segments;
      if (Array.isArray(data)) {
        segments = Segments.fromArray(data);
      } else if (typeof data === "string") {
        let estimatedVersion = version2;
        if (!estimatedVersion) {
          const rawSegments = Segments.rawSplit(data);
          estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel);
        }
        segments = Segments.fromString(data, estimatedVersion || 40);
      } else {
        throw new Error("Invalid data");
      }
      const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel);
      if (!bestVersion) {
        throw new Error("The amount of data is too big to be stored in a QR Code");
      }
      if (!version2) {
        version2 = bestVersion;
      } else if (version2 < bestVersion) {
        throw new Error(
          "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n"
        );
      }
      const dataBits = createData(version2, errorCorrectionLevel, segments);
      const moduleCount = Utils.getSymbolSize(version2);
      const modules = new BitMatrix(moduleCount);
      setupFinderPattern(modules, version2);
      setupTimingPattern(modules);
      setupAlignmentPattern(modules, version2);
      setupFormatInfo(modules, errorCorrectionLevel, 0);
      if (version2 >= 7) {
        setupVersionInfo(modules, version2);
      }
      setupData(modules, dataBits);
      if (isNaN(maskPattern)) {
        maskPattern = MaskPattern.getBestMask(
          modules,
          setupFormatInfo.bind(null, modules, errorCorrectionLevel)
        );
      }
      MaskPattern.applyMask(maskPattern, modules);
      setupFormatInfo(modules, errorCorrectionLevel, maskPattern);
      return {
        modules,
        version: version2,
        errorCorrectionLevel,
        maskPattern,
        segments
      };
    }
    exports2.create = function create(data, options) {
      if (typeof data === "undefined" || data === "") {
        throw new Error("No input text");
      }
      let errorCorrectionLevel = ECLevel.M;
      let version2;
      let mask;
      if (typeof options !== "undefined") {
        errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M);
        version2 = Version.from(options.version);
        mask = MaskPattern.from(options.maskPattern);
        if (options.toSJISFunc) {
          Utils.setToSJISFunction(options.toSJISFunc);
        }
      }
      return createSymbol(data, version2, errorCorrectionLevel, mask);
    };
  }
});

// node_modules/qrcode/lib/renderer/utils.js
var require_utils3 = __commonJS({
  "node_modules/qrcode/lib/renderer/utils.js"(exports2) {
    function hex2rgba(hex) {
      if (typeof hex === "number") {
        hex = hex.toString();
      }
      if (typeof hex !== "string") {
        throw new Error("Color should be defined as hex string");
      }
      let hexCode = hex.slice().replace("#", "").split("");
      if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
        throw new Error("Invalid hex color: " + hex);
      }
      if (hexCode.length === 3 || hexCode.length === 4) {
        hexCode = Array.prototype.concat.apply([], hexCode.map(function(c) {
          return [c, c];
        }));
      }
      if (hexCode.length === 6)
        hexCode.push("F", "F");
      const hexValue = parseInt(hexCode.join(""), 16);
      return {
        r: hexValue >> 24 & 255,
        g: hexValue >> 16 & 255,
        b: hexValue >> 8 & 255,
        a: hexValue & 255,
        hex: "#" + hexCode.slice(0, 6).join("")
      };
    }
    exports2.getOptions = function getOptions(options) {
      if (!options)
        options = {};
      if (!options.color)
        options.color = {};
      const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin;
      const width = options.width && options.width >= 21 ? options.width : void 0;
      const scale = options.scale || 4;
      return {
        width,
        scale: width ? 4 : scale,
        margin,
        color: {
          dark: hex2rgba(options.color.dark || "#000000ff"),
          light: hex2rgba(options.color.light || "#ffffffff")
        },
        type: options.type,
        rendererOpts: options.rendererOpts || {}
      };
    };
    exports2.getScale = function getScale(qrSize, opts) {
      return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale;
    };
    exports2.getImageWidth = function getImageWidth(qrSize, opts) {
      const scale = exports2.getScale(qrSize, opts);
      return Math.floor((qrSize + opts.margin * 2) * scale);
    };
    exports2.qrToImageData = function qrToImageData(imgData, qr, opts) {
      const size = qr.modules.size;
      const data = qr.modules.data;
      const scale = exports2.getScale(size, opts);
      const symbolSize = Math.floor((size + opts.margin * 2) * scale);
      const scaledMargin = opts.margin * scale;
      const palette = [opts.color.light, opts.color.dark];
      for (let i = 0; i < symbolSize; i++) {
        for (let j = 0; j < symbolSize; j++) {
          let posDst = (i * symbolSize + j) * 4;
          let pxColor = opts.color.light;
          if (i >= scaledMargin && j >= scaledMargin && i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
            const iSrc = Math.floor((i - scaledMargin) / scale);
            const jSrc = Math.floor((j - scaledMargin) / scale);
            pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0];
          }
          imgData[posDst++] = pxColor.r;
          imgData[posDst++] = pxColor.g;
          imgData[posDst++] = pxColor.b;
          imgData[posDst] = pxColor.a;
        }
      }
    };
  }
});

// node_modules/qrcode/lib/renderer/canvas.js
var require_canvas = __commonJS({
  "node_modules/qrcode/lib/renderer/canvas.js"(exports2) {
    var Utils = require_utils3();
    function clearCanvas(ctx, canvas, size) {
      ctx.clearRect(0, 0, canvas.width, canvas.height);
      if (!canvas.style)
        canvas.style = {};
      canvas.height = size;
      canvas.width = size;
      canvas.style.height = size + "px";
      canvas.style.width = size + "px";
    }
    function getCanvasElement() {
      try {
        return document.createElement("canvas");
      } catch (e) {
        throw new Error("You need to specify a canvas element");
      }
    }
    exports2.render = function render(qrData, canvas, options) {
      let opts = options;
      let canvasEl = canvas;
      if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
        opts = canvas;
        canvas = void 0;
      }
      if (!canvas) {
        canvasEl = getCanvasElement();
      }
      opts = Utils.getOptions(opts);
      const size = Utils.getImageWidth(qrData.modules.size, opts);
      const ctx = canvasEl.getContext("2d");
      const image = ctx.createImageData(size, size);
      Utils.qrToImageData(image.data, qrData, opts);
      clearCanvas(ctx, canvasEl, size);
      ctx.putImageData(image, 0, 0);
      return canvasEl;
    };
    exports2.renderToDataURL = function renderToDataURL(qrData, canvas, options) {
      let opts = options;
      if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
        opts = canvas;
        canvas = void 0;
      }
      if (!opts)
        opts = {};
      const canvasEl = exports2.render(qrData, canvas, opts);
      const type = opts.type || "image/png";
      const rendererOpts = opts.rendererOpts || {};
      return canvasEl.toDataURL(type, rendererOpts.quality);
    };
  }
});

// node_modules/qrcode/lib/renderer/svg-tag.js
var require_svg_tag = __commonJS({
  "node_modules/qrcode/lib/renderer/svg-tag.js"(exports2) {
    var Utils = require_utils3();
    function getColorAttrib(color, attrib) {
      const alpha = color.a / 255;
      const str = attrib + '="' + color.hex + '"';
      return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str;
    }
    function svgCmd(cmd, x, y) {
      let str = cmd + x;
      if (typeof y !== "undefined")
        str += " " + y;
      return str;
    }
    function qrToPath(data, size, margin) {
      let path4 = "";
      let moveBy = 0;
      let newRow = false;
      let lineLength = 0;
      for (let i = 0; i < data.length; i++) {
        const col = Math.floor(i % size);
        const row = Math.floor(i / size);
        if (!col && !newRow)
          newRow = true;
        if (data[i]) {
          lineLength++;
          if (!(i > 0 && col > 0 && data[i - 1])) {
            path4 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
            moveBy = 0;
            newRow = false;
          }
          if (!(col + 1 < size && data[i + 1])) {
            path4 += svgCmd("h", lineLength);
            lineLength = 0;
          }
        } else {
          moveBy++;
        }
      }
      return path4;
    }
    exports2.render = function render(qrData, options, cb) {
      const opts = Utils.getOptions(options);
      const size = qrData.modules.size;
      const data = qrData.modules.data;
      const qrcodesize = size + opts.margin * 2;
      const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
      const path4 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
      const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
      const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
      const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path4 + "</svg>\n";
      if (typeof cb === "function") {
        cb(null, svgTag);
      }
      return svgTag;
    };
  }
});

// node_modules/qrcode/lib/browser.js
var require_browser2 = __commonJS({
  "node_modules/qrcode/lib/browser.js"(exports2) {
    var canPromise = require_can_promise();
    var QRCode2 = require_qrcode();
    var CanvasRenderer = require_canvas();
    var SvgRenderer = require_svg_tag();
    function renderCanvas(renderFunc, canvas, text, opts, cb) {
      const args = [].slice.call(arguments, 1);
      const argsNum = args.length;
      const isLastArgCb = typeof args[argsNum - 1] === "function";
      if (!isLastArgCb && !canPromise()) {
        throw new Error("Callback required as last argument");
      }
      if (isLastArgCb) {
        if (argsNum < 2) {
          throw new Error("Too few arguments provided");
        }
        if (argsNum === 2) {
          cb = text;
          text = canvas;
          canvas = opts = void 0;
        } else if (argsNum === 3) {
          if (canvas.getContext && typeof cb === "undefined") {
            cb = opts;
            opts = void 0;
          } else {
            cb = opts;
            opts = text;
            text = canvas;
            canvas = void 0;
          }
        }
      } else {
        if (argsNum < 1) {
          throw new Error("Too few arguments provided");
        }
        if (argsNum === 1) {
          text = canvas;
          canvas = opts = void 0;
        } else if (argsNum === 2 && !canvas.getContext) {
          opts = text;
          text = canvas;
          canvas = void 0;
        }
        return new Promise(function(resolve, reject) {
          try {
            const data = QRCode2.create(text, opts);
            resolve(renderFunc(data, canvas, opts));
          } catch (e) {
            reject(e);
          }
        });
      }
      try {
        const data = QRCode2.create(text, opts);
        cb(null, renderFunc(data, canvas, opts));
      } catch (e) {
        cb(e);
      }
    }
    exports2.create = QRCode2.create;
    exports2.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
    exports2.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
    exports2.toString = renderCanvas.bind(null, function(data, _, opts) {
      return SvgRenderer.render(data, opts);
    });
  }
});

// node_modules/uc.micro/properties/Any/regex.js
var require_regex2 = __commonJS({
  "node_modules/uc.micro/properties/Any/regex.js"(exports2, module2) {
    module2.exports = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  }
});

// node_modules/uc.micro/categories/Cc/regex.js
var require_regex3 = __commonJS({
  "node_modules/uc.micro/categories/Cc/regex.js"(exports2, module2) {
    module2.exports = /[\0-\x1F\x7F-\x9F]/;
  }
});

// node_modules/uc.micro/categories/Z/regex.js
var require_regex4 = __commonJS({
  "node_modules/uc.micro/categories/Z/regex.js"(exports2, module2) {
    module2.exports = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
  }
});

// node_modules/uc.micro/categories/P/regex.js
var require_regex5 = __commonJS({
  "node_modules/uc.micro/categories/P/regex.js"(exports2, module2) {
    module2.exports = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
  }
});

// node_modules/linkify-it/lib/re.js
var require_re = __commonJS({
  "node_modules/linkify-it/lib/re.js"(exports2, module2) {
    "use strict";
    module2.exports = function(opts) {
      var re = {};
      opts = opts || {};
      re.src_Any = require_regex2().source;
      re.src_Cc = require_regex3().source;
      re.src_Z = require_regex4().source;
      re.src_P = require_regex5().source;
      re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|");
      re.src_ZCc = [re.src_Z, re.src_Cc].join("|");
      var text_separators = "[><\uFF5C]";
      re.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re.src_ZPCc + ")" + re.src_Any + ")";
      re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
      re.src_auth = "(?:(?:(?!" + re.src_ZCc + "|[@/\\[\\]()]).)+@)?";
      re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
      re.src_host_terminator = "(?=$|" + text_separators + "|" + re.src_ZPCc + ")(?!" + (opts["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + re.src_ZPCc + "))";
      re.src_path = "(?:[/?#](?:(?!" + re.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re.src_ZCc + "|[']).)+\\'|\\'(?=" + re.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re.src_ZCc + "|[.]|$)|" + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + ",(?!" + re.src_ZCc + "|$)|;(?!" + re.src_ZCc + "|$)|\\!+(?!" + re.src_ZCc + "|[!]|$)|\\?(?!" + re.src_ZCc + "|[?]|$))+|\\/)?";
      re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
      re.src_xn = "xn--[a-z0-9\\-]{1,59}";
      re.src_domain_root = // Allow letters & digits (http://test1)
      "(?:" + re.src_xn + "|" + re.src_pseudo_letter + "{1,63})";
      re.src_domain = "(?:" + re.src_xn + "|(?:" + re.src_pseudo_letter + ")|(?:" + re.src_pseudo_letter + "(?:-|" + re.src_pseudo_letter + "){0,61}" + re.src_pseudo_letter + "))";
      re.src_host = "(?:(?:(?:(?:" + re.src_domain + ")\\.)*" + re.src_domain + "))";
      re.tpl_host_fuzzy = "(?:" + re.src_ip4 + "|(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%)))";
      re.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%))";
      re.src_host_strict = re.src_host + re.src_host_terminator;
      re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;
      re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;
      re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
      re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
      re.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re.src_ZPCc + "|>|$))";
      re.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re.src_ZCc + ")(" + re.src_email_name + "@" + re.tpl_host_fuzzy_strict + ")";
      re.tpl_link_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
      // but can start with > (markdown blockquote)
      "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_fuzzy_strict + re.src_path + ")";
      re.tpl_link_no_ip_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
      // but can start with > (markdown blockquote)
      "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ")";
      return re;
    };
  }
});

// node_modules/linkify-it/index.js
var require_linkify_it = __commonJS({
  "node_modules/linkify-it/index.js"(exports2, module2) {
    "use strict";
    function assign(obj2) {
      var sources = Array.prototype.slice.call(arguments, 1);
      sources.forEach(function(source) {
        if (!source) {
          return;
        }
        Object.keys(source).forEach(function(key) {
          obj2[key] = source[key];
        });
      });
      return obj2;
    }
    function _class(obj2) {
      return Object.prototype.toString.call(obj2);
    }
    function isString(obj2) {
      return _class(obj2) === "[object String]";
    }
    function isObject2(obj2) {
      return _class(obj2) === "[object Object]";
    }
    function isRegExp(obj2) {
      return _class(obj2) === "[object RegExp]";
    }
    function isFunction(obj2) {
      return _class(obj2) === "[object Function]";
    }
    function escapeRE(str) {
      return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
    }
    var defaultOptions = {
      fuzzyLink: true,
      fuzzyEmail: true,
      fuzzyIP: false
    };
    function isOptionsObj(obj2) {
      return Object.keys(obj2 || {}).reduce(function(acc, k) {
        return acc || defaultOptions.hasOwnProperty(k);
      }, false);
    }
    var defaultSchemas = {
      "http:": {
        validate: function(text, pos, self2) {
          var tail = text.slice(pos);
          if (!self2.re.http) {
            self2.re.http = new RegExp(
              "^\\/\\/" + self2.re.src_auth + self2.re.src_host_port_strict + self2.re.src_path,
              "i"
            );
          }
          if (self2.re.http.test(tail)) {
            return tail.match(self2.re.http)[0].length;
          }
          return 0;
        }
      },
      "https:": "http:",
      "ftp:": "http:",
      "//": {
        validate: function(text, pos, self2) {
          var tail = text.slice(pos);
          if (!self2.re.no_http) {
            self2.re.no_http = new RegExp(
              "^" + self2.re.src_auth + // Don't allow single-level domains, because of false positives like '//test'
              // with code comments
              "(?:localhost|(?:(?:" + self2.re.src_domain + ")\\.)+" + self2.re.src_domain_root + ")" + self2.re.src_port + self2.re.src_host_terminator + self2.re.src_path,
              "i"
            );
          }
          if (self2.re.no_http.test(tail)) {
            if (pos >= 3 && text[pos - 3] === ":") {
              return 0;
            }
            if (pos >= 3 && text[pos - 3] === "/") {
              return 0;
            }
            return tail.match(self2.re.no_http)[0].length;
          }
          return 0;
        }
      },
      "mailto:": {
        validate: function(text, pos, self2) {
          var tail = text.slice(pos);
          if (!self2.re.mailto) {
            self2.re.mailto = new RegExp(
              "^" + self2.re.src_email_name + "@" + self2.re.src_host_strict,
              "i"
            );
          }
          if (self2.re.mailto.test(tail)) {
            return tail.match(self2.re.mailto)[0].length;
          }
          return 0;
        }
      }
    };
    var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
    var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
    function resetScanCache(self2) {
      self2.__index__ = -1;
      self2.__text_cache__ = "";
    }
    function createValidator(re) {
      return function(text, pos) {
        var tail = text.slice(pos);
        if (re.test(tail)) {
          return tail.match(re)[0].length;
        }
        return 0;
      };
    }
    function createNormalizer() {
      return function(match, self2) {
        self2.normalize(match);
      };
    }
    function compile(self2) {
      var re = self2.re = require_re()(self2.__opts__);
      var tlds = self2.__tlds__.slice();
      self2.onCompile();
      if (!self2.__tlds_replaced__) {
        tlds.push(tlds_2ch_src_re);
      }
      tlds.push(re.src_xn);
      re.src_tlds = tlds.join("|");
      function untpl(tpl) {
        return tpl.replace("%TLDS%", re.src_tlds);
      }
      re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
      re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
      re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
      re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
      var aliases = [];
      self2.__compiled__ = {};
      function schemaError(name, val) {
        throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
      }
      Object.keys(self2.__schemas__).forEach(function(name) {
        var val = self2.__schemas__[name];
        if (val === null) {
          return;
        }
        var compiled = { validate: null, link: null };
        self2.__compiled__[name] = compiled;
        if (isObject2(val)) {
          if (isRegExp(val.validate)) {
            compiled.validate = createValidator(val.validate);
          } else if (isFunction(val.validate)) {
            compiled.validate = val.validate;
          } else {
            schemaError(name, val);
          }
          if (isFunction(val.normalize)) {
            compiled.normalize = val.normalize;
          } else if (!val.normalize) {
            compiled.normalize = createNormalizer();
          } else {
            schemaError(name, val);
          }
          return;
        }
        if (isString(val)) {
          aliases.push(name);
          return;
        }
        schemaError(name, val);
      });
      aliases.forEach(function(alias) {
        if (!self2.__compiled__[self2.__schemas__[alias]]) {
          return;
        }
        self2.__compiled__[alias].validate = self2.__compiled__[self2.__schemas__[alias]].validate;
        self2.__compiled__[alias].normalize = self2.__compiled__[self2.__schemas__[alias]].normalize;
      });
      self2.__compiled__[""] = { validate: null, normalize: createNormalizer() };
      var slist = Object.keys(self2.__compiled__).filter(function(name) {
        return name.length > 0 && self2.__compiled__[name];
      }).map(escapeRE).join("|");
      self2.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "i");
      self2.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "ig");
      self2.re.schema_at_start = RegExp("^" + self2.re.schema_search.source, "i");
      self2.re.pretest = RegExp(
        "(" + self2.re.schema_test.source + ")|(" + self2.re.host_fuzzy_test.source + ")|@",
        "i"
      );
      resetScanCache(self2);
    }
    function Match(self2, shift) {
      var start2 = self2.__index__, end2 = self2.__last_index__, text = self2.__text_cache__.slice(start2, end2);
      this.schema = self2.__schema__.toLowerCase();
      this.index = start2 + shift;
      this.lastIndex = end2 + shift;
      this.raw = text;
      this.text = text;
      this.url = text;
    }
    function createMatch(self2, shift) {
      var match = new Match(self2, shift);
      self2.__compiled__[match.schema].normalize(match, self2);
      return match;
    }
    function LinkifyIt2(schemas, options) {
      if (!(this instanceof LinkifyIt2)) {
        return new LinkifyIt2(schemas, options);
      }
      if (!options) {
        if (isOptionsObj(schemas)) {
          options = schemas;
          schemas = {};
        }
      }
      this.__opts__ = assign({}, defaultOptions, options);
      this.__index__ = -1;
      this.__last_index__ = -1;
      this.__schema__ = "";
      this.__text_cache__ = "";
      this.__schemas__ = assign({}, defaultSchemas, schemas);
      this.__compiled__ = {};
      this.__tlds__ = tlds_default;
      this.__tlds_replaced__ = false;
      this.re = {};
      compile(this);
    }
    LinkifyIt2.prototype.add = function add(schema, definition) {
      this.__schemas__[schema] = definition;
      compile(this);
      return this;
    };
    LinkifyIt2.prototype.set = function set(options) {
      this.__opts__ = assign(this.__opts__, options);
      return this;
    };
    LinkifyIt2.prototype.test = function test(text) {
      this.__text_cache__ = text;
      this.__index__ = -1;
      if (!text.length) {
        return false;
      }
      var m, ml, me, len, shift, next, re, tld_pos, at_pos;
      if (this.re.schema_test.test(text)) {
        re = this.re.schema_search;
        re.lastIndex = 0;
        while ((m = re.exec(text)) !== null) {
          len = this.testSchemaAt(text, m[2], re.lastIndex);
          if (len) {
            this.__schema__ = m[2];
            this.__index__ = m.index + m[1].length;
            this.__last_index__ = m.index + m[0].length + len;
            break;
          }
        }
      }
      if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
        tld_pos = text.search(this.re.host_fuzzy_test);
        if (tld_pos >= 0) {
          if (this.__index__ < 0 || tld_pos < this.__index__) {
            if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
              shift = ml.index + ml[1].length;
              if (this.__index__ < 0 || shift < this.__index__) {
                this.__schema__ = "";
                this.__index__ = shift;
                this.__last_index__ = ml.index + ml[0].length;
              }
            }
          }
        }
      }
      if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
        at_pos = text.indexOf("@");
        if (at_pos >= 0) {
          if ((me = text.match(this.re.email_fuzzy)) !== null) {
            shift = me.index + me[1].length;
            next = me.index + me[0].length;
            if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {
              this.__schema__ = "mailto:";
              this.__index__ = shift;
              this.__last_index__ = next;
            }
          }
        }
      }
      return this.__index__ >= 0;
    };
    LinkifyIt2.prototype.pretest = function pretest(text) {
      return this.re.pretest.test(text);
    };
    LinkifyIt2.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
      if (!this.__compiled__[schema.toLowerCase()]) {
        return 0;
      }
      return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
    };
    LinkifyIt2.prototype.match = function match(text) {
      var shift = 0, result = [];
      if (this.__index__ >= 0 && this.__text_cache__ === text) {
        result.push(createMatch(this, shift));
        shift = this.__last_index__;
      }
      var tail = shift ? text.slice(shift) : text;
      while (this.test(tail)) {
        result.push(createMatch(this, shift));
        tail = tail.slice(this.__last_index__);
        shift += this.__last_index__;
      }
      if (result.length) {
        return result;
      }
      return null;
    };
    LinkifyIt2.prototype.matchAtStart = function matchAtStart(text) {
      this.__text_cache__ = text;
      this.__index__ = -1;
      if (!text.length)
        return null;
      var m = this.re.schema_at_start.exec(text);
      if (!m)
        return null;
      var len = this.testSchemaAt(text, m[2], m[0].length);
      if (!len)
        return null;
      this.__schema__ = m[2];
      this.__index__ = m.index + m[1].length;
      this.__last_index__ = m.index + m[0].length + len;
      return createMatch(this, 0);
    };
    LinkifyIt2.prototype.tlds = function tlds(list, keepOld) {
      list = Array.isArray(list) ? list : [list];
      if (!keepOld) {
        this.__tlds__ = list.slice();
        this.__tlds_replaced__ = true;
        compile(this);
        return this;
      }
      this.__tlds__ = this.__tlds__.concat(list).sort().filter(function(el, idx, arr) {
        return el !== arr[idx - 1];
      }).reverse();
      compile(this);
      return this;
    };
    LinkifyIt2.prototype.normalize = function normalize(match) {
      if (!match.schema) {
        match.url = "http://" + match.url;
      }
      if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) {
        match.url = "mailto:" + match.url;
      }
    };
    LinkifyIt2.prototype.onCompile = function onCompile() {
    };
    module2.exports = LinkifyIt2;
  }
});

// node_modules/node-machine-id/dist/index.js
var require_dist = __commonJS({
  "node_modules/node-machine-id/dist/index.js"(exports2, module2) {
    !function(t, n) {
      "object" == typeof exports2 && "object" == typeof module2 ? module2.exports = n(require("child_process"), require("crypto")) : "function" == typeof define && define.amd ? define(["child_process", "crypto"], n) : "object" == typeof exports2 ? exports2["electron-machine-id"] = n(require("child_process"), require("crypto")) : t["electron-machine-id"] = n(t.child_process, t.crypto);
    }(exports2, function(t, n) {
      return function(t2) {
        function n2(e) {
          if (r[e])
            return r[e].exports;
          var o = r[e] = { exports: {}, id: e, loaded: false };
          return t2[e].call(o.exports, o, o.exports, n2), o.loaded = true, o.exports;
        }
        var r = {};
        return n2.m = t2, n2.c = r, n2.p = "", n2(0);
      }([function(t2, n2, r) {
        t2.exports = r(34);
      }, function(t2, n2, r) {
        var e = r(29)("wks"), o = r(33), i = r(2).Symbol, c = "function" == typeof i, u = t2.exports = function(t3) {
          return e[t3] || (e[t3] = c && i[t3] || (c ? i : o)("Symbol." + t3));
        };
        u.store = e;
      }, function(t2, n2) {
        var r = t2.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
        "number" == typeof __g && (__g = r);
      }, function(t2, n2, r) {
        var e = r(9);
        t2.exports = function(t3) {
          if (!e(t3))
            throw TypeError(t3 + " is not an object!");
          return t3;
        };
      }, function(t2, n2, r) {
        t2.exports = !r(24)(function() {
          return 7 != Object.defineProperty({}, "a", { get: function() {
            return 7;
          } }).a;
        });
      }, function(t2, n2, r) {
        var e = r(12), o = r(17);
        t2.exports = r(4) ? function(t3, n3, r2) {
          return e.f(t3, n3, o(1, r2));
        } : function(t3, n3, r2) {
          return t3[n3] = r2, t3;
        };
      }, function(t2, n2) {
        var r = t2.exports = { version: "2.4.0" };
        "number" == typeof __e && (__e = r);
      }, function(t2, n2, r) {
        var e = r(14);
        t2.exports = function(t3, n3, r2) {
          if (e(t3), void 0 === n3)
            return t3;
          switch (r2) {
            case 1:
              return function(r3) {
                return t3.call(n3, r3);
              };
            case 2:
              return function(r3, e2) {
                return t3.call(n3, r3, e2);
              };
            case 3:
              return function(r3, e2, o) {
                return t3.call(n3, r3, e2, o);
              };
          }
          return function() {
            return t3.apply(n3, arguments);
          };
        };
      }, function(t2, n2) {
        var r = {}.hasOwnProperty;
        t2.exports = function(t3, n3) {
          return r.call(t3, n3);
        };
      }, function(t2, n2) {
        t2.exports = function(t3) {
          return "object" == typeof t3 ? null !== t3 : "function" == typeof t3;
        };
      }, function(t2, n2) {
        t2.exports = {};
      }, function(t2, n2) {
        var r = {}.toString;
        t2.exports = function(t3) {
          return r.call(t3).slice(8, -1);
        };
      }, function(t2, n2, r) {
        var e = r(3), o = r(26), i = r(32), c = Object.defineProperty;
        n2.f = r(4) ? Object.defineProperty : function(t3, n3, r2) {
          if (e(t3), n3 = i(n3, true), e(r2), o)
            try {
              return c(t3, n3, r2);
            } catch (t4) {
            }
          if ("get" in r2 || "set" in r2)
            throw TypeError("Accessors not supported!");
          return "value" in r2 && (t3[n3] = r2.value), t3;
        };
      }, function(t2, n2, r) {
        var e = r(42), o = r(15);
        t2.exports = function(t3) {
          return e(o(t3));
        };
      }, function(t2, n2) {
        t2.exports = function(t3) {
          if ("function" != typeof t3)
            throw TypeError(t3 + " is not a function!");
          return t3;
        };
      }, function(t2, n2) {
        t2.exports = function(t3) {
          if (void 0 == t3)
            throw TypeError("Can't call method on  " + t3);
          return t3;
        };
      }, function(t2, n2, r) {
        var e = r(9), o = r(2).document, i = e(o) && e(o.createElement);
        t2.exports = function(t3) {
          return i ? o.createElement(t3) : {};
        };
      }, function(t2, n2) {
        t2.exports = function(t3, n3) {
          return { enumerable: !(1 & t3), configurable: !(2 & t3), writable: !(4 & t3), value: n3 };
        };
      }, function(t2, n2, r) {
        var e = r(12).f, o = r(8), i = r(1)("toStringTag");
        t2.exports = function(t3, n3, r2) {
          t3 && !o(t3 = r2 ? t3 : t3.prototype, i) && e(t3, i, { configurable: true, value: n3 });
        };
      }, function(t2, n2, r) {
        var e = r(29)("keys"), o = r(33);
        t2.exports = function(t3) {
          return e[t3] || (e[t3] = o(t3));
        };
      }, function(t2, n2) {
        var r = Math.ceil, e = Math.floor;
        t2.exports = function(t3) {
          return isNaN(t3 = +t3) ? 0 : (t3 > 0 ? e : r)(t3);
        };
      }, function(t2, n2, r) {
        var e = r(11), o = r(1)("toStringTag"), i = "Arguments" == e(function() {
          return arguments;
        }()), c = function(t3, n3) {
          try {
            return t3[n3];
          } catch (t4) {
          }
        };
        t2.exports = function(t3) {
          var n3, r2, u;
          return void 0 === t3 ? "Undefined" : null === t3 ? "Null" : "string" == typeof (r2 = c(n3 = Object(t3), o)) ? r2 : i ? e(n3) : "Object" == (u = e(n3)) && "function" == typeof n3.callee ? "Arguments" : u;
        };
      }, function(t2, n2) {
        t2.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
      }, function(t2, n2, r) {
        var e = r(2), o = r(6), i = r(7), c = r(5), u = "prototype", s = function(t3, n3, r2) {
          var f2, a, p, l = t3 & s.F, v = t3 & s.G, h = t3 & s.S, d = t3 & s.P, y = t3 & s.B, _ = t3 & s.W, x = v ? o : o[n3] || (o[n3] = {}), m = x[u], w = v ? e : h ? e[n3] : (e[n3] || {})[u];
          v && (r2 = n3);
          for (f2 in r2)
            a = !l && w && void 0 !== w[f2], a && f2 in x || (p = a ? w[f2] : r2[f2], x[f2] = v && "function" != typeof w[f2] ? r2[f2] : y && a ? i(p, e) : _ && w[f2] == p ? function(t4) {
              var n4 = function(n5, r3, e2) {
                if (this instanceof t4) {
                  switch (arguments.length) {
                    case 0:
                      return new t4();
                    case 1:
                      return new t4(n5);
                    case 2:
                      return new t4(n5, r3);
                  }
                  return new t4(n5, r3, e2);
                }
                return t4.apply(this, arguments);
              };
              return n4[u] = t4[u], n4;
            }(p) : d && "function" == typeof p ? i(Function.call, p) : p, d && ((x.virtual || (x.virtual = {}))[f2] = p, t3 & s.R && m && !m[f2] && c(m, f2, p)));
        };
        s.F = 1, s.G = 2, s.S = 4, s.P = 8, s.B = 16, s.W = 32, s.U = 64, s.R = 128, t2.exports = s;
      }, function(t2, n2) {
        t2.exports = function(t3) {
          try {
            return !!t3();
          } catch (t4) {
            return true;
          }
        };
      }, function(t2, n2, r) {
        t2.exports = r(2).document && document.documentElement;
      }, function(t2, n2, r) {
        t2.exports = !r(4) && !r(24)(function() {
          return 7 != Object.defineProperty(r(16)("div"), "a", { get: function() {
            return 7;
          } }).a;
        });
      }, function(t2, n2, r) {
        "use strict";
        var e = r(28), o = r(23), i = r(57), c = r(5), u = r(8), s = r(10), f2 = r(45), a = r(18), p = r(52), l = r(1)("iterator"), v = !([].keys && "next" in [].keys()), h = "@@iterator", d = "keys", y = "values", _ = function() {
          return this;
        };
        t2.exports = function(t3, n3, r2, x, m, w, g) {
          f2(r2, n3, x);
          var b, O, j, S = function(t4) {
            if (!v && t4 in T)
              return T[t4];
            switch (t4) {
              case d:
                return function() {
                  return new r2(this, t4);
                };
              case y:
                return function() {
                  return new r2(this, t4);
                };
            }
            return function() {
              return new r2(this, t4);
            };
          }, E = n3 + " Iterator", P = m == y, M = false, T = t3.prototype, A = T[l] || T[h] || m && T[m], k = A || S(m), C = m ? P ? S("entries") : k : void 0, I = "Array" == n3 ? T.entries || A : A;
          if (I && (j = p(I.call(new t3())), j !== Object.prototype && (a(j, E, true), e || u(j, l) || c(j, l, _))), P && A && A.name !== y && (M = true, k = function() {
            return A.call(this);
          }), e && !g || !v && !M && T[l] || c(T, l, k), s[n3] = k, s[E] = _, m)
            if (b = { values: P ? k : S(y), keys: w ? k : S(d), entries: C }, g)
              for (O in b)
                O in T || i(T, O, b[O]);
            else
              o(o.P + o.F * (v || M), n3, b);
          return b;
        };
      }, function(t2, n2) {
        t2.exports = true;
      }, function(t2, n2, r) {
        var e = r(2), o = "__core-js_shared__", i = e[o] || (e[o] = {});
        t2.exports = function(t3) {
          return i[t3] || (i[t3] = {});
        };
      }, function(t2, n2, r) {
        var e, o, i, c = r(7), u = r(41), s = r(25), f2 = r(16), a = r(2), p = a.process, l = a.setImmediate, v = a.clearImmediate, h = a.MessageChannel, d = 0, y = {}, _ = "onreadystatechange", x = function() {
          var t3 = +this;
          if (y.hasOwnProperty(t3)) {
            var n3 = y[t3];
            delete y[t3], n3();
          }
        }, m = function(t3) {
          x.call(t3.data);
        };
        l && v || (l = function(t3) {
          for (var n3 = [], r2 = 1; arguments.length > r2; )
            n3.push(arguments[r2++]);
          return y[++d] = function() {
            u("function" == typeof t3 ? t3 : Function(t3), n3);
          }, e(d), d;
        }, v = function(t3) {
          delete y[t3];
        }, "process" == r(11)(p) ? e = function(t3) {
          p.nextTick(c(x, t3, 1));
        } : h ? (o = new h(), i = o.port2, o.port1.onmessage = m, e = c(i.postMessage, i, 1)) : a.addEventListener && "function" == typeof postMessage && !a.importScripts ? (e = function(t3) {
          a.postMessage(t3 + "", "*");
        }, a.addEventListener("message", m, false)) : e = _ in f2("script") ? function(t3) {
          s.appendChild(f2("script"))[_] = function() {
            s.removeChild(this), x.call(t3);
          };
        } : function(t3) {
          setTimeout(c(x, t3, 1), 0);
        }), t2.exports = { set: l, clear: v };
      }, function(t2, n2, r) {
        var e = r(20), o = Math.min;
        t2.exports = function(t3) {
          return t3 > 0 ? o(e(t3), 9007199254740991) : 0;
        };
      }, function(t2, n2, r) {
        var e = r(9);
        t2.exports = function(t3, n3) {
          if (!e(t3))
            return t3;
          var r2, o;
          if (n3 && "function" == typeof (r2 = t3.toString) && !e(o = r2.call(t3)))
            return o;
          if ("function" == typeof (r2 = t3.valueOf) && !e(o = r2.call(t3)))
            return o;
          if (!n3 && "function" == typeof (r2 = t3.toString) && !e(o = r2.call(t3)))
            return o;
          throw TypeError("Can't convert object to primitive value");
        };
      }, function(t2, n2) {
        var r = 0, e = Math.random();
        t2.exports = function(t3) {
          return "Symbol(".concat(void 0 === t3 ? "" : t3, ")_", (++r + e).toString(36));
        };
      }, function(t2, n2, r) {
        "use strict";
        function e(t3) {
          return t3 && t3.__esModule ? t3 : { default: t3 };
        }
        function o() {
          return "win32" !== process.platform ? "" : "ia32" === process.arch && process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432") ? "mixed" : "native";
        }
        function i(t3) {
          return (0, l.createHash)("sha256").update(t3).digest("hex");
        }
        function c(t3) {
          switch (h) {
            case "darwin":
              return t3.split("IOPlatformUUID")[1].split("\n")[0].replace(/\=|\s+|\"/gi, "").toLowerCase();
            case "win32":
              return t3.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi, "").toLowerCase();
            case "linux":
              return t3.toString().replace(/\r+|\n+|\s+/gi, "").toLowerCase();
            case "freebsd":
              return t3.toString().replace(/\r+|\n+|\s+/gi, "").toLowerCase();
            default:
              throw new Error("Unsupported platform: " + process.platform);
          }
        }
        function u(t3) {
          var n3 = c((0, p.execSync)(y[h]).toString());
          return t3 ? n3 : i(n3);
        }
        function s(t3) {
          return new a.default(function(n3, r2) {
            return (0, p.exec)(y[h], {}, function(e2, o2, u2) {
              if (e2)
                return r2(new Error("Error while obtaining machine id: " + e2.stack));
              var s2 = c(o2.toString());
              return n3(t3 ? s2 : i(s2));
            });
          });
        }
        Object.defineProperty(n2, "__esModule", { value: true });
        var f2 = r(35), a = e(f2);
        n2.machineIdSync = u, n2.machineId = s;
        var p = r(70), l = r(71), v = process, h = v.platform, d = { native: "%windir%\\System32", mixed: "%windir%\\sysnative\\cmd.exe /c %windir%\\System32" }, y = { darwin: "ioreg -rd1 -c IOPlatformExpertDevice", win32: d[o()] + "\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid", linux: "( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :", freebsd: "kenv -q smbios.system.uuid || sysctl -n kern.hostuuid" };
      }, function(t2, n2, r) {
        t2.exports = { default: r(36), __esModule: true };
      }, function(t2, n2, r) {
        r(66), r(68), r(69), r(67), t2.exports = r(6).Promise;
      }, function(t2, n2) {
        t2.exports = function() {
        };
      }, function(t2, n2) {
        t2.exports = function(t3, n3, r, e) {
          if (!(t3 instanceof n3) || void 0 !== e && e in t3)
            throw TypeError(r + ": incorrect invocation!");
          return t3;
        };
      }, function(t2, n2, r) {
        var e = r(13), o = r(31), i = r(62);
        t2.exports = function(t3) {
          return function(n3, r2, c) {
            var u, s = e(n3), f2 = o(s.length), a = i(c, f2);
            if (t3 && r2 != r2) {
              for (; f2 > a; )
                if (u = s[a++], u != u)
                  return true;
            } else
              for (; f2 > a; a++)
                if ((t3 || a in s) && s[a] === r2)
                  return t3 || a || 0;
            return !t3 && -1;
          };
        };
      }, function(t2, n2, r) {
        var e = r(7), o = r(44), i = r(43), c = r(3), u = r(31), s = r(64), f2 = {}, a = {}, n2 = t2.exports = function(t3, n3, r2, p, l) {
          var v, h, d, y, _ = l ? function() {
            return t3;
          } : s(t3), x = e(r2, p, n3 ? 2 : 1), m = 0;
          if ("function" != typeof _)
            throw TypeError(t3 + " is not iterable!");
          if (i(_)) {
            for (v = u(t3.length); v > m; m++)
              if (y = n3 ? x(c(h = t3[m])[0], h[1]) : x(t3[m]), y === f2 || y === a)
                return y;
          } else
            for (d = _.call(t3); !(h = d.next()).done; )
              if (y = o(d, x, h.value, n3), y === f2 || y === a)
                return y;
        };
        n2.BREAK = f2, n2.RETURN = a;
      }, function(t2, n2) {
        t2.exports = function(t3, n3, r) {
          var e = void 0 === r;
          switch (n3.length) {
            case 0:
              return e ? t3() : t3.call(r);
            case 1:
              return e ? t3(n3[0]) : t3.call(r, n3[0]);
            case 2:
              return e ? t3(n3[0], n3[1]) : t3.call(r, n3[0], n3[1]);
            case 3:
              return e ? t3(n3[0], n3[1], n3[2]) : t3.call(r, n3[0], n3[1], n3[2]);
            case 4:
              return e ? t3(n3[0], n3[1], n3[2], n3[3]) : t3.call(r, n3[0], n3[1], n3[2], n3[3]);
          }
          return t3.apply(r, n3);
        };
      }, function(t2, n2, r) {
        var e = r(11);
        t2.exports = Object("z").propertyIsEnumerable(0) ? Object : function(t3) {
          return "String" == e(t3) ? t3.split("") : Object(t3);
        };
      }, function(t2, n2, r) {
        var e = r(10), o = r(1)("iterator"), i = Array.prototype;
        t2.exports = function(t3) {
          return void 0 !== t3 && (e.Array === t3 || i[o] === t3);
        };
      }, function(t2, n2, r) {
        var e = r(3);
        t2.exports = function(t3, n3, r2, o) {
          try {
            return o ? n3(e(r2)[0], r2[1]) : n3(r2);
          } catch (n4) {
            var i = t3.return;
            throw void 0 !== i && e(i.call(t3)), n4;
          }
        };
      }, function(t2, n2, r) {
        "use strict";
        var e = r(49), o = r(17), i = r(18), c = {};
        r(5)(c, r(1)("iterator"), function() {
          return this;
        }), t2.exports = function(t3, n3, r2) {
          t3.prototype = e(c, { next: o(1, r2) }), i(t3, n3 + " Iterator");
        };
      }, function(t2, n2, r) {
        var e = r(1)("iterator"), o = false;
        try {
          var i = [7][e]();
          i.return = function() {
            o = true;
          }, Array.from(i, function() {
            throw 2;
          });
        } catch (t3) {
        }
        t2.exports = function(t3, n3) {
          if (!n3 && !o)
            return false;
          var r2 = false;
          try {
            var i2 = [7], c = i2[e]();
            c.next = function() {
              return { done: r2 = true };
            }, i2[e] = function() {
              return c;
            }, t3(i2);
          } catch (t4) {
          }
          return r2;
        };
      }, function(t2, n2) {
        t2.exports = function(t3, n3) {
          return { value: n3, done: !!t3 };
        };
      }, function(t2, n2, r) {
        var e = r(2), o = r(30).set, i = e.MutationObserver || e.WebKitMutationObserver, c = e.process, u = e.Promise, s = "process" == r(11)(c);
        t2.exports = function() {
          var t3, n3, r2, f2 = function() {
            var e2, o2;
            for (s && (e2 = c.domain) && e2.exit(); t3; ) {
              o2 = t3.fn, t3 = t3.next;
              try {
                o2();
              } catch (e3) {
                throw t3 ? r2() : n3 = void 0, e3;
              }
            }
            n3 = void 0, e2 && e2.enter();
          };
          if (s)
            r2 = function() {
              c.nextTick(f2);
            };
          else if (i) {
            var a = true, p = document.createTextNode("");
            new i(f2).observe(p, { characterData: true }), r2 = function() {
              p.data = a = !a;
            };
          } else if (u && u.resolve) {
            var l = u.resolve();
            r2 = function() {
              l.then(f2);
            };
          } else
            r2 = function() {
              o.call(e, f2);
            };
          return function(e2) {
            var o2 = { fn: e2, next: void 0 };
            n3 && (n3.next = o2), t3 || (t3 = o2, r2()), n3 = o2;
          };
        };
      }, function(t2, n2, r) {
        var e = r(3), o = r(50), i = r(22), c = r(19)("IE_PROTO"), u = function() {
        }, s = "prototype", f2 = function() {
          var t3, n3 = r(16)("iframe"), e2 = i.length, o2 = ">";
          for (n3.style.display = "none", r(25).appendChild(n3), n3.src = "javascript:", t3 = n3.contentWindow.document, t3.open(), t3.write("<script>document.F=Object<\/script" + o2), t3.close(), f2 = t3.F; e2--; )
            delete f2[s][i[e2]];
          return f2();
        };
        t2.exports = Object.create || function(t3, n3) {
          var r2;
          return null !== t3 ? (u[s] = e(t3), r2 = new u(), u[s] = null, r2[c] = t3) : r2 = f2(), void 0 === n3 ? r2 : o(r2, n3);
        };
      }, function(t2, n2, r) {
        var e = r(12), o = r(3), i = r(54);
        t2.exports = r(4) ? Object.defineProperties : function(t3, n3) {
          o(t3);
          for (var r2, c = i(n3), u = c.length, s = 0; u > s; )
            e.f(t3, r2 = c[s++], n3[r2]);
          return t3;
        };
      }, function(t2, n2, r) {
        var e = r(55), o = r(17), i = r(13), c = r(32), u = r(8), s = r(26), f2 = Object.getOwnPropertyDescriptor;
        n2.f = r(4) ? f2 : function(t3, n3) {
          if (t3 = i(t3), n3 = c(n3, true), s)
            try {
              return f2(t3, n3);
            } catch (t4) {
            }
          if (u(t3, n3))
            return o(!e.f.call(t3, n3), t3[n3]);
        };
      }, function(t2, n2, r) {
        var e = r(8), o = r(63), i = r(19)("IE_PROTO"), c = Object.prototype;
        t2.exports = Object.getPrototypeOf || function(t3) {
          return t3 = o(t3), e(t3, i) ? t3[i] : "function" == typeof t3.constructor && t3 instanceof t3.constructor ? t3.constructor.prototype : t3 instanceof Object ? c : null;
        };
      }, function(t2, n2, r) {
        var e = r(8), o = r(13), i = r(39)(false), c = r(19)("IE_PROTO");
        t2.exports = function(t3, n3) {
          var r2, u = o(t3), s = 0, f2 = [];
          for (r2 in u)
            r2 != c && e(u, r2) && f2.push(r2);
          for (; n3.length > s; )
            e(u, r2 = n3[s++]) && (~i(f2, r2) || f2.push(r2));
          return f2;
        };
      }, function(t2, n2, r) {
        var e = r(53), o = r(22);
        t2.exports = Object.keys || function(t3) {
          return e(t3, o);
        };
      }, function(t2, n2) {
        n2.f = {}.propertyIsEnumerable;
      }, function(t2, n2, r) {
        var e = r(5);
        t2.exports = function(t3, n3, r2) {
          for (var o in n3)
            r2 && t3[o] ? t3[o] = n3[o] : e(t3, o, n3[o]);
          return t3;
        };
      }, function(t2, n2, r) {
        t2.exports = r(5);
      }, function(t2, n2, r) {
        var e = r(9), o = r(3), i = function(t3, n3) {
          if (o(t3), !e(n3) && null !== n3)
            throw TypeError(n3 + ": can't set as prototype!");
        };
        t2.exports = { set: Object.setPrototypeOf || ("__proto__" in {} ? function(t3, n3, e2) {
          try {
            e2 = r(7)(Function.call, r(51).f(Object.prototype, "__proto__").set, 2), e2(t3, []), n3 = !(t3 instanceof Array);
          } catch (t4) {
            n3 = true;
          }
          return function(t4, r2) {
            return i(t4, r2), n3 ? t4.__proto__ = r2 : e2(t4, r2), t4;
          };
        }({}, false) : void 0), check: i };
      }, function(t2, n2, r) {
        "use strict";
        var e = r(2), o = r(6), i = r(12), c = r(4), u = r(1)("species");
        t2.exports = function(t3) {
          var n3 = "function" == typeof o[t3] ? o[t3] : e[t3];
          c && n3 && !n3[u] && i.f(n3, u, { configurable: true, get: function() {
            return this;
          } });
        };
      }, function(t2, n2, r) {
        var e = r(3), o = r(14), i = r(1)("species");
        t2.exports = function(t3, n3) {
          var r2, c = e(t3).constructor;
          return void 0 === c || void 0 == (r2 = e(c)[i]) ? n3 : o(r2);
        };
      }, function(t2, n2, r) {
        var e = r(20), o = r(15);
        t2.exports = function(t3) {
          return function(n3, r2) {
            var i, c, u = String(o(n3)), s = e(r2), f2 = u.length;
            return s < 0 || s >= f2 ? t3 ? "" : void 0 : (i = u.charCodeAt(s), i < 55296 || i > 56319 || s + 1 === f2 || (c = u.charCodeAt(s + 1)) < 56320 || c > 57343 ? t3 ? u.charAt(s) : i : t3 ? u.slice(s, s + 2) : (i - 55296 << 10) + (c - 56320) + 65536);
          };
        };
      }, function(t2, n2, r) {
        var e = r(20), o = Math.max, i = Math.min;
        t2.exports = function(t3, n3) {
          return t3 = e(t3), t3 < 0 ? o(t3 + n3, 0) : i(t3, n3);
        };
      }, function(t2, n2, r) {
        var e = r(15);
        t2.exports = function(t3) {
          return Object(e(t3));
        };
      }, function(t2, n2, r) {
        var e = r(21), o = r(1)("iterator"), i = r(10);
        t2.exports = r(6).getIteratorMethod = function(t3) {
          if (void 0 != t3)
            return t3[o] || t3["@@iterator"] || i[e(t3)];
        };
      }, function(t2, n2, r) {
        "use strict";
        var e = r(37), o = r(47), i = r(10), c = r(13);
        t2.exports = r(27)(Array, "Array", function(t3, n3) {
          this._t = c(t3), this._i = 0, this._k = n3;
        }, function() {
          var t3 = this._t, n3 = this._k, r2 = this._i++;
          return !t3 || r2 >= t3.length ? (this._t = void 0, o(1)) : "keys" == n3 ? o(0, r2) : "values" == n3 ? o(0, t3[r2]) : o(0, [r2, t3[r2]]);
        }, "values"), i.Arguments = i.Array, e("keys"), e("values"), e("entries");
      }, function(t2, n2) {
      }, function(t2, n2, r) {
        "use strict";
        var e, o, i, c = r(28), u = r(2), s = r(7), f2 = r(21), a = r(23), p = r(9), l = (r(3), r(14)), v = r(38), h = r(40), d = (r(58).set, r(60)), y = r(30).set, _ = r(48)(), x = "Promise", m = u.TypeError, w = u.process, g = u[x], w = u.process, b = "process" == f2(w), O = function() {
        }, j = !!function() {
          try {
            var t3 = g.resolve(1), n3 = (t3.constructor = {})[r(1)("species")] = function(t4) {
              t4(O, O);
            };
            return (b || "function" == typeof PromiseRejectionEvent) && t3.then(O) instanceof n3;
          } catch (t4) {
          }
        }(), S = function(t3, n3) {
          return t3 === n3 || t3 === g && n3 === i;
        }, E = function(t3) {
          var n3;
          return !(!p(t3) || "function" != typeof (n3 = t3.then)) && n3;
        }, P = function(t3) {
          return S(g, t3) ? new M(t3) : new o(t3);
        }, M = o = function(t3) {
          var n3, r2;
          this.promise = new t3(function(t4, e2) {
            if (void 0 !== n3 || void 0 !== r2)
              throw m("Bad Promise constructor");
            n3 = t4, r2 = e2;
          }), this.resolve = l(n3), this.reject = l(r2);
        }, T = function(t3) {
          try {
            t3();
          } catch (t4) {
            return { error: t4 };
          }
        }, A = function(t3, n3) {
          if (!t3._n) {
            t3._n = true;
            var r2 = t3._c;
            _(function() {
              for (var e2 = t3._v, o2 = 1 == t3._s, i2 = 0, c2 = function(n4) {
                var r3, i3, c3 = o2 ? n4.ok : n4.fail, u2 = n4.resolve, s2 = n4.reject, f3 = n4.domain;
                try {
                  c3 ? (o2 || (2 == t3._h && I(t3), t3._h = 1), c3 === true ? r3 = e2 : (f3 && f3.enter(), r3 = c3(e2), f3 && f3.exit()), r3 === n4.promise ? s2(m("Promise-chain cycle")) : (i3 = E(r3)) ? i3.call(r3, u2, s2) : u2(r3)) : s2(e2);
                } catch (t4) {
                  s2(t4);
                }
              }; r2.length > i2; )
                c2(r2[i2++]);
              t3._c = [], t3._n = false, n3 && !t3._h && k(t3);
            });
          }
        }, k = function(t3) {
          y.call(u, function() {
            var n3, r2, e2, o2 = t3._v;
            if (C(t3) && (n3 = T(function() {
              b ? w.emit("unhandledRejection", o2, t3) : (r2 = u.onunhandledrejection) ? r2({ promise: t3, reason: o2 }) : (e2 = u.console) && e2.error && e2.error("Unhandled promise rejection", o2);
            }), t3._h = b || C(t3) ? 2 : 1), t3._a = void 0, n3)
              throw n3.error;
          });
        }, C = function(t3) {
          if (1 == t3._h)
            return false;
          for (var n3, r2 = t3._a || t3._c, e2 = 0; r2.length > e2; )
            if (n3 = r2[e2++], n3.fail || !C(n3.promise))
              return false;
          return true;
        }, I = function(t3) {
          y.call(u, function() {
            var n3;
            b ? w.emit("rejectionHandled", t3) : (n3 = u.onrejectionhandled) && n3({ promise: t3, reason: t3._v });
          });
        }, R = function(t3) {
          var n3 = this;
          n3._d || (n3._d = true, n3 = n3._w || n3, n3._v = t3, n3._s = 2, n3._a || (n3._a = n3._c.slice()), A(n3, true));
        }, F = function(t3) {
          var n3, r2 = this;
          if (!r2._d) {
            r2._d = true, r2 = r2._w || r2;
            try {
              if (r2 === t3)
                throw m("Promise can't be resolved itself");
              (n3 = E(t3)) ? _(function() {
                var e2 = { _w: r2, _d: false };
                try {
                  n3.call(t3, s(F, e2, 1), s(R, e2, 1));
                } catch (t4) {
                  R.call(e2, t4);
                }
              }) : (r2._v = t3, r2._s = 1, A(r2, false));
            } catch (t4) {
              R.call({ _w: r2, _d: false }, t4);
            }
          }
        };
        j || (g = function(t3) {
          v(this, g, x, "_h"), l(t3), e.call(this);
          try {
            t3(s(F, this, 1), s(R, this, 1));
          } catch (t4) {
            R.call(this, t4);
          }
        }, e = function(t3) {
          this._c = [], this._a = void 0, this._s = 0, this._d = false, this._v = void 0, this._h = 0, this._n = false;
        }, e.prototype = r(56)(g.prototype, { then: function(t3, n3) {
          var r2 = P(d(this, g));
          return r2.ok = "function" != typeof t3 || t3, r2.fail = "function" == typeof n3 && n3, r2.domain = b ? w.domain : void 0, this._c.push(r2), this._a && this._a.push(r2), this._s && A(this, false), r2.promise;
        }, catch: function(t3) {
          return this.then(void 0, t3);
        } }), M = function() {
          var t3 = new e();
          this.promise = t3, this.resolve = s(F, t3, 1), this.reject = s(R, t3, 1);
        }), a(a.G + a.W + a.F * !j, { Promise: g }), r(18)(g, x), r(59)(x), i = r(6)[x], a(a.S + a.F * !j, x, { reject: function(t3) {
          var n3 = P(this), r2 = n3.reject;
          return r2(t3), n3.promise;
        } }), a(a.S + a.F * (c || !j), x, { resolve: function(t3) {
          if (t3 instanceof g && S(t3.constructor, this))
            return t3;
          var n3 = P(this), r2 = n3.resolve;
          return r2(t3), n3.promise;
        } }), a(a.S + a.F * !(j && r(46)(function(t3) {
          g.all(t3).catch(O);
        })), x, { all: function(t3) {
          var n3 = this, r2 = P(n3), e2 = r2.resolve, o2 = r2.reject, i2 = T(function() {
            var r3 = [], i3 = 0, c2 = 1;
            h(t3, false, function(t4) {
              var u2 = i3++, s2 = false;
              r3.push(void 0), c2++, n3.resolve(t4).then(function(t5) {
                s2 || (s2 = true, r3[u2] = t5, --c2 || e2(r3));
              }, o2);
            }), --c2 || e2(r3);
          });
          return i2 && o2(i2.error), r2.promise;
        }, race: function(t3) {
          var n3 = this, r2 = P(n3), e2 = r2.reject, o2 = T(function() {
            h(t3, false, function(t4) {
              n3.resolve(t4).then(r2.resolve, e2);
            });
          });
          return o2 && e2(o2.error), r2.promise;
        } });
      }, function(t2, n2, r) {
        "use strict";
        var e = r(61)(true);
        r(27)(String, "String", function(t3) {
          this._t = String(t3), this._i = 0;
        }, function() {
          var t3, n3 = this._t, r2 = this._i;
          return r2 >= n3.length ? { value: void 0, done: true } : (t3 = e(n3, r2), this._i += t3.length, { value: t3, done: false });
        });
      }, function(t2, n2, r) {
        r(65);
        for (var e = r(2), o = r(5), i = r(10), c = r(1)("toStringTag"), u = ["NodeList", "DOMTokenList", "MediaList", "StyleSheetList", "CSSRuleList"], s = 0; s < 5; s++) {
          var f2 = u[s], a = e[f2], p = a && a.prototype;
          p && !p[c] && o(p, c, f2), i[f2] = i.Array;
        }
      }, function(t2, n2) {
        t2.exports = require("child_process");
      }, function(t2, n2) {
        t2.exports = require("crypto");
      }]);
    });
  }
});

// node_modules/node-telegram-bot-api/src/utils.js
var require_utils4 = __commonJS({
  "node_modules/node-telegram-bot-api/src/utils.js"(exports2) {
    var util = require("util");
    exports2.deprecate = (msg) => util.deprecate(() => {
    }, msg, "node-telegram-bot-api")();
  }
});

// node_modules/object-keys/isArguments.js
var require_isArguments = __commonJS({
  "node_modules/object-keys/isArguments.js"(exports2, module2) {
    "use strict";
    var toStr = Object.prototype.toString;
    module2.exports = function isArguments(value) {
      var str = toStr.call(value);
      var isArgs = str === "[object Arguments]";
      if (!isArgs) {
        isArgs = str !== "[object Array]" && value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && toStr.call(value.callee) === "[object Function]";
      }
      return isArgs;
    };
  }
});

// node_modules/object-keys/implementation.js
var require_implementation = __commonJS({
  "node_modules/object-keys/implementation.js"(exports2, module2) {
    "use strict";
    var keysShim;
    if (!Object.keys) {
      has = Object.prototype.hasOwnProperty;
      toStr = Object.prototype.toString;
      isArgs = require_isArguments();
      isEnumerable = Object.prototype.propertyIsEnumerable;
      hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString");
      hasProtoEnumBug = isEnumerable.call(function() {
      }, "prototype");
      dontEnums = [
        "toString",
        "toLocaleString",
        "valueOf",
        "hasOwnProperty",
        "isPrototypeOf",
        "propertyIsEnumerable",
        "constructor"
      ];
      equalsConstructorPrototype = function(o) {
        var ctor = o.constructor;
        return ctor && ctor.prototype === o;
      };
      excludedKeys = {
        $applicationCache: true,
        $console: true,
        $external: true,
        $frame: true,
        $frameElement: true,
        $frames: true,
        $innerHeight: true,
        $innerWidth: true,
        $onmozfullscreenchange: true,
        $onmozfullscreenerror: true,
        $outerHeight: true,
        $outerWidth: true,
        $pageXOffset: true,
        $pageYOffset: true,
        $parent: true,
        $scrollLeft: true,
        $scrollTop: true,
        $scrollX: true,
        $scrollY: true,
        $self: true,
        $webkitIndexedDB: true,
        $webkitStorageInfo: true,
        $window: true
      };
      hasAutomationEqualityBug = function() {
        if (typeof window === "undefined") {
          return false;
        }
        for (var k in window) {
          try {
            if (!excludedKeys["$" + k] && has.call(window, k) && window[k] !== null && typeof window[k] === "object") {
              try {
                equalsConstructorPrototype(window[k]);
              } catch (e) {
                return true;
              }
            }
          } catch (e) {
            return true;
          }
        }
        return false;
      }();
      equalsConstructorPrototypeIfNotBuggy = function(o) {
        if (typeof window === "undefined" || !hasAutomationEqualityBug) {
          return equalsConstructorPrototype(o);
        }
        try {
          return equalsConstructorPrototype(o);
        } catch (e) {
          return false;
        }
      };
      keysShim = function keys(object) {
        var isObject2 = object !== null && typeof object === "object";
        var isFunction = toStr.call(object) === "[object Function]";
        var isArguments = isArgs(object);
        var isString = isObject2 && toStr.call(object) === "[object String]";
        var theKeys = [];
        if (!isObject2 && !isFunction && !isArguments) {
          throw new TypeError("Object.keys called on a non-object");
        }
        var skipProto = hasProtoEnumBug && isFunction;
        if (isString && object.length > 0 && !has.call(object, 0)) {
          for (var i = 0; i < object.length; ++i) {
            theKeys.push(String(i));
          }
        }
        if (isArguments && object.length > 0) {
          for (var j = 0; j < object.length; ++j) {
            theKeys.push(String(j));
          }
        } else {
          for (var name in object) {
            if (!(skipProto && name === "prototype") && has.call(object, name)) {
              theKeys.push(String(name));
            }
          }
        }
        if (hasDontEnumBug) {
          var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
          for (var k = 0; k < dontEnums.length; ++k) {
            if (!(skipConstructor && dontEnums[k] === "constructor") && has.call(object, dontEnums[k])) {
              theKeys.push(dontEnums[k]);
            }
          }
        }
        return theKeys;
      };
    }
    var has;
    var toStr;
    var isArgs;
    var isEnumerable;
    var hasDontEnumBug;
    var hasProtoEnumBug;
    var dontEnums;
    var equalsConstructorPrototype;
    var excludedKeys;
    var hasAutomationEqualityBug;
    var equalsConstructorPrototypeIfNotBuggy;
    module2.exports = keysShim;
  }
});

// node_modules/object-keys/index.js
var require_object_keys = __commonJS({
  "node_modules/object-keys/index.js"(exports2, module2) {
    "use strict";
    var slice = Array.prototype.slice;
    var isArgs = require_isArguments();
    var origKeys = Object.keys;
    var keysShim = origKeys ? function keys(o) {
      return origKeys(o);
    } : require_implementation();
    var originalKeys = Object.keys;
    keysShim.shim = function shimObjectKeys() {
      if (Object.keys) {
        var keysWorksWithArguments = function() {
          var args = Object.keys(arguments);
          return args && args.length === arguments.length;
        }(1, 2);
        if (!keysWorksWithArguments) {
          Object.keys = function keys(object) {
            if (isArgs(object)) {
              return originalKeys(slice.call(object));
            }
            return originalKeys(object);
          };
        }
      } else {
        Object.keys = keysShim;
      }
      return Object.keys || keysShim;
    };
    module2.exports = keysShim;
  }
});

// node_modules/es-errors/index.js
var require_es_errors = __commonJS({
  "node_modules/es-errors/index.js"(exports2, module2) {
    "use strict";
    module2.exports = Error;
  }
});

// node_modules/es-errors/eval.js
var require_eval = __commonJS({
  "node_modules/es-errors/eval.js"(exports2, module2) {
    "use strict";
    module2.exports = EvalError;
  }
});

// node_modules/es-errors/range.js
var require_range = __commonJS({
  "node_modules/es-errors/range.js"(exports2, module2) {
    "use strict";
    module2.exports = RangeError;
  }
});

// node_modules/es-errors/ref.js
var require_ref = __commonJS({
  "node_modules/es-errors/ref.js"(exports2, module2) {
    "use strict";
    module2.exports = ReferenceError;
  }
});

// node_modules/es-errors/syntax.js
var require_syntax = __commonJS({
  "node_modules/es-errors/syntax.js"(exports2, module2) {
    "use strict";
    module2.exports = SyntaxError;
  }
});

// node_modules/es-errors/type.js
var require_type = __commonJS({
  "node_modules/es-errors/type.js"(exports2, module2) {
    "use strict";
    module2.exports = TypeError;
  }
});

// node_modules/es-errors/uri.js
var require_uri = __commonJS({
  "node_modules/es-errors/uri.js"(exports2, module2) {
    "use strict";
    module2.exports = URIError;
  }
});

// node_modules/has-symbols/shams.js
var require_shams = __commonJS({
  "node_modules/has-symbols/shams.js"(exports2, module2) {
    "use strict";
    module2.exports = function hasSymbols() {
      if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
        return false;
      }
      if (typeof Symbol.iterator === "symbol") {
        return true;
      }
      var obj2 = {};
      var sym = Symbol("test");
      var symObj = Object(sym);
      if (typeof sym === "string") {
        return false;
      }
      if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
        return false;
      }
      if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
        return false;
      }
      var symVal = 42;
      obj2[sym] = symVal;
      for (sym in obj2) {
        return false;
      }
      if (typeof Object.keys === "function" && Object.keys(obj2).length !== 0) {
        return false;
      }
      if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj2).length !== 0) {
        return false;
      }
      var syms = Object.getOwnPropertySymbols(obj2);
      if (syms.length !== 1 || syms[0] !== sym) {
        return false;
      }
      if (!Object.prototype.propertyIsEnumerable.call(obj2, sym)) {
        return false;
      }
      if (typeof Object.getOwnPropertyDescriptor === "function") {
        var descriptor = Object.getOwnPropertyDescriptor(obj2, sym);
        if (descriptor.value !== symVal || descriptor.enumerable !== true) {
          return false;
        }
      }
      return true;
    };
  }
});

// node_modules/has-symbols/index.js
var require_has_symbols = __commonJS({
  "node_modules/has-symbols/index.js"(exports2, module2) {
    "use strict";
    var origSymbol = typeof Symbol !== "undefined" && Symbol;
    var hasSymbolSham = require_shams();
    module2.exports = function hasNativeSymbols() {
      if (typeof origSymbol !== "function") {
        return false;
      }
      if (typeof Symbol !== "function") {
        return false;
      }
      if (typeof origSymbol("foo") !== "symbol") {
        return false;
      }
      if (typeof Symbol("bar") !== "symbol") {
        return false;
      }
      return hasSymbolSham();
    };
  }
});

// node_modules/has-proto/index.js
var require_has_proto = __commonJS({
  "node_modules/has-proto/index.js"(exports2, module2) {
    "use strict";
    var test = {
      __proto__: null,
      foo: {}
    };
    var $Object = Object;
    module2.exports = function hasProto() {
      return { __proto__: test }.foo === test.foo && !(test instanceof $Object);
    };
  }
});

// node_modules/function-bind/implementation.js
var require_implementation2 = __commonJS({
  "node_modules/function-bind/implementation.js"(exports2, module2) {
    "use strict";
    var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
    var toStr = Object.prototype.toString;
    var max2 = Math.max;
    var funcType = "[object Function]";
    var concatty = function concatty2(a, b) {
      var arr = [];
      for (var i = 0; i < a.length; i += 1) {
        arr[i] = a[i];
      }
      for (var j = 0; j < b.length; j += 1) {
        arr[j + a.length] = b[j];
      }
      return arr;
    };
    var slicy = function slicy2(arrLike, offset2) {
      var arr = [];
      for (var i = offset2 || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
        arr[j] = arrLike[i];
      }
      return arr;
    };
    var joiny = function(arr, joiner) {
      var str = "";
      for (var i = 0; i < arr.length; i += 1) {
        str += arr[i];
        if (i + 1 < arr.length) {
          str += joiner;
        }
      }
      return str;
    };
    module2.exports = function bind(that) {
      var target = this;
      if (typeof target !== "function" || toStr.apply(target) !== funcType) {
        throw new TypeError(ERROR_MESSAGE + target);
      }
      var args = slicy(arguments, 1);
      var bound;
      var binder = function() {
        if (this instanceof bound) {
          var result = target.apply(
            this,
            concatty(args, arguments)
          );
          if (Object(result) === result) {
            return result;
          }
          return this;
        }
        return target.apply(
          that,
          concatty(args, arguments)
        );
      };
      var boundLength = max2(0, target.length - args.length);
      var boundArgs = [];
      for (var i = 0; i < boundLength; i++) {
        boundArgs[i] = "$" + i;
      }
      bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
      if (target.prototype) {
        var Empty = function Empty2() {
        };
        Empty.prototype = target.prototype;
        bound.prototype = new Empty();
        Empty.prototype = null;
      }
      return bound;
    };
  }
});

// node_modules/function-bind/index.js
var require_function_bind = __commonJS({
  "node_modules/function-bind/index.js"(exports2, module2) {
    "use strict";
    var implementation = require_implementation2();
    module2.exports = Function.prototype.bind || implementation;
  }
});

// node_modules/hasown/index.js
var require_hasown = __commonJS({
  "node_modules/hasown/index.js"(exports2, module2) {
    "use strict";
    var call = Function.prototype.call;
    var $hasOwn = Object.prototype.hasOwnProperty;
    var bind = require_function_bind();
    module2.exports = bind.call(call, $hasOwn);
  }
});

// node_modules/get-intrinsic/index.js
var require_get_intrinsic = __commonJS({
  "node_modules/get-intrinsic/index.js"(exports2, module2) {
    "use strict";
    var undefined2;
    var $Error = require_es_errors();
    var $EvalError = require_eval();
    var $RangeError = require_range();
    var $ReferenceError = require_ref();
    var $SyntaxError = require_syntax();
    var $TypeError = require_type();
    var $URIError = require_uri();
    var $Function = Function;
    var getEvalledConstructor = function(expressionSyntax) {
      try {
        return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
      } catch (e) {
      }
    };
    var $gOPD = Object.getOwnPropertyDescriptor;
    if ($gOPD) {
      try {
        $gOPD({}, "");
      } catch (e) {
        $gOPD = null;
      }
    }
    var throwTypeError = function() {
      throw new $TypeError();
    };
    var ThrowTypeError = $gOPD ? function() {
      try {
        arguments.callee;
        return throwTypeError;
      } catch (calleeThrows) {
        try {
          return $gOPD(arguments, "callee").get;
        } catch (gOPDthrows) {
          return throwTypeError;
        }
      }
    }() : throwTypeError;
    var hasSymbols = require_has_symbols()();
    var hasProto = require_has_proto()();
    var getProto = Object.getPrototypeOf || (hasProto ? function(x) {
      return x.__proto__;
    } : null);
    var needsEval = {};
    var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
    var INTRINSICS = {
      __proto__: null,
      "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
      "%Array%": Array,
      "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
      "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
      "%AsyncFromSyncIteratorPrototype%": undefined2,
      "%AsyncFunction%": needsEval,
      "%AsyncGenerator%": needsEval,
      "%AsyncGeneratorFunction%": needsEval,
      "%AsyncIteratorPrototype%": needsEval,
      "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
      "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
      "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
      "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
      "%Boolean%": Boolean,
      "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
      "%Date%": Date,
      "%decodeURI%": decodeURI,
      "%decodeURIComponent%": decodeURIComponent,
      "%encodeURI%": encodeURI,
      "%encodeURIComponent%": encodeURIComponent,
      "%Error%": $Error,
      "%eval%": eval,
      // eslint-disable-line no-eval
      "%EvalError%": $EvalError,
      "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
      "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
      "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
      "%Function%": $Function,
      "%GeneratorFunction%": needsEval,
      "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
      "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
      "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
      "%isFinite%": isFinite,
      "%isNaN%": isNaN,
      "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
      "%JSON%": typeof JSON === "object" ? JSON : undefined2,
      "%Map%": typeof Map === "undefined" ? undefined2 : Map,
      "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
      "%Math%": Math,
      "%Number%": Number,
      "%Object%": Object,
      "%parseFloat%": parseFloat,
      "%parseInt%": parseInt,
      "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
      "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
      "%RangeError%": $RangeError,
      "%ReferenceError%": $ReferenceError,
      "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
      "%RegExp%": RegExp,
      "%Set%": typeof Set === "undefined" ? undefined2 : Set,
      "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
      "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
      "%String%": String,
      "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
      "%Symbol%": hasSymbols ? Symbol : undefined2,
      "%SyntaxError%": $SyntaxError,
      "%ThrowTypeError%": ThrowTypeError,
      "%TypedArray%": TypedArray,
      "%TypeError%": $TypeError,
      "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
      "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
      "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
      "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
      "%URIError%": $URIError,
      "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
      "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
      "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
    };
    if (getProto) {
      try {
        null.error;
      } catch (e) {
        errorProto = getProto(getProto(e));
        INTRINSICS["%Error.prototype%"] = errorProto;
      }
    }
    var errorProto;
    var doEval = function doEval2(name) {
      var value;
      if (name === "%AsyncFunction%") {
        value = getEvalledConstructor("async function () {}");
      } else if (name === "%GeneratorFunction%") {
        value = getEvalledConstructor("function* () {}");
      } else if (name === "%AsyncGeneratorFunction%") {
        value = getEvalledConstructor("async function* () {}");
      } else if (name === "%AsyncGenerator%") {
        var fn2 = doEval2("%AsyncGeneratorFunction%");
        if (fn2) {
          value = fn2.prototype;
        }
      } else if (name === "%AsyncIteratorPrototype%") {
        var gen = doEval2("%AsyncGenerator%");
        if (gen && getProto) {
          value = getProto(gen.prototype);
        }
      }
      INTRINSICS[name] = value;
      return value;
    };
    var LEGACY_ALIASES = {
      __proto__: null,
      "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
      "%ArrayPrototype%": ["Array", "prototype"],
      "%ArrayProto_entries%": ["Array", "prototype", "entries"],
      "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
      "%ArrayProto_keys%": ["Array", "prototype", "keys"],
      "%ArrayProto_values%": ["Array", "prototype", "values"],
      "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
      "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
      "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
      "%BooleanPrototype%": ["Boolean", "prototype"],
      "%DataViewPrototype%": ["DataView", "prototype"],
      "%DatePrototype%": ["Date", "prototype"],
      "%ErrorPrototype%": ["Error", "prototype"],
      "%EvalErrorPrototype%": ["EvalError", "prototype"],
      "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
      "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
      "%FunctionPrototype%": ["Function", "prototype"],
      "%Generator%": ["GeneratorFunction", "prototype"],
      "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
      "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
      "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
      "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
      "%JSONParse%": ["JSON", "parse"],
      "%JSONStringify%": ["JSON", "stringify"],
      "%MapPrototype%": ["Map", "prototype"],
      "%NumberPrototype%": ["Number", "prototype"],
      "%ObjectPrototype%": ["Object", "prototype"],
      "%ObjProto_toString%": ["Object", "prototype", "toString"],
      "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
      "%PromisePrototype%": ["Promise", "prototype"],
      "%PromiseProto_then%": ["Promise", "prototype", "then"],
      "%Promise_all%": ["Promise", "all"],
      "%Promise_reject%": ["Promise", "reject"],
      "%Promise_resolve%": ["Promise", "resolve"],
      "%RangeErrorPrototype%": ["RangeError", "prototype"],
      "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
      "%RegExpPrototype%": ["RegExp", "prototype"],
      "%SetPrototype%": ["Set", "prototype"],
      "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
      "%StringPrototype%": ["String", "prototype"],
      "%SymbolPrototype%": ["Symbol", "prototype"],
      "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
      "%TypedArrayPrototype%": ["TypedArray", "prototype"],
      "%TypeErrorPrototype%": ["TypeError", "prototype"],
      "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
      "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
      "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
      "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
      "%URIErrorPrototype%": ["URIError", "prototype"],
      "%WeakMapPrototype%": ["WeakMap", "prototype"],
      "%WeakSetPrototype%": ["WeakSet", "prototype"]
    };
    var bind = require_function_bind();
    var hasOwn = require_hasown();
    var $concat = bind.call(Function.call, Array.prototype.concat);
    var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
    var $replace = bind.call(Function.call, String.prototype.replace);
    var $strSlice = bind.call(Function.call, String.prototype.slice);
    var $exec = bind.call(Function.call, RegExp.prototype.exec);
    var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
    var reEscapeChar = /\\(\\)?/g;
    var stringToPath = function stringToPath2(string) {
      var first = $strSlice(string, 0, 1);
      var last = $strSlice(string, -1);
      if (first === "%" && last !== "%") {
        throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
      } else if (last === "%" && first !== "%") {
        throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
      }
      var result = [];
      $replace(string, rePropName, function(match, number, quote, subString) {
        result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
      });
      return result;
    };
    var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
      var intrinsicName = name;
      var alias;
      if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
        alias = LEGACY_ALIASES[intrinsicName];
        intrinsicName = "%" + alias[0] + "%";
      }
      if (hasOwn(INTRINSICS, intrinsicName)) {
        var value = INTRINSICS[intrinsicName];
        if (value === needsEval) {
          value = doEval(intrinsicName);
        }
        if (typeof value === "undefined" && !allowMissing) {
          throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
        }
        return {
          alias,
          name: intrinsicName,
          value
        };
      }
      throw new $SyntaxError("intrinsic " + name + " does not exist!");
    };
    module2.exports = function GetIntrinsic(name, allowMissing) {
      if (typeof name !== "string" || name.length === 0) {
        throw new $TypeError("intrinsic name must be a non-empty string");
      }
      if (arguments.length > 1 && typeof allowMissing !== "boolean") {
        throw new $TypeError('"allowMissing" argument must be a boolean');
      }
      if ($exec(/^%?[^%]*%?$/, name) === null) {
        throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
      }
      var parts = stringToPath(name);
      var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
      var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
      var intrinsicRealName = intrinsic.name;
      var value = intrinsic.value;
      var skipFurtherCaching = false;
      var alias = intrinsic.alias;
      if (alias) {
        intrinsicBaseName = alias[0];
        $spliceApply(parts, $concat([0, 1], alias));
      }
      for (var i = 1, isOwn = true; i < parts.length; i += 1) {
        var part = parts[i];
        var first = $strSlice(part, 0, 1);
        var last = $strSlice(part, -1);
        if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
          throw new $SyntaxError("property names with quotes must have matching quotes");
        }
        if (part === "constructor" || !isOwn) {
          skipFurtherCaching = true;
        }
        intrinsicBaseName += "." + part;
        intrinsicRealName = "%" + intrinsicBaseName + "%";
        if (hasOwn(INTRINSICS, intrinsicRealName)) {
          value = INTRINSICS[intrinsicRealName];
        } else if (value != null) {
          if (!(part in value)) {
            if (!allowMissing) {
              throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
            }
            return void 0;
          }
          if ($gOPD && i + 1 >= parts.length) {
            var desc = $gOPD(value, part);
            isOwn = !!desc;
            if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
              value = desc.get;
            } else {
              value = value[part];
            }
          } else {
            isOwn = hasOwn(value, part);
            value = value[part];
          }
          if (isOwn && !skipFurtherCaching) {
            INTRINSICS[intrinsicRealName] = value;
          }
        }
      }
      return value;
    };
  }
});

// node_modules/es-define-property/index.js
var require_es_define_property = __commonJS({
  "node_modules/es-define-property/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false;
    if ($defineProperty) {
      try {
        $defineProperty({}, "a", { value: 1 });
      } catch (e) {
        $defineProperty = false;
      }
    }
    module2.exports = $defineProperty;
  }
});

// node_modules/gopd/index.js
var require_gopd = __commonJS({
  "node_modules/gopd/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
    if ($gOPD) {
      try {
        $gOPD([], "length");
      } catch (e) {
        $gOPD = null;
      }
    }
    module2.exports = $gOPD;
  }
});

// node_modules/define-data-property/index.js
var require_define_data_property = __commonJS({
  "node_modules/define-data-property/index.js"(exports2, module2) {
    "use strict";
    var $defineProperty = require_es_define_property();
    var $SyntaxError = require_syntax();
    var $TypeError = require_type();
    var gopd = require_gopd();
    module2.exports = function defineDataProperty(obj2, property, value) {
      if (!obj2 || typeof obj2 !== "object" && typeof obj2 !== "function") {
        throw new $TypeError("`obj` must be an object or a function`");
      }
      if (typeof property !== "string" && typeof property !== "symbol") {
        throw new $TypeError("`property` must be a string or a symbol`");
      }
      if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
        throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
      }
      if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
        throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
      }
      if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
        throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
      }
      if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
        throw new $TypeError("`loose`, if provided, must be a boolean");
      }
      var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
      var nonWritable = arguments.length > 4 ? arguments[4] : null;
      var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
      var loose = arguments.length > 6 ? arguments[6] : false;
      var desc = !!gopd && gopd(obj2, property);
      if ($defineProperty) {
        $defineProperty(obj2, property, {
          configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
          enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
          value,
          writable: nonWritable === null && desc ? desc.writable : !nonWritable
        });
      } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
        obj2[property] = value;
      } else {
        throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
      }
    };
  }
});

// node_modules/has-property-descriptors/index.js
var require_has_property_descriptors = __commonJS({
  "node_modules/has-property-descriptors/index.js"(exports2, module2) {
    "use strict";
    var $defineProperty = require_es_define_property();
    var hasPropertyDescriptors = function hasPropertyDescriptors2() {
      return !!$defineProperty;
    };
    hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
      if (!$defineProperty) {
        return null;
      }
      try {
        return $defineProperty([], "length", { value: 1 }).length !== 1;
      } catch (e) {
        return true;
      }
    };
    module2.exports = hasPropertyDescriptors;
  }
});

// node_modules/define-properties/index.js
var require_define_properties = __commonJS({
  "node_modules/define-properties/index.js"(exports2, module2) {
    "use strict";
    var keys = require_object_keys();
    var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol";
    var toStr = Object.prototype.toString;
    var concat = Array.prototype.concat;
    var defineDataProperty = require_define_data_property();
    var isFunction = function(fn2) {
      return typeof fn2 === "function" && toStr.call(fn2) === "[object Function]";
    };
    var supportsDescriptors = require_has_property_descriptors()();
    var defineProperty = function(object, name, value, predicate) {
      if (name in object) {
        if (predicate === true) {
          if (object[name] === value) {
            return;
          }
        } else if (!isFunction(predicate) || !predicate()) {
          return;
        }
      }
      if (supportsDescriptors) {
        defineDataProperty(object, name, value, true);
      } else {
        defineDataProperty(object, name, value);
      }
    };
    var defineProperties = function(object, map) {
      var predicates = arguments.length > 2 ? arguments[2] : {};
      var props = keys(map);
      if (hasSymbols) {
        props = concat.call(props, Object.getOwnPropertySymbols(map));
      }
      for (var i = 0; i < props.length; i += 1) {
        defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
      }
    };
    defineProperties.supportsDescriptors = !!supportsDescriptors;
    module2.exports = defineProperties;
  }
});

// node_modules/es-object-atoms/RequireObjectCoercible.js
var require_RequireObjectCoercible = __commonJS({
  "node_modules/es-object-atoms/RequireObjectCoercible.js"(exports2, module2) {
    "use strict";
    var $TypeError = require_type();
    module2.exports = function RequireObjectCoercible(value) {
      if (value == null) {
        throw new $TypeError(arguments.length > 0 && arguments[1] || "Cannot call method on " + value);
      }
      return value;
    };
  }
});

// node_modules/set-function-length/index.js
var require_set_function_length = __commonJS({
  "node_modules/set-function-length/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var define2 = require_define_data_property();
    var hasDescriptors = require_has_property_descriptors()();
    var gOPD = require_gopd();
    var $TypeError = require_type();
    var $floor = GetIntrinsic("%Math.floor%");
    module2.exports = function setFunctionLength(fn2, length) {
      if (typeof fn2 !== "function") {
        throw new $TypeError("`fn` is not a function");
      }
      if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) {
        throw new $TypeError("`length` must be a positive 32-bit integer");
      }
      var loose = arguments.length > 2 && !!arguments[2];
      var functionLengthIsConfigurable = true;
      var functionLengthIsWritable = true;
      if ("length" in fn2 && gOPD) {
        var desc = gOPD(fn2, "length");
        if (desc && !desc.configurable) {
          functionLengthIsConfigurable = false;
        }
        if (desc && !desc.writable) {
          functionLengthIsWritable = false;
        }
      }
      if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
        if (hasDescriptors) {
          define2(
            /** @type {Parameters<define>[0]} */
            fn2,
            "length",
            length,
            true,
            true
          );
        } else {
          define2(
            /** @type {Parameters<define>[0]} */
            fn2,
            "length",
            length
          );
        }
      }
      return fn2;
    };
  }
});

// node_modules/call-bind/index.js
var require_call_bind = __commonJS({
  "node_modules/call-bind/index.js"(exports2, module2) {
    "use strict";
    var bind = require_function_bind();
    var GetIntrinsic = require_get_intrinsic();
    var setFunctionLength = require_set_function_length();
    var $TypeError = require_type();
    var $apply = GetIntrinsic("%Function.prototype.apply%");
    var $call = GetIntrinsic("%Function.prototype.call%");
    var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
    var $defineProperty = require_es_define_property();
    var $max = GetIntrinsic("%Math.max%");
    module2.exports = function callBind(originalFunction) {
      if (typeof originalFunction !== "function") {
        throw new $TypeError("a function is required");
      }
      var func = $reflectApply(bind, $call, arguments);
      return setFunctionLength(
        func,
        1 + $max(0, originalFunction.length - (arguments.length - 1)),
        true
      );
    };
    var applyBind = function applyBind2() {
      return $reflectApply(bind, $apply, arguments);
    };
    if ($defineProperty) {
      $defineProperty(module2.exports, "apply", { value: applyBind });
    } else {
      module2.exports.apply = applyBind;
    }
  }
});

// node_modules/call-bind/callBound.js
var require_callBound = __commonJS({
  "node_modules/call-bind/callBound.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var callBind = require_call_bind();
    var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
    module2.exports = function callBoundIntrinsic(name, allowMissing) {
      var intrinsic = GetIntrinsic(name, !!allowMissing);
      if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
        return callBind(intrinsic);
      }
      return intrinsic;
    };
  }
});

// node_modules/es-abstract/helpers/IsArray.js
var require_IsArray = __commonJS({
  "node_modules/es-abstract/helpers/IsArray.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $Array = GetIntrinsic("%Array%");
    var toStr = !$Array.isArray && require_callBound()("Object.prototype.toString");
    module2.exports = $Array.isArray || function IsArray(argument) {
      return toStr(argument) === "[object Array]";
    };
  }
});

// node_modules/es-abstract/2024/IsArray.js
var require_IsArray2 = __commonJS({
  "node_modules/es-abstract/2024/IsArray.js"(exports2, module2) {
    "use strict";
    module2.exports = require_IsArray();
  }
});

// node_modules/es-abstract/2024/Call.js
var require_Call = __commonJS({
  "node_modules/es-abstract/2024/Call.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var callBound = require_callBound();
    var $TypeError = require_type();
    var IsArray = require_IsArray2();
    var $apply = GetIntrinsic("%Reflect.apply%", true) || callBound("Function.prototype.apply");
    module2.exports = function Call(F, V) {
      var argumentsList = arguments.length > 2 ? arguments[2] : [];
      if (!IsArray(argumentsList)) {
        throw new $TypeError("Assertion failed: optional `argumentsList`, if provided, must be a List");
      }
      return $apply(F, V, argumentsList);
    };
  }
});

// (disabled):node_modules/object-inspect/util.inspect
var require_util2 = __commonJS({
  "(disabled):node_modules/object-inspect/util.inspect"() {
  }
});

// node_modules/object-inspect/index.js
var require_object_inspect = __commonJS({
  "node_modules/object-inspect/index.js"(exports2, module2) {
    var hasMap = typeof Map === "function" && Map.prototype;
    var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
    var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
    var mapForEach = hasMap && Map.prototype.forEach;
    var hasSet = typeof Set === "function" && Set.prototype;
    var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
    var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
    var setForEach = hasSet && Set.prototype.forEach;
    var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
    var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
    var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
    var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
    var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
    var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
    var booleanValueOf = Boolean.prototype.valueOf;
    var objectToString = Object.prototype.toString;
    var functionToString = Function.prototype.toString;
    var $match = String.prototype.match;
    var $slice = String.prototype.slice;
    var $replace = String.prototype.replace;
    var $toUpperCase = String.prototype.toUpperCase;
    var $toLowerCase = String.prototype.toLowerCase;
    var $test = RegExp.prototype.test;
    var $concat = Array.prototype.concat;
    var $join = Array.prototype.join;
    var $arrSlice = Array.prototype.slice;
    var $floor = Math.floor;
    var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
    var gOPS = Object.getOwnPropertySymbols;
    var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
    var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
    var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
    var isEnumerable = Object.prototype.propertyIsEnumerable;
    var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
      return O.__proto__;
    } : null);
    function addNumericSeparator(num, str) {
      if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) {
        return str;
      }
      var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
      if (typeof num === "number") {
        var int = num < 0 ? -$floor(-num) : $floor(num);
        if (int !== num) {
          var intStr = String(int);
          var dec = $slice.call(str, intStr.length + 1);
          return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
        }
      }
      return $replace.call(str, sepRegex, "$&_");
    }
    var utilInspect = require_util2();
    var inspectCustom = utilInspect.custom;
    var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
    module2.exports = function inspect_(obj2, options, depth, seen) {
      var opts = options || {};
      if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) {
        throw new TypeError('option "quoteStyle" must be "single" or "double"');
      }
      if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
        throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
      }
      var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
      if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
        throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
      }
      if (has(opts, "indent") && opts.indent !== null && opts.indent !== "	" && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
        throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
      }
      if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
        throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
      }
      var numericSeparator = opts.numericSeparator;
      if (typeof obj2 === "undefined") {
        return "undefined";
      }
      if (obj2 === null) {
        return "null";
      }
      if (typeof obj2 === "boolean") {
        return obj2 ? "true" : "false";
      }
      if (typeof obj2 === "string") {
        return inspectString(obj2, opts);
      }
      if (typeof obj2 === "number") {
        if (obj2 === 0) {
          return Infinity / obj2 > 0 ? "0" : "-0";
        }
        var str = String(obj2);
        return numericSeparator ? addNumericSeparator(obj2, str) : str;
      }
      if (typeof obj2 === "bigint") {
        var bigIntStr = String(obj2) + "n";
        return numericSeparator ? addNumericSeparator(obj2, bigIntStr) : bigIntStr;
      }
      var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
      if (typeof depth === "undefined") {
        depth = 0;
      }
      if (depth >= maxDepth && maxDepth > 0 && typeof obj2 === "object") {
        return isArray(obj2) ? "[Array]" : "[Object]";
      }
      var indent = getIndent(opts, depth);
      if (typeof seen === "undefined") {
        seen = [];
      } else if (indexOf(seen, obj2) >= 0) {
        return "[Circular]";
      }
      function inspect(value, from, noIndent) {
        if (from) {
          seen = $arrSlice.call(seen);
          seen.push(from);
        }
        if (noIndent) {
          var newOpts = {
            depth: opts.depth
          };
          if (has(opts, "quoteStyle")) {
            newOpts.quoteStyle = opts.quoteStyle;
          }
          return inspect_(value, newOpts, depth + 1, seen);
        }
        return inspect_(value, opts, depth + 1, seen);
      }
      if (typeof obj2 === "function" && !isRegExp(obj2)) {
        var name = nameOf(obj2);
        var keys = arrObjKeys(obj2, inspect);
        return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
      }
      if (isSymbol(obj2)) {
        var symString = hasShammedSymbols ? $replace.call(String(obj2), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj2);
        return typeof obj2 === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
      }
      if (isElement2(obj2)) {
        var s = "<" + $toLowerCase.call(String(obj2.nodeName));
        var attrs = obj2.attributes || [];
        for (var i = 0; i < attrs.length; i++) {
          s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
        }
        s += ">";
        if (obj2.childNodes && obj2.childNodes.length) {
          s += "...";
        }
        s += "</" + $toLowerCase.call(String(obj2.nodeName)) + ">";
        return s;
      }
      if (isArray(obj2)) {
        if (obj2.length === 0) {
          return "[]";
        }
        var xs = arrObjKeys(obj2, inspect);
        if (indent && !singleLineValues(xs)) {
          return "[" + indentedJoin(xs, indent) + "]";
        }
        return "[ " + $join.call(xs, ", ") + " ]";
      }
      if (isError2(obj2)) {
        var parts = arrObjKeys(obj2, inspect);
        if (!("cause" in Error.prototype) && "cause" in obj2 && !isEnumerable.call(obj2, "cause")) {
          return "{ [" + String(obj2) + "] " + $join.call($concat.call("[cause]: " + inspect(obj2.cause), parts), ", ") + " }";
        }
        if (parts.length === 0) {
          return "[" + String(obj2) + "]";
        }
        return "{ [" + String(obj2) + "] " + $join.call(parts, ", ") + " }";
      }
      if (typeof obj2 === "object" && customInspect) {
        if (inspectSymbol && typeof obj2[inspectSymbol] === "function" && utilInspect) {
          return utilInspect(obj2, { depth: maxDepth - depth });
        } else if (customInspect !== "symbol" && typeof obj2.inspect === "function") {
          return obj2.inspect();
        }
      }
      if (isMap(obj2)) {
        var mapParts = [];
        if (mapForEach) {
          mapForEach.call(obj2, function(value, key) {
            mapParts.push(inspect(key, obj2, true) + " => " + inspect(value, obj2));
          });
        }
        return collectionOf("Map", mapSize.call(obj2), mapParts, indent);
      }
      if (isSet(obj2)) {
        var setParts = [];
        if (setForEach) {
          setForEach.call(obj2, function(value) {
            setParts.push(inspect(value, obj2));
          });
        }
        return collectionOf("Set", setSize.call(obj2), setParts, indent);
      }
      if (isWeakMap(obj2)) {
        return weakCollectionOf("WeakMap");
      }
      if (isWeakSet(obj2)) {
        return weakCollectionOf("WeakSet");
      }
      if (isWeakRef(obj2)) {
        return weakCollectionOf("WeakRef");
      }
      if (isNumber(obj2)) {
        return markBoxed(inspect(Number(obj2)));
      }
      if (isBigInt(obj2)) {
        return markBoxed(inspect(bigIntValueOf.call(obj2)));
      }
      if (isBoolean(obj2)) {
        return markBoxed(booleanValueOf.call(obj2));
      }
      if (isString(obj2)) {
        return markBoxed(inspect(String(obj2)));
      }
      if (typeof window !== "undefined" && obj2 === window) {
        return "{ [object Window] }";
      }
      if (typeof globalThis !== "undefined" && obj2 === globalThis || typeof global !== "undefined" && obj2 === global) {
        return "{ [object globalThis] }";
      }
      if (!isDate(obj2) && !isRegExp(obj2)) {
        var ys = arrObjKeys(obj2, inspect);
        var isPlainObject = gPO ? gPO(obj2) === Object.prototype : obj2 instanceof Object || obj2.constructor === Object;
        var protoTag = obj2 instanceof Object ? "" : "null prototype";
        var stringTag = !isPlainObject && toStringTag && Object(obj2) === obj2 && toStringTag in obj2 ? $slice.call(toStr(obj2), 8, -1) : protoTag ? "Object" : "";
        var constructorTag = isPlainObject || typeof obj2.constructor !== "function" ? "" : obj2.constructor.name ? obj2.constructor.name + " " : "";
        var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
        if (ys.length === 0) {
          return tag + "{}";
        }
        if (indent) {
          return tag + "{" + indentedJoin(ys, indent) + "}";
        }
        return tag + "{ " + $join.call(ys, ", ") + " }";
      }
      return String(obj2);
    };
    function wrapQuotes(s, defaultStyle, opts) {
      var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'";
      return quoteChar + s + quoteChar;
    }
    function quote(s) {
      return $replace.call(String(s), /"/g, "&quot;");
    }
    function isArray(obj2) {
      return toStr(obj2) === "[object Array]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isDate(obj2) {
      return toStr(obj2) === "[object Date]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isRegExp(obj2) {
      return toStr(obj2) === "[object RegExp]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isError2(obj2) {
      return toStr(obj2) === "[object Error]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isString(obj2) {
      return toStr(obj2) === "[object String]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isNumber(obj2) {
      return toStr(obj2) === "[object Number]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isBoolean(obj2) {
      return toStr(obj2) === "[object Boolean]" && (!toStringTag || !(typeof obj2 === "object" && toStringTag in obj2));
    }
    function isSymbol(obj2) {
      if (hasShammedSymbols) {
        return obj2 && typeof obj2 === "object" && obj2 instanceof Symbol;
      }
      if (typeof obj2 === "symbol") {
        return true;
      }
      if (!obj2 || typeof obj2 !== "object" || !symToString) {
        return false;
      }
      try {
        symToString.call(obj2);
        return true;
      } catch (e) {
      }
      return false;
    }
    function isBigInt(obj2) {
      if (!obj2 || typeof obj2 !== "object" || !bigIntValueOf) {
        return false;
      }
      try {
        bigIntValueOf.call(obj2);
        return true;
      } catch (e) {
      }
      return false;
    }
    var hasOwn = Object.prototype.hasOwnProperty || function(key) {
      return key in this;
    };
    function has(obj2, key) {
      return hasOwn.call(obj2, key);
    }
    function toStr(obj2) {
      return objectToString.call(obj2);
    }
    function nameOf(f2) {
      if (f2.name) {
        return f2.name;
      }
      var m = $match.call(functionToString.call(f2), /^function\s*([\w$]+)/);
      if (m) {
        return m[1];
      }
      return null;
    }
    function indexOf(xs, x) {
      if (xs.indexOf) {
        return xs.indexOf(x);
      }
      for (var i = 0, l = xs.length; i < l; i++) {
        if (xs[i] === x) {
          return i;
        }
      }
      return -1;
    }
    function isMap(x) {
      if (!mapSize || !x || typeof x !== "object") {
        return false;
      }
      try {
        mapSize.call(x);
        try {
          setSize.call(x);
        } catch (s) {
          return true;
        }
        return x instanceof Map;
      } catch (e) {
      }
      return false;
    }
    function isWeakMap(x) {
      if (!weakMapHas || !x || typeof x !== "object") {
        return false;
      }
      try {
        weakMapHas.call(x, weakMapHas);
        try {
          weakSetHas.call(x, weakSetHas);
        } catch (s) {
          return true;
        }
        return x instanceof WeakMap;
      } catch (e) {
      }
      return false;
    }
    function isWeakRef(x) {
      if (!weakRefDeref || !x || typeof x !== "object") {
        return false;
      }
      try {
        weakRefDeref.call(x);
        return true;
      } catch (e) {
      }
      return false;
    }
    function isSet(x) {
      if (!setSize || !x || typeof x !== "object") {
        return false;
      }
      try {
        setSize.call(x);
        try {
          mapSize.call(x);
        } catch (m) {
          return true;
        }
        return x instanceof Set;
      } catch (e) {
      }
      return false;
    }
    function isWeakSet(x) {
      if (!weakSetHas || !x || typeof x !== "object") {
        return false;
      }
      try {
        weakSetHas.call(x, weakSetHas);
        try {
          weakMapHas.call(x, weakMapHas);
        } catch (s) {
          return true;
        }
        return x instanceof WeakSet;
      } catch (e) {
      }
      return false;
    }
    function isElement2(x) {
      if (!x || typeof x !== "object") {
        return false;
      }
      if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {
        return true;
      }
      return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
    }
    function inspectString(str, opts) {
      if (str.length > opts.maxStringLength) {
        var remaining = str.length - opts.maxStringLength;
        var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
        return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
      }
      var s = $replace.call($replace.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte);
      return wrapQuotes(s, "single", opts);
    }
    function lowbyte(c) {
      var n = c.charCodeAt(0);
      var x = {
        8: "b",
        9: "t",
        10: "n",
        12: "f",
        13: "r"
      }[n];
      if (x) {
        return "\\" + x;
      }
      return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
    }
    function markBoxed(str) {
      return "Object(" + str + ")";
    }
    function weakCollectionOf(type) {
      return type + " { ? }";
    }
    function collectionOf(type, size, entries, indent) {
      var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
      return type + " (" + size + ") {" + joinedEntries + "}";
    }
    function singleLineValues(xs) {
      for (var i = 0; i < xs.length; i++) {
        if (indexOf(xs[i], "\n") >= 0) {
          return false;
        }
      }
      return true;
    }
    function getIndent(opts, depth) {
      var baseIndent;
      if (opts.indent === "	") {
        baseIndent = "	";
      } else if (typeof opts.indent === "number" && opts.indent > 0) {
        baseIndent = $join.call(Array(opts.indent + 1), " ");
      } else {
        return null;
      }
      return {
        base: baseIndent,
        prev: $join.call(Array(depth + 1), baseIndent)
      };
    }
    function indentedJoin(xs, indent) {
      if (xs.length === 0) {
        return "";
      }
      var lineJoiner = "\n" + indent.prev + indent.base;
      return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
    }
    function arrObjKeys(obj2, inspect) {
      var isArr = isArray(obj2);
      var xs = [];
      if (isArr) {
        xs.length = obj2.length;
        for (var i = 0; i < obj2.length; i++) {
          xs[i] = has(obj2, i) ? inspect(obj2[i], obj2) : "";
        }
      }
      var syms = typeof gOPS === "function" ? gOPS(obj2) : [];
      var symMap;
      if (hasShammedSymbols) {
        symMap = {};
        for (var k = 0; k < syms.length; k++) {
          symMap["$" + syms[k]] = syms[k];
        }
      }
      for (var key in obj2) {
        if (!has(obj2, key)) {
          continue;
        }
        if (isArr && String(Number(key)) === key && key < obj2.length) {
          continue;
        }
        if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
          continue;
        } else if ($test.call(/[^\w$]/, key)) {
          xs.push(inspect(key, obj2) + ": " + inspect(obj2[key], obj2));
        } else {
          xs.push(key + ": " + inspect(obj2[key], obj2));
        }
      }
      if (typeof gOPS === "function") {
        for (var j = 0; j < syms.length; j++) {
          if (isEnumerable.call(obj2, syms[j])) {
            xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj2[syms[j]], obj2));
          }
        }
      }
      return xs;
    }
  }
});

// node_modules/es-abstract/2024/IsPropertyKey.js
var require_IsPropertyKey = __commonJS({
  "node_modules/es-abstract/2024/IsPropertyKey.js"(exports2, module2) {
    "use strict";
    module2.exports = function IsPropertyKey(argument) {
      return typeof argument === "string" || typeof argument === "symbol";
    };
  }
});

// node_modules/es-abstract/5/Type.js
var require_Type = __commonJS({
  "node_modules/es-abstract/5/Type.js"(exports2, module2) {
    "use strict";
    module2.exports = function Type(x) {
      if (x === null) {
        return "Null";
      }
      if (typeof x === "undefined") {
        return "Undefined";
      }
      if (typeof x === "function" || typeof x === "object") {
        return "Object";
      }
      if (typeof x === "number") {
        return "Number";
      }
      if (typeof x === "boolean") {
        return "Boolean";
      }
      if (typeof x === "string") {
        return "String";
      }
    };
  }
});

// node_modules/es-abstract/2024/Type.js
var require_Type2 = __commonJS({
  "node_modules/es-abstract/2024/Type.js"(exports2, module2) {
    "use strict";
    var ES5Type = require_Type();
    module2.exports = function Type(x) {
      if (typeof x === "symbol") {
        return "Symbol";
      }
      if (typeof x === "bigint") {
        return "BigInt";
      }
      return ES5Type(x);
    };
  }
});

// node_modules/es-abstract/2024/Get.js
var require_Get = __commonJS({
  "node_modules/es-abstract/2024/Get.js"(exports2, module2) {
    "use strict";
    var $TypeError = require_type();
    var inspect = require_object_inspect();
    var IsPropertyKey = require_IsPropertyKey();
    var Type = require_Type2();
    module2.exports = function Get(O, P) {
      if (Type(O) !== "Object") {
        throw new $TypeError("Assertion failed: Type(O) is not Object");
      }
      if (!IsPropertyKey(P)) {
        throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true, got " + inspect(P));
      }
      return O[P];
    };
  }
});

// node_modules/is-callable/index.js
var require_is_callable = __commonJS({
  "node_modules/is-callable/index.js"(exports2, module2) {
    "use strict";
    var fnToStr = Function.prototype.toString;
    var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply;
    var badArrayLike;
    var isCallableMarker;
    if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") {
      try {
        badArrayLike = Object.defineProperty({}, "length", {
          get: function() {
            throw isCallableMarker;
          }
        });
        isCallableMarker = {};
        reflectApply(function() {
          throw 42;
        }, null, badArrayLike);
      } catch (_) {
        if (_ !== isCallableMarker) {
          reflectApply = null;
        }
      }
    } else {
      reflectApply = null;
    }
    var constructorRegex = /^\s*class\b/;
    var isES6ClassFn = function isES6ClassFunction(value) {
      try {
        var fnStr = fnToStr.call(value);
        return constructorRegex.test(fnStr);
      } catch (e) {
        return false;
      }
    };
    var tryFunctionObject = function tryFunctionToStr(value) {
      try {
        if (isES6ClassFn(value)) {
          return false;
        }
        fnToStr.call(value);
        return true;
      } catch (e) {
        return false;
      }
    };
    var toStr = Object.prototype.toString;
    var objectClass = "[object Object]";
    var fnClass = "[object Function]";
    var genClass = "[object GeneratorFunction]";
    var ddaClass = "[object HTMLAllCollection]";
    var ddaClass2 = "[object HTML document.all class]";
    var ddaClass3 = "[object HTMLCollection]";
    var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag;
    var isIE68 = !(0 in [,]);
    var isDDA = function isDocumentDotAll() {
      return false;
    };
    if (typeof document === "object") {
      all = document.all;
      if (toStr.call(all) === toStr.call(document.all)) {
        isDDA = function isDocumentDotAll(value) {
          if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) {
            try {
              var str = toStr.call(value);
              return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null;
            } catch (e) {
            }
          }
          return false;
        };
      }
    }
    var all;
    module2.exports = reflectApply ? function isCallable(value) {
      if (isDDA(value)) {
        return true;
      }
      if (!value) {
        return false;
      }
      if (typeof value !== "function" && typeof value !== "object") {
        return false;
      }
      try {
        reflectApply(value, null, badArrayLike);
      } catch (e) {
        if (e !== isCallableMarker) {
          return false;
        }
      }
      return !isES6ClassFn(value) && tryFunctionObject(value);
    } : function isCallable(value) {
      if (isDDA(value)) {
        return true;
      }
      if (!value) {
        return false;
      }
      if (typeof value !== "function" && typeof value !== "object") {
        return false;
      }
      if (hasToStringTag) {
        return tryFunctionObject(value);
      }
      if (isES6ClassFn(value)) {
        return false;
      }
      var strClass = toStr.call(value);
      if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) {
        return false;
      }
      return tryFunctionObject(value);
    };
  }
});

// node_modules/es-abstract/2024/IsCallable.js
var require_IsCallable = __commonJS({
  "node_modules/es-abstract/2024/IsCallable.js"(exports2, module2) {
    "use strict";
    module2.exports = require_is_callable();
  }
});

// node_modules/es-abstract/helpers/maxSafeInteger.js
var require_maxSafeInteger = __commonJS({
  "node_modules/es-abstract/helpers/maxSafeInteger.js"(exports2, module2) {
    "use strict";
    module2.exports = Number.MAX_SAFE_INTEGER || 9007199254740991;
  }
});

// node_modules/es-abstract/helpers/isPrimitive.js
var require_isPrimitive = __commonJS({
  "node_modules/es-abstract/helpers/isPrimitive.js"(exports2, module2) {
    "use strict";
    module2.exports = function isPrimitive2(value) {
      return value === null || typeof value !== "function" && typeof value !== "object";
    };
  }
});

// node_modules/es-to-primitive/helpers/isPrimitive.js
var require_isPrimitive2 = __commonJS({
  "node_modules/es-to-primitive/helpers/isPrimitive.js"(exports2, module2) {
    "use strict";
    module2.exports = function isPrimitive2(value) {
      return value === null || typeof value !== "function" && typeof value !== "object";
    };
  }
});

// node_modules/has-tostringtag/shams.js
var require_shams2 = __commonJS({
  "node_modules/has-tostringtag/shams.js"(exports2, module2) {
    "use strict";
    var hasSymbols = require_shams();
    module2.exports = function hasToStringTagShams() {
      return hasSymbols() && !!Symbol.toStringTag;
    };
  }
});

// node_modules/is-date-object/index.js
var require_is_date_object = __commonJS({
  "node_modules/is-date-object/index.js"(exports2, module2) {
    "use strict";
    var getDay = Date.prototype.getDay;
    var tryDateObject = function tryDateGetDayCall(value) {
      try {
        getDay.call(value);
        return true;
      } catch (e) {
        return false;
      }
    };
    var toStr = Object.prototype.toString;
    var dateClass = "[object Date]";
    var hasToStringTag = require_shams2()();
    module2.exports = function isDateObject(value) {
      if (typeof value !== "object" || value === null) {
        return false;
      }
      return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
    };
  }
});

// node_modules/is-symbol/index.js
var require_is_symbol = __commonJS({
  "node_modules/is-symbol/index.js"(exports2, module2) {
    "use strict";
    var toStr = Object.prototype.toString;
    var hasSymbols = require_has_symbols()();
    if (hasSymbols) {
      symToStr = Symbol.prototype.toString;
      symStringRegex = /^Symbol\(.*\)$/;
      isSymbolObject = function isRealSymbolObject(value) {
        if (typeof value.valueOf() !== "symbol") {
          return false;
        }
        return symStringRegex.test(symToStr.call(value));
      };
      module2.exports = function isSymbol(value) {
        if (typeof value === "symbol") {
          return true;
        }
        if (toStr.call(value) !== "[object Symbol]") {
          return false;
        }
        try {
          return isSymbolObject(value);
        } catch (e) {
          return false;
        }
      };
    } else {
      module2.exports = function isSymbol(value) {
        return false;
      };
    }
    var symToStr;
    var symStringRegex;
    var isSymbolObject;
  }
});

// node_modules/es-to-primitive/es2015.js
var require_es2015 = __commonJS({
  "node_modules/es-to-primitive/es2015.js"(exports2, module2) {
    "use strict";
    var hasSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "symbol";
    var isPrimitive2 = require_isPrimitive2();
    var isCallable = require_is_callable();
    var isDate = require_is_date_object();
    var isSymbol = require_is_symbol();
    var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
      if (typeof O === "undefined" || O === null) {
        throw new TypeError("Cannot call method on " + O);
      }
      if (typeof hint !== "string" || hint !== "number" && hint !== "string") {
        throw new TypeError('hint must be "string" or "number"');
      }
      var methodNames = hint === "string" ? ["toString", "valueOf"] : ["valueOf", "toString"];
      var method, result, i;
      for (i = 0; i < methodNames.length; ++i) {
        method = O[methodNames[i]];
        if (isCallable(method)) {
          result = method.call(O);
          if (isPrimitive2(result)) {
            return result;
          }
        }
      }
      throw new TypeError("No default value");
    };
    var GetMethod = function GetMethod2(O, P) {
      var func = O[P];
      if (func !== null && typeof func !== "undefined") {
        if (!isCallable(func)) {
          throw new TypeError(func + " returned for property " + P + " of object " + O + " is not a function");
        }
        return func;
      }
      return void 0;
    };
    module2.exports = function ToPrimitive(input) {
      if (isPrimitive2(input)) {
        return input;
      }
      var hint = "default";
      if (arguments.length > 1) {
        if (arguments[1] === String) {
          hint = "string";
        } else if (arguments[1] === Number) {
          hint = "number";
        }
      }
      var exoticToPrim;
      if (hasSymbols) {
        if (Symbol.toPrimitive) {
          exoticToPrim = GetMethod(input, Symbol.toPrimitive);
        } else if (isSymbol(input)) {
          exoticToPrim = Symbol.prototype.valueOf;
        }
      }
      if (typeof exoticToPrim !== "undefined") {
        var result = exoticToPrim.call(input, hint);
        if (isPrimitive2(result)) {
          return result;
        }
        throw new TypeError("unable to convert exotic object to primitive");
      }
      if (hint === "default" && (isDate(input) || isSymbol(input))) {
        hint = "string";
      }
      return ordinaryToPrimitive(input, hint === "default" ? "number" : hint);
    };
  }
});

// node_modules/es-abstract/2024/ToPrimitive.js
var require_ToPrimitive = __commonJS({
  "node_modules/es-abstract/2024/ToPrimitive.js"(exports2, module2) {
    "use strict";
    var toPrimitive = require_es2015();
    module2.exports = function ToPrimitive(input) {
      if (arguments.length > 1) {
        return toPrimitive(input, arguments[1]);
      }
      return toPrimitive(input);
    };
  }
});

// node_modules/is-regex/index.js
var require_is_regex = __commonJS({
  "node_modules/is-regex/index.js"(exports2, module2) {
    "use strict";
    var callBound = require_callBound();
    var hasToStringTag = require_shams2()();
    var has;
    var $exec;
    var isRegexMarker;
    var badStringifier;
    if (hasToStringTag) {
      has = callBound("Object.prototype.hasOwnProperty");
      $exec = callBound("RegExp.prototype.exec");
      isRegexMarker = {};
      throwRegexMarker = function() {
        throw isRegexMarker;
      };
      badStringifier = {
        toString: throwRegexMarker,
        valueOf: throwRegexMarker
      };
      if (typeof Symbol.toPrimitive === "symbol") {
        badStringifier[Symbol.toPrimitive] = throwRegexMarker;
      }
    }
    var throwRegexMarker;
    var $toString = callBound("Object.prototype.toString");
    var gOPD = Object.getOwnPropertyDescriptor;
    var regexClass = "[object RegExp]";
    module2.exports = hasToStringTag ? function isRegex(value) {
      if (!value || typeof value !== "object") {
        return false;
      }
      var descriptor = gOPD(value, "lastIndex");
      var hasLastIndexDataProperty = descriptor && has(descriptor, "value");
      if (!hasLastIndexDataProperty) {
        return false;
      }
      try {
        $exec(value, badStringifier);
      } catch (e) {
        return e === isRegexMarker;
      }
    } : function isRegex(value) {
      if (!value || typeof value !== "object" && typeof value !== "function") {
        return false;
      }
      return $toString(value) === regexClass;
    };
  }
});

// node_modules/safe-regex-test/index.js
var require_safe_regex_test = __commonJS({
  "node_modules/safe-regex-test/index.js"(exports2, module2) {
    "use strict";
    var callBound = require_callBound();
    var isRegex = require_is_regex();
    var $exec = callBound("RegExp.prototype.exec");
    var $TypeError = require_type();
    module2.exports = function regexTester(regex) {
      if (!isRegex(regex)) {
        throw new $TypeError("`regex` must be a RegExp");
      }
      return function test(s) {
        return $exec(regex, s) !== null;
      };
    };
  }
});

// node_modules/es-abstract/2024/ToString.js
var require_ToString = __commonJS({
  "node_modules/es-abstract/2024/ToString.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $String = GetIntrinsic("%String%");
    var $TypeError = require_type();
    module2.exports = function ToString(argument) {
      if (typeof argument === "symbol") {
        throw new $TypeError("Cannot convert a Symbol value to a string");
      }
      return $String(argument);
    };
  }
});

// node_modules/string.prototype.trim/implementation.js
var require_implementation3 = __commonJS({
  "node_modules/string.prototype.trim/implementation.js"(exports2, module2) {
    "use strict";
    var RequireObjectCoercible = require_RequireObjectCoercible();
    var ToString = require_ToString();
    var callBound = require_callBound();
    var $replace = callBound("String.prototype.replace");
    var mvsIsWS = /^\s$/.test("\u180E");
    var leftWhitespace = mvsIsWS ? /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/ : /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/;
    var rightWhitespace = mvsIsWS ? /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/ : /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;
    module2.exports = function trim() {
      var S = ToString(RequireObjectCoercible(this));
      return $replace($replace(S, leftWhitespace, ""), rightWhitespace, "");
    };
  }
});

// node_modules/string.prototype.trim/polyfill.js
var require_polyfill = __commonJS({
  "node_modules/string.prototype.trim/polyfill.js"(exports2, module2) {
    "use strict";
    var implementation = require_implementation3();
    var zeroWidthSpace = "\u200B";
    var mongolianVowelSeparator = "\u180E";
    module2.exports = function getPolyfill() {
      if (String.prototype.trim && zeroWidthSpace.trim() === zeroWidthSpace && mongolianVowelSeparator.trim() === mongolianVowelSeparator && ("_" + mongolianVowelSeparator).trim() === "_" + mongolianVowelSeparator && (mongolianVowelSeparator + "_").trim() === mongolianVowelSeparator + "_") {
        return String.prototype.trim;
      }
      return implementation;
    };
  }
});

// node_modules/string.prototype.trim/shim.js
var require_shim = __commonJS({
  "node_modules/string.prototype.trim/shim.js"(exports2, module2) {
    "use strict";
    var define2 = require_define_properties();
    var getPolyfill = require_polyfill();
    module2.exports = function shimStringTrim() {
      var polyfill = getPolyfill();
      define2(String.prototype, { trim: polyfill }, {
        trim: function testTrim() {
          return String.prototype.trim !== polyfill;
        }
      });
      return polyfill;
    };
  }
});

// node_modules/string.prototype.trim/index.js
var require_string_prototype = __commonJS({
  "node_modules/string.prototype.trim/index.js"(exports2, module2) {
    "use strict";
    var callBind = require_call_bind();
    var define2 = require_define_properties();
    var RequireObjectCoercible = require_RequireObjectCoercible();
    var implementation = require_implementation3();
    var getPolyfill = require_polyfill();
    var shim = require_shim();
    var bound = callBind(getPolyfill());
    var boundMethod = function trim(receiver2) {
      RequireObjectCoercible(receiver2);
      return bound(receiver2);
    };
    define2(boundMethod, {
      getPolyfill,
      implementation,
      shim
    });
    module2.exports = boundMethod;
  }
});

// node_modules/es-abstract/2024/StringToNumber.js
var require_StringToNumber = __commonJS({
  "node_modules/es-abstract/2024/StringToNumber.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $Number = GetIntrinsic("%Number%");
    var $RegExp = GetIntrinsic("%RegExp%");
    var $TypeError = require_type();
    var $parseInteger = GetIntrinsic("%parseInt%");
    var callBound = require_callBound();
    var regexTester = require_safe_regex_test();
    var $strSlice = callBound("String.prototype.slice");
    var isBinary = regexTester(/^0b[01]+$/i);
    var isOctal = regexTester(/^0o[0-7]+$/i);
    var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);
    var nonWS = ["\x85", "\u200B", "\uFFFE"].join("");
    var nonWSregex = new $RegExp("[" + nonWS + "]", "g");
    var hasNonWS = regexTester(nonWSregex);
    var $trim = require_string_prototype();
    module2.exports = function StringToNumber(argument) {
      if (typeof argument !== "string") {
        throw new $TypeError("Assertion failed: `argument` is not a String");
      }
      if (isBinary(argument)) {
        return $Number($parseInteger($strSlice(argument, 2), 2));
      }
      if (isOctal(argument)) {
        return $Number($parseInteger($strSlice(argument, 2), 8));
      }
      if (hasNonWS(argument) || isInvalidHexLiteral(argument)) {
        return NaN;
      }
      var trimmed = $trim(argument);
      if (trimmed !== argument) {
        return StringToNumber(trimmed);
      }
      return $Number(argument);
    };
  }
});

// node_modules/es-abstract/2024/ToNumber.js
var require_ToNumber = __commonJS({
  "node_modules/es-abstract/2024/ToNumber.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $TypeError = require_type();
    var $Number = GetIntrinsic("%Number%");
    var isPrimitive2 = require_isPrimitive();
    var ToPrimitive = require_ToPrimitive();
    var StringToNumber = require_StringToNumber();
    module2.exports = function ToNumber(argument) {
      var value = isPrimitive2(argument) ? argument : ToPrimitive(argument, $Number);
      if (typeof value === "symbol") {
        throw new $TypeError("Cannot convert a Symbol value to a number");
      }
      if (typeof value === "bigint") {
        throw new $TypeError("Conversion from 'BigInt' to 'number' is not allowed.");
      }
      if (typeof value === "string") {
        return StringToNumber(value);
      }
      return $Number(value);
    };
  }
});

// node_modules/es-abstract/2024/floor.js
var require_floor = __commonJS({
  "node_modules/es-abstract/2024/floor.js"(exports2, module2) {
    "use strict";
    var $floor = Math.floor;
    module2.exports = function floor(x) {
      if (typeof x === "bigint") {
        return x;
      }
      return $floor(x);
    };
  }
});

// node_modules/es-abstract/2024/truncate.js
var require_truncate = __commonJS({
  "node_modules/es-abstract/2024/truncate.js"(exports2, module2) {
    "use strict";
    var floor = require_floor();
    var $TypeError = require_type();
    module2.exports = function truncate(x) {
      if (typeof x !== "number" && typeof x !== "bigint") {
        throw new $TypeError("argument must be a Number or a BigInt");
      }
      var result = x < 0 ? -floor(-x) : floor(x);
      return result === 0 ? 0 : result;
    };
  }
});

// node_modules/es-abstract/helpers/isNaN.js
var require_isNaN = __commonJS({
  "node_modules/es-abstract/helpers/isNaN.js"(exports2, module2) {
    "use strict";
    module2.exports = Number.isNaN || function isNaN2(a) {
      return a !== a;
    };
  }
});

// node_modules/es-abstract/helpers/isFinite.js
var require_isFinite = __commonJS({
  "node_modules/es-abstract/helpers/isFinite.js"(exports2, module2) {
    "use strict";
    var $isNaN = require_isNaN();
    module2.exports = function(x) {
      return (typeof x === "number" || typeof x === "bigint") && !$isNaN(x) && x !== Infinity && x !== -Infinity;
    };
  }
});

// node_modules/es-abstract/2024/ToIntegerOrInfinity.js
var require_ToIntegerOrInfinity = __commonJS({
  "node_modules/es-abstract/2024/ToIntegerOrInfinity.js"(exports2, module2) {
    "use strict";
    var ToNumber = require_ToNumber();
    var truncate = require_truncate();
    var $isNaN = require_isNaN();
    var $isFinite = require_isFinite();
    module2.exports = function ToIntegerOrInfinity(value) {
      var number = ToNumber(value);
      if ($isNaN(number) || number === 0) {
        return 0;
      }
      if (!$isFinite(number)) {
        return number;
      }
      return truncate(number);
    };
  }
});

// node_modules/es-abstract/2024/ToLength.js
var require_ToLength = __commonJS({
  "node_modules/es-abstract/2024/ToLength.js"(exports2, module2) {
    "use strict";
    var MAX_SAFE_INTEGER = require_maxSafeInteger();
    var ToIntegerOrInfinity = require_ToIntegerOrInfinity();
    module2.exports = function ToLength(argument) {
      var len = ToIntegerOrInfinity(argument);
      if (len <= 0) {
        return 0;
      }
      if (len > MAX_SAFE_INTEGER) {
        return MAX_SAFE_INTEGER;
      }
      return len;
    };
  }
});

// node_modules/es-abstract/2024/LengthOfArrayLike.js
var require_LengthOfArrayLike = __commonJS({
  "node_modules/es-abstract/2024/LengthOfArrayLike.js"(exports2, module2) {
    "use strict";
    var $TypeError = require_type();
    var Get = require_Get();
    var ToLength = require_ToLength();
    var Type = require_Type2();
    module2.exports = function LengthOfArrayLike(obj2) {
      if (Type(obj2) !== "Object") {
        throw new $TypeError("Assertion failed: `obj` must be an Object");
      }
      return ToLength(Get(obj2, "length"));
    };
  }
});

// node_modules/es-abstract/2024/ToBoolean.js
var require_ToBoolean = __commonJS({
  "node_modules/es-abstract/2024/ToBoolean.js"(exports2, module2) {
    "use strict";
    module2.exports = function ToBoolean(value) {
      return !!value;
    };
  }
});

// node_modules/es-object-atoms/index.js
var require_es_object_atoms = __commonJS({
  "node_modules/es-object-atoms/index.js"(exports2, module2) {
    "use strict";
    module2.exports = Object;
  }
});

// node_modules/es-object-atoms/ToObject.js
var require_ToObject = __commonJS({
  "node_modules/es-object-atoms/ToObject.js"(exports2, module2) {
    "use strict";
    var $Object = require_es_object_atoms();
    var RequireObjectCoercible = require_RequireObjectCoercible();
    module2.exports = function ToObject(value) {
      RequireObjectCoercible(value);
      return $Object(value);
    };
  }
});

// node_modules/array.prototype.findindex/implementation.js
var require_implementation4 = __commonJS({
  "node_modules/array.prototype.findindex/implementation.js"(exports2, module2) {
    "use strict";
    var Call = require_Call();
    var Get = require_Get();
    var IsCallable = require_IsCallable();
    var LengthOfArrayLike = require_LengthOfArrayLike();
    var ToBoolean = require_ToBoolean();
    var ToObject = require_ToObject();
    var ToString = require_ToString();
    module2.exports = function findIndex(predicate) {
      var O = ToObject(this);
      var len = LengthOfArrayLike(O);
      if (!IsCallable(predicate)) {
        throw new TypeError("Array#findIndex: predicate must be a function");
      }
      var thisArg = arguments.length > 1 ? arguments[1] : void 0;
      var k = 0;
      while (k < len) {
        var Pk = ToString(k);
        var kValue = Get(O, Pk);
        var testResult = ToBoolean(Call(predicate, thisArg, [kValue, k, O]));
        if (testResult) {
          return k;
        }
        k += 1;
      }
      return -1;
    };
  }
});

// node_modules/array.prototype.findindex/polyfill.js
var require_polyfill2 = __commonJS({
  "node_modules/array.prototype.findindex/polyfill.js"(exports2, module2) {
    "use strict";
    var implementation = require_implementation4();
    module2.exports = function getPolyfill() {
      var implemented = Array.prototype.findIndex && [, 1].findIndex(function(item, idx) {
        return idx === 0;
      }) === 0;
      return implemented ? Array.prototype.findIndex : implementation;
    };
  }
});

// node_modules/es-shim-unscopables/index.js
var require_es_shim_unscopables = __commonJS({
  "node_modules/es-shim-unscopables/index.js"(exports2, module2) {
    "use strict";
    var hasOwn = require_hasown();
    var hasUnscopables = typeof Symbol === "function" && typeof Symbol.unscopables === "symbol";
    var map = hasUnscopables && Array.prototype[Symbol.unscopables];
    var $TypeError = TypeError;
    module2.exports = function shimUnscopables(method) {
      if (typeof method !== "string" || !method) {
        throw new $TypeError("method must be a non-empty string");
      }
      if (!hasOwn(Array.prototype, method)) {
        throw new $TypeError("method must be on Array.prototype");
      }
      if (hasUnscopables) {
        map[method] = true;
      }
    };
  }
});

// node_modules/array.prototype.findindex/shim.js
var require_shim2 = __commonJS({
  "node_modules/array.prototype.findindex/shim.js"(exports2, module2) {
    "use strict";
    var define2 = require_define_properties();
    var shimUnscopables = require_es_shim_unscopables();
    var getPolyfill = require_polyfill2();
    module2.exports = function shimFindIndex() {
      var polyfill = getPolyfill();
      define2(
        Array.prototype,
        { findIndex: polyfill },
        {
          findIndex: function() {
            return Array.prototype.findIndex !== polyfill;
          }
        }
      );
      shimUnscopables("findIndex");
      return polyfill;
    };
  }
});

// node_modules/array.prototype.findindex/index.js
var require_array_prototype = __commonJS({
  "node_modules/array.prototype.findindex/index.js"(exports2, module2) {
    "use strict";
    var define2 = require_define_properties();
    var RequireObjectCoercible = require_RequireObjectCoercible();
    var callBind = require_call_bind();
    var callBound = require_callBound();
    var implementation = require_implementation4();
    var getPolyfill = require_polyfill2();
    var shim = require_shim2();
    var $slice = callBound("Array.prototype.slice");
    var polyfill = callBind.apply(getPolyfill());
    var boundShim = function findIndex(array, predicate) {
      RequireObjectCoercible(array);
      var args = $slice(arguments, 1);
      return polyfill(array, args);
    };
    define2(boundShim, {
      getPolyfill,
      implementation,
      shim
    });
    module2.exports = boundShim;
  }
});

// node_modules/node-telegram-bot-api/lib/errors.js
var require_errors3 = __commonJS({
  "node_modules/node-telegram-bot-api/lib/errors.js"(exports2) {
    "use strict";
    var _createClass = function() {
      function defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor = props[i];
          descriptor.enumerable = descriptor.enumerable || false;
          descriptor.configurable = true;
          if ("value" in descriptor)
            descriptor.writable = true;
          Object.defineProperty(target, descriptor.key, descriptor);
        }
      }
      return function(Constructor, protoProps, staticProps) {
        if (protoProps)
          defineProperties(Constructor.prototype, protoProps);
        if (staticProps)
          defineProperties(Constructor, staticProps);
        return Constructor;
      };
    }();
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
    function _possibleConstructorReturn(self2, call) {
      if (!self2) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return call && (typeof call === "object" || typeof call === "function") ? call : self2;
    }
    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
      }
      subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
      if (superClass)
        Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
    }
    exports2.BaseError = function(_Error) {
      _inherits(BaseError, _Error);
      function BaseError(code, message) {
        _classCallCheck(this, BaseError);
        var _this = _possibleConstructorReturn(this, (BaseError.__proto__ || Object.getPrototypeOf(BaseError)).call(this, code + ": " + message));
        _this.code = code;
        return _this;
      }
      _createClass(BaseError, [{
        key: "toJSON",
        value: function toJSON() {
          return {
            code: this.code,
            message: this.message
          };
        }
      }]);
      return BaseError;
    }(Error);
    exports2.FatalError = function(_exports$BaseError) {
      _inherits(FatalError, _exports$BaseError);
      function FatalError(data) {
        _classCallCheck(this, FatalError);
        var error = typeof data === "string" ? null : data;
        var message = error ? error.message : data;
        var _this2 = _possibleConstructorReturn(this, (FatalError.__proto__ || Object.getPrototypeOf(FatalError)).call(this, "EFATAL", message));
        if (error)
          _this2.stack = error.stack;
        return _this2;
      }
      return FatalError;
    }(exports2.BaseError);
    exports2.ParseError = function(_exports$BaseError2) {
      _inherits(ParseError, _exports$BaseError2);
      function ParseError(message, response) {
        _classCallCheck(this, ParseError);
        var _this3 = _possibleConstructorReturn(this, (ParseError.__proto__ || Object.getPrototypeOf(ParseError)).call(this, "EPARSE", message));
        _this3.response = response;
        return _this3;
      }
      return ParseError;
    }(exports2.BaseError);
    exports2.TelegramError = function(_exports$BaseError3) {
      _inherits(TelegramError, _exports$BaseError3);
      function TelegramError(message, response) {
        _classCallCheck(this, TelegramError);
        var _this4 = _possibleConstructorReturn(this, (TelegramError.__proto__ || Object.getPrototypeOf(TelegramError)).call(this, "ETELEGRAM", message));
        _this4.response = response;
        return _this4;
      }
      return TelegramError;
    }(exports2.BaseError);
  }
});

// node_modules/ms/index.js
var require_ms = __commonJS({
  "node_modules/ms/index.js"(exports2, module2) {
    var s = 1e3;
    var m = s * 60;
    var h = m * 60;
    var d = h * 24;
    var w = d * 7;
    var y = d * 365.25;
    module2.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse2(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse2(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match) {
        return;
      }
      var n = parseFloat(match[1]);
      var type = (match[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n * y;
        case "weeks":
        case "week":
        case "w":
          return n * w;
        case "days":
        case "day":
        case "d":
          return n * d;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n * h;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n * m;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n * s;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return Math.round(ms / d) + "d";
      }
      if (msAbs >= h) {
        return Math.round(ms / h) + "h";
      }
      if (msAbs >= m) {
        return Math.round(ms / m) + "m";
      }
      if (msAbs >= s) {
        return Math.round(ms / s) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return plural(ms, msAbs, d, "day");
      }
      if (msAbs >= h) {
        return plural(ms, msAbs, h, "hour");
      }
      if (msAbs >= m) {
        return plural(ms, msAbs, m, "minute");
      }
      if (msAbs >= s) {
        return plural(ms, msAbs, s, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n, name) {
      var isPlural = msAbs >= n * 1.5;
      return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// node_modules/node-telegram-bot-api/node_modules/debug/src/common.js
var require_common3 = __commonJS({
  "node_modules/node-telegram-bot-api/node_modules/debug/src/common.js"(exports2, module2) {
    "use strict";
    function setup(env2) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      Object.keys(env2).forEach(function(key) {
        createDebug[key] = env2[key];
      });
      createDebug.instances = [];
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        var hash3 = 0;
        for (var i = 0; i < namespace.length; i++) {
          hash3 = (hash3 << 5) - hash3 + namespace.charCodeAt(i);
          hash3 |= 0;
        }
        return createDebug.colors[Math.abs(hash3) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        var prevTime;
        function debug() {
          if (!debug.enabled) {
            return;
          }
          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          var self2 = debug;
          var curr = Number(new Date());
          var ms = curr - (prevTime || curr);
          self2.diff = ms;
          self2.prev = prevTime;
          self2.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          var index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
            if (match === "%%") {
              return match;
            }
            index++;
            var formatter = createDebug.formatters[format];
            if (typeof formatter === "function") {
              var val = args[index];
              match = formatter.call(self2, val);
              args.splice(index, 1);
              index--;
            }
            return match;
          });
          createDebug.formatArgs.call(self2, args);
          var logFn = self2.log || createDebug.log;
          logFn.apply(self2, args);
        }
        debug.namespace = namespace;
        debug.enabled = createDebug.enabled(namespace);
        debug.useColors = createDebug.useColors();
        debug.color = selectColor(namespace);
        debug.destroy = destroy;
        debug.extend = extend;
        if (typeof createDebug.init === "function") {
          createDebug.init(debug);
        }
        createDebug.instances.push(debug);
        return debug;
      }
      function destroy() {
        var index = createDebug.instances.indexOf(this);
        if (index !== -1) {
          createDebug.instances.splice(index, 1);
          return true;
        }
        return false;
      }
      function extend(namespace, delimiter) {
        return createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.names = [];
        createDebug.skips = [];
        var i;
        var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
        var len = split.length;
        for (i = 0; i < len; i++) {
          if (!split[i]) {
            continue;
          }
          namespaces = split[i].replace(/\*/g, ".*?");
          if (namespaces[0] === "-") {
            createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
          } else {
            createDebug.names.push(new RegExp("^" + namespaces + "$"));
          }
        }
        for (i = 0; i < createDebug.instances.length; i++) {
          var instance = createDebug.instances[i];
          instance.enabled = createDebug.enabled(instance.namespace);
        }
      }
      function disable() {
        createDebug.enable("");
      }
      function enabled(name) {
        if (name[name.length - 1] === "*") {
          return true;
        }
        var i;
        var len;
        for (i = 0, len = createDebug.skips.length; i < len; i++) {
          if (createDebug.skips[i].test(name)) {
            return false;
          }
        }
        for (i = 0, len = createDebug.names.length; i < len; i++) {
          if (createDebug.names[i].test(name)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module2.exports = setup;
  }
});

// node_modules/node-telegram-bot-api/node_modules/debug/src/browser.js
var require_browser3 = __commonJS({
  "node_modules/node-telegram-bot-api/node_modules/debug/src/browser.js"(exports2, module2) {
    "use strict";
    function _typeof(obj2) {
      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
        _typeof = function _typeof2(obj3) {
          return typeof obj3;
        };
      } else {
        _typeof = function _typeof2(obj3) {
          return obj3 && typeof Symbol === "function" && obj3.constructor === Symbol && obj3 !== Symbol.prototype ? "symbol" : typeof obj3;
        };
      }
      return _typeof(obj2);
    }
    exports2.log = log;
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.storage = localstorage();
    exports2.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"];
    function useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      var c = "color: " + this.color;
      args.splice(1, 0, c, "color: inherit");
      var index = 0;
      var lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, function(match) {
        if (match === "%%") {
          return;
        }
        index++;
        if (match === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c);
    }
    function log() {
      var _console;
      return (typeof console === "undefined" ? "undefined" : _typeof(console)) === "object" && console.log && (_console = console).log.apply(_console, arguments);
    }
    function save(namespaces) {
      try {
        if (namespaces) {
          exports2.storage.setItem("debug", namespaces);
        } else {
          exports2.storage.removeItem("debug");
        }
      } catch (error) {
      }
    }
    function load() {
      var r;
      try {
        r = exports2.storage.getItem("debug");
      } catch (error) {
      }
      if (!r && typeof process !== "undefined" && "env" in process) {
        r = process.env.DEBUG;
      }
      return r;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error) {
      }
    }
    module2.exports = require_common3()(exports2);
    var formatters = module2.exports.formatters;
    formatters.j = function(v) {
      try {
        return JSON.stringify(v);
      } catch (error) {
        return "[UnexpectedJSONParseError]: " + error.message;
      }
    };
  }
});

// node_modules/process-nextick-args/index.js
var require_process_nextick_args = __commonJS({
  "node_modules/process-nextick-args/index.js"(exports2, module2) {
    "use strict";
    if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
      module2.exports = { nextTick };
    } else {
      module2.exports = process;
    }
    function nextTick(fn2, arg1, arg2, arg3) {
      if (typeof fn2 !== "function") {
        throw new TypeError('"callback" argument must be a function');
      }
      var len = arguments.length;
      var args, i;
      switch (len) {
        case 0:
        case 1:
          return process.nextTick(fn2);
        case 2:
          return process.nextTick(function afterTickOne() {
            fn2.call(null, arg1);
          });
        case 3:
          return process.nextTick(function afterTickTwo() {
            fn2.call(null, arg1, arg2);
          });
        case 4:
          return process.nextTick(function afterTickThree() {
            fn2.call(null, arg1, arg2, arg3);
          });
        default:
          args = new Array(len - 1);
          i = 0;
          while (i < args.length) {
            args[i++] = arguments[i];
          }
          return process.nextTick(function afterTick() {
            fn2.apply(null, args);
          });
      }
    }
  }
});

// node_modules/core-util-is/lib/util.js
var require_util3 = __commonJS({
  "node_modules/core-util-is/lib/util.js"(exports2) {
    function isArray(arg) {
      if (Array.isArray) {
        return Array.isArray(arg);
      }
      return objectToString(arg) === "[object Array]";
    }
    exports2.isArray = isArray;
    function isBoolean(arg) {
      return typeof arg === "boolean";
    }
    exports2.isBoolean = isBoolean;
    function isNull(arg) {
      return arg === null;
    }
    exports2.isNull = isNull;
    function isNullOrUndefined(arg) {
      return arg == null;
    }
    exports2.isNullOrUndefined = isNullOrUndefined;
    function isNumber(arg) {
      return typeof arg === "number";
    }
    exports2.isNumber = isNumber;
    function isString(arg) {
      return typeof arg === "string";
    }
    exports2.isString = isString;
    function isSymbol(arg) {
      return typeof arg === "symbol";
    }
    exports2.isSymbol = isSymbol;
    function isUndefined(arg) {
      return arg === void 0;
    }
    exports2.isUndefined = isUndefined;
    function isRegExp(re) {
      return objectToString(re) === "[object RegExp]";
    }
    exports2.isRegExp = isRegExp;
    function isObject2(arg) {
      return typeof arg === "object" && arg !== null;
    }
    exports2.isObject = isObject2;
    function isDate(d) {
      return objectToString(d) === "[object Date]";
    }
    exports2.isDate = isDate;
    function isError2(e) {
      return objectToString(e) === "[object Error]" || e instanceof Error;
    }
    exports2.isError = isError2;
    function isFunction(arg) {
      return typeof arg === "function";
    }
    exports2.isFunction = isFunction;
    function isPrimitive2(arg) {
      return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
      typeof arg === "undefined";
    }
    exports2.isPrimitive = isPrimitive2;
    exports2.isBuffer = require("buffer").Buffer.isBuffer;
    function objectToString(o) {
      return Object.prototype.toString.call(o);
    }
  }
});

// node_modules/inherits/inherits_browser.js
var require_inherits_browser = __commonJS({
  "node_modules/inherits/inherits_browser.js"(exports2, module2) {
    if (typeof Object.create === "function") {
      module2.exports = function inherits2(ctor, superCtor) {
        if (superCtor) {
          ctor.super_ = superCtor;
          ctor.prototype = Object.create(superCtor.prototype, {
            constructor: {
              value: ctor,
              enumerable: false,
              writable: true,
              configurable: true
            }
          });
        }
      };
    } else {
      module2.exports = function inherits2(ctor, superCtor) {
        if (superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {
          };
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor();
          ctor.prototype.constructor = ctor;
        }
      };
    }
  }
});

// node_modules/isarray/index.js
var require_isarray = __commonJS({
  "node_modules/isarray/index.js"(exports2, module2) {
    var toString = {}.toString;
    module2.exports = Array.isArray || function(arr) {
      return toString.call(arr) == "[object Array]";
    };
  }
});

// node_modules/readable-stream/lib/internal/streams/stream-browser.js
var require_stream_browser = __commonJS({
  "node_modules/readable-stream/lib/internal/streams/stream-browser.js"(exports2, module2) {
    module2.exports = require("events").EventEmitter;
  }
});

// node_modules/readable-stream/node_modules/safe-buffer/index.js
var require_safe_buffer = __commonJS({
  "node_modules/readable-stream/node_modules/safe-buffer/index.js"(exports2, module2) {
    var buffer = require("buffer");
    var Buffer3 = buffer.Buffer;
    function copyProps(src, dst) {
      for (var key in src) {
        dst[key] = src[key];
      }
    }
    if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
      module2.exports = buffer;
    } else {
      copyProps(buffer, exports2);
      exports2.Buffer = SafeBuffer;
    }
    function SafeBuffer(arg, encodingOrOffset, length) {
      return Buffer3(arg, encodingOrOffset, length);
    }
    copyProps(Buffer3, SafeBuffer);
    SafeBuffer.from = function(arg, encodingOrOffset, length) {
      if (typeof arg === "number") {
        throw new TypeError("Argument must not be a number");
      }
      return Buffer3(arg, encodingOrOffset, length);
    };
    SafeBuffer.alloc = function(size, fill, encoding) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      var buf = Buffer3(size);
      if (fill !== void 0) {
        if (typeof encoding === "string") {
          buf.fill(fill, encoding);
        } else {
          buf.fill(fill);
        }
      } else {
        buf.fill(0);
      }
      return buf;
    };
    SafeBuffer.allocUnsafe = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return Buffer3(size);
    };
    SafeBuffer.allocUnsafeSlow = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return buffer.SlowBuffer(size);
    };
  }
});

// node_modules/readable-stream/lib/internal/streams/BufferList.js
var require_BufferList = __commonJS({
  "node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) {
    "use strict";
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
    var Buffer3 = require_safe_buffer().Buffer;
    var util = require("util");
    function copyBuffer(src, target, offset2) {
      src.copy(target, offset2);
    }
    module2.exports = function() {
      function BufferList() {
        _classCallCheck(this, BufferList);
        this.head = null;
        this.tail = null;
        this.length = 0;
      }
      BufferList.prototype.push = function push(v) {
        var entry = { data: v, next: null };
        if (this.length > 0)
          this.tail.next = entry;
        else
          this.head = entry;
        this.tail = entry;
        ++this.length;
      };
      BufferList.prototype.unshift = function unshift(v) {
        var entry = { data: v, next: this.head };
        if (this.length === 0)
          this.tail = entry;
        this.head = entry;
        ++this.length;
      };
      BufferList.prototype.shift = function shift() {
        if (this.length === 0)
          return;
        var ret2 = this.head.data;
        if (this.length === 1)
          this.head = this.tail = null;
        else
          this.head = this.head.next;
        --this.length;
        return ret2;
      };
      BufferList.prototype.clear = function clear() {
        this.head = this.tail = null;
        this.length = 0;
      };
      BufferList.prototype.join = function join(s) {
        if (this.length === 0)
          return "";
        var p = this.head;
        var ret2 = "" + p.data;
        while (p = p.next) {
          ret2 += s + p.data;
        }
        return ret2;
      };
      BufferList.prototype.concat = function concat(n) {
        if (this.length === 0)
          return Buffer3.alloc(0);
        var ret2 = Buffer3.allocUnsafe(n >>> 0);
        var p = this.head;
        var i = 0;
        while (p) {
          copyBuffer(p.data, ret2, i);
          i += p.data.length;
          p = p.next;
        }
        return ret2;
      };
      return BufferList;
    }();
    if (util && util.inspect && util.inspect.custom) {
      module2.exports.prototype[util.inspect.custom] = function() {
        var obj2 = util.inspect({ length: this.length });
        return this.constructor.name + " " + obj2;
      };
    }
  }
});

// node_modules/readable-stream/lib/internal/streams/destroy.js
var require_destroy = __commonJS({
  "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) {
    "use strict";
    var pna = require_process_nextick_args();
    function destroy(err, cb) {
      var _this = this;
      var readableDestroyed = this._readableState && this._readableState.destroyed;
      var writableDestroyed = this._writableState && this._writableState.destroyed;
      if (readableDestroyed || writableDestroyed) {
        if (cb) {
          cb(err);
        } else if (err) {
          if (!this._writableState) {
            pna.nextTick(emitErrorNT, this, err);
          } else if (!this._writableState.errorEmitted) {
            this._writableState.errorEmitted = true;
            pna.nextTick(emitErrorNT, this, err);
          }
        }
        return this;
      }
      if (this._readableState) {
        this._readableState.destroyed = true;
      }
      if (this._writableState) {
        this._writableState.destroyed = true;
      }
      this._destroy(err || null, function(err2) {
        if (!cb && err2) {
          if (!_this._writableState) {
            pna.nextTick(emitErrorNT, _this, err2);
          } else if (!_this._writableState.errorEmitted) {
            _this._writableState.errorEmitted = true;
            pna.nextTick(emitErrorNT, _this, err2);
          }
        } else if (cb) {
          cb(err2);
        }
      });
      return this;
    }
    function undestroy() {
      if (this._readableState) {
        this._readableState.destroyed = false;
        this._readableState.reading = false;
        this._readableState.ended = false;
        this._readableState.endEmitted = false;
      }
      if (this._writableState) {
        this._writableState.destroyed = false;
        this._writableState.ended = false;
        this._writableState.ending = false;
        this._writableState.finalCalled = false;
        this._writableState.prefinished = false;
        this._writableState.finished = false;
        this._writableState.errorEmitted = false;
      }
    }
    function emitErrorNT(self2, err) {
      self2.emit("error", err);
    }
    module2.exports = {
      destroy,
      undestroy
    };
  }
});

// node_modules/readable-stream/lib/_stream_readable.js
var require_stream_readable = __commonJS({
  "node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
    "use strict";
    var pna = require_process_nextick_args();
    module2.exports = Readable;
    var isArray = require_isarray();
    var Duplex;
    Readable.ReadableState = ReadableState;
    var EE = require("events").EventEmitter;
    var EElistenerCount = function(emitter, type) {
      return emitter.listeners(type).length;
    };
    var Stream = require_stream_browser();
    var Buffer3 = require_safe_buffer().Buffer;
    var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
    };
    function _uint8ArrayToBuffer(chunk) {
      return Buffer3.from(chunk);
    }
    function _isUint8Array(obj2) {
      return Buffer3.isBuffer(obj2) || obj2 instanceof OurUint8Array;
    }
    var util = Object.create(require_util3());
    util.inherits = require_inherits_browser();
    var debugUtil = require("util");
    var debug = void 0;
    if (debugUtil && debugUtil.debuglog) {
      debug = debugUtil.debuglog("stream");
    } else {
      debug = function() {
      };
    }
    var BufferList = require_BufferList();
    var destroyImpl = require_destroy();
    var StringDecoder;
    util.inherits(Readable, Stream);
    var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
    function prependListener(emitter, event, fn2) {
      if (typeof emitter.prependListener === "function")
        return emitter.prependListener(event, fn2);
      if (!emitter._events || !emitter._events[event])
        emitter.on(event, fn2);
      else if (isArray(emitter._events[event]))
        emitter._events[event].unshift(fn2);
      else
        emitter._events[event] = [fn2, emitter._events[event]];
    }
    function ReadableState(options, stream) {
      Duplex = Duplex || require_stream_duplex();
      options = options || {};
      var isDuplex = stream instanceof Duplex;
      this.objectMode = !!options.objectMode;
      if (isDuplex)
        this.objectMode = this.objectMode || !!options.readableObjectMode;
      var hwm = options.highWaterMark;
      var readableHwm = options.readableHighWaterMark;
      var defaultHwm = this.objectMode ? 16 : 16 * 1024;
      if (hwm || hwm === 0)
        this.highWaterMark = hwm;
      else if (isDuplex && (readableHwm || readableHwm === 0))
        this.highWaterMark = readableHwm;
      else
        this.highWaterMark = defaultHwm;
      this.highWaterMark = Math.floor(this.highWaterMark);
      this.buffer = new BufferList();
      this.length = 0;
      this.pipes = null;
      this.pipesCount = 0;
      this.flowing = null;
      this.ended = false;
      this.endEmitted = false;
      this.reading = false;
      this.sync = true;
      this.needReadable = false;
      this.emittedReadable = false;
      this.readableListening = false;
      this.resumeScheduled = false;
      this.destroyed = false;
      this.defaultEncoding = options.defaultEncoding || "utf8";
      this.awaitDrain = 0;
      this.readingMore = false;
      this.decoder = null;
      this.encoding = null;
      if (options.encoding) {
        if (!StringDecoder)
          StringDecoder = require("string_decoder/").StringDecoder;
        this.decoder = new StringDecoder(options.encoding);
        this.encoding = options.encoding;
      }
    }
    function Readable(options) {
      Duplex = Duplex || require_stream_duplex();
      if (!(this instanceof Readable))
        return new Readable(options);
      this._readableState = new ReadableState(options, this);
      this.readable = true;
      if (options) {
        if (typeof options.read === "function")
          this._read = options.read;
        if (typeof options.destroy === "function")
          this._destroy = options.destroy;
      }
      Stream.call(this);
    }
    Object.defineProperty(Readable.prototype, "destroyed", {
      get: function() {
        if (this._readableState === void 0) {
          return false;
        }
        return this._readableState.destroyed;
      },
      set: function(value) {
        if (!this._readableState) {
          return;
        }
        this._readableState.destroyed = value;
      }
    });
    Readable.prototype.destroy = destroyImpl.destroy;
    Readable.prototype._undestroy = destroyImpl.undestroy;
    Readable.prototype._destroy = function(err, cb) {
      this.push(null);
      cb(err);
    };
    Readable.prototype.push = function(chunk, encoding) {
      var state = this._readableState;
      var skipChunkCheck;
      if (!state.objectMode) {
        if (typeof chunk === "string") {
          encoding = encoding || state.defaultEncoding;
          if (encoding !== state.encoding) {
            chunk = Buffer3.from(chunk, encoding);
            encoding = "";
          }
          skipChunkCheck = true;
        }
      } else {
        skipChunkCheck = true;
      }
      return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
    };
    Readable.prototype.unshift = function(chunk) {
      return readableAddChunk(this, chunk, null, true, false);
    };
    function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
      var state = stream._readableState;
      if (chunk === null) {
        state.reading = false;
        onEofChunk(stream, state);
      } else {
        var er;
        if (!skipChunkCheck)
          er = chunkInvalid(state, chunk);
        if (er) {
          stream.emit("error", er);
        } else if (state.objectMode || chunk && chunk.length > 0) {
          if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer3.prototype) {
            chunk = _uint8ArrayToBuffer(chunk);
          }
          if (addToFront) {
            if (state.endEmitted)
              stream.emit("error", new Error("stream.unshift() after end event"));
            else
              addChunk(stream, state, chunk, true);
          } else if (state.ended) {
            stream.emit("error", new Error("stream.push() after EOF"));
          } else {
            state.reading = false;
            if (state.decoder && !encoding) {
              chunk = state.decoder.write(chunk);
              if (state.objectMode || chunk.length !== 0)
                addChunk(stream, state, chunk, false);
              else
                maybeReadMore(stream, state);
            } else {
              addChunk(stream, state, chunk, false);
            }
          }
        } else if (!addToFront) {
          state.reading = false;
        }
      }
      return needMoreData(state);
    }
    function addChunk(stream, state, chunk, addToFront) {
      if (state.flowing && state.length === 0 && !state.sync) {
        stream.emit("data", chunk);
        stream.read(0);
      } else {
        state.length += state.objectMode ? 1 : chunk.length;
        if (addToFront)
          state.buffer.unshift(chunk);
        else
          state.buffer.push(chunk);
        if (state.needReadable)
          emitReadable(stream);
      }
      maybeReadMore(stream, state);
    }
    function chunkInvalid(state, chunk) {
      var er;
      if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
        er = new TypeError("Invalid non-string/buffer chunk");
      }
      return er;
    }
    function needMoreData(state) {
      return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
    }
    Readable.prototype.isPaused = function() {
      return this._readableState.flowing === false;
    };
    Readable.prototype.setEncoding = function(enc) {
      if (!StringDecoder)
        StringDecoder = require("string_decoder/").StringDecoder;
      this._readableState.decoder = new StringDecoder(enc);
      this._readableState.encoding = enc;
      return this;
    };
    var MAX_HWM = 8388608;
    function computeNewHighWaterMark(n) {
      if (n >= MAX_HWM) {
        n = MAX_HWM;
      } else {
        n--;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        n++;
      }
      return n;
    }
    function howMuchToRead(n, state) {
      if (n <= 0 || state.length === 0 && state.ended)
        return 0;
      if (state.objectMode)
        return 1;
      if (n !== n) {
        if (state.flowing && state.length)
          return state.buffer.head.data.length;
        else
          return state.length;
      }
      if (n > state.highWaterMark)
        state.highWaterMark = computeNewHighWaterMark(n);
      if (n <= state.length)
        return n;
      if (!state.ended) {
        state.needReadable = true;
        return 0;
      }
      return state.length;
    }
    Readable.prototype.read = function(n) {
      debug("read", n);
      n = parseInt(n, 10);
      var state = this._readableState;
      var nOrig = n;
      if (n !== 0)
        state.emittedReadable = false;
      if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
        debug("read: emitReadable", state.length, state.ended);
        if (state.length === 0 && state.ended)
          endReadable(this);
        else
          emitReadable(this);
        return null;
      }
      n = howMuchToRead(n, state);
      if (n === 0 && state.ended) {
        if (state.length === 0)
          endReadable(this);
        return null;
      }
      var doRead = state.needReadable;
      debug("need readable", doRead);
      if (state.length === 0 || state.length - n < state.highWaterMark) {
        doRead = true;
        debug("length less than watermark", doRead);
      }
      if (state.ended || state.reading) {
        doRead = false;
        debug("reading or ended", doRead);
      } else if (doRead) {
        debug("do read");
        state.reading = true;
        state.sync = true;
        if (state.length === 0)
          state.needReadable = true;
        this._read(state.highWaterMark);
        state.sync = false;
        if (!state.reading)
          n = howMuchToRead(nOrig, state);
      }
      var ret2;
      if (n > 0)
        ret2 = fromList(n, state);
      else
        ret2 = null;
      if (ret2 === null) {
        state.needReadable = true;
        n = 0;
      } else {
        state.length -= n;
      }
      if (state.length === 0) {
        if (!state.ended)
          state.needReadable = true;
        if (nOrig !== n && state.ended)
          endReadable(this);
      }
      if (ret2 !== null)
        this.emit("data", ret2);
      return ret2;
    };
    function onEofChunk(stream, state) {
      if (state.ended)
        return;
      if (state.decoder) {
        var chunk = state.decoder.end();
        if (chunk && chunk.length) {
          state.buffer.push(chunk);
          state.length += state.objectMode ? 1 : chunk.length;
        }
      }
      state.ended = true;
      emitReadable(stream);
    }
    function emitReadable(stream) {
      var state = stream._readableState;
      state.needReadable = false;
      if (!state.emittedReadable) {
        debug("emitReadable", state.flowing);
        state.emittedReadable = true;
        if (state.sync)
          pna.nextTick(emitReadable_, stream);
        else
          emitReadable_(stream);
      }
    }
    function emitReadable_(stream) {
      debug("emit readable");
      stream.emit("readable");
      flow(stream);
    }
    function maybeReadMore(stream, state) {
      if (!state.readingMore) {
        state.readingMore = true;
        pna.nextTick(maybeReadMore_, stream, state);
      }
    }
    function maybeReadMore_(stream, state) {
      var len = state.length;
      while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
        debug("maybeReadMore read 0");
        stream.read(0);
        if (len === state.length)
          break;
        else
          len = state.length;
      }
      state.readingMore = false;
    }
    Readable.prototype._read = function(n) {
      this.emit("error", new Error("_read() is not implemented"));
    };
    Readable.prototype.pipe = function(dest, pipeOpts) {
      var src = this;
      var state = this._readableState;
      switch (state.pipesCount) {
        case 0:
          state.pipes = dest;
          break;
        case 1:
          state.pipes = [state.pipes, dest];
          break;
        default:
          state.pipes.push(dest);
          break;
      }
      state.pipesCount += 1;
      debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
      var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
      var endFn = doEnd ? onend : unpipe;
      if (state.endEmitted)
        pna.nextTick(endFn);
      else
        src.once("end", endFn);
      dest.on("unpipe", onunpipe);
      function onunpipe(readable, unpipeInfo) {
        debug("onunpipe");
        if (readable === src) {
          if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
            unpipeInfo.hasUnpiped = true;
            cleanup();
          }
        }
      }
      function onend() {
        debug("onend");
        dest.end();
      }
      var ondrain = pipeOnDrain(src);
      dest.on("drain", ondrain);
      var cleanedUp = false;
      function cleanup() {
        debug("cleanup");
        dest.removeListener("close", onclose);
        dest.removeListener("finish", onfinish);
        dest.removeListener("drain", ondrain);
        dest.removeListener("error", onerror);
        dest.removeListener("unpipe", onunpipe);
        src.removeListener("end", onend);
        src.removeListener("end", unpipe);
        src.removeListener("data", ondata);
        cleanedUp = true;
        if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
          ondrain();
      }
      var increasedAwaitDrain = false;
      src.on("data", ondata);
      function ondata(chunk) {
        debug("ondata");
        increasedAwaitDrain = false;
        var ret2 = dest.write(chunk);
        if (false === ret2 && !increasedAwaitDrain) {
          if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
            debug("false write response, pause", state.awaitDrain);
            state.awaitDrain++;
            increasedAwaitDrain = true;
          }
          src.pause();
        }
      }
      function onerror(er) {
        debug("onerror", er);
        unpipe();
        dest.removeListener("error", onerror);
        if (EElistenerCount(dest, "error") === 0)
          dest.emit("error", er);
      }
      prependListener(dest, "error", onerror);
      function onclose() {
        dest.removeListener("finish", onfinish);
        unpipe();
      }
      dest.once("close", onclose);
      function onfinish() {
        debug("onfinish");
        dest.removeListener("close", onclose);
        unpipe();
      }
      dest.once("finish", onfinish);
      function unpipe() {
        debug("unpipe");
        src.unpipe(dest);
      }
      dest.emit("pipe", src);
      if (!state.flowing) {
        debug("pipe resume");
        src.resume();
      }
      return dest;
    };
    function pipeOnDrain(src) {
      return function() {
        var state = src._readableState;
        debug("pipeOnDrain", state.awaitDrain);
        if (state.awaitDrain)
          state.awaitDrain--;
        if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
          state.flowing = true;
          flow(src);
        }
      };
    }
    Readable.prototype.unpipe = function(dest) {
      var state = this._readableState;
      var unpipeInfo = { hasUnpiped: false };
      if (state.pipesCount === 0)
        return this;
      if (state.pipesCount === 1) {
        if (dest && dest !== state.pipes)
          return this;
        if (!dest)
          dest = state.pipes;
        state.pipes = null;
        state.pipesCount = 0;
        state.flowing = false;
        if (dest)
          dest.emit("unpipe", this, unpipeInfo);
        return this;
      }
      if (!dest) {
        var dests = state.pipes;
        var len = state.pipesCount;
        state.pipes = null;
        state.pipesCount = 0;
        state.flowing = false;
        for (var i = 0; i < len; i++) {
          dests[i].emit("unpipe", this, { hasUnpiped: false });
        }
        return this;
      }
      var index = indexOf(state.pipes, dest);
      if (index === -1)
        return this;
      state.pipes.splice(index, 1);
      state.pipesCount -= 1;
      if (state.pipesCount === 1)
        state.pipes = state.pipes[0];
      dest.emit("unpipe", this, unpipeInfo);
      return this;
    };
    Readable.prototype.on = function(ev, fn2) {
      var res = Stream.prototype.on.call(this, ev, fn2);
      if (ev === "data") {
        if (this._readableState.flowing !== false)
          this.resume();
      } else if (ev === "readable") {
        var state = this._readableState;
        if (!state.endEmitted && !state.readableListening) {
          state.readableListening = state.needReadable = true;
          state.emittedReadable = false;
          if (!state.reading) {
            pna.nextTick(nReadingNextTick, this);
          } else if (state.length) {
            emitReadable(this);
          }
        }
      }
      return res;
    };
    Readable.prototype.addListener = Readable.prototype.on;
    function nReadingNextTick(self2) {
      debug("readable nexttick read 0");
      self2.read(0);
    }
    Readable.prototype.resume = function() {
      var state = this._readableState;
      if (!state.flowing) {
        debug("resume");
        state.flowing = true;
        resume(this, state);
      }
      return this;
    };
    function resume(stream, state) {
      if (!state.resumeScheduled) {
        state.resumeScheduled = true;
        pna.nextTick(resume_, stream, state);
      }
    }
    function resume_(stream, state) {
      if (!state.reading) {
        debug("resume read 0");
        stream.read(0);
      }
      state.resumeScheduled = false;
      state.awaitDrain = 0;
      stream.emit("resume");
      flow(stream);
      if (state.flowing && !state.reading)
        stream.read(0);
    }
    Readable.prototype.pause = function() {
      debug("call pause flowing=%j", this._readableState.flowing);
      if (false !== this._readableState.flowing) {
        debug("pause");
        this._readableState.flowing = false;
        this.emit("pause");
      }
      return this;
    };
    function flow(stream) {
      var state = stream._readableState;
      debug("flow", state.flowing);
      while (state.flowing && stream.read() !== null) {
      }
    }
    Readable.prototype.wrap = function(stream) {
      var _this = this;
      var state = this._readableState;
      var paused = false;
      stream.on("end", function() {
        debug("wrapped end");
        if (state.decoder && !state.ended) {
          var chunk = state.decoder.end();
          if (chunk && chunk.length)
            _this.push(chunk);
        }
        _this.push(null);
      });
      stream.on("data", function(chunk) {
        debug("wrapped data");
        if (state.decoder)
          chunk = state.decoder.write(chunk);
        if (state.objectMode && (chunk === null || chunk === void 0))
          return;
        else if (!state.objectMode && (!chunk || !chunk.length))
          return;
        var ret2 = _this.push(chunk);
        if (!ret2) {
          paused = true;
          stream.pause();
        }
      });
      for (var i in stream) {
        if (this[i] === void 0 && typeof stream[i] === "function") {
          this[i] = function(method) {
            return function() {
              return stream[method].apply(stream, arguments);
            };
          }(i);
        }
      }
      for (var n = 0; n < kProxyEvents.length; n++) {
        stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
      }
      this._read = function(n2) {
        debug("wrapped _read", n2);
        if (paused) {
          paused = false;
          stream.resume();
        }
      };
      return this;
    };
    Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function() {
        return this._readableState.highWaterMark;
      }
    });
    Readable._fromList = fromList;
    function fromList(n, state) {
      if (state.length === 0)
        return null;
      var ret2;
      if (state.objectMode)
        ret2 = state.buffer.shift();
      else if (!n || n >= state.length) {
        if (state.decoder)
          ret2 = state.buffer.join("");
        else if (state.buffer.length === 1)
          ret2 = state.buffer.head.data;
        else
          ret2 = state.buffer.concat(state.length);
        state.buffer.clear();
      } else {
        ret2 = fromListPartial(n, state.buffer, state.decoder);
      }
      return ret2;
    }
    function fromListPartial(n, list, hasStrings) {
      var ret2;
      if (n < list.head.data.length) {
        ret2 = list.head.data.slice(0, n);
        list.head.data = list.head.data.slice(n);
      } else if (n === list.head.data.length) {
        ret2 = list.shift();
      } else {
        ret2 = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
      }
      return ret2;
    }
    function copyFromBufferString(n, list) {
      var p = list.head;
      var c = 1;
      var ret2 = p.data;
      n -= ret2.length;
      while (p = p.next) {
        var str = p.data;
        var nb = n > str.length ? str.length : n;
        if (nb === str.length)
          ret2 += str;
        else
          ret2 += str.slice(0, n);
        n -= nb;
        if (n === 0) {
          if (nb === str.length) {
            ++c;
            if (p.next)
              list.head = p.next;
            else
              list.head = list.tail = null;
          } else {
            list.head = p;
            p.data = str.slice(nb);
          }
          break;
        }
        ++c;
      }
      list.length -= c;
      return ret2;
    }
    function copyFromBuffer(n, list) {
      var ret2 = Buffer3.allocUnsafe(n);
      var p = list.head;
      var c = 1;
      p.data.copy(ret2);
      n -= p.data.length;
      while (p = p.next) {
        var buf = p.data;
        var nb = n > buf.length ? buf.length : n;
        buf.copy(ret2, ret2.length - n, 0, nb);
        n -= nb;
        if (n === 0) {
          if (nb === buf.length) {
            ++c;
            if (p.next)
              list.head = p.next;
            else
              list.head = list.tail = null;
          } else {
            list.head = p;
            p.data = buf.slice(nb);
          }
          break;
        }
        ++c;
      }
      list.length -= c;
      return ret2;
    }
    function endReadable(stream) {
      var state = stream._readableState;
      if (state.length > 0)
        throw new Error('"endReadable()" called on non-empty stream');
      if (!state.endEmitted) {
        state.ended = true;
        pna.nextTick(endReadableNT, state, stream);
      }
    }
    function endReadableNT(state, stream) {
      if (!state.endEmitted && state.length === 0) {
        state.endEmitted = true;
        stream.readable = false;
        stream.emit("end");
      }
    }
    function indexOf(xs, x) {
      for (var i = 0, l = xs.length; i < l; i++) {
        if (xs[i] === x)
          return i;
      }
      return -1;
    }
  }
});

// node_modules/util-deprecate/browser.js
var require_browser4 = __commonJS({
  "node_modules/util-deprecate/browser.js"(exports2, module2) {
    module2.exports = deprecate;
    function deprecate(fn2, msg) {
      if (config("noDeprecation")) {
        return fn2;
      }
      var warned = false;
      function deprecated() {
        if (!warned) {
          if (config("throwDeprecation")) {
            throw new Error(msg);
          } else if (config("traceDeprecation")) {
            console.trace(msg);
          } else {
            console.warn(msg);
          }
          warned = true;
        }
        return fn2.apply(this, arguments);
      }
      return deprecated;
    }
    function config(name) {
      try {
        if (!global.localStorage)
          return false;
      } catch (_) {
        return false;
      }
      var val = global.localStorage[name];
      if (null == val)
        return false;
      return String(val).toLowerCase() === "true";
    }
  }
});

// node_modules/readable-stream/lib/_stream_writable.js
var require_stream_writable = __commonJS({
  "node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) {
    "use strict";
    var pna = require_process_nextick_args();
    module2.exports = Writable;
    function CorkedRequest(state) {
      var _this = this;
      this.next = null;
      this.entry = null;
      this.finish = function() {
        onCorkedFinish(_this, state);
      };
    }
    var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
    var Duplex;
    Writable.WritableState = WritableState;
    var util = Object.create(require_util3());
    util.inherits = require_inherits_browser();
    var internalUtil = {
      deprecate: require_browser4()
    };
    var Stream = require_stream_browser();
    var Buffer3 = require_safe_buffer().Buffer;
    var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
    };
    function _uint8ArrayToBuffer(chunk) {
      return Buffer3.from(chunk);
    }
    function _isUint8Array(obj2) {
      return Buffer3.isBuffer(obj2) || obj2 instanceof OurUint8Array;
    }
    var destroyImpl = require_destroy();
    util.inherits(Writable, Stream);
    function nop() {
    }
    function WritableState(options, stream) {
      Duplex = Duplex || require_stream_duplex();
      options = options || {};
      var isDuplex = stream instanceof Duplex;
      this.objectMode = !!options.objectMode;
      if (isDuplex)
        this.objectMode = this.objectMode || !!options.writableObjectMode;
      var hwm = options.highWaterMark;
      var writableHwm = options.writableHighWaterMark;
      var defaultHwm = this.objectMode ? 16 : 16 * 1024;
      if (hwm || hwm === 0)
        this.highWaterMark = hwm;
      else if (isDuplex && (writableHwm || writableHwm === 0))
        this.highWaterMark = writableHwm;
      else
        this.highWaterMark = defaultHwm;
      this.highWaterMark = Math.floor(this.highWaterMark);
      this.finalCalled = false;
      this.needDrain = false;
      this.ending = false;
      this.ended = false;
      this.finished = false;
      this.destroyed = false;
      var noDecode = options.decodeStrings === false;
      this.decodeStrings = !noDecode;
      this.defaultEncoding = options.defaultEncoding || "utf8";
      this.length = 0;
      this.writing = false;
      this.corked = 0;
      this.sync = true;
      this.bufferProcessing = false;
      this.onwrite = function(er) {
        onwrite(stream, er);
      };
      this.writecb = null;
      this.writelen = 0;
      this.bufferedRequest = null;
      this.lastBufferedRequest = null;
      this.pendingcb = 0;
      this.prefinished = false;
      this.errorEmitted = false;
      this.bufferedRequestCount = 0;
      this.corkedRequestsFree = new CorkedRequest(this);
    }
    WritableState.prototype.getBuffer = function getBuffer() {
      var current = this.bufferedRequest;
      var out = [];
      while (current) {
        out.push(current);
        current = current.next;
      }
      return out;
    };
    (function() {
      try {
        Object.defineProperty(WritableState.prototype, "buffer", {
          get: internalUtil.deprecate(function() {
            return this.getBuffer();
          }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
        });
      } catch (_) {
      }
    })();
    var realHasInstance;
    if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
      realHasInstance = Function.prototype[Symbol.hasInstance];
      Object.defineProperty(Writable, Symbol.hasInstance, {
        value: function(object) {
          if (realHasInstance.call(this, object))
            return true;
          if (this !== Writable)
            return false;
          return object && object._writableState instanceof WritableState;
        }
      });
    } else {
      realHasInstance = function(object) {
        return object instanceof this;
      };
    }
    function Writable(options) {
      Duplex = Duplex || require_stream_duplex();
      if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
        return new Writable(options);
      }
      this._writableState = new WritableState(options, this);
      this.writable = true;
      if (options) {
        if (typeof options.write === "function")
          this._write = options.write;
        if (typeof options.writev === "function")
          this._writev = options.writev;
        if (typeof options.destroy === "function")
          this._destroy = options.destroy;
        if (typeof options.final === "function")
          this._final = options.final;
      }
      Stream.call(this);
    }
    Writable.prototype.pipe = function() {
      this.emit("error", new Error("Cannot pipe, not readable"));
    };
    function writeAfterEnd(stream, cb) {
      var er = new Error("write after end");
      stream.emit("error", er);
      pna.nextTick(cb, er);
    }
    function validChunk(stream, state, chunk, cb) {
      var valid = true;
      var er = false;
      if (chunk === null) {
        er = new TypeError("May not write null values to stream");
      } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
        er = new TypeError("Invalid non-string/buffer chunk");
      }
      if (er) {
        stream.emit("error", er);
        pna.nextTick(cb, er);
        valid = false;
      }
      return valid;
    }
    Writable.prototype.write = function(chunk, encoding, cb) {
      var state = this._writableState;
      var ret2 = false;
      var isBuf = !state.objectMode && _isUint8Array(chunk);
      if (isBuf && !Buffer3.isBuffer(chunk)) {
        chunk = _uint8ArrayToBuffer(chunk);
      }
      if (typeof encoding === "function") {
        cb = encoding;
        encoding = null;
      }
      if (isBuf)
        encoding = "buffer";
      else if (!encoding)
        encoding = state.defaultEncoding;
      if (typeof cb !== "function")
        cb = nop;
      if (state.ended)
        writeAfterEnd(this, cb);
      else if (isBuf || validChunk(this, state, chunk, cb)) {
        state.pendingcb++;
        ret2 = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
      }
      return ret2;
    };
    Writable.prototype.cork = function() {
      var state = this._writableState;
      state.corked++;
    };
    Writable.prototype.uncork = function() {
      var state = this._writableState;
      if (state.corked) {
        state.corked--;
        if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest)
          clearBuffer(this, state);
      }
    };
    Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
      if (typeof encoding === "string")
        encoding = encoding.toLowerCase();
      if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
        throw new TypeError("Unknown encoding: " + encoding);
      this._writableState.defaultEncoding = encoding;
      return this;
    };
    function decodeChunk(state, chunk, encoding) {
      if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
        chunk = Buffer3.from(chunk, encoding);
      }
      return chunk;
    }
    Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function() {
        return this._writableState.highWaterMark;
      }
    });
    function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
      if (!isBuf) {
        var newChunk = decodeChunk(state, chunk, encoding);
        if (chunk !== newChunk) {
          isBuf = true;
          encoding = "buffer";
          chunk = newChunk;
        }
      }
      var len = state.objectMode ? 1 : chunk.length;
      state.length += len;
      var ret2 = state.length < state.highWaterMark;
      if (!ret2)
        state.needDrain = true;
      if (state.writing || state.corked) {
        var last = state.lastBufferedRequest;
        state.lastBufferedRequest = {
          chunk,
          encoding,
          isBuf,
          callback: cb,
          next: null
        };
        if (last) {
          last.next = state.lastBufferedRequest;
        } else {
          state.bufferedRequest = state.lastBufferedRequest;
        }
        state.bufferedRequestCount += 1;
      } else {
        doWrite(stream, state, false, len, chunk, encoding, cb);
      }
      return ret2;
    }
    function doWrite(stream, state, writev, len, chunk, encoding, cb) {
      state.writelen = len;
      state.writecb = cb;
      state.writing = true;
      state.sync = true;
      if (writev)
        stream._writev(chunk, state.onwrite);
      else
        stream._write(chunk, encoding, state.onwrite);
      state.sync = false;
    }
    function onwriteError(stream, state, sync, er, cb) {
      --state.pendingcb;
      if (sync) {
        pna.nextTick(cb, er);
        pna.nextTick(finishMaybe, stream, state);
        stream._writableState.errorEmitted = true;
        stream.emit("error", er);
      } else {
        cb(er);
        stream._writableState.errorEmitted = true;
        stream.emit("error", er);
        finishMaybe(stream, state);
      }
    }
    function onwriteStateUpdate(state) {
      state.writing = false;
      state.writecb = null;
      state.length -= state.writelen;
      state.writelen = 0;
    }
    function onwrite(stream, er) {
      var state = stream._writableState;
      var sync = state.sync;
      var cb = state.writecb;
      onwriteStateUpdate(state);
      if (er)
        onwriteError(stream, state, sync, er, cb);
      else {
        var finished = needFinish(state);
        if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
          clearBuffer(stream, state);
        }
        if (sync) {
          asyncWrite(afterWrite2, stream, state, finished, cb);
        } else {
          afterWrite2(stream, state, finished, cb);
        }
      }
    }
    function afterWrite2(stream, state, finished, cb) {
      if (!finished)
        onwriteDrain(stream, state);
      state.pendingcb--;
      cb();
      finishMaybe(stream, state);
    }
    function onwriteDrain(stream, state) {
      if (state.length === 0 && state.needDrain) {
        state.needDrain = false;
        stream.emit("drain");
      }
    }
    function clearBuffer(stream, state) {
      state.bufferProcessing = true;
      var entry = state.bufferedRequest;
      if (stream._writev && entry && entry.next) {
        var l = state.bufferedRequestCount;
        var buffer = new Array(l);
        var holder = state.corkedRequestsFree;
        holder.entry = entry;
        var count = 0;
        var allBuffers = true;
        while (entry) {
          buffer[count] = entry;
          if (!entry.isBuf)
            allBuffers = false;
          entry = entry.next;
          count += 1;
        }
        buffer.allBuffers = allBuffers;
        doWrite(stream, state, true, state.length, buffer, "", holder.finish);
        state.pendingcb++;
        state.lastBufferedRequest = null;
        if (holder.next) {
          state.corkedRequestsFree = holder.next;
          holder.next = null;
        } else {
          state.corkedRequestsFree = new CorkedRequest(state);
        }
        state.bufferedRequestCount = 0;
      } else {
        while (entry) {
          var chunk = entry.chunk;
          var encoding = entry.encoding;
          var cb = entry.callback;
          var len = state.objectMode ? 1 : chunk.length;
          doWrite(stream, state, false, len, chunk, encoding, cb);
          entry = entry.next;
          state.bufferedRequestCount--;
          if (state.writing) {
            break;
          }
        }
        if (entry === null)
          state.lastBufferedRequest = null;
      }
      state.bufferedRequest = entry;
      state.bufferProcessing = false;
    }
    Writable.prototype._write = function(chunk, encoding, cb) {
      cb(new Error("_write() is not implemented"));
    };
    Writable.prototype._writev = null;
    Writable.prototype.end = function(chunk, encoding, cb) {
      var state = this._writableState;
      if (typeof chunk === "function") {
        cb = chunk;
        chunk = null;
        encoding = null;
      } else if (typeof encoding === "function") {
        cb = encoding;
        encoding = null;
      }
      if (chunk !== null && chunk !== void 0)
        this.write(chunk, encoding);
      if (state.corked) {
        state.corked = 1;
        this.uncork();
      }
      if (!state.ending)
        endWritable(this, state, cb);
    };
    function needFinish(state) {
      return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
    }
    function callFinal(stream, state) {
      stream._final(function(err) {
        state.pendingcb--;
        if (err) {
          stream.emit("error", err);
        }
        state.prefinished = true;
        stream.emit("prefinish");
        finishMaybe(stream, state);
      });
    }
    function prefinish(stream, state) {
      if (!state.prefinished && !state.finalCalled) {
        if (typeof stream._final === "function") {
          state.pendingcb++;
          state.finalCalled = true;
          pna.nextTick(callFinal, stream, state);
        } else {
          state.prefinished = true;
          stream.emit("prefinish");
        }
      }
    }
    function finishMaybe(stream, state) {
      var need = needFinish(state);
      if (need) {
        prefinish(stream, state);
        if (state.pendingcb === 0) {
          state.finished = true;
          stream.emit("finish");
        }
      }
      return need;
    }
    function endWritable(stream, state, cb) {
      state.ending = true;
      finishMaybe(stream, state);
      if (cb) {
        if (state.finished)
          pna.nextTick(cb);
        else
          stream.once("finish", cb);
      }
      state.ended = true;
      stream.writable = false;
    }
    function onCorkedFinish(corkReq, state, err) {
      var entry = corkReq.entry;
      corkReq.entry = null;
      while (entry) {
        var cb = entry.callback;
        state.pendingcb--;
        cb(err);
        entry = entry.next;
      }
      state.corkedRequestsFree.next = corkReq;
    }
    Object.defineProperty(Writable.prototype, "destroyed", {
      get: function() {
        if (this._writableState === void 0) {
          return false;
        }
        return this._writableState.destroyed;
      },
      set: function(value) {
        if (!this._writableState) {
          return;
        }
        this._writableState.destroyed = value;
      }
    });
    Writable.prototype.destroy = destroyImpl.destroy;
    Writable.prototype._undestroy = destroyImpl.undestroy;
    Writable.prototype._destroy = function(err, cb) {
      this.end();
      cb(err);
    };
  }
});

// node_modules/readable-stream/lib/_stream_duplex.js
var require_stream_duplex = __commonJS({
  "node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) {
    "use strict";
    var pna = require_process_nextick_args();
    var objectKeys = Object.keys || function(obj2) {
      var keys2 = [];
      for (var key in obj2) {
        keys2.push(key);
      }
      return keys2;
    };
    module2.exports = Duplex;
    var util = Object.create(require_util3());
    util.inherits = require_inherits_browser();
    var Readable = require_stream_readable();
    var Writable = require_stream_writable();
    util.inherits(Duplex, Readable);
    {
      keys = objectKeys(Writable.prototype);
      for (v = 0; v < keys.length; v++) {
        method = keys[v];
        if (!Duplex.prototype[method])
          Duplex.prototype[method] = Writable.prototype[method];
      }
    }
    var keys;
    var method;
    var v;
    function Duplex(options) {
      if (!(this instanceof Duplex))
        return new Duplex(options);
      Readable.call(this, options);
      Writable.call(this, options);
      if (options && options.readable === false)
        this.readable = false;
      if (options && options.writable === false)
        this.writable = false;
      this.allowHalfOpen = true;
      if (options && options.allowHalfOpen === false)
        this.allowHalfOpen = false;
      this.once("end", onend);
    }
    Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function() {
        return this._writableState.highWaterMark;
      }
    });
    function onend() {
      if (this.allowHalfOpen || this._writableState.ended)
        return;
      pna.nextTick(onEndNT, this);
    }
    function onEndNT(self2) {
      self2.end();
    }
    Object.defineProperty(Duplex.prototype, "destroyed", {
      get: function() {
        if (this._readableState === void 0 || this._writableState === void 0) {
          return false;
        }
        return this._readableState.destroyed && this._writableState.destroyed;
      },
      set: function(value) {
        if (this._readableState === void 0 || this._writableState === void 0) {
          return;
        }
        this._readableState.destroyed = value;
        this._writableState.destroyed = value;
      }
    });
    Duplex.prototype._destroy = function(err, cb) {
      this.push(null);
      this.end();
      pna.nextTick(cb, err);
    };
  }
});

// node_modules/readable-stream/duplex-browser.js
var require_duplex_browser = __commonJS({
  "node_modules/readable-stream/duplex-browser.js"(exports2, module2) {
    module2.exports = require_stream_duplex();
  }
});

// node_modules/safe-buffer/index.js
var require_safe_buffer2 = __commonJS({
  "node_modules/safe-buffer/index.js"(exports2, module2) {
    var buffer = require("buffer");
    var Buffer3 = buffer.Buffer;
    function copyProps(src, dst) {
      for (var key in src) {
        dst[key] = src[key];
      }
    }
    if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
      module2.exports = buffer;
    } else {
      copyProps(buffer, exports2);
      exports2.Buffer = SafeBuffer;
    }
    function SafeBuffer(arg, encodingOrOffset, length) {
      return Buffer3(arg, encodingOrOffset, length);
    }
    SafeBuffer.prototype = Object.create(Buffer3.prototype);
    copyProps(Buffer3, SafeBuffer);
    SafeBuffer.from = function(arg, encodingOrOffset, length) {
      if (typeof arg === "number") {
        throw new TypeError("Argument must not be a number");
      }
      return Buffer3(arg, encodingOrOffset, length);
    };
    SafeBuffer.alloc = function(size, fill, encoding) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      var buf = Buffer3(size);
      if (fill !== void 0) {
        if (typeof encoding === "string") {
          buf.fill(fill, encoding);
        } else {
          buf.fill(fill);
        }
      } else {
        buf.fill(0);
      }
      return buf;
    };
    SafeBuffer.allocUnsafe = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return Buffer3(size);
    };
    SafeBuffer.allocUnsafeSlow = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return buffer.SlowBuffer(size);
    };
  }
});

// node_modules/bl/bl.js
var require_bl = __commonJS({
  "node_modules/bl/bl.js"(exports2, module2) {
    var DuplexStream = require_duplex_browser();
    var util = require("util");
    var Buffer3 = require_safe_buffer2().Buffer;
    function BufferList(callback) {
      if (!(this instanceof BufferList))
        return new BufferList(callback);
      this._bufs = [];
      this.length = 0;
      if (typeof callback == "function") {
        this._callback = callback;
        var piper = function piper2(err) {
          if (this._callback) {
            this._callback(err);
            this._callback = null;
          }
        }.bind(this);
        this.on("pipe", function onPipe(src) {
          src.on("error", piper);
        });
        this.on("unpipe", function onUnpipe(src) {
          src.removeListener("error", piper);
        });
      } else {
        this.append(callback);
      }
      DuplexStream.call(this);
    }
    util.inherits(BufferList, DuplexStream);
    BufferList.prototype._offset = function _offset(offset2) {
      var tot = 0, i = 0, _t;
      if (offset2 === 0)
        return [0, 0];
      for (; i < this._bufs.length; i++) {
        _t = tot + this._bufs[i].length;
        if (offset2 < _t || i == this._bufs.length - 1)
          return [i, offset2 - tot];
        tot = _t;
      }
    };
    BufferList.prototype.append = function append(buf) {
      var i = 0;
      if (Buffer3.isBuffer(buf)) {
        this._appendBuffer(buf);
      } else if (Array.isArray(buf)) {
        for (; i < buf.length; i++)
          this.append(buf[i]);
      } else if (buf instanceof BufferList) {
        for (; i < buf._bufs.length; i++)
          this.append(buf._bufs[i]);
      } else if (buf != null) {
        if (typeof buf == "number")
          buf = buf.toString();
        this._appendBuffer(Buffer3.from(buf));
      }
      return this;
    };
    BufferList.prototype._appendBuffer = function appendBuffer(buf) {
      this._bufs.push(buf);
      this.length += buf.length;
    };
    BufferList.prototype._write = function _write(buf, encoding, callback) {
      this._appendBuffer(buf);
      if (typeof callback == "function")
        callback();
    };
    BufferList.prototype._read = function _read(size) {
      if (!this.length)
        return this.push(null);
      size = Math.min(size, this.length);
      this.push(this.slice(0, size));
      this.consume(size);
    };
    BufferList.prototype.end = function end2(chunk) {
      DuplexStream.prototype.end.call(this, chunk);
      if (this._callback) {
        this._callback(null, this.slice());
        this._callback = null;
      }
    };
    BufferList.prototype.get = function get(index) {
      return this.slice(index, index + 1)[0];
    };
    BufferList.prototype.slice = function slice(start2, end2) {
      if (typeof start2 == "number" && start2 < 0)
        start2 += this.length;
      if (typeof end2 == "number" && end2 < 0)
        end2 += this.length;
      return this.copy(null, 0, start2, end2);
    };
    BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) {
      if (typeof srcStart != "number" || srcStart < 0)
        srcStart = 0;
      if (typeof srcEnd != "number" || srcEnd > this.length)
        srcEnd = this.length;
      if (srcStart >= this.length)
        return dst || Buffer3.alloc(0);
      if (srcEnd <= 0)
        return dst || Buffer3.alloc(0);
      var copy2 = !!dst, off = this._offset(srcStart), len = srcEnd - srcStart, bytes = len, bufoff = copy2 && dstStart || 0, start2 = off[1], l, i;
      if (srcStart === 0 && srcEnd == this.length) {
        if (!copy2) {
          return this._bufs.length === 1 ? this._bufs[0] : Buffer3.concat(this._bufs, this.length);
        }
        for (i = 0; i < this._bufs.length; i++) {
          this._bufs[i].copy(dst, bufoff);
          bufoff += this._bufs[i].length;
        }
        return dst;
      }
      if (bytes <= this._bufs[off[0]].length - start2) {
        return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start2, start2 + bytes) : this._bufs[off[0]].slice(start2, start2 + bytes);
      }
      if (!copy2)
        dst = Buffer3.allocUnsafe(len);
      for (i = off[0]; i < this._bufs.length; i++) {
        l = this._bufs[i].length - start2;
        if (bytes > l) {
          this._bufs[i].copy(dst, bufoff, start2);
          bufoff += l;
        } else {
          this._bufs[i].copy(dst, bufoff, start2, start2 + bytes);
          bufoff += l;
          break;
        }
        bytes -= l;
        if (start2)
          start2 = 0;
      }
      if (dst.length > bufoff)
        return dst.slice(0, bufoff);
      return dst;
    };
    BufferList.prototype.shallowSlice = function shallowSlice(start2, end2) {
      start2 = start2 || 0;
      end2 = end2 || this.length;
      if (start2 < 0)
        start2 += this.length;
      if (end2 < 0)
        end2 += this.length;
      var startOffset = this._offset(start2), endOffset = this._offset(end2), buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1);
      if (endOffset[1] == 0)
        buffers.pop();
      else
        buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]);
      if (startOffset[1] != 0)
        buffers[0] = buffers[0].slice(startOffset[1]);
      return new BufferList(buffers);
    };
    BufferList.prototype.toString = function toString(encoding, start2, end2) {
      return this.slice(start2, end2).toString(encoding);
    };
    BufferList.prototype.consume = function consume(bytes) {
      bytes = Math.trunc(bytes);
      if (Number.isNaN(bytes) || bytes <= 0)
        return this;
      while (this._bufs.length) {
        if (bytes >= this._bufs[0].length) {
          bytes -= this._bufs[0].length;
          this.length -= this._bufs[0].length;
          this._bufs.shift();
        } else {
          this._bufs[0] = this._bufs[0].slice(bytes);
          this.length -= bytes;
          break;
        }
      }
      return this;
    };
    BufferList.prototype.duplicate = function duplicate() {
      var i = 0, copy = new BufferList();
      for (; i < this._bufs.length; i++)
        copy.append(this._bufs[i]);
      return copy;
    };
    BufferList.prototype.destroy = function destroy() {
      this._bufs.length = 0;
      this.length = 0;
      this.push(null);
    };
    (function() {
      var methods = {
        "readDoubleBE": 8,
        "readDoubleLE": 8,
        "readFloatBE": 4,
        "readFloatLE": 4,
        "readInt32BE": 4,
        "readInt32LE": 4,
        "readUInt32BE": 4,
        "readUInt32LE": 4,
        "readInt16BE": 2,
        "readInt16LE": 2,
        "readUInt16BE": 2,
        "readUInt16LE": 2,
        "readInt8": 1,
        "readUInt8": 1
      };
      for (var m in methods) {
        (function(m2) {
          BufferList.prototype[m2] = function(offset2) {
            return this.slice(offset2, offset2 + methods[m2])[m2](0);
          };
        })(m);
      }
    })();
    module2.exports = BufferList;
  }
});

// node_modules/node-telegram-bot-api/lib/telegramWebHook.js
var require_telegramWebHook = __commonJS({
  "node_modules/node-telegram-bot-api/lib/telegramWebHook.js"(exports2, module2) {
    "use strict";
    var _createClass = function() {
      function defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor = props[i];
          descriptor.enumerable = descriptor.enumerable || false;
          descriptor.configurable = true;
          if ("value" in descriptor)
            descriptor.writable = true;
          Object.defineProperty(target, descriptor.key, descriptor);
        }
      }
      return function(Constructor, protoProps, staticProps) {
        if (protoProps)
          defineProperties(Constructor.prototype, protoProps);
        if (staticProps)
          defineProperties(Constructor, staticProps);
        return Constructor;
      };
    }();
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
    var errors = require_errors3();
    var debug = require_browser3()("node-telegram-bot-api");
    var https = require("https");
    var http = require("http");
    var fs = require("fs");
    var bl = require_bl();
    var TelegramBotWebHook = function() {
      function TelegramBotWebHook2(bot) {
        _classCallCheck(this, TelegramBotWebHook2);
        this.bot = bot;
        this.options = typeof bot.options.webHook === "boolean" ? {} : bot.options.webHook;
        this.options.host = this.options.host || "0.0.0.0";
        this.options.port = this.options.port || 8443;
        this.options.https = this.options.https || {};
        this.options.healthEndpoint = this.options.healthEndpoint || "/healthz";
        this._healthRegex = new RegExp(this.options.healthEndpoint);
        this._webServer = null;
        this._open = false;
        this._requestListener = this._requestListener.bind(this);
        this._parseBody = this._parseBody.bind(this);
        if (this.options.key && this.options.cert) {
          debug("HTTPS WebHook enabled (by key/cert)");
          this.options.https.key = fs.readFileSync(this.options.key);
          this.options.https.cert = fs.readFileSync(this.options.cert);
          this._webServer = https.createServer(this.options.https, this._requestListener);
        } else if (this.options.pfx) {
          debug("HTTPS WebHook enabled (by pfx)");
          this.options.https.pfx = fs.readFileSync(this.options.pfx);
          this._webServer = https.createServer(this.options.https, this._requestListener);
        } else if (Object.keys(this.options.https).length) {
          debug("HTTPS WebHook enabled by (https)");
          this._webServer = https.createServer(this.options.https, this._requestListener);
        } else {
          debug("HTTP WebHook enabled");
          this._webServer = http.createServer(this._requestListener);
        }
      }
      _createClass(TelegramBotWebHook2, [{
        key: "open",
        value: function open() {
          var _this = this;
          if (this.isOpen()) {
            return Promise.resolve();
          }
          return new Promise(function(resolve, reject) {
            _this._webServer.listen(_this.options.port, _this.options.host, function() {
              debug("WebHook listening on port %s", _this.options.port);
              _this._open = true;
              return resolve();
            });
            _this._webServer.once("error", function(err) {
              reject(err);
            });
          });
        }
        /**
         * Close the webHook
         * @return {Promise}
         */
      }, {
        key: "close",
        value: function close() {
          var _this2 = this;
          if (!this.isOpen()) {
            return Promise.resolve();
          }
          return new Promise(function(resolve, reject) {
            _this2._webServer.close(function(error) {
              if (error)
                return reject(error);
              _this2._open = false;
              return resolve();
            });
          });
        }
        /**
         * Return `true` if server is listening. Otherwise, `false`.
         */
      }, {
        key: "isOpen",
        value: function isOpen() {
          return this._open;
        }
        /**
         * Handle error thrown during processing of webhook request.
         * @private
         * @param  {Error} error
         */
      }, {
        key: "_error",
        value: function _error(error) {
          if (!this.bot.listeners("webhook_error").length) {
            return console.error("error: [webhook_error] %j", error);
          }
          return this.bot.emit("webhook_error", error);
        }
        /**
         * Handle request body by passing it to 'callback'
         * @private
         */
      }, {
        key: "_parseBody",
        value: function _parseBody(error, body) {
          if (error) {
            return this._error(new errors.FatalError(error));
          }
          var data = void 0;
          try {
            data = JSON.parse(body.toString());
          } catch (parseError) {
            return this._error(new errors.ParseError(parseError.message));
          }
          return this.bot.processUpdate(data);
        }
        /**
         * Listener for 'request' event on server
         * @private
         * @see https://nodejs.org/docs/latest/api/http.html#http_http_createserver_requestlistener
         * @see https://nodejs.org/docs/latest/api/https.html#https_https_createserver_options_requestlistener
         */
      }, {
        key: "_requestListener",
        value: function _requestListener(req, res) {
          debug("WebHook request URL: %s", req.url);
          debug("WebHook request headers: %j", req.headers);
          if (req.url.indexOf(this.bot.token) !== -1) {
            if (req.method !== "POST") {
              debug("WebHook request isn't a POST");
              res.statusCode = 418;
              res.end();
            } else {
              req.pipe(bl(this._parseBody)).on("finish", function() {
                return res.end("OK");
              });
            }
          } else if (this._healthRegex.test(req.url)) {
            debug("WebHook health check passed");
            res.statusCode = 200;
            res.end("OK");
          } else {
            debug("WebHook request unauthorized");
            res.statusCode = 401;
            res.end();
          }
        }
      }]);
      return TelegramBotWebHook2;
    }();
    module2.exports = TelegramBotWebHook;
  }
});

// node_modules/node-telegram-bot-api/lib/utils.js
var require_utils5 = __commonJS({
  "node_modules/node-telegram-bot-api/lib/utils.js"(exports2) {
    "use strict";
    var util = require("util");
    exports2.deprecate = function(msg) {
      return util.deprecate(function() {
      }, msg, "node-telegram-bot-api")();
    };
  }
});

// node_modules/node-telegram-bot-api/lib/telegramPolling.js
var require_telegramPolling = __commonJS({
  "node_modules/node-telegram-bot-api/lib/telegramPolling.js"(exports2, module2) {
    "use strict";
    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
    var _createClass = function() {
      function defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor = props[i];
          descriptor.enumerable = descriptor.enumerable || false;
          descriptor.configurable = true;
          if ("value" in descriptor)
            descriptor.writable = true;
          Object.defineProperty(target, descriptor.key, descriptor);
        }
      }
      return function(Constructor, protoProps, staticProps) {
        if (protoProps)
          defineProperties(Constructor.prototype, protoProps);
        if (staticProps)
          defineProperties(Constructor, staticProps);
        return Constructor;
      };
    }();
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
    var errors = require_errors3();
    var debug = require_browser3()("node-telegram-bot-api");
    var deprecate = require_utils5().deprecate;
    var ANOTHER_WEB_HOOK_USED = 409;
    var TelegramBotPolling = function() {
      function TelegramBotPolling2(bot) {
        _classCallCheck(this, TelegramBotPolling2);
        this.bot = bot;
        this.options = typeof bot.options.polling === "boolean" ? {} : bot.options.polling;
        this.options.interval = typeof this.options.interval === "number" ? this.options.interval : 300;
        this.options.params = _typeof(this.options.params) === "object" ? this.options.params : {};
        this.options.params.offset = typeof this.options.params.offset === "number" ? this.options.params.offset : 0;
        this.options.params.timeout = typeof this.options.params.timeout === "number" ? this.options.params.timeout : 10;
        if (typeof this.options.timeout === "number") {
          deprecate("`options.polling.timeout` is deprecated. Use `options.polling.params` instead.");
          this.options.params.timeout = this.options.timeout;
        }
        this._lastUpdate = 0;
        this._lastRequest = null;
        this._abort = false;
        this._pollingTimeout = null;
      }
      _createClass(TelegramBotPolling2, [{
        key: "start",
        value: function start2() {
          var _this = this;
          var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          if (this._lastRequest) {
            if (!options.restart) {
              return Promise.resolve();
            }
            return this.stop({
              cancel: true,
              reason: "Polling restart"
            }).then(function() {
              return _this._polling();
            });
          }
          return this._polling();
        }
        /**
         * Stop polling
         * @param  {Object} [options] Options
         * @param  {Boolean} [options.cancel] Cancel current request
         * @param  {String} [options.reason] Reason for stopping polling
         * @return {Promise}
         */
      }, {
        key: "stop",
        value: function stop2() {
          var _this2 = this;
          var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          if (!this._lastRequest) {
            return Promise.resolve();
          }
          var lastRequest = this._lastRequest;
          this._lastRequest = null;
          clearTimeout(this._pollingTimeout);
          if (options.cancel) {
            var reason = options.reason || "Polling stop";
            lastRequest.cancel(reason);
            return Promise.resolve();
          }
          this._abort = true;
          return lastRequest.finally(function() {
            _this2._abort = false;
          });
        }
        /**
         * Return `true` if is polling. Otherwise, `false`.
         */
      }, {
        key: "isPolling",
        value: function isPolling() {
          return !!this._lastRequest;
        }
        /**
         * Handle error thrown during polling.
         * @private
         * @param  {Error} error
         */
      }, {
        key: "_error",
        value: function _error(error) {
          if (!this.bot.listeners("polling_error").length) {
            return console.error("error: [polling_error] %j", error);
          }
          return this.bot.emit("polling_error", error);
        }
        /**
         * Invokes polling (with recursion!)
         * @return {Promise} promise of the current request
         * @private
         */
      }, {
        key: "_polling",
        value: function _polling() {
          var _this3 = this;
          this._lastRequest = this._getUpdates().then(function(updates) {
            _this3._lastUpdate = Date.now();
            debug("polling data %j", updates);
            updates.forEach(function(update) {
              _this3.options.params.offset = update.update_id + 1;
              debug("updated offset: %s", _this3.options.params.offset);
              try {
                _this3.bot.processUpdate(update);
              } catch (err) {
                err._processing = true;
                throw err;
              }
            });
            return null;
          }).catch(function(err) {
            debug("polling error: %s", err.message);
            if (!err._processing) {
              return _this3._error(err);
            }
            delete err._processing;
            if (!_this3.bot.options.badRejection) {
              return _this3._error(err);
            }
            var opts = {
              offset: _this3.options.params.offset,
              limit: 1,
              timeout: 0
            };
            return _this3.bot.getUpdates(opts).then(function() {
              return _this3._error(err);
            }).catch(function(requestErr) {
              var bugUrl = "https://github.com/yagop/node-telegram-bot-api/issues/36#issuecomment-268532067";
              console.error("error: Internal handling of The Offset Infinite Loop failed");
              console.error("error: Due to error '" + requestErr + "'");
              console.error("error: You may receive already-processed updates on app restart");
              console.error("error: Please see " + bugUrl + " for more information");
              return _this3.bot.emit("error", new errors.FatalError(err));
            });
          }).finally(function() {
            if (_this3._abort) {
              debug("Polling is aborted!");
            } else {
              debug("setTimeout for %s miliseconds", _this3.options.interval);
              _this3._pollingTimeout = setTimeout(function() {
                return _this3._polling();
              }, _this3.options.interval);
            }
          });
          return this._lastRequest;
        }
        /**
         * Unset current webhook. Used when we detect that a webhook has been set
         * and we are trying to poll. Polling and WebHook are mutually exclusive.
         * @see https://core.telegram.org/bots/api#getting-updates
         * @private
         */
      }, {
        key: "_unsetWebHook",
        value: function _unsetWebHook() {
          debug("unsetting webhook");
          return this.bot._request("setWebHook");
        }
        /**
         * Retrieve updates
         */
      }, {
        key: "_getUpdates",
        value: function _getUpdates() {
          var _this4 = this;
          debug("polling with options: %j", this.options.params);
          return this.bot.getUpdates(this.options.params).catch(function(err) {
            if (err.response && err.response.statusCode === ANOTHER_WEB_HOOK_USED) {
              return _this4._unsetWebHook().then(function() {
                return _this4.bot.getUpdates(_this4.options.params);
              });
            }
            throw err;
          });
        }
      }]);
      return TelegramBotPolling2;
    }();
    module2.exports = TelegramBotPolling;
  }
});

// node_modules/eventemitter3/index.js
var require_eventemitter3 = __commonJS({
  "node_modules/eventemitter3/index.js"(exports2, module2) {
    "use strict";
    var has = Object.prototype.hasOwnProperty;
    var prefix = "~";
    function Events() {
    }
    if (Object.create) {
      Events.prototype = /* @__PURE__ */ Object.create(null);
      if (!new Events().__proto__)
        prefix = false;
    }
    function EE(fn2, context, once) {
      this.fn = fn2;
      this.context = context;
      this.once = once || false;
    }
    function addListener(emitter, event, fn2, context, once) {
      if (typeof fn2 !== "function") {
        throw new TypeError("The listener must be a function");
      }
      var listener = new EE(fn2, context || emitter, once), evt = prefix ? prefix + event : event;
      if (!emitter._events[evt])
        emitter._events[evt] = listener, emitter._eventsCount++;
      else if (!emitter._events[evt].fn)
        emitter._events[evt].push(listener);
      else
        emitter._events[evt] = [emitter._events[evt], listener];
      return emitter;
    }
    function clearEvent(emitter, evt) {
      if (--emitter._eventsCount === 0)
        emitter._events = new Events();
      else
        delete emitter._events[evt];
    }
    function EventEmitter() {
      this._events = new Events();
      this._eventsCount = 0;
    }
    EventEmitter.prototype.eventNames = function eventNames() {
      var names = [], events, name;
      if (this._eventsCount === 0)
        return names;
      for (name in events = this._events) {
        if (has.call(events, name))
          names.push(prefix ? name.slice(1) : name);
      }
      if (Object.getOwnPropertySymbols) {
        return names.concat(Object.getOwnPropertySymbols(events));
      }
      return names;
    };
    EventEmitter.prototype.listeners = function listeners(event) {
      var evt = prefix ? prefix + event : event, handlers = this._events[evt];
      if (!handlers)
        return [];
      if (handlers.fn)
        return [handlers.fn];
      for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
        ee[i] = handlers[i].fn;
      }
      return ee;
    };
    EventEmitter.prototype.listenerCount = function listenerCount(event) {
      var evt = prefix ? prefix + event : event, listeners = this._events[evt];
      if (!listeners)
        return 0;
      if (listeners.fn)
        return 1;
      return listeners.length;
    };
    EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
      var evt = prefix ? prefix + event : event;
      if (!this._events[evt])
        return false;
      var listeners = this._events[evt], len = arguments.length, args, i;
      if (listeners.fn) {
        if (listeners.once)
          this.removeListener(event, listeners.fn, void 0, true);
        switch (len) {
          case 1:
            return listeners.fn.call(listeners.context), true;
          case 2:
            return listeners.fn.call(listeners.context, a1), true;
          case 3:
            return listeners.fn.call(listeners.context, a1, a2), true;
          case 4:
            return listeners.fn.call(listeners.context, a1, a2, a3), true;
          case 5:
            return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
          case 6:
            return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
        }
        for (i = 1, args = new Array(len - 1); i < len; i++) {
          args[i - 1] = arguments[i];
        }
        listeners.fn.apply(listeners.context, args);
      } else {
        var length = listeners.length, j;
        for (i = 0; i < length; i++) {
          if (listeners[i].once)
            this.removeListener(event, listeners[i].fn, void 0, true);
          switch (len) {
            case 1:
              listeners[i].fn.call(listeners[i].context);
              break;
            case 2:
              listeners[i].fn.call(listeners[i].context, a1);
              break;
            case 3:
              listeners[i].fn.call(listeners[i].context, a1, a2);
              break;
            case 4:
              listeners[i].fn.call(listeners[i].context, a1, a2, a3);
              break;
            default:
              if (!args)
                for (j = 1, args = new Array(len - 1); j < len; j++) {
                  args[j - 1] = arguments[j];
                }
              listeners[i].fn.apply(listeners[i].context, args);
          }
        }
      }
      return true;
    };
    EventEmitter.prototype.on = function on(event, fn2, context) {
      return addListener(this, event, fn2, context, false);
    };
    EventEmitter.prototype.once = function once(event, fn2, context) {
      return addListener(this, event, fn2, context, true);
    };
    EventEmitter.prototype.removeListener = function removeListener(event, fn2, context, once) {
      var evt = prefix ? prefix + event : event;
      if (!this._events[evt])
        return this;
      if (!fn2) {
        clearEvent(this, evt);
        return this;
      }
      var listeners = this._events[evt];
      if (listeners.fn) {
        if (listeners.fn === fn2 && (!once || listeners.once) && (!context || listeners.context === context)) {
          clearEvent(this, evt);
        }
      } else {
        for (var i = 0, events = [], length = listeners.length; i < length; i++) {
          if (listeners[i].fn !== fn2 || once && !listeners[i].once || context && listeners[i].context !== context) {
            events.push(listeners[i]);
          }
        }
        if (events.length)
          this._events[evt] = events.length === 1 ? events[0] : events;
        else
          clearEvent(this, evt);
      }
      return this;
    };
    EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
      var evt;
      if (event) {
        evt = prefix ? prefix + event : event;
        if (this._events[evt])
          clearEvent(this, evt);
      } else {
        this._events = new Events();
        this._eventsCount = 0;
      }
      return this;
    };
    EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
    EventEmitter.prototype.addListener = EventEmitter.prototype.on;
    EventEmitter.prefixed = prefix;
    EventEmitter.EventEmitter = EventEmitter;
    if ("undefined" !== typeof module2) {
      module2.exports = EventEmitter;
    }
  }
});

// node_modules/file-type/index.js
var require_file_type = __commonJS({
  "node_modules/file-type/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function(buf) {
      if (!(buf && buf.length > 1)) {
        return null;
      }
      if (buf[0] === 255 && buf[1] === 216 && buf[2] === 255) {
        return {
          ext: "jpg",
          mime: "image/jpeg"
        };
      }
      if (buf[0] === 137 && buf[1] === 80 && buf[2] === 78 && buf[3] === 71) {
        return {
          ext: "png",
          mime: "image/png"
        };
      }
      if (buf[0] === 71 && buf[1] === 73 && buf[2] === 70) {
        return {
          ext: "gif",
          mime: "image/gif"
        };
      }
      if (buf[8] === 87 && buf[9] === 69 && buf[10] === 66 && buf[11] === 80) {
        return {
          ext: "webp",
          mime: "image/webp"
        };
      }
      if (buf[0] === 70 && buf[1] === 76 && buf[2] === 73 && buf[3] === 70) {
        return {
          ext: "flif",
          mime: "image/flif"
        };
      }
      if ((buf[0] === 73 && buf[1] === 73 && buf[2] === 42 && buf[3] === 0 || buf[0] === 77 && buf[1] === 77 && buf[2] === 0 && buf[3] === 42) && buf[8] === 67 && buf[9] === 82) {
        return {
          ext: "cr2",
          mime: "image/x-canon-cr2"
        };
      }
      if (buf[0] === 73 && buf[1] === 73 && buf[2] === 42 && buf[3] === 0 || buf[0] === 77 && buf[1] === 77 && buf[2] === 0 && buf[3] === 42) {
        return {
          ext: "tif",
          mime: "image/tiff"
        };
      }
      if (buf[0] === 66 && buf[1] === 77) {
        return {
          ext: "bmp",
          mime: "image/bmp"
        };
      }
      if (buf[0] === 73 && buf[1] === 73 && buf[2] === 188) {
        return {
          ext: "jxr",
          mime: "image/vnd.ms-photo"
        };
      }
      if (buf[0] === 56 && buf[1] === 66 && buf[2] === 80 && buf[3] === 83) {
        return {
          ext: "psd",
          mime: "image/vnd.adobe.photoshop"
        };
      }
      if (buf[0] === 80 && buf[1] === 75 && buf[2] === 3 && buf[3] === 4 && buf[30] === 109 && buf[31] === 105 && buf[32] === 109 && buf[33] === 101 && buf[34] === 116 && buf[35] === 121 && buf[36] === 112 && buf[37] === 101 && buf[38] === 97 && buf[39] === 112 && buf[40] === 112 && buf[41] === 108 && buf[42] === 105 && buf[43] === 99 && buf[44] === 97 && buf[45] === 116 && buf[46] === 105 && buf[47] === 111 && buf[48] === 110 && buf[49] === 47 && buf[50] === 101 && buf[51] === 112 && buf[52] === 117 && buf[53] === 98 && buf[54] === 43 && buf[55] === 122 && buf[56] === 105 && buf[57] === 112) {
        return {
          ext: "epub",
          mime: "application/epub+zip"
        };
      }
      if (buf[0] === 80 && buf[1] === 75 && buf[2] === 3 && buf[3] === 4 && buf[30] === 77 && buf[31] === 69 && buf[32] === 84 && buf[33] === 65 && buf[34] === 45 && buf[35] === 73 && buf[36] === 78 && buf[37] === 70 && buf[38] === 47 && buf[39] === 109 && buf[40] === 111 && buf[41] === 122 && buf[42] === 105 && buf[43] === 108 && buf[44] === 108 && buf[45] === 97 && buf[46] === 46 && buf[47] === 114 && buf[48] === 115 && buf[49] === 97) {
        return {
          ext: "xpi",
          mime: "application/x-xpinstall"
        };
      }
      if (buf[0] === 80 && buf[1] === 75 && (buf[2] === 3 || buf[2] === 5 || buf[2] === 7) && (buf[3] === 4 || buf[3] === 6 || buf[3] === 8)) {
        return {
          ext: "zip",
          mime: "application/zip"
        };
      }
      if (buf[257] === 117 && buf[258] === 115 && buf[259] === 116 && buf[260] === 97 && buf[261] === 114) {
        return {
          ext: "tar",
          mime: "application/x-tar"
        };
      }
      if (buf[0] === 82 && buf[1] === 97 && buf[2] === 114 && buf[3] === 33 && buf[4] === 26 && buf[5] === 7 && (buf[6] === 0 || buf[6] === 1)) {
        return {
          ext: "rar",
          mime: "application/x-rar-compressed"
        };
      }
      if (buf[0] === 31 && buf[1] === 139 && buf[2] === 8) {
        return {
          ext: "gz",
          mime: "application/gzip"
        };
      }
      if (buf[0] === 66 && buf[1] === 90 && buf[2] === 104) {
        return {
          ext: "bz2",
          mime: "application/x-bzip2"
        };
      }
      if (buf[0] === 55 && buf[1] === 122 && buf[2] === 188 && buf[3] === 175 && buf[4] === 39 && buf[5] === 28) {
        return {
          ext: "7z",
          mime: "application/x-7z-compressed"
        };
      }
      if (buf[0] === 120 && buf[1] === 1) {
        return {
          ext: "dmg",
          mime: "application/x-apple-diskimage"
        };
      }
      if (buf[0] === 0 && buf[1] === 0 && buf[2] === 0 && (buf[3] === 24 || buf[3] === 32) && buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112 || buf[0] === 51 && buf[1] === 103 && buf[2] === 112 && buf[3] === 53 || buf[0] === 0 && buf[1] === 0 && buf[2] === 0 && buf[3] === 28 && buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112 && buf[8] === 109 && buf[9] === 112 && buf[10] === 52 && buf[11] === 50 && buf[16] === 109 && buf[17] === 112 && buf[18] === 52 && buf[19] === 49 && buf[20] === 109 && buf[21] === 112 && buf[22] === 52 && buf[23] === 50 && buf[24] === 105 && buf[25] === 115 && buf[26] === 111 && buf[27] === 109 || buf[0] === 0 && buf[1] === 0 && buf[2] === 0 && buf[3] === 28 && buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112 && buf[8] === 105 && buf[9] === 115 && buf[10] === 111 && buf[11] === 109 || buf[0] === 0 && buf[1] === 0 && buf[2] === 0 && buf[3] === 28 && buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112 && buf[8] === 109 && buf[9] === 112 && buf[10] === 52 && buf[11] === 50 && buf[12] === 0 && buf[13] === 0 && buf[14] === 0 && buf[15] === 0) {
        return {
          ext: "mp4",
          mime: "video/mp4"
        };
      }
      if (buf[0] === 0 && buf[1] === 0 && buf[2] === 0 && buf[3] === 28 && buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112 && buf[8] === 77 && buf[9] === 52 && buf[10] === 86) {
        return {
          ext: "m4v",
          mime: "video/x-m4v"
        };
      }
      if (buf[0] === 77 && buf[1] === 84 && buf[2] === 104 && buf[3] === 100) {
        return {
          ext: "mid",
          mime: "audio/midi"
        };
      }
      if (buf[31] === 109 && buf[32] === 97 && buf[33] === 116 && buf[34] === 114 && buf[35] === 111 && buf[36] === 115 && buf[37] === 107 && buf[38] === 97) {
        return {
          ext: "mkv",
          mime: "video/x-matroska"
        };
      }
      if (buf[0] === 26 && buf[1] === 69 && buf[2] === 223 && buf[3] === 163) {
        return {
          ext: "webm",
          mime: "video/webm"
        };
      }
      if (buf[0] === 0 && buf[1] === 0 && buf[2] === 0 && buf[3] === 20 && buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112) {
        return {
          ext: "mov",
          mime: "video/quicktime"
        };
      }
      if (buf[0] === 82 && buf[1] === 73 && buf[2] === 70 && buf[3] === 70 && buf[8] === 65 && buf[9] === 86 && buf[10] === 73) {
        return {
          ext: "avi",
          mime: "video/x-msvideo"
        };
      }
      if (buf[0] === 48 && buf[1] === 38 && buf[2] === 178 && buf[3] === 117 && buf[4] === 142 && buf[5] === 102 && buf[6] === 207 && buf[7] === 17 && buf[8] === 166 && buf[9] === 217) {
        return {
          ext: "wmv",
          mime: "video/x-ms-wmv"
        };
      }
      if (buf[0] === 0 && buf[1] === 0 && buf[2] === 1 && buf[3].toString(16)[0] === "b") {
        return {
          ext: "mpg",
          mime: "video/mpeg"
        };
      }
      if (buf[0] === 73 && buf[1] === 68 && buf[2] === 51 || buf[0] === 255 && buf[1] === 251) {
        return {
          ext: "mp3",
          mime: "audio/mpeg"
        };
      }
      if (buf[4] === 102 && buf[5] === 116 && buf[6] === 121 && buf[7] === 112 && buf[8] === 77 && buf[9] === 52 && buf[10] === 65 || buf[0] === 77 && buf[1] === 52 && buf[2] === 65 && buf[3] === 32) {
        return {
          ext: "m4a",
          mime: "audio/m4a"
        };
      }
      if (buf[28] === 79 && buf[29] === 112 && buf[30] === 117 && buf[31] === 115 && buf[32] === 72 && buf[33] === 101 && buf[34] === 97 && buf[35] === 100) {
        return {
          ext: "opus",
          mime: "audio/opus"
        };
      }
      if (buf[0] === 79 && buf[1] === 103 && buf[2] === 103 && buf[3] === 83) {
        return {
          ext: "ogg",
          mime: "audio/ogg"
        };
      }
      if (buf[0] === 102 && buf[1] === 76 && buf[2] === 97 && buf[3] === 67) {
        return {
          ext: "flac",
          mime: "audio/x-flac"
        };
      }
      if (buf[0] === 82 && buf[1] === 73 && buf[2] === 70 && buf[3] === 70 && buf[8] === 87 && buf[9] === 65 && buf[10] === 86 && buf[11] === 69) {
        return {
          ext: "wav",
          mime: "audio/x-wav"
        };
      }
      if (buf[0] === 35 && buf[1] === 33 && buf[2] === 65 && buf[3] === 77 && buf[4] === 82 && buf[5] === 10) {
        return {
          ext: "amr",
          mime: "audio/amr"
        };
      }
      if (buf[0] === 37 && buf[1] === 80 && buf[2] === 68 && buf[3] === 70) {
        return {
          ext: "pdf",
          mime: "application/pdf"
        };
      }
      if (buf[0] === 77 && buf[1] === 90) {
        return {
          ext: "exe",
          mime: "application/x-msdownload"
        };
      }
      if ((buf[0] === 67 || buf[0] === 70) && buf[1] === 87 && buf[2] === 83) {
        return {
          ext: "swf",
          mime: "application/x-shockwave-flash"
        };
      }
      if (buf[0] === 123 && buf[1] === 92 && buf[2] === 114 && buf[3] === 116 && buf[4] === 102) {
        return {
          ext: "rtf",
          mime: "application/rtf"
        };
      }
      if (buf[0] === 119 && buf[1] === 79 && buf[2] === 70 && buf[3] === 70 && (buf[4] === 0 && buf[5] === 1 && buf[6] === 0 && buf[7] === 0 || buf[4] === 79 && buf[5] === 84 && buf[6] === 84 && buf[7] === 79)) {
        return {
          ext: "woff",
          mime: "application/font-woff"
        };
      }
      if (buf[0] === 119 && buf[1] === 79 && buf[2] === 70 && buf[3] === 50 && (buf[4] === 0 && buf[5] === 1 && buf[6] === 0 && buf[7] === 0 || buf[4] === 79 && buf[5] === 84 && buf[6] === 84 && buf[7] === 79)) {
        return {
          ext: "woff2",
          mime: "application/font-woff"
        };
      }
      if (buf[34] === 76 && buf[35] === 80 && (buf[8] === 0 && buf[9] === 0 && buf[10] === 1 || buf[8] === 1 && buf[9] === 0 && buf[10] === 2 || buf[8] === 2 && buf[9] === 0 && buf[10] === 2)) {
        return {
          ext: "eot",
          mime: "application/octet-stream"
        };
      }
      if (buf[0] === 0 && buf[1] === 1 && buf[2] === 0 && buf[3] === 0 && buf[4] === 0) {
        return {
          ext: "ttf",
          mime: "application/font-sfnt"
        };
      }
      if (buf[0] === 79 && buf[1] === 84 && buf[2] === 84 && buf[3] === 79 && buf[4] === 0) {
        return {
          ext: "otf",
          mime: "application/font-sfnt"
        };
      }
      if (buf[0] === 0 && buf[1] === 0 && buf[2] === 1 && buf[3] === 0) {
        return {
          ext: "ico",
          mime: "image/x-icon"
        };
      }
      if (buf[0] === 70 && buf[1] === 76 && buf[2] === 86 && buf[3] === 1) {
        return {
          ext: "flv",
          mime: "video/x-flv"
        };
      }
      if (buf[0] === 37 && buf[1] === 33) {
        return {
          ext: "ps",
          mime: "application/postscript"
        };
      }
      if (buf[0] === 253 && buf[1] === 55 && buf[2] === 122 && buf[3] === 88 && buf[4] === 90 && buf[5] === 0) {
        return {
          ext: "xz",
          mime: "application/x-xz"
        };
      }
      if (buf[0] === 83 && buf[1] === 81 && buf[2] === 76 && buf[3] === 105) {
        return {
          ext: "sqlite",
          mime: "application/x-sqlite3"
        };
      }
      if (buf[0] === 78 && buf[1] === 69 && buf[2] === 83 && buf[3] === 26) {
        return {
          ext: "nes",
          mime: "application/x-nintendo-nes-rom"
        };
      }
      if (buf[0] === 67 && buf[1] === 114 && buf[2] === 50 && buf[3] === 52) {
        return {
          ext: "crx",
          mime: "application/x-google-chrome-extension"
        };
      }
      if (buf[0] === 77 && buf[1] === 83 && buf[2] === 67 && buf[3] === 70 || buf[0] === 73 && buf[1] === 83 && buf[2] === 99 && buf[3] === 40) {
        return {
          ext: "cab",
          mime: "application/vnd.ms-cab-compressed"
        };
      }
      if (buf[0] === 33 && buf[1] === 60 && buf[2] === 97 && buf[3] === 114 && buf[4] === 99 && buf[5] === 104 && buf[6] === 62 && buf[7] === 10 && buf[8] === 100 && buf[9] === 101 && buf[10] === 98 && buf[11] === 105 && buf[12] === 97 && buf[13] === 110 && buf[14] === 45 && buf[15] === 98 && buf[16] === 105 && buf[17] === 110 && buf[18] === 97 && buf[19] === 114 && buf[20] === 121) {
        return {
          ext: "deb",
          mime: "application/x-deb"
        };
      }
      if (buf[0] === 33 && buf[1] === 60 && buf[2] === 97 && buf[3] === 114 && buf[4] === 99 && buf[5] === 104 && buf[6] === 62) {
        return {
          ext: "ar",
          mime: "application/x-unix-archive"
        };
      }
      if (buf[0] === 237 && buf[1] === 171 && buf[2] === 238 && buf[3] === 219) {
        return {
          ext: "rpm",
          mime: "application/x-rpm"
        };
      }
      if (buf[0] === 31 && buf[1] === 160 || buf[0] === 31 && buf[1] === 157) {
        return {
          ext: "Z",
          mime: "application/x-compress"
        };
      }
      if (buf[0] === 76 && buf[1] === 90 && buf[2] === 73 && buf[3] === 80) {
        return {
          ext: "lz",
          mime: "application/x-lzip"
        };
      }
      if (buf[0] === 208 && buf[1] === 207 && buf[2] === 17 && buf[3] === 224 && buf[4] === 161 && buf[5] === 177 && buf[6] === 26 && buf[7] === 225) {
        return {
          ext: "msi",
          mime: "application/x-msi"
        };
      }
      return null;
    };
  }
});

// node_modules/bluebird/js/browser/bluebird.js
var require_bluebird = __commonJS({
  "node_modules/bluebird/js/browser/bluebird.js"(exports, module) {
    !function(e) {
      if ("object" == typeof exports && "undefined" != typeof module)
        module.exports = e();
      else if ("function" == typeof define && define.amd)
        define([], e);
      else {
        var f2;
        "undefined" != typeof window ? f2 = window : "undefined" != typeof global ? f2 = global : "undefined" != typeof self && (f2 = self), f2.Promise = e();
      }
    }(function() {
      var define, module, exports;
      return function e(t, n, r) {
        function s(o2, u) {
          if (!n[o2]) {
            if (!t[o2]) {
              var a = typeof _dereq_ == "function" && _dereq_;
              if (!u && a)
                return a(o2, true);
              if (i)
                return i(o2, true);
              var f2 = new Error("Cannot find module '" + o2 + "'");
              throw f2.code = "MODULE_NOT_FOUND", f2;
            }
            var l = n[o2] = { exports: {} };
            t[o2][0].call(l.exports, function(e2) {
              var n2 = t[o2][1][e2];
              return s(n2 ? n2 : e2);
            }, l, l.exports, e, t, n, r);
          }
          return n[o2].exports;
        }
        var i = typeof _dereq_ == "function" && _dereq_;
        for (var o = 0; o < r.length; o++)
          s(r[o]);
        return s;
      }({ 1: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2) {
          var SomePromiseArray = Promise2._SomePromiseArray;
          function any(promises) {
            var ret2 = new SomePromiseArray(promises);
            var promise = ret2.promise();
            ret2.setHowMany(1);
            ret2.setUnwrap();
            ret2.init();
            return promise;
          }
          Promise2.any = function(promises) {
            return any(promises);
          };
          Promise2.prototype.any = function() {
            return any(this);
          };
        };
      }, {}], 2: [function(_dereq_2, module2, exports2) {
        "use strict";
        var firstLineError;
        try {
          throw new Error();
        } catch (e) {
          firstLineError = e;
        }
        var schedule = _dereq_2("./schedule");
        var Queue = _dereq_2("./queue");
        function Async() {
          this._customScheduler = false;
          this._isTickUsed = false;
          this._lateQueue = new Queue(16);
          this._normalQueue = new Queue(16);
          this._haveDrainedQueues = false;
          var self2 = this;
          this.drainQueues = function() {
            self2._drainQueues();
          };
          this._schedule = schedule;
        }
        Async.prototype.setScheduler = function(fn2) {
          var prev = this._schedule;
          this._schedule = fn2;
          this._customScheduler = true;
          return prev;
        };
        Async.prototype.hasCustomScheduler = function() {
          return this._customScheduler;
        };
        Async.prototype.haveItemsQueued = function() {
          return this._isTickUsed || this._haveDrainedQueues;
        };
        Async.prototype.fatalError = function(e, isNode2) {
          if (isNode2) {
            process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n");
            process.exit(2);
          } else {
            this.throwLater(e);
          }
        };
        Async.prototype.throwLater = function(fn2, arg) {
          if (arguments.length === 1) {
            arg = fn2;
            fn2 = function() {
              throw arg;
            };
          }
          if (typeof setTimeout !== "undefined") {
            setTimeout(function() {
              fn2(arg);
            }, 0);
          } else
            try {
              this._schedule(function() {
                fn2(arg);
              });
            } catch (e) {
              throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");
            }
        };
        function AsyncInvokeLater(fn2, receiver2, arg) {
          this._lateQueue.push(fn2, receiver2, arg);
          this._queueTick();
        }
        function AsyncInvoke(fn2, receiver2, arg) {
          this._normalQueue.push(fn2, receiver2, arg);
          this._queueTick();
        }
        function AsyncSettlePromises(promise) {
          this._normalQueue._pushOne(promise);
          this._queueTick();
        }
        Async.prototype.invokeLater = AsyncInvokeLater;
        Async.prototype.invoke = AsyncInvoke;
        Async.prototype.settlePromises = AsyncSettlePromises;
        function _drainQueue(queue) {
          while (queue.length() > 0) {
            _drainQueueStep(queue);
          }
        }
        function _drainQueueStep(queue) {
          var fn2 = queue.shift();
          if (typeof fn2 !== "function") {
            fn2._settlePromises();
          } else {
            var receiver2 = queue.shift();
            var arg = queue.shift();
            fn2.call(receiver2, arg);
          }
        }
        Async.prototype._drainQueues = function() {
          _drainQueue(this._normalQueue);
          this._reset();
          this._haveDrainedQueues = true;
          _drainQueue(this._lateQueue);
        };
        Async.prototype._queueTick = function() {
          if (!this._isTickUsed) {
            this._isTickUsed = true;
            this._schedule(this.drainQueues);
          }
        };
        Async.prototype._reset = function() {
          this._isTickUsed = false;
        };
        module2.exports = Async;
        module2.exports.firstLineError = firstLineError;
      }, { "./queue": 26, "./schedule": 29 }], 3: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, debug) {
          var calledBind = false;
          var rejectThis = function(_, e) {
            this._reject(e);
          };
          var targetRejected = function(e, context) {
            context.promiseRejectionQueued = true;
            context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
          };
          var bindingResolved = function(thisArg, context) {
            if ((this._bitField & 50397184) === 0) {
              this._resolveCallback(context.target);
            }
          };
          var bindingRejected = function(e, context) {
            if (!context.promiseRejectionQueued)
              this._reject(e);
          };
          Promise2.prototype.bind = function(thisArg) {
            if (!calledBind) {
              calledBind = true;
              Promise2.prototype._propagateFrom = debug.propagateFromFunction();
              Promise2.prototype._boundValue = debug.boundValueFunction();
            }
            var maybePromise = tryConvertToPromise(thisArg);
            var ret2 = new Promise2(INTERNAL);
            ret2._propagateFrom(this, 1);
            var target = this._target();
            ret2._setBoundTo(maybePromise);
            if (maybePromise instanceof Promise2) {
              var context = {
                promiseRejectionQueued: false,
                promise: ret2,
                target,
                bindingPromise: maybePromise
              };
              target._then(INTERNAL, targetRejected, void 0, ret2, context);
              maybePromise._then(
                bindingResolved,
                bindingRejected,
                void 0,
                ret2,
                context
              );
              ret2._setOnCancel(maybePromise);
            } else {
              ret2._resolveCallback(target);
            }
            return ret2;
          };
          Promise2.prototype._setBoundTo = function(obj2) {
            if (obj2 !== void 0) {
              this._bitField = this._bitField | 2097152;
              this._boundTo = obj2;
            } else {
              this._bitField = this._bitField & ~2097152;
            }
          };
          Promise2.prototype._isBound = function() {
            return (this._bitField & 2097152) === 2097152;
          };
          Promise2.bind = function(thisArg, value) {
            return Promise2.resolve(value).bind(thisArg);
          };
        };
      }, {}], 4: [function(_dereq_2, module2, exports2) {
        "use strict";
        var old;
        if (typeof Promise !== "undefined")
          old = Promise;
        function noConflict() {
          try {
            if (Promise === bluebird)
              Promise = old;
          } catch (e) {
          }
          return bluebird;
        }
        var bluebird = _dereq_2("./promise")();
        bluebird.noConflict = noConflict;
        module2.exports = bluebird;
      }, { "./promise": 22 }], 5: [function(_dereq_2, module2, exports2) {
        "use strict";
        var cr = Object.create;
        if (cr) {
          var callerCache = cr(null);
          var getterCache = cr(null);
          callerCache[" size"] = getterCache[" size"] = 0;
        }
        module2.exports = function(Promise2) {
          var util = _dereq_2("./util");
          var canEvaluate2 = util.canEvaluate;
          var isIdentifier2 = util.isIdentifier;
          var getMethodCaller;
          var getGetter;
          if (false) {
            var makeMethodCaller = function(methodName) {
              return new Function("ensureMethod", "                                    \n        return function(obj) {                                               \n            'use strict'                                                     \n            var len = this.length;                                           \n            ensureMethod(obj, 'methodName');                                 \n            switch(len) {                                                    \n                case 1: return obj.methodName(this[0]);                      \n                case 2: return obj.methodName(this[0], this[1]);             \n                case 3: return obj.methodName(this[0], this[1], this[2]);    \n                case 0: return obj.methodName();                             \n                default:                                                     \n                    return obj.methodName.apply(obj, this);                  \n            }                                                                \n        };                                                                   \n        ".replace(/methodName/g, methodName))(ensureMethod);
            };
            var makeGetter = function(propertyName) {
              return new Function("obj", "                                             \n        'use strict';                                                        \n        return obj.propertyName;                                             \n        ".replace("propertyName", propertyName));
            };
            var getCompiled = function(name, compiler, cache) {
              var ret2 = cache[name];
              if (typeof ret2 !== "function") {
                if (!isIdentifier2(name)) {
                  return null;
                }
                ret2 = compiler(name);
                cache[name] = ret2;
                cache[" size"]++;
                if (cache[" size"] > 512) {
                  var keys = Object.keys(cache);
                  for (var i = 0; i < 256; ++i)
                    delete cache[keys[i]];
                  cache[" size"] = keys.length - 256;
                }
              }
              return ret2;
            };
            getMethodCaller = function(name) {
              return getCompiled(name, makeMethodCaller, callerCache);
            };
            getGetter = function(name) {
              return getCompiled(name, makeGetter, getterCache);
            };
          }
          function ensureMethod(obj2, methodName) {
            var fn2;
            if (obj2 != null)
              fn2 = obj2[methodName];
            if (typeof fn2 !== "function") {
              var message = "Object " + util.classString(obj2) + " has no method '" + util.toString(methodName) + "'";
              throw new Promise2.TypeError(message);
            }
            return fn2;
          }
          function caller(obj2) {
            var methodName = this.pop();
            var fn2 = ensureMethod(obj2, methodName);
            return fn2.apply(obj2, this);
          }
          Promise2.prototype.call = function(methodName) {
            var args = [].slice.call(arguments, 1);
            ;
            if (false) {
              if (canEvaluate2) {
                var maybeCaller = getMethodCaller(methodName);
                if (maybeCaller !== null) {
                  return this._then(
                    maybeCaller,
                    void 0,
                    void 0,
                    args,
                    void 0
                  );
                }
              }
            }
            args.push(methodName);
            return this._then(caller, void 0, void 0, args, void 0);
          };
          function namedGetter(obj2) {
            return obj2[this];
          }
          function indexedGetter(obj2) {
            var index = +this;
            if (index < 0)
              index = Math.max(0, index + obj2.length);
            return obj2[index];
          }
          Promise2.prototype.get = function(propertyName) {
            var isIndex = typeof propertyName === "number";
            var getter;
            if (!isIndex) {
              if (canEvaluate2) {
                var maybeGetter = getGetter(propertyName);
                getter = maybeGetter !== null ? maybeGetter : namedGetter;
              } else {
                getter = namedGetter;
              }
            } else {
              getter = indexedGetter;
            }
            return this._then(getter, void 0, void 0, propertyName, void 0);
          };
        };
      }, { "./util": 36 }], 6: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, apiRejection, debug) {
          var util = _dereq_2("./util");
          var tryCatch2 = util.tryCatch;
          var errorObj2 = util.errorObj;
          var async = Promise2._async;
          Promise2.prototype["break"] = Promise2.prototype.cancel = function() {
            if (!debug.cancellation())
              return this._warn("cancellation is disabled");
            var promise = this;
            var child = promise;
            while (promise._isCancellable()) {
              if (!promise._cancelBy(child)) {
                if (child._isFollowing()) {
                  child._followee().cancel();
                } else {
                  child._cancelBranched();
                }
                break;
              }
              var parent = promise._cancellationParent;
              if (parent == null || !parent._isCancellable()) {
                if (promise._isFollowing()) {
                  promise._followee().cancel();
                } else {
                  promise._cancelBranched();
                }
                break;
              } else {
                if (promise._isFollowing())
                  promise._followee().cancel();
                promise._setWillBeCancelled();
                child = promise;
                promise = parent;
              }
            }
          };
          Promise2.prototype._branchHasCancelled = function() {
            this._branchesRemainingToCancel--;
          };
          Promise2.prototype._enoughBranchesHaveCancelled = function() {
            return this._branchesRemainingToCancel === void 0 || this._branchesRemainingToCancel <= 0;
          };
          Promise2.prototype._cancelBy = function(canceller) {
            if (canceller === this) {
              this._branchesRemainingToCancel = 0;
              this._invokeOnCancel();
              return true;
            } else {
              this._branchHasCancelled();
              if (this._enoughBranchesHaveCancelled()) {
                this._invokeOnCancel();
                return true;
              }
            }
            return false;
          };
          Promise2.prototype._cancelBranched = function() {
            if (this._enoughBranchesHaveCancelled()) {
              this._cancel();
            }
          };
          Promise2.prototype._cancel = function() {
            if (!this._isCancellable())
              return;
            this._setCancelled();
            async.invoke(this._cancelPromises, this, void 0);
          };
          Promise2.prototype._cancelPromises = function() {
            if (this._length() > 0)
              this._settlePromises();
          };
          Promise2.prototype._unsetOnCancel = function() {
            this._onCancelField = void 0;
          };
          Promise2.prototype._isCancellable = function() {
            return this.isPending() && !this._isCancelled();
          };
          Promise2.prototype.isCancellable = function() {
            return this.isPending() && !this.isCancelled();
          };
          Promise2.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {
            if (util.isArray(onCancelCallback)) {
              for (var i = 0; i < onCancelCallback.length; ++i) {
                this._doInvokeOnCancel(onCancelCallback[i], internalOnly);
              }
            } else if (onCancelCallback !== void 0) {
              if (typeof onCancelCallback === "function") {
                if (!internalOnly) {
                  var e = tryCatch2(onCancelCallback).call(this._boundValue());
                  if (e === errorObj2) {
                    this._attachExtraTrace(e.e);
                    async.throwLater(e.e);
                  }
                }
              } else {
                onCancelCallback._resultCancelled(this);
              }
            }
          };
          Promise2.prototype._invokeOnCancel = function() {
            var onCancelCallback = this._onCancel();
            this._unsetOnCancel();
            async.invoke(this._doInvokeOnCancel, this, onCancelCallback);
          };
          Promise2.prototype._invokeInternalOnCancel = function() {
            if (this._isCancellable()) {
              this._doInvokeOnCancel(this._onCancel(), true);
              this._unsetOnCancel();
            }
          };
          Promise2.prototype._resultCancelled = function() {
            this.cancel();
          };
        };
      }, { "./util": 36 }], 7: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(NEXT_FILTER) {
          var util = _dereq_2("./util");
          var getKeys = _dereq_2("./es5").keys;
          var tryCatch2 = util.tryCatch;
          var errorObj2 = util.errorObj;
          function catchFilter(instances, cb, promise) {
            return function(e) {
              var boundTo = promise._boundValue();
              predicateLoop:
                for (var i = 0; i < instances.length; ++i) {
                  var item = instances[i];
                  if (item === Error || item != null && item.prototype instanceof Error) {
                    if (e instanceof item) {
                      return tryCatch2(cb).call(boundTo, e);
                    }
                  } else if (typeof item === "function") {
                    var matchesPredicate = tryCatch2(item).call(boundTo, e);
                    if (matchesPredicate === errorObj2) {
                      return matchesPredicate;
                    } else if (matchesPredicate) {
                      return tryCatch2(cb).call(boundTo, e);
                    }
                  } else if (util.isObject(e)) {
                    var keys = getKeys(item);
                    for (var j = 0; j < keys.length; ++j) {
                      var key = keys[j];
                      if (item[key] != e[key]) {
                        continue predicateLoop;
                      }
                    }
                    return tryCatch2(cb).call(boundTo, e);
                  }
                }
              return NEXT_FILTER;
            };
          }
          return catchFilter;
        };
      }, { "./es5": 13, "./util": 36 }], 8: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2) {
          var longStackTraces = false;
          var contextStack = [];
          Promise2.prototype._promiseCreated = function() {
          };
          Promise2.prototype._pushContext = function() {
          };
          Promise2.prototype._popContext = function() {
            return null;
          };
          Promise2._peekContext = Promise2.prototype._peekContext = function() {
          };
          function Context() {
            this._trace = new Context.CapturedTrace(peekContext());
          }
          Context.prototype._pushContext = function() {
            if (this._trace !== void 0) {
              this._trace._promiseCreated = null;
              contextStack.push(this._trace);
            }
          };
          Context.prototype._popContext = function() {
            if (this._trace !== void 0) {
              var trace = contextStack.pop();
              var ret2 = trace._promiseCreated;
              trace._promiseCreated = null;
              return ret2;
            }
            return null;
          };
          function createContext() {
            if (longStackTraces)
              return new Context();
          }
          function peekContext() {
            var lastIndex = contextStack.length - 1;
            if (lastIndex >= 0) {
              return contextStack[lastIndex];
            }
            return void 0;
          }
          Context.CapturedTrace = null;
          Context.create = createContext;
          Context.deactivateLongStackTraces = function() {
          };
          Context.activateLongStackTraces = function() {
            var Promise_pushContext = Promise2.prototype._pushContext;
            var Promise_popContext = Promise2.prototype._popContext;
            var Promise_PeekContext = Promise2._peekContext;
            var Promise_peekContext = Promise2.prototype._peekContext;
            var Promise_promiseCreated = Promise2.prototype._promiseCreated;
            Context.deactivateLongStackTraces = function() {
              Promise2.prototype._pushContext = Promise_pushContext;
              Promise2.prototype._popContext = Promise_popContext;
              Promise2._peekContext = Promise_PeekContext;
              Promise2.prototype._peekContext = Promise_peekContext;
              Promise2.prototype._promiseCreated = Promise_promiseCreated;
              longStackTraces = false;
            };
            longStackTraces = true;
            Promise2.prototype._pushContext = Context.prototype._pushContext;
            Promise2.prototype._popContext = Context.prototype._popContext;
            Promise2._peekContext = Promise2.prototype._peekContext = peekContext;
            Promise2.prototype._promiseCreated = function() {
              var ctx = this._peekContext();
              if (ctx && ctx._promiseCreated == null)
                ctx._promiseCreated = this;
            };
          };
          return Context;
        };
      }, {}], 9: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, Context, enableAsyncHooks, disableAsyncHooks) {
          var async = Promise2._async;
          var Warning = _dereq_2("./errors").Warning;
          var util = _dereq_2("./util");
          var es52 = _dereq_2("./es5");
          var canAttachTrace2 = util.canAttachTrace;
          var unhandledRejectionHandled;
          var possiblyUnhandledRejection;
          var bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/;
          var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/;
          var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/;
          var stackFramePattern = null;
          var formatStack = null;
          var indentStackFrames = false;
          var printWarning;
          var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && true);
          var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && (debugging || util.env("BLUEBIRD_WARNINGS")));
          var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES")));
          var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));
          var deferUnhandledRejectionCheck;
          (function() {
            var promises = [];
            function unhandledRejectionCheck() {
              for (var i = 0; i < promises.length; ++i) {
                promises[i]._notifyUnhandledRejection();
              }
              unhandledRejectionClear();
            }
            function unhandledRejectionClear() {
              promises.length = 0;
            }
            deferUnhandledRejectionCheck = function(promise) {
              promises.push(promise);
              setTimeout(unhandledRejectionCheck, 1);
            };
            es52.defineProperty(Promise2, "_unhandledRejectionCheck", {
              value: unhandledRejectionCheck
            });
            es52.defineProperty(Promise2, "_unhandledRejectionClear", {
              value: unhandledRejectionClear
            });
          })();
          Promise2.prototype.suppressUnhandledRejections = function() {
            var target = this._target();
            target._bitField = target._bitField & ~1048576 | 524288;
          };
          Promise2.prototype._ensurePossibleRejectionHandled = function() {
            if ((this._bitField & 524288) !== 0)
              return;
            this._setRejectionIsUnhandled();
            deferUnhandledRejectionCheck(this);
          };
          Promise2.prototype._notifyUnhandledRejectionIsHandled = function() {
            fireRejectionEvent(
              "rejectionHandled",
              unhandledRejectionHandled,
              void 0,
              this
            );
          };
          Promise2.prototype._setReturnedNonUndefined = function() {
            this._bitField = this._bitField | 268435456;
          };
          Promise2.prototype._returnedNonUndefined = function() {
            return (this._bitField & 268435456) !== 0;
          };
          Promise2.prototype._notifyUnhandledRejection = function() {
            if (this._isRejectionUnhandled()) {
              var reason = this._settledValue();
              this._setUnhandledRejectionIsNotified();
              fireRejectionEvent(
                "unhandledRejection",
                possiblyUnhandledRejection,
                reason,
                this
              );
            }
          };
          Promise2.prototype._setUnhandledRejectionIsNotified = function() {
            this._bitField = this._bitField | 262144;
          };
          Promise2.prototype._unsetUnhandledRejectionIsNotified = function() {
            this._bitField = this._bitField & ~262144;
          };
          Promise2.prototype._isUnhandledRejectionNotified = function() {
            return (this._bitField & 262144) > 0;
          };
          Promise2.prototype._setRejectionIsUnhandled = function() {
            this._bitField = this._bitField | 1048576;
          };
          Promise2.prototype._unsetRejectionIsUnhandled = function() {
            this._bitField = this._bitField & ~1048576;
            if (this._isUnhandledRejectionNotified()) {
              this._unsetUnhandledRejectionIsNotified();
              this._notifyUnhandledRejectionIsHandled();
            }
          };
          Promise2.prototype._isRejectionUnhandled = function() {
            return (this._bitField & 1048576) > 0;
          };
          Promise2.prototype._warn = function(message, shouldUseOwnTrace, promise) {
            return warn(message, shouldUseOwnTrace, promise || this);
          };
          Promise2.onPossiblyUnhandledRejection = function(fn2) {
            var context = Promise2._getContext();
            possiblyUnhandledRejection = util.contextBind(context, fn2);
          };
          Promise2.onUnhandledRejectionHandled = function(fn2) {
            var context = Promise2._getContext();
            unhandledRejectionHandled = util.contextBind(context, fn2);
          };
          var disableLongStackTraces = function() {
          };
          Promise2.longStackTraces = function() {
            if (async.haveItemsQueued() && !config.longStackTraces) {
              throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");
            }
            if (!config.longStackTraces && longStackTracesIsSupported()) {
              var Promise_captureStackTrace = Promise2.prototype._captureStackTrace;
              var Promise_attachExtraTrace = Promise2.prototype._attachExtraTrace;
              var Promise_dereferenceTrace = Promise2.prototype._dereferenceTrace;
              config.longStackTraces = true;
              disableLongStackTraces = function() {
                if (async.haveItemsQueued() && !config.longStackTraces) {
                  throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");
                }
                Promise2.prototype._captureStackTrace = Promise_captureStackTrace;
                Promise2.prototype._attachExtraTrace = Promise_attachExtraTrace;
                Promise2.prototype._dereferenceTrace = Promise_dereferenceTrace;
                Context.deactivateLongStackTraces();
                config.longStackTraces = false;
              };
              Promise2.prototype._captureStackTrace = longStackTracesCaptureStackTrace;
              Promise2.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;
              Promise2.prototype._dereferenceTrace = longStackTracesDereferenceTrace;
              Context.activateLongStackTraces();
            }
          };
          Promise2.hasLongStackTraces = function() {
            return config.longStackTraces && longStackTracesIsSupported();
          };
          var legacyHandlers = {
            unhandledrejection: {
              before: function() {
                var ret2 = util.global.onunhandledrejection;
                util.global.onunhandledrejection = null;
                return ret2;
              },
              after: function(fn2) {
                util.global.onunhandledrejection = fn2;
              }
            },
            rejectionhandled: {
              before: function() {
                var ret2 = util.global.onrejectionhandled;
                util.global.onrejectionhandled = null;
                return ret2;
              },
              after: function(fn2) {
                util.global.onrejectionhandled = fn2;
              }
            }
          };
          var fireDomEvent = function() {
            var dispatch = function(legacy, e) {
              if (legacy) {
                var fn2;
                try {
                  fn2 = legacy.before();
                  return !util.global.dispatchEvent(e);
                } finally {
                  legacy.after(fn2);
                }
              } else {
                return !util.global.dispatchEvent(e);
              }
            };
            try {
              if (typeof CustomEvent === "function") {
                var event = new CustomEvent("CustomEvent");
                util.global.dispatchEvent(event);
                return function(name, event2) {
                  name = name.toLowerCase();
                  var eventData = {
                    detail: event2,
                    cancelable: true
                  };
                  var domEvent = new CustomEvent(name, eventData);
                  es52.defineProperty(
                    domEvent,
                    "promise",
                    { value: event2.promise }
                  );
                  es52.defineProperty(
                    domEvent,
                    "reason",
                    { value: event2.reason }
                  );
                  return dispatch(legacyHandlers[name], domEvent);
                };
              } else if (typeof Event === "function") {
                var event = new Event("CustomEvent");
                util.global.dispatchEvent(event);
                return function(name, event2) {
                  name = name.toLowerCase();
                  var domEvent = new Event(name, {
                    cancelable: true
                  });
                  domEvent.detail = event2;
                  es52.defineProperty(domEvent, "promise", { value: event2.promise });
                  es52.defineProperty(domEvent, "reason", { value: event2.reason });
                  return dispatch(legacyHandlers[name], domEvent);
                };
              } else {
                var event = document.createEvent("CustomEvent");
                event.initCustomEvent("testingtheevent", false, true, {});
                util.global.dispatchEvent(event);
                return function(name, event2) {
                  name = name.toLowerCase();
                  var domEvent = document.createEvent("CustomEvent");
                  domEvent.initCustomEvent(
                    name,
                    false,
                    true,
                    event2
                  );
                  return dispatch(legacyHandlers[name], domEvent);
                };
              }
            } catch (e) {
            }
            return function() {
              return false;
            };
          }();
          var fireGlobalEvent = function() {
            if (util.isNode) {
              return function() {
                return process.emit.apply(process, arguments);
              };
            } else {
              if (!util.global) {
                return function() {
                  return false;
                };
              }
              return function(name) {
                var methodName = "on" + name.toLowerCase();
                var method = util.global[methodName];
                if (!method)
                  return false;
                method.apply(util.global, [].slice.call(arguments, 1));
                return true;
              };
            }
          }();
          function generatePromiseLifecycleEventObject(name, promise) {
            return { promise };
          }
          var eventToObjectGenerator = {
            promiseCreated: generatePromiseLifecycleEventObject,
            promiseFulfilled: generatePromiseLifecycleEventObject,
            promiseRejected: generatePromiseLifecycleEventObject,
            promiseResolved: generatePromiseLifecycleEventObject,
            promiseCancelled: generatePromiseLifecycleEventObject,
            promiseChained: function(name, promise, child) {
              return { promise, child };
            },
            warning: function(name, warning) {
              return { warning };
            },
            unhandledRejection: function(name, reason, promise) {
              return { reason, promise };
            },
            rejectionHandled: generatePromiseLifecycleEventObject
          };
          var activeFireEvent = function(name) {
            var globalEventFired = false;
            try {
              globalEventFired = fireGlobalEvent.apply(null, arguments);
            } catch (e) {
              async.throwLater(e);
              globalEventFired = true;
            }
            var domEventFired = false;
            try {
              domEventFired = fireDomEvent(
                name,
                eventToObjectGenerator[name].apply(null, arguments)
              );
            } catch (e) {
              async.throwLater(e);
              domEventFired = true;
            }
            return domEventFired || globalEventFired;
          };
          Promise2.config = function(opts) {
            opts = Object(opts);
            if ("longStackTraces" in opts) {
              if (opts.longStackTraces) {
                Promise2.longStackTraces();
              } else if (!opts.longStackTraces && Promise2.hasLongStackTraces()) {
                disableLongStackTraces();
              }
            }
            if ("warnings" in opts) {
              var warningsOption = opts.warnings;
              config.warnings = !!warningsOption;
              wForgottenReturn = config.warnings;
              if (util.isObject(warningsOption)) {
                if ("wForgottenReturn" in warningsOption) {
                  wForgottenReturn = !!warningsOption.wForgottenReturn;
                }
              }
            }
            if ("cancellation" in opts && opts.cancellation && !config.cancellation) {
              if (async.haveItemsQueued()) {
                throw new Error(
                  "cannot enable cancellation after promises are in use"
                );
              }
              Promise2.prototype._clearCancellationData = cancellationClearCancellationData;
              Promise2.prototype._propagateFrom = cancellationPropagateFrom;
              Promise2.prototype._onCancel = cancellationOnCancel;
              Promise2.prototype._setOnCancel = cancellationSetOnCancel;
              Promise2.prototype._attachCancellationCallback = cancellationAttachCancellationCallback;
              Promise2.prototype._execute = cancellationExecute;
              propagateFromFunction = cancellationPropagateFrom;
              config.cancellation = true;
            }
            if ("monitoring" in opts) {
              if (opts.monitoring && !config.monitoring) {
                config.monitoring = true;
                Promise2.prototype._fireEvent = activeFireEvent;
              } else if (!opts.monitoring && config.monitoring) {
                config.monitoring = false;
                Promise2.prototype._fireEvent = defaultFireEvent;
              }
            }
            if ("asyncHooks" in opts && util.nodeSupportsAsyncResource) {
              var prev = config.asyncHooks;
              var cur = !!opts.asyncHooks;
              if (prev !== cur) {
                config.asyncHooks = cur;
                if (cur) {
                  enableAsyncHooks();
                } else {
                  disableAsyncHooks();
                }
              }
            }
            return Promise2;
          };
          function defaultFireEvent() {
            return false;
          }
          Promise2.prototype._fireEvent = defaultFireEvent;
          Promise2.prototype._execute = function(executor, resolve, reject) {
            try {
              executor(resolve, reject);
            } catch (e) {
              return e;
            }
          };
          Promise2.prototype._onCancel = function() {
          };
          Promise2.prototype._setOnCancel = function(handler) {
            ;
          };
          Promise2.prototype._attachCancellationCallback = function(onCancel) {
            ;
          };
          Promise2.prototype._captureStackTrace = function() {
          };
          Promise2.prototype._attachExtraTrace = function() {
          };
          Promise2.prototype._dereferenceTrace = function() {
          };
          Promise2.prototype._clearCancellationData = function() {
          };
          Promise2.prototype._propagateFrom = function(parent, flags) {
            ;
            ;
          };
          function cancellationExecute(executor, resolve, reject) {
            var promise = this;
            try {
              executor(resolve, reject, function(onCancel) {
                if (typeof onCancel !== "function") {
                  throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel));
                }
                promise._attachCancellationCallback(onCancel);
              });
            } catch (e) {
              return e;
            }
          }
          function cancellationAttachCancellationCallback(onCancel) {
            if (!this._isCancellable())
              return this;
            var previousOnCancel = this._onCancel();
            if (previousOnCancel !== void 0) {
              if (util.isArray(previousOnCancel)) {
                previousOnCancel.push(onCancel);
              } else {
                this._setOnCancel([previousOnCancel, onCancel]);
              }
            } else {
              this._setOnCancel(onCancel);
            }
          }
          function cancellationOnCancel() {
            return this._onCancelField;
          }
          function cancellationSetOnCancel(onCancel) {
            this._onCancelField = onCancel;
          }
          function cancellationClearCancellationData() {
            this._cancellationParent = void 0;
            this._onCancelField = void 0;
          }
          function cancellationPropagateFrom(parent, flags) {
            if ((flags & 1) !== 0) {
              this._cancellationParent = parent;
              var branchesRemainingToCancel = parent._branchesRemainingToCancel;
              if (branchesRemainingToCancel === void 0) {
                branchesRemainingToCancel = 0;
              }
              parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;
            }
            if ((flags & 2) !== 0 && parent._isBound()) {
              this._setBoundTo(parent._boundTo);
            }
          }
          function bindingPropagateFrom(parent, flags) {
            if ((flags & 2) !== 0 && parent._isBound()) {
              this._setBoundTo(parent._boundTo);
            }
          }
          var propagateFromFunction = bindingPropagateFrom;
          function boundValueFunction() {
            var ret2 = this._boundTo;
            if (ret2 !== void 0) {
              if (ret2 instanceof Promise2) {
                if (ret2.isFulfilled()) {
                  return ret2.value();
                } else {
                  return void 0;
                }
              }
            }
            return ret2;
          }
          function longStackTracesCaptureStackTrace() {
            this._trace = new CapturedTrace(this._peekContext());
          }
          function longStackTracesAttachExtraTrace(error, ignoreSelf) {
            if (canAttachTrace2(error)) {
              var trace = this._trace;
              if (trace !== void 0) {
                if (ignoreSelf)
                  trace = trace._parent;
              }
              if (trace !== void 0) {
                trace.attachExtraTrace(error);
              } else if (!error.__stackCleaned__) {
                var parsed = parseStackAndMessage(error);
                util.notEnumerableProp(
                  error,
                  "stack",
                  parsed.message + "\n" + parsed.stack.join("\n")
                );
                util.notEnumerableProp(error, "__stackCleaned__", true);
              }
            }
          }
          function longStackTracesDereferenceTrace() {
            this._trace = void 0;
          }
          function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) {
            if (returnValue === void 0 && promiseCreated !== null && wForgottenReturn) {
              if (parent !== void 0 && parent._returnedNonUndefined())
                return;
              if ((promise._bitField & 65535) === 0)
                return;
              if (name)
                name = name + " ";
              var handlerLine = "";
              var creatorLine = "";
              if (promiseCreated._trace) {
                var traceLines = promiseCreated._trace.stack.split("\n");
                var stack = cleanStack(traceLines);
                for (var i = stack.length - 1; i >= 0; --i) {
                  var line = stack[i];
                  if (!nodeFramePattern.test(line)) {
                    var lineMatches = line.match(parseLinePattern);
                    if (lineMatches) {
                      handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " ";
                    }
                    break;
                  }
                }
                if (stack.length > 0) {
                  var firstUserLine = stack[0];
                  for (var i = 0; i < traceLines.length; ++i) {
                    if (traceLines[i] === firstUserLine) {
                      if (i > 0) {
                        creatorLine = "\n" + traceLines[i - 1];
                      }
                      break;
                    }
                  }
                }
              }
              var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine;
              promise._warn(msg, true, promiseCreated);
            }
          }
          function deprecated(name, replacement) {
            var message = name + " is deprecated and will be removed in a future version.";
            if (replacement)
              message += " Use " + replacement + " instead.";
            return warn(message);
          }
          function warn(message, shouldUseOwnTrace, promise) {
            if (!config.warnings)
              return;
            var warning = new Warning(message);
            var ctx;
            if (shouldUseOwnTrace) {
              promise._attachExtraTrace(warning);
            } else if (config.longStackTraces && (ctx = Promise2._peekContext())) {
              ctx.attachExtraTrace(warning);
            } else {
              var parsed = parseStackAndMessage(warning);
              warning.stack = parsed.message + "\n" + parsed.stack.join("\n");
            }
            if (!activeFireEvent("warning", warning)) {
              formatAndLogError(warning, "", true);
            }
          }
          function reconstructStack(message, stacks) {
            for (var i = 0; i < stacks.length - 1; ++i) {
              stacks[i].push("From previous event:");
              stacks[i] = stacks[i].join("\n");
            }
            if (i < stacks.length) {
              stacks[i] = stacks[i].join("\n");
            }
            return message + "\n" + stacks.join("\n");
          }
          function removeDuplicateOrEmptyJumps(stacks) {
            for (var i = 0; i < stacks.length; ++i) {
              if (stacks[i].length === 0 || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) {
                stacks.splice(i, 1);
                i--;
              }
            }
          }
          function removeCommonRoots(stacks) {
            var current = stacks[0];
            for (var i = 1; i < stacks.length; ++i) {
              var prev = stacks[i];
              var currentLastIndex = current.length - 1;
              var currentLastLine = current[currentLastIndex];
              var commonRootMeetPoint = -1;
              for (var j = prev.length - 1; j >= 0; --j) {
                if (prev[j] === currentLastLine) {
                  commonRootMeetPoint = j;
                  break;
                }
              }
              for (var j = commonRootMeetPoint; j >= 0; --j) {
                var line = prev[j];
                if (current[currentLastIndex] === line) {
                  current.pop();
                  currentLastIndex--;
                } else {
                  break;
                }
              }
              current = prev;
            }
          }
          function cleanStack(stack) {
            var ret2 = [];
            for (var i = 0; i < stack.length; ++i) {
              var line = stack[i];
              var isTraceLine = "    (No stack trace)" === line || stackFramePattern.test(line);
              var isInternalFrame = isTraceLine && shouldIgnore(line);
              if (isTraceLine && !isInternalFrame) {
                if (indentStackFrames && line.charAt(0) !== " ") {
                  line = "    " + line;
                }
                ret2.push(line);
              }
            }
            return ret2;
          }
          function stackFramesAsArray(error) {
            var stack = error.stack.replace(/\s+$/g, "").split("\n");
            for (var i = 0; i < stack.length; ++i) {
              var line = stack[i];
              if ("    (No stack trace)" === line || stackFramePattern.test(line)) {
                break;
              }
            }
            if (i > 0 && error.name != "SyntaxError") {
              stack = stack.slice(i);
            }
            return stack;
          }
          function parseStackAndMessage(error) {
            var stack = error.stack;
            var message = error.toString();
            stack = typeof stack === "string" && stack.length > 0 ? stackFramesAsArray(error) : ["    (No stack trace)"];
            return {
              message,
              stack: error.name == "SyntaxError" ? stack : cleanStack(stack)
            };
          }
          function formatAndLogError(error, title, isSoft) {
            if (typeof console !== "undefined") {
              var message;
              if (util.isObject(error)) {
                var stack = error.stack;
                message = title + formatStack(stack, error);
              } else {
                message = title + String(error);
              }
              if (typeof printWarning === "function") {
                printWarning(message, isSoft);
              } else if (typeof console.log === "function" || typeof console.log === "object") {
                console.log(message);
              }
            }
          }
          function fireRejectionEvent(name, localHandler, reason, promise) {
            var localEventFired = false;
            try {
              if (typeof localHandler === "function") {
                localEventFired = true;
                if (name === "rejectionHandled") {
                  localHandler(promise);
                } else {
                  localHandler(reason, promise);
                }
              }
            } catch (e) {
              async.throwLater(e);
            }
            if (name === "unhandledRejection") {
              if (!activeFireEvent(name, reason, promise) && !localEventFired) {
                formatAndLogError(reason, "Unhandled rejection ");
              }
            } else {
              activeFireEvent(name, promise);
            }
          }
          function formatNonError(obj2) {
            var str;
            if (typeof obj2 === "function") {
              str = "[function " + (obj2.name || "anonymous") + "]";
            } else {
              str = obj2 && typeof obj2.toString === "function" ? obj2.toString() : util.toString(obj2);
              var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;
              if (ruselessToString.test(str)) {
                try {
                  var newStr = JSON.stringify(obj2);
                  str = newStr;
                } catch (e) {
                }
              }
              if (str.length === 0) {
                str = "(empty array)";
              }
            }
            return "(<" + snip(str) + ">, no stack trace)";
          }
          function snip(str) {
            var maxChars = 41;
            if (str.length < maxChars) {
              return str;
            }
            return str.substr(0, maxChars - 3) + "...";
          }
          function longStackTracesIsSupported() {
            return typeof captureStackTrace === "function";
          }
          var shouldIgnore = function() {
            return false;
          };
          var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
          function parseLineInfo(line) {
            var matches = line.match(parseLineInfoRegex);
            if (matches) {
              return {
                fileName: matches[1],
                line: parseInt(matches[2], 10)
              };
            }
          }
          function setBounds(firstLineError, lastLineError) {
            if (!longStackTracesIsSupported())
              return;
            var firstStackLines = (firstLineError.stack || "").split("\n");
            var lastStackLines = (lastLineError.stack || "").split("\n");
            var firstIndex = -1;
            var lastIndex = -1;
            var firstFileName;
            var lastFileName;
            for (var i = 0; i < firstStackLines.length; ++i) {
              var result = parseLineInfo(firstStackLines[i]);
              if (result) {
                firstFileName = result.fileName;
                firstIndex = result.line;
                break;
              }
            }
            for (var i = 0; i < lastStackLines.length; ++i) {
              var result = parseLineInfo(lastStackLines[i]);
              if (result) {
                lastFileName = result.fileName;
                lastIndex = result.line;
                break;
              }
            }
            if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) {
              return;
            }
            shouldIgnore = function(line) {
              if (bluebirdFramePattern.test(line))
                return true;
              var info = parseLineInfo(line);
              if (info) {
                if (info.fileName === firstFileName && (firstIndex <= info.line && info.line <= lastIndex)) {
                  return true;
                }
              }
              return false;
            };
          }
          function CapturedTrace(parent) {
            this._parent = parent;
            this._promisesCreated = 0;
            var length = this._length = 1 + (parent === void 0 ? 0 : parent._length);
            captureStackTrace(this, CapturedTrace);
            if (length > 32)
              this.uncycle();
          }
          util.inherits(CapturedTrace, Error);
          Context.CapturedTrace = CapturedTrace;
          CapturedTrace.prototype.uncycle = function() {
            var length = this._length;
            if (length < 2)
              return;
            var nodes = [];
            var stackToIndex = {};
            for (var i = 0, node = this; node !== void 0; ++i) {
              nodes.push(node);
              node = node._parent;
            }
            length = this._length = i;
            for (var i = length - 1; i >= 0; --i) {
              var stack = nodes[i].stack;
              if (stackToIndex[stack] === void 0) {
                stackToIndex[stack] = i;
              }
            }
            for (var i = 0; i < length; ++i) {
              var currentStack = nodes[i].stack;
              var index = stackToIndex[currentStack];
              if (index !== void 0 && index !== i) {
                if (index > 0) {
                  nodes[index - 1]._parent = void 0;
                  nodes[index - 1]._length = 1;
                }
                nodes[i]._parent = void 0;
                nodes[i]._length = 1;
                var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;
                if (index < length - 1) {
                  cycleEdgeNode._parent = nodes[index + 1];
                  cycleEdgeNode._parent.uncycle();
                  cycleEdgeNode._length = cycleEdgeNode._parent._length + 1;
                } else {
                  cycleEdgeNode._parent = void 0;
                  cycleEdgeNode._length = 1;
                }
                var currentChildLength = cycleEdgeNode._length + 1;
                for (var j = i - 2; j >= 0; --j) {
                  nodes[j]._length = currentChildLength;
                  currentChildLength++;
                }
                return;
              }
            }
          };
          CapturedTrace.prototype.attachExtraTrace = function(error) {
            if (error.__stackCleaned__)
              return;
            this.uncycle();
            var parsed = parseStackAndMessage(error);
            var message = parsed.message;
            var stacks = [parsed.stack];
            var trace = this;
            while (trace !== void 0) {
              stacks.push(cleanStack(trace.stack.split("\n")));
              trace = trace._parent;
            }
            removeCommonRoots(stacks);
            removeDuplicateOrEmptyJumps(stacks);
            util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
            util.notEnumerableProp(error, "__stackCleaned__", true);
          };
          var captureStackTrace = function stackDetection() {
            var v8stackFramePattern = /^\s*at\s*/;
            var v8stackFormatter = function(stack, error) {
              if (typeof stack === "string")
                return stack;
              if (error.name !== void 0 && error.message !== void 0) {
                return error.toString();
              }
              return formatNonError(error);
            };
            if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") {
              Error.stackTraceLimit += 6;
              stackFramePattern = v8stackFramePattern;
              formatStack = v8stackFormatter;
              var captureStackTrace2 = Error.captureStackTrace;
              shouldIgnore = function(line) {
                return bluebirdFramePattern.test(line);
              };
              return function(receiver2, ignoreUntil) {
                Error.stackTraceLimit += 6;
                captureStackTrace2(receiver2, ignoreUntil);
                Error.stackTraceLimit -= 6;
              };
            }
            var err = new Error();
            if (typeof err.stack === "string" && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) {
              stackFramePattern = /@/;
              formatStack = v8stackFormatter;
              indentStackFrames = true;
              return function captureStackTrace3(o) {
                o.stack = new Error().stack;
              };
            }
            var hasStackAfterThrow;
            try {
              throw new Error();
            } catch (e) {
              hasStackAfterThrow = "stack" in e;
            }
            if (!("stack" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === "number") {
              stackFramePattern = v8stackFramePattern;
              formatStack = v8stackFormatter;
              return function captureStackTrace3(o) {
                Error.stackTraceLimit += 6;
                try {
                  throw new Error();
                } catch (e) {
                  o.stack = e.stack;
                }
                Error.stackTraceLimit -= 6;
              };
            }
            formatStack = function(stack, error) {
              if (typeof stack === "string")
                return stack;
              if ((typeof error === "object" || typeof error === "function") && error.name !== void 0 && error.message !== void 0) {
                return error.toString();
              }
              return formatNonError(error);
            };
            return null;
          }([]);
          if (typeof console !== "undefined" && typeof console.warn !== "undefined") {
            printWarning = function(message) {
              console.warn(message);
            };
            if (util.isNode && process.stderr.isTTY) {
              printWarning = function(message, isSoft) {
                var color = isSoft ? "\x1B[33m" : "\x1B[31m";
                console.warn(color + message + "\x1B[0m\n");
              };
            } else if (!util.isNode && typeof new Error().stack === "string") {
              printWarning = function(message, isSoft) {
                console.warn(
                  "%c" + message,
                  isSoft ? "color: darkorange" : "color: red"
                );
              };
            }
          }
          var config = {
            warnings,
            longStackTraces: false,
            cancellation: false,
            monitoring: false,
            asyncHooks: false
          };
          if (longStackTraces)
            Promise2.longStackTraces();
          return {
            asyncHooks: function() {
              return config.asyncHooks;
            },
            longStackTraces: function() {
              return config.longStackTraces;
            },
            warnings: function() {
              return config.warnings;
            },
            cancellation: function() {
              return config.cancellation;
            },
            monitoring: function() {
              return config.monitoring;
            },
            propagateFromFunction: function() {
              return propagateFromFunction;
            },
            boundValueFunction: function() {
              return boundValueFunction;
            },
            checkForgottenReturns,
            setBounds,
            warn,
            deprecated,
            CapturedTrace,
            fireDomEvent,
            fireGlobalEvent
          };
        };
      }, { "./errors": 12, "./es5": 13, "./util": 36 }], 10: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2) {
          function returner() {
            return this.value;
          }
          function thrower2() {
            throw this.reason;
          }
          Promise2.prototype["return"] = Promise2.prototype.thenReturn = function(value) {
            if (value instanceof Promise2)
              value.suppressUnhandledRejections();
            return this._then(
              returner,
              void 0,
              void 0,
              { value },
              void 0
            );
          };
          Promise2.prototype["throw"] = Promise2.prototype.thenThrow = function(reason) {
            return this._then(
              thrower2,
              void 0,
              void 0,
              { reason },
              void 0
            );
          };
          Promise2.prototype.catchThrow = function(reason) {
            if (arguments.length <= 1) {
              return this._then(
                void 0,
                thrower2,
                void 0,
                { reason },
                void 0
              );
            } else {
              var _reason = arguments[1];
              var handler = function() {
                throw _reason;
              };
              return this.caught(reason, handler);
            }
          };
          Promise2.prototype.catchReturn = function(value) {
            if (arguments.length <= 1) {
              if (value instanceof Promise2)
                value.suppressUnhandledRejections();
              return this._then(
                void 0,
                returner,
                void 0,
                { value },
                void 0
              );
            } else {
              var _value = arguments[1];
              if (_value instanceof Promise2)
                _value.suppressUnhandledRejections();
              var handler = function() {
                return _value;
              };
              return this.caught(value, handler);
            }
          };
        };
      }, {}], 11: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL) {
          var PromiseReduce = Promise2.reduce;
          var PromiseAll = Promise2.all;
          function promiseAllThis() {
            return PromiseAll(this);
          }
          function PromiseMapSeries(promises, fn2) {
            return PromiseReduce(promises, fn2, INTERNAL, INTERNAL);
          }
          Promise2.prototype.each = function(fn2) {
            return PromiseReduce(this, fn2, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, this, void 0);
          };
          Promise2.prototype.mapSeries = function(fn2) {
            return PromiseReduce(this, fn2, INTERNAL, INTERNAL);
          };
          Promise2.each = function(promises, fn2) {
            return PromiseReduce(promises, fn2, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, promises, void 0);
          };
          Promise2.mapSeries = PromiseMapSeries;
        };
      }, {}], 12: [function(_dereq_2, module2, exports2) {
        "use strict";
        var es52 = _dereq_2("./es5");
        var Objectfreeze = es52.freeze;
        var util = _dereq_2("./util");
        var inherits2 = util.inherits;
        var notEnumerableProp2 = util.notEnumerableProp;
        function subError(nameProperty, defaultMessage) {
          function SubError(message) {
            if (!(this instanceof SubError))
              return new SubError(message);
            notEnumerableProp2(
              this,
              "message",
              typeof message === "string" ? message : defaultMessage
            );
            notEnumerableProp2(this, "name", nameProperty);
            if (Error.captureStackTrace) {
              Error.captureStackTrace(this, this.constructor);
            } else {
              Error.call(this);
            }
          }
          inherits2(SubError, Error);
          return SubError;
        }
        var _TypeError, _RangeError;
        var Warning = subError("Warning", "warning");
        var CancellationError = subError("CancellationError", "cancellation error");
        var TimeoutError = subError("TimeoutError", "timeout error");
        var AggregateError2 = subError("AggregateError", "aggregate error");
        try {
          _TypeError = TypeError;
          _RangeError = RangeError;
        } catch (e) {
          _TypeError = subError("TypeError", "type error");
          _RangeError = subError("RangeError", "range error");
        }
        var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");
        for (var i = 0; i < methods.length; ++i) {
          if (typeof Array.prototype[methods[i]] === "function") {
            AggregateError2.prototype[methods[i]] = Array.prototype[methods[i]];
          }
        }
        es52.defineProperty(AggregateError2.prototype, "length", {
          value: 0,
          configurable: false,
          writable: true,
          enumerable: true
        });
        AggregateError2.prototype["isOperational"] = true;
        var level = 0;
        AggregateError2.prototype.toString = function() {
          var indent = Array(level * 4 + 1).join(" ");
          var ret2 = "\n" + indent + "AggregateError of:\n";
          level++;
          indent = Array(level * 4 + 1).join(" ");
          for (var i2 = 0; i2 < this.length; ++i2) {
            var str = this[i2] === this ? "[Circular AggregateError]" : this[i2] + "";
            var lines = str.split("\n");
            for (var j = 0; j < lines.length; ++j) {
              lines[j] = indent + lines[j];
            }
            str = lines.join("\n");
            ret2 += str + "\n";
          }
          level--;
          return ret2;
        };
        function OperationalError(message) {
          if (!(this instanceof OperationalError))
            return new OperationalError(message);
          notEnumerableProp2(this, "name", "OperationalError");
          notEnumerableProp2(this, "message", message);
          this.cause = message;
          this["isOperational"] = true;
          if (message instanceof Error) {
            notEnumerableProp2(this, "message", message.message);
            notEnumerableProp2(this, "stack", message.stack);
          } else if (Error.captureStackTrace) {
            Error.captureStackTrace(this, this.constructor);
          }
        }
        inherits2(OperationalError, Error);
        var errorTypes = Error["__BluebirdErrorTypes__"];
        if (!errorTypes) {
          errorTypes = Objectfreeze({
            CancellationError,
            TimeoutError,
            OperationalError,
            RejectionError: OperationalError,
            AggregateError: AggregateError2
          });
          es52.defineProperty(Error, "__BluebirdErrorTypes__", {
            value: errorTypes,
            writable: false,
            enumerable: false,
            configurable: false
          });
        }
        module2.exports = {
          Error,
          TypeError: _TypeError,
          RangeError: _RangeError,
          CancellationError: errorTypes.CancellationError,
          OperationalError: errorTypes.OperationalError,
          TimeoutError: errorTypes.TimeoutError,
          AggregateError: errorTypes.AggregateError,
          Warning
        };
      }, { "./es5": 13, "./util": 36 }], 13: [function(_dereq_2, module2, exports2) {
        var isES5 = function() {
          "use strict";
          return this === void 0;
        }();
        if (isES5) {
          module2.exports = {
            freeze: Object.freeze,
            defineProperty: Object.defineProperty,
            getDescriptor: Object.getOwnPropertyDescriptor,
            keys: Object.keys,
            names: Object.getOwnPropertyNames,
            getPrototypeOf: Object.getPrototypeOf,
            isArray: Array.isArray,
            isES5,
            propertyIsWritable: function(obj2, prop) {
              var descriptor = Object.getOwnPropertyDescriptor(obj2, prop);
              return !!(!descriptor || descriptor.writable || descriptor.set);
            }
          };
        } else {
          var has = {}.hasOwnProperty;
          var str = {}.toString;
          var proto = {}.constructor.prototype;
          var ObjectKeys = function(o) {
            var ret2 = [];
            for (var key in o) {
              if (has.call(o, key)) {
                ret2.push(key);
              }
            }
            return ret2;
          };
          var ObjectGetDescriptor = function(o, key) {
            return { value: o[key] };
          };
          var ObjectDefineProperty = function(o, key, desc) {
            o[key] = desc.value;
            return o;
          };
          var ObjectFreeze = function(obj2) {
            return obj2;
          };
          var ObjectGetPrototypeOf = function(obj2) {
            try {
              return Object(obj2).constructor.prototype;
            } catch (e) {
              return proto;
            }
          };
          var ArrayIsArray = function(obj2) {
            try {
              return str.call(obj2) === "[object Array]";
            } catch (e) {
              return false;
            }
          };
          module2.exports = {
            isArray: ArrayIsArray,
            keys: ObjectKeys,
            names: ObjectKeys,
            defineProperty: ObjectDefineProperty,
            getDescriptor: ObjectGetDescriptor,
            freeze: ObjectFreeze,
            getPrototypeOf: ObjectGetPrototypeOf,
            isES5,
            propertyIsWritable: function() {
              return true;
            }
          };
        }
      }, {}], 14: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL) {
          var PromiseMap = Promise2.map;
          Promise2.prototype.filter = function(fn2, options) {
            return PromiseMap(this, fn2, options, INTERNAL);
          };
          Promise2.filter = function(promises, fn2, options) {
            return PromiseMap(promises, fn2, options, INTERNAL);
          };
        };
      }, {}], 15: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, tryConvertToPromise, NEXT_FILTER) {
          var util = _dereq_2("./util");
          var CancellationError = Promise2.CancellationError;
          var errorObj2 = util.errorObj;
          var catchFilter = _dereq_2("./catch_filter")(NEXT_FILTER);
          function PassThroughHandlerContext(promise, type, handler) {
            this.promise = promise;
            this.type = type;
            this.handler = handler;
            this.called = false;
            this.cancelPromise = null;
          }
          PassThroughHandlerContext.prototype.isFinallyHandler = function() {
            return this.type === 0;
          };
          function FinallyHandlerCancelReaction(finallyHandler2) {
            this.finallyHandler = finallyHandler2;
          }
          FinallyHandlerCancelReaction.prototype._resultCancelled = function() {
            checkCancel(this.finallyHandler);
          };
          function checkCancel(ctx, reason) {
            if (ctx.cancelPromise != null) {
              if (arguments.length > 1) {
                ctx.cancelPromise._reject(reason);
              } else {
                ctx.cancelPromise._cancel();
              }
              ctx.cancelPromise = null;
              return true;
            }
            return false;
          }
          function succeed() {
            return finallyHandler.call(this, this.promise._target()._settledValue());
          }
          function fail(reason) {
            if (checkCancel(this, reason))
              return;
            errorObj2.e = reason;
            return errorObj2;
          }
          function finallyHandler(reasonOrValue) {
            var promise = this.promise;
            var handler = this.handler;
            if (!this.called) {
              this.called = true;
              var ret2 = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue);
              if (ret2 === NEXT_FILTER) {
                return ret2;
              } else if (ret2 !== void 0) {
                promise._setReturnedNonUndefined();
                var maybePromise = tryConvertToPromise(ret2, promise);
                if (maybePromise instanceof Promise2) {
                  if (this.cancelPromise != null) {
                    if (maybePromise._isCancelled()) {
                      var reason = new CancellationError("late cancellation observer");
                      promise._attachExtraTrace(reason);
                      errorObj2.e = reason;
                      return errorObj2;
                    } else if (maybePromise.isPending()) {
                      maybePromise._attachCancellationCallback(
                        new FinallyHandlerCancelReaction(this)
                      );
                    }
                  }
                  return maybePromise._then(
                    succeed,
                    fail,
                    void 0,
                    this,
                    void 0
                  );
                }
              }
            }
            if (promise.isRejected()) {
              checkCancel(this);
              errorObj2.e = reasonOrValue;
              return errorObj2;
            } else {
              checkCancel(this);
              return reasonOrValue;
            }
          }
          Promise2.prototype._passThrough = function(handler, type, success, fail2) {
            if (typeof handler !== "function")
              return this.then();
            return this._then(
              success,
              fail2,
              void 0,
              new PassThroughHandlerContext(this, type, handler),
              void 0
            );
          };
          Promise2.prototype.lastly = Promise2.prototype["finally"] = function(handler) {
            return this._passThrough(
              handler,
              0,
              finallyHandler,
              finallyHandler
            );
          };
          Promise2.prototype.tap = function(handler) {
            return this._passThrough(handler, 1, finallyHandler);
          };
          Promise2.prototype.tapCatch = function(handlerOrPredicate) {
            var len = arguments.length;
            if (len === 1) {
              return this._passThrough(
                handlerOrPredicate,
                1,
                void 0,
                finallyHandler
              );
            } else {
              var catchInstances = new Array(len - 1), j = 0, i;
              for (i = 0; i < len - 1; ++i) {
                var item = arguments[i];
                if (util.isObject(item)) {
                  catchInstances[j++] = item;
                } else {
                  return Promise2.reject(new TypeError(
                    "tapCatch statement predicate: expecting an object but got " + util.classString(item)
                  ));
                }
              }
              catchInstances.length = j;
              var handler = arguments[i];
              return this._passThrough(
                catchFilter(catchInstances, handler, this),
                1,
                void 0,
                finallyHandler
              );
            }
          };
          return PassThroughHandlerContext;
        };
      }, { "./catch_filter": 7, "./util": 36 }], 16: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) {
          var errors = _dereq_2("./errors");
          var TypeError2 = errors.TypeError;
          var util = _dereq_2("./util");
          var errorObj2 = util.errorObj;
          var tryCatch2 = util.tryCatch;
          var yieldHandlers = [];
          function promiseFromYieldHandler(value, yieldHandlers2, traceParent) {
            for (var i = 0; i < yieldHandlers2.length; ++i) {
              traceParent._pushContext();
              var result = tryCatch2(yieldHandlers2[i])(value);
              traceParent._popContext();
              if (result === errorObj2) {
                traceParent._pushContext();
                var ret2 = Promise2.reject(errorObj2.e);
                traceParent._popContext();
                return ret2;
              }
              var maybePromise = tryConvertToPromise(result, traceParent);
              if (maybePromise instanceof Promise2)
                return maybePromise;
            }
            return null;
          }
          function PromiseSpawn(generatorFunction, receiver2, yieldHandler, stack) {
            if (debug.cancellation()) {
              var internal = new Promise2(INTERNAL);
              var _finallyPromise = this._finallyPromise = new Promise2(INTERNAL);
              this._promise = internal.lastly(function() {
                return _finallyPromise;
              });
              internal._captureStackTrace();
              internal._setOnCancel(this);
            } else {
              var promise = this._promise = new Promise2(INTERNAL);
              promise._captureStackTrace();
            }
            this._stack = stack;
            this._generatorFunction = generatorFunction;
            this._receiver = receiver2;
            this._generator = void 0;
            this._yieldHandlers = typeof yieldHandler === "function" ? [yieldHandler].concat(yieldHandlers) : yieldHandlers;
            this._yieldedPromise = null;
            this._cancellationPhase = false;
          }
          util.inherits(PromiseSpawn, Proxyable);
          PromiseSpawn.prototype._isResolved = function() {
            return this._promise === null;
          };
          PromiseSpawn.prototype._cleanup = function() {
            this._promise = this._generator = null;
            if (debug.cancellation() && this._finallyPromise !== null) {
              this._finallyPromise._fulfill();
              this._finallyPromise = null;
            }
          };
          PromiseSpawn.prototype._promiseCancelled = function() {
            if (this._isResolved())
              return;
            var implementsReturn = typeof this._generator["return"] !== "undefined";
            var result;
            if (!implementsReturn) {
              var reason = new Promise2.CancellationError(
                "generator .return() sentinel"
              );
              Promise2.coroutine.returnSentinel = reason;
              this._promise._attachExtraTrace(reason);
              this._promise._pushContext();
              result = tryCatch2(this._generator["throw"]).call(
                this._generator,
                reason
              );
              this._promise._popContext();
            } else {
              this._promise._pushContext();
              result = tryCatch2(this._generator["return"]).call(
                this._generator,
                void 0
              );
              this._promise._popContext();
            }
            this._cancellationPhase = true;
            this._yieldedPromise = null;
            this._continue(result);
          };
          PromiseSpawn.prototype._promiseFulfilled = function(value) {
            this._yieldedPromise = null;
            this._promise._pushContext();
            var result = tryCatch2(this._generator.next).call(this._generator, value);
            this._promise._popContext();
            this._continue(result);
          };
          PromiseSpawn.prototype._promiseRejected = function(reason) {
            this._yieldedPromise = null;
            this._promise._attachExtraTrace(reason);
            this._promise._pushContext();
            var result = tryCatch2(this._generator["throw"]).call(this._generator, reason);
            this._promise._popContext();
            this._continue(result);
          };
          PromiseSpawn.prototype._resultCancelled = function() {
            if (this._yieldedPromise instanceof Promise2) {
              var promise = this._yieldedPromise;
              this._yieldedPromise = null;
              promise.cancel();
            }
          };
          PromiseSpawn.prototype.promise = function() {
            return this._promise;
          };
          PromiseSpawn.prototype._run = function() {
            this._generator = this._generatorFunction.call(this._receiver);
            this._receiver = this._generatorFunction = void 0;
            this._promiseFulfilled(void 0);
          };
          PromiseSpawn.prototype._continue = function(result) {
            var promise = this._promise;
            if (result === errorObj2) {
              this._cleanup();
              if (this._cancellationPhase) {
                return promise.cancel();
              } else {
                return promise._rejectCallback(result.e, false);
              }
            }
            var value = result.value;
            if (result.done === true) {
              this._cleanup();
              if (this._cancellationPhase) {
                return promise.cancel();
              } else {
                return promise._resolveCallback(value);
              }
            } else {
              var maybePromise = tryConvertToPromise(value, this._promise);
              if (!(maybePromise instanceof Promise2)) {
                maybePromise = promiseFromYieldHandler(
                  maybePromise,
                  this._yieldHandlers,
                  this._promise
                );
                if (maybePromise === null) {
                  this._promiseRejected(
                    new TypeError2(
                      "A value %s was yielded that could not be treated as a promise\n\n    See http://goo.gl/MqrFmX\n\n".replace("%s", String(value)) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n")
                    )
                  );
                  return;
                }
              }
              maybePromise = maybePromise._target();
              var bitField = maybePromise._bitField;
              ;
              if ((bitField & 50397184) === 0) {
                this._yieldedPromise = maybePromise;
                maybePromise._proxy(this, null);
              } else if ((bitField & 33554432) !== 0) {
                Promise2._async.invoke(
                  this._promiseFulfilled,
                  this,
                  maybePromise._value()
                );
              } else if ((bitField & 16777216) !== 0) {
                Promise2._async.invoke(
                  this._promiseRejected,
                  this,
                  maybePromise._reason()
                );
              } else {
                this._promiseCancelled();
              }
            }
          };
          Promise2.coroutine = function(generatorFunction, options) {
            if (typeof generatorFunction !== "function") {
              throw new TypeError2("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
            }
            var yieldHandler = Object(options).yieldHandler;
            var PromiseSpawn$ = PromiseSpawn;
            var stack = new Error().stack;
            return function() {
              var generator = generatorFunction.apply(this, arguments);
              var spawn = new PromiseSpawn$(
                void 0,
                void 0,
                yieldHandler,
                stack
              );
              var ret2 = spawn.promise();
              spawn._generator = generator;
              spawn._promiseFulfilled(void 0);
              return ret2;
            };
          };
          Promise2.coroutine.addYieldHandler = function(fn2) {
            if (typeof fn2 !== "function") {
              throw new TypeError2("expecting a function but got " + util.classString(fn2));
            }
            yieldHandlers.push(fn2);
          };
          Promise2.spawn = function(generatorFunction) {
            debug.deprecated("Promise.spawn()", "Promise.coroutine()");
            if (typeof generatorFunction !== "function") {
              return apiRejection("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
            }
            var spawn = new PromiseSpawn(generatorFunction, this);
            var ret2 = spawn.promise();
            spawn._run(Promise2.spawn);
            return ret2;
          };
        };
      }, { "./errors": 12, "./util": 36 }], 17: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async) {
          var util = _dereq_2("./util");
          var canEvaluate2 = util.canEvaluate;
          var tryCatch2 = util.tryCatch;
          var errorObj2 = util.errorObj;
          var reject;
          if (false) {
            if (canEvaluate2) {
              var thenCallback = function(i2) {
                return new Function("value", "holder", "                             \n            'use strict';                                                    \n            holder.pIndex = value;                                           \n            holder.checkFulfillment(this);                                   \n            ".replace(/Index/g, i2));
              };
              var promiseSetter = function(i2) {
                return new Function("promise", "holder", "                           \n            'use strict';                                                    \n            holder.pIndex = promise;                                         \n            ".replace(/Index/g, i2));
              };
              var generateHolderClass = function(total) {
                var props = new Array(total);
                for (var i2 = 0; i2 < props.length; ++i2) {
                  props[i2] = "this.p" + (i2 + 1);
                }
                var assignment = props.join(" = ") + " = null;";
                var cancellationCode = "var promise;\n" + props.map(function(prop) {
                  return "                                                         \n                promise = " + prop + ";                                      \n                if (promise instanceof Promise) {                            \n                    promise.cancel();                                        \n                }                                                            \n            ";
                }).join("\n");
                var passedArguments = props.join(", ");
                var name = "Holder$" + total;
                var code = "return function(tryCatch, errorObj, Promise, async) {    \n            'use strict';                                                    \n            function [TheName](fn) {                                         \n                [TheProperties]                                              \n                this.fn = fn;                                                \n                this.asyncNeeded = true;                                     \n                this.now = 0;                                                \n            }                                                                \n                                                                             \n            [TheName].prototype._callFunction = function(promise) {          \n                promise._pushContext();                                      \n                var ret = tryCatch(this.fn)([ThePassedArguments]);           \n                promise._popContext();                                       \n                if (ret === errorObj) {                                      \n                    promise._rejectCallback(ret.e, false);                   \n                } else {                                                     \n                    promise._resolveCallback(ret);                           \n                }                                                            \n            };                                                               \n                                                                             \n            [TheName].prototype.checkFulfillment = function(promise) {       \n                var now = ++this.now;                                        \n                if (now === [TheTotal]) {                                    \n                    if (this.asyncNeeded) {                                  \n                        async.invoke(this._callFunction, this, promise);     \n                    } else {                                                 \n                        this._callFunction(promise);                         \n                    }                                                        \n                                                                             \n                }                                                            \n            };                                                               \n                                                                             \n            [TheName].prototype._resultCancelled = function() {              \n                [CancellationCode]                                           \n            };                                                               \n                                                                             \n            return [TheName];                                                \n        }(tryCatch, errorObj, Promise, async);                               \n        ";
                code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode);
                return new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch2, errorObj2, Promise2, async);
              };
              var holderClasses = [];
              var thenCallbacks = [];
              var promiseSetters = [];
              for (var i = 0; i < 8; ++i) {
                holderClasses.push(generateHolderClass(i + 1));
                thenCallbacks.push(thenCallback(i + 1));
                promiseSetters.push(promiseSetter(i + 1));
              }
              reject = function(reason) {
                this._reject(reason);
              };
            }
          }
          Promise2.join = function() {
            var last = arguments.length - 1;
            var fn2;
            if (last > 0 && typeof arguments[last] === "function") {
              fn2 = arguments[last];
              if (false) {
                if (last <= 8 && canEvaluate2) {
                  var ret2 = new Promise2(INTERNAL);
                  ret2._captureStackTrace();
                  var HolderClass = holderClasses[last - 1];
                  var holder = new HolderClass(fn2);
                  var callbacks = thenCallbacks;
                  for (var i2 = 0; i2 < last; ++i2) {
                    var maybePromise = tryConvertToPromise(arguments[i2], ret2);
                    if (maybePromise instanceof Promise2) {
                      maybePromise = maybePromise._target();
                      var bitField = maybePromise._bitField;
                      ;
                      if ((bitField & 50397184) === 0) {
                        maybePromise._then(
                          callbacks[i2],
                          reject,
                          void 0,
                          ret2,
                          holder
                        );
                        promiseSetters[i2](maybePromise, holder);
                        holder.asyncNeeded = false;
                      } else if ((bitField & 33554432) !== 0) {
                        callbacks[i2].call(
                          ret2,
                          maybePromise._value(),
                          holder
                        );
                      } else if ((bitField & 16777216) !== 0) {
                        ret2._reject(maybePromise._reason());
                      } else {
                        ret2._cancel();
                      }
                    } else {
                      callbacks[i2].call(ret2, maybePromise, holder);
                    }
                  }
                  if (!ret2._isFateSealed()) {
                    if (holder.asyncNeeded) {
                      var context = Promise2._getContext();
                      holder.fn = util.contextBind(context, holder.fn);
                    }
                    ret2._setAsyncGuaranteed();
                    ret2._setOnCancel(holder);
                  }
                  return ret2;
                }
              }
            }
            var args = [].slice.call(arguments);
            ;
            if (fn2)
              args.pop();
            var ret2 = new PromiseArray(args).promise();
            return fn2 !== void 0 ? ret2.spread(fn2) : ret2;
          };
        };
      }, { "./util": 36 }], 18: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) {
          var util = _dereq_2("./util");
          var tryCatch2 = util.tryCatch;
          var errorObj2 = util.errorObj;
          var async = Promise2._async;
          function MappingPromiseArray(promises, fn2, limit, _filter) {
            this.constructor$(promises);
            this._promise._captureStackTrace();
            var context = Promise2._getContext();
            this._callback = util.contextBind(context, fn2);
            this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null;
            this._limit = limit;
            this._inFlight = 0;
            this._queue = [];
            async.invoke(this._asyncInit, this, void 0);
            if (util.isArray(promises)) {
              for (var i = 0; i < promises.length; ++i) {
                var maybePromise = promises[i];
                if (maybePromise instanceof Promise2) {
                  maybePromise.suppressUnhandledRejections();
                }
              }
            }
          }
          util.inherits(MappingPromiseArray, PromiseArray);
          MappingPromiseArray.prototype._asyncInit = function() {
            this._init$(void 0, -2);
          };
          MappingPromiseArray.prototype._init = function() {
          };
          MappingPromiseArray.prototype._promiseFulfilled = function(value, index) {
            var values = this._values;
            var length = this.length();
            var preservedValues = this._preservedValues;
            var limit = this._limit;
            if (index < 0) {
              index = index * -1 - 1;
              values[index] = value;
              if (limit >= 1) {
                this._inFlight--;
                this._drainQueue();
                if (this._isResolved())
                  return true;
              }
            } else {
              if (limit >= 1 && this._inFlight >= limit) {
                values[index] = value;
                this._queue.push(index);
                return false;
              }
              if (preservedValues !== null)
                preservedValues[index] = value;
              var promise = this._promise;
              var callback = this._callback;
              var receiver2 = promise._boundValue();
              promise._pushContext();
              var ret2 = tryCatch2(callback).call(receiver2, value, index, length);
              var promiseCreated = promise._popContext();
              debug.checkForgottenReturns(
                ret2,
                promiseCreated,
                preservedValues !== null ? "Promise.filter" : "Promise.map",
                promise
              );
              if (ret2 === errorObj2) {
                this._reject(ret2.e);
                return true;
              }
              var maybePromise = tryConvertToPromise(ret2, this._promise);
              if (maybePromise instanceof Promise2) {
                maybePromise = maybePromise._target();
                var bitField = maybePromise._bitField;
                ;
                if ((bitField & 50397184) === 0) {
                  if (limit >= 1)
                    this._inFlight++;
                  values[index] = maybePromise;
                  maybePromise._proxy(this, (index + 1) * -1);
                  return false;
                } else if ((bitField & 33554432) !== 0) {
                  ret2 = maybePromise._value();
                } else if ((bitField & 16777216) !== 0) {
                  this._reject(maybePromise._reason());
                  return true;
                } else {
                  this._cancel();
                  return true;
                }
              }
              values[index] = ret2;
            }
            var totalResolved = ++this._totalResolved;
            if (totalResolved >= length) {
              if (preservedValues !== null) {
                this._filter(values, preservedValues);
              } else {
                this._resolve(values);
              }
              return true;
            }
            return false;
          };
          MappingPromiseArray.prototype._drainQueue = function() {
            var queue = this._queue;
            var limit = this._limit;
            var values = this._values;
            while (queue.length > 0 && this._inFlight < limit) {
              if (this._isResolved())
                return;
              var index = queue.pop();
              this._promiseFulfilled(values[index], index);
            }
          };
          MappingPromiseArray.prototype._filter = function(booleans, values) {
            var len = values.length;
            var ret2 = new Array(len);
            var j = 0;
            for (var i = 0; i < len; ++i) {
              if (booleans[i])
                ret2[j++] = values[i];
            }
            ret2.length = j;
            this._resolve(ret2);
          };
          MappingPromiseArray.prototype.preservedValues = function() {
            return this._preservedValues;
          };
          function map(promises, fn2, options, _filter) {
            if (typeof fn2 !== "function") {
              return apiRejection("expecting a function but got " + util.classString(fn2));
            }
            var limit = 0;
            if (options !== void 0) {
              if (typeof options === "object" && options !== null) {
                if (typeof options.concurrency !== "number") {
                  return Promise2.reject(
                    new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency))
                  );
                }
                limit = options.concurrency;
              } else {
                return Promise2.reject(new TypeError(
                  "options argument must be an object but it is " + util.classString(options)
                ));
              }
            }
            limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0;
            return new MappingPromiseArray(promises, fn2, limit, _filter).promise();
          }
          Promise2.prototype.map = function(fn2, options) {
            return map(this, fn2, options, null);
          };
          Promise2.map = function(promises, fn2, options, _filter) {
            return map(promises, fn2, options, _filter);
          };
        };
      }, { "./util": 36 }], 19: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug) {
          var util = _dereq_2("./util");
          var tryCatch2 = util.tryCatch;
          Promise2.method = function(fn2) {
            if (typeof fn2 !== "function") {
              throw new Promise2.TypeError("expecting a function but got " + util.classString(fn2));
            }
            return function() {
              var ret2 = new Promise2(INTERNAL);
              ret2._captureStackTrace();
              ret2._pushContext();
              var value = tryCatch2(fn2).apply(this, arguments);
              var promiseCreated = ret2._popContext();
              debug.checkForgottenReturns(
                value,
                promiseCreated,
                "Promise.method",
                ret2
              );
              ret2._resolveFromSyncValue(value);
              return ret2;
            };
          };
          Promise2.attempt = Promise2["try"] = function(fn2) {
            if (typeof fn2 !== "function") {
              return apiRejection("expecting a function but got " + util.classString(fn2));
            }
            var ret2 = new Promise2(INTERNAL);
            ret2._captureStackTrace();
            ret2._pushContext();
            var value;
            if (arguments.length > 1) {
              debug.deprecated("calling Promise.try with more than 1 argument");
              var arg = arguments[1];
              var ctx = arguments[2];
              value = util.isArray(arg) ? tryCatch2(fn2).apply(ctx, arg) : tryCatch2(fn2).call(ctx, arg);
            } else {
              value = tryCatch2(fn2)();
            }
            var promiseCreated = ret2._popContext();
            debug.checkForgottenReturns(
              value,
              promiseCreated,
              "Promise.try",
              ret2
            );
            ret2._resolveFromSyncValue(value);
            return ret2;
          };
          Promise2.prototype._resolveFromSyncValue = function(value) {
            if (value === util.errorObj) {
              this._rejectCallback(value.e, false);
            } else {
              this._resolveCallback(value, true);
            }
          };
        };
      }, { "./util": 36 }], 20: [function(_dereq_2, module2, exports2) {
        "use strict";
        var util = _dereq_2("./util");
        var maybeWrapAsError2 = util.maybeWrapAsError;
        var errors = _dereq_2("./errors");
        var OperationalError = errors.OperationalError;
        var es52 = _dereq_2("./es5");
        function isUntypedError(obj2) {
          return obj2 instanceof Error && es52.getPrototypeOf(obj2) === Error.prototype;
        }
        var rErrorKey = /^(?:name|message|stack|cause)$/;
        function wrapAsOperationalError(obj2) {
          var ret2;
          if (isUntypedError(obj2)) {
            ret2 = new OperationalError(obj2);
            ret2.name = obj2.name;
            ret2.message = obj2.message;
            ret2.stack = obj2.stack;
            var keys = es52.keys(obj2);
            for (var i = 0; i < keys.length; ++i) {
              var key = keys[i];
              if (!rErrorKey.test(key)) {
                ret2[key] = obj2[key];
              }
            }
            return ret2;
          }
          util.markAsOriginatingFromRejection(obj2);
          return obj2;
        }
        function nodebackForPromise(promise, multiArgs) {
          return function(err, value) {
            if (promise === null)
              return;
            if (err) {
              var wrapped = wrapAsOperationalError(maybeWrapAsError2(err));
              promise._attachExtraTrace(wrapped);
              promise._reject(wrapped);
            } else if (!multiArgs) {
              promise._fulfill(value);
            } else {
              var args = [].slice.call(arguments, 1);
              ;
              promise._fulfill(args);
            }
            promise = null;
          };
        }
        module2.exports = nodebackForPromise;
      }, { "./errors": 12, "./es5": 13, "./util": 36 }], 21: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2) {
          var util = _dereq_2("./util");
          var async = Promise2._async;
          var tryCatch2 = util.tryCatch;
          var errorObj2 = util.errorObj;
          function spreadAdapter(val, nodeback) {
            var promise = this;
            if (!util.isArray(val))
              return successAdapter.call(promise, val, nodeback);
            var ret2 = tryCatch2(nodeback).apply(promise._boundValue(), [null].concat(val));
            if (ret2 === errorObj2) {
              async.throwLater(ret2.e);
            }
          }
          function successAdapter(val, nodeback) {
            var promise = this;
            var receiver2 = promise._boundValue();
            var ret2 = val === void 0 ? tryCatch2(nodeback).call(receiver2, null) : tryCatch2(nodeback).call(receiver2, null, val);
            if (ret2 === errorObj2) {
              async.throwLater(ret2.e);
            }
          }
          function errorAdapter(reason, nodeback) {
            var promise = this;
            if (!reason) {
              var newReason = new Error(reason + "");
              newReason.cause = reason;
              reason = newReason;
            }
            var ret2 = tryCatch2(nodeback).call(promise._boundValue(), reason);
            if (ret2 === errorObj2) {
              async.throwLater(ret2.e);
            }
          }
          Promise2.prototype.asCallback = Promise2.prototype.nodeify = function(nodeback, options) {
            if (typeof nodeback == "function") {
              var adapter = successAdapter;
              if (options !== void 0 && Object(options).spread) {
                adapter = spreadAdapter;
              }
              this._then(
                adapter,
                errorAdapter,
                void 0,
                this,
                nodeback
              );
            }
            return this;
          };
        };
      }, { "./util": 36 }], 22: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function() {
          var makeSelfResolutionError = function() {
            return new TypeError2("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n");
          };
          var reflectHandler2 = function() {
            return new Promise2.PromiseInspection(this._target());
          };
          var apiRejection = function(msg) {
            return Promise2.reject(new TypeError2(msg));
          };
          function Proxyable() {
          }
          var UNDEFINED_BINDING = {};
          var util = _dereq_2("./util");
          util.setReflectHandler(reflectHandler2);
          var getDomain = function() {
            var domain = process.domain;
            if (domain === void 0) {
              return null;
            }
            return domain;
          };
          var getContextDefault = function() {
            return null;
          };
          var getContextDomain = function() {
            return {
              domain: getDomain(),
              async: null
            };
          };
          var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? _dereq_2("async_hooks").AsyncResource : null;
          var getContextAsyncHooks = function() {
            return {
              domain: getDomain(),
              async: new AsyncResource("Bluebird::Promise")
            };
          };
          var getContext = util.isNode ? getContextDomain : getContextDefault;
          util.notEnumerableProp(Promise2, "_getContext", getContext);
          var enableAsyncHooks = function() {
            getContext = getContextAsyncHooks;
            util.notEnumerableProp(Promise2, "_getContext", getContextAsyncHooks);
          };
          var disableAsyncHooks = function() {
            getContext = getContextDomain;
            util.notEnumerableProp(Promise2, "_getContext", getContextDomain);
          };
          var es52 = _dereq_2("./es5");
          var Async = _dereq_2("./async");
          var async = new Async();
          es52.defineProperty(Promise2, "_async", { value: async });
          var errors = _dereq_2("./errors");
          var TypeError2 = Promise2.TypeError = errors.TypeError;
          Promise2.RangeError = errors.RangeError;
          var CancellationError = Promise2.CancellationError = errors.CancellationError;
          Promise2.TimeoutError = errors.TimeoutError;
          Promise2.OperationalError = errors.OperationalError;
          Promise2.RejectionError = errors.OperationalError;
          Promise2.AggregateError = errors.AggregateError;
          var INTERNAL = function() {
          };
          var APPLY = {};
          var NEXT_FILTER = {};
          var tryConvertToPromise = _dereq_2("./thenables")(Promise2, INTERNAL);
          var PromiseArray = _dereq_2("./promise_array")(
            Promise2,
            INTERNAL,
            tryConvertToPromise,
            apiRejection,
            Proxyable
          );
          var Context = _dereq_2("./context")(Promise2);
          var createContext = Context.create;
          var debug = _dereq_2("./debuggability")(
            Promise2,
            Context,
            enableAsyncHooks,
            disableAsyncHooks
          );
          var CapturedTrace = debug.CapturedTrace;
          var PassThroughHandlerContext = _dereq_2("./finally")(Promise2, tryConvertToPromise, NEXT_FILTER);
          var catchFilter = _dereq_2("./catch_filter")(NEXT_FILTER);
          var nodebackForPromise = _dereq_2("./nodeback");
          var errorObj2 = util.errorObj;
          var tryCatch2 = util.tryCatch;
          function check2(self2, executor) {
            if (self2 == null || self2.constructor !== Promise2) {
              throw new TypeError2("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n");
            }
            if (typeof executor !== "function") {
              throw new TypeError2("expecting a function but got " + util.classString(executor));
            }
          }
          function Promise2(executor) {
            if (executor !== INTERNAL) {
              check2(this, executor);
            }
            this._bitField = 0;
            this._fulfillmentHandler0 = void 0;
            this._rejectionHandler0 = void 0;
            this._promise0 = void 0;
            this._receiver0 = void 0;
            this._resolveFromExecutor(executor);
            this._promiseCreated();
            this._fireEvent("promiseCreated", this);
          }
          Promise2.prototype.toString = function() {
            return "[object Promise]";
          };
          Promise2.prototype.caught = Promise2.prototype["catch"] = function(fn2) {
            var len = arguments.length;
            if (len > 1) {
              var catchInstances = new Array(len - 1), j = 0, i;
              for (i = 0; i < len - 1; ++i) {
                var item = arguments[i];
                if (util.isObject(item)) {
                  catchInstances[j++] = item;
                } else {
                  return apiRejection("Catch statement predicate: expecting an object but got " + util.classString(item));
                }
              }
              catchInstances.length = j;
              fn2 = arguments[i];
              if (typeof fn2 !== "function") {
                throw new TypeError2("The last argument to .catch() must be a function, got " + util.toString(fn2));
              }
              return this.then(void 0, catchFilter(catchInstances, fn2, this));
            }
            return this.then(void 0, fn2);
          };
          Promise2.prototype.reflect = function() {
            return this._then(
              reflectHandler2,
              reflectHandler2,
              void 0,
              this,
              void 0
            );
          };
          Promise2.prototype.then = function(didFulfill, didReject) {
            if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== "function" && typeof didReject !== "function") {
              var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill);
              if (arguments.length > 1) {
                msg += ", " + util.classString(didReject);
              }
              this._warn(msg);
            }
            return this._then(didFulfill, didReject, void 0, void 0, void 0);
          };
          Promise2.prototype.done = function(didFulfill, didReject) {
            var promise = this._then(didFulfill, didReject, void 0, void 0, void 0);
            promise._setIsFinal();
          };
          Promise2.prototype.spread = function(fn2) {
            if (typeof fn2 !== "function") {
              return apiRejection("expecting a function but got " + util.classString(fn2));
            }
            return this.all()._then(fn2, void 0, void 0, APPLY, void 0);
          };
          Promise2.prototype.toJSON = function() {
            var ret2 = {
              isFulfilled: false,
              isRejected: false,
              fulfillmentValue: void 0,
              rejectionReason: void 0
            };
            if (this.isFulfilled()) {
              ret2.fulfillmentValue = this.value();
              ret2.isFulfilled = true;
            } else if (this.isRejected()) {
              ret2.rejectionReason = this.reason();
              ret2.isRejected = true;
            }
            return ret2;
          };
          Promise2.prototype.all = function() {
            if (arguments.length > 0) {
              this._warn(".all() was passed arguments but it does not take any");
            }
            return new PromiseArray(this).promise();
          };
          Promise2.prototype.error = function(fn2) {
            return this.caught(util.originatesFromRejection, fn2);
          };
          Promise2.getNewLibraryCopy = module2.exports;
          Promise2.is = function(val) {
            return val instanceof Promise2;
          };
          Promise2.fromNode = Promise2.fromCallback = function(fn2) {
            var ret2 = new Promise2(INTERNAL);
            ret2._captureStackTrace();
            var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false;
            var result = tryCatch2(fn2)(nodebackForPromise(ret2, multiArgs));
            if (result === errorObj2) {
              ret2._rejectCallback(result.e, true);
            }
            if (!ret2._isFateSealed())
              ret2._setAsyncGuaranteed();
            return ret2;
          };
          Promise2.all = function(promises) {
            return new PromiseArray(promises).promise();
          };
          Promise2.cast = function(obj2) {
            var ret2 = tryConvertToPromise(obj2);
            if (!(ret2 instanceof Promise2)) {
              ret2 = new Promise2(INTERNAL);
              ret2._captureStackTrace();
              ret2._setFulfilled();
              ret2._rejectionHandler0 = obj2;
            }
            return ret2;
          };
          Promise2.resolve = Promise2.fulfilled = Promise2.cast;
          Promise2.reject = Promise2.rejected = function(reason) {
            var ret2 = new Promise2(INTERNAL);
            ret2._captureStackTrace();
            ret2._rejectCallback(reason, true);
            return ret2;
          };
          Promise2.setScheduler = function(fn2) {
            if (typeof fn2 !== "function") {
              throw new TypeError2("expecting a function but got " + util.classString(fn2));
            }
            return async.setScheduler(fn2);
          };
          Promise2.prototype._then = function(didFulfill, didReject, _, receiver2, internalData) {
            var haveInternalData = internalData !== void 0;
            var promise = haveInternalData ? internalData : new Promise2(INTERNAL);
            var target = this._target();
            var bitField = target._bitField;
            if (!haveInternalData) {
              promise._propagateFrom(this, 3);
              promise._captureStackTrace();
              if (receiver2 === void 0 && (this._bitField & 2097152) !== 0) {
                if (!((bitField & 50397184) === 0)) {
                  receiver2 = this._boundValue();
                } else {
                  receiver2 = target === this ? void 0 : this._boundTo;
                }
              }
              this._fireEvent("promiseChained", this, promise);
            }
            var context = getContext();
            if (!((bitField & 50397184) === 0)) {
              var handler, value, settler = target._settlePromiseCtx;
              if ((bitField & 33554432) !== 0) {
                value = target._rejectionHandler0;
                handler = didFulfill;
              } else if ((bitField & 16777216) !== 0) {
                value = target._fulfillmentHandler0;
                handler = didReject;
                target._unsetRejectionIsUnhandled();
              } else {
                settler = target._settlePromiseLateCancellationObserver;
                value = new CancellationError("late cancellation observer");
                target._attachExtraTrace(value);
                handler = didReject;
              }
              async.invoke(settler, target, {
                handler: util.contextBind(context, handler),
                promise,
                receiver: receiver2,
                value
              });
            } else {
              target._addCallbacks(
                didFulfill,
                didReject,
                promise,
                receiver2,
                context
              );
            }
            return promise;
          };
          Promise2.prototype._length = function() {
            return this._bitField & 65535;
          };
          Promise2.prototype._isFateSealed = function() {
            return (this._bitField & 117506048) !== 0;
          };
          Promise2.prototype._isFollowing = function() {
            return (this._bitField & 67108864) === 67108864;
          };
          Promise2.prototype._setLength = function(len) {
            this._bitField = this._bitField & -65536 | len & 65535;
          };
          Promise2.prototype._setFulfilled = function() {
            this._bitField = this._bitField | 33554432;
            this._fireEvent("promiseFulfilled", this);
          };
          Promise2.prototype._setRejected = function() {
            this._bitField = this._bitField | 16777216;
            this._fireEvent("promiseRejected", this);
          };
          Promise2.prototype._setFollowing = function() {
            this._bitField = this._bitField | 67108864;
            this._fireEvent("promiseResolved", this);
          };
          Promise2.prototype._setIsFinal = function() {
            this._bitField = this._bitField | 4194304;
          };
          Promise2.prototype._isFinal = function() {
            return (this._bitField & 4194304) > 0;
          };
          Promise2.prototype._unsetCancelled = function() {
            this._bitField = this._bitField & ~65536;
          };
          Promise2.prototype._setCancelled = function() {
            this._bitField = this._bitField | 65536;
            this._fireEvent("promiseCancelled", this);
          };
          Promise2.prototype._setWillBeCancelled = function() {
            this._bitField = this._bitField | 8388608;
          };
          Promise2.prototype._setAsyncGuaranteed = function() {
            if (async.hasCustomScheduler())
              return;
            var bitField = this._bitField;
            this._bitField = bitField | (bitField & 536870912) >> 2 ^ 134217728;
          };
          Promise2.prototype._setNoAsyncGuarantee = function() {
            this._bitField = (this._bitField | 536870912) & ~134217728;
          };
          Promise2.prototype._receiverAt = function(index) {
            var ret2 = index === 0 ? this._receiver0 : this[index * 4 - 4 + 3];
            if (ret2 === UNDEFINED_BINDING) {
              return void 0;
            } else if (ret2 === void 0 && this._isBound()) {
              return this._boundValue();
            }
            return ret2;
          };
          Promise2.prototype._promiseAt = function(index) {
            return this[index * 4 - 4 + 2];
          };
          Promise2.prototype._fulfillmentHandlerAt = function(index) {
            return this[index * 4 - 4 + 0];
          };
          Promise2.prototype._rejectionHandlerAt = function(index) {
            return this[index * 4 - 4 + 1];
          };
          Promise2.prototype._boundValue = function() {
          };
          Promise2.prototype._migrateCallback0 = function(follower) {
            var bitField = follower._bitField;
            var fulfill = follower._fulfillmentHandler0;
            var reject = follower._rejectionHandler0;
            var promise = follower._promise0;
            var receiver2 = follower._receiverAt(0);
            if (receiver2 === void 0)
              receiver2 = UNDEFINED_BINDING;
            this._addCallbacks(fulfill, reject, promise, receiver2, null);
          };
          Promise2.prototype._migrateCallbackAt = function(follower, index) {
            var fulfill = follower._fulfillmentHandlerAt(index);
            var reject = follower._rejectionHandlerAt(index);
            var promise = follower._promiseAt(index);
            var receiver2 = follower._receiverAt(index);
            if (receiver2 === void 0)
              receiver2 = UNDEFINED_BINDING;
            this._addCallbacks(fulfill, reject, promise, receiver2, null);
          };
          Promise2.prototype._addCallbacks = function(fulfill, reject, promise, receiver2, context) {
            var index = this._length();
            if (index >= 65535 - 4) {
              index = 0;
              this._setLength(0);
            }
            if (index === 0) {
              this._promise0 = promise;
              this._receiver0 = receiver2;
              if (typeof fulfill === "function") {
                this._fulfillmentHandler0 = util.contextBind(context, fulfill);
              }
              if (typeof reject === "function") {
                this._rejectionHandler0 = util.contextBind(context, reject);
              }
            } else {
              var base = index * 4 - 4;
              this[base + 2] = promise;
              this[base + 3] = receiver2;
              if (typeof fulfill === "function") {
                this[base + 0] = util.contextBind(context, fulfill);
              }
              if (typeof reject === "function") {
                this[base + 1] = util.contextBind(context, reject);
              }
            }
            this._setLength(index + 1);
            return index;
          };
          Promise2.prototype._proxy = function(proxyable, arg) {
            this._addCallbacks(void 0, void 0, arg, proxyable, null);
          };
          Promise2.prototype._resolveCallback = function(value, shouldBind) {
            if ((this._bitField & 117506048) !== 0)
              return;
            if (value === this)
              return this._rejectCallback(makeSelfResolutionError(), false);
            var maybePromise = tryConvertToPromise(value, this);
            if (!(maybePromise instanceof Promise2))
              return this._fulfill(value);
            if (shouldBind)
              this._propagateFrom(maybePromise, 2);
            var promise = maybePromise._target();
            if (promise === this) {
              this._reject(makeSelfResolutionError());
              return;
            }
            var bitField = promise._bitField;
            if ((bitField & 50397184) === 0) {
              var len = this._length();
              if (len > 0)
                promise._migrateCallback0(this);
              for (var i = 1; i < len; ++i) {
                promise._migrateCallbackAt(this, i);
              }
              this._setFollowing();
              this._setLength(0);
              this._setFollowee(maybePromise);
            } else if ((bitField & 33554432) !== 0) {
              this._fulfill(promise._value());
            } else if ((bitField & 16777216) !== 0) {
              this._reject(promise._reason());
            } else {
              var reason = new CancellationError("late cancellation observer");
              promise._attachExtraTrace(reason);
              this._reject(reason);
            }
          };
          Promise2.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) {
            var trace = util.ensureErrorObject(reason);
            var hasStack = trace === reason;
            if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {
              var message = "a promise was rejected with a non-error: " + util.classString(reason);
              this._warn(message, true);
            }
            this._attachExtraTrace(trace, synchronous ? hasStack : false);
            this._reject(reason);
          };
          Promise2.prototype._resolveFromExecutor = function(executor) {
            if (executor === INTERNAL)
              return;
            var promise = this;
            this._captureStackTrace();
            this._pushContext();
            var synchronous = true;
            var r = this._execute(executor, function(value) {
              promise._resolveCallback(value);
            }, function(reason) {
              promise._rejectCallback(reason, synchronous);
            });
            synchronous = false;
            this._popContext();
            if (r !== void 0) {
              promise._rejectCallback(r, true);
            }
          };
          Promise2.prototype._settlePromiseFromHandler = function(handler, receiver2, value, promise) {
            var bitField = promise._bitField;
            if ((bitField & 65536) !== 0)
              return;
            promise._pushContext();
            var x;
            if (receiver2 === APPLY) {
              if (!value || typeof value.length !== "number") {
                x = errorObj2;
                x.e = new TypeError2("cannot .spread() a non-array: " + util.classString(value));
              } else {
                x = tryCatch2(handler).apply(this._boundValue(), value);
              }
            } else {
              x = tryCatch2(handler).call(receiver2, value);
            }
            var promiseCreated = promise._popContext();
            bitField = promise._bitField;
            if ((bitField & 65536) !== 0)
              return;
            if (x === NEXT_FILTER) {
              promise._reject(value);
            } else if (x === errorObj2) {
              promise._rejectCallback(x.e, false);
            } else {
              debug.checkForgottenReturns(x, promiseCreated, "", promise, this);
              promise._resolveCallback(x);
            }
          };
          Promise2.prototype._target = function() {
            var ret2 = this;
            while (ret2._isFollowing())
              ret2 = ret2._followee();
            return ret2;
          };
          Promise2.prototype._followee = function() {
            return this._rejectionHandler0;
          };
          Promise2.prototype._setFollowee = function(promise) {
            this._rejectionHandler0 = promise;
          };
          Promise2.prototype._settlePromise = function(promise, handler, receiver2, value) {
            var isPromise = promise instanceof Promise2;
            var bitField = this._bitField;
            var asyncGuaranteed = (bitField & 134217728) !== 0;
            if ((bitField & 65536) !== 0) {
              if (isPromise)
                promise._invokeInternalOnCancel();
              if (receiver2 instanceof PassThroughHandlerContext && receiver2.isFinallyHandler()) {
                receiver2.cancelPromise = promise;
                if (tryCatch2(handler).call(receiver2, value) === errorObj2) {
                  promise._reject(errorObj2.e);
                }
              } else if (handler === reflectHandler2) {
                promise._fulfill(reflectHandler2.call(receiver2));
              } else if (receiver2 instanceof Proxyable) {
                receiver2._promiseCancelled(promise);
              } else if (isPromise || promise instanceof PromiseArray) {
                promise._cancel();
              } else {
                receiver2.cancel();
              }
            } else if (typeof handler === "function") {
              if (!isPromise) {
                handler.call(receiver2, value, promise);
              } else {
                if (asyncGuaranteed)
                  promise._setAsyncGuaranteed();
                this._settlePromiseFromHandler(handler, receiver2, value, promise);
              }
            } else if (receiver2 instanceof Proxyable) {
              if (!receiver2._isResolved()) {
                if ((bitField & 33554432) !== 0) {
                  receiver2._promiseFulfilled(value, promise);
                } else {
                  receiver2._promiseRejected(value, promise);
                }
              }
            } else if (isPromise) {
              if (asyncGuaranteed)
                promise._setAsyncGuaranteed();
              if ((bitField & 33554432) !== 0) {
                promise._fulfill(value);
              } else {
                promise._reject(value);
              }
            }
          };
          Promise2.prototype._settlePromiseLateCancellationObserver = function(ctx) {
            var handler = ctx.handler;
            var promise = ctx.promise;
            var receiver2 = ctx.receiver;
            var value = ctx.value;
            if (typeof handler === "function") {
              if (!(promise instanceof Promise2)) {
                handler.call(receiver2, value, promise);
              } else {
                this._settlePromiseFromHandler(handler, receiver2, value, promise);
              }
            } else if (promise instanceof Promise2) {
              promise._reject(value);
            }
          };
          Promise2.prototype._settlePromiseCtx = function(ctx) {
            this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);
          };
          Promise2.prototype._settlePromise0 = function(handler, value, bitField) {
            var promise = this._promise0;
            var receiver2 = this._receiverAt(0);
            this._promise0 = void 0;
            this._receiver0 = void 0;
            this._settlePromise(promise, handler, receiver2, value);
          };
          Promise2.prototype._clearCallbackDataAtIndex = function(index) {
            var base = index * 4 - 4;
            this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = void 0;
          };
          Promise2.prototype._fulfill = function(value) {
            var bitField = this._bitField;
            if ((bitField & 117506048) >>> 16)
              return;
            if (value === this) {
              var err = makeSelfResolutionError();
              this._attachExtraTrace(err);
              return this._reject(err);
            }
            this._setFulfilled();
            this._rejectionHandler0 = value;
            if ((bitField & 65535) > 0) {
              if ((bitField & 134217728) !== 0) {
                this._settlePromises();
              } else {
                async.settlePromises(this);
              }
              this._dereferenceTrace();
            }
          };
          Promise2.prototype._reject = function(reason) {
            var bitField = this._bitField;
            if ((bitField & 117506048) >>> 16)
              return;
            this._setRejected();
            this._fulfillmentHandler0 = reason;
            if (this._isFinal()) {
              return async.fatalError(reason, util.isNode);
            }
            if ((bitField & 65535) > 0) {
              async.settlePromises(this);
            } else {
              this._ensurePossibleRejectionHandled();
            }
          };
          Promise2.prototype._fulfillPromises = function(len, value) {
            for (var i = 1; i < len; i++) {
              var handler = this._fulfillmentHandlerAt(i);
              var promise = this._promiseAt(i);
              var receiver2 = this._receiverAt(i);
              this._clearCallbackDataAtIndex(i);
              this._settlePromise(promise, handler, receiver2, value);
            }
          };
          Promise2.prototype._rejectPromises = function(len, reason) {
            for (var i = 1; i < len; i++) {
              var handler = this._rejectionHandlerAt(i);
              var promise = this._promiseAt(i);
              var receiver2 = this._receiverAt(i);
              this._clearCallbackDataAtIndex(i);
              this._settlePromise(promise, handler, receiver2, reason);
            }
          };
          Promise2.prototype._settlePromises = function() {
            var bitField = this._bitField;
            var len = bitField & 65535;
            if (len > 0) {
              if ((bitField & 16842752) !== 0) {
                var reason = this._fulfillmentHandler0;
                this._settlePromise0(this._rejectionHandler0, reason, bitField);
                this._rejectPromises(len, reason);
              } else {
                var value = this._rejectionHandler0;
                this._settlePromise0(this._fulfillmentHandler0, value, bitField);
                this._fulfillPromises(len, value);
              }
              this._setLength(0);
            }
            this._clearCancellationData();
          };
          Promise2.prototype._settledValue = function() {
            var bitField = this._bitField;
            if ((bitField & 33554432) !== 0) {
              return this._rejectionHandler0;
            } else if ((bitField & 16777216) !== 0) {
              return this._fulfillmentHandler0;
            }
          };
          if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
            es52.defineProperty(Promise2.prototype, Symbol.toStringTag, {
              get: function() {
                return "Object";
              }
            });
          }
          function deferResolve(v) {
            this.promise._resolveCallback(v);
          }
          function deferReject(v) {
            this.promise._rejectCallback(v, false);
          }
          Promise2.defer = Promise2.pending = function() {
            debug.deprecated("Promise.defer", "new Promise");
            var promise = new Promise2(INTERNAL);
            return {
              promise,
              resolve: deferResolve,
              reject: deferReject
            };
          };
          util.notEnumerableProp(
            Promise2,
            "_makeSelfResolutionError",
            makeSelfResolutionError
          );
          _dereq_2("./method")(
            Promise2,
            INTERNAL,
            tryConvertToPromise,
            apiRejection,
            debug
          );
          _dereq_2("./bind")(Promise2, INTERNAL, tryConvertToPromise, debug);
          _dereq_2("./cancel")(Promise2, PromiseArray, apiRejection, debug);
          _dereq_2("./direct_resolve")(Promise2);
          _dereq_2("./synchronous_inspection")(Promise2);
          _dereq_2("./join")(
            Promise2,
            PromiseArray,
            tryConvertToPromise,
            INTERNAL,
            async
          );
          Promise2.Promise = Promise2;
          Promise2.version = "3.7.2";
          _dereq_2("./call_get.js")(Promise2);
          _dereq_2("./generators.js")(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);
          _dereq_2("./map.js")(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);
          _dereq_2("./nodeify.js")(Promise2);
          _dereq_2("./promisify.js")(Promise2, INTERNAL);
          _dereq_2("./props.js")(Promise2, PromiseArray, tryConvertToPromise, apiRejection);
          _dereq_2("./race.js")(Promise2, INTERNAL, tryConvertToPromise, apiRejection);
          _dereq_2("./reduce.js")(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);
          _dereq_2("./settle.js")(Promise2, PromiseArray, debug);
          _dereq_2("./some.js")(Promise2, PromiseArray, apiRejection);
          _dereq_2("./timers.js")(Promise2, INTERNAL, debug);
          _dereq_2("./using.js")(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);
          _dereq_2("./any.js")(Promise2);
          _dereq_2("./each.js")(Promise2, INTERNAL);
          _dereq_2("./filter.js")(Promise2, INTERNAL);
          util.toFastProperties(Promise2);
          util.toFastProperties(Promise2.prototype);
          function fillTypes(value) {
            var p = new Promise2(INTERNAL);
            p._fulfillmentHandler0 = value;
            p._rejectionHandler0 = value;
            p._promise0 = value;
            p._receiver0 = value;
          }
          fillTypes({ a: 1 });
          fillTypes({ b: 2 });
          fillTypes({ c: 3 });
          fillTypes(1);
          fillTypes(function() {
          });
          fillTypes(void 0);
          fillTypes(false);
          fillTypes(new Promise2(INTERNAL));
          debug.setBounds(Async.firstLineError, util.lastLineError);
          return Promise2;
        };
      }, { "./any.js": 1, "./async": 2, "./bind": 3, "./call_get.js": 5, "./cancel": 6, "./catch_filter": 7, "./context": 8, "./debuggability": 9, "./direct_resolve": 10, "./each.js": 11, "./errors": 12, "./es5": 13, "./filter.js": 14, "./finally": 15, "./generators.js": 16, "./join": 17, "./map.js": 18, "./method": 19, "./nodeback": 20, "./nodeify.js": 21, "./promise_array": 23, "./promisify.js": 24, "./props.js": 25, "./race.js": 27, "./reduce.js": 28, "./settle.js": 30, "./some.js": 31, "./synchronous_inspection": 32, "./thenables": 33, "./timers.js": 34, "./using.js": 35, "./util": 36, "async_hooks": void 0 }], 23: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) {
          var util = _dereq_2("./util");
          var isArray = util.isArray;
          function toResolutionValue(val) {
            switch (val) {
              case -2:
                return [];
              case -3:
                return {};
              case -6:
                return /* @__PURE__ */ new Map();
            }
          }
          function PromiseArray(values) {
            var promise = this._promise = new Promise2(INTERNAL);
            if (values instanceof Promise2) {
              promise._propagateFrom(values, 3);
              values.suppressUnhandledRejections();
            }
            promise._setOnCancel(this);
            this._values = values;
            this._length = 0;
            this._totalResolved = 0;
            this._init(void 0, -2);
          }
          util.inherits(PromiseArray, Proxyable);
          PromiseArray.prototype.length = function() {
            return this._length;
          };
          PromiseArray.prototype.promise = function() {
            return this._promise;
          };
          PromiseArray.prototype._init = function init2(_, resolveValueIfEmpty) {
            var values = tryConvertToPromise(this._values, this._promise);
            if (values instanceof Promise2) {
              values = values._target();
              var bitField = values._bitField;
              ;
              this._values = values;
              if ((bitField & 50397184) === 0) {
                this._promise._setAsyncGuaranteed();
                return values._then(
                  init2,
                  this._reject,
                  void 0,
                  this,
                  resolveValueIfEmpty
                );
              } else if ((bitField & 33554432) !== 0) {
                values = values._value();
              } else if ((bitField & 16777216) !== 0) {
                return this._reject(values._reason());
              } else {
                return this._cancel();
              }
            }
            values = util.asArray(values);
            if (values === null) {
              var err = apiRejection(
                "expecting an array or an iterable object but got " + util.classString(values)
              ).reason();
              this._promise._rejectCallback(err, false);
              return;
            }
            if (values.length === 0) {
              if (resolveValueIfEmpty === -5) {
                this._resolveEmptyArray();
              } else {
                this._resolve(toResolutionValue(resolveValueIfEmpty));
              }
              return;
            }
            this._iterate(values);
          };
          PromiseArray.prototype._iterate = function(values) {
            var len = this.getActualLength(values.length);
            this._length = len;
            this._values = this.shouldCopyValues() ? new Array(len) : this._values;
            var result = this._promise;
            var isResolved = false;
            var bitField = null;
            for (var i = 0; i < len; ++i) {
              var maybePromise = tryConvertToPromise(values[i], result);
              if (maybePromise instanceof Promise2) {
                maybePromise = maybePromise._target();
                bitField = maybePromise._bitField;
              } else {
                bitField = null;
              }
              if (isResolved) {
                if (bitField !== null) {
                  maybePromise.suppressUnhandledRejections();
                }
              } else if (bitField !== null) {
                if ((bitField & 50397184) === 0) {
                  maybePromise._proxy(this, i);
                  this._values[i] = maybePromise;
                } else if ((bitField & 33554432) !== 0) {
                  isResolved = this._promiseFulfilled(maybePromise._value(), i);
                } else if ((bitField & 16777216) !== 0) {
                  isResolved = this._promiseRejected(maybePromise._reason(), i);
                } else {
                  isResolved = this._promiseCancelled(i);
                }
              } else {
                isResolved = this._promiseFulfilled(maybePromise, i);
              }
            }
            if (!isResolved)
              result._setAsyncGuaranteed();
          };
          PromiseArray.prototype._isResolved = function() {
            return this._values === null;
          };
          PromiseArray.prototype._resolve = function(value) {
            this._values = null;
            this._promise._fulfill(value);
          };
          PromiseArray.prototype._cancel = function() {
            if (this._isResolved() || !this._promise._isCancellable())
              return;
            this._values = null;
            this._promise._cancel();
          };
          PromiseArray.prototype._reject = function(reason) {
            this._values = null;
            this._promise._rejectCallback(reason, false);
          };
          PromiseArray.prototype._promiseFulfilled = function(value, index) {
            this._values[index] = value;
            var totalResolved = ++this._totalResolved;
            if (totalResolved >= this._length) {
              this._resolve(this._values);
              return true;
            }
            return false;
          };
          PromiseArray.prototype._promiseCancelled = function() {
            this._cancel();
            return true;
          };
          PromiseArray.prototype._promiseRejected = function(reason) {
            this._totalResolved++;
            this._reject(reason);
            return true;
          };
          PromiseArray.prototype._resultCancelled = function() {
            if (this._isResolved())
              return;
            var values = this._values;
            this._cancel();
            if (values instanceof Promise2) {
              values.cancel();
            } else {
              for (var i = 0; i < values.length; ++i) {
                if (values[i] instanceof Promise2) {
                  values[i].cancel();
                }
              }
            }
          };
          PromiseArray.prototype.shouldCopyValues = function() {
            return true;
          };
          PromiseArray.prototype.getActualLength = function(len) {
            return len;
          };
          return PromiseArray;
        };
      }, { "./util": 36 }], 24: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL) {
          var THIS = {};
          var util = _dereq_2("./util");
          var nodebackForPromise = _dereq_2("./nodeback");
          var withAppended2 = util.withAppended;
          var maybeWrapAsError2 = util.maybeWrapAsError;
          var canEvaluate2 = util.canEvaluate;
          var TypeError2 = _dereq_2("./errors").TypeError;
          var defaultSuffix = "Async";
          var defaultPromisified = { __isPromisified__: true };
          var noCopyProps = [
            "arity",
            "length",
            "name",
            "arguments",
            "caller",
            "callee",
            "prototype",
            "__isPromisified__"
          ];
          var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");
          var defaultFilter = function(name) {
            return util.isIdentifier(name) && name.charAt(0) !== "_" && name !== "constructor";
          };
          function propsFilter(key) {
            return !noCopyPropsPattern.test(key);
          }
          function isPromisified(fn2) {
            try {
              return fn2.__isPromisified__ === true;
            } catch (e) {
              return false;
            }
          }
          function hasPromisified(obj2, key, suffix) {
            var val = util.getDataPropertyOrDefault(
              obj2,
              key + suffix,
              defaultPromisified
            );
            return val ? isPromisified(val) : false;
          }
          function checkValid(ret2, suffix, suffixRegexp) {
            for (var i = 0; i < ret2.length; i += 2) {
              var key = ret2[i];
              if (suffixRegexp.test(key)) {
                var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");
                for (var j = 0; j < ret2.length; j += 2) {
                  if (ret2[j] === keyWithoutAsyncSuffix) {
                    throw new TypeError2("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s", suffix));
                  }
                }
              }
            }
          }
          function promisifiableMethods(obj2, suffix, suffixRegexp, filter) {
            var keys = util.inheritedDataKeys(obj2);
            var ret2 = [];
            for (var i = 0; i < keys.length; ++i) {
              var key = keys[i];
              var value = obj2[key];
              var passesDefaultFilter = filter === defaultFilter ? true : defaultFilter(key, value, obj2);
              if (typeof value === "function" && !isPromisified(value) && !hasPromisified(obj2, key, suffix) && filter(key, value, obj2, passesDefaultFilter)) {
                ret2.push(key, value);
              }
            }
            checkValid(ret2, suffix, suffixRegexp);
            return ret2;
          }
          var escapeIdentRegex = function(str) {
            return str.replace(/([$])/, "\\$");
          };
          var makeNodePromisifiedEval;
          if (false) {
            var switchCaseArgumentOrder = function(likelyArgumentCount) {
              var ret2 = [likelyArgumentCount];
              var min2 = Math.max(0, likelyArgumentCount - 1 - 3);
              for (var i = likelyArgumentCount - 1; i >= min2; --i) {
                ret2.push(i);
              }
              for (var i = likelyArgumentCount + 1; i <= 3; ++i) {
                ret2.push(i);
              }
              return ret2;
            };
            var argumentSequence = function(argumentCount) {
              return util.filledRange(argumentCount, "_arg", "");
            };
            var parameterDeclaration = function(parameterCount2) {
              return util.filledRange(
                Math.max(parameterCount2, 3),
                "_arg",
                ""
              );
            };
            var parameterCount = function(fn2) {
              if (typeof fn2.length === "number") {
                return Math.max(Math.min(fn2.length, 1023 + 1), 0);
              }
              return 0;
            };
            makeNodePromisifiedEval = function(callback, receiver2, originalName, fn2, _, multiArgs) {
              var newParameterCount = Math.max(0, parameterCount(fn2) - 1);
              var argumentOrder = switchCaseArgumentOrder(newParameterCount);
              var shouldProxyThis = typeof callback === "string" || receiver2 === THIS;
              function generateCallForArgumentCount(count) {
                var args = argumentSequence(count).join(", ");
                var comma = count > 0 ? ", " : "";
                var ret2;
                if (shouldProxyThis) {
                  ret2 = "ret = callback.call(this, {{args}}, nodeback); break;\n";
                } else {
                  ret2 = receiver2 === void 0 ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n";
                }
                return ret2.replace("{{args}}", args).replace(", ", comma);
              }
              function generateArgumentSwitchCase() {
                var ret2 = "";
                for (var i = 0; i < argumentOrder.length; ++i) {
                  ret2 += "case " + argumentOrder[i] + ":" + generateCallForArgumentCount(argumentOrder[i]);
                }
                ret2 += "                                                             \n        default:                                                             \n            var args = new Array(len + 1);                                   \n            var i = 0;                                                       \n            for (var i = 0; i < len; ++i) {                                  \n               args[i] = arguments[i];                                       \n            }                                                                \n            args[i] = nodeback;                                              \n            [CodeForCall]                                                    \n            break;                                                           \n        ".replace("[CodeForCall]", shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n");
                return ret2;
              }
              var getFunctionCode = typeof callback === "string" ? "this != null ? this['" + callback + "'] : fn" : "fn";
              var body = "'use strict';                                                \n        var ret = function (Parameters) {                                    \n            'use strict';                                                    \n            var len = arguments.length;                                      \n            var promise = new Promise(INTERNAL);                             \n            promise._captureStackTrace();                                    \n            var nodeback = nodebackForPromise(promise, " + multiArgs + ");   \n            var ret;                                                         \n            var callback = tryCatch([GetFunctionCode]);                      \n            switch(len) {                                                    \n                [CodeForSwitchCase]                                          \n            }                                                                \n            if (ret === errorObj) {                                          \n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n            }                                                                \n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \n            return promise;                                                  \n        };                                                                   \n        notEnumerableProp(ret, '__isPromisified__', true);                   \n        return ret;                                                          \n    ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()).replace("[GetFunctionCode]", getFunctionCode);
              body = body.replace("Parameters", parameterDeclaration(newParameterCount));
              return new Function(
                "Promise",
                "fn",
                "receiver",
                "withAppended",
                "maybeWrapAsError",
                "nodebackForPromise",
                "tryCatch",
                "errorObj",
                "notEnumerableProp",
                "INTERNAL",
                body
              )(
                Promise2,
                fn2,
                receiver2,
                withAppended2,
                maybeWrapAsError2,
                nodebackForPromise,
                util.tryCatch,
                util.errorObj,
                util.notEnumerableProp,
                INTERNAL
              );
            };
          }
          function makeNodePromisifiedClosure(callback, receiver2, _, fn2, __, multiArgs) {
            var defaultThis = function() {
              return this;
            }();
            var method = callback;
            if (typeof method === "string") {
              callback = fn2;
            }
            function promisified() {
              var _receiver = receiver2;
              if (receiver2 === THIS)
                _receiver = this;
              var promise = new Promise2(INTERNAL);
              promise._captureStackTrace();
              var cb = typeof method === "string" && this !== defaultThis ? this[method] : callback;
              var fn3 = nodebackForPromise(promise, multiArgs);
              try {
                cb.apply(_receiver, withAppended2(arguments, fn3));
              } catch (e) {
                promise._rejectCallback(maybeWrapAsError2(e), true, true);
              }
              if (!promise._isFateSealed())
                promise._setAsyncGuaranteed();
              return promise;
            }
            util.notEnumerableProp(promisified, "__isPromisified__", true);
            return promisified;
          }
          var makeNodePromisified = canEvaluate2 ? makeNodePromisifiedEval : makeNodePromisifiedClosure;
          function promisifyAll(obj2, suffix, filter, promisifier, multiArgs) {
            var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");
            var methods = promisifiableMethods(obj2, suffix, suffixRegexp, filter);
            for (var i = 0, len = methods.length; i < len; i += 2) {
              var key = methods[i];
              var fn2 = methods[i + 1];
              var promisifiedKey = key + suffix;
              if (promisifier === makeNodePromisified) {
                obj2[promisifiedKey] = makeNodePromisified(key, THIS, key, fn2, suffix, multiArgs);
              } else {
                var promisified = promisifier(fn2, function() {
                  return makeNodePromisified(
                    key,
                    THIS,
                    key,
                    fn2,
                    suffix,
                    multiArgs
                  );
                });
                util.notEnumerableProp(promisified, "__isPromisified__", true);
                obj2[promisifiedKey] = promisified;
              }
            }
            util.toFastProperties(obj2);
            return obj2;
          }
          function promisify(callback, receiver2, multiArgs) {
            return makeNodePromisified(
              callback,
              receiver2,
              void 0,
              callback,
              null,
              multiArgs
            );
          }
          Promise2.promisify = function(fn2, options) {
            if (typeof fn2 !== "function") {
              throw new TypeError2("expecting a function but got " + util.classString(fn2));
            }
            if (isPromisified(fn2)) {
              return fn2;
            }
            options = Object(options);
            var receiver2 = options.context === void 0 ? THIS : options.context;
            var multiArgs = !!options.multiArgs;
            var ret2 = promisify(fn2, receiver2, multiArgs);
            util.copyDescriptors(fn2, ret2, propsFilter);
            return ret2;
          };
          Promise2.promisifyAll = function(target, options) {
            if (typeof target !== "function" && typeof target !== "object") {
              throw new TypeError2("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");
            }
            options = Object(options);
            var multiArgs = !!options.multiArgs;
            var suffix = options.suffix;
            if (typeof suffix !== "string")
              suffix = defaultSuffix;
            var filter = options.filter;
            if (typeof filter !== "function")
              filter = defaultFilter;
            var promisifier = options.promisifier;
            if (typeof promisifier !== "function")
              promisifier = makeNodePromisified;
            if (!util.isIdentifier(suffix)) {
              throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");
            }
            var keys = util.inheritedDataKeys(target);
            for (var i = 0; i < keys.length; ++i) {
              var value = target[keys[i]];
              if (keys[i] !== "constructor" && util.isClass(value)) {
                promisifyAll(
                  value.prototype,
                  suffix,
                  filter,
                  promisifier,
                  multiArgs
                );
                promisifyAll(value, suffix, filter, promisifier, multiArgs);
              }
            }
            return promisifyAll(target, suffix, filter, promisifier, multiArgs);
          };
        };
      }, { "./errors": 12, "./nodeback": 20, "./util": 36 }], 25: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, apiRejection) {
          var util = _dereq_2("./util");
          var isObject2 = util.isObject;
          var es52 = _dereq_2("./es5");
          var Es6Map;
          if (typeof Map === "function")
            Es6Map = Map;
          var mapToEntries = function() {
            var index = 0;
            var size = 0;
            function extractEntry(value, key) {
              this[index] = value;
              this[index + size] = key;
              index++;
            }
            return function mapToEntries2(map) {
              size = map.size;
              index = 0;
              var ret2 = new Array(map.size * 2);
              map.forEach(extractEntry, ret2);
              return ret2;
            };
          }();
          var entriesToMap = function(entries) {
            var ret2 = new Es6Map();
            var length = entries.length / 2 | 0;
            for (var i = 0; i < length; ++i) {
              var key = entries[length + i];
              var value = entries[i];
              ret2.set(key, value);
            }
            return ret2;
          };
          function PropertiesPromiseArray(obj2) {
            var isMap = false;
            var entries;
            if (Es6Map !== void 0 && obj2 instanceof Es6Map) {
              entries = mapToEntries(obj2);
              isMap = true;
            } else {
              var keys = es52.keys(obj2);
              var len = keys.length;
              entries = new Array(len * 2);
              for (var i = 0; i < len; ++i) {
                var key = keys[i];
                entries[i] = obj2[key];
                entries[i + len] = key;
              }
            }
            this.constructor$(entries);
            this._isMap = isMap;
            this._init$(void 0, isMap ? -6 : -3);
          }
          util.inherits(PropertiesPromiseArray, PromiseArray);
          PropertiesPromiseArray.prototype._init = function() {
          };
          PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index) {
            this._values[index] = value;
            var totalResolved = ++this._totalResolved;
            if (totalResolved >= this._length) {
              var val;
              if (this._isMap) {
                val = entriesToMap(this._values);
              } else {
                val = {};
                var keyOffset = this.length();
                for (var i = 0, len = this.length(); i < len; ++i) {
                  val[this._values[i + keyOffset]] = this._values[i];
                }
              }
              this._resolve(val);
              return true;
            }
            return false;
          };
          PropertiesPromiseArray.prototype.shouldCopyValues = function() {
            return false;
          };
          PropertiesPromiseArray.prototype.getActualLength = function(len) {
            return len >> 1;
          };
          function props(promises) {
            var ret2;
            var castValue = tryConvertToPromise(promises);
            if (!isObject2(castValue)) {
              return apiRejection("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n");
            } else if (castValue instanceof Promise2) {
              ret2 = castValue._then(
                Promise2.props,
                void 0,
                void 0,
                void 0,
                void 0
              );
            } else {
              ret2 = new PropertiesPromiseArray(castValue).promise();
            }
            if (castValue instanceof Promise2) {
              ret2._propagateFrom(castValue, 2);
            }
            return ret2;
          }
          Promise2.prototype.props = function() {
            return props(this);
          };
          Promise2.props = function(promises) {
            return props(promises);
          };
        };
      }, { "./es5": 13, "./util": 36 }], 26: [function(_dereq_2, module2, exports2) {
        "use strict";
        function arrayMove2(src, srcIndex, dst, dstIndex, len) {
          for (var j = 0; j < len; ++j) {
            dst[j + dstIndex] = src[j + srcIndex];
            src[j + srcIndex] = void 0;
          }
        }
        function Queue(capacity) {
          this._capacity = capacity;
          this._length = 0;
          this._front = 0;
        }
        Queue.prototype._willBeOverCapacity = function(size) {
          return this._capacity < size;
        };
        Queue.prototype._pushOne = function(arg) {
          var length = this.length();
          this._checkCapacity(length + 1);
          var i = this._front + length & this._capacity - 1;
          this[i] = arg;
          this._length = length + 1;
        };
        Queue.prototype.push = function(fn2, receiver2, arg) {
          var length = this.length() + 3;
          if (this._willBeOverCapacity(length)) {
            this._pushOne(fn2);
            this._pushOne(receiver2);
            this._pushOne(arg);
            return;
          }
          var j = this._front + length - 3;
          this._checkCapacity(length);
          var wrapMask = this._capacity - 1;
          this[j + 0 & wrapMask] = fn2;
          this[j + 1 & wrapMask] = receiver2;
          this[j + 2 & wrapMask] = arg;
          this._length = length;
        };
        Queue.prototype.shift = function() {
          var front = this._front, ret2 = this[front];
          this[front] = void 0;
          this._front = front + 1 & this._capacity - 1;
          this._length--;
          return ret2;
        };
        Queue.prototype.length = function() {
          return this._length;
        };
        Queue.prototype._checkCapacity = function(size) {
          if (this._capacity < size) {
            this._resizeTo(this._capacity << 1);
          }
        };
        Queue.prototype._resizeTo = function(capacity) {
          var oldCapacity = this._capacity;
          this._capacity = capacity;
          var front = this._front;
          var length = this._length;
          var moveItemsCount = front + length & oldCapacity - 1;
          arrayMove2(this, 0, this, oldCapacity, moveItemsCount);
        };
        module2.exports = Queue;
      }, {}], 27: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection) {
          var util = _dereq_2("./util");
          var raceLater = function(promise) {
            return promise.then(function(array) {
              return race(array, promise);
            });
          };
          function race(promises, parent) {
            var maybePromise = tryConvertToPromise(promises);
            if (maybePromise instanceof Promise2) {
              return raceLater(maybePromise);
            } else {
              promises = util.asArray(promises);
              if (promises === null)
                return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));
            }
            var ret2 = new Promise2(INTERNAL);
            if (parent !== void 0) {
              ret2._propagateFrom(parent, 3);
            }
            var fulfill = ret2._fulfill;
            var reject = ret2._reject;
            for (var i = 0, len = promises.length; i < len; ++i) {
              var val = promises[i];
              if (val === void 0 && !(i in promises)) {
                continue;
              }
              Promise2.cast(val)._then(fulfill, reject, void 0, ret2, null);
            }
            return ret2;
          }
          Promise2.race = function(promises) {
            return race(promises, void 0);
          };
          Promise2.prototype.race = function() {
            return race(this, void 0);
          };
        };
      }, { "./util": 36 }], 28: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) {
          var util = _dereq_2("./util");
          var tryCatch2 = util.tryCatch;
          function ReductionPromiseArray(promises, fn2, initialValue, _each) {
            this.constructor$(promises);
            var context = Promise2._getContext();
            this._fn = util.contextBind(context, fn2);
            if (initialValue !== void 0) {
              initialValue = Promise2.resolve(initialValue);
              initialValue._attachCancellationCallback(this);
            }
            this._initialValue = initialValue;
            this._currentCancellable = null;
            if (_each === INTERNAL) {
              this._eachValues = Array(this._length);
            } else if (_each === 0) {
              this._eachValues = null;
            } else {
              this._eachValues = void 0;
            }
            this._promise._captureStackTrace();
            this._init$(void 0, -5);
          }
          util.inherits(ReductionPromiseArray, PromiseArray);
          ReductionPromiseArray.prototype._gotAccum = function(accum) {
            if (this._eachValues !== void 0 && this._eachValues !== null && accum !== INTERNAL) {
              this._eachValues.push(accum);
            }
          };
          ReductionPromiseArray.prototype._eachComplete = function(value) {
            if (this._eachValues !== null) {
              this._eachValues.push(value);
            }
            return this._eachValues;
          };
          ReductionPromiseArray.prototype._init = function() {
          };
          ReductionPromiseArray.prototype._resolveEmptyArray = function() {
            this._resolve(this._eachValues !== void 0 ? this._eachValues : this._initialValue);
          };
          ReductionPromiseArray.prototype.shouldCopyValues = function() {
            return false;
          };
          ReductionPromiseArray.prototype._resolve = function(value) {
            this._promise._resolveCallback(value);
            this._values = null;
          };
          ReductionPromiseArray.prototype._resultCancelled = function(sender) {
            if (sender === this._initialValue)
              return this._cancel();
            if (this._isResolved())
              return;
            this._resultCancelled$();
            if (this._currentCancellable instanceof Promise2) {
              this._currentCancellable.cancel();
            }
            if (this._initialValue instanceof Promise2) {
              this._initialValue.cancel();
            }
          };
          ReductionPromiseArray.prototype._iterate = function(values) {
            this._values = values;
            var value;
            var i;
            var length = values.length;
            if (this._initialValue !== void 0) {
              value = this._initialValue;
              i = 0;
            } else {
              value = Promise2.resolve(values[0]);
              i = 1;
            }
            this._currentCancellable = value;
            for (var j = i; j < length; ++j) {
              var maybePromise = values[j];
              if (maybePromise instanceof Promise2) {
                maybePromise.suppressUnhandledRejections();
              }
            }
            if (!value.isRejected()) {
              for (; i < length; ++i) {
                var ctx = {
                  accum: null,
                  value: values[i],
                  index: i,
                  length,
                  array: this
                };
                value = value._then(gotAccum, void 0, void 0, ctx, void 0);
                if ((i & 127) === 0) {
                  value._setNoAsyncGuarantee();
                }
              }
            }
            if (this._eachValues !== void 0) {
              value = value._then(this._eachComplete, void 0, void 0, this, void 0);
            }
            value._then(completed, completed, void 0, value, this);
          };
          Promise2.prototype.reduce = function(fn2, initialValue) {
            return reduce(this, fn2, initialValue, null);
          };
          Promise2.reduce = function(promises, fn2, initialValue, _each) {
            return reduce(promises, fn2, initialValue, _each);
          };
          function completed(valueOrReason, array) {
            if (this.isFulfilled()) {
              array._resolve(valueOrReason);
            } else {
              array._reject(valueOrReason);
            }
          }
          function reduce(promises, fn2, initialValue, _each) {
            if (typeof fn2 !== "function") {
              return apiRejection("expecting a function but got " + util.classString(fn2));
            }
            var array = new ReductionPromiseArray(promises, fn2, initialValue, _each);
            return array.promise();
          }
          function gotAccum(accum) {
            this.accum = accum;
            this.array._gotAccum(accum);
            var value = tryConvertToPromise(this.value, this.array._promise);
            if (value instanceof Promise2) {
              this.array._currentCancellable = value;
              return value._then(gotValue, void 0, void 0, this, void 0);
            } else {
              return gotValue.call(this, value);
            }
          }
          function gotValue(value) {
            var array = this.array;
            var promise = array._promise;
            var fn2 = tryCatch2(array._fn);
            promise._pushContext();
            var ret2;
            if (array._eachValues !== void 0) {
              ret2 = fn2.call(promise._boundValue(), value, this.index, this.length);
            } else {
              ret2 = fn2.call(
                promise._boundValue(),
                this.accum,
                value,
                this.index,
                this.length
              );
            }
            if (ret2 instanceof Promise2) {
              array._currentCancellable = ret2;
            }
            var promiseCreated = promise._popContext();
            debug.checkForgottenReturns(
              ret2,
              promiseCreated,
              array._eachValues !== void 0 ? "Promise.each" : "Promise.reduce",
              promise
            );
            return ret2;
          }
        };
      }, { "./util": 36 }], 29: [function(_dereq_2, module2, exports2) {
        "use strict";
        var util = _dereq_2("./util");
        var schedule;
        var noAsyncScheduler = function() {
          throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");
        };
        var NativePromise = util.getNativePromise();
        if (util.isNode && typeof MutationObserver === "undefined") {
          var GlobalSetImmediate = global.setImmediate;
          var ProcessNextTick = process.nextTick;
          schedule = util.isRecentNode ? function(fn2) {
            GlobalSetImmediate.call(global, fn2);
          } : function(fn2) {
            ProcessNextTick.call(process, fn2);
          };
        } else if (typeof NativePromise === "function" && typeof NativePromise.resolve === "function") {
          var nativePromise = NativePromise.resolve();
          schedule = function(fn2) {
            nativePromise.then(fn2);
          };
        } else if (typeof MutationObserver !== "undefined" && !(typeof window !== "undefined" && window.navigator && (window.navigator.standalone || window.cordova)) && "classList" in document.documentElement) {
          schedule = function() {
            var div = document.createElement("div");
            var opts = { attributes: true };
            var toggleScheduled = false;
            var div2 = document.createElement("div");
            var o2 = new MutationObserver(function() {
              div.classList.toggle("foo");
              toggleScheduled = false;
            });
            o2.observe(div2, opts);
            var scheduleToggle = function() {
              if (toggleScheduled)
                return;
              toggleScheduled = true;
              div2.classList.toggle("foo");
            };
            return function schedule2(fn2) {
              var o = new MutationObserver(function() {
                o.disconnect();
                fn2();
              });
              o.observe(div, opts);
              scheduleToggle();
            };
          }();
        } else if (typeof setImmediate !== "undefined") {
          schedule = function(fn2) {
            setImmediate(fn2);
          };
        } else if (typeof setTimeout !== "undefined") {
          schedule = function(fn2) {
            setTimeout(fn2, 0);
          };
        } else {
          schedule = noAsyncScheduler;
        }
        module2.exports = schedule;
      }, { "./util": 36 }], 30: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, debug) {
          var PromiseInspection = Promise2.PromiseInspection;
          var util = _dereq_2("./util");
          function SettledPromiseArray(values) {
            this.constructor$(values);
          }
          util.inherits(SettledPromiseArray, PromiseArray);
          SettledPromiseArray.prototype._promiseResolved = function(index, inspection) {
            this._values[index] = inspection;
            var totalResolved = ++this._totalResolved;
            if (totalResolved >= this._length) {
              this._resolve(this._values);
              return true;
            }
            return false;
          };
          SettledPromiseArray.prototype._promiseFulfilled = function(value, index) {
            var ret2 = new PromiseInspection();
            ret2._bitField = 33554432;
            ret2._settledValueField = value;
            return this._promiseResolved(index, ret2);
          };
          SettledPromiseArray.prototype._promiseRejected = function(reason, index) {
            var ret2 = new PromiseInspection();
            ret2._bitField = 16777216;
            ret2._settledValueField = reason;
            return this._promiseResolved(index, ret2);
          };
          Promise2.settle = function(promises) {
            debug.deprecated(".settle()", ".reflect()");
            return new SettledPromiseArray(promises).promise();
          };
          Promise2.allSettled = function(promises) {
            return new SettledPromiseArray(promises).promise();
          };
          Promise2.prototype.settle = function() {
            return Promise2.settle(this);
          };
        };
      }, { "./util": 36 }], 31: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, PromiseArray, apiRejection) {
          var util = _dereq_2("./util");
          var RangeError2 = _dereq_2("./errors").RangeError;
          var AggregateError2 = _dereq_2("./errors").AggregateError;
          var isArray = util.isArray;
          var CANCELLATION = {};
          function SomePromiseArray(values) {
            this.constructor$(values);
            this._howMany = 0;
            this._unwrap = false;
            this._initialized = false;
          }
          util.inherits(SomePromiseArray, PromiseArray);
          SomePromiseArray.prototype._init = function() {
            if (!this._initialized) {
              return;
            }
            if (this._howMany === 0) {
              this._resolve([]);
              return;
            }
            this._init$(void 0, -5);
            var isArrayResolved = isArray(this._values);
            if (!this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill()) {
              this._reject(this._getRangeError(this.length()));
            }
          };
          SomePromiseArray.prototype.init = function() {
            this._initialized = true;
            this._init();
          };
          SomePromiseArray.prototype.setUnwrap = function() {
            this._unwrap = true;
          };
          SomePromiseArray.prototype.howMany = function() {
            return this._howMany;
          };
          SomePromiseArray.prototype.setHowMany = function(count) {
            this._howMany = count;
          };
          SomePromiseArray.prototype._promiseFulfilled = function(value) {
            this._addFulfilled(value);
            if (this._fulfilled() === this.howMany()) {
              this._values.length = this.howMany();
              if (this.howMany() === 1 && this._unwrap) {
                this._resolve(this._values[0]);
              } else {
                this._resolve(this._values);
              }
              return true;
            }
            return false;
          };
          SomePromiseArray.prototype._promiseRejected = function(reason) {
            this._addRejected(reason);
            return this._checkOutcome();
          };
          SomePromiseArray.prototype._promiseCancelled = function() {
            if (this._values instanceof Promise2 || this._values == null) {
              return this._cancel();
            }
            this._addRejected(CANCELLATION);
            return this._checkOutcome();
          };
          SomePromiseArray.prototype._checkOutcome = function() {
            if (this.howMany() > this._canPossiblyFulfill()) {
              var e = new AggregateError2();
              for (var i = this.length(); i < this._values.length; ++i) {
                if (this._values[i] !== CANCELLATION) {
                  e.push(this._values[i]);
                }
              }
              if (e.length > 0) {
                this._reject(e);
              } else {
                this._cancel();
              }
              return true;
            }
            return false;
          };
          SomePromiseArray.prototype._fulfilled = function() {
            return this._totalResolved;
          };
          SomePromiseArray.prototype._rejected = function() {
            return this._values.length - this.length();
          };
          SomePromiseArray.prototype._addRejected = function(reason) {
            this._values.push(reason);
          };
          SomePromiseArray.prototype._addFulfilled = function(value) {
            this._values[this._totalResolved++] = value;
          };
          SomePromiseArray.prototype._canPossiblyFulfill = function() {
            return this.length() - this._rejected();
          };
          SomePromiseArray.prototype._getRangeError = function(count) {
            var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items";
            return new RangeError2(message);
          };
          SomePromiseArray.prototype._resolveEmptyArray = function() {
            this._reject(this._getRangeError(0));
          };
          function some(promises, howMany) {
            if ((howMany | 0) !== howMany || howMany < 0) {
              return apiRejection("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");
            }
            var ret2 = new SomePromiseArray(promises);
            var promise = ret2.promise();
            ret2.setHowMany(howMany);
            ret2.init();
            return promise;
          }
          Promise2.some = function(promises, howMany) {
            return some(promises, howMany);
          };
          Promise2.prototype.some = function(howMany) {
            return some(this, howMany);
          };
          Promise2._SomePromiseArray = SomePromiseArray;
        };
      }, { "./errors": 12, "./util": 36 }], 32: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2) {
          function PromiseInspection(promise) {
            if (promise !== void 0) {
              promise = promise._target();
              this._bitField = promise._bitField;
              this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0;
            } else {
              this._bitField = 0;
              this._settledValueField = void 0;
            }
          }
          PromiseInspection.prototype._settledValue = function() {
            return this._settledValueField;
          };
          var value = PromiseInspection.prototype.value = function() {
            if (!this.isFulfilled()) {
              throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");
            }
            return this._settledValue();
          };
          var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() {
            if (!this.isRejected()) {
              throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");
            }
            return this._settledValue();
          };
          var isFulfilled = PromiseInspection.prototype.isFulfilled = function() {
            return (this._bitField & 33554432) !== 0;
          };
          var isRejected = PromiseInspection.prototype.isRejected = function() {
            return (this._bitField & 16777216) !== 0;
          };
          var isPending = PromiseInspection.prototype.isPending = function() {
            return (this._bitField & 50397184) === 0;
          };
          var isResolved = PromiseInspection.prototype.isResolved = function() {
            return (this._bitField & 50331648) !== 0;
          };
          PromiseInspection.prototype.isCancelled = function() {
            return (this._bitField & 8454144) !== 0;
          };
          Promise2.prototype.__isCancelled = function() {
            return (this._bitField & 65536) === 65536;
          };
          Promise2.prototype._isCancelled = function() {
            return this._target().__isCancelled();
          };
          Promise2.prototype.isCancelled = function() {
            return (this._target()._bitField & 8454144) !== 0;
          };
          Promise2.prototype.isPending = function() {
            return isPending.call(this._target());
          };
          Promise2.prototype.isRejected = function() {
            return isRejected.call(this._target());
          };
          Promise2.prototype.isFulfilled = function() {
            return isFulfilled.call(this._target());
          };
          Promise2.prototype.isResolved = function() {
            return isResolved.call(this._target());
          };
          Promise2.prototype.value = function() {
            return value.call(this._target());
          };
          Promise2.prototype.reason = function() {
            var target = this._target();
            target._unsetRejectionIsUnhandled();
            return reason.call(target);
          };
          Promise2.prototype._value = function() {
            return this._settledValue();
          };
          Promise2.prototype._reason = function() {
            this._unsetRejectionIsUnhandled();
            return this._settledValue();
          };
          Promise2.PromiseInspection = PromiseInspection;
        };
      }, {}], 33: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL) {
          var util = _dereq_2("./util");
          var errorObj2 = util.errorObj;
          var isObject2 = util.isObject;
          function tryConvertToPromise(obj2, context) {
            if (isObject2(obj2)) {
              if (obj2 instanceof Promise2)
                return obj2;
              var then = getThen(obj2);
              if (then === errorObj2) {
                if (context)
                  context._pushContext();
                var ret2 = Promise2.reject(then.e);
                if (context)
                  context._popContext();
                return ret2;
              } else if (typeof then === "function") {
                if (isAnyBluebirdPromise(obj2)) {
                  var ret2 = new Promise2(INTERNAL);
                  obj2._then(
                    ret2._fulfill,
                    ret2._reject,
                    void 0,
                    ret2,
                    null
                  );
                  return ret2;
                }
                return doThenable(obj2, then, context);
              }
            }
            return obj2;
          }
          function doGetThen(obj2) {
            return obj2.then;
          }
          function getThen(obj2) {
            try {
              return doGetThen(obj2);
            } catch (e) {
              errorObj2.e = e;
              return errorObj2;
            }
          }
          var hasProp = {}.hasOwnProperty;
          function isAnyBluebirdPromise(obj2) {
            try {
              return hasProp.call(obj2, "_promise0");
            } catch (e) {
              return false;
            }
          }
          function doThenable(x, then, context) {
            var promise = new Promise2(INTERNAL);
            var ret2 = promise;
            if (context)
              context._pushContext();
            promise._captureStackTrace();
            if (context)
              context._popContext();
            var synchronous = true;
            var result = util.tryCatch(then).call(x, resolve, reject);
            synchronous = false;
            if (promise && result === errorObj2) {
              promise._rejectCallback(result.e, true, true);
              promise = null;
            }
            function resolve(value) {
              if (!promise)
                return;
              promise._resolveCallback(value);
              promise = null;
            }
            function reject(reason) {
              if (!promise)
                return;
              promise._rejectCallback(reason, synchronous, true);
              promise = null;
            }
            return ret2;
          }
          return tryConvertToPromise;
        };
      }, { "./util": 36 }], 34: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, INTERNAL, debug) {
          var util = _dereq_2("./util");
          var TimeoutError = Promise2.TimeoutError;
          function HandleWrapper(handle) {
            this.handle = handle;
          }
          HandleWrapper.prototype._resultCancelled = function() {
            clearTimeout(this.handle);
          };
          var afterValue = function(value) {
            return delay(+this).thenReturn(value);
          };
          var delay = Promise2.delay = function(ms, value) {
            var ret2;
            var handle;
            if (value !== void 0) {
              ret2 = Promise2.resolve(value)._then(afterValue, null, null, ms, void 0);
              if (debug.cancellation() && value instanceof Promise2) {
                ret2._setOnCancel(value);
              }
            } else {
              ret2 = new Promise2(INTERNAL);
              handle = setTimeout(function() {
                ret2._fulfill();
              }, +ms);
              if (debug.cancellation()) {
                ret2._setOnCancel(new HandleWrapper(handle));
              }
              ret2._captureStackTrace();
            }
            ret2._setAsyncGuaranteed();
            return ret2;
          };
          Promise2.prototype.delay = function(ms) {
            return delay(ms, this);
          };
          var afterTimeout = function(promise, message, parent) {
            var err;
            if (typeof message !== "string") {
              if (message instanceof Error) {
                err = message;
              } else {
                err = new TimeoutError("operation timed out");
              }
            } else {
              err = new TimeoutError(message);
            }
            util.markAsOriginatingFromRejection(err);
            promise._attachExtraTrace(err);
            promise._reject(err);
            if (parent != null) {
              parent.cancel();
            }
          };
          function successClear(value) {
            clearTimeout(this.handle);
            return value;
          }
          function failureClear(reason) {
            clearTimeout(this.handle);
            throw reason;
          }
          Promise2.prototype.timeout = function(ms, message) {
            ms = +ms;
            var ret2, parent;
            var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {
              if (ret2.isPending()) {
                afterTimeout(ret2, message, parent);
              }
            }, ms));
            if (debug.cancellation()) {
              parent = this.then();
              ret2 = parent._then(
                successClear,
                failureClear,
                void 0,
                handleWrapper,
                void 0
              );
              ret2._setOnCancel(handleWrapper);
            } else {
              ret2 = this._then(
                successClear,
                failureClear,
                void 0,
                handleWrapper,
                void 0
              );
            }
            return ret2;
          };
        };
      }, { "./util": 36 }], 35: [function(_dereq_2, module2, exports2) {
        "use strict";
        module2.exports = function(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) {
          var util = _dereq_2("./util");
          var TypeError2 = _dereq_2("./errors").TypeError;
          var inherits2 = _dereq_2("./util").inherits;
          var errorObj2 = util.errorObj;
          var tryCatch2 = util.tryCatch;
          var NULL = {};
          function thrower2(e) {
            setTimeout(function() {
              throw e;
            }, 0);
          }
          function castPreservingDisposable(thenable) {
            var maybePromise = tryConvertToPromise(thenable);
            if (maybePromise !== thenable && typeof thenable._isDisposable === "function" && typeof thenable._getDisposer === "function" && thenable._isDisposable()) {
              maybePromise._setDisposable(thenable._getDisposer());
            }
            return maybePromise;
          }
          function dispose(resources, inspection) {
            var i = 0;
            var len = resources.length;
            var ret2 = new Promise2(INTERNAL);
            function iterator() {
              if (i >= len)
                return ret2._fulfill();
              var maybePromise = castPreservingDisposable(resources[i++]);
              if (maybePromise instanceof Promise2 && maybePromise._isDisposable()) {
                try {
                  maybePromise = tryConvertToPromise(
                    maybePromise._getDisposer().tryDispose(inspection),
                    resources.promise
                  );
                } catch (e) {
                  return thrower2(e);
                }
                if (maybePromise instanceof Promise2) {
                  return maybePromise._then(
                    iterator,
                    thrower2,
                    null,
                    null,
                    null
                  );
                }
              }
              iterator();
            }
            iterator();
            return ret2;
          }
          function Disposer(data, promise, context) {
            this._data = data;
            this._promise = promise;
            this._context = context;
          }
          Disposer.prototype.data = function() {
            return this._data;
          };
          Disposer.prototype.promise = function() {
            return this._promise;
          };
          Disposer.prototype.resource = function() {
            if (this.promise().isFulfilled()) {
              return this.promise().value();
            }
            return NULL;
          };
          Disposer.prototype.tryDispose = function(inspection) {
            var resource = this.resource();
            var context = this._context;
            if (context !== void 0)
              context._pushContext();
            var ret2 = resource !== NULL ? this.doDispose(resource, inspection) : null;
            if (context !== void 0)
              context._popContext();
            this._promise._unsetDisposable();
            this._data = null;
            return ret2;
          };
          Disposer.isDisposer = function(d) {
            return d != null && typeof d.resource === "function" && typeof d.tryDispose === "function";
          };
          function FunctionDisposer(fn2, promise, context) {
            this.constructor$(fn2, promise, context);
          }
          inherits2(FunctionDisposer, Disposer);
          FunctionDisposer.prototype.doDispose = function(resource, inspection) {
            var fn2 = this.data();
            return fn2.call(resource, resource, inspection);
          };
          function maybeUnwrapDisposer(value) {
            if (Disposer.isDisposer(value)) {
              this.resources[this.index]._setDisposable(value);
              return value.promise();
            }
            return value;
          }
          function ResourceList(length) {
            this.length = length;
            this.promise = null;
            this[length - 1] = null;
          }
          ResourceList.prototype._resultCancelled = function() {
            var len = this.length;
            for (var i = 0; i < len; ++i) {
              var item = this[i];
              if (item instanceof Promise2) {
                item.cancel();
              }
            }
          };
          Promise2.using = function() {
            var len = arguments.length;
            if (len < 2)
              return apiRejection(
                "you must pass at least 2 arguments to Promise.using"
              );
            var fn2 = arguments[len - 1];
            if (typeof fn2 !== "function") {
              return apiRejection("expecting a function but got " + util.classString(fn2));
            }
            var input;
            var spreadArgs = true;
            if (len === 2 && Array.isArray(arguments[0])) {
              input = arguments[0];
              len = input.length;
              spreadArgs = false;
            } else {
              input = arguments;
              len--;
            }
            var resources = new ResourceList(len);
            for (var i = 0; i < len; ++i) {
              var resource = input[i];
              if (Disposer.isDisposer(resource)) {
                var disposer = resource;
                resource = resource.promise();
                resource._setDisposable(disposer);
              } else {
                var maybePromise = tryConvertToPromise(resource);
                if (maybePromise instanceof Promise2) {
                  resource = maybePromise._then(maybeUnwrapDisposer, null, null, {
                    resources,
                    index: i
                  }, void 0);
                }
              }
              resources[i] = resource;
            }
            var reflectedResources = new Array(resources.length);
            for (var i = 0; i < reflectedResources.length; ++i) {
              reflectedResources[i] = Promise2.resolve(resources[i]).reflect();
            }
            var resultPromise = Promise2.all(reflectedResources).then(function(inspections) {
              for (var i2 = 0; i2 < inspections.length; ++i2) {
                var inspection = inspections[i2];
                if (inspection.isRejected()) {
                  errorObj2.e = inspection.error();
                  return errorObj2;
                } else if (!inspection.isFulfilled()) {
                  resultPromise.cancel();
                  return;
                }
                inspections[i2] = inspection.value();
              }
              promise._pushContext();
              fn2 = tryCatch2(fn2);
              var ret2 = spreadArgs ? fn2.apply(void 0, inspections) : fn2(inspections);
              var promiseCreated = promise._popContext();
              debug.checkForgottenReturns(
                ret2,
                promiseCreated,
                "Promise.using",
                promise
              );
              return ret2;
            });
            var promise = resultPromise.lastly(function() {
              var inspection = new Promise2.PromiseInspection(resultPromise);
              return dispose(resources, inspection);
            });
            resources.promise = promise;
            promise._setOnCancel(resources);
            return promise;
          };
          Promise2.prototype._setDisposable = function(disposer) {
            this._bitField = this._bitField | 131072;
            this._disposer = disposer;
          };
          Promise2.prototype._isDisposable = function() {
            return (this._bitField & 131072) > 0;
          };
          Promise2.prototype._getDisposer = function() {
            return this._disposer;
          };
          Promise2.prototype._unsetDisposable = function() {
            this._bitField = this._bitField & ~131072;
            this._disposer = void 0;
          };
          Promise2.prototype.disposer = function(fn2) {
            if (typeof fn2 === "function") {
              return new FunctionDisposer(fn2, this, createContext());
            }
            throw new TypeError2();
          };
        };
      }, { "./errors": 12, "./util": 36 }], 36: [function(_dereq_, module, exports) {
        "use strict";
        var es5 = _dereq_("./es5");
        var canEvaluate = typeof navigator == "undefined";
        var errorObj = { e: {} };
        var tryCatchTarget;
        var globalObject = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : this !== void 0 ? this : null;
        function tryCatcher() {
          try {
            var target = tryCatchTarget;
            tryCatchTarget = null;
            return target.apply(this, arguments);
          } catch (e) {
            errorObj.e = e;
            return errorObj;
          }
        }
        function tryCatch(fn2) {
          tryCatchTarget = fn2;
          return tryCatcher;
        }
        var inherits = function(Child, Parent) {
          var hasProp = {}.hasOwnProperty;
          function T() {
            this.constructor = Child;
            this.constructor$ = Parent;
            for (var propertyName in Parent.prototype) {
              if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length - 1) !== "$") {
                this[propertyName + "$"] = Parent.prototype[propertyName];
              }
            }
          }
          T.prototype = Parent.prototype;
          Child.prototype = new T();
          return Child.prototype;
        };
        function isPrimitive(val) {
          return val == null || val === true || val === false || typeof val === "string" || typeof val === "number";
        }
        function isObject(value) {
          return typeof value === "function" || typeof value === "object" && value !== null;
        }
        function maybeWrapAsError(maybeError) {
          if (!isPrimitive(maybeError))
            return maybeError;
          return new Error(safeToString(maybeError));
        }
        function withAppended(target, appendee) {
          var len = target.length;
          var ret2 = new Array(len + 1);
          var i;
          for (i = 0; i < len; ++i) {
            ret2[i] = target[i];
          }
          ret2[i] = appendee;
          return ret2;
        }
        function getDataPropertyOrDefault(obj2, key, defaultValue) {
          if (es5.isES5) {
            var desc = Object.getOwnPropertyDescriptor(obj2, key);
            if (desc != null) {
              return desc.get == null && desc.set == null ? desc.value : defaultValue;
            }
          } else {
            return {}.hasOwnProperty.call(obj2, key) ? obj2[key] : void 0;
          }
        }
        function notEnumerableProp(obj2, name, value) {
          if (isPrimitive(obj2))
            return obj2;
          var descriptor = {
            value,
            configurable: true,
            enumerable: false,
            writable: true
          };
          es5.defineProperty(obj2, name, descriptor);
          return obj2;
        }
        function thrower(r) {
          throw r;
        }
        var inheritedDataKeys = function() {
          var excludedPrototypes = [
            Array.prototype,
            Object.prototype,
            Function.prototype
          ];
          var isExcludedProto = function(val) {
            for (var i = 0; i < excludedPrototypes.length; ++i) {
              if (excludedPrototypes[i] === val) {
                return true;
              }
            }
            return false;
          };
          if (es5.isES5) {
            var getKeys = Object.getOwnPropertyNames;
            return function(obj2) {
              var ret2 = [];
              var visitedKeys = /* @__PURE__ */ Object.create(null);
              while (obj2 != null && !isExcludedProto(obj2)) {
                var keys;
                try {
                  keys = getKeys(obj2);
                } catch (e) {
                  return ret2;
                }
                for (var i = 0; i < keys.length; ++i) {
                  var key = keys[i];
                  if (visitedKeys[key])
                    continue;
                  visitedKeys[key] = true;
                  var desc = Object.getOwnPropertyDescriptor(obj2, key);
                  if (desc != null && desc.get == null && desc.set == null) {
                    ret2.push(key);
                  }
                }
                obj2 = es5.getPrototypeOf(obj2);
              }
              return ret2;
            };
          } else {
            var hasProp = {}.hasOwnProperty;
            return function(obj2) {
              if (isExcludedProto(obj2))
                return [];
              var ret2 = [];
              enumeration:
                for (var key in obj2) {
                  if (hasProp.call(obj2, key)) {
                    ret2.push(key);
                  } else {
                    for (var i = 0; i < excludedPrototypes.length; ++i) {
                      if (hasProp.call(excludedPrototypes[i], key)) {
                        continue enumeration;
                      }
                    }
                    ret2.push(key);
                  }
                }
              return ret2;
            };
          }
        }();
        var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
        function isClass(fn2) {
          try {
            if (typeof fn2 === "function") {
              var keys = es5.names(fn2.prototype);
              var hasMethods = es5.isES5 && keys.length > 1;
              var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor");
              var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn2 + "") && es5.names(fn2).length > 0;
              if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) {
                return true;
              }
            }
            return false;
          } catch (e) {
            return false;
          }
        }
        function toFastProperties(obj) {
          function FakeConstructor() {
          }
          FakeConstructor.prototype = obj;
          var receiver = new FakeConstructor();
          function ic() {
            return typeof receiver.foo;
          }
          ic();
          ic();
          return obj;
          eval(obj);
        }
        var rident = /^[a-z$_][a-z$_0-9]*$/i;
        function isIdentifier(str) {
          return rident.test(str);
        }
        function filledRange(count, prefix, suffix) {
          var ret2 = new Array(count);
          for (var i = 0; i < count; ++i) {
            ret2[i] = prefix + i + suffix;
          }
          return ret2;
        }
        function safeToString(obj2) {
          try {
            return obj2 + "";
          } catch (e) {
            return "[no string representation]";
          }
        }
        function isError(obj2) {
          return obj2 instanceof Error || obj2 !== null && typeof obj2 === "object" && typeof obj2.message === "string" && typeof obj2.name === "string";
        }
        function markAsOriginatingFromRejection(e) {
          try {
            notEnumerableProp(e, "isOperational", true);
          } catch (ignore) {
          }
        }
        function originatesFromRejection(e) {
          if (e == null)
            return false;
          return e instanceof Error["__BluebirdErrorTypes__"].OperationalError || e["isOperational"] === true;
        }
        function canAttachTrace(obj2) {
          return isError(obj2) && es5.propertyIsWritable(obj2, "stack");
        }
        var ensureErrorObject = function() {
          if (!("stack" in new Error())) {
            return function(value) {
              if (canAttachTrace(value))
                return value;
              try {
                throw new Error(safeToString(value));
              } catch (err) {
                return err;
              }
            };
          } else {
            return function(value) {
              if (canAttachTrace(value))
                return value;
              return new Error(safeToString(value));
            };
          }
        }();
        function classString(obj2) {
          return {}.toString.call(obj2);
        }
        function copyDescriptors(from, to, filter) {
          var keys = es5.names(from);
          for (var i = 0; i < keys.length; ++i) {
            var key = keys[i];
            if (filter(key)) {
              try {
                es5.defineProperty(to, key, es5.getDescriptor(from, key));
              } catch (ignore) {
              }
            }
          }
        }
        var asArray = function(v) {
          if (es5.isArray(v)) {
            return v;
          }
          return null;
        };
        if (typeof Symbol !== "undefined" && Symbol.iterator) {
          var ArrayFrom = typeof Array.from === "function" ? function(v) {
            return Array.from(v);
          } : function(v) {
            var ret2 = [];
            var it = v[Symbol.iterator]();
            var itResult;
            while (!(itResult = it.next()).done) {
              ret2.push(itResult.value);
            }
            return ret2;
          };
          asArray = function(v) {
            if (es5.isArray(v)) {
              return v;
            } else if (v != null && typeof v[Symbol.iterator] === "function") {
              return ArrayFrom(v);
            }
            return null;
          };
        }
        var isNode = typeof process !== "undefined" && classString(process).toLowerCase() === "[object process]";
        var hasEnvVariables = typeof process !== "undefined" && typeof process.env !== "undefined";
        function env(key) {
          return hasEnvVariables ? process.env[key] : void 0;
        }
        function getNativePromise() {
          if (typeof Promise === "function") {
            try {
              var promise = new Promise(function() {
              });
              if (classString(promise) === "[object Promise]") {
                return Promise;
              }
            } catch (e) {
            }
          }
        }
        var reflectHandler;
        function contextBind(ctx, cb) {
          if (ctx === null || typeof cb !== "function" || cb === reflectHandler) {
            return cb;
          }
          if (ctx.domain !== null) {
            cb = ctx.domain.bind(cb);
          }
          var async = ctx.async;
          if (async !== null) {
            var old = cb;
            cb = function() {
              var args = new Array(2).concat([].slice.call(arguments));
              ;
              args[0] = old;
              args[1] = this;
              return async.runInAsyncScope.apply(async, args);
            };
          }
          return cb;
        }
        var ret = {
          setReflectHandler: function(fn2) {
            reflectHandler = fn2;
          },
          isClass,
          isIdentifier,
          inheritedDataKeys,
          getDataPropertyOrDefault,
          thrower,
          isArray: es5.isArray,
          asArray,
          notEnumerableProp,
          isPrimitive,
          isObject,
          isError,
          canEvaluate,
          errorObj,
          tryCatch,
          inherits,
          withAppended,
          maybeWrapAsError,
          toFastProperties,
          filledRange,
          toString: safeToString,
          canAttachTrace,
          ensureErrorObject,
          originatesFromRejection,
          markAsOriginatingFromRejection,
          classString,
          copyDescriptors,
          isNode,
          hasEnvVariables,
          env,
          global: globalObject,
          getNativePromise,
          contextBind
        };
        ret.isRecentNode = ret.isNode && function() {
          var version2;
          if (process.versions && process.versions.node) {
            version2 = process.versions.node.split(".").map(Number);
          } else if (process.version) {
            version2 = process.version.split(".").map(Number);
          }
          return version2[0] === 0 && version2[1] > 10 || version2[0] > 0;
        }();
        ret.nodeSupportsAsyncResource = ret.isNode && function() {
          var supportsAsync = false;
          try {
            var res = _dereq_("async_hooks").AsyncResource;
            supportsAsync = typeof res.prototype.runInAsyncScope === "function";
          } catch (e) {
            supportsAsync = false;
          }
          return supportsAsync;
        }();
        if (ret.isNode)
          ret.toFastProperties(process);
        try {
          throw new Error();
        } catch (e) {
          ret.lastLineError = e;
        }
        module.exports = ret;
      }, { "./es5": 13, "async_hooks": void 0 }] }, {}, [4])(4);
    });
    if (typeof window !== "undefined" && window !== null) {
      window.P = window.Promise;
    } else if (typeof self !== "undefined" && self !== null) {
      self.P = self.Promise;
    }
  }
});

// node_modules/request-promise-core/lib/errors.js
var require_errors4 = __commonJS({
  "node_modules/request-promise-core/lib/errors.js"(exports2, module2) {
    "use strict";
    function RequestError(cause, options, response) {
      this.name = "RequestError";
      this.message = String(cause);
      this.cause = cause;
      this.error = cause;
      this.options = options;
      this.response = response;
      if (Error.captureStackTrace) {
        Error.captureStackTrace(this);
      }
    }
    RequestError.prototype = Object.create(Error.prototype);
    RequestError.prototype.constructor = RequestError;
    function StatusCodeError(statusCode, body, options, response) {
      this.name = "StatusCodeError";
      this.statusCode = statusCode;
      this.message = statusCode + " - " + (JSON && JSON.stringify ? JSON.stringify(body) : body);
      this.error = body;
      this.options = options;
      this.response = response;
      if (Error.captureStackTrace) {
        Error.captureStackTrace(this);
      }
    }
    StatusCodeError.prototype = Object.create(Error.prototype);
    StatusCodeError.prototype.constructor = StatusCodeError;
    function TransformError(cause, options, response) {
      this.name = "TransformError";
      this.message = String(cause);
      this.cause = cause;
      this.error = cause;
      this.options = options;
      this.response = response;
      if (Error.captureStackTrace) {
        Error.captureStackTrace(this);
      }
    }
    TransformError.prototype = Object.create(Error.prototype);
    TransformError.prototype.constructor = TransformError;
    module2.exports = {
      RequestError,
      StatusCodeError,
      TransformError
    };
  }
});

// node_modules/lodash/_freeGlobal.js
var require_freeGlobal = __commonJS({
  "node_modules/lodash/_freeGlobal.js"(exports2, module2) {
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    module2.exports = freeGlobal;
  }
});

// node_modules/lodash/_root.js
var require_root = __commonJS({
  "node_modules/lodash/_root.js"(exports2, module2) {
    var freeGlobal = require_freeGlobal();
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root = freeGlobal || freeSelf || Function("return this")();
    module2.exports = root;
  }
});

// node_modules/lodash/_Symbol.js
var require_Symbol = __commonJS({
  "node_modules/lodash/_Symbol.js"(exports2, module2) {
    var root = require_root();
    var Symbol2 = root.Symbol;
    module2.exports = Symbol2;
  }
});

// node_modules/lodash/_getRawTag.js
var require_getRawTag = __commonJS({
  "node_modules/lodash/_getRawTag.js"(exports2, module2) {
    var Symbol2 = require_Symbol();
    var objectProto = Object.prototype;
    var hasOwnProperty = objectProto.hasOwnProperty;
    var nativeObjectToString = objectProto.toString;
    var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
      try {
        value[symToStringTag] = void 0;
        var unmasked = true;
      } catch (e) {
      }
      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }
    module2.exports = getRawTag;
  }
});

// node_modules/lodash/_objectToString.js
var require_objectToString = __commonJS({
  "node_modules/lodash/_objectToString.js"(exports2, module2) {
    var objectProto = Object.prototype;
    var nativeObjectToString = objectProto.toString;
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }
    module2.exports = objectToString;
  }
});

// node_modules/lodash/_baseGetTag.js
var require_baseGetTag = __commonJS({
  "node_modules/lodash/_baseGetTag.js"(exports2, module2) {
    var Symbol2 = require_Symbol();
    var getRawTag = require_getRawTag();
    var objectToString = require_objectToString();
    var nullTag = "[object Null]";
    var undefinedTag = "[object Undefined]";
    var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
    function baseGetTag(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag : nullTag;
      }
      return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
    }
    module2.exports = baseGetTag;
  }
});

// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
  "node_modules/lodash/isObject.js"(exports2, module2) {
    function isObject2(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    module2.exports = isObject2;
  }
});

// node_modules/lodash/isFunction.js
var require_isFunction = __commonJS({
  "node_modules/lodash/isFunction.js"(exports2, module2) {
    var baseGetTag = require_baseGetTag();
    var isObject2 = require_isObject();
    var asyncTag = "[object AsyncFunction]";
    var funcTag = "[object Function]";
    var genTag = "[object GeneratorFunction]";
    var proxyTag = "[object Proxy]";
    function isFunction(value) {
      if (!isObject2(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }
    module2.exports = isFunction;
  }
});

// node_modules/lodash/isObjectLike.js
var require_isObjectLike = __commonJS({
  "node_modules/lodash/isObjectLike.js"(exports2, module2) {
    function isObjectLike(value) {
      return value != null && typeof value == "object";
    }
    module2.exports = isObjectLike;
  }
});

// node_modules/lodash/isArray.js
var require_isArray = __commonJS({
  "node_modules/lodash/isArray.js"(exports2, module2) {
    var isArray = Array.isArray;
    module2.exports = isArray;
  }
});

// node_modules/lodash/isString.js
var require_isString = __commonJS({
  "node_modules/lodash/isString.js"(exports2, module2) {
    var baseGetTag = require_baseGetTag();
    var isArray = require_isArray();
    var isObjectLike = require_isObjectLike();
    var stringTag = "[object String]";
    function isString(value) {
      return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
    }
    module2.exports = isString;
  }
});

// node_modules/lodash/isUndefined.js
var require_isUndefined = __commonJS({
  "node_modules/lodash/isUndefined.js"(exports2, module2) {
    function isUndefined(value) {
      return value === void 0;
    }
    module2.exports = isUndefined;
  }
});

// node_modules/request-promise-core/lib/plumbing.js
var require_plumbing = __commonJS({
  "node_modules/request-promise-core/lib/plumbing.js"(exports2, module2) {
    "use strict";
    var errors = require_errors4();
    var isFunction = require_isFunction();
    var isObjectLike = require_isObjectLike();
    var isString = require_isString();
    var isUndefined = require_isUndefined();
    module2.exports = function(options) {
      var errorText = "Please verify options";
      if (!isObjectLike(options)) {
        throw new TypeError(errorText);
      }
      if (!isFunction(options.PromiseImpl)) {
        throw new TypeError(errorText + ".PromiseImpl");
      }
      if (!isUndefined(options.constructorMixin) && !isFunction(options.constructorMixin)) {
        throw new TypeError(errorText + ".PromiseImpl");
      }
      var PromiseImpl = options.PromiseImpl;
      var constructorMixin = options.constructorMixin;
      var plumbing = {};
      plumbing.init = function(requestOptions) {
        var self2 = this;
        self2._rp_promise = new PromiseImpl(function(resolve, reject) {
          self2._rp_resolve = resolve;
          self2._rp_reject = reject;
          if (constructorMixin) {
            constructorMixin.apply(self2, arguments);
          }
        });
        self2._rp_callbackOrig = requestOptions.callback;
        requestOptions.callback = self2.callback = function RP$callback(err, response, body) {
          plumbing.callback.call(self2, err, response, body);
        };
        if (isString(requestOptions.method)) {
          requestOptions.method = requestOptions.method.toUpperCase();
        }
        requestOptions.transform = requestOptions.transform || plumbing.defaultTransformations[requestOptions.method];
        self2._rp_options = requestOptions;
        self2._rp_options.simple = requestOptions.simple !== false;
        self2._rp_options.resolveWithFullResponse = requestOptions.resolveWithFullResponse === true;
        self2._rp_options.transform2xxOnly = requestOptions.transform2xxOnly === true;
      };
      plumbing.defaultTransformations = {
        HEAD: function(body, response, resolveWithFullResponse) {
          return resolveWithFullResponse ? response : response.headers;
        }
      };
      plumbing.callback = function(err, response, body) {
        var self2 = this;
        var origCallbackThrewException = false, thrownException = null;
        if (isFunction(self2._rp_callbackOrig)) {
          try {
            self2._rp_callbackOrig.apply(self2, arguments);
          } catch (e) {
            origCallbackThrewException = true;
            thrownException = e;
          }
        }
        var is2xx = !err && /^2/.test("" + response.statusCode);
        if (err) {
          self2._rp_reject(new errors.RequestError(err, self2._rp_options, response));
        } else if (self2._rp_options.simple && !is2xx) {
          if (isFunction(self2._rp_options.transform) && self2._rp_options.transform2xxOnly === false) {
            new PromiseImpl(function(resolve) {
              resolve(self2._rp_options.transform(body, response, self2._rp_options.resolveWithFullResponse));
            }).then(function(transformedResponse) {
              self2._rp_reject(new errors.StatusCodeError(response.statusCode, body, self2._rp_options, transformedResponse));
            }).catch(function(transformErr) {
              self2._rp_reject(new errors.TransformError(transformErr, self2._rp_options, response));
            });
          } else {
            self2._rp_reject(new errors.StatusCodeError(response.statusCode, body, self2._rp_options, response));
          }
        } else {
          if (isFunction(self2._rp_options.transform) && (is2xx || self2._rp_options.transform2xxOnly === false)) {
            new PromiseImpl(function(resolve) {
              resolve(self2._rp_options.transform(body, response, self2._rp_options.resolveWithFullResponse));
            }).then(function(transformedResponse) {
              self2._rp_resolve(transformedResponse);
            }).catch(function(transformErr) {
              self2._rp_reject(new errors.TransformError(transformErr, self2._rp_options, response));
            });
          } else if (self2._rp_options.resolveWithFullResponse) {
            self2._rp_resolve(response);
          } else {
            self2._rp_resolve(body);
          }
        }
        if (origCallbackThrewException) {
          throw thrownException;
        }
      };
      plumbing.exposePromiseMethod = function(exposeTo, bindTo, promisePropertyKey, methodToExpose, exposeAs) {
        exposeAs = exposeAs || methodToExpose;
        if (exposeAs in exposeTo) {
          throw new Error('Unable to expose method "' + exposeAs + '"');
        }
        exposeTo[exposeAs] = function RP$exposed() {
          var self2 = bindTo || this;
          return self2[promisePropertyKey][methodToExpose].apply(self2[promisePropertyKey], arguments);
        };
      };
      plumbing.exposePromise = function(exposeTo, bindTo, promisePropertyKey, exposeAs) {
        exposeAs = exposeAs || "promise";
        if (exposeAs in exposeTo) {
          throw new Error('Unable to expose method "' + exposeAs + '"');
        }
        exposeTo[exposeAs] = function RP$promise() {
          var self2 = bindTo || this;
          return self2[promisePropertyKey];
        };
      };
      return plumbing;
    };
  }
});

// node_modules/request-promise-core/configure/request2.js
var require_request2 = __commonJS({
  "node_modules/request-promise-core/configure/request2.js"(exports2, module2) {
    "use strict";
    var core = require_plumbing();
    var isArray = require_isArray();
    var isFunction = require_isFunction();
    var isObjectLike = require_isObjectLike();
    module2.exports = function(options) {
      var errorText = "Please verify options";
      if (!isObjectLike(options)) {
        throw new TypeError(errorText);
      }
      if (!isFunction(options.request)) {
        throw new TypeError(errorText + ".request");
      }
      if (!isArray(options.expose) || options.expose.length === 0) {
        throw new TypeError(errorText + ".expose");
      }
      var plumbing = core({
        PromiseImpl: options.PromiseImpl,
        constructorMixin: options.constructorMixin
      });
      var originalInit = options.request.Request.prototype.init;
      options.request.Request.prototype.init = function RP$initInterceptor(requestOptions) {
        if (isObjectLike(requestOptions) && !this._callback && !this._rp_promise) {
          plumbing.init.call(this, requestOptions);
        }
        return originalInit.apply(this, arguments);
      };
      var thenExposed = false;
      for (var i = 0; i < options.expose.length; i += 1) {
        var method = options.expose[i];
        plumbing[method === "promise" ? "exposePromise" : "exposePromiseMethod"](
          options.request.Request.prototype,
          null,
          "_rp_promise",
          method
        );
        if (method === "then") {
          thenExposed = true;
        }
      }
      if (!thenExposed) {
        throw new Error('Please expose "then"');
      }
    };
  }
});

// node_modules/stealthy-require/lib/index.js
var require_lib8 = __commonJS({
  "node_modules/stealthy-require/lib/index.js"(exports2, module2) {
    "use strict";
    var isNative = /\.node$/;
    function forEach(obj2, callback) {
      for (var key in obj2) {
        if (!Object.prototype.hasOwnProperty.call(obj2, key)) {
          continue;
        }
        callback(key);
      }
    }
    function assign(target, source) {
      forEach(source, function(key) {
        target[key] = source[key];
      });
      return target;
    }
    function clearCache(requireCache) {
      forEach(requireCache, function(resolvedPath) {
        if (!isNative.test(resolvedPath)) {
          delete requireCache[resolvedPath];
        }
      });
    }
    module2.exports = function(requireCache, callback, callbackForModulesToKeep, module3) {
      var originalCache = assign({}, requireCache);
      clearCache(requireCache);
      if (callbackForModulesToKeep) {
        var originalModuleChildren = module3.children ? module3.children.slice() : false;
        callbackForModulesToKeep();
        var modulesToKeep = [];
        forEach(requireCache, function(key) {
          modulesToKeep.push(key);
        });
        clearCache(requireCache);
        if (module3.children) {
          module3.children = originalModuleChildren;
        }
        for (var i = 0; i < modulesToKeep.length; i += 1) {
          if (originalCache[modulesToKeep[i]]) {
            requireCache[modulesToKeep[i]] = originalCache[modulesToKeep[i]];
          }
        }
      }
      var freshModule = callback();
      var stealthCache = callbackForModulesToKeep ? assign({}, requireCache) : false;
      clearCache(requireCache);
      if (callbackForModulesToKeep) {
        for (var k = 0; k < modulesToKeep.length; k += 1) {
          if (stealthCache[modulesToKeep[k]]) {
            requireCache[modulesToKeep[k]] = stealthCache[modulesToKeep[k]];
          }
        }
      }
      assign(requireCache, originalCache);
      return freshModule;
    };
  }
});

// node_modules/extend/index.js
var require_extend = __commonJS({
  "node_modules/extend/index.js"(exports2, module2) {
    "use strict";
    var hasOwn = Object.prototype.hasOwnProperty;
    var toStr = Object.prototype.toString;
    var defineProperty = Object.defineProperty;
    var gOPD = Object.getOwnPropertyDescriptor;
    var isArray = function isArray2(arr) {
      if (typeof Array.isArray === "function") {
        return Array.isArray(arr);
      }
      return toStr.call(arr) === "[object Array]";
    };
    var isPlainObject = function isPlainObject2(obj2) {
      if (!obj2 || toStr.call(obj2) !== "[object Object]") {
        return false;
      }
      var hasOwnConstructor = hasOwn.call(obj2, "constructor");
      var hasIsPrototypeOf = obj2.constructor && obj2.constructor.prototype && hasOwn.call(obj2.constructor.prototype, "isPrototypeOf");
      if (obj2.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
        return false;
      }
      var key;
      for (key in obj2) {
      }
      return typeof key === "undefined" || hasOwn.call(obj2, key);
    };
    var setProperty = function setProperty2(target, options) {
      if (defineProperty && options.name === "__proto__") {
        defineProperty(target, options.name, {
          enumerable: true,
          configurable: true,
          value: options.newValue,
          writable: true
        });
      } else {
        target[options.name] = options.newValue;
      }
    };
    var getProperty = function getProperty2(obj2, name) {
      if (name === "__proto__") {
        if (!hasOwn.call(obj2, name)) {
          return void 0;
        } else if (gOPD) {
          return gOPD(obj2, name).value;
        }
      }
      return obj2[name];
    };
    module2.exports = function extend() {
      var options, name, src, copy, copyIsArray, clone;
      var target = arguments[0];
      var i = 1;
      var length = arguments.length;
      var deep = false;
      if (typeof target === "boolean") {
        deep = target;
        target = arguments[1] || {};
        i = 2;
      }
      if (target == null || typeof target !== "object" && typeof target !== "function") {
        target = {};
      }
      for (; i < length; ++i) {
        options = arguments[i];
        if (options != null) {
          for (name in options) {
            src = getProperty(target, name);
            copy = getProperty(options, name);
            if (target !== copy) {
              if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
                if (copyIsArray) {
                  copyIsArray = false;
                  clone = src && isArray(src) ? src : [];
                } else {
                  clone = src && isPlainObject(src) ? src : {};
                }
                setProperty(target, { name, newValue: extend(deep, clone, copy) });
              } else if (typeof copy !== "undefined") {
                setProperty(target, { name, newValue: copy });
              }
            }
          }
        }
      }
      return target;
    };
  }
});

// node_modules/requires-port/index.js
var require_requires_port = __commonJS({
  "node_modules/requires-port/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function required(port, protocol) {
      protocol = protocol.split(":")[0];
      port = +port;
      if (!port)
        return false;
      switch (protocol) {
        case "http":
        case "ws":
          return port !== 80;
        case "https":
        case "wss":
          return port !== 443;
        case "ftp":
          return port !== 21;
        case "gopher":
          return port !== 70;
        case "file":
          return false;
      }
      return port !== 0;
    };
  }
});

// node_modules/querystringify/index.js
var require_querystringify = __commonJS({
  "node_modules/querystringify/index.js"(exports2) {
    "use strict";
    var has = Object.prototype.hasOwnProperty;
    var undef;
    function decode(input) {
      try {
        return decodeURIComponent(input.replace(/\+/g, " "));
      } catch (e) {
        return null;
      }
    }
    function encode(input) {
      try {
        return encodeURIComponent(input);
      } catch (e) {
        return null;
      }
    }
    function querystring(query) {
      var parser = /([^=?#&]+)=?([^&]*)/g, result = {}, part;
      while (part = parser.exec(query)) {
        var key = decode(part[1]), value = decode(part[2]);
        if (key === null || value === null || key in result)
          continue;
        result[key] = value;
      }
      return result;
    }
    function querystringify(obj2, prefix) {
      prefix = prefix || "";
      var pairs = [], value, key;
      if ("string" !== typeof prefix)
        prefix = "?";
      for (key in obj2) {
        if (has.call(obj2, key)) {
          value = obj2[key];
          if (!value && (value === null || value === undef || isNaN(value))) {
            value = "";
          }
          key = encode(key);
          value = encode(value);
          if (key === null || value === null)
            continue;
          pairs.push(key + "=" + value);
        }
      }
      return pairs.length ? prefix + pairs.join("&") : "";
    }
    exports2.stringify = querystringify;
    exports2.parse = querystring;
  }
});

// node_modules/url-parse/index.js
var require_url_parse = __commonJS({
  "node_modules/url-parse/index.js"(exports2, module2) {
    "use strict";
    var required = require_requires_port();
    var qs = require_querystringify();
    var controlOrWhitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;
    var CRHTLF = /[\n\r\t]/g;
    var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//;
    var port = /:\d+$/;
    var protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i;
    var windowsDriveLetter = /^[a-zA-Z]:/;
    function trimLeft(str) {
      return (str ? str : "").toString().replace(controlOrWhitespace, "");
    }
    var rules = [
      ["#", "hash"],
      // Extract from the back.
      ["?", "query"],
      // Extract from the back.
      function sanitize(address, url) {
        return isSpecial(url.protocol) ? address.replace(/\\/g, "/") : address;
      },
      ["/", "pathname"],
      // Extract from the back.
      ["@", "auth", 1],
      // Extract from the front.
      [NaN, "host", void 0, 1, 1],
      // Set left over value.
      [/:(\d*)$/, "port", void 0, 1],
      // RegExp the back.
      [NaN, "hostname", void 0, 1, 1]
      // Set left over.
    ];
    var ignore = { hash: 1, query: 1 };
    function lolcation(loc) {
      var globalVar;
      if (typeof window !== "undefined")
        globalVar = window;
      else if (typeof global !== "undefined")
        globalVar = global;
      else if (typeof self !== "undefined")
        globalVar = self;
      else
        globalVar = {};
      var location = globalVar.location || {};
      loc = loc || location;
      var finaldestination = {}, type = typeof loc, key;
      if ("blob:" === loc.protocol) {
        finaldestination = new Url(unescape(loc.pathname), {});
      } else if ("string" === type) {
        finaldestination = new Url(loc, {});
        for (key in ignore)
          delete finaldestination[key];
      } else if ("object" === type) {
        for (key in loc) {
          if (key in ignore)
            continue;
          finaldestination[key] = loc[key];
        }
        if (finaldestination.slashes === void 0) {
          finaldestination.slashes = slashes.test(loc.href);
        }
      }
      return finaldestination;
    }
    function isSpecial(scheme) {
      return scheme === "file:" || scheme === "ftp:" || scheme === "http:" || scheme === "https:" || scheme === "ws:" || scheme === "wss:";
    }
    function extractProtocol(address, location) {
      address = trimLeft(address);
      address = address.replace(CRHTLF, "");
      location = location || {};
      var match = protocolre.exec(address);
      var protocol = match[1] ? match[1].toLowerCase() : "";
      var forwardSlashes = !!match[2];
      var otherSlashes = !!match[3];
      var slashesCount = 0;
      var rest;
      if (forwardSlashes) {
        if (otherSlashes) {
          rest = match[2] + match[3] + match[4];
          slashesCount = match[2].length + match[3].length;
        } else {
          rest = match[2] + match[4];
          slashesCount = match[2].length;
        }
      } else {
        if (otherSlashes) {
          rest = match[3] + match[4];
          slashesCount = match[3].length;
        } else {
          rest = match[4];
        }
      }
      if (protocol === "file:") {
        if (slashesCount >= 2) {
          rest = rest.slice(2);
        }
      } else if (isSpecial(protocol)) {
        rest = match[4];
      } else if (protocol) {
        if (forwardSlashes) {
          rest = rest.slice(2);
        }
      } else if (slashesCount >= 2 && isSpecial(location.protocol)) {
        rest = match[4];
      }
      return {
        protocol,
        slashes: forwardSlashes || isSpecial(protocol),
        slashesCount,
        rest
      };
    }
    function resolve(relative, base) {
      if (relative === "")
        return base;
      var path4 = (base || "/").split("/").slice(0, -1).concat(relative.split("/")), i = path4.length, last = path4[i - 1], unshift = false, up = 0;
      while (i--) {
        if (path4[i] === ".") {
          path4.splice(i, 1);
        } else if (path4[i] === "..") {
          path4.splice(i, 1);
          up++;
        } else if (up) {
          if (i === 0)
            unshift = true;
          path4.splice(i, 1);
          up--;
        }
      }
      if (unshift)
        path4.unshift("");
      if (last === "." || last === "..")
        path4.push("");
      return path4.join("/");
    }
    function Url(address, location, parser) {
      address = trimLeft(address);
      address = address.replace(CRHTLF, "");
      if (!(this instanceof Url)) {
        return new Url(address, location, parser);
      }
      var relative, extracted, parse2, instruction, index, key, instructions = rules.slice(), type = typeof location, url = this, i = 0;
      if ("object" !== type && "string" !== type) {
        parser = location;
        location = null;
      }
      if (parser && "function" !== typeof parser)
        parser = qs.parse;
      location = lolcation(location);
      extracted = extractProtocol(address || "", location);
      relative = !extracted.protocol && !extracted.slashes;
      url.slashes = extracted.slashes || relative && location.slashes;
      url.protocol = extracted.protocol || location.protocol || "";
      address = extracted.rest;
      if (extracted.protocol === "file:" && (extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || !extracted.slashes && (extracted.protocol || extracted.slashesCount < 2 || !isSpecial(url.protocol))) {
        instructions[3] = [/(.*)/, "pathname"];
      }
      for (; i < instructions.length; i++) {
        instruction = instructions[i];
        if (typeof instruction === "function") {
          address = instruction(address, url);
          continue;
        }
        parse2 = instruction[0];
        key = instruction[1];
        if (parse2 !== parse2) {
          url[key] = address;
        } else if ("string" === typeof parse2) {
          index = parse2 === "@" ? address.lastIndexOf(parse2) : address.indexOf(parse2);
          if (~index) {
            if ("number" === typeof instruction[2]) {
              url[key] = address.slice(0, index);
              address = address.slice(index + instruction[2]);
            } else {
              url[key] = address.slice(index);
              address = address.slice(0, index);
            }
          }
        } else if (index = parse2.exec(address)) {
          url[key] = index[1];
          address = address.slice(0, index.index);
        }
        url[key] = url[key] || (relative && instruction[3] ? location[key] || "" : "");
        if (instruction[4])
          url[key] = url[key].toLowerCase();
      }
      if (parser)
        url.query = parser(url.query);
      if (relative && location.slashes && url.pathname.charAt(0) !== "/" && (url.pathname !== "" || location.pathname !== "")) {
        url.pathname = resolve(url.pathname, location.pathname);
      }
      if (url.pathname.charAt(0) !== "/" && isSpecial(url.protocol)) {
        url.pathname = "/" + url.pathname;
      }
      if (!required(url.port, url.protocol)) {
        url.host = url.hostname;
        url.port = "";
      }
      url.username = url.password = "";
      if (url.auth) {
        index = url.auth.indexOf(":");
        if (~index) {
          url.username = url.auth.slice(0, index);
          url.username = encodeURIComponent(decodeURIComponent(url.username));
          url.password = url.auth.slice(index + 1);
          url.password = encodeURIComponent(decodeURIComponent(url.password));
        } else {
          url.username = encodeURIComponent(decodeURIComponent(url.auth));
        }
        url.auth = url.password ? url.username + ":" + url.password : url.username;
      }
      url.origin = url.protocol !== "file:" && isSpecial(url.protocol) && url.host ? url.protocol + "//" + url.host : "null";
      url.href = url.toString();
    }
    function set(part, value, fn2) {
      var url = this;
      switch (part) {
        case "query":
          if ("string" === typeof value && value.length) {
            value = (fn2 || qs.parse)(value);
          }
          url[part] = value;
          break;
        case "port":
          url[part] = value;
          if (!required(value, url.protocol)) {
            url.host = url.hostname;
            url[part] = "";
          } else if (value) {
            url.host = url.hostname + ":" + value;
          }
          break;
        case "hostname":
          url[part] = value;
          if (url.port)
            value += ":" + url.port;
          url.host = value;
          break;
        case "host":
          url[part] = value;
          if (port.test(value)) {
            value = value.split(":");
            url.port = value.pop();
            url.hostname = value.join(":");
          } else {
            url.hostname = value;
            url.port = "";
          }
          break;
        case "protocol":
          url.protocol = value.toLowerCase();
          url.slashes = !fn2;
          break;
        case "pathname":
        case "hash":
          if (value) {
            var char = part === "pathname" ? "/" : "#";
            url[part] = value.charAt(0) !== char ? char + value : value;
          } else {
            url[part] = value;
          }
          break;
        case "username":
        case "password":
          url[part] = encodeURIComponent(value);
          break;
        case "auth":
          var index = value.indexOf(":");
          if (~index) {
            url.username = value.slice(0, index);
            url.username = encodeURIComponent(decodeURIComponent(url.username));
            url.password = value.slice(index + 1);
            url.password = encodeURIComponent(decodeURIComponent(url.password));
          } else {
            url.username = encodeURIComponent(decodeURIComponent(value));
          }
      }
      for (var i = 0; i < rules.length; i++) {
        var ins = rules[i];
        if (ins[4])
          url[ins[1]] = url[ins[1]].toLowerCase();
      }
      url.auth = url.password ? url.username + ":" + url.password : url.username;
      url.origin = url.protocol !== "file:" && isSpecial(url.protocol) && url.host ? url.protocol + "//" + url.host : "null";
      url.href = url.toString();
      return url;
    }
    function toString(stringify2) {
      if (!stringify2 || "function" !== typeof stringify2)
        stringify2 = qs.stringify;
      var query, url = this, host = url.host, protocol = url.protocol;
      if (protocol && protocol.charAt(protocol.length - 1) !== ":")
        protocol += ":";
      var result = protocol + (url.protocol && url.slashes || isSpecial(url.protocol) ? "//" : "");
      if (url.username) {
        result += url.username;
        if (url.password)
          result += ":" + url.password;
        result += "@";
      } else if (url.password) {
        result += ":" + url.password;
        result += "@";
      } else if (url.protocol !== "file:" && isSpecial(url.protocol) && !host && url.pathname !== "/") {
        result += "@";
      }
      if (host[host.length - 1] === ":" || port.test(url.hostname) && !url.port) {
        host += ":";
      }
      result += host + url.pathname;
      query = "object" === typeof url.query ? stringify2(url.query) : url.query;
      if (query)
        result += "?" !== query.charAt(0) ? "?" + query : query;
      if (url.hash)
        result += url.hash;
      return result;
    }
    Url.prototype = { set, toString };
    Url.extractProtocol = extractProtocol;
    Url.location = lolcation;
    Url.trimLeft = trimLeft;
    Url.qs = qs;
    module2.exports = Url;
  }
});

// node_modules/psl/data/rules.json
var require_rules = __commonJS({
  "node_modules/psl/data/rules.json"(exports2, module2) {
    module2.exports = [
      "ac",
      "com.ac",
      "edu.ac",
      "gov.ac",
      "net.ac",
      "mil.ac",
      "org.ac",
      "ad",
      "nom.ad",
      "ae",
      "co.ae",
      "net.ae",
      "org.ae",
      "sch.ae",
      "ac.ae",
      "gov.ae",
      "mil.ae",
      "aero",
      "accident-investigation.aero",
      "accident-prevention.aero",
      "aerobatic.aero",
      "aeroclub.aero",
      "aerodrome.aero",
      "agents.aero",
      "aircraft.aero",
      "airline.aero",
      "airport.aero",
      "air-surveillance.aero",
      "airtraffic.aero",
      "air-traffic-control.aero",
      "ambulance.aero",
      "amusement.aero",
      "association.aero",
      "author.aero",
      "ballooning.aero",
      "broker.aero",
      "caa.aero",
      "cargo.aero",
      "catering.aero",
      "certification.aero",
      "championship.aero",
      "charter.aero",
      "civilaviation.aero",
      "club.aero",
      "conference.aero",
      "consultant.aero",
      "consulting.aero",
      "control.aero",
      "council.aero",
      "crew.aero",
      "design.aero",
      "dgca.aero",
      "educator.aero",
      "emergency.aero",
      "engine.aero",
      "engineer.aero",
      "entertainment.aero",
      "equipment.aero",
      "exchange.aero",
      "express.aero",
      "federation.aero",
      "flight.aero",
      "fuel.aero",
      "gliding.aero",
      "government.aero",
      "groundhandling.aero",
      "group.aero",
      "hanggliding.aero",
      "homebuilt.aero",
      "insurance.aero",
      "journal.aero",
      "journalist.aero",
      "leasing.aero",
      "logistics.aero",
      "magazine.aero",
      "maintenance.aero",
      "media.aero",
      "microlight.aero",
      "modelling.aero",
      "navigation.aero",
      "parachuting.aero",
      "paragliding.aero",
      "passenger-association.aero",
      "pilot.aero",
      "press.aero",
      "production.aero",
      "recreation.aero",
      "repbody.aero",
      "res.aero",
      "research.aero",
      "rotorcraft.aero",
      "safety.aero",
      "scientist.aero",
      "services.aero",
      "show.aero",
      "skydiving.aero",
      "software.aero",
      "student.aero",
      "trader.aero",
      "trading.aero",
      "trainer.aero",
      "union.aero",
      "workinggroup.aero",
      "works.aero",
      "af",
      "gov.af",
      "com.af",
      "org.af",
      "net.af",
      "edu.af",
      "ag",
      "com.ag",
      "org.ag",
      "net.ag",
      "co.ag",
      "nom.ag",
      "ai",
      "off.ai",
      "com.ai",
      "net.ai",
      "org.ai",
      "al",
      "com.al",
      "edu.al",
      "gov.al",
      "mil.al",
      "net.al",
      "org.al",
      "am",
      "co.am",
      "com.am",
      "commune.am",
      "net.am",
      "org.am",
      "ao",
      "ed.ao",
      "gv.ao",
      "og.ao",
      "co.ao",
      "pb.ao",
      "it.ao",
      "aq",
      "ar",
      "bet.ar",
      "com.ar",
      "coop.ar",
      "edu.ar",
      "gob.ar",
      "gov.ar",
      "int.ar",
      "mil.ar",
      "musica.ar",
      "mutual.ar",
      "net.ar",
      "org.ar",
      "senasa.ar",
      "tur.ar",
      "arpa",
      "e164.arpa",
      "in-addr.arpa",
      "ip6.arpa",
      "iris.arpa",
      "uri.arpa",
      "urn.arpa",
      "as",
      "gov.as",
      "asia",
      "at",
      "ac.at",
      "co.at",
      "gv.at",
      "or.at",
      "sth.ac.at",
      "au",
      "com.au",
      "net.au",
      "org.au",
      "edu.au",
      "gov.au",
      "asn.au",
      "id.au",
      "info.au",
      "conf.au",
      "oz.au",
      "act.au",
      "nsw.au",
      "nt.au",
      "qld.au",
      "sa.au",
      "tas.au",
      "vic.au",
      "wa.au",
      "act.edu.au",
      "catholic.edu.au",
      "nsw.edu.au",
      "nt.edu.au",
      "qld.edu.au",
      "sa.edu.au",
      "tas.edu.au",
      "vic.edu.au",
      "wa.edu.au",
      "qld.gov.au",
      "sa.gov.au",
      "tas.gov.au",
      "vic.gov.au",
      "wa.gov.au",
      "schools.nsw.edu.au",
      "aw",
      "com.aw",
      "ax",
      "az",
      "com.az",
      "net.az",
      "int.az",
      "gov.az",
      "org.az",
      "edu.az",
      "info.az",
      "pp.az",
      "mil.az",
      "name.az",
      "pro.az",
      "biz.az",
      "ba",
      "com.ba",
      "edu.ba",
      "gov.ba",
      "mil.ba",
      "net.ba",
      "org.ba",
      "bb",
      "biz.bb",
      "co.bb",
      "com.bb",
      "edu.bb",
      "gov.bb",
      "info.bb",
      "net.bb",
      "org.bb",
      "store.bb",
      "tv.bb",
      "*.bd",
      "be",
      "ac.be",
      "bf",
      "gov.bf",
      "bg",
      "a.bg",
      "b.bg",
      "c.bg",
      "d.bg",
      "e.bg",
      "f.bg",
      "g.bg",
      "h.bg",
      "i.bg",
      "j.bg",
      "k.bg",
      "l.bg",
      "m.bg",
      "n.bg",
      "o.bg",
      "p.bg",
      "q.bg",
      "r.bg",
      "s.bg",
      "t.bg",
      "u.bg",
      "v.bg",
      "w.bg",
      "x.bg",
      "y.bg",
      "z.bg",
      "0.bg",
      "1.bg",
      "2.bg",
      "3.bg",
      "4.bg",
      "5.bg",
      "6.bg",
      "7.bg",
      "8.bg",
      "9.bg",
      "bh",
      "com.bh",
      "edu.bh",
      "net.bh",
      "org.bh",
      "gov.bh",
      "bi",
      "co.bi",
      "com.bi",
      "edu.bi",
      "or.bi",
      "org.bi",
      "biz",
      "bj",
      "asso.bj",
      "barreau.bj",
      "gouv.bj",
      "bm",
      "com.bm",
      "edu.bm",
      "gov.bm",
      "net.bm",
      "org.bm",
      "bn",
      "com.bn",
      "edu.bn",
      "gov.bn",
      "net.bn",
      "org.bn",
      "bo",
      "com.bo",
      "edu.bo",
      "gob.bo",
      "int.bo",
      "org.bo",
      "net.bo",
      "mil.bo",
      "tv.bo",
      "web.bo",
      "academia.bo",
      "agro.bo",
      "arte.bo",
      "blog.bo",
      "bolivia.bo",
      "ciencia.bo",
      "cooperativa.bo",
      "democracia.bo",
      "deporte.bo",
      "ecologia.bo",
      "economia.bo",
      "empresa.bo",
      "indigena.bo",
      "industria.bo",
      "info.bo",
      "medicina.bo",
      "movimiento.bo",
      "musica.bo",
      "natural.bo",
      "nombre.bo",
      "noticias.bo",
      "patria.bo",
      "politica.bo",
      "profesional.bo",
      "plurinacional.bo",
      "pueblo.bo",
      "revista.bo",
      "salud.bo",
      "tecnologia.bo",
      "tksat.bo",
      "transporte.bo",
      "wiki.bo",
      "br",
      "9guacu.br",
      "abc.br",
      "adm.br",
      "adv.br",
      "agr.br",
      "aju.br",
      "am.br",
      "anani.br",
      "aparecida.br",
      "app.br",
      "arq.br",
      "art.br",
      "ato.br",
      "b.br",
      "barueri.br",
      "belem.br",
      "bhz.br",
      "bib.br",
      "bio.br",
      "blog.br",
      "bmd.br",
      "boavista.br",
      "bsb.br",
      "campinagrande.br",
      "campinas.br",
      "caxias.br",
      "cim.br",
      "cng.br",
      "cnt.br",
      "com.br",
      "contagem.br",
      "coop.br",
      "coz.br",
      "cri.br",
      "cuiaba.br",
      "curitiba.br",
      "def.br",
      "des.br",
      "det.br",
      "dev.br",
      "ecn.br",
      "eco.br",
      "edu.br",
      "emp.br",
      "enf.br",
      "eng.br",
      "esp.br",
      "etc.br",
      "eti.br",
      "far.br",
      "feira.br",
      "flog.br",
      "floripa.br",
      "fm.br",
      "fnd.br",
      "fortal.br",
      "fot.br",
      "foz.br",
      "fst.br",
      "g12.br",
      "geo.br",
      "ggf.br",
      "goiania.br",
      "gov.br",
      "ac.gov.br",
      "al.gov.br",
      "am.gov.br",
      "ap.gov.br",
      "ba.gov.br",
      "ce.gov.br",
      "df.gov.br",
      "es.gov.br",
      "go.gov.br",
      "ma.gov.br",
      "mg.gov.br",
      "ms.gov.br",
      "mt.gov.br",
      "pa.gov.br",
      "pb.gov.br",
      "pe.gov.br",
      "pi.gov.br",
      "pr.gov.br",
      "rj.gov.br",
      "rn.gov.br",
      "ro.gov.br",
      "rr.gov.br",
      "rs.gov.br",
      "sc.gov.br",
      "se.gov.br",
      "sp.gov.br",
      "to.gov.br",
      "gru.br",
      "imb.br",
      "ind.br",
      "inf.br",
      "jab.br",
      "jampa.br",
      "jdf.br",
      "joinville.br",
      "jor.br",
      "jus.br",
      "leg.br",
      "lel.br",
      "log.br",
      "londrina.br",
      "macapa.br",
      "maceio.br",
      "manaus.br",
      "maringa.br",
      "mat.br",
      "med.br",
      "mil.br",
      "morena.br",
      "mp.br",
      "mus.br",
      "natal.br",
      "net.br",
      "niteroi.br",
      "*.nom.br",
      "not.br",
      "ntr.br",
      "odo.br",
      "ong.br",
      "org.br",
      "osasco.br",
      "palmas.br",
      "poa.br",
      "ppg.br",
      "pro.br",
      "psc.br",
      "psi.br",
      "pvh.br",
      "qsl.br",
      "radio.br",
      "rec.br",
      "recife.br",
      "rep.br",
      "ribeirao.br",
      "rio.br",
      "riobranco.br",
      "riopreto.br",
      "salvador.br",
      "sampa.br",
      "santamaria.br",
      "santoandre.br",
      "saobernardo.br",
      "saogonca.br",
      "seg.br",
      "sjc.br",
      "slg.br",
      "slz.br",
      "sorocaba.br",
      "srv.br",
      "taxi.br",
      "tc.br",
      "tec.br",
      "teo.br",
      "the.br",
      "tmp.br",
      "trd.br",
      "tur.br",
      "tv.br",
      "udi.br",
      "vet.br",
      "vix.br",
      "vlog.br",
      "wiki.br",
      "zlg.br",
      "bs",
      "com.bs",
      "net.bs",
      "org.bs",
      "edu.bs",
      "gov.bs",
      "bt",
      "com.bt",
      "edu.bt",
      "gov.bt",
      "net.bt",
      "org.bt",
      "bv",
      "bw",
      "co.bw",
      "org.bw",
      "by",
      "gov.by",
      "mil.by",
      "com.by",
      "of.by",
      "bz",
      "com.bz",
      "net.bz",
      "org.bz",
      "edu.bz",
      "gov.bz",
      "ca",
      "ab.ca",
      "bc.ca",
      "mb.ca",
      "nb.ca",
      "nf.ca",
      "nl.ca",
      "ns.ca",
      "nt.ca",
      "nu.ca",
      "on.ca",
      "pe.ca",
      "qc.ca",
      "sk.ca",
      "yk.ca",
      "gc.ca",
      "cat",
      "cc",
      "cd",
      "gov.cd",
      "cf",
      "cg",
      "ch",
      "ci",
      "org.ci",
      "or.ci",
      "com.ci",
      "co.ci",
      "edu.ci",
      "ed.ci",
      "ac.ci",
      "net.ci",
      "go.ci",
      "asso.ci",
      "a\xE9roport.ci",
      "int.ci",
      "presse.ci",
      "md.ci",
      "gouv.ci",
      "*.ck",
      "!www.ck",
      "cl",
      "co.cl",
      "gob.cl",
      "gov.cl",
      "mil.cl",
      "cm",
      "co.cm",
      "com.cm",
      "gov.cm",
      "net.cm",
      "cn",
      "ac.cn",
      "com.cn",
      "edu.cn",
      "gov.cn",
      "net.cn",
      "org.cn",
      "mil.cn",
      "\u516C\u53F8.cn",
      "\u7F51\u7EDC.cn",
      "\u7DB2\u7D61.cn",
      "ah.cn",
      "bj.cn",
      "cq.cn",
      "fj.cn",
      "gd.cn",
      "gs.cn",
      "gz.cn",
      "gx.cn",
      "ha.cn",
      "hb.cn",
      "he.cn",
      "hi.cn",
      "hl.cn",
      "hn.cn",
      "jl.cn",
      "js.cn",
      "jx.cn",
      "ln.cn",
      "nm.cn",
      "nx.cn",
      "qh.cn",
      "sc.cn",
      "sd.cn",
      "sh.cn",
      "sn.cn",
      "sx.cn",
      "tj.cn",
      "xj.cn",
      "xz.cn",
      "yn.cn",
      "zj.cn",
      "hk.cn",
      "mo.cn",
      "tw.cn",
      "co",
      "arts.co",
      "com.co",
      "edu.co",
      "firm.co",
      "gov.co",
      "info.co",
      "int.co",
      "mil.co",
      "net.co",
      "nom.co",
      "org.co",
      "rec.co",
      "web.co",
      "com",
      "coop",
      "cr",
      "ac.cr",
      "co.cr",
      "ed.cr",
      "fi.cr",
      "go.cr",
      "or.cr",
      "sa.cr",
      "cu",
      "com.cu",
      "edu.cu",
      "org.cu",
      "net.cu",
      "gov.cu",
      "inf.cu",
      "cv",
      "com.cv",
      "edu.cv",
      "int.cv",
      "nome.cv",
      "org.cv",
      "cw",
      "com.cw",
      "edu.cw",
      "net.cw",
      "org.cw",
      "cx",
      "gov.cx",
      "cy",
      "ac.cy",
      "biz.cy",
      "com.cy",
      "ekloges.cy",
      "gov.cy",
      "ltd.cy",
      "mil.cy",
      "net.cy",
      "org.cy",
      "press.cy",
      "pro.cy",
      "tm.cy",
      "cz",
      "de",
      "dj",
      "dk",
      "dm",
      "com.dm",
      "net.dm",
      "org.dm",
      "edu.dm",
      "gov.dm",
      "do",
      "art.do",
      "com.do",
      "edu.do",
      "gob.do",
      "gov.do",
      "mil.do",
      "net.do",
      "org.do",
      "sld.do",
      "web.do",
      "dz",
      "art.dz",
      "asso.dz",
      "com.dz",
      "edu.dz",
      "gov.dz",
      "org.dz",
      "net.dz",
      "pol.dz",
      "soc.dz",
      "tm.dz",
      "ec",
      "com.ec",
      "info.ec",
      "net.ec",
      "fin.ec",
      "k12.ec",
      "med.ec",
      "pro.ec",
      "org.ec",
      "edu.ec",
      "gov.ec",
      "gob.ec",
      "mil.ec",
      "edu",
      "ee",
      "edu.ee",
      "gov.ee",
      "riik.ee",
      "lib.ee",
      "med.ee",
      "com.ee",
      "pri.ee",
      "aip.ee",
      "org.ee",
      "fie.ee",
      "eg",
      "com.eg",
      "edu.eg",
      "eun.eg",
      "gov.eg",
      "mil.eg",
      "name.eg",
      "net.eg",
      "org.eg",
      "sci.eg",
      "*.er",
      "es",
      "com.es",
      "nom.es",
      "org.es",
      "gob.es",
      "edu.es",
      "et",
      "com.et",
      "gov.et",
      "org.et",
      "edu.et",
      "biz.et",
      "name.et",
      "info.et",
      "net.et",
      "eu",
      "fi",
      "aland.fi",
      "fj",
      "ac.fj",
      "biz.fj",
      "com.fj",
      "gov.fj",
      "info.fj",
      "mil.fj",
      "name.fj",
      "net.fj",
      "org.fj",
      "pro.fj",
      "*.fk",
      "com.fm",
      "edu.fm",
      "net.fm",
      "org.fm",
      "fm",
      "fo",
      "fr",
      "asso.fr",
      "com.fr",
      "gouv.fr",
      "nom.fr",
      "prd.fr",
      "tm.fr",
      "aeroport.fr",
      "avocat.fr",
      "avoues.fr",
      "cci.fr",
      "chambagri.fr",
      "chirurgiens-dentistes.fr",
      "experts-comptables.fr",
      "geometre-expert.fr",
      "greta.fr",
      "huissier-justice.fr",
      "medecin.fr",
      "notaires.fr",
      "pharmacien.fr",
      "port.fr",
      "veterinaire.fr",
      "ga",
      "gb",
      "edu.gd",
      "gov.gd",
      "gd",
      "ge",
      "com.ge",
      "edu.ge",
      "gov.ge",
      "org.ge",
      "mil.ge",
      "net.ge",
      "pvt.ge",
      "gf",
      "gg",
      "co.gg",
      "net.gg",
      "org.gg",
      "gh",
      "com.gh",
      "edu.gh",
      "gov.gh",
      "org.gh",
      "mil.gh",
      "gi",
      "com.gi",
      "ltd.gi",
      "gov.gi",
      "mod.gi",
      "edu.gi",
      "org.gi",
      "gl",
      "co.gl",
      "com.gl",
      "edu.gl",
      "net.gl",
      "org.gl",
      "gm",
      "gn",
      "ac.gn",
      "com.gn",
      "edu.gn",
      "gov.gn",
      "org.gn",
      "net.gn",
      "gov",
      "gp",
      "com.gp",
      "net.gp",
      "mobi.gp",
      "edu.gp",
      "org.gp",
      "asso.gp",
      "gq",
      "gr",
      "com.gr",
      "edu.gr",
      "net.gr",
      "org.gr",
      "gov.gr",
      "gs",
      "gt",
      "com.gt",
      "edu.gt",
      "gob.gt",
      "ind.gt",
      "mil.gt",
      "net.gt",
      "org.gt",
      "gu",
      "com.gu",
      "edu.gu",
      "gov.gu",
      "guam.gu",
      "info.gu",
      "net.gu",
      "org.gu",
      "web.gu",
      "gw",
      "gy",
      "co.gy",
      "com.gy",
      "edu.gy",
      "gov.gy",
      "net.gy",
      "org.gy",
      "hk",
      "com.hk",
      "edu.hk",
      "gov.hk",
      "idv.hk",
      "net.hk",
      "org.hk",
      "\u516C\u53F8.hk",
      "\u6559\u80B2.hk",
      "\u654E\u80B2.hk",
      "\u653F\u5E9C.hk",
      "\u500B\u4EBA.hk",
      "\u4E2A\uFFFD\uFFFD.hk",
      "\u7B87\u4EBA.hk",
      "\u7DB2\u7EDC.hk",
      "\u7F51\u7EDC.hk",
      "\u7EC4\u7E54.hk",
      "\u7DB2\u7D61.hk",
      "\u7F51\u7D61.hk",
      "\u7EC4\u7EC7.hk",
      "\u7D44\u7E54.hk",
      "\u7D44\u7EC7.hk",
      "hm",
      "hn",
      "com.hn",
      "edu.hn",
      "org.hn",
      "net.hn",
      "mil.hn",
      "gob.hn",
      "hr",
      "iz.hr",
      "from.hr",
      "name.hr",
      "com.hr",
      "ht",
      "com.ht",
      "shop.ht",
      "firm.ht",
      "info.ht",
      "adult.ht",
      "net.ht",
      "pro.ht",
      "org.ht",
      "med.ht",
      "art.ht",
      "coop.ht",
      "pol.ht",
      "asso.ht",
      "edu.ht",
      "rel.ht",
      "gouv.ht",
      "perso.ht",
      "hu",
      "co.hu",
      "info.hu",
      "org.hu",
      "priv.hu",
      "sport.hu",
      "tm.hu",
      "2000.hu",
      "agrar.hu",
      "bolt.hu",
      "casino.hu",
      "city.hu",
      "erotica.hu",
      "erotika.hu",
      "film.hu",
      "forum.hu",
      "games.hu",
      "hotel.hu",
      "ingatlan.hu",
      "jogasz.hu",
      "konyvelo.hu",
      "lakas.hu",
      "media.hu",
      "news.hu",
      "reklam.hu",
      "sex.hu",
      "shop.hu",
      "suli.hu",
      "szex.hu",
      "tozsde.hu",
      "utazas.hu",
      "video.hu",
      "id",
      "ac.id",
      "biz.id",
      "co.id",
      "desa.id",
      "go.id",
      "mil.id",
      "my.id",
      "net.id",
      "or.id",
      "ponpes.id",
      "sch.id",
      "web.id",
      "ie",
      "gov.ie",
      "il",
      "ac.il",
      "co.il",
      "gov.il",
      "idf.il",
      "k12.il",
      "muni.il",
      "net.il",
      "org.il",
      "im",
      "ac.im",
      "co.im",
      "com.im",
      "ltd.co.im",
      "net.im",
      "org.im",
      "plc.co.im",
      "tt.im",
      "tv.im",
      "in",
      "co.in",
      "firm.in",
      "net.in",
      "org.in",
      "gen.in",
      "ind.in",
      "nic.in",
      "ac.in",
      "edu.in",
      "res.in",
      "gov.in",
      "mil.in",
      "info",
      "int",
      "eu.int",
      "io",
      "com.io",
      "iq",
      "gov.iq",
      "edu.iq",
      "mil.iq",
      "com.iq",
      "org.iq",
      "net.iq",
      "ir",
      "ac.ir",
      "co.ir",
      "gov.ir",
      "id.ir",
      "net.ir",
      "org.ir",
      "sch.ir",
      "\u0627\u06CC\u0631\u0627\u0646.ir",
      "\u0627\u064A\u0631\u0627\u0646.ir",
      "is",
      "net.is",
      "com.is",
      "edu.is",
      "gov.is",
      "org.is",
      "int.is",
      "it",
      "gov.it",
      "edu.it",
      "abr.it",
      "abruzzo.it",
      "aosta-valley.it",
      "aostavalley.it",
      "bas.it",
      "basilicata.it",
      "cal.it",
      "calabria.it",
      "cam.it",
      "campania.it",
      "emilia-romagna.it",
      "emiliaromagna.it",
      "emr.it",
      "friuli-v-giulia.it",
      "friuli-ve-giulia.it",
      "friuli-vegiulia.it",
      "friuli-venezia-giulia.it",
      "friuli-veneziagiulia.it",
      "friuli-vgiulia.it",
      "friuliv-giulia.it",
      "friulive-giulia.it",
      "friulivegiulia.it",
      "friulivenezia-giulia.it",
      "friuliveneziagiulia.it",
      "friulivgiulia.it",
      "fvg.it",
      "laz.it",
      "lazio.it",
      "lig.it",
      "liguria.it",
      "lom.it",
      "lombardia.it",
      "lombardy.it",
      "lucania.it",
      "mar.it",
      "marche.it",
      "mol.it",
      "molise.it",
      "piedmont.it",
      "piemonte.it",
      "pmn.it",
      "pug.it",
      "puglia.it",
      "sar.it",
      "sardegna.it",
      "sardinia.it",
      "sic.it",
      "sicilia.it",
      "sicily.it",
      "taa.it",
      "tos.it",
      "toscana.it",
      "trentin-sud-tirol.it",
      "trentin-s\xFCd-tirol.it",
      "trentin-sudtirol.it",
      "trentin-s\xFCdtirol.it",
      "trentin-sued-tirol.it",
      "trentin-suedtirol.it",
      "trentino-a-adige.it",
      "trentino-aadige.it",
      "trentino-alto-adige.it",
      "trentino-altoadige.it",
      "trentino-s-tirol.it",
      "trentino-stirol.it",
      "trentino-sud-tirol.it",
      "trentino-s\xFCd-tirol.it",
      "trentino-sudtirol.it",
      "trentino-s\xFCdtirol.it",
      "trentino-sued-tirol.it",
      "trentino-suedtirol.it",
      "trentino.it",
      "trentinoa-adige.it",
      "trentinoaadige.it",
      "trentinoalto-adige.it",
      "trentinoaltoadige.it",
      "trentinos-tirol.it",
      "trentinostirol.it",
      "trentinosud-tirol.it",
      "trentinos\xFCd-tirol.it",
      "trentinosudtirol.it",
      "trentinos\xFCdtirol.it",
      "trentinosued-tirol.it",
      "trentinosuedtirol.it",
      "trentinsud-tirol.it",
      "trentins\xFCd-tirol.it",
      "trentinsudtirol.it",
      "trentins\xFCdtirol.it",
      "trentinsued-tirol.it",
      "trentinsuedtirol.it",
      "tuscany.it",
      "umb.it",
      "umbria.it",
      "val-d-aosta.it",
      "val-daosta.it",
      "vald-aosta.it",
      "valdaosta.it",
      "valle-aosta.it",
      "valle-d-aosta.it",
      "valle-daosta.it",
      "valleaosta.it",
      "valled-aosta.it",
      "valledaosta.it",
      "vallee-aoste.it",
      "vall\xE9e-aoste.it",
      "vallee-d-aoste.it",
      "vall\xE9e-d-aoste.it",
      "valleeaoste.it",
      "vall\xE9eaoste.it",
      "valleedaoste.it",
      "vall\xE9edaoste.it",
      "vao.it",
      "vda.it",
      "ven.it",
      "veneto.it",
      "ag.it",
      "agrigento.it",
      "al.it",
      "alessandria.it",
      "alto-adige.it",
      "altoadige.it",
      "an.it",
      "ancona.it",
      "andria-barletta-trani.it",
      "andria-trani-barletta.it",
      "andriabarlettatrani.it",
      "andriatranibarletta.it",
      "ao.it",
      "aosta.it",
      "aoste.it",
      "ap.it",
      "aq.it",
      "aquila.it",
      "ar.it",
      "arezzo.it",
      "ascoli-piceno.it",
      "ascolipiceno.it",
      "asti.it",
      "at.it",
      "av.it",
      "avellino.it",
      "ba.it",
      "balsan-sudtirol.it",
      "balsan-s\xFCdtirol.it",
      "balsan-suedtirol.it",
      "balsan.it",
      "bari.it",
      "barletta-trani-andria.it",
      "barlettatraniandria.it",
      "belluno.it",
      "benevento.it",
      "bergamo.it",
      "bg.it",
      "bi.it",
      "biella.it",
      "bl.it",
      "bn.it",
      "bo.it",
      "bologna.it",
      "bolzano-altoadige.it",
      "bolzano.it",
      "bozen-sudtirol.it",
      "bozen-s\xFCdtirol.it",
      "bozen-suedtirol.it",
      "bozen.it",
      "br.it",
      "brescia.it",
      "brindisi.it",
      "bs.it",
      "bt.it",
      "bulsan-sudtirol.it",
      "bulsan-s\xFCdtirol.it",
      "bulsan-suedtirol.it",
      "bulsan.it",
      "bz.it",
      "ca.it",
      "cagliari.it",
      "caltanissetta.it",
      "campidano-medio.it",
      "campidanomedio.it",
      "campobasso.it",
      "carbonia-iglesias.it",
      "carboniaiglesias.it",
      "carrara-massa.it",
      "carraramassa.it",
      "caserta.it",
      "catania.it",
      "catanzaro.it",
      "cb.it",
      "ce.it",
      "cesena-forli.it",
      "cesena-forl\xEC.it",
      "cesenaforli.it",
      "cesenaforl\xEC.it",
      "ch.it",
      "chieti.it",
      "ci.it",
      "cl.it",
      "cn.it",
      "co.it",
      "como.it",
      "cosenza.it",
      "cr.it",
      "cremona.it",
      "crotone.it",
      "cs.it",
      "ct.it",
      "cuneo.it",
      "cz.it",
      "dell-ogliastra.it",
      "dellogliastra.it",
      "en.it",
      "enna.it",
      "fc.it",
      "fe.it",
      "fermo.it",
      "ferrara.it",
      "fg.it",
      "fi.it",
      "firenze.it",
      "florence.it",
      "fm.it",
      "foggia.it",
      "forli-cesena.it",
      "forl\xEC-cesena.it",
      "forlicesena.it",
      "forl\xECcesena.it",
      "fr.it",
      "frosinone.it",
      "ge.it",
      "genoa.it",
      "genova.it",
      "go.it",
      "gorizia.it",
      "gr.it",
      "grosseto.it",
      "iglesias-carbonia.it",
      "iglesiascarbonia.it",
      "im.it",
      "imperia.it",
      "is.it",
      "isernia.it",
      "kr.it",
      "la-spezia.it",
      "laquila.it",
      "laspezia.it",
      "latina.it",
      "lc.it",
      "le.it",
      "lecce.it",
      "lecco.it",
      "li.it",
      "livorno.it",
      "lo.it",
      "lodi.it",
      "lt.it",
      "lu.it",
      "lucca.it",
      "macerata.it",
      "mantova.it",
      "massa-carrara.it",
      "massacarrara.it",
      "matera.it",
      "mb.it",
      "mc.it",
      "me.it",
      "medio-campidano.it",
      "mediocampidano.it",
      "messina.it",
      "mi.it",
      "milan.it",
      "milano.it",
      "mn.it",
      "mo.it",
      "modena.it",
      "monza-brianza.it",
      "monza-e-della-brianza.it",
      "monza.it",
      "monzabrianza.it",
      "monzaebrianza.it",
      "monzaedellabrianza.it",
      "ms.it",
      "mt.it",
      "na.it",
      "naples.it",
      "napoli.it",
      "no.it",
      "novara.it",
      "nu.it",
      "nuoro.it",
      "og.it",
      "ogliastra.it",
      "olbia-tempio.it",
      "olbiatempio.it",
      "or.it",
      "oristano.it",
      "ot.it",
      "pa.it",
      "padova.it",
      "padua.it",
      "palermo.it",
      "parma.it",
      "pavia.it",
      "pc.it",
      "pd.it",
      "pe.it",
      "perugia.it",
      "pesaro-urbino.it",
      "pesarourbino.it",
      "pescara.it",
      "pg.it",
      "pi.it",
      "piacenza.it",
      "pisa.it",
      "pistoia.it",
      "pn.it",
      "po.it",
      "pordenone.it",
      "potenza.it",
      "pr.it",
      "prato.it",
      "pt.it",
      "pu.it",
      "pv.it",
      "pz.it",
      "ra.it",
      "ragusa.it",
      "ravenna.it",
      "rc.it",
      "re.it",
      "reggio-calabria.it",
      "reggio-emilia.it",
      "reggiocalabria.it",
      "reggioemilia.it",
      "rg.it",
      "ri.it",
      "rieti.it",
      "rimini.it",
      "rm.it",
      "rn.it",
      "ro.it",
      "roma.it",
      "rome.it",
      "rovigo.it",
      "sa.it",
      "salerno.it",
      "sassari.it",
      "savona.it",
      "si.it",
      "siena.it",
      "siracusa.it",
      "so.it",
      "sondrio.it",
      "sp.it",
      "sr.it",
      "ss.it",
      "suedtirol.it",
      "s\xFCdtirol.it",
      "sv.it",
      "ta.it",
      "taranto.it",
      "te.it",
      "tempio-olbia.it",
      "tempioolbia.it",
      "teramo.it",
      "terni.it",
      "tn.it",
      "to.it",
      "torino.it",
      "tp.it",
      "tr.it",
      "trani-andria-barletta.it",
      "trani-barletta-andria.it",
      "traniandriabarletta.it",
      "tranibarlettaandria.it",
      "trapani.it",
      "trento.it",
      "treviso.it",
      "trieste.it",
      "ts.it",
      "turin.it",
      "tv.it",
      "ud.it",
      "udine.it",
      "urbino-pesaro.it",
      "urbinopesaro.it",
      "va.it",
      "varese.it",
      "vb.it",
      "vc.it",
      "ve.it",
      "venezia.it",
      "venice.it",
      "verbania.it",
      "vercelli.it",
      "verona.it",
      "vi.it",
      "vibo-valentia.it",
      "vibovalentia.it",
      "vicenza.it",
      "viterbo.it",
      "vr.it",
      "vs.it",
      "vt.it",
      "vv.it",
      "je",
      "co.je",
      "net.je",
      "org.je",
      "*.jm",
      "jo",
      "com.jo",
      "org.jo",
      "net.jo",
      "edu.jo",
      "sch.jo",
      "gov.jo",
      "mil.jo",
      "name.jo",
      "jobs",
      "jp",
      "ac.jp",
      "ad.jp",
      "co.jp",
      "ed.jp",
      "go.jp",
      "gr.jp",
      "lg.jp",
      "ne.jp",
      "or.jp",
      "aichi.jp",
      "akita.jp",
      "aomori.jp",
      "chiba.jp",
      "ehime.jp",
      "fukui.jp",
      "fukuoka.jp",
      "fukushima.jp",
      "gifu.jp",
      "gunma.jp",
      "hiroshima.jp",
      "hokkaido.jp",
      "hyogo.jp",
      "ibaraki.jp",
      "ishikawa.jp",
      "iwate.jp",
      "kagawa.jp",
      "kagoshima.jp",
      "kanagawa.jp",
      "kochi.jp",
      "kumamoto.jp",
      "kyoto.jp",
      "mie.jp",
      "miyagi.jp",
      "miyazaki.jp",
      "nagano.jp",
      "nagasaki.jp",
      "nara.jp",
      "niigata.jp",
      "oita.jp",
      "okayama.jp",
      "okinawa.jp",
      "osaka.jp",
      "saga.jp",
      "saitama.jp",
      "shiga.jp",
      "shimane.jp",
      "shizuoka.jp",
      "tochigi.jp",
      "tokushima.jp",
      "tokyo.jp",
      "tottori.jp",
      "toyama.jp",
      "wakayama.jp",
      "yamagata.jp",
      "yamaguchi.jp",
      "yamanashi.jp",
      "\u6803\u6728.jp",
      "\u611B\u77E5.jp",
      "\u611B\u5A9B.jp",
      "\u5175\u5EAB.jp",
      "\u718A\u672C.jp",
      "\u8328\u57CE.jp",
      "\u5317\u6D77\u9053.jp",
      "\u5343\u8449.jp",
      "\u548C\u6B4C\u5C71.jp",
      "\u9577\u5D0E.jp",
      "\u9577\u91CE.jp",
      "\u65B0\u6F5F.jp",
      "\u9752\u68EE.jp",
      "\u9759\u5CA1.jp",
      "\u6771\u4EAC.jp",
      "\u77F3\u5DDD.jp",
      "\u57FC\u7389.jp",
      "\u4E09\u91CD.jp",
      "\u4EAC\u90FD.jp",
      "\u4F50\u8CC0.jp",
      "\u5927\u5206.jp",
      "\u5927\u962A.jp",
      "\u5948\u826F.jp",
      "\u5BAE\u57CE.jp",
      "\u5BAE\u5D0E.jp",
      "\u5BCC\u5C71.jp",
      "\u5C71\u53E3.jp",
      "\u5C71\u5F62.jp",
      "\u5C71\u68A8.jp",
      "\u5CA9\u624B.jp",
      "\u5C90\u961C.jp",
      "\u5CA1\u5C71.jp",
      "\u5CF6\u6839.jp",
      "\u5E83\u5CF6.jp",
      "\u5FB3\u5CF6.jp",
      "\u6C96\u7E04.jp",
      "\u6ECB\u8CC0.jp",
      "\u795E\u5948\u5DDD.jp",
      "\u798F\u4E95.jp",
      "\u798F\u5CA1.jp",
      "\u798F\u5CF6.jp",
      "\u79CB\u7530.jp",
      "\u7FA4\u99AC.jp",
      "\u9999\u5DDD.jp",
      "\u9AD8\u77E5.jp",
      "\u9CE5\u53D6.jp",
      "\u9E7F\u5150\u5CF6.jp",
      "*.kawasaki.jp",
      "*.kitakyushu.jp",
      "*.kobe.jp",
      "*.nagoya.jp",
      "*.sapporo.jp",
      "*.sendai.jp",
      "*.yokohama.jp",
      "!city.kawasaki.jp",
      "!city.kitakyushu.jp",
      "!city.kobe.jp",
      "!city.nagoya.jp",
      "!city.sapporo.jp",
      "!city.sendai.jp",
      "!city.yokohama.jp",
      "aisai.aichi.jp",
      "ama.aichi.jp",
      "anjo.aichi.jp",
      "asuke.aichi.jp",
      "chiryu.aichi.jp",
      "chita.aichi.jp",
      "fuso.aichi.jp",
      "gamagori.aichi.jp",
      "handa.aichi.jp",
      "hazu.aichi.jp",
      "hekinan.aichi.jp",
      "higashiura.aichi.jp",
      "ichinomiya.aichi.jp",
      "inazawa.aichi.jp",
      "inuyama.aichi.jp",
      "isshiki.aichi.jp",
      "iwakura.aichi.jp",
      "kanie.aichi.jp",
      "kariya.aichi.jp",
      "kasugai.aichi.jp",
      "kira.aichi.jp",
      "kiyosu.aichi.jp",
      "komaki.aichi.jp",
      "konan.aichi.jp",
      "kota.aichi.jp",
      "mihama.aichi.jp",
      "miyoshi.aichi.jp",
      "nishio.aichi.jp",
      "nisshin.aichi.jp",
      "obu.aichi.jp",
      "oguchi.aichi.jp",
      "oharu.aichi.jp",
      "okazaki.aichi.jp",
      "owariasahi.aichi.jp",
      "seto.aichi.jp",
      "shikatsu.aichi.jp",
      "shinshiro.aichi.jp",
      "shitara.aichi.jp",
      "tahara.aichi.jp",
      "takahama.aichi.jp",
      "tobishima.aichi.jp",
      "toei.aichi.jp",
      "togo.aichi.jp",
      "tokai.aichi.jp",
      "tokoname.aichi.jp",
      "toyoake.aichi.jp",
      "toyohashi.aichi.jp",
      "toyokawa.aichi.jp",
      "toyone.aichi.jp",
      "toyota.aichi.jp",
      "tsushima.aichi.jp",
      "yatomi.aichi.jp",
      "akita.akita.jp",
      "daisen.akita.jp",
      "fujisato.akita.jp",
      "gojome.akita.jp",
      "hachirogata.akita.jp",
      "happou.akita.jp",
      "higashinaruse.akita.jp",
      "honjo.akita.jp",
      "honjyo.akita.jp",
      "ikawa.akita.jp",
      "kamikoani.akita.jp",
      "kamioka.akita.jp",
      "katagami.akita.jp",
      "kazuno.akita.jp",
      "kitaakita.akita.jp",
      "kosaka.akita.jp",
      "kyowa.akita.jp",
      "misato.akita.jp",
      "mitane.akita.jp",
      "moriyoshi.akita.jp",
      "nikaho.akita.jp",
      "noshiro.akita.jp",
      "odate.akita.jp",
      "oga.akita.jp",
      "ogata.akita.jp",
      "semboku.akita.jp",
      "yokote.akita.jp",
      "yurihonjo.akita.jp",
      "aomori.aomori.jp",
      "gonohe.aomori.jp",
      "hachinohe.aomori.jp",
      "hashikami.aomori.jp",
      "hiranai.aomori.jp",
      "hirosaki.aomori.jp",
      "itayanagi.aomori.jp",
      "kuroishi.aomori.jp",
      "misawa.aomori.jp",
      "mutsu.aomori.jp",
      "nakadomari.aomori.jp",
      "noheji.aomori.jp",
      "oirase.aomori.jp",
      "owani.aomori.jp",
      "rokunohe.aomori.jp",
      "sannohe.aomori.jp",
      "shichinohe.aomori.jp",
      "shingo.aomori.jp",
      "takko.aomori.jp",
      "towada.aomori.jp",
      "tsugaru.aomori.jp",
      "tsuruta.aomori.jp",
      "abiko.chiba.jp",
      "asahi.chiba.jp",
      "chonan.chiba.jp",
      "chosei.chiba.jp",
      "choshi.chiba.jp",
      "chuo.chiba.jp",
      "funabashi.chiba.jp",
      "futtsu.chiba.jp",
      "hanamigawa.chiba.jp",
      "ichihara.chiba.jp",
      "ichikawa.chiba.jp",
      "ichinomiya.chiba.jp",
      "inzai.chiba.jp",
      "isumi.chiba.jp",
      "kamagaya.chiba.jp",
      "kamogawa.chiba.jp",
      "kashiwa.chiba.jp",
      "katori.chiba.jp",
      "katsuura.chiba.jp",
      "kimitsu.chiba.jp",
      "kisarazu.chiba.jp",
      "kozaki.chiba.jp",
      "kujukuri.chiba.jp",
      "kyonan.chiba.jp",
      "matsudo.chiba.jp",
      "midori.chiba.jp",
      "mihama.chiba.jp",
      "minamiboso.chiba.jp",
      "mobara.chiba.jp",
      "mutsuzawa.chiba.jp",
      "nagara.chiba.jp",
      "nagareyama.chiba.jp",
      "narashino.chiba.jp",
      "narita.chiba.jp",
      "noda.chiba.jp",
      "oamishirasato.chiba.jp",
      "omigawa.chiba.jp",
      "onjuku.chiba.jp",
      "otaki.chiba.jp",
      "sakae.chiba.jp",
      "sakura.chiba.jp",
      "shimofusa.chiba.jp",
      "shirako.chiba.jp",
      "shiroi.chiba.jp",
      "shisui.chiba.jp",
      "sodegaura.chiba.jp",
      "sosa.chiba.jp",
      "tako.chiba.jp",
      "tateyama.chiba.jp",
      "togane.chiba.jp",
      "tohnosho.chiba.jp",
      "tomisato.chiba.jp",
      "urayasu.chiba.jp",
      "yachimata.chiba.jp",
      "yachiyo.chiba.jp",
      "yokaichiba.chiba.jp",
      "yokoshibahikari.chiba.jp",
      "yotsukaido.chiba.jp",
      "ainan.ehime.jp",
      "honai.ehime.jp",
      "ikata.ehime.jp",
      "imabari.ehime.jp",
      "iyo.ehime.jp",
      "kamijima.ehime.jp",
      "kihoku.ehime.jp",
      "kumakogen.ehime.jp",
      "masaki.ehime.jp",
      "matsuno.ehime.jp",
      "matsuyama.ehime.jp",
      "namikata.ehime.jp",
      "niihama.ehime.jp",
      "ozu.ehime.jp",
      "saijo.ehime.jp",
      "seiyo.ehime.jp",
      "shikokuchuo.ehime.jp",
      "tobe.ehime.jp",
      "toon.ehime.jp",
      "uchiko.ehime.jp",
      "uwajima.ehime.jp",
      "yawatahama.ehime.jp",
      "echizen.fukui.jp",
      "eiheiji.fukui.jp",
      "fukui.fukui.jp",
      "ikeda.fukui.jp",
      "katsuyama.fukui.jp",
      "mihama.fukui.jp",
      "minamiechizen.fukui.jp",
      "obama.fukui.jp",
      "ohi.fukui.jp",
      "ono.fukui.jp",
      "sabae.fukui.jp",
      "sakai.fukui.jp",
      "takahama.fukui.jp",
      "tsuruga.fukui.jp",
      "wakasa.fukui.jp",
      "ashiya.fukuoka.jp",
      "buzen.fukuoka.jp",
      "chikugo.fukuoka.jp",
      "chikuho.fukuoka.jp",
      "chikujo.fukuoka.jp",
      "chikushino.fukuoka.jp",
      "chikuzen.fukuoka.jp",
      "chuo.fukuoka.jp",
      "dazaifu.fukuoka.jp",
      "fukuchi.fukuoka.jp",
      "hakata.fukuoka.jp",
      "higashi.fukuoka.jp",
      "hirokawa.fukuoka.jp",
      "hisayama.fukuoka.jp",
      "iizuka.fukuoka.jp",
      "inatsuki.fukuoka.jp",
      "kaho.fukuoka.jp",
      "kasuga.fukuoka.jp",
      "kasuya.fukuoka.jp",
      "kawara.fukuoka.jp",
      "keisen.fukuoka.jp",
      "koga.fukuoka.jp",
      "kurate.fukuoka.jp",
      "kurogi.fukuoka.jp",
      "kurume.fukuoka.jp",
      "minami.fukuoka.jp",
      "miyako.fukuoka.jp",
      "miyama.fukuoka.jp",
      "miyawaka.fukuoka.jp",
      "mizumaki.fukuoka.jp",
      "munakata.fukuoka.jp",
      "nakagawa.fukuoka.jp",
      "nakama.fukuoka.jp",
      "nishi.fukuoka.jp",
      "nogata.fukuoka.jp",
      "ogori.fukuoka.jp",
      "okagaki.fukuoka.jp",
      "okawa.fukuoka.jp",
      "oki.fukuoka.jp",
      "omuta.fukuoka.jp",
      "onga.fukuoka.jp",
      "onojo.fukuoka.jp",
      "oto.fukuoka.jp",
      "saigawa.fukuoka.jp",
      "sasaguri.fukuoka.jp",
      "shingu.fukuoka.jp",
      "shinyoshitomi.fukuoka.jp",
      "shonai.fukuoka.jp",
      "soeda.fukuoka.jp",
      "sue.fukuoka.jp",
      "tachiarai.fukuoka.jp",
      "tagawa.fukuoka.jp",
      "takata.fukuoka.jp",
      "toho.fukuoka.jp",
      "toyotsu.fukuoka.jp",
      "tsuiki.fukuoka.jp",
      "ukiha.fukuoka.jp",
      "umi.fukuoka.jp",
      "usui.fukuoka.jp",
      "yamada.fukuoka.jp",
      "yame.fukuoka.jp",
      "yanagawa.fukuoka.jp",
      "yukuhashi.fukuoka.jp",
      "aizubange.fukushima.jp",
      "aizumisato.fukushima.jp",
      "aizuwakamatsu.fukushima.jp",
      "asakawa.fukushima.jp",
      "bandai.fukushima.jp",
      "date.fukushima.jp",
      "fukushima.fukushima.jp",
      "furudono.fukushima.jp",
      "futaba.fukushima.jp",
      "hanawa.fukushima.jp",
      "higashi.fukushima.jp",
      "hirata.fukushima.jp",
      "hirono.fukushima.jp",
      "iitate.fukushima.jp",
      "inawashiro.fukushima.jp",
      "ishikawa.fukushima.jp",
      "iwaki.fukushima.jp",
      "izumizaki.fukushima.jp",
      "kagamiishi.fukushima.jp",
      "kaneyama.fukushima.jp",
      "kawamata.fukushima.jp",
      "kitakata.fukushima.jp",
      "kitashiobara.fukushima.jp",
      "koori.fukushima.jp",
      "koriyama.fukushima.jp",
      "kunimi.fukushima.jp",
      "miharu.fukushima.jp",
      "mishima.fukushima.jp",
      "namie.fukushima.jp",
      "nango.fukushima.jp",
      "nishiaizu.fukushima.jp",
      "nishigo.fukushima.jp",
      "okuma.fukushima.jp",
      "omotego.fukushima.jp",
      "ono.fukushima.jp",
      "otama.fukushima.jp",
      "samegawa.fukushima.jp",
      "shimogo.fukushima.jp",
      "shirakawa.fukushima.jp",
      "showa.fukushima.jp",
      "soma.fukushima.jp",
      "sukagawa.fukushima.jp",
      "taishin.fukushima.jp",
      "tamakawa.fukushima.jp",
      "tanagura.fukushima.jp",
      "tenei.fukushima.jp",
      "yabuki.fukushima.jp",
      "yamato.fukushima.jp",
      "yamatsuri.fukushima.jp",
      "yanaizu.fukushima.jp",
      "yugawa.fukushima.jp",
      "anpachi.gifu.jp",
      "ena.gifu.jp",
      "gifu.gifu.jp",
      "ginan.gifu.jp",
      "godo.gifu.jp",
      "gujo.gifu.jp",
      "hashima.gifu.jp",
      "hichiso.gifu.jp",
      "hida.gifu.jp",
      "higashishirakawa.gifu.jp",
      "ibigawa.gifu.jp",
      "ikeda.gifu.jp",
      "kakamigahara.gifu.jp",
      "kani.gifu.jp",
      "kasahara.gifu.jp",
      "kasamatsu.gifu.jp",
      "kawaue.gifu.jp",
      "kitagata.gifu.jp",
      "mino.gifu.jp",
      "minokamo.gifu.jp",
      "mitake.gifu.jp",
      "mizunami.gifu.jp",
      "motosu.gifu.jp",
      "nakatsugawa.gifu.jp",
      "ogaki.gifu.jp",
      "sakahogi.gifu.jp",
      "seki.gifu.jp",
      "sekigahara.gifu.jp",
      "shirakawa.gifu.jp",
      "tajimi.gifu.jp",
      "takayama.gifu.jp",
      "tarui.gifu.jp",
      "toki.gifu.jp",
      "tomika.gifu.jp",
      "wanouchi.gifu.jp",
      "yamagata.gifu.jp",
      "yaotsu.gifu.jp",
      "yoro.gifu.jp",
      "annaka.gunma.jp",
      "chiyoda.gunma.jp",
      "fujioka.gunma.jp",
      "higashiagatsuma.gunma.jp",
      "isesaki.gunma.jp",
      "itakura.gunma.jp",
      "kanna.gunma.jp",
      "kanra.gunma.jp",
      "katashina.gunma.jp",
      "kawaba.gunma.jp",
      "kiryu.gunma.jp",
      "kusatsu.gunma.jp",
      "maebashi.gunma.jp",
      "meiwa.gunma.jp",
      "midori.gunma.jp",
      "minakami.gunma.jp",
      "naganohara.gunma.jp",
      "nakanojo.gunma.jp",
      "nanmoku.gunma.jp",
      "numata.gunma.jp",
      "oizumi.gunma.jp",
      "ora.gunma.jp",
      "ota.gunma.jp",
      "shibukawa.gunma.jp",
      "shimonita.gunma.jp",
      "shinto.gunma.jp",
      "showa.gunma.jp",
      "takasaki.gunma.jp",
      "takayama.gunma.jp",
      "tamamura.gunma.jp",
      "tatebayashi.gunma.jp",
      "tomioka.gunma.jp",
      "tsukiyono.gunma.jp",
      "tsumagoi.gunma.jp",
      "ueno.gunma.jp",
      "yoshioka.gunma.jp",
      "asaminami.hiroshima.jp",
      "daiwa.hiroshima.jp",
      "etajima.hiroshima.jp",
      "fuchu.hiroshima.jp",
      "fukuyama.hiroshima.jp",
      "hatsukaichi.hiroshima.jp",
      "higashihiroshima.hiroshima.jp",
      "hongo.hiroshima.jp",
      "jinsekikogen.hiroshima.jp",
      "kaita.hiroshima.jp",
      "kui.hiroshima.jp",
      "kumano.hiroshima.jp",
      "kure.hiroshima.jp",
      "mihara.hiroshima.jp",
      "miyoshi.hiroshima.jp",
      "naka.hiroshima.jp",
      "onomichi.hiroshima.jp",
      "osakikamijima.hiroshima.jp",
      "otake.hiroshima.jp",
      "saka.hiroshima.jp",
      "sera.hiroshima.jp",
      "seranishi.hiroshima.jp",
      "shinichi.hiroshima.jp",
      "shobara.hiroshima.jp",
      "takehara.hiroshima.jp",
      "abashiri.hokkaido.jp",
      "abira.hokkaido.jp",
      "aibetsu.hokkaido.jp",
      "akabira.hokkaido.jp",
      "akkeshi.hokkaido.jp",
      "asahikawa.hokkaido.jp",
      "ashibetsu.hokkaido.jp",
      "ashoro.hokkaido.jp",
      "assabu.hokkaido.jp",
      "atsuma.hokkaido.jp",
      "bibai.hokkaido.jp",
      "biei.hokkaido.jp",
      "bifuka.hokkaido.jp",
      "bihoro.hokkaido.jp",
      "biratori.hokkaido.jp",
      "chippubetsu.hokkaido.jp",
      "chitose.hokkaido.jp",
      "date.hokkaido.jp",
      "ebetsu.hokkaido.jp",
      "embetsu.hokkaido.jp",
      "eniwa.hokkaido.jp",
      "erimo.hokkaido.jp",
      "esan.hokkaido.jp",
      "esashi.hokkaido.jp",
      "fukagawa.hokkaido.jp",
      "fukushima.hokkaido.jp",
      "furano.hokkaido.jp",
      "furubira.hokkaido.jp",
      "haboro.hokkaido.jp",
      "hakodate.hokkaido.jp",
      "hamatonbetsu.hokkaido.jp",
      "hidaka.hokkaido.jp",
      "higashikagura.hokkaido.jp",
      "higashikawa.hokkaido.jp",
      "hiroo.hokkaido.jp",
      "hokuryu.hokkaido.jp",
      "hokuto.hokkaido.jp",
      "honbetsu.hokkaido.jp",
      "horokanai.hokkaido.jp",
      "horonobe.hokkaido.jp",
      "ikeda.hokkaido.jp",
      "imakane.hokkaido.jp",
      "ishikari.hokkaido.jp",
      "iwamizawa.hokkaido.jp",
      "iwanai.hokkaido.jp",
      "kamifurano.hokkaido.jp",
      "kamikawa.hokkaido.jp",
      "kamishihoro.hokkaido.jp",
      "kamisunagawa.hokkaido.jp",
      "kamoenai.hokkaido.jp",
      "kayabe.hokkaido.jp",
      "kembuchi.hokkaido.jp",
      "kikonai.hokkaido.jp",
      "kimobetsu.hokkaido.jp",
      "kitahiroshima.hokkaido.jp",
      "kitami.hokkaido.jp",
      "kiyosato.hokkaido.jp",
      "koshimizu.hokkaido.jp",
      "kunneppu.hokkaido.jp",
      "kuriyama.hokkaido.jp",
      "kuromatsunai.hokkaido.jp",
      "kushiro.hokkaido.jp",
      "kutchan.hokkaido.jp",
      "kyowa.hokkaido.jp",
      "mashike.hokkaido.jp",
      "matsumae.hokkaido.jp",
      "mikasa.hokkaido.jp",
      "minamifurano.hokkaido.jp",
      "mombetsu.hokkaido.jp",
      "moseushi.hokkaido.jp",
      "mukawa.hokkaido.jp",
      "muroran.hokkaido.jp",
      "naie.hokkaido.jp",
      "nakagawa.hokkaido.jp",
      "nakasatsunai.hokkaido.jp",
      "nakatombetsu.hokkaido.jp",
      "nanae.hokkaido.jp",
      "nanporo.hokkaido.jp",
      "nayoro.hokkaido.jp",
      "nemuro.hokkaido.jp",
      "niikappu.hokkaido.jp",
      "niki.hokkaido.jp",
      "nishiokoppe.hokkaido.jp",
      "noboribetsu.hokkaido.jp",
      "numata.hokkaido.jp",
      "obihiro.hokkaido.jp",
      "obira.hokkaido.jp",
      "oketo.hokkaido.jp",
      "okoppe.hokkaido.jp",
      "otaru.hokkaido.jp",
      "otobe.hokkaido.jp",
      "otofuke.hokkaido.jp",
      "otoineppu.hokkaido.jp",
      "oumu.hokkaido.jp",
      "ozora.hokkaido.jp",
      "pippu.hokkaido.jp",
      "rankoshi.hokkaido.jp",
      "rebun.hokkaido.jp",
      "rikubetsu.hokkaido.jp",
      "rishiri.hokkaido.jp",
      "rishirifuji.hokkaido.jp",
      "saroma.hokkaido.jp",
      "sarufutsu.hokkaido.jp",
      "shakotan.hokkaido.jp",
      "shari.hokkaido.jp",
      "shibecha.hokkaido.jp",
      "shibetsu.hokkaido.jp",
      "shikabe.hokkaido.jp",
      "shikaoi.hokkaido.jp",
      "shimamaki.hokkaido.jp",
      "shimizu.hokkaido.jp",
      "shimokawa.hokkaido.jp",
      "shinshinotsu.hokkaido.jp",
      "shintoku.hokkaido.jp",
      "shiranuka.hokkaido.jp",
      "shiraoi.hokkaido.jp",
      "shiriuchi.hokkaido.jp",
      "sobetsu.hokkaido.jp",
      "sunagawa.hokkaido.jp",
      "taiki.hokkaido.jp",
      "takasu.hokkaido.jp",
      "takikawa.hokkaido.jp",
      "takinoue.hokkaido.jp",
      "teshikaga.hokkaido.jp",
      "tobetsu.hokkaido.jp",
      "tohma.hokkaido.jp",
      "tomakomai.hokkaido.jp",
      "tomari.hokkaido.jp",
      "toya.hokkaido.jp",
      "toyako.hokkaido.jp",
      "toyotomi.hokkaido.jp",
      "toyoura.hokkaido.jp",
      "tsubetsu.hokkaido.jp",
      "tsukigata.hokkaido.jp",
      "urakawa.hokkaido.jp",
      "urausu.hokkaido.jp",
      "uryu.hokkaido.jp",
      "utashinai.hokkaido.jp",
      "wakkanai.hokkaido.jp",
      "wassamu.hokkaido.jp",
      "yakumo.hokkaido.jp",
      "yoichi.hokkaido.jp",
      "aioi.hyogo.jp",
      "akashi.hyogo.jp",
      "ako.hyogo.jp",
      "amagasaki.hyogo.jp",
      "aogaki.hyogo.jp",
      "asago.hyogo.jp",
      "ashiya.hyogo.jp",
      "awaji.hyogo.jp",
      "fukusaki.hyogo.jp",
      "goshiki.hyogo.jp",
      "harima.hyogo.jp",
      "himeji.hyogo.jp",
      "ichikawa.hyogo.jp",
      "inagawa.hyogo.jp",
      "itami.hyogo.jp",
      "kakogawa.hyogo.jp",
      "kamigori.hyogo.jp",
      "kamikawa.hyogo.jp",
      "kasai.hyogo.jp",
      "kasuga.hyogo.jp",
      "kawanishi.hyogo.jp",
      "miki.hyogo.jp",
      "minamiawaji.hyogo.jp",
      "nishinomiya.hyogo.jp",
      "nishiwaki.hyogo.jp",
      "ono.hyogo.jp",
      "sanda.hyogo.jp",
      "sannan.hyogo.jp",
      "sasayama.hyogo.jp",
      "sayo.hyogo.jp",
      "shingu.hyogo.jp",
      "shinonsen.hyogo.jp",
      "shiso.hyogo.jp",
      "sumoto.hyogo.jp",
      "taishi.hyogo.jp",
      "taka.hyogo.jp",
      "takarazuka.hyogo.jp",
      "takasago.hyogo.jp",
      "takino.hyogo.jp",
      "tamba.hyogo.jp",
      "tatsuno.hyogo.jp",
      "toyooka.hyogo.jp",
      "yabu.hyogo.jp",
      "yashiro.hyogo.jp",
      "yoka.hyogo.jp",
      "yokawa.hyogo.jp",
      "ami.ibaraki.jp",
      "asahi.ibaraki.jp",
      "bando.ibaraki.jp",
      "chikusei.ibaraki.jp",
      "daigo.ibaraki.jp",
      "fujishiro.ibaraki.jp",
      "hitachi.ibaraki.jp",
      "hitachinaka.ibaraki.jp",
      "hitachiomiya.ibaraki.jp",
      "hitachiota.ibaraki.jp",
      "ibaraki.ibaraki.jp",
      "ina.ibaraki.jp",
      "inashiki.ibaraki.jp",
      "itako.ibaraki.jp",
      "iwama.ibaraki.jp",
      "joso.ibaraki.jp",
      "kamisu.ibaraki.jp",
      "kasama.ibaraki.jp",
      "kashima.ibaraki.jp",
      "kasumigaura.ibaraki.jp",
      "koga.ibaraki.jp",
      "miho.ibaraki.jp",
      "mito.ibaraki.jp",
      "moriya.ibaraki.jp",
      "naka.ibaraki.jp",
      "namegata.ibaraki.jp",
      "oarai.ibaraki.jp",
      "ogawa.ibaraki.jp",
      "omitama.ibaraki.jp",
      "ryugasaki.ibaraki.jp",
      "sakai.ibaraki.jp",
      "sakuragawa.ibaraki.jp",
      "shimodate.ibaraki.jp",
      "shimotsuma.ibaraki.jp",
      "shirosato.ibaraki.jp",
      "sowa.ibaraki.jp",
      "suifu.ibaraki.jp",
      "takahagi.ibaraki.jp",
      "tamatsukuri.ibaraki.jp",
      "tokai.ibaraki.jp",
      "tomobe.ibaraki.jp",
      "tone.ibaraki.jp",
      "toride.ibaraki.jp",
      "tsuchiura.ibaraki.jp",
      "tsukuba.ibaraki.jp",
      "uchihara.ibaraki.jp",
      "ushiku.ibaraki.jp",
      "yachiyo.ibaraki.jp",
      "yamagata.ibaraki.jp",
      "yawara.ibaraki.jp",
      "yuki.ibaraki.jp",
      "anamizu.ishikawa.jp",
      "hakui.ishikawa.jp",
      "hakusan.ishikawa.jp",
      "kaga.ishikawa.jp",
      "kahoku.ishikawa.jp",
      "kanazawa.ishikawa.jp",
      "kawakita.ishikawa.jp",
      "komatsu.ishikawa.jp",
      "nakanoto.ishikawa.jp",
      "nanao.ishikawa.jp",
      "nomi.ishikawa.jp",
      "nonoichi.ishikawa.jp",
      "noto.ishikawa.jp",
      "shika.ishikawa.jp",
      "suzu.ishikawa.jp",
      "tsubata.ishikawa.jp",
      "tsurugi.ishikawa.jp",
      "uchinada.ishikawa.jp",
      "wajima.ishikawa.jp",
      "fudai.iwate.jp",
      "fujisawa.iwate.jp",
      "hanamaki.iwate.jp",
      "hiraizumi.iwate.jp",
      "hirono.iwate.jp",
      "ichinohe.iwate.jp",
      "ichinoseki.iwate.jp",
      "iwaizumi.iwate.jp",
      "iwate.iwate.jp",
      "joboji.iwate.jp",
      "kamaishi.iwate.jp",
      "kanegasaki.iwate.jp",
      "karumai.iwate.jp",
      "kawai.iwate.jp",
      "kitakami.iwate.jp",
      "kuji.iwate.jp",
      "kunohe.iwate.jp",
      "kuzumaki.iwate.jp",
      "miyako.iwate.jp",
      "mizusawa.iwate.jp",
      "morioka.iwate.jp",
      "ninohe.iwate.jp",
      "noda.iwate.jp",
      "ofunato.iwate.jp",
      "oshu.iwate.jp",
      "otsuchi.iwate.jp",
      "rikuzentakata.iwate.jp",
      "shiwa.iwate.jp",
      "shizukuishi.iwate.jp",
      "sumita.iwate.jp",
      "tanohata.iwate.jp",
      "tono.iwate.jp",
      "yahaba.iwate.jp",
      "yamada.iwate.jp",
      "ayagawa.kagawa.jp",
      "higashikagawa.kagawa.jp",
      "kanonji.kagawa.jp",
      "kotohira.kagawa.jp",
      "manno.kagawa.jp",
      "marugame.kagawa.jp",
      "mitoyo.kagawa.jp",
      "naoshima.kagawa.jp",
      "sanuki.kagawa.jp",
      "tadotsu.kagawa.jp",
      "takamatsu.kagawa.jp",
      "tonosho.kagawa.jp",
      "uchinomi.kagawa.jp",
      "utazu.kagawa.jp",
      "zentsuji.kagawa.jp",
      "akune.kagoshima.jp",
      "amami.kagoshima.jp",
      "hioki.kagoshima.jp",
      "isa.kagoshima.jp",
      "isen.kagoshima.jp",
      "izumi.kagoshima.jp",
      "kagoshima.kagoshima.jp",
      "kanoya.kagoshima.jp",
      "kawanabe.kagoshima.jp",
      "kinko.kagoshima.jp",
      "kouyama.kagoshima.jp",
      "makurazaki.kagoshima.jp",
      "matsumoto.kagoshima.jp",
      "minamitane.kagoshima.jp",
      "nakatane.kagoshima.jp",
      "nishinoomote.kagoshima.jp",
      "satsumasendai.kagoshima.jp",
      "soo.kagoshima.jp",
      "tarumizu.kagoshima.jp",
      "yusui.kagoshima.jp",
      "aikawa.kanagawa.jp",
      "atsugi.kanagawa.jp",
      "ayase.kanagawa.jp",
      "chigasaki.kanagawa.jp",
      "ebina.kanagawa.jp",
      "fujisawa.kanagawa.jp",
      "hadano.kanagawa.jp",
      "hakone.kanagawa.jp",
      "hiratsuka.kanagawa.jp",
      "isehara.kanagawa.jp",
      "kaisei.kanagawa.jp",
      "kamakura.kanagawa.jp",
      "kiyokawa.kanagawa.jp",
      "matsuda.kanagawa.jp",
      "minamiashigara.kanagawa.jp",
      "miura.kanagawa.jp",
      "nakai.kanagawa.jp",
      "ninomiya.kanagawa.jp",
      "odawara.kanagawa.jp",
      "oi.kanagawa.jp",
      "oiso.kanagawa.jp",
      "sagamihara.kanagawa.jp",
      "samukawa.kanagawa.jp",
      "tsukui.kanagawa.jp",
      "yamakita.kanagawa.jp",
      "yamato.kanagawa.jp",
      "yokosuka.kanagawa.jp",
      "yugawara.kanagawa.jp",
      "zama.kanagawa.jp",
      "zushi.kanagawa.jp",
      "aki.kochi.jp",
      "geisei.kochi.jp",
      "hidaka.kochi.jp",
      "higashitsuno.kochi.jp",
      "ino.kochi.jp",
      "kagami.kochi.jp",
      "kami.kochi.jp",
      "kitagawa.kochi.jp",
      "kochi.kochi.jp",
      "mihara.kochi.jp",
      "motoyama.kochi.jp",
      "muroto.kochi.jp",
      "nahari.kochi.jp",
      "nakamura.kochi.jp",
      "nankoku.kochi.jp",
      "nishitosa.kochi.jp",
      "niyodogawa.kochi.jp",
      "ochi.kochi.jp",
      "okawa.kochi.jp",
      "otoyo.kochi.jp",
      "otsuki.kochi.jp",
      "sakawa.kochi.jp",
      "sukumo.kochi.jp",
      "susaki.kochi.jp",
      "tosa.kochi.jp",
      "tosashimizu.kochi.jp",
      "toyo.kochi.jp",
      "tsuno.kochi.jp",
      "umaji.kochi.jp",
      "yasuda.kochi.jp",
      "yusuhara.kochi.jp",
      "amakusa.kumamoto.jp",
      "arao.kumamoto.jp",
      "aso.kumamoto.jp",
      "choyo.kumamoto.jp",
      "gyokuto.kumamoto.jp",
      "kamiamakusa.kumamoto.jp",
      "kikuchi.kumamoto.jp",
      "kumamoto.kumamoto.jp",
      "mashiki.kumamoto.jp",
      "mifune.kumamoto.jp",
      "minamata.kumamoto.jp",
      "minamioguni.kumamoto.jp",
      "nagasu.kumamoto.jp",
      "nishihara.kumamoto.jp",
      "oguni.kumamoto.jp",
      "ozu.kumamoto.jp",
      "sumoto.kumamoto.jp",
      "takamori.kumamoto.jp",
      "uki.kumamoto.jp",
      "uto.kumamoto.jp",
      "yamaga.kumamoto.jp",
      "yamato.kumamoto.jp",
      "yatsushiro.kumamoto.jp",
      "ayabe.kyoto.jp",
      "fukuchiyama.kyoto.jp",
      "higashiyama.kyoto.jp",
      "ide.kyoto.jp",
      "ine.kyoto.jp",
      "joyo.kyoto.jp",
      "kameoka.kyoto.jp",
      "kamo.kyoto.jp",
      "kita.kyoto.jp",
      "kizu.kyoto.jp",
      "kumiyama.kyoto.jp",
      "kyotamba.kyoto.jp",
      "kyotanabe.kyoto.jp",
      "kyotango.kyoto.jp",
      "maizuru.kyoto.jp",
      "minami.kyoto.jp",
      "minamiyamashiro.kyoto.jp",
      "miyazu.kyoto.jp",
      "muko.kyoto.jp",
      "nagaokakyo.kyoto.jp",
      "nakagyo.kyoto.jp",
      "nantan.kyoto.jp",
      "oyamazaki.kyoto.jp",
      "sakyo.kyoto.jp",
      "seika.kyoto.jp",
      "tanabe.kyoto.jp",
      "uji.kyoto.jp",
      "ujitawara.kyoto.jp",
      "wazuka.kyoto.jp",
      "yamashina.kyoto.jp",
      "yawata.kyoto.jp",
      "asahi.mie.jp",
      "inabe.mie.jp",
      "ise.mie.jp",
      "kameyama.mie.jp",
      "kawagoe.mie.jp",
      "kiho.mie.jp",
      "kisosaki.mie.jp",
      "kiwa.mie.jp",
      "komono.mie.jp",
      "kumano.mie.jp",
      "kuwana.mie.jp",
      "matsusaka.mie.jp",
      "meiwa.mie.jp",
      "mihama.mie.jp",
      "minamiise.mie.jp",
      "misugi.mie.jp",
      "miyama.mie.jp",
      "nabari.mie.jp",
      "shima.mie.jp",
      "suzuka.mie.jp",
      "tado.mie.jp",
      "taiki.mie.jp",
      "taki.mie.jp",
      "tamaki.mie.jp",
      "toba.mie.jp",
      "tsu.mie.jp",
      "udono.mie.jp",
      "ureshino.mie.jp",
      "watarai.mie.jp",
      "yokkaichi.mie.jp",
      "furukawa.miyagi.jp",
      "higashimatsushima.miyagi.jp",
      "ishinomaki.miyagi.jp",
      "iwanuma.miyagi.jp",
      "kakuda.miyagi.jp",
      "kami.miyagi.jp",
      "kawasaki.miyagi.jp",
      "marumori.miyagi.jp",
      "matsushima.miyagi.jp",
      "minamisanriku.miyagi.jp",
      "misato.miyagi.jp",
      "murata.miyagi.jp",
      "natori.miyagi.jp",
      "ogawara.miyagi.jp",
      "ohira.miyagi.jp",
      "onagawa.miyagi.jp",
      "osaki.miyagi.jp",
      "rifu.miyagi.jp",
      "semine.miyagi.jp",
      "shibata.miyagi.jp",
      "shichikashuku.miyagi.jp",
      "shikama.miyagi.jp",
      "shiogama.miyagi.jp",
      "shiroishi.miyagi.jp",
      "tagajo.miyagi.jp",
      "taiwa.miyagi.jp",
      "tome.miyagi.jp",
      "tomiya.miyagi.jp",
      "wakuya.miyagi.jp",
      "watari.miyagi.jp",
      "yamamoto.miyagi.jp",
      "zao.miyagi.jp",
      "aya.miyazaki.jp",
      "ebino.miyazaki.jp",
      "gokase.miyazaki.jp",
      "hyuga.miyazaki.jp",
      "kadogawa.miyazaki.jp",
      "kawaminami.miyazaki.jp",
      "kijo.miyazaki.jp",
      "kitagawa.miyazaki.jp",
      "kitakata.miyazaki.jp",
      "kitaura.miyazaki.jp",
      "kobayashi.miyazaki.jp",
      "kunitomi.miyazaki.jp",
      "kushima.miyazaki.jp",
      "mimata.miyazaki.jp",
      "miyakonojo.miyazaki.jp",
      "miyazaki.miyazaki.jp",
      "morotsuka.miyazaki.jp",
      "nichinan.miyazaki.jp",
      "nishimera.miyazaki.jp",
      "nobeoka.miyazaki.jp",
      "saito.miyazaki.jp",
      "shiiba.miyazaki.jp",
      "shintomi.miyazaki.jp",
      "takaharu.miyazaki.jp",
      "takanabe.miyazaki.jp",
      "takazaki.miyazaki.jp",
      "tsuno.miyazaki.jp",
      "achi.nagano.jp",
      "agematsu.nagano.jp",
      "anan.nagano.jp",
      "aoki.nagano.jp",
      "asahi.nagano.jp",
      "azumino.nagano.jp",
      "chikuhoku.nagano.jp",
      "chikuma.nagano.jp",
      "chino.nagano.jp",
      "fujimi.nagano.jp",
      "hakuba.nagano.jp",
      "hara.nagano.jp",
      "hiraya.nagano.jp",
      "iida.nagano.jp",
      "iijima.nagano.jp",
      "iiyama.nagano.jp",
      "iizuna.nagano.jp",
      "ikeda.nagano.jp",
      "ikusaka.nagano.jp",
      "ina.nagano.jp",
      "karuizawa.nagano.jp",
      "kawakami.nagano.jp",
      "kiso.nagano.jp",
      "kisofukushima.nagano.jp",
      "kitaaiki.nagano.jp",
      "komagane.nagano.jp",
      "komoro.nagano.jp",
      "matsukawa.nagano.jp",
      "matsumoto.nagano.jp",
      "miasa.nagano.jp",
      "minamiaiki.nagano.jp",
      "minamimaki.nagano.jp",
      "minamiminowa.nagano.jp",
      "minowa.nagano.jp",
      "miyada.nagano.jp",
      "miyota.nagano.jp",
      "mochizuki.nagano.jp",
      "nagano.nagano.jp",
      "nagawa.nagano.jp",
      "nagiso.nagano.jp",
      "nakagawa.nagano.jp",
      "nakano.nagano.jp",
      "nozawaonsen.nagano.jp",
      "obuse.nagano.jp",
      "ogawa.nagano.jp",
      "okaya.nagano.jp",
      "omachi.nagano.jp",
      "omi.nagano.jp",
      "ookuwa.nagano.jp",
      "ooshika.nagano.jp",
      "otaki.nagano.jp",
      "otari.nagano.jp",
      "sakae.nagano.jp",
      "sakaki.nagano.jp",
      "saku.nagano.jp",
      "sakuho.nagano.jp",
      "shimosuwa.nagano.jp",
      "shinanomachi.nagano.jp",
      "shiojiri.nagano.jp",
      "suwa.nagano.jp",
      "suzaka.nagano.jp",
      "takagi.nagano.jp",
      "takamori.nagano.jp",
      "takayama.nagano.jp",
      "tateshina.nagano.jp",
      "tatsuno.nagano.jp",
      "togakushi.nagano.jp",
      "togura.nagano.jp",
      "tomi.nagano.jp",
      "ueda.nagano.jp",
      "wada.nagano.jp",
      "yamagata.nagano.jp",
      "yamanouchi.nagano.jp",
      "yasaka.nagano.jp",
      "yasuoka.nagano.jp",
      "chijiwa.nagasaki.jp",
      "futsu.nagasaki.jp",
      "goto.nagasaki.jp",
      "hasami.nagasaki.jp",
      "hirado.nagasaki.jp",
      "iki.nagasaki.jp",
      "isahaya.nagasaki.jp",
      "kawatana.nagasaki.jp",
      "kuchinotsu.nagasaki.jp",
      "matsuura.nagasaki.jp",
      "nagasaki.nagasaki.jp",
      "obama.nagasaki.jp",
      "omura.nagasaki.jp",
      "oseto.nagasaki.jp",
      "saikai.nagasaki.jp",
      "sasebo.nagasaki.jp",
      "seihi.nagasaki.jp",
      "shimabara.nagasaki.jp",
      "shinkamigoto.nagasaki.jp",
      "togitsu.nagasaki.jp",
      "tsushima.nagasaki.jp",
      "unzen.nagasaki.jp",
      "ando.nara.jp",
      "gose.nara.jp",
      "heguri.nara.jp",
      "higashiyoshino.nara.jp",
      "ikaruga.nara.jp",
      "ikoma.nara.jp",
      "kamikitayama.nara.jp",
      "kanmaki.nara.jp",
      "kashiba.nara.jp",
      "kashihara.nara.jp",
      "katsuragi.nara.jp",
      "kawai.nara.jp",
      "kawakami.nara.jp",
      "kawanishi.nara.jp",
      "koryo.nara.jp",
      "kurotaki.nara.jp",
      "mitsue.nara.jp",
      "miyake.nara.jp",
      "nara.nara.jp",
      "nosegawa.nara.jp",
      "oji.nara.jp",
      "ouda.nara.jp",
      "oyodo.nara.jp",
      "sakurai.nara.jp",
      "sango.nara.jp",
      "shimoichi.nara.jp",
      "shimokitayama.nara.jp",
      "shinjo.nara.jp",
      "soni.nara.jp",
      "takatori.nara.jp",
      "tawaramoto.nara.jp",
      "tenkawa.nara.jp",
      "tenri.nara.jp",
      "uda.nara.jp",
      "yamatokoriyama.nara.jp",
      "yamatotakada.nara.jp",
      "yamazoe.nara.jp",
      "yoshino.nara.jp",
      "aga.niigata.jp",
      "agano.niigata.jp",
      "gosen.niigata.jp",
      "itoigawa.niigata.jp",
      "izumozaki.niigata.jp",
      "joetsu.niigata.jp",
      "kamo.niigata.jp",
      "kariwa.niigata.jp",
      "kashiwazaki.niigata.jp",
      "minamiuonuma.niigata.jp",
      "mitsuke.niigata.jp",
      "muika.niigata.jp",
      "murakami.niigata.jp",
      "myoko.niigata.jp",
      "nagaoka.niigata.jp",
      "niigata.niigata.jp",
      "ojiya.niigata.jp",
      "omi.niigata.jp",
      "sado.niigata.jp",
      "sanjo.niigata.jp",
      "seiro.niigata.jp",
      "seirou.niigata.jp",
      "sekikawa.niigata.jp",
      "shibata.niigata.jp",
      "tagami.niigata.jp",
      "tainai.niigata.jp",
      "tochio.niigata.jp",
      "tokamachi.niigata.jp",
      "tsubame.niigata.jp",
      "tsunan.niigata.jp",
      "uonuma.niigata.jp",
      "yahiko.niigata.jp",
      "yoita.niigata.jp",
      "yuzawa.niigata.jp",
      "beppu.oita.jp",
      "bungoono.oita.jp",
      "bungotakada.oita.jp",
      "hasama.oita.jp",
      "hiji.oita.jp",
      "himeshima.oita.jp",
      "hita.oita.jp",
      "kamitsue.oita.jp",
      "kokonoe.oita.jp",
      "kuju.oita.jp",
      "kunisaki.oita.jp",
      "kusu.oita.jp",
      "oita.oita.jp",
      "saiki.oita.jp",
      "taketa.oita.jp",
      "tsukumi.oita.jp",
      "usa.oita.jp",
      "usuki.oita.jp",
      "yufu.oita.jp",
      "akaiwa.okayama.jp",
      "asakuchi.okayama.jp",
      "bizen.okayama.jp",
      "hayashima.okayama.jp",
      "ibara.okayama.jp",
      "kagamino.okayama.jp",
      "kasaoka.okayama.jp",
      "kibichuo.okayama.jp",
      "kumenan.okayama.jp",
      "kurashiki.okayama.jp",
      "maniwa.okayama.jp",
      "misaki.okayama.jp",
      "nagi.okayama.jp",
      "niimi.okayama.jp",
      "nishiawakura.okayama.jp",
      "okayama.okayama.jp",
      "satosho.okayama.jp",
      "setouchi.okayama.jp",
      "shinjo.okayama.jp",
      "shoo.okayama.jp",
      "soja.okayama.jp",
      "takahashi.okayama.jp",
      "tamano.okayama.jp",
      "tsuyama.okayama.jp",
      "wake.okayama.jp",
      "yakage.okayama.jp",
      "aguni.okinawa.jp",
      "ginowan.okinawa.jp",
      "ginoza.okinawa.jp",
      "gushikami.okinawa.jp",
      "haebaru.okinawa.jp",
      "higashi.okinawa.jp",
      "hirara.okinawa.jp",
      "iheya.okinawa.jp",
      "ishigaki.okinawa.jp",
      "ishikawa.okinawa.jp",
      "itoman.okinawa.jp",
      "izena.okinawa.jp",
      "kadena.okinawa.jp",
      "kin.okinawa.jp",
      "kitadaito.okinawa.jp",
      "kitanakagusuku.okinawa.jp",
      "kumejima.okinawa.jp",
      "kunigami.okinawa.jp",
      "minamidaito.okinawa.jp",
      "motobu.okinawa.jp",
      "nago.okinawa.jp",
      "naha.okinawa.jp",
      "nakagusuku.okinawa.jp",
      "nakijin.okinawa.jp",
      "nanjo.okinawa.jp",
      "nishihara.okinawa.jp",
      "ogimi.okinawa.jp",
      "okinawa.okinawa.jp",
      "onna.okinawa.jp",
      "shimoji.okinawa.jp",
      "taketomi.okinawa.jp",
      "tarama.okinawa.jp",
      "tokashiki.okinawa.jp",
      "tomigusuku.okinawa.jp",
      "tonaki.okinawa.jp",
      "urasoe.okinawa.jp",
      "uruma.okinawa.jp",
      "yaese.okinawa.jp",
      "yomitan.okinawa.jp",
      "yonabaru.okinawa.jp",
      "yonaguni.okinawa.jp",
      "zamami.okinawa.jp",
      "abeno.osaka.jp",
      "chihayaakasaka.osaka.jp",
      "chuo.osaka.jp",
      "daito.osaka.jp",
      "fujiidera.osaka.jp",
      "habikino.osaka.jp",
      "hannan.osaka.jp",
      "higashiosaka.osaka.jp",
      "higashisumiyoshi.osaka.jp",
      "higashiyodogawa.osaka.jp",
      "hirakata.osaka.jp",
      "ibaraki.osaka.jp",
      "ikeda.osaka.jp",
      "izumi.osaka.jp",
      "izumiotsu.osaka.jp",
      "izumisano.osaka.jp",
      "kadoma.osaka.jp",
      "kaizuka.osaka.jp",
      "kanan.osaka.jp",
      "kashiwara.osaka.jp",
      "katano.osaka.jp",
      "kawachinagano.osaka.jp",
      "kishiwada.osaka.jp",
      "kita.osaka.jp",
      "kumatori.osaka.jp",
      "matsubara.osaka.jp",
      "minato.osaka.jp",
      "minoh.osaka.jp",
      "misaki.osaka.jp",
      "moriguchi.osaka.jp",
      "neyagawa.osaka.jp",
      "nishi.osaka.jp",
      "nose.osaka.jp",
      "osakasayama.osaka.jp",
      "sakai.osaka.jp",
      "sayama.osaka.jp",
      "sennan.osaka.jp",
      "settsu.osaka.jp",
      "shijonawate.osaka.jp",
      "shimamoto.osaka.jp",
      "suita.osaka.jp",
      "tadaoka.osaka.jp",
      "taishi.osaka.jp",
      "tajiri.osaka.jp",
      "takaishi.osaka.jp",
      "takatsuki.osaka.jp",
      "tondabayashi.osaka.jp",
      "toyonaka.osaka.jp",
      "toyono.osaka.jp",
      "yao.osaka.jp",
      "ariake.saga.jp",
      "arita.saga.jp",
      "fukudomi.saga.jp",
      "genkai.saga.jp",
      "hamatama.saga.jp",
      "hizen.saga.jp",
      "imari.saga.jp",
      "kamimine.saga.jp",
      "kanzaki.saga.jp",
      "karatsu.saga.jp",
      "kashima.saga.jp",
      "kitagata.saga.jp",
      "kitahata.saga.jp",
      "kiyama.saga.jp",
      "kouhoku.saga.jp",
      "kyuragi.saga.jp",
      "nishiarita.saga.jp",
      "ogi.saga.jp",
      "omachi.saga.jp",
      "ouchi.saga.jp",
      "saga.saga.jp",
      "shiroishi.saga.jp",
      "taku.saga.jp",
      "tara.saga.jp",
      "tosu.saga.jp",
      "yoshinogari.saga.jp",
      "arakawa.saitama.jp",
      "asaka.saitama.jp",
      "chichibu.saitama.jp",
      "fujimi.saitama.jp",
      "fujimino.saitama.jp",
      "fukaya.saitama.jp",
      "hanno.saitama.jp",
      "hanyu.saitama.jp",
      "hasuda.saitama.jp",
      "hatogaya.saitama.jp",
      "hatoyama.saitama.jp",
      "hidaka.saitama.jp",
      "higashichichibu.saitama.jp",
      "higashimatsuyama.saitama.jp",
      "honjo.saitama.jp",
      "ina.saitama.jp",
      "iruma.saitama.jp",
      "iwatsuki.saitama.jp",
      "kamiizumi.saitama.jp",
      "kamikawa.saitama.jp",
      "kamisato.saitama.jp",
      "kasukabe.saitama.jp",
      "kawagoe.saitama.jp",
      "kawaguchi.saitama.jp",
      "kawajima.saitama.jp",
      "kazo.saitama.jp",
      "kitamoto.saitama.jp",
      "koshigaya.saitama.jp",
      "kounosu.saitama.jp",
      "kuki.saitama.jp",
      "kumagaya.saitama.jp",
      "matsubushi.saitama.jp",
      "minano.saitama.jp",
      "misato.saitama.jp",
      "miyashiro.saitama.jp",
      "miyoshi.saitama.jp",
      "moroyama.saitama.jp",
      "nagatoro.saitama.jp",
      "namegawa.saitama.jp",
      "niiza.saitama.jp",
      "ogano.saitama.jp",
      "ogawa.saitama.jp",
      "ogose.saitama.jp",
      "okegawa.saitama.jp",
      "omiya.saitama.jp",
      "otaki.saitama.jp",
      "ranzan.saitama.jp",
      "ryokami.saitama.jp",
      "saitama.saitama.jp",
      "sakado.saitama.jp",
      "satte.saitama.jp",
      "sayama.saitama.jp",
      "shiki.saitama.jp",
      "shiraoka.saitama.jp",
      "soka.saitama.jp",
      "sugito.saitama.jp",
      "toda.saitama.jp",
      "tokigawa.saitama.jp",
      "tokorozawa.saitama.jp",
      "tsurugashima.saitama.jp",
      "urawa.saitama.jp",
      "warabi.saitama.jp",
      "yashio.saitama.jp",
      "yokoze.saitama.jp",
      "yono.saitama.jp",
      "yorii.saitama.jp",
      "yoshida.saitama.jp",
      "yoshikawa.saitama.jp",
      "yoshimi.saitama.jp",
      "aisho.shiga.jp",
      "gamo.shiga.jp",
      "higashiomi.shiga.jp",
      "hikone.shiga.jp",
      "koka.shiga.jp",
      "konan.shiga.jp",
      "kosei.shiga.jp",
      "koto.shiga.jp",
      "kusatsu.shiga.jp",
      "maibara.shiga.jp",
      "moriyama.shiga.jp",
      "nagahama.shiga.jp",
      "nishiazai.shiga.jp",
      "notogawa.shiga.jp",
      "omihachiman.shiga.jp",
      "otsu.shiga.jp",
      "ritto.shiga.jp",
      "ryuoh.shiga.jp",
      "takashima.shiga.jp",
      "takatsuki.shiga.jp",
      "torahime.shiga.jp",
      "toyosato.shiga.jp",
      "yasu.shiga.jp",
      "akagi.shimane.jp",
      "ama.shimane.jp",
      "gotsu.shimane.jp",
      "hamada.shimane.jp",
      "higashiizumo.shimane.jp",
      "hikawa.shimane.jp",
      "hikimi.shimane.jp",
      "izumo.shimane.jp",
      "kakinoki.shimane.jp",
      "masuda.shimane.jp",
      "matsue.shimane.jp",
      "misato.shimane.jp",
      "nishinoshima.shimane.jp",
      "ohda.shimane.jp",
      "okinoshima.shimane.jp",
      "okuizumo.shimane.jp",
      "shimane.shimane.jp",
      "tamayu.shimane.jp",
      "tsuwano.shimane.jp",
      "unnan.shimane.jp",
      "yakumo.shimane.jp",
      "yasugi.shimane.jp",
      "yatsuka.shimane.jp",
      "arai.shizuoka.jp",
      "atami.shizuoka.jp",
      "fuji.shizuoka.jp",
      "fujieda.shizuoka.jp",
      "fujikawa.shizuoka.jp",
      "fujinomiya.shizuoka.jp",
      "fukuroi.shizuoka.jp",
      "gotemba.shizuoka.jp",
      "haibara.shizuoka.jp",
      "hamamatsu.shizuoka.jp",
      "higashiizu.shizuoka.jp",
      "ito.shizuoka.jp",
      "iwata.shizuoka.jp",
      "izu.shizuoka.jp",
      "izunokuni.shizuoka.jp",
      "kakegawa.shizuoka.jp",
      "kannami.shizuoka.jp",
      "kawanehon.shizuoka.jp",
      "kawazu.shizuoka.jp",
      "kikugawa.shizuoka.jp",
      "kosai.shizuoka.jp",
      "makinohara.shizuoka.jp",
      "matsuzaki.shizuoka.jp",
      "minamiizu.shizuoka.jp",
      "mishima.shizuoka.jp",
      "morimachi.shizuoka.jp",
      "nishiizu.shizuoka.jp",
      "numazu.shizuoka.jp",
      "omaezaki.shizuoka.jp",
      "shimada.shizuoka.jp",
      "shimizu.shizuoka.jp",
      "shimoda.shizuoka.jp",
      "shizuoka.shizuoka.jp",
      "susono.shizuoka.jp",
      "yaizu.shizuoka.jp",
      "yoshida.shizuoka.jp",
      "ashikaga.tochigi.jp",
      "bato.tochigi.jp",
      "haga.tochigi.jp",
      "ichikai.tochigi.jp",
      "iwafune.tochigi.jp",
      "kaminokawa.tochigi.jp",
      "kanuma.tochigi.jp",
      "karasuyama.tochigi.jp",
      "kuroiso.tochigi.jp",
      "mashiko.tochigi.jp",
      "mibu.tochigi.jp",
      "moka.tochigi.jp",
      "motegi.tochigi.jp",
      "nasu.tochigi.jp",
      "nasushiobara.tochigi.jp",
      "nikko.tochigi.jp",
      "nishikata.tochigi.jp",
      "nogi.tochigi.jp",
      "ohira.tochigi.jp",
      "ohtawara.tochigi.jp",
      "oyama.tochigi.jp",
      "sakura.tochigi.jp",
      "sano.tochigi.jp",
      "shimotsuke.tochigi.jp",
      "shioya.tochigi.jp",
      "takanezawa.tochigi.jp",
      "tochigi.tochigi.jp",
      "tsuga.tochigi.jp",
      "ujiie.tochigi.jp",
      "utsunomiya.tochigi.jp",
      "yaita.tochigi.jp",
      "aizumi.tokushima.jp",
      "anan.tokushima.jp",
      "ichiba.tokushima.jp",
      "itano.tokushima.jp",
      "kainan.tokushima.jp",
      "komatsushima.tokushima.jp",
      "matsushige.tokushima.jp",
      "mima.tokushima.jp",
      "minami.tokushima.jp",
      "miyoshi.tokushima.jp",
      "mugi.tokushima.jp",
      "nakagawa.tokushima.jp",
      "naruto.tokushima.jp",
      "sanagochi.tokushima.jp",
      "shishikui.tokushima.jp",
      "tokushima.tokushima.jp",
      "wajiki.tokushima.jp",
      "adachi.tokyo.jp",
      "akiruno.tokyo.jp",
      "akishima.tokyo.jp",
      "aogashima.tokyo.jp",
      "arakawa.tokyo.jp",
      "bunkyo.tokyo.jp",
      "chiyoda.tokyo.jp",
      "chofu.tokyo.jp",
      "chuo.tokyo.jp",
      "edogawa.tokyo.jp",
      "fuchu.tokyo.jp",
      "fussa.tokyo.jp",
      "hachijo.tokyo.jp",
      "hachioji.tokyo.jp",
      "hamura.tokyo.jp",
      "higashikurume.tokyo.jp",
      "higashimurayama.tokyo.jp",
      "higashiyamato.tokyo.jp",
      "hino.tokyo.jp",
      "hinode.tokyo.jp",
      "hinohara.tokyo.jp",
      "inagi.tokyo.jp",
      "itabashi.tokyo.jp",
      "katsushika.tokyo.jp",
      "kita.tokyo.jp",
      "kiyose.tokyo.jp",
      "kodaira.tokyo.jp",
      "koganei.tokyo.jp",
      "kokubunji.tokyo.jp",
      "komae.tokyo.jp",
      "koto.tokyo.jp",
      "kouzushima.tokyo.jp",
      "kunitachi.tokyo.jp",
      "machida.tokyo.jp",
      "meguro.tokyo.jp",
      "minato.tokyo.jp",
      "mitaka.tokyo.jp",
      "mizuho.tokyo.jp",
      "musashimurayama.tokyo.jp",
      "musashino.tokyo.jp",
      "nakano.tokyo.jp",
      "nerima.tokyo.jp",
      "ogasawara.tokyo.jp",
      "okutama.tokyo.jp",
      "ome.tokyo.jp",
      "oshima.tokyo.jp",
      "ota.tokyo.jp",
      "setagaya.tokyo.jp",
      "shibuya.tokyo.jp",
      "shinagawa.tokyo.jp",
      "shinjuku.tokyo.jp",
      "suginami.tokyo.jp",
      "sumida.tokyo.jp",
      "tachikawa.tokyo.jp",
      "taito.tokyo.jp",
      "tama.tokyo.jp",
      "toshima.tokyo.jp",
      "chizu.tottori.jp",
      "hino.tottori.jp",
      "kawahara.tottori.jp",
      "koge.tottori.jp",
      "kotoura.tottori.jp",
      "misasa.tottori.jp",
      "nanbu.tottori.jp",
      "nichinan.tottori.jp",
      "sakaiminato.tottori.jp",
      "tottori.tottori.jp",
      "wakasa.tottori.jp",
      "yazu.tottori.jp",
      "yonago.tottori.jp",
      "asahi.toyama.jp",
      "fuchu.toyama.jp",
      "fukumitsu.toyama.jp",
      "funahashi.toyama.jp",
      "himi.toyama.jp",
      "imizu.toyama.jp",
      "inami.toyama.jp",
      "johana.toyama.jp",
      "kamiichi.toyama.jp",
      "kurobe.toyama.jp",
      "nakaniikawa.toyama.jp",
      "namerikawa.toyama.jp",
      "nanto.toyama.jp",
      "nyuzen.toyama.jp",
      "oyabe.toyama.jp",
      "taira.toyama.jp",
      "takaoka.toyama.jp",
      "tateyama.toyama.jp",
      "toga.toyama.jp",
      "tonami.toyama.jp",
      "toyama.toyama.jp",
      "unazuki.toyama.jp",
      "uozu.toyama.jp",
      "yamada.toyama.jp",
      "arida.wakayama.jp",
      "aridagawa.wakayama.jp",
      "gobo.wakayama.jp",
      "hashimoto.wakayama.jp",
      "hidaka.wakayama.jp",
      "hirogawa.wakayama.jp",
      "inami.wakayama.jp",
      "iwade.wakayama.jp",
      "kainan.wakayama.jp",
      "kamitonda.wakayama.jp",
      "katsuragi.wakayama.jp",
      "kimino.wakayama.jp",
      "kinokawa.wakayama.jp",
      "kitayama.wakayama.jp",
      "koya.wakayama.jp",
      "koza.wakayama.jp",
      "kozagawa.wakayama.jp",
      "kudoyama.wakayama.jp",
      "kushimoto.wakayama.jp",
      "mihama.wakayama.jp",
      "misato.wakayama.jp",
      "nachikatsuura.wakayama.jp",
      "shingu.wakayama.jp",
      "shirahama.wakayama.jp",
      "taiji.wakayama.jp",
      "tanabe.wakayama.jp",
      "wakayama.wakayama.jp",
      "yuasa.wakayama.jp",
      "yura.wakayama.jp",
      "asahi.yamagata.jp",
      "funagata.yamagata.jp",
      "higashine.yamagata.jp",
      "iide.yamagata.jp",
      "kahoku.yamagata.jp",
      "kaminoyama.yamagata.jp",
      "kaneyama.yamagata.jp",
      "kawanishi.yamagata.jp",
      "mamurogawa.yamagata.jp",
      "mikawa.yamagata.jp",
      "murayama.yamagata.jp",
      "nagai.yamagata.jp",
      "nakayama.yamagata.jp",
      "nanyo.yamagata.jp",
      "nishikawa.yamagata.jp",
      "obanazawa.yamagata.jp",
      "oe.yamagata.jp",
      "oguni.yamagata.jp",
      "ohkura.yamagata.jp",
      "oishida.yamagata.jp",
      "sagae.yamagata.jp",
      "sakata.yamagata.jp",
      "sakegawa.yamagata.jp",
      "shinjo.yamagata.jp",
      "shirataka.yamagata.jp",
      "shonai.yamagata.jp",
      "takahata.yamagata.jp",
      "tendo.yamagata.jp",
      "tozawa.yamagata.jp",
      "tsuruoka.yamagata.jp",
      "yamagata.yamagata.jp",
      "yamanobe.yamagata.jp",
      "yonezawa.yamagata.jp",
      "yuza.yamagata.jp",
      "abu.yamaguchi.jp",
      "hagi.yamaguchi.jp",
      "hikari.yamaguchi.jp",
      "hofu.yamaguchi.jp",
      "iwakuni.yamaguchi.jp",
      "kudamatsu.yamaguchi.jp",
      "mitou.yamaguchi.jp",
      "nagato.yamaguchi.jp",
      "oshima.yamaguchi.jp",
      "shimonoseki.yamaguchi.jp",
      "shunan.yamaguchi.jp",
      "tabuse.yamaguchi.jp",
      "tokuyama.yamaguchi.jp",
      "toyota.yamaguchi.jp",
      "ube.yamaguchi.jp",
      "yuu.yamaguchi.jp",
      "chuo.yamanashi.jp",
      "doshi.yamanashi.jp",
      "fuefuki.yamanashi.jp",
      "fujikawa.yamanashi.jp",
      "fujikawaguchiko.yamanashi.jp",
      "fujiyoshida.yamanashi.jp",
      "hayakawa.yamanashi.jp",
      "hokuto.yamanashi.jp",
      "ichikawamisato.yamanashi.jp",
      "kai.yamanashi.jp",
      "kofu.yamanashi.jp",
      "koshu.yamanashi.jp",
      "kosuge.yamanashi.jp",
      "minami-alps.yamanashi.jp",
      "minobu.yamanashi.jp",
      "nakamichi.yamanashi.jp",
      "nanbu.yamanashi.jp",
      "narusawa.yamanashi.jp",
      "nirasaki.yamanashi.jp",
      "nishikatsura.yamanashi.jp",
      "oshino.yamanashi.jp",
      "otsuki.yamanashi.jp",
      "showa.yamanashi.jp",
      "tabayama.yamanashi.jp",
      "tsuru.yamanashi.jp",
      "uenohara.yamanashi.jp",
      "yamanakako.yamanashi.jp",
      "yamanashi.yamanashi.jp",
      "ke",
      "ac.ke",
      "co.ke",
      "go.ke",
      "info.ke",
      "me.ke",
      "mobi.ke",
      "ne.ke",
      "or.ke",
      "sc.ke",
      "kg",
      "org.kg",
      "net.kg",
      "com.kg",
      "edu.kg",
      "gov.kg",
      "mil.kg",
      "*.kh",
      "ki",
      "edu.ki",
      "biz.ki",
      "net.ki",
      "org.ki",
      "gov.ki",
      "info.ki",
      "com.ki",
      "km",
      "org.km",
      "nom.km",
      "gov.km",
      "prd.km",
      "tm.km",
      "edu.km",
      "mil.km",
      "ass.km",
      "com.km",
      "coop.km",
      "asso.km",
      "presse.km",
      "medecin.km",
      "notaires.km",
      "pharmaciens.km",
      "veterinaire.km",
      "gouv.km",
      "kn",
      "net.kn",
      "org.kn",
      "edu.kn",
      "gov.kn",
      "kp",
      "com.kp",
      "edu.kp",
      "gov.kp",
      "org.kp",
      "rep.kp",
      "tra.kp",
      "kr",
      "ac.kr",
      "co.kr",
      "es.kr",
      "go.kr",
      "hs.kr",
      "kg.kr",
      "mil.kr",
      "ms.kr",
      "ne.kr",
      "or.kr",
      "pe.kr",
      "re.kr",
      "sc.kr",
      "busan.kr",
      "chungbuk.kr",
      "chungnam.kr",
      "daegu.kr",
      "daejeon.kr",
      "gangwon.kr",
      "gwangju.kr",
      "gyeongbuk.kr",
      "gyeonggi.kr",
      "gyeongnam.kr",
      "incheon.kr",
      "jeju.kr",
      "jeonbuk.kr",
      "jeonnam.kr",
      "seoul.kr",
      "ulsan.kr",
      "kw",
      "com.kw",
      "edu.kw",
      "emb.kw",
      "gov.kw",
      "ind.kw",
      "net.kw",
      "org.kw",
      "ky",
      "com.ky",
      "edu.ky",
      "net.ky",
      "org.ky",
      "kz",
      "org.kz",
      "edu.kz",
      "net.kz",
      "gov.kz",
      "mil.kz",
      "com.kz",
      "la",
      "int.la",
      "net.la",
      "info.la",
      "edu.la",
      "gov.la",
      "per.la",
      "com.la",
      "org.la",
      "lb",
      "com.lb",
      "edu.lb",
      "gov.lb",
      "net.lb",
      "org.lb",
      "lc",
      "com.lc",
      "net.lc",
      "co.lc",
      "org.lc",
      "edu.lc",
      "gov.lc",
      "li",
      "lk",
      "gov.lk",
      "sch.lk",
      "net.lk",
      "int.lk",
      "com.lk",
      "org.lk",
      "edu.lk",
      "ngo.lk",
      "soc.lk",
      "web.lk",
      "ltd.lk",
      "assn.lk",
      "grp.lk",
      "hotel.lk",
      "ac.lk",
      "lr",
      "com.lr",
      "edu.lr",
      "gov.lr",
      "org.lr",
      "net.lr",
      "ls",
      "ac.ls",
      "biz.ls",
      "co.ls",
      "edu.ls",
      "gov.ls",
      "info.ls",
      "net.ls",
      "org.ls",
      "sc.ls",
      "lt",
      "gov.lt",
      "lu",
      "lv",
      "com.lv",
      "edu.lv",
      "gov.lv",
      "org.lv",
      "mil.lv",
      "id.lv",
      "net.lv",
      "asn.lv",
      "conf.lv",
      "ly",
      "com.ly",
      "net.ly",
      "gov.ly",
      "plc.ly",
      "edu.ly",
      "sch.ly",
      "med.ly",
      "org.ly",
      "id.ly",
      "ma",
      "co.ma",
      "net.ma",
      "gov.ma",
      "org.ma",
      "ac.ma",
      "press.ma",
      "mc",
      "tm.mc",
      "asso.mc",
      "md",
      "me",
      "co.me",
      "net.me",
      "org.me",
      "edu.me",
      "ac.me",
      "gov.me",
      "its.me",
      "priv.me",
      "mg",
      "org.mg",
      "nom.mg",
      "gov.mg",
      "prd.mg",
      "tm.mg",
      "edu.mg",
      "mil.mg",
      "com.mg",
      "co.mg",
      "mh",
      "mil",
      "mk",
      "com.mk",
      "org.mk",
      "net.mk",
      "edu.mk",
      "gov.mk",
      "inf.mk",
      "name.mk",
      "ml",
      "com.ml",
      "edu.ml",
      "gouv.ml",
      "gov.ml",
      "net.ml",
      "org.ml",
      "presse.ml",
      "*.mm",
      "mn",
      "gov.mn",
      "edu.mn",
      "org.mn",
      "mo",
      "com.mo",
      "net.mo",
      "org.mo",
      "edu.mo",
      "gov.mo",
      "mobi",
      "mp",
      "mq",
      "mr",
      "gov.mr",
      "ms",
      "com.ms",
      "edu.ms",
      "gov.ms",
      "net.ms",
      "org.ms",
      "mt",
      "com.mt",
      "edu.mt",
      "net.mt",
      "org.mt",
      "mu",
      "com.mu",
      "net.mu",
      "org.mu",
      "gov.mu",
      "ac.mu",
      "co.mu",
      "or.mu",
      "museum",
      "academy.museum",
      "agriculture.museum",
      "air.museum",
      "airguard.museum",
      "alabama.museum",
      "alaska.museum",
      "amber.museum",
      "ambulance.museum",
      "american.museum",
      "americana.museum",
      "americanantiques.museum",
      "americanart.museum",
      "amsterdam.museum",
      "and.museum",
      "annefrank.museum",
      "anthro.museum",
      "anthropology.museum",
      "antiques.museum",
      "aquarium.museum",
      "arboretum.museum",
      "archaeological.museum",
      "archaeology.museum",
      "architecture.museum",
      "art.museum",
      "artanddesign.museum",
      "artcenter.museum",
      "artdeco.museum",
      "arteducation.museum",
      "artgallery.museum",
      "arts.museum",
      "artsandcrafts.museum",
      "asmatart.museum",
      "assassination.museum",
      "assisi.museum",
      "association.museum",
      "astronomy.museum",
      "atlanta.museum",
      "austin.museum",
      "australia.museum",
      "automotive.museum",
      "aviation.museum",
      "axis.museum",
      "badajoz.museum",
      "baghdad.museum",
      "bahn.museum",
      "bale.museum",
      "baltimore.museum",
      "barcelona.museum",
      "baseball.museum",
      "basel.museum",
      "baths.museum",
      "bauern.museum",
      "beauxarts.museum",
      "beeldengeluid.museum",
      "bellevue.museum",
      "bergbau.museum",
      "berkeley.museum",
      "berlin.museum",
      "bern.museum",
      "bible.museum",
      "bilbao.museum",
      "bill.museum",
      "birdart.museum",
      "birthplace.museum",
      "bonn.museum",
      "boston.museum",
      "botanical.museum",
      "botanicalgarden.museum",
      "botanicgarden.museum",
      "botany.museum",
      "brandywinevalley.museum",
      "brasil.museum",
      "bristol.museum",
      "british.museum",
      "britishcolumbia.museum",
      "broadcast.museum",
      "brunel.museum",
      "brussel.museum",
      "brussels.museum",
      "bruxelles.museum",
      "building.museum",
      "burghof.museum",
      "bus.museum",
      "bushey.museum",
      "cadaques.museum",
      "california.museum",
      "cambridge.museum",
      "can.museum",
      "canada.museum",
      "capebreton.museum",
      "carrier.museum",
      "cartoonart.museum",
      "casadelamoneda.museum",
      "castle.museum",
      "castres.museum",
      "celtic.museum",
      "center.museum",
      "chattanooga.museum",
      "cheltenham.museum",
      "chesapeakebay.museum",
      "chicago.museum",
      "children.museum",
      "childrens.museum",
      "childrensgarden.museum",
      "chiropractic.museum",
      "chocolate.museum",
      "christiansburg.museum",
      "cincinnati.museum",
      "cinema.museum",
      "circus.museum",
      "civilisation.museum",
      "civilization.museum",
      "civilwar.museum",
      "clinton.museum",
      "clock.museum",
      "coal.museum",
      "coastaldefence.museum",
      "cody.museum",
      "coldwar.museum",
      "collection.museum",
      "colonialwilliamsburg.museum",
      "coloradoplateau.museum",
      "columbia.museum",
      "columbus.museum",
      "communication.museum",
      "communications.museum",
      "community.museum",
      "computer.museum",
      "computerhistory.museum",
      "comunica\xE7\xF5es.museum",
      "contemporary.museum",
      "contemporaryart.museum",
      "convent.museum",
      "copenhagen.museum",
      "corporation.museum",
      "correios-e-telecomunica\xE7\xF5es.museum",
      "corvette.museum",
      "costume.museum",
      "countryestate.museum",
      "county.museum",
      "crafts.museum",
      "cranbrook.museum",
      "creation.museum",
      "cultural.museum",
      "culturalcenter.museum",
      "culture.museum",
      "cyber.museum",
      "cymru.museum",
      "dali.museum",
      "dallas.museum",
      "database.museum",
      "ddr.museum",
      "decorativearts.museum",
      "delaware.museum",
      "delmenhorst.museum",
      "denmark.museum",
      "depot.museum",
      "design.museum",
      "detroit.museum",
      "dinosaur.museum",
      "discovery.museum",
      "dolls.museum",
      "donostia.museum",
      "durham.museum",
      "eastafrica.museum",
      "eastcoast.museum",
      "education.museum",
      "educational.museum",
      "egyptian.museum",
      "eisenbahn.museum",
      "elburg.museum",
      "elvendrell.museum",
      "embroidery.museum",
      "encyclopedic.museum",
      "england.museum",
      "entomology.museum",
      "environment.museum",
      "environmentalconservation.museum",
      "epilepsy.museum",
      "essex.museum",
      "estate.museum",
      "ethnology.museum",
      "exeter.museum",
      "exhibition.museum",
      "family.museum",
      "farm.museum",
      "farmequipment.museum",
      "farmers.museum",
      "farmstead.museum",
      "field.museum",
      "figueres.museum",
      "filatelia.museum",
      "film.museum",
      "fineart.museum",
      "finearts.museum",
      "finland.museum",
      "flanders.museum",
      "florida.museum",
      "force.museum",
      "fortmissoula.museum",
      "fortworth.museum",
      "foundation.museum",
      "francaise.museum",
      "frankfurt.museum",
      "franziskaner.museum",
      "freemasonry.museum",
      "freiburg.museum",
      "fribourg.museum",
      "frog.museum",
      "fundacio.museum",
      "furniture.museum",
      "gallery.museum",
      "garden.museum",
      "gateway.museum",
      "geelvinck.museum",
      "gemological.museum",
      "geology.museum",
      "georgia.museum",
      "giessen.museum",
      "glas.museum",
      "glass.museum",
      "gorge.museum",
      "grandrapids.museum",
      "graz.museum",
      "guernsey.museum",
      "halloffame.museum",
      "hamburg.museum",
      "handson.museum",
      "harvestcelebration.museum",
      "hawaii.museum",
      "health.museum",
      "heimatunduhren.museum",
      "hellas.museum",
      "helsinki.museum",
      "hembygdsforbund.museum",
      "heritage.museum",
      "histoire.museum",
      "historical.museum",
      "historicalsociety.museum",
      "historichouses.museum",
      "historisch.museum",
      "historisches.museum",
      "history.museum",
      "historyofscience.museum",
      "horology.museum",
      "house.museum",
      "humanities.museum",
      "illustration.museum",
      "imageandsound.museum",
      "indian.museum",
      "indiana.museum",
      "indianapolis.museum",
      "indianmarket.museum",
      "intelligence.museum",
      "interactive.museum",
      "iraq.museum",
      "iron.museum",
      "isleofman.museum",
      "jamison.museum",
      "jefferson.museum",
      "jerusalem.museum",
      "jewelry.museum",
      "jewish.museum",
      "jewishart.museum",
      "jfk.museum",
      "journalism.museum",
      "judaica.museum",
      "judygarland.museum",
      "juedisches.museum",
      "juif.museum",
      "karate.museum",
      "karikatur.museum",
      "kids.museum",
      "koebenhavn.museum",
      "koeln.museum",
      "kunst.museum",
      "kunstsammlung.museum",
      "kunstunddesign.museum",
      "labor.museum",
      "labour.museum",
      "lajolla.museum",
      "lancashire.museum",
      "landes.museum",
      "lans.museum",
      "l\xE4ns.museum",
      "larsson.museum",
      "lewismiller.museum",
      "lincoln.museum",
      "linz.museum",
      "living.museum",
      "livinghistory.museum",
      "localhistory.museum",
      "london.museum",
      "losangeles.museum",
      "louvre.museum",
      "loyalist.museum",
      "lucerne.museum",
      "luxembourg.museum",
      "luzern.museum",
      "mad.museum",
      "madrid.museum",
      "mallorca.museum",
      "manchester.museum",
      "mansion.museum",
      "mansions.museum",
      "manx.museum",
      "marburg.museum",
      "maritime.museum",
      "maritimo.museum",
      "maryland.museum",
      "marylhurst.museum",
      "media.museum",
      "medical.museum",
      "medizinhistorisches.museum",
      "meeres.museum",
      "memorial.museum",
      "mesaverde.museum",
      "michigan.museum",
      "midatlantic.museum",
      "military.museum",
      "mill.museum",
      "miners.museum",
      "mining.museum",
      "minnesota.museum",
      "missile.museum",
      "missoula.museum",
      "modern.museum",
      "moma.museum",
      "money.museum",
      "monmouth.museum",
      "monticello.museum",
      "montreal.museum",
      "moscow.museum",
      "motorcycle.museum",
      "muenchen.museum",
      "muenster.museum",
      "mulhouse.museum",
      "muncie.museum",
      "museet.museum",
      "museumcenter.museum",
      "museumvereniging.museum",
      "music.museum",
      "national.museum",
      "nationalfirearms.museum",
      "nationalheritage.museum",
      "nativeamerican.museum",
      "naturalhistory.museum",
      "naturalhistorymuseum.museum",
      "naturalsciences.museum",
      "nature.museum",
      "naturhistorisches.museum",
      "natuurwetenschappen.museum",
      "naumburg.museum",
      "naval.museum",
      "nebraska.museum",
      "neues.museum",
      "newhampshire.museum",
      "newjersey.museum",
      "newmexico.museum",
      "newport.museum",
      "newspaper.museum",
      "newyork.museum",
      "niepce.museum",
      "norfolk.museum",
      "north.museum",
      "nrw.museum",
      "nyc.museum",
      "nyny.museum",
      "oceanographic.museum",
      "oceanographique.museum",
      "omaha.museum",
      "online.museum",
      "ontario.museum",
      "openair.museum",
      "oregon.museum",
      "oregontrail.museum",
      "otago.museum",
      "oxford.museum",
      "pacific.museum",
      "paderborn.museum",
      "palace.museum",
      "paleo.museum",
      "palmsprings.museum",
      "panama.museum",
      "paris.museum",
      "pasadena.museum",
      "pharmacy.museum",
      "philadelphia.museum",
      "philadelphiaarea.museum",
      "philately.museum",
      "phoenix.museum",
      "photography.museum",
      "pilots.museum",
      "pittsburgh.museum",
      "planetarium.museum",
      "plantation.museum",
      "plants.museum",
      "plaza.museum",
      "portal.museum",
      "portland.museum",
      "portlligat.museum",
      "posts-and-telecommunications.museum",
      "preservation.museum",
      "presidio.museum",
      "press.museum",
      "project.museum",
      "public.museum",
      "pubol.museum",
      "quebec.museum",
      "railroad.museum",
      "railway.museum",
      "research.museum",
      "resistance.museum",
      "riodejaneiro.museum",
      "rochester.museum",
      "rockart.museum",
      "roma.museum",
      "russia.museum",
      "saintlouis.museum",
      "salem.museum",
      "salvadordali.museum",
      "salzburg.museum",
      "sandiego.museum",
      "sanfrancisco.museum",
      "santabarbara.museum",
      "santacruz.museum",
      "santafe.museum",
      "saskatchewan.museum",
      "satx.museum",
      "savannahga.museum",
      "schlesisches.museum",
      "schoenbrunn.museum",
      "schokoladen.museum",
      "school.museum",
      "schweiz.museum",
      "science.museum",
      "scienceandhistory.museum",
      "scienceandindustry.museum",
      "sciencecenter.museum",
      "sciencecenters.museum",
      "science-fiction.museum",
      "sciencehistory.museum",
      "sciences.museum",
      "sciencesnaturelles.museum",
      "scotland.museum",
      "seaport.museum",
      "settlement.museum",
      "settlers.museum",
      "shell.museum",
      "sherbrooke.museum",
      "sibenik.museum",
      "silk.museum",
      "ski.museum",
      "skole.museum",
      "society.museum",
      "sologne.museum",
      "soundandvision.museum",
      "southcarolina.museum",
      "southwest.museum",
      "space.museum",
      "spy.museum",
      "square.museum",
      "stadt.museum",
      "stalbans.museum",
      "starnberg.museum",
      "state.museum",
      "stateofdelaware.museum",
      "station.museum",
      "steam.museum",
      "steiermark.museum",
      "stjohn.museum",
      "stockholm.museum",
      "stpetersburg.museum",
      "stuttgart.museum",
      "suisse.museum",
      "surgeonshall.museum",
      "surrey.museum",
      "svizzera.museum",
      "sweden.museum",
      "sydney.museum",
      "tank.museum",
      "tcm.museum",
      "technology.museum",
      "telekommunikation.museum",
      "television.museum",
      "texas.museum",
      "textile.museum",
      "theater.museum",
      "time.museum",
      "timekeeping.museum",
      "topology.museum",
      "torino.museum",
      "touch.museum",
      "town.museum",
      "transport.museum",
      "tree.museum",
      "trolley.museum",
      "trust.museum",
      "trustee.museum",
      "uhren.museum",
      "ulm.museum",
      "undersea.museum",
      "university.museum",
      "usa.museum",
      "usantiques.museum",
      "usarts.museum",
      "uscountryestate.museum",
      "usculture.museum",
      "usdecorativearts.museum",
      "usgarden.museum",
      "ushistory.museum",
      "ushuaia.museum",
      "uslivinghistory.museum",
      "utah.museum",
      "uvic.museum",
      "valley.museum",
      "vantaa.museum",
      "versailles.museum",
      "viking.museum",
      "village.museum",
      "virginia.museum",
      "virtual.museum",
      "virtuel.museum",
      "vlaanderen.museum",
      "volkenkunde.museum",
      "wales.museum",
      "wallonie.museum",
      "war.museum",
      "washingtondc.museum",
      "watchandclock.museum",
      "watch-and-clock.museum",
      "western.museum",
      "westfalen.museum",
      "whaling.museum",
      "wildlife.museum",
      "williamsburg.museum",
      "windmill.museum",
      "workshop.museum",
      "york.museum",
      "yorkshire.museum",
      "yosemite.museum",
      "youth.museum",
      "zoological.museum",
      "zoology.museum",
      "\u05D9\u05E8\u05D5\u05E9\u05DC\u05D9\u05DD.museum",
      "\u0438\u043A\u043E\u043C.museum",
      "mv",
      "aero.mv",
      "biz.mv",
      "com.mv",
      "coop.mv",
      "edu.mv",
      "gov.mv",
      "info.mv",
      "int.mv",
      "mil.mv",
      "museum.mv",
      "name.mv",
      "net.mv",
      "org.mv",
      "pro.mv",
      "mw",
      "ac.mw",
      "biz.mw",
      "co.mw",
      "com.mw",
      "coop.mw",
      "edu.mw",
      "gov.mw",
      "int.mw",
      "museum.mw",
      "net.mw",
      "org.mw",
      "mx",
      "com.mx",
      "org.mx",
      "gob.mx",
      "edu.mx",
      "net.mx",
      "my",
      "biz.my",
      "com.my",
      "edu.my",
      "gov.my",
      "mil.my",
      "name.my",
      "net.my",
      "org.my",
      "mz",
      "ac.mz",
      "adv.mz",
      "co.mz",
      "edu.mz",
      "gov.mz",
      "mil.mz",
      "net.mz",
      "org.mz",
      "na",
      "info.na",
      "pro.na",
      "name.na",
      "school.na",
      "or.na",
      "dr.na",
      "us.na",
      "mx.na",
      "ca.na",
      "in.na",
      "cc.na",
      "tv.na",
      "ws.na",
      "mobi.na",
      "co.na",
      "com.na",
      "org.na",
      "name",
      "nc",
      "asso.nc",
      "nom.nc",
      "ne",
      "net",
      "nf",
      "com.nf",
      "net.nf",
      "per.nf",
      "rec.nf",
      "web.nf",
      "arts.nf",
      "firm.nf",
      "info.nf",
      "other.nf",
      "store.nf",
      "ng",
      "com.ng",
      "edu.ng",
      "gov.ng",
      "i.ng",
      "mil.ng",
      "mobi.ng",
      "name.ng",
      "net.ng",
      "org.ng",
      "sch.ng",
      "ni",
      "ac.ni",
      "biz.ni",
      "co.ni",
      "com.ni",
      "edu.ni",
      "gob.ni",
      "in.ni",
      "info.ni",
      "int.ni",
      "mil.ni",
      "net.ni",
      "nom.ni",
      "org.ni",
      "web.ni",
      "nl",
      "no",
      "fhs.no",
      "vgs.no",
      "fylkesbibl.no",
      "folkebibl.no",
      "museum.no",
      "idrett.no",
      "priv.no",
      "mil.no",
      "stat.no",
      "dep.no",
      "kommune.no",
      "herad.no",
      "aa.no",
      "ah.no",
      "bu.no",
      "fm.no",
      "hl.no",
      "hm.no",
      "jan-mayen.no",
      "mr.no",
      "nl.no",
      "nt.no",
      "of.no",
      "ol.no",
      "oslo.no",
      "rl.no",
      "sf.no",
      "st.no",
      "svalbard.no",
      "tm.no",
      "tr.no",
      "va.no",
      "vf.no",
      "gs.aa.no",
      "gs.ah.no",
      "gs.bu.no",
      "gs.fm.no",
      "gs.hl.no",
      "gs.hm.no",
      "gs.jan-mayen.no",
      "gs.mr.no",
      "gs.nl.no",
      "gs.nt.no",
      "gs.of.no",
      "gs.ol.no",
      "gs.oslo.no",
      "gs.rl.no",
      "gs.sf.no",
      "gs.st.no",
      "gs.svalbard.no",
      "gs.tm.no",
      "gs.tr.no",
      "gs.va.no",
      "gs.vf.no",
      "akrehamn.no",
      "\xE5krehamn.no",
      "algard.no",
      "\xE5lg\xE5rd.no",
      "arna.no",
      "brumunddal.no",
      "bryne.no",
      "bronnoysund.no",
      "br\xF8nn\xF8ysund.no",
      "drobak.no",
      "dr\xF8bak.no",
      "egersund.no",
      "fetsund.no",
      "floro.no",
      "flor\xF8.no",
      "fredrikstad.no",
      "hokksund.no",
      "honefoss.no",
      "h\xF8nefoss.no",
      "jessheim.no",
      "jorpeland.no",
      "j\xF8rpeland.no",
      "kirkenes.no",
      "kopervik.no",
      "krokstadelva.no",
      "langevag.no",
      "langev\xE5g.no",
      "leirvik.no",
      "mjondalen.no",
      "mj\xF8ndalen.no",
      "mo-i-rana.no",
      "mosjoen.no",
      "mosj\xF8en.no",
      "nesoddtangen.no",
      "orkanger.no",
      "osoyro.no",
      "os\xF8yro.no",
      "raholt.no",
      "r\xE5holt.no",
      "sandnessjoen.no",
      "sandnessj\xF8en.no",
      "skedsmokorset.no",
      "slattum.no",
      "spjelkavik.no",
      "stathelle.no",
      "stavern.no",
      "stjordalshalsen.no",
      "stj\xF8rdalshalsen.no",
      "tananger.no",
      "tranby.no",
      "vossevangen.no",
      "afjord.no",
      "\xE5fjord.no",
      "agdenes.no",
      "al.no",
      "\xE5l.no",
      "alesund.no",
      "\xE5lesund.no",
      "alstahaug.no",
      "alta.no",
      "\xE1lt\xE1.no",
      "alaheadju.no",
      "\xE1laheadju.no",
      "alvdal.no",
      "amli.no",
      "\xE5mli.no",
      "amot.no",
      "\xE5mot.no",
      "andebu.no",
      "andoy.no",
      "and\xF8y.no",
      "andasuolo.no",
      "ardal.no",
      "\xE5rdal.no",
      "aremark.no",
      "arendal.no",
      "\xE5s.no",
      "aseral.no",
      "\xE5seral.no",
      "asker.no",
      "askim.no",
      "askvoll.no",
      "askoy.no",
      "ask\xF8y.no",
      "asnes.no",
      "\xE5snes.no",
      "audnedaln.no",
      "aukra.no",
      "aure.no",
      "aurland.no",
      "aurskog-holand.no",
      "aurskog-h\xF8land.no",
      "austevoll.no",
      "austrheim.no",
      "averoy.no",
      "aver\xF8y.no",
      "balestrand.no",
      "ballangen.no",
      "balat.no",
      "b\xE1l\xE1t.no",
      "balsfjord.no",
      "bahccavuotna.no",
      "b\xE1hccavuotna.no",
      "bamble.no",
      "bardu.no",
      "beardu.no",
      "beiarn.no",
      "bajddar.no",
      "b\xE1jddar.no",
      "baidar.no",
      "b\xE1id\xE1r.no",
      "berg.no",
      "bergen.no",
      "berlevag.no",
      "berlev\xE5g.no",
      "bearalvahki.no",
      "bearalv\xE1hki.no",
      "bindal.no",
      "birkenes.no",
      "bjarkoy.no",
      "bjark\xF8y.no",
      "bjerkreim.no",
      "bjugn.no",
      "bodo.no",
      "bod\xF8.no",
      "badaddja.no",
      "b\xE5d\xE5ddj\xE5.no",
      "budejju.no",
      "bokn.no",
      "bremanger.no",
      "bronnoy.no",
      "br\xF8nn\xF8y.no",
      "bygland.no",
      "bykle.no",
      "barum.no",
      "b\xE6rum.no",
      "bo.telemark.no",
      "b\xF8.telemark.no",
      "bo.nordland.no",
      "b\xF8.nordland.no",
      "bievat.no",
      "biev\xE1t.no",
      "bomlo.no",
      "b\xF8mlo.no",
      "batsfjord.no",
      "b\xE5tsfjord.no",
      "bahcavuotna.no",
      "b\xE1hcavuotna.no",
      "dovre.no",
      "drammen.no",
      "drangedal.no",
      "dyroy.no",
      "dyr\xF8y.no",
      "donna.no",
      "d\xF8nna.no",
      "eid.no",
      "eidfjord.no",
      "eidsberg.no",
      "eidskog.no",
      "eidsvoll.no",
      "eigersund.no",
      "elverum.no",
      "enebakk.no",
      "engerdal.no",
      "etne.no",
      "etnedal.no",
      "evenes.no",
      "evenassi.no",
      "even\xE1\u0161\u0161i.no",
      "evje-og-hornnes.no",
      "farsund.no",
      "fauske.no",
      "fuossko.no",
      "fuoisku.no",
      "fedje.no",
      "fet.no",
      "finnoy.no",
      "finn\xF8y.no",
      "fitjar.no",
      "fjaler.no",
      "fjell.no",
      "flakstad.no",
      "flatanger.no",
      "flekkefjord.no",
      "flesberg.no",
      "flora.no",
      "fla.no",
      "fl\xE5.no",
      "folldal.no",
      "forsand.no",
      "fosnes.no",
      "frei.no",
      "frogn.no",
      "froland.no",
      "frosta.no",
      "frana.no",
      "fr\xE6na.no",
      "froya.no",
      "fr\xF8ya.no",
      "fusa.no",
      "fyresdal.no",
      "forde.no",
      "f\xF8rde.no",
      "gamvik.no",
      "gangaviika.no",
      "g\xE1\u014Bgaviika.no",
      "gaular.no",
      "gausdal.no",
      "gildeskal.no",
      "gildesk\xE5l.no",
      "giske.no",
      "gjemnes.no",
      "gjerdrum.no",
      "gjerstad.no",
      "gjesdal.no",
      "gjovik.no",
      "gj\xF8vik.no",
      "gloppen.no",
      "gol.no",
      "gran.no",
      "grane.no",
      "granvin.no",
      "gratangen.no",
      "grimstad.no",
      "grong.no",
      "kraanghke.no",
      "kr\xE5anghke.no",
      "grue.no",
      "gulen.no",
      "hadsel.no",
      "halden.no",
      "halsa.no",
      "hamar.no",
      "hamaroy.no",
      "habmer.no",
      "h\xE1bmer.no",
      "hapmir.no",
      "h\xE1pmir.no",
      "hammerfest.no",
      "hammarfeasta.no",
      "h\xE1mm\xE1rfeasta.no",
      "haram.no",
      "hareid.no",
      "harstad.no",
      "hasvik.no",
      "aknoluokta.no",
      "\xE1k\u014Boluokta.no",
      "hattfjelldal.no",
      "aarborte.no",
      "haugesund.no",
      "hemne.no",
      "hemnes.no",
      "hemsedal.no",
      "heroy.more-og-romsdal.no",
      "her\xF8y.m\xF8re-og-romsdal.no",
      "heroy.nordland.no",
      "her\xF8y.nordland.no",
      "hitra.no",
      "hjartdal.no",
      "hjelmeland.no",
      "hobol.no",
      "hob\xF8l.no",
      "hof.no",
      "hol.no",
      "hole.no",
      "holmestrand.no",
      "holtalen.no",
      "holt\xE5len.no",
      "hornindal.no",
      "horten.no",
      "hurdal.no",
      "hurum.no",
      "hvaler.no",
      "hyllestad.no",
      "hagebostad.no",
      "h\xE6gebostad.no",
      "hoyanger.no",
      "h\xF8yanger.no",
      "hoylandet.no",
      "h\xF8ylandet.no",
      "ha.no",
      "h\xE5.no",
      "ibestad.no",
      "inderoy.no",
      "inder\xF8y.no",
      "iveland.no",
      "jevnaker.no",
      "jondal.no",
      "jolster.no",
      "j\xF8lster.no",
      "karasjok.no",
      "karasjohka.no",
      "k\xE1r\xE1\u0161johka.no",
      "karlsoy.no",
      "galsa.no",
      "g\xE1ls\xE1.no",
      "karmoy.no",
      "karm\xF8y.no",
      "kautokeino.no",
      "guovdageaidnu.no",
      "klepp.no",
      "klabu.no",
      "kl\xE6bu.no",
      "kongsberg.no",
      "kongsvinger.no",
      "kragero.no",
      "krager\xF8.no",
      "kristiansand.no",
      "kristiansund.no",
      "krodsherad.no",
      "kr\xF8dsherad.no",
      "kvalsund.no",
      "rahkkeravju.no",
      "r\xE1hkker\xE1vju.no",
      "kvam.no",
      "kvinesdal.no",
      "kvinnherad.no",
      "kviteseid.no",
      "kvitsoy.no",
      "kvits\xF8y.no",
      "kvafjord.no",
      "kv\xE6fjord.no",
      "giehtavuoatna.no",
      "kvanangen.no",
      "kv\xE6nangen.no",
      "navuotna.no",
      "n\xE1vuotna.no",
      "kafjord.no",
      "k\xE5fjord.no",
      "gaivuotna.no",
      "g\xE1ivuotna.no",
      "larvik.no",
      "lavangen.no",
      "lavagis.no",
      "loabat.no",
      "loab\xE1t.no",
      "lebesby.no",
      "davvesiida.no",
      "leikanger.no",
      "leirfjord.no",
      "leka.no",
      "leksvik.no",
      "lenvik.no",
      "leangaviika.no",
      "lea\u014Bgaviika.no",
      "lesja.no",
      "levanger.no",
      "lier.no",
      "lierne.no",
      "lillehammer.no",
      "lillesand.no",
      "lindesnes.no",
      "lindas.no",
      "lind\xE5s.no",
      "lom.no",
      "loppa.no",
      "lahppi.no",
      "l\xE1hppi.no",
      "lund.no",
      "lunner.no",
      "luroy.no",
      "lur\xF8y.no",
      "luster.no",
      "lyngdal.no",
      "lyngen.no",
      "ivgu.no",
      "lardal.no",
      "lerdal.no",
      "l\xE6rdal.no",
      "lodingen.no",
      "l\xF8dingen.no",
      "lorenskog.no",
      "l\xF8renskog.no",
      "loten.no",
      "l\xF8ten.no",
      "malvik.no",
      "masoy.no",
      "m\xE5s\xF8y.no",
      "muosat.no",
      "muos\xE1t.no",
      "mandal.no",
      "marker.no",
      "marnardal.no",
      "masfjorden.no",
      "meland.no",
      "meldal.no",
      "melhus.no",
      "meloy.no",
      "mel\xF8y.no",
      "meraker.no",
      "mer\xE5ker.no",
      "moareke.no",
      "mo\xE5reke.no",
      "midsund.no",
      "midtre-gauldal.no",
      "modalen.no",
      "modum.no",
      "molde.no",
      "moskenes.no",
      "moss.no",
      "mosvik.no",
      "malselv.no",
      "m\xE5lselv.no",
      "malatvuopmi.no",
      "m\xE1latvuopmi.no",
      "namdalseid.no",
      "aejrie.no",
      "namsos.no",
      "namsskogan.no",
      "naamesjevuemie.no",
      "n\xE5\xE5mesjevuemie.no",
      "laakesvuemie.no",
      "nannestad.no",
      "narvik.no",
      "narviika.no",
      "naustdal.no",
      "nedre-eiker.no",
      "nes.akershus.no",
      "nes.buskerud.no",
      "nesna.no",
      "nesodden.no",
      "nesseby.no",
      "unjarga.no",
      "unj\xE1rga.no",
      "nesset.no",
      "nissedal.no",
      "nittedal.no",
      "nord-aurdal.no",
      "nord-fron.no",
      "nord-odal.no",
      "norddal.no",
      "nordkapp.no",
      "davvenjarga.no",
      "davvenj\xE1rga.no",
      "nordre-land.no",
      "nordreisa.no",
      "raisa.no",
      "r\xE1isa.no",
      "nore-og-uvdal.no",
      "notodden.no",
      "naroy.no",
      "n\xE6r\xF8y.no",
      "notteroy.no",
      "n\xF8tter\xF8y.no",
      "odda.no",
      "oksnes.no",
      "\xF8ksnes.no",
      "oppdal.no",
      "oppegard.no",
      "oppeg\xE5rd.no",
      "orkdal.no",
      "orland.no",
      "\xF8rland.no",
      "orskog.no",
      "\xF8rskog.no",
      "orsta.no",
      "\xF8rsta.no",
      "os.hedmark.no",
      "os.hordaland.no",
      "osen.no",
      "osteroy.no",
      "oster\xF8y.no",
      "ostre-toten.no",
      "\xF8stre-toten.no",
      "overhalla.no",
      "ovre-eiker.no",
      "\xF8vre-eiker.no",
      "oyer.no",
      "\xF8yer.no",
      "oygarden.no",
      "\xF8ygarden.no",
      "oystre-slidre.no",
      "\xF8ystre-slidre.no",
      "porsanger.no",
      "porsangu.no",
      "pors\xE1\u014Bgu.no",
      "porsgrunn.no",
      "radoy.no",
      "rad\xF8y.no",
      "rakkestad.no",
      "rana.no",
      "ruovat.no",
      "randaberg.no",
      "rauma.no",
      "rendalen.no",
      "rennebu.no",
      "rennesoy.no",
      "rennes\xF8y.no",
      "rindal.no",
      "ringebu.no",
      "ringerike.no",
      "ringsaker.no",
      "rissa.no",
      "risor.no",
      "ris\xF8r.no",
      "roan.no",
      "rollag.no",
      "rygge.no",
      "ralingen.no",
      "r\xE6lingen.no",
      "rodoy.no",
      "r\xF8d\xF8y.no",
      "romskog.no",
      "r\xF8mskog.no",
      "roros.no",
      "r\xF8ros.no",
      "rost.no",
      "r\xF8st.no",
      "royken.no",
      "r\xF8yken.no",
      "royrvik.no",
      "r\xF8yrvik.no",
      "rade.no",
      "r\xE5de.no",
      "salangen.no",
      "siellak.no",
      "saltdal.no",
      "salat.no",
      "s\xE1l\xE1t.no",
      "s\xE1lat.no",
      "samnanger.no",
      "sande.more-og-romsdal.no",
      "sande.m\xF8re-og-romsdal.no",
      "sande.vestfold.no",
      "sandefjord.no",
      "sandnes.no",
      "sandoy.no",
      "sand\xF8y.no",
      "sarpsborg.no",
      "sauda.no",
      "sauherad.no",
      "sel.no",
      "selbu.no",
      "selje.no",
      "seljord.no",
      "sigdal.no",
      "siljan.no",
      "sirdal.no",
      "skaun.no",
      "skedsmo.no",
      "ski.no",
      "skien.no",
      "skiptvet.no",
      "skjervoy.no",
      "skjerv\xF8y.no",
      "skierva.no",
      "skierv\xE1.no",
      "skjak.no",
      "skj\xE5k.no",
      "skodje.no",
      "skanland.no",
      "sk\xE5nland.no",
      "skanit.no",
      "sk\xE1nit.no",
      "smola.no",
      "sm\xF8la.no",
      "snillfjord.no",
      "snasa.no",
      "sn\xE5sa.no",
      "snoasa.no",
      "snaase.no",
      "sn\xE5ase.no",
      "sogndal.no",
      "sokndal.no",
      "sola.no",
      "solund.no",
      "songdalen.no",
      "sortland.no",
      "spydeberg.no",
      "stange.no",
      "stavanger.no",
      "steigen.no",
      "steinkjer.no",
      "stjordal.no",
      "stj\xF8rdal.no",
      "stokke.no",
      "stor-elvdal.no",
      "stord.no",
      "stordal.no",
      "storfjord.no",
      "omasvuotna.no",
      "strand.no",
      "stranda.no",
      "stryn.no",
      "sula.no",
      "suldal.no",
      "sund.no",
      "sunndal.no",
      "surnadal.no",
      "sveio.no",
      "svelvik.no",
      "sykkylven.no",
      "sogne.no",
      "s\xF8gne.no",
      "somna.no",
      "s\xF8mna.no",
      "sondre-land.no",
      "s\xF8ndre-land.no",
      "sor-aurdal.no",
      "s\xF8r-aurdal.no",
      "sor-fron.no",
      "s\xF8r-fron.no",
      "sor-odal.no",
      "s\xF8r-odal.no",
      "sor-varanger.no",
      "s\xF8r-varanger.no",
      "matta-varjjat.no",
      "m\xE1tta-v\xE1rjjat.no",
      "sorfold.no",
      "s\xF8rfold.no",
      "sorreisa.no",
      "s\xF8rreisa.no",
      "sorum.no",
      "s\xF8rum.no",
      "tana.no",
      "deatnu.no",
      "time.no",
      "tingvoll.no",
      "tinn.no",
      "tjeldsund.no",
      "dielddanuorri.no",
      "tjome.no",
      "tj\xF8me.no",
      "tokke.no",
      "tolga.no",
      "torsken.no",
      "tranoy.no",
      "tran\xF8y.no",
      "tromso.no",
      "troms\xF8.no",
      "tromsa.no",
      "romsa.no",
      "trondheim.no",
      "troandin.no",
      "trysil.no",
      "trana.no",
      "tr\xE6na.no",
      "trogstad.no",
      "tr\xF8gstad.no",
      "tvedestrand.no",
      "tydal.no",
      "tynset.no",
      "tysfjord.no",
      "divtasvuodna.no",
      "divttasvuotna.no",
      "tysnes.no",
      "tysvar.no",
      "tysv\xE6r.no",
      "tonsberg.no",
      "t\xF8nsberg.no",
      "ullensaker.no",
      "ullensvang.no",
      "ulvik.no",
      "utsira.no",
      "vadso.no",
      "vads\xF8.no",
      "cahcesuolo.no",
      "\u010D\xE1hcesuolo.no",
      "vaksdal.no",
      "valle.no",
      "vang.no",
      "vanylven.no",
      "vardo.no",
      "vard\xF8.no",
      "varggat.no",
      "v\xE1rgg\xE1t.no",
      "vefsn.no",
      "vaapste.no",
      "vega.no",
      "vegarshei.no",
      "veg\xE5rshei.no",
      "vennesla.no",
      "verdal.no",
      "verran.no",
      "vestby.no",
      "vestnes.no",
      "vestre-slidre.no",
      "vestre-toten.no",
      "vestvagoy.no",
      "vestv\xE5g\xF8y.no",
      "vevelstad.no",
      "vik.no",
      "vikna.no",
      "vindafjord.no",
      "volda.no",
      "voss.no",
      "varoy.no",
      "v\xE6r\xF8y.no",
      "vagan.no",
      "v\xE5gan.no",
      "voagat.no",
      "vagsoy.no",
      "v\xE5gs\xF8y.no",
      "vaga.no",
      "v\xE5g\xE5.no",
      "valer.ostfold.no",
      "v\xE5ler.\xF8stfold.no",
      "valer.hedmark.no",
      "v\xE5ler.hedmark.no",
      "*.np",
      "nr",
      "biz.nr",
      "info.nr",
      "gov.nr",
      "edu.nr",
      "org.nr",
      "net.nr",
      "com.nr",
      "nu",
      "nz",
      "ac.nz",
      "co.nz",
      "cri.nz",
      "geek.nz",
      "gen.nz",
      "govt.nz",
      "health.nz",
      "iwi.nz",
      "kiwi.nz",
      "maori.nz",
      "mil.nz",
      "m\u0101ori.nz",
      "net.nz",
      "org.nz",
      "parliament.nz",
      "school.nz",
      "om",
      "co.om",
      "com.om",
      "edu.om",
      "gov.om",
      "med.om",
      "museum.om",
      "net.om",
      "org.om",
      "pro.om",
      "onion",
      "org",
      "pa",
      "ac.pa",
      "gob.pa",
      "com.pa",
      "org.pa",
      "sld.pa",
      "edu.pa",
      "net.pa",
      "ing.pa",
      "abo.pa",
      "med.pa",
      "nom.pa",
      "pe",
      "edu.pe",
      "gob.pe",
      "nom.pe",
      "mil.pe",
      "org.pe",
      "com.pe",
      "net.pe",
      "pf",
      "com.pf",
      "org.pf",
      "edu.pf",
      "*.pg",
      "ph",
      "com.ph",
      "net.ph",
      "org.ph",
      "gov.ph",
      "edu.ph",
      "ngo.ph",
      "mil.ph",
      "i.ph",
      "pk",
      "com.pk",
      "net.pk",
      "edu.pk",
      "org.pk",
      "fam.pk",
      "biz.pk",
      "web.pk",
      "gov.pk",
      "gob.pk",
      "gok.pk",
      "gon.pk",
      "gop.pk",
      "gos.pk",
      "info.pk",
      "pl",
      "com.pl",
      "net.pl",
      "org.pl",
      "aid.pl",
      "agro.pl",
      "atm.pl",
      "auto.pl",
      "biz.pl",
      "edu.pl",
      "gmina.pl",
      "gsm.pl",
      "info.pl",
      "mail.pl",
      "miasta.pl",
      "media.pl",
      "mil.pl",
      "nieruchomosci.pl",
      "nom.pl",
      "pc.pl",
      "powiat.pl",
      "priv.pl",
      "realestate.pl",
      "rel.pl",
      "sex.pl",
      "shop.pl",
      "sklep.pl",
      "sos.pl",
      "szkola.pl",
      "targi.pl",
      "tm.pl",
      "tourism.pl",
      "travel.pl",
      "turystyka.pl",
      "gov.pl",
      "ap.gov.pl",
      "ic.gov.pl",
      "is.gov.pl",
      "us.gov.pl",
      "kmpsp.gov.pl",
      "kppsp.gov.pl",
      "kwpsp.gov.pl",
      "psp.gov.pl",
      "wskr.gov.pl",
      "kwp.gov.pl",
      "mw.gov.pl",
      "ug.gov.pl",
      "um.gov.pl",
      "umig.gov.pl",
      "ugim.gov.pl",
      "upow.gov.pl",
      "uw.gov.pl",
      "starostwo.gov.pl",
      "pa.gov.pl",
      "po.gov.pl",
      "psse.gov.pl",
      "pup.gov.pl",
      "rzgw.gov.pl",
      "sa.gov.pl",
      "so.gov.pl",
      "sr.gov.pl",
      "wsa.gov.pl",
      "sko.gov.pl",
      "uzs.gov.pl",
      "wiih.gov.pl",
      "winb.gov.pl",
      "pinb.gov.pl",
      "wios.gov.pl",
      "witd.gov.pl",
      "wzmiuw.gov.pl",
      "piw.gov.pl",
      "wiw.gov.pl",
      "griw.gov.pl",
      "wif.gov.pl",
      "oum.gov.pl",
      "sdn.gov.pl",
      "zp.gov.pl",
      "uppo.gov.pl",
      "mup.gov.pl",
      "wuoz.gov.pl",
      "konsulat.gov.pl",
      "oirm.gov.pl",
      "augustow.pl",
      "babia-gora.pl",
      "bedzin.pl",
      "beskidy.pl",
      "bialowieza.pl",
      "bialystok.pl",
      "bielawa.pl",
      "bieszczady.pl",
      "boleslawiec.pl",
      "bydgoszcz.pl",
      "bytom.pl",
      "cieszyn.pl",
      "czeladz.pl",
      "czest.pl",
      "dlugoleka.pl",
      "elblag.pl",
      "elk.pl",
      "glogow.pl",
      "gniezno.pl",
      "gorlice.pl",
      "grajewo.pl",
      "ilawa.pl",
      "jaworzno.pl",
      "jelenia-gora.pl",
      "jgora.pl",
      "kalisz.pl",
      "kazimierz-dolny.pl",
      "karpacz.pl",
      "kartuzy.pl",
      "kaszuby.pl",
      "katowice.pl",
      "kepno.pl",
      "ketrzyn.pl",
      "klodzko.pl",
      "kobierzyce.pl",
      "kolobrzeg.pl",
      "konin.pl",
      "konskowola.pl",
      "kutno.pl",
      "lapy.pl",
      "lebork.pl",
      "legnica.pl",
      "lezajsk.pl",
      "limanowa.pl",
      "lomza.pl",
      "lowicz.pl",
      "lubin.pl",
      "lukow.pl",
      "malbork.pl",
      "malopolska.pl",
      "mazowsze.pl",
      "mazury.pl",
      "mielec.pl",
      "mielno.pl",
      "mragowo.pl",
      "naklo.pl",
      "nowaruda.pl",
      "nysa.pl",
      "olawa.pl",
      "olecko.pl",
      "olkusz.pl",
      "olsztyn.pl",
      "opoczno.pl",
      "opole.pl",
      "ostroda.pl",
      "ostroleka.pl",
      "ostrowiec.pl",
      "ostrowwlkp.pl",
      "pila.pl",
      "pisz.pl",
      "podhale.pl",
      "podlasie.pl",
      "polkowice.pl",
      "pomorze.pl",
      "pomorskie.pl",
      "prochowice.pl",
      "pruszkow.pl",
      "przeworsk.pl",
      "pulawy.pl",
      "radom.pl",
      "rawa-maz.pl",
      "rybnik.pl",
      "rzeszow.pl",
      "sanok.pl",
      "sejny.pl",
      "slask.pl",
      "slupsk.pl",
      "sosnowiec.pl",
      "stalowa-wola.pl",
      "skoczow.pl",
      "starachowice.pl",
      "stargard.pl",
      "suwalki.pl",
      "swidnica.pl",
      "swiebodzin.pl",
      "swinoujscie.pl",
      "szczecin.pl",
      "szczytno.pl",
      "tarnobrzeg.pl",
      "tgory.pl",
      "turek.pl",
      "tychy.pl",
      "ustka.pl",
      "walbrzych.pl",
      "warmia.pl",
      "warszawa.pl",
      "waw.pl",
      "wegrow.pl",
      "wielun.pl",
      "wlocl.pl",
      "wloclawek.pl",
      "wodzislaw.pl",
      "wolomin.pl",
      "wroclaw.pl",
      "zachpomor.pl",
      "zagan.pl",
      "zarow.pl",
      "zgora.pl",
      "zgorzelec.pl",
      "pm",
      "pn",
      "gov.pn",
      "co.pn",
      "org.pn",
      "edu.pn",
      "net.pn",
      "post",
      "pr",
      "com.pr",
      "net.pr",
      "org.pr",
      "gov.pr",
      "edu.pr",
      "isla.pr",
      "pro.pr",
      "biz.pr",
      "info.pr",
      "name.pr",
      "est.pr",
      "prof.pr",
      "ac.pr",
      "pro",
      "aaa.pro",
      "aca.pro",
      "acct.pro",
      "avocat.pro",
      "bar.pro",
      "cpa.pro",
      "eng.pro",
      "jur.pro",
      "law.pro",
      "med.pro",
      "recht.pro",
      "ps",
      "edu.ps",
      "gov.ps",
      "sec.ps",
      "plo.ps",
      "com.ps",
      "org.ps",
      "net.ps",
      "pt",
      "net.pt",
      "gov.pt",
      "org.pt",
      "edu.pt",
      "int.pt",
      "publ.pt",
      "com.pt",
      "nome.pt",
      "pw",
      "co.pw",
      "ne.pw",
      "or.pw",
      "ed.pw",
      "go.pw",
      "belau.pw",
      "py",
      "com.py",
      "coop.py",
      "edu.py",
      "gov.py",
      "mil.py",
      "net.py",
      "org.py",
      "qa",
      "com.qa",
      "edu.qa",
      "gov.qa",
      "mil.qa",
      "name.qa",
      "net.qa",
      "org.qa",
      "sch.qa",
      "re",
      "asso.re",
      "com.re",
      "nom.re",
      "ro",
      "arts.ro",
      "com.ro",
      "firm.ro",
      "info.ro",
      "nom.ro",
      "nt.ro",
      "org.ro",
      "rec.ro",
      "store.ro",
      "tm.ro",
      "www.ro",
      "rs",
      "ac.rs",
      "co.rs",
      "edu.rs",
      "gov.rs",
      "in.rs",
      "org.rs",
      "ru",
      "rw",
      "ac.rw",
      "co.rw",
      "coop.rw",
      "gov.rw",
      "mil.rw",
      "net.rw",
      "org.rw",
      "sa",
      "com.sa",
      "net.sa",
      "org.sa",
      "gov.sa",
      "med.sa",
      "pub.sa",
      "edu.sa",
      "sch.sa",
      "sb",
      "com.sb",
      "edu.sb",
      "gov.sb",
      "net.sb",
      "org.sb",
      "sc",
      "com.sc",
      "gov.sc",
      "net.sc",
      "org.sc",
      "edu.sc",
      "sd",
      "com.sd",
      "net.sd",
      "org.sd",
      "edu.sd",
      "med.sd",
      "tv.sd",
      "gov.sd",
      "info.sd",
      "se",
      "a.se",
      "ac.se",
      "b.se",
      "bd.se",
      "brand.se",
      "c.se",
      "d.se",
      "e.se",
      "f.se",
      "fh.se",
      "fhsk.se",
      "fhv.se",
      "g.se",
      "h.se",
      "i.se",
      "k.se",
      "komforb.se",
      "kommunalforbund.se",
      "komvux.se",
      "l.se",
      "lanbib.se",
      "m.se",
      "n.se",
      "naturbruksgymn.se",
      "o.se",
      "org.se",
      "p.se",
      "parti.se",
      "pp.se",
      "press.se",
      "r.se",
      "s.se",
      "t.se",
      "tm.se",
      "u.se",
      "w.se",
      "x.se",
      "y.se",
      "z.se",
      "sg",
      "com.sg",
      "net.sg",
      "org.sg",
      "gov.sg",
      "edu.sg",
      "per.sg",
      "sh",
      "com.sh",
      "net.sh",
      "gov.sh",
      "org.sh",
      "mil.sh",
      "si",
      "sj",
      "sk",
      "sl",
      "com.sl",
      "net.sl",
      "edu.sl",
      "gov.sl",
      "org.sl",
      "sm",
      "sn",
      "art.sn",
      "com.sn",
      "edu.sn",
      "gouv.sn",
      "org.sn",
      "perso.sn",
      "univ.sn",
      "so",
      "com.so",
      "edu.so",
      "gov.so",
      "me.so",
      "net.so",
      "org.so",
      "sr",
      "ss",
      "biz.ss",
      "com.ss",
      "edu.ss",
      "gov.ss",
      "me.ss",
      "net.ss",
      "org.ss",
      "sch.ss",
      "st",
      "co.st",
      "com.st",
      "consulado.st",
      "edu.st",
      "embaixada.st",
      "mil.st",
      "net.st",
      "org.st",
      "principe.st",
      "saotome.st",
      "store.st",
      "su",
      "sv",
      "com.sv",
      "edu.sv",
      "gob.sv",
      "org.sv",
      "red.sv",
      "sx",
      "gov.sx",
      "sy",
      "edu.sy",
      "gov.sy",
      "net.sy",
      "mil.sy",
      "com.sy",
      "org.sy",
      "sz",
      "co.sz",
      "ac.sz",
      "org.sz",
      "tc",
      "td",
      "tel",
      "tf",
      "tg",
      "th",
      "ac.th",
      "co.th",
      "go.th",
      "in.th",
      "mi.th",
      "net.th",
      "or.th",
      "tj",
      "ac.tj",
      "biz.tj",
      "co.tj",
      "com.tj",
      "edu.tj",
      "go.tj",
      "gov.tj",
      "int.tj",
      "mil.tj",
      "name.tj",
      "net.tj",
      "nic.tj",
      "org.tj",
      "test.tj",
      "web.tj",
      "tk",
      "tl",
      "gov.tl",
      "tm",
      "com.tm",
      "co.tm",
      "org.tm",
      "net.tm",
      "nom.tm",
      "gov.tm",
      "mil.tm",
      "edu.tm",
      "tn",
      "com.tn",
      "ens.tn",
      "fin.tn",
      "gov.tn",
      "ind.tn",
      "info.tn",
      "intl.tn",
      "mincom.tn",
      "nat.tn",
      "net.tn",
      "org.tn",
      "perso.tn",
      "tourism.tn",
      "to",
      "com.to",
      "gov.to",
      "net.to",
      "org.to",
      "edu.to",
      "mil.to",
      "tr",
      "av.tr",
      "bbs.tr",
      "bel.tr",
      "biz.tr",
      "com.tr",
      "dr.tr",
      "edu.tr",
      "gen.tr",
      "gov.tr",
      "info.tr",
      "mil.tr",
      "k12.tr",
      "kep.tr",
      "name.tr",
      "net.tr",
      "org.tr",
      "pol.tr",
      "tel.tr",
      "tsk.tr",
      "tv.tr",
      "web.tr",
      "nc.tr",
      "gov.nc.tr",
      "tt",
      "co.tt",
      "com.tt",
      "org.tt",
      "net.tt",
      "biz.tt",
      "info.tt",
      "pro.tt",
      "int.tt",
      "coop.tt",
      "jobs.tt",
      "mobi.tt",
      "travel.tt",
      "museum.tt",
      "aero.tt",
      "name.tt",
      "gov.tt",
      "edu.tt",
      "tv",
      "tw",
      "edu.tw",
      "gov.tw",
      "mil.tw",
      "com.tw",
      "net.tw",
      "org.tw",
      "idv.tw",
      "game.tw",
      "ebiz.tw",
      "club.tw",
      "\u7DB2\u8DEF.tw",
      "\u7D44\u7E54.tw",
      "\u5546\u696D.tw",
      "tz",
      "ac.tz",
      "co.tz",
      "go.tz",
      "hotel.tz",
      "info.tz",
      "me.tz",
      "mil.tz",
      "mobi.tz",
      "ne.tz",
      "or.tz",
      "sc.tz",
      "tv.tz",
      "ua",
      "com.ua",
      "edu.ua",
      "gov.ua",
      "in.ua",
      "net.ua",
      "org.ua",
      "cherkassy.ua",
      "cherkasy.ua",
      "chernigov.ua",
      "chernihiv.ua",
      "chernivtsi.ua",
      "chernovtsy.ua",
      "ck.ua",
      "cn.ua",
      "cr.ua",
      "crimea.ua",
      "cv.ua",
      "dn.ua",
      "dnepropetrovsk.ua",
      "dnipropetrovsk.ua",
      "donetsk.ua",
      "dp.ua",
      "if.ua",
      "ivano-frankivsk.ua",
      "kh.ua",
      "kharkiv.ua",
      "kharkov.ua",
      "kherson.ua",
      "khmelnitskiy.ua",
      "khmelnytskyi.ua",
      "kiev.ua",
      "kirovograd.ua",
      "km.ua",
      "kr.ua",
      "krym.ua",
      "ks.ua",
      "kv.ua",
      "kyiv.ua",
      "lg.ua",
      "lt.ua",
      "lugansk.ua",
      "lutsk.ua",
      "lv.ua",
      "lviv.ua",
      "mk.ua",
      "mykolaiv.ua",
      "nikolaev.ua",
      "od.ua",
      "odesa.ua",
      "odessa.ua",
      "pl.ua",
      "poltava.ua",
      "rivne.ua",
      "rovno.ua",
      "rv.ua",
      "sb.ua",
      "sebastopol.ua",
      "sevastopol.ua",
      "sm.ua",
      "sumy.ua",
      "te.ua",
      "ternopil.ua",
      "uz.ua",
      "uzhgorod.ua",
      "vinnica.ua",
      "vinnytsia.ua",
      "vn.ua",
      "volyn.ua",
      "yalta.ua",
      "zaporizhzhe.ua",
      "zaporizhzhia.ua",
      "zhitomir.ua",
      "zhytomyr.ua",
      "zp.ua",
      "zt.ua",
      "ug",
      "co.ug",
      "or.ug",
      "ac.ug",
      "sc.ug",
      "go.ug",
      "ne.ug",
      "com.ug",
      "org.ug",
      "uk",
      "ac.uk",
      "co.uk",
      "gov.uk",
      "ltd.uk",
      "me.uk",
      "net.uk",
      "nhs.uk",
      "org.uk",
      "plc.uk",
      "police.uk",
      "*.sch.uk",
      "us",
      "dni.us",
      "fed.us",
      "isa.us",
      "kids.us",
      "nsn.us",
      "ak.us",
      "al.us",
      "ar.us",
      "as.us",
      "az.us",
      "ca.us",
      "co.us",
      "ct.us",
      "dc.us",
      "de.us",
      "fl.us",
      "ga.us",
      "gu.us",
      "hi.us",
      "ia.us",
      "id.us",
      "il.us",
      "in.us",
      "ks.us",
      "ky.us",
      "la.us",
      "ma.us",
      "md.us",
      "me.us",
      "mi.us",
      "mn.us",
      "mo.us",
      "ms.us",
      "mt.us",
      "nc.us",
      "nd.us",
      "ne.us",
      "nh.us",
      "nj.us",
      "nm.us",
      "nv.us",
      "ny.us",
      "oh.us",
      "ok.us",
      "or.us",
      "pa.us",
      "pr.us",
      "ri.us",
      "sc.us",
      "sd.us",
      "tn.us",
      "tx.us",
      "ut.us",
      "vi.us",
      "vt.us",
      "va.us",
      "wa.us",
      "wi.us",
      "wv.us",
      "wy.us",
      "k12.ak.us",
      "k12.al.us",
      "k12.ar.us",
      "k12.as.us",
      "k12.az.us",
      "k12.ca.us",
      "k12.co.us",
      "k12.ct.us",
      "k12.dc.us",
      "k12.de.us",
      "k12.fl.us",
      "k12.ga.us",
      "k12.gu.us",
      "k12.ia.us",
      "k12.id.us",
      "k12.il.us",
      "k12.in.us",
      "k12.ks.us",
      "k12.ky.us",
      "k12.la.us",
      "k12.ma.us",
      "k12.md.us",
      "k12.me.us",
      "k12.mi.us",
      "k12.mn.us",
      "k12.mo.us",
      "k12.ms.us",
      "k12.mt.us",
      "k12.nc.us",
      "k12.ne.us",
      "k12.nh.us",
      "k12.nj.us",
      "k12.nm.us",
      "k12.nv.us",
      "k12.ny.us",
      "k12.oh.us",
      "k12.ok.us",
      "k12.or.us",
      "k12.pa.us",
      "k12.pr.us",
      "k12.sc.us",
      "k12.tn.us",
      "k12.tx.us",
      "k12.ut.us",
      "k12.vi.us",
      "k12.vt.us",
      "k12.va.us",
      "k12.wa.us",
      "k12.wi.us",
      "k12.wy.us",
      "cc.ak.us",
      "cc.al.us",
      "cc.ar.us",
      "cc.as.us",
      "cc.az.us",
      "cc.ca.us",
      "cc.co.us",
      "cc.ct.us",
      "cc.dc.us",
      "cc.de.us",
      "cc.fl.us",
      "cc.ga.us",
      "cc.gu.us",
      "cc.hi.us",
      "cc.ia.us",
      "cc.id.us",
      "cc.il.us",
      "cc.in.us",
      "cc.ks.us",
      "cc.ky.us",
      "cc.la.us",
      "cc.ma.us",
      "cc.md.us",
      "cc.me.us",
      "cc.mi.us",
      "cc.mn.us",
      "cc.mo.us",
      "cc.ms.us",
      "cc.mt.us",
      "cc.nc.us",
      "cc.nd.us",
      "cc.ne.us",
      "cc.nh.us",
      "cc.nj.us",
      "cc.nm.us",
      "cc.nv.us",
      "cc.ny.us",
      "cc.oh.us",
      "cc.ok.us",
      "cc.or.us",
      "cc.pa.us",
      "cc.pr.us",
      "cc.ri.us",
      "cc.sc.us",
      "cc.sd.us",
      "cc.tn.us",
      "cc.tx.us",
      "cc.ut.us",
      "cc.vi.us",
      "cc.vt.us",
      "cc.va.us",
      "cc.wa.us",
      "cc.wi.us",
      "cc.wv.us",
      "cc.wy.us",
      "lib.ak.us",
      "lib.al.us",
      "lib.ar.us",
      "lib.as.us",
      "lib.az.us",
      "lib.ca.us",
      "lib.co.us",
      "lib.ct.us",
      "lib.dc.us",
      "lib.fl.us",
      "lib.ga.us",
      "lib.gu.us",
      "lib.hi.us",
      "lib.ia.us",
      "lib.id.us",
      "lib.il.us",
      "lib.in.us",
      "lib.ks.us",
      "lib.ky.us",
      "lib.la.us",
      "lib.ma.us",
      "lib.md.us",
      "lib.me.us",
      "lib.mi.us",
      "lib.mn.us",
      "lib.mo.us",
      "lib.ms.us",
      "lib.mt.us",
      "lib.nc.us",
      "lib.nd.us",
      "lib.ne.us",
      "lib.nh.us",
      "lib.nj.us",
      "lib.nm.us",
      "lib.nv.us",
      "lib.ny.us",
      "lib.oh.us",
      "lib.ok.us",
      "lib.or.us",
      "lib.pa.us",
      "lib.pr.us",
      "lib.ri.us",
      "lib.sc.us",
      "lib.sd.us",
      "lib.tn.us",
      "lib.tx.us",
      "lib.ut.us",
      "lib.vi.us",
      "lib.vt.us",
      "lib.va.us",
      "lib.wa.us",
      "lib.wi.us",
      "lib.wy.us",
      "pvt.k12.ma.us",
      "chtr.k12.ma.us",
      "paroch.k12.ma.us",
      "ann-arbor.mi.us",
      "cog.mi.us",
      "dst.mi.us",
      "eaton.mi.us",
      "gen.mi.us",
      "mus.mi.us",
      "tec.mi.us",
      "washtenaw.mi.us",
      "uy",
      "com.uy",
      "edu.uy",
      "gub.uy",
      "mil.uy",
      "net.uy",
      "org.uy",
      "uz",
      "co.uz",
      "com.uz",
      "net.uz",
      "org.uz",
      "va",
      "vc",
      "com.vc",
      "net.vc",
      "org.vc",
      "gov.vc",
      "mil.vc",
      "edu.vc",
      "ve",
      "arts.ve",
      "bib.ve",
      "co.ve",
      "com.ve",
      "e12.ve",
      "edu.ve",
      "firm.ve",
      "gob.ve",
      "gov.ve",
      "info.ve",
      "int.ve",
      "mil.ve",
      "net.ve",
      "nom.ve",
      "org.ve",
      "rar.ve",
      "rec.ve",
      "store.ve",
      "tec.ve",
      "web.ve",
      "vg",
      "vi",
      "co.vi",
      "com.vi",
      "k12.vi",
      "net.vi",
      "org.vi",
      "vn",
      "com.vn",
      "net.vn",
      "org.vn",
      "edu.vn",
      "gov.vn",
      "int.vn",
      "ac.vn",
      "biz.vn",
      "info.vn",
      "name.vn",
      "pro.vn",
      "health.vn",
      "vu",
      "com.vu",
      "edu.vu",
      "net.vu",
      "org.vu",
      "wf",
      "ws",
      "com.ws",
      "net.ws",
      "org.ws",
      "gov.ws",
      "edu.ws",
      "yt",
      "\u0627\u0645\u0627\u0631\u0627\u062A",
      "\u0570\u0561\u0575",
      "\u09AC\u09BE\u0982\u09B2\u09BE",
      "\u0431\u0433",
      "\u0627\u0644\u0628\u062D\u0631\u064A\u0646",
      "\u0431\u0435\u043B",
      "\u4E2D\u56FD",
      "\u4E2D\u570B",
      "\u0627\u0644\u062C\u0632\u0627\u0626\u0631",
      "\u0645\u0635\u0631",
      "\u0435\u044E",
      "\u03B5\u03C5",
      "\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627",
      "\u10D2\u10D4",
      "\u03B5\u03BB",
      "\u9999\u6E2F",
      "\u516C\u53F8.\u9999\u6E2F",
      "\u6559\u80B2.\u9999\u6E2F",
      "\u653F\u5E9C.\u9999\u6E2F",
      "\u500B\u4EBA.\u9999\u6E2F",
      "\u7DB2\u7D61.\u9999\u6E2F",
      "\u7D44\u7E54.\u9999\u6E2F",
      "\u0CAD\u0CBE\u0CB0\u0CA4",
      "\u0B2D\u0B3E\u0B30\u0B24",
      "\u09AD\u09BE\u09F0\u09A4",
      "\u092D\u093E\u0930\u0924\u092E\u094D",
      "\u092D\u093E\u0930\u094B\u0924",
      "\u0680\u0627\u0631\u062A",
      "\u0D2D\u0D3E\u0D30\u0D24\u0D02",
      "\u092D\u093E\u0930\u0924",
      "\u0628\u0627\u0631\u062A",
      "\u0628\u06BE\u0627\u0631\u062A",
      "\u0C2D\u0C3E\u0C30\u0C24\u0C4D",
      "\u0AAD\u0ABE\u0AB0\u0AA4",
      "\u0A2D\u0A3E\u0A30\u0A24",
      "\u09AD\u09BE\u09B0\u09A4",
      "\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE",
      "\u0627\u06CC\u0631\u0627\u0646",
      "\u0627\u064A\u0631\u0627\u0646",
      "\u0639\u0631\u0627\u0642",
      "\u0627\u0644\u0627\u0631\u062F\u0646",
      "\uD55C\uAD6D",
      "\u049B\u0430\u0437",
      "\u0EA5\u0EB2\u0EA7",
      "\u0DBD\u0D82\u0D9A\u0DCF",
      "\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8",
      "\u0627\u0644\u0645\u063A\u0631\u0628",
      "\u043C\u043A\u0434",
      "\u043C\u043E\u043D",
      "\u6FB3\u9580",
      "\u6FB3\u95E8",
      "\u0645\u0644\u064A\u0633\u064A\u0627",
      "\u0639\u0645\u0627\u0646",
      "\u067E\u0627\u06A9\u0633\u062A\u0627\u0646",
      "\u067E\u0627\u0643\u0633\u062A\u0627\u0646",
      "\u0641\u0644\u0633\u0637\u064A\u0646",
      "\u0441\u0440\u0431",
      "\u043F\u0440.\u0441\u0440\u0431",
      "\u043E\u0440\u0433.\u0441\u0440\u0431",
      "\u043E\u0431\u0440.\u0441\u0440\u0431",
      "\u043E\u0434.\u0441\u0440\u0431",
      "\u0443\u043F\u0440.\u0441\u0440\u0431",
      "\u0430\u043A.\u0441\u0440\u0431",
      "\u0440\u0444",
      "\u0642\u0637\u0631",
      "\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629",
      "\u0627\u0644\u0633\u0639\u0648\u062F\u06CC\u0629",
      "\u0627\u0644\u0633\u0639\u0648\u062F\u06CC\u06C3",
      "\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647",
      "\u0633\u0648\u062F\u0627\u0646",
      "\u65B0\u52A0\u5761",
      "\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD",
      "\u0633\u0648\u0631\u064A\u0629",
      "\u0633\u0648\u0631\u064A\u0627",
      "\u0E44\u0E17\u0E22",
      "\u0E28\u0E36\u0E01\u0E29\u0E32.\u0E44\u0E17\u0E22",
      "\u0E18\u0E38\u0E23\u0E01\u0E34\u0E08.\u0E44\u0E17\u0E22",
      "\u0E23\u0E31\u0E10\u0E1A\u0E32\u0E25.\u0E44\u0E17\u0E22",
      "\u0E17\u0E2B\u0E32\u0E23.\u0E44\u0E17\u0E22",
      "\u0E40\u0E19\u0E47\u0E15.\u0E44\u0E17\u0E22",
      "\u0E2D\u0E07\u0E04\u0E4C\u0E01\u0E23.\u0E44\u0E17\u0E22",
      "\u062A\u0648\u0646\u0633",
      "\u53F0\u7063",
      "\u53F0\u6E7E",
      "\u81FA\u7063",
      "\u0443\u043A\u0440",
      "\u0627\u0644\u064A\u0645\u0646",
      "xxx",
      "ye",
      "com.ye",
      "edu.ye",
      "gov.ye",
      "net.ye",
      "mil.ye",
      "org.ye",
      "ac.za",
      "agric.za",
      "alt.za",
      "co.za",
      "edu.za",
      "gov.za",
      "grondar.za",
      "law.za",
      "mil.za",
      "net.za",
      "ngo.za",
      "nic.za",
      "nis.za",
      "nom.za",
      "org.za",
      "school.za",
      "tm.za",
      "web.za",
      "zm",
      "ac.zm",
      "biz.zm",
      "co.zm",
      "com.zm",
      "edu.zm",
      "gov.zm",
      "info.zm",
      "mil.zm",
      "net.zm",
      "org.zm",
      "sch.zm",
      "zw",
      "ac.zw",
      "co.zw",
      "gov.zw",
      "mil.zw",
      "org.zw",
      "aaa",
      "aarp",
      "abarth",
      "abb",
      "abbott",
      "abbvie",
      "abc",
      "able",
      "abogado",
      "abudhabi",
      "academy",
      "accenture",
      "accountant",
      "accountants",
      "aco",
      "actor",
      "adac",
      "ads",
      "adult",
      "aeg",
      "aetna",
      "afl",
      "africa",
      "agakhan",
      "agency",
      "aig",
      "airbus",
      "airforce",
      "airtel",
      "akdn",
      "alfaromeo",
      "alibaba",
      "alipay",
      "allfinanz",
      "allstate",
      "ally",
      "alsace",
      "alstom",
      "amazon",
      "americanexpress",
      "americanfamily",
      "amex",
      "amfam",
      "amica",
      "amsterdam",
      "analytics",
      "android",
      "anquan",
      "anz",
      "aol",
      "apartments",
      "app",
      "apple",
      "aquarelle",
      "arab",
      "aramco",
      "archi",
      "army",
      "art",
      "arte",
      "asda",
      "associates",
      "athleta",
      "attorney",
      "auction",
      "audi",
      "audible",
      "audio",
      "auspost",
      "author",
      "auto",
      "autos",
      "avianca",
      "aws",
      "axa",
      "azure",
      "baby",
      "baidu",
      "banamex",
      "bananarepublic",
      "band",
      "bank",
      "bar",
      "barcelona",
      "barclaycard",
      "barclays",
      "barefoot",
      "bargains",
      "baseball",
      "basketball",
      "bauhaus",
      "bayern",
      "bbc",
      "bbt",
      "bbva",
      "bcg",
      "bcn",
      "beats",
      "beauty",
      "beer",
      "bentley",
      "berlin",
      "best",
      "bestbuy",
      "bet",
      "bharti",
      "bible",
      "bid",
      "bike",
      "bing",
      "bingo",
      "bio",
      "black",
      "blackfriday",
      "blockbuster",
      "blog",
      "bloomberg",
      "blue",
      "bms",
      "bmw",
      "bnpparibas",
      "boats",
      "boehringer",
      "bofa",
      "bom",
      "bond",
      "boo",
      "book",
      "booking",
      "bosch",
      "bostik",
      "boston",
      "bot",
      "boutique",
      "box",
      "bradesco",
      "bridgestone",
      "broadway",
      "broker",
      "brother",
      "brussels",
      "bugatti",
      "build",
      "builders",
      "business",
      "buy",
      "buzz",
      "bzh",
      "cab",
      "cafe",
      "cal",
      "call",
      "calvinklein",
      "cam",
      "camera",
      "camp",
      "cancerresearch",
      "canon",
      "capetown",
      "capital",
      "capitalone",
      "car",
      "caravan",
      "cards",
      "care",
      "career",
      "careers",
      "cars",
      "casa",
      "case",
      "cash",
      "casino",
      "catering",
      "catholic",
      "cba",
      "cbn",
      "cbre",
      "cbs",
      "center",
      "ceo",
      "cern",
      "cfa",
      "cfd",
      "chanel",
      "channel",
      "charity",
      "chase",
      "chat",
      "cheap",
      "chintai",
      "christmas",
      "chrome",
      "church",
      "cipriani",
      "circle",
      "cisco",
      "citadel",
      "citi",
      "citic",
      "city",
      "cityeats",
      "claims",
      "cleaning",
      "click",
      "clinic",
      "clinique",
      "clothing",
      "cloud",
      "club",
      "clubmed",
      "coach",
      "codes",
      "coffee",
      "college",
      "cologne",
      "comcast",
      "commbank",
      "community",
      "company",
      "compare",
      "computer",
      "comsec",
      "condos",
      "construction",
      "consulting",
      "contact",
      "contractors",
      "cooking",
      "cookingchannel",
      "cool",
      "corsica",
      "country",
      "coupon",
      "coupons",
      "courses",
      "cpa",
      "credit",
      "creditcard",
      "creditunion",
      "cricket",
      "crown",
      "crs",
      "cruise",
      "cruises",
      "cuisinella",
      "cymru",
      "cyou",
      "dabur",
      "dad",
      "dance",
      "data",
      "date",
      "dating",
      "datsun",
      "day",
      "dclk",
      "dds",
      "deal",
      "dealer",
      "deals",
      "degree",
      "delivery",
      "dell",
      "deloitte",
      "delta",
      "democrat",
      "dental",
      "dentist",
      "desi",
      "design",
      "dev",
      "dhl",
      "diamonds",
      "diet",
      "digital",
      "direct",
      "directory",
      "discount",
      "discover",
      "dish",
      "diy",
      "dnp",
      "docs",
      "doctor",
      "dog",
      "domains",
      "dot",
      "download",
      "drive",
      "dtv",
      "dubai",
      "dunlop",
      "dupont",
      "durban",
      "dvag",
      "dvr",
      "earth",
      "eat",
      "eco",
      "edeka",
      "education",
      "email",
      "emerck",
      "energy",
      "engineer",
      "engineering",
      "enterprises",
      "epson",
      "equipment",
      "ericsson",
      "erni",
      "esq",
      "estate",
      "etisalat",
      "eurovision",
      "eus",
      "events",
      "exchange",
      "expert",
      "exposed",
      "express",
      "extraspace",
      "fage",
      "fail",
      "fairwinds",
      "faith",
      "family",
      "fan",
      "fans",
      "farm",
      "farmers",
      "fashion",
      "fast",
      "fedex",
      "feedback",
      "ferrari",
      "ferrero",
      "fiat",
      "fidelity",
      "fido",
      "film",
      "final",
      "finance",
      "financial",
      "fire",
      "firestone",
      "firmdale",
      "fish",
      "fishing",
      "fit",
      "fitness",
      "flickr",
      "flights",
      "flir",
      "florist",
      "flowers",
      "fly",
      "foo",
      "food",
      "foodnetwork",
      "football",
      "ford",
      "forex",
      "forsale",
      "forum",
      "foundation",
      "fox",
      "free",
      "fresenius",
      "frl",
      "frogans",
      "frontdoor",
      "frontier",
      "ftr",
      "fujitsu",
      "fun",
      "fund",
      "furniture",
      "futbol",
      "fyi",
      "gal",
      "gallery",
      "gallo",
      "gallup",
      "game",
      "games",
      "gap",
      "garden",
      "gay",
      "gbiz",
      "gdn",
      "gea",
      "gent",
      "genting",
      "george",
      "ggee",
      "gift",
      "gifts",
      "gives",
      "giving",
      "glass",
      "gle",
      "global",
      "globo",
      "gmail",
      "gmbh",
      "gmo",
      "gmx",
      "godaddy",
      "gold",
      "goldpoint",
      "golf",
      "goo",
      "goodyear",
      "goog",
      "google",
      "gop",
      "got",
      "grainger",
      "graphics",
      "gratis",
      "green",
      "gripe",
      "grocery",
      "group",
      "guardian",
      "gucci",
      "guge",
      "guide",
      "guitars",
      "guru",
      "hair",
      "hamburg",
      "hangout",
      "haus",
      "hbo",
      "hdfc",
      "hdfcbank",
      "health",
      "healthcare",
      "help",
      "helsinki",
      "here",
      "hermes",
      "hgtv",
      "hiphop",
      "hisamitsu",
      "hitachi",
      "hiv",
      "hkt",
      "hockey",
      "holdings",
      "holiday",
      "homedepot",
      "homegoods",
      "homes",
      "homesense",
      "honda",
      "horse",
      "hospital",
      "host",
      "hosting",
      "hot",
      "hoteles",
      "hotels",
      "hotmail",
      "house",
      "how",
      "hsbc",
      "hughes",
      "hyatt",
      "hyundai",
      "ibm",
      "icbc",
      "ice",
      "icu",
      "ieee",
      "ifm",
      "ikano",
      "imamat",
      "imdb",
      "immo",
      "immobilien",
      "inc",
      "industries",
      "infiniti",
      "ing",
      "ink",
      "institute",
      "insurance",
      "insure",
      "international",
      "intuit",
      "investments",
      "ipiranga",
      "irish",
      "ismaili",
      "ist",
      "istanbul",
      "itau",
      "itv",
      "jaguar",
      "java",
      "jcb",
      "jeep",
      "jetzt",
      "jewelry",
      "jio",
      "jll",
      "jmp",
      "jnj",
      "joburg",
      "jot",
      "joy",
      "jpmorgan",
      "jprs",
      "juegos",
      "juniper",
      "kaufen",
      "kddi",
      "kerryhotels",
      "kerrylogistics",
      "kerryproperties",
      "kfh",
      "kia",
      "kids",
      "kim",
      "kinder",
      "kindle",
      "kitchen",
      "kiwi",
      "koeln",
      "komatsu",
      "kosher",
      "kpmg",
      "kpn",
      "krd",
      "kred",
      "kuokgroup",
      "kyoto",
      "lacaixa",
      "lamborghini",
      "lamer",
      "lancaster",
      "lancia",
      "land",
      "landrover",
      "lanxess",
      "lasalle",
      "lat",
      "latino",
      "latrobe",
      "law",
      "lawyer",
      "lds",
      "lease",
      "leclerc",
      "lefrak",
      "legal",
      "lego",
      "lexus",
      "lgbt",
      "lidl",
      "life",
      "lifeinsurance",
      "lifestyle",
      "lighting",
      "like",
      "lilly",
      "limited",
      "limo",
      "lincoln",
      "linde",
      "link",
      "lipsy",
      "live",
      "living",
      "llc",
      "llp",
      "loan",
      "loans",
      "locker",
      "locus",
      "loft",
      "lol",
      "london",
      "lotte",
      "lotto",
      "love",
      "lpl",
      "lplfinancial",
      "ltd",
      "ltda",
      "lundbeck",
      "luxe",
      "luxury",
      "macys",
      "madrid",
      "maif",
      "maison",
      "makeup",
      "man",
      "management",
      "mango",
      "map",
      "market",
      "marketing",
      "markets",
      "marriott",
      "marshalls",
      "maserati",
      "mattel",
      "mba",
      "mckinsey",
      "med",
      "media",
      "meet",
      "melbourne",
      "meme",
      "memorial",
      "men",
      "menu",
      "merckmsd",
      "miami",
      "microsoft",
      "mini",
      "mint",
      "mit",
      "mitsubishi",
      "mlb",
      "mls",
      "mma",
      "mobile",
      "moda",
      "moe",
      "moi",
      "mom",
      "monash",
      "money",
      "monster",
      "mormon",
      "mortgage",
      "moscow",
      "moto",
      "motorcycles",
      "mov",
      "movie",
      "msd",
      "mtn",
      "mtr",
      "music",
      "mutual",
      "nab",
      "nagoya",
      "natura",
      "navy",
      "nba",
      "nec",
      "netbank",
      "netflix",
      "network",
      "neustar",
      "new",
      "news",
      "next",
      "nextdirect",
      "nexus",
      "nfl",
      "ngo",
      "nhk",
      "nico",
      "nike",
      "nikon",
      "ninja",
      "nissan",
      "nissay",
      "nokia",
      "northwesternmutual",
      "norton",
      "now",
      "nowruz",
      "nowtv",
      "nra",
      "nrw",
      "ntt",
      "nyc",
      "obi",
      "observer",
      "office",
      "okinawa",
      "olayan",
      "olayangroup",
      "oldnavy",
      "ollo",
      "omega",
      "one",
      "ong",
      "onl",
      "online",
      "ooo",
      "open",
      "oracle",
      "orange",
      "organic",
      "origins",
      "osaka",
      "otsuka",
      "ott",
      "ovh",
      "page",
      "panasonic",
      "paris",
      "pars",
      "partners",
      "parts",
      "party",
      "passagens",
      "pay",
      "pccw",
      "pet",
      "pfizer",
      "pharmacy",
      "phd",
      "philips",
      "phone",
      "photo",
      "photography",
      "photos",
      "physio",
      "pics",
      "pictet",
      "pictures",
      "pid",
      "pin",
      "ping",
      "pink",
      "pioneer",
      "pizza",
      "place",
      "play",
      "playstation",
      "plumbing",
      "plus",
      "pnc",
      "pohl",
      "poker",
      "politie",
      "porn",
      "pramerica",
      "praxi",
      "press",
      "prime",
      "prod",
      "productions",
      "prof",
      "progressive",
      "promo",
      "properties",
      "property",
      "protection",
      "pru",
      "prudential",
      "pub",
      "pwc",
      "qpon",
      "quebec",
      "quest",
      "racing",
      "radio",
      "read",
      "realestate",
      "realtor",
      "realty",
      "recipes",
      "red",
      "redstone",
      "redumbrella",
      "rehab",
      "reise",
      "reisen",
      "reit",
      "reliance",
      "ren",
      "rent",
      "rentals",
      "repair",
      "report",
      "republican",
      "rest",
      "restaurant",
      "review",
      "reviews",
      "rexroth",
      "rich",
      "richardli",
      "ricoh",
      "ril",
      "rio",
      "rip",
      "rocher",
      "rocks",
      "rodeo",
      "rogers",
      "room",
      "rsvp",
      "rugby",
      "ruhr",
      "run",
      "rwe",
      "ryukyu",
      "saarland",
      "safe",
      "safety",
      "sakura",
      "sale",
      "salon",
      "samsclub",
      "samsung",
      "sandvik",
      "sandvikcoromant",
      "sanofi",
      "sap",
      "sarl",
      "sas",
      "save",
      "saxo",
      "sbi",
      "sbs",
      "sca",
      "scb",
      "schaeffler",
      "schmidt",
      "scholarships",
      "school",
      "schule",
      "schwarz",
      "science",
      "scot",
      "search",
      "seat",
      "secure",
      "security",
      "seek",
      "select",
      "sener",
      "services",
      "ses",
      "seven",
      "sew",
      "sex",
      "sexy",
      "sfr",
      "shangrila",
      "sharp",
      "shaw",
      "shell",
      "shia",
      "shiksha",
      "shoes",
      "shop",
      "shopping",
      "shouji",
      "show",
      "showtime",
      "silk",
      "sina",
      "singles",
      "site",
      "ski",
      "skin",
      "sky",
      "skype",
      "sling",
      "smart",
      "smile",
      "sncf",
      "soccer",
      "social",
      "softbank",
      "software",
      "sohu",
      "solar",
      "solutions",
      "song",
      "sony",
      "soy",
      "spa",
      "space",
      "sport",
      "spot",
      "srl",
      "stada",
      "staples",
      "star",
      "statebank",
      "statefarm",
      "stc",
      "stcgroup",
      "stockholm",
      "storage",
      "store",
      "stream",
      "studio",
      "study",
      "style",
      "sucks",
      "supplies",
      "supply",
      "support",
      "surf",
      "surgery",
      "suzuki",
      "swatch",
      "swiss",
      "sydney",
      "systems",
      "tab",
      "taipei",
      "talk",
      "taobao",
      "target",
      "tatamotors",
      "tatar",
      "tattoo",
      "tax",
      "taxi",
      "tci",
      "tdk",
      "team",
      "tech",
      "technology",
      "temasek",
      "tennis",
      "teva",
      "thd",
      "theater",
      "theatre",
      "tiaa",
      "tickets",
      "tienda",
      "tiffany",
      "tips",
      "tires",
      "tirol",
      "tjmaxx",
      "tjx",
      "tkmaxx",
      "tmall",
      "today",
      "tokyo",
      "tools",
      "top",
      "toray",
      "toshiba",
      "total",
      "tours",
      "town",
      "toyota",
      "toys",
      "trade",
      "trading",
      "training",
      "travel",
      "travelchannel",
      "travelers",
      "travelersinsurance",
      "trust",
      "trv",
      "tube",
      "tui",
      "tunes",
      "tushu",
      "tvs",
      "ubank",
      "ubs",
      "unicom",
      "university",
      "uno",
      "uol",
      "ups",
      "vacations",
      "vana",
      "vanguard",
      "vegas",
      "ventures",
      "verisign",
      "versicherung",
      "vet",
      "viajes",
      "video",
      "vig",
      "viking",
      "villas",
      "vin",
      "vip",
      "virgin",
      "visa",
      "vision",
      "viva",
      "vivo",
      "vlaanderen",
      "vodka",
      "volkswagen",
      "volvo",
      "vote",
      "voting",
      "voto",
      "voyage",
      "vuelos",
      "wales",
      "walmart",
      "walter",
      "wang",
      "wanggou",
      "watch",
      "watches",
      "weather",
      "weatherchannel",
      "webcam",
      "weber",
      "website",
      "wedding",
      "weibo",
      "weir",
      "whoswho",
      "wien",
      "wiki",
      "williamhill",
      "win",
      "windows",
      "wine",
      "winners",
      "wme",
      "wolterskluwer",
      "woodside",
      "work",
      "works",
      "world",
      "wow",
      "wtc",
      "wtf",
      "xbox",
      "xerox",
      "xfinity",
      "xihuan",
      "xin",
      "\u0915\u0949\u092E",
      "\u30BB\u30FC\u30EB",
      "\u4F5B\u5C71",
      "\u6148\u5584",
      "\u96C6\u56E2",
      "\u5728\u7EBF",
      "\u70B9\u770B",
      "\u0E04\u0E2D\u0E21",
      "\u516B\u5366",
      "\u0645\u0648\u0642\u0639",
      "\u516C\u76CA",
      "\u516C\u53F8",
      "\u9999\u683C\u91CC\u62C9",
      "\u7F51\u7AD9",
      "\u79FB\u52A8",
      "\u6211\u7231\u4F60",
      "\u043C\u043E\u0441\u043A\u0432\u0430",
      "\u043A\u0430\u0442\u043E\u043B\u0438\u043A",
      "\u043E\u043D\u043B\u0430\u0439\u043D",
      "\u0441\u0430\u0439\u0442",
      "\u8054\u901A",
      "\u05E7\u05D5\u05DD",
      "\u65F6\u5C1A",
      "\u5FAE\u535A",
      "\u6DE1\u9A6C\u9521",
      "\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3",
      "\u043E\u0440\u0433",
      "\u0928\u0947\u091F",
      "\u30B9\u30C8\u30A2",
      "\u30A2\u30DE\u30BE\u30F3",
      "\uC0BC\uC131",
      "\u5546\u6807",
      "\u5546\u5E97",
      "\u5546\u57CE",
      "\u0434\u0435\u0442\u0438",
      "\u30DD\u30A4\u30F3\u30C8",
      "\u65B0\u95FB",
      "\u5BB6\u96FB",
      "\u0643\u0648\u0645",
      "\u4E2D\u6587\u7F51",
      "\u4E2D\u4FE1",
      "\u5A31\u4E50",
      "\u8C37\u6B4C",
      "\u96FB\u8A0A\u76C8\u79D1",
      "\u8D2D\u7269",
      "\u30AF\u30E9\u30A6\u30C9",
      "\u901A\u8CA9",
      "\u7F51\u5E97",
      "\u0938\u0902\u0917\u0920\u0928",
      "\u9910\u5385",
      "\u7F51\u7EDC",
      "\u043A\u043E\u043C",
      "\u4E9A\u9A6C\u900A",
      "\u8BFA\u57FA\u4E9A",
      "\u98DF\u54C1",
      "\u98DE\u5229\u6D66",
      "\u624B\u673A",
      "\u0627\u0631\u0627\u0645\u0643\u0648",
      "\u0627\u0644\u0639\u0644\u064A\u0627\u0646",
      "\u0627\u062A\u0635\u0627\u0644\u0627\u062A",
      "\u0628\u0627\u0632\u0627\u0631",
      "\u0627\u0628\u0648\u0638\u0628\u064A",
      "\u0643\u0627\u062B\u0648\u0644\u064A\u0643",
      "\u0647\u0645\u0631\u0627\u0647",
      "\uB2F7\uCEF4",
      "\u653F\u5E9C",
      "\u0634\u0628\u0643\u0629",
      "\u0628\u064A\u062A\u0643",
      "\u0639\u0631\u0628",
      "\u673A\u6784",
      "\u7EC4\u7EC7\u673A\u6784",
      "\u5065\u5EB7",
      "\u62DB\u8058",
      "\u0440\u0443\u0441",
      "\u5927\u62FF",
      "\u307F\u3093\u306A",
      "\u30B0\u30FC\u30B0\u30EB",
      "\u4E16\u754C",
      "\u66F8\u7C4D",
      "\u7F51\u5740",
      "\uB2F7\uB137",
      "\u30B3\u30E0",
      "\u5929\u4E3B\u6559",
      "\u6E38\u620F",
      "verm\xF6gensberater",
      "verm\xF6gensberatung",
      "\u4F01\u4E1A",
      "\u4FE1\u606F",
      "\u5609\u91CC\u5927\u9152\u5E97",
      "\u5609\u91CC",
      "\u5E7F\u4E1C",
      "\u653F\u52A1",
      "xyz",
      "yachts",
      "yahoo",
      "yamaxun",
      "yandex",
      "yodobashi",
      "yoga",
      "yokohama",
      "you",
      "youtube",
      "yun",
      "zappos",
      "zara",
      "zero",
      "zip",
      "zone",
      "zuerich",
      "cc.ua",
      "inf.ua",
      "ltd.ua",
      "611.to",
      "graphox.us",
      "*.devcdnaccesso.com",
      "adobeaemcloud.com",
      "*.dev.adobeaemcloud.com",
      "hlx.live",
      "adobeaemcloud.net",
      "hlx.page",
      "hlx3.page",
      "beep.pl",
      "airkitapps.com",
      "airkitapps-au.com",
      "airkitapps.eu",
      "aivencloud.com",
      "barsy.ca",
      "*.compute.estate",
      "*.alces.network",
      "kasserver.com",
      "altervista.org",
      "alwaysdata.net",
      "cloudfront.net",
      "*.compute.amazonaws.com",
      "*.compute-1.amazonaws.com",
      "*.compute.amazonaws.com.cn",
      "us-east-1.amazonaws.com",
      "cn-north-1.eb.amazonaws.com.cn",
      "cn-northwest-1.eb.amazonaws.com.cn",
      "elasticbeanstalk.com",
      "ap-northeast-1.elasticbeanstalk.com",
      "ap-northeast-2.elasticbeanstalk.com",
      "ap-northeast-3.elasticbeanstalk.com",
      "ap-south-1.elasticbeanstalk.com",
      "ap-southeast-1.elasticbeanstalk.com",
      "ap-southeast-2.elasticbeanstalk.com",
      "ca-central-1.elasticbeanstalk.com",
      "eu-central-1.elasticbeanstalk.com",
      "eu-west-1.elasticbeanstalk.com",
      "eu-west-2.elasticbeanstalk.com",
      "eu-west-3.elasticbeanstalk.com",
      "sa-east-1.elasticbeanstalk.com",
      "us-east-1.elasticbeanstalk.com",
      "us-east-2.elasticbeanstalk.com",
      "us-gov-west-1.elasticbeanstalk.com",
      "us-west-1.elasticbeanstalk.com",
      "us-west-2.elasticbeanstalk.com",
      "*.elb.amazonaws.com",
      "*.elb.amazonaws.com.cn",
      "awsglobalaccelerator.com",
      "s3.amazonaws.com",
      "s3-ap-northeast-1.amazonaws.com",
      "s3-ap-northeast-2.amazonaws.com",
      "s3-ap-south-1.amazonaws.com",
      "s3-ap-southeast-1.amazonaws.com",
      "s3-ap-southeast-2.amazonaws.com",
      "s3-ca-central-1.amazonaws.com",
      "s3-eu-central-1.amazonaws.com",
      "s3-eu-west-1.amazonaws.com",
      "s3-eu-west-2.amazonaws.com",
      "s3-eu-west-3.amazonaws.com",
      "s3-external-1.amazonaws.com",
      "s3-fips-us-gov-west-1.amazonaws.com",
      "s3-sa-east-1.amazonaws.com",
      "s3-us-gov-west-1.amazonaws.com",
      "s3-us-east-2.amazonaws.com",
      "s3-us-west-1.amazonaws.com",
      "s3-us-west-2.amazonaws.com",
      "s3.ap-northeast-2.amazonaws.com",
      "s3.ap-south-1.amazonaws.com",
      "s3.cn-north-1.amazonaws.com.cn",
      "s3.ca-central-1.amazonaws.com",
      "s3.eu-central-1.amazonaws.com",
      "s3.eu-west-2.amazonaws.com",
      "s3.eu-west-3.amazonaws.com",
      "s3.us-east-2.amazonaws.com",
      "s3.dualstack.ap-northeast-1.amazonaws.com",
      "s3.dualstack.ap-northeast-2.amazonaws.com",
      "s3.dualstack.ap-south-1.amazonaws.com",
      "s3.dualstack.ap-southeast-1.amazonaws.com",
      "s3.dualstack.ap-southeast-2.amazonaws.com",
      "s3.dualstack.ca-central-1.amazonaws.com",
      "s3.dualstack.eu-central-1.amazonaws.com",
      "s3.dualstack.eu-west-1.amazonaws.com",
      "s3.dualstack.eu-west-2.amazonaws.com",
      "s3.dualstack.eu-west-3.amazonaws.com",
      "s3.dualstack.sa-east-1.amazonaws.com",
      "s3.dualstack.us-east-1.amazonaws.com",
      "s3.dualstack.us-east-2.amazonaws.com",
      "s3-website-us-east-1.amazonaws.com",
      "s3-website-us-west-1.amazonaws.com",
      "s3-website-us-west-2.amazonaws.com",
      "s3-website-ap-northeast-1.amazonaws.com",
      "s3-website-ap-southeast-1.amazonaws.com",
      "s3-website-ap-southeast-2.amazonaws.com",
      "s3-website-eu-west-1.amazonaws.com",
      "s3-website-sa-east-1.amazonaws.com",
      "s3-website.ap-northeast-2.amazonaws.com",
      "s3-website.ap-south-1.amazonaws.com",
      "s3-website.ca-central-1.amazonaws.com",
      "s3-website.eu-central-1.amazonaws.com",
      "s3-website.eu-west-2.amazonaws.com",
      "s3-website.eu-west-3.amazonaws.com",
      "s3-website.us-east-2.amazonaws.com",
      "t3l3p0rt.net",
      "tele.amune.org",
      "apigee.io",
      "siiites.com",
      "appspacehosted.com",
      "appspaceusercontent.com",
      "appudo.net",
      "on-aptible.com",
      "user.aseinet.ne.jp",
      "gv.vc",
      "d.gv.vc",
      "user.party.eus",
      "pimienta.org",
      "poivron.org",
      "potager.org",
      "sweetpepper.org",
      "myasustor.com",
      "cdn.prod.atlassian-dev.net",
      "translated.page",
      "myfritz.net",
      "onavstack.net",
      "*.awdev.ca",
      "*.advisor.ws",
      "ecommerce-shop.pl",
      "b-data.io",
      "backplaneapp.io",
      "balena-devices.com",
      "rs.ba",
      "*.banzai.cloud",
      "app.banzaicloud.io",
      "*.backyards.banzaicloud.io",
      "base.ec",
      "official.ec",
      "buyshop.jp",
      "fashionstore.jp",
      "handcrafted.jp",
      "kawaiishop.jp",
      "supersale.jp",
      "theshop.jp",
      "shopselect.net",
      "base.shop",
      "*.beget.app",
      "betainabox.com",
      "bnr.la",
      "bitbucket.io",
      "blackbaudcdn.net",
      "of.je",
      "bluebite.io",
      "boomla.net",
      "boutir.com",
      "boxfuse.io",
      "square7.ch",
      "bplaced.com",
      "bplaced.de",
      "square7.de",
      "bplaced.net",
      "square7.net",
      "shop.brendly.rs",
      "browsersafetymark.io",
      "uk0.bigv.io",
      "dh.bytemark.co.uk",
      "vm.bytemark.co.uk",
      "cafjs.com",
      "mycd.eu",
      "drr.ac",
      "uwu.ai",
      "carrd.co",
      "crd.co",
      "ju.mp",
      "ae.org",
      "br.com",
      "cn.com",
      "com.de",
      "com.se",
      "de.com",
      "eu.com",
      "gb.net",
      "hu.net",
      "jp.net",
      "jpn.com",
      "mex.com",
      "ru.com",
      "sa.com",
      "se.net",
      "uk.com",
      "uk.net",
      "us.com",
      "za.bz",
      "za.com",
      "ar.com",
      "hu.com",
      "kr.com",
      "no.com",
      "qc.com",
      "uy.com",
      "africa.com",
      "gr.com",
      "in.net",
      "web.in",
      "us.org",
      "co.com",
      "aus.basketball",
      "nz.basketball",
      "radio.am",
      "radio.fm",
      "c.la",
      "certmgr.org",
      "cx.ua",
      "discourse.group",
      "discourse.team",
      "cleverapps.io",
      "clerk.app",
      "clerkstage.app",
      "*.lcl.dev",
      "*.lclstage.dev",
      "*.stg.dev",
      "*.stgstage.dev",
      "clickrising.net",
      "c66.me",
      "cloud66.ws",
      "cloud66.zone",
      "jdevcloud.com",
      "wpdevcloud.com",
      "cloudaccess.host",
      "freesite.host",
      "cloudaccess.net",
      "cloudcontrolled.com",
      "cloudcontrolapp.com",
      "*.cloudera.site",
      "pages.dev",
      "trycloudflare.com",
      "workers.dev",
      "wnext.app",
      "co.ca",
      "*.otap.co",
      "co.cz",
      "c.cdn77.org",
      "cdn77-ssl.net",
      "r.cdn77.net",
      "rsc.cdn77.org",
      "ssl.origin.cdn77-secure.org",
      "cloudns.asia",
      "cloudns.biz",
      "cloudns.club",
      "cloudns.cc",
      "cloudns.eu",
      "cloudns.in",
      "cloudns.info",
      "cloudns.org",
      "cloudns.pro",
      "cloudns.pw",
      "cloudns.us",
      "cnpy.gdn",
      "codeberg.page",
      "co.nl",
      "co.no",
      "webhosting.be",
      "hosting-cluster.nl",
      "ac.ru",
      "edu.ru",
      "gov.ru",
      "int.ru",
      "mil.ru",
      "test.ru",
      "dyn.cosidns.de",
      "dynamisches-dns.de",
      "dnsupdater.de",
      "internet-dns.de",
      "l-o-g-i-n.de",
      "dynamic-dns.info",
      "feste-ip.net",
      "knx-server.net",
      "static-access.net",
      "realm.cz",
      "*.cryptonomic.net",
      "cupcake.is",
      "curv.dev",
      "*.customer-oci.com",
      "*.oci.customer-oci.com",
      "*.ocp.customer-oci.com",
      "*.ocs.customer-oci.com",
      "cyon.link",
      "cyon.site",
      "fnwk.site",
      "folionetwork.site",
      "platform0.app",
      "daplie.me",
      "localhost.daplie.me",
      "dattolocal.com",
      "dattorelay.com",
      "dattoweb.com",
      "mydatto.com",
      "dattolocal.net",
      "mydatto.net",
      "biz.dk",
      "co.dk",
      "firm.dk",
      "reg.dk",
      "store.dk",
      "dyndns.dappnode.io",
      "*.dapps.earth",
      "*.bzz.dapps.earth",
      "builtwithdark.com",
      "demo.datadetect.com",
      "instance.datadetect.com",
      "edgestack.me",
      "ddns5.com",
      "debian.net",
      "deno.dev",
      "deno-staging.dev",
      "dedyn.io",
      "deta.app",
      "deta.dev",
      "*.rss.my.id",
      "*.diher.solutions",
      "discordsays.com",
      "discordsez.com",
      "jozi.biz",
      "dnshome.de",
      "online.th",
      "shop.th",
      "drayddns.com",
      "shoparena.pl",
      "dreamhosters.com",
      "mydrobo.com",
      "drud.io",
      "drud.us",
      "duckdns.org",
      "bip.sh",
      "bitbridge.net",
      "dy.fi",
      "tunk.org",
      "dyndns-at-home.com",
      "dyndns-at-work.com",
      "dyndns-blog.com",
      "dyndns-free.com",
      "dyndns-home.com",
      "dyndns-ip.com",
      "dyndns-mail.com",
      "dyndns-office.com",
      "dyndns-pics.com",
      "dyndns-remote.com",
      "dyndns-server.com",
      "dyndns-web.com",
      "dyndns-wiki.com",
      "dyndns-work.com",
      "dyndns.biz",
      "dyndns.info",
      "dyndns.org",
      "dyndns.tv",
      "at-band-camp.net",
      "ath.cx",
      "barrel-of-knowledge.info",
      "barrell-of-knowledge.info",
      "better-than.tv",
      "blogdns.com",
      "blogdns.net",
      "blogdns.org",
      "blogsite.org",
      "boldlygoingnowhere.org",
      "broke-it.net",
      "buyshouses.net",
      "cechire.com",
      "dnsalias.com",
      "dnsalias.net",
      "dnsalias.org",
      "dnsdojo.com",
      "dnsdojo.net",
      "dnsdojo.org",
      "does-it.net",
      "doesntexist.com",
      "doesntexist.org",
      "dontexist.com",
      "dontexist.net",
      "dontexist.org",
      "doomdns.com",
      "doomdns.org",
      "dvrdns.org",
      "dyn-o-saur.com",
      "dynalias.com",
      "dynalias.net",
      "dynalias.org",
      "dynathome.net",
      "dyndns.ws",
      "endofinternet.net",
      "endofinternet.org",
      "endoftheinternet.org",
      "est-a-la-maison.com",
      "est-a-la-masion.com",
      "est-le-patron.com",
      "est-mon-blogueur.com",
      "for-better.biz",
      "for-more.biz",
      "for-our.info",
      "for-some.biz",
      "for-the.biz",
      "forgot.her.name",
      "forgot.his.name",
      "from-ak.com",
      "from-al.com",
      "from-ar.com",
      "from-az.net",
      "from-ca.com",
      "from-co.net",
      "from-ct.com",
      "from-dc.com",
      "from-de.com",
      "from-fl.com",
      "from-ga.com",
      "from-hi.com",
      "from-ia.com",
      "from-id.com",
      "from-il.com",
      "from-in.com",
      "from-ks.com",
      "from-ky.com",
      "from-la.net",
      "from-ma.com",
      "from-md.com",
      "from-me.org",
      "from-mi.com",
      "from-mn.com",
      "from-mo.com",
      "from-ms.com",
      "from-mt.com",
      "from-nc.com",
      "from-nd.com",
      "from-ne.com",
      "from-nh.com",
      "from-nj.com",
      "from-nm.com",
      "from-nv.com",
      "from-ny.net",
      "from-oh.com",
      "from-ok.com",
      "from-or.com",
      "from-pa.com",
      "from-pr.com",
      "from-ri.com",
      "from-sc.com",
      "from-sd.com",
      "from-tn.com",
      "from-tx.com",
      "from-ut.com",
      "from-va.com",
      "from-vt.com",
      "from-wa.com",
      "from-wi.com",
      "from-wv.com",
      "from-wy.com",
      "ftpaccess.cc",
      "fuettertdasnetz.de",
      "game-host.org",
      "game-server.cc",
      "getmyip.com",
      "gets-it.net",
      "go.dyndns.org",
      "gotdns.com",
      "gotdns.org",
      "groks-the.info",
      "groks-this.info",
      "ham-radio-op.net",
      "here-for-more.info",
      "hobby-site.com",
      "hobby-site.org",
      "home.dyndns.org",
      "homedns.org",
      "homeftp.net",
      "homeftp.org",
      "homeip.net",
      "homelinux.com",
      "homelinux.net",
      "homelinux.org",
      "homeunix.com",
      "homeunix.net",
      "homeunix.org",
      "iamallama.com",
      "in-the-band.net",
      "is-a-anarchist.com",
      "is-a-blogger.com",
      "is-a-bookkeeper.com",
      "is-a-bruinsfan.org",
      "is-a-bulls-fan.com",
      "is-a-candidate.org",
      "is-a-caterer.com",
      "is-a-celticsfan.org",
      "is-a-chef.com",
      "is-a-chef.net",
      "is-a-chef.org",
      "is-a-conservative.com",
      "is-a-cpa.com",
      "is-a-cubicle-slave.com",
      "is-a-democrat.com",
      "is-a-designer.com",
      "is-a-doctor.com",
      "is-a-financialadvisor.com",
      "is-a-geek.com",
      "is-a-geek.net",
      "is-a-geek.org",
      "is-a-green.com",
      "is-a-guru.com",
      "is-a-hard-worker.com",
      "is-a-hunter.com",
      "is-a-knight.org",
      "is-a-landscaper.com",
      "is-a-lawyer.com",
      "is-a-liberal.com",
      "is-a-libertarian.com",
      "is-a-linux-user.org",
      "is-a-llama.com",
      "is-a-musician.com",
      "is-a-nascarfan.com",
      "is-a-nurse.com",
      "is-a-painter.com",
      "is-a-patsfan.org",
      "is-a-personaltrainer.com",
      "is-a-photographer.com",
      "is-a-player.com",
      "is-a-republican.com",
      "is-a-rockstar.com",
      "is-a-socialist.com",
      "is-a-soxfan.org",
      "is-a-student.com",
      "is-a-teacher.com",
      "is-a-techie.com",
      "is-a-therapist.com",
      "is-an-accountant.com",
      "is-an-actor.com",
      "is-an-actress.com",
      "is-an-anarchist.com",
      "is-an-artist.com",
      "is-an-engineer.com",
      "is-an-entertainer.com",
      "is-by.us",
      "is-certified.com",
      "is-found.org",
      "is-gone.com",
      "is-into-anime.com",
      "is-into-cars.com",
      "is-into-cartoons.com",
      "is-into-games.com",
      "is-leet.com",
      "is-lost.org",
      "is-not-certified.com",
      "is-saved.org",
      "is-slick.com",
      "is-uberleet.com",
      "is-very-bad.org",
      "is-very-evil.org",
      "is-very-good.org",
      "is-very-nice.org",
      "is-very-sweet.org",
      "is-with-theband.com",
      "isa-geek.com",
      "isa-geek.net",
      "isa-geek.org",
      "isa-hockeynut.com",
      "issmarterthanyou.com",
      "isteingeek.de",
      "istmein.de",
      "kicks-ass.net",
      "kicks-ass.org",
      "knowsitall.info",
      "land-4-sale.us",
      "lebtimnetz.de",
      "leitungsen.de",
      "likes-pie.com",
      "likescandy.com",
      "merseine.nu",
      "mine.nu",
      "misconfused.org",
      "mypets.ws",
      "myphotos.cc",
      "neat-url.com",
      "office-on-the.net",
      "on-the-web.tv",
      "podzone.net",
      "podzone.org",
      "readmyblog.org",
      "saves-the-whales.com",
      "scrapper-site.net",
      "scrapping.cc",
      "selfip.biz",
      "selfip.com",
      "selfip.info",
      "selfip.net",
      "selfip.org",
      "sells-for-less.com",
      "sells-for-u.com",
      "sells-it.net",
      "sellsyourhome.org",
      "servebbs.com",
      "servebbs.net",
      "servebbs.org",
      "serveftp.net",
      "serveftp.org",
      "servegame.org",
      "shacknet.nu",
      "simple-url.com",
      "space-to-rent.com",
      "stuff-4-sale.org",
      "stuff-4-sale.us",
      "teaches-yoga.com",
      "thruhere.net",
      "traeumtgerade.de",
      "webhop.biz",
      "webhop.info",
      "webhop.net",
      "webhop.org",
      "worse-than.tv",
      "writesthisblog.com",
      "ddnss.de",
      "dyn.ddnss.de",
      "dyndns.ddnss.de",
      "dyndns1.de",
      "dyn-ip24.de",
      "home-webserver.de",
      "dyn.home-webserver.de",
      "myhome-server.de",
      "ddnss.org",
      "definima.net",
      "definima.io",
      "ondigitalocean.app",
      "*.digitaloceanspaces.com",
      "bci.dnstrace.pro",
      "ddnsfree.com",
      "ddnsgeek.com",
      "giize.com",
      "gleeze.com",
      "kozow.com",
      "loseyourip.com",
      "ooguy.com",
      "theworkpc.com",
      "casacam.net",
      "dynu.net",
      "accesscam.org",
      "camdvr.org",
      "freeddns.org",
      "mywire.org",
      "webredirect.org",
      "myddns.rocks",
      "blogsite.xyz",
      "dynv6.net",
      "e4.cz",
      "eero.online",
      "eero-stage.online",
      "elementor.cloud",
      "elementor.cool",
      "en-root.fr",
      "mytuleap.com",
      "tuleap-partners.com",
      "encr.app",
      "encoreapi.com",
      "onred.one",
      "staging.onred.one",
      "eu.encoway.cloud",
      "eu.org",
      "al.eu.org",
      "asso.eu.org",
      "at.eu.org",
      "au.eu.org",
      "be.eu.org",
      "bg.eu.org",
      "ca.eu.org",
      "cd.eu.org",
      "ch.eu.org",
      "cn.eu.org",
      "cy.eu.org",
      "cz.eu.org",
      "de.eu.org",
      "dk.eu.org",
      "edu.eu.org",
      "ee.eu.org",
      "es.eu.org",
      "fi.eu.org",
      "fr.eu.org",
      "gr.eu.org",
      "hr.eu.org",
      "hu.eu.org",
      "ie.eu.org",
      "il.eu.org",
      "in.eu.org",
      "int.eu.org",
      "is.eu.org",
      "it.eu.org",
      "jp.eu.org",
      "kr.eu.org",
      "lt.eu.org",
      "lu.eu.org",
      "lv.eu.org",
      "mc.eu.org",
      "me.eu.org",
      "mk.eu.org",
      "mt.eu.org",
      "my.eu.org",
      "net.eu.org",
      "ng.eu.org",
      "nl.eu.org",
      "no.eu.org",
      "nz.eu.org",
      "paris.eu.org",
      "pl.eu.org",
      "pt.eu.org",
      "q-a.eu.org",
      "ro.eu.org",
      "ru.eu.org",
      "se.eu.org",
      "si.eu.org",
      "sk.eu.org",
      "tr.eu.org",
      "uk.eu.org",
      "us.eu.org",
      "eurodir.ru",
      "eu-1.evennode.com",
      "eu-2.evennode.com",
      "eu-3.evennode.com",
      "eu-4.evennode.com",
      "us-1.evennode.com",
      "us-2.evennode.com",
      "us-3.evennode.com",
      "us-4.evennode.com",
      "twmail.cc",
      "twmail.net",
      "twmail.org",
      "mymailer.com.tw",
      "url.tw",
      "onfabrica.com",
      "apps.fbsbx.com",
      "ru.net",
      "adygeya.ru",
      "bashkiria.ru",
      "bir.ru",
      "cbg.ru",
      "com.ru",
      "dagestan.ru",
      "grozny.ru",
      "kalmykia.ru",
      "kustanai.ru",
      "marine.ru",
      "mordovia.ru",
      "msk.ru",
      "mytis.ru",
      "nalchik.ru",
      "nov.ru",
      "pyatigorsk.ru",
      "spb.ru",
      "vladikavkaz.ru",
      "vladimir.ru",
      "abkhazia.su",
      "adygeya.su",
      "aktyubinsk.su",
      "arkhangelsk.su",
      "armenia.su",
      "ashgabad.su",
      "azerbaijan.su",
      "balashov.su",
      "bashkiria.su",
      "bryansk.su",
      "bukhara.su",
      "chimkent.su",
      "dagestan.su",
      "east-kazakhstan.su",
      "exnet.su",
      "georgia.su",
      "grozny.su",
      "ivanovo.su",
      "jambyl.su",
      "kalmykia.su",
      "kaluga.su",
      "karacol.su",
      "karaganda.su",
      "karelia.su",
      "khakassia.su",
      "krasnodar.su",
      "kurgan.su",
      "kustanai.su",
      "lenug.su",
      "mangyshlak.su",
      "mordovia.su",
      "msk.su",
      "murmansk.su",
      "nalchik.su",
      "navoi.su",
      "north-kazakhstan.su",
      "nov.su",
      "obninsk.su",
      "penza.su",
      "pokrovsk.su",
      "sochi.su",
      "spb.su",
      "tashkent.su",
      "termez.su",
      "togliatti.su",
      "troitsk.su",
      "tselinograd.su",
      "tula.su",
      "tuva.su",
      "vladikavkaz.su",
      "vladimir.su",
      "vologda.su",
      "channelsdvr.net",
      "u.channelsdvr.net",
      "edgecompute.app",
      "fastly-terrarium.com",
      "fastlylb.net",
      "map.fastlylb.net",
      "freetls.fastly.net",
      "map.fastly.net",
      "a.prod.fastly.net",
      "global.prod.fastly.net",
      "a.ssl.fastly.net",
      "b.ssl.fastly.net",
      "global.ssl.fastly.net",
      "fastvps-server.com",
      "fastvps.host",
      "myfast.host",
      "fastvps.site",
      "myfast.space",
      "fedorainfracloud.org",
      "fedorapeople.org",
      "cloud.fedoraproject.org",
      "app.os.fedoraproject.org",
      "app.os.stg.fedoraproject.org",
      "conn.uk",
      "copro.uk",
      "hosp.uk",
      "mydobiss.com",
      "fh-muenster.io",
      "filegear.me",
      "filegear-au.me",
      "filegear-de.me",
      "filegear-gb.me",
      "filegear-ie.me",
      "filegear-jp.me",
      "filegear-sg.me",
      "firebaseapp.com",
      "fireweb.app",
      "flap.id",
      "onflashdrive.app",
      "fldrv.com",
      "fly.dev",
      "edgeapp.net",
      "shw.io",
      "flynnhosting.net",
      "forgeblocks.com",
      "id.forgerock.io",
      "framer.app",
      "framercanvas.com",
      "*.frusky.de",
      "ravpage.co.il",
      "0e.vc",
      "freebox-os.com",
      "freeboxos.com",
      "fbx-os.fr",
      "fbxos.fr",
      "freebox-os.fr",
      "freeboxos.fr",
      "freedesktop.org",
      "freemyip.com",
      "wien.funkfeuer.at",
      "*.futurecms.at",
      "*.ex.futurecms.at",
      "*.in.futurecms.at",
      "futurehosting.at",
      "futuremailing.at",
      "*.ex.ortsinfo.at",
      "*.kunden.ortsinfo.at",
      "*.statics.cloud",
      "independent-commission.uk",
      "independent-inquest.uk",
      "independent-inquiry.uk",
      "independent-panel.uk",
      "independent-review.uk",
      "public-inquiry.uk",
      "royal-commission.uk",
      "campaign.gov.uk",
      "service.gov.uk",
      "api.gov.uk",
      "gehirn.ne.jp",
      "usercontent.jp",
      "gentapps.com",
      "gentlentapis.com",
      "lab.ms",
      "cdn-edges.net",
      "ghost.io",
      "gsj.bz",
      "githubusercontent.com",
      "githubpreview.dev",
      "github.io",
      "gitlab.io",
      "gitapp.si",
      "gitpage.si",
      "glitch.me",
      "nog.community",
      "co.ro",
      "shop.ro",
      "lolipop.io",
      "angry.jp",
      "babyblue.jp",
      "babymilk.jp",
      "backdrop.jp",
      "bambina.jp",
      "bitter.jp",
      "blush.jp",
      "boo.jp",
      "boy.jp",
      "boyfriend.jp",
      "but.jp",
      "candypop.jp",
      "capoo.jp",
      "catfood.jp",
      "cheap.jp",
      "chicappa.jp",
      "chillout.jp",
      "chips.jp",
      "chowder.jp",
      "chu.jp",
      "ciao.jp",
      "cocotte.jp",
      "coolblog.jp",
      "cranky.jp",
      "cutegirl.jp",
      "daa.jp",
      "deca.jp",
      "deci.jp",
      "digick.jp",
      "egoism.jp",
      "fakefur.jp",
      "fem.jp",
      "flier.jp",
      "floppy.jp",
      "fool.jp",
      "frenchkiss.jp",
      "girlfriend.jp",
      "girly.jp",
      "gloomy.jp",
      "gonna.jp",
      "greater.jp",
      "hacca.jp",
      "heavy.jp",
      "her.jp",
      "hiho.jp",
      "hippy.jp",
      "holy.jp",
      "hungry.jp",
      "icurus.jp",
      "itigo.jp",
      "jellybean.jp",
      "kikirara.jp",
      "kill.jp",
      "kilo.jp",
      "kuron.jp",
      "littlestar.jp",
      "lolipopmc.jp",
      "lolitapunk.jp",
      "lomo.jp",
      "lovepop.jp",
      "lovesick.jp",
      "main.jp",
      "mods.jp",
      "mond.jp",
      "mongolian.jp",
      "moo.jp",
      "namaste.jp",
      "nikita.jp",
      "nobushi.jp",
      "noor.jp",
      "oops.jp",
      "parallel.jp",
      "parasite.jp",
      "pecori.jp",
      "peewee.jp",
      "penne.jp",
      "pepper.jp",
      "perma.jp",
      "pigboat.jp",
      "pinoko.jp",
      "punyu.jp",
      "pupu.jp",
      "pussycat.jp",
      "pya.jp",
      "raindrop.jp",
      "readymade.jp",
      "sadist.jp",
      "schoolbus.jp",
      "secret.jp",
      "staba.jp",
      "stripper.jp",
      "sub.jp",
      "sunnyday.jp",
      "thick.jp",
      "tonkotsu.jp",
      "under.jp",
      "upper.jp",
      "velvet.jp",
      "verse.jp",
      "versus.jp",
      "vivian.jp",
      "watson.jp",
      "weblike.jp",
      "whitesnow.jp",
      "zombie.jp",
      "heteml.net",
      "cloudapps.digital",
      "london.cloudapps.digital",
      "pymnt.uk",
      "homeoffice.gov.uk",
      "ro.im",
      "goip.de",
      "run.app",
      "a.run.app",
      "web.app",
      "*.0emm.com",
      "appspot.com",
      "*.r.appspot.com",
      "codespot.com",
      "googleapis.com",
      "googlecode.com",
      "pagespeedmobilizer.com",
      "publishproxy.com",
      "withgoogle.com",
      "withyoutube.com",
      "*.gateway.dev",
      "cloud.goog",
      "translate.goog",
      "*.usercontent.goog",
      "cloudfunctions.net",
      "blogspot.ae",
      "blogspot.al",
      "blogspot.am",
      "blogspot.ba",
      "blogspot.be",
      "blogspot.bg",
      "blogspot.bj",
      "blogspot.ca",
      "blogspot.cf",
      "blogspot.ch",
      "blogspot.cl",
      "blogspot.co.at",
      "blogspot.co.id",
      "blogspot.co.il",
      "blogspot.co.ke",
      "blogspot.co.nz",
      "blogspot.co.uk",
      "blogspot.co.za",
      "blogspot.com",
      "blogspot.com.ar",
      "blogspot.com.au",
      "blogspot.com.br",
      "blogspot.com.by",
      "blogspot.com.co",
      "blogspot.com.cy",
      "blogspot.com.ee",
      "blogspot.com.eg",
      "blogspot.com.es",
      "blogspot.com.mt",
      "blogspot.com.ng",
      "blogspot.com.tr",
      "blogspot.com.uy",
      "blogspot.cv",
      "blogspot.cz",
      "blogspot.de",
      "blogspot.dk",
      "blogspot.fi",
      "blogspot.fr",
      "blogspot.gr",
      "blogspot.hk",
      "blogspot.hr",
      "blogspot.hu",
      "blogspot.ie",
      "blogspot.in",
      "blogspot.is",
      "blogspot.it",
      "blogspot.jp",
      "blogspot.kr",
      "blogspot.li",
      "blogspot.lt",
      "blogspot.lu",
      "blogspot.md",
      "blogspot.mk",
      "blogspot.mr",
      "blogspot.mx",
      "blogspot.my",
      "blogspot.nl",
      "blogspot.no",
      "blogspot.pe",
      "blogspot.pt",
      "blogspot.qa",
      "blogspot.re",
      "blogspot.ro",
      "blogspot.rs",
      "blogspot.ru",
      "blogspot.se",
      "blogspot.sg",
      "blogspot.si",
      "blogspot.sk",
      "blogspot.sn",
      "blogspot.td",
      "blogspot.tw",
      "blogspot.ug",
      "blogspot.vn",
      "goupile.fr",
      "gov.nl",
      "awsmppl.com",
      "g\xFCnstigbestellen.de",
      "g\xFCnstigliefern.de",
      "fin.ci",
      "free.hr",
      "caa.li",
      "ua.rs",
      "conf.se",
      "hs.zone",
      "hs.run",
      "hashbang.sh",
      "hasura.app",
      "hasura-app.io",
      "pages.it.hs-heilbronn.de",
      "hepforge.org",
      "herokuapp.com",
      "herokussl.com",
      "ravendb.cloud",
      "myravendb.com",
      "ravendb.community",
      "ravendb.me",
      "development.run",
      "ravendb.run",
      "homesklep.pl",
      "secaas.hk",
      "hoplix.shop",
      "orx.biz",
      "biz.gl",
      "col.ng",
      "firm.ng",
      "gen.ng",
      "ltd.ng",
      "ngo.ng",
      "edu.scot",
      "sch.so",
      "hostyhosting.io",
      "h\xE4kkinen.fi",
      "*.moonscale.io",
      "moonscale.net",
      "iki.fi",
      "ibxos.it",
      "iliadboxos.it",
      "impertrixcdn.com",
      "impertrix.com",
      "smushcdn.com",
      "wphostedmail.com",
      "wpmucdn.com",
      "tempurl.host",
      "wpmudev.host",
      "dyn-berlin.de",
      "in-berlin.de",
      "in-brb.de",
      "in-butter.de",
      "in-dsl.de",
      "in-dsl.net",
      "in-dsl.org",
      "in-vpn.de",
      "in-vpn.net",
      "in-vpn.org",
      "biz.at",
      "info.at",
      "info.cx",
      "ac.leg.br",
      "al.leg.br",
      "am.leg.br",
      "ap.leg.br",
      "ba.leg.br",
      "ce.leg.br",
      "df.leg.br",
      "es.leg.br",
      "go.leg.br",
      "ma.leg.br",
      "mg.leg.br",
      "ms.leg.br",
      "mt.leg.br",
      "pa.leg.br",
      "pb.leg.br",
      "pe.leg.br",
      "pi.leg.br",
      "pr.leg.br",
      "rj.leg.br",
      "rn.leg.br",
      "ro.leg.br",
      "rr.leg.br",
      "rs.leg.br",
      "sc.leg.br",
      "se.leg.br",
      "sp.leg.br",
      "to.leg.br",
      "pixolino.com",
      "na4u.ru",
      "iopsys.se",
      "ipifony.net",
      "iservschule.de",
      "mein-iserv.de",
      "schulplattform.de",
      "schulserver.de",
      "test-iserv.de",
      "iserv.dev",
      "iobb.net",
      "mel.cloudlets.com.au",
      "cloud.interhostsolutions.be",
      "users.scale.virtualcloud.com.br",
      "mycloud.by",
      "alp1.ae.flow.ch",
      "appengine.flow.ch",
      "es-1.axarnet.cloud",
      "diadem.cloud",
      "vip.jelastic.cloud",
      "jele.cloud",
      "it1.eur.aruba.jenv-aruba.cloud",
      "it1.jenv-aruba.cloud",
      "keliweb.cloud",
      "cs.keliweb.cloud",
      "oxa.cloud",
      "tn.oxa.cloud",
      "uk.oxa.cloud",
      "primetel.cloud",
      "uk.primetel.cloud",
      "ca.reclaim.cloud",
      "uk.reclaim.cloud",
      "us.reclaim.cloud",
      "ch.trendhosting.cloud",
      "de.trendhosting.cloud",
      "jele.club",
      "amscompute.com",
      "clicketcloud.com",
      "dopaas.com",
      "hidora.com",
      "paas.hosted-by-previder.com",
      "rag-cloud.hosteur.com",
      "rag-cloud-ch.hosteur.com",
      "jcloud.ik-server.com",
      "jcloud-ver-jpc.ik-server.com",
      "demo.jelastic.com",
      "kilatiron.com",
      "paas.massivegrid.com",
      "jed.wafaicloud.com",
      "lon.wafaicloud.com",
      "ryd.wafaicloud.com",
      "j.scaleforce.com.cy",
      "jelastic.dogado.eu",
      "fi.cloudplatform.fi",
      "demo.datacenter.fi",
      "paas.datacenter.fi",
      "jele.host",
      "mircloud.host",
      "paas.beebyte.io",
      "sekd1.beebyteapp.io",
      "jele.io",
      "cloud-fr1.unispace.io",
      "jc.neen.it",
      "cloud.jelastic.open.tim.it",
      "jcloud.kz",
      "upaas.kazteleport.kz",
      "cloudjiffy.net",
      "fra1-de.cloudjiffy.net",
      "west1-us.cloudjiffy.net",
      "jls-sto1.elastx.net",
      "jls-sto2.elastx.net",
      "jls-sto3.elastx.net",
      "faststacks.net",
      "fr-1.paas.massivegrid.net",
      "lon-1.paas.massivegrid.net",
      "lon-2.paas.massivegrid.net",
      "ny-1.paas.massivegrid.net",
      "ny-2.paas.massivegrid.net",
      "sg-1.paas.massivegrid.net",
      "jelastic.saveincloud.net",
      "nordeste-idc.saveincloud.net",
      "j.scaleforce.net",
      "jelastic.tsukaeru.net",
      "sdscloud.pl",
      "unicloud.pl",
      "mircloud.ru",
      "jelastic.regruhosting.ru",
      "enscaled.sg",
      "jele.site",
      "jelastic.team",
      "orangecloud.tn",
      "j.layershift.co.uk",
      "phx.enscaled.us",
      "mircloud.us",
      "myjino.ru",
      "*.hosting.myjino.ru",
      "*.landing.myjino.ru",
      "*.spectrum.myjino.ru",
      "*.vps.myjino.ru",
      "jotelulu.cloud",
      "*.triton.zone",
      "*.cns.joyent.com",
      "js.org",
      "kaas.gg",
      "khplay.nl",
      "ktistory.com",
      "kapsi.fi",
      "keymachine.de",
      "kinghost.net",
      "uni5.net",
      "knightpoint.systems",
      "koobin.events",
      "oya.to",
      "kuleuven.cloud",
      "ezproxy.kuleuven.be",
      "co.krd",
      "edu.krd",
      "krellian.net",
      "webthings.io",
      "git-repos.de",
      "lcube-server.de",
      "svn-repos.de",
      "leadpages.co",
      "lpages.co",
      "lpusercontent.com",
      "lelux.site",
      "co.business",
      "co.education",
      "co.events",
      "co.financial",
      "co.network",
      "co.place",
      "co.technology",
      "app.lmpm.com",
      "linkyard.cloud",
      "linkyard-cloud.ch",
      "members.linode.com",
      "*.nodebalancer.linode.com",
      "*.linodeobjects.com",
      "ip.linodeusercontent.com",
      "we.bs",
      "*.user.localcert.dev",
      "localzone.xyz",
      "loginline.app",
      "loginline.dev",
      "loginline.io",
      "loginline.services",
      "loginline.site",
      "servers.run",
      "lohmus.me",
      "krasnik.pl",
      "leczna.pl",
      "lubartow.pl",
      "lublin.pl",
      "poniatowa.pl",
      "swidnik.pl",
      "glug.org.uk",
      "lug.org.uk",
      "lugs.org.uk",
      "barsy.bg",
      "barsy.co.uk",
      "barsyonline.co.uk",
      "barsycenter.com",
      "barsyonline.com",
      "barsy.club",
      "barsy.de",
      "barsy.eu",
      "barsy.in",
      "barsy.info",
      "barsy.io",
      "barsy.me",
      "barsy.menu",
      "barsy.mobi",
      "barsy.net",
      "barsy.online",
      "barsy.org",
      "barsy.pro",
      "barsy.pub",
      "barsy.ro",
      "barsy.shop",
      "barsy.site",
      "barsy.support",
      "barsy.uk",
      "*.magentosite.cloud",
      "mayfirst.info",
      "mayfirst.org",
      "hb.cldmail.ru",
      "cn.vu",
      "mazeplay.com",
      "mcpe.me",
      "mcdir.me",
      "mcdir.ru",
      "mcpre.ru",
      "vps.mcdir.ru",
      "mediatech.by",
      "mediatech.dev",
      "hra.health",
      "miniserver.com",
      "memset.net",
      "messerli.app",
      "*.cloud.metacentrum.cz",
      "custom.metacentrum.cz",
      "flt.cloud.muni.cz",
      "usr.cloud.muni.cz",
      "meteorapp.com",
      "eu.meteorapp.com",
      "co.pl",
      "*.azurecontainer.io",
      "azurewebsites.net",
      "azure-mobile.net",
      "cloudapp.net",
      "azurestaticapps.net",
      "1.azurestaticapps.net",
      "centralus.azurestaticapps.net",
      "eastasia.azurestaticapps.net",
      "eastus2.azurestaticapps.net",
      "westeurope.azurestaticapps.net",
      "westus2.azurestaticapps.net",
      "csx.cc",
      "mintere.site",
      "forte.id",
      "mozilla-iot.org",
      "bmoattachments.org",
      "net.ru",
      "org.ru",
      "pp.ru",
      "hostedpi.com",
      "customer.mythic-beasts.com",
      "caracal.mythic-beasts.com",
      "fentiger.mythic-beasts.com",
      "lynx.mythic-beasts.com",
      "ocelot.mythic-beasts.com",
      "oncilla.mythic-beasts.com",
      "onza.mythic-beasts.com",
      "sphinx.mythic-beasts.com",
      "vs.mythic-beasts.com",
      "x.mythic-beasts.com",
      "yali.mythic-beasts.com",
      "cust.retrosnub.co.uk",
      "ui.nabu.casa",
      "pony.club",
      "of.fashion",
      "in.london",
      "of.london",
      "from.marketing",
      "with.marketing",
      "for.men",
      "repair.men",
      "and.mom",
      "for.mom",
      "for.one",
      "under.one",
      "for.sale",
      "that.win",
      "from.work",
      "to.work",
      "cloud.nospamproxy.com",
      "netlify.app",
      "4u.com",
      "ngrok.io",
      "nh-serv.co.uk",
      "nfshost.com",
      "*.developer.app",
      "noop.app",
      "*.northflank.app",
      "*.build.run",
      "*.code.run",
      "*.database.run",
      "*.migration.run",
      "noticeable.news",
      "dnsking.ch",
      "mypi.co",
      "n4t.co",
      "001www.com",
      "ddnslive.com",
      "myiphost.com",
      "forumz.info",
      "16-b.it",
      "32-b.it",
      "64-b.it",
      "soundcast.me",
      "tcp4.me",
      "dnsup.net",
      "hicam.net",
      "now-dns.net",
      "ownip.net",
      "vpndns.net",
      "dynserv.org",
      "now-dns.org",
      "x443.pw",
      "now-dns.top",
      "ntdll.top",
      "freeddns.us",
      "crafting.xyz",
      "zapto.xyz",
      "nsupdate.info",
      "nerdpol.ovh",
      "blogsyte.com",
      "brasilia.me",
      "cable-modem.org",
      "ciscofreak.com",
      "collegefan.org",
      "couchpotatofries.org",
      "damnserver.com",
      "ddns.me",
      "ditchyourip.com",
      "dnsfor.me",
      "dnsiskinky.com",
      "dvrcam.info",
      "dynns.com",
      "eating-organic.net",
      "fantasyleague.cc",
      "geekgalaxy.com",
      "golffan.us",
      "health-carereform.com",
      "homesecuritymac.com",
      "homesecuritypc.com",
      "hopto.me",
      "ilovecollege.info",
      "loginto.me",
      "mlbfan.org",
      "mmafan.biz",
      "myactivedirectory.com",
      "mydissent.net",
      "myeffect.net",
      "mymediapc.net",
      "mypsx.net",
      "mysecuritycamera.com",
      "mysecuritycamera.net",
      "mysecuritycamera.org",
      "net-freaks.com",
      "nflfan.org",
      "nhlfan.net",
      "no-ip.ca",
      "no-ip.co.uk",
      "no-ip.net",
      "noip.us",
      "onthewifi.com",
      "pgafan.net",
      "point2this.com",
      "pointto.us",
      "privatizehealthinsurance.net",
      "quicksytes.com",
      "read-books.org",
      "securitytactics.com",
      "serveexchange.com",
      "servehumour.com",
      "servep2p.com",
      "servesarcasm.com",
      "stufftoread.com",
      "ufcfan.org",
      "unusualperson.com",
      "workisboring.com",
      "3utilities.com",
      "bounceme.net",
      "ddns.net",
      "ddnsking.com",
      "gotdns.ch",
      "hopto.org",
      "myftp.biz",
      "myftp.org",
      "myvnc.com",
      "no-ip.biz",
      "no-ip.info",
      "no-ip.org",
      "noip.me",
      "redirectme.net",
      "servebeer.com",
      "serveblog.net",
      "servecounterstrike.com",
      "serveftp.com",
      "servegame.com",
      "servehalflife.com",
      "servehttp.com",
      "serveirc.com",
      "serveminecraft.net",
      "servemp3.com",
      "servepics.com",
      "servequake.com",
      "sytes.net",
      "webhop.me",
      "zapto.org",
      "stage.nodeart.io",
      "pcloud.host",
      "nyc.mn",
      "static.observableusercontent.com",
      "cya.gg",
      "omg.lol",
      "cloudycluster.net",
      "omniwe.site",
      "service.one",
      "nid.io",
      "opensocial.site",
      "opencraft.hosting",
      "orsites.com",
      "operaunite.com",
      "tech.orange",
      "authgear-staging.com",
      "authgearapps.com",
      "skygearapp.com",
      "outsystemscloud.com",
      "*.webpaas.ovh.net",
      "*.hosting.ovh.net",
      "ownprovider.com",
      "own.pm",
      "*.owo.codes",
      "ox.rs",
      "oy.lc",
      "pgfog.com",
      "pagefrontapp.com",
      "pagexl.com",
      "*.paywhirl.com",
      "bar0.net",
      "bar1.net",
      "bar2.net",
      "rdv.to",
      "art.pl",
      "gliwice.pl",
      "krakow.pl",
      "poznan.pl",
      "wroc.pl",
      "zakopane.pl",
      "pantheonsite.io",
      "gotpantheon.com",
      "mypep.link",
      "perspecta.cloud",
      "lk3.ru",
      "on-web.fr",
      "bc.platform.sh",
      "ent.platform.sh",
      "eu.platform.sh",
      "us.platform.sh",
      "*.platformsh.site",
      "*.tst.site",
      "platter-app.com",
      "platter-app.dev",
      "platterp.us",
      "pdns.page",
      "plesk.page",
      "pleskns.com",
      "dyn53.io",
      "onporter.run",
      "co.bn",
      "postman-echo.com",
      "pstmn.io",
      "mock.pstmn.io",
      "httpbin.org",
      "prequalifyme.today",
      "xen.prgmr.com",
      "priv.at",
      "prvcy.page",
      "*.dweb.link",
      "protonet.io",
      "chirurgiens-dentistes-en-france.fr",
      "byen.site",
      "pubtls.org",
      "pythonanywhere.com",
      "eu.pythonanywhere.com",
      "qoto.io",
      "qualifioapp.com",
      "qbuser.com",
      "cloudsite.builders",
      "instances.spawn.cc",
      "instantcloud.cn",
      "ras.ru",
      "qa2.com",
      "qcx.io",
      "*.sys.qcx.io",
      "dev-myqnapcloud.com",
      "alpha-myqnapcloud.com",
      "myqnapcloud.com",
      "*.quipelements.com",
      "vapor.cloud",
      "vaporcloud.io",
      "rackmaze.com",
      "rackmaze.net",
      "g.vbrplsbx.io",
      "*.on-k3s.io",
      "*.on-rancher.cloud",
      "*.on-rio.io",
      "readthedocs.io",
      "rhcloud.com",
      "app.render.com",
      "onrender.com",
      "repl.co",
      "id.repl.co",
      "repl.run",
      "resindevice.io",
      "devices.resinstaging.io",
      "hzc.io",
      "wellbeingzone.eu",
      "wellbeingzone.co.uk",
      "adimo.co.uk",
      "itcouldbewor.se",
      "git-pages.rit.edu",
      "rocky.page",
      "\u0431\u0438\u0437.\u0440\u0443\u0441",
      "\u043A\u043E\u043C.\u0440\u0443\u0441",
      "\u043A\u0440\u044B\u043C.\u0440\u0443\u0441",
      "\u043C\u0438\u0440.\u0440\u0443\u0441",
      "\u043C\u0441\u043A.\u0440\u0443\u0441",
      "\u043E\u0440\u0433.\u0440\u0443\u0441",
      "\u0441\u0430\u043C\u0430\u0440\u0430.\u0440\u0443\u0441",
      "\u0441\u043E\u0447\u0438.\u0440\u0443\u0441",
      "\u0441\u043F\u0431.\u0440\u0443\u0441",
      "\u044F.\u0440\u0443\u0441",
      "*.builder.code.com",
      "*.dev-builder.code.com",
      "*.stg-builder.code.com",
      "sandcats.io",
      "logoip.de",
      "logoip.com",
      "fr-par-1.baremetal.scw.cloud",
      "fr-par-2.baremetal.scw.cloud",
      "nl-ams-1.baremetal.scw.cloud",
      "fnc.fr-par.scw.cloud",
      "functions.fnc.fr-par.scw.cloud",
      "k8s.fr-par.scw.cloud",
      "nodes.k8s.fr-par.scw.cloud",
      "s3.fr-par.scw.cloud",
      "s3-website.fr-par.scw.cloud",
      "whm.fr-par.scw.cloud",
      "priv.instances.scw.cloud",
      "pub.instances.scw.cloud",
      "k8s.scw.cloud",
      "k8s.nl-ams.scw.cloud",
      "nodes.k8s.nl-ams.scw.cloud",
      "s3.nl-ams.scw.cloud",
      "s3-website.nl-ams.scw.cloud",
      "whm.nl-ams.scw.cloud",
      "k8s.pl-waw.scw.cloud",
      "nodes.k8s.pl-waw.scw.cloud",
      "s3.pl-waw.scw.cloud",
      "s3-website.pl-waw.scw.cloud",
      "scalebook.scw.cloud",
      "smartlabeling.scw.cloud",
      "dedibox.fr",
      "schokokeks.net",
      "gov.scot",
      "service.gov.scot",
      "scrysec.com",
      "firewall-gateway.com",
      "firewall-gateway.de",
      "my-gateway.de",
      "my-router.de",
      "spdns.de",
      "spdns.eu",
      "firewall-gateway.net",
      "my-firewall.org",
      "myfirewall.org",
      "spdns.org",
      "seidat.net",
      "sellfy.store",
      "senseering.net",
      "minisite.ms",
      "magnet.page",
      "biz.ua",
      "co.ua",
      "pp.ua",
      "shiftcrypto.dev",
      "shiftcrypto.io",
      "shiftedit.io",
      "myshopblocks.com",
      "myshopify.com",
      "shopitsite.com",
      "shopware.store",
      "mo-siemens.io",
      "1kapp.com",
      "appchizi.com",
      "applinzi.com",
      "sinaapp.com",
      "vipsinaapp.com",
      "siteleaf.net",
      "bounty-full.com",
      "alpha.bounty-full.com",
      "beta.bounty-full.com",
      "small-web.org",
      "vp4.me",
      "try-snowplow.com",
      "srht.site",
      "stackhero-network.com",
      "musician.io",
      "novecore.site",
      "static.land",
      "dev.static.land",
      "sites.static.land",
      "storebase.store",
      "vps-host.net",
      "atl.jelastic.vps-host.net",
      "njs.jelastic.vps-host.net",
      "ric.jelastic.vps-host.net",
      "playstation-cloud.com",
      "apps.lair.io",
      "*.stolos.io",
      "spacekit.io",
      "customer.speedpartner.de",
      "myspreadshop.at",
      "myspreadshop.com.au",
      "myspreadshop.be",
      "myspreadshop.ca",
      "myspreadshop.ch",
      "myspreadshop.com",
      "myspreadshop.de",
      "myspreadshop.dk",
      "myspreadshop.es",
      "myspreadshop.fi",
      "myspreadshop.fr",
      "myspreadshop.ie",
      "myspreadshop.it",
      "myspreadshop.net",
      "myspreadshop.nl",
      "myspreadshop.no",
      "myspreadshop.pl",
      "myspreadshop.se",
      "myspreadshop.co.uk",
      "api.stdlib.com",
      "storj.farm",
      "utwente.io",
      "soc.srcf.net",
      "user.srcf.net",
      "temp-dns.com",
      "supabase.co",
      "supabase.in",
      "supabase.net",
      "su.paba.se",
      "*.s5y.io",
      "*.sensiosite.cloud",
      "syncloud.it",
      "dscloud.biz",
      "direct.quickconnect.cn",
      "dsmynas.com",
      "familyds.com",
      "diskstation.me",
      "dscloud.me",
      "i234.me",
      "myds.me",
      "synology.me",
      "dscloud.mobi",
      "dsmynas.net",
      "familyds.net",
      "dsmynas.org",
      "familyds.org",
      "vpnplus.to",
      "direct.quickconnect.to",
      "tabitorder.co.il",
      "taifun-dns.de",
      "beta.tailscale.net",
      "ts.net",
      "gda.pl",
      "gdansk.pl",
      "gdynia.pl",
      "med.pl",
      "sopot.pl",
      "site.tb-hosting.com",
      "edugit.io",
      "s3.teckids.org",
      "telebit.app",
      "telebit.io",
      "*.telebit.xyz",
      "gwiddle.co.uk",
      "*.firenet.ch",
      "*.svc.firenet.ch",
      "reservd.com",
      "thingdustdata.com",
      "cust.dev.thingdust.io",
      "cust.disrec.thingdust.io",
      "cust.prod.thingdust.io",
      "cust.testing.thingdust.io",
      "reservd.dev.thingdust.io",
      "reservd.disrec.thingdust.io",
      "reservd.testing.thingdust.io",
      "tickets.io",
      "arvo.network",
      "azimuth.network",
      "tlon.network",
      "torproject.net",
      "pages.torproject.net",
      "bloxcms.com",
      "townnews-staging.com",
      "tbits.me",
      "12hp.at",
      "2ix.at",
      "4lima.at",
      "lima-city.at",
      "12hp.ch",
      "2ix.ch",
      "4lima.ch",
      "lima-city.ch",
      "trafficplex.cloud",
      "de.cool",
      "12hp.de",
      "2ix.de",
      "4lima.de",
      "lima-city.de",
      "1337.pictures",
      "clan.rip",
      "lima-city.rocks",
      "webspace.rocks",
      "lima.zone",
      "*.transurl.be",
      "*.transurl.eu",
      "*.transurl.nl",
      "site.transip.me",
      "tuxfamily.org",
      "dd-dns.de",
      "diskstation.eu",
      "diskstation.org",
      "dray-dns.de",
      "draydns.de",
      "dyn-vpn.de",
      "dynvpn.de",
      "mein-vigor.de",
      "my-vigor.de",
      "my-wan.de",
      "syno-ds.de",
      "synology-diskstation.de",
      "synology-ds.de",
      "typedream.app",
      "pro.typeform.com",
      "uber.space",
      "*.uberspace.de",
      "hk.com",
      "hk.org",
      "ltd.hk",
      "inc.hk",
      "name.pm",
      "sch.tf",
      "biz.wf",
      "sch.wf",
      "org.yt",
      "virtualuser.de",
      "virtual-user.de",
      "upli.io",
      "urown.cloud",
      "dnsupdate.info",
      "lib.de.us",
      "2038.io",
      "vercel.app",
      "vercel.dev",
      "now.sh",
      "router.management",
      "v-info.info",
      "voorloper.cloud",
      "neko.am",
      "nyaa.am",
      "be.ax",
      "cat.ax",
      "es.ax",
      "eu.ax",
      "gg.ax",
      "mc.ax",
      "us.ax",
      "xy.ax",
      "nl.ci",
      "xx.gl",
      "app.gp",
      "blog.gt",
      "de.gt",
      "to.gt",
      "be.gy",
      "cc.hn",
      "blog.kg",
      "io.kg",
      "jp.kg",
      "tv.kg",
      "uk.kg",
      "us.kg",
      "de.ls",
      "at.md",
      "de.md",
      "jp.md",
      "to.md",
      "indie.porn",
      "vxl.sh",
      "ch.tc",
      "me.tc",
      "we.tc",
      "nyan.to",
      "at.vg",
      "blog.vu",
      "dev.vu",
      "me.vu",
      "v.ua",
      "*.vultrobjects.com",
      "wafflecell.com",
      "*.webhare.dev",
      "reserve-online.net",
      "reserve-online.com",
      "bookonline.app",
      "hotelwithflight.com",
      "wedeploy.io",
      "wedeploy.me",
      "wedeploy.sh",
      "remotewd.com",
      "pages.wiardweb.com",
      "wmflabs.org",
      "toolforge.org",
      "wmcloud.org",
      "panel.gg",
      "daemon.panel.gg",
      "messwithdns.com",
      "woltlab-demo.com",
      "myforum.community",
      "community-pro.de",
      "diskussionsbereich.de",
      "community-pro.net",
      "meinforum.net",
      "affinitylottery.org.uk",
      "raffleentry.org.uk",
      "weeklylottery.org.uk",
      "wpenginepowered.com",
      "js.wpenginepowered.com",
      "wixsite.com",
      "editorx.io",
      "half.host",
      "xnbay.com",
      "u2.xnbay.com",
      "u2-local.xnbay.com",
      "cistron.nl",
      "demon.nl",
      "xs4all.space",
      "yandexcloud.net",
      "storage.yandexcloud.net",
      "website.yandexcloud.net",
      "official.academy",
      "yolasite.com",
      "ybo.faith",
      "yombo.me",
      "homelink.one",
      "ybo.party",
      "ybo.review",
      "ybo.science",
      "ybo.trade",
      "ynh.fr",
      "nohost.me",
      "noho.st",
      "za.net",
      "za.org",
      "bss.design",
      "basicserver.io",
      "virtualserver.io",
      "enterprisecloud.nu"
    ];
  }
});

// node_modules/psl/index.js
var require_psl = __commonJS({
  "node_modules/psl/index.js"(exports2) {
    "use strict";
    var Punycode = require("punycode");
    var internals = {};
    internals.rules = require_rules().map(function(rule) {
      return {
        rule,
        suffix: rule.replace(/^(\*\.|\!)/, ""),
        punySuffix: -1,
        wildcard: rule.charAt(0) === "*",
        exception: rule.charAt(0) === "!"
      };
    });
    internals.endsWith = function(str, suffix) {
      return str.indexOf(suffix, str.length - suffix.length) !== -1;
    };
    internals.findRule = function(domain) {
      var punyDomain = Punycode.toASCII(domain);
      return internals.rules.reduce(function(memo, rule) {
        if (rule.punySuffix === -1) {
          rule.punySuffix = Punycode.toASCII(rule.suffix);
        }
        if (!internals.endsWith(punyDomain, "." + rule.punySuffix) && punyDomain !== rule.punySuffix) {
          return memo;
        }
        return rule;
      }, null);
    };
    exports2.errorCodes = {
      DOMAIN_TOO_SHORT: "Domain name too short.",
      DOMAIN_TOO_LONG: "Domain name too long. It should be no more than 255 chars.",
      LABEL_STARTS_WITH_DASH: "Domain name label can not start with a dash.",
      LABEL_ENDS_WITH_DASH: "Domain name label can not end with a dash.",
      LABEL_TOO_LONG: "Domain name label should be at most 63 chars long.",
      LABEL_TOO_SHORT: "Domain name label should be at least 1 character long.",
      LABEL_INVALID_CHARS: "Domain name label can only contain alphanumeric characters or dashes."
    };
    internals.validate = function(input) {
      var ascii = Punycode.toASCII(input);
      if (ascii.length < 1) {
        return "DOMAIN_TOO_SHORT";
      }
      if (ascii.length > 255) {
        return "DOMAIN_TOO_LONG";
      }
      var labels = ascii.split(".");
      var label;
      for (var i = 0; i < labels.length; ++i) {
        label = labels[i];
        if (!label.length) {
          return "LABEL_TOO_SHORT";
        }
        if (label.length > 63) {
          return "LABEL_TOO_LONG";
        }
        if (label.charAt(0) === "-") {
          return "LABEL_STARTS_WITH_DASH";
        }
        if (label.charAt(label.length - 1) === "-") {
          return "LABEL_ENDS_WITH_DASH";
        }
        if (!/^[a-z0-9\-]+$/.test(label)) {
          return "LABEL_INVALID_CHARS";
        }
      }
    };
    exports2.parse = function(input) {
      if (typeof input !== "string") {
        throw new TypeError("Domain name must be a string.");
      }
      var domain = input.slice(0).toLowerCase();
      if (domain.charAt(domain.length - 1) === ".") {
        domain = domain.slice(0, domain.length - 1);
      }
      var error = internals.validate(domain);
      if (error) {
        return {
          input,
          error: {
            message: exports2.errorCodes[error],
            code: error
          }
        };
      }
      var parsed = {
        input,
        tld: null,
        sld: null,
        domain: null,
        subdomain: null,
        listed: false
      };
      var domainParts = domain.split(".");
      if (domainParts[domainParts.length - 1] === "local") {
        return parsed;
      }
      var handlePunycode = function() {
        if (!/xn--/.test(domain)) {
          return parsed;
        }
        if (parsed.domain) {
          parsed.domain = Punycode.toASCII(parsed.domain);
        }
        if (parsed.subdomain) {
          parsed.subdomain = Punycode.toASCII(parsed.subdomain);
        }
        return parsed;
      };
      var rule = internals.findRule(domain);
      if (!rule) {
        if (domainParts.length < 2) {
          return parsed;
        }
        parsed.tld = domainParts.pop();
        parsed.sld = domainParts.pop();
        parsed.domain = [parsed.sld, parsed.tld].join(".");
        if (domainParts.length) {
          parsed.subdomain = domainParts.pop();
        }
        return handlePunycode();
      }
      parsed.listed = true;
      var tldParts = rule.suffix.split(".");
      var privateParts = domainParts.slice(0, domainParts.length - tldParts.length);
      if (rule.exception) {
        privateParts.push(tldParts.shift());
      }
      parsed.tld = tldParts.join(".");
      if (!privateParts.length) {
        return handlePunycode();
      }
      if (rule.wildcard) {
        tldParts.unshift(privateParts.pop());
        parsed.tld = tldParts.join(".");
      }
      if (!privateParts.length) {
        return handlePunycode();
      }
      parsed.sld = privateParts.pop();
      parsed.domain = [parsed.sld, parsed.tld].join(".");
      if (privateParts.length) {
        parsed.subdomain = privateParts.join(".");
      }
      return handlePunycode();
    };
    exports2.get = function(domain) {
      if (!domain) {
        return null;
      }
      return exports2.parse(domain).domain || null;
    };
    exports2.isValid = function(domain) {
      var parsed = exports2.parse(domain);
      return Boolean(parsed.domain && parsed.listed);
    };
  }
});

// node_modules/tough-cookie/lib/pubsuffix-psl.js
var require_pubsuffix_psl = __commonJS({
  "node_modules/tough-cookie/lib/pubsuffix-psl.js"(exports2) {
    "use strict";
    var psl = require_psl();
    var SPECIAL_USE_DOMAINS = [
      "local",
      "example",
      "invalid",
      "localhost",
      "test"
    ];
    var SPECIAL_TREATMENT_DOMAINS = ["localhost", "invalid"];
    function getPublicSuffix(domain, options = {}) {
      const domainParts = domain.split(".");
      const topLevelDomain = domainParts[domainParts.length - 1];
      const allowSpecialUseDomain = !!options.allowSpecialUseDomain;
      const ignoreError = !!options.ignoreError;
      if (allowSpecialUseDomain && SPECIAL_USE_DOMAINS.includes(topLevelDomain)) {
        if (domainParts.length > 1) {
          const secondLevelDomain = domainParts[domainParts.length - 2];
          return `${secondLevelDomain}.${topLevelDomain}`;
        } else if (SPECIAL_TREATMENT_DOMAINS.includes(topLevelDomain)) {
          return `${topLevelDomain}`;
        }
      }
      if (!ignoreError && SPECIAL_USE_DOMAINS.includes(topLevelDomain)) {
        throw new Error(
          `Cookie has domain set to the public suffix "${topLevelDomain}" which is a special use domain. To allow this, configure your CookieJar with {allowSpecialUseDomain:true, rejectPublicSuffixes: false}.`
        );
      }
      return psl.get(domain);
    }
    exports2.getPublicSuffix = getPublicSuffix;
  }
});

// node_modules/tough-cookie/lib/store.js
var require_store = __commonJS({
  "node_modules/tough-cookie/lib/store.js"(exports2) {
    "use strict";
    var Store = class {
      constructor() {
        this.synchronous = false;
      }
      findCookie(domain, path4, key, cb) {
        throw new Error("findCookie is not implemented");
      }
      findCookies(domain, path4, allowSpecialUseDomain, cb) {
        throw new Error("findCookies is not implemented");
      }
      putCookie(cookie, cb) {
        throw new Error("putCookie is not implemented");
      }
      updateCookie(oldCookie, newCookie, cb) {
        throw new Error("updateCookie is not implemented");
      }
      removeCookie(domain, path4, key, cb) {
        throw new Error("removeCookie is not implemented");
      }
      removeCookies(domain, path4, cb) {
        throw new Error("removeCookies is not implemented");
      }
      removeAllCookies(cb) {
        throw new Error("removeAllCookies is not implemented");
      }
      getAllCookies(cb) {
        throw new Error(
          "getAllCookies is not implemented (therefore jar cannot be serialized)"
        );
      }
    };
    exports2.Store = Store;
  }
});

// node_modules/universalify/index.js
var require_universalify = __commonJS({
  "node_modules/universalify/index.js"(exports2) {
    "use strict";
    exports2.fromCallback = function(fn2) {
      return Object.defineProperty(function() {
        if (typeof arguments[arguments.length - 1] === "function")
          fn2.apply(this, arguments);
        else {
          return new Promise((resolve, reject) => {
            arguments[arguments.length] = (err, res) => {
              if (err)
                return reject(err);
              resolve(res);
            };
            arguments.length++;
            fn2.apply(this, arguments);
          });
        }
      }, "name", { value: fn2.name });
    };
    exports2.fromPromise = function(fn2) {
      return Object.defineProperty(function() {
        const cb = arguments[arguments.length - 1];
        if (typeof cb !== "function")
          return fn2.apply(this, arguments);
        else {
          delete arguments[arguments.length - 1];
          arguments.length--;
          fn2.apply(this, arguments).then((r) => cb(null, r), cb);
        }
      }, "name", { value: fn2.name });
    };
  }
});

// node_modules/tough-cookie/lib/permuteDomain.js
var require_permuteDomain = __commonJS({
  "node_modules/tough-cookie/lib/permuteDomain.js"(exports2) {
    "use strict";
    var pubsuffix = require_pubsuffix_psl();
    function permuteDomain(domain, allowSpecialUseDomain) {
      const pubSuf = pubsuffix.getPublicSuffix(domain, {
        allowSpecialUseDomain
      });
      if (!pubSuf) {
        return null;
      }
      if (pubSuf == domain) {
        return [domain];
      }
      if (domain.slice(-1) == ".") {
        domain = domain.slice(0, -1);
      }
      const prefix = domain.slice(0, -(pubSuf.length + 1));
      const parts = prefix.split(".").reverse();
      let cur = pubSuf;
      const permutations = [cur];
      while (parts.length) {
        cur = `${parts.shift()}.${cur}`;
        permutations.push(cur);
      }
      return permutations;
    }
    exports2.permuteDomain = permuteDomain;
  }
});

// node_modules/tough-cookie/lib/pathMatch.js
var require_pathMatch = __commonJS({
  "node_modules/tough-cookie/lib/pathMatch.js"(exports2) {
    "use strict";
    function pathMatch(reqPath, cookiePath) {
      if (cookiePath === reqPath) {
        return true;
      }
      const idx = reqPath.indexOf(cookiePath);
      if (idx === 0) {
        if (cookiePath.substr(-1) === "/") {
          return true;
        }
        if (reqPath.substr(cookiePath.length, 1) === "/") {
          return true;
        }
      }
      return false;
    }
    exports2.pathMatch = pathMatch;
  }
});

// node_modules/tough-cookie/lib/utilHelper.js
var require_utilHelper = __commonJS({
  "node_modules/tough-cookie/lib/utilHelper.js"(exports2) {
    function requireUtil() {
      try {
        return require("util");
      } catch (e) {
        return null;
      }
    }
    function lookupCustomInspectSymbol() {
      return Symbol.for("nodejs.util.inspect.custom");
    }
    function tryReadingCustomSymbolFromUtilInspect(options) {
      const _requireUtil = options.requireUtil || requireUtil;
      const util = _requireUtil();
      return util ? util.inspect.custom : null;
    }
    exports2.getUtilInspect = function getUtilInspect(fallback, options = {}) {
      const _requireUtil = options.requireUtil || requireUtil;
      const util = _requireUtil();
      return function inspect(value, showHidden, depth) {
        return util ? util.inspect(value, showHidden, depth) : fallback(value);
      };
    };
    exports2.getCustomInspectSymbol = function getCustomInspectSymbol(options = {}) {
      const _lookupCustomInspectSymbol = options.lookupCustomInspectSymbol || lookupCustomInspectSymbol;
      return _lookupCustomInspectSymbol() || tryReadingCustomSymbolFromUtilInspect(options);
    };
  }
});

// node_modules/tough-cookie/lib/memstore.js
var require_memstore = __commonJS({
  "node_modules/tough-cookie/lib/memstore.js"(exports2) {
    "use strict";
    var { fromCallback } = require_universalify();
    var Store = require_store().Store;
    var permuteDomain = require_permuteDomain().permuteDomain;
    var pathMatch = require_pathMatch().pathMatch;
    var { getCustomInspectSymbol, getUtilInspect } = require_utilHelper();
    var MemoryCookieStore = class extends Store {
      constructor() {
        super();
        this.synchronous = true;
        this.idx = /* @__PURE__ */ Object.create(null);
        const customInspectSymbol = getCustomInspectSymbol();
        if (customInspectSymbol) {
          this[customInspectSymbol] = this.inspect;
        }
      }
      inspect() {
        const util = { inspect: getUtilInspect(inspectFallback) };
        return `{ idx: ${util.inspect(this.idx, false, 2)} }`;
      }
      findCookie(domain, path4, key, cb) {
        if (!this.idx[domain]) {
          return cb(null, void 0);
        }
        if (!this.idx[domain][path4]) {
          return cb(null, void 0);
        }
        return cb(null, this.idx[domain][path4][key] || null);
      }
      findCookies(domain, path4, allowSpecialUseDomain, cb) {
        const results = [];
        if (typeof allowSpecialUseDomain === "function") {
          cb = allowSpecialUseDomain;
          allowSpecialUseDomain = true;
        }
        if (!domain) {
          return cb(null, []);
        }
        let pathMatcher;
        if (!path4) {
          pathMatcher = function matchAll(domainIndex) {
            for (const curPath in domainIndex) {
              const pathIndex = domainIndex[curPath];
              for (const key in pathIndex) {
                results.push(pathIndex[key]);
              }
            }
          };
        } else {
          pathMatcher = function matchRFC(domainIndex) {
            Object.keys(domainIndex).forEach((cookiePath) => {
              if (pathMatch(path4, cookiePath)) {
                const pathIndex = domainIndex[cookiePath];
                for (const key in pathIndex) {
                  results.push(pathIndex[key]);
                }
              }
            });
          };
        }
        const domains = permuteDomain(domain, allowSpecialUseDomain) || [domain];
        const idx = this.idx;
        domains.forEach((curDomain) => {
          const domainIndex = idx[curDomain];
          if (!domainIndex) {
            return;
          }
          pathMatcher(domainIndex);
        });
        cb(null, results);
      }
      putCookie(cookie, cb) {
        if (!this.idx[cookie.domain]) {
          this.idx[cookie.domain] = /* @__PURE__ */ Object.create(null);
        }
        if (!this.idx[cookie.domain][cookie.path]) {
          this.idx[cookie.domain][cookie.path] = /* @__PURE__ */ Object.create(null);
        }
        this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
        cb(null);
      }
      updateCookie(oldCookie, newCookie, cb) {
        this.putCookie(newCookie, cb);
      }
      removeCookie(domain, path4, key, cb) {
        if (this.idx[domain] && this.idx[domain][path4] && this.idx[domain][path4][key]) {
          delete this.idx[domain][path4][key];
        }
        cb(null);
      }
      removeCookies(domain, path4, cb) {
        if (this.idx[domain]) {
          if (path4) {
            delete this.idx[domain][path4];
          } else {
            delete this.idx[domain];
          }
        }
        return cb(null);
      }
      removeAllCookies(cb) {
        this.idx = /* @__PURE__ */ Object.create(null);
        return cb(null);
      }
      getAllCookies(cb) {
        const cookies = [];
        const idx = this.idx;
        const domains = Object.keys(idx);
        domains.forEach((domain) => {
          const paths = Object.keys(idx[domain]);
          paths.forEach((path4) => {
            const keys = Object.keys(idx[domain][path4]);
            keys.forEach((key) => {
              if (key !== null) {
                cookies.push(idx[domain][path4][key]);
              }
            });
          });
        });
        cookies.sort((a, b) => {
          return (a.creationIndex || 0) - (b.creationIndex || 0);
        });
        cb(null, cookies);
      }
    };
    [
      "findCookie",
      "findCookies",
      "putCookie",
      "updateCookie",
      "removeCookie",
      "removeCookies",
      "removeAllCookies",
      "getAllCookies"
    ].forEach((name) => {
      MemoryCookieStore.prototype[name] = fromCallback(
        MemoryCookieStore.prototype[name]
      );
    });
    exports2.MemoryCookieStore = MemoryCookieStore;
    function inspectFallback(val) {
      const domains = Object.keys(val);
      if (domains.length === 0) {
        return "[Object: null prototype] {}";
      }
      let result = "[Object: null prototype] {\n";
      Object.keys(val).forEach((domain, i) => {
        result += formatDomain(domain, val[domain]);
        if (i < domains.length - 1) {
          result += ",";
        }
        result += "\n";
      });
      result += "}";
      return result;
    }
    function formatDomain(domainName, domainValue) {
      const indent = "  ";
      let result = `${indent}'${domainName}': [Object: null prototype] {
`;
      Object.keys(domainValue).forEach((path4, i, paths) => {
        result += formatPath(path4, domainValue[path4]);
        if (i < paths.length - 1) {
          result += ",";
        }
        result += "\n";
      });
      result += `${indent}}`;
      return result;
    }
    function formatPath(pathName, pathValue) {
      const indent = "    ";
      let result = `${indent}'${pathName}': [Object: null prototype] {
`;
      Object.keys(pathValue).forEach((cookieName, i, cookieNames) => {
        const cookie = pathValue[cookieName];
        result += `      ${cookieName}: ${cookie.inspect()}`;
        if (i < cookieNames.length - 1) {
          result += ",";
        }
        result += "\n";
      });
      result += `${indent}}`;
      return result;
    }
    exports2.inspectFallback = inspectFallback;
  }
});

// node_modules/tough-cookie/lib/validators.js
var require_validators = __commonJS({
  "node_modules/tough-cookie/lib/validators.js"(exports2) {
    "use strict";
    var toString = Object.prototype.toString;
    function isFunction(data) {
      return typeof data === "function";
    }
    function isNonEmptyString(data) {
      return isString(data) && data !== "";
    }
    function isDate(data) {
      return isInstanceStrict(data, Date) && isInteger(data.getTime());
    }
    function isEmptyString(data) {
      return data === "" || data instanceof String && data.toString() === "";
    }
    function isString(data) {
      return typeof data === "string" || data instanceof String;
    }
    function isObject2(data) {
      return toString.call(data) === "[object Object]";
    }
    function isInstanceStrict(data, prototype) {
      try {
        return data instanceof prototype;
      } catch (error) {
        return false;
      }
    }
    function isUrlStringOrObject(data) {
      return isNonEmptyString(data) || isObject2(data) && "hostname" in data && "pathname" in data && "protocol" in data || isInstanceStrict(data, URL);
    }
    function isInteger(data) {
      return typeof data === "number" && data % 1 === 0;
    }
    function validate2(bool, cb, options) {
      if (!isFunction(cb)) {
        options = cb;
        cb = null;
      }
      if (!isObject2(options))
        options = { Error: "Failed Check" };
      if (!bool) {
        if (cb) {
          cb(new ParameterError(options));
        } else {
          throw new ParameterError(options);
        }
      }
    }
    var ParameterError = class extends Error {
      constructor(...params) {
        super(...params);
      }
    };
    exports2.ParameterError = ParameterError;
    exports2.isFunction = isFunction;
    exports2.isNonEmptyString = isNonEmptyString;
    exports2.isDate = isDate;
    exports2.isEmptyString = isEmptyString;
    exports2.isString = isString;
    exports2.isObject = isObject2;
    exports2.isUrlStringOrObject = isUrlStringOrObject;
    exports2.validate = validate2;
  }
});

// node_modules/tough-cookie/lib/version.js
var require_version3 = __commonJS({
  "node_modules/tough-cookie/lib/version.js"(exports2, module2) {
    module2.exports = "4.1.4";
  }
});

// node_modules/tough-cookie/lib/cookie.js
var require_cookie = __commonJS({
  "node_modules/tough-cookie/lib/cookie.js"(exports2) {
    "use strict";
    var punycode = require("punycode");
    var urlParse = require_url_parse();
    var pubsuffix = require_pubsuffix_psl();
    var Store = require_store().Store;
    var MemoryCookieStore = require_memstore().MemoryCookieStore;
    var pathMatch = require_pathMatch().pathMatch;
    var validators = require_validators();
    var VERSION = require_version3();
    var { fromCallback } = require_universalify();
    var { getCustomInspectSymbol } = require_utilHelper();
    var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
    var CONTROL_CHARS = /[\x00-\x1F]/;
    var TERMINATORS = ["\n", "\r", "\0"];
    var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
    var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
    var MONTH_TO_NUM = {
      jan: 0,
      feb: 1,
      mar: 2,
      apr: 3,
      may: 4,
      jun: 5,
      jul: 6,
      aug: 7,
      sep: 8,
      oct: 9,
      nov: 10,
      dec: 11
    };
    var MAX_TIME = 2147483647e3;
    var MIN_TIME = 0;
    var SAME_SITE_CONTEXT_VAL_ERR = 'Invalid sameSiteContext option for getCookies(); expected one of "strict", "lax", or "none"';
    function checkSameSiteContext(value) {
      validators.validate(validators.isNonEmptyString(value), value);
      const context = String(value).toLowerCase();
      if (context === "none" || context === "lax" || context === "strict") {
        return context;
      } else {
        return null;
      }
    }
    var PrefixSecurityEnum = Object.freeze({
      SILENT: "silent",
      STRICT: "strict",
      DISABLED: "unsafe-disabled"
    });
    var IP_REGEX_LOWERCASE = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|(?:[a-f\d]{1,4}:){1}(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|(?::(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:)))$)/;
    var IP_V6_REGEX = `
\\[?(?:
(?:[a-fA-F\\d]{1,4}:){7}(?:[a-fA-F\\d]{1,4}|:)|
(?:[a-fA-F\\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|:[a-fA-F\\d]{1,4}|:)|
(?:[a-fA-F\\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,2}|:)|
(?:[a-fA-F\\d]{1,4}:){4}(?:(?::[a-fA-F\\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,3}|:)|
(?:[a-fA-F\\d]{1,4}:){3}(?:(?::[a-fA-F\\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,4}|:)|
(?:[a-fA-F\\d]{1,4}:){2}(?:(?::[a-fA-F\\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,5}|:)|
(?:[a-fA-F\\d]{1,4}:){1}(?:(?::[a-fA-F\\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,6}|:)|
(?::(?:(?::[a-fA-F\\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,7}|:))
)(?:%[0-9a-zA-Z]{1,})?\\]?
`.replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
    var IP_V6_REGEX_OBJECT = new RegExp(`^${IP_V6_REGEX}$`);
    function parseDigits(token, minDigits, maxDigits, trailingOK) {
      let count = 0;
      while (count < token.length) {
        const c = token.charCodeAt(count);
        if (c <= 47 || c >= 58) {
          break;
        }
        count++;
      }
      if (count < minDigits || count > maxDigits) {
        return null;
      }
      if (!trailingOK && count != token.length) {
        return null;
      }
      return parseInt(token.substr(0, count), 10);
    }
    function parseTime(token) {
      const parts = token.split(":");
      const result = [0, 0, 0];
      if (parts.length !== 3) {
        return null;
      }
      for (let i = 0; i < 3; i++) {
        const trailingOK = i == 2;
        const num = parseDigits(parts[i], 1, 2, trailingOK);
        if (num === null) {
          return null;
        }
        result[i] = num;
      }
      return result;
    }
    function parseMonth(token) {
      token = String(token).substr(0, 3).toLowerCase();
      const num = MONTH_TO_NUM[token];
      return num >= 0 ? num : null;
    }
    function parseDate(str) {
      if (!str) {
        return;
      }
      const tokens = str.split(DATE_DELIM);
      if (!tokens) {
        return;
      }
      let hour = null;
      let minute = null;
      let second = null;
      let dayOfMonth = null;
      let month = null;
      let year = null;
      for (let i = 0; i < tokens.length; i++) {
        const token = tokens[i].trim();
        if (!token.length) {
          continue;
        }
        let result;
        if (second === null) {
          result = parseTime(token);
          if (result) {
            hour = result[0];
            minute = result[1];
            second = result[2];
            continue;
          }
        }
        if (dayOfMonth === null) {
          result = parseDigits(token, 1, 2, true);
          if (result !== null) {
            dayOfMonth = result;
            continue;
          }
        }
        if (month === null) {
          result = parseMonth(token);
          if (result !== null) {
            month = result;
            continue;
          }
        }
        if (year === null) {
          result = parseDigits(token, 2, 4, true);
          if (result !== null) {
            year = result;
            if (year >= 70 && year <= 99) {
              year += 1900;
            } else if (year >= 0 && year <= 69) {
              year += 2e3;
            }
          }
        }
      }
      if (dayOfMonth === null || month === null || year === null || second === null || dayOfMonth < 1 || dayOfMonth > 31 || year < 1601 || hour > 23 || minute > 59 || second > 59) {
        return;
      }
      return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));
    }
    function formatDate(date) {
      validators.validate(validators.isDate(date), date);
      return date.toUTCString();
    }
    function canonicalDomain(str) {
      if (str == null) {
        return null;
      }
      str = str.trim().replace(/^\./, "");
      if (IP_V6_REGEX_OBJECT.test(str)) {
        str = str.replace("[", "").replace("]", "");
      }
      if (punycode && /[^\u0001-\u007f]/.test(str)) {
        str = punycode.toASCII(str);
      }
      return str.toLowerCase();
    }
    function domainMatch(str, domStr, canonicalize) {
      if (str == null || domStr == null) {
        return null;
      }
      if (canonicalize !== false) {
        str = canonicalDomain(str);
        domStr = canonicalDomain(domStr);
      }
      if (str == domStr) {
        return true;
      }
      const idx = str.lastIndexOf(domStr);
      if (idx <= 0) {
        return false;
      }
      if (str.length !== domStr.length + idx) {
        return false;
      }
      if (str.substr(idx - 1, 1) !== ".") {
        return false;
      }
      if (IP_REGEX_LOWERCASE.test(str)) {
        return false;
      }
      return true;
    }
    function defaultPath(path4) {
      if (!path4 || path4.substr(0, 1) !== "/") {
        return "/";
      }
      if (path4 === "/") {
        return path4;
      }
      const rightSlash = path4.lastIndexOf("/");
      if (rightSlash === 0) {
        return "/";
      }
      return path4.slice(0, rightSlash);
    }
    function trimTerminator(str) {
      if (validators.isEmptyString(str))
        return str;
      for (let t = 0; t < TERMINATORS.length; t++) {
        const terminatorIdx = str.indexOf(TERMINATORS[t]);
        if (terminatorIdx !== -1) {
          str = str.substr(0, terminatorIdx);
        }
      }
      return str;
    }
    function parseCookiePair(cookiePair, looseMode) {
      cookiePair = trimTerminator(cookiePair);
      validators.validate(validators.isString(cookiePair), cookiePair);
      let firstEq = cookiePair.indexOf("=");
      if (looseMode) {
        if (firstEq === 0) {
          cookiePair = cookiePair.substr(1);
          firstEq = cookiePair.indexOf("=");
        }
      } else {
        if (firstEq <= 0) {
          return;
        }
      }
      let cookieName, cookieValue;
      if (firstEq <= 0) {
        cookieName = "";
        cookieValue = cookiePair.trim();
      } else {
        cookieName = cookiePair.substr(0, firstEq).trim();
        cookieValue = cookiePair.substr(firstEq + 1).trim();
      }
      if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {
        return;
      }
      const c = new Cookie();
      c.key = cookieName;
      c.value = cookieValue;
      return c;
    }
    function parse2(str, options) {
      if (!options || typeof options !== "object") {
        options = {};
      }
      if (validators.isEmptyString(str) || !validators.isString(str)) {
        return null;
      }
      str = str.trim();
      const firstSemi = str.indexOf(";");
      const cookiePair = firstSemi === -1 ? str : str.substr(0, firstSemi);
      const c = parseCookiePair(cookiePair, !!options.loose);
      if (!c) {
        return;
      }
      if (firstSemi === -1) {
        return c;
      }
      const unparsed = str.slice(firstSemi + 1).trim();
      if (unparsed.length === 0) {
        return c;
      }
      const cookie_avs = unparsed.split(";");
      while (cookie_avs.length) {
        const av = cookie_avs.shift().trim();
        if (av.length === 0) {
          continue;
        }
        const av_sep = av.indexOf("=");
        let av_key, av_value;
        if (av_sep === -1) {
          av_key = av;
          av_value = null;
        } else {
          av_key = av.substr(0, av_sep);
          av_value = av.substr(av_sep + 1);
        }
        av_key = av_key.trim().toLowerCase();
        if (av_value) {
          av_value = av_value.trim();
        }
        switch (av_key) {
          case "expires":
            if (av_value) {
              const exp = parseDate(av_value);
              if (exp) {
                c.expires = exp;
              }
            }
            break;
          case "max-age":
            if (av_value) {
              if (/^-?[0-9]+$/.test(av_value)) {
                const delta = parseInt(av_value, 10);
                c.setMaxAge(delta);
              }
            }
            break;
          case "domain":
            if (av_value) {
              const domain = av_value.trim().replace(/^\./, "");
              if (domain) {
                c.domain = domain.toLowerCase();
              }
            }
            break;
          case "path":
            c.path = av_value && av_value[0] === "/" ? av_value : null;
            break;
          case "secure":
            c.secure = true;
            break;
          case "httponly":
            c.httpOnly = true;
            break;
          case "samesite":
            const enforcement = av_value ? av_value.toLowerCase() : "";
            switch (enforcement) {
              case "strict":
                c.sameSite = "strict";
                break;
              case "lax":
                c.sameSite = "lax";
                break;
              case "none":
                c.sameSite = "none";
                break;
              default:
                c.sameSite = void 0;
                break;
            }
            break;
          default:
            c.extensions = c.extensions || [];
            c.extensions.push(av);
            break;
        }
      }
      return c;
    }
    function isSecurePrefixConditionMet(cookie) {
      validators.validate(validators.isObject(cookie), cookie);
      return !cookie.key.startsWith("__Secure-") || cookie.secure;
    }
    function isHostPrefixConditionMet(cookie) {
      validators.validate(validators.isObject(cookie));
      return !cookie.key.startsWith("__Host-") || cookie.secure && cookie.hostOnly && cookie.path != null && cookie.path === "/";
    }
    function jsonParse(str) {
      let obj2;
      try {
        obj2 = JSON.parse(str);
      } catch (e) {
        return e;
      }
      return obj2;
    }
    function fromJSON(str) {
      if (!str || validators.isEmptyString(str)) {
        return null;
      }
      let obj2;
      if (typeof str === "string") {
        obj2 = jsonParse(str);
        if (obj2 instanceof Error) {
          return null;
        }
      } else {
        obj2 = str;
      }
      const c = new Cookie();
      for (let i = 0; i < Cookie.serializableProperties.length; i++) {
        const prop = Cookie.serializableProperties[i];
        if (obj2[prop] === void 0 || obj2[prop] === cookieDefaults[prop]) {
          continue;
        }
        if (prop === "expires" || prop === "creation" || prop === "lastAccessed") {
          if (obj2[prop] === null) {
            c[prop] = null;
          } else {
            c[prop] = obj2[prop] == "Infinity" ? "Infinity" : new Date(obj2[prop]);
          }
        } else {
          c[prop] = obj2[prop];
        }
      }
      return c;
    }
    function cookieCompare(a, b) {
      validators.validate(validators.isObject(a), a);
      validators.validate(validators.isObject(b), b);
      let cmp = 0;
      const aPathLen = a.path ? a.path.length : 0;
      const bPathLen = b.path ? b.path.length : 0;
      cmp = bPathLen - aPathLen;
      if (cmp !== 0) {
        return cmp;
      }
      const aTime = a.creation ? a.creation.getTime() : MAX_TIME;
      const bTime = b.creation ? b.creation.getTime() : MAX_TIME;
      cmp = aTime - bTime;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = a.creationIndex - b.creationIndex;
      return cmp;
    }
    function permutePath(path4) {
      validators.validate(validators.isString(path4));
      if (path4 === "/") {
        return ["/"];
      }
      const permutations = [path4];
      while (path4.length > 1) {
        const lindex = path4.lastIndexOf("/");
        if (lindex === 0) {
          break;
        }
        path4 = path4.substr(0, lindex);
        permutations.push(path4);
      }
      permutations.push("/");
      return permutations;
    }
    function getCookieContext(url) {
      if (url instanceof Object) {
        return url;
      }
      try {
        url = decodeURI(url);
      } catch (err) {
      }
      return urlParse(url);
    }
    var cookieDefaults = {
      // the order in which the RFC has them:
      key: "",
      value: "",
      expires: "Infinity",
      maxAge: null,
      domain: null,
      path: null,
      secure: false,
      httpOnly: false,
      extensions: null,
      // set by the CookieJar:
      hostOnly: null,
      pathIsDefault: null,
      creation: null,
      lastAccessed: null,
      sameSite: void 0
    };
    var Cookie = class {
      constructor(options = {}) {
        const customInspectSymbol = getCustomInspectSymbol();
        if (customInspectSymbol) {
          this[customInspectSymbol] = this.inspect;
        }
        Object.assign(this, cookieDefaults, options);
        this.creation = this.creation || new Date();
        Object.defineProperty(this, "creationIndex", {
          configurable: false,
          enumerable: false,
          // important for assert.deepEqual checks
          writable: true,
          value: ++Cookie.cookiesCreated
        });
      }
      inspect() {
        const now = Date.now();
        const hostOnly = this.hostOnly != null ? this.hostOnly : "?";
        const createAge = this.creation ? `${now - this.creation.getTime()}ms` : "?";
        const accessAge = this.lastAccessed ? `${now - this.lastAccessed.getTime()}ms` : "?";
        return `Cookie="${this.toString()}; hostOnly=${hostOnly}; aAge=${accessAge}; cAge=${createAge}"`;
      }
      toJSON() {
        const obj2 = {};
        for (const prop of Cookie.serializableProperties) {
          if (this[prop] === cookieDefaults[prop]) {
            continue;
          }
          if (prop === "expires" || prop === "creation" || prop === "lastAccessed") {
            if (this[prop] === null) {
              obj2[prop] = null;
            } else {
              obj2[prop] = this[prop] == "Infinity" ? "Infinity" : this[prop].toISOString();
            }
          } else if (prop === "maxAge") {
            if (this[prop] !== null) {
              obj2[prop] = this[prop] == Infinity || this[prop] == -Infinity ? this[prop].toString() : this[prop];
            }
          } else {
            if (this[prop] !== cookieDefaults[prop]) {
              obj2[prop] = this[prop];
            }
          }
        }
        return obj2;
      }
      clone() {
        return fromJSON(this.toJSON());
      }
      validate() {
        if (!COOKIE_OCTETS.test(this.value)) {
          return false;
        }
        if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {
          return false;
        }
        if (this.maxAge != null && this.maxAge <= 0) {
          return false;
        }
        if (this.path != null && !PATH_VALUE.test(this.path)) {
          return false;
        }
        const cdomain = this.cdomain();
        if (cdomain) {
          if (cdomain.match(/\.$/)) {
            return false;
          }
          const suffix = pubsuffix.getPublicSuffix(cdomain);
          if (suffix == null) {
            return false;
          }
        }
        return true;
      }
      setExpires(exp) {
        if (exp instanceof Date) {
          this.expires = exp;
        } else {
          this.expires = parseDate(exp) || "Infinity";
        }
      }
      setMaxAge(age) {
        if (age === Infinity || age === -Infinity) {
          this.maxAge = age.toString();
        } else {
          this.maxAge = age;
        }
      }
      cookieString() {
        let val = this.value;
        if (val == null) {
          val = "";
        }
        if (this.key === "") {
          return val;
        }
        return `${this.key}=${val}`;
      }
      // gives Set-Cookie header format
      toString() {
        let str = this.cookieString();
        if (this.expires != Infinity) {
          if (this.expires instanceof Date) {
            str += `; Expires=${formatDate(this.expires)}`;
          } else {
            str += `; Expires=${this.expires}`;
          }
        }
        if (this.maxAge != null && this.maxAge != Infinity) {
          str += `; Max-Age=${this.maxAge}`;
        }
        if (this.domain && !this.hostOnly) {
          str += `; Domain=${this.domain}`;
        }
        if (this.path) {
          str += `; Path=${this.path}`;
        }
        if (this.secure) {
          str += "; Secure";
        }
        if (this.httpOnly) {
          str += "; HttpOnly";
        }
        if (this.sameSite && this.sameSite !== "none") {
          const ssCanon = Cookie.sameSiteCanonical[this.sameSite.toLowerCase()];
          str += `; SameSite=${ssCanon ? ssCanon : this.sameSite}`;
        }
        if (this.extensions) {
          this.extensions.forEach((ext) => {
            str += `; ${ext}`;
          });
        }
        return str;
      }
      // TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
      // elsewhere)
      // S5.3 says to give the "latest representable date" for which we use Infinity
      // For "expired" we use 0
      TTL(now) {
        if (this.maxAge != null) {
          return this.maxAge <= 0 ? 0 : this.maxAge * 1e3;
        }
        let expires = this.expires;
        if (expires != Infinity) {
          if (!(expires instanceof Date)) {
            expires = parseDate(expires) || Infinity;
          }
          if (expires == Infinity) {
            return Infinity;
          }
          return expires.getTime() - (now || Date.now());
        }
        return Infinity;
      }
      // expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
      // elsewhere)
      expiryTime(now) {
        if (this.maxAge != null) {
          const relativeTo = now || this.creation || new Date();
          const age = this.maxAge <= 0 ? -Infinity : this.maxAge * 1e3;
          return relativeTo.getTime() + age;
        }
        if (this.expires == Infinity) {
          return Infinity;
        }
        return this.expires.getTime();
      }
      // expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
      // elsewhere), except it returns a Date
      expiryDate(now) {
        const millisec = this.expiryTime(now);
        if (millisec == Infinity) {
          return new Date(MAX_TIME);
        } else if (millisec == -Infinity) {
          return new Date(MIN_TIME);
        } else {
          return new Date(millisec);
        }
      }
      // This replaces the "persistent-flag" parts of S5.3 step 3
      isPersistent() {
        return this.maxAge != null || this.expires != Infinity;
      }
      // Mostly S5.1.2 and S5.2.3:
      canonicalizedDomain() {
        if (this.domain == null) {
          return null;
        }
        return canonicalDomain(this.domain);
      }
      cdomain() {
        return this.canonicalizedDomain();
      }
    };
    Cookie.cookiesCreated = 0;
    Cookie.parse = parse2;
    Cookie.fromJSON = fromJSON;
    Cookie.serializableProperties = Object.keys(cookieDefaults);
    Cookie.sameSiteLevel = {
      strict: 3,
      lax: 2,
      none: 1
    };
    Cookie.sameSiteCanonical = {
      strict: "Strict",
      lax: "Lax"
    };
    function getNormalizedPrefixSecurity(prefixSecurity) {
      if (prefixSecurity != null) {
        const normalizedPrefixSecurity = prefixSecurity.toLowerCase();
        switch (normalizedPrefixSecurity) {
          case PrefixSecurityEnum.STRICT:
          case PrefixSecurityEnum.SILENT:
          case PrefixSecurityEnum.DISABLED:
            return normalizedPrefixSecurity;
        }
      }
      return PrefixSecurityEnum.SILENT;
    }
    var CookieJar = class {
      constructor(store, options = { rejectPublicSuffixes: true }) {
        if (typeof options === "boolean") {
          options = { rejectPublicSuffixes: options };
        }
        validators.validate(validators.isObject(options), options);
        this.rejectPublicSuffixes = options.rejectPublicSuffixes;
        this.enableLooseMode = !!options.looseMode;
        this.allowSpecialUseDomain = typeof options.allowSpecialUseDomain === "boolean" ? options.allowSpecialUseDomain : true;
        this.store = store || new MemoryCookieStore();
        this.prefixSecurity = getNormalizedPrefixSecurity(options.prefixSecurity);
        this._cloneSync = syncWrap("clone");
        this._importCookiesSync = syncWrap("_importCookies");
        this.getCookiesSync = syncWrap("getCookies");
        this.getCookieStringSync = syncWrap("getCookieString");
        this.getSetCookieStringsSync = syncWrap("getSetCookieStrings");
        this.removeAllCookiesSync = syncWrap("removeAllCookies");
        this.setCookieSync = syncWrap("setCookie");
        this.serializeSync = syncWrap("serialize");
      }
      setCookie(cookie, url, options, cb) {
        validators.validate(validators.isUrlStringOrObject(url), cb, options);
        let err;
        if (validators.isFunction(url)) {
          cb = url;
          return cb(new Error("No URL was specified"));
        }
        const context = getCookieContext(url);
        if (validators.isFunction(options)) {
          cb = options;
          options = {};
        }
        validators.validate(validators.isFunction(cb), cb);
        if (!validators.isNonEmptyString(cookie) && !validators.isObject(cookie) && cookie instanceof String && cookie.length == 0) {
          return cb(null);
        }
        const host = canonicalDomain(context.hostname);
        const loose = options.loose || this.enableLooseMode;
        let sameSiteContext = null;
        if (options.sameSiteContext) {
          sameSiteContext = checkSameSiteContext(options.sameSiteContext);
          if (!sameSiteContext) {
            return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR));
          }
        }
        if (typeof cookie === "string" || cookie instanceof String) {
          cookie = Cookie.parse(cookie, { loose });
          if (!cookie) {
            err = new Error("Cookie failed to parse");
            return cb(options.ignoreError ? null : err);
          }
        } else if (!(cookie instanceof Cookie)) {
          err = new Error(
            "First argument to setCookie must be a Cookie object or string"
          );
          return cb(options.ignoreError ? null : err);
        }
        const now = options.now || new Date();
        if (this.rejectPublicSuffixes && cookie.domain) {
          const suffix = pubsuffix.getPublicSuffix(cookie.cdomain(), {
            allowSpecialUseDomain: this.allowSpecialUseDomain,
            ignoreError: options.ignoreError
          });
          if (suffix == null && !IP_V6_REGEX_OBJECT.test(cookie.domain)) {
            err = new Error("Cookie has domain set to a public suffix");
            return cb(options.ignoreError ? null : err);
          }
        }
        if (cookie.domain) {
          if (!domainMatch(host, cookie.cdomain(), false)) {
            err = new Error(
              `Cookie not in this host's domain. Cookie:${cookie.cdomain()} Request:${host}`
            );
            return cb(options.ignoreError ? null : err);
          }
          if (cookie.hostOnly == null) {
            cookie.hostOnly = false;
          }
        } else {
          cookie.hostOnly = true;
          cookie.domain = host;
        }
        if (!cookie.path || cookie.path[0] !== "/") {
          cookie.path = defaultPath(context.pathname);
          cookie.pathIsDefault = true;
        }
        if (options.http === false && cookie.httpOnly) {
          err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
          return cb(options.ignoreError ? null : err);
        }
        if (cookie.sameSite !== "none" && cookie.sameSite !== void 0 && sameSiteContext) {
          if (sameSiteContext === "none") {
            err = new Error(
              "Cookie is SameSite but this is a cross-origin request"
            );
            return cb(options.ignoreError ? null : err);
          }
        }
        const ignoreErrorForPrefixSecurity = this.prefixSecurity === PrefixSecurityEnum.SILENT;
        const prefixSecurityDisabled = this.prefixSecurity === PrefixSecurityEnum.DISABLED;
        if (!prefixSecurityDisabled) {
          let errorFound = false;
          let errorMsg;
          if (!isSecurePrefixConditionMet(cookie)) {
            errorFound = true;
            errorMsg = "Cookie has __Secure prefix but Secure attribute is not set";
          } else if (!isHostPrefixConditionMet(cookie)) {
            errorFound = true;
            errorMsg = "Cookie has __Host prefix but either Secure or HostOnly attribute is not set or Path is not '/'";
          }
          if (errorFound) {
            return cb(
              options.ignoreError || ignoreErrorForPrefixSecurity ? null : new Error(errorMsg)
            );
          }
        }
        const store = this.store;
        if (!store.updateCookie) {
          store.updateCookie = function(oldCookie, newCookie, cb2) {
            this.putCookie(newCookie, cb2);
          };
        }
        function withCookie(err2, oldCookie) {
          if (err2) {
            return cb(err2);
          }
          const next = function(err3) {
            if (err3) {
              return cb(err3);
            } else {
              cb(null, cookie);
            }
          };
          if (oldCookie) {
            if (options.http === false && oldCookie.httpOnly) {
              err2 = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
              return cb(options.ignoreError ? null : err2);
            }
            cookie.creation = oldCookie.creation;
            cookie.creationIndex = oldCookie.creationIndex;
            cookie.lastAccessed = now;
            store.updateCookie(oldCookie, cookie, next);
          } else {
            cookie.creation = cookie.lastAccessed = now;
            store.putCookie(cookie, next);
          }
        }
        store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
      }
      // RFC6365 S5.4
      getCookies(url, options, cb) {
        validators.validate(validators.isUrlStringOrObject(url), cb, url);
        const context = getCookieContext(url);
        if (validators.isFunction(options)) {
          cb = options;
          options = {};
        }
        validators.validate(validators.isObject(options), cb, options);
        validators.validate(validators.isFunction(cb), cb);
        const host = canonicalDomain(context.hostname);
        const path4 = context.pathname || "/";
        let secure = options.secure;
        if (secure == null && context.protocol && (context.protocol == "https:" || context.protocol == "wss:")) {
          secure = true;
        }
        let sameSiteLevel = 0;
        if (options.sameSiteContext) {
          const sameSiteContext = checkSameSiteContext(options.sameSiteContext);
          sameSiteLevel = Cookie.sameSiteLevel[sameSiteContext];
          if (!sameSiteLevel) {
            return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR));
          }
        }
        let http = options.http;
        if (http == null) {
          http = true;
        }
        const now = options.now || Date.now();
        const expireCheck = options.expire !== false;
        const allPaths = !!options.allPaths;
        const store = this.store;
        function matchingCookie(c) {
          if (c.hostOnly) {
            if (c.domain != host) {
              return false;
            }
          } else {
            if (!domainMatch(host, c.domain, false)) {
              return false;
            }
          }
          if (!allPaths && !pathMatch(path4, c.path)) {
            return false;
          }
          if (c.secure && !secure) {
            return false;
          }
          if (c.httpOnly && !http) {
            return false;
          }
          if (sameSiteLevel) {
            const cookieLevel = Cookie.sameSiteLevel[c.sameSite || "none"];
            if (cookieLevel > sameSiteLevel) {
              return false;
            }
          }
          if (expireCheck && c.expiryTime() <= now) {
            store.removeCookie(c.domain, c.path, c.key, () => {
            });
            return false;
          }
          return true;
        }
        store.findCookies(
          host,
          allPaths ? null : path4,
          this.allowSpecialUseDomain,
          (err, cookies) => {
            if (err) {
              return cb(err);
            }
            cookies = cookies.filter(matchingCookie);
            if (options.sort !== false) {
              cookies = cookies.sort(cookieCompare);
            }
            const now2 = new Date();
            for (const cookie of cookies) {
              cookie.lastAccessed = now2;
            }
            cb(null, cookies);
          }
        );
      }
      getCookieString(...args) {
        const cb = args.pop();
        validators.validate(validators.isFunction(cb), cb);
        const next = function(err, cookies) {
          if (err) {
            cb(err);
          } else {
            cb(
              null,
              cookies.sort(cookieCompare).map((c) => c.cookieString()).join("; ")
            );
          }
        };
        args.push(next);
        this.getCookies.apply(this, args);
      }
      getSetCookieStrings(...args) {
        const cb = args.pop();
        validators.validate(validators.isFunction(cb), cb);
        const next = function(err, cookies) {
          if (err) {
            cb(err);
          } else {
            cb(
              null,
              cookies.map((c) => {
                return c.toString();
              })
            );
          }
        };
        args.push(next);
        this.getCookies.apply(this, args);
      }
      serialize(cb) {
        validators.validate(validators.isFunction(cb), cb);
        let type = this.store.constructor.name;
        if (validators.isObject(type)) {
          type = null;
        }
        const serialized = {
          // The version of tough-cookie that serialized this jar. Generally a good
          // practice since future versions can make data import decisions based on
          // known past behavior. When/if this matters, use `semver`.
          version: `tough-cookie@${VERSION}`,
          // add the store type, to make humans happy:
          storeType: type,
          // CookieJar configuration:
          rejectPublicSuffixes: !!this.rejectPublicSuffixes,
          enableLooseMode: !!this.enableLooseMode,
          allowSpecialUseDomain: !!this.allowSpecialUseDomain,
          prefixSecurity: getNormalizedPrefixSecurity(this.prefixSecurity),
          // this gets filled from getAllCookies:
          cookies: []
        };
        if (!(this.store.getAllCookies && typeof this.store.getAllCookies === "function")) {
          return cb(
            new Error(
              "store does not support getAllCookies and cannot be serialized"
            )
          );
        }
        this.store.getAllCookies((err, cookies) => {
          if (err) {
            return cb(err);
          }
          serialized.cookies = cookies.map((cookie) => {
            cookie = cookie instanceof Cookie ? cookie.toJSON() : cookie;
            delete cookie.creationIndex;
            return cookie;
          });
          return cb(null, serialized);
        });
      }
      toJSON() {
        return this.serializeSync();
      }
      // use the class method CookieJar.deserialize instead of calling this directly
      _importCookies(serialized, cb) {
        let cookies = serialized.cookies;
        if (!cookies || !Array.isArray(cookies)) {
          return cb(new Error("serialized jar has no cookies array"));
        }
        cookies = cookies.slice();
        const putNext = (err) => {
          if (err) {
            return cb(err);
          }
          if (!cookies.length) {
            return cb(err, this);
          }
          let cookie;
          try {
            cookie = fromJSON(cookies.shift());
          } catch (e) {
            return cb(e);
          }
          if (cookie === null) {
            return putNext(null);
          }
          this.store.putCookie(cookie, putNext);
        };
        putNext();
      }
      clone(newStore, cb) {
        if (arguments.length === 1) {
          cb = newStore;
          newStore = null;
        }
        this.serialize((err, serialized) => {
          if (err) {
            return cb(err);
          }
          CookieJar.deserialize(serialized, newStore, cb);
        });
      }
      cloneSync(newStore) {
        if (arguments.length === 0) {
          return this._cloneSync();
        }
        if (!newStore.synchronous) {
          throw new Error(
            "CookieJar clone destination store is not synchronous; use async API instead."
          );
        }
        return this._cloneSync(newStore);
      }
      removeAllCookies(cb) {
        validators.validate(validators.isFunction(cb), cb);
        const store = this.store;
        if (typeof store.removeAllCookies === "function" && store.removeAllCookies !== Store.prototype.removeAllCookies) {
          return store.removeAllCookies(cb);
        }
        store.getAllCookies((err, cookies) => {
          if (err) {
            return cb(err);
          }
          if (cookies.length === 0) {
            return cb(null);
          }
          let completedCount = 0;
          const removeErrors = [];
          function removeCookieCb(removeErr) {
            if (removeErr) {
              removeErrors.push(removeErr);
            }
            completedCount++;
            if (completedCount === cookies.length) {
              return cb(removeErrors.length ? removeErrors[0] : null);
            }
          }
          cookies.forEach((cookie) => {
            store.removeCookie(
              cookie.domain,
              cookie.path,
              cookie.key,
              removeCookieCb
            );
          });
        });
      }
      static deserialize(strOrObj, store, cb) {
        if (arguments.length !== 3) {
          cb = store;
          store = null;
        }
        validators.validate(validators.isFunction(cb), cb);
        let serialized;
        if (typeof strOrObj === "string") {
          serialized = jsonParse(strOrObj);
          if (serialized instanceof Error) {
            return cb(serialized);
          }
        } else {
          serialized = strOrObj;
        }
        const jar = new CookieJar(store, {
          rejectPublicSuffixes: serialized.rejectPublicSuffixes,
          looseMode: serialized.enableLooseMode,
          allowSpecialUseDomain: serialized.allowSpecialUseDomain,
          prefixSecurity: serialized.prefixSecurity
        });
        jar._importCookies(serialized, (err) => {
          if (err) {
            return cb(err);
          }
          cb(null, jar);
        });
      }
      static deserializeSync(strOrObj, store) {
        const serialized = typeof strOrObj === "string" ? JSON.parse(strOrObj) : strOrObj;
        const jar = new CookieJar(store, {
          rejectPublicSuffixes: serialized.rejectPublicSuffixes,
          looseMode: serialized.enableLooseMode
        });
        if (!jar.store.synchronous) {
          throw new Error(
            "CookieJar store is not synchronous; use async API instead."
          );
        }
        jar._importCookiesSync(serialized);
        return jar;
      }
    };
    CookieJar.fromJSON = CookieJar.deserializeSync;
    [
      "_importCookies",
      "clone",
      "getCookies",
      "getCookieString",
      "getSetCookieStrings",
      "removeAllCookies",
      "serialize",
      "setCookie"
    ].forEach((name) => {
      CookieJar.prototype[name] = fromCallback(CookieJar.prototype[name]);
    });
    CookieJar.deserialize = fromCallback(CookieJar.deserialize);
    function syncWrap(method) {
      return function(...args) {
        if (!this.store.synchronous) {
          throw new Error(
            "CookieJar store is not synchronous; use async API instead."
          );
        }
        let syncErr, syncResult;
        this[method](...args, (err, result) => {
          syncErr = err;
          syncResult = result;
        });
        if (syncErr) {
          throw syncErr;
        }
        return syncResult;
      };
    }
    exports2.version = VERSION;
    exports2.CookieJar = CookieJar;
    exports2.Cookie = Cookie;
    exports2.Store = Store;
    exports2.MemoryCookieStore = MemoryCookieStore;
    exports2.parseDate = parseDate;
    exports2.formatDate = formatDate;
    exports2.parse = parse2;
    exports2.fromJSON = fromJSON;
    exports2.domainMatch = domainMatch;
    exports2.defaultPath = defaultPath;
    exports2.pathMatch = pathMatch;
    exports2.getPublicSuffix = pubsuffix.getPublicSuffix;
    exports2.cookieCompare = cookieCompare;
    exports2.permuteDomain = require_permuteDomain().permuteDomain;
    exports2.permutePath = permutePath;
    exports2.canonicalDomain = canonicalDomain;
    exports2.PrefixSecurityEnum = PrefixSecurityEnum;
    exports2.ParameterError = validators.ParameterError;
  }
});

// node_modules/@cypress/request/lib/cookies.js
var require_cookies = __commonJS({
  "node_modules/@cypress/request/lib/cookies.js"(exports2) {
    "use strict";
    var tough = require_cookie();
    var Cookie = tough.Cookie;
    var CookieJar = tough.CookieJar;
    exports2.parse = function(str) {
      if (str && str.uri) {
        str = str.uri;
      }
      if (typeof str !== "string") {
        throw new Error("The cookie function only accepts STRING as param");
      }
      return Cookie.parse(str, { loose: true });
    };
    function RequestJar(store) {
      var self2 = this;
      self2._jar = new CookieJar(store, { looseMode: true });
    }
    RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) {
      var self2 = this;
      return self2._jar.setCookieSync(cookieOrStr, uri, options || {});
    };
    RequestJar.prototype.getCookieString = function(uri) {
      var self2 = this;
      return self2._jar.getCookieStringSync(uri);
    };
    RequestJar.prototype.getCookies = function(uri) {
      var self2 = this;
      return self2._jar.getCookiesSync(uri);
    };
    exports2.jar = function(store) {
      return new RequestJar(store);
    };
  }
});

// node_modules/json-stringify-safe/stringify.js
var require_stringify2 = __commonJS({
  "node_modules/json-stringify-safe/stringify.js"(exports2, module2) {
    exports2 = module2.exports = stringify2;
    exports2.getSerialize = serializer;
    function stringify2(obj2, replacer, spaces, cycleReplacer) {
      return JSON.stringify(obj2, serializer(replacer, cycleReplacer), spaces);
    }
    function serializer(replacer, cycleReplacer) {
      var stack = [], keys = [];
      if (cycleReplacer == null)
        cycleReplacer = function(key, value) {
          if (stack[0] === value)
            return "[Circular ~]";
          return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
        };
      return function(key, value) {
        if (stack.length > 0) {
          var thisPos = stack.indexOf(this);
          ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
          ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
          if (~stack.indexOf(value))
            value = cycleReplacer.call(this, key, value);
        } else
          stack.push(value);
        return replacer == null ? value : replacer.call(this, key, value);
      };
    }
  }
});

// node_modules/@cypress/request/lib/helpers.js
var require_helpers3 = __commonJS({
  "node_modules/@cypress/request/lib/helpers.js"(exports2) {
    "use strict";
    var jsonSafeStringify = require_stringify2();
    var crypto3 = require("crypto");
    var Buffer3 = require_safe_buffer2().Buffer;
    var defer = typeof setImmediate === "undefined" ? process.nextTick : setImmediate;
    function paramsHaveRequestBody(params) {
      return params.body || params.requestBodyStream || params.json && typeof params.json !== "boolean" || params.multipart;
    }
    function safeStringify(obj2, replacer) {
      var ret2;
      try {
        ret2 = JSON.stringify(obj2, replacer);
      } catch (e) {
        ret2 = jsonSafeStringify(obj2, replacer);
      }
      return ret2;
    }
    function md52(str) {
      return crypto3.createHash("md5").update(str).digest("hex");
    }
    function isReadStream(rs) {
      return rs.readable && rs.path && rs.mode;
    }
    function toBase64(str) {
      return Buffer3.from(str || "", "utf8").toString("base64");
    }
    function copy(obj2) {
      var o = {};
      Object.keys(obj2).forEach(function(i) {
        o[i] = obj2[i];
      });
      return o;
    }
    function version2() {
      var numbers = process.version.replace("v", "").split(".");
      return {
        major: parseInt(numbers[0], 10),
        minor: parseInt(numbers[1], 10),
        patch: parseInt(numbers[2], 10)
      };
    }
    exports2.paramsHaveRequestBody = paramsHaveRequestBody;
    exports2.safeStringify = safeStringify;
    exports2.md5 = md52;
    exports2.isReadStream = isReadStream;
    exports2.toBase64 = toBase64;
    exports2.copy = copy;
    exports2.version = version2;
    exports2.defer = defer;
  }
});

// node_modules/aws-sign2/index.js
var require_aws_sign2 = __commonJS({
  "node_modules/aws-sign2/index.js"(exports2, module2) {
    var crypto3 = require("crypto");
    var parse2 = require("url").parse;
    var keys = [
      "acl",
      "location",
      "logging",
      "notification",
      "partNumber",
      "policy",
      "requestPayment",
      "torrent",
      "uploadId",
      "uploads",
      "versionId",
      "versioning",
      "versions",
      "website"
    ];
    function authorization(options) {
      return "AWS " + options.key + ":" + sign(options);
    }
    module2.exports = authorization;
    module2.exports.authorization = authorization;
    function hmacSha1(options) {
      return crypto3.createHmac("sha1", options.secret).update(options.message).digest("base64");
    }
    module2.exports.hmacSha1 = hmacSha1;
    function sign(options) {
      options.message = stringToSign(options);
      return hmacSha1(options);
    }
    module2.exports.sign = sign;
    function signQuery(options) {
      options.message = queryStringToSign(options);
      return hmacSha1(options);
    }
    module2.exports.signQuery = signQuery;
    function stringToSign(options) {
      var headers = options.amazonHeaders || "";
      if (headers)
        headers += "\n";
      var r = [
        options.verb,
        options.md5,
        options.contentType,
        options.date ? options.date.toUTCString() : "",
        headers + options.resource
      ];
      return r.join("\n");
    }
    module2.exports.stringToSign = stringToSign;
    function queryStringToSign(options) {
      return "GET\n\n\n" + options.date + "\n" + options.resource;
    }
    module2.exports.queryStringToSign = queryStringToSign;
    function canonicalizeHeaders(headers) {
      var buf = [], fields = Object.keys(headers);
      for (var i = 0, len = fields.length; i < len; ++i) {
        var field = fields[i], val = headers[field], field = field.toLowerCase();
        if (0 !== field.indexOf("x-amz"))
          continue;
        buf.push(field + ":" + val);
      }
      return buf.sort().join("\n");
    }
    module2.exports.canonicalizeHeaders = canonicalizeHeaders;
    function canonicalizeResource(resource) {
      var url = parse2(resource, true), path4 = url.pathname, buf = [];
      Object.keys(url.query).forEach(function(key) {
        if (!~keys.indexOf(key))
          return;
        var val = "" == url.query[key] ? "" : "=" + encodeURIComponent(url.query[key]);
        buf.push(key + val);
      });
      return path4 + (buf.length ? "?" + buf.sort().join("&") : "");
    }
    module2.exports.canonicalizeResource = canonicalizeResource;
  }
});

// node_modules/aws4/lru.js
var require_lru = __commonJS({
  "node_modules/aws4/lru.js"(exports2, module2) {
    module2.exports = function(size) {
      return new LruCache(size);
    };
    function LruCache(size) {
      this.capacity = size | 0;
      this.map = /* @__PURE__ */ Object.create(null);
      this.list = new DoublyLinkedList();
    }
    LruCache.prototype.get = function(key) {
      var node = this.map[key];
      if (node == null)
        return void 0;
      this.used(node);
      return node.val;
    };
    LruCache.prototype.set = function(key, val) {
      var node = this.map[key];
      if (node != null) {
        node.val = val;
      } else {
        if (!this.capacity)
          this.prune();
        if (!this.capacity)
          return false;
        node = new DoublyLinkedNode(key, val);
        this.map[key] = node;
        this.capacity--;
      }
      this.used(node);
      return true;
    };
    LruCache.prototype.used = function(node) {
      this.list.moveToFront(node);
    };
    LruCache.prototype.prune = function() {
      var node = this.list.pop();
      if (node != null) {
        delete this.map[node.key];
        this.capacity++;
      }
    };
    function DoublyLinkedList() {
      this.firstNode = null;
      this.lastNode = null;
    }
    DoublyLinkedList.prototype.moveToFront = function(node) {
      if (this.firstNode == node)
        return;
      this.remove(node);
      if (this.firstNode == null) {
        this.firstNode = node;
        this.lastNode = node;
        node.prev = null;
        node.next = null;
      } else {
        node.prev = null;
        node.next = this.firstNode;
        node.next.prev = node;
        this.firstNode = node;
      }
    };
    DoublyLinkedList.prototype.pop = function() {
      var lastNode = this.lastNode;
      if (lastNode != null) {
        this.remove(lastNode);
      }
      return lastNode;
    };
    DoublyLinkedList.prototype.remove = function(node) {
      if (this.firstNode == node) {
        this.firstNode = node.next;
      } else if (node.prev != null) {
        node.prev.next = node.next;
      }
      if (this.lastNode == node) {
        this.lastNode = node.prev;
      } else if (node.next != null) {
        node.next.prev = node.prev;
      }
    };
    function DoublyLinkedNode(key, val) {
      this.key = key;
      this.val = val;
      this.prev = null;
      this.next = null;
    }
  }
});

// node_modules/aws4/aws4.js
var require_aws4 = __commonJS({
  "node_modules/aws4/aws4.js"(exports2) {
    var aws4 = exports2;
    var url = require("url");
    var querystring = require("querystring");
    var crypto3 = require("crypto");
    var lru = require_lru();
    var credentialsCache = lru(1e3);
    function hmac(key, string, encoding) {
      return crypto3.createHmac("sha256", key).update(string, "utf8").digest(encoding);
    }
    function hash3(string, encoding) {
      return crypto3.createHash("sha256").update(string, "utf8").digest(encoding);
    }
    function encodeRfc3986(urlEncodedString) {
      return urlEncodedString.replace(/[!'()*]/g, function(c) {
        return "%" + c.charCodeAt(0).toString(16).toUpperCase();
      });
    }
    function encodeRfc3986Full(str) {
      return encodeRfc3986(encodeURIComponent(str));
    }
    var HEADERS_TO_IGNORE = {
      "authorization": true,
      "connection": true,
      "x-amzn-trace-id": true,
      "user-agent": true,
      "expect": true,
      "presigned-expires": true,
      "range": true
    };
    function RequestSigner(request, credentials) {
      if (typeof request === "string")
        request = url.parse(request);
      var headers = request.headers = Object.assign({}, request.headers || {}), hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host);
      this.request = request;
      this.credentials = credentials || this.defaultCredentials();
      this.service = request.service || hostParts[0] || "";
      this.region = request.region || hostParts[1] || "us-east-1";
      if (this.service === "email")
        this.service = "ses";
      if (!request.method && request.body)
        request.method = "POST";
      if (!headers.Host && !headers.host) {
        headers.Host = request.hostname || request.host || this.createHost();
        if (request.port)
          headers.Host += ":" + request.port;
      }
      if (!request.hostname && !request.host)
        request.hostname = headers.Host || headers.host;
      this.isCodeCommitGit = this.service === "codecommit" && request.method === "GIT";
      this.extraHeadersToIgnore = request.extraHeadersToIgnore || /* @__PURE__ */ Object.create(null);
      this.extraHeadersToInclude = request.extraHeadersToInclude || /* @__PURE__ */ Object.create(null);
    }
    RequestSigner.prototype.matchHost = function(host) {
      var match = (host || "").match(/([^\.]{1,63})\.(?:([^\.]{0,63})\.)?amazonaws\.com(\.cn)?$/);
      var hostParts = (match || []).slice(1, 3);
      if (hostParts[1] === "es" || hostParts[1] === "aoss")
        hostParts = hostParts.reverse();
      if (hostParts[1] == "s3") {
        hostParts[0] = "s3";
        hostParts[1] = "us-east-1";
      } else {
        for (var i = 0; i < 2; i++) {
          if (/^s3-/.test(hostParts[i])) {
            hostParts[1] = hostParts[i].slice(3);
            hostParts[0] = "s3";
            break;
          }
        }
      }
      return hostParts;
    };
    RequestSigner.prototype.isSingleRegion = function() {
      if (["s3", "sdb"].indexOf(this.service) >= 0 && this.region === "us-east-1")
        return true;
      return ["cloudfront", "ls", "route53", "iam", "importexport", "sts"].indexOf(this.service) >= 0;
    };
    RequestSigner.prototype.createHost = function() {
      var region = this.isSingleRegion() ? "" : "." + this.region, subdomain = this.service === "ses" ? "email" : this.service;
      return subdomain + region + ".amazonaws.com";
    };
    RequestSigner.prototype.prepareRequest = function() {
      this.parsePath();
      var request = this.request, headers = request.headers, query;
      if (request.signQuery) {
        this.parsedPath.query = query = this.parsedPath.query || {};
        if (this.credentials.sessionToken)
          query["X-Amz-Security-Token"] = this.credentials.sessionToken;
        if (this.service === "s3" && !query["X-Amz-Expires"])
          query["X-Amz-Expires"] = 86400;
        if (query["X-Amz-Date"])
          this.datetime = query["X-Amz-Date"];
        else
          query["X-Amz-Date"] = this.getDateTime();
        query["X-Amz-Algorithm"] = "AWS4-HMAC-SHA256";
        query["X-Amz-Credential"] = this.credentials.accessKeyId + "/" + this.credentialString();
        query["X-Amz-SignedHeaders"] = this.signedHeaders();
      } else {
        if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {
          if (request.body && !headers["Content-Type"] && !headers["content-type"])
            headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8";
          if (request.body && !headers["Content-Length"] && !headers["content-length"])
            headers["Content-Length"] = Buffer.byteLength(request.body);
          if (this.credentials.sessionToken && !headers["X-Amz-Security-Token"] && !headers["x-amz-security-token"])
            headers["X-Amz-Security-Token"] = this.credentials.sessionToken;
          if (this.service === "s3" && !headers["X-Amz-Content-Sha256"] && !headers["x-amz-content-sha256"])
            headers["X-Amz-Content-Sha256"] = hash3(this.request.body || "", "hex");
          if (headers["X-Amz-Date"] || headers["x-amz-date"])
            this.datetime = headers["X-Amz-Date"] || headers["x-amz-date"];
          else
            headers["X-Amz-Date"] = this.getDateTime();
        }
        delete headers.Authorization;
        delete headers.authorization;
      }
    };
    RequestSigner.prototype.sign = function() {
      if (!this.parsedPath)
        this.prepareRequest();
      if (this.request.signQuery) {
        this.parsedPath.query["X-Amz-Signature"] = this.signature();
      } else {
        this.request.headers.Authorization = this.authHeader();
      }
      this.request.path = this.formatPath();
      return this.request;
    };
    RequestSigner.prototype.getDateTime = function() {
      if (!this.datetime) {
        var headers = this.request.headers, date = new Date(headers.Date || headers.date || new Date());
        this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, "");
        if (this.isCodeCommitGit)
          this.datetime = this.datetime.slice(0, -1);
      }
      return this.datetime;
    };
    RequestSigner.prototype.getDate = function() {
      return this.getDateTime().substr(0, 8);
    };
    RequestSigner.prototype.authHeader = function() {
      return [
        "AWS4-HMAC-SHA256 Credential=" + this.credentials.accessKeyId + "/" + this.credentialString(),
        "SignedHeaders=" + this.signedHeaders(),
        "Signature=" + this.signature()
      ].join(", ");
    };
    RequestSigner.prototype.signature = function() {
      var date = this.getDate(), cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey);
      if (!kCredentials) {
        kDate = hmac("AWS4" + this.credentials.secretAccessKey, date);
        kRegion = hmac(kDate, this.region);
        kService = hmac(kRegion, this.service);
        kCredentials = hmac(kService, "aws4_request");
        credentialsCache.set(cacheKey, kCredentials);
      }
      return hmac(kCredentials, this.stringToSign(), "hex");
    };
    RequestSigner.prototype.stringToSign = function() {
      return [
        "AWS4-HMAC-SHA256",
        this.getDateTime(),
        this.credentialString(),
        hash3(this.canonicalString(), "hex")
      ].join("\n");
    };
    RequestSigner.prototype.canonicalString = function() {
      if (!this.parsedPath)
        this.prepareRequest();
      var pathStr = this.parsedPath.path, query = this.parsedPath.query, headers = this.request.headers, queryStr = "", normalizePath4 = this.service !== "s3", decodePath = this.service === "s3" || this.request.doNotEncodePath, decodeSlashesInPath = this.service === "s3", firstValOnly = this.service === "s3", bodyHash;
      if (this.service === "s3" && this.request.signQuery) {
        bodyHash = "UNSIGNED-PAYLOAD";
      } else if (this.isCodeCommitGit) {
        bodyHash = "";
      } else {
        bodyHash = headers["X-Amz-Content-Sha256"] || headers["x-amz-content-sha256"] || hash3(this.request.body || "", "hex");
      }
      if (query) {
        var reducedQuery = Object.keys(query).reduce(function(obj2, key) {
          if (!key)
            return obj2;
          obj2[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] : firstValOnly ? query[key][0] : query[key];
          return obj2;
        }, {});
        var encodedQueryPieces = [];
        Object.keys(reducedQuery).sort().forEach(function(key) {
          if (!Array.isArray(reducedQuery[key])) {
            encodedQueryPieces.push(key + "=" + encodeRfc3986Full(reducedQuery[key]));
          } else {
            reducedQuery[key].map(encodeRfc3986Full).sort().forEach(function(val) {
              encodedQueryPieces.push(key + "=" + val);
            });
          }
        });
        queryStr = encodedQueryPieces.join("&");
      }
      if (pathStr !== "/") {
        if (normalizePath4)
          pathStr = pathStr.replace(/\/{2,}/g, "/");
        pathStr = pathStr.split("/").reduce(function(path4, piece) {
          if (normalizePath4 && piece === "..") {
            path4.pop();
          } else if (!normalizePath4 || piece !== ".") {
            if (decodePath)
              piece = decodeURIComponent(piece.replace(/\+/g, " "));
            path4.push(encodeRfc3986Full(piece));
          }
          return path4;
        }, []).join("/");
        if (pathStr[0] !== "/")
          pathStr = "/" + pathStr;
        if (decodeSlashesInPath)
          pathStr = pathStr.replace(/%2F/g, "/");
      }
      return [
        this.request.method || "GET",
        pathStr,
        queryStr,
        this.canonicalHeaders() + "\n",
        this.signedHeaders(),
        bodyHash
      ].join("\n");
    };
    RequestSigner.prototype.filterHeaders = function() {
      var headers = this.request.headers, extraHeadersToInclude = this.extraHeadersToInclude, extraHeadersToIgnore = this.extraHeadersToIgnore;
      this.filteredHeaders = Object.keys(headers).map(function(key) {
        return [key.toLowerCase(), headers[key]];
      }).filter(function(entry) {
        return extraHeadersToInclude[entry[0]] || HEADERS_TO_IGNORE[entry[0]] == null && !extraHeadersToIgnore[entry[0]];
      }).sort(function(a, b) {
        return a[0] < b[0] ? -1 : 1;
      });
    };
    RequestSigner.prototype.canonicalHeaders = function() {
      if (!this.filteredHeaders)
        this.filterHeaders();
      return this.filteredHeaders.map(function(entry) {
        return entry[0] + ":" + entry[1].toString().trim().replace(/\s+/g, " ");
      }).join("\n");
    };
    RequestSigner.prototype.signedHeaders = function() {
      if (!this.filteredHeaders)
        this.filterHeaders();
      return this.filteredHeaders.map(function(entry) {
        return entry[0];
      }).join(";");
    };
    RequestSigner.prototype.credentialString = function() {
      return [
        this.getDate(),
        this.region,
        this.service,
        "aws4_request"
      ].join("/");
    };
    RequestSigner.prototype.defaultCredentials = function() {
      var env2 = process.env;
      return {
        accessKeyId: env2.AWS_ACCESS_KEY_ID || env2.AWS_ACCESS_KEY,
        secretAccessKey: env2.AWS_SECRET_ACCESS_KEY || env2.AWS_SECRET_KEY,
        sessionToken: env2.AWS_SESSION_TOKEN
      };
    };
    RequestSigner.prototype.parsePath = function() {
      var path4 = this.request.path || "/";
      if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path4)) {
        path4 = encodeURI(decodeURI(path4));
      }
      var queryIx = path4.indexOf("?"), query = null;
      if (queryIx >= 0) {
        query = querystring.parse(path4.slice(queryIx + 1));
        path4 = path4.slice(0, queryIx);
      }
      this.parsedPath = {
        path: path4,
        query
      };
    };
    RequestSigner.prototype.formatPath = function() {
      var path4 = this.parsedPath.path, query = this.parsedPath.query;
      if (!query)
        return path4;
      if (query[""] != null)
        delete query[""];
      return path4 + "?" + encodeRfc3986(querystring.stringify(query));
    };
    aws4.RequestSigner = RequestSigner;
    aws4.sign = function(request, credentials) {
      return new RequestSigner(request, credentials).sign();
    };
  }
});

// node_modules/assert-plus/assert.js
var require_assert = __commonJS({
  "node_modules/assert-plus/assert.js"(exports2, module2) {
    var assert = require("assert");
    var Stream = require("stream").Stream;
    var util = require("util");
    var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
    function _capitalize(str) {
      return str.charAt(0).toUpperCase() + str.slice(1);
    }
    function _toss(name, expected, oper, arg, actual) {
      throw new assert.AssertionError({
        message: util.format("%s (%s) is required", name, expected),
        actual: actual === void 0 ? typeof arg : actual(arg),
        expected,
        operator: oper || "===",
        stackStartFunction: _toss.caller
      });
    }
    function _getClass(arg) {
      return Object.prototype.toString.call(arg).slice(8, -1);
    }
    function noop() {
    }
    var types = {
      bool: {
        check: function(arg) {
          return typeof arg === "boolean";
        }
      },
      func: {
        check: function(arg) {
          return typeof arg === "function";
        }
      },
      string: {
        check: function(arg) {
          return typeof arg === "string";
        }
      },
      object: {
        check: function(arg) {
          return typeof arg === "object" && arg !== null;
        }
      },
      number: {
        check: function(arg) {
          return typeof arg === "number" && !isNaN(arg);
        }
      },
      finite: {
        check: function(arg) {
          return typeof arg === "number" && !isNaN(arg) && isFinite(arg);
        }
      },
      buffer: {
        check: function(arg) {
          return Buffer.isBuffer(arg);
        },
        operator: "Buffer.isBuffer"
      },
      array: {
        check: function(arg) {
          return Array.isArray(arg);
        },
        operator: "Array.isArray"
      },
      stream: {
        check: function(arg) {
          return arg instanceof Stream;
        },
        operator: "instanceof",
        actual: _getClass
      },
      date: {
        check: function(arg) {
          return arg instanceof Date;
        },
        operator: "instanceof",
        actual: _getClass
      },
      regexp: {
        check: function(arg) {
          return arg instanceof RegExp;
        },
        operator: "instanceof",
        actual: _getClass
      },
      uuid: {
        check: function(arg) {
          return typeof arg === "string" && UUID_REGEXP.test(arg);
        },
        operator: "isUUID"
      }
    };
    function _setExports(ndebug) {
      var keys = Object.keys(types);
      var out;
      if (process.env.NODE_NDEBUG) {
        out = noop;
      } else {
        out = function(arg, msg) {
          if (!arg) {
            _toss(msg, "true", arg);
          }
        };
      }
      keys.forEach(function(k) {
        if (ndebug) {
          out[k] = noop;
          return;
        }
        var type = types[k];
        out[k] = function(arg, msg) {
          if (!type.check(arg)) {
            _toss(msg, k, type.operator, arg, type.actual);
          }
        };
      });
      keys.forEach(function(k) {
        var name = "optional" + _capitalize(k);
        if (ndebug) {
          out[name] = noop;
          return;
        }
        var type = types[k];
        out[name] = function(arg, msg) {
          if (arg === void 0 || arg === null) {
            return;
          }
          if (!type.check(arg)) {
            _toss(msg, k, type.operator, arg, type.actual);
          }
        };
      });
      keys.forEach(function(k) {
        var name = "arrayOf" + _capitalize(k);
        if (ndebug) {
          out[name] = noop;
          return;
        }
        var type = types[k];
        var expected = "[" + k + "]";
        out[name] = function(arg, msg) {
          if (!Array.isArray(arg)) {
            _toss(msg, expected, type.operator, arg, type.actual);
          }
          var i;
          for (i = 0; i < arg.length; i++) {
            if (!type.check(arg[i])) {
              _toss(msg, expected, type.operator, arg, type.actual);
            }
          }
        };
      });
      keys.forEach(function(k) {
        var name = "optionalArrayOf" + _capitalize(k);
        if (ndebug) {
          out[name] = noop;
          return;
        }
        var type = types[k];
        var expected = "[" + k + "]";
        out[name] = function(arg, msg) {
          if (arg === void 0 || arg === null) {
            return;
          }
          if (!Array.isArray(arg)) {
            _toss(msg, expected, type.operator, arg, type.actual);
          }
          var i;
          for (i = 0; i < arg.length; i++) {
            if (!type.check(arg[i])) {
              _toss(msg, expected, type.operator, arg, type.actual);
            }
          }
        };
      });
      Object.keys(assert).forEach(function(k) {
        if (k === "AssertionError") {
          out[k] = assert[k];
          return;
        }
        if (ndebug) {
          out[k] = noop;
          return;
        }
        out[k] = assert[k];
      });
      out._setExports = _setExports;
      return out;
    }
    module2.exports = _setExports(process.env.NODE_NDEBUG);
  }
});

// node_modules/safer-buffer/safer.js
var require_safer = __commonJS({
  "node_modules/safer-buffer/safer.js"(exports2, module2) {
    "use strict";
    var buffer = require("buffer");
    var Buffer3 = buffer.Buffer;
    var safer = {};
    var key;
    for (key in buffer) {
      if (!buffer.hasOwnProperty(key))
        continue;
      if (key === "SlowBuffer" || key === "Buffer")
        continue;
      safer[key] = buffer[key];
    }
    var Safer = safer.Buffer = {};
    for (key in Buffer3) {
      if (!Buffer3.hasOwnProperty(key))
        continue;
      if (key === "allocUnsafe" || key === "allocUnsafeSlow")
        continue;
      Safer[key] = Buffer3[key];
    }
    safer.Buffer.prototype = Buffer3.prototype;
    if (!Safer.from || Safer.from === Uint8Array.from) {
      Safer.from = function(value, encodingOrOffset, length) {
        if (typeof value === "number") {
          throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value);
        }
        if (value && typeof value.length === "undefined") {
          throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
        }
        return Buffer3(value, encodingOrOffset, length);
      };
    }
    if (!Safer.alloc) {
      Safer.alloc = function(size, fill, encoding) {
        if (typeof size !== "number") {
          throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size);
        }
        if (size < 0 || size >= 2 * (1 << 30)) {
          throw new RangeError('The value "' + size + '" is invalid for option "size"');
        }
        var buf = Buffer3(size);
        if (!fill || fill.length === 0) {
          buf.fill(0);
        } else if (typeof encoding === "string") {
          buf.fill(fill, encoding);
        } else {
          buf.fill(fill);
        }
        return buf;
      };
    }
    if (!safer.kStringMaxLength) {
      try {
        safer.kStringMaxLength = process.binding("buffer").kStringMaxLength;
      } catch (e) {
      }
    }
    if (!safer.constants) {
      safer.constants = {
        MAX_LENGTH: safer.kMaxLength
      };
      if (safer.kStringMaxLength) {
        safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength;
      }
    }
    module2.exports = safer;
  }
});

// node_modules/sshpk/lib/algs.js
var require_algs = __commonJS({
  "node_modules/sshpk/lib/algs.js"(exports2, module2) {
    var Buffer3 = require_safer().Buffer;
    var algInfo = {
      "dsa": {
        parts: ["p", "q", "g", "y"],
        sizePart: "p"
      },
      "rsa": {
        parts: ["e", "n"],
        sizePart: "n"
      },
      "ecdsa": {
        parts: ["curve", "Q"],
        sizePart: "Q"
      },
      "ed25519": {
        parts: ["A"],
        sizePart: "A"
      }
    };
    algInfo["curve25519"] = algInfo["ed25519"];
    var algPrivInfo = {
      "dsa": {
        parts: ["p", "q", "g", "y", "x"]
      },
      "rsa": {
        parts: ["n", "e", "d", "iqmp", "p", "q"]
      },
      "ecdsa": {
        parts: ["curve", "Q", "d"]
      },
      "ed25519": {
        parts: ["A", "k"]
      }
    };
    algPrivInfo["curve25519"] = algPrivInfo["ed25519"];
    var hashAlgs = {
      "md5": true,
      "sha1": true,
      "sha256": true,
      "sha384": true,
      "sha512": true
    };
    var curves = {
      "nistp256": {
        size: 256,
        pkcs8oid: "1.2.840.10045.3.1.7",
        p: Buffer3.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g, ""), "hex"),
        a: Buffer3.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g, ""), "hex"),
        b: Buffer3.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g, ""), "hex"),
        s: Buffer3.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g, ""), "hex"),
        n: Buffer3.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g, ""), "hex"),
        G: Buffer3.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g, ""), "hex")
      },
      "nistp384": {
        size: 384,
        pkcs8oid: "1.3.132.0.34",
        p: Buffer3.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g, ""), "hex"),
        a: Buffer3.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g, ""), "hex"),
        b: Buffer3.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g, ""), "hex"),
        s: Buffer3.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g, ""), "hex"),
        n: Buffer3.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g, ""), "hex"),
        G: Buffer3.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g, ""), "hex")
      },
      "nistp521": {
        size: 521,
        pkcs8oid: "1.3.132.0.35",
        p: Buffer3.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g, ""), "hex"),
        a: Buffer3.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g, ""), "hex"),
        b: Buffer3.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g, ""), "hex"),
        s: Buffer3.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g, ""), "hex"),
        n: Buffer3.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g, ""), "hex"),
        G: Buffer3.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g, ""), "hex")
      }
    };
    module2.exports = {
      info: algInfo,
      privInfo: algPrivInfo,
      hashAlgs,
      curves
    };
  }
});

// node_modules/sshpk/lib/errors.js
var require_errors5 = __commonJS({
  "node_modules/sshpk/lib/errors.js"(exports2, module2) {
    var assert = require_assert();
    var util = require("util");
    function FingerprintFormatError(fp, format) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, FingerprintFormatError);
      this.name = "FingerprintFormatError";
      this.fingerprint = fp;
      this.format = format;
      this.message = "Fingerprint format is not supported, or is invalid: ";
      if (fp !== void 0)
        this.message += " fingerprint = " + fp;
      if (format !== void 0)
        this.message += " format = " + format;
    }
    util.inherits(FingerprintFormatError, Error);
    function InvalidAlgorithmError(alg) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, InvalidAlgorithmError);
      this.name = "InvalidAlgorithmError";
      this.algorithm = alg;
      this.message = 'Algorithm "' + alg + '" is not supported';
    }
    util.inherits(InvalidAlgorithmError, Error);
    function KeyParseError(name, format, innerErr) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, KeyParseError);
      this.name = "KeyParseError";
      this.format = format;
      this.keyName = name;
      this.innerErr = innerErr;
      this.message = "Failed to parse " + name + " as a valid " + format + " format key: " + innerErr.message;
    }
    util.inherits(KeyParseError, Error);
    function SignatureParseError(type, format, innerErr) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, SignatureParseError);
      this.name = "SignatureParseError";
      this.type = type;
      this.format = format;
      this.innerErr = innerErr;
      this.message = "Failed to parse the given data as a " + type + " signature in " + format + " format: " + innerErr.message;
    }
    util.inherits(SignatureParseError, Error);
    function CertificateParseError(name, format, innerErr) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, CertificateParseError);
      this.name = "CertificateParseError";
      this.format = format;
      this.certName = name;
      this.innerErr = innerErr;
      this.message = "Failed to parse " + name + " as a valid " + format + " format certificate: " + innerErr.message;
    }
    util.inherits(CertificateParseError, Error);
    function KeyEncryptedError(name, format) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, KeyEncryptedError);
      this.name = "KeyEncryptedError";
      this.format = format;
      this.keyName = name;
      this.message = "The " + format + " format key " + name + " is encrypted (password-protected), and no passphrase was provided in `options`";
    }
    util.inherits(KeyEncryptedError, Error);
    module2.exports = {
      FingerprintFormatError,
      InvalidAlgorithmError,
      KeyParseError,
      SignatureParseError,
      KeyEncryptedError,
      CertificateParseError
    };
  }
});

// node_modules/asn1/lib/ber/errors.js
var require_errors6 = __commonJS({
  "node_modules/asn1/lib/ber/errors.js"(exports2, module2) {
    module2.exports = {
      newInvalidAsn1Error: function(msg) {
        var e = new Error();
        e.name = "InvalidAsn1Error";
        e.message = msg || "";
        return e;
      }
    };
  }
});

// node_modules/asn1/lib/ber/types.js
var require_types = __commonJS({
  "node_modules/asn1/lib/ber/types.js"(exports2, module2) {
    module2.exports = {
      EOC: 0,
      Boolean: 1,
      Integer: 2,
      BitString: 3,
      OctetString: 4,
      Null: 5,
      OID: 6,
      ObjectDescriptor: 7,
      External: 8,
      Real: 9,
      // float
      Enumeration: 10,
      PDV: 11,
      Utf8String: 12,
      RelativeOID: 13,
      Sequence: 16,
      Set: 17,
      NumericString: 18,
      PrintableString: 19,
      T61String: 20,
      VideotexString: 21,
      IA5String: 22,
      UTCTime: 23,
      GeneralizedTime: 24,
      GraphicString: 25,
      VisibleString: 26,
      GeneralString: 28,
      UniversalString: 29,
      CharacterString: 30,
      BMPString: 31,
      Constructor: 32,
      Context: 128
    };
  }
});

// node_modules/asn1/lib/ber/reader.js
var require_reader = __commonJS({
  "node_modules/asn1/lib/ber/reader.js"(exports2, module2) {
    var assert = require("assert");
    var Buffer3 = require_safer().Buffer;
    var ASN1 = require_types();
    var errors = require_errors6();
    var newInvalidAsn1Error = errors.newInvalidAsn1Error;
    function Reader(data) {
      if (!data || !Buffer3.isBuffer(data))
        throw new TypeError("data must be a node Buffer");
      this._buf = data;
      this._size = data.length;
      this._len = 0;
      this._offset = 0;
    }
    Object.defineProperty(Reader.prototype, "length", {
      enumerable: true,
      get: function() {
        return this._len;
      }
    });
    Object.defineProperty(Reader.prototype, "offset", {
      enumerable: true,
      get: function() {
        return this._offset;
      }
    });
    Object.defineProperty(Reader.prototype, "remain", {
      get: function() {
        return this._size - this._offset;
      }
    });
    Object.defineProperty(Reader.prototype, "buffer", {
      get: function() {
        return this._buf.slice(this._offset);
      }
    });
    Reader.prototype.readByte = function(peek) {
      if (this._size - this._offset < 1)
        return null;
      var b = this._buf[this._offset] & 255;
      if (!peek)
        this._offset += 1;
      return b;
    };
    Reader.prototype.peek = function() {
      return this.readByte(true);
    };
    Reader.prototype.readLength = function(offset2) {
      if (offset2 === void 0)
        offset2 = this._offset;
      if (offset2 >= this._size)
        return null;
      var lenB = this._buf[offset2++] & 255;
      if (lenB === null)
        return null;
      if ((lenB & 128) === 128) {
        lenB &= 127;
        if (lenB === 0)
          throw newInvalidAsn1Error("Indefinite length not supported");
        if (lenB > 4)
          throw newInvalidAsn1Error("encoding too long");
        if (this._size - offset2 < lenB)
          return null;
        this._len = 0;
        for (var i = 0; i < lenB; i++)
          this._len = (this._len << 8) + (this._buf[offset2++] & 255);
      } else {
        this._len = lenB;
      }
      return offset2;
    };
    Reader.prototype.readSequence = function(tag) {
      var seq = this.peek();
      if (seq === null)
        return null;
      if (tag !== void 0 && tag !== seq)
        throw newInvalidAsn1Error("Expected 0x" + tag.toString(16) + ": got 0x" + seq.toString(16));
      var o = this.readLength(this._offset + 1);
      if (o === null)
        return null;
      this._offset = o;
      return seq;
    };
    Reader.prototype.readInt = function() {
      return this._readTag(ASN1.Integer);
    };
    Reader.prototype.readBoolean = function() {
      return this._readTag(ASN1.Boolean) === 0 ? false : true;
    };
    Reader.prototype.readEnumeration = function() {
      return this._readTag(ASN1.Enumeration);
    };
    Reader.prototype.readString = function(tag, retbuf) {
      if (!tag)
        tag = ASN1.OctetString;
      var b = this.peek();
      if (b === null)
        return null;
      if (b !== tag)
        throw newInvalidAsn1Error("Expected 0x" + tag.toString(16) + ": got 0x" + b.toString(16));
      var o = this.readLength(this._offset + 1);
      if (o === null)
        return null;
      if (this.length > this._size - o)
        return null;
      this._offset = o;
      if (this.length === 0)
        return retbuf ? Buffer3.alloc(0) : "";
      var str = this._buf.slice(this._offset, this._offset + this.length);
      this._offset += this.length;
      return retbuf ? str : str.toString("utf8");
    };
    Reader.prototype.readOID = function(tag) {
      if (!tag)
        tag = ASN1.OID;
      var b = this.readString(tag, true);
      if (b === null)
        return null;
      var values = [];
      var value = 0;
      for (var i = 0; i < b.length; i++) {
        var byte = b[i] & 255;
        value <<= 7;
        value += byte & 127;
        if ((byte & 128) === 0) {
          values.push(value);
          value = 0;
        }
      }
      value = values.shift();
      values.unshift(value % 40);
      values.unshift(value / 40 >> 0);
      return values.join(".");
    };
    Reader.prototype._readTag = function(tag) {
      assert.ok(tag !== void 0);
      var b = this.peek();
      if (b === null)
        return null;
      if (b !== tag)
        throw newInvalidAsn1Error("Expected 0x" + tag.toString(16) + ": got 0x" + b.toString(16));
      var o = this.readLength(this._offset + 1);
      if (o === null)
        return null;
      if (this.length > 4)
        throw newInvalidAsn1Error("Integer too long: " + this.length);
      if (this.length > this._size - o)
        return null;
      this._offset = o;
      var fb = this._buf[this._offset];
      var value = 0;
      for (var i = 0; i < this.length; i++) {
        value <<= 8;
        value |= this._buf[this._offset++] & 255;
      }
      if ((fb & 128) === 128 && i !== 4)
        value -= 1 << i * 8;
      return value >> 0;
    };
    module2.exports = Reader;
  }
});

// node_modules/asn1/lib/ber/writer.js
var require_writer = __commonJS({
  "node_modules/asn1/lib/ber/writer.js"(exports2, module2) {
    var assert = require("assert");
    var Buffer3 = require_safer().Buffer;
    var ASN1 = require_types();
    var errors = require_errors6();
    var newInvalidAsn1Error = errors.newInvalidAsn1Error;
    var DEFAULT_OPTS = {
      size: 1024,
      growthFactor: 8
    };
    function merge(from, to) {
      assert.ok(from);
      assert.equal(typeof from, "object");
      assert.ok(to);
      assert.equal(typeof to, "object");
      var keys = Object.getOwnPropertyNames(from);
      keys.forEach(function(key) {
        if (to[key])
          return;
        var value = Object.getOwnPropertyDescriptor(from, key);
        Object.defineProperty(to, key, value);
      });
      return to;
    }
    function Writer(options) {
      options = merge(DEFAULT_OPTS, options || {});
      this._buf = Buffer3.alloc(options.size || 1024);
      this._size = this._buf.length;
      this._offset = 0;
      this._options = options;
      this._seq = [];
    }
    Object.defineProperty(Writer.prototype, "buffer", {
      get: function() {
        if (this._seq.length)
          throw newInvalidAsn1Error(this._seq.length + " unended sequence(s)");
        return this._buf.slice(0, this._offset);
      }
    });
    Writer.prototype.writeByte = function(b) {
      if (typeof b !== "number")
        throw new TypeError("argument must be a Number");
      this._ensure(1);
      this._buf[this._offset++] = b;
    };
    Writer.prototype.writeInt = function(i, tag) {
      if (typeof i !== "number")
        throw new TypeError("argument must be a Number");
      if (typeof tag !== "number")
        tag = ASN1.Integer;
      var sz = 4;
      while (((i & 4286578688) === 0 || (i & 4286578688) === 4286578688 >> 0) && sz > 1) {
        sz--;
        i <<= 8;
      }
      if (sz > 4)
        throw newInvalidAsn1Error("BER ints cannot be > 0xffffffff");
      this._ensure(2 + sz);
      this._buf[this._offset++] = tag;
      this._buf[this._offset++] = sz;
      while (sz-- > 0) {
        this._buf[this._offset++] = (i & 4278190080) >>> 24;
        i <<= 8;
      }
    };
    Writer.prototype.writeNull = function() {
      this.writeByte(ASN1.Null);
      this.writeByte(0);
    };
    Writer.prototype.writeEnumeration = function(i, tag) {
      if (typeof i !== "number")
        throw new TypeError("argument must be a Number");
      if (typeof tag !== "number")
        tag = ASN1.Enumeration;
      return this.writeInt(i, tag);
    };
    Writer.prototype.writeBoolean = function(b, tag) {
      if (typeof b !== "boolean")
        throw new TypeError("argument must be a Boolean");
      if (typeof tag !== "number")
        tag = ASN1.Boolean;
      this._ensure(3);
      this._buf[this._offset++] = tag;
      this._buf[this._offset++] = 1;
      this._buf[this._offset++] = b ? 255 : 0;
    };
    Writer.prototype.writeString = function(s, tag) {
      if (typeof s !== "string")
        throw new TypeError("argument must be a string (was: " + typeof s + ")");
      if (typeof tag !== "number")
        tag = ASN1.OctetString;
      var len = Buffer3.byteLength(s);
      this.writeByte(tag);
      this.writeLength(len);
      if (len) {
        this._ensure(len);
        this._buf.write(s, this._offset);
        this._offset += len;
      }
    };
    Writer.prototype.writeBuffer = function(buf, tag) {
      if (typeof tag !== "number")
        throw new TypeError("tag must be a number");
      if (!Buffer3.isBuffer(buf))
        throw new TypeError("argument must be a buffer");
      this.writeByte(tag);
      this.writeLength(buf.length);
      this._ensure(buf.length);
      buf.copy(this._buf, this._offset, 0, buf.length);
      this._offset += buf.length;
    };
    Writer.prototype.writeStringArray = function(strings) {
      if (!strings instanceof Array)
        throw new TypeError("argument must be an Array[String]");
      var self2 = this;
      strings.forEach(function(s) {
        self2.writeString(s);
      });
    };
    Writer.prototype.writeOID = function(s, tag) {
      if (typeof s !== "string")
        throw new TypeError("argument must be a string");
      if (typeof tag !== "number")
        tag = ASN1.OID;
      if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
        throw new Error("argument is not a valid OID string");
      function encodeOctet(bytes2, octet) {
        if (octet < 128) {
          bytes2.push(octet);
        } else if (octet < 16384) {
          bytes2.push(octet >>> 7 | 128);
          bytes2.push(octet & 127);
        } else if (octet < 2097152) {
          bytes2.push(octet >>> 14 | 128);
          bytes2.push((octet >>> 7 | 128) & 255);
          bytes2.push(octet & 127);
        } else if (octet < 268435456) {
          bytes2.push(octet >>> 21 | 128);
          bytes2.push((octet >>> 14 | 128) & 255);
          bytes2.push((octet >>> 7 | 128) & 255);
          bytes2.push(octet & 127);
        } else {
          bytes2.push((octet >>> 28 | 128) & 255);
          bytes2.push((octet >>> 21 | 128) & 255);
          bytes2.push((octet >>> 14 | 128) & 255);
          bytes2.push((octet >>> 7 | 128) & 255);
          bytes2.push(octet & 127);
        }
      }
      var tmp = s.split(".");
      var bytes = [];
      bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
      tmp.slice(2).forEach(function(b) {
        encodeOctet(bytes, parseInt(b, 10));
      });
      var self2 = this;
      this._ensure(2 + bytes.length);
      this.writeByte(tag);
      this.writeLength(bytes.length);
      bytes.forEach(function(b) {
        self2.writeByte(b);
      });
    };
    Writer.prototype.writeLength = function(len) {
      if (typeof len !== "number")
        throw new TypeError("argument must be a Number");
      this._ensure(4);
      if (len <= 127) {
        this._buf[this._offset++] = len;
      } else if (len <= 255) {
        this._buf[this._offset++] = 129;
        this._buf[this._offset++] = len;
      } else if (len <= 65535) {
        this._buf[this._offset++] = 130;
        this._buf[this._offset++] = len >> 8;
        this._buf[this._offset++] = len;
      } else if (len <= 16777215) {
        this._buf[this._offset++] = 131;
        this._buf[this._offset++] = len >> 16;
        this._buf[this._offset++] = len >> 8;
        this._buf[this._offset++] = len;
      } else {
        throw newInvalidAsn1Error("Length too long (> 4 bytes)");
      }
    };
    Writer.prototype.startSequence = function(tag) {
      if (typeof tag !== "number")
        tag = ASN1.Sequence | ASN1.Constructor;
      this.writeByte(tag);
      this._seq.push(this._offset);
      this._ensure(3);
      this._offset += 3;
    };
    Writer.prototype.endSequence = function() {
      var seq = this._seq.pop();
      var start2 = seq + 3;
      var len = this._offset - start2;
      if (len <= 127) {
        this._shift(start2, len, -2);
        this._buf[seq] = len;
      } else if (len <= 255) {
        this._shift(start2, len, -1);
        this._buf[seq] = 129;
        this._buf[seq + 1] = len;
      } else if (len <= 65535) {
        this._buf[seq] = 130;
        this._buf[seq + 1] = len >> 8;
        this._buf[seq + 2] = len;
      } else if (len <= 16777215) {
        this._shift(start2, len, 1);
        this._buf[seq] = 131;
        this._buf[seq + 1] = len >> 16;
        this._buf[seq + 2] = len >> 8;
        this._buf[seq + 3] = len;
      } else {
        throw newInvalidAsn1Error("Sequence too long");
      }
    };
    Writer.prototype._shift = function(start2, len, shift) {
      assert.ok(start2 !== void 0);
      assert.ok(len !== void 0);
      assert.ok(shift);
      this._buf.copy(this._buf, start2 + shift, start2, start2 + len);
      this._offset += shift;
    };
    Writer.prototype._ensure = function(len) {
      assert.ok(len);
      if (this._size - this._offset < len) {
        var sz = this._size * this._options.growthFactor;
        if (sz - this._offset < len)
          sz += len;
        var buf = Buffer3.alloc(sz);
        this._buf.copy(buf, 0, 0, this._offset);
        this._buf = buf;
        this._size = sz;
      }
    };
    module2.exports = Writer;
  }
});

// node_modules/asn1/lib/ber/index.js
var require_ber = __commonJS({
  "node_modules/asn1/lib/ber/index.js"(exports2, module2) {
    var errors = require_errors6();
    var types = require_types();
    var Reader = require_reader();
    var Writer = require_writer();
    module2.exports = {
      Reader,
      Writer
    };
    for (t in types) {
      if (types.hasOwnProperty(t))
        module2.exports[t] = types[t];
    }
    var t;
    for (e in errors) {
      if (errors.hasOwnProperty(e))
        module2.exports[e] = errors[e];
    }
    var e;
  }
});

// node_modules/asn1/lib/index.js
var require_lib9 = __commonJS({
  "node_modules/asn1/lib/index.js"(exports2, module2) {
    var Ber = require_ber();
    module2.exports = {
      Ber,
      BerReader: Ber.Reader,
      BerWriter: Ber.Writer
    };
  }
});

// node_modules/jsbn/index.js
var require_jsbn = __commonJS({
  "node_modules/jsbn/index.js"(exports2, module2) {
    (function() {
      var dbits;
      var canary = 244837814094590;
      var j_lm = (canary & 16777215) == 15715070;
      function BigInteger(a, b, c) {
        if (a != null)
          if ("number" == typeof a)
            this.fromNumber(a, b, c);
          else if (b == null && "string" != typeof a)
            this.fromString(a, 256);
          else
            this.fromString(a, b);
      }
      function nbi() {
        return new BigInteger(null);
      }
      function am1(i, x, w, j, c, n) {
        while (--n >= 0) {
          var v = x * this[i++] + w[j] + c;
          c = Math.floor(v / 67108864);
          w[j++] = v & 67108863;
        }
        return c;
      }
      function am2(i, x, w, j, c, n) {
        var xl = x & 32767, xh = x >> 15;
        while (--n >= 0) {
          var l = this[i] & 32767;
          var h = this[i++] >> 15;
          var m = xh * l + h * xl;
          l = xl * l + ((m & 32767) << 15) + w[j] + (c & 1073741823);
          c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);
          w[j++] = l & 1073741823;
        }
        return c;
      }
      function am3(i, x, w, j, c, n) {
        var xl = x & 16383, xh = x >> 14;
        while (--n >= 0) {
          var l = this[i] & 16383;
          var h = this[i++] >> 14;
          var m = xh * l + h * xl;
          l = xl * l + ((m & 16383) << 14) + w[j] + c;
          c = (l >> 28) + (m >> 14) + xh * h;
          w[j++] = l & 268435455;
        }
        return c;
      }
      var inBrowser = typeof navigator !== "undefined";
      if (inBrowser && j_lm && navigator.appName == "Microsoft Internet Explorer") {
        BigInteger.prototype.am = am2;
        dbits = 30;
      } else if (inBrowser && j_lm && navigator.appName != "Netscape") {
        BigInteger.prototype.am = am1;
        dbits = 26;
      } else {
        BigInteger.prototype.am = am3;
        dbits = 28;
      }
      BigInteger.prototype.DB = dbits;
      BigInteger.prototype.DM = (1 << dbits) - 1;
      BigInteger.prototype.DV = 1 << dbits;
      var BI_FP = 52;
      BigInteger.prototype.FV = Math.pow(2, BI_FP);
      BigInteger.prototype.F1 = BI_FP - dbits;
      BigInteger.prototype.F2 = 2 * dbits - BI_FP;
      var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
      var BI_RC = new Array();
      var rr, vv;
      rr = "0".charCodeAt(0);
      for (vv = 0; vv <= 9; ++vv)
        BI_RC[rr++] = vv;
      rr = "a".charCodeAt(0);
      for (vv = 10; vv < 36; ++vv)
        BI_RC[rr++] = vv;
      rr = "A".charCodeAt(0);
      for (vv = 10; vv < 36; ++vv)
        BI_RC[rr++] = vv;
      function int2char(n) {
        return BI_RM.charAt(n);
      }
      function intAt(s, i) {
        var c = BI_RC[s.charCodeAt(i)];
        return c == null ? -1 : c;
      }
      function bnpCopyTo(r) {
        for (var i = this.t - 1; i >= 0; --i)
          r[i] = this[i];
        r.t = this.t;
        r.s = this.s;
      }
      function bnpFromInt(x) {
        this.t = 1;
        this.s = x < 0 ? -1 : 0;
        if (x > 0)
          this[0] = x;
        else if (x < -1)
          this[0] = x + this.DV;
        else
          this.t = 0;
      }
      function nbv(i) {
        var r = nbi();
        r.fromInt(i);
        return r;
      }
      function bnpFromString(s, b) {
        var k;
        if (b == 16)
          k = 4;
        else if (b == 8)
          k = 3;
        else if (b == 256)
          k = 8;
        else if (b == 2)
          k = 1;
        else if (b == 32)
          k = 5;
        else if (b == 4)
          k = 2;
        else {
          this.fromRadix(s, b);
          return;
        }
        this.t = 0;
        this.s = 0;
        var i = s.length, mi = false, sh = 0;
        while (--i >= 0) {
          var x = k == 8 ? s[i] & 255 : intAt(s, i);
          if (x < 0) {
            if (s.charAt(i) == "-")
              mi = true;
            continue;
          }
          mi = false;
          if (sh == 0)
            this[this.t++] = x;
          else if (sh + k > this.DB) {
            this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;
            this[this.t++] = x >> this.DB - sh;
          } else
            this[this.t - 1] |= x << sh;
          sh += k;
          if (sh >= this.DB)
            sh -= this.DB;
        }
        if (k == 8 && (s[0] & 128) != 0) {
          this.s = -1;
          if (sh > 0)
            this[this.t - 1] |= (1 << this.DB - sh) - 1 << sh;
        }
        this.clamp();
        if (mi)
          BigInteger.ZERO.subTo(this, this);
      }
      function bnpClamp() {
        var c = this.s & this.DM;
        while (this.t > 0 && this[this.t - 1] == c)
          --this.t;
      }
      function bnToString(b) {
        if (this.s < 0)
          return "-" + this.negate().toString(b);
        var k;
        if (b == 16)
          k = 4;
        else if (b == 8)
          k = 3;
        else if (b == 2)
          k = 1;
        else if (b == 32)
          k = 5;
        else if (b == 4)
          k = 2;
        else
          return this.toRadix(b);
        var km = (1 << k) - 1, d, m = false, r = "", i = this.t;
        var p = this.DB - i * this.DB % k;
        if (i-- > 0) {
          if (p < this.DB && (d = this[i] >> p) > 0) {
            m = true;
            r = int2char(d);
          }
          while (i >= 0) {
            if (p < k) {
              d = (this[i] & (1 << p) - 1) << k - p;
              d |= this[--i] >> (p += this.DB - k);
            } else {
              d = this[i] >> (p -= k) & km;
              if (p <= 0) {
                p += this.DB;
                --i;
              }
            }
            if (d > 0)
              m = true;
            if (m)
              r += int2char(d);
          }
        }
        return m ? r : "0";
      }
      function bnNegate() {
        var r = nbi();
        BigInteger.ZERO.subTo(this, r);
        return r;
      }
      function bnAbs() {
        return this.s < 0 ? this.negate() : this;
      }
      function bnCompareTo(a) {
        var r = this.s - a.s;
        if (r != 0)
          return r;
        var i = this.t;
        r = i - a.t;
        if (r != 0)
          return this.s < 0 ? -r : r;
        while (--i >= 0)
          if ((r = this[i] - a[i]) != 0)
            return r;
        return 0;
      }
      function nbits(x) {
        var r = 1, t2;
        if ((t2 = x >>> 16) != 0) {
          x = t2;
          r += 16;
        }
        if ((t2 = x >> 8) != 0) {
          x = t2;
          r += 8;
        }
        if ((t2 = x >> 4) != 0) {
          x = t2;
          r += 4;
        }
        if ((t2 = x >> 2) != 0) {
          x = t2;
          r += 2;
        }
        if ((t2 = x >> 1) != 0) {
          x = t2;
          r += 1;
        }
        return r;
      }
      function bnBitLength() {
        if (this.t <= 0)
          return 0;
        return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);
      }
      function bnpDLShiftTo(n, r) {
        var i;
        for (i = this.t - 1; i >= 0; --i)
          r[i + n] = this[i];
        for (i = n - 1; i >= 0; --i)
          r[i] = 0;
        r.t = this.t + n;
        r.s = this.s;
      }
      function bnpDRShiftTo(n, r) {
        for (var i = n; i < this.t; ++i)
          r[i - n] = this[i];
        r.t = Math.max(this.t - n, 0);
        r.s = this.s;
      }
      function bnpLShiftTo(n, r) {
        var bs = n % this.DB;
        var cbs = this.DB - bs;
        var bm = (1 << cbs) - 1;
        var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;
        for (i = this.t - 1; i >= 0; --i) {
          r[i + ds + 1] = this[i] >> cbs | c;
          c = (this[i] & bm) << bs;
        }
        for (i = ds - 1; i >= 0; --i)
          r[i] = 0;
        r[ds] = c;
        r.t = this.t + ds + 1;
        r.s = this.s;
        r.clamp();
      }
      function bnpRShiftTo(n, r) {
        r.s = this.s;
        var ds = Math.floor(n / this.DB);
        if (ds >= this.t) {
          r.t = 0;
          return;
        }
        var bs = n % this.DB;
        var cbs = this.DB - bs;
        var bm = (1 << bs) - 1;
        r[0] = this[ds] >> bs;
        for (var i = ds + 1; i < this.t; ++i) {
          r[i - ds - 1] |= (this[i] & bm) << cbs;
          r[i - ds] = this[i] >> bs;
        }
        if (bs > 0)
          r[this.t - ds - 1] |= (this.s & bm) << cbs;
        r.t = this.t - ds;
        r.clamp();
      }
      function bnpSubTo(a, r) {
        var i = 0, c = 0, m = Math.min(a.t, this.t);
        while (i < m) {
          c += this[i] - a[i];
          r[i++] = c & this.DM;
          c >>= this.DB;
        }
        if (a.t < this.t) {
          c -= a.s;
          while (i < this.t) {
            c += this[i];
            r[i++] = c & this.DM;
            c >>= this.DB;
          }
          c += this.s;
        } else {
          c += this.s;
          while (i < a.t) {
            c -= a[i];
            r[i++] = c & this.DM;
            c >>= this.DB;
          }
          c -= a.s;
        }
        r.s = c < 0 ? -1 : 0;
        if (c < -1)
          r[i++] = this.DV + c;
        else if (c > 0)
          r[i++] = c;
        r.t = i;
        r.clamp();
      }
      function bnpMultiplyTo(a, r) {
        var x = this.abs(), y = a.abs();
        var i = x.t;
        r.t = i + y.t;
        while (--i >= 0)
          r[i] = 0;
        for (i = 0; i < y.t; ++i)
          r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);
        r.s = 0;
        r.clamp();
        if (this.s != a.s)
          BigInteger.ZERO.subTo(r, r);
      }
      function bnpSquareTo(r) {
        var x = this.abs();
        var i = r.t = 2 * x.t;
        while (--i >= 0)
          r[i] = 0;
        for (i = 0; i < x.t - 1; ++i) {
          var c = x.am(i, x[i], r, 2 * i, 0, 1);
          if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
            r[i + x.t] -= x.DV;
            r[i + x.t + 1] = 1;
          }
        }
        if (r.t > 0)
          r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);
        r.s = 0;
        r.clamp();
      }
      function bnpDivRemTo(m, q2, r) {
        var pm = m.abs();
        if (pm.t <= 0)
          return;
        var pt = this.abs();
        if (pt.t < pm.t) {
          if (q2 != null)
            q2.fromInt(0);
          if (r != null)
            this.copyTo(r);
          return;
        }
        if (r == null)
          r = nbi();
        var y = nbi(), ts = this.s, ms = m.s;
        var nsh = this.DB - nbits(pm[pm.t - 1]);
        if (nsh > 0) {
          pm.lShiftTo(nsh, y);
          pt.lShiftTo(nsh, r);
        } else {
          pm.copyTo(y);
          pt.copyTo(r);
        }
        var ys = y.t;
        var y0 = y[ys - 1];
        if (y0 == 0)
          return;
        var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);
        var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;
        var i = r.t, j = i - ys, t2 = q2 == null ? nbi() : q2;
        y.dlShiftTo(j, t2);
        if (r.compareTo(t2) >= 0) {
          r[r.t++] = 1;
          r.subTo(t2, r);
        }
        BigInteger.ONE.dlShiftTo(ys, t2);
        t2.subTo(y, y);
        while (y.t < ys)
          y[y.t++] = 0;
        while (--j >= 0) {
          var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);
          if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {
            y.dlShiftTo(j, t2);
            r.subTo(t2, r);
            while (r[i] < --qd)
              r.subTo(t2, r);
          }
        }
        if (q2 != null) {
          r.drShiftTo(ys, q2);
          if (ts != ms)
            BigInteger.ZERO.subTo(q2, q2);
        }
        r.t = ys;
        r.clamp();
        if (nsh > 0)
          r.rShiftTo(nsh, r);
        if (ts < 0)
          BigInteger.ZERO.subTo(r, r);
      }
      function bnMod(a) {
        var r = nbi();
        this.abs().divRemTo(a, null, r);
        if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0)
          a.subTo(r, r);
        return r;
      }
      function Classic(m) {
        this.m = m;
      }
      function cConvert(x) {
        if (x.s < 0 || x.compareTo(this.m) >= 0)
          return x.mod(this.m);
        else
          return x;
      }
      function cRevert(x) {
        return x;
      }
      function cReduce(x) {
        x.divRemTo(this.m, null, x);
      }
      function cMulTo(x, y, r) {
        x.multiplyTo(y, r);
        this.reduce(r);
      }
      function cSqrTo(x, r) {
        x.squareTo(r);
        this.reduce(r);
      }
      Classic.prototype.convert = cConvert;
      Classic.prototype.revert = cRevert;
      Classic.prototype.reduce = cReduce;
      Classic.prototype.mulTo = cMulTo;
      Classic.prototype.sqrTo = cSqrTo;
      function bnpInvDigit() {
        if (this.t < 1)
          return 0;
        var x = this[0];
        if ((x & 1) == 0)
          return 0;
        var y = x & 3;
        y = y * (2 - (x & 15) * y) & 15;
        y = y * (2 - (x & 255) * y) & 255;
        y = y * (2 - ((x & 65535) * y & 65535)) & 65535;
        y = y * (2 - x * y % this.DV) % this.DV;
        return y > 0 ? this.DV - y : -y;
      }
      function Montgomery(m) {
        this.m = m;
        this.mp = m.invDigit();
        this.mpl = this.mp & 32767;
        this.mph = this.mp >> 15;
        this.um = (1 << m.DB - 15) - 1;
        this.mt2 = 2 * m.t;
      }
      function montConvert(x) {
        var r = nbi();
        x.abs().dlShiftTo(this.m.t, r);
        r.divRemTo(this.m, null, r);
        if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0)
          this.m.subTo(r, r);
        return r;
      }
      function montRevert(x) {
        var r = nbi();
        x.copyTo(r);
        this.reduce(r);
        return r;
      }
      function montReduce(x) {
        while (x.t <= this.mt2)
          x[x.t++] = 0;
        for (var i = 0; i < this.m.t; ++i) {
          var j = x[i] & 32767;
          var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;
          j = i + this.m.t;
          x[j] += this.m.am(0, u0, x, i, 0, this.m.t);
          while (x[j] >= x.DV) {
            x[j] -= x.DV;
            x[++j]++;
          }
        }
        x.clamp();
        x.drShiftTo(this.m.t, x);
        if (x.compareTo(this.m) >= 0)
          x.subTo(this.m, x);
      }
      function montSqrTo(x, r) {
        x.squareTo(r);
        this.reduce(r);
      }
      function montMulTo(x, y, r) {
        x.multiplyTo(y, r);
        this.reduce(r);
      }
      Montgomery.prototype.convert = montConvert;
      Montgomery.prototype.revert = montRevert;
      Montgomery.prototype.reduce = montReduce;
      Montgomery.prototype.mulTo = montMulTo;
      Montgomery.prototype.sqrTo = montSqrTo;
      function bnpIsEven() {
        return (this.t > 0 ? this[0] & 1 : this.s) == 0;
      }
      function bnpExp(e, z2) {
        if (e > 4294967295 || e < 1)
          return BigInteger.ONE;
        var r = nbi(), r2 = nbi(), g = z2.convert(this), i = nbits(e) - 1;
        g.copyTo(r);
        while (--i >= 0) {
          z2.sqrTo(r, r2);
          if ((e & 1 << i) > 0)
            z2.mulTo(r2, g, r);
          else {
            var t2 = r;
            r = r2;
            r2 = t2;
          }
        }
        return z2.revert(r);
      }
      function bnModPowInt(e, m) {
        var z2;
        if (e < 256 || m.isEven())
          z2 = new Classic(m);
        else
          z2 = new Montgomery(m);
        return this.exp(e, z2);
      }
      BigInteger.prototype.copyTo = bnpCopyTo;
      BigInteger.prototype.fromInt = bnpFromInt;
      BigInteger.prototype.fromString = bnpFromString;
      BigInteger.prototype.clamp = bnpClamp;
      BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
      BigInteger.prototype.drShiftTo = bnpDRShiftTo;
      BigInteger.prototype.lShiftTo = bnpLShiftTo;
      BigInteger.prototype.rShiftTo = bnpRShiftTo;
      BigInteger.prototype.subTo = bnpSubTo;
      BigInteger.prototype.multiplyTo = bnpMultiplyTo;
      BigInteger.prototype.squareTo = bnpSquareTo;
      BigInteger.prototype.divRemTo = bnpDivRemTo;
      BigInteger.prototype.invDigit = bnpInvDigit;
      BigInteger.prototype.isEven = bnpIsEven;
      BigInteger.prototype.exp = bnpExp;
      BigInteger.prototype.toString = bnToString;
      BigInteger.prototype.negate = bnNegate;
      BigInteger.prototype.abs = bnAbs;
      BigInteger.prototype.compareTo = bnCompareTo;
      BigInteger.prototype.bitLength = bnBitLength;
      BigInteger.prototype.mod = bnMod;
      BigInteger.prototype.modPowInt = bnModPowInt;
      BigInteger.ZERO = nbv(0);
      BigInteger.ONE = nbv(1);
      function bnClone() {
        var r = nbi();
        this.copyTo(r);
        return r;
      }
      function bnIntValue() {
        if (this.s < 0) {
          if (this.t == 1)
            return this[0] - this.DV;
          else if (this.t == 0)
            return -1;
        } else if (this.t == 1)
          return this[0];
        else if (this.t == 0)
          return 0;
        return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
      }
      function bnByteValue() {
        return this.t == 0 ? this.s : this[0] << 24 >> 24;
      }
      function bnShortValue() {
        return this.t == 0 ? this.s : this[0] << 16 >> 16;
      }
      function bnpChunkSize(r) {
        return Math.floor(Math.LN2 * this.DB / Math.log(r));
      }
      function bnSigNum() {
        if (this.s < 0)
          return -1;
        else if (this.t <= 0 || this.t == 1 && this[0] <= 0)
          return 0;
        else
          return 1;
      }
      function bnpToRadix(b) {
        if (b == null)
          b = 10;
        if (this.signum() == 0 || b < 2 || b > 36)
          return "0";
        var cs = this.chunkSize(b);
        var a = Math.pow(b, cs);
        var d = nbv(a), y = nbi(), z2 = nbi(), r = "";
        this.divRemTo(d, y, z2);
        while (y.signum() > 0) {
          r = (a + z2.intValue()).toString(b).substr(1) + r;
          y.divRemTo(d, y, z2);
        }
        return z2.intValue().toString(b) + r;
      }
      function bnpFromRadix(s, b) {
        this.fromInt(0);
        if (b == null)
          b = 10;
        var cs = this.chunkSize(b);
        var d = Math.pow(b, cs), mi = false, j = 0, w = 0;
        for (var i = 0; i < s.length; ++i) {
          var x = intAt(s, i);
          if (x < 0) {
            if (s.charAt(i) == "-" && this.signum() == 0)
              mi = true;
            continue;
          }
          w = b * w + x;
          if (++j >= cs) {
            this.dMultiply(d);
            this.dAddOffset(w, 0);
            j = 0;
            w = 0;
          }
        }
        if (j > 0) {
          this.dMultiply(Math.pow(b, j));
          this.dAddOffset(w, 0);
        }
        if (mi)
          BigInteger.ZERO.subTo(this, this);
      }
      function bnpFromNumber(a, b, c) {
        if ("number" == typeof b) {
          if (a < 2)
            this.fromInt(1);
          else {
            this.fromNumber(a, c);
            if (!this.testBit(a - 1))
              this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this);
            if (this.isEven())
              this.dAddOffset(1, 0);
            while (!this.isProbablePrime(b)) {
              this.dAddOffset(2, 0);
              if (this.bitLength() > a)
                this.subTo(BigInteger.ONE.shiftLeft(a - 1), this);
            }
          }
        } else {
          var x = new Array(), t2 = a & 7;
          x.length = (a >> 3) + 1;
          b.nextBytes(x);
          if (t2 > 0)
            x[0] &= (1 << t2) - 1;
          else
            x[0] = 0;
          this.fromString(x, 256);
        }
      }
      function bnToByteArray() {
        var i = this.t, r = new Array();
        r[0] = this.s;
        var p = this.DB - i * this.DB % 8, d, k = 0;
        if (i-- > 0) {
          if (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p)
            r[k++] = d | this.s << this.DB - p;
          while (i >= 0) {
            if (p < 8) {
              d = (this[i] & (1 << p) - 1) << 8 - p;
              d |= this[--i] >> (p += this.DB - 8);
            } else {
              d = this[i] >> (p -= 8) & 255;
              if (p <= 0) {
                p += this.DB;
                --i;
              }
            }
            if ((d & 128) != 0)
              d |= -256;
            if (k == 0 && (this.s & 128) != (d & 128))
              ++k;
            if (k > 0 || d != this.s)
              r[k++] = d;
          }
        }
        return r;
      }
      function bnEquals(a) {
        return this.compareTo(a) == 0;
      }
      function bnMin(a) {
        return this.compareTo(a) < 0 ? this : a;
      }
      function bnMax(a) {
        return this.compareTo(a) > 0 ? this : a;
      }
      function bnpBitwiseTo(a, op, r) {
        var i, f2, m = Math.min(a.t, this.t);
        for (i = 0; i < m; ++i)
          r[i] = op(this[i], a[i]);
        if (a.t < this.t) {
          f2 = a.s & this.DM;
          for (i = m; i < this.t; ++i)
            r[i] = op(this[i], f2);
          r.t = this.t;
        } else {
          f2 = this.s & this.DM;
          for (i = m; i < a.t; ++i)
            r[i] = op(f2, a[i]);
          r.t = a.t;
        }
        r.s = op(this.s, a.s);
        r.clamp();
      }
      function op_and(x, y) {
        return x & y;
      }
      function bnAnd(a) {
        var r = nbi();
        this.bitwiseTo(a, op_and, r);
        return r;
      }
      function op_or(x, y) {
        return x | y;
      }
      function bnOr(a) {
        var r = nbi();
        this.bitwiseTo(a, op_or, r);
        return r;
      }
      function op_xor(x, y) {
        return x ^ y;
      }
      function bnXor(a) {
        var r = nbi();
        this.bitwiseTo(a, op_xor, r);
        return r;
      }
      function op_andnot(x, y) {
        return x & ~y;
      }
      function bnAndNot(a) {
        var r = nbi();
        this.bitwiseTo(a, op_andnot, r);
        return r;
      }
      function bnNot() {
        var r = nbi();
        for (var i = 0; i < this.t; ++i)
          r[i] = this.DM & ~this[i];
        r.t = this.t;
        r.s = ~this.s;
        return r;
      }
      function bnShiftLeft(n) {
        var r = nbi();
        if (n < 0)
          this.rShiftTo(-n, r);
        else
          this.lShiftTo(n, r);
        return r;
      }
      function bnShiftRight(n) {
        var r = nbi();
        if (n < 0)
          this.lShiftTo(-n, r);
        else
          this.rShiftTo(n, r);
        return r;
      }
      function lbit(x) {
        if (x == 0)
          return -1;
        var r = 0;
        if ((x & 65535) == 0) {
          x >>= 16;
          r += 16;
        }
        if ((x & 255) == 0) {
          x >>= 8;
          r += 8;
        }
        if ((x & 15) == 0) {
          x >>= 4;
          r += 4;
        }
        if ((x & 3) == 0) {
          x >>= 2;
          r += 2;
        }
        if ((x & 1) == 0)
          ++r;
        return r;
      }
      function bnGetLowestSetBit() {
        for (var i = 0; i < this.t; ++i)
          if (this[i] != 0)
            return i * this.DB + lbit(this[i]);
        if (this.s < 0)
          return this.t * this.DB;
        return -1;
      }
      function cbit(x) {
        var r = 0;
        while (x != 0) {
          x &= x - 1;
          ++r;
        }
        return r;
      }
      function bnBitCount() {
        var r = 0, x = this.s & this.DM;
        for (var i = 0; i < this.t; ++i)
          r += cbit(this[i] ^ x);
        return r;
      }
      function bnTestBit(n) {
        var j = Math.floor(n / this.DB);
        if (j >= this.t)
          return this.s != 0;
        return (this[j] & 1 << n % this.DB) != 0;
      }
      function bnpChangeBit(n, op) {
        var r = BigInteger.ONE.shiftLeft(n);
        this.bitwiseTo(r, op, r);
        return r;
      }
      function bnSetBit(n) {
        return this.changeBit(n, op_or);
      }
      function bnClearBit(n) {
        return this.changeBit(n, op_andnot);
      }
      function bnFlipBit(n) {
        return this.changeBit(n, op_xor);
      }
      function bnpAddTo(a, r) {
        var i = 0, c = 0, m = Math.min(a.t, this.t);
        while (i < m) {
          c += this[i] + a[i];
          r[i++] = c & this.DM;
          c >>= this.DB;
        }
        if (a.t < this.t) {
          c += a.s;
          while (i < this.t) {
            c += this[i];
            r[i++] = c & this.DM;
            c >>= this.DB;
          }
          c += this.s;
        } else {
          c += this.s;
          while (i < a.t) {
            c += a[i];
            r[i++] = c & this.DM;
            c >>= this.DB;
          }
          c += a.s;
        }
        r.s = c < 0 ? -1 : 0;
        if (c > 0)
          r[i++] = c;
        else if (c < -1)
          r[i++] = this.DV + c;
        r.t = i;
        r.clamp();
      }
      function bnAdd(a) {
        var r = nbi();
        this.addTo(a, r);
        return r;
      }
      function bnSubtract(a) {
        var r = nbi();
        this.subTo(a, r);
        return r;
      }
      function bnMultiply(a) {
        var r = nbi();
        this.multiplyTo(a, r);
        return r;
      }
      function bnSquare() {
        var r = nbi();
        this.squareTo(r);
        return r;
      }
      function bnDivide(a) {
        var r = nbi();
        this.divRemTo(a, r, null);
        return r;
      }
      function bnRemainder(a) {
        var r = nbi();
        this.divRemTo(a, null, r);
        return r;
      }
      function bnDivideAndRemainder(a) {
        var q2 = nbi(), r = nbi();
        this.divRemTo(a, q2, r);
        return new Array(q2, r);
      }
      function bnpDMultiply(n) {
        this[this.t] = this.am(0, n - 1, this, 0, 0, this.t);
        ++this.t;
        this.clamp();
      }
      function bnpDAddOffset(n, w) {
        if (n == 0)
          return;
        while (this.t <= w)
          this[this.t++] = 0;
        this[w] += n;
        while (this[w] >= this.DV) {
          this[w] -= this.DV;
          if (++w >= this.t)
            this[this.t++] = 0;
          ++this[w];
        }
      }
      function NullExp() {
      }
      function nNop(x) {
        return x;
      }
      function nMulTo(x, y, r) {
        x.multiplyTo(y, r);
      }
      function nSqrTo(x, r) {
        x.squareTo(r);
      }
      NullExp.prototype.convert = nNop;
      NullExp.prototype.revert = nNop;
      NullExp.prototype.mulTo = nMulTo;
      NullExp.prototype.sqrTo = nSqrTo;
      function bnPow(e) {
        return this.exp(e, new NullExp());
      }
      function bnpMultiplyLowerTo(a, n, r) {
        var i = Math.min(this.t + a.t, n);
        r.s = 0;
        r.t = i;
        while (i > 0)
          r[--i] = 0;
        var j;
        for (j = r.t - this.t; i < j; ++i)
          r[i + this.t] = this.am(0, a[i], r, i, 0, this.t);
        for (j = Math.min(a.t, n); i < j; ++i)
          this.am(0, a[i], r, i, 0, n - i);
        r.clamp();
      }
      function bnpMultiplyUpperTo(a, n, r) {
        --n;
        var i = r.t = this.t + a.t - n;
        r.s = 0;
        while (--i >= 0)
          r[i] = 0;
        for (i = Math.max(n - this.t, 0); i < a.t; ++i)
          r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n);
        r.clamp();
        r.drShiftTo(1, r);
      }
      function Barrett(m) {
        this.r2 = nbi();
        this.q3 = nbi();
        BigInteger.ONE.dlShiftTo(2 * m.t, this.r2);
        this.mu = this.r2.divide(m);
        this.m = m;
      }
      function barrettConvert(x) {
        if (x.s < 0 || x.t > 2 * this.m.t)
          return x.mod(this.m);
        else if (x.compareTo(this.m) < 0)
          return x;
        else {
          var r = nbi();
          x.copyTo(r);
          this.reduce(r);
          return r;
        }
      }
      function barrettRevert(x) {
        return x;
      }
      function barrettReduce(x) {
        x.drShiftTo(this.m.t - 1, this.r2);
        if (x.t > this.m.t + 1) {
          x.t = this.m.t + 1;
          x.clamp();
        }
        this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3);
        this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2);
        while (x.compareTo(this.r2) < 0)
          x.dAddOffset(1, this.m.t + 1);
        x.subTo(this.r2, x);
        while (x.compareTo(this.m) >= 0)
          x.subTo(this.m, x);
      }
      function barrettSqrTo(x, r) {
        x.squareTo(r);
        this.reduce(r);
      }
      function barrettMulTo(x, y, r) {
        x.multiplyTo(y, r);
        this.reduce(r);
      }
      Barrett.prototype.convert = barrettConvert;
      Barrett.prototype.revert = barrettRevert;
      Barrett.prototype.reduce = barrettReduce;
      Barrett.prototype.mulTo = barrettMulTo;
      Barrett.prototype.sqrTo = barrettSqrTo;
      function bnModPow(e, m) {
        var i = e.bitLength(), k, r = nbv(1), z2;
        if (i <= 0)
          return r;
        else if (i < 18)
          k = 1;
        else if (i < 48)
          k = 3;
        else if (i < 144)
          k = 4;
        else if (i < 768)
          k = 5;
        else
          k = 6;
        if (i < 8)
          z2 = new Classic(m);
        else if (m.isEven())
          z2 = new Barrett(m);
        else
          z2 = new Montgomery(m);
        var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;
        g[1] = z2.convert(this);
        if (k > 1) {
          var g2 = nbi();
          z2.sqrTo(g[1], g2);
          while (n <= km) {
            g[n] = nbi();
            z2.mulTo(g2, g[n - 2], g[n]);
            n += 2;
          }
        }
        var j = e.t - 1, w, is1 = true, r2 = nbi(), t2;
        i = nbits(e[j]) - 1;
        while (j >= 0) {
          if (i >= k1)
            w = e[j] >> i - k1 & km;
          else {
            w = (e[j] & (1 << i + 1) - 1) << k1 - i;
            if (j > 0)
              w |= e[j - 1] >> this.DB + i - k1;
          }
          n = k;
          while ((w & 1) == 0) {
            w >>= 1;
            --n;
          }
          if ((i -= n) < 0) {
            i += this.DB;
            --j;
          }
          if (is1) {
            g[w].copyTo(r);
            is1 = false;
          } else {
            while (n > 1) {
              z2.sqrTo(r, r2);
              z2.sqrTo(r2, r);
              n -= 2;
            }
            if (n > 0)
              z2.sqrTo(r, r2);
            else {
              t2 = r;
              r = r2;
              r2 = t2;
            }
            z2.mulTo(r2, g[w], r);
          }
          while (j >= 0 && (e[j] & 1 << i) == 0) {
            z2.sqrTo(r, r2);
            t2 = r;
            r = r2;
            r2 = t2;
            if (--i < 0) {
              i = this.DB - 1;
              --j;
            }
          }
        }
        return z2.revert(r);
      }
      function bnGCD(a) {
        var x = this.s < 0 ? this.negate() : this.clone();
        var y = a.s < 0 ? a.negate() : a.clone();
        if (x.compareTo(y) < 0) {
          var t2 = x;
          x = y;
          y = t2;
        }
        var i = x.getLowestSetBit(), g = y.getLowestSetBit();
        if (g < 0)
          return x;
        if (i < g)
          g = i;
        if (g > 0) {
          x.rShiftTo(g, x);
          y.rShiftTo(g, y);
        }
        while (x.signum() > 0) {
          if ((i = x.getLowestSetBit()) > 0)
            x.rShiftTo(i, x);
          if ((i = y.getLowestSetBit()) > 0)
            y.rShiftTo(i, y);
          if (x.compareTo(y) >= 0) {
            x.subTo(y, x);
            x.rShiftTo(1, x);
          } else {
            y.subTo(x, y);
            y.rShiftTo(1, y);
          }
        }
        if (g > 0)
          y.lShiftTo(g, y);
        return y;
      }
      function bnpModInt(n) {
        if (n <= 0)
          return 0;
        var d = this.DV % n, r = this.s < 0 ? n - 1 : 0;
        if (this.t > 0)
          if (d == 0)
            r = this[0] % n;
          else
            for (var i = this.t - 1; i >= 0; --i)
              r = (d * r + this[i]) % n;
        return r;
      }
      function bnModInverse(m) {
        var ac = m.isEven();
        if (this.isEven() && ac || m.signum() == 0)
          return BigInteger.ZERO;
        var u = m.clone(), v = this.clone();
        var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
        while (u.signum() != 0) {
          while (u.isEven()) {
            u.rShiftTo(1, u);
            if (ac) {
              if (!a.isEven() || !b.isEven()) {
                a.addTo(this, a);
                b.subTo(m, b);
              }
              a.rShiftTo(1, a);
            } else if (!b.isEven())
              b.subTo(m, b);
            b.rShiftTo(1, b);
          }
          while (v.isEven()) {
            v.rShiftTo(1, v);
            if (ac) {
              if (!c.isEven() || !d.isEven()) {
                c.addTo(this, c);
                d.subTo(m, d);
              }
              c.rShiftTo(1, c);
            } else if (!d.isEven())
              d.subTo(m, d);
            d.rShiftTo(1, d);
          }
          if (u.compareTo(v) >= 0) {
            u.subTo(v, u);
            if (ac)
              a.subTo(c, a);
            b.subTo(d, b);
          } else {
            v.subTo(u, v);
            if (ac)
              c.subTo(a, c);
            d.subTo(b, d);
          }
        }
        if (v.compareTo(BigInteger.ONE) != 0)
          return BigInteger.ZERO;
        if (d.compareTo(m) >= 0)
          return d.subtract(m);
        if (d.signum() < 0)
          d.addTo(m, d);
        else
          return d;
        if (d.signum() < 0)
          return d.add(m);
        else
          return d;
      }
      var lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997];
      var lplim = (1 << 26) / lowprimes[lowprimes.length - 1];
      function bnIsProbablePrime(t2) {
        var i, x = this.abs();
        if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
          for (i = 0; i < lowprimes.length; ++i)
            if (x[0] == lowprimes[i])
              return true;
          return false;
        }
        if (x.isEven())
          return false;
        i = 1;
        while (i < lowprimes.length) {
          var m = lowprimes[i], j = i + 1;
          while (j < lowprimes.length && m < lplim)
            m *= lowprimes[j++];
          m = x.modInt(m);
          while (i < j)
            if (m % lowprimes[i++] == 0)
              return false;
        }
        return x.millerRabin(t2);
      }
      function bnpMillerRabin(t2) {
        var n1 = this.subtract(BigInteger.ONE);
        var k = n1.getLowestSetBit();
        if (k <= 0)
          return false;
        var r = n1.shiftRight(k);
        t2 = t2 + 1 >> 1;
        if (t2 > lowprimes.length)
          t2 = lowprimes.length;
        var a = nbi();
        for (var i = 0; i < t2; ++i) {
          a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]);
          var y = a.modPow(r, this);
          if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
            var j = 1;
            while (j++ < k && y.compareTo(n1) != 0) {
              y = y.modPowInt(2, this);
              if (y.compareTo(BigInteger.ONE) == 0)
                return false;
            }
            if (y.compareTo(n1) != 0)
              return false;
          }
        }
        return true;
      }
      BigInteger.prototype.chunkSize = bnpChunkSize;
      BigInteger.prototype.toRadix = bnpToRadix;
      BigInteger.prototype.fromRadix = bnpFromRadix;
      BigInteger.prototype.fromNumber = bnpFromNumber;
      BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
      BigInteger.prototype.changeBit = bnpChangeBit;
      BigInteger.prototype.addTo = bnpAddTo;
      BigInteger.prototype.dMultiply = bnpDMultiply;
      BigInteger.prototype.dAddOffset = bnpDAddOffset;
      BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
      BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
      BigInteger.prototype.modInt = bnpModInt;
      BigInteger.prototype.millerRabin = bnpMillerRabin;
      BigInteger.prototype.clone = bnClone;
      BigInteger.prototype.intValue = bnIntValue;
      BigInteger.prototype.byteValue = bnByteValue;
      BigInteger.prototype.shortValue = bnShortValue;
      BigInteger.prototype.signum = bnSigNum;
      BigInteger.prototype.toByteArray = bnToByteArray;
      BigInteger.prototype.equals = bnEquals;
      BigInteger.prototype.min = bnMin;
      BigInteger.prototype.max = bnMax;
      BigInteger.prototype.and = bnAnd;
      BigInteger.prototype.or = bnOr;
      BigInteger.prototype.xor = bnXor;
      BigInteger.prototype.andNot = bnAndNot;
      BigInteger.prototype.not = bnNot;
      BigInteger.prototype.shiftLeft = bnShiftLeft;
      BigInteger.prototype.shiftRight = bnShiftRight;
      BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
      BigInteger.prototype.bitCount = bnBitCount;
      BigInteger.prototype.testBit = bnTestBit;
      BigInteger.prototype.setBit = bnSetBit;
      BigInteger.prototype.clearBit = bnClearBit;
      BigInteger.prototype.flipBit = bnFlipBit;
      BigInteger.prototype.add = bnAdd;
      BigInteger.prototype.subtract = bnSubtract;
      BigInteger.prototype.multiply = bnMultiply;
      BigInteger.prototype.divide = bnDivide;
      BigInteger.prototype.remainder = bnRemainder;
      BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
      BigInteger.prototype.modPow = bnModPow;
      BigInteger.prototype.modInverse = bnModInverse;
      BigInteger.prototype.pow = bnPow;
      BigInteger.prototype.gcd = bnGCD;
      BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
      BigInteger.prototype.square = bnSquare;
      BigInteger.prototype.Barrett = Barrett;
      var rng_state;
      var rng_pool;
      var rng_pptr;
      function rng_seed_int(x) {
        rng_pool[rng_pptr++] ^= x & 255;
        rng_pool[rng_pptr++] ^= x >> 8 & 255;
        rng_pool[rng_pptr++] ^= x >> 16 & 255;
        rng_pool[rng_pptr++] ^= x >> 24 & 255;
        if (rng_pptr >= rng_psize)
          rng_pptr -= rng_psize;
      }
      function rng_seed_time() {
        rng_seed_int(new Date().getTime());
      }
      if (rng_pool == null) {
        rng_pool = new Array();
        rng_pptr = 0;
        var t;
        if (typeof window !== "undefined" && window.crypto) {
          if (window.crypto.getRandomValues) {
            var ua = new Uint8Array(32);
            window.crypto.getRandomValues(ua);
            for (t = 0; t < 32; ++t)
              rng_pool[rng_pptr++] = ua[t];
          } else if (navigator.appName == "Netscape" && navigator.appVersion < "5") {
            var z = window.crypto.random(32);
            for (t = 0; t < z.length; ++t)
              rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
          }
        }
        while (rng_pptr < rng_psize) {
          t = Math.floor(65536 * Math.random());
          rng_pool[rng_pptr++] = t >>> 8;
          rng_pool[rng_pptr++] = t & 255;
        }
        rng_pptr = 0;
        rng_seed_time();
      }
      function rng_get_byte() {
        if (rng_state == null) {
          rng_seed_time();
          rng_state = prng_newstate();
          rng_state.init(rng_pool);
          for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
            rng_pool[rng_pptr] = 0;
          rng_pptr = 0;
        }
        return rng_state.next();
      }
      function rng_get_bytes(ba) {
        var i;
        for (i = 0; i < ba.length; ++i)
          ba[i] = rng_get_byte();
      }
      function SecureRandom2() {
      }
      SecureRandom2.prototype.nextBytes = rng_get_bytes;
      function Arcfour() {
        this.i = 0;
        this.j = 0;
        this.S = new Array();
      }
      function ARC4init(key) {
        var i, j, t2;
        for (i = 0; i < 256; ++i)
          this.S[i] = i;
        j = 0;
        for (i = 0; i < 256; ++i) {
          j = j + this.S[i] + key[i % key.length] & 255;
          t2 = this.S[i];
          this.S[i] = this.S[j];
          this.S[j] = t2;
        }
        this.i = 0;
        this.j = 0;
      }
      function ARC4next() {
        var t2;
        this.i = this.i + 1 & 255;
        this.j = this.j + this.S[this.i] & 255;
        t2 = this.S[this.i];
        this.S[this.i] = this.S[this.j];
        this.S[this.j] = t2;
        return this.S[t2 + this.S[this.i] & 255];
      }
      Arcfour.prototype.init = ARC4init;
      Arcfour.prototype.next = ARC4next;
      function prng_newstate() {
        return new Arcfour();
      }
      var rng_psize = 256;
      BigInteger.SecureRandom = SecureRandom2;
      BigInteger.BigInteger = BigInteger;
      if (typeof exports2 !== "undefined") {
        exports2 = module2.exports = BigInteger;
      } else {
        this.BigInteger = BigInteger;
        this.SecureRandom = SecureRandom2;
      }
    }).call(exports2);
  }
});

// node_modules/ecc-jsbn/lib/ec.js
var require_ec = __commonJS({
  "node_modules/ecc-jsbn/lib/ec.js"(exports2, module2) {
    var BigInteger = require_jsbn().BigInteger;
    var Barrett = BigInteger.prototype.Barrett;
    function ECFieldElementFp(q2, x) {
      this.x = x;
      this.q = q2;
    }
    function feFpEquals(other) {
      if (other == this)
        return true;
      return this.q.equals(other.q) && this.x.equals(other.x);
    }
    function feFpToBigInteger() {
      return this.x;
    }
    function feFpNegate() {
      return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));
    }
    function feFpAdd(b) {
      return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));
    }
    function feFpSubtract(b) {
      return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));
    }
    function feFpMultiply(b) {
      return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));
    }
    function feFpSquare() {
      return new ECFieldElementFp(this.q, this.x.square().mod(this.q));
    }
    function feFpDivide(b) {
      return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));
    }
    ECFieldElementFp.prototype.equals = feFpEquals;
    ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;
    ECFieldElementFp.prototype.negate = feFpNegate;
    ECFieldElementFp.prototype.add = feFpAdd;
    ECFieldElementFp.prototype.subtract = feFpSubtract;
    ECFieldElementFp.prototype.multiply = feFpMultiply;
    ECFieldElementFp.prototype.square = feFpSquare;
    ECFieldElementFp.prototype.divide = feFpDivide;
    function ECPointFp(curve, x, y, z) {
      this.curve = curve;
      this.x = x;
      this.y = y;
      if (z == null) {
        this.z = BigInteger.ONE;
      } else {
        this.z = z;
      }
      this.zinv = null;
    }
    function pointFpGetX() {
      if (this.zinv == null) {
        this.zinv = this.z.modInverse(this.curve.q);
      }
      var r = this.x.toBigInteger().multiply(this.zinv);
      this.curve.reduce(r);
      return this.curve.fromBigInteger(r);
    }
    function pointFpGetY() {
      if (this.zinv == null) {
        this.zinv = this.z.modInverse(this.curve.q);
      }
      var r = this.y.toBigInteger().multiply(this.zinv);
      this.curve.reduce(r);
      return this.curve.fromBigInteger(r);
    }
    function pointFpEquals(other) {
      if (other == this)
        return true;
      if (this.isInfinity())
        return other.isInfinity();
      if (other.isInfinity())
        return this.isInfinity();
      var u, v;
      u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);
      if (!u.equals(BigInteger.ZERO))
        return false;
      v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);
      return v.equals(BigInteger.ZERO);
    }
    function pointFpIsInfinity() {
      if (this.x == null && this.y == null)
        return true;
      return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);
    }
    function pointFpNegate() {
      return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);
    }
    function pointFpAdd(b) {
      if (this.isInfinity())
        return b;
      if (b.isInfinity())
        return this;
      var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);
      var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);
      if (BigInteger.ZERO.equals(v)) {
        if (BigInteger.ZERO.equals(u)) {
          return this.twice();
        }
        return this.curve.getInfinity();
      }
      var THREE = new BigInteger("3");
      var x1 = this.x.toBigInteger();
      var y1 = this.y.toBigInteger();
      var x2 = b.x.toBigInteger();
      var y2 = b.y.toBigInteger();
      var v2 = v.square();
      var v32 = v2.multiply(v);
      var x1v2 = x1.multiply(v2);
      var zu2 = u.square().multiply(this.z);
      var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v32).multiply(v).mod(this.curve.q);
      var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v32)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v32)).mod(this.curve.q);
      var z3 = v32.multiply(this.z).multiply(b.z).mod(this.curve.q);
      return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
    }
    function pointFpTwice() {
      if (this.isInfinity())
        return this;
      if (this.y.toBigInteger().signum() == 0)
        return this.curve.getInfinity();
      var THREE = new BigInteger("3");
      var x1 = this.x.toBigInteger();
      var y1 = this.y.toBigInteger();
      var y1z1 = y1.multiply(this.z);
      var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);
      var a = this.curve.a.toBigInteger();
      var w = x1.square().multiply(THREE);
      if (!BigInteger.ZERO.equals(a)) {
        w = w.add(this.z.square().multiply(a));
      }
      w = w.mod(this.curve.q);
      var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);
      var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);
      var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);
      return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
    }
    function pointFpMultiply(k) {
      if (this.isInfinity())
        return this;
      if (k.signum() == 0)
        return this.curve.getInfinity();
      var e = k;
      var h = e.multiply(new BigInteger("3"));
      var neg = this.negate();
      var R = this;
      var i;
      for (i = h.bitLength() - 2; i > 0; --i) {
        R = R.twice();
        var hBit = h.testBit(i);
        var eBit = e.testBit(i);
        if (hBit != eBit) {
          R = R.add(hBit ? this : neg);
        }
      }
      return R;
    }
    function pointFpMultiplyTwo(j, x, k) {
      var i;
      if (j.bitLength() > k.bitLength())
        i = j.bitLength() - 1;
      else
        i = k.bitLength() - 1;
      var R = this.curve.getInfinity();
      var both = this.add(x);
      while (i >= 0) {
        R = R.twice();
        if (j.testBit(i)) {
          if (k.testBit(i)) {
            R = R.add(both);
          } else {
            R = R.add(this);
          }
        } else {
          if (k.testBit(i)) {
            R = R.add(x);
          }
        }
        --i;
      }
      return R;
    }
    ECPointFp.prototype.getX = pointFpGetX;
    ECPointFp.prototype.getY = pointFpGetY;
    ECPointFp.prototype.equals = pointFpEquals;
    ECPointFp.prototype.isInfinity = pointFpIsInfinity;
    ECPointFp.prototype.negate = pointFpNegate;
    ECPointFp.prototype.add = pointFpAdd;
    ECPointFp.prototype.twice = pointFpTwice;
    ECPointFp.prototype.multiply = pointFpMultiply;
    ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;
    function ECCurveFp(q2, a, b) {
      this.q = q2;
      this.a = this.fromBigInteger(a);
      this.b = this.fromBigInteger(b);
      this.infinity = new ECPointFp(this, null, null);
      this.reducer = new Barrett(this.q);
    }
    function curveFpGetQ() {
      return this.q;
    }
    function curveFpGetA() {
      return this.a;
    }
    function curveFpGetB() {
      return this.b;
    }
    function curveFpEquals(other) {
      if (other == this)
        return true;
      return this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b);
    }
    function curveFpGetInfinity() {
      return this.infinity;
    }
    function curveFpFromBigInteger(x) {
      return new ECFieldElementFp(this.q, x);
    }
    function curveReduce(x) {
      this.reducer.reduce(x);
    }
    function curveFpEncodePointHex(p) {
      if (p.isInfinity())
        return "00";
      var xHex = p.getX().toBigInteger().toString(16);
      var yHex = p.getY().toBigInteger().toString(16);
      var oLen = this.getQ().toString(16).length;
      if (oLen % 2 != 0)
        oLen++;
      while (xHex.length < oLen) {
        xHex = "0" + xHex;
      }
      while (yHex.length < oLen) {
        yHex = "0" + yHex;
      }
      return "04" + xHex + yHex;
    }
    ECCurveFp.prototype.getQ = curveFpGetQ;
    ECCurveFp.prototype.getA = curveFpGetA;
    ECCurveFp.prototype.getB = curveFpGetB;
    ECCurveFp.prototype.equals = curveFpEquals;
    ECCurveFp.prototype.getInfinity = curveFpGetInfinity;
    ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;
    ECCurveFp.prototype.reduce = curveReduce;
    ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;
    ECCurveFp.prototype.decodePointHex = function(s) {
      var yIsEven;
      switch (parseInt(s.substr(0, 2), 16)) {
        case 0:
          return this.infinity;
        case 2:
          yIsEven = false;
        case 3:
          if (yIsEven == void 0)
            yIsEven = true;
          var len = s.length - 2;
          var xHex = s.substr(2, len);
          var x = this.fromBigInteger(new BigInteger(xHex, 16));
          var alpha = x.multiply(x.square().add(this.getA())).add(this.getB());
          var beta = alpha.sqrt();
          if (beta == null)
            throw "Invalid point compression";
          var betaValue = beta.toBigInteger();
          if (betaValue.testBit(0) != yIsEven) {
            beta = this.fromBigInteger(this.getQ().subtract(betaValue));
          }
          return new ECPointFp(this, x, beta);
        case 4:
        case 6:
        case 7:
          var len = (s.length - 2) / 2;
          var xHex = s.substr(2, len);
          var yHex = s.substr(len + 2, len);
          return new ECPointFp(
            this,
            this.fromBigInteger(new BigInteger(xHex, 16)),
            this.fromBigInteger(new BigInteger(yHex, 16))
          );
        default:
          return null;
      }
    };
    ECCurveFp.prototype.encodeCompressedPointHex = function(p) {
      if (p.isInfinity())
        return "00";
      var xHex = p.getX().toBigInteger().toString(16);
      var oLen = this.getQ().toString(16).length;
      if (oLen % 2 != 0)
        oLen++;
      while (xHex.length < oLen)
        xHex = "0" + xHex;
      var yPrefix;
      if (p.getY().toBigInteger().isEven())
        yPrefix = "02";
      else
        yPrefix = "03";
      return yPrefix + xHex;
    };
    ECFieldElementFp.prototype.getR = function() {
      if (this.r != void 0)
        return this.r;
      this.r = null;
      var bitLength = this.q.bitLength();
      if (bitLength > 128) {
        var firstWord = this.q.shiftRight(bitLength - 64);
        if (firstWord.intValue() == -1) {
          this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);
        }
      }
      return this.r;
    };
    ECFieldElementFp.prototype.modMult = function(x1, x2) {
      return this.modReduce(x1.multiply(x2));
    };
    ECFieldElementFp.prototype.modReduce = function(x) {
      if (this.getR() != null) {
        var qLen = q.bitLength();
        while (x.bitLength() > qLen + 1) {
          var u = x.shiftRight(qLen);
          var v = x.subtract(u.shiftLeft(qLen));
          if (!this.getR().equals(BigInteger.ONE)) {
            u = u.multiply(this.getR());
          }
          x = u.add(v);
        }
        while (x.compareTo(q) >= 0) {
          x = x.subtract(q);
        }
      } else {
        x = x.mod(q);
      }
      return x;
    };
    ECFieldElementFp.prototype.sqrt = function() {
      if (!this.q.testBit(0))
        throw "unsupported";
      if (this.q.testBit(1)) {
        var z = new ECFieldElementFp(this.q, this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE), this.q));
        return z.square().equals(this) ? z : null;
      }
      var qMinusOne = this.q.subtract(BigInteger.ONE);
      var legendreExponent = qMinusOne.shiftRight(1);
      if (!this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)) {
        return null;
      }
      var u = qMinusOne.shiftRight(2);
      var k = u.shiftLeft(1).add(BigInteger.ONE);
      var Q = this.x;
      var fourQ = modDouble(modDouble(Q));
      var U, V;
      do {
        var P;
        do {
          P = new BigInteger(this.q.bitLength(), new SecureRandom());
        } while (P.compareTo(this.q) >= 0 || !P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne));
        var result = this.lucasSequence(P, Q, k);
        U = result[0];
        V = result[1];
        if (this.modMult(V, V).equals(fourQ)) {
          if (V.testBit(0)) {
            V = V.add(q);
          }
          V = V.shiftRight(1);
          return new ECFieldElementFp(q, V);
        }
      } while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));
      return null;
    };
    ECFieldElementFp.prototype.lucasSequence = function(P, Q, k) {
      var n = k.bitLength();
      var s = k.getLowestSetBit();
      var Uh = BigInteger.ONE;
      var Vl = BigInteger.TWO;
      var Vh = P;
      var Ql = BigInteger.ONE;
      var Qh = BigInteger.ONE;
      for (var j = n - 1; j >= s + 1; --j) {
        Ql = this.modMult(Ql, Qh);
        if (k.testBit(j)) {
          Qh = this.modMult(Ql, Q);
          Uh = this.modMult(Uh, Vh);
          Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
          Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));
        } else {
          Qh = Ql;
          Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
          Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
          Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
        }
      }
      Ql = this.modMult(Ql, Qh);
      Qh = this.modMult(Ql, Q);
      Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
      Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
      Ql = this.modMult(Ql, Qh);
      for (var j = 1; j <= s; ++j) {
        Uh = this.modMult(Uh, Vl);
        Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
        Ql = this.modMult(Ql, Ql);
      }
      return [Uh, Vl];
    };
    var exports2 = {
      ECCurveFp,
      ECPointFp,
      ECFieldElementFp
    };
    module2.exports = exports2;
  }
});

// node_modules/tweetnacl/nacl-fast.js
var require_nacl_fast = __commonJS({
  "node_modules/tweetnacl/nacl-fast.js"(exports2, module2) {
    (function(nacl) {
      "use strict";
      var gf = function(init2) {
        var i, r = new Float64Array(16);
        if (init2)
          for (i = 0; i < init2.length; i++)
            r[i] = init2[i];
        return r;
      };
      var randombytes = function() {
        throw new Error("no PRNG");
      };
      var _0 = new Uint8Array(16);
      var _9 = new Uint8Array(32);
      _9[0] = 9;
      var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]);
      function ts64(x, i, h, l) {
        x[i] = h >> 24 & 255;
        x[i + 1] = h >> 16 & 255;
        x[i + 2] = h >> 8 & 255;
        x[i + 3] = h & 255;
        x[i + 4] = l >> 24 & 255;
        x[i + 5] = l >> 16 & 255;
        x[i + 6] = l >> 8 & 255;
        x[i + 7] = l & 255;
      }
      function vn(x, xi, y, yi, n) {
        var i, d = 0;
        for (i = 0; i < n; i++)
          d |= x[xi + i] ^ y[yi + i];
        return (1 & d - 1 >>> 8) - 1;
      }
      function crypto_verify_16(x, xi, y, yi) {
        return vn(x, xi, y, yi, 16);
      }
      function crypto_verify_32(x, xi, y, yi) {
        return vn(x, xi, y, yi, 32);
      }
      function core_salsa20(o, p, k, c) {
        var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24;
        var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u;
        for (var i = 0; i < 20; i += 2) {
          u = x0 + x12 | 0;
          x4 ^= u << 7 | u >>> 32 - 7;
          u = x4 + x0 | 0;
          x8 ^= u << 9 | u >>> 32 - 9;
          u = x8 + x4 | 0;
          x12 ^= u << 13 | u >>> 32 - 13;
          u = x12 + x8 | 0;
          x0 ^= u << 18 | u >>> 32 - 18;
          u = x5 + x1 | 0;
          x9 ^= u << 7 | u >>> 32 - 7;
          u = x9 + x5 | 0;
          x13 ^= u << 9 | u >>> 32 - 9;
          u = x13 + x9 | 0;
          x1 ^= u << 13 | u >>> 32 - 13;
          u = x1 + x13 | 0;
          x5 ^= u << 18 | u >>> 32 - 18;
          u = x10 + x6 | 0;
          x14 ^= u << 7 | u >>> 32 - 7;
          u = x14 + x10 | 0;
          x2 ^= u << 9 | u >>> 32 - 9;
          u = x2 + x14 | 0;
          x6 ^= u << 13 | u >>> 32 - 13;
          u = x6 + x2 | 0;
          x10 ^= u << 18 | u >>> 32 - 18;
          u = x15 + x11 | 0;
          x3 ^= u << 7 | u >>> 32 - 7;
          u = x3 + x15 | 0;
          x7 ^= u << 9 | u >>> 32 - 9;
          u = x7 + x3 | 0;
          x11 ^= u << 13 | u >>> 32 - 13;
          u = x11 + x7 | 0;
          x15 ^= u << 18 | u >>> 32 - 18;
          u = x0 + x3 | 0;
          x1 ^= u << 7 | u >>> 32 - 7;
          u = x1 + x0 | 0;
          x2 ^= u << 9 | u >>> 32 - 9;
          u = x2 + x1 | 0;
          x3 ^= u << 13 | u >>> 32 - 13;
          u = x3 + x2 | 0;
          x0 ^= u << 18 | u >>> 32 - 18;
          u = x5 + x4 | 0;
          x6 ^= u << 7 | u >>> 32 - 7;
          u = x6 + x5 | 0;
          x7 ^= u << 9 | u >>> 32 - 9;
          u = x7 + x6 | 0;
          x4 ^= u << 13 | u >>> 32 - 13;
          u = x4 + x7 | 0;
          x5 ^= u << 18 | u >>> 32 - 18;
          u = x10 + x9 | 0;
          x11 ^= u << 7 | u >>> 32 - 7;
          u = x11 + x10 | 0;
          x8 ^= u << 9 | u >>> 32 - 9;
          u = x8 + x11 | 0;
          x9 ^= u << 13 | u >>> 32 - 13;
          u = x9 + x8 | 0;
          x10 ^= u << 18 | u >>> 32 - 18;
          u = x15 + x14 | 0;
          x12 ^= u << 7 | u >>> 32 - 7;
          u = x12 + x15 | 0;
          x13 ^= u << 9 | u >>> 32 - 9;
          u = x13 + x12 | 0;
          x14 ^= u << 13 | u >>> 32 - 13;
          u = x14 + x13 | 0;
          x15 ^= u << 18 | u >>> 32 - 18;
        }
        x0 = x0 + j0 | 0;
        x1 = x1 + j1 | 0;
        x2 = x2 + j2 | 0;
        x3 = x3 + j3 | 0;
        x4 = x4 + j4 | 0;
        x5 = x5 + j5 | 0;
        x6 = x6 + j6 | 0;
        x7 = x7 + j7 | 0;
        x8 = x8 + j8 | 0;
        x9 = x9 + j9 | 0;
        x10 = x10 + j10 | 0;
        x11 = x11 + j11 | 0;
        x12 = x12 + j12 | 0;
        x13 = x13 + j13 | 0;
        x14 = x14 + j14 | 0;
        x15 = x15 + j15 | 0;
        o[0] = x0 >>> 0 & 255;
        o[1] = x0 >>> 8 & 255;
        o[2] = x0 >>> 16 & 255;
        o[3] = x0 >>> 24 & 255;
        o[4] = x1 >>> 0 & 255;
        o[5] = x1 >>> 8 & 255;
        o[6] = x1 >>> 16 & 255;
        o[7] = x1 >>> 24 & 255;
        o[8] = x2 >>> 0 & 255;
        o[9] = x2 >>> 8 & 255;
        o[10] = x2 >>> 16 & 255;
        o[11] = x2 >>> 24 & 255;
        o[12] = x3 >>> 0 & 255;
        o[13] = x3 >>> 8 & 255;
        o[14] = x3 >>> 16 & 255;
        o[15] = x3 >>> 24 & 255;
        o[16] = x4 >>> 0 & 255;
        o[17] = x4 >>> 8 & 255;
        o[18] = x4 >>> 16 & 255;
        o[19] = x4 >>> 24 & 255;
        o[20] = x5 >>> 0 & 255;
        o[21] = x5 >>> 8 & 255;
        o[22] = x5 >>> 16 & 255;
        o[23] = x5 >>> 24 & 255;
        o[24] = x6 >>> 0 & 255;
        o[25] = x6 >>> 8 & 255;
        o[26] = x6 >>> 16 & 255;
        o[27] = x6 >>> 24 & 255;
        o[28] = x7 >>> 0 & 255;
        o[29] = x7 >>> 8 & 255;
        o[30] = x7 >>> 16 & 255;
        o[31] = x7 >>> 24 & 255;
        o[32] = x8 >>> 0 & 255;
        o[33] = x8 >>> 8 & 255;
        o[34] = x8 >>> 16 & 255;
        o[35] = x8 >>> 24 & 255;
        o[36] = x9 >>> 0 & 255;
        o[37] = x9 >>> 8 & 255;
        o[38] = x9 >>> 16 & 255;
        o[39] = x9 >>> 24 & 255;
        o[40] = x10 >>> 0 & 255;
        o[41] = x10 >>> 8 & 255;
        o[42] = x10 >>> 16 & 255;
        o[43] = x10 >>> 24 & 255;
        o[44] = x11 >>> 0 & 255;
        o[45] = x11 >>> 8 & 255;
        o[46] = x11 >>> 16 & 255;
        o[47] = x11 >>> 24 & 255;
        o[48] = x12 >>> 0 & 255;
        o[49] = x12 >>> 8 & 255;
        o[50] = x12 >>> 16 & 255;
        o[51] = x12 >>> 24 & 255;
        o[52] = x13 >>> 0 & 255;
        o[53] = x13 >>> 8 & 255;
        o[54] = x13 >>> 16 & 255;
        o[55] = x13 >>> 24 & 255;
        o[56] = x14 >>> 0 & 255;
        o[57] = x14 >>> 8 & 255;
        o[58] = x14 >>> 16 & 255;
        o[59] = x14 >>> 24 & 255;
        o[60] = x15 >>> 0 & 255;
        o[61] = x15 >>> 8 & 255;
        o[62] = x15 >>> 16 & 255;
        o[63] = x15 >>> 24 & 255;
      }
      function core_hsalsa20(o, p, k, c) {
        var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24;
        var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u;
        for (var i = 0; i < 20; i += 2) {
          u = x0 + x12 | 0;
          x4 ^= u << 7 | u >>> 32 - 7;
          u = x4 + x0 | 0;
          x8 ^= u << 9 | u >>> 32 - 9;
          u = x8 + x4 | 0;
          x12 ^= u << 13 | u >>> 32 - 13;
          u = x12 + x8 | 0;
          x0 ^= u << 18 | u >>> 32 - 18;
          u = x5 + x1 | 0;
          x9 ^= u << 7 | u >>> 32 - 7;
          u = x9 + x5 | 0;
          x13 ^= u << 9 | u >>> 32 - 9;
          u = x13 + x9 | 0;
          x1 ^= u << 13 | u >>> 32 - 13;
          u = x1 + x13 | 0;
          x5 ^= u << 18 | u >>> 32 - 18;
          u = x10 + x6 | 0;
          x14 ^= u << 7 | u >>> 32 - 7;
          u = x14 + x10 | 0;
          x2 ^= u << 9 | u >>> 32 - 9;
          u = x2 + x14 | 0;
          x6 ^= u << 13 | u >>> 32 - 13;
          u = x6 + x2 | 0;
          x10 ^= u << 18 | u >>> 32 - 18;
          u = x15 + x11 | 0;
          x3 ^= u << 7 | u >>> 32 - 7;
          u = x3 + x15 | 0;
          x7 ^= u << 9 | u >>> 32 - 9;
          u = x7 + x3 | 0;
          x11 ^= u << 13 | u >>> 32 - 13;
          u = x11 + x7 | 0;
          x15 ^= u << 18 | u >>> 32 - 18;
          u = x0 + x3 | 0;
          x1 ^= u << 7 | u >>> 32 - 7;
          u = x1 + x0 | 0;
          x2 ^= u << 9 | u >>> 32 - 9;
          u = x2 + x1 | 0;
          x3 ^= u << 13 | u >>> 32 - 13;
          u = x3 + x2 | 0;
          x0 ^= u << 18 | u >>> 32 - 18;
          u = x5 + x4 | 0;
          x6 ^= u << 7 | u >>> 32 - 7;
          u = x6 + x5 | 0;
          x7 ^= u << 9 | u >>> 32 - 9;
          u = x7 + x6 | 0;
          x4 ^= u << 13 | u >>> 32 - 13;
          u = x4 + x7 | 0;
          x5 ^= u << 18 | u >>> 32 - 18;
          u = x10 + x9 | 0;
          x11 ^= u << 7 | u >>> 32 - 7;
          u = x11 + x10 | 0;
          x8 ^= u << 9 | u >>> 32 - 9;
          u = x8 + x11 | 0;
          x9 ^= u << 13 | u >>> 32 - 13;
          u = x9 + x8 | 0;
          x10 ^= u << 18 | u >>> 32 - 18;
          u = x15 + x14 | 0;
          x12 ^= u << 7 | u >>> 32 - 7;
          u = x12 + x15 | 0;
          x13 ^= u << 9 | u >>> 32 - 9;
          u = x13 + x12 | 0;
          x14 ^= u << 13 | u >>> 32 - 13;
          u = x14 + x13 | 0;
          x15 ^= u << 18 | u >>> 32 - 18;
        }
        o[0] = x0 >>> 0 & 255;
        o[1] = x0 >>> 8 & 255;
        o[2] = x0 >>> 16 & 255;
        o[3] = x0 >>> 24 & 255;
        o[4] = x5 >>> 0 & 255;
        o[5] = x5 >>> 8 & 255;
        o[6] = x5 >>> 16 & 255;
        o[7] = x5 >>> 24 & 255;
        o[8] = x10 >>> 0 & 255;
        o[9] = x10 >>> 8 & 255;
        o[10] = x10 >>> 16 & 255;
        o[11] = x10 >>> 24 & 255;
        o[12] = x15 >>> 0 & 255;
        o[13] = x15 >>> 8 & 255;
        o[14] = x15 >>> 16 & 255;
        o[15] = x15 >>> 24 & 255;
        o[16] = x6 >>> 0 & 255;
        o[17] = x6 >>> 8 & 255;
        o[18] = x6 >>> 16 & 255;
        o[19] = x6 >>> 24 & 255;
        o[20] = x7 >>> 0 & 255;
        o[21] = x7 >>> 8 & 255;
        o[22] = x7 >>> 16 & 255;
        o[23] = x7 >>> 24 & 255;
        o[24] = x8 >>> 0 & 255;
        o[25] = x8 >>> 8 & 255;
        o[26] = x8 >>> 16 & 255;
        o[27] = x8 >>> 24 & 255;
        o[28] = x9 >>> 0 & 255;
        o[29] = x9 >>> 8 & 255;
        o[30] = x9 >>> 16 & 255;
        o[31] = x9 >>> 24 & 255;
      }
      function crypto_core_salsa20(out, inp, k, c) {
        core_salsa20(out, inp, k, c);
      }
      function crypto_core_hsalsa20(out, inp, k, c) {
        core_hsalsa20(out, inp, k, c);
      }
      var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
      function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) {
        var z = new Uint8Array(16), x = new Uint8Array(64);
        var u, i;
        for (i = 0; i < 16; i++)
          z[i] = 0;
        for (i = 0; i < 8; i++)
          z[i] = n[i];
        while (b >= 64) {
          crypto_core_salsa20(x, z, k, sigma);
          for (i = 0; i < 64; i++)
            c[cpos + i] = m[mpos + i] ^ x[i];
          u = 1;
          for (i = 8; i < 16; i++) {
            u = u + (z[i] & 255) | 0;
            z[i] = u & 255;
            u >>>= 8;
          }
          b -= 64;
          cpos += 64;
          mpos += 64;
        }
        if (b > 0) {
          crypto_core_salsa20(x, z, k, sigma);
          for (i = 0; i < b; i++)
            c[cpos + i] = m[mpos + i] ^ x[i];
        }
        return 0;
      }
      function crypto_stream_salsa20(c, cpos, b, n, k) {
        var z = new Uint8Array(16), x = new Uint8Array(64);
        var u, i;
        for (i = 0; i < 16; i++)
          z[i] = 0;
        for (i = 0; i < 8; i++)
          z[i] = n[i];
        while (b >= 64) {
          crypto_core_salsa20(x, z, k, sigma);
          for (i = 0; i < 64; i++)
            c[cpos + i] = x[i];
          u = 1;
          for (i = 8; i < 16; i++) {
            u = u + (z[i] & 255) | 0;
            z[i] = u & 255;
            u >>>= 8;
          }
          b -= 64;
          cpos += 64;
        }
        if (b > 0) {
          crypto_core_salsa20(x, z, k, sigma);
          for (i = 0; i < b; i++)
            c[cpos + i] = x[i];
        }
        return 0;
      }
      function crypto_stream(c, cpos, d, n, k) {
        var s = new Uint8Array(32);
        crypto_core_hsalsa20(s, n, k, sigma);
        var sn = new Uint8Array(8);
        for (var i = 0; i < 8; i++)
          sn[i] = n[i + 16];
        return crypto_stream_salsa20(c, cpos, d, sn, s);
      }
      function crypto_stream_xor(c, cpos, m, mpos, d, n, k) {
        var s = new Uint8Array(32);
        crypto_core_hsalsa20(s, n, k, sigma);
        var sn = new Uint8Array(8);
        for (var i = 0; i < 8; i++)
          sn[i] = n[i + 16];
        return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s);
      }
      var poly1305 = function(key) {
        this.buffer = new Uint8Array(16);
        this.r = new Uint16Array(10);
        this.h = new Uint16Array(10);
        this.pad = new Uint16Array(8);
        this.leftover = 0;
        this.fin = 0;
        var t0, t1, t2, t3, t4, t5, t6, t7;
        t0 = key[0] & 255 | (key[1] & 255) << 8;
        this.r[0] = t0 & 8191;
        t1 = key[2] & 255 | (key[3] & 255) << 8;
        this.r[1] = (t0 >>> 13 | t1 << 3) & 8191;
        t2 = key[4] & 255 | (key[5] & 255) << 8;
        this.r[2] = (t1 >>> 10 | t2 << 6) & 7939;
        t3 = key[6] & 255 | (key[7] & 255) << 8;
        this.r[3] = (t2 >>> 7 | t3 << 9) & 8191;
        t4 = key[8] & 255 | (key[9] & 255) << 8;
        this.r[4] = (t3 >>> 4 | t4 << 12) & 255;
        this.r[5] = t4 >>> 1 & 8190;
        t5 = key[10] & 255 | (key[11] & 255) << 8;
        this.r[6] = (t4 >>> 14 | t5 << 2) & 8191;
        t6 = key[12] & 255 | (key[13] & 255) << 8;
        this.r[7] = (t5 >>> 11 | t6 << 5) & 8065;
        t7 = key[14] & 255 | (key[15] & 255) << 8;
        this.r[8] = (t6 >>> 8 | t7 << 8) & 8191;
        this.r[9] = t7 >>> 5 & 127;
        this.pad[0] = key[16] & 255 | (key[17] & 255) << 8;
        this.pad[1] = key[18] & 255 | (key[19] & 255) << 8;
        this.pad[2] = key[20] & 255 | (key[21] & 255) << 8;
        this.pad[3] = key[22] & 255 | (key[23] & 255) << 8;
        this.pad[4] = key[24] & 255 | (key[25] & 255) << 8;
        this.pad[5] = key[26] & 255 | (key[27] & 255) << 8;
        this.pad[6] = key[28] & 255 | (key[29] & 255) << 8;
        this.pad[7] = key[30] & 255 | (key[31] & 255) << 8;
      };
      poly1305.prototype.blocks = function(m, mpos, bytes) {
        var hibit = this.fin ? 0 : 1 << 11;
        var t0, t1, t2, t3, t4, t5, t6, t7, c;
        var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
        var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9];
        var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9];
        while (bytes >= 16) {
          t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8;
          h0 += t0 & 8191;
          t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8;
          h1 += (t0 >>> 13 | t1 << 3) & 8191;
          t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8;
          h2 += (t1 >>> 10 | t2 << 6) & 8191;
          t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8;
          h3 += (t2 >>> 7 | t3 << 9) & 8191;
          t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8;
          h4 += (t3 >>> 4 | t4 << 12) & 8191;
          h5 += t4 >>> 1 & 8191;
          t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8;
          h6 += (t4 >>> 14 | t5 << 2) & 8191;
          t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8;
          h7 += (t5 >>> 11 | t6 << 5) & 8191;
          t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8;
          h8 += (t6 >>> 8 | t7 << 8) & 8191;
          h9 += t7 >>> 5 | hibit;
          c = 0;
          d0 = c;
          d0 += h0 * r0;
          d0 += h1 * (5 * r9);
          d0 += h2 * (5 * r8);
          d0 += h3 * (5 * r7);
          d0 += h4 * (5 * r6);
          c = d0 >>> 13;
          d0 &= 8191;
          d0 += h5 * (5 * r5);
          d0 += h6 * (5 * r4);
          d0 += h7 * (5 * r3);
          d0 += h8 * (5 * r2);
          d0 += h9 * (5 * r1);
          c += d0 >>> 13;
          d0 &= 8191;
          d1 = c;
          d1 += h0 * r1;
          d1 += h1 * r0;
          d1 += h2 * (5 * r9);
          d1 += h3 * (5 * r8);
          d1 += h4 * (5 * r7);
          c = d1 >>> 13;
          d1 &= 8191;
          d1 += h5 * (5 * r6);
          d1 += h6 * (5 * r5);
          d1 += h7 * (5 * r4);
          d1 += h8 * (5 * r3);
          d1 += h9 * (5 * r2);
          c += d1 >>> 13;
          d1 &= 8191;
          d2 = c;
          d2 += h0 * r2;
          d2 += h1 * r1;
          d2 += h2 * r0;
          d2 += h3 * (5 * r9);
          d2 += h4 * (5 * r8);
          c = d2 >>> 13;
          d2 &= 8191;
          d2 += h5 * (5 * r7);
          d2 += h6 * (5 * r6);
          d2 += h7 * (5 * r5);
          d2 += h8 * (5 * r4);
          d2 += h9 * (5 * r3);
          c += d2 >>> 13;
          d2 &= 8191;
          d3 = c;
          d3 += h0 * r3;
          d3 += h1 * r2;
          d3 += h2 * r1;
          d3 += h3 * r0;
          d3 += h4 * (5 * r9);
          c = d3 >>> 13;
          d3 &= 8191;
          d3 += h5 * (5 * r8);
          d3 += h6 * (5 * r7);
          d3 += h7 * (5 * r6);
          d3 += h8 * (5 * r5);
          d3 += h9 * (5 * r4);
          c += d3 >>> 13;
          d3 &= 8191;
          d4 = c;
          d4 += h0 * r4;
          d4 += h1 * r3;
          d4 += h2 * r2;
          d4 += h3 * r1;
          d4 += h4 * r0;
          c = d4 >>> 13;
          d4 &= 8191;
          d4 += h5 * (5 * r9);
          d4 += h6 * (5 * r8);
          d4 += h7 * (5 * r7);
          d4 += h8 * (5 * r6);
          d4 += h9 * (5 * r5);
          c += d4 >>> 13;
          d4 &= 8191;
          d5 = c;
          d5 += h0 * r5;
          d5 += h1 * r4;
          d5 += h2 * r3;
          d5 += h3 * r2;
          d5 += h4 * r1;
          c = d5 >>> 13;
          d5 &= 8191;
          d5 += h5 * r0;
          d5 += h6 * (5 * r9);
          d5 += h7 * (5 * r8);
          d5 += h8 * (5 * r7);
          d5 += h9 * (5 * r6);
          c += d5 >>> 13;
          d5 &= 8191;
          d6 = c;
          d6 += h0 * r6;
          d6 += h1 * r5;
          d6 += h2 * r4;
          d6 += h3 * r3;
          d6 += h4 * r2;
          c = d6 >>> 13;
          d6 &= 8191;
          d6 += h5 * r1;
          d6 += h6 * r0;
          d6 += h7 * (5 * r9);
          d6 += h8 * (5 * r8);
          d6 += h9 * (5 * r7);
          c += d6 >>> 13;
          d6 &= 8191;
          d7 = c;
          d7 += h0 * r7;
          d7 += h1 * r6;
          d7 += h2 * r5;
          d7 += h3 * r4;
          d7 += h4 * r3;
          c = d7 >>> 13;
          d7 &= 8191;
          d7 += h5 * r2;
          d7 += h6 * r1;
          d7 += h7 * r0;
          d7 += h8 * (5 * r9);
          d7 += h9 * (5 * r8);
          c += d7 >>> 13;
          d7 &= 8191;
          d8 = c;
          d8 += h0 * r8;
          d8 += h1 * r7;
          d8 += h2 * r6;
          d8 += h3 * r5;
          d8 += h4 * r4;
          c = d8 >>> 13;
          d8 &= 8191;
          d8 += h5 * r3;
          d8 += h6 * r2;
          d8 += h7 * r1;
          d8 += h8 * r0;
          d8 += h9 * (5 * r9);
          c += d8 >>> 13;
          d8 &= 8191;
          d9 = c;
          d9 += h0 * r9;
          d9 += h1 * r8;
          d9 += h2 * r7;
          d9 += h3 * r6;
          d9 += h4 * r5;
          c = d9 >>> 13;
          d9 &= 8191;
          d9 += h5 * r4;
          d9 += h6 * r3;
          d9 += h7 * r2;
          d9 += h8 * r1;
          d9 += h9 * r0;
          c += d9 >>> 13;
          d9 &= 8191;
          c = (c << 2) + c | 0;
          c = c + d0 | 0;
          d0 = c & 8191;
          c = c >>> 13;
          d1 += c;
          h0 = d0;
          h1 = d1;
          h2 = d2;
          h3 = d3;
          h4 = d4;
          h5 = d5;
          h6 = d6;
          h7 = d7;
          h8 = d8;
          h9 = d9;
          mpos += 16;
          bytes -= 16;
        }
        this.h[0] = h0;
        this.h[1] = h1;
        this.h[2] = h2;
        this.h[3] = h3;
        this.h[4] = h4;
        this.h[5] = h5;
        this.h[6] = h6;
        this.h[7] = h7;
        this.h[8] = h8;
        this.h[9] = h9;
      };
      poly1305.prototype.finish = function(mac, macpos) {
        var g = new Uint16Array(10);
        var c, mask, f2, i;
        if (this.leftover) {
          i = this.leftover;
          this.buffer[i++] = 1;
          for (; i < 16; i++)
            this.buffer[i] = 0;
          this.fin = 1;
          this.blocks(this.buffer, 0, 16);
        }
        c = this.h[1] >>> 13;
        this.h[1] &= 8191;
        for (i = 2; i < 10; i++) {
          this.h[i] += c;
          c = this.h[i] >>> 13;
          this.h[i] &= 8191;
        }
        this.h[0] += c * 5;
        c = this.h[0] >>> 13;
        this.h[0] &= 8191;
        this.h[1] += c;
        c = this.h[1] >>> 13;
        this.h[1] &= 8191;
        this.h[2] += c;
        g[0] = this.h[0] + 5;
        c = g[0] >>> 13;
        g[0] &= 8191;
        for (i = 1; i < 10; i++) {
          g[i] = this.h[i] + c;
          c = g[i] >>> 13;
          g[i] &= 8191;
        }
        g[9] -= 1 << 13;
        mask = (c ^ 1) - 1;
        for (i = 0; i < 10; i++)
          g[i] &= mask;
        mask = ~mask;
        for (i = 0; i < 10; i++)
          this.h[i] = this.h[i] & mask | g[i];
        this.h[0] = (this.h[0] | this.h[1] << 13) & 65535;
        this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535;
        this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535;
        this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535;
        this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535;
        this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535;
        this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535;
        this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535;
        f2 = this.h[0] + this.pad[0];
        this.h[0] = f2 & 65535;
        for (i = 1; i < 8; i++) {
          f2 = (this.h[i] + this.pad[i] | 0) + (f2 >>> 16) | 0;
          this.h[i] = f2 & 65535;
        }
        mac[macpos + 0] = this.h[0] >>> 0 & 255;
        mac[macpos + 1] = this.h[0] >>> 8 & 255;
        mac[macpos + 2] = this.h[1] >>> 0 & 255;
        mac[macpos + 3] = this.h[1] >>> 8 & 255;
        mac[macpos + 4] = this.h[2] >>> 0 & 255;
        mac[macpos + 5] = this.h[2] >>> 8 & 255;
        mac[macpos + 6] = this.h[3] >>> 0 & 255;
        mac[macpos + 7] = this.h[3] >>> 8 & 255;
        mac[macpos + 8] = this.h[4] >>> 0 & 255;
        mac[macpos + 9] = this.h[4] >>> 8 & 255;
        mac[macpos + 10] = this.h[5] >>> 0 & 255;
        mac[macpos + 11] = this.h[5] >>> 8 & 255;
        mac[macpos + 12] = this.h[6] >>> 0 & 255;
        mac[macpos + 13] = this.h[6] >>> 8 & 255;
        mac[macpos + 14] = this.h[7] >>> 0 & 255;
        mac[macpos + 15] = this.h[7] >>> 8 & 255;
      };
      poly1305.prototype.update = function(m, mpos, bytes) {
        var i, want;
        if (this.leftover) {
          want = 16 - this.leftover;
          if (want > bytes)
            want = bytes;
          for (i = 0; i < want; i++)
            this.buffer[this.leftover + i] = m[mpos + i];
          bytes -= want;
          mpos += want;
          this.leftover += want;
          if (this.leftover < 16)
            return;
          this.blocks(this.buffer, 0, 16);
          this.leftover = 0;
        }
        if (bytes >= 16) {
          want = bytes - bytes % 16;
          this.blocks(m, mpos, want);
          mpos += want;
          bytes -= want;
        }
        if (bytes) {
          for (i = 0; i < bytes; i++)
            this.buffer[this.leftover + i] = m[mpos + i];
          this.leftover += bytes;
        }
      };
      function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
        var s = new poly1305(k);
        s.update(m, mpos, n);
        s.finish(out, outpos);
        return 0;
      }
      function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
        var x = new Uint8Array(16);
        crypto_onetimeauth(x, 0, m, mpos, n, k);
        return crypto_verify_16(h, hpos, x, 0);
      }
      function crypto_secretbox(c, m, d, n, k) {
        var i;
        if (d < 32)
          return -1;
        crypto_stream_xor(c, 0, m, 0, d, n, k);
        crypto_onetimeauth(c, 16, c, 32, d - 32, c);
        for (i = 0; i < 16; i++)
          c[i] = 0;
        return 0;
      }
      function crypto_secretbox_open(m, c, d, n, k) {
        var i;
        var x = new Uint8Array(32);
        if (d < 32)
          return -1;
        crypto_stream(x, 0, 32, n, k);
        if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0)
          return -1;
        crypto_stream_xor(m, 0, c, 0, d, n, k);
        for (i = 0; i < 32; i++)
          m[i] = 0;
        return 0;
      }
      function set25519(r, a) {
        var i;
        for (i = 0; i < 16; i++)
          r[i] = a[i] | 0;
      }
      function car25519(o) {
        var i, v, c = 1;
        for (i = 0; i < 16; i++) {
          v = o[i] + c + 65535;
          c = Math.floor(v / 65536);
          o[i] = v - c * 65536;
        }
        o[0] += c - 1 + 37 * (c - 1);
      }
      function sel25519(p, q2, b) {
        var t, c = ~(b - 1);
        for (var i = 0; i < 16; i++) {
          t = c & (p[i] ^ q2[i]);
          p[i] ^= t;
          q2[i] ^= t;
        }
      }
      function pack25519(o, n) {
        var i, j, b;
        var m = gf(), t = gf();
        for (i = 0; i < 16; i++)
          t[i] = n[i];
        car25519(t);
        car25519(t);
        car25519(t);
        for (j = 0; j < 2; j++) {
          m[0] = t[0] - 65517;
          for (i = 1; i < 15; i++) {
            m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1);
            m[i - 1] &= 65535;
          }
          m[15] = t[15] - 32767 - (m[14] >> 16 & 1);
          b = m[15] >> 16 & 1;
          m[14] &= 65535;
          sel25519(t, m, 1 - b);
        }
        for (i = 0; i < 16; i++) {
          o[2 * i] = t[i] & 255;
          o[2 * i + 1] = t[i] >> 8;
        }
      }
      function neq25519(a, b) {
        var c = new Uint8Array(32), d = new Uint8Array(32);
        pack25519(c, a);
        pack25519(d, b);
        return crypto_verify_32(c, 0, d, 0);
      }
      function par25519(a) {
        var d = new Uint8Array(32);
        pack25519(d, a);
        return d[0] & 1;
      }
      function unpack25519(o, n) {
        var i;
        for (i = 0; i < 16; i++)
          o[i] = n[2 * i] + (n[2 * i + 1] << 8);
        o[15] &= 32767;
      }
      function A(o, a, b) {
        for (var i = 0; i < 16; i++)
          o[i] = a[i] + b[i];
      }
      function Z(o, a, b) {
        for (var i = 0; i < 16; i++)
          o[i] = a[i] - b[i];
      }
      function M(o, a, b) {
        var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];
        v = a[0];
        t0 += v * b0;
        t1 += v * b1;
        t2 += v * b2;
        t3 += v * b3;
        t4 += v * b4;
        t5 += v * b5;
        t6 += v * b6;
        t7 += v * b7;
        t8 += v * b8;
        t9 += v * b9;
        t10 += v * b10;
        t11 += v * b11;
        t12 += v * b12;
        t13 += v * b13;
        t14 += v * b14;
        t15 += v * b15;
        v = a[1];
        t1 += v * b0;
        t2 += v * b1;
        t3 += v * b2;
        t4 += v * b3;
        t5 += v * b4;
        t6 += v * b5;
        t7 += v * b6;
        t8 += v * b7;
        t9 += v * b8;
        t10 += v * b9;
        t11 += v * b10;
        t12 += v * b11;
        t13 += v * b12;
        t14 += v * b13;
        t15 += v * b14;
        t16 += v * b15;
        v = a[2];
        t2 += v * b0;
        t3 += v * b1;
        t4 += v * b2;
        t5 += v * b3;
        t6 += v * b4;
        t7 += v * b5;
        t8 += v * b6;
        t9 += v * b7;
        t10 += v * b8;
        t11 += v * b9;
        t12 += v * b10;
        t13 += v * b11;
        t14 += v * b12;
        t15 += v * b13;
        t16 += v * b14;
        t17 += v * b15;
        v = a[3];
        t3 += v * b0;
        t4 += v * b1;
        t5 += v * b2;
        t6 += v * b3;
        t7 += v * b4;
        t8 += v * b5;
        t9 += v * b6;
        t10 += v * b7;
        t11 += v * b8;
        t12 += v * b9;
        t13 += v * b10;
        t14 += v * b11;
        t15 += v * b12;
        t16 += v * b13;
        t17 += v * b14;
        t18 += v * b15;
        v = a[4];
        t4 += v * b0;
        t5 += v * b1;
        t6 += v * b2;
        t7 += v * b3;
        t8 += v * b4;
        t9 += v * b5;
        t10 += v * b6;
        t11 += v * b7;
        t12 += v * b8;
        t13 += v * b9;
        t14 += v * b10;
        t15 += v * b11;
        t16 += v * b12;
        t17 += v * b13;
        t18 += v * b14;
        t19 += v * b15;
        v = a[5];
        t5 += v * b0;
        t6 += v * b1;
        t7 += v * b2;
        t8 += v * b3;
        t9 += v * b4;
        t10 += v * b5;
        t11 += v * b6;
        t12 += v * b7;
        t13 += v * b8;
        t14 += v * b9;
        t15 += v * b10;
        t16 += v * b11;
        t17 += v * b12;
        t18 += v * b13;
        t19 += v * b14;
        t20 += v * b15;
        v = a[6];
        t6 += v * b0;
        t7 += v * b1;
        t8 += v * b2;
        t9 += v * b3;
        t10 += v * b4;
        t11 += v * b5;
        t12 += v * b6;
        t13 += v * b7;
        t14 += v * b8;
        t15 += v * b9;
        t16 += v * b10;
        t17 += v * b11;
        t18 += v * b12;
        t19 += v * b13;
        t20 += v * b14;
        t21 += v * b15;
        v = a[7];
        t7 += v * b0;
        t8 += v * b1;
        t9 += v * b2;
        t10 += v * b3;
        t11 += v * b4;
        t12 += v * b5;
        t13 += v * b6;
        t14 += v * b7;
        t15 += v * b8;
        t16 += v * b9;
        t17 += v * b10;
        t18 += v * b11;
        t19 += v * b12;
        t20 += v * b13;
        t21 += v * b14;
        t22 += v * b15;
        v = a[8];
        t8 += v * b0;
        t9 += v * b1;
        t10 += v * b2;
        t11 += v * b3;
        t12 += v * b4;
        t13 += v * b5;
        t14 += v * b6;
        t15 += v * b7;
        t16 += v * b8;
        t17 += v * b9;
        t18 += v * b10;
        t19 += v * b11;
        t20 += v * b12;
        t21 += v * b13;
        t22 += v * b14;
        t23 += v * b15;
        v = a[9];
        t9 += v * b0;
        t10 += v * b1;
        t11 += v * b2;
        t12 += v * b3;
        t13 += v * b4;
        t14 += v * b5;
        t15 += v * b6;
        t16 += v * b7;
        t17 += v * b8;
        t18 += v * b9;
        t19 += v * b10;
        t20 += v * b11;
        t21 += v * b12;
        t22 += v * b13;
        t23 += v * b14;
        t24 += v * b15;
        v = a[10];
        t10 += v * b0;
        t11 += v * b1;
        t12 += v * b2;
        t13 += v * b3;
        t14 += v * b4;
        t15 += v * b5;
        t16 += v * b6;
        t17 += v * b7;
        t18 += v * b8;
        t19 += v * b9;
        t20 += v * b10;
        t21 += v * b11;
        t22 += v * b12;
        t23 += v * b13;
        t24 += v * b14;
        t25 += v * b15;
        v = a[11];
        t11 += v * b0;
        t12 += v * b1;
        t13 += v * b2;
        t14 += v * b3;
        t15 += v * b4;
        t16 += v * b5;
        t17 += v * b6;
        t18 += v * b7;
        t19 += v * b8;
        t20 += v * b9;
        t21 += v * b10;
        t22 += v * b11;
        t23 += v * b12;
        t24 += v * b13;
        t25 += v * b14;
        t26 += v * b15;
        v = a[12];
        t12 += v * b0;
        t13 += v * b1;
        t14 += v * b2;
        t15 += v * b3;
        t16 += v * b4;
        t17 += v * b5;
        t18 += v * b6;
        t19 += v * b7;
        t20 += v * b8;
        t21 += v * b9;
        t22 += v * b10;
        t23 += v * b11;
        t24 += v * b12;
        t25 += v * b13;
        t26 += v * b14;
        t27 += v * b15;
        v = a[13];
        t13 += v * b0;
        t14 += v * b1;
        t15 += v * b2;
        t16 += v * b3;
        t17 += v * b4;
        t18 += v * b5;
        t19 += v * b6;
        t20 += v * b7;
        t21 += v * b8;
        t22 += v * b9;
        t23 += v * b10;
        t24 += v * b11;
        t25 += v * b12;
        t26 += v * b13;
        t27 += v * b14;
        t28 += v * b15;
        v = a[14];
        t14 += v * b0;
        t15 += v * b1;
        t16 += v * b2;
        t17 += v * b3;
        t18 += v * b4;
        t19 += v * b5;
        t20 += v * b6;
        t21 += v * b7;
        t22 += v * b8;
        t23 += v * b9;
        t24 += v * b10;
        t25 += v * b11;
        t26 += v * b12;
        t27 += v * b13;
        t28 += v * b14;
        t29 += v * b15;
        v = a[15];
        t15 += v * b0;
        t16 += v * b1;
        t17 += v * b2;
        t18 += v * b3;
        t19 += v * b4;
        t20 += v * b5;
        t21 += v * b6;
        t22 += v * b7;
        t23 += v * b8;
        t24 += v * b9;
        t25 += v * b10;
        t26 += v * b11;
        t27 += v * b12;
        t28 += v * b13;
        t29 += v * b14;
        t30 += v * b15;
        t0 += 38 * t16;
        t1 += 38 * t17;
        t2 += 38 * t18;
        t3 += 38 * t19;
        t4 += 38 * t20;
        t5 += 38 * t21;
        t6 += 38 * t22;
        t7 += 38 * t23;
        t8 += 38 * t24;
        t9 += 38 * t25;
        t10 += 38 * t26;
        t11 += 38 * t27;
        t12 += 38 * t28;
        t13 += 38 * t29;
        t14 += 38 * t30;
        c = 1;
        v = t0 + c + 65535;
        c = Math.floor(v / 65536);
        t0 = v - c * 65536;
        v = t1 + c + 65535;
        c = Math.floor(v / 65536);
        t1 = v - c * 65536;
        v = t2 + c + 65535;
        c = Math.floor(v / 65536);
        t2 = v - c * 65536;
        v = t3 + c + 65535;
        c = Math.floor(v / 65536);
        t3 = v - c * 65536;
        v = t4 + c + 65535;
        c = Math.floor(v / 65536);
        t4 = v - c * 65536;
        v = t5 + c + 65535;
        c = Math.floor(v / 65536);
        t5 = v - c * 65536;
        v = t6 + c + 65535;
        c = Math.floor(v / 65536);
        t6 = v - c * 65536;
        v = t7 + c + 65535;
        c = Math.floor(v / 65536);
        t7 = v - c * 65536;
        v = t8 + c + 65535;
        c = Math.floor(v / 65536);
        t8 = v - c * 65536;
        v = t9 + c + 65535;
        c = Math.floor(v / 65536);
        t9 = v - c * 65536;
        v = t10 + c + 65535;
        c = Math.floor(v / 65536);
        t10 = v - c * 65536;
        v = t11 + c + 65535;
        c = Math.floor(v / 65536);
        t11 = v - c * 65536;
        v = t12 + c + 65535;
        c = Math.floor(v / 65536);
        t12 = v - c * 65536;
        v = t13 + c + 65535;
        c = Math.floor(v / 65536);
        t13 = v - c * 65536;
        v = t14 + c + 65535;
        c = Math.floor(v / 65536);
        t14 = v - c * 65536;
        v = t15 + c + 65535;
        c = Math.floor(v / 65536);
        t15 = v - c * 65536;
        t0 += c - 1 + 37 * (c - 1);
        c = 1;
        v = t0 + c + 65535;
        c = Math.floor(v / 65536);
        t0 = v - c * 65536;
        v = t1 + c + 65535;
        c = Math.floor(v / 65536);
        t1 = v - c * 65536;
        v = t2 + c + 65535;
        c = Math.floor(v / 65536);
        t2 = v - c * 65536;
        v = t3 + c + 65535;
        c = Math.floor(v / 65536);
        t3 = v - c * 65536;
        v = t4 + c + 65535;
        c = Math.floor(v / 65536);
        t4 = v - c * 65536;
        v = t5 + c + 65535;
        c = Math.floor(v / 65536);
        t5 = v - c * 65536;
        v = t6 + c + 65535;
        c = Math.floor(v / 65536);
        t6 = v - c * 65536;
        v = t7 + c + 65535;
        c = Math.floor(v / 65536);
        t7 = v - c * 65536;
        v = t8 + c + 65535;
        c = Math.floor(v / 65536);
        t8 = v - c * 65536;
        v = t9 + c + 65535;
        c = Math.floor(v / 65536);
        t9 = v - c * 65536;
        v = t10 + c + 65535;
        c = Math.floor(v / 65536);
        t10 = v - c * 65536;
        v = t11 + c + 65535;
        c = Math.floor(v / 65536);
        t11 = v - c * 65536;
        v = t12 + c + 65535;
        c = Math.floor(v / 65536);
        t12 = v - c * 65536;
        v = t13 + c + 65535;
        c = Math.floor(v / 65536);
        t13 = v - c * 65536;
        v = t14 + c + 65535;
        c = Math.floor(v / 65536);
        t14 = v - c * 65536;
        v = t15 + c + 65535;
        c = Math.floor(v / 65536);
        t15 = v - c * 65536;
        t0 += c - 1 + 37 * (c - 1);
        o[0] = t0;
        o[1] = t1;
        o[2] = t2;
        o[3] = t3;
        o[4] = t4;
        o[5] = t5;
        o[6] = t6;
        o[7] = t7;
        o[8] = t8;
        o[9] = t9;
        o[10] = t10;
        o[11] = t11;
        o[12] = t12;
        o[13] = t13;
        o[14] = t14;
        o[15] = t15;
      }
      function S(o, a) {
        M(o, a, a);
      }
      function inv25519(o, i) {
        var c = gf();
        var a;
        for (a = 0; a < 16; a++)
          c[a] = i[a];
        for (a = 253; a >= 0; a--) {
          S(c, c);
          if (a !== 2 && a !== 4)
            M(c, c, i);
        }
        for (a = 0; a < 16; a++)
          o[a] = c[a];
      }
      function pow2523(o, i) {
        var c = gf();
        var a;
        for (a = 0; a < 16; a++)
          c[a] = i[a];
        for (a = 250; a >= 0; a--) {
          S(c, c);
          if (a !== 1)
            M(c, c, i);
        }
        for (a = 0; a < 16; a++)
          o[a] = c[a];
      }
      function crypto_scalarmult(q2, n, p) {
        var z = new Uint8Array(32);
        var x = new Float64Array(80), r, i;
        var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f2 = gf();
        for (i = 0; i < 31; i++)
          z[i] = n[i];
        z[31] = n[31] & 127 | 64;
        z[0] &= 248;
        unpack25519(x, p);
        for (i = 0; i < 16; i++) {
          b[i] = x[i];
          d[i] = a[i] = c[i] = 0;
        }
        a[0] = d[0] = 1;
        for (i = 254; i >= 0; --i) {
          r = z[i >>> 3] >>> (i & 7) & 1;
          sel25519(a, b, r);
          sel25519(c, d, r);
          A(e, a, c);
          Z(a, a, c);
          A(c, b, d);
          Z(b, b, d);
          S(d, e);
          S(f2, a);
          M(a, c, a);
          M(c, b, e);
          A(e, a, c);
          Z(a, a, c);
          S(b, a);
          Z(c, d, f2);
          M(a, c, _121665);
          A(a, a, d);
          M(c, c, a);
          M(a, d, f2);
          M(d, b, x);
          S(b, e);
          sel25519(a, b, r);
          sel25519(c, d, r);
        }
        for (i = 0; i < 16; i++) {
          x[i + 16] = a[i];
          x[i + 32] = c[i];
          x[i + 48] = b[i];
          x[i + 64] = d[i];
        }
        var x32 = x.subarray(32);
        var x16 = x.subarray(16);
        inv25519(x32, x32);
        M(x16, x16, x32);
        pack25519(q2, x16);
        return 0;
      }
      function crypto_scalarmult_base(q2, n) {
        return crypto_scalarmult(q2, n, _9);
      }
      function crypto_box_keypair(y, x) {
        randombytes(x, 32);
        return crypto_scalarmult_base(y, x);
      }
      function crypto_box_beforenm(k, y, x) {
        var s = new Uint8Array(32);
        crypto_scalarmult(s, x, y);
        return crypto_core_hsalsa20(k, _0, s, sigma);
      }
      var crypto_box_afternm = crypto_secretbox;
      var crypto_box_open_afternm = crypto_secretbox_open;
      function crypto_box(c, m, d, n, y, x) {
        var k = new Uint8Array(32);
        crypto_box_beforenm(k, y, x);
        return crypto_box_afternm(c, m, d, n, k);
      }
      function crypto_box_open(m, c, d, n, y, x) {
        var k = new Uint8Array(32);
        crypto_box_beforenm(k, y, x);
        return crypto_box_open_afternm(m, c, d, n, k);
      }
      var K = [
        1116352408,
        3609767458,
        1899447441,
        602891725,
        3049323471,
        3964484399,
        3921009573,
        2173295548,
        961987163,
        4081628472,
        1508970993,
        3053834265,
        2453635748,
        2937671579,
        2870763221,
        3664609560,
        3624381080,
        2734883394,
        310598401,
        1164996542,
        607225278,
        1323610764,
        1426881987,
        3590304994,
        1925078388,
        4068182383,
        2162078206,
        991336113,
        2614888103,
        633803317,
        3248222580,
        3479774868,
        3835390401,
        2666613458,
        4022224774,
        944711139,
        264347078,
        2341262773,
        604807628,
        2007800933,
        770255983,
        1495990901,
        1249150122,
        1856431235,
        1555081692,
        3175218132,
        1996064986,
        2198950837,
        2554220882,
        3999719339,
        2821834349,
        766784016,
        2952996808,
        2566594879,
        3210313671,
        3203337956,
        3336571891,
        1034457026,
        3584528711,
        2466948901,
        113926993,
        3758326383,
        338241895,
        168717936,
        666307205,
        1188179964,
        773529912,
        1546045734,
        1294757372,
        1522805485,
        1396182291,
        2643833823,
        1695183700,
        2343527390,
        1986661051,
        1014477480,
        2177026350,
        1206759142,
        2456956037,
        344077627,
        2730485921,
        1290863460,
        2820302411,
        3158454273,
        3259730800,
        3505952657,
        3345764771,
        106217008,
        3516065817,
        3606008344,
        3600352804,
        1432725776,
        4094571909,
        1467031594,
        275423344,
        851169720,
        430227734,
        3100823752,
        506948616,
        1363258195,
        659060556,
        3750685593,
        883997877,
        3785050280,
        958139571,
        3318307427,
        1322822218,
        3812723403,
        1537002063,
        2003034995,
        1747873779,
        3602036899,
        1955562222,
        1575990012,
        2024104815,
        1125592928,
        2227730452,
        2716904306,
        2361852424,
        442776044,
        2428436474,
        593698344,
        2756734187,
        3733110249,
        3204031479,
        2999351573,
        3329325298,
        3815920427,
        3391569614,
        3928383900,
        3515267271,
        566280711,
        3940187606,
        3454069534,
        4118630271,
        4000239992,
        116418474,
        1914138554,
        174292421,
        2731055270,
        289380356,
        3203993006,
        460393269,
        320620315,
        685471733,
        587496836,
        852142971,
        1086792851,
        1017036298,
        365543100,
        1126000580,
        2618297676,
        1288033470,
        3409855158,
        1501505948,
        4234509866,
        1607167915,
        987167468,
        1816402316,
        1246189591
      ];
      function crypto_hashblocks_hl(hh, hl, m, n) {
        var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d;
        var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7];
        var pos = 0;
        while (n >= 128) {
          for (i = 0; i < 16; i++) {
            j = 8 * i + pos;
            wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3];
            wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7];
          }
          for (i = 0; i < 80; i++) {
            bh0 = ah0;
            bh1 = ah1;
            bh2 = ah2;
            bh3 = ah3;
            bh4 = ah4;
            bh5 = ah5;
            bh6 = ah6;
            bh7 = ah7;
            bl0 = al0;
            bl1 = al1;
            bl2 = al2;
            bl3 = al3;
            bl4 = al4;
            bl5 = al5;
            bl6 = al6;
            bl7 = al7;
            h = ah7;
            l = al7;
            a = l & 65535;
            b = l >>> 16;
            c = h & 65535;
            d = h >>> 16;
            h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32));
            l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32));
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            h = ah4 & ah5 ^ ~ah4 & ah6;
            l = al4 & al5 ^ ~al4 & al6;
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            h = K[i * 2];
            l = K[i * 2 + 1];
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            h = wh[i % 16];
            l = wl[i % 16];
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            b += a >>> 16;
            c += b >>> 16;
            d += c >>> 16;
            th = c & 65535 | d << 16;
            tl = a & 65535 | b << 16;
            h = th;
            l = tl;
            a = l & 65535;
            b = l >>> 16;
            c = h & 65535;
            d = h >>> 16;
            h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32));
            l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32));
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2;
            l = al0 & al1 ^ al0 & al2 ^ al1 & al2;
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            b += a >>> 16;
            c += b >>> 16;
            d += c >>> 16;
            bh7 = c & 65535 | d << 16;
            bl7 = a & 65535 | b << 16;
            h = bh3;
            l = bl3;
            a = l & 65535;
            b = l >>> 16;
            c = h & 65535;
            d = h >>> 16;
            h = th;
            l = tl;
            a += l & 65535;
            b += l >>> 16;
            c += h & 65535;
            d += h >>> 16;
            b += a >>> 16;
            c += b >>> 16;
            d += c >>> 16;
            bh3 = c & 65535 | d << 16;
            bl3 = a & 65535 | b << 16;
            ah1 = bh0;
            ah2 = bh1;
            ah3 = bh2;
            ah4 = bh3;
            ah5 = bh4;
            ah6 = bh5;
            ah7 = bh6;
            ah0 = bh7;
            al1 = bl0;
            al2 = bl1;
            al3 = bl2;
            al4 = bl3;
            al5 = bl4;
            al6 = bl5;
            al7 = bl6;
            al0 = bl7;
            if (i % 16 === 15) {
              for (j = 0; j < 16; j++) {
                h = wh[j];
                l = wl[j];
                a = l & 65535;
                b = l >>> 16;
                c = h & 65535;
                d = h >>> 16;
                h = wh[(j + 9) % 16];
                l = wl[(j + 9) % 16];
                a += l & 65535;
                b += l >>> 16;
                c += h & 65535;
                d += h >>> 16;
                th = wh[(j + 1) % 16];
                tl = wl[(j + 1) % 16];
                h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7;
                l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7);
                a += l & 65535;
                b += l >>> 16;
                c += h & 65535;
                d += h >>> 16;
                th = wh[(j + 14) % 16];
                tl = wl[(j + 14) % 16];
                h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6;
                l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6);
                a += l & 65535;
                b += l >>> 16;
                c += h & 65535;
                d += h >>> 16;
                b += a >>> 16;
                c += b >>> 16;
                d += c >>> 16;
                wh[j] = c & 65535 | d << 16;
                wl[j] = a & 65535 | b << 16;
              }
            }
          }
          h = ah0;
          l = al0;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[0];
          l = hl[0];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[0] = ah0 = c & 65535 | d << 16;
          hl[0] = al0 = a & 65535 | b << 16;
          h = ah1;
          l = al1;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[1];
          l = hl[1];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[1] = ah1 = c & 65535 | d << 16;
          hl[1] = al1 = a & 65535 | b << 16;
          h = ah2;
          l = al2;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[2];
          l = hl[2];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[2] = ah2 = c & 65535 | d << 16;
          hl[2] = al2 = a & 65535 | b << 16;
          h = ah3;
          l = al3;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[3];
          l = hl[3];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[3] = ah3 = c & 65535 | d << 16;
          hl[3] = al3 = a & 65535 | b << 16;
          h = ah4;
          l = al4;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[4];
          l = hl[4];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[4] = ah4 = c & 65535 | d << 16;
          hl[4] = al4 = a & 65535 | b << 16;
          h = ah5;
          l = al5;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[5];
          l = hl[5];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[5] = ah5 = c & 65535 | d << 16;
          hl[5] = al5 = a & 65535 | b << 16;
          h = ah6;
          l = al6;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[6];
          l = hl[6];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[6] = ah6 = c & 65535 | d << 16;
          hl[6] = al6 = a & 65535 | b << 16;
          h = ah7;
          l = al7;
          a = l & 65535;
          b = l >>> 16;
          c = h & 65535;
          d = h >>> 16;
          h = hh[7];
          l = hl[7];
          a += l & 65535;
          b += l >>> 16;
          c += h & 65535;
          d += h >>> 16;
          b += a >>> 16;
          c += b >>> 16;
          d += c >>> 16;
          hh[7] = ah7 = c & 65535 | d << 16;
          hl[7] = al7 = a & 65535 | b << 16;
          pos += 128;
          n -= 128;
        }
        return n;
      }
      function crypto_hash(out, m, n) {
        var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n;
        hh[0] = 1779033703;
        hh[1] = 3144134277;
        hh[2] = 1013904242;
        hh[3] = 2773480762;
        hh[4] = 1359893119;
        hh[5] = 2600822924;
        hh[6] = 528734635;
        hh[7] = 1541459225;
        hl[0] = 4089235720;
        hl[1] = 2227873595;
        hl[2] = 4271175723;
        hl[3] = 1595750129;
        hl[4] = 2917565137;
        hl[5] = 725511199;
        hl[6] = 4215389547;
        hl[7] = 327033209;
        crypto_hashblocks_hl(hh, hl, m, n);
        n %= 128;
        for (i = 0; i < n; i++)
          x[i] = m[b - n + i];
        x[n] = 128;
        n = 256 - 128 * (n < 112 ? 1 : 0);
        x[n - 9] = 0;
        ts64(x, n - 8, b / 536870912 | 0, b << 3);
        crypto_hashblocks_hl(hh, hl, x, n);
        for (i = 0; i < 8; i++)
          ts64(out, 8 * i, hh[i], hl[i]);
        return 0;
      }
      function add(p, q2) {
        var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f2 = gf(), g = gf(), h = gf(), t = gf();
        Z(a, p[1], p[0]);
        Z(t, q2[1], q2[0]);
        M(a, a, t);
        A(b, p[0], p[1]);
        A(t, q2[0], q2[1]);
        M(b, b, t);
        M(c, p[3], q2[3]);
        M(c, c, D2);
        M(d, p[2], q2[2]);
        A(d, d, d);
        Z(e, b, a);
        Z(f2, d, c);
        A(g, d, c);
        A(h, b, a);
        M(p[0], e, f2);
        M(p[1], h, g);
        M(p[2], g, f2);
        M(p[3], e, h);
      }
      function cswap(p, q2, b) {
        var i;
        for (i = 0; i < 4; i++) {
          sel25519(p[i], q2[i], b);
        }
      }
      function pack(r, p) {
        var tx = gf(), ty = gf(), zi = gf();
        inv25519(zi, p[2]);
        M(tx, p[0], zi);
        M(ty, p[1], zi);
        pack25519(r, ty);
        r[31] ^= par25519(tx) << 7;
      }
      function scalarmult(p, q2, s) {
        var b, i;
        set25519(p[0], gf0);
        set25519(p[1], gf1);
        set25519(p[2], gf1);
        set25519(p[3], gf0);
        for (i = 255; i >= 0; --i) {
          b = s[i / 8 | 0] >> (i & 7) & 1;
          cswap(p, q2, b);
          add(q2, p);
          add(p, p);
          cswap(p, q2, b);
        }
      }
      function scalarbase(p, s) {
        var q2 = [gf(), gf(), gf(), gf()];
        set25519(q2[0], X);
        set25519(q2[1], Y);
        set25519(q2[2], gf1);
        M(q2[3], X, Y);
        scalarmult(p, q2, s);
      }
      function crypto_sign_keypair(pk, sk, seeded) {
        var d = new Uint8Array(64);
        var p = [gf(), gf(), gf(), gf()];
        var i;
        if (!seeded)
          randombytes(sk, 32);
        crypto_hash(d, sk, 32);
        d[0] &= 248;
        d[31] &= 127;
        d[31] |= 64;
        scalarbase(p, d);
        pack(pk, p);
        for (i = 0; i < 32; i++)
          sk[i + 32] = pk[i];
        return 0;
      }
      var L = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]);
      function modL(r, x) {
        var carry, i, j, k;
        for (i = 63; i >= 32; --i) {
          carry = 0;
          for (j = i - 32, k = i - 12; j < k; ++j) {
            x[j] += carry - 16 * x[i] * L[j - (i - 32)];
            carry = x[j] + 128 >> 8;
            x[j] -= carry * 256;
          }
          x[j] += carry;
          x[i] = 0;
        }
        carry = 0;
        for (j = 0; j < 32; j++) {
          x[j] += carry - (x[31] >> 4) * L[j];
          carry = x[j] >> 8;
          x[j] &= 255;
        }
        for (j = 0; j < 32; j++)
          x[j] -= carry * L[j];
        for (i = 0; i < 32; i++) {
          x[i + 1] += x[i] >> 8;
          r[i] = x[i] & 255;
        }
      }
      function reduce(r) {
        var x = new Float64Array(64), i;
        for (i = 0; i < 64; i++)
          x[i] = r[i];
        for (i = 0; i < 64; i++)
          r[i] = 0;
        modL(r, x);
      }
      function crypto_sign(sm, m, n, sk) {
        var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
        var i, j, x = new Float64Array(64);
        var p = [gf(), gf(), gf(), gf()];
        crypto_hash(d, sk, 32);
        d[0] &= 248;
        d[31] &= 127;
        d[31] |= 64;
        var smlen = n + 64;
        for (i = 0; i < n; i++)
          sm[64 + i] = m[i];
        for (i = 0; i < 32; i++)
          sm[32 + i] = d[32 + i];
        crypto_hash(r, sm.subarray(32), n + 32);
        reduce(r);
        scalarbase(p, r);
        pack(sm, p);
        for (i = 32; i < 64; i++)
          sm[i] = sk[i];
        crypto_hash(h, sm, n + 64);
        reduce(h);
        for (i = 0; i < 64; i++)
          x[i] = 0;
        for (i = 0; i < 32; i++)
          x[i] = r[i];
        for (i = 0; i < 32; i++) {
          for (j = 0; j < 32; j++) {
            x[i + j] += h[i] * d[j];
          }
        }
        modL(sm.subarray(32), x);
        return smlen;
      }
      function unpackneg(r, p) {
        var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf();
        set25519(r[2], gf1);
        unpack25519(r[1], p);
        S(num, r[1]);
        M(den, num, D);
        Z(num, num, r[2]);
        A(den, r[2], den);
        S(den2, den);
        S(den4, den2);
        M(den6, den4, den2);
        M(t, den6, num);
        M(t, t, den);
        pow2523(t, t);
        M(t, t, num);
        M(t, t, den);
        M(t, t, den);
        M(r[0], t, den);
        S(chk, r[0]);
        M(chk, chk, den);
        if (neq25519(chk, num))
          M(r[0], r[0], I);
        S(chk, r[0]);
        M(chk, chk, den);
        if (neq25519(chk, num))
          return -1;
        if (par25519(r[0]) === p[31] >> 7)
          Z(r[0], gf0, r[0]);
        M(r[3], r[0], r[1]);
        return 0;
      }
      function crypto_sign_open(m, sm, n, pk) {
        var i, mlen;
        var t = new Uint8Array(32), h = new Uint8Array(64);
        var p = [gf(), gf(), gf(), gf()], q2 = [gf(), gf(), gf(), gf()];
        mlen = -1;
        if (n < 64)
          return -1;
        if (unpackneg(q2, pk))
          return -1;
        for (i = 0; i < n; i++)
          m[i] = sm[i];
        for (i = 0; i < 32; i++)
          m[i + 32] = pk[i];
        crypto_hash(h, m, n);
        reduce(h);
        scalarmult(p, q2, h);
        scalarbase(q2, sm.subarray(32));
        add(p, q2);
        pack(t, p);
        n -= 64;
        if (crypto_verify_32(sm, 0, t, 0)) {
          for (i = 0; i < n; i++)
            m[i] = 0;
          return -1;
        }
        for (i = 0; i < n; i++)
          m[i] = sm[i + 64];
        mlen = n;
        return mlen;
      }
      var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64;
      nacl.lowlevel = {
        crypto_core_hsalsa20,
        crypto_stream_xor,
        crypto_stream,
        crypto_stream_salsa20_xor,
        crypto_stream_salsa20,
        crypto_onetimeauth,
        crypto_onetimeauth_verify,
        crypto_verify_16,
        crypto_verify_32,
        crypto_secretbox,
        crypto_secretbox_open,
        crypto_scalarmult,
        crypto_scalarmult_base,
        crypto_box_beforenm,
        crypto_box_afternm,
        crypto_box,
        crypto_box_open,
        crypto_box_keypair,
        crypto_hash,
        crypto_sign,
        crypto_sign_keypair,
        crypto_sign_open,
        crypto_secretbox_KEYBYTES,
        crypto_secretbox_NONCEBYTES,
        crypto_secretbox_ZEROBYTES,
        crypto_secretbox_BOXZEROBYTES,
        crypto_scalarmult_BYTES,
        crypto_scalarmult_SCALARBYTES,
        crypto_box_PUBLICKEYBYTES,
        crypto_box_SECRETKEYBYTES,
        crypto_box_BEFORENMBYTES,
        crypto_box_NONCEBYTES,
        crypto_box_ZEROBYTES,
        crypto_box_BOXZEROBYTES,
        crypto_sign_BYTES,
        crypto_sign_PUBLICKEYBYTES,
        crypto_sign_SECRETKEYBYTES,
        crypto_sign_SEEDBYTES,
        crypto_hash_BYTES
      };
      function checkLengths(k, n) {
        if (k.length !== crypto_secretbox_KEYBYTES)
          throw new Error("bad key size");
        if (n.length !== crypto_secretbox_NONCEBYTES)
          throw new Error("bad nonce size");
      }
      function checkBoxLengths(pk, sk) {
        if (pk.length !== crypto_box_PUBLICKEYBYTES)
          throw new Error("bad public key size");
        if (sk.length !== crypto_box_SECRETKEYBYTES)
          throw new Error("bad secret key size");
      }
      function checkArrayTypes() {
        var t, i;
        for (i = 0; i < arguments.length; i++) {
          if ((t = Object.prototype.toString.call(arguments[i])) !== "[object Uint8Array]")
            throw new TypeError("unexpected type " + t + ", use Uint8Array");
        }
      }
      function cleanup(arr) {
        for (var i = 0; i < arr.length; i++)
          arr[i] = 0;
      }
      if (!nacl.util) {
        nacl.util = {};
        nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
          throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js");
        };
      }
      nacl.randomBytes = function(n) {
        var b = new Uint8Array(n);
        randombytes(b, n);
        return b;
      };
      nacl.secretbox = function(msg, nonce, key) {
        checkArrayTypes(msg, nonce, key);
        checkLengths(key, nonce);
        var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
        var c = new Uint8Array(m.length);
        for (var i = 0; i < msg.length; i++)
          m[i + crypto_secretbox_ZEROBYTES] = msg[i];
        crypto_secretbox(c, m, m.length, nonce, key);
        return c.subarray(crypto_secretbox_BOXZEROBYTES);
      };
      nacl.secretbox.open = function(box, nonce, key) {
        checkArrayTypes(box, nonce, key);
        checkLengths(key, nonce);
        var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
        var m = new Uint8Array(c.length);
        for (var i = 0; i < box.length; i++)
          c[i + crypto_secretbox_BOXZEROBYTES] = box[i];
        if (c.length < 32)
          return false;
        if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0)
          return false;
        return m.subarray(crypto_secretbox_ZEROBYTES);
      };
      nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
      nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
      nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
      nacl.scalarMult = function(n, p) {
        checkArrayTypes(n, p);
        if (n.length !== crypto_scalarmult_SCALARBYTES)
          throw new Error("bad n size");
        if (p.length !== crypto_scalarmult_BYTES)
          throw new Error("bad p size");
        var q2 = new Uint8Array(crypto_scalarmult_BYTES);
        crypto_scalarmult(q2, n, p);
        return q2;
      };
      nacl.scalarMult.base = function(n) {
        checkArrayTypes(n);
        if (n.length !== crypto_scalarmult_SCALARBYTES)
          throw new Error("bad n size");
        var q2 = new Uint8Array(crypto_scalarmult_BYTES);
        crypto_scalarmult_base(q2, n);
        return q2;
      };
      nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
      nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
      nacl.box = function(msg, nonce, publicKey, secretKey) {
        var k = nacl.box.before(publicKey, secretKey);
        return nacl.secretbox(msg, nonce, k);
      };
      nacl.box.before = function(publicKey, secretKey) {
        checkArrayTypes(publicKey, secretKey);
        checkBoxLengths(publicKey, secretKey);
        var k = new Uint8Array(crypto_box_BEFORENMBYTES);
        crypto_box_beforenm(k, publicKey, secretKey);
        return k;
      };
      nacl.box.after = nacl.secretbox;
      nacl.box.open = function(msg, nonce, publicKey, secretKey) {
        var k = nacl.box.before(publicKey, secretKey);
        return nacl.secretbox.open(msg, nonce, k);
      };
      nacl.box.open.after = nacl.secretbox.open;
      nacl.box.keyPair = function() {
        var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
        var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
        crypto_box_keypair(pk, sk);
        return { publicKey: pk, secretKey: sk };
      };
      nacl.box.keyPair.fromSecretKey = function(secretKey) {
        checkArrayTypes(secretKey);
        if (secretKey.length !== crypto_box_SECRETKEYBYTES)
          throw new Error("bad secret key size");
        var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
        crypto_scalarmult_base(pk, secretKey);
        return { publicKey: pk, secretKey: new Uint8Array(secretKey) };
      };
      nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
      nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
      nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
      nacl.box.nonceLength = crypto_box_NONCEBYTES;
      nacl.box.overheadLength = nacl.secretbox.overheadLength;
      nacl.sign = function(msg, secretKey) {
        checkArrayTypes(msg, secretKey);
        if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
          throw new Error("bad secret key size");
        var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length);
        crypto_sign(signedMsg, msg, msg.length, secretKey);
        return signedMsg;
      };
      nacl.sign.open = function(signedMsg, publicKey) {
        if (arguments.length !== 2)
          throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");
        checkArrayTypes(signedMsg, publicKey);
        if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
          throw new Error("bad public key size");
        var tmp = new Uint8Array(signedMsg.length);
        var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
        if (mlen < 0)
          return null;
        var m = new Uint8Array(mlen);
        for (var i = 0; i < m.length; i++)
          m[i] = tmp[i];
        return m;
      };
      nacl.sign.detached = function(msg, secretKey) {
        var signedMsg = nacl.sign(msg, secretKey);
        var sig = new Uint8Array(crypto_sign_BYTES);
        for (var i = 0; i < sig.length; i++)
          sig[i] = signedMsg[i];
        return sig;
      };
      nacl.sign.detached.verify = function(msg, sig, publicKey) {
        checkArrayTypes(msg, sig, publicKey);
        if (sig.length !== crypto_sign_BYTES)
          throw new Error("bad signature size");
        if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
          throw new Error("bad public key size");
        var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
        var m = new Uint8Array(crypto_sign_BYTES + msg.length);
        var i;
        for (i = 0; i < crypto_sign_BYTES; i++)
          sm[i] = sig[i];
        for (i = 0; i < msg.length; i++)
          sm[i + crypto_sign_BYTES] = msg[i];
        return crypto_sign_open(m, sm, sm.length, publicKey) >= 0;
      };
      nacl.sign.keyPair = function() {
        var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
        var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
        crypto_sign_keypair(pk, sk);
        return { publicKey: pk, secretKey: sk };
      };
      nacl.sign.keyPair.fromSecretKey = function(secretKey) {
        checkArrayTypes(secretKey);
        if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
          throw new Error("bad secret key size");
        var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
        for (var i = 0; i < pk.length; i++)
          pk[i] = secretKey[32 + i];
        return { publicKey: pk, secretKey: new Uint8Array(secretKey) };
      };
      nacl.sign.keyPair.fromSeed = function(seed) {
        checkArrayTypes(seed);
        if (seed.length !== crypto_sign_SEEDBYTES)
          throw new Error("bad seed size");
        var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
        var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
        for (var i = 0; i < 32; i++)
          sk[i] = seed[i];
        crypto_sign_keypair(pk, sk, true);
        return { publicKey: pk, secretKey: sk };
      };
      nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
      nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
      nacl.sign.seedLength = crypto_sign_SEEDBYTES;
      nacl.sign.signatureLength = crypto_sign_BYTES;
      nacl.hash = function(msg) {
        checkArrayTypes(msg);
        var h = new Uint8Array(crypto_hash_BYTES);
        crypto_hash(h, msg, msg.length);
        return h;
      };
      nacl.hash.hashLength = crypto_hash_BYTES;
      nacl.verify = function(x, y) {
        checkArrayTypes(x, y);
        if (x.length === 0 || y.length === 0)
          return false;
        if (x.length !== y.length)
          return false;
        return vn(x, 0, y, 0, x.length) === 0 ? true : false;
      };
      nacl.setPRNG = function(fn2) {
        randombytes = fn2;
      };
      (function() {
        var crypto3 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null;
        if (crypto3 && crypto3.getRandomValues) {
          var QUOTA = 65536;
          nacl.setPRNG(function(x, n) {
            var i, v = new Uint8Array(n);
            for (i = 0; i < n; i += QUOTA) {
              crypto3.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
            }
            for (i = 0; i < n; i++)
              x[i] = v[i];
            cleanup(v);
          });
        } else if (typeof require !== "undefined") {
          crypto3 = require("crypto");
          if (crypto3 && crypto3.randomBytes) {
            nacl.setPRNG(function(x, n) {
              var i, v = crypto3.randomBytes(n);
              for (i = 0; i < n; i++)
                x[i] = v[i];
              cleanup(v);
            });
          }
        }
      })();
    })(typeof module2 !== "undefined" && module2.exports ? module2.exports : self.nacl = self.nacl || {});
  }
});

// node_modules/sshpk/lib/utils.js
var require_utils6 = __commonJS({
  "node_modules/sshpk/lib/utils.js"(exports2, module2) {
    module2.exports = {
      bufferSplit,
      addRSAMissing,
      calculateDSAPublic,
      calculateED25519Public,
      calculateX25519Public,
      mpNormalize,
      mpDenormalize,
      ecNormalize,
      countZeros,
      assertCompatible,
      isCompatible,
      opensslKeyDeriv,
      opensshCipherInfo,
      publicFromPrivateECDSA,
      zeroPadToLength,
      writeBitString,
      readBitString,
      pbkdf2
    };
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var PrivateKey = require_private_key();
    var Key = require_key();
    var crypto3 = require("crypto");
    var algs = require_algs();
    var asn1 = require_lib9();
    var ec = require_ec();
    var jsbn = require_jsbn().BigInteger;
    var nacl = require_nacl_fast();
    var MAX_CLASS_DEPTH = 3;
    function isCompatible(obj2, klass, needVer) {
      if (obj2 === null || typeof obj2 !== "object")
        return false;
      if (needVer === void 0)
        needVer = klass.prototype._sshpkApiVersion;
      if (obj2 instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0])
        return true;
      var proto = Object.getPrototypeOf(obj2);
      var depth = 0;
      while (proto.constructor.name !== klass.name) {
        proto = Object.getPrototypeOf(proto);
        if (!proto || ++depth > MAX_CLASS_DEPTH)
          return false;
      }
      if (proto.constructor.name !== klass.name)
        return false;
      var ver = proto._sshpkApiVersion;
      if (ver === void 0)
        ver = klass._oldVersionDetect(obj2);
      if (ver[0] != needVer[0] || ver[1] < needVer[1])
        return false;
      return true;
    }
    function assertCompatible(obj2, klass, needVer, name) {
      if (name === void 0)
        name = "object";
      assert.ok(obj2, name + " must not be null");
      assert.object(obj2, name + " must be an object");
      if (needVer === void 0)
        needVer = klass.prototype._sshpkApiVersion;
      if (obj2 instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0])
        return;
      var proto = Object.getPrototypeOf(obj2);
      var depth = 0;
      while (proto.constructor.name !== klass.name) {
        proto = Object.getPrototypeOf(proto);
        assert.ok(
          proto && ++depth <= MAX_CLASS_DEPTH,
          name + " must be a " + klass.name + " instance"
        );
      }
      assert.strictEqual(
        proto.constructor.name,
        klass.name,
        name + " must be a " + klass.name + " instance"
      );
      var ver = proto._sshpkApiVersion;
      if (ver === void 0)
        ver = klass._oldVersionDetect(obj2);
      assert.ok(
        ver[0] == needVer[0] && ver[1] >= needVer[1],
        name + " must be compatible with " + klass.name + " klass version " + needVer[0] + "." + needVer[1]
      );
    }
    var CIPHER_LEN = {
      "des-ede3-cbc": { key: 24, iv: 8 },
      "aes-128-cbc": { key: 16, iv: 16 },
      "aes-256-cbc": { key: 32, iv: 16 }
    };
    var PKCS5_SALT_LEN = 8;
    function opensslKeyDeriv(cipher, salt, passphrase, count) {
      assert.buffer(salt, "salt");
      assert.buffer(passphrase, "passphrase");
      assert.number(count, "iteration count");
      var clen = CIPHER_LEN[cipher];
      assert.object(clen, "supported cipher");
      salt = salt.slice(0, PKCS5_SALT_LEN);
      var D, D_prev, bufs;
      var material = Buffer3.alloc(0);
      while (material.length < clen.key + clen.iv) {
        bufs = [];
        if (D_prev)
          bufs.push(D_prev);
        bufs.push(passphrase);
        bufs.push(salt);
        D = Buffer3.concat(bufs);
        for (var j = 0; j < count; ++j)
          D = crypto3.createHash("md5").update(D).digest();
        material = Buffer3.concat([material, D]);
        D_prev = D;
      }
      return {
        key: material.slice(0, clen.key),
        iv: material.slice(clen.key, clen.key + clen.iv)
      };
    }
    function pbkdf2(hashAlg, salt, iterations, size, passphrase) {
      var hkey = Buffer3.alloc(salt.length + 4);
      salt.copy(hkey);
      var gen = 0, ts = [];
      var i = 1;
      while (gen < size) {
        var t = T(i++);
        gen += t.length;
        ts.push(t);
      }
      return Buffer3.concat(ts).slice(0, size);
      function T(I) {
        hkey.writeUInt32BE(I, hkey.length - 4);
        var hmac = crypto3.createHmac(hashAlg, passphrase);
        hmac.update(hkey);
        var Ti = hmac.digest();
        var Uc = Ti;
        var c = 1;
        while (c++ < iterations) {
          hmac = crypto3.createHmac(hashAlg, passphrase);
          hmac.update(Uc);
          Uc = hmac.digest();
          for (var x = 0; x < Ti.length; ++x)
            Ti[x] ^= Uc[x];
        }
        return Ti;
      }
    }
    function countZeros(buf) {
      var o = 0, obit = 8;
      while (o < buf.length) {
        var mask = 1 << obit;
        if ((buf[o] & mask) === mask)
          break;
        obit--;
        if (obit < 0) {
          o++;
          obit = 8;
        }
      }
      return o * 8 + (8 - obit) - 1;
    }
    function bufferSplit(buf, chr) {
      assert.buffer(buf);
      assert.string(chr);
      var parts = [];
      var lastPart = 0;
      var matches = 0;
      for (var i = 0; i < buf.length; ++i) {
        if (buf[i] === chr.charCodeAt(matches))
          ++matches;
        else if (buf[i] === chr.charCodeAt(0))
          matches = 1;
        else
          matches = 0;
        if (matches >= chr.length) {
          var newPart = i + 1;
          parts.push(buf.slice(lastPart, newPart - matches));
          lastPart = newPart;
          matches = 0;
        }
      }
      if (lastPart <= buf.length)
        parts.push(buf.slice(lastPart, buf.length));
      return parts;
    }
    function ecNormalize(buf, addZero) {
      assert.buffer(buf);
      if (buf[0] === 0 && buf[1] === 4) {
        if (addZero)
          return buf;
        return buf.slice(1);
      } else if (buf[0] === 4) {
        if (!addZero)
          return buf;
      } else {
        while (buf[0] === 0)
          buf = buf.slice(1);
        if (buf[0] === 2 || buf[0] === 3)
          throw new Error("Compressed elliptic curve points are not supported");
        if (buf[0] !== 4)
          throw new Error("Not a valid elliptic curve point");
        if (!addZero)
          return buf;
      }
      var b = Buffer3.alloc(buf.length + 1);
      b[0] = 0;
      buf.copy(b, 1);
      return b;
    }
    function readBitString(der, tag) {
      if (tag === void 0)
        tag = asn1.Ber.BitString;
      var buf = der.readString(tag, true);
      assert.strictEqual(buf[0], 0, "bit strings with unused bits are not supported (0x" + buf[0].toString(16) + ")");
      return buf.slice(1);
    }
    function writeBitString(der, buf, tag) {
      if (tag === void 0)
        tag = asn1.Ber.BitString;
      var b = Buffer3.alloc(buf.length + 1);
      b[0] = 0;
      buf.copy(b, 1);
      der.writeBuffer(b, tag);
    }
    function mpNormalize(buf) {
      assert.buffer(buf);
      while (buf.length > 1 && buf[0] === 0 && (buf[1] & 128) === 0)
        buf = buf.slice(1);
      if ((buf[0] & 128) === 128) {
        var b = Buffer3.alloc(buf.length + 1);
        b[0] = 0;
        buf.copy(b, 1);
        buf = b;
      }
      return buf;
    }
    function mpDenormalize(buf) {
      assert.buffer(buf);
      while (buf.length > 1 && buf[0] === 0)
        buf = buf.slice(1);
      return buf;
    }
    function zeroPadToLength(buf, len) {
      assert.buffer(buf);
      assert.number(len);
      while (buf.length > len) {
        assert.equal(buf[0], 0);
        buf = buf.slice(1);
      }
      while (buf.length < len) {
        var b = Buffer3.alloc(buf.length + 1);
        b[0] = 0;
        buf.copy(b, 1);
        buf = b;
      }
      return buf;
    }
    function bigintToMpBuf(bigint) {
      var buf = Buffer3.from(bigint.toByteArray());
      buf = mpNormalize(buf);
      return buf;
    }
    function calculateDSAPublic(g, p, x) {
      assert.buffer(g);
      assert.buffer(p);
      assert.buffer(x);
      g = new jsbn(g);
      p = new jsbn(p);
      x = new jsbn(x);
      var y = g.modPow(x, p);
      var ybuf = bigintToMpBuf(y);
      return ybuf;
    }
    function calculateED25519Public(k) {
      assert.buffer(k);
      var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));
      return Buffer3.from(kp.publicKey);
    }
    function calculateX25519Public(k) {
      assert.buffer(k);
      var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));
      return Buffer3.from(kp.publicKey);
    }
    function addRSAMissing(key) {
      assert.object(key);
      assertCompatible(key, PrivateKey, [1, 1]);
      var d = new jsbn(key.part.d.data);
      var buf;
      if (!key.part.dmodp) {
        var p = new jsbn(key.part.p.data);
        var dmodp = d.mod(p.subtract(1));
        buf = bigintToMpBuf(dmodp);
        key.part.dmodp = { name: "dmodp", data: buf };
        key.parts.push(key.part.dmodp);
      }
      if (!key.part.dmodq) {
        var q2 = new jsbn(key.part.q.data);
        var dmodq = d.mod(q2.subtract(1));
        buf = bigintToMpBuf(dmodq);
        key.part.dmodq = { name: "dmodq", data: buf };
        key.parts.push(key.part.dmodq);
      }
    }
    function publicFromPrivateECDSA(curveName, priv) {
      assert.string(curveName, "curveName");
      assert.buffer(priv);
      var params = algs.curves[curveName];
      var p = new jsbn(params.p);
      var a = new jsbn(params.a);
      var b = new jsbn(params.b);
      var curve = new ec.ECCurveFp(p, a, b);
      var G = curve.decodePointHex(params.G.toString("hex"));
      var d = new jsbn(mpNormalize(priv));
      var pub = G.multiply(d);
      pub = Buffer3.from(curve.encodePointHex(pub), "hex");
      var parts = [];
      parts.push({ name: "curve", data: Buffer3.from(curveName) });
      parts.push({ name: "Q", data: pub });
      var key = new Key({ type: "ecdsa", curve, parts });
      return key;
    }
    function opensshCipherInfo(cipher) {
      var inf = {};
      switch (cipher) {
        case "3des-cbc":
          inf.keySize = 24;
          inf.blockSize = 8;
          inf.opensslName = "des-ede3-cbc";
          break;
        case "blowfish-cbc":
          inf.keySize = 16;
          inf.blockSize = 8;
          inf.opensslName = "bf-cbc";
          break;
        case "aes128-cbc":
        case "aes128-ctr":
        case "aes128-gcm@openssh.com":
          inf.keySize = 16;
          inf.blockSize = 16;
          inf.opensslName = "aes-128-" + cipher.slice(7, 10);
          break;
        case "aes192-cbc":
        case "aes192-ctr":
        case "aes192-gcm@openssh.com":
          inf.keySize = 24;
          inf.blockSize = 16;
          inf.opensslName = "aes-192-" + cipher.slice(7, 10);
          break;
        case "aes256-cbc":
        case "aes256-ctr":
        case "aes256-gcm@openssh.com":
          inf.keySize = 32;
          inf.blockSize = 16;
          inf.opensslName = "aes-256-" + cipher.slice(7, 10);
          break;
        default:
          throw new Error(
            'Unsupported openssl cipher "' + cipher + '"'
          );
      }
      return inf;
    }
  }
});

// node_modules/sshpk/lib/ssh-buffer.js
var require_ssh_buffer = __commonJS({
  "node_modules/sshpk/lib/ssh-buffer.js"(exports2, module2) {
    module2.exports = SSHBuffer;
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    function SSHBuffer(opts) {
      assert.object(opts, "options");
      if (opts.buffer !== void 0)
        assert.buffer(opts.buffer, "options.buffer");
      this._size = opts.buffer ? opts.buffer.length : 1024;
      this._buffer = opts.buffer || Buffer3.alloc(this._size);
      this._offset = 0;
    }
    SSHBuffer.prototype.toBuffer = function() {
      return this._buffer.slice(0, this._offset);
    };
    SSHBuffer.prototype.atEnd = function() {
      return this._offset >= this._buffer.length;
    };
    SSHBuffer.prototype.remainder = function() {
      return this._buffer.slice(this._offset);
    };
    SSHBuffer.prototype.skip = function(n) {
      this._offset += n;
    };
    SSHBuffer.prototype.expand = function() {
      this._size *= 2;
      var buf = Buffer3.alloc(this._size);
      this._buffer.copy(buf, 0);
      this._buffer = buf;
    };
    SSHBuffer.prototype.readPart = function() {
      return { data: this.readBuffer() };
    };
    SSHBuffer.prototype.readBuffer = function() {
      var len = this._buffer.readUInt32BE(this._offset);
      this._offset += 4;
      assert.ok(
        this._offset + len <= this._buffer.length,
        "length out of bounds at +0x" + this._offset.toString(16) + " (data truncated?)"
      );
      var buf = this._buffer.slice(this._offset, this._offset + len);
      this._offset += len;
      return buf;
    };
    SSHBuffer.prototype.readString = function() {
      return this.readBuffer().toString();
    };
    SSHBuffer.prototype.readCString = function() {
      var offset2 = this._offset;
      while (offset2 < this._buffer.length && this._buffer[offset2] !== 0)
        offset2++;
      assert.ok(offset2 < this._buffer.length, "c string does not terminate");
      var str = this._buffer.slice(this._offset, offset2).toString();
      this._offset = offset2 + 1;
      return str;
    };
    SSHBuffer.prototype.readInt = function() {
      var v = this._buffer.readUInt32BE(this._offset);
      this._offset += 4;
      return v;
    };
    SSHBuffer.prototype.readInt64 = function() {
      assert.ok(
        this._offset + 8 < this._buffer.length,
        "buffer not long enough to read Int64"
      );
      var v = this._buffer.slice(this._offset, this._offset + 8);
      this._offset += 8;
      return v;
    };
    SSHBuffer.prototype.readChar = function() {
      var v = this._buffer[this._offset++];
      return v;
    };
    SSHBuffer.prototype.writeBuffer = function(buf) {
      while (this._offset + 4 + buf.length > this._size)
        this.expand();
      this._buffer.writeUInt32BE(buf.length, this._offset);
      this._offset += 4;
      buf.copy(this._buffer, this._offset);
      this._offset += buf.length;
    };
    SSHBuffer.prototype.writeString = function(str) {
      this.writeBuffer(Buffer3.from(str, "utf8"));
    };
    SSHBuffer.prototype.writeCString = function(str) {
      while (this._offset + 1 + str.length > this._size)
        this.expand();
      this._buffer.write(str, this._offset);
      this._offset += str.length;
      this._buffer[this._offset++] = 0;
    };
    SSHBuffer.prototype.writeInt = function(v) {
      while (this._offset + 4 > this._size)
        this.expand();
      this._buffer.writeUInt32BE(v, this._offset);
      this._offset += 4;
    };
    SSHBuffer.prototype.writeInt64 = function(v) {
      assert.buffer(v, "value");
      if (v.length > 8) {
        var lead = v.slice(0, v.length - 8);
        for (var i = 0; i < lead.length; ++i) {
          assert.strictEqual(
            lead[i],
            0,
            "must fit in 64 bits of precision"
          );
        }
        v = v.slice(v.length - 8, v.length);
      }
      while (this._offset + 8 > this._size)
        this.expand();
      v.copy(this._buffer, this._offset);
      this._offset += 8;
    };
    SSHBuffer.prototype.writeChar = function(v) {
      while (this._offset + 1 > this._size)
        this.expand();
      this._buffer[this._offset++] = v;
    };
    SSHBuffer.prototype.writePart = function(p) {
      this.writeBuffer(p.data);
    };
    SSHBuffer.prototype.write = function(buf) {
      while (this._offset + buf.length > this._size)
        this.expand();
      buf.copy(this._buffer, this._offset);
      this._offset += buf.length;
    };
  }
});

// node_modules/sshpk/lib/signature.js
var require_signature = __commonJS({
  "node_modules/sshpk/lib/signature.js"(exports2, module2) {
    module2.exports = Signature;
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var crypto3 = require("crypto");
    var errs = require_errors5();
    var utils = require_utils6();
    var asn1 = require_lib9();
    var SSHBuffer = require_ssh_buffer();
    var InvalidAlgorithmError = errs.InvalidAlgorithmError;
    var SignatureParseError = errs.SignatureParseError;
    function Signature(opts) {
      assert.object(opts, "options");
      assert.arrayOfObject(opts.parts, "options.parts");
      assert.string(opts.type, "options.type");
      var partLookup = {};
      for (var i = 0; i < opts.parts.length; ++i) {
        var part = opts.parts[i];
        partLookup[part.name] = part;
      }
      this.type = opts.type;
      this.hashAlgorithm = opts.hashAlgo;
      this.curve = opts.curve;
      this.parts = opts.parts;
      this.part = partLookup;
    }
    Signature.prototype.toBuffer = function(format) {
      if (format === void 0)
        format = "asn1";
      assert.string(format, "format");
      var buf;
      var stype = "ssh-" + this.type;
      switch (this.type) {
        case "rsa":
          switch (this.hashAlgorithm) {
            case "sha256":
              stype = "rsa-sha2-256";
              break;
            case "sha512":
              stype = "rsa-sha2-512";
              break;
            case "sha1":
            case void 0:
              break;
            default:
              throw new Error("SSH signature format does not support hash algorithm " + this.hashAlgorithm);
          }
          if (format === "ssh") {
            buf = new SSHBuffer({});
            buf.writeString(stype);
            buf.writePart(this.part.sig);
            return buf.toBuffer();
          } else {
            return this.part.sig.data;
          }
          break;
        case "ed25519":
          if (format === "ssh") {
            buf = new SSHBuffer({});
            buf.writeString(stype);
            buf.writePart(this.part.sig);
            return buf.toBuffer();
          } else {
            return this.part.sig.data;
          }
          break;
        case "dsa":
        case "ecdsa":
          var r, s;
          if (format === "asn1") {
            var der = new asn1.BerWriter();
            der.startSequence();
            r = utils.mpNormalize(this.part.r.data);
            s = utils.mpNormalize(this.part.s.data);
            der.writeBuffer(r, asn1.Ber.Integer);
            der.writeBuffer(s, asn1.Ber.Integer);
            der.endSequence();
            return der.buffer;
          } else if (format === "ssh" && this.type === "dsa") {
            buf = new SSHBuffer({});
            buf.writeString("ssh-dss");
            r = this.part.r.data;
            if (r.length > 20 && r[0] === 0)
              r = r.slice(1);
            s = this.part.s.data;
            if (s.length > 20 && s[0] === 0)
              s = s.slice(1);
            if (this.hashAlgorithm && this.hashAlgorithm !== "sha1" || r.length + s.length !== 40) {
              throw new Error("OpenSSH only supports DSA signatures with SHA1 hash");
            }
            buf.writeBuffer(Buffer3.concat([r, s]));
            return buf.toBuffer();
          } else if (format === "ssh" && this.type === "ecdsa") {
            var inner = new SSHBuffer({});
            r = this.part.r.data;
            inner.writeBuffer(r);
            inner.writePart(this.part.s);
            buf = new SSHBuffer({});
            var curve;
            if (r[0] === 0)
              r = r.slice(1);
            var sz = r.length * 8;
            if (sz === 256)
              curve = "nistp256";
            else if (sz === 384)
              curve = "nistp384";
            else if (sz === 528)
              curve = "nistp521";
            buf.writeString("ecdsa-sha2-" + curve);
            buf.writeBuffer(inner.toBuffer());
            return buf.toBuffer();
          }
          throw new Error("Invalid signature format");
        default:
          throw new Error("Invalid signature data");
      }
    };
    Signature.prototype.toString = function(format) {
      assert.optionalString(format, "format");
      return this.toBuffer(format).toString("base64");
    };
    Signature.parse = function(data, type, format) {
      if (typeof data === "string")
        data = Buffer3.from(data, "base64");
      assert.buffer(data, "data");
      assert.string(format, "format");
      assert.string(type, "type");
      var opts = {};
      opts.type = type.toLowerCase();
      opts.parts = [];
      try {
        assert.ok(data.length > 0, "signature must not be empty");
        switch (opts.type) {
          case "rsa":
            return parseOneNum(data, type, format, opts);
          case "ed25519":
            return parseOneNum(data, type, format, opts);
          case "dsa":
          case "ecdsa":
            if (format === "asn1")
              return parseDSAasn1(data, type, format, opts);
            else if (opts.type === "dsa")
              return parseDSA(data, type, format, opts);
            else
              return parseECDSA(data, type, format, opts);
          default:
            throw new InvalidAlgorithmError(type);
        }
      } catch (e) {
        if (e instanceof InvalidAlgorithmError)
          throw e;
        throw new SignatureParseError(type, format, e);
      }
    };
    function parseOneNum(data, type, format, opts) {
      if (format === "ssh") {
        try {
          var buf = new SSHBuffer({ buffer: data });
          var head = buf.readString();
        } catch (e) {
        }
        if (buf !== void 0) {
          var msg = "SSH signature does not match expected type (expected " + type + ", got " + head + ")";
          switch (head) {
            case "ssh-rsa":
              assert.strictEqual(type, "rsa", msg);
              opts.hashAlgo = "sha1";
              break;
            case "rsa-sha2-256":
              assert.strictEqual(type, "rsa", msg);
              opts.hashAlgo = "sha256";
              break;
            case "rsa-sha2-512":
              assert.strictEqual(type, "rsa", msg);
              opts.hashAlgo = "sha512";
              break;
            case "ssh-ed25519":
              assert.strictEqual(type, "ed25519", msg);
              opts.hashAlgo = "sha512";
              break;
            default:
              throw new Error("Unknown SSH signature type: " + head);
          }
          var sig = buf.readPart();
          assert.ok(buf.atEnd(), "extra trailing bytes");
          sig.name = "sig";
          opts.parts.push(sig);
          return new Signature(opts);
        }
      }
      opts.parts.push({ name: "sig", data });
      return new Signature(opts);
    }
    function parseDSAasn1(data, type, format, opts) {
      var der = new asn1.BerReader(data);
      der.readSequence();
      var r = der.readString(asn1.Ber.Integer, true);
      var s = der.readString(asn1.Ber.Integer, true);
      opts.parts.push({ name: "r", data: utils.mpNormalize(r) });
      opts.parts.push({ name: "s", data: utils.mpNormalize(s) });
      return new Signature(opts);
    }
    function parseDSA(data, type, format, opts) {
      if (data.length != 40) {
        var buf = new SSHBuffer({ buffer: data });
        var d = buf.readBuffer();
        if (d.toString("ascii") === "ssh-dss")
          d = buf.readBuffer();
        assert.ok(buf.atEnd(), "extra trailing bytes");
        assert.strictEqual(d.length, 40, "invalid inner length");
        data = d;
      }
      opts.parts.push({ name: "r", data: data.slice(0, 20) });
      opts.parts.push({ name: "s", data: data.slice(20, 40) });
      return new Signature(opts);
    }
    function parseECDSA(data, type, format, opts) {
      var buf = new SSHBuffer({ buffer: data });
      var r, s;
      var inner = buf.readBuffer();
      var stype = inner.toString("ascii");
      if (stype.slice(0, 6) === "ecdsa-") {
        var parts = stype.split("-");
        assert.strictEqual(parts[0], "ecdsa");
        assert.strictEqual(parts[1], "sha2");
        opts.curve = parts[2];
        switch (opts.curve) {
          case "nistp256":
            opts.hashAlgo = "sha256";
            break;
          case "nistp384":
            opts.hashAlgo = "sha384";
            break;
          case "nistp521":
            opts.hashAlgo = "sha512";
            break;
          default:
            throw new Error("Unsupported ECDSA curve: " + opts.curve);
        }
        inner = buf.readBuffer();
        assert.ok(buf.atEnd(), "extra trailing bytes on outer");
        buf = new SSHBuffer({ buffer: inner });
        r = buf.readPart();
      } else {
        r = { data: inner };
      }
      s = buf.readPart();
      assert.ok(buf.atEnd(), "extra trailing bytes");
      r.name = "r";
      s.name = "s";
      opts.parts.push(r);
      opts.parts.push(s);
      return new Signature(opts);
    }
    Signature.isSignature = function(obj2, ver) {
      return utils.isCompatible(obj2, Signature, ver);
    };
    Signature.prototype._sshpkApiVersion = [2, 1];
    Signature._oldVersionDetect = function(obj2) {
      assert.func(obj2.toBuffer);
      if (obj2.hasOwnProperty("hashAlgorithm"))
        return [2, 0];
      return [1, 0];
    };
  }
});

// node_modules/ecc-jsbn/lib/sec.js
var require_sec = __commonJS({
  "node_modules/ecc-jsbn/lib/sec.js"(exports2, module2) {
    var BigInteger = require_jsbn().BigInteger;
    var ECCurveFp = require_ec().ECCurveFp;
    function X9ECParameters(curve, g, n, h) {
      this.curve = curve;
      this.g = g;
      this.n = n;
      this.h = h;
    }
    function x9getCurve() {
      return this.curve;
    }
    function x9getG() {
      return this.g;
    }
    function x9getN() {
      return this.n;
    }
    function x9getH() {
      return this.h;
    }
    X9ECParameters.prototype.getCurve = x9getCurve;
    X9ECParameters.prototype.getG = x9getG;
    X9ECParameters.prototype.getN = x9getN;
    X9ECParameters.prototype.getH = x9getH;
    function fromHex(s) {
      return new BigInteger(s, 16);
    }
    function secp128r1() {
      var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
      var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC");
      var b = fromHex("E87579C11079F43DD824993C2CEE5ED3");
      var n = fromHex("FFFFFFFE0000000075A30D1B9038A115");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");
      return new X9ECParameters(curve, G, n, h);
    }
    function secp160k1() {
      var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
      var a = BigInteger.ZERO;
      var b = fromHex("7");
      var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");
      return new X9ECParameters(curve, G, n, h);
    }
    function secp160r1() {
      var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF");
      var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC");
      var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45");
      var n = fromHex("0100000000000000000001F4C8F927AED3CA752257");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");
      return new X9ECParameters(curve, G, n, h);
    }
    function secp192k1() {
      var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");
      var a = BigInteger.ZERO;
      var b = fromHex("3");
      var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");
      return new X9ECParameters(curve, G, n, h);
    }
    function secp192r1() {
      var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF");
      var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC");
      var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1");
      var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");
      return new X9ECParameters(curve, G, n, h);
    }
    function secp224r1() {
      var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001");
      var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE");
      var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4");
      var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");
      return new X9ECParameters(curve, G, n, h);
    }
    function secp256r1() {
      var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF");
      var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC");
      var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B");
      var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551");
      var h = BigInteger.ONE;
      var curve = new ECCurveFp(p, a, b);
      var G = curve.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");
      return new X9ECParameters(curve, G, n, h);
    }
    module2.exports = {
      "secp128r1": secp128r1,
      "secp160k1": secp160k1,
      "secp160r1": secp160r1,
      "secp192k1": secp192k1,
      "secp192r1": secp192r1,
      "secp224r1": secp224r1,
      "secp256r1": secp256r1
    };
  }
});

// node_modules/ecc-jsbn/index.js
var require_ecc_jsbn = __commonJS({
  "node_modules/ecc-jsbn/index.js"(exports2) {
    var crypto3 = require("crypto");
    var BigInteger = require_jsbn().BigInteger;
    var ECPointFp = require_ec().ECPointFp;
    var Buffer3 = require_safer().Buffer;
    exports2.ECCurves = require_sec();
    function unstupid(hex, len) {
      return hex.length >= len ? hex : unstupid("0" + hex, len);
    }
    exports2.ECKey = function(curve, key, isPublic) {
      var priv;
      var c = curve();
      var n = c.getN();
      var bytes = Math.floor(n.bitLength() / 8);
      if (key) {
        if (isPublic) {
          var curve = c.getCurve();
          this.P = curve.decodePointHex(key.toString("hex"));
        } else {
          if (key.length != bytes)
            return false;
          priv = new BigInteger(key.toString("hex"), 16);
        }
      } else {
        var n1 = n.subtract(BigInteger.ONE);
        var r = new BigInteger(crypto3.randomBytes(n.bitLength()));
        priv = r.mod(n1).add(BigInteger.ONE);
        this.P = c.getG().multiply(priv);
      }
      if (this.P) {
        this.PublicKey = Buffer3.from(c.getCurve().encodeCompressedPointHex(this.P), "hex");
      }
      if (priv) {
        this.PrivateKey = Buffer3.from(unstupid(priv.toString(16), bytes * 2), "hex");
        this.deriveSharedSecret = function(key2) {
          if (!key2 || !key2.P)
            return false;
          var S = key2.P.multiply(priv);
          return Buffer3.from(unstupid(S.getX().toBigInteger().toString(16), bytes * 2), "hex");
        };
      }
    };
  }
});

// node_modules/sshpk/lib/dhe.js
var require_dhe = __commonJS({
  "node_modules/sshpk/lib/dhe.js"(exports2, module2) {
    module2.exports = {
      DiffieHellman,
      generateECDSA,
      generateED25519
    };
    var assert = require_assert();
    var crypto3 = require("crypto");
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var nacl = require_nacl_fast();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var CRYPTO_HAVE_ECDH = crypto3.createECDH !== void 0;
    var ecdh = require_ecc_jsbn();
    var ec = require_ec();
    var jsbn = require_jsbn().BigInteger;
    function DiffieHellman(key) {
      utils.assertCompatible(key, Key, [1, 4], "key");
      this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]);
      this._algo = key.type;
      this._curve = key.curve;
      this._key = key;
      if (key.type === "dsa") {
        if (!CRYPTO_HAVE_ECDH) {
          throw new Error("Due to bugs in the node 0.10 crypto API, node 0.12.x or later is required to use DH");
        }
        this._dh = crypto3.createDiffieHellman(
          key.part.p.data,
          void 0,
          key.part.g.data,
          void 0
        );
        this._p = key.part.p;
        this._g = key.part.g;
        if (this._isPriv)
          this._dh.setPrivateKey(key.part.x.data);
        this._dh.setPublicKey(key.part.y.data);
      } else if (key.type === "ecdsa") {
        if (!CRYPTO_HAVE_ECDH) {
          this._ecParams = new X9ECParameters(this._curve);
          if (this._isPriv) {
            this._priv = new ECPrivate(
              this._ecParams,
              key.part.d.data
            );
          }
          return;
        }
        var curve = {
          "nistp256": "prime256v1",
          "nistp384": "secp384r1",
          "nistp521": "secp521r1"
        }[key.curve];
        this._dh = crypto3.createECDH(curve);
        if (typeof this._dh !== "object" || typeof this._dh.setPrivateKey !== "function") {
          CRYPTO_HAVE_ECDH = false;
          DiffieHellman.call(this, key);
          return;
        }
        if (this._isPriv)
          this._dh.setPrivateKey(key.part.d.data);
        this._dh.setPublicKey(key.part.Q.data);
      } else if (key.type === "curve25519") {
        if (this._isPriv) {
          utils.assertCompatible(key, PrivateKey, [1, 5], "key");
          this._priv = key.part.k.data;
        }
      } else {
        throw new Error("DH not supported for " + key.type + " keys");
      }
    }
    DiffieHellman.prototype.getPublicKey = function() {
      if (this._isPriv)
        return this._key.toPublic();
      return this._key;
    };
    DiffieHellman.prototype.getPrivateKey = function() {
      if (this._isPriv)
        return this._key;
      else
        return void 0;
    };
    DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey;
    DiffieHellman.prototype._keyCheck = function(pk, isPub) {
      assert.object(pk, "key");
      if (!isPub)
        utils.assertCompatible(pk, PrivateKey, [1, 3], "key");
      utils.assertCompatible(pk, Key, [1, 4], "key");
      if (pk.type !== this._algo) {
        throw new Error("A " + pk.type + " key cannot be used in " + this._algo + " Diffie-Hellman");
      }
      if (pk.curve !== this._curve) {
        throw new Error("A key from the " + pk.curve + " curve cannot be used with a " + this._curve + " Diffie-Hellman");
      }
      if (pk.type === "dsa") {
        assert.deepEqual(
          pk.part.p,
          this._p,
          "DSA key prime does not match"
        );
        assert.deepEqual(
          pk.part.g,
          this._g,
          "DSA key generator does not match"
        );
      }
    };
    DiffieHellman.prototype.setKey = function(pk) {
      this._keyCheck(pk);
      if (pk.type === "dsa") {
        this._dh.setPrivateKey(pk.part.x.data);
        this._dh.setPublicKey(pk.part.y.data);
      } else if (pk.type === "ecdsa") {
        if (CRYPTO_HAVE_ECDH) {
          this._dh.setPrivateKey(pk.part.d.data);
          this._dh.setPublicKey(pk.part.Q.data);
        } else {
          this._priv = new ECPrivate(
            this._ecParams,
            pk.part.d.data
          );
        }
      } else if (pk.type === "curve25519") {
        var k = pk.part.k;
        if (!pk.part.k)
          k = pk.part.r;
        this._priv = k.data;
        if (this._priv[0] === 0)
          this._priv = this._priv.slice(1);
        this._priv = this._priv.slice(0, 32);
      }
      this._key = pk;
      this._isPriv = true;
    };
    DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey;
    DiffieHellman.prototype.computeSecret = function(otherpk) {
      this._keyCheck(otherpk, true);
      if (!this._isPriv)
        throw new Error("DH exchange has not been initialized with a private key yet");
      var pub;
      if (this._algo === "dsa") {
        return this._dh.computeSecret(
          otherpk.part.y.data
        );
      } else if (this._algo === "ecdsa") {
        if (CRYPTO_HAVE_ECDH) {
          return this._dh.computeSecret(
            otherpk.part.Q.data
          );
        } else {
          pub = new ECPublic(
            this._ecParams,
            otherpk.part.Q.data
          );
          return this._priv.deriveSharedSecret(pub);
        }
      } else if (this._algo === "curve25519") {
        pub = otherpk.part.A.data;
        while (pub[0] === 0 && pub.length > 32)
          pub = pub.slice(1);
        var priv = this._priv;
        assert.strictEqual(pub.length, 32);
        assert.strictEqual(priv.length, 32);
        var secret = nacl.box.before(
          new Uint8Array(pub),
          new Uint8Array(priv)
        );
        return Buffer3.from(secret);
      }
      throw new Error("Invalid algorithm: " + this._algo);
    };
    DiffieHellman.prototype.generateKey = function() {
      var parts = [];
      var priv, pub;
      if (this._algo === "dsa") {
        this._dh.generateKeys();
        parts.push({ name: "p", data: this._p.data });
        parts.push({ name: "q", data: this._key.part.q.data });
        parts.push({ name: "g", data: this._g.data });
        parts.push({ name: "y", data: this._dh.getPublicKey() });
        parts.push({ name: "x", data: this._dh.getPrivateKey() });
        this._key = new PrivateKey({
          type: "dsa",
          parts
        });
        this._isPriv = true;
        return this._key;
      } else if (this._algo === "ecdsa") {
        if (CRYPTO_HAVE_ECDH) {
          this._dh.generateKeys();
          parts.push({
            name: "curve",
            data: Buffer3.from(this._curve)
          });
          parts.push({ name: "Q", data: this._dh.getPublicKey() });
          parts.push({ name: "d", data: this._dh.getPrivateKey() });
          this._key = new PrivateKey({
            type: "ecdsa",
            curve: this._curve,
            parts
          });
          this._isPriv = true;
          return this._key;
        } else {
          var n = this._ecParams.getN();
          var r = new jsbn(crypto3.randomBytes(n.bitLength()));
          var n1 = n.subtract(jsbn.ONE);
          priv = r.mod(n1).add(jsbn.ONE);
          pub = this._ecParams.getG().multiply(priv);
          priv = Buffer3.from(priv.toByteArray());
          pub = Buffer3.from(this._ecParams.getCurve().encodePointHex(pub), "hex");
          this._priv = new ECPrivate(this._ecParams, priv);
          parts.push({
            name: "curve",
            data: Buffer3.from(this._curve)
          });
          parts.push({ name: "Q", data: pub });
          parts.push({ name: "d", data: priv });
          this._key = new PrivateKey({
            type: "ecdsa",
            curve: this._curve,
            parts
          });
          this._isPriv = true;
          return this._key;
        }
      } else if (this._algo === "curve25519") {
        var pair = nacl.box.keyPair();
        priv = Buffer3.from(pair.secretKey);
        pub = Buffer3.from(pair.publicKey);
        priv = Buffer3.concat([priv, pub]);
        assert.strictEqual(priv.length, 64);
        assert.strictEqual(pub.length, 32);
        parts.push({ name: "A", data: pub });
        parts.push({ name: "k", data: priv });
        this._key = new PrivateKey({
          type: "curve25519",
          parts
        });
        this._isPriv = true;
        return this._key;
      }
      throw new Error("Invalid algorithm: " + this._algo);
    };
    DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey;
    function X9ECParameters(name) {
      var params = algs.curves[name];
      assert.object(params);
      var p = new jsbn(params.p);
      var a = new jsbn(params.a);
      var b = new jsbn(params.b);
      var n = new jsbn(params.n);
      var h = jsbn.ONE;
      var curve = new ec.ECCurveFp(p, a, b);
      var G = curve.decodePointHex(params.G.toString("hex"));
      this.curve = curve;
      this.g = G;
      this.n = n;
      this.h = h;
    }
    X9ECParameters.prototype.getCurve = function() {
      return this.curve;
    };
    X9ECParameters.prototype.getG = function() {
      return this.g;
    };
    X9ECParameters.prototype.getN = function() {
      return this.n;
    };
    X9ECParameters.prototype.getH = function() {
      return this.h;
    };
    function ECPublic(params, buffer) {
      this._params = params;
      if (buffer[0] === 0)
        buffer = buffer.slice(1);
      this._pub = params.getCurve().decodePointHex(buffer.toString("hex"));
    }
    function ECPrivate(params, buffer) {
      this._params = params;
      this._priv = new jsbn(utils.mpNormalize(buffer));
    }
    ECPrivate.prototype.deriveSharedSecret = function(pubKey) {
      assert.ok(pubKey instanceof ECPublic);
      var S = pubKey._pub.multiply(this._priv);
      return Buffer3.from(S.getX().toBigInteger().toByteArray());
    };
    function generateED25519() {
      var pair = nacl.sign.keyPair();
      var priv = Buffer3.from(pair.secretKey);
      var pub = Buffer3.from(pair.publicKey);
      assert.strictEqual(priv.length, 64);
      assert.strictEqual(pub.length, 32);
      var parts = [];
      parts.push({ name: "A", data: pub });
      parts.push({ name: "k", data: priv.slice(0, 32) });
      var key = new PrivateKey({
        type: "ed25519",
        parts
      });
      return key;
    }
    function generateECDSA(curve) {
      var parts = [];
      var key;
      if (CRYPTO_HAVE_ECDH) {
        var osCurve = {
          "nistp256": "prime256v1",
          "nistp384": "secp384r1",
          "nistp521": "secp521r1"
        }[curve];
        var dh = crypto3.createECDH(osCurve);
        dh.generateKeys();
        parts.push({
          name: "curve",
          data: Buffer3.from(curve)
        });
        parts.push({ name: "Q", data: dh.getPublicKey() });
        parts.push({ name: "d", data: dh.getPrivateKey() });
        key = new PrivateKey({
          type: "ecdsa",
          curve,
          parts
        });
        return key;
      } else {
        var ecParams = new X9ECParameters(curve);
        var n = ecParams.getN();
        var cByteLen = Math.ceil((n.bitLength() + 64) / 8);
        var c = new jsbn(crypto3.randomBytes(cByteLen));
        var n1 = n.subtract(jsbn.ONE);
        var priv = c.mod(n1).add(jsbn.ONE);
        var pub = ecParams.getG().multiply(priv);
        priv = Buffer3.from(priv.toByteArray());
        pub = Buffer3.from(ecParams.getCurve().encodePointHex(pub), "hex");
        parts.push({ name: "curve", data: Buffer3.from(curve) });
        parts.push({ name: "Q", data: pub });
        parts.push({ name: "d", data: priv });
        key = new PrivateKey({
          type: "ecdsa",
          curve,
          parts
        });
        return key;
      }
    }
  }
});

// node_modules/sshpk/lib/ed-compat.js
var require_ed_compat = __commonJS({
  "node_modules/sshpk/lib/ed-compat.js"(exports2, module2) {
    module2.exports = {
      Verifier,
      Signer
    };
    var nacl = require_nacl_fast();
    var stream = require("stream");
    var util = require("util");
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var Signature = require_signature();
    function Verifier(key, hashAlgo) {
      if (hashAlgo.toLowerCase() !== "sha512")
        throw new Error("ED25519 only supports the use of SHA-512 hashes");
      this.key = key;
      this.chunks = [];
      stream.Writable.call(this, {});
    }
    util.inherits(Verifier, stream.Writable);
    Verifier.prototype._write = function(chunk, enc, cb) {
      this.chunks.push(chunk);
      cb();
    };
    Verifier.prototype.update = function(chunk) {
      if (typeof chunk === "string")
        chunk = Buffer3.from(chunk, "binary");
      this.chunks.push(chunk);
    };
    Verifier.prototype.verify = function(signature, fmt) {
      var sig;
      if (Signature.isSignature(signature, [2, 0])) {
        if (signature.type !== "ed25519")
          return false;
        sig = signature.toBuffer("raw");
      } else if (typeof signature === "string") {
        sig = Buffer3.from(signature, "base64");
      } else if (Signature.isSignature(signature, [1, 0])) {
        throw new Error("signature was created by too old a version of sshpk and cannot be verified");
      }
      assert.buffer(sig);
      return nacl.sign.detached.verify(
        new Uint8Array(Buffer3.concat(this.chunks)),
        new Uint8Array(sig),
        new Uint8Array(this.key.part.A.data)
      );
    };
    function Signer(key, hashAlgo) {
      if (hashAlgo.toLowerCase() !== "sha512")
        throw new Error("ED25519 only supports the use of SHA-512 hashes");
      this.key = key;
      this.chunks = [];
      stream.Writable.call(this, {});
    }
    util.inherits(Signer, stream.Writable);
    Signer.prototype._write = function(chunk, enc, cb) {
      this.chunks.push(chunk);
      cb();
    };
    Signer.prototype.update = function(chunk) {
      if (typeof chunk === "string")
        chunk = Buffer3.from(chunk, "binary");
      this.chunks.push(chunk);
    };
    Signer.prototype.sign = function() {
      var sig = nacl.sign.detached(
        new Uint8Array(Buffer3.concat(this.chunks)),
        new Uint8Array(Buffer3.concat([
          this.key.part.k.data,
          this.key.part.A.data
        ]))
      );
      var sigBuf = Buffer3.from(sig);
      var sigObj = Signature.parse(sigBuf, "ed25519", "raw");
      sigObj.hashAlgorithm = "sha512";
      return sigObj;
    };
  }
});

// node_modules/sshpk/lib/formats/pkcs8.js
var require_pkcs8 = __commonJS({
  "node_modules/sshpk/lib/formats/pkcs8.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      readPkcs8,
      write: write2,
      writePkcs8,
      pkcs8ToBuffer,
      readECDSACurve,
      writeECDSACurve
    };
    var assert = require_assert();
    var asn1 = require_lib9();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pem = require_pem();
    function read2(buf, options) {
      return pem.read(buf, options, "pkcs8");
    }
    function write2(key, options) {
      return pem.write(key, options, "pkcs8");
    }
    function readMPInt(der, nm) {
      assert.strictEqual(
        der.peek(),
        asn1.Ber.Integer,
        nm + " is not an Integer"
      );
      return utils.mpNormalize(der.readString(asn1.Ber.Integer, true));
    }
    function readPkcs8(alg, type, der) {
      if (der.peek() === asn1.Ber.Integer) {
        assert.strictEqual(
          type,
          "private",
          "unexpected Integer at start of public key"
        );
        der.readString(asn1.Ber.Integer, true);
      }
      der.readSequence();
      var next = der.offset + der.length;
      var oid = der.readOID();
      switch (oid) {
        case "1.2.840.113549.1.1.1":
          der._offset = next;
          if (type === "public")
            return readPkcs8RSAPublic(der);
          else
            return readPkcs8RSAPrivate(der);
        case "1.2.840.10040.4.1":
          if (type === "public")
            return readPkcs8DSAPublic(der);
          else
            return readPkcs8DSAPrivate(der);
        case "1.2.840.10045.2.1":
          if (type === "public")
            return readPkcs8ECDSAPublic(der);
          else
            return readPkcs8ECDSAPrivate(der);
        case "1.3.101.112":
          if (type === "public") {
            return readPkcs8EdDSAPublic(der);
          } else {
            return readPkcs8EdDSAPrivate(der);
          }
        case "1.3.101.110":
          if (type === "public") {
            return readPkcs8X25519Public(der);
          } else {
            return readPkcs8X25519Private(der);
          }
        default:
          throw new Error("Unknown key type OID " + oid);
      }
    }
    function readPkcs8RSAPublic(der) {
      der.readSequence(asn1.Ber.BitString);
      der.readByte();
      der.readSequence();
      var n = readMPInt(der, "modulus");
      var e = readMPInt(der, "exponent");
      var key = {
        type: "rsa",
        source: der.originalInput,
        parts: [
          { name: "e", data: e },
          { name: "n", data: n }
        ]
      };
      return new Key(key);
    }
    function readPkcs8RSAPrivate(der) {
      der.readSequence(asn1.Ber.OctetString);
      der.readSequence();
      var ver = readMPInt(der, "version");
      assert.equal(ver[0], 0, "unknown RSA private key version");
      var n = readMPInt(der, "modulus");
      var e = readMPInt(der, "public exponent");
      var d = readMPInt(der, "private exponent");
      var p = readMPInt(der, "prime1");
      var q2 = readMPInt(der, "prime2");
      var dmodp = readMPInt(der, "exponent1");
      var dmodq = readMPInt(der, "exponent2");
      var iqmp = readMPInt(der, "iqmp");
      var key = {
        type: "rsa",
        parts: [
          { name: "n", data: n },
          { name: "e", data: e },
          { name: "d", data: d },
          { name: "iqmp", data: iqmp },
          { name: "p", data: p },
          { name: "q", data: q2 },
          { name: "dmodp", data: dmodp },
          { name: "dmodq", data: dmodq }
        ]
      };
      return new PrivateKey(key);
    }
    function readPkcs8DSAPublic(der) {
      der.readSequence();
      var p = readMPInt(der, "p");
      var q2 = readMPInt(der, "q");
      var g = readMPInt(der, "g");
      der.readSequence(asn1.Ber.BitString);
      der.readByte();
      var y = readMPInt(der, "y");
      var key = {
        type: "dsa",
        parts: [
          { name: "p", data: p },
          { name: "q", data: q2 },
          { name: "g", data: g },
          { name: "y", data: y }
        ]
      };
      return new Key(key);
    }
    function readPkcs8DSAPrivate(der) {
      der.readSequence();
      var p = readMPInt(der, "p");
      var q2 = readMPInt(der, "q");
      var g = readMPInt(der, "g");
      der.readSequence(asn1.Ber.OctetString);
      var x = readMPInt(der, "x");
      var y = utils.calculateDSAPublic(g, p, x);
      var key = {
        type: "dsa",
        parts: [
          { name: "p", data: p },
          { name: "q", data: q2 },
          { name: "g", data: g },
          { name: "y", data: y },
          { name: "x", data: x }
        ]
      };
      return new PrivateKey(key);
    }
    function readECDSACurve(der) {
      var curveName, curveNames;
      var j, c, cd;
      if (der.peek() === asn1.Ber.OID) {
        var oid = der.readOID();
        curveNames = Object.keys(algs.curves);
        for (j = 0; j < curveNames.length; ++j) {
          c = curveNames[j];
          cd = algs.curves[c];
          if (cd.pkcs8oid === oid) {
            curveName = c;
            break;
          }
        }
      } else {
        der.readSequence();
        var version2 = der.readString(asn1.Ber.Integer, true);
        assert.strictEqual(version2[0], 1, "ECDSA key not version 1");
        var curve = {};
        der.readSequence();
        var fieldTypeOid = der.readOID();
        assert.strictEqual(
          fieldTypeOid,
          "1.2.840.10045.1.1",
          "ECDSA key is not from a prime-field"
        );
        var p = curve.p = utils.mpNormalize(
          der.readString(asn1.Ber.Integer, true)
        );
        curve.size = p.length * 8 - utils.countZeros(p);
        der.readSequence();
        curve.a = utils.mpNormalize(
          der.readString(asn1.Ber.OctetString, true)
        );
        curve.b = utils.mpNormalize(
          der.readString(asn1.Ber.OctetString, true)
        );
        if (der.peek() === asn1.Ber.BitString)
          curve.s = der.readString(asn1.Ber.BitString, true);
        curve.G = der.readString(asn1.Ber.OctetString, true);
        assert.strictEqual(
          curve.G[0],
          4,
          "uncompressed G is required"
        );
        curve.n = utils.mpNormalize(
          der.readString(asn1.Ber.Integer, true)
        );
        curve.h = utils.mpNormalize(
          der.readString(asn1.Ber.Integer, true)
        );
        assert.strictEqual(curve.h[0], 1, "a cofactor=1 curve is required");
        curveNames = Object.keys(algs.curves);
        var ks = Object.keys(curve);
        for (j = 0; j < curveNames.length; ++j) {
          c = curveNames[j];
          cd = algs.curves[c];
          var equal = true;
          for (var i = 0; i < ks.length; ++i) {
            var k = ks[i];
            if (cd[k] === void 0)
              continue;
            if (typeof cd[k] === "object" && cd[k].equals !== void 0) {
              if (!cd[k].equals(curve[k])) {
                equal = false;
                break;
              }
            } else if (Buffer3.isBuffer(cd[k])) {
              if (cd[k].toString("binary") !== curve[k].toString("binary")) {
                equal = false;
                break;
              }
            } else {
              if (cd[k] !== curve[k]) {
                equal = false;
                break;
              }
            }
          }
          if (equal) {
            curveName = c;
            break;
          }
        }
      }
      return curveName;
    }
    function readPkcs8ECDSAPrivate(der) {
      var curveName = readECDSACurve(der);
      assert.string(curveName, "a known elliptic curve");
      der.readSequence(asn1.Ber.OctetString);
      der.readSequence();
      var version2 = readMPInt(der, "version");
      assert.equal(version2[0], 1, "unknown version of ECDSA key");
      var d = der.readString(asn1.Ber.OctetString, true);
      var Q;
      if (der.peek() == 160) {
        der.readSequence(160);
        der._offset += der.length;
      }
      if (der.peek() == 161) {
        der.readSequence(161);
        Q = der.readString(asn1.Ber.BitString, true);
        Q = utils.ecNormalize(Q);
      }
      if (Q === void 0) {
        var pub = utils.publicFromPrivateECDSA(curveName, d);
        Q = pub.part.Q.data;
      }
      var key = {
        type: "ecdsa",
        parts: [
          { name: "curve", data: Buffer3.from(curveName) },
          { name: "Q", data: Q },
          { name: "d", data: d }
        ]
      };
      return new PrivateKey(key);
    }
    function readPkcs8ECDSAPublic(der) {
      var curveName = readECDSACurve(der);
      assert.string(curveName, "a known elliptic curve");
      var Q = der.readString(asn1.Ber.BitString, true);
      Q = utils.ecNormalize(Q);
      var key = {
        type: "ecdsa",
        parts: [
          { name: "curve", data: Buffer3.from(curveName) },
          { name: "Q", data: Q }
        ]
      };
      return new Key(key);
    }
    function readPkcs8EdDSAPublic(der) {
      if (der.peek() === 0)
        der.readByte();
      var A = utils.readBitString(der);
      var key = {
        type: "ed25519",
        parts: [
          { name: "A", data: utils.zeroPadToLength(A, 32) }
        ]
      };
      return new Key(key);
    }
    function readPkcs8X25519Public(der) {
      var A = utils.readBitString(der);
      var key = {
        type: "curve25519",
        parts: [
          { name: "A", data: utils.zeroPadToLength(A, 32) }
        ]
      };
      return new Key(key);
    }
    function readPkcs8EdDSAPrivate(der) {
      if (der.peek() === 0)
        der.readByte();
      der.readSequence(asn1.Ber.OctetString);
      var k = der.readString(asn1.Ber.OctetString, true);
      k = utils.zeroPadToLength(k, 32);
      var A, tag;
      while ((tag = der.peek()) !== null) {
        if (tag === (asn1.Ber.Context | 1)) {
          A = utils.readBitString(der, tag);
        } else {
          der.readSequence(tag);
          der._offset += der.length;
        }
      }
      if (A === void 0)
        A = utils.calculateED25519Public(k);
      var key = {
        type: "ed25519",
        parts: [
          { name: "A", data: utils.zeroPadToLength(A, 32) },
          { name: "k", data: utils.zeroPadToLength(k, 32) }
        ]
      };
      return new PrivateKey(key);
    }
    function readPkcs8X25519Private(der) {
      if (der.peek() === 0)
        der.readByte();
      der.readSequence(asn1.Ber.OctetString);
      var k = der.readString(asn1.Ber.OctetString, true);
      k = utils.zeroPadToLength(k, 32);
      var A = utils.calculateX25519Public(k);
      var key = {
        type: "curve25519",
        parts: [
          { name: "A", data: utils.zeroPadToLength(A, 32) },
          { name: "k", data: utils.zeroPadToLength(k, 32) }
        ]
      };
      return new PrivateKey(key);
    }
    function pkcs8ToBuffer(key) {
      var der = new asn1.BerWriter();
      writePkcs8(der, key);
      return der.buffer;
    }
    function writePkcs8(der, key) {
      der.startSequence();
      if (PrivateKey.isPrivateKey(key)) {
        var version2 = 0;
        if (key.type === "ed25519")
          version2 = 1;
        var vbuf = Buffer3.from([version2]);
        der.writeBuffer(vbuf, asn1.Ber.Integer);
      }
      der.startSequence();
      switch (key.type) {
        case "rsa":
          der.writeOID("1.2.840.113549.1.1.1");
          if (PrivateKey.isPrivateKey(key))
            writePkcs8RSAPrivate(key, der);
          else
            writePkcs8RSAPublic(key, der);
          break;
        case "dsa":
          der.writeOID("1.2.840.10040.4.1");
          if (PrivateKey.isPrivateKey(key))
            writePkcs8DSAPrivate(key, der);
          else
            writePkcs8DSAPublic(key, der);
          break;
        case "ecdsa":
          der.writeOID("1.2.840.10045.2.1");
          if (PrivateKey.isPrivateKey(key))
            writePkcs8ECDSAPrivate(key, der);
          else
            writePkcs8ECDSAPublic(key, der);
          break;
        case "ed25519":
          der.writeOID("1.3.101.112");
          if (PrivateKey.isPrivateKey(key))
            writePkcs8EdDSAPrivate(key, der);
          else
            writePkcs8EdDSAPublic(key, der);
          break;
        default:
          throw new Error("Unsupported key type: " + key.type);
      }
      der.endSequence();
    }
    function writePkcs8RSAPrivate(key, der) {
      der.writeNull();
      der.endSequence();
      der.startSequence(asn1.Ber.OctetString);
      der.startSequence();
      var version2 = Buffer3.from([0]);
      der.writeBuffer(version2, asn1.Ber.Integer);
      der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.d.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
      if (!key.part.dmodp || !key.part.dmodq)
        utils.addRSAMissing(key);
      der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);
      der.endSequence();
      der.endSequence();
    }
    function writePkcs8RSAPublic(key, der) {
      der.writeNull();
      der.endSequence();
      der.startSequence(asn1.Ber.BitString);
      der.writeByte(0);
      der.startSequence();
      der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
      der.endSequence();
      der.endSequence();
    }
    function writePkcs8DSAPrivate(key, der) {
      der.startSequence();
      der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
      der.endSequence();
      der.endSequence();
      der.startSequence(asn1.Ber.OctetString);
      der.writeBuffer(key.part.x.data, asn1.Ber.Integer);
      der.endSequence();
    }
    function writePkcs8DSAPublic(key, der) {
      der.startSequence();
      der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
      der.endSequence();
      der.endSequence();
      der.startSequence(asn1.Ber.BitString);
      der.writeByte(0);
      der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
      der.endSequence();
    }
    function writeECDSACurve(key, der) {
      var curve = algs.curves[key.curve];
      if (curve.pkcs8oid) {
        der.writeOID(curve.pkcs8oid);
      } else {
        der.startSequence();
        var version2 = Buffer3.from([1]);
        der.writeBuffer(version2, asn1.Ber.Integer);
        der.startSequence();
        der.writeOID("1.2.840.10045.1.1");
        der.writeBuffer(curve.p, asn1.Ber.Integer);
        der.endSequence();
        der.startSequence();
        var a = curve.p;
        if (a[0] === 0)
          a = a.slice(1);
        der.writeBuffer(a, asn1.Ber.OctetString);
        der.writeBuffer(curve.b, asn1.Ber.OctetString);
        der.writeBuffer(curve.s, asn1.Ber.BitString);
        der.endSequence();
        der.writeBuffer(curve.G, asn1.Ber.OctetString);
        der.writeBuffer(curve.n, asn1.Ber.Integer);
        var h = curve.h;
        if (!h) {
          h = Buffer3.from([1]);
        }
        der.writeBuffer(h, asn1.Ber.Integer);
        der.endSequence();
      }
    }
    function writePkcs8ECDSAPublic(key, der) {
      writeECDSACurve(key, der);
      der.endSequence();
      var Q = utils.ecNormalize(key.part.Q.data, true);
      der.writeBuffer(Q, asn1.Ber.BitString);
    }
    function writePkcs8ECDSAPrivate(key, der) {
      writeECDSACurve(key, der);
      der.endSequence();
      der.startSequence(asn1.Ber.OctetString);
      der.startSequence();
      var version2 = Buffer3.from([1]);
      der.writeBuffer(version2, asn1.Ber.Integer);
      der.writeBuffer(key.part.d.data, asn1.Ber.OctetString);
      der.startSequence(161);
      var Q = utils.ecNormalize(key.part.Q.data, true);
      der.writeBuffer(Q, asn1.Ber.BitString);
      der.endSequence();
      der.endSequence();
      der.endSequence();
    }
    function writePkcs8EdDSAPublic(key, der) {
      der.endSequence();
      utils.writeBitString(der, key.part.A.data);
    }
    function writePkcs8EdDSAPrivate(key, der) {
      der.endSequence();
      der.startSequence(asn1.Ber.OctetString);
      var k = utils.mpNormalize(key.part.k.data);
      while (k.length > 32 && k[0] === 0)
        k = k.slice(1);
      der.writeBuffer(k, asn1.Ber.OctetString);
      der.endSequence();
      utils.writeBitString(der, key.part.A.data, asn1.Ber.Context | 1);
    }
  }
});

// node_modules/sshpk/lib/formats/pkcs1.js
var require_pkcs1 = __commonJS({
  "node_modules/sshpk/lib/formats/pkcs1.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      readPkcs1,
      write: write2,
      writePkcs1
    };
    var assert = require_assert();
    var asn1 = require_lib9();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pem = require_pem();
    var pkcs8 = require_pkcs8();
    var readECDSACurve = pkcs8.readECDSACurve;
    function read2(buf, options) {
      return pem.read(buf, options, "pkcs1");
    }
    function write2(key, options) {
      return pem.write(key, options, "pkcs1");
    }
    function readMPInt(der, nm) {
      assert.strictEqual(
        der.peek(),
        asn1.Ber.Integer,
        nm + " is not an Integer"
      );
      return utils.mpNormalize(der.readString(asn1.Ber.Integer, true));
    }
    function readPkcs1(alg, type, der) {
      switch (alg) {
        case "RSA":
          if (type === "public")
            return readPkcs1RSAPublic(der);
          else if (type === "private")
            return readPkcs1RSAPrivate(der);
          throw new Error("Unknown key type: " + type);
        case "DSA":
          if (type === "public")
            return readPkcs1DSAPublic(der);
          else if (type === "private")
            return readPkcs1DSAPrivate(der);
          throw new Error("Unknown key type: " + type);
        case "EC":
        case "ECDSA":
          if (type === "private")
            return readPkcs1ECDSAPrivate(der);
          else if (type === "public")
            return readPkcs1ECDSAPublic(der);
          throw new Error("Unknown key type: " + type);
        case "EDDSA":
        case "EdDSA":
          if (type === "private")
            return readPkcs1EdDSAPrivate(der);
          throw new Error(type + " keys not supported with EdDSA");
        default:
          throw new Error("Unknown key algo: " + alg);
      }
    }
    function readPkcs1RSAPublic(der) {
      var n = readMPInt(der, "modulus");
      var e = readMPInt(der, "exponent");
      var key = {
        type: "rsa",
        parts: [
          { name: "e", data: e },
          { name: "n", data: n }
        ]
      };
      return new Key(key);
    }
    function readPkcs1RSAPrivate(der) {
      var version2 = readMPInt(der, "version");
      assert.strictEqual(version2[0], 0);
      var n = readMPInt(der, "modulus");
      var e = readMPInt(der, "public exponent");
      var d = readMPInt(der, "private exponent");
      var p = readMPInt(der, "prime1");
      var q2 = readMPInt(der, "prime2");
      var dmodp = readMPInt(der, "exponent1");
      var dmodq = readMPInt(der, "exponent2");
      var iqmp = readMPInt(der, "iqmp");
      var key = {
        type: "rsa",
        parts: [
          { name: "n", data: n },
          { name: "e", data: e },
          { name: "d", data: d },
          { name: "iqmp", data: iqmp },
          { name: "p", data: p },
          { name: "q", data: q2 },
          { name: "dmodp", data: dmodp },
          { name: "dmodq", data: dmodq }
        ]
      };
      return new PrivateKey(key);
    }
    function readPkcs1DSAPrivate(der) {
      var version2 = readMPInt(der, "version");
      assert.strictEqual(version2.readUInt8(0), 0);
      var p = readMPInt(der, "p");
      var q2 = readMPInt(der, "q");
      var g = readMPInt(der, "g");
      var y = readMPInt(der, "y");
      var x = readMPInt(der, "x");
      var key = {
        type: "dsa",
        parts: [
          { name: "p", data: p },
          { name: "q", data: q2 },
          { name: "g", data: g },
          { name: "y", data: y },
          { name: "x", data: x }
        ]
      };
      return new PrivateKey(key);
    }
    function readPkcs1EdDSAPrivate(der) {
      var version2 = readMPInt(der, "version");
      assert.strictEqual(version2.readUInt8(0), 1);
      var k = der.readString(asn1.Ber.OctetString, true);
      der.readSequence(160);
      var oid = der.readOID();
      assert.strictEqual(oid, "1.3.101.112", "the ed25519 curve identifier");
      der.readSequence(161);
      var A = utils.readBitString(der);
      var key = {
        type: "ed25519",
        parts: [
          { name: "A", data: utils.zeroPadToLength(A, 32) },
          { name: "k", data: k }
        ]
      };
      return new PrivateKey(key);
    }
    function readPkcs1DSAPublic(der) {
      var y = readMPInt(der, "y");
      var p = readMPInt(der, "p");
      var q2 = readMPInt(der, "q");
      var g = readMPInt(der, "g");
      var key = {
        type: "dsa",
        parts: [
          { name: "y", data: y },
          { name: "p", data: p },
          { name: "q", data: q2 },
          { name: "g", data: g }
        ]
      };
      return new Key(key);
    }
    function readPkcs1ECDSAPublic(der) {
      der.readSequence();
      var oid = der.readOID();
      assert.strictEqual(oid, "1.2.840.10045.2.1", "must be ecPublicKey");
      var curveOid = der.readOID();
      var curve;
      var curves = Object.keys(algs.curves);
      for (var j = 0; j < curves.length; ++j) {
        var c = curves[j];
        var cd = algs.curves[c];
        if (cd.pkcs8oid === curveOid) {
          curve = c;
          break;
        }
      }
      assert.string(curve, "a known ECDSA named curve");
      var Q = der.readString(asn1.Ber.BitString, true);
      Q = utils.ecNormalize(Q);
      var key = {
        type: "ecdsa",
        parts: [
          { name: "curve", data: Buffer3.from(curve) },
          { name: "Q", data: Q }
        ]
      };
      return new Key(key);
    }
    function readPkcs1ECDSAPrivate(der) {
      var version2 = readMPInt(der, "version");
      assert.strictEqual(version2.readUInt8(0), 1);
      var d = der.readString(asn1.Ber.OctetString, true);
      der.readSequence(160);
      var curve = readECDSACurve(der);
      assert.string(curve, "a known elliptic curve");
      der.readSequence(161);
      var Q = der.readString(asn1.Ber.BitString, true);
      Q = utils.ecNormalize(Q);
      var key = {
        type: "ecdsa",
        parts: [
          { name: "curve", data: Buffer3.from(curve) },
          { name: "Q", data: Q },
          { name: "d", data: d }
        ]
      };
      return new PrivateKey(key);
    }
    function writePkcs1(der, key) {
      der.startSequence();
      switch (key.type) {
        case "rsa":
          if (PrivateKey.isPrivateKey(key))
            writePkcs1RSAPrivate(der, key);
          else
            writePkcs1RSAPublic(der, key);
          break;
        case "dsa":
          if (PrivateKey.isPrivateKey(key))
            writePkcs1DSAPrivate(der, key);
          else
            writePkcs1DSAPublic(der, key);
          break;
        case "ecdsa":
          if (PrivateKey.isPrivateKey(key))
            writePkcs1ECDSAPrivate(der, key);
          else
            writePkcs1ECDSAPublic(der, key);
          break;
        case "ed25519":
          if (PrivateKey.isPrivateKey(key))
            writePkcs1EdDSAPrivate(der, key);
          else
            writePkcs1EdDSAPublic(der, key);
          break;
        default:
          throw new Error("Unknown key algo: " + key.type);
      }
      der.endSequence();
    }
    function writePkcs1RSAPublic(der, key) {
      der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
    }
    function writePkcs1RSAPrivate(der, key) {
      var ver = Buffer3.from([0]);
      der.writeBuffer(ver, asn1.Ber.Integer);
      der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.d.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
      if (!key.part.dmodp || !key.part.dmodq)
        utils.addRSAMissing(key);
      der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);
    }
    function writePkcs1DSAPrivate(der, key) {
      var ver = Buffer3.from([0]);
      der.writeBuffer(ver, asn1.Ber.Integer);
      der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.x.data, asn1.Ber.Integer);
    }
    function writePkcs1DSAPublic(der, key) {
      der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
      der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
    }
    function writePkcs1ECDSAPublic(der, key) {
      der.startSequence();
      der.writeOID("1.2.840.10045.2.1");
      var curve = key.part.curve.data.toString();
      var curveOid = algs.curves[curve].pkcs8oid;
      assert.string(curveOid, "a known ECDSA named curve");
      der.writeOID(curveOid);
      der.endSequence();
      var Q = utils.ecNormalize(key.part.Q.data, true);
      der.writeBuffer(Q, asn1.Ber.BitString);
    }
    function writePkcs1ECDSAPrivate(der, key) {
      var ver = Buffer3.from([1]);
      der.writeBuffer(ver, asn1.Ber.Integer);
      der.writeBuffer(key.part.d.data, asn1.Ber.OctetString);
      der.startSequence(160);
      var curve = key.part.curve.data.toString();
      var curveOid = algs.curves[curve].pkcs8oid;
      assert.string(curveOid, "a known ECDSA named curve");
      der.writeOID(curveOid);
      der.endSequence();
      der.startSequence(161);
      var Q = utils.ecNormalize(key.part.Q.data, true);
      der.writeBuffer(Q, asn1.Ber.BitString);
      der.endSequence();
    }
    function writePkcs1EdDSAPrivate(der, key) {
      var ver = Buffer3.from([1]);
      der.writeBuffer(ver, asn1.Ber.Integer);
      der.writeBuffer(key.part.k.data, asn1.Ber.OctetString);
      der.startSequence(160);
      der.writeOID("1.3.101.112");
      der.endSequence();
      der.startSequence(161);
      utils.writeBitString(der, key.part.A.data);
      der.endSequence();
    }
    function writePkcs1EdDSAPublic(der, key) {
      throw new Error("Public keys are not supported for EdDSA PKCS#1");
    }
  }
});

// node_modules/sshpk/lib/formats/rfc4253.js
var require_rfc4253 = __commonJS({
  "node_modules/sshpk/lib/formats/rfc4253.js"(exports2, module2) {
    module2.exports = {
      read: read2.bind(void 0, false, void 0),
      readType: read2.bind(void 0, false),
      write: write2,
      /* semi-private api, used by sshpk-agent */
      readPartial: read2.bind(void 0, true),
      /* shared with ssh format */
      readInternal: read2,
      keyTypeToAlg,
      algToKeyType
    };
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var SSHBuffer = require_ssh_buffer();
    function algToKeyType(alg) {
      assert.string(alg);
      if (alg === "ssh-dss")
        return "dsa";
      else if (alg === "ssh-rsa")
        return "rsa";
      else if (alg === "ssh-ed25519")
        return "ed25519";
      else if (alg === "ssh-curve25519")
        return "curve25519";
      else if (alg.match(/^ecdsa-sha2-/))
        return "ecdsa";
      else
        throw new Error("Unknown algorithm " + alg);
    }
    function keyTypeToAlg(key) {
      assert.object(key);
      if (key.type === "dsa")
        return "ssh-dss";
      else if (key.type === "rsa")
        return "ssh-rsa";
      else if (key.type === "ed25519")
        return "ssh-ed25519";
      else if (key.type === "curve25519")
        return "ssh-curve25519";
      else if (key.type === "ecdsa")
        return "ecdsa-sha2-" + key.part.curve.data.toString();
      else
        throw new Error("Unknown key type " + key.type);
    }
    function read2(partial, type, buf, options) {
      if (typeof buf === "string")
        buf = Buffer3.from(buf);
      assert.buffer(buf, "buf");
      var key = {};
      var parts = key.parts = [];
      var sshbuf = new SSHBuffer({ buffer: buf });
      var alg = sshbuf.readString();
      assert.ok(!sshbuf.atEnd(), "key must have at least one part");
      key.type = algToKeyType(alg);
      var partCount = algs.info[key.type].parts.length;
      if (type && type === "private")
        partCount = algs.privInfo[key.type].parts.length;
      while (!sshbuf.atEnd() && parts.length < partCount)
        parts.push(sshbuf.readPart());
      while (!partial && !sshbuf.atEnd())
        parts.push(sshbuf.readPart());
      assert.ok(
        parts.length >= 1,
        "key must have at least one part"
      );
      assert.ok(
        partial || sshbuf.atEnd(),
        "leftover bytes at end of key"
      );
      var Constructor = Key;
      var algInfo = algs.info[key.type];
      if (type === "private" || algInfo.parts.length !== parts.length) {
        algInfo = algs.privInfo[key.type];
        Constructor = PrivateKey;
      }
      assert.strictEqual(algInfo.parts.length, parts.length);
      if (key.type === "ecdsa") {
        var res = /^ecdsa-sha2-(.+)$/.exec(alg);
        assert.ok(res !== null);
        assert.strictEqual(res[1], parts[0].data.toString());
      }
      var normalized = true;
      for (var i = 0; i < algInfo.parts.length; ++i) {
        var p = parts[i];
        p.name = algInfo.parts[i];
        if (key.type === "ed25519" && p.name === "k")
          p.data = p.data.slice(0, 32);
        if (p.name !== "curve" && algInfo.normalize !== false) {
          var nd;
          if (key.type === "ed25519") {
            nd = utils.zeroPadToLength(p.data, 32);
          } else {
            nd = utils.mpNormalize(p.data);
          }
          if (nd.toString("binary") !== p.data.toString("binary")) {
            p.data = nd;
            normalized = false;
          }
        }
      }
      if (normalized)
        key._rfc4253Cache = sshbuf.toBuffer();
      if (partial && typeof partial === "object") {
        partial.remainder = sshbuf.remainder();
        partial.consumed = sshbuf._offset;
      }
      return new Constructor(key);
    }
    function write2(key, options) {
      assert.object(key);
      var alg = keyTypeToAlg(key);
      var i;
      var algInfo = algs.info[key.type];
      if (PrivateKey.isPrivateKey(key))
        algInfo = algs.privInfo[key.type];
      var parts = algInfo.parts;
      var buf = new SSHBuffer({});
      buf.writeString(alg);
      for (i = 0; i < parts.length; ++i) {
        var data = key.part[parts[i]].data;
        if (algInfo.normalize !== false) {
          if (key.type === "ed25519")
            data = utils.zeroPadToLength(data, 32);
          else
            data = utils.mpNormalize(data);
        }
        if (key.type === "ed25519" && parts[i] === "k")
          data = Buffer3.concat([data, key.part.A.data]);
        buf.writeBuffer(data);
      }
      return buf.toBuffer();
    }
  }
});

// node_modules/bcrypt-pbkdf/index.js
var require_bcrypt_pbkdf = __commonJS({
  "node_modules/bcrypt-pbkdf/index.js"(exports2, module2) {
    "use strict";
    var crypto_hash_sha512 = require_nacl_fast().lowlevel.crypto_hash;
    var BLF_J = 0;
    var Blowfish = function() {
      this.S = [
        new Uint32Array([
          3509652390,
          2564797868,
          805139163,
          3491422135,
          3101798381,
          1780907670,
          3128725573,
          4046225305,
          614570311,
          3012652279,
          134345442,
          2240740374,
          1667834072,
          1901547113,
          2757295779,
          4103290238,
          227898511,
          1921955416,
          1904987480,
          2182433518,
          2069144605,
          3260701109,
          2620446009,
          720527379,
          3318853667,
          677414384,
          3393288472,
          3101374703,
          2390351024,
          1614419982,
          1822297739,
          2954791486,
          3608508353,
          3174124327,
          2024746970,
          1432378464,
          3864339955,
          2857741204,
          1464375394,
          1676153920,
          1439316330,
          715854006,
          3033291828,
          289532110,
          2706671279,
          2087905683,
          3018724369,
          1668267050,
          732546397,
          1947742710,
          3462151702,
          2609353502,
          2950085171,
          1814351708,
          2050118529,
          680887927,
          999245976,
          1800124847,
          3300911131,
          1713906067,
          1641548236,
          4213287313,
          1216130144,
          1575780402,
          4018429277,
          3917837745,
          3693486850,
          3949271944,
          596196993,
          3549867205,
          258830323,
          2213823033,
          772490370,
          2760122372,
          1774776394,
          2652871518,
          566650946,
          4142492826,
          1728879713,
          2882767088,
          1783734482,
          3629395816,
          2517608232,
          2874225571,
          1861159788,
          326777828,
          3124490320,
          2130389656,
          2716951837,
          967770486,
          1724537150,
          2185432712,
          2364442137,
          1164943284,
          2105845187,
          998989502,
          3765401048,
          2244026483,
          1075463327,
          1455516326,
          1322494562,
          910128902,
          469688178,
          1117454909,
          936433444,
          3490320968,
          3675253459,
          1240580251,
          122909385,
          2157517691,
          634681816,
          4142456567,
          3825094682,
          3061402683,
          2540495037,
          79693498,
          3249098678,
          1084186820,
          1583128258,
          426386531,
          1761308591,
          1047286709,
          322548459,
          995290223,
          1845252383,
          2603652396,
          3431023940,
          2942221577,
          3202600964,
          3727903485,
          1712269319,
          422464435,
          3234572375,
          1170764815,
          3523960633,
          3117677531,
          1434042557,
          442511882,
          3600875718,
          1076654713,
          1738483198,
          4213154764,
          2393238008,
          3677496056,
          1014306527,
          4251020053,
          793779912,
          2902807211,
          842905082,
          4246964064,
          1395751752,
          1040244610,
          2656851899,
          3396308128,
          445077038,
          3742853595,
          3577915638,
          679411651,
          2892444358,
          2354009459,
          1767581616,
          3150600392,
          3791627101,
          3102740896,
          284835224,
          4246832056,
          1258075500,
          768725851,
          2589189241,
          3069724005,
          3532540348,
          1274779536,
          3789419226,
          2764799539,
          1660621633,
          3471099624,
          4011903706,
          913787905,
          3497959166,
          737222580,
          2514213453,
          2928710040,
          3937242737,
          1804850592,
          3499020752,
          2949064160,
          2386320175,
          2390070455,
          2415321851,
          4061277028,
          2290661394,
          2416832540,
          1336762016,
          1754252060,
          3520065937,
          3014181293,
          791618072,
          3188594551,
          3933548030,
          2332172193,
          3852520463,
          3043980520,
          413987798,
          3465142937,
          3030929376,
          4245938359,
          2093235073,
          3534596313,
          375366246,
          2157278981,
          2479649556,
          555357303,
          3870105701,
          2008414854,
          3344188149,
          4221384143,
          3956125452,
          2067696032,
          3594591187,
          2921233993,
          2428461,
          544322398,
          577241275,
          1471733935,
          610547355,
          4027169054,
          1432588573,
          1507829418,
          2025931657,
          3646575487,
          545086370,
          48609733,
          2200306550,
          1653985193,
          298326376,
          1316178497,
          3007786442,
          2064951626,
          458293330,
          2589141269,
          3591329599,
          3164325604,
          727753846,
          2179363840,
          146436021,
          1461446943,
          4069977195,
          705550613,
          3059967265,
          3887724982,
          4281599278,
          3313849956,
          1404054877,
          2845806497,
          146425753,
          1854211946
        ]),
        new Uint32Array([
          1266315497,
          3048417604,
          3681880366,
          3289982499,
          290971e4,
          1235738493,
          2632868024,
          2414719590,
          3970600049,
          1771706367,
          1449415276,
          3266420449,
          422970021,
          1963543593,
          2690192192,
          3826793022,
          1062508698,
          1531092325,
          1804592342,
          2583117782,
          2714934279,
          4024971509,
          1294809318,
          4028980673,
          1289560198,
          2221992742,
          1669523910,
          35572830,
          157838143,
          1052438473,
          1016535060,
          1802137761,
          1753167236,
          1386275462,
          3080475397,
          2857371447,
          1040679964,
          2145300060,
          2390574316,
          1461121720,
          2956646967,
          4031777805,
          4028374788,
          33600511,
          2920084762,
          1018524850,
          629373528,
          3691585981,
          3515945977,
          2091462646,
          2486323059,
          586499841,
          988145025,
          935516892,
          3367335476,
          2599673255,
          2839830854,
          265290510,
          3972581182,
          2759138881,
          3795373465,
          1005194799,
          847297441,
          406762289,
          1314163512,
          1332590856,
          1866599683,
          4127851711,
          750260880,
          613907577,
          1450815602,
          3165620655,
          3734664991,
          3650291728,
          3012275730,
          3704569646,
          1427272223,
          778793252,
          1343938022,
          2676280711,
          2052605720,
          1946737175,
          3164576444,
          3914038668,
          3967478842,
          3682934266,
          1661551462,
          3294938066,
          4011595847,
          840292616,
          3712170807,
          616741398,
          312560963,
          711312465,
          1351876610,
          322626781,
          1910503582,
          271666773,
          2175563734,
          1594956187,
          70604529,
          3617834859,
          1007753275,
          1495573769,
          4069517037,
          2549218298,
          2663038764,
          504708206,
          2263041392,
          3941167025,
          2249088522,
          1514023603,
          1998579484,
          1312622330,
          694541497,
          2582060303,
          2151582166,
          1382467621,
          776784248,
          2618340202,
          3323268794,
          2497899128,
          2784771155,
          503983604,
          4076293799,
          907881277,
          423175695,
          432175456,
          1378068232,
          4145222326,
          3954048622,
          3938656102,
          3820766613,
          2793130115,
          2977904593,
          26017576,
          3274890735,
          3194772133,
          1700274565,
          1756076034,
          4006520079,
          3677328699,
          720338349,
          1533947780,
          354530856,
          688349552,
          3973924725,
          1637815568,
          332179504,
          3949051286,
          53804574,
          2852348879,
          3044236432,
          1282449977,
          3583942155,
          3416972820,
          4006381244,
          1617046695,
          2628476075,
          3002303598,
          1686838959,
          431878346,
          2686675385,
          1700445008,
          1080580658,
          1009431731,
          832498133,
          3223435511,
          2605976345,
          2271191193,
          2516031870,
          1648197032,
          4164389018,
          2548247927,
          300782431,
          375919233,
          238389289,
          3353747414,
          2531188641,
          2019080857,
          1475708069,
          455242339,
          2609103871,
          448939670,
          3451063019,
          1395535956,
          2413381860,
          1841049896,
          1491858159,
          885456874,
          4264095073,
          4001119347,
          1565136089,
          3898914787,
          1108368660,
          540939232,
          1173283510,
          2745871338,
          3681308437,
          4207628240,
          3343053890,
          4016749493,
          1699691293,
          1103962373,
          3625875870,
          2256883143,
          3830138730,
          1031889488,
          3479347698,
          1535977030,
          4236805024,
          3251091107,
          2132092099,
          1774941330,
          1199868427,
          1452454533,
          157007616,
          2904115357,
          342012276,
          595725824,
          1480756522,
          206960106,
          497939518,
          591360097,
          863170706,
          2375253569,
          3596610801,
          1814182875,
          2094937945,
          3421402208,
          1082520231,
          3463918190,
          2785509508,
          435703966,
          3908032597,
          1641649973,
          2842273706,
          3305899714,
          1510255612,
          2148256476,
          2655287854,
          3276092548,
          4258621189,
          236887753,
          3681803219,
          274041037,
          1734335097,
          3815195456,
          3317970021,
          1899903192,
          1026095262,
          4050517792,
          356393447,
          2410691914,
          3873677099,
          3682840055
        ]),
        new Uint32Array([
          3913112168,
          2491498743,
          4132185628,
          2489919796,
          1091903735,
          1979897079,
          3170134830,
          3567386728,
          3557303409,
          857797738,
          1136121015,
          1342202287,
          507115054,
          2535736646,
          337727348,
          3213592640,
          1301675037,
          2528481711,
          1895095763,
          1721773893,
          3216771564,
          62756741,
          2142006736,
          835421444,
          2531993523,
          1442658625,
          3659876326,
          2882144922,
          676362277,
          1392781812,
          170690266,
          3921047035,
          1759253602,
          3611846912,
          1745797284,
          664899054,
          1329594018,
          3901205900,
          3045908486,
          2062866102,
          2865634940,
          3543621612,
          3464012697,
          1080764994,
          553557557,
          3656615353,
          3996768171,
          991055499,
          499776247,
          1265440854,
          648242737,
          3940784050,
          980351604,
          3713745714,
          1749149687,
          3396870395,
          4211799374,
          3640570775,
          1161844396,
          3125318951,
          1431517754,
          545492359,
          4268468663,
          3499529547,
          1437099964,
          2702547544,
          3433638243,
          2581715763,
          2787789398,
          1060185593,
          1593081372,
          2418618748,
          4260947970,
          69676912,
          2159744348,
          86519011,
          2512459080,
          3838209314,
          1220612927,
          3339683548,
          133810670,
          1090789135,
          1078426020,
          1569222167,
          845107691,
          3583754449,
          4072456591,
          1091646820,
          628848692,
          1613405280,
          3757631651,
          526609435,
          236106946,
          48312990,
          2942717905,
          3402727701,
          1797494240,
          859738849,
          992217954,
          4005476642,
          2243076622,
          3870952857,
          3732016268,
          765654824,
          3490871365,
          2511836413,
          1685915746,
          3888969200,
          1414112111,
          2273134842,
          3281911079,
          4080962846,
          172450625,
          2569994100,
          980381355,
          4109958455,
          2819808352,
          2716589560,
          2568741196,
          3681446669,
          3329971472,
          1835478071,
          660984891,
          3704678404,
          4045999559,
          3422617507,
          3040415634,
          1762651403,
          1719377915,
          3470491036,
          2693910283,
          3642056355,
          3138596744,
          1364962596,
          2073328063,
          1983633131,
          926494387,
          3423689081,
          2150032023,
          4096667949,
          1749200295,
          3328846651,
          309677260,
          2016342300,
          1779581495,
          3079819751,
          111262694,
          1274766160,
          443224088,
          298511866,
          1025883608,
          3806446537,
          1145181785,
          168956806,
          3641502830,
          3584813610,
          1689216846,
          3666258015,
          3200248200,
          1692713982,
          2646376535,
          4042768518,
          1618508792,
          1610833997,
          3523052358,
          4130873264,
          2001055236,
          3610705100,
          2202168115,
          4028541809,
          2961195399,
          1006657119,
          2006996926,
          3186142756,
          1430667929,
          3210227297,
          1314452623,
          4074634658,
          4101304120,
          2273951170,
          1399257539,
          3367210612,
          3027628629,
          1190975929,
          2062231137,
          2333990788,
          2221543033,
          2438960610,
          1181637006,
          548689776,
          2362791313,
          3372408396,
          3104550113,
          3145860560,
          296247880,
          1970579870,
          3078560182,
          3769228297,
          1714227617,
          3291629107,
          3898220290,
          166772364,
          1251581989,
          493813264,
          448347421,
          195405023,
          2709975567,
          677966185,
          3703036547,
          1463355134,
          2715995803,
          1338867538,
          1343315457,
          2802222074,
          2684532164,
          233230375,
          2599980071,
          2000651841,
          3277868038,
          1638401717,
          4028070440,
          3237316320,
          6314154,
          819756386,
          300326615,
          590932579,
          1405279636,
          3267499572,
          3150704214,
          2428286686,
          3959192993,
          3461946742,
          1862657033,
          1266418056,
          963775037,
          2089974820,
          2263052895,
          1917689273,
          448879540,
          3550394620,
          3981727096,
          150775221,
          3627908307,
          1303187396,
          508620638,
          2975983352,
          2726630617,
          1817252668,
          1876281319,
          1457606340,
          908771278,
          3720792119,
          3617206836,
          2455994898,
          1729034894,
          1080033504
        ]),
        new Uint32Array([
          976866871,
          3556439503,
          2881648439,
          1522871579,
          1555064734,
          1336096578,
          3548522304,
          2579274686,
          3574697629,
          3205460757,
          3593280638,
          3338716283,
          3079412587,
          564236357,
          2993598910,
          1781952180,
          1464380207,
          3163844217,
          3332601554,
          1699332808,
          1393555694,
          1183702653,
          3581086237,
          1288719814,
          691649499,
          2847557200,
          2895455976,
          3193889540,
          2717570544,
          1781354906,
          1676643554,
          2592534050,
          3230253752,
          1126444790,
          2770207658,
          2633158820,
          2210423226,
          2615765581,
          2414155088,
          3127139286,
          673620729,
          2805611233,
          1269405062,
          4015350505,
          3341807571,
          4149409754,
          1057255273,
          2012875353,
          2162469141,
          2276492801,
          2601117357,
          993977747,
          3918593370,
          2654263191,
          753973209,
          36408145,
          2530585658,
          25011837,
          3520020182,
          2088578344,
          530523599,
          2918365339,
          1524020338,
          1518925132,
          3760827505,
          3759777254,
          1202760957,
          3985898139,
          3906192525,
          674977740,
          4174734889,
          2031300136,
          2019492241,
          3983892565,
          4153806404,
          3822280332,
          352677332,
          2297720250,
          60907813,
          90501309,
          3286998549,
          1016092578,
          2535922412,
          2839152426,
          457141659,
          509813237,
          4120667899,
          652014361,
          1966332200,
          2975202805,
          55981186,
          2327461051,
          676427537,
          3255491064,
          2882294119,
          3433927263,
          1307055953,
          942726286,
          933058658,
          2468411793,
          3933900994,
          4215176142,
          1361170020,
          2001714738,
          2830558078,
          3274259782,
          1222529897,
          1679025792,
          2729314320,
          3714953764,
          1770335741,
          151462246,
          3013232138,
          1682292957,
          1483529935,
          471910574,
          1539241949,
          458788160,
          3436315007,
          1807016891,
          3718408830,
          978976581,
          1043663428,
          3165965781,
          1927990952,
          4200891579,
          2372276910,
          3208408903,
          3533431907,
          1412390302,
          2931980059,
          4132332400,
          1947078029,
          3881505623,
          4168226417,
          2941484381,
          1077988104,
          1320477388,
          886195818,
          18198404,
          3786409e3,
          2509781533,
          112762804,
          3463356488,
          1866414978,
          891333506,
          18488651,
          661792760,
          1628790961,
          3885187036,
          3141171499,
          876946877,
          2693282273,
          1372485963,
          791857591,
          2686433993,
          3759982718,
          3167212022,
          3472953795,
          2716379847,
          445679433,
          3561995674,
          3504004811,
          3574258232,
          54117162,
          3331405415,
          2381918588,
          3769707343,
          4154350007,
          1140177722,
          4074052095,
          668550556,
          3214352940,
          367459370,
          261225585,
          2610173221,
          4209349473,
          3468074219,
          3265815641,
          314222801,
          3066103646,
          3808782860,
          282218597,
          3406013506,
          3773591054,
          379116347,
          1285071038,
          846784868,
          2669647154,
          3771962079,
          3550491691,
          2305946142,
          453669953,
          1268987020,
          3317592352,
          3279303384,
          3744833421,
          2610507566,
          3859509063,
          266596637,
          3847019092,
          517658769,
          3462560207,
          3443424879,
          370717030,
          4247526661,
          2224018117,
          4143653529,
          4112773975,
          2788324899,
          2477274417,
          1456262402,
          2901442914,
          1517677493,
          1846949527,
          2295493580,
          3734397586,
          2176403920,
          1280348187,
          1908823572,
          3871786941,
          846861322,
          1172426758,
          3287448474,
          3383383037,
          1655181056,
          3139813346,
          901632758,
          1897031941,
          2986607138,
          3066810236,
          3447102507,
          1393639104,
          373351379,
          950779232,
          625454576,
          3124240540,
          4148612726,
          2007998917,
          544563296,
          2244738638,
          2330496472,
          2058025392,
          1291430526,
          424198748,
          50039436,
          29584100,
          3605783033,
          2429876329,
          2791104160,
          1057563949,
          3255363231,
          3075367218,
          3463963227,
          1469046755,
          985887462
        ])
      ];
      this.P = new Uint32Array([
        608135816,
        2242054355,
        320440878,
        57701188,
        2752067618,
        698298832,
        137296536,
        3964562569,
        1160258022,
        953160567,
        3193202383,
        887688300,
        3232508343,
        3380367581,
        1065670069,
        3041331479,
        2450970073,
        2306472731
      ]);
    };
    function F(S, x8, i) {
      return (S[0][x8[i + 3]] + S[1][x8[i + 2]] ^ S[2][x8[i + 1]]) + S[3][x8[i]];
    }
    Blowfish.prototype.encipher = function(x, x8) {
      if (x8 === void 0) {
        x8 = new Uint8Array(x.buffer);
        if (x.byteOffset !== 0)
          x8 = x8.subarray(x.byteOffset);
      }
      x[0] ^= this.P[0];
      for (var i = 1; i < 16; i += 2) {
        x[1] ^= F(this.S, x8, 0) ^ this.P[i];
        x[0] ^= F(this.S, x8, 4) ^ this.P[i + 1];
      }
      var t = x[0];
      x[0] = x[1] ^ this.P[17];
      x[1] = t;
    };
    Blowfish.prototype.decipher = function(x) {
      var x8 = new Uint8Array(x.buffer);
      if (x.byteOffset !== 0)
        x8 = x8.subarray(x.byteOffset);
      x[0] ^= this.P[17];
      for (var i = 16; i > 0; i -= 2) {
        x[1] ^= F(this.S, x8, 0) ^ this.P[i];
        x[0] ^= F(this.S, x8, 4) ^ this.P[i - 1];
      }
      var t = x[0];
      x[0] = x[1] ^ this.P[0];
      x[1] = t;
    };
    function stream2word(data, databytes) {
      var i, temp = 0;
      for (i = 0; i < 4; i++, BLF_J++) {
        if (BLF_J >= databytes)
          BLF_J = 0;
        temp = temp << 8 | data[BLF_J];
      }
      return temp;
    }
    Blowfish.prototype.expand0state = function(key, keybytes) {
      var d = new Uint32Array(2), i, k;
      var d8 = new Uint8Array(d.buffer);
      for (i = 0, BLF_J = 0; i < 18; i++) {
        this.P[i] ^= stream2word(key, keybytes);
      }
      BLF_J = 0;
      for (i = 0; i < 18; i += 2) {
        this.encipher(d, d8);
        this.P[i] = d[0];
        this.P[i + 1] = d[1];
      }
      for (i = 0; i < 4; i++) {
        for (k = 0; k < 256; k += 2) {
          this.encipher(d, d8);
          this.S[i][k] = d[0];
          this.S[i][k + 1] = d[1];
        }
      }
    };
    Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) {
      var d = new Uint32Array(2), i, k;
      for (i = 0, BLF_J = 0; i < 18; i++) {
        this.P[i] ^= stream2word(key, keybytes);
      }
      for (i = 0, BLF_J = 0; i < 18; i += 2) {
        d[0] ^= stream2word(data, databytes);
        d[1] ^= stream2word(data, databytes);
        this.encipher(d);
        this.P[i] = d[0];
        this.P[i + 1] = d[1];
      }
      for (i = 0; i < 4; i++) {
        for (k = 0; k < 256; k += 2) {
          d[0] ^= stream2word(data, databytes);
          d[1] ^= stream2word(data, databytes);
          this.encipher(d);
          this.S[i][k] = d[0];
          this.S[i][k + 1] = d[1];
        }
      }
      BLF_J = 0;
    };
    Blowfish.prototype.enc = function(data, blocks) {
      for (var i = 0; i < blocks; i++) {
        this.encipher(data.subarray(i * 2));
      }
    };
    Blowfish.prototype.dec = function(data, blocks) {
      for (var i = 0; i < blocks; i++) {
        this.decipher(data.subarray(i * 2));
      }
    };
    var BCRYPT_BLOCKS = 8;
    var BCRYPT_HASHSIZE = 32;
    function bcrypt_hash(sha2pass, sha2salt, out) {
      var state = new Blowfish(), cdata = new Uint32Array(BCRYPT_BLOCKS), i, ciphertext = new Uint8Array([
        79,
        120,
        121,
        99,
        104,
        114,
        111,
        109,
        97,
        116,
        105,
        99,
        66,
        108,
        111,
        119,
        102,
        105,
        115,
        104,
        83,
        119,
        97,
        116,
        68,
        121,
        110,
        97,
        109,
        105,
        116,
        101
      ]);
      state.expandstate(sha2salt, 64, sha2pass, 64);
      for (i = 0; i < 64; i++) {
        state.expand0state(sha2salt, 64);
        state.expand0state(sha2pass, 64);
      }
      for (i = 0; i < BCRYPT_BLOCKS; i++)
        cdata[i] = stream2word(ciphertext, ciphertext.byteLength);
      for (i = 0; i < 64; i++)
        state.enc(cdata, cdata.byteLength / 8);
      for (i = 0; i < BCRYPT_BLOCKS; i++) {
        out[4 * i + 3] = cdata[i] >>> 24;
        out[4 * i + 2] = cdata[i] >>> 16;
        out[4 * i + 1] = cdata[i] >>> 8;
        out[4 * i + 0] = cdata[i];
      }
    }
    function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {
      var sha2pass = new Uint8Array(64), sha2salt = new Uint8Array(64), out = new Uint8Array(BCRYPT_HASHSIZE), tmpout = new Uint8Array(BCRYPT_HASHSIZE), countsalt = new Uint8Array(saltlen + 4), i, j, amt, stride, dest, count, origkeylen = keylen;
      if (rounds < 1)
        return -1;
      if (passlen === 0 || saltlen === 0 || keylen === 0 || keylen > out.byteLength * out.byteLength || saltlen > 1 << 20)
        return -1;
      stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);
      amt = Math.floor((keylen + stride - 1) / stride);
      for (i = 0; i < saltlen; i++)
        countsalt[i] = salt[i];
      crypto_hash_sha512(sha2pass, pass, passlen);
      for (count = 1; keylen > 0; count++) {
        countsalt[saltlen + 0] = count >>> 24;
        countsalt[saltlen + 1] = count >>> 16;
        countsalt[saltlen + 2] = count >>> 8;
        countsalt[saltlen + 3] = count;
        crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);
        bcrypt_hash(sha2pass, sha2salt, tmpout);
        for (i = out.byteLength; i--; )
          out[i] = tmpout[i];
        for (i = 1; i < rounds; i++) {
          crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);
          bcrypt_hash(sha2pass, sha2salt, tmpout);
          for (j = 0; j < out.byteLength; j++)
            out[j] ^= tmpout[j];
        }
        amt = Math.min(amt, keylen);
        for (i = 0; i < amt; i++) {
          dest = i * stride + (count - 1);
          if (dest >= origkeylen)
            break;
          key[dest] = out[i];
        }
        keylen -= i;
      }
      return 0;
    }
    module2.exports = {
      BLOCKS: BCRYPT_BLOCKS,
      HASHSIZE: BCRYPT_HASHSIZE,
      hash: bcrypt_hash,
      pbkdf: bcrypt_pbkdf
    };
  }
});

// node_modules/sshpk/lib/formats/ssh-private.js
var require_ssh_private = __commonJS({
  "node_modules/sshpk/lib/formats/ssh-private.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      readSSHPrivate,
      write: write2
    };
    var assert = require_assert();
    var asn1 = require_lib9();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var crypto3 = require("crypto");
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pem = require_pem();
    var rfc4253 = require_rfc4253();
    var SSHBuffer = require_ssh_buffer();
    var errors = require_errors5();
    var bcrypt;
    function read2(buf, options) {
      return pem.read(buf, options);
    }
    var MAGIC = "openssh-key-v1";
    function readSSHPrivate(type, buf, options) {
      buf = new SSHBuffer({ buffer: buf });
      var magic = buf.readCString();
      assert.strictEqual(magic, MAGIC, "bad magic string");
      var cipher = buf.readString();
      var kdf = buf.readString();
      var kdfOpts = buf.readBuffer();
      var nkeys = buf.readInt();
      if (nkeys !== 1) {
        throw new Error("OpenSSH-format key file contains multiple keys: this is unsupported.");
      }
      var pubKey = buf.readBuffer();
      if (type === "public") {
        assert.ok(buf.atEnd(), "excess bytes left after key");
        return rfc4253.read(pubKey);
      }
      var privKeyBlob = buf.readBuffer();
      assert.ok(buf.atEnd(), "excess bytes left after key");
      var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts });
      switch (kdf) {
        case "none":
          if (cipher !== "none") {
            throw new Error('OpenSSH-format key uses KDF "none" but specifies a cipher other than "none"');
          }
          break;
        case "bcrypt":
          var salt = kdfOptsBuf.readBuffer();
          var rounds = kdfOptsBuf.readInt();
          var cinf = utils.opensshCipherInfo(cipher);
          if (bcrypt === void 0) {
            bcrypt = require_bcrypt_pbkdf();
          }
          if (typeof options.passphrase === "string") {
            options.passphrase = Buffer3.from(
              options.passphrase,
              "utf-8"
            );
          }
          if (!Buffer3.isBuffer(options.passphrase)) {
            throw new errors.KeyEncryptedError(
              options.filename,
              "OpenSSH"
            );
          }
          var pass = new Uint8Array(options.passphrase);
          var salti = new Uint8Array(salt);
          var out = new Uint8Array(cinf.keySize + cinf.blockSize);
          var res = bcrypt.pbkdf(
            pass,
            pass.length,
            salti,
            salti.length,
            out,
            out.length,
            rounds
          );
          if (res !== 0) {
            throw new Error("bcrypt_pbkdf function returned failure, parameters invalid");
          }
          out = Buffer3.from(out);
          var ckey = out.slice(0, cinf.keySize);
          var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
          var cipherStream = crypto3.createDecipheriv(
            cinf.opensslName,
            ckey,
            iv
          );
          cipherStream.setAutoPadding(false);
          var chunk, chunks = [];
          cipherStream.once("error", function(e) {
            if (e.toString().indexOf("bad decrypt") !== -1) {
              throw new Error("Incorrect passphrase supplied, could not decrypt key");
            }
            throw e;
          });
          cipherStream.write(privKeyBlob);
          cipherStream.end();
          while ((chunk = cipherStream.read()) !== null)
            chunks.push(chunk);
          privKeyBlob = Buffer3.concat(chunks);
          break;
        default:
          throw new Error(
            'OpenSSH-format key uses unknown KDF "' + kdf + '"'
          );
      }
      buf = new SSHBuffer({ buffer: privKeyBlob });
      var checkInt1 = buf.readInt();
      var checkInt2 = buf.readInt();
      if (checkInt1 !== checkInt2) {
        throw new Error("Incorrect passphrase supplied, could not decrypt key");
      }
      var ret2 = {};
      var key = rfc4253.readInternal(ret2, "private", buf.remainder());
      buf.skip(ret2.consumed);
      var comment = buf.readString();
      key.comment = comment;
      return key;
    }
    function write2(key, options) {
      var pubKey;
      if (PrivateKey.isPrivateKey(key))
        pubKey = key.toPublic();
      else
        pubKey = key;
      var cipher = "none";
      var kdf = "none";
      var kdfopts = Buffer3.alloc(0);
      var cinf = { blockSize: 8 };
      var passphrase;
      if (options !== void 0) {
        passphrase = options.passphrase;
        if (typeof passphrase === "string")
          passphrase = Buffer3.from(passphrase, "utf-8");
        if (passphrase !== void 0) {
          assert.buffer(passphrase, "options.passphrase");
          assert.optionalString(options.cipher, "options.cipher");
          cipher = options.cipher;
          if (cipher === void 0)
            cipher = "aes128-ctr";
          cinf = utils.opensshCipherInfo(cipher);
          kdf = "bcrypt";
        }
      }
      var privBuf;
      if (PrivateKey.isPrivateKey(key)) {
        privBuf = new SSHBuffer({});
        var checkInt = crypto3.randomBytes(4).readUInt32BE(0);
        privBuf.writeInt(checkInt);
        privBuf.writeInt(checkInt);
        privBuf.write(key.toBuffer("rfc4253"));
        privBuf.writeString(key.comment || "");
        var n = 1;
        while (privBuf._offset % cinf.blockSize !== 0)
          privBuf.writeChar(n++);
        privBuf = privBuf.toBuffer();
      }
      switch (kdf) {
        case "none":
          break;
        case "bcrypt":
          var salt = crypto3.randomBytes(16);
          var rounds = 16;
          var kdfssh = new SSHBuffer({});
          kdfssh.writeBuffer(salt);
          kdfssh.writeInt(rounds);
          kdfopts = kdfssh.toBuffer();
          if (bcrypt === void 0) {
            bcrypt = require_bcrypt_pbkdf();
          }
          var pass = new Uint8Array(passphrase);
          var salti = new Uint8Array(salt);
          var out = new Uint8Array(cinf.keySize + cinf.blockSize);
          var res = bcrypt.pbkdf(
            pass,
            pass.length,
            salti,
            salti.length,
            out,
            out.length,
            rounds
          );
          if (res !== 0) {
            throw new Error("bcrypt_pbkdf function returned failure, parameters invalid");
          }
          out = Buffer3.from(out);
          var ckey = out.slice(0, cinf.keySize);
          var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
          var cipherStream = crypto3.createCipheriv(
            cinf.opensslName,
            ckey,
            iv
          );
          cipherStream.setAutoPadding(false);
          var chunk, chunks = [];
          cipherStream.once("error", function(e) {
            throw e;
          });
          cipherStream.write(privBuf);
          cipherStream.end();
          while ((chunk = cipherStream.read()) !== null)
            chunks.push(chunk);
          privBuf = Buffer3.concat(chunks);
          break;
        default:
          throw new Error("Unsupported kdf " + kdf);
      }
      var buf = new SSHBuffer({});
      buf.writeCString(MAGIC);
      buf.writeString(cipher);
      buf.writeString(kdf);
      buf.writeBuffer(kdfopts);
      buf.writeInt(1);
      buf.writeBuffer(pubKey.toBuffer("rfc4253"));
      if (privBuf)
        buf.writeBuffer(privBuf);
      buf = buf.toBuffer();
      var header;
      if (PrivateKey.isPrivateKey(key))
        header = "OPENSSH PRIVATE KEY";
      else
        header = "OPENSSH PUBLIC KEY";
      var tmp = buf.toString("base64");
      var len = tmp.length + tmp.length / 70 + 18 + 16 + header.length * 2 + 10;
      buf = Buffer3.alloc(len);
      var o = 0;
      o += buf.write("-----BEGIN " + header + "-----\n", o);
      for (var i = 0; i < tmp.length; ) {
        var limit = i + 70;
        if (limit > tmp.length)
          limit = tmp.length;
        o += buf.write(tmp.slice(i, limit), o);
        buf[o++] = 10;
        i = limit;
      }
      o += buf.write("-----END " + header + "-----\n", o);
      return buf.slice(0, o);
    }
  }
});

// node_modules/sshpk/lib/formats/pem.js
var require_pem = __commonJS({
  "node_modules/sshpk/lib/formats/pem.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      write: write2
    };
    var assert = require_assert();
    var asn1 = require_lib9();
    var crypto3 = require("crypto");
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pkcs1 = require_pkcs1();
    var pkcs8 = require_pkcs8();
    var sshpriv = require_ssh_private();
    var rfc4253 = require_rfc4253();
    var errors = require_errors5();
    var OID_PBES2 = "1.2.840.113549.1.5.13";
    var OID_PBKDF2 = "1.2.840.113549.1.5.12";
    var OID_TO_CIPHER = {
      "1.2.840.113549.3.7": "3des-cbc",
      "2.16.840.1.101.3.4.1.2": "aes128-cbc",
      "2.16.840.1.101.3.4.1.42": "aes256-cbc"
    };
    var CIPHER_TO_OID = {};
    Object.keys(OID_TO_CIPHER).forEach(function(k) {
      CIPHER_TO_OID[OID_TO_CIPHER[k]] = k;
    });
    var OID_TO_HASH = {
      "1.2.840.113549.2.7": "sha1",
      "1.2.840.113549.2.9": "sha256",
      "1.2.840.113549.2.11": "sha512"
    };
    var HASH_TO_OID = {};
    Object.keys(OID_TO_HASH).forEach(function(k) {
      HASH_TO_OID[OID_TO_HASH[k]] = k;
    });
    function read2(buf, options, forceType2) {
      var input = buf;
      if (typeof buf !== "string") {
        assert.buffer(buf, "buf");
        buf = buf.toString("ascii");
      }
      var lines = buf.trim().split(/[\r\n]+/g);
      var m;
      var si = -1;
      while (!m && si < lines.length) {
        m = lines[++si].match(
          /*JSSTYLED*/
          /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/
        );
      }
      assert.ok(m, "invalid PEM header");
      var m2;
      var ei = lines.length;
      while (!m2 && ei > 0) {
        m2 = lines[--ei].match(
          /*JSSTYLED*/
          /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/
        );
      }
      assert.ok(m2, "invalid PEM footer");
      assert.equal(m[2], m2[2]);
      var type = m[2].toLowerCase();
      var alg;
      if (m[1]) {
        assert.equal(m[1], m2[1], "PEM header and footer mismatch");
        alg = m[1].trim();
      }
      lines = lines.slice(si, ei + 1);
      var headers = {};
      while (true) {
        lines = lines.slice(1);
        m = lines[0].match(
          /*JSSTYLED*/
          /^([A-Za-z0-9-]+): (.+)$/
        );
        if (!m)
          break;
        headers[m[1].toLowerCase()] = m[2];
      }
      lines = lines.slice(0, -1).join("");
      buf = Buffer3.from(lines, "base64");
      var cipher, key, iv;
      if (headers["proc-type"]) {
        var parts = headers["proc-type"].split(",");
        if (parts[0] === "4" && parts[1] === "ENCRYPTED") {
          if (typeof options.passphrase === "string") {
            options.passphrase = Buffer3.from(
              options.passphrase,
              "utf-8"
            );
          }
          if (!Buffer3.isBuffer(options.passphrase)) {
            throw new errors.KeyEncryptedError(
              options.filename,
              "PEM"
            );
          } else {
            parts = headers["dek-info"].split(",");
            assert.ok(parts.length === 2);
            cipher = parts[0].toLowerCase();
            iv = Buffer3.from(parts[1], "hex");
            key = utils.opensslKeyDeriv(
              cipher,
              iv,
              options.passphrase,
              1
            ).key;
          }
        }
      }
      if (alg && alg.toLowerCase() === "encrypted") {
        var eder = new asn1.BerReader(buf);
        var pbesEnd;
        eder.readSequence();
        eder.readSequence();
        pbesEnd = eder.offset + eder.length;
        var method = eder.readOID();
        if (method !== OID_PBES2) {
          throw new Error("Unsupported PEM/PKCS8 encryption scheme: " + method);
        }
        eder.readSequence();
        eder.readSequence();
        var kdfEnd = eder.offset + eder.length;
        var kdfOid = eder.readOID();
        if (kdfOid !== OID_PBKDF2)
          throw new Error("Unsupported PBES2 KDF: " + kdfOid);
        eder.readSequence();
        var salt = eder.readString(asn1.Ber.OctetString, true);
        var iterations = eder.readInt();
        var hashAlg = "sha1";
        if (eder.offset < kdfEnd) {
          eder.readSequence();
          var hashAlgOid = eder.readOID();
          hashAlg = OID_TO_HASH[hashAlgOid];
          if (hashAlg === void 0) {
            throw new Error("Unsupported PBKDF2 hash: " + hashAlgOid);
          }
        }
        eder._offset = kdfEnd;
        eder.readSequence();
        var cipherOid = eder.readOID();
        cipher = OID_TO_CIPHER[cipherOid];
        if (cipher === void 0) {
          throw new Error("Unsupported PBES2 cipher: " + cipherOid);
        }
        iv = eder.readString(asn1.Ber.OctetString, true);
        eder._offset = pbesEnd;
        buf = eder.readString(asn1.Ber.OctetString, true);
        if (typeof options.passphrase === "string") {
          options.passphrase = Buffer3.from(
            options.passphrase,
            "utf-8"
          );
        }
        if (!Buffer3.isBuffer(options.passphrase)) {
          throw new errors.KeyEncryptedError(
            options.filename,
            "PEM"
          );
        }
        var cinfo = utils.opensshCipherInfo(cipher);
        cipher = cinfo.opensslName;
        key = utils.pbkdf2(
          hashAlg,
          salt,
          iterations,
          cinfo.keySize,
          options.passphrase
        );
        alg = void 0;
      }
      if (cipher && key && iv) {
        var cipherStream = crypto3.createDecipheriv(cipher, key, iv);
        var chunk, chunks = [];
        cipherStream.once("error", function(e) {
          if (e.toString().indexOf("bad decrypt") !== -1) {
            throw new Error("Incorrect passphrase supplied, could not decrypt key");
          }
          throw e;
        });
        cipherStream.write(buf);
        cipherStream.end();
        while ((chunk = cipherStream.read()) !== null)
          chunks.push(chunk);
        buf = Buffer3.concat(chunks);
      }
      if (alg && alg.toLowerCase() === "openssh")
        return sshpriv.readSSHPrivate(type, buf, options);
      if (alg && alg.toLowerCase() === "ssh2")
        return rfc4253.readType(type, buf, options);
      var der = new asn1.BerReader(buf);
      der.originalInput = input;
      der.readSequence();
      if (alg) {
        if (forceType2)
          assert.strictEqual(forceType2, "pkcs1");
        return pkcs1.readPkcs1(alg, type, der);
      } else {
        if (forceType2)
          assert.strictEqual(forceType2, "pkcs8");
        return pkcs8.readPkcs8(alg, type, der);
      }
    }
    function write2(key, options, type) {
      assert.object(key);
      var alg = {
        "ecdsa": "EC",
        "rsa": "RSA",
        "dsa": "DSA",
        "ed25519": "EdDSA"
      }[key.type];
      var header;
      var der = new asn1.BerWriter();
      if (PrivateKey.isPrivateKey(key)) {
        if (type && type === "pkcs8") {
          header = "PRIVATE KEY";
          pkcs8.writePkcs8(der, key);
        } else {
          if (type)
            assert.strictEqual(type, "pkcs1");
          header = alg + " PRIVATE KEY";
          pkcs1.writePkcs1(der, key);
        }
      } else if (Key.isKey(key)) {
        if (type && type === "pkcs1") {
          header = alg + " PUBLIC KEY";
          pkcs1.writePkcs1(der, key);
        } else {
          if (type)
            assert.strictEqual(type, "pkcs8");
          header = "PUBLIC KEY";
          pkcs8.writePkcs8(der, key);
        }
      } else {
        throw new Error("key is not a Key or PrivateKey");
      }
      var tmp = der.buffer.toString("base64");
      var len = tmp.length + tmp.length / 64 + 18 + 16 + header.length * 2 + 10;
      var buf = Buffer3.alloc(len);
      var o = 0;
      o += buf.write("-----BEGIN " + header + "-----\n", o);
      for (var i = 0; i < tmp.length; ) {
        var limit = i + 64;
        if (limit > tmp.length)
          limit = tmp.length;
        o += buf.write(tmp.slice(i, limit), o);
        buf[o++] = 10;
        i = limit;
      }
      o += buf.write("-----END " + header + "-----\n", o);
      return buf.slice(0, o);
    }
  }
});

// node_modules/sshpk/lib/formats/ssh.js
var require_ssh = __commonJS({
  "node_modules/sshpk/lib/formats/ssh.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      write: write2
    };
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var rfc4253 = require_rfc4253();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var sshpriv = require_ssh_private();
    var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/;
    var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/;
    function read2(buf, options) {
      if (typeof buf !== "string") {
        assert.buffer(buf, "buf");
        buf = buf.toString("ascii");
      }
      var trimmed = buf.trim().replace(/[\\\r]/g, "");
      var m = trimmed.match(SSHKEY_RE);
      if (!m)
        m = trimmed.match(SSHKEY_RE2);
      assert.ok(m, "key must match regex");
      var type = rfc4253.algToKeyType(m[1]);
      var kbuf = Buffer3.from(m[2], "base64");
      var key;
      var ret2 = {};
      if (m[4]) {
        try {
          key = rfc4253.read(kbuf);
        } catch (e) {
          m = trimmed.match(SSHKEY_RE2);
          assert.ok(m, "key must match regex");
          kbuf = Buffer3.from(m[2], "base64");
          key = rfc4253.readInternal(ret2, "public", kbuf);
        }
      } else {
        key = rfc4253.readInternal(ret2, "public", kbuf);
      }
      assert.strictEqual(type, key.type);
      if (m[4] && m[4].length > 0) {
        key.comment = m[4];
      } else if (ret2.consumed) {
        var data = m[2] + (m[3] ? m[3] : "");
        var realOffset = Math.ceil(ret2.consumed / 3) * 4;
        data = data.slice(0, realOffset - 2).replace(/[^a-zA-Z0-9+\/=]/g, "") + data.slice(realOffset - 2);
        var padding = ret2.consumed % 3;
        if (padding > 0 && data.slice(realOffset - 1, realOffset) !== "=")
          realOffset--;
        while (data.slice(realOffset, realOffset + 1) === "=")
          realOffset++;
        var trailer = data.slice(realOffset);
        trailer = trailer.replace(/[\r\n]/g, " ").replace(/^\s+/, "");
        if (trailer.match(/^[a-zA-Z0-9]/))
          key.comment = trailer;
      }
      return key;
    }
    function write2(key, options) {
      assert.object(key);
      if (!Key.isKey(key))
        throw new Error("Must be a public key");
      var parts = [];
      var alg = rfc4253.keyTypeToAlg(key);
      parts.push(alg);
      var buf = rfc4253.write(key);
      parts.push(buf.toString("base64"));
      if (key.comment)
        parts.push(key.comment);
      return Buffer3.from(parts.join(" "));
    }
  }
});

// node_modules/sshpk/lib/formats/dnssec.js
var require_dnssec = __commonJS({
  "node_modules/sshpk/lib/formats/dnssec.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      write: write2
    };
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var Key = require_key();
    var PrivateKey = require_private_key();
    var utils = require_utils6();
    var SSHBuffer = require_ssh_buffer();
    var Dhe = require_dhe();
    var supportedAlgos = {
      "rsa-sha1": 5,
      "rsa-sha256": 8,
      "rsa-sha512": 10,
      "ecdsa-p256-sha256": 13,
      "ecdsa-p384-sha384": 14
      /*
       * ed25519 is hypothetically supported with id 15
       * but the common tools available don't appear to be
       * capable of generating/using ed25519 keys
       */
    };
    var supportedAlgosById = {};
    Object.keys(supportedAlgos).forEach(function(k) {
      supportedAlgosById[supportedAlgos[k]] = k.toUpperCase();
    });
    function read2(buf, options) {
      if (typeof buf !== "string") {
        assert.buffer(buf, "buf");
        buf = buf.toString("ascii");
      }
      var lines = buf.split("\n");
      if (lines[0].match(/^Private-key-format\: v1/)) {
        var algElems = lines[1].split(" ");
        var algoNum = parseInt(algElems[1], 10);
        var algoName = algElems[2];
        if (!supportedAlgosById[algoNum])
          throw new Error("Unsupported algorithm: " + algoName);
        return readDNSSECPrivateKey(algoNum, lines.slice(2));
      }
      var line = 0;
      while (lines[line].match(/^\;/))
        line++;
      if ((lines[line].match(/\. IN KEY /) || lines[line].match(/\. IN DNSKEY /)) && lines[line + 1].length === 0) {
        return readRFC3110(lines[line]);
      }
      throw new Error("Cannot parse dnssec key");
    }
    function readRFC3110(keyString) {
      var elems = keyString.split(" ");
      var algorithm2 = parseInt(elems[5], 10);
      if (!supportedAlgosById[algorithm2])
        throw new Error("Unsupported algorithm: " + algorithm2);
      var base64key = elems.slice(6, elems.length).join();
      var keyBuffer = Buffer3.from(base64key, "base64");
      if (supportedAlgosById[algorithm2].match(/^RSA-/)) {
        var publicExponentLen = keyBuffer.readUInt8(0);
        if (publicExponentLen != 3 && publicExponentLen != 1)
          throw new Error("Cannot parse dnssec key: unsupported exponent length");
        var publicExponent = keyBuffer.slice(1, publicExponentLen + 1);
        publicExponent = utils.mpNormalize(publicExponent);
        var modulus = keyBuffer.slice(1 + publicExponentLen);
        modulus = utils.mpNormalize(modulus);
        var rsaKey = {
          type: "rsa",
          parts: []
        };
        rsaKey.parts.push({ name: "e", data: publicExponent });
        rsaKey.parts.push({ name: "n", data: modulus });
        return new Key(rsaKey);
      }
      if (supportedAlgosById[algorithm2] === "ECDSA-P384-SHA384" || supportedAlgosById[algorithm2] === "ECDSA-P256-SHA256") {
        var curve = "nistp384";
        var size = 384;
        if (supportedAlgosById[algorithm2].match(/^ECDSA-P256-SHA256/)) {
          curve = "nistp256";
          size = 256;
        }
        var ecdsaKey = {
          type: "ecdsa",
          curve,
          size,
          parts: [
            { name: "curve", data: Buffer3.from(curve) },
            { name: "Q", data: utils.ecNormalize(keyBuffer) }
          ]
        };
        return new Key(ecdsaKey);
      }
      throw new Error("Unsupported algorithm: " + supportedAlgosById[algorithm2]);
    }
    function elementToBuf(e) {
      return Buffer3.from(e.split(" ")[1], "base64");
    }
    function readDNSSECRSAPrivateKey(elements) {
      var rsaParams = {};
      elements.forEach(function(element) {
        if (element.split(" ")[0] === "Modulus:")
          rsaParams["n"] = elementToBuf(element);
        else if (element.split(" ")[0] === "PublicExponent:")
          rsaParams["e"] = elementToBuf(element);
        else if (element.split(" ")[0] === "PrivateExponent:")
          rsaParams["d"] = elementToBuf(element);
        else if (element.split(" ")[0] === "Prime1:")
          rsaParams["p"] = elementToBuf(element);
        else if (element.split(" ")[0] === "Prime2:")
          rsaParams["q"] = elementToBuf(element);
        else if (element.split(" ")[0] === "Exponent1:")
          rsaParams["dmodp"] = elementToBuf(element);
        else if (element.split(" ")[0] === "Exponent2:")
          rsaParams["dmodq"] = elementToBuf(element);
        else if (element.split(" ")[0] === "Coefficient:")
          rsaParams["iqmp"] = elementToBuf(element);
      });
      var key = {
        type: "rsa",
        parts: [
          { name: "e", data: utils.mpNormalize(rsaParams["e"]) },
          { name: "n", data: utils.mpNormalize(rsaParams["n"]) },
          { name: "d", data: utils.mpNormalize(rsaParams["d"]) },
          { name: "p", data: utils.mpNormalize(rsaParams["p"]) },
          { name: "q", data: utils.mpNormalize(rsaParams["q"]) },
          {
            name: "dmodp",
            data: utils.mpNormalize(rsaParams["dmodp"])
          },
          {
            name: "dmodq",
            data: utils.mpNormalize(rsaParams["dmodq"])
          },
          {
            name: "iqmp",
            data: utils.mpNormalize(rsaParams["iqmp"])
          }
        ]
      };
      return new PrivateKey(key);
    }
    function readDNSSECPrivateKey(alg, elements) {
      if (supportedAlgosById[alg].match(/^RSA-/)) {
        return readDNSSECRSAPrivateKey(elements);
      }
      if (supportedAlgosById[alg] === "ECDSA-P384-SHA384" || supportedAlgosById[alg] === "ECDSA-P256-SHA256") {
        var d = Buffer3.from(elements[0].split(" ")[1], "base64");
        var curve = "nistp384";
        var size = 384;
        if (supportedAlgosById[alg] === "ECDSA-P256-SHA256") {
          curve = "nistp256";
          size = 256;
        }
        var publicKey = utils.publicFromPrivateECDSA(curve, d);
        var Q = publicKey.part["Q"].data;
        var ecdsaKey = {
          type: "ecdsa",
          curve,
          size,
          parts: [
            { name: "curve", data: Buffer3.from(curve) },
            { name: "d", data: d },
            { name: "Q", data: Q }
          ]
        };
        return new PrivateKey(ecdsaKey);
      }
      throw new Error("Unsupported algorithm: " + supportedAlgosById[alg]);
    }
    function dnssecTimestamp(date) {
      var year = date.getFullYear() + "";
      var month = date.getMonth() + 1;
      var timestampStr = year + month + date.getUTCDate();
      timestampStr += "" + date.getUTCHours() + date.getUTCMinutes();
      timestampStr += date.getUTCSeconds();
      return timestampStr;
    }
    function rsaAlgFromOptions(opts) {
      if (!opts || !opts.hashAlgo || opts.hashAlgo === "sha1")
        return "5 (RSASHA1)";
      else if (opts.hashAlgo === "sha256")
        return "8 (RSASHA256)";
      else if (opts.hashAlgo === "sha512")
        return "10 (RSASHA512)";
      else
        throw new Error("Unknown or unsupported hash: " + opts.hashAlgo);
    }
    function writeRSA(key, options) {
      if (!key.part.dmodp || !key.part.dmodq) {
        utils.addRSAMissing(key);
      }
      var out = "";
      out += "Private-key-format: v1.3\n";
      out += "Algorithm: " + rsaAlgFromOptions(options) + "\n";
      var n = utils.mpDenormalize(key.part["n"].data);
      out += "Modulus: " + n.toString("base64") + "\n";
      var e = utils.mpDenormalize(key.part["e"].data);
      out += "PublicExponent: " + e.toString("base64") + "\n";
      var d = utils.mpDenormalize(key.part["d"].data);
      out += "PrivateExponent: " + d.toString("base64") + "\n";
      var p = utils.mpDenormalize(key.part["p"].data);
      out += "Prime1: " + p.toString("base64") + "\n";
      var q2 = utils.mpDenormalize(key.part["q"].data);
      out += "Prime2: " + q2.toString("base64") + "\n";
      var dmodp = utils.mpDenormalize(key.part["dmodp"].data);
      out += "Exponent1: " + dmodp.toString("base64") + "\n";
      var dmodq = utils.mpDenormalize(key.part["dmodq"].data);
      out += "Exponent2: " + dmodq.toString("base64") + "\n";
      var iqmp = utils.mpDenormalize(key.part["iqmp"].data);
      out += "Coefficient: " + iqmp.toString("base64") + "\n";
      var timestamp = new Date();
      out += "Created: " + dnssecTimestamp(timestamp) + "\n";
      out += "Publish: " + dnssecTimestamp(timestamp) + "\n";
      out += "Activate: " + dnssecTimestamp(timestamp) + "\n";
      return Buffer3.from(out, "ascii");
    }
    function writeECDSA(key, options) {
      var out = "";
      out += "Private-key-format: v1.3\n";
      if (key.curve === "nistp256") {
        out += "Algorithm: 13 (ECDSAP256SHA256)\n";
      } else if (key.curve === "nistp384") {
        out += "Algorithm: 14 (ECDSAP384SHA384)\n";
      } else {
        throw new Error("Unsupported curve");
      }
      var base64Key = key.part["d"].data.toString("base64");
      out += "PrivateKey: " + base64Key + "\n";
      var timestamp = new Date();
      out += "Created: " + dnssecTimestamp(timestamp) + "\n";
      out += "Publish: " + dnssecTimestamp(timestamp) + "\n";
      out += "Activate: " + dnssecTimestamp(timestamp) + "\n";
      return Buffer3.from(out, "ascii");
    }
    function write2(key, options) {
      if (PrivateKey.isPrivateKey(key)) {
        if (key.type === "rsa") {
          return writeRSA(key, options);
        } else if (key.type === "ecdsa") {
          return writeECDSA(key, options);
        } else {
          throw new Error("Unsupported algorithm: " + key.type);
        }
      } else if (Key.isKey(key)) {
        throw new Error('Format "dnssec" only supports writing private keys');
      } else {
        throw new Error("key is not a Key or PrivateKey");
      }
    }
  }
});

// node_modules/sshpk/lib/formats/putty.js
var require_putty = __commonJS({
  "node_modules/sshpk/lib/formats/putty.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      write: write2
    };
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var rfc4253 = require_rfc4253();
    var Key = require_key();
    var SSHBuffer = require_ssh_buffer();
    var crypto3 = require("crypto");
    var PrivateKey = require_private_key();
    var errors = require_errors5();
    function read2(buf, options) {
      var lines = buf.toString("ascii").split(/[\r\n]+/);
      var found = false;
      var parts;
      var si = 0;
      var formatVersion;
      while (si < lines.length) {
        parts = splitHeader(lines[si++]);
        if (parts) {
          formatVersion = {
            "putty-user-key-file-2": 2,
            "putty-user-key-file-3": 3
          }[parts[0].toLowerCase()];
          if (formatVersion) {
            found = true;
            break;
          }
        }
      }
      if (!found) {
        throw new Error("No PuTTY format first line found");
      }
      var alg = parts[1];
      parts = splitHeader(lines[si++]);
      assert.equal(parts[0].toLowerCase(), "encryption");
      var encryption = parts[1];
      parts = splitHeader(lines[si++]);
      assert.equal(parts[0].toLowerCase(), "comment");
      var comment = parts[1];
      parts = splitHeader(lines[si++]);
      assert.equal(parts[0].toLowerCase(), "public-lines");
      var publicLines = parseInt(parts[1], 10);
      if (!isFinite(publicLines) || publicLines < 0 || publicLines > lines.length) {
        throw new Error("Invalid public-lines count");
      }
      var publicBuf = Buffer3.from(
        lines.slice(si, si + publicLines).join(""),
        "base64"
      );
      var keyType = rfc4253.algToKeyType(alg);
      var key = rfc4253.read(publicBuf);
      if (key.type !== keyType) {
        throw new Error("Outer key algorithm mismatch");
      }
      si += publicLines;
      if (lines[si]) {
        parts = splitHeader(lines[si++]);
        assert.equal(parts[0].toLowerCase(), "private-lines");
        var privateLines = parseInt(parts[1], 10);
        if (!isFinite(privateLines) || privateLines < 0 || privateLines > lines.length) {
          throw new Error("Invalid private-lines count");
        }
        var privateBuf = Buffer3.from(
          lines.slice(si, si + privateLines).join(""),
          "base64"
        );
        if (encryption !== "none" && formatVersion === 3) {
          throw new Error("Encrypted keys arenot supported for PuTTY format version 3");
        }
        if (encryption === "aes256-cbc") {
          if (!options.passphrase) {
            throw new errors.KeyEncryptedError(
              options.filename,
              "PEM"
            );
          }
          var iv = Buffer3.alloc(16, 0);
          var decipher = crypto3.createDecipheriv(
            "aes-256-cbc",
            derivePPK2EncryptionKey(options.passphrase),
            iv
          );
          decipher.setAutoPadding(false);
          privateBuf = Buffer3.concat([
            decipher.update(privateBuf),
            decipher.final()
          ]);
        }
        key = new PrivateKey(key);
        if (key.type !== keyType) {
          throw new Error("Outer key algorithm mismatch");
        }
        var sshbuf = new SSHBuffer({ buffer: privateBuf });
        var privateKeyParts;
        if (alg === "ssh-dss") {
          privateKeyParts = [{
            name: "x",
            data: sshbuf.readBuffer()
          }];
        } else if (alg === "ssh-rsa") {
          privateKeyParts = [
            { name: "d", data: sshbuf.readBuffer() },
            { name: "p", data: sshbuf.readBuffer() },
            { name: "q", data: sshbuf.readBuffer() },
            { name: "iqmp", data: sshbuf.readBuffer() }
          ];
        } else if (alg.match(/^ecdsa-sha2-nistp/)) {
          privateKeyParts = [{
            name: "d",
            data: sshbuf.readBuffer()
          }];
        } else if (alg === "ssh-ed25519") {
          privateKeyParts = [{
            name: "k",
            data: sshbuf.readBuffer()
          }];
        } else {
          throw new Error("Unsupported PPK key type: " + alg);
        }
        key = new PrivateKey({
          type: key.type,
          parts: key.parts.concat(privateKeyParts)
        });
      }
      key.comment = comment;
      return key;
    }
    function derivePPK2EncryptionKey(passphrase) {
      var hash1 = crypto3.createHash("sha1").update(Buffer3.concat([
        Buffer3.from([0, 0, 0, 0]),
        Buffer3.from(passphrase)
      ])).digest();
      var hash22 = crypto3.createHash("sha1").update(Buffer3.concat([
        Buffer3.from([0, 0, 0, 1]),
        Buffer3.from(passphrase)
      ])).digest();
      return Buffer3.concat([hash1, hash22]).slice(0, 32);
    }
    function splitHeader(line) {
      var idx = line.indexOf(":");
      if (idx === -1)
        return null;
      var header = line.slice(0, idx);
      ++idx;
      while (line[idx] === " ")
        ++idx;
      var rest = line.slice(idx);
      return [header, rest];
    }
    function write2(key, options) {
      assert.object(key);
      if (!Key.isKey(key))
        throw new Error("Must be a public key");
      var alg = rfc4253.keyTypeToAlg(key);
      var buf = rfc4253.write(key);
      var comment = key.comment || "";
      var b64 = buf.toString("base64");
      var lines = wrap(b64, 64);
      lines.unshift("Public-Lines: " + lines.length);
      lines.unshift("Comment: " + comment);
      lines.unshift("Encryption: none");
      lines.unshift("PuTTY-User-Key-File-2: " + alg);
      return Buffer3.from(lines.join("\n") + "\n");
    }
    function wrap(txt, len) {
      var lines = [];
      var pos = 0;
      while (pos < txt.length) {
        lines.push(txt.slice(pos, pos + 64));
        pos += 64;
      }
      return lines;
    }
  }
});

// node_modules/sshpk/lib/formats/auto.js
var require_auto = __commonJS({
  "node_modules/sshpk/lib/formats/auto.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      write: write2
    };
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pem = require_pem();
    var ssh = require_ssh();
    var rfc4253 = require_rfc4253();
    var dnssec = require_dnssec();
    var putty = require_putty();
    var DNSSEC_PRIVKEY_HEADER_PREFIX = "Private-key-format: v1";
    function read2(buf, options) {
      if (typeof buf === "string") {
        if (buf.trim().match(/^[-]+[ ]*BEGIN/))
          return pem.read(buf, options);
        if (buf.match(/^\s*ssh-[a-z]/))
          return ssh.read(buf, options);
        if (buf.match(/^\s*ecdsa-/))
          return ssh.read(buf, options);
        if (buf.match(/^putty-user-key-file-2:/i))
          return putty.read(buf, options);
        if (findDNSSECHeader(buf))
          return dnssec.read(buf, options);
        buf = Buffer3.from(buf, "binary");
      } else {
        assert.buffer(buf);
        if (findPEMHeader(buf))
          return pem.read(buf, options);
        if (findSSHHeader(buf))
          return ssh.read(buf, options);
        if (findPuTTYHeader(buf))
          return putty.read(buf, options);
        if (findDNSSECHeader(buf))
          return dnssec.read(buf, options);
      }
      if (buf.readUInt32BE(0) < buf.length)
        return rfc4253.read(buf, options);
      throw new Error("Failed to auto-detect format of key");
    }
    function findPuTTYHeader(buf) {
      var offset2 = 0;
      while (offset2 < buf.length && (buf[offset2] === 32 || buf[offset2] === 10 || buf[offset2] === 9))
        ++offset2;
      if (offset2 + 22 <= buf.length && buf.slice(offset2, offset2 + 22).toString("ascii").toLowerCase() === "putty-user-key-file-2:")
        return true;
      return false;
    }
    function findSSHHeader(buf) {
      var offset2 = 0;
      while (offset2 < buf.length && (buf[offset2] === 32 || buf[offset2] === 10 || buf[offset2] === 9))
        ++offset2;
      if (offset2 + 4 <= buf.length && buf.slice(offset2, offset2 + 4).toString("ascii") === "ssh-")
        return true;
      if (offset2 + 6 <= buf.length && buf.slice(offset2, offset2 + 6).toString("ascii") === "ecdsa-")
        return true;
      return false;
    }
    function findPEMHeader(buf) {
      var offset2 = 0;
      while (offset2 < buf.length && (buf[offset2] === 32 || buf[offset2] === 10))
        ++offset2;
      if (buf[offset2] !== 45)
        return false;
      while (offset2 < buf.length && buf[offset2] === 45)
        ++offset2;
      while (offset2 < buf.length && buf[offset2] === 32)
        ++offset2;
      if (offset2 + 5 > buf.length || buf.slice(offset2, offset2 + 5).toString("ascii") !== "BEGIN")
        return false;
      return true;
    }
    function findDNSSECHeader(buf) {
      if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length)
        return false;
      var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length);
      if (headerCheck.toString("ascii") === DNSSEC_PRIVKEY_HEADER_PREFIX)
        return true;
      if (typeof buf !== "string") {
        buf = buf.toString("ascii");
      }
      var lines = buf.split("\n");
      var line = 0;
      while (lines[line].match(/^\;/))
        line++;
      if (lines[line].toString("ascii").match(/\. IN KEY /))
        return true;
      if (lines[line].toString("ascii").match(/\. IN DNSKEY /))
        return true;
      return false;
    }
    function write2(key, options) {
      throw new Error('"auto" format cannot be used for writing');
    }
  }
});

// node_modules/sshpk/lib/private-key.js
var require_private_key = __commonJS({
  "node_modules/sshpk/lib/private-key.js"(exports2, module2) {
    module2.exports = PrivateKey;
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var crypto3 = require("crypto");
    var Fingerprint = require_fingerprint();
    var Signature = require_signature();
    var errs = require_errors5();
    var util = require("util");
    var utils = require_utils6();
    var dhe = require_dhe();
    var generateECDSA = dhe.generateECDSA;
    var generateED25519 = dhe.generateED25519;
    var edCompat = require_ed_compat();
    var nacl = require_nacl_fast();
    var Key = require_key();
    var InvalidAlgorithmError = errs.InvalidAlgorithmError;
    var KeyParseError = errs.KeyParseError;
    var KeyEncryptedError = errs.KeyEncryptedError;
    var formats = {};
    formats["auto"] = require_auto();
    formats["pem"] = require_pem();
    formats["pkcs1"] = require_pkcs1();
    formats["pkcs8"] = require_pkcs8();
    formats["rfc4253"] = require_rfc4253();
    formats["ssh-private"] = require_ssh_private();
    formats["openssh"] = formats["ssh-private"];
    formats["ssh"] = formats["ssh-private"];
    formats["dnssec"] = require_dnssec();
    formats["putty"] = require_putty();
    function PrivateKey(opts) {
      assert.object(opts, "options");
      Key.call(this, opts);
      this._pubCache = void 0;
    }
    util.inherits(PrivateKey, Key);
    PrivateKey.formats = formats;
    PrivateKey.prototype.toBuffer = function(format, options) {
      if (format === void 0)
        format = "pkcs1";
      assert.string(format, "format");
      assert.object(formats[format], "formats[format]");
      assert.optionalObject(options, "options");
      return formats[format].write(this, options);
    };
    PrivateKey.prototype.hash = function(algo, type) {
      return this.toPublic().hash(algo, type);
    };
    PrivateKey.prototype.fingerprint = function(algo, type) {
      return this.toPublic().fingerprint(algo, type);
    };
    PrivateKey.prototype.toPublic = function() {
      if (this._pubCache)
        return this._pubCache;
      var algInfo = algs.info[this.type];
      var pubParts = [];
      for (var i = 0; i < algInfo.parts.length; ++i) {
        var p = algInfo.parts[i];
        pubParts.push(this.part[p]);
      }
      this._pubCache = new Key({
        type: this.type,
        source: this,
        parts: pubParts
      });
      if (this.comment)
        this._pubCache.comment = this.comment;
      return this._pubCache;
    };
    PrivateKey.prototype.derive = function(newType) {
      assert.string(newType, "type");
      var priv, pub, pair;
      if (this.type === "ed25519" && newType === "curve25519") {
        priv = this.part.k.data;
        if (priv[0] === 0)
          priv = priv.slice(1);
        pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));
        pub = Buffer3.from(pair.publicKey);
        return new PrivateKey({
          type: "curve25519",
          parts: [
            { name: "A", data: utils.mpNormalize(pub) },
            { name: "k", data: utils.mpNormalize(priv) }
          ]
        });
      } else if (this.type === "curve25519" && newType === "ed25519") {
        priv = this.part.k.data;
        if (priv[0] === 0)
          priv = priv.slice(1);
        pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));
        pub = Buffer3.from(pair.publicKey);
        return new PrivateKey({
          type: "ed25519",
          parts: [
            { name: "A", data: utils.mpNormalize(pub) },
            { name: "k", data: utils.mpNormalize(priv) }
          ]
        });
      }
      throw new Error("Key derivation not supported from " + this.type + " to " + newType);
    };
    PrivateKey.prototype.createVerify = function(hashAlgo) {
      return this.toPublic().createVerify(hashAlgo);
    };
    PrivateKey.prototype.createSign = function(hashAlgo) {
      if (hashAlgo === void 0)
        hashAlgo = this.defaultHashAlgorithm();
      assert.string(hashAlgo, "hash algorithm");
      if (this.type === "ed25519" && edCompat !== void 0)
        return new edCompat.Signer(this, hashAlgo);
      if (this.type === "curve25519")
        throw new Error("Curve25519 keys are not suitable for signing or verification");
      var v, nm, err;
      try {
        nm = hashAlgo.toUpperCase();
        v = crypto3.createSign(nm);
      } catch (e) {
        err = e;
      }
      if (v === void 0 || err instanceof Error && err.message.match(/Unknown message digest/)) {
        nm = "RSA-";
        nm += hashAlgo.toUpperCase();
        v = crypto3.createSign(nm);
      }
      assert.ok(v, "failed to create verifier");
      var oldSign = v.sign.bind(v);
      var key = this.toBuffer("pkcs1");
      var type = this.type;
      var curve = this.curve;
      v.sign = function() {
        var sig = oldSign(key);
        if (typeof sig === "string")
          sig = Buffer3.from(sig, "binary");
        sig = Signature.parse(sig, type, "asn1");
        sig.hashAlgorithm = hashAlgo;
        sig.curve = curve;
        return sig;
      };
      return v;
    };
    PrivateKey.parse = function(data, format, options) {
      if (typeof data !== "string")
        assert.buffer(data, "data");
      if (format === void 0)
        format = "auto";
      assert.string(format, "format");
      if (typeof options === "string")
        options = { filename: options };
      assert.optionalObject(options, "options");
      if (options === void 0)
        options = {};
      assert.optionalString(options.filename, "options.filename");
      if (options.filename === void 0)
        options.filename = "(unnamed)";
      assert.object(formats[format], "formats[format]");
      try {
        var k = formats[format].read(data, options);
        assert.ok(k instanceof PrivateKey, "key is not a private key");
        if (!k.comment)
          k.comment = options.filename;
        return k;
      } catch (e) {
        if (e.name === "KeyEncryptedError")
          throw e;
        throw new KeyParseError(options.filename, format, e);
      }
    };
    PrivateKey.isPrivateKey = function(obj2, ver) {
      return utils.isCompatible(obj2, PrivateKey, ver);
    };
    PrivateKey.generate = function(type, options) {
      if (options === void 0)
        options = {};
      assert.object(options, "options");
      switch (type) {
        case "ecdsa":
          if (options.curve === void 0)
            options.curve = "nistp256";
          assert.string(options.curve, "options.curve");
          return generateECDSA(options.curve);
        case "ed25519":
          return generateED25519();
        default:
          throw new Error('Key generation not supported with key type "' + type + '"');
      }
    };
    PrivateKey.prototype._sshpkApiVersion = [1, 6];
    PrivateKey._oldVersionDetect = function(obj2) {
      assert.func(obj2.toPublic);
      assert.func(obj2.createSign);
      if (obj2.derive)
        return [1, 3];
      if (obj2.defaultHashAlgorithm)
        return [1, 2];
      if (obj2.formats["auto"])
        return [1, 1];
      return [1, 0];
    };
  }
});

// node_modules/sshpk/lib/identity.js
var require_identity = __commonJS({
  "node_modules/sshpk/lib/identity.js"(exports2, module2) {
    module2.exports = Identity;
    var assert = require_assert();
    var algs = require_algs();
    var crypto3 = require("crypto");
    var Fingerprint = require_fingerprint();
    var Signature = require_signature();
    var errs = require_errors5();
    var util = require("util");
    var utils = require_utils6();
    var asn1 = require_lib9();
    var Buffer3 = require_safer().Buffer;
    var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i;
    var oids = {};
    oids.cn = "2.5.4.3";
    oids.o = "2.5.4.10";
    oids.ou = "2.5.4.11";
    oids.l = "2.5.4.7";
    oids.s = "2.5.4.8";
    oids.c = "2.5.4.6";
    oids.sn = "2.5.4.4";
    oids.postalCode = "2.5.4.17";
    oids.serialNumber = "2.5.4.5";
    oids.street = "2.5.4.9";
    oids.x500UniqueIdentifier = "2.5.4.45";
    oids.role = "2.5.4.72";
    oids.telephoneNumber = "2.5.4.20";
    oids.description = "2.5.4.13";
    oids.dc = "0.9.2342.19200300.100.1.25";
    oids.uid = "0.9.2342.19200300.100.1.1";
    oids.mail = "0.9.2342.19200300.100.1.3";
    oids.title = "2.5.4.12";
    oids.gn = "2.5.4.42";
    oids.initials = "2.5.4.43";
    oids.pseudonym = "2.5.4.65";
    oids.emailAddress = "1.2.840.113549.1.9.1";
    var unoids = {};
    Object.keys(oids).forEach(function(k) {
      unoids[oids[k]] = k;
    });
    function Identity(opts) {
      var self2 = this;
      assert.object(opts, "options");
      assert.arrayOfObject(opts.components, "options.components");
      this.components = opts.components;
      this.componentLookup = {};
      this.components.forEach(function(c) {
        if (c.name && !c.oid)
          c.oid = oids[c.name];
        if (c.oid && !c.name)
          c.name = unoids[c.oid];
        if (self2.componentLookup[c.name] === void 0)
          self2.componentLookup[c.name] = [];
        self2.componentLookup[c.name].push(c);
      });
      if (this.componentLookup.cn && this.componentLookup.cn.length > 0) {
        this.cn = this.componentLookup.cn[0].value;
      }
      assert.optionalString(opts.type, "options.type");
      if (opts.type === void 0) {
        if (this.components.length === 1 && this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {
          this.type = "host";
          this.hostname = this.componentLookup.cn[0].value;
        } else if (this.componentLookup.dc && this.components.length === this.componentLookup.dc.length) {
          this.type = "host";
          this.hostname = this.componentLookup.dc.map(
            function(c) {
              return c.value;
            }
          ).join(".");
        } else if (this.componentLookup.uid && this.components.length === this.componentLookup.uid.length) {
          this.type = "user";
          this.uid = this.componentLookup.uid[0].value;
        } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {
          this.type = "host";
          this.hostname = this.componentLookup.cn[0].value;
        } else if (this.componentLookup.uid && this.componentLookup.uid.length === 1) {
          this.type = "user";
          this.uid = this.componentLookup.uid[0].value;
        } else if (this.componentLookup.mail && this.componentLookup.mail.length === 1) {
          this.type = "email";
          this.email = this.componentLookup.mail[0].value;
        } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1) {
          this.type = "user";
          this.uid = this.componentLookup.cn[0].value;
        } else {
          this.type = "unknown";
        }
      } else {
        this.type = opts.type;
        if (this.type === "host")
          this.hostname = opts.hostname;
        else if (this.type === "user")
          this.uid = opts.uid;
        else if (this.type === "email")
          this.email = opts.email;
        else
          throw new Error("Unknown type " + this.type);
      }
    }
    Identity.prototype.toString = function() {
      return this.components.map(function(c) {
        var n = c.name.toUpperCase();
        n = n.replace(/=/g, "\\=");
        var v = c.value;
        v = v.replace(/,/g, "\\,");
        return n + "=" + v;
      }).join(", ");
    };
    Identity.prototype.get = function(name, asArray2) {
      assert.string(name, "name");
      var arr = this.componentLookup[name];
      if (arr === void 0 || arr.length === 0)
        return void 0;
      if (!asArray2 && arr.length > 1)
        throw new Error("Multiple values for attribute " + name);
      if (!asArray2)
        return arr[0].value;
      return arr.map(function(c) {
        return c.value;
      });
    };
    Identity.prototype.toArray = function(idx) {
      return this.components.map(function(c) {
        return {
          name: c.name,
          value: c.value
        };
      });
    };
    var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/;
    var NOT_IA5 = /[^\x00-\x7f]/;
    Identity.prototype.toAsn1 = function(der, tag) {
      der.startSequence(tag);
      this.components.forEach(function(c) {
        der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set);
        der.startSequence();
        der.writeOID(c.oid);
        if (c.asn1type === asn1.Ber.Utf8String || c.value.match(NOT_IA5)) {
          var v = Buffer3.from(c.value, "utf8");
          der.writeBuffer(v, asn1.Ber.Utf8String);
        } else if (c.asn1type === asn1.Ber.IA5String || c.value.match(NOT_PRINTABLE)) {
          der.writeString(c.value, asn1.Ber.IA5String);
        } else {
          var type = asn1.Ber.PrintableString;
          if (c.asn1type !== void 0)
            type = c.asn1type;
          der.writeString(c.value, type);
        }
        der.endSequence();
        der.endSequence();
      });
      der.endSequence();
    };
    function globMatch(a, b) {
      if (a === "**" || b === "**")
        return true;
      var aParts = a.split(".");
      var bParts = b.split(".");
      if (aParts.length !== bParts.length)
        return false;
      for (var i = 0; i < aParts.length; ++i) {
        if (aParts[i] === "*" || bParts[i] === "*")
          continue;
        if (aParts[i] !== bParts[i])
          return false;
      }
      return true;
    }
    Identity.prototype.equals = function(other) {
      if (!Identity.isIdentity(other, [1, 0]))
        return false;
      if (other.components.length !== this.components.length)
        return false;
      for (var i = 0; i < this.components.length; ++i) {
        if (this.components[i].oid !== other.components[i].oid)
          return false;
        if (!globMatch(
          this.components[i].value,
          other.components[i].value
        )) {
          return false;
        }
      }
      return true;
    };
    Identity.forHost = function(hostname) {
      assert.string(hostname, "hostname");
      return new Identity({
        type: "host",
        hostname,
        components: [{ name: "cn", value: hostname }]
      });
    };
    Identity.forUser = function(uid) {
      assert.string(uid, "uid");
      return new Identity({
        type: "user",
        uid,
        components: [{ name: "uid", value: uid }]
      });
    };
    Identity.forEmail = function(email) {
      assert.string(email, "email");
      return new Identity({
        type: "email",
        email,
        components: [{ name: "mail", value: email }]
      });
    };
    Identity.parseDN = function(dn) {
      assert.string(dn, "dn");
      var parts = [""];
      var idx = 0;
      var rem = dn;
      while (rem.length > 0) {
        var m;
        if ((m = /^,/.exec(rem)) !== null) {
          parts[++idx] = "";
          rem = rem.slice(m[0].length);
        } else if ((m = /^\\,/.exec(rem)) !== null) {
          parts[idx] += ",";
          rem = rem.slice(m[0].length);
        } else if ((m = /^\\./.exec(rem)) !== null) {
          parts[idx] += m[0];
          rem = rem.slice(m[0].length);
        } else if ((m = /^[^\\,]+/.exec(rem)) !== null) {
          parts[idx] += m[0];
          rem = rem.slice(m[0].length);
        } else {
          throw new Error("Failed to parse DN");
        }
      }
      var cmps = parts.map(function(c) {
        c = c.trim();
        var eqPos = c.indexOf("=");
        while (eqPos > 0 && c.charAt(eqPos - 1) === "\\")
          eqPos = c.indexOf("=", eqPos + 1);
        if (eqPos === -1) {
          throw new Error("Failed to parse DN");
        }
        var name = c.slice(0, eqPos).toLowerCase().replace(/\\=/g, "=");
        var value = c.slice(eqPos + 1);
        return { name, value };
      });
      return new Identity({ components: cmps });
    };
    Identity.fromArray = function(components) {
      assert.arrayOfObject(components, "components");
      components.forEach(function(cmp) {
        assert.object(cmp, "component");
        assert.string(cmp.name, "component.name");
        if (!Buffer3.isBuffer(cmp.value) && !(typeof cmp.value === "string")) {
          throw new Error("Invalid component value");
        }
      });
      return new Identity({ components });
    };
    Identity.parseAsn1 = function(der, top2) {
      var components = [];
      der.readSequence(top2);
      var end2 = der.offset + der.length;
      while (der.offset < end2) {
        der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set);
        var after = der.offset + der.length;
        der.readSequence();
        var oid = der.readOID();
        var type = der.peek();
        var value;
        switch (type) {
          case asn1.Ber.PrintableString:
          case asn1.Ber.IA5String:
          case asn1.Ber.OctetString:
          case asn1.Ber.T61String:
            value = der.readString(type);
            break;
          case asn1.Ber.Utf8String:
            value = der.readString(type, true);
            value = value.toString("utf8");
            break;
          case asn1.Ber.CharacterString:
          case asn1.Ber.BMPString:
            value = der.readString(type, true);
            value = value.toString("utf16le");
            break;
          default:
            throw new Error("Unknown asn1 type " + type);
        }
        components.push({ oid, asn1type: type, value });
        der._offset = after;
      }
      der._offset = end2;
      return new Identity({
        components
      });
    };
    Identity.isIdentity = function(obj2, ver) {
      return utils.isCompatible(obj2, Identity, ver);
    };
    Identity.prototype._sshpkApiVersion = [1, 0];
    Identity._oldVersionDetect = function(obj2) {
      return [1, 0];
    };
  }
});

// node_modules/sshpk/lib/formats/openssh-cert.js
var require_openssh_cert = __commonJS({
  "node_modules/sshpk/lib/formats/openssh-cert.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      verify,
      sign,
      signAsync,
      write: write2,
      /* Internal private API */
      fromBuffer,
      toBuffer
    };
    var assert = require_assert();
    var SSHBuffer = require_ssh_buffer();
    var crypto3 = require("crypto");
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var Identity = require_identity();
    var rfc4253 = require_rfc4253();
    var Signature = require_signature();
    var utils = require_utils6();
    var Certificate = require_certificate();
    function verify(cert, key) {
      return false;
    }
    var TYPES = {
      "user": 1,
      "host": 2
    };
    Object.keys(TYPES).forEach(function(k) {
      TYPES[TYPES[k]] = k;
    });
    var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;
    function read2(buf, options) {
      if (Buffer3.isBuffer(buf))
        buf = buf.toString("ascii");
      var parts = buf.trim().split(/[ \t\n]+/g);
      if (parts.length < 2 || parts.length > 3)
        throw new Error("Not a valid SSH certificate line");
      var algo = parts[0];
      var data = parts[1];
      data = Buffer3.from(data, "base64");
      return fromBuffer(data, algo);
    }
    function fromBuffer(data, algo, partial) {
      var sshbuf = new SSHBuffer({ buffer: data });
      var innerAlgo = sshbuf.readString();
      if (algo !== void 0 && innerAlgo !== algo)
        throw new Error("SSH certificate algorithm mismatch");
      if (algo === void 0)
        algo = innerAlgo;
      var cert = {};
      cert.signatures = {};
      cert.signatures.openssh = {};
      cert.signatures.openssh.nonce = sshbuf.readBuffer();
      var key = {};
      var parts = key.parts = [];
      key.type = getAlg(algo);
      var partCount = algs.info[key.type].parts.length;
      while (parts.length < partCount)
        parts.push(sshbuf.readPart());
      assert.ok(parts.length >= 1, "key must have at least one part");
      var algInfo = algs.info[key.type];
      if (key.type === "ecdsa") {
        var res = ECDSA_ALGO.exec(algo);
        assert.ok(res !== null);
        assert.strictEqual(res[1], parts[0].data.toString());
      }
      for (var i = 0; i < algInfo.parts.length; ++i) {
        parts[i].name = algInfo.parts[i];
        if (parts[i].name !== "curve" && algInfo.normalize !== false) {
          var p = parts[i];
          p.data = utils.mpNormalize(p.data);
        }
      }
      cert.subjectKey = new Key(key);
      cert.serial = sshbuf.readInt64();
      var type = TYPES[sshbuf.readInt()];
      assert.string(type, "valid cert type");
      cert.signatures.openssh.keyId = sshbuf.readString();
      var principals = [];
      var pbuf = sshbuf.readBuffer();
      var psshbuf = new SSHBuffer({ buffer: pbuf });
      while (!psshbuf.atEnd())
        principals.push(psshbuf.readString());
      if (principals.length === 0)
        principals = ["*"];
      cert.subjects = principals.map(function(pr) {
        if (type === "user")
          return Identity.forUser(pr);
        else if (type === "host")
          return Identity.forHost(pr);
        throw new Error("Unknown identity type " + type);
      });
      cert.validFrom = int64ToDate(sshbuf.readInt64());
      cert.validUntil = int64ToDate(sshbuf.readInt64());
      var exts = [];
      var extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });
      var ext;
      while (!extbuf.atEnd()) {
        ext = { critical: true };
        ext.name = extbuf.readString();
        ext.data = extbuf.readBuffer();
        exts.push(ext);
      }
      extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });
      while (!extbuf.atEnd()) {
        ext = { critical: false };
        ext.name = extbuf.readString();
        ext.data = extbuf.readBuffer();
        exts.push(ext);
      }
      cert.signatures.openssh.exts = exts;
      sshbuf.readBuffer();
      var signingKeyBuf = sshbuf.readBuffer();
      cert.issuerKey = rfc4253.read(signingKeyBuf);
      cert.issuer = Identity.forHost("**");
      var sigBuf = sshbuf.readBuffer();
      cert.signatures.openssh.signature = Signature.parse(sigBuf, cert.issuerKey.type, "ssh");
      if (partial !== void 0) {
        partial.remainder = sshbuf.remainder();
        partial.consumed = sshbuf._offset;
      }
      return new Certificate(cert);
    }
    function int64ToDate(buf) {
      var i = buf.readUInt32BE(0) * 4294967296;
      i += buf.readUInt32BE(4);
      var d = new Date();
      d.setTime(i * 1e3);
      d.sourceInt64 = buf;
      return d;
    }
    function dateToInt64(date) {
      if (date.sourceInt64 !== void 0)
        return date.sourceInt64;
      var i = Math.round(date.getTime() / 1e3);
      var upper = Math.floor(i / 4294967296);
      var lower = Math.floor(i % 4294967296);
      var buf = Buffer3.alloc(8);
      buf.writeUInt32BE(upper, 0);
      buf.writeUInt32BE(lower, 4);
      return buf;
    }
    function sign(cert, key) {
      if (cert.signatures.openssh === void 0)
        cert.signatures.openssh = {};
      try {
        var blob = toBuffer(cert, true);
      } catch (e) {
        delete cert.signatures.openssh;
        return false;
      }
      var sig = cert.signatures.openssh;
      var hashAlgo = void 0;
      if (key.type === "rsa" || key.type === "dsa")
        hashAlgo = "sha1";
      var signer = key.createSign(hashAlgo);
      signer.write(blob);
      sig.signature = signer.sign();
      return true;
    }
    function signAsync(cert, signer, done) {
      if (cert.signatures.openssh === void 0)
        cert.signatures.openssh = {};
      try {
        var blob = toBuffer(cert, true);
      } catch (e) {
        delete cert.signatures.openssh;
        done(e);
        return;
      }
      var sig = cert.signatures.openssh;
      signer(blob, function(err, signature) {
        if (err) {
          done(err);
          return;
        }
        try {
          signature.toBuffer("ssh");
        } catch (e) {
          done(e);
          return;
        }
        sig.signature = signature;
        done();
      });
    }
    function write2(cert, options) {
      if (options === void 0)
        options = {};
      var blob = toBuffer(cert);
      var out = getCertType(cert.subjectKey) + " " + blob.toString("base64");
      if (options.comment)
        out = out + " " + options.comment;
      return out;
    }
    function toBuffer(cert, noSig) {
      assert.object(cert.signatures.openssh, "signature for openssh format");
      var sig = cert.signatures.openssh;
      if (sig.nonce === void 0)
        sig.nonce = crypto3.randomBytes(16);
      var buf = new SSHBuffer({});
      buf.writeString(getCertType(cert.subjectKey));
      buf.writeBuffer(sig.nonce);
      var key = cert.subjectKey;
      var algInfo = algs.info[key.type];
      algInfo.parts.forEach(function(part) {
        buf.writePart(key.part[part]);
      });
      buf.writeInt64(cert.serial);
      var type = cert.subjects[0].type;
      assert.notStrictEqual(type, "unknown");
      cert.subjects.forEach(function(id) {
        assert.strictEqual(id.type, type);
      });
      type = TYPES[type];
      buf.writeInt(type);
      if (sig.keyId === void 0) {
        sig.keyId = cert.subjects[0].type + "_" + (cert.subjects[0].uid || cert.subjects[0].hostname);
      }
      buf.writeString(sig.keyId);
      var sub = new SSHBuffer({});
      cert.subjects.forEach(function(id) {
        if (type === TYPES.host)
          sub.writeString(id.hostname);
        else if (type === TYPES.user)
          sub.writeString(id.uid);
      });
      buf.writeBuffer(sub.toBuffer());
      buf.writeInt64(dateToInt64(cert.validFrom));
      buf.writeInt64(dateToInt64(cert.validUntil));
      var exts = sig.exts;
      if (exts === void 0)
        exts = [];
      var extbuf = new SSHBuffer({});
      exts.forEach(function(ext) {
        if (ext.critical !== true)
          return;
        extbuf.writeString(ext.name);
        extbuf.writeBuffer(ext.data);
      });
      buf.writeBuffer(extbuf.toBuffer());
      extbuf = new SSHBuffer({});
      exts.forEach(function(ext) {
        if (ext.critical === true)
          return;
        extbuf.writeString(ext.name);
        extbuf.writeBuffer(ext.data);
      });
      buf.writeBuffer(extbuf.toBuffer());
      buf.writeBuffer(Buffer3.alloc(0));
      sub = rfc4253.write(cert.issuerKey);
      buf.writeBuffer(sub);
      if (!noSig)
        buf.writeBuffer(sig.signature.toBuffer("ssh"));
      return buf.toBuffer();
    }
    function getAlg(certType) {
      if (certType === "ssh-rsa-cert-v01@openssh.com")
        return "rsa";
      if (certType === "ssh-dss-cert-v01@openssh.com")
        return "dsa";
      if (certType.match(ECDSA_ALGO))
        return "ecdsa";
      if (certType === "ssh-ed25519-cert-v01@openssh.com")
        return "ed25519";
      throw new Error("Unsupported cert type " + certType);
    }
    function getCertType(key) {
      if (key.type === "rsa")
        return "ssh-rsa-cert-v01@openssh.com";
      if (key.type === "dsa")
        return "ssh-dss-cert-v01@openssh.com";
      if (key.type === "ecdsa")
        return "ecdsa-sha2-" + key.curve + "-cert-v01@openssh.com";
      if (key.type === "ed25519")
        return "ssh-ed25519-cert-v01@openssh.com";
      throw new Error("Unsupported key type " + key.type);
    }
  }
});

// node_modules/sshpk/lib/formats/x509.js
var require_x509 = __commonJS({
  "node_modules/sshpk/lib/formats/x509.js"(exports2, module2) {
    module2.exports = {
      read: read2,
      verify,
      sign,
      signAsync,
      write: write2
    };
    var assert = require_assert();
    var asn1 = require_lib9();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pem = require_pem();
    var Identity = require_identity();
    var Signature = require_signature();
    var Certificate = require_certificate();
    var pkcs8 = require_pkcs8();
    function readMPInt(der, nm) {
      assert.strictEqual(
        der.peek(),
        asn1.Ber.Integer,
        nm + " is not an Integer"
      );
      return utils.mpNormalize(der.readString(asn1.Ber.Integer, true));
    }
    function verify(cert, key) {
      var sig = cert.signatures.x509;
      assert.object(sig, "x509 signature");
      var algParts = sig.algo.split("-");
      if (algParts[0] !== key.type)
        return false;
      var blob = sig.cache;
      if (blob === void 0) {
        var der = new asn1.BerWriter();
        writeTBSCert(cert, der);
        blob = der.buffer;
      }
      var verifier = key.createVerify(algParts[1]);
      verifier.write(blob);
      return verifier.verify(sig.signature);
    }
    function Local(i) {
      return asn1.Ber.Context | asn1.Ber.Constructor | i;
    }
    function Context(i) {
      return asn1.Ber.Context | i;
    }
    var SIGN_ALGS = {
      "rsa-md5": "1.2.840.113549.1.1.4",
      "rsa-sha1": "1.2.840.113549.1.1.5",
      "rsa-sha256": "1.2.840.113549.1.1.11",
      "rsa-sha384": "1.2.840.113549.1.1.12",
      "rsa-sha512": "1.2.840.113549.1.1.13",
      "dsa-sha1": "1.2.840.10040.4.3",
      "dsa-sha256": "2.16.840.1.101.3.4.3.2",
      "ecdsa-sha1": "1.2.840.10045.4.1",
      "ecdsa-sha256": "1.2.840.10045.4.3.2",
      "ecdsa-sha384": "1.2.840.10045.4.3.3",
      "ecdsa-sha512": "1.2.840.10045.4.3.4",
      "ed25519-sha512": "1.3.101.112"
    };
    Object.keys(SIGN_ALGS).forEach(function(k) {
      SIGN_ALGS[SIGN_ALGS[k]] = k;
    });
    SIGN_ALGS["1.3.14.3.2.3"] = "rsa-md5";
    SIGN_ALGS["1.3.14.3.2.29"] = "rsa-sha1";
    var EXTS = {
      "issuerKeyId": "2.5.29.35",
      "altName": "2.5.29.17",
      "basicConstraints": "2.5.29.19",
      "keyUsage": "2.5.29.15",
      "extKeyUsage": "2.5.29.37"
    };
    function read2(buf, options) {
      if (typeof buf === "string") {
        buf = Buffer3.from(buf, "binary");
      }
      assert.buffer(buf, "buf");
      var der = new asn1.BerReader(buf);
      der.readSequence();
      if (Math.abs(der.length - der.remain) > 1) {
        throw new Error("DER sequence does not contain whole byte stream");
      }
      var tbsStart = der.offset;
      der.readSequence();
      var sigOffset = der.offset + der.length;
      var tbsEnd = sigOffset;
      if (der.peek() === Local(0)) {
        der.readSequence(Local(0));
        var version2 = der.readInt();
        assert.ok(
          version2 <= 3,
          "only x.509 versions up to v3 supported"
        );
      }
      var cert = {};
      cert.signatures = {};
      var sig = cert.signatures.x509 = {};
      sig.extras = {};
      cert.serial = readMPInt(der, "serial");
      der.readSequence();
      var after = der.offset + der.length;
      var certAlgOid = der.readOID();
      var certAlg = SIGN_ALGS[certAlgOid];
      if (certAlg === void 0)
        throw new Error("unknown signature algorithm " + certAlgOid);
      der._offset = after;
      cert.issuer = Identity.parseAsn1(der);
      der.readSequence();
      cert.validFrom = readDate(der);
      cert.validUntil = readDate(der);
      cert.subjects = [Identity.parseAsn1(der)];
      der.readSequence();
      after = der.offset + der.length;
      cert.subjectKey = pkcs8.readPkcs8(void 0, "public", der);
      der._offset = after;
      if (der.peek() === Local(1)) {
        der.readSequence(Local(1));
        sig.extras.issuerUniqueID = buf.slice(der.offset, der.offset + der.length);
        der._offset += der.length;
      }
      if (der.peek() === Local(2)) {
        der.readSequence(Local(2));
        sig.extras.subjectUniqueID = buf.slice(der.offset, der.offset + der.length);
        der._offset += der.length;
      }
      if (der.peek() === Local(3)) {
        der.readSequence(Local(3));
        var extEnd = der.offset + der.length;
        der.readSequence();
        while (der.offset < extEnd)
          readExtension(cert, buf, der);
        assert.strictEqual(der.offset, extEnd);
      }
      assert.strictEqual(der.offset, sigOffset);
      der.readSequence();
      after = der.offset + der.length;
      var sigAlgOid = der.readOID();
      var sigAlg = SIGN_ALGS[sigAlgOid];
      if (sigAlg === void 0)
        throw new Error("unknown signature algorithm " + sigAlgOid);
      der._offset = after;
      var sigData = der.readString(asn1.Ber.BitString, true);
      if (sigData[0] === 0)
        sigData = sigData.slice(1);
      var algParts = sigAlg.split("-");
      sig.signature = Signature.parse(sigData, algParts[0], "asn1");
      sig.signature.hashAlgorithm = algParts[1];
      sig.algo = sigAlg;
      sig.cache = buf.slice(tbsStart, tbsEnd);
      return new Certificate(cert);
    }
    function readDate(der) {
      if (der.peek() === asn1.Ber.UTCTime) {
        return utcTimeToDate(der.readString(asn1.Ber.UTCTime));
      } else if (der.peek() === asn1.Ber.GeneralizedTime) {
        return gTimeToDate(der.readString(asn1.Ber.GeneralizedTime));
      } else {
        throw new Error("Unsupported date format");
      }
    }
    function writeDate(der, date) {
      if (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) {
        der.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime);
      } else {
        der.writeString(dateToUTCTime(date), asn1.Ber.UTCTime);
      }
    }
    var ALTNAME = {
      OtherName: Local(0),
      RFC822Name: Context(1),
      DNSName: Context(2),
      X400Address: Local(3),
      DirectoryName: Local(4),
      EDIPartyName: Local(5),
      URI: Context(6),
      IPAddress: Context(7),
      OID: Context(8)
    };
    var EXTPURPOSE = {
      "serverAuth": "1.3.6.1.5.5.7.3.1",
      "clientAuth": "1.3.6.1.5.5.7.3.2",
      "codeSigning": "1.3.6.1.5.5.7.3.3",
      /* See https://github.com/joyent/oid-docs/blob/master/root.md */
      "joyentDocker": "1.3.6.1.4.1.38678.1.4.1",
      "joyentCmon": "1.3.6.1.4.1.38678.1.4.2"
    };
    var EXTPURPOSE_REV = {};
    Object.keys(EXTPURPOSE).forEach(function(k) {
      EXTPURPOSE_REV[EXTPURPOSE[k]] = k;
    });
    var KEYUSEBITS = [
      "signature",
      "identity",
      "keyEncryption",
      "encryption",
      "keyAgreement",
      "ca",
      "crl"
    ];
    function readExtension(cert, buf, der) {
      der.readSequence();
      var after = der.offset + der.length;
      var extId = der.readOID();
      var id;
      var sig = cert.signatures.x509;
      if (!sig.extras.exts)
        sig.extras.exts = [];
      var critical;
      if (der.peek() === asn1.Ber.Boolean)
        critical = der.readBoolean();
      switch (extId) {
        case EXTS.basicConstraints:
          der.readSequence(asn1.Ber.OctetString);
          der.readSequence();
          var bcEnd = der.offset + der.length;
          var ca = false;
          if (der.peek() === asn1.Ber.Boolean)
            ca = der.readBoolean();
          if (cert.purposes === void 0)
            cert.purposes = [];
          if (ca === true)
            cert.purposes.push("ca");
          var bc = { oid: extId, critical };
          if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer)
            bc.pathLen = der.readInt();
          sig.extras.exts.push(bc);
          break;
        case EXTS.extKeyUsage:
          der.readSequence(asn1.Ber.OctetString);
          der.readSequence();
          if (cert.purposes === void 0)
            cert.purposes = [];
          var ekEnd = der.offset + der.length;
          while (der.offset < ekEnd) {
            var oid = der.readOID();
            cert.purposes.push(EXTPURPOSE_REV[oid] || oid);
          }
          if (cert.purposes.indexOf("serverAuth") !== -1 && cert.purposes.indexOf("clientAuth") === -1) {
            cert.subjects.forEach(function(ide) {
              if (ide.type !== "host") {
                ide.type = "host";
                ide.hostname = ide.uid || ide.email || ide.components[0].value;
              }
            });
          } else if (cert.purposes.indexOf("clientAuth") !== -1 && cert.purposes.indexOf("serverAuth") === -1) {
            cert.subjects.forEach(function(ide) {
              if (ide.type !== "user") {
                ide.type = "user";
                ide.uid = ide.hostname || ide.email || ide.components[0].value;
              }
            });
          }
          sig.extras.exts.push({ oid: extId, critical });
          break;
        case EXTS.keyUsage:
          der.readSequence(asn1.Ber.OctetString);
          var bits = der.readString(asn1.Ber.BitString, true);
          var setBits = readBitField(bits, KEYUSEBITS);
          setBits.forEach(function(bit) {
            if (cert.purposes === void 0)
              cert.purposes = [];
            if (cert.purposes.indexOf(bit) === -1)
              cert.purposes.push(bit);
          });
          sig.extras.exts.push({
            oid: extId,
            critical,
            bits
          });
          break;
        case EXTS.altName:
          der.readSequence(asn1.Ber.OctetString);
          der.readSequence();
          var aeEnd = der.offset + der.length;
          while (der.offset < aeEnd) {
            switch (der.peek()) {
              case ALTNAME.OtherName:
              case ALTNAME.EDIPartyName:
                der.readSequence();
                der._offset += der.length;
                break;
              case ALTNAME.OID:
                der.readOID(ALTNAME.OID);
                break;
              case ALTNAME.RFC822Name:
                var email = der.readString(ALTNAME.RFC822Name);
                id = Identity.forEmail(email);
                if (!cert.subjects[0].equals(id))
                  cert.subjects.push(id);
                break;
              case ALTNAME.DirectoryName:
                der.readSequence(ALTNAME.DirectoryName);
                id = Identity.parseAsn1(der);
                if (!cert.subjects[0].equals(id))
                  cert.subjects.push(id);
                break;
              case ALTNAME.DNSName:
                var host = der.readString(
                  ALTNAME.DNSName
                );
                id = Identity.forHost(host);
                if (!cert.subjects[0].equals(id))
                  cert.subjects.push(id);
                break;
              default:
                der.readString(der.peek());
                break;
            }
          }
          sig.extras.exts.push({ oid: extId, critical });
          break;
        default:
          sig.extras.exts.push({
            oid: extId,
            critical,
            data: der.readString(asn1.Ber.OctetString, true)
          });
          break;
      }
      der._offset = after;
    }
    var UTCTIME_RE = /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;
    function utcTimeToDate(t) {
      var m = t.match(UTCTIME_RE);
      assert.ok(m, "timestamps must be in UTC");
      var d = new Date();
      var thisYear = d.getUTCFullYear();
      var century = Math.floor(thisYear / 100) * 100;
      var year = parseInt(m[1], 10);
      if (thisYear % 100 < 50 && year >= 60)
        year += century - 1;
      else
        year += century;
      d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10));
      d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));
      if (m[6] && m[6].length > 0)
        d.setUTCSeconds(parseInt(m[6], 10));
      return d;
    }
    var GTIME_RE = /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;
    function gTimeToDate(t) {
      var m = t.match(GTIME_RE);
      assert.ok(m);
      var d = new Date();
      d.setUTCFullYear(
        parseInt(m[1], 10),
        parseInt(m[2], 10) - 1,
        parseInt(m[3], 10)
      );
      d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));
      if (m[6] && m[6].length > 0)
        d.setUTCSeconds(parseInt(m[6], 10));
      return d;
    }
    function zeroPad(n, m) {
      if (m === void 0)
        m = 2;
      var s = "" + n;
      while (s.length < m)
        s = "0" + s;
      return s;
    }
    function dateToUTCTime(d) {
      var s = "";
      s += zeroPad(d.getUTCFullYear() % 100);
      s += zeroPad(d.getUTCMonth() + 1);
      s += zeroPad(d.getUTCDate());
      s += zeroPad(d.getUTCHours());
      s += zeroPad(d.getUTCMinutes());
      s += zeroPad(d.getUTCSeconds());
      s += "Z";
      return s;
    }
    function dateToGTime(d) {
      var s = "";
      s += zeroPad(d.getUTCFullYear(), 4);
      s += zeroPad(d.getUTCMonth() + 1);
      s += zeroPad(d.getUTCDate());
      s += zeroPad(d.getUTCHours());
      s += zeroPad(d.getUTCMinutes());
      s += zeroPad(d.getUTCSeconds());
      s += "Z";
      return s;
    }
    function sign(cert, key) {
      if (cert.signatures.x509 === void 0)
        cert.signatures.x509 = {};
      var sig = cert.signatures.x509;
      sig.algo = key.type + "-" + key.defaultHashAlgorithm();
      if (SIGN_ALGS[sig.algo] === void 0)
        return false;
      var der = new asn1.BerWriter();
      writeTBSCert(cert, der);
      var blob = der.buffer;
      sig.cache = blob;
      var signer = key.createSign();
      signer.write(blob);
      cert.signatures.x509.signature = signer.sign();
      return true;
    }
    function signAsync(cert, signer, done) {
      if (cert.signatures.x509 === void 0)
        cert.signatures.x509 = {};
      var sig = cert.signatures.x509;
      var der = new asn1.BerWriter();
      writeTBSCert(cert, der);
      var blob = der.buffer;
      sig.cache = blob;
      signer(blob, function(err, signature) {
        if (err) {
          done(err);
          return;
        }
        sig.algo = signature.type + "-" + signature.hashAlgorithm;
        if (SIGN_ALGS[sig.algo] === void 0) {
          done(new Error('Invalid signing algorithm "' + sig.algo + '"'));
          return;
        }
        sig.signature = signature;
        done();
      });
    }
    function write2(cert, options) {
      var sig = cert.signatures.x509;
      assert.object(sig, "x509 signature");
      var der = new asn1.BerWriter();
      der.startSequence();
      if (sig.cache) {
        der._ensure(sig.cache.length);
        sig.cache.copy(der._buf, der._offset);
        der._offset += sig.cache.length;
      } else {
        writeTBSCert(cert, der);
      }
      der.startSequence();
      der.writeOID(SIGN_ALGS[sig.algo]);
      if (sig.algo.match(/^rsa-/))
        der.writeNull();
      der.endSequence();
      var sigData = sig.signature.toBuffer("asn1");
      var data = Buffer3.alloc(sigData.length + 1);
      data[0] = 0;
      sigData.copy(data, 1);
      der.writeBuffer(data, asn1.Ber.BitString);
      der.endSequence();
      return der.buffer;
    }
    function writeTBSCert(cert, der) {
      var sig = cert.signatures.x509;
      assert.object(sig, "x509 signature");
      der.startSequence();
      der.startSequence(Local(0));
      der.writeInt(2);
      der.endSequence();
      der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer);
      der.startSequence();
      der.writeOID(SIGN_ALGS[sig.algo]);
      if (sig.algo.match(/^rsa-/))
        der.writeNull();
      der.endSequence();
      cert.issuer.toAsn1(der);
      der.startSequence();
      writeDate(der, cert.validFrom);
      writeDate(der, cert.validUntil);
      der.endSequence();
      var subject = cert.subjects[0];
      var altNames = cert.subjects.slice(1);
      subject.toAsn1(der);
      pkcs8.writePkcs8(der, cert.subjectKey);
      if (sig.extras && sig.extras.issuerUniqueID) {
        der.writeBuffer(sig.extras.issuerUniqueID, Local(1));
      }
      if (sig.extras && sig.extras.subjectUniqueID) {
        der.writeBuffer(sig.extras.subjectUniqueID, Local(2));
      }
      if (altNames.length > 0 || subject.type === "host" || cert.purposes !== void 0 && cert.purposes.length > 0 || sig.extras && sig.extras.exts) {
        der.startSequence(Local(3));
        der.startSequence();
        var exts = [];
        if (cert.purposes !== void 0 && cert.purposes.length > 0) {
          exts.push({
            oid: EXTS.basicConstraints,
            critical: true
          });
          exts.push({
            oid: EXTS.keyUsage,
            critical: true
          });
          exts.push({
            oid: EXTS.extKeyUsage,
            critical: true
          });
        }
        exts.push({ oid: EXTS.altName });
        if (sig.extras && sig.extras.exts)
          exts = sig.extras.exts;
        for (var i = 0; i < exts.length; ++i) {
          der.startSequence();
          der.writeOID(exts[i].oid);
          if (exts[i].critical !== void 0)
            der.writeBoolean(exts[i].critical);
          if (exts[i].oid === EXTS.altName) {
            der.startSequence(asn1.Ber.OctetString);
            der.startSequence();
            if (subject.type === "host") {
              der.writeString(
                subject.hostname,
                Context(2)
              );
            }
            for (var j = 0; j < altNames.length; ++j) {
              if (altNames[j].type === "host") {
                der.writeString(
                  altNames[j].hostname,
                  ALTNAME.DNSName
                );
              } else if (altNames[j].type === "email") {
                der.writeString(
                  altNames[j].email,
                  ALTNAME.RFC822Name
                );
              } else {
                der.startSequence(
                  ALTNAME.DirectoryName
                );
                altNames[j].toAsn1(der);
                der.endSequence();
              }
            }
            der.endSequence();
            der.endSequence();
          } else if (exts[i].oid === EXTS.basicConstraints) {
            der.startSequence(asn1.Ber.OctetString);
            der.startSequence();
            var ca = cert.purposes.indexOf("ca") !== -1;
            var pathLen = exts[i].pathLen;
            der.writeBoolean(ca);
            if (pathLen !== void 0)
              der.writeInt(pathLen);
            der.endSequence();
            der.endSequence();
          } else if (exts[i].oid === EXTS.extKeyUsage) {
            der.startSequence(asn1.Ber.OctetString);
            der.startSequence();
            cert.purposes.forEach(function(purpose) {
              if (purpose === "ca")
                return;
              if (KEYUSEBITS.indexOf(purpose) !== -1)
                return;
              var oid = purpose;
              if (EXTPURPOSE[purpose] !== void 0)
                oid = EXTPURPOSE[purpose];
              der.writeOID(oid);
            });
            der.endSequence();
            der.endSequence();
          } else if (exts[i].oid === EXTS.keyUsage) {
            der.startSequence(asn1.Ber.OctetString);
            if (exts[i].bits !== void 0) {
              der.writeBuffer(
                exts[i].bits,
                asn1.Ber.BitString
              );
            } else {
              var bits = writeBitField(
                cert.purposes,
                KEYUSEBITS
              );
              der.writeBuffer(
                bits,
                asn1.Ber.BitString
              );
            }
            der.endSequence();
          } else {
            der.writeBuffer(
              exts[i].data,
              asn1.Ber.OctetString
            );
          }
          der.endSequence();
        }
        der.endSequence();
        der.endSequence();
      }
      der.endSequence();
    }
    function readBitField(bits, bitIndex) {
      var bitLen = 8 * (bits.length - 1) - bits[0];
      var setBits = {};
      for (var i = 0; i < bitLen; ++i) {
        var byteN = 1 + Math.floor(i / 8);
        var bit = 7 - i % 8;
        var mask = 1 << bit;
        var bitVal = (bits[byteN] & mask) !== 0;
        var name = bitIndex[i];
        if (bitVal && typeof name === "string") {
          setBits[name] = true;
        }
      }
      return Object.keys(setBits);
    }
    function writeBitField(setBits, bitIndex) {
      var bitLen = bitIndex.length;
      var blen = Math.ceil(bitLen / 8);
      var unused = blen * 8 - bitLen;
      var bits = Buffer3.alloc(1 + blen);
      bits[0] = unused;
      for (var i = 0; i < bitLen; ++i) {
        var byteN = 1 + Math.floor(i / 8);
        var bit = 7 - i % 8;
        var mask = 1 << bit;
        var name = bitIndex[i];
        if (name === void 0)
          continue;
        var bitVal = setBits.indexOf(name) !== -1;
        if (bitVal) {
          bits[byteN] |= mask;
        }
      }
      return bits;
    }
  }
});

// node_modules/sshpk/lib/formats/x509-pem.js
var require_x509_pem = __commonJS({
  "node_modules/sshpk/lib/formats/x509-pem.js"(exports2, module2) {
    var x509 = require_x509();
    module2.exports = {
      read: read2,
      verify: x509.verify,
      sign: x509.sign,
      write: write2
    };
    var assert = require_assert();
    var asn1 = require_lib9();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var pem = require_pem();
    var Identity = require_identity();
    var Signature = require_signature();
    var Certificate = require_certificate();
    function read2(buf, options) {
      if (typeof buf !== "string") {
        assert.buffer(buf, "buf");
        buf = buf.toString("ascii");
      }
      var lines = buf.trim().split(/[\r\n]+/g);
      var m;
      var si = -1;
      while (!m && si < lines.length) {
        m = lines[++si].match(
          /*JSSTYLED*/
          /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/
        );
      }
      assert.ok(m, "invalid PEM header");
      var m2;
      var ei = lines.length;
      while (!m2 && ei > 0) {
        m2 = lines[--ei].match(
          /*JSSTYLED*/
          /[-]+[ ]*END CERTIFICATE[ ]*[-]+/
        );
      }
      assert.ok(m2, "invalid PEM footer");
      lines = lines.slice(si, ei + 1);
      var headers = {};
      while (true) {
        lines = lines.slice(1);
        m = lines[0].match(
          /*JSSTYLED*/
          /^([A-Za-z0-9-]+): (.+)$/
        );
        if (!m)
          break;
        headers[m[1].toLowerCase()] = m[2];
      }
      lines = lines.slice(0, -1).join("");
      buf = Buffer3.from(lines, "base64");
      return x509.read(buf, options);
    }
    function write2(cert, options) {
      var dbuf = x509.write(cert, options);
      var header = "CERTIFICATE";
      var tmp = dbuf.toString("base64");
      var len = tmp.length + tmp.length / 64 + 18 + 16 + header.length * 2 + 10;
      var buf = Buffer3.alloc(len);
      var o = 0;
      o += buf.write("-----BEGIN " + header + "-----\n", o);
      for (var i = 0; i < tmp.length; ) {
        var limit = i + 64;
        if (limit > tmp.length)
          limit = tmp.length;
        o += buf.write(tmp.slice(i, limit), o);
        buf[o++] = 10;
        i = limit;
      }
      o += buf.write("-----END " + header + "-----\n", o);
      return buf.slice(0, o);
    }
  }
});

// node_modules/sshpk/lib/certificate.js
var require_certificate = __commonJS({
  "node_modules/sshpk/lib/certificate.js"(exports2, module2) {
    module2.exports = Certificate;
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var crypto3 = require("crypto");
    var Fingerprint = require_fingerprint();
    var Signature = require_signature();
    var errs = require_errors5();
    var util = require("util");
    var utils = require_utils6();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var Identity = require_identity();
    var formats = {};
    formats["openssh"] = require_openssh_cert();
    formats["x509"] = require_x509();
    formats["pem"] = require_x509_pem();
    var CertificateParseError = errs.CertificateParseError;
    var InvalidAlgorithmError = errs.InvalidAlgorithmError;
    function Certificate(opts) {
      assert.object(opts, "options");
      assert.arrayOfObject(opts.subjects, "options.subjects");
      utils.assertCompatible(
        opts.subjects[0],
        Identity,
        [1, 0],
        "options.subjects"
      );
      utils.assertCompatible(
        opts.subjectKey,
        Key,
        [1, 0],
        "options.subjectKey"
      );
      utils.assertCompatible(opts.issuer, Identity, [1, 0], "options.issuer");
      if (opts.issuerKey !== void 0) {
        utils.assertCompatible(
          opts.issuerKey,
          Key,
          [1, 0],
          "options.issuerKey"
        );
      }
      assert.object(opts.signatures, "options.signatures");
      assert.buffer(opts.serial, "options.serial");
      assert.date(opts.validFrom, "options.validFrom");
      assert.date(opts.validUntil, "optons.validUntil");
      assert.optionalArrayOfString(opts.purposes, "options.purposes");
      this._hashCache = {};
      this.subjects = opts.subjects;
      this.issuer = opts.issuer;
      this.subjectKey = opts.subjectKey;
      this.issuerKey = opts.issuerKey;
      this.signatures = opts.signatures;
      this.serial = opts.serial;
      this.validFrom = opts.validFrom;
      this.validUntil = opts.validUntil;
      this.purposes = opts.purposes;
    }
    Certificate.formats = formats;
    Certificate.prototype.toBuffer = function(format, options) {
      if (format === void 0)
        format = "x509";
      assert.string(format, "format");
      assert.object(formats[format], "formats[format]");
      assert.optionalObject(options, "options");
      return formats[format].write(this, options);
    };
    Certificate.prototype.toString = function(format, options) {
      if (format === void 0)
        format = "pem";
      return this.toBuffer(format, options).toString();
    };
    Certificate.prototype.fingerprint = function(algo) {
      if (algo === void 0)
        algo = "sha256";
      assert.string(algo, "algorithm");
      var opts = {
        type: "certificate",
        hash: this.hash(algo),
        algorithm: algo
      };
      return new Fingerprint(opts);
    };
    Certificate.prototype.hash = function(algo) {
      assert.string(algo, "algorithm");
      algo = algo.toLowerCase();
      if (algs.hashAlgs[algo] === void 0)
        throw new InvalidAlgorithmError(algo);
      if (this._hashCache[algo])
        return this._hashCache[algo];
      var hash3 = crypto3.createHash(algo).update(this.toBuffer("x509")).digest();
      this._hashCache[algo] = hash3;
      return hash3;
    };
    Certificate.prototype.isExpired = function(when) {
      if (when === void 0)
        when = new Date();
      return !(when.getTime() >= this.validFrom.getTime() && when.getTime() < this.validUntil.getTime());
    };
    Certificate.prototype.isSignedBy = function(issuerCert) {
      utils.assertCompatible(issuerCert, Certificate, [1, 0], "issuer");
      if (!this.issuer.equals(issuerCert.subjects[0]))
        return false;
      if (this.issuer.purposes && this.issuer.purposes.length > 0 && this.issuer.purposes.indexOf("ca") === -1) {
        return false;
      }
      return this.isSignedByKey(issuerCert.subjectKey);
    };
    Certificate.prototype.getExtension = function(keyOrOid) {
      assert.string(keyOrOid, "keyOrOid");
      var ext = this.getExtensions().filter(function(maybeExt) {
        if (maybeExt.format === "x509")
          return maybeExt.oid === keyOrOid;
        if (maybeExt.format === "openssh")
          return maybeExt.name === keyOrOid;
        return false;
      })[0];
      return ext;
    };
    Certificate.prototype.getExtensions = function() {
      var exts = [];
      var x509 = this.signatures.x509;
      if (x509 && x509.extras && x509.extras.exts) {
        x509.extras.exts.forEach(function(ext) {
          ext.format = "x509";
          exts.push(ext);
        });
      }
      var openssh = this.signatures.openssh;
      if (openssh && openssh.exts) {
        openssh.exts.forEach(function(ext) {
          ext.format = "openssh";
          exts.push(ext);
        });
      }
      return exts;
    };
    Certificate.prototype.isSignedByKey = function(issuerKey) {
      utils.assertCompatible(issuerKey, Key, [1, 2], "issuerKey");
      if (this.issuerKey !== void 0) {
        return this.issuerKey.fingerprint("sha512").matches(issuerKey);
      }
      var fmt = Object.keys(this.signatures)[0];
      var valid = formats[fmt].verify(this, issuerKey);
      if (valid)
        this.issuerKey = issuerKey;
      return valid;
    };
    Certificate.prototype.signWith = function(key) {
      utils.assertCompatible(key, PrivateKey, [1, 2], "key");
      var fmts = Object.keys(formats);
      var didOne = false;
      for (var i = 0; i < fmts.length; ++i) {
        if (fmts[i] !== "pem") {
          var ret2 = formats[fmts[i]].sign(this, key);
          if (ret2 === true)
            didOne = true;
        }
      }
      if (!didOne) {
        throw new Error("Failed to sign the certificate for any available certificate formats");
      }
    };
    Certificate.createSelfSigned = function(subjectOrSubjects, key, options) {
      var subjects;
      if (Array.isArray(subjectOrSubjects))
        subjects = subjectOrSubjects;
      else
        subjects = [subjectOrSubjects];
      assert.arrayOfObject(subjects);
      subjects.forEach(function(subject) {
        utils.assertCompatible(subject, Identity, [1, 0], "subject");
      });
      utils.assertCompatible(key, PrivateKey, [1, 2], "private key");
      assert.optionalObject(options, "options");
      if (options === void 0)
        options = {};
      assert.optionalObject(options.validFrom, "options.validFrom");
      assert.optionalObject(options.validUntil, "options.validUntil");
      var validFrom = options.validFrom;
      var validUntil = options.validUntil;
      if (validFrom === void 0)
        validFrom = new Date();
      if (validUntil === void 0) {
        assert.optionalNumber(options.lifetime, "options.lifetime");
        var lifetime = options.lifetime;
        if (lifetime === void 0)
          lifetime = 10 * 365 * 24 * 3600;
        validUntil = new Date();
        validUntil.setTime(validUntil.getTime() + lifetime * 1e3);
      }
      assert.optionalBuffer(options.serial, "options.serial");
      var serial = options.serial;
      if (serial === void 0)
        serial = Buffer3.from("0000000000000001", "hex");
      var purposes = options.purposes;
      if (purposes === void 0)
        purposes = [];
      if (purposes.indexOf("signature") === -1)
        purposes.push("signature");
      if (purposes.indexOf("ca") === -1)
        purposes.push("ca");
      if (purposes.indexOf("crl") === -1)
        purposes.push("crl");
      if (purposes.length <= 3) {
        var hostSubjects = subjects.filter(function(subject) {
          return subject.type === "host";
        });
        var userSubjects = subjects.filter(function(subject) {
          return subject.type === "user";
        });
        if (hostSubjects.length > 0) {
          if (purposes.indexOf("serverAuth") === -1)
            purposes.push("serverAuth");
        }
        if (userSubjects.length > 0) {
          if (purposes.indexOf("clientAuth") === -1)
            purposes.push("clientAuth");
        }
        if (userSubjects.length > 0 || hostSubjects.length > 0) {
          if (purposes.indexOf("keyAgreement") === -1)
            purposes.push("keyAgreement");
          if (key.type === "rsa" && purposes.indexOf("encryption") === -1)
            purposes.push("encryption");
        }
      }
      var cert = new Certificate({
        subjects,
        issuer: subjects[0],
        subjectKey: key.toPublic(),
        issuerKey: key.toPublic(),
        signatures: {},
        serial,
        validFrom,
        validUntil,
        purposes
      });
      cert.signWith(key);
      return cert;
    };
    Certificate.create = function(subjectOrSubjects, key, issuer, issuerKey, options) {
      var subjects;
      if (Array.isArray(subjectOrSubjects))
        subjects = subjectOrSubjects;
      else
        subjects = [subjectOrSubjects];
      assert.arrayOfObject(subjects);
      subjects.forEach(function(subject) {
        utils.assertCompatible(subject, Identity, [1, 0], "subject");
      });
      utils.assertCompatible(key, Key, [1, 0], "key");
      if (PrivateKey.isPrivateKey(key))
        key = key.toPublic();
      utils.assertCompatible(issuer, Identity, [1, 0], "issuer");
      utils.assertCompatible(issuerKey, PrivateKey, [1, 2], "issuer key");
      assert.optionalObject(options, "options");
      if (options === void 0)
        options = {};
      assert.optionalObject(options.validFrom, "options.validFrom");
      assert.optionalObject(options.validUntil, "options.validUntil");
      var validFrom = options.validFrom;
      var validUntil = options.validUntil;
      if (validFrom === void 0)
        validFrom = new Date();
      if (validUntil === void 0) {
        assert.optionalNumber(options.lifetime, "options.lifetime");
        var lifetime = options.lifetime;
        if (lifetime === void 0)
          lifetime = 10 * 365 * 24 * 3600;
        validUntil = new Date();
        validUntil.setTime(validUntil.getTime() + lifetime * 1e3);
      }
      assert.optionalBuffer(options.serial, "options.serial");
      var serial = options.serial;
      if (serial === void 0)
        serial = Buffer3.from("0000000000000001", "hex");
      var purposes = options.purposes;
      if (purposes === void 0)
        purposes = [];
      if (purposes.indexOf("signature") === -1)
        purposes.push("signature");
      if (options.ca === true) {
        if (purposes.indexOf("ca") === -1)
          purposes.push("ca");
        if (purposes.indexOf("crl") === -1)
          purposes.push("crl");
      }
      var hostSubjects = subjects.filter(function(subject) {
        return subject.type === "host";
      });
      var userSubjects = subjects.filter(function(subject) {
        return subject.type === "user";
      });
      if (hostSubjects.length > 0) {
        if (purposes.indexOf("serverAuth") === -1)
          purposes.push("serverAuth");
      }
      if (userSubjects.length > 0) {
        if (purposes.indexOf("clientAuth") === -1)
          purposes.push("clientAuth");
      }
      if (userSubjects.length > 0 || hostSubjects.length > 0) {
        if (purposes.indexOf("keyAgreement") === -1)
          purposes.push("keyAgreement");
        if (key.type === "rsa" && purposes.indexOf("encryption") === -1)
          purposes.push("encryption");
      }
      var cert = new Certificate({
        subjects,
        issuer,
        subjectKey: key,
        issuerKey: issuerKey.toPublic(),
        signatures: {},
        serial,
        validFrom,
        validUntil,
        purposes
      });
      cert.signWith(issuerKey);
      return cert;
    };
    Certificate.parse = function(data, format, options) {
      if (typeof data !== "string")
        assert.buffer(data, "data");
      if (format === void 0)
        format = "auto";
      assert.string(format, "format");
      if (typeof options === "string")
        options = { filename: options };
      assert.optionalObject(options, "options");
      if (options === void 0)
        options = {};
      assert.optionalString(options.filename, "options.filename");
      if (options.filename === void 0)
        options.filename = "(unnamed)";
      assert.object(formats[format], "formats[format]");
      try {
        var k = formats[format].read(data, options);
        return k;
      } catch (e) {
        throw new CertificateParseError(options.filename, format, e);
      }
    };
    Certificate.isCertificate = function(obj2, ver) {
      return utils.isCompatible(obj2, Certificate, ver);
    };
    Certificate.prototype._sshpkApiVersion = [1, 1];
    Certificate._oldVersionDetect = function(obj2) {
      return [1, 0];
    };
  }
});

// node_modules/sshpk/lib/fingerprint.js
var require_fingerprint = __commonJS({
  "node_modules/sshpk/lib/fingerprint.js"(exports2, module2) {
    module2.exports = Fingerprint;
    var assert = require_assert();
    var Buffer3 = require_safer().Buffer;
    var algs = require_algs();
    var crypto3 = require("crypto");
    var errs = require_errors5();
    var Key = require_key();
    var PrivateKey = require_private_key();
    var Certificate = require_certificate();
    var utils = require_utils6();
    var FingerprintFormatError = errs.FingerprintFormatError;
    var InvalidAlgorithmError = errs.InvalidAlgorithmError;
    function Fingerprint(opts) {
      assert.object(opts, "options");
      assert.string(opts.type, "options.type");
      assert.buffer(opts.hash, "options.hash");
      assert.string(opts.algorithm, "options.algorithm");
      this.algorithm = opts.algorithm.toLowerCase();
      if (algs.hashAlgs[this.algorithm] !== true)
        throw new InvalidAlgorithmError(this.algorithm);
      this.hash = opts.hash;
      this.type = opts.type;
      this.hashType = opts.hashType;
    }
    Fingerprint.prototype.toString = function(format) {
      if (format === void 0) {
        if (this.algorithm === "md5" || this.hashType === "spki")
          format = "hex";
        else
          format = "base64";
      }
      assert.string(format);
      switch (format) {
        case "hex":
          if (this.hashType === "spki")
            return this.hash.toString("hex");
          return addColons(this.hash.toString("hex"));
        case "base64":
          if (this.hashType === "spki")
            return this.hash.toString("base64");
          return sshBase64Format(
            this.algorithm,
            this.hash.toString("base64")
          );
        default:
          throw new FingerprintFormatError(void 0, format);
      }
    };
    Fingerprint.prototype.matches = function(other) {
      assert.object(other, "key or certificate");
      if (this.type === "key" && this.hashType !== "ssh") {
        utils.assertCompatible(other, Key, [1, 7], "key with spki");
        if (PrivateKey.isPrivateKey(other)) {
          utils.assertCompatible(
            other,
            PrivateKey,
            [1, 6],
            "privatekey with spki support"
          );
        }
      } else if (this.type === "key") {
        utils.assertCompatible(other, Key, [1, 0], "key");
      } else {
        utils.assertCompatible(
          other,
          Certificate,
          [1, 0],
          "certificate"
        );
      }
      var theirHash = other.hash(this.algorithm, this.hashType);
      var theirHash2 = crypto3.createHash(this.algorithm).update(theirHash).digest("base64");
      if (this.hash2 === void 0)
        this.hash2 = crypto3.createHash(this.algorithm).update(this.hash).digest("base64");
      return this.hash2 === theirHash2;
    };
    var base64RE = /^[A-Za-z0-9+\/=]+$/;
    var hexRE = /^[a-fA-F0-9]+$/;
    Fingerprint.parse = function(fp, options) {
      assert.string(fp, "fingerprint");
      var alg, hash3, enAlgs;
      if (Array.isArray(options)) {
        enAlgs = options;
        options = {};
      }
      assert.optionalObject(options, "options");
      if (options === void 0)
        options = {};
      if (options.enAlgs !== void 0)
        enAlgs = options.enAlgs;
      if (options.algorithms !== void 0)
        enAlgs = options.algorithms;
      assert.optionalArrayOfString(enAlgs, "algorithms");
      var hashType = "ssh";
      if (options.hashType !== void 0)
        hashType = options.hashType;
      assert.string(hashType, "options.hashType");
      var parts = fp.split(":");
      if (parts.length == 2) {
        alg = parts[0].toLowerCase();
        if (!base64RE.test(parts[1]))
          throw new FingerprintFormatError(fp);
        try {
          hash3 = Buffer3.from(parts[1], "base64");
        } catch (e) {
          throw new FingerprintFormatError(fp);
        }
      } else if (parts.length > 2) {
        alg = "md5";
        if (parts[0].toLowerCase() === "md5")
          parts = parts.slice(1);
        parts = parts.map(function(p) {
          while (p.length < 2)
            p = "0" + p;
          if (p.length > 2)
            throw new FingerprintFormatError(fp);
          return p;
        });
        parts = parts.join("");
        if (!hexRE.test(parts) || parts.length % 2 !== 0)
          throw new FingerprintFormatError(fp);
        try {
          hash3 = Buffer3.from(parts, "hex");
        } catch (e) {
          throw new FingerprintFormatError(fp);
        }
      } else {
        if (hexRE.test(fp)) {
          hash3 = Buffer3.from(fp, "hex");
        } else if (base64RE.test(fp)) {
          hash3 = Buffer3.from(fp, "base64");
        } else {
          throw new FingerprintFormatError(fp);
        }
        switch (hash3.length) {
          case 32:
            alg = "sha256";
            break;
          case 16:
            alg = "md5";
            break;
          case 20:
            alg = "sha1";
            break;
          case 64:
            alg = "sha512";
            break;
          default:
            throw new FingerprintFormatError(fp);
        }
        if (options.hashType === void 0)
          hashType = "spki";
      }
      if (alg === void 0)
        throw new FingerprintFormatError(fp);
      if (algs.hashAlgs[alg] === void 0)
        throw new InvalidAlgorithmError(alg);
      if (enAlgs !== void 0) {
        enAlgs = enAlgs.map(function(a) {
          return a.toLowerCase();
        });
        if (enAlgs.indexOf(alg) === -1)
          throw new InvalidAlgorithmError(alg);
      }
      return new Fingerprint({
        algorithm: alg,
        hash: hash3,
        type: options.type || "key",
        hashType
      });
    };
    function addColons(s) {
      return s.replace(/(.{2})(?=.)/g, "$1:");
    }
    function base64Strip(s) {
      return s.replace(/=*$/, "");
    }
    function sshBase64Format(alg, h) {
      return alg.toUpperCase() + ":" + base64Strip(h);
    }
    Fingerprint.isFingerprint = function(obj2, ver) {
      return utils.isCompatible(obj2, Fingerprint, ver);
    };
    Fingerprint.prototype._sshpkApiVersion = [1, 2];
    Fingerprint._oldVersionDetect = function(obj2) {
      assert.func(obj2.toString);
      assert.func(obj2.matches);
      return [1, 0];
    };
  }
});

// node_modules/sshpk/lib/key.js
var require_key = __commonJS({
  "node_modules/sshpk/lib/key.js"(exports2, module2) {
    module2.exports = Key;
    var assert = require_assert();
    var algs = require_algs();
    var crypto3 = require("crypto");
    var Fingerprint = require_fingerprint();
    var Signature = require_signature();
    var DiffieHellman = require_dhe().DiffieHellman;
    var errs = require_errors5();
    var utils = require_utils6();
    var PrivateKey = require_private_key();
    var edCompat;
    try {
      edCompat = require_ed_compat();
    } catch (e) {
    }
    var InvalidAlgorithmError = errs.InvalidAlgorithmError;
    var KeyParseError = errs.KeyParseError;
    var formats = {};
    formats["auto"] = require_auto();
    formats["pem"] = require_pem();
    formats["pkcs1"] = require_pkcs1();
    formats["pkcs8"] = require_pkcs8();
    formats["rfc4253"] = require_rfc4253();
    formats["ssh"] = require_ssh();
    formats["ssh-private"] = require_ssh_private();
    formats["openssh"] = formats["ssh-private"];
    formats["dnssec"] = require_dnssec();
    formats["putty"] = require_putty();
    formats["ppk"] = formats["putty"];
    function Key(opts) {
      assert.object(opts, "options");
      assert.arrayOfObject(opts.parts, "options.parts");
      assert.string(opts.type, "options.type");
      assert.optionalString(opts.comment, "options.comment");
      var algInfo = algs.info[opts.type];
      if (typeof algInfo !== "object")
        throw new InvalidAlgorithmError(opts.type);
      var partLookup = {};
      for (var i = 0; i < opts.parts.length; ++i) {
        var part = opts.parts[i];
        partLookup[part.name] = part;
      }
      this.type = opts.type;
      this.parts = opts.parts;
      this.part = partLookup;
      this.comment = void 0;
      this.source = opts.source;
      this._rfc4253Cache = opts._rfc4253Cache;
      this._hashCache = {};
      var sz;
      this.curve = void 0;
      if (this.type === "ecdsa") {
        var curve = this.part.curve.data.toString();
        this.curve = curve;
        sz = algs.curves[curve].size;
      } else if (this.type === "ed25519" || this.type === "curve25519") {
        sz = 256;
        this.curve = "curve25519";
      } else {
        var szPart = this.part[algInfo.sizePart];
        sz = szPart.data.length;
        sz = sz * 8 - utils.countZeros(szPart.data);
      }
      this.size = sz;
    }
    Key.formats = formats;
    Key.prototype.toBuffer = function(format, options) {
      if (format === void 0)
        format = "ssh";
      assert.string(format, "format");
      assert.object(formats[format], "formats[format]");
      assert.optionalObject(options, "options");
      if (format === "rfc4253") {
        if (this._rfc4253Cache === void 0)
          this._rfc4253Cache = formats["rfc4253"].write(this);
        return this._rfc4253Cache;
      }
      return formats[format].write(this, options);
    };
    Key.prototype.toString = function(format, options) {
      return this.toBuffer(format, options).toString();
    };
    Key.prototype.hash = function(algo, type) {
      assert.string(algo, "algorithm");
      assert.optionalString(type, "type");
      if (type === void 0)
        type = "ssh";
      algo = algo.toLowerCase();
      if (algs.hashAlgs[algo] === void 0)
        throw new InvalidAlgorithmError(algo);
      var cacheKey = algo + "||" + type;
      if (this._hashCache[cacheKey])
        return this._hashCache[cacheKey];
      var buf;
      if (type === "ssh") {
        buf = this.toBuffer("rfc4253");
      } else if (type === "spki") {
        buf = formats.pkcs8.pkcs8ToBuffer(this);
      } else {
        throw new Error("Hash type " + type + " not supported");
      }
      var hash3 = crypto3.createHash(algo).update(buf).digest();
      this._hashCache[cacheKey] = hash3;
      return hash3;
    };
    Key.prototype.fingerprint = function(algo, type) {
      if (algo === void 0)
        algo = "sha256";
      if (type === void 0)
        type = "ssh";
      assert.string(algo, "algorithm");
      assert.string(type, "type");
      var opts = {
        type: "key",
        hash: this.hash(algo, type),
        algorithm: algo,
        hashType: type
      };
      return new Fingerprint(opts);
    };
    Key.prototype.defaultHashAlgorithm = function() {
      var hashAlgo = "sha1";
      if (this.type === "rsa")
        hashAlgo = "sha256";
      if (this.type === "dsa" && this.size > 1024)
        hashAlgo = "sha256";
      if (this.type === "ed25519")
        hashAlgo = "sha512";
      if (this.type === "ecdsa") {
        if (this.size <= 256)
          hashAlgo = "sha256";
        else if (this.size <= 384)
          hashAlgo = "sha384";
        else
          hashAlgo = "sha512";
      }
      return hashAlgo;
    };
    Key.prototype.createVerify = function(hashAlgo) {
      if (hashAlgo === void 0)
        hashAlgo = this.defaultHashAlgorithm();
      assert.string(hashAlgo, "hash algorithm");
      if (this.type === "ed25519" && edCompat !== void 0)
        return new edCompat.Verifier(this, hashAlgo);
      if (this.type === "curve25519")
        throw new Error("Curve25519 keys are not suitable for signing or verification");
      var v, nm, err;
      try {
        nm = hashAlgo.toUpperCase();
        v = crypto3.createVerify(nm);
      } catch (e) {
        err = e;
      }
      if (v === void 0 || err instanceof Error && err.message.match(/Unknown message digest/)) {
        nm = "RSA-";
        nm += hashAlgo.toUpperCase();
        v = crypto3.createVerify(nm);
      }
      assert.ok(v, "failed to create verifier");
      var oldVerify = v.verify.bind(v);
      var key = this.toBuffer("pkcs8");
      var curve = this.curve;
      var self2 = this;
      v.verify = function(signature, fmt) {
        if (Signature.isSignature(signature, [2, 0])) {
          if (signature.type !== self2.type)
            return false;
          if (signature.hashAlgorithm && signature.hashAlgorithm !== hashAlgo)
            return false;
          if (signature.curve && self2.type === "ecdsa" && signature.curve !== curve)
            return false;
          return oldVerify(key, signature.toBuffer("asn1"));
        } else if (typeof signature === "string" || Buffer.isBuffer(signature)) {
          return oldVerify(key, signature, fmt);
        } else if (Signature.isSignature(signature, [1, 0])) {
          throw new Error("signature was created by too old a version of sshpk and cannot be verified");
        } else {
          throw new TypeError("signature must be a string, Buffer, or Signature object");
        }
      };
      return v;
    };
    Key.prototype.createDiffieHellman = function() {
      if (this.type === "rsa")
        throw new Error("RSA keys do not support Diffie-Hellman");
      return new DiffieHellman(this);
    };
    Key.prototype.createDH = Key.prototype.createDiffieHellman;
    Key.parse = function(data, format, options) {
      if (typeof data !== "string")
        assert.buffer(data, "data");
      if (format === void 0)
        format = "auto";
      assert.string(format, "format");
      if (typeof options === "string")
        options = { filename: options };
      assert.optionalObject(options, "options");
      if (options === void 0)
        options = {};
      assert.optionalString(options.filename, "options.filename");
      if (options.filename === void 0)
        options.filename = "(unnamed)";
      assert.object(formats[format], "formats[format]");
      try {
        var k = formats[format].read(data, options);
        if (k instanceof PrivateKey)
          k = k.toPublic();
        if (!k.comment)
          k.comment = options.filename;
        return k;
      } catch (e) {
        if (e.name === "KeyEncryptedError")
          throw e;
        throw new KeyParseError(options.filename, format, e);
      }
    };
    Key.isKey = function(obj2, ver) {
      return utils.isCompatible(obj2, Key, ver);
    };
    Key.prototype._sshpkApiVersion = [1, 7];
    Key._oldVersionDetect = function(obj2) {
      assert.func(obj2.toBuffer);
      assert.func(obj2.fingerprint);
      if (obj2.createDH)
        return [1, 4];
      if (obj2.defaultHashAlgorithm)
        return [1, 3];
      if (obj2.formats["auto"])
        return [1, 2];
      if (obj2.formats["pkcs1"])
        return [1, 1];
      return [1, 0];
    };
  }
});

// node_modules/sshpk/lib/index.js
var require_lib10 = __commonJS({
  "node_modules/sshpk/lib/index.js"(exports2, module2) {
    var Key = require_key();
    var Fingerprint = require_fingerprint();
    var Signature = require_signature();
    var PrivateKey = require_private_key();
    var Certificate = require_certificate();
    var Identity = require_identity();
    var errs = require_errors5();
    module2.exports = {
      /* top-level classes */
      Key,
      parseKey: Key.parse,
      Fingerprint,
      parseFingerprint: Fingerprint.parse,
      Signature,
      parseSignature: Signature.parse,
      PrivateKey,
      parsePrivateKey: PrivateKey.parse,
      generatePrivateKey: PrivateKey.generate,
      Certificate,
      parseCertificate: Certificate.parse,
      createSelfSignedCertificate: Certificate.createSelfSigned,
      createCertificate: Certificate.create,
      Identity,
      identityFromDN: Identity.parseDN,
      identityForHost: Identity.forHost,
      identityForUser: Identity.forUser,
      identityForEmail: Identity.forEmail,
      identityFromArray: Identity.fromArray,
      /* errors */
      FingerprintFormatError: errs.FingerprintFormatError,
      InvalidAlgorithmError: errs.InvalidAlgorithmError,
      KeyParseError: errs.KeyParseError,
      SignatureParseError: errs.SignatureParseError,
      KeyEncryptedError: errs.KeyEncryptedError,
      CertificateParseError: errs.CertificateParseError
    };
  }
});

// node_modules/http-signature/lib/utils.js
var require_utils7 = __commonJS({
  "node_modules/http-signature/lib/utils.js"(exports2, module2) {
    var assert = require_assert();
    var sshpk = require_lib10();
    var util = require("util");
    var HASH_ALGOS = {
      "sha1": true,
      "sha256": true,
      "sha512": true
    };
    var PK_ALGOS = {
      "rsa": true,
      "dsa": true,
      "ecdsa": true,
      "ed25519": true
    };
    var HEADER = {
      AUTH: "authorization",
      SIG: "signature"
    };
    function HttpSignatureError(message, caller) {
      if (Error.captureStackTrace)
        Error.captureStackTrace(this, caller || HttpSignatureError);
      this.message = message;
      this.name = caller.name;
    }
    util.inherits(HttpSignatureError, Error);
    function InvalidAlgorithmError(message) {
      HttpSignatureError.call(this, message, InvalidAlgorithmError);
    }
    util.inherits(InvalidAlgorithmError, HttpSignatureError);
    function validateAlgorithm(algorithm2) {
      var alg = algorithm2.toLowerCase().split("-");
      if (alg.length !== 2) {
        throw new InvalidAlgorithmError(alg[0].toUpperCase() + " is not a valid algorithm");
      }
      if (alg[0] !== "hmac" && !PK_ALGOS[alg[0]]) {
        throw new InvalidAlgorithmError(alg[0].toUpperCase() + " type keys are not supported");
      }
      if (!HASH_ALGOS[alg[1]]) {
        throw new InvalidAlgorithmError(alg[1].toUpperCase() + " is not a supported hash algorithm");
      }
      return alg;
    }
    module2.exports = {
      HEADER,
      HASH_ALGOS,
      PK_ALGOS,
      HttpSignatureError,
      InvalidAlgorithmError,
      validateAlgorithm,
      /**
       * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
       *
       * The intent of this module is to interoperate with OpenSSL only,
       * specifically the node crypto module's `verify` method.
       *
       * @param {String} key an OpenSSH public key.
       * @return {String} PEM encoded form of the RSA public key.
       * @throws {TypeError} on bad input.
       * @throws {Error} on invalid ssh key formatted data.
       */
      sshKeyToPEM: function sshKeyToPEM(key) {
        assert.string(key, "ssh_key");
        var k = sshpk.parseKey(key, "ssh");
        return k.toString("pem");
      },
      /**
       * Generates an OpenSSH fingerprint from an ssh public key.
       *
       * @param {String} key an OpenSSH public key.
       * @return {String} key fingerprint.
       * @throws {TypeError} on bad input.
       * @throws {Error} if what you passed doesn't look like an ssh public key.
       */
      fingerprint: function fingerprint(key) {
        assert.string(key, "ssh_key");
        var k = sshpk.parseKey(key, "ssh");
        return k.fingerprint("md5").toString("hex");
      },
      /**
       * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
       *
       * The reverse of the above function.
       */
      pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
        assert.equal("string", typeof pem, "typeof pem");
        var k = sshpk.parseKey(pem, "pem");
        k.comment = comment;
        return k.toString("ssh");
      }
    };
  }
});

// node_modules/http-signature/lib/parser.js
var require_parser = __commonJS({
  "node_modules/http-signature/lib/parser.js"(exports2, module2) {
    var assert = require_assert();
    var util = require("util");
    var utils = require_utils7();
    var HASH_ALGOS = utils.HASH_ALGOS;
    var PK_ALGOS = utils.PK_ALGOS;
    var HttpSignatureError = utils.HttpSignatureError;
    var InvalidAlgorithmError = utils.InvalidAlgorithmError;
    var validateAlgorithm = utils.validateAlgorithm;
    var State = {
      New: 0,
      Params: 1
    };
    var ParamsState = {
      Name: 0,
      Quote: 1,
      Value: 2,
      Comma: 3,
      Number: 4
    };
    function ExpiredRequestError(message) {
      HttpSignatureError.call(this, message, ExpiredRequestError);
    }
    util.inherits(ExpiredRequestError, HttpSignatureError);
    function InvalidHeaderError(message) {
      HttpSignatureError.call(this, message, InvalidHeaderError);
    }
    util.inherits(InvalidHeaderError, HttpSignatureError);
    function InvalidParamsError(message) {
      HttpSignatureError.call(this, message, InvalidParamsError);
    }
    util.inherits(InvalidParamsError, HttpSignatureError);
    function MissingHeaderError(message) {
      HttpSignatureError.call(this, message, MissingHeaderError);
    }
    util.inherits(MissingHeaderError, HttpSignatureError);
    function StrictParsingError(message) {
      HttpSignatureError.call(this, message, StrictParsingError);
    }
    util.inherits(StrictParsingError, HttpSignatureError);
    module2.exports = {
      /**
       * Parses the 'Authorization' header out of an http.ServerRequest object.
       *
       * Note that this API will fully validate the Authorization header, and throw
       * on any error.  It will not however check the signature, or the keyId format
       * as those are specific to your environment.  You can use the options object
       * to pass in extra constraints.
       *
       * As a response object you can expect this:
       *
       *     {
       *       "scheme": "Signature",
       *       "params": {
       *         "keyId": "foo",
       *         "algorithm": "rsa-sha256",
       *         "headers": [
       *           "date" or "x-date",
       *           "digest"
       *         ],
       *         "signature": "base64"
       *       },
       *       "signingString": "ready to be passed to crypto.verify()"
       *     }
       *
       * @param {Object} request an http.ServerRequest.
       * @param {Object} options an optional options object with:
       *                   - clockSkew: allowed clock skew in seconds (default 300).
       *                   - headers: required header names (def: date or x-date)
       *                   - algorithms: algorithms to support (default: all).
       *                   - strict: should enforce latest spec parsing
       *                             (default: false).
       * @return {Object} parsed out object (see above).
       * @throws {TypeError} on invalid input.
       * @throws {InvalidHeaderError} on an invalid Authorization header error.
       * @throws {InvalidParamsError} if the params in the scheme are invalid.
       * @throws {MissingHeaderError} if the params indicate a header not present,
       *                              either in the request headers from the params,
       *                              or not in the params from a required header
       *                              in options.
       * @throws {StrictParsingError} if old attributes are used in strict parsing
       *                              mode.
       * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
       */
      parseRequest: function parseRequest(request, options) {
        assert.object(request, "request");
        assert.object(request.headers, "request.headers");
        if (options === void 0) {
          options = {};
        }
        assert.object(options, "options");
        assert.optionalFinite(options.clockSkew, "options.clockSkew");
        var headers = [request.headers["x-date"] ? "x-date" : "date"];
        if (options.headers !== void 0) {
          assert.arrayOfString(headers, "options.headers");
          headers = options.headers;
        }
        var authzHeaderName = options.authorizationHeaderName;
        var authz = request.headers[authzHeaderName] || request.headers[utils.HEADER.AUTH] || request.headers[utils.HEADER.SIG];
        if (!authz) {
          var errHeader = authzHeaderName ? authzHeaderName : utils.HEADER.AUTH + " or " + utils.HEADER.SIG;
          throw new MissingHeaderError("no " + errHeader + " header present in the request");
        }
        options.clockSkew = options.clockSkew || 300;
        var i = 0;
        var state = authz === request.headers[utils.HEADER.SIG] ? State.Params : State.New;
        var substate = ParamsState.Name;
        var tmpName = "";
        var tmpValue = "";
        var parsed = {
          scheme: authz === request.headers[utils.HEADER.SIG] ? "Signature" : "",
          params: {},
          signingString: ""
        };
        for (i = 0; i < authz.length; i++) {
          var c = authz.charAt(i);
          switch (Number(state)) {
            case State.New:
              if (c !== " ")
                parsed.scheme += c;
              else
                state = State.Params;
              break;
            case State.Params:
              switch (Number(substate)) {
                case ParamsState.Name:
                  var code = c.charCodeAt(0);
                  if (code >= 65 && code <= 90 || // A-Z
                  code >= 97 && code <= 122) {
                    tmpName += c;
                  } else if (c === "=") {
                    if (tmpName.length === 0)
                      throw new InvalidHeaderError("bad param format");
                    substate = ParamsState.Quote;
                  } else {
                    throw new InvalidHeaderError("bad param format");
                  }
                  break;
                case ParamsState.Quote:
                  if (c === '"') {
                    tmpValue = "";
                    substate = ParamsState.Value;
                  } else {
                    substate = ParamsState.Number;
                    code = c.charCodeAt(0);
                    if (code < 48 || code > 57) {
                      throw new InvalidHeaderError("bad param format");
                    }
                    tmpValue = c;
                  }
                  break;
                case ParamsState.Value:
                  if (c === '"') {
                    parsed.params[tmpName] = tmpValue;
                    substate = ParamsState.Comma;
                  } else {
                    tmpValue += c;
                  }
                  break;
                case ParamsState.Number:
                  if (c === ",") {
                    parsed.params[tmpName] = parseInt(tmpValue, 10);
                    tmpName = "";
                    substate = ParamsState.Name;
                  } else {
                    code = c.charCodeAt(0);
                    if (code < 48 || code > 57) {
                      throw new InvalidHeaderError("bad param format");
                    }
                    tmpValue += c;
                  }
                  break;
                case ParamsState.Comma:
                  if (c === ",") {
                    tmpName = "";
                    substate = ParamsState.Name;
                  } else {
                    throw new InvalidHeaderError("bad param format");
                  }
                  break;
                default:
                  throw new Error("Invalid substate");
              }
              break;
            default:
              throw new Error("Invalid substate");
          }
        }
        if (!parsed.params.headers || parsed.params.headers === "") {
          if (request.headers["x-date"]) {
            parsed.params.headers = ["x-date"];
          } else {
            parsed.params.headers = ["date"];
          }
        } else {
          parsed.params.headers = parsed.params.headers.split(" ");
        }
        if (!parsed.scheme || parsed.scheme !== "Signature")
          throw new InvalidHeaderError('scheme was not "Signature"');
        if (!parsed.params.keyId)
          throw new InvalidHeaderError("keyId was not specified");
        if (!parsed.params.algorithm)
          throw new InvalidHeaderError("algorithm was not specified");
        if (!parsed.params.signature)
          throw new InvalidHeaderError("signature was not specified");
        try {
          validateAlgorithm(parsed.params.algorithm);
        } catch (e) {
          if (e instanceof InvalidAlgorithmError)
            throw new InvalidParamsError(parsed.params.algorithm + " is not supported");
          else
            throw e;
        }
        for (i = 0; i < parsed.params.headers.length; i++) {
          var h = parsed.params.headers[i].toLowerCase();
          parsed.params.headers[i] = h;
          if (h === "request-line") {
            if (!options.strict) {
              parsed.signingString += request.method + " " + request.url + " HTTP/" + request.httpVersion;
            } else {
              throw new StrictParsingError("request-line is not a valid header with strict parsing enabled.");
            }
          } else if (h === "(request-target)") {
            parsed.signingString += "(request-target): " + request.method.toLowerCase() + " " + request.url;
          } else if (h === "(keyid)") {
            parsed.signingString += "(keyid): " + parsed.params.keyId;
          } else if (h === "(algorithm)") {
            parsed.signingString += "(algorithm): " + parsed.params.algorithm;
          } else if (h === "(opaque)") {
            var opaque = parsed.params.opaque;
            if (opaque === void 0) {
              throw new MissingHeaderError("opaque param was not in the " + authzHeaderName + " header");
            }
            parsed.signingString += "(opaque): " + opaque;
          } else if (h === "(created)") {
            parsed.signingString += "(created): " + parsed.params.created;
          } else if (h === "(expires)") {
            parsed.signingString += "(expires): " + parsed.params.expires;
          } else {
            var value = request.headers[h];
            if (value === void 0)
              throw new MissingHeaderError(h + " was not in the request");
            parsed.signingString += h + ": " + value;
          }
          if (i + 1 < parsed.params.headers.length)
            parsed.signingString += "\n";
        }
        var date;
        var skew;
        if (request.headers.date || request.headers["x-date"]) {
          if (request.headers["x-date"]) {
            date = new Date(request.headers["x-date"]);
          } else {
            date = new Date(request.headers.date);
          }
          var now = new Date();
          skew = Math.abs(now.getTime() - date.getTime());
          if (skew > options.clockSkew * 1e3) {
            throw new ExpiredRequestError("clock skew of " + skew / 1e3 + "s was greater than " + options.clockSkew + "s");
          }
        }
        if (parsed.params.created) {
          skew = parsed.params.created - Math.floor(Date.now() / 1e3);
          if (skew > options.clockSkew) {
            throw new ExpiredRequestError("Created lies in the future (with skew " + skew + "s greater than allowed " + options.clockSkew + "s");
          }
        }
        if (parsed.params.expires) {
          var expiredSince = Math.floor(Date.now() / 1e3) - parsed.params.expires;
          if (expiredSince > options.clockSkew) {
            throw new ExpiredRequestError("Request expired with skew " + expiredSince + "s greater than allowed " + options.clockSkew + "s");
          }
        }
        headers.forEach(function(hdr) {
          if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)
            throw new MissingHeaderError(hdr + " was not a signed header");
        });
        parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
        if (options.algorithms) {
          if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
            throw new InvalidParamsError(parsed.params.algorithm + " is not a supported algorithm");
        }
        parsed.algorithm = parsed.params.algorithm.toUpperCase();
        parsed.keyId = parsed.params.keyId;
        parsed.opaque = parsed.params.opaque;
        return parsed;
      }
    };
  }
});

// node_modules/extsprintf/lib/extsprintf.js
var require_extsprintf = __commonJS({
  "node_modules/extsprintf/lib/extsprintf.js"(exports2) {
    var mod_assert = require("assert");
    var mod_util = require("util");
    exports2.sprintf = jsSprintf;
    exports2.printf = jsPrintf;
    exports2.fprintf = jsFprintf;
    function jsSprintf(fmt) {
      var regex = [
        "([^%]*)",
        /* normal text */
        "%",
        /* start of format */
        "(['\\-+ #0]*?)",
        /* flags (optional) */
        "([1-9]\\d*)?",
        /* width (optional) */
        "(\\.([1-9]\\d*))?",
        /* precision (optional) */
        "[lhjztL]*?",
        /* length mods (ignored) */
        "([diouxXfFeEgGaAcCsSp%jr])"
        /* conversion */
      ].join("");
      var re = new RegExp(regex);
      var args = Array.prototype.slice.call(arguments, 1);
      var flags, width, precision, conversion;
      var left2, pad, sign, arg, match;
      var ret2 = "";
      var argn = 1;
      mod_assert.equal("string", typeof fmt);
      while ((match = re.exec(fmt)) !== null) {
        ret2 += match[1];
        fmt = fmt.substring(match[0].length);
        flags = match[2] || "";
        width = match[3] || 0;
        precision = match[4] || "";
        conversion = match[6];
        left2 = false;
        sign = false;
        pad = " ";
        if (conversion == "%") {
          ret2 += "%";
          continue;
        }
        if (args.length === 0)
          throw new Error("too few args to sprintf");
        arg = args.shift();
        argn++;
        if (flags.match(/[\' #]/))
          throw new Error(
            "unsupported flags: " + flags
          );
        if (precision.length > 0)
          throw new Error(
            "non-zero precision not supported"
          );
        if (flags.match(/-/))
          left2 = true;
        if (flags.match(/0/))
          pad = "0";
        if (flags.match(/\+/))
          sign = true;
        switch (conversion) {
          case "s":
            if (arg === void 0 || arg === null)
              throw new Error("argument " + argn + ": attempted to print undefined or null as a string");
            ret2 += doPad(pad, width, left2, arg.toString());
            break;
          case "d":
            arg = Math.floor(arg);
          case "f":
            sign = sign && arg > 0 ? "+" : "";
            ret2 += sign + doPad(
              pad,
              width,
              left2,
              arg.toString()
            );
            break;
          case "x":
            ret2 += doPad(pad, width, left2, arg.toString(16));
            break;
          case "j":
            if (width === 0)
              width = 10;
            ret2 += mod_util.inspect(arg, false, width);
            break;
          case "r":
            ret2 += dumpException(arg);
            break;
          default:
            throw new Error("unsupported conversion: " + conversion);
        }
      }
      ret2 += fmt;
      return ret2;
    }
    function jsPrintf() {
      var args = Array.prototype.slice.call(arguments);
      args.unshift(process.stdout);
      jsFprintf.apply(null, args);
    }
    function jsFprintf(stream) {
      var args = Array.prototype.slice.call(arguments, 1);
      return stream.write(jsSprintf.apply(this, args));
    }
    function doPad(chr, width, left2, str) {
      var ret2 = str;
      while (ret2.length < width) {
        if (left2)
          ret2 += chr;
        else
          ret2 = chr + ret2;
      }
      return ret2;
    }
    function dumpException(ex) {
      var ret2;
      if (!(ex instanceof Error))
        throw new Error(jsSprintf("invalid type for %%r: %j", ex));
      ret2 = "EXCEPTION: " + ex.constructor.name + ": " + ex.stack;
      if (ex.cause && typeof ex.cause === "function") {
        var cex = ex.cause();
        if (cex) {
          ret2 += "\nCaused by: " + dumpException(cex);
        }
      }
      return ret2;
    }
  }
});

// node_modules/verror/node_modules/core-util-is/lib/util.js
var require_util4 = __commonJS({
  "node_modules/verror/node_modules/core-util-is/lib/util.js"(exports2) {
    function isArray(arg) {
      if (Array.isArray) {
        return Array.isArray(arg);
      }
      return objectToString(arg) === "[object Array]";
    }
    exports2.isArray = isArray;
    function isBoolean(arg) {
      return typeof arg === "boolean";
    }
    exports2.isBoolean = isBoolean;
    function isNull(arg) {
      return arg === null;
    }
    exports2.isNull = isNull;
    function isNullOrUndefined(arg) {
      return arg == null;
    }
    exports2.isNullOrUndefined = isNullOrUndefined;
    function isNumber(arg) {
      return typeof arg === "number";
    }
    exports2.isNumber = isNumber;
    function isString(arg) {
      return typeof arg === "string";
    }
    exports2.isString = isString;
    function isSymbol(arg) {
      return typeof arg === "symbol";
    }
    exports2.isSymbol = isSymbol;
    function isUndefined(arg) {
      return arg === void 0;
    }
    exports2.isUndefined = isUndefined;
    function isRegExp(re) {
      return objectToString(re) === "[object RegExp]";
    }
    exports2.isRegExp = isRegExp;
    function isObject2(arg) {
      return typeof arg === "object" && arg !== null;
    }
    exports2.isObject = isObject2;
    function isDate(d) {
      return objectToString(d) === "[object Date]";
    }
    exports2.isDate = isDate;
    function isError2(e) {
      return objectToString(e) === "[object Error]" || e instanceof Error;
    }
    exports2.isError = isError2;
    function isFunction(arg) {
      return typeof arg === "function";
    }
    exports2.isFunction = isFunction;
    function isPrimitive2(arg) {
      return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
      typeof arg === "undefined";
    }
    exports2.isPrimitive = isPrimitive2;
    exports2.isBuffer = Buffer.isBuffer;
    function objectToString(o) {
      return Object.prototype.toString.call(o);
    }
  }
});

// node_modules/verror/lib/verror.js
var require_verror = __commonJS({
  "node_modules/verror/lib/verror.js"(exports2, module2) {
    var mod_assertplus = require_assert();
    var mod_util = require("util");
    var mod_extsprintf = require_extsprintf();
    var mod_isError = require_util4().isError;
    var sprintf = mod_extsprintf.sprintf;
    module2.exports = VError;
    VError.VError = VError;
    VError.SError = SError;
    VError.WError = WError;
    VError.MultiError = MultiError;
    function parseConstructorArguments(args) {
      var argv, options, sprintf_args, shortmessage, k;
      mod_assertplus.object(args, "args");
      mod_assertplus.bool(args.strict, "args.strict");
      mod_assertplus.array(args.argv, "args.argv");
      argv = args.argv;
      if (argv.length === 0) {
        options = {};
        sprintf_args = [];
      } else if (mod_isError(argv[0])) {
        options = { "cause": argv[0] };
        sprintf_args = argv.slice(1);
      } else if (typeof argv[0] === "object") {
        options = {};
        for (k in argv[0]) {
          options[k] = argv[0][k];
        }
        sprintf_args = argv.slice(1);
      } else {
        mod_assertplus.string(
          argv[0],
          "first argument to VError, SError, or WError constructor must be a string, object, or Error"
        );
        options = {};
        sprintf_args = argv;
      }
      mod_assertplus.object(options);
      if (!options.strict && !args.strict) {
        sprintf_args = sprintf_args.map(function(a) {
          return a === null ? "null" : a === void 0 ? "undefined" : a;
        });
      }
      if (sprintf_args.length === 0) {
        shortmessage = "";
      } else {
        shortmessage = sprintf.apply(null, sprintf_args);
      }
      return {
        "options": options,
        "shortmessage": shortmessage
      };
    }
    function VError() {
      var args, obj2, parsed, cause, ctor, message, k;
      args = Array.prototype.slice.call(arguments, 0);
      if (!(this instanceof VError)) {
        obj2 = Object.create(VError.prototype);
        VError.apply(obj2, arguments);
        return obj2;
      }
      parsed = parseConstructorArguments({
        "argv": args,
        "strict": false
      });
      if (parsed.options.name) {
        mod_assertplus.string(
          parsed.options.name,
          `error's "name" must be a string`
        );
        this.name = parsed.options.name;
      }
      this.jse_shortmsg = parsed.shortmessage;
      message = parsed.shortmessage;
      cause = parsed.options.cause;
      if (cause) {
        mod_assertplus.ok(mod_isError(cause), "cause is not an Error");
        this.jse_cause = cause;
        if (!parsed.options.skipCauseMessage) {
          message += ": " + cause.message;
        }
      }
      this.jse_info = {};
      if (parsed.options.info) {
        for (k in parsed.options.info) {
          this.jse_info[k] = parsed.options.info[k];
        }
      }
      this.message = message;
      Error.call(this, message);
      if (Error.captureStackTrace) {
        ctor = parsed.options.constructorOpt || this.constructor;
        Error.captureStackTrace(this, ctor);
      }
      return this;
    }
    mod_util.inherits(VError, Error);
    VError.prototype.name = "VError";
    VError.prototype.toString = function ve_toString() {
      var str = this.hasOwnProperty("name") && this.name || this.constructor.name || this.constructor.prototype.name;
      if (this.message)
        str += ": " + this.message;
      return str;
    };
    VError.prototype.cause = function ve_cause() {
      var cause = VError.cause(this);
      return cause === null ? void 0 : cause;
    };
    VError.cause = function(err) {
      mod_assertplus.ok(mod_isError(err), "err must be an Error");
      return mod_isError(err.jse_cause) ? err.jse_cause : null;
    };
    VError.info = function(err) {
      var rv, cause, k;
      mod_assertplus.ok(mod_isError(err), "err must be an Error");
      cause = VError.cause(err);
      if (cause !== null) {
        rv = VError.info(cause);
      } else {
        rv = {};
      }
      if (typeof err.jse_info == "object" && err.jse_info !== null) {
        for (k in err.jse_info) {
          rv[k] = err.jse_info[k];
        }
      }
      return rv;
    };
    VError.findCauseByName = function(err, name) {
      var cause;
      mod_assertplus.ok(mod_isError(err), "err must be an Error");
      mod_assertplus.string(name, "name");
      mod_assertplus.ok(name.length > 0, "name cannot be empty");
      for (cause = err; cause !== null; cause = VError.cause(cause)) {
        mod_assertplus.ok(mod_isError(cause));
        if (cause.name == name) {
          return cause;
        }
      }
      return null;
    };
    VError.hasCauseWithName = function(err, name) {
      return VError.findCauseByName(err, name) !== null;
    };
    VError.fullStack = function(err) {
      mod_assertplus.ok(mod_isError(err), "err must be an Error");
      var cause = VError.cause(err);
      if (cause) {
        return err.stack + "\ncaused by: " + VError.fullStack(cause);
      }
      return err.stack;
    };
    VError.errorFromList = function(errors) {
      mod_assertplus.arrayOfObject(errors, "errors");
      if (errors.length === 0) {
        return null;
      }
      errors.forEach(function(e) {
        mod_assertplus.ok(mod_isError(e));
      });
      if (errors.length == 1) {
        return errors[0];
      }
      return new MultiError(errors);
    };
    VError.errorForEach = function(err, func) {
      mod_assertplus.ok(mod_isError(err), "err must be an Error");
      mod_assertplus.func(func, "func");
      if (err instanceof MultiError) {
        err.errors().forEach(function iterError(e) {
          func(e);
        });
      } else {
        func(err);
      }
    };
    function SError() {
      var args, obj2, parsed, options;
      args = Array.prototype.slice.call(arguments, 0);
      if (!(this instanceof SError)) {
        obj2 = Object.create(SError.prototype);
        SError.apply(obj2, arguments);
        return obj2;
      }
      parsed = parseConstructorArguments({
        "argv": args,
        "strict": true
      });
      options = parsed.options;
      VError.call(this, options, "%s", parsed.shortmessage);
      return this;
    }
    mod_util.inherits(SError, VError);
    function MultiError(errors) {
      mod_assertplus.array(errors, "list of errors");
      mod_assertplus.ok(errors.length > 0, "must be at least one error");
      this.ase_errors = errors;
      VError.call(this, {
        "cause": errors[0]
      }, "first of %d error%s", errors.length, errors.length == 1 ? "" : "s");
    }
    mod_util.inherits(MultiError, VError);
    MultiError.prototype.name = "MultiError";
    MultiError.prototype.errors = function me_errors() {
      return this.ase_errors.slice(0);
    };
    function WError() {
      var args, obj2, parsed, options;
      args = Array.prototype.slice.call(arguments, 0);
      if (!(this instanceof WError)) {
        obj2 = Object.create(WError.prototype);
        WError.apply(obj2, args);
        return obj2;
      }
      parsed = parseConstructorArguments({
        "argv": args,
        "strict": false
      });
      options = parsed.options;
      options["skipCauseMessage"] = true;
      VError.call(this, options, "%s", parsed.shortmessage);
      return this;
    }
    mod_util.inherits(WError, VError);
    WError.prototype.name = "WError";
    WError.prototype.toString = function we_toString() {
      var str = this.hasOwnProperty("name") && this.name || this.constructor.name || this.constructor.prototype.name;
      if (this.message)
        str += ": " + this.message;
      if (this.jse_cause && this.jse_cause.message)
        str += "; caused by " + this.jse_cause.toString();
      return str;
    };
    WError.prototype.cause = function we_cause(c) {
      if (mod_isError(c))
        this.jse_cause = c;
      return this.jse_cause;
    };
  }
});

// node_modules/json-schema/lib/validate.js
var require_validate = __commonJS({
  "node_modules/json-schema/lib/validate.js"(exports2, module2) {
    (function(root, factory) {
      if (typeof define === "function" && define.amd) {
        define([], function() {
          return factory();
        });
      } else if (typeof module2 === "object" && module2.exports) {
        module2.exports = factory();
      } else {
        root.jsonSchema = factory();
      }
    })(exports2, function() {
      var exports3 = validate2;
      exports3.Integer = { type: "integer" };
      var primitiveConstructors = {
        String,
        Boolean,
        Number,
        Object,
        Array,
        Date
      };
      exports3.validate = validate2;
      function validate2(instance, schema) {
        return validate2(instance, schema, { changing: false });
      }
      ;
      exports3.checkPropertyChange = function(value, schema, property) {
        return validate2(value, schema, { changing: property || "property" });
      };
      var validate2 = exports3._validate = function(instance, schema, options) {
        if (!options)
          options = {};
        var _changing = options.changing;
        function getType(schema2) {
          return schema2.type || primitiveConstructors[schema2.name] == schema2 && schema2.name.toLowerCase();
        }
        var errors = [];
        function checkProp(value, schema2, path4, i) {
          var l;
          path4 += path4 ? typeof i == "number" ? "[" + i + "]" : typeof i == "undefined" ? "" : "." + i : i;
          function addError(message) {
            errors.push({ property: path4, message });
          }
          if ((typeof schema2 != "object" || schema2 instanceof Array) && (path4 || typeof schema2 != "function") && !(schema2 && getType(schema2))) {
            if (typeof schema2 == "function") {
              if (!(value instanceof schema2)) {
                addError("is not an instance of the class/constructor " + schema2.name);
              }
            } else if (schema2) {
              addError("Invalid schema/property definition " + schema2);
            }
            return null;
          }
          if (_changing && schema2.readonly) {
            addError("is a readonly field, it can not be changed");
          }
          if (schema2["extends"]) {
            checkProp(value, schema2["extends"], path4, i);
          }
          function checkType(type, value2) {
            if (type) {
              if (typeof type == "string" && type != "any" && (type == "null" ? value2 !== null : typeof value2 != type) && !(value2 instanceof Array && type == "array") && !(value2 instanceof Date && type == "date") && !(type == "integer" && value2 % 1 === 0)) {
                return [{ property: path4, message: value2 + " - " + typeof value2 + " value found, but a " + type + " is required" }];
              }
              if (type instanceof Array) {
                var unionErrors = [];
                for (var j2 = 0; j2 < type.length; j2++) {
                  if (!(unionErrors = checkType(type[j2], value2)).length) {
                    break;
                  }
                }
                if (unionErrors.length) {
                  return unionErrors;
                }
              } else if (typeof type == "object") {
                var priorErrors = errors;
                errors = [];
                checkProp(value2, type, path4);
                var theseErrors = errors;
                errors = priorErrors;
                return theseErrors;
              }
            }
            return [];
          }
          if (value === void 0) {
            if (schema2.required) {
              addError("is missing and it is required");
            }
          } else {
            errors = errors.concat(checkType(getType(schema2), value));
            if (schema2.disallow && !checkType(schema2.disallow, value).length) {
              addError(" disallowed value was matched");
            }
            if (value !== null) {
              if (value instanceof Array) {
                if (schema2.items) {
                  var itemsIsArray = schema2.items instanceof Array;
                  var propDef = schema2.items;
                  for (i = 0, l = value.length; i < l; i += 1) {
                    if (itemsIsArray)
                      propDef = schema2.items[i];
                    if (options.coerce)
                      value[i] = options.coerce(value[i], propDef);
                    errors.concat(checkProp(value[i], propDef, path4, i));
                  }
                }
                if (schema2.minItems && value.length < schema2.minItems) {
                  addError("There must be a minimum of " + schema2.minItems + " in the array");
                }
                if (schema2.maxItems && value.length > schema2.maxItems) {
                  addError("There must be a maximum of " + schema2.maxItems + " in the array");
                }
              } else if (schema2.properties || schema2.additionalProperties) {
                errors.concat(checkObj(value, schema2.properties, path4, schema2.additionalProperties));
              }
              if (schema2.pattern && typeof value == "string" && !value.match(schema2.pattern)) {
                addError("does not match the regex pattern " + schema2.pattern);
              }
              if (schema2.maxLength && typeof value == "string" && value.length > schema2.maxLength) {
                addError("may only be " + schema2.maxLength + " characters long");
              }
              if (schema2.minLength && typeof value == "string" && value.length < schema2.minLength) {
                addError("must be at least " + schema2.minLength + " characters long");
              }
              if (typeof schema2.minimum !== "undefined" && typeof value == typeof schema2.minimum && schema2.minimum > value) {
                addError("must have a minimum value of " + schema2.minimum);
              }
              if (typeof schema2.maximum !== "undefined" && typeof value == typeof schema2.maximum && schema2.maximum < value) {
                addError("must have a maximum value of " + schema2.maximum);
              }
              if (schema2["enum"]) {
                var enumer = schema2["enum"];
                l = enumer.length;
                var found;
                for (var j = 0; j < l; j++) {
                  if (enumer[j] === value) {
                    found = 1;
                    break;
                  }
                }
                if (!found) {
                  addError("does not have a value in the enumeration " + enumer.join(", "));
                }
              }
              if (typeof schema2.maxDecimal == "number" && value.toString().match(new RegExp("\\.[0-9]{" + (schema2.maxDecimal + 1) + ",}"))) {
                addError("may only have " + schema2.maxDecimal + " digits of decimal places");
              }
            }
          }
          return null;
        }
        function checkObj(instance2, objTypeDef, path4, additionalProp) {
          if (typeof objTypeDef == "object") {
            if (typeof instance2 != "object" || instance2 instanceof Array) {
              errors.push({ property: path4, message: "an object is required" });
            }
            for (var i in objTypeDef) {
              if (objTypeDef.hasOwnProperty(i) && i != "__proto__" && i != "constructor") {
                var value = instance2.hasOwnProperty(i) ? instance2[i] : void 0;
                if (value === void 0 && options.existingOnly)
                  continue;
                var propDef = objTypeDef[i];
                if (value === void 0 && propDef["default"]) {
                  value = instance2[i] = propDef["default"];
                }
                if (options.coerce && i in instance2) {
                  value = instance2[i] = options.coerce(value, propDef);
                }
                checkProp(value, propDef, path4, i);
              }
            }
          }
          for (i in instance2) {
            if (instance2.hasOwnProperty(i) && !(i.charAt(0) == "_" && i.charAt(1) == "_") && objTypeDef && !objTypeDef[i] && additionalProp === false) {
              if (options.filter) {
                delete instance2[i];
                continue;
              } else {
                errors.push({ property: path4, message: "The property " + i + " is not defined in the schema and the schema does not allow additional properties" });
              }
            }
            var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;
            if (requires && !(requires in instance2)) {
              errors.push({ property: path4, message: "the presence of the property " + i + " requires that " + requires + " also be present" });
            }
            value = instance2[i];
            if (additionalProp && (!(objTypeDef && typeof objTypeDef == "object") || !(i in objTypeDef))) {
              if (options.coerce) {
                value = instance2[i] = options.coerce(value, additionalProp);
              }
              checkProp(value, additionalProp, path4, i);
            }
            if (!_changing && value && value.$schema) {
              errors = errors.concat(checkProp(value, value.$schema, path4, i));
            }
          }
          return errors;
        }
        if (schema) {
          checkProp(instance, schema, "", _changing || "");
        }
        if (!_changing && instance && instance.$schema) {
          checkProp(instance, instance.$schema, "", "");
        }
        return { valid: !errors.length, errors };
      };
      exports3.mustBeValid = function(result) {
        if (!result.valid) {
          throw new TypeError(result.errors.map(function(error) {
            return "for property " + error.property + ": " + error.message;
          }).join(", \n"));
        }
      };
      return exports3;
    });
  }
});

// node_modules/jsprim/lib/jsprim.js
var require_jsprim = __commonJS({
  "node_modules/jsprim/lib/jsprim.js"(exports2) {
    var mod_assert = require_assert();
    var mod_util = require("util");
    var mod_extsprintf = require_extsprintf();
    var mod_verror = require_verror();
    var mod_jsonschema = require_validate();
    exports2.deepCopy = deepCopy;
    exports2.deepEqual = deepEqual;
    exports2.isEmpty = isEmpty;
    exports2.hasKey = hasKey;
    exports2.forEachKey = forEachKey;
    exports2.pluck = pluck;
    exports2.flattenObject = flattenObject;
    exports2.flattenIter = flattenIter;
    exports2.validateJsonObject = validateJsonObjectJS;
    exports2.validateJsonObjectJS = validateJsonObjectJS;
    exports2.randElt = randElt;
    exports2.extraProperties = extraProperties;
    exports2.mergeObjects = mergeObjects;
    exports2.startsWith = startsWith;
    exports2.endsWith = endsWith;
    exports2.parseInteger = parseInteger;
    exports2.iso8601 = iso8601;
    exports2.rfc1123 = rfc1123;
    exports2.parseDateTime = parseDateTime;
    exports2.hrtimediff = hrtimeDiff;
    exports2.hrtimeDiff = hrtimeDiff;
    exports2.hrtimeAccum = hrtimeAccum;
    exports2.hrtimeAdd = hrtimeAdd;
    exports2.hrtimeNanosec = hrtimeNanosec;
    exports2.hrtimeMicrosec = hrtimeMicrosec;
    exports2.hrtimeMillisec = hrtimeMillisec;
    function deepCopy(obj2) {
      var ret2, key;
      var marker = "__deepCopy";
      if (obj2 && obj2[marker])
        throw new Error("attempted deep copy of cyclic object");
      if (obj2 && obj2.constructor == Object) {
        ret2 = {};
        obj2[marker] = true;
        for (key in obj2) {
          if (key == marker)
            continue;
          ret2[key] = deepCopy(obj2[key]);
        }
        delete obj2[marker];
        return ret2;
      }
      if (obj2 && obj2.constructor == Array) {
        ret2 = [];
        obj2[marker] = true;
        for (key = 0; key < obj2.length; key++)
          ret2.push(deepCopy(obj2[key]));
        delete obj2[marker];
        return ret2;
      }
      return obj2;
    }
    function deepEqual(obj1, obj2) {
      if (typeof obj1 != typeof obj2)
        return false;
      if (obj1 === null || obj2 === null || typeof obj1 != "object")
        return obj1 === obj2;
      if (obj1.constructor != obj2.constructor)
        return false;
      var k;
      for (k in obj1) {
        if (!(k in obj2))
          return false;
        if (!deepEqual(obj1[k], obj2[k]))
          return false;
      }
      for (k in obj2) {
        if (!(k in obj1))
          return false;
      }
      return true;
    }
    function isEmpty(obj2) {
      var key;
      for (key in obj2)
        return false;
      return true;
    }
    function hasKey(obj2, key) {
      mod_assert.equal(typeof key, "string");
      return Object.prototype.hasOwnProperty.call(obj2, key);
    }
    function forEachKey(obj2, callback) {
      for (var key in obj2) {
        if (hasKey(obj2, key)) {
          callback(key, obj2[key]);
        }
      }
    }
    function pluck(obj2, key) {
      mod_assert.equal(typeof key, "string");
      return pluckv(obj2, key);
    }
    function pluckv(obj2, key) {
      if (obj2 === null || typeof obj2 !== "object")
        return void 0;
      if (obj2.hasOwnProperty(key))
        return obj2[key];
      var i = key.indexOf(".");
      if (i == -1)
        return void 0;
      var key1 = key.substr(0, i);
      if (!obj2.hasOwnProperty(key1))
        return void 0;
      return pluckv(obj2[key1], key.substr(i + 1));
    }
    function flattenIter(data, depth, callback) {
      doFlattenIter(data, depth, [], callback);
    }
    function doFlattenIter(data, depth, accum, callback) {
      var each;
      var key;
      if (depth === 0) {
        each = accum.slice(0);
        each.push(data);
        callback(each);
        return;
      }
      mod_assert.ok(data !== null);
      mod_assert.equal(typeof data, "object");
      mod_assert.equal(typeof depth, "number");
      mod_assert.ok(depth >= 0);
      for (key in data) {
        each = accum.slice(0);
        each.push(key);
        doFlattenIter(data[key], depth - 1, each, callback);
      }
    }
    function flattenObject(data, depth) {
      if (depth === 0)
        return [data];
      mod_assert.ok(data !== null);
      mod_assert.equal(typeof data, "object");
      mod_assert.equal(typeof depth, "number");
      mod_assert.ok(depth >= 0);
      var rv = [];
      var key;
      for (key in data) {
        flattenObject(data[key], depth - 1).forEach(function(p) {
          rv.push([key].concat(p));
        });
      }
      return rv;
    }
    function startsWith(str, prefix) {
      return str.substr(0, prefix.length) == prefix;
    }
    function endsWith(str, suffix) {
      return str.substr(
        str.length - suffix.length,
        suffix.length
      ) == suffix;
    }
    function iso8601(d) {
      if (typeof d == "number")
        d = new Date(d);
      mod_assert.ok(d.constructor === Date);
      return mod_extsprintf.sprintf(
        "%4d-%02d-%02dT%02d:%02d:%02d.%03dZ",
        d.getUTCFullYear(),
        d.getUTCMonth() + 1,
        d.getUTCDate(),
        d.getUTCHours(),
        d.getUTCMinutes(),
        d.getUTCSeconds(),
        d.getUTCMilliseconds()
      );
    }
    var RFC1123_MONTHS = [
      "Jan",
      "Feb",
      "Mar",
      "Apr",
      "May",
      "Jun",
      "Jul",
      "Aug",
      "Sep",
      "Oct",
      "Nov",
      "Dec"
    ];
    var RFC1123_DAYS = [
      "Sun",
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri",
      "Sat"
    ];
    function rfc1123(date) {
      return mod_extsprintf.sprintf(
        "%s, %02d %s %04d %02d:%02d:%02d GMT",
        RFC1123_DAYS[date.getUTCDay()],
        date.getUTCDate(),
        RFC1123_MONTHS[date.getUTCMonth()],
        date.getUTCFullYear(),
        date.getUTCHours(),
        date.getUTCMinutes(),
        date.getUTCSeconds()
      );
    }
    function parseDateTime(str) {
      var numeric = +str;
      if (!isNaN(numeric)) {
        return new Date(numeric);
      } else {
        return new Date(str);
      }
    }
    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
    var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
    var PI_DEFAULTS = {
      base: 10,
      allowSign: true,
      allowPrefix: false,
      allowTrailing: false,
      allowImprecise: false,
      trimWhitespace: false,
      leadingZeroIsOctal: false
    };
    var CP_0 = 48;
    var CP_9 = 57;
    var CP_A = 65;
    var CP_B = 66;
    var CP_O = 79;
    var CP_T = 84;
    var CP_X = 88;
    var CP_Z = 90;
    var CP_a = 97;
    var CP_b = 98;
    var CP_o = 111;
    var CP_t = 116;
    var CP_x = 120;
    var CP_z = 122;
    var PI_CONV_DEC = 48;
    var PI_CONV_UC = 55;
    var PI_CONV_LC = 87;
    function parseInteger(str, uopts) {
      mod_assert.string(str, "str");
      mod_assert.optionalObject(uopts, "options");
      var baseOverride = false;
      var options = PI_DEFAULTS;
      if (uopts) {
        baseOverride = hasKey(uopts, "base");
        options = mergeObjects(options, uopts);
        mod_assert.number(options.base, "options.base");
        mod_assert.ok(options.base >= 2, "options.base >= 2");
        mod_assert.ok(options.base <= 36, "options.base <= 36");
        mod_assert.bool(options.allowSign, "options.allowSign");
        mod_assert.bool(options.allowPrefix, "options.allowPrefix");
        mod_assert.bool(
          options.allowTrailing,
          "options.allowTrailing"
        );
        mod_assert.bool(
          options.allowImprecise,
          "options.allowImprecise"
        );
        mod_assert.bool(
          options.trimWhitespace,
          "options.trimWhitespace"
        );
        mod_assert.bool(
          options.leadingZeroIsOctal,
          "options.leadingZeroIsOctal"
        );
        if (options.leadingZeroIsOctal) {
          mod_assert.ok(
            !baseOverride,
            '"base" and "leadingZeroIsOctal" are mutually exclusive'
          );
        }
      }
      var c;
      var pbase = -1;
      var base = options.base;
      var start2;
      var mult = 1;
      var value = 0;
      var idx = 0;
      var len = str.length;
      if (options.trimWhitespace) {
        while (idx < len && isSpace(str.charCodeAt(idx))) {
          ++idx;
        }
      }
      if (options.allowSign) {
        if (str[idx] === "-") {
          idx += 1;
          mult = -1;
        } else if (str[idx] === "+") {
          idx += 1;
        }
      }
      if (str[idx] === "0") {
        if (options.allowPrefix) {
          pbase = prefixToBase(str.charCodeAt(idx + 1));
          if (pbase !== -1 && (!baseOverride || pbase === base)) {
            base = pbase;
            idx += 2;
          }
        }
        if (pbase === -1 && options.leadingZeroIsOctal) {
          base = 8;
        }
      }
      for (start2 = idx; idx < len; ++idx) {
        c = translateDigit(str.charCodeAt(idx));
        if (c !== -1 && c < base) {
          value *= base;
          value += c;
        } else {
          break;
        }
      }
      if (start2 === idx) {
        return new Error("invalid number: " + JSON.stringify(str));
      }
      if (options.trimWhitespace) {
        while (idx < len && isSpace(str.charCodeAt(idx))) {
          ++idx;
        }
      }
      if (idx < len && !options.allowTrailing) {
        return new Error("trailing characters after number: " + JSON.stringify(str.slice(idx)));
      }
      if (value === 0) {
        return 0;
      }
      var result = value * mult;
      if (!options.allowImprecise && (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {
        return new Error("number is outside of the supported range: " + JSON.stringify(str.slice(start2, idx)));
      }
      return result;
    }
    function translateDigit(d) {
      if (d >= CP_0 && d <= CP_9) {
        return d - PI_CONV_DEC;
      } else if (d >= CP_A && d <= CP_Z) {
        return d - PI_CONV_UC;
      } else if (d >= CP_a && d <= CP_z) {
        return d - PI_CONV_LC;
      } else {
        return -1;
      }
    }
    function isSpace(c) {
      return c === 32 || c >= 9 && c <= 13 || c === 160 || c === 5760 || c === 6158 || c >= 8192 && c <= 8202 || c === 8232 || c === 8233 || c === 8239 || c === 8287 || c === 12288 || c === 65279;
    }
    function prefixToBase(c) {
      if (c === CP_b || c === CP_B) {
        return 2;
      } else if (c === CP_o || c === CP_O) {
        return 8;
      } else if (c === CP_t || c === CP_T) {
        return 10;
      } else if (c === CP_x || c === CP_X) {
        return 16;
      } else {
        return -1;
      }
    }
    function validateJsonObjectJS(schema, input) {
      var report = mod_jsonschema.validate(input, schema);
      if (report.errors.length === 0)
        return null;
      var error = report.errors[0];
      var propname = error["property"];
      var reason = error["message"].toLowerCase();
      var i, j;
      if ((i = reason.indexOf("the property ")) != -1 && (j = reason.indexOf(" is not defined in the schema and the schema does not allow additional properties")) != -1) {
        i += "the property ".length;
        if (propname === "")
          propname = reason.substr(i, j - i);
        else
          propname = propname + "." + reason.substr(i, j - i);
        reason = "unsupported property";
      }
      var rv = new mod_verror.VError('property "%s": %s', propname, reason);
      rv.jsv_details = error;
      return rv;
    }
    function randElt(arr) {
      mod_assert.ok(
        Array.isArray(arr) && arr.length > 0,
        "randElt argument must be a non-empty array"
      );
      return arr[Math.floor(Math.random() * arr.length)];
    }
    function assertHrtime(a) {
      mod_assert.ok(
        a[0] >= 0 && a[1] >= 0,
        "negative numbers not allowed in hrtimes"
      );
      mod_assert.ok(a[1] < 1e9, "nanoseconds column overflow");
    }
    function hrtimeDiff(a, b) {
      assertHrtime(a);
      assertHrtime(b);
      mod_assert.ok(
        a[0] > b[0] || a[0] == b[0] && a[1] >= b[1],
        "negative differences not allowed"
      );
      var rv = [a[0] - b[0], 0];
      if (a[1] >= b[1]) {
        rv[1] = a[1] - b[1];
      } else {
        rv[0]--;
        rv[1] = 1e9 - (b[1] - a[1]);
      }
      return rv;
    }
    function hrtimeNanosec(a) {
      assertHrtime(a);
      return Math.floor(a[0] * 1e9 + a[1]);
    }
    function hrtimeMicrosec(a) {
      assertHrtime(a);
      return Math.floor(a[0] * 1e6 + a[1] / 1e3);
    }
    function hrtimeMillisec(a) {
      assertHrtime(a);
      return Math.floor(a[0] * 1e3 + a[1] / 1e6);
    }
    function hrtimeAccum(a, b) {
      assertHrtime(a);
      assertHrtime(b);
      a[1] += b[1];
      if (a[1] >= 1e9) {
        a[0]++;
        a[1] -= 1e9;
      }
      a[0] += b[0];
      return a;
    }
    function hrtimeAdd(a, b) {
      assertHrtime(a);
      var rv = [a[0], a[1]];
      return hrtimeAccum(rv, b);
    }
    function extraProperties(obj2, allowed) {
      mod_assert.ok(
        typeof obj2 === "object" && obj2 !== null,
        "obj argument must be a non-null object"
      );
      mod_assert.ok(
        Array.isArray(allowed),
        "allowed argument must be an array of strings"
      );
      for (var i = 0; i < allowed.length; i++) {
        mod_assert.ok(
          typeof allowed[i] === "string",
          "allowed argument must be an array of strings"
        );
      }
      return Object.keys(obj2).filter(function(key) {
        return allowed.indexOf(key) === -1;
      });
    }
    function mergeObjects(provided, overrides, defaults) {
      var rv, k;
      rv = {};
      if (defaults) {
        for (k in defaults)
          rv[k] = defaults[k];
      }
      if (provided) {
        for (k in provided)
          rv[k] = provided[k];
      }
      if (overrides) {
        for (k in overrides)
          rv[k] = overrides[k];
      }
      return rv;
    }
  }
});

// node_modules/http-signature/lib/signer.js
var require_signer = __commonJS({
  "node_modules/http-signature/lib/signer.js"(exports2, module2) {
    var assert = require_assert();
    var crypto3 = require("crypto");
    var util = require("util");
    var sshpk = require_lib10();
    var jsprim = require_jsprim();
    var utils = require_utils7();
    var sprintf = require("util").format;
    var HASH_ALGOS = utils.HASH_ALGOS;
    var PK_ALGOS = utils.PK_ALGOS;
    var InvalidAlgorithmError = utils.InvalidAlgorithmError;
    var HttpSignatureError = utils.HttpSignatureError;
    var validateAlgorithm = utils.validateAlgorithm;
    var AUTHZ_PARAMS = [
      "keyId",
      "algorithm",
      "created",
      "expires",
      "opaque",
      "headers",
      "signature"
    ];
    function MissingHeaderError(message) {
      HttpSignatureError.call(this, message, MissingHeaderError);
    }
    util.inherits(MissingHeaderError, HttpSignatureError);
    function StrictParsingError(message) {
      HttpSignatureError.call(this, message, StrictParsingError);
    }
    util.inherits(StrictParsingError, HttpSignatureError);
    function FormatAuthz(prefix, params) {
      assert.string(prefix, "prefix");
      assert.object(params, "params");
      var authz = "";
      for (var i = 0; i < AUTHZ_PARAMS.length; i++) {
        var param = AUTHZ_PARAMS[i];
        var value = params[param];
        if (value === void 0)
          continue;
        if (typeof value === "number") {
          authz += prefix + sprintf("%s=%d", param, value);
        } else {
          assert.string(value, "params." + param);
          authz += prefix + sprintf('%s="%s"', param, value);
        }
        prefix = ",";
      }
      return authz;
    }
    function RequestSigner(options) {
      assert.object(options, "options");
      var alg = [];
      if (options.algorithm !== void 0) {
        assert.string(options.algorithm, "options.algorithm");
        alg = validateAlgorithm(options.algorithm);
      }
      this.rs_alg = alg;
      if (options.sign !== void 0) {
        assert.func(options.sign, "options.sign");
        this.rs_signFunc = options.sign;
      } else if (alg[0] === "hmac" && options.key !== void 0) {
        assert.string(options.keyId, "options.keyId");
        this.rs_keyId = options.keyId;
        if (typeof options.key !== "string" && !Buffer.isBuffer(options.key))
          throw new TypeError("options.key for HMAC must be a string or Buffer");
        this.rs_signer = crypto3.createHmac(alg[1].toUpperCase(), options.key);
        this.rs_signer.sign = function() {
          var digest = this.digest("base64");
          return {
            hashAlgorithm: alg[1],
            toString: function() {
              return digest;
            }
          };
        };
      } else if (options.key !== void 0) {
        var key = options.key;
        if (typeof key === "string" || Buffer.isBuffer(key))
          assert.optionalString(options.keyPassphrase, "options.keyPassphrase");
        key = sshpk.parsePrivateKey(key, "auto", {
          passphrase: options.keyPassphrase
        });
        assert.ok(
          sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
          "options.key must be a sshpk.PrivateKey"
        );
        this.rs_key = key;
        assert.string(options.keyId, "options.keyId");
        this.rs_keyId = options.keyId;
        if (!PK_ALGOS[key.type]) {
          throw new InvalidAlgorithmError(key.type.toUpperCase() + " type keys are not supported");
        }
        if (alg[0] !== void 0 && key.type !== alg[0]) {
          throw new InvalidAlgorithmError("options.key must be a " + alg[0].toUpperCase() + " key, was given a " + key.type.toUpperCase() + " key instead");
        }
        this.rs_signer = key.createSign(alg[1]);
      } else {
        throw new TypeError("options.sign (func) or options.key is required");
      }
      this.rs_headers = [];
      this.rs_lines = [];
    }
    RequestSigner.prototype.writeHeader = function(header, value) {
      assert.string(header, "header");
      header = header.toLowerCase();
      assert.string(value, "value");
      this.rs_headers.push(header);
      if (this.rs_signFunc) {
        this.rs_lines.push(header + ": " + value);
      } else {
        var line = header + ": " + value;
        if (this.rs_headers.length > 0)
          line = "\n" + line;
        this.rs_signer.update(line);
      }
      return value;
    };
    RequestSigner.prototype.writeDateHeader = function() {
      return this.writeHeader("date", jsprim.rfc1123(new Date()));
    };
    RequestSigner.prototype.writeTarget = function(method, path4) {
      assert.string(method, "method");
      assert.string(path4, "path");
      method = method.toLowerCase();
      this.writeHeader("(request-target)", method + " " + path4);
    };
    RequestSigner.prototype.sign = function(cb) {
      assert.func(cb, "callback");
      if (this.rs_headers.length < 1)
        throw new Error("At least one header must be signed");
      var alg, authz;
      if (this.rs_signFunc) {
        var data = this.rs_lines.join("\n");
        var self2 = this;
        this.rs_signFunc(data, function(err, sig) {
          if (err) {
            cb(err);
            return;
          }
          try {
            assert.object(sig, "signature");
            assert.string(sig.keyId, "signature.keyId");
            assert.string(sig.algorithm, "signature.algorithm");
            assert.string(sig.signature, "signature.signature");
            alg = validateAlgorithm(sig.algorithm);
            authz = FormatAuthz("Signature ", {
              keyId: sig.keyId,
              algorithm: sig.algorithm,
              headers: self2.rs_headers.join(" "),
              signature: sig.signature
            });
          } catch (e) {
            cb(e);
            return;
          }
          cb(null, authz);
        });
      } else {
        try {
          var sigObj = this.rs_signer.sign();
        } catch (e) {
          cb(e);
          return;
        }
        alg = (this.rs_alg[0] || this.rs_key.type) + "-" + sigObj.hashAlgorithm;
        var signature = sigObj.toString();
        authz = FormatAuthz("Signature ", {
          keyId: this.rs_keyId,
          algorithm: alg,
          headers: this.rs_headers.join(" "),
          signature
        });
        cb(null, authz);
      }
    };
    module2.exports = {
      /**
       * Identifies whether a given object is a request signer or not.
       *
       * @param {Object} object, the object to identify
       * @returns {Boolean}
       */
      isSigner: function(obj2) {
        if (typeof obj2 === "object" && obj2 instanceof RequestSigner)
          return true;
        return false;
      },
      /**
       * Creates a request signer, used to asynchronously build a signature
       * for a request (does not have to be an http.ClientRequest).
       *
       * @param {Object} options, either:
       *                   - {String} keyId
       *                   - {String|Buffer} key
       *                   - {String} algorithm (optional, required for HMAC)
       *                   - {String} keyPassphrase (optional, not for HMAC)
       *                 or:
       *                   - {Func} sign (data, cb)
       * @return {RequestSigner}
       */
      createSigner: function createSigner(options) {
        return new RequestSigner(options);
      },
      /**
       * Adds an 'Authorization' header to an http.ClientRequest object.
       *
       * Note that this API will add a Date header if it's not already set. Any
       * other headers in the options.headers array MUST be present, or this
       * will throw.
       *
       * You shouldn't need to check the return type; it's just there if you want
       * to be pedantic.
       *
       * The optional flag indicates whether parsing should use strict enforcement
       * of the version draft-cavage-http-signatures-04 of the spec or beyond.
       * The default is to be loose and support
       * older versions for compatibility.
       *
       * @param {Object} request an instance of http.ClientRequest.
       * @param {Object} options signing parameters object:
       *                   - {String} keyId required.
       *                   - {String} key required (either a PEM or HMAC key).
       *                   - {Array} headers optional; defaults to ['date'].
       *                   - {String} algorithm optional (unless key is HMAC);
       *                              default is the same as the sshpk default
       *                              signing algorithm for the type of key given
       *                   - {String} httpVersion optional; defaults to '1.1'.
       *                   - {Boolean} strict optional; defaults to 'false'.
       *                   - {int}    expiresIn optional; defaults to 60. The
       *                              seconds after which the signature should
       *                              expire;
       *                   - {String} keyPassphrase optional; The passphrase to
       *                              pass to sshpk to parse the privateKey.
       *                              This doesn't do anything if algorithm is
       *                              HMAC.
       * @return {Boolean} true if Authorization (and optionally Date) were added.
       * @throws {TypeError} on bad parameter types (input).
       * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with
       *                                 the given key.
       * @throws {sshpk.KeyParseError} if key was bad.
       * @throws {MissingHeaderError} if a header to be signed was specified but
       *                              was not present.
       */
      signRequest: function signRequest(request, options) {
        assert.object(request, "request");
        assert.object(options, "options");
        assert.optionalString(options.algorithm, "options.algorithm");
        assert.string(options.keyId, "options.keyId");
        assert.optionalString(options.opaque, "options.opaque");
        assert.optionalArrayOfString(options.headers, "options.headers");
        assert.optionalString(options.httpVersion, "options.httpVersion");
        assert.optionalNumber(options.expiresIn, "options.expiresIn");
        assert.optionalString(options.keyPassphrase, "options.keyPassphrase");
        if (!request.getHeader("Date"))
          request.setHeader("Date", jsprim.rfc1123(new Date()));
        var headers = ["date"];
        if (options.headers)
          headers = options.headers;
        if (!options.httpVersion)
          options.httpVersion = "1.1";
        var alg = [];
        if (options.algorithm) {
          options.algorithm = options.algorithm.toLowerCase();
          alg = validateAlgorithm(options.algorithm);
        }
        var key = options.key;
        if (alg[0] === "hmac") {
          if (typeof key !== "string" && !Buffer.isBuffer(key))
            throw new TypeError("options.key must be a string or Buffer");
        } else {
          if (typeof key === "string" || Buffer.isBuffer(key))
            key = sshpk.parsePrivateKey(options.key, "auto", {
              passphrase: options.keyPassphrase
            });
          assert.ok(
            sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
            "options.key must be a sshpk.PrivateKey"
          );
          if (!PK_ALGOS[key.type]) {
            throw new InvalidAlgorithmError(key.type.toUpperCase() + " type keys are not supported");
          }
          if (alg[0] === void 0) {
            alg[0] = key.type;
          } else if (key.type !== alg[0]) {
            throw new InvalidAlgorithmError("options.key must be a " + alg[0].toUpperCase() + " key, was given a " + key.type.toUpperCase() + " key instead");
          }
          if (alg[1] === void 0) {
            alg[1] = key.defaultHashAlgorithm();
          }
          options.algorithm = alg[0] + "-" + alg[1];
        }
        var params = {
          "keyId": options.keyId,
          "algorithm": options.algorithm
        };
        var i;
        var stringToSign = "";
        for (i = 0; i < headers.length; i++) {
          if (typeof headers[i] !== "string")
            throw new TypeError("options.headers must be an array of Strings");
          var h = headers[i].toLowerCase();
          if (h === "request-line") {
            if (!options.strict) {
              stringToSign += request.method + " " + request.path + " HTTP/" + options.httpVersion;
            } else {
              throw new StrictParsingError("request-line is not a valid header with strict parsing enabled.");
            }
          } else if (h === "(request-target)") {
            stringToSign += "(request-target): " + request.method.toLowerCase() + " " + request.path;
          } else if (h === "(keyid)") {
            stringToSign += "(keyid): " + options.keyId;
          } else if (h === "(algorithm)") {
            stringToSign += "(algorithm): " + options.algorithm;
          } else if (h === "(opaque)") {
            var opaque = options.opaque;
            if (opaque == void 0 || opaque === "") {
              throw new MissingHeaderError("options.opaque was not in the request");
            }
            stringToSign += "(opaque): " + opaque;
          } else if (h === "(created)") {
            var created = Math.floor(Date.now() / 1e3);
            params.created = created;
            stringToSign += "(created): " + created;
          } else if (h === "(expires)") {
            var expiresIn = options.expiresIn;
            if (expiresIn === void 0) {
              expiresIn = 60;
            }
            const expires = Math.floor(Date.now() / 1e3) + expiresIn;
            params.expires = expires;
            stringToSign += "(expires): " + expires;
          } else {
            var value = request.getHeader(h);
            if (value === void 0 || value === "") {
              throw new MissingHeaderError(h + " was not in the request");
            }
            stringToSign += h + ": " + value;
          }
          if (i + 1 < headers.length)
            stringToSign += "\n";
        }
        if (request.hasOwnProperty("_stringToSign")) {
          request._stringToSign = stringToSign;
        }
        var signature;
        if (alg[0] === "hmac") {
          var hmac = crypto3.createHmac(alg[1].toUpperCase(), key);
          hmac.update(stringToSign);
          signature = hmac.digest("base64");
        } else {
          var signer = key.createSign(alg[1]);
          signer.update(stringToSign);
          var sigObj = signer.sign();
          if (!HASH_ALGOS[sigObj.hashAlgorithm]) {
            throw new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() + " is not a supported hash algorithm");
          }
          assert.strictEqual(
            alg[1],
            sigObj.hashAlgorithm,
            "hash algorithm mismatch"
          );
          signature = sigObj.toString();
          assert.notStrictEqual(signature, "", "empty signature produced");
        }
        var authzHeaderName = options.authorizationHeaderName || "Authorization";
        var prefix = authzHeaderName.toLowerCase() === utils.HEADER.SIG ? "" : "Signature ";
        params.signature = signature;
        if (options.opaque)
          params.opaque = options.opaque;
        if (options.headers)
          params.headers = options.headers.join(" ");
        request.setHeader(authzHeaderName, FormatAuthz(prefix, params));
        return true;
      }
    };
  }
});

// node_modules/http-signature/lib/verify.js
var require_verify = __commonJS({
  "node_modules/http-signature/lib/verify.js"(exports2, module2) {
    var assert = require_assert();
    var crypto3 = require("crypto");
    var sshpk = require_lib10();
    var utils = require_utils7();
    var HASH_ALGOS = utils.HASH_ALGOS;
    var PK_ALGOS = utils.PK_ALGOS;
    var InvalidAlgorithmError = utils.InvalidAlgorithmError;
    var HttpSignatureError = utils.HttpSignatureError;
    var validateAlgorithm = utils.validateAlgorithm;
    module2.exports = {
      /**
       * Verify RSA/DSA signature against public key.  You are expected to pass in
       * an object that was returned from `parse()`.
       *
       * @param {Object} parsedSignature the object you got from `parse`.
       * @param {String} pubkey RSA/DSA private key PEM.
       * @return {Boolean} true if valid, false otherwise.
       * @throws {TypeError} if you pass in bad arguments.
       * @throws {InvalidAlgorithmError}
       */
      verifySignature: function verifySignature(parsedSignature, pubkey) {
        assert.object(parsedSignature, "parsedSignature");
        if (typeof pubkey === "string" || Buffer.isBuffer(pubkey))
          pubkey = sshpk.parseKey(pubkey);
        assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), "pubkey must be a sshpk.Key");
        var alg = validateAlgorithm(parsedSignature.algorithm);
        if (alg[0] === "hmac" || alg[0] !== pubkey.type)
          return false;
        var v = pubkey.createVerify(alg[1]);
        v.update(parsedSignature.signingString);
        return v.verify(parsedSignature.params.signature, "base64");
      },
      /**
       * Verify HMAC against shared secret.  You are expected to pass in an object
       * that was returned from `parse()`.
       *
       * @param {Object} parsedSignature the object you got from `parse`.
       * @param {String} or {Buffer} secret HMAC shared secret.
       * @return {Boolean} true if valid, false otherwise.
       * @throws {TypeError} if you pass in bad arguments.
       * @throws {InvalidAlgorithmError}
       */
      verifyHMAC: function verifyHMAC(parsedSignature, secret) {
        assert.object(parsedSignature, "parsedHMAC");
        assert(typeof secret === "string" || Buffer.isBuffer(secret));
        var alg = validateAlgorithm(parsedSignature.algorithm);
        if (alg[0] !== "hmac")
          return false;
        var hashAlg = alg[1].toUpperCase();
        var hmac = crypto3.createHmac(hashAlg, secret);
        hmac.update(parsedSignature.signingString);
        var h1 = crypto3.createHmac(hashAlg, secret);
        h1.update(hmac.digest());
        h1 = h1.digest();
        var h2 = crypto3.createHmac(hashAlg, secret);
        h2.update(new Buffer(parsedSignature.params.signature, "base64"));
        h2 = h2.digest();
        if (typeof h1 === "string")
          return h1 === h2;
        if (Buffer.isBuffer(h1) && !h1.equals)
          return h1.toString("binary") === h2.toString("binary");
        return h1.equals(h2);
      }
    };
  }
});

// node_modules/http-signature/lib/index.js
var require_lib11 = __commonJS({
  "node_modules/http-signature/lib/index.js"(exports2, module2) {
    var parser = require_parser();
    var signer = require_signer();
    var verify = require_verify();
    var utils = require_utils7();
    module2.exports = {
      parse: parser.parseRequest,
      parseRequest: parser.parseRequest,
      sign: signer.signRequest,
      signRequest: signer.signRequest,
      createSigner: signer.createSigner,
      isSigner: signer.isSigner,
      sshKeyToPEM: utils.sshKeyToPEM,
      sshKeyFingerprint: utils.fingerprint,
      pemToRsaSSHKey: utils.pemToRsaSSHKey,
      verify: verify.verifySignature,
      verifySignature: verify.verifySignature,
      verifyHMAC: verify.verifyHMAC
    };
  }
});

// node_modules/mime-db/db.json
var require_db = __commonJS({
  "node_modules/mime-db/db.json"(exports2, module2) {
    module2.exports = {
      "application/1d-interleaved-parityfec": {
        source: "iana"
      },
      "application/3gpdash-qoe-report+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/3gpp-ims+xml": {
        source: "iana",
        compressible: true
      },
      "application/3gpphal+json": {
        source: "iana",
        compressible: true
      },
      "application/3gpphalforms+json": {
        source: "iana",
        compressible: true
      },
      "application/a2l": {
        source: "iana"
      },
      "application/ace+cbor": {
        source: "iana"
      },
      "application/activemessage": {
        source: "iana"
      },
      "application/activity+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-costmap+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-costmapfilter+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-directory+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointcost+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointcostparams+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointprop+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointpropparams+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-error+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-networkmap+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-networkmapfilter+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-updatestreamcontrol+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-updatestreamparams+json": {
        source: "iana",
        compressible: true
      },
      "application/aml": {
        source: "iana"
      },
      "application/andrew-inset": {
        source: "iana",
        extensions: ["ez"]
      },
      "application/applefile": {
        source: "iana"
      },
      "application/applixware": {
        source: "apache",
        extensions: ["aw"]
      },
      "application/at+jwt": {
        source: "iana"
      },
      "application/atf": {
        source: "iana"
      },
      "application/atfx": {
        source: "iana"
      },
      "application/atom+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atom"]
      },
      "application/atomcat+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atomcat"]
      },
      "application/atomdeleted+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atomdeleted"]
      },
      "application/atomicmail": {
        source: "iana"
      },
      "application/atomsvc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atomsvc"]
      },
      "application/atsc-dwd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["dwd"]
      },
      "application/atsc-dynamic-event-message": {
        source: "iana"
      },
      "application/atsc-held+xml": {
        source: "iana",
        compressible: true,
        extensions: ["held"]
      },
      "application/atsc-rdt+json": {
        source: "iana",
        compressible: true
      },
      "application/atsc-rsat+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rsat"]
      },
      "application/atxml": {
        source: "iana"
      },
      "application/auth-policy+xml": {
        source: "iana",
        compressible: true
      },
      "application/bacnet-xdd+zip": {
        source: "iana",
        compressible: false
      },
      "application/batch-smtp": {
        source: "iana"
      },
      "application/bdoc": {
        compressible: false,
        extensions: ["bdoc"]
      },
      "application/beep+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/calendar+json": {
        source: "iana",
        compressible: true
      },
      "application/calendar+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xcs"]
      },
      "application/call-completion": {
        source: "iana"
      },
      "application/cals-1840": {
        source: "iana"
      },
      "application/captive+json": {
        source: "iana",
        compressible: true
      },
      "application/cbor": {
        source: "iana"
      },
      "application/cbor-seq": {
        source: "iana"
      },
      "application/cccex": {
        source: "iana"
      },
      "application/ccmp+xml": {
        source: "iana",
        compressible: true
      },
      "application/ccxml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ccxml"]
      },
      "application/cdfx+xml": {
        source: "iana",
        compressible: true,
        extensions: ["cdfx"]
      },
      "application/cdmi-capability": {
        source: "iana",
        extensions: ["cdmia"]
      },
      "application/cdmi-container": {
        source: "iana",
        extensions: ["cdmic"]
      },
      "application/cdmi-domain": {
        source: "iana",
        extensions: ["cdmid"]
      },
      "application/cdmi-object": {
        source: "iana",
        extensions: ["cdmio"]
      },
      "application/cdmi-queue": {
        source: "iana",
        extensions: ["cdmiq"]
      },
      "application/cdni": {
        source: "iana"
      },
      "application/cea": {
        source: "iana"
      },
      "application/cea-2018+xml": {
        source: "iana",
        compressible: true
      },
      "application/cellml+xml": {
        source: "iana",
        compressible: true
      },
      "application/cfw": {
        source: "iana"
      },
      "application/city+json": {
        source: "iana",
        compressible: true
      },
      "application/clr": {
        source: "iana"
      },
      "application/clue+xml": {
        source: "iana",
        compressible: true
      },
      "application/clue_info+xml": {
        source: "iana",
        compressible: true
      },
      "application/cms": {
        source: "iana"
      },
      "application/cnrp+xml": {
        source: "iana",
        compressible: true
      },
      "application/coap-group+json": {
        source: "iana",
        compressible: true
      },
      "application/coap-payload": {
        source: "iana"
      },
      "application/commonground": {
        source: "iana"
      },
      "application/conference-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/cose": {
        source: "iana"
      },
      "application/cose-key": {
        source: "iana"
      },
      "application/cose-key-set": {
        source: "iana"
      },
      "application/cpl+xml": {
        source: "iana",
        compressible: true,
        extensions: ["cpl"]
      },
      "application/csrattrs": {
        source: "iana"
      },
      "application/csta+xml": {
        source: "iana",
        compressible: true
      },
      "application/cstadata+xml": {
        source: "iana",
        compressible: true
      },
      "application/csvm+json": {
        source: "iana",
        compressible: true
      },
      "application/cu-seeme": {
        source: "apache",
        extensions: ["cu"]
      },
      "application/cwt": {
        source: "iana"
      },
      "application/cybercash": {
        source: "iana"
      },
      "application/dart": {
        compressible: true
      },
      "application/dash+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpd"]
      },
      "application/dash-patch+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpp"]
      },
      "application/dashdelta": {
        source: "iana"
      },
      "application/davmount+xml": {
        source: "iana",
        compressible: true,
        extensions: ["davmount"]
      },
      "application/dca-rft": {
        source: "iana"
      },
      "application/dcd": {
        source: "iana"
      },
      "application/dec-dx": {
        source: "iana"
      },
      "application/dialog-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/dicom": {
        source: "iana"
      },
      "application/dicom+json": {
        source: "iana",
        compressible: true
      },
      "application/dicom+xml": {
        source: "iana",
        compressible: true
      },
      "application/dii": {
        source: "iana"
      },
      "application/dit": {
        source: "iana"
      },
      "application/dns": {
        source: "iana"
      },
      "application/dns+json": {
        source: "iana",
        compressible: true
      },
      "application/dns-message": {
        source: "iana"
      },
      "application/docbook+xml": {
        source: "apache",
        compressible: true,
        extensions: ["dbk"]
      },
      "application/dots+cbor": {
        source: "iana"
      },
      "application/dskpp+xml": {
        source: "iana",
        compressible: true
      },
      "application/dssc+der": {
        source: "iana",
        extensions: ["dssc"]
      },
      "application/dssc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xdssc"]
      },
      "application/dvcs": {
        source: "iana"
      },
      "application/ecmascript": {
        source: "iana",
        compressible: true,
        extensions: ["es", "ecma"]
      },
      "application/edi-consent": {
        source: "iana"
      },
      "application/edi-x12": {
        source: "iana",
        compressible: false
      },
      "application/edifact": {
        source: "iana",
        compressible: false
      },
      "application/efi": {
        source: "iana"
      },
      "application/elm+json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/elm+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.cap+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/emergencycalldata.comment+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.control+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.deviceinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.ecall.msd": {
        source: "iana"
      },
      "application/emergencycalldata.providerinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.serviceinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.subscriberinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.veds+xml": {
        source: "iana",
        compressible: true
      },
      "application/emma+xml": {
        source: "iana",
        compressible: true,
        extensions: ["emma"]
      },
      "application/emotionml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["emotionml"]
      },
      "application/encaprtp": {
        source: "iana"
      },
      "application/epp+xml": {
        source: "iana",
        compressible: true
      },
      "application/epub+zip": {
        source: "iana",
        compressible: false,
        extensions: ["epub"]
      },
      "application/eshop": {
        source: "iana"
      },
      "application/exi": {
        source: "iana",
        extensions: ["exi"]
      },
      "application/expect-ct-report+json": {
        source: "iana",
        compressible: true
      },
      "application/express": {
        source: "iana",
        extensions: ["exp"]
      },
      "application/fastinfoset": {
        source: "iana"
      },
      "application/fastsoap": {
        source: "iana"
      },
      "application/fdt+xml": {
        source: "iana",
        compressible: true,
        extensions: ["fdt"]
      },
      "application/fhir+json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/fhir+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/fido.trusted-apps+json": {
        compressible: true
      },
      "application/fits": {
        source: "iana"
      },
      "application/flexfec": {
        source: "iana"
      },
      "application/font-sfnt": {
        source: "iana"
      },
      "application/font-tdpfr": {
        source: "iana",
        extensions: ["pfr"]
      },
      "application/font-woff": {
        source: "iana",
        compressible: false
      },
      "application/framework-attributes+xml": {
        source: "iana",
        compressible: true
      },
      "application/geo+json": {
        source: "iana",
        compressible: true,
        extensions: ["geojson"]
      },
      "application/geo+json-seq": {
        source: "iana"
      },
      "application/geopackage+sqlite3": {
        source: "iana"
      },
      "application/geoxacml+xml": {
        source: "iana",
        compressible: true
      },
      "application/gltf-buffer": {
        source: "iana"
      },
      "application/gml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["gml"]
      },
      "application/gpx+xml": {
        source: "apache",
        compressible: true,
        extensions: ["gpx"]
      },
      "application/gxf": {
        source: "apache",
        extensions: ["gxf"]
      },
      "application/gzip": {
        source: "iana",
        compressible: false,
        extensions: ["gz"]
      },
      "application/h224": {
        source: "iana"
      },
      "application/held+xml": {
        source: "iana",
        compressible: true
      },
      "application/hjson": {
        extensions: ["hjson"]
      },
      "application/http": {
        source: "iana"
      },
      "application/hyperstudio": {
        source: "iana",
        extensions: ["stk"]
      },
      "application/ibe-key-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/ibe-pkg-reply+xml": {
        source: "iana",
        compressible: true
      },
      "application/ibe-pp-data": {
        source: "iana"
      },
      "application/iges": {
        source: "iana"
      },
      "application/im-iscomposing+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/index": {
        source: "iana"
      },
      "application/index.cmd": {
        source: "iana"
      },
      "application/index.obj": {
        source: "iana"
      },
      "application/index.response": {
        source: "iana"
      },
      "application/index.vnd": {
        source: "iana"
      },
      "application/inkml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ink", "inkml"]
      },
      "application/iotp": {
        source: "iana"
      },
      "application/ipfix": {
        source: "iana",
        extensions: ["ipfix"]
      },
      "application/ipp": {
        source: "iana"
      },
      "application/isup": {
        source: "iana"
      },
      "application/its+xml": {
        source: "iana",
        compressible: true,
        extensions: ["its"]
      },
      "application/java-archive": {
        source: "apache",
        compressible: false,
        extensions: ["jar", "war", "ear"]
      },
      "application/java-serialized-object": {
        source: "apache",
        compressible: false,
        extensions: ["ser"]
      },
      "application/java-vm": {
        source: "apache",
        compressible: false,
        extensions: ["class"]
      },
      "application/javascript": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["js", "mjs"]
      },
      "application/jf2feed+json": {
        source: "iana",
        compressible: true
      },
      "application/jose": {
        source: "iana"
      },
      "application/jose+json": {
        source: "iana",
        compressible: true
      },
      "application/jrd+json": {
        source: "iana",
        compressible: true
      },
      "application/jscalendar+json": {
        source: "iana",
        compressible: true
      },
      "application/json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["json", "map"]
      },
      "application/json-patch+json": {
        source: "iana",
        compressible: true
      },
      "application/json-seq": {
        source: "iana"
      },
      "application/json5": {
        extensions: ["json5"]
      },
      "application/jsonml+json": {
        source: "apache",
        compressible: true,
        extensions: ["jsonml"]
      },
      "application/jwk+json": {
        source: "iana",
        compressible: true
      },
      "application/jwk-set+json": {
        source: "iana",
        compressible: true
      },
      "application/jwt": {
        source: "iana"
      },
      "application/kpml-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/kpml-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/ld+json": {
        source: "iana",
        compressible: true,
        extensions: ["jsonld"]
      },
      "application/lgr+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lgr"]
      },
      "application/link-format": {
        source: "iana"
      },
      "application/load-control+xml": {
        source: "iana",
        compressible: true
      },
      "application/lost+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lostxml"]
      },
      "application/lostsync+xml": {
        source: "iana",
        compressible: true
      },
      "application/lpf+zip": {
        source: "iana",
        compressible: false
      },
      "application/lxf": {
        source: "iana"
      },
      "application/mac-binhex40": {
        source: "iana",
        extensions: ["hqx"]
      },
      "application/mac-compactpro": {
        source: "apache",
        extensions: ["cpt"]
      },
      "application/macwriteii": {
        source: "iana"
      },
      "application/mads+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mads"]
      },
      "application/manifest+json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["webmanifest"]
      },
      "application/marc": {
        source: "iana",
        extensions: ["mrc"]
      },
      "application/marcxml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mrcx"]
      },
      "application/mathematica": {
        source: "iana",
        extensions: ["ma", "nb", "mb"]
      },
      "application/mathml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mathml"]
      },
      "application/mathml-content+xml": {
        source: "iana",
        compressible: true
      },
      "application/mathml-presentation+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-associated-procedure-description+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-deregister+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-envelope+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-msk+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-msk-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-protection-description+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-reception-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-register+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-register-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-schedule+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-user-service-description+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbox": {
        source: "iana",
        extensions: ["mbox"]
      },
      "application/media-policy-dataset+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpf"]
      },
      "application/media_control+xml": {
        source: "iana",
        compressible: true
      },
      "application/mediaservercontrol+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mscml"]
      },
      "application/merge-patch+json": {
        source: "iana",
        compressible: true
      },
      "application/metalink+xml": {
        source: "apache",
        compressible: true,
        extensions: ["metalink"]
      },
      "application/metalink4+xml": {
        source: "iana",
        compressible: true,
        extensions: ["meta4"]
      },
      "application/mets+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mets"]
      },
      "application/mf4": {
        source: "iana"
      },
      "application/mikey": {
        source: "iana"
      },
      "application/mipc": {
        source: "iana"
      },
      "application/missing-blocks+cbor-seq": {
        source: "iana"
      },
      "application/mmt-aei+xml": {
        source: "iana",
        compressible: true,
        extensions: ["maei"]
      },
      "application/mmt-usd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["musd"]
      },
      "application/mods+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mods"]
      },
      "application/moss-keys": {
        source: "iana"
      },
      "application/moss-signature": {
        source: "iana"
      },
      "application/mosskey-data": {
        source: "iana"
      },
      "application/mosskey-request": {
        source: "iana"
      },
      "application/mp21": {
        source: "iana",
        extensions: ["m21", "mp21"]
      },
      "application/mp4": {
        source: "iana",
        extensions: ["mp4s", "m4p"]
      },
      "application/mpeg4-generic": {
        source: "iana"
      },
      "application/mpeg4-iod": {
        source: "iana"
      },
      "application/mpeg4-iod-xmt": {
        source: "iana"
      },
      "application/mrb-consumer+xml": {
        source: "iana",
        compressible: true
      },
      "application/mrb-publish+xml": {
        source: "iana",
        compressible: true
      },
      "application/msc-ivr+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/msc-mixer+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/msword": {
        source: "iana",
        compressible: false,
        extensions: ["doc", "dot"]
      },
      "application/mud+json": {
        source: "iana",
        compressible: true
      },
      "application/multipart-core": {
        source: "iana"
      },
      "application/mxf": {
        source: "iana",
        extensions: ["mxf"]
      },
      "application/n-quads": {
        source: "iana",
        extensions: ["nq"]
      },
      "application/n-triples": {
        source: "iana",
        extensions: ["nt"]
      },
      "application/nasdata": {
        source: "iana"
      },
      "application/news-checkgroups": {
        source: "iana",
        charset: "US-ASCII"
      },
      "application/news-groupinfo": {
        source: "iana",
        charset: "US-ASCII"
      },
      "application/news-transmission": {
        source: "iana"
      },
      "application/nlsml+xml": {
        source: "iana",
        compressible: true
      },
      "application/node": {
        source: "iana",
        extensions: ["cjs"]
      },
      "application/nss": {
        source: "iana"
      },
      "application/oauth-authz-req+jwt": {
        source: "iana"
      },
      "application/oblivious-dns-message": {
        source: "iana"
      },
      "application/ocsp-request": {
        source: "iana"
      },
      "application/ocsp-response": {
        source: "iana"
      },
      "application/octet-stream": {
        source: "iana",
        compressible: false,
        extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"]
      },
      "application/oda": {
        source: "iana",
        extensions: ["oda"]
      },
      "application/odm+xml": {
        source: "iana",
        compressible: true
      },
      "application/odx": {
        source: "iana"
      },
      "application/oebps-package+xml": {
        source: "iana",
        compressible: true,
        extensions: ["opf"]
      },
      "application/ogg": {
        source: "iana",
        compressible: false,
        extensions: ["ogx"]
      },
      "application/omdoc+xml": {
        source: "apache",
        compressible: true,
        extensions: ["omdoc"]
      },
      "application/onenote": {
        source: "apache",
        extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"]
      },
      "application/opc-nodeset+xml": {
        source: "iana",
        compressible: true
      },
      "application/oscore": {
        source: "iana"
      },
      "application/oxps": {
        source: "iana",
        extensions: ["oxps"]
      },
      "application/p21": {
        source: "iana"
      },
      "application/p21+zip": {
        source: "iana",
        compressible: false
      },
      "application/p2p-overlay+xml": {
        source: "iana",
        compressible: true,
        extensions: ["relo"]
      },
      "application/parityfec": {
        source: "iana"
      },
      "application/passport": {
        source: "iana"
      },
      "application/patch-ops-error+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xer"]
      },
      "application/pdf": {
        source: "iana",
        compressible: false,
        extensions: ["pdf"]
      },
      "application/pdx": {
        source: "iana"
      },
      "application/pem-certificate-chain": {
        source: "iana"
      },
      "application/pgp-encrypted": {
        source: "iana",
        compressible: false,
        extensions: ["pgp"]
      },
      "application/pgp-keys": {
        source: "iana",
        extensions: ["asc"]
      },
      "application/pgp-signature": {
        source: "iana",
        extensions: ["asc", "sig"]
      },
      "application/pics-rules": {
        source: "apache",
        extensions: ["prf"]
      },
      "application/pidf+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/pidf-diff+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/pkcs10": {
        source: "iana",
        extensions: ["p10"]
      },
      "application/pkcs12": {
        source: "iana"
      },
      "application/pkcs7-mime": {
        source: "iana",
        extensions: ["p7m", "p7c"]
      },
      "application/pkcs7-signature": {
        source: "iana",
        extensions: ["p7s"]
      },
      "application/pkcs8": {
        source: "iana",
        extensions: ["p8"]
      },
      "application/pkcs8-encrypted": {
        source: "iana"
      },
      "application/pkix-attr-cert": {
        source: "iana",
        extensions: ["ac"]
      },
      "application/pkix-cert": {
        source: "iana",
        extensions: ["cer"]
      },
      "application/pkix-crl": {
        source: "iana",
        extensions: ["crl"]
      },
      "application/pkix-pkipath": {
        source: "iana",
        extensions: ["pkipath"]
      },
      "application/pkixcmp": {
        source: "iana",
        extensions: ["pki"]
      },
      "application/pls+xml": {
        source: "iana",
        compressible: true,
        extensions: ["pls"]
      },
      "application/poc-settings+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/postscript": {
        source: "iana",
        compressible: true,
        extensions: ["ai", "eps", "ps"]
      },
      "application/ppsp-tracker+json": {
        source: "iana",
        compressible: true
      },
      "application/problem+json": {
        source: "iana",
        compressible: true
      },
      "application/problem+xml": {
        source: "iana",
        compressible: true
      },
      "application/provenance+xml": {
        source: "iana",
        compressible: true,
        extensions: ["provx"]
      },
      "application/prs.alvestrand.titrax-sheet": {
        source: "iana"
      },
      "application/prs.cww": {
        source: "iana",
        extensions: ["cww"]
      },
      "application/prs.cyn": {
        source: "iana",
        charset: "7-BIT"
      },
      "application/prs.hpub+zip": {
        source: "iana",
        compressible: false
      },
      "application/prs.nprend": {
        source: "iana"
      },
      "application/prs.plucker": {
        source: "iana"
      },
      "application/prs.rdf-xml-crypt": {
        source: "iana"
      },
      "application/prs.xsf+xml": {
        source: "iana",
        compressible: true
      },
      "application/pskc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["pskcxml"]
      },
      "application/pvd+json": {
        source: "iana",
        compressible: true
      },
      "application/qsig": {
        source: "iana"
      },
      "application/raml+yaml": {
        compressible: true,
        extensions: ["raml"]
      },
      "application/raptorfec": {
        source: "iana"
      },
      "application/rdap+json": {
        source: "iana",
        compressible: true
      },
      "application/rdf+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rdf", "owl"]
      },
      "application/reginfo+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rif"]
      },
      "application/relax-ng-compact-syntax": {
        source: "iana",
        extensions: ["rnc"]
      },
      "application/remote-printing": {
        source: "iana"
      },
      "application/reputon+json": {
        source: "iana",
        compressible: true
      },
      "application/resource-lists+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rl"]
      },
      "application/resource-lists-diff+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rld"]
      },
      "application/rfc+xml": {
        source: "iana",
        compressible: true
      },
      "application/riscos": {
        source: "iana"
      },
      "application/rlmi+xml": {
        source: "iana",
        compressible: true
      },
      "application/rls-services+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rs"]
      },
      "application/route-apd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rapd"]
      },
      "application/route-s-tsid+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sls"]
      },
      "application/route-usd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rusd"]
      },
      "application/rpki-ghostbusters": {
        source: "iana",
        extensions: ["gbr"]
      },
      "application/rpki-manifest": {
        source: "iana",
        extensions: ["mft"]
      },
      "application/rpki-publication": {
        source: "iana"
      },
      "application/rpki-roa": {
        source: "iana",
        extensions: ["roa"]
      },
      "application/rpki-updown": {
        source: "iana"
      },
      "application/rsd+xml": {
        source: "apache",
        compressible: true,
        extensions: ["rsd"]
      },
      "application/rss+xml": {
        source: "apache",
        compressible: true,
        extensions: ["rss"]
      },
      "application/rtf": {
        source: "iana",
        compressible: true,
        extensions: ["rtf"]
      },
      "application/rtploopback": {
        source: "iana"
      },
      "application/rtx": {
        source: "iana"
      },
      "application/samlassertion+xml": {
        source: "iana",
        compressible: true
      },
      "application/samlmetadata+xml": {
        source: "iana",
        compressible: true
      },
      "application/sarif+json": {
        source: "iana",
        compressible: true
      },
      "application/sarif-external-properties+json": {
        source: "iana",
        compressible: true
      },
      "application/sbe": {
        source: "iana"
      },
      "application/sbml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sbml"]
      },
      "application/scaip+xml": {
        source: "iana",
        compressible: true
      },
      "application/scim+json": {
        source: "iana",
        compressible: true
      },
      "application/scvp-cv-request": {
        source: "iana",
        extensions: ["scq"]
      },
      "application/scvp-cv-response": {
        source: "iana",
        extensions: ["scs"]
      },
      "application/scvp-vp-request": {
        source: "iana",
        extensions: ["spq"]
      },
      "application/scvp-vp-response": {
        source: "iana",
        extensions: ["spp"]
      },
      "application/sdp": {
        source: "iana",
        extensions: ["sdp"]
      },
      "application/secevent+jwt": {
        source: "iana"
      },
      "application/senml+cbor": {
        source: "iana"
      },
      "application/senml+json": {
        source: "iana",
        compressible: true
      },
      "application/senml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["senmlx"]
      },
      "application/senml-etch+cbor": {
        source: "iana"
      },
      "application/senml-etch+json": {
        source: "iana",
        compressible: true
      },
      "application/senml-exi": {
        source: "iana"
      },
      "application/sensml+cbor": {
        source: "iana"
      },
      "application/sensml+json": {
        source: "iana",
        compressible: true
      },
      "application/sensml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sensmlx"]
      },
      "application/sensml-exi": {
        source: "iana"
      },
      "application/sep+xml": {
        source: "iana",
        compressible: true
      },
      "application/sep-exi": {
        source: "iana"
      },
      "application/session-info": {
        source: "iana"
      },
      "application/set-payment": {
        source: "iana"
      },
      "application/set-payment-initiation": {
        source: "iana",
        extensions: ["setpay"]
      },
      "application/set-registration": {
        source: "iana"
      },
      "application/set-registration-initiation": {
        source: "iana",
        extensions: ["setreg"]
      },
      "application/sgml": {
        source: "iana"
      },
      "application/sgml-open-catalog": {
        source: "iana"
      },
      "application/shf+xml": {
        source: "iana",
        compressible: true,
        extensions: ["shf"]
      },
      "application/sieve": {
        source: "iana",
        extensions: ["siv", "sieve"]
      },
      "application/simple-filter+xml": {
        source: "iana",
        compressible: true
      },
      "application/simple-message-summary": {
        source: "iana"
      },
      "application/simplesymbolcontainer": {
        source: "iana"
      },
      "application/sipc": {
        source: "iana"
      },
      "application/slate": {
        source: "iana"
      },
      "application/smil": {
        source: "iana"
      },
      "application/smil+xml": {
        source: "iana",
        compressible: true,
        extensions: ["smi", "smil"]
      },
      "application/smpte336m": {
        source: "iana"
      },
      "application/soap+fastinfoset": {
        source: "iana"
      },
      "application/soap+xml": {
        source: "iana",
        compressible: true
      },
      "application/sparql-query": {
        source: "iana",
        extensions: ["rq"]
      },
      "application/sparql-results+xml": {
        source: "iana",
        compressible: true,
        extensions: ["srx"]
      },
      "application/spdx+json": {
        source: "iana",
        compressible: true
      },
      "application/spirits-event+xml": {
        source: "iana",
        compressible: true
      },
      "application/sql": {
        source: "iana"
      },
      "application/srgs": {
        source: "iana",
        extensions: ["gram"]
      },
      "application/srgs+xml": {
        source: "iana",
        compressible: true,
        extensions: ["grxml"]
      },
      "application/sru+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sru"]
      },
      "application/ssdl+xml": {
        source: "apache",
        compressible: true,
        extensions: ["ssdl"]
      },
      "application/ssml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ssml"]
      },
      "application/stix+json": {
        source: "iana",
        compressible: true
      },
      "application/swid+xml": {
        source: "iana",
        compressible: true,
        extensions: ["swidtag"]
      },
      "application/tamp-apex-update": {
        source: "iana"
      },
      "application/tamp-apex-update-confirm": {
        source: "iana"
      },
      "application/tamp-community-update": {
        source: "iana"
      },
      "application/tamp-community-update-confirm": {
        source: "iana"
      },
      "application/tamp-error": {
        source: "iana"
      },
      "application/tamp-sequence-adjust": {
        source: "iana"
      },
      "application/tamp-sequence-adjust-confirm": {
        source: "iana"
      },
      "application/tamp-status-query": {
        source: "iana"
      },
      "application/tamp-status-response": {
        source: "iana"
      },
      "application/tamp-update": {
        source: "iana"
      },
      "application/tamp-update-confirm": {
        source: "iana"
      },
      "application/tar": {
        compressible: true
      },
      "application/taxii+json": {
        source: "iana",
        compressible: true
      },
      "application/td+json": {
        source: "iana",
        compressible: true
      },
      "application/tei+xml": {
        source: "iana",
        compressible: true,
        extensions: ["tei", "teicorpus"]
      },
      "application/tetra_isi": {
        source: "iana"
      },
      "application/thraud+xml": {
        source: "iana",
        compressible: true,
        extensions: ["tfi"]
      },
      "application/timestamp-query": {
        source: "iana"
      },
      "application/timestamp-reply": {
        source: "iana"
      },
      "application/timestamped-data": {
        source: "iana",
        extensions: ["tsd"]
      },
      "application/tlsrpt+gzip": {
        source: "iana"
      },
      "application/tlsrpt+json": {
        source: "iana",
        compressible: true
      },
      "application/tnauthlist": {
        source: "iana"
      },
      "application/token-introspection+jwt": {
        source: "iana"
      },
      "application/toml": {
        compressible: true,
        extensions: ["toml"]
      },
      "application/trickle-ice-sdpfrag": {
        source: "iana"
      },
      "application/trig": {
        source: "iana",
        extensions: ["trig"]
      },
      "application/ttml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ttml"]
      },
      "application/tve-trigger": {
        source: "iana"
      },
      "application/tzif": {
        source: "iana"
      },
      "application/tzif-leap": {
        source: "iana"
      },
      "application/ubjson": {
        compressible: false,
        extensions: ["ubj"]
      },
      "application/ulpfec": {
        source: "iana"
      },
      "application/urc-grpsheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/urc-ressheet+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rsheet"]
      },
      "application/urc-targetdesc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["td"]
      },
      "application/urc-uisocketdesc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vcard+json": {
        source: "iana",
        compressible: true
      },
      "application/vcard+xml": {
        source: "iana",
        compressible: true
      },
      "application/vemmi": {
        source: "iana"
      },
      "application/vividence.scriptfile": {
        source: "apache"
      },
      "application/vnd.1000minds.decision-model+xml": {
        source: "iana",
        compressible: true,
        extensions: ["1km"]
      },
      "application/vnd.3gpp-prose+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp-prose-pc3ch+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp-v2x-local-service-information": {
        source: "iana"
      },
      "application/vnd.3gpp.5gnas": {
        source: "iana"
      },
      "application/vnd.3gpp.access-transfer-events+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.bsf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.gmop+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.gtpc": {
        source: "iana"
      },
      "application/vnd.3gpp.interworking-data": {
        source: "iana"
      },
      "application/vnd.3gpp.lpp": {
        source: "iana"
      },
      "application/vnd.3gpp.mc-signalling-ear": {
        source: "iana"
      },
      "application/vnd.3gpp.mcdata-affiliation-command+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-payload": {
        source: "iana"
      },
      "application/vnd.3gpp.mcdata-service-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-signalling": {
        source: "iana"
      },
      "application/vnd.3gpp.mcdata-ue-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-user-profile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-affiliation-command+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-floor-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-location-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-mbms-usage-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-service-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-signed+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-ue-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-ue-init-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-user-profile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-affiliation-command+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-affiliation-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-location-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-service-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-transmission-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-ue-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-user-profile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mid-call+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.ngap": {
        source: "iana"
      },
      "application/vnd.3gpp.pfcp": {
        source: "iana"
      },
      "application/vnd.3gpp.pic-bw-large": {
        source: "iana",
        extensions: ["plb"]
      },
      "application/vnd.3gpp.pic-bw-small": {
        source: "iana",
        extensions: ["psb"]
      },
      "application/vnd.3gpp.pic-bw-var": {
        source: "iana",
        extensions: ["pvb"]
      },
      "application/vnd.3gpp.s1ap": {
        source: "iana"
      },
      "application/vnd.3gpp.sms": {
        source: "iana"
      },
      "application/vnd.3gpp.sms+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.srvcc-ext+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.srvcc-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.state-and-event-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.ussd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp2.bcmcsinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp2.sms": {
        source: "iana"
      },
      "application/vnd.3gpp2.tcap": {
        source: "iana",
        extensions: ["tcap"]
      },
      "application/vnd.3lightssoftware.imagescal": {
        source: "iana"
      },
      "application/vnd.3m.post-it-notes": {
        source: "iana",
        extensions: ["pwn"]
      },
      "application/vnd.accpac.simply.aso": {
        source: "iana",
        extensions: ["aso"]
      },
      "application/vnd.accpac.simply.imp": {
        source: "iana",
        extensions: ["imp"]
      },
      "application/vnd.acucobol": {
        source: "iana",
        extensions: ["acu"]
      },
      "application/vnd.acucorp": {
        source: "iana",
        extensions: ["atc", "acutc"]
      },
      "application/vnd.adobe.air-application-installer-package+zip": {
        source: "apache",
        compressible: false,
        extensions: ["air"]
      },
      "application/vnd.adobe.flash.movie": {
        source: "iana"
      },
      "application/vnd.adobe.formscentral.fcdt": {
        source: "iana",
        extensions: ["fcdt"]
      },
      "application/vnd.adobe.fxp": {
        source: "iana",
        extensions: ["fxp", "fxpl"]
      },
      "application/vnd.adobe.partial-upload": {
        source: "iana"
      },
      "application/vnd.adobe.xdp+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xdp"]
      },
      "application/vnd.adobe.xfdf": {
        source: "iana",
        extensions: ["xfdf"]
      },
      "application/vnd.aether.imp": {
        source: "iana"
      },
      "application/vnd.afpc.afplinedata": {
        source: "iana"
      },
      "application/vnd.afpc.afplinedata-pagedef": {
        source: "iana"
      },
      "application/vnd.afpc.cmoca-cmresource": {
        source: "iana"
      },
      "application/vnd.afpc.foca-charset": {
        source: "iana"
      },
      "application/vnd.afpc.foca-codedfont": {
        source: "iana"
      },
      "application/vnd.afpc.foca-codepage": {
        source: "iana"
      },
      "application/vnd.afpc.modca": {
        source: "iana"
      },
      "application/vnd.afpc.modca-cmtable": {
        source: "iana"
      },
      "application/vnd.afpc.modca-formdef": {
        source: "iana"
      },
      "application/vnd.afpc.modca-mediummap": {
        source: "iana"
      },
      "application/vnd.afpc.modca-objectcontainer": {
        source: "iana"
      },
      "application/vnd.afpc.modca-overlay": {
        source: "iana"
      },
      "application/vnd.afpc.modca-pagesegment": {
        source: "iana"
      },
      "application/vnd.age": {
        source: "iana",
        extensions: ["age"]
      },
      "application/vnd.ah-barcode": {
        source: "iana"
      },
      "application/vnd.ahead.space": {
        source: "iana",
        extensions: ["ahead"]
      },
      "application/vnd.airzip.filesecure.azf": {
        source: "iana",
        extensions: ["azf"]
      },
      "application/vnd.airzip.filesecure.azs": {
        source: "iana",
        extensions: ["azs"]
      },
      "application/vnd.amadeus+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.amazon.ebook": {
        source: "apache",
        extensions: ["azw"]
      },
      "application/vnd.amazon.mobi8-ebook": {
        source: "iana"
      },
      "application/vnd.americandynamics.acc": {
        source: "iana",
        extensions: ["acc"]
      },
      "application/vnd.amiga.ami": {
        source: "iana",
        extensions: ["ami"]
      },
      "application/vnd.amundsen.maze+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.android.ota": {
        source: "iana"
      },
      "application/vnd.android.package-archive": {
        source: "apache",
        compressible: false,
        extensions: ["apk"]
      },
      "application/vnd.anki": {
        source: "iana"
      },
      "application/vnd.anser-web-certificate-issue-initiation": {
        source: "iana",
        extensions: ["cii"]
      },
      "application/vnd.anser-web-funds-transfer-initiation": {
        source: "apache",
        extensions: ["fti"]
      },
      "application/vnd.antix.game-component": {
        source: "iana",
        extensions: ["atx"]
      },
      "application/vnd.apache.arrow.file": {
        source: "iana"
      },
      "application/vnd.apache.arrow.stream": {
        source: "iana"
      },
      "application/vnd.apache.thrift.binary": {
        source: "iana"
      },
      "application/vnd.apache.thrift.compact": {
        source: "iana"
      },
      "application/vnd.apache.thrift.json": {
        source: "iana"
      },
      "application/vnd.api+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.aplextor.warrp+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.apothekende.reservation+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.apple.installer+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpkg"]
      },
      "application/vnd.apple.keynote": {
        source: "iana",
        extensions: ["key"]
      },
      "application/vnd.apple.mpegurl": {
        source: "iana",
        extensions: ["m3u8"]
      },
      "application/vnd.apple.numbers": {
        source: "iana",
        extensions: ["numbers"]
      },
      "application/vnd.apple.pages": {
        source: "iana",
        extensions: ["pages"]
      },
      "application/vnd.apple.pkpass": {
        compressible: false,
        extensions: ["pkpass"]
      },
      "application/vnd.arastra.swi": {
        source: "iana"
      },
      "application/vnd.aristanetworks.swi": {
        source: "iana",
        extensions: ["swi"]
      },
      "application/vnd.artisan+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.artsquare": {
        source: "iana"
      },
      "application/vnd.astraea-software.iota": {
        source: "iana",
        extensions: ["iota"]
      },
      "application/vnd.audiograph": {
        source: "iana",
        extensions: ["aep"]
      },
      "application/vnd.autopackage": {
        source: "iana"
      },
      "application/vnd.avalon+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.avistar+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.balsamiq.bmml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["bmml"]
      },
      "application/vnd.balsamiq.bmpr": {
        source: "iana"
      },
      "application/vnd.banana-accounting": {
        source: "iana"
      },
      "application/vnd.bbf.usp.error": {
        source: "iana"
      },
      "application/vnd.bbf.usp.msg": {
        source: "iana"
      },
      "application/vnd.bbf.usp.msg+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.bekitzur-stech+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.bint.med-content": {
        source: "iana"
      },
      "application/vnd.biopax.rdf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.blink-idb-value-wrapper": {
        source: "iana"
      },
      "application/vnd.blueice.multipass": {
        source: "iana",
        extensions: ["mpm"]
      },
      "application/vnd.bluetooth.ep.oob": {
        source: "iana"
      },
      "application/vnd.bluetooth.le.oob": {
        source: "iana"
      },
      "application/vnd.bmi": {
        source: "iana",
        extensions: ["bmi"]
      },
      "application/vnd.bpf": {
        source: "iana"
      },
      "application/vnd.bpf3": {
        source: "iana"
      },
      "application/vnd.businessobjects": {
        source: "iana",
        extensions: ["rep"]
      },
      "application/vnd.byu.uapi+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cab-jscript": {
        source: "iana"
      },
      "application/vnd.canon-cpdl": {
        source: "iana"
      },
      "application/vnd.canon-lips": {
        source: "iana"
      },
      "application/vnd.capasystems-pg+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cendio.thinlinc.clientconf": {
        source: "iana"
      },
      "application/vnd.century-systems.tcp_stream": {
        source: "iana"
      },
      "application/vnd.chemdraw+xml": {
        source: "iana",
        compressible: true,
        extensions: ["cdxml"]
      },
      "application/vnd.chess-pgn": {
        source: "iana"
      },
      "application/vnd.chipnuts.karaoke-mmd": {
        source: "iana",
        extensions: ["mmd"]
      },
      "application/vnd.ciedi": {
        source: "iana"
      },
      "application/vnd.cinderella": {
        source: "iana",
        extensions: ["cdy"]
      },
      "application/vnd.cirpack.isdn-ext": {
        source: "iana"
      },
      "application/vnd.citationstyles.style+xml": {
        source: "iana",
        compressible: true,
        extensions: ["csl"]
      },
      "application/vnd.claymore": {
        source: "iana",
        extensions: ["cla"]
      },
      "application/vnd.cloanto.rp9": {
        source: "iana",
        extensions: ["rp9"]
      },
      "application/vnd.clonk.c4group": {
        source: "iana",
        extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"]
      },
      "application/vnd.cluetrust.cartomobile-config": {
        source: "iana",
        extensions: ["c11amc"]
      },
      "application/vnd.cluetrust.cartomobile-config-pkg": {
        source: "iana",
        extensions: ["c11amz"]
      },
      "application/vnd.coffeescript": {
        source: "iana"
      },
      "application/vnd.collabio.xodocuments.document": {
        source: "iana"
      },
      "application/vnd.collabio.xodocuments.document-template": {
        source: "iana"
      },
      "application/vnd.collabio.xodocuments.presentation": {
        source: "iana"
      },
      "application/vnd.collabio.xodocuments.presentation-template": {
        source: "iana"
      },
      "application/vnd.collabio.xodocuments.spreadsheet": {
        source: "iana"
      },
      "application/vnd.collabio.xodocuments.spreadsheet-template": {
        source: "iana"
      },
      "application/vnd.collection+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.collection.doc+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.collection.next+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.comicbook+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.comicbook-rar": {
        source: "iana"
      },
      "application/vnd.commerce-battelle": {
        source: "iana"
      },
      "application/vnd.commonspace": {
        source: "iana",
        extensions: ["csp"]
      },
      "application/vnd.contact.cmsg": {
        source: "iana",
        extensions: ["cdbcmsg"]
      },
      "application/vnd.coreos.ignition+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cosmocaller": {
        source: "iana",
        extensions: ["cmc"]
      },
      "application/vnd.crick.clicker": {
        source: "iana",
        extensions: ["clkx"]
      },
      "application/vnd.crick.clicker.keyboard": {
        source: "iana",
        extensions: ["clkk"]
      },
      "application/vnd.crick.clicker.palette": {
        source: "iana",
        extensions: ["clkp"]
      },
      "application/vnd.crick.clicker.template": {
        source: "iana",
        extensions: ["clkt"]
      },
      "application/vnd.crick.clicker.wordbank": {
        source: "iana",
        extensions: ["clkw"]
      },
      "application/vnd.criticaltools.wbs+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wbs"]
      },
      "application/vnd.cryptii.pipe+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.crypto-shade-file": {
        source: "iana"
      },
      "application/vnd.cryptomator.encrypted": {
        source: "iana"
      },
      "application/vnd.cryptomator.vault": {
        source: "iana"
      },
      "application/vnd.ctc-posml": {
        source: "iana",
        extensions: ["pml"]
      },
      "application/vnd.ctct.ws+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cups-pdf": {
        source: "iana"
      },
      "application/vnd.cups-postscript": {
        source: "iana"
      },
      "application/vnd.cups-ppd": {
        source: "iana",
        extensions: ["ppd"]
      },
      "application/vnd.cups-raster": {
        source: "iana"
      },
      "application/vnd.cups-raw": {
        source: "iana"
      },
      "application/vnd.curl": {
        source: "iana"
      },
      "application/vnd.curl.car": {
        source: "apache",
        extensions: ["car"]
      },
      "application/vnd.curl.pcurl": {
        source: "apache",
        extensions: ["pcurl"]
      },
      "application/vnd.cyan.dean.root+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cybank": {
        source: "iana"
      },
      "application/vnd.cyclonedx+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cyclonedx+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.d2l.coursepackage1p0+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.d3m-dataset": {
        source: "iana"
      },
      "application/vnd.d3m-problem": {
        source: "iana"
      },
      "application/vnd.dart": {
        source: "iana",
        compressible: true,
        extensions: ["dart"]
      },
      "application/vnd.data-vision.rdz": {
        source: "iana",
        extensions: ["rdz"]
      },
      "application/vnd.datapackage+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dataresource+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dbf": {
        source: "iana",
        extensions: ["dbf"]
      },
      "application/vnd.debian.binary-package": {
        source: "iana"
      },
      "application/vnd.dece.data": {
        source: "iana",
        extensions: ["uvf", "uvvf", "uvd", "uvvd"]
      },
      "application/vnd.dece.ttml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["uvt", "uvvt"]
      },
      "application/vnd.dece.unspecified": {
        source: "iana",
        extensions: ["uvx", "uvvx"]
      },
      "application/vnd.dece.zip": {
        source: "iana",
        extensions: ["uvz", "uvvz"]
      },
      "application/vnd.denovo.fcselayout-link": {
        source: "iana",
        extensions: ["fe_launch"]
      },
      "application/vnd.desmume.movie": {
        source: "iana"
      },
      "application/vnd.dir-bi.plate-dl-nosuffix": {
        source: "iana"
      },
      "application/vnd.dm.delegation+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dna": {
        source: "iana",
        extensions: ["dna"]
      },
      "application/vnd.document+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dolby.mlp": {
        source: "apache",
        extensions: ["mlp"]
      },
      "application/vnd.dolby.mobile.1": {
        source: "iana"
      },
      "application/vnd.dolby.mobile.2": {
        source: "iana"
      },
      "application/vnd.doremir.scorecloud-binary-document": {
        source: "iana"
      },
      "application/vnd.dpgraph": {
        source: "iana",
        extensions: ["dpg"]
      },
      "application/vnd.dreamfactory": {
        source: "iana",
        extensions: ["dfac"]
      },
      "application/vnd.drive+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ds-keypoint": {
        source: "apache",
        extensions: ["kpxx"]
      },
      "application/vnd.dtg.local": {
        source: "iana"
      },
      "application/vnd.dtg.local.flash": {
        source: "iana"
      },
      "application/vnd.dtg.local.html": {
        source: "iana"
      },
      "application/vnd.dvb.ait": {
        source: "iana",
        extensions: ["ait"]
      },
      "application/vnd.dvb.dvbisl+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.dvbj": {
        source: "iana"
      },
      "application/vnd.dvb.esgcontainer": {
        source: "iana"
      },
      "application/vnd.dvb.ipdcdftnotifaccess": {
        source: "iana"
      },
      "application/vnd.dvb.ipdcesgaccess": {
        source: "iana"
      },
      "application/vnd.dvb.ipdcesgaccess2": {
        source: "iana"
      },
      "application/vnd.dvb.ipdcesgpdd": {
        source: "iana"
      },
      "application/vnd.dvb.ipdcroaming": {
        source: "iana"
      },
      "application/vnd.dvb.iptv.alfec-base": {
        source: "iana"
      },
      "application/vnd.dvb.iptv.alfec-enhancement": {
        source: "iana"
      },
      "application/vnd.dvb.notif-aggregate-root+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-container+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-generic+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-ia-msglist+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-ia-registration-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-ia-registration-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-init+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.pfr": {
        source: "iana"
      },
      "application/vnd.dvb.service": {
        source: "iana",
        extensions: ["svc"]
      },
      "application/vnd.dxr": {
        source: "iana"
      },
      "application/vnd.dynageo": {
        source: "iana",
        extensions: ["geo"]
      },
      "application/vnd.dzr": {
        source: "iana"
      },
      "application/vnd.easykaraoke.cdgdownload": {
        source: "iana"
      },
      "application/vnd.ecdis-update": {
        source: "iana"
      },
      "application/vnd.ecip.rlp": {
        source: "iana"
      },
      "application/vnd.eclipse.ditto+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ecowin.chart": {
        source: "iana",
        extensions: ["mag"]
      },
      "application/vnd.ecowin.filerequest": {
        source: "iana"
      },
      "application/vnd.ecowin.fileupdate": {
        source: "iana"
      },
      "application/vnd.ecowin.series": {
        source: "iana"
      },
      "application/vnd.ecowin.seriesrequest": {
        source: "iana"
      },
      "application/vnd.ecowin.seriesupdate": {
        source: "iana"
      },
      "application/vnd.efi.img": {
        source: "iana"
      },
      "application/vnd.efi.iso": {
        source: "iana"
      },
      "application/vnd.emclient.accessrequest+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.enliven": {
        source: "iana",
        extensions: ["nml"]
      },
      "application/vnd.enphase.envoy": {
        source: "iana"
      },
      "application/vnd.eprints.data+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.epson.esf": {
        source: "iana",
        extensions: ["esf"]
      },
      "application/vnd.epson.msf": {
        source: "iana",
        extensions: ["msf"]
      },
      "application/vnd.epson.quickanime": {
        source: "iana",
        extensions: ["qam"]
      },
      "application/vnd.epson.salt": {
        source: "iana",
        extensions: ["slt"]
      },
      "application/vnd.epson.ssf": {
        source: "iana",
        extensions: ["ssf"]
      },
      "application/vnd.ericsson.quickcall": {
        source: "iana"
      },
      "application/vnd.espass-espass+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.eszigno3+xml": {
        source: "iana",
        compressible: true,
        extensions: ["es3", "et3"]
      },
      "application/vnd.etsi.aoc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.asic-e+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.etsi.asic-s+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.etsi.cug+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvcommand+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvdiscovery+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsad-bc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsad-cod+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsad-npvr+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvservice+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsync+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvueprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.mcid+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.mheg5": {
        source: "iana"
      },
      "application/vnd.etsi.overload-control-policy-dataset+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.pstn+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.sci+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.simservs+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.timestamp-token": {
        source: "iana"
      },
      "application/vnd.etsi.tsl+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.tsl.der": {
        source: "iana"
      },
      "application/vnd.eu.kasparian.car+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.eudora.data": {
        source: "iana"
      },
      "application/vnd.evolv.ecig.profile": {
        source: "iana"
      },
      "application/vnd.evolv.ecig.settings": {
        source: "iana"
      },
      "application/vnd.evolv.ecig.theme": {
        source: "iana"
      },
      "application/vnd.exstream-empower+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.exstream-package": {
        source: "iana"
      },
      "application/vnd.ezpix-album": {
        source: "iana",
        extensions: ["ez2"]
      },
      "application/vnd.ezpix-package": {
        source: "iana",
        extensions: ["ez3"]
      },
      "application/vnd.f-secure.mobile": {
        source: "iana"
      },
      "application/vnd.familysearch.gedcom+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.fastcopy-disk-image": {
        source: "iana"
      },
      "application/vnd.fdf": {
        source: "iana",
        extensions: ["fdf"]
      },
      "application/vnd.fdsn.mseed": {
        source: "iana",
        extensions: ["mseed"]
      },
      "application/vnd.fdsn.seed": {
        source: "iana",
        extensions: ["seed", "dataless"]
      },
      "application/vnd.ffsns": {
        source: "iana"
      },
      "application/vnd.ficlab.flb+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.filmit.zfc": {
        source: "iana"
      },
      "application/vnd.fints": {
        source: "iana"
      },
      "application/vnd.firemonkeys.cloudcell": {
        source: "iana"
      },
      "application/vnd.flographit": {
        source: "iana",
        extensions: ["gph"]
      },
      "application/vnd.fluxtime.clip": {
        source: "iana",
        extensions: ["ftc"]
      },
      "application/vnd.font-fontforge-sfd": {
        source: "iana"
      },
      "application/vnd.framemaker": {
        source: "iana",
        extensions: ["fm", "frame", "maker", "book"]
      },
      "application/vnd.frogans.fnc": {
        source: "iana",
        extensions: ["fnc"]
      },
      "application/vnd.frogans.ltf": {
        source: "iana",
        extensions: ["ltf"]
      },
      "application/vnd.fsc.weblaunch": {
        source: "iana",
        extensions: ["fsc"]
      },
      "application/vnd.fujifilm.fb.docuworks": {
        source: "iana"
      },
      "application/vnd.fujifilm.fb.docuworks.binder": {
        source: "iana"
      },
      "application/vnd.fujifilm.fb.docuworks.container": {
        source: "iana"
      },
      "application/vnd.fujifilm.fb.jfi+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.fujitsu.oasys": {
        source: "iana",
        extensions: ["oas"]
      },
      "application/vnd.fujitsu.oasys2": {
        source: "iana",
        extensions: ["oa2"]
      },
      "application/vnd.fujitsu.oasys3": {
        source: "iana",
        extensions: ["oa3"]
      },
      "application/vnd.fujitsu.oasysgp": {
        source: "iana",
        extensions: ["fg5"]
      },
      "application/vnd.fujitsu.oasysprs": {
        source: "iana",
        extensions: ["bh2"]
      },
      "application/vnd.fujixerox.art-ex": {
        source: "iana"
      },
      "application/vnd.fujixerox.art4": {
        source: "iana"
      },
      "application/vnd.fujixerox.ddd": {
        source: "iana",
        extensions: ["ddd"]
      },
      "application/vnd.fujixerox.docuworks": {
        source: "iana",
        extensions: ["xdw"]
      },
      "application/vnd.fujixerox.docuworks.binder": {
        source: "iana",
        extensions: ["xbd"]
      },
      "application/vnd.fujixerox.docuworks.container": {
        source: "iana"
      },
      "application/vnd.fujixerox.hbpl": {
        source: "iana"
      },
      "application/vnd.fut-misnet": {
        source: "iana"
      },
      "application/vnd.futoin+cbor": {
        source: "iana"
      },
      "application/vnd.futoin+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.fuzzysheet": {
        source: "iana",
        extensions: ["fzs"]
      },
      "application/vnd.genomatix.tuxedo": {
        source: "iana",
        extensions: ["txd"]
      },
      "application/vnd.gentics.grd+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.geo+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.geocube+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.geogebra.file": {
        source: "iana",
        extensions: ["ggb"]
      },
      "application/vnd.geogebra.slides": {
        source: "iana"
      },
      "application/vnd.geogebra.tool": {
        source: "iana",
        extensions: ["ggt"]
      },
      "application/vnd.geometry-explorer": {
        source: "iana",
        extensions: ["gex", "gre"]
      },
      "application/vnd.geonext": {
        source: "iana",
        extensions: ["gxt"]
      },
      "application/vnd.geoplan": {
        source: "iana",
        extensions: ["g2w"]
      },
      "application/vnd.geospace": {
        source: "iana",
        extensions: ["g3w"]
      },
      "application/vnd.gerber": {
        source: "iana"
      },
      "application/vnd.globalplatform.card-content-mgt": {
        source: "iana"
      },
      "application/vnd.globalplatform.card-content-mgt-response": {
        source: "iana"
      },
      "application/vnd.gmx": {
        source: "iana",
        extensions: ["gmx"]
      },
      "application/vnd.google-apps.document": {
        compressible: false,
        extensions: ["gdoc"]
      },
      "application/vnd.google-apps.presentation": {
        compressible: false,
        extensions: ["gslides"]
      },
      "application/vnd.google-apps.spreadsheet": {
        compressible: false,
        extensions: ["gsheet"]
      },
      "application/vnd.google-earth.kml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["kml"]
      },
      "application/vnd.google-earth.kmz": {
        source: "iana",
        compressible: false,
        extensions: ["kmz"]
      },
      "application/vnd.gov.sk.e-form+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.gov.sk.e-form+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.gov.sk.xmldatacontainer+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.grafeq": {
        source: "iana",
        extensions: ["gqf", "gqs"]
      },
      "application/vnd.gridmp": {
        source: "iana"
      },
      "application/vnd.groove-account": {
        source: "iana",
        extensions: ["gac"]
      },
      "application/vnd.groove-help": {
        source: "iana",
        extensions: ["ghf"]
      },
      "application/vnd.groove-identity-message": {
        source: "iana",
        extensions: ["gim"]
      },
      "application/vnd.groove-injector": {
        source: "iana",
        extensions: ["grv"]
      },
      "application/vnd.groove-tool-message": {
        source: "iana",
        extensions: ["gtm"]
      },
      "application/vnd.groove-tool-template": {
        source: "iana",
        extensions: ["tpl"]
      },
      "application/vnd.groove-vcard": {
        source: "iana",
        extensions: ["vcg"]
      },
      "application/vnd.hal+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hal+xml": {
        source: "iana",
        compressible: true,
        extensions: ["hal"]
      },
      "application/vnd.handheld-entertainment+xml": {
        source: "iana",
        compressible: true,
        extensions: ["zmm"]
      },
      "application/vnd.hbci": {
        source: "iana",
        extensions: ["hbci"]
      },
      "application/vnd.hc+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hcl-bireports": {
        source: "iana"
      },
      "application/vnd.hdt": {
        source: "iana"
      },
      "application/vnd.heroku+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hhe.lesson-player": {
        source: "iana",
        extensions: ["les"]
      },
      "application/vnd.hl7cda+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.hl7v2+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.hp-hpgl": {
        source: "iana",
        extensions: ["hpgl"]
      },
      "application/vnd.hp-hpid": {
        source: "iana",
        extensions: ["hpid"]
      },
      "application/vnd.hp-hps": {
        source: "iana",
        extensions: ["hps"]
      },
      "application/vnd.hp-jlyt": {
        source: "iana",
        extensions: ["jlt"]
      },
      "application/vnd.hp-pcl": {
        source: "iana",
        extensions: ["pcl"]
      },
      "application/vnd.hp-pclxl": {
        source: "iana",
        extensions: ["pclxl"]
      },
      "application/vnd.httphone": {
        source: "iana"
      },
      "application/vnd.hydrostatix.sof-data": {
        source: "iana",
        extensions: ["sfd-hdstx"]
      },
      "application/vnd.hyper+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hyper-item+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hyperdrive+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hzn-3d-crossword": {
        source: "iana"
      },
      "application/vnd.ibm.afplinedata": {
        source: "iana"
      },
      "application/vnd.ibm.electronic-media": {
        source: "iana"
      },
      "application/vnd.ibm.minipay": {
        source: "iana",
        extensions: ["mpy"]
      },
      "application/vnd.ibm.modcap": {
        source: "iana",
        extensions: ["afp", "listafp", "list3820"]
      },
      "application/vnd.ibm.rights-management": {
        source: "iana",
        extensions: ["irm"]
      },
      "application/vnd.ibm.secure-container": {
        source: "iana",
        extensions: ["sc"]
      },
      "application/vnd.iccprofile": {
        source: "iana",
        extensions: ["icc", "icm"]
      },
      "application/vnd.ieee.1905": {
        source: "iana"
      },
      "application/vnd.igloader": {
        source: "iana",
        extensions: ["igl"]
      },
      "application/vnd.imagemeter.folder+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.imagemeter.image+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.immervision-ivp": {
        source: "iana",
        extensions: ["ivp"]
      },
      "application/vnd.immervision-ivu": {
        source: "iana",
        extensions: ["ivu"]
      },
      "application/vnd.ims.imsccv1p1": {
        source: "iana"
      },
      "application/vnd.ims.imsccv1p2": {
        source: "iana"
      },
      "application/vnd.ims.imsccv1p3": {
        source: "iana"
      },
      "application/vnd.ims.lis.v2.result+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolproxy+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolproxy.id+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolsettings+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolsettings.simple+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.informedcontrol.rms+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.informix-visionary": {
        source: "iana"
      },
      "application/vnd.infotech.project": {
        source: "iana"
      },
      "application/vnd.infotech.project+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.innopath.wamp.notification": {
        source: "iana"
      },
      "application/vnd.insors.igm": {
        source: "iana",
        extensions: ["igm"]
      },
      "application/vnd.intercon.formnet": {
        source: "iana",
        extensions: ["xpw", "xpx"]
      },
      "application/vnd.intergeo": {
        source: "iana",
        extensions: ["i2g"]
      },
      "application/vnd.intertrust.digibox": {
        source: "iana"
      },
      "application/vnd.intertrust.nncp": {
        source: "iana"
      },
      "application/vnd.intu.qbo": {
        source: "iana",
        extensions: ["qbo"]
      },
      "application/vnd.intu.qfx": {
        source: "iana",
        extensions: ["qfx"]
      },
      "application/vnd.iptc.g2.catalogitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.conceptitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.knowledgeitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.newsitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.newsmessage+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.packageitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.planningitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ipunplugged.rcprofile": {
        source: "iana",
        extensions: ["rcprofile"]
      },
      "application/vnd.irepository.package+xml": {
        source: "iana",
        compressible: true,
        extensions: ["irp"]
      },
      "application/vnd.is-xpr": {
        source: "iana",
        extensions: ["xpr"]
      },
      "application/vnd.isac.fcs": {
        source: "iana",
        extensions: ["fcs"]
      },
      "application/vnd.iso11783-10+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.jam": {
        source: "iana",
        extensions: ["jam"]
      },
      "application/vnd.japannet-directory-service": {
        source: "iana"
      },
      "application/vnd.japannet-jpnstore-wakeup": {
        source: "iana"
      },
      "application/vnd.japannet-payment-wakeup": {
        source: "iana"
      },
      "application/vnd.japannet-registration": {
        source: "iana"
      },
      "application/vnd.japannet-registration-wakeup": {
        source: "iana"
      },
      "application/vnd.japannet-setstore-wakeup": {
        source: "iana"
      },
      "application/vnd.japannet-verification": {
        source: "iana"
      },
      "application/vnd.japannet-verification-wakeup": {
        source: "iana"
      },
      "application/vnd.jcp.javame.midlet-rms": {
        source: "iana",
        extensions: ["rms"]
      },
      "application/vnd.jisp": {
        source: "iana",
        extensions: ["jisp"]
      },
      "application/vnd.joost.joda-archive": {
        source: "iana",
        extensions: ["joda"]
      },
      "application/vnd.jsk.isdn-ngn": {
        source: "iana"
      },
      "application/vnd.kahootz": {
        source: "iana",
        extensions: ["ktz", "ktr"]
      },
      "application/vnd.kde.karbon": {
        source: "iana",
        extensions: ["karbon"]
      },
      "application/vnd.kde.kchart": {
        source: "iana",
        extensions: ["chrt"]
      },
      "application/vnd.kde.kformula": {
        source: "iana",
        extensions: ["kfo"]
      },
      "application/vnd.kde.kivio": {
        source: "iana",
        extensions: ["flw"]
      },
      "application/vnd.kde.kontour": {
        source: "iana",
        extensions: ["kon"]
      },
      "application/vnd.kde.kpresenter": {
        source: "iana",
        extensions: ["kpr", "kpt"]
      },
      "application/vnd.kde.kspread": {
        source: "iana",
        extensions: ["ksp"]
      },
      "application/vnd.kde.kword": {
        source: "iana",
        extensions: ["kwd", "kwt"]
      },
      "application/vnd.kenameaapp": {
        source: "iana",
        extensions: ["htke"]
      },
      "application/vnd.kidspiration": {
        source: "iana",
        extensions: ["kia"]
      },
      "application/vnd.kinar": {
        source: "iana",
        extensions: ["kne", "knp"]
      },
      "application/vnd.koan": {
        source: "iana",
        extensions: ["skp", "skd", "skt", "skm"]
      },
      "application/vnd.kodak-descriptor": {
        source: "iana",
        extensions: ["sse"]
      },
      "application/vnd.las": {
        source: "iana"
      },
      "application/vnd.las.las+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.las.las+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lasxml"]
      },
      "application/vnd.laszip": {
        source: "iana"
      },
      "application/vnd.leap+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.liberty-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.llamagraphics.life-balance.desktop": {
        source: "iana",
        extensions: ["lbd"]
      },
      "application/vnd.llamagraphics.life-balance.exchange+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lbe"]
      },
      "application/vnd.logipipe.circuit+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.loom": {
        source: "iana"
      },
      "application/vnd.lotus-1-2-3": {
        source: "iana",
        extensions: ["123"]
      },
      "application/vnd.lotus-approach": {
        source: "iana",
        extensions: ["apr"]
      },
      "application/vnd.lotus-freelance": {
        source: "iana",
        extensions: ["pre"]
      },
      "application/vnd.lotus-notes": {
        source: "iana",
        extensions: ["nsf"]
      },
      "application/vnd.lotus-organizer": {
        source: "iana",
        extensions: ["org"]
      },
      "application/vnd.lotus-screencam": {
        source: "iana",
        extensions: ["scm"]
      },
      "application/vnd.lotus-wordpro": {
        source: "iana",
        extensions: ["lwp"]
      },
      "application/vnd.macports.portpkg": {
        source: "iana",
        extensions: ["portpkg"]
      },
      "application/vnd.mapbox-vector-tile": {
        source: "iana",
        extensions: ["mvt"]
      },
      "application/vnd.marlin.drm.actiontoken+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.marlin.drm.conftoken+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.marlin.drm.license+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.marlin.drm.mdcf": {
        source: "iana"
      },
      "application/vnd.mason+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.maxar.archive.3tz+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.maxmind.maxmind-db": {
        source: "iana"
      },
      "application/vnd.mcd": {
        source: "iana",
        extensions: ["mcd"]
      },
      "application/vnd.medcalcdata": {
        source: "iana",
        extensions: ["mc1"]
      },
      "application/vnd.mediastation.cdkey": {
        source: "iana",
        extensions: ["cdkey"]
      },
      "application/vnd.meridian-slingshot": {
        source: "iana"
      },
      "application/vnd.mfer": {
        source: "iana",
        extensions: ["mwf"]
      },
      "application/vnd.mfmp": {
        source: "iana",
        extensions: ["mfm"]
      },
      "application/vnd.micro+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.micrografx.flo": {
        source: "iana",
        extensions: ["flo"]
      },
      "application/vnd.micrografx.igx": {
        source: "iana",
        extensions: ["igx"]
      },
      "application/vnd.microsoft.portable-executable": {
        source: "iana"
      },
      "application/vnd.microsoft.windows.thumbnail-cache": {
        source: "iana"
      },
      "application/vnd.miele+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.mif": {
        source: "iana",
        extensions: ["mif"]
      },
      "application/vnd.minisoft-hp3000-save": {
        source: "iana"
      },
      "application/vnd.mitsubishi.misty-guard.trustweb": {
        source: "iana"
      },
      "application/vnd.mobius.daf": {
        source: "iana",
        extensions: ["daf"]
      },
      "application/vnd.mobius.dis": {
        source: "iana",
        extensions: ["dis"]
      },
      "application/vnd.mobius.mbk": {
        source: "iana",
        extensions: ["mbk"]
      },
      "application/vnd.mobius.mqy": {
        source: "iana",
        extensions: ["mqy"]
      },
      "application/vnd.mobius.msl": {
        source: "iana",
        extensions: ["msl"]
      },
      "application/vnd.mobius.plc": {
        source: "iana",
        extensions: ["plc"]
      },
      "application/vnd.mobius.txf": {
        source: "iana",
        extensions: ["txf"]
      },
      "application/vnd.mophun.application": {
        source: "iana",
        extensions: ["mpn"]
      },
      "application/vnd.mophun.certificate": {
        source: "iana",
        extensions: ["mpc"]
      },
      "application/vnd.motorola.flexsuite": {
        source: "iana"
      },
      "application/vnd.motorola.flexsuite.adsi": {
        source: "iana"
      },
      "application/vnd.motorola.flexsuite.fis": {
        source: "iana"
      },
      "application/vnd.motorola.flexsuite.gotap": {
        source: "iana"
      },
      "application/vnd.motorola.flexsuite.kmr": {
        source: "iana"
      },
      "application/vnd.motorola.flexsuite.ttc": {
        source: "iana"
      },
      "application/vnd.motorola.flexsuite.wem": {
        source: "iana"
      },
      "application/vnd.motorola.iprm": {
        source: "iana"
      },
      "application/vnd.mozilla.xul+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xul"]
      },
      "application/vnd.ms-3mfdocument": {
        source: "iana"
      },
      "application/vnd.ms-artgalry": {
        source: "iana",
        extensions: ["cil"]
      },
      "application/vnd.ms-asf": {
        source: "iana"
      },
      "application/vnd.ms-cab-compressed": {
        source: "iana",
        extensions: ["cab"]
      },
      "application/vnd.ms-color.iccprofile": {
        source: "apache"
      },
      "application/vnd.ms-excel": {
        source: "iana",
        compressible: false,
        extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"]
      },
      "application/vnd.ms-excel.addin.macroenabled.12": {
        source: "iana",
        extensions: ["xlam"]
      },
      "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
        source: "iana",
        extensions: ["xlsb"]
      },
      "application/vnd.ms-excel.sheet.macroenabled.12": {
        source: "iana",
        extensions: ["xlsm"]
      },
      "application/vnd.ms-excel.template.macroenabled.12": {
        source: "iana",
        extensions: ["xltm"]
      },
      "application/vnd.ms-fontobject": {
        source: "iana",
        compressible: true,
        extensions: ["eot"]
      },
      "application/vnd.ms-htmlhelp": {
        source: "iana",
        extensions: ["chm"]
      },
      "application/vnd.ms-ims": {
        source: "iana",
        extensions: ["ims"]
      },
      "application/vnd.ms-lrm": {
        source: "iana",
        extensions: ["lrm"]
      },
      "application/vnd.ms-office.activex+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ms-officetheme": {
        source: "iana",
        extensions: ["thmx"]
      },
      "application/vnd.ms-opentype": {
        source: "apache",
        compressible: true
      },
      "application/vnd.ms-outlook": {
        compressible: false,
        extensions: ["msg"]
      },
      "application/vnd.ms-package.obfuscated-opentype": {
        source: "apache"
      },
      "application/vnd.ms-pki.seccat": {
        source: "apache",
        extensions: ["cat"]
      },
      "application/vnd.ms-pki.stl": {
        source: "apache",
        extensions: ["stl"]
      },
      "application/vnd.ms-playready.initiator+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ms-powerpoint": {
        source: "iana",
        compressible: false,
        extensions: ["ppt", "pps", "pot"]
      },
      "application/vnd.ms-powerpoint.addin.macroenabled.12": {
        source: "iana",
        extensions: ["ppam"]
      },
      "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
        source: "iana",
        extensions: ["pptm"]
      },
      "application/vnd.ms-powerpoint.slide.macroenabled.12": {
        source: "iana",
        extensions: ["sldm"]
      },
      "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
        source: "iana",
        extensions: ["ppsm"]
      },
      "application/vnd.ms-powerpoint.template.macroenabled.12": {
        source: "iana",
        extensions: ["potm"]
      },
      "application/vnd.ms-printdevicecapabilities+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ms-printing.printticket+xml": {
        source: "apache",
        compressible: true
      },
      "application/vnd.ms-printschematicket+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ms-project": {
        source: "iana",
        extensions: ["mpp", "mpt"]
      },
      "application/vnd.ms-tnef": {
        source: "iana"
      },
      "application/vnd.ms-windows.devicepairing": {
        source: "iana"
      },
      "application/vnd.ms-windows.nwprinting.oob": {
        source: "iana"
      },
      "application/vnd.ms-windows.printerpairing": {
        source: "iana"
      },
      "application/vnd.ms-windows.wsd.oob": {
        source: "iana"
      },
      "application/vnd.ms-wmdrm.lic-chlg-req": {
        source: "iana"
      },
      "application/vnd.ms-wmdrm.lic-resp": {
        source: "iana"
      },
      "application/vnd.ms-wmdrm.meter-chlg-req": {
        source: "iana"
      },
      "application/vnd.ms-wmdrm.meter-resp": {
        source: "iana"
      },
      "application/vnd.ms-word.document.macroenabled.12": {
        source: "iana",
        extensions: ["docm"]
      },
      "application/vnd.ms-word.template.macroenabled.12": {
        source: "iana",
        extensions: ["dotm"]
      },
      "application/vnd.ms-works": {
        source: "iana",
        extensions: ["wps", "wks", "wcm", "wdb"]
      },
      "application/vnd.ms-wpl": {
        source: "iana",
        extensions: ["wpl"]
      },
      "application/vnd.ms-xpsdocument": {
        source: "iana",
        compressible: false,
        extensions: ["xps"]
      },
      "application/vnd.msa-disk-image": {
        source: "iana"
      },
      "application/vnd.mseq": {
        source: "iana",
        extensions: ["mseq"]
      },
      "application/vnd.msign": {
        source: "iana"
      },
      "application/vnd.multiad.creator": {
        source: "iana"
      },
      "application/vnd.multiad.creator.cif": {
        source: "iana"
      },
      "application/vnd.music-niff": {
        source: "iana"
      },
      "application/vnd.musician": {
        source: "iana",
        extensions: ["mus"]
      },
      "application/vnd.muvee.style": {
        source: "iana",
        extensions: ["msty"]
      },
      "application/vnd.mynfc": {
        source: "iana",
        extensions: ["taglet"]
      },
      "application/vnd.nacamar.ybrid+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ncd.control": {
        source: "iana"
      },
      "application/vnd.ncd.reference": {
        source: "iana"
      },
      "application/vnd.nearst.inv+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nebumind.line": {
        source: "iana"
      },
      "application/vnd.nervana": {
        source: "iana"
      },
      "application/vnd.netfpx": {
        source: "iana"
      },
      "application/vnd.neurolanguage.nlu": {
        source: "iana",
        extensions: ["nlu"]
      },
      "application/vnd.nimn": {
        source: "iana"
      },
      "application/vnd.nintendo.nitro.rom": {
        source: "iana"
      },
      "application/vnd.nintendo.snes.rom": {
        source: "iana"
      },
      "application/vnd.nitf": {
        source: "iana",
        extensions: ["ntf", "nitf"]
      },
      "application/vnd.noblenet-directory": {
        source: "iana",
        extensions: ["nnd"]
      },
      "application/vnd.noblenet-sealer": {
        source: "iana",
        extensions: ["nns"]
      },
      "application/vnd.noblenet-web": {
        source: "iana",
        extensions: ["nnw"]
      },
      "application/vnd.nokia.catalogs": {
        source: "iana"
      },
      "application/vnd.nokia.conml+wbxml": {
        source: "iana"
      },
      "application/vnd.nokia.conml+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.iptv.config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.isds-radio-presets": {
        source: "iana"
      },
      "application/vnd.nokia.landmark+wbxml": {
        source: "iana"
      },
      "application/vnd.nokia.landmark+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.landmarkcollection+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.n-gage.ac+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ac"]
      },
      "application/vnd.nokia.n-gage.data": {
        source: "iana",
        extensions: ["ngdat"]
      },
      "application/vnd.nokia.n-gage.symbian.install": {
        source: "iana",
        extensions: ["n-gage"]
      },
      "application/vnd.nokia.ncd": {
        source: "iana"
      },
      "application/vnd.nokia.pcd+wbxml": {
        source: "iana"
      },
      "application/vnd.nokia.pcd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.radio-preset": {
        source: "iana",
        extensions: ["rpst"]
      },
      "application/vnd.nokia.radio-presets": {
        source: "iana",
        extensions: ["rpss"]
      },
      "application/vnd.novadigm.edm": {
        source: "iana",
        extensions: ["edm"]
      },
      "application/vnd.novadigm.edx": {
        source: "iana",
        extensions: ["edx"]
      },
      "application/vnd.novadigm.ext": {
        source: "iana",
        extensions: ["ext"]
      },
      "application/vnd.ntt-local.content-share": {
        source: "iana"
      },
      "application/vnd.ntt-local.file-transfer": {
        source: "iana"
      },
      "application/vnd.ntt-local.ogw_remote-access": {
        source: "iana"
      },
      "application/vnd.ntt-local.sip-ta_remote": {
        source: "iana"
      },
      "application/vnd.ntt-local.sip-ta_tcp_stream": {
        source: "iana"
      },
      "application/vnd.oasis.opendocument.chart": {
        source: "iana",
        extensions: ["odc"]
      },
      "application/vnd.oasis.opendocument.chart-template": {
        source: "iana",
        extensions: ["otc"]
      },
      "application/vnd.oasis.opendocument.database": {
        source: "iana",
        extensions: ["odb"]
      },
      "application/vnd.oasis.opendocument.formula": {
        source: "iana",
        extensions: ["odf"]
      },
      "application/vnd.oasis.opendocument.formula-template": {
        source: "iana",
        extensions: ["odft"]
      },
      "application/vnd.oasis.opendocument.graphics": {
        source: "iana",
        compressible: false,
        extensions: ["odg"]
      },
      "application/vnd.oasis.opendocument.graphics-template": {
        source: "iana",
        extensions: ["otg"]
      },
      "application/vnd.oasis.opendocument.image": {
        source: "iana",
        extensions: ["odi"]
      },
      "application/vnd.oasis.opendocument.image-template": {
        source: "iana",
        extensions: ["oti"]
      },
      "application/vnd.oasis.opendocument.presentation": {
        source: "iana",
        compressible: false,
        extensions: ["odp"]
      },
      "application/vnd.oasis.opendocument.presentation-template": {
        source: "iana",
        extensions: ["otp"]
      },
      "application/vnd.oasis.opendocument.spreadsheet": {
        source: "iana",
        compressible: false,
        extensions: ["ods"]
      },
      "application/vnd.oasis.opendocument.spreadsheet-template": {
        source: "iana",
        extensions: ["ots"]
      },
      "application/vnd.oasis.opendocument.text": {
        source: "iana",
        compressible: false,
        extensions: ["odt"]
      },
      "application/vnd.oasis.opendocument.text-master": {
        source: "iana",
        extensions: ["odm"]
      },
      "application/vnd.oasis.opendocument.text-template": {
        source: "iana",
        extensions: ["ott"]
      },
      "application/vnd.oasis.opendocument.text-web": {
        source: "iana",
        extensions: ["oth"]
      },
      "application/vnd.obn": {
        source: "iana"
      },
      "application/vnd.ocf+cbor": {
        source: "iana"
      },
      "application/vnd.oci.image.manifest.v1+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oftn.l10n+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.contentaccessdownload+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.contentaccessstreaming+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.cspg-hexbinary": {
        source: "iana"
      },
      "application/vnd.oipf.dae.svg+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.dae.xhtml+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.mippvcontrolmessage+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.pae.gem": {
        source: "iana"
      },
      "application/vnd.oipf.spdiscovery+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.spdlist+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.ueprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.userprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.olpc-sugar": {
        source: "iana",
        extensions: ["xo"]
      },
      "application/vnd.oma-scws-config": {
        source: "iana"
      },
      "application/vnd.oma-scws-http-request": {
        source: "iana"
      },
      "application/vnd.oma-scws-http-response": {
        source: "iana"
      },
      "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.drm-trigger+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.imd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.ltkm": {
        source: "iana"
      },
      "application/vnd.oma.bcast.notification+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.provisioningtrigger": {
        source: "iana"
      },
      "application/vnd.oma.bcast.sgboot": {
        source: "iana"
      },
      "application/vnd.oma.bcast.sgdd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.sgdu": {
        source: "iana"
      },
      "application/vnd.oma.bcast.simple-symbol-container": {
        source: "iana"
      },
      "application/vnd.oma.bcast.smartcard-trigger+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.sprov+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.stkm": {
        source: "iana"
      },
      "application/vnd.oma.cab-address-book+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-feature-handler+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-pcc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-subs-invite+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-user-prefs+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.dcd": {
        source: "iana"
      },
      "application/vnd.oma.dcdc": {
        source: "iana"
      },
      "application/vnd.oma.dd2+xml": {
        source: "iana",
        compressible: true,
        extensions: ["dd2"]
      },
      "application/vnd.oma.drm.risd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.group-usage-list+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.lwm2m+cbor": {
        source: "iana"
      },
      "application/vnd.oma.lwm2m+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.lwm2m+tlv": {
        source: "iana"
      },
      "application/vnd.oma.pal+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.detailed-progress-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.final-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.groups+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.invocation-descriptor+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.optimized-progress-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.push": {
        source: "iana"
      },
      "application/vnd.oma.scidm.messages+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.xcap-directory+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.omads-email+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.omads-file+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.omads-folder+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.omaloc-supl-init": {
        source: "iana"
      },
      "application/vnd.onepager": {
        source: "iana"
      },
      "application/vnd.onepagertamp": {
        source: "iana"
      },
      "application/vnd.onepagertamx": {
        source: "iana"
      },
      "application/vnd.onepagertat": {
        source: "iana"
      },
      "application/vnd.onepagertatp": {
        source: "iana"
      },
      "application/vnd.onepagertatx": {
        source: "iana"
      },
      "application/vnd.openblox.game+xml": {
        source: "iana",
        compressible: true,
        extensions: ["obgx"]
      },
      "application/vnd.openblox.game-binary": {
        source: "iana"
      },
      "application/vnd.openeye.oeb": {
        source: "iana"
      },
      "application/vnd.openofficeorg.extension": {
        source: "apache",
        extensions: ["oxt"]
      },
      "application/vnd.openstreetmap.data+xml": {
        source: "iana",
        compressible: true,
        extensions: ["osm"]
      },
      "application/vnd.opentimestamps.ots": {
        source: "iana"
      },
      "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawing+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
        source: "iana",
        compressible: false,
        extensions: ["pptx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slide": {
        source: "iana",
        extensions: ["sldx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
        source: "iana",
        extensions: ["ppsx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.template": {
        source: "iana",
        extensions: ["potx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
        source: "iana",
        compressible: false,
        extensions: ["xlsx"]
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
        source: "iana",
        extensions: ["xltx"]
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.theme+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.vmldrawing": {
        source: "iana"
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
        source: "iana",
        compressible: false,
        extensions: ["docx"]
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
        source: "iana",
        extensions: ["dotx"]
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-package.core-properties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-package.relationships+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oracle.resource+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.orange.indata": {
        source: "iana"
      },
      "application/vnd.osa.netdeploy": {
        source: "iana"
      },
      "application/vnd.osgeo.mapguide.package": {
        source: "iana",
        extensions: ["mgp"]
      },
      "application/vnd.osgi.bundle": {
        source: "iana"
      },
      "application/vnd.osgi.dp": {
        source: "iana",
        extensions: ["dp"]
      },
      "application/vnd.osgi.subsystem": {
        source: "iana",
        extensions: ["esa"]
      },
      "application/vnd.otps.ct-kip+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oxli.countgraph": {
        source: "iana"
      },
      "application/vnd.pagerduty+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.palm": {
        source: "iana",
        extensions: ["pdb", "pqa", "oprc"]
      },
      "application/vnd.panoply": {
        source: "iana"
      },
      "application/vnd.paos.xml": {
        source: "iana"
      },
      "application/vnd.patentdive": {
        source: "iana"
      },
      "application/vnd.patientecommsdoc": {
        source: "iana"
      },
      "application/vnd.pawaafile": {
        source: "iana",
        extensions: ["paw"]
      },
      "application/vnd.pcos": {
        source: "iana"
      },
      "application/vnd.pg.format": {
        source: "iana",
        extensions: ["str"]
      },
      "application/vnd.pg.osasli": {
        source: "iana",
        extensions: ["ei6"]
      },
      "application/vnd.piaccess.application-licence": {
        source: "iana"
      },
      "application/vnd.picsel": {
        source: "iana",
        extensions: ["efif"]
      },
      "application/vnd.pmi.widget": {
        source: "iana",
        extensions: ["wg"]
      },
      "application/vnd.poc.group-advertisement+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.pocketlearn": {
        source: "iana",
        extensions: ["plf"]
      },
      "application/vnd.powerbuilder6": {
        source: "iana",
        extensions: ["pbd"]
      },
      "application/vnd.powerbuilder6-s": {
        source: "iana"
      },
      "application/vnd.powerbuilder7": {
        source: "iana"
      },
      "application/vnd.powerbuilder7-s": {
        source: "iana"
      },
      "application/vnd.powerbuilder75": {
        source: "iana"
      },
      "application/vnd.powerbuilder75-s": {
        source: "iana"
      },
      "application/vnd.preminet": {
        source: "iana"
      },
      "application/vnd.previewsystems.box": {
        source: "iana",
        extensions: ["box"]
      },
      "application/vnd.proteus.magazine": {
        source: "iana",
        extensions: ["mgz"]
      },
      "application/vnd.psfs": {
        source: "iana"
      },
      "application/vnd.publishare-delta-tree": {
        source: "iana",
        extensions: ["qps"]
      },
      "application/vnd.pvi.ptid1": {
        source: "iana",
        extensions: ["ptid"]
      },
      "application/vnd.pwg-multiplexed": {
        source: "iana"
      },
      "application/vnd.pwg-xhtml-print+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.qualcomm.brew-app-res": {
        source: "iana"
      },
      "application/vnd.quarantainenet": {
        source: "iana"
      },
      "application/vnd.quark.quarkxpress": {
        source: "iana",
        extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"]
      },
      "application/vnd.quobject-quoxdocument": {
        source: "iana"
      },
      "application/vnd.radisys.moml+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-conf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-conn+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-dialog+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-stream+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-conf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-base+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-fax-detect+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-group+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-speech+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-transform+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.rainstor.data": {
        source: "iana"
      },
      "application/vnd.rapid": {
        source: "iana"
      },
      "application/vnd.rar": {
        source: "iana",
        extensions: ["rar"]
      },
      "application/vnd.realvnc.bed": {
        source: "iana",
        extensions: ["bed"]
      },
      "application/vnd.recordare.musicxml": {
        source: "iana",
        extensions: ["mxl"]
      },
      "application/vnd.recordare.musicxml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["musicxml"]
      },
      "application/vnd.renlearn.rlprint": {
        source: "iana"
      },
      "application/vnd.resilient.logic": {
        source: "iana"
      },
      "application/vnd.restful+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.rig.cryptonote": {
        source: "iana",
        extensions: ["cryptonote"]
      },
      "application/vnd.rim.cod": {
        source: "apache",
        extensions: ["cod"]
      },
      "application/vnd.rn-realmedia": {
        source: "apache",
        extensions: ["rm"]
      },
      "application/vnd.rn-realmedia-vbr": {
        source: "apache",
        extensions: ["rmvb"]
      },
      "application/vnd.route66.link66+xml": {
        source: "iana",
        compressible: true,
        extensions: ["link66"]
      },
      "application/vnd.rs-274x": {
        source: "iana"
      },
      "application/vnd.ruckus.download": {
        source: "iana"
      },
      "application/vnd.s3sms": {
        source: "iana"
      },
      "application/vnd.sailingtracker.track": {
        source: "iana",
        extensions: ["st"]
      },
      "application/vnd.sar": {
        source: "iana"
      },
      "application/vnd.sbm.cid": {
        source: "iana"
      },
      "application/vnd.sbm.mid2": {
        source: "iana"
      },
      "application/vnd.scribus": {
        source: "iana"
      },
      "application/vnd.sealed.3df": {
        source: "iana"
      },
      "application/vnd.sealed.csf": {
        source: "iana"
      },
      "application/vnd.sealed.doc": {
        source: "iana"
      },
      "application/vnd.sealed.eml": {
        source: "iana"
      },
      "application/vnd.sealed.mht": {
        source: "iana"
      },
      "application/vnd.sealed.net": {
        source: "iana"
      },
      "application/vnd.sealed.ppt": {
        source: "iana"
      },
      "application/vnd.sealed.tiff": {
        source: "iana"
      },
      "application/vnd.sealed.xls": {
        source: "iana"
      },
      "application/vnd.sealedmedia.softseal.html": {
        source: "iana"
      },
      "application/vnd.sealedmedia.softseal.pdf": {
        source: "iana"
      },
      "application/vnd.seemail": {
        source: "iana",
        extensions: ["see"]
      },
      "application/vnd.seis+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.sema": {
        source: "iana",
        extensions: ["sema"]
      },
      "application/vnd.semd": {
        source: "iana",
        extensions: ["semd"]
      },
      "application/vnd.semf": {
        source: "iana",
        extensions: ["semf"]
      },
      "application/vnd.shade-save-file": {
        source: "iana"
      },
      "application/vnd.shana.informed.formdata": {
        source: "iana",
        extensions: ["ifm"]
      },
      "application/vnd.shana.informed.formtemplate": {
        source: "iana",
        extensions: ["itp"]
      },
      "application/vnd.shana.informed.interchange": {
        source: "iana",
        extensions: ["iif"]
      },
      "application/vnd.shana.informed.package": {
        source: "iana",
        extensions: ["ipk"]
      },
      "application/vnd.shootproof+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.shopkick+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.shp": {
        source: "iana"
      },
      "application/vnd.shx": {
        source: "iana"
      },
      "application/vnd.sigrok.session": {
        source: "iana"
      },
      "application/vnd.simtech-mindmapper": {
        source: "iana",
        extensions: ["twd", "twds"]
      },
      "application/vnd.siren+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.smaf": {
        source: "iana",
        extensions: ["mmf"]
      },
      "application/vnd.smart.notebook": {
        source: "iana"
      },
      "application/vnd.smart.teacher": {
        source: "iana",
        extensions: ["teacher"]
      },
      "application/vnd.snesdev-page-table": {
        source: "iana"
      },
      "application/vnd.software602.filler.form+xml": {
        source: "iana",
        compressible: true,
        extensions: ["fo"]
      },
      "application/vnd.software602.filler.form-xml-zip": {
        source: "iana"
      },
      "application/vnd.solent.sdkm+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sdkm", "sdkd"]
      },
      "application/vnd.spotfire.dxp": {
        source: "iana",
        extensions: ["dxp"]
      },
      "application/vnd.spotfire.sfs": {
        source: "iana",
        extensions: ["sfs"]
      },
      "application/vnd.sqlite3": {
        source: "iana"
      },
      "application/vnd.sss-cod": {
        source: "iana"
      },
      "application/vnd.sss-dtf": {
        source: "iana"
      },
      "application/vnd.sss-ntf": {
        source: "iana"
      },
      "application/vnd.stardivision.calc": {
        source: "apache",
        extensions: ["sdc"]
      },
      "application/vnd.stardivision.draw": {
        source: "apache",
        extensions: ["sda"]
      },
      "application/vnd.stardivision.impress": {
        source: "apache",
        extensions: ["sdd"]
      },
      "application/vnd.stardivision.math": {
        source: "apache",
        extensions: ["smf"]
      },
      "application/vnd.stardivision.writer": {
        source: "apache",
        extensions: ["sdw", "vor"]
      },
      "application/vnd.stardivision.writer-global": {
        source: "apache",
        extensions: ["sgl"]
      },
      "application/vnd.stepmania.package": {
        source: "iana",
        extensions: ["smzip"]
      },
      "application/vnd.stepmania.stepchart": {
        source: "iana",
        extensions: ["sm"]
      },
      "application/vnd.street-stream": {
        source: "iana"
      },
      "application/vnd.sun.wadl+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wadl"]
      },
      "application/vnd.sun.xml.calc": {
        source: "apache",
        extensions: ["sxc"]
      },
      "application/vnd.sun.xml.calc.template": {
        source: "apache",
        extensions: ["stc"]
      },
      "application/vnd.sun.xml.draw": {
        source: "apache",
        extensions: ["sxd"]
      },
      "application/vnd.sun.xml.draw.template": {
        source: "apache",
        extensions: ["std"]
      },
      "application/vnd.sun.xml.impress": {
        source: "apache",
        extensions: ["sxi"]
      },
      "application/vnd.sun.xml.impress.template": {
        source: "apache",
        extensions: ["sti"]
      },
      "application/vnd.sun.xml.math": {
        source: "apache",
        extensions: ["sxm"]
      },
      "application/vnd.sun.xml.writer": {
        source: "apache",
        extensions: ["sxw"]
      },
      "application/vnd.sun.xml.writer.global": {
        source: "apache",
        extensions: ["sxg"]
      },
      "application/vnd.sun.xml.writer.template": {
        source: "apache",
        extensions: ["stw"]
      },
      "application/vnd.sus-calendar": {
        source: "iana",
        extensions: ["sus", "susp"]
      },
      "application/vnd.svd": {
        source: "iana",
        extensions: ["svd"]
      },
      "application/vnd.swiftview-ics": {
        source: "iana"
      },
      "application/vnd.sycle+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.syft+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.symbian.install": {
        source: "apache",
        extensions: ["sis", "sisx"]
      },
      "application/vnd.syncml+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["xsm"]
      },
      "application/vnd.syncml.dm+wbxml": {
        source: "iana",
        charset: "UTF-8",
        extensions: ["bdm"]
      },
      "application/vnd.syncml.dm+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["xdm"]
      },
      "application/vnd.syncml.dm.notification": {
        source: "iana"
      },
      "application/vnd.syncml.dmddf+wbxml": {
        source: "iana"
      },
      "application/vnd.syncml.dmddf+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["ddf"]
      },
      "application/vnd.syncml.dmtnds+wbxml": {
        source: "iana"
      },
      "application/vnd.syncml.dmtnds+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.syncml.ds.notification": {
        source: "iana"
      },
      "application/vnd.tableschema+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.tao.intent-module-archive": {
        source: "iana",
        extensions: ["tao"]
      },
      "application/vnd.tcpdump.pcap": {
        source: "iana",
        extensions: ["pcap", "cap", "dmp"]
      },
      "application/vnd.think-cell.ppttc+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.tmd.mediaflex.api+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.tml": {
        source: "iana"
      },
      "application/vnd.tmobile-livetv": {
        source: "iana",
        extensions: ["tmo"]
      },
      "application/vnd.tri.onesource": {
        source: "iana"
      },
      "application/vnd.trid.tpt": {
        source: "iana",
        extensions: ["tpt"]
      },
      "application/vnd.triscape.mxs": {
        source: "iana",
        extensions: ["mxs"]
      },
      "application/vnd.trueapp": {
        source: "iana",
        extensions: ["tra"]
      },
      "application/vnd.truedoc": {
        source: "iana"
      },
      "application/vnd.ubisoft.webplayer": {
        source: "iana"
      },
      "application/vnd.ufdl": {
        source: "iana",
        extensions: ["ufd", "ufdl"]
      },
      "application/vnd.uiq.theme": {
        source: "iana",
        extensions: ["utz"]
      },
      "application/vnd.umajin": {
        source: "iana",
        extensions: ["umj"]
      },
      "application/vnd.unity": {
        source: "iana",
        extensions: ["unityweb"]
      },
      "application/vnd.uoml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["uoml"]
      },
      "application/vnd.uplanet.alert": {
        source: "iana"
      },
      "application/vnd.uplanet.alert-wbxml": {
        source: "iana"
      },
      "application/vnd.uplanet.bearer-choice": {
        source: "iana"
      },
      "application/vnd.uplanet.bearer-choice-wbxml": {
        source: "iana"
      },
      "application/vnd.uplanet.cacheop": {
        source: "iana"
      },
      "application/vnd.uplanet.cacheop-wbxml": {
        source: "iana"
      },
      "application/vnd.uplanet.channel": {
        source: "iana"
      },
      "application/vnd.uplanet.channel-wbxml": {
        source: "iana"
      },
      "application/vnd.uplanet.list": {
        source: "iana"
      },
      "application/vnd.uplanet.list-wbxml": {
        source: "iana"
      },
      "application/vnd.uplanet.listcmd": {
        source: "iana"
      },
      "application/vnd.uplanet.listcmd-wbxml": {
        source: "iana"
      },
      "application/vnd.uplanet.signal": {
        source: "iana"
      },
      "application/vnd.uri-map": {
        source: "iana"
      },
      "application/vnd.valve.source.material": {
        source: "iana"
      },
      "application/vnd.vcx": {
        source: "iana",
        extensions: ["vcx"]
      },
      "application/vnd.vd-study": {
        source: "iana"
      },
      "application/vnd.vectorworks": {
        source: "iana"
      },
      "application/vnd.vel+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.verimatrix.vcas": {
        source: "iana"
      },
      "application/vnd.veritone.aion+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.veryant.thin": {
        source: "iana"
      },
      "application/vnd.ves.encrypted": {
        source: "iana"
      },
      "application/vnd.vidsoft.vidconference": {
        source: "iana"
      },
      "application/vnd.visio": {
        source: "iana",
        extensions: ["vsd", "vst", "vss", "vsw"]
      },
      "application/vnd.visionary": {
        source: "iana",
        extensions: ["vis"]
      },
      "application/vnd.vividence.scriptfile": {
        source: "iana"
      },
      "application/vnd.vsf": {
        source: "iana",
        extensions: ["vsf"]
      },
      "application/vnd.wap.sic": {
        source: "iana"
      },
      "application/vnd.wap.slc": {
        source: "iana"
      },
      "application/vnd.wap.wbxml": {
        source: "iana",
        charset: "UTF-8",
        extensions: ["wbxml"]
      },
      "application/vnd.wap.wmlc": {
        source: "iana",
        extensions: ["wmlc"]
      },
      "application/vnd.wap.wmlscriptc": {
        source: "iana",
        extensions: ["wmlsc"]
      },
      "application/vnd.webturbo": {
        source: "iana",
        extensions: ["wtb"]
      },
      "application/vnd.wfa.dpp": {
        source: "iana"
      },
      "application/vnd.wfa.p2p": {
        source: "iana"
      },
      "application/vnd.wfa.wsc": {
        source: "iana"
      },
      "application/vnd.windows.devicepairing": {
        source: "iana"
      },
      "application/vnd.wmc": {
        source: "iana"
      },
      "application/vnd.wmf.bootstrap": {
        source: "iana"
      },
      "application/vnd.wolfram.mathematica": {
        source: "iana"
      },
      "application/vnd.wolfram.mathematica.package": {
        source: "iana"
      },
      "application/vnd.wolfram.player": {
        source: "iana",
        extensions: ["nbp"]
      },
      "application/vnd.wordperfect": {
        source: "iana",
        extensions: ["wpd"]
      },
      "application/vnd.wqd": {
        source: "iana",
        extensions: ["wqd"]
      },
      "application/vnd.wrq-hp3000-labelled": {
        source: "iana"
      },
      "application/vnd.wt.stf": {
        source: "iana",
        extensions: ["stf"]
      },
      "application/vnd.wv.csp+wbxml": {
        source: "iana"
      },
      "application/vnd.wv.csp+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.wv.ssp+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.xacml+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.xara": {
        source: "iana",
        extensions: ["xar"]
      },
      "application/vnd.xfdl": {
        source: "iana",
        extensions: ["xfdl"]
      },
      "application/vnd.xfdl.webform": {
        source: "iana"
      },
      "application/vnd.xmi+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.xmpie.cpkg": {
        source: "iana"
      },
      "application/vnd.xmpie.dpkg": {
        source: "iana"
      },
      "application/vnd.xmpie.plan": {
        source: "iana"
      },
      "application/vnd.xmpie.ppkg": {
        source: "iana"
      },
      "application/vnd.xmpie.xlim": {
        source: "iana"
      },
      "application/vnd.yamaha.hv-dic": {
        source: "iana",
        extensions: ["hvd"]
      },
      "application/vnd.yamaha.hv-script": {
        source: "iana",
        extensions: ["hvs"]
      },
      "application/vnd.yamaha.hv-voice": {
        source: "iana",
        extensions: ["hvp"]
      },
      "application/vnd.yamaha.openscoreformat": {
        source: "iana",
        extensions: ["osf"]
      },
      "application/vnd.yamaha.openscoreformat.osfpvg+xml": {
        source: "iana",
        compressible: true,
        extensions: ["osfpvg"]
      },
      "application/vnd.yamaha.remote-setup": {
        source: "iana"
      },
      "application/vnd.yamaha.smaf-audio": {
        source: "iana",
        extensions: ["saf"]
      },
      "application/vnd.yamaha.smaf-phrase": {
        source: "iana",
        extensions: ["spf"]
      },
      "application/vnd.yamaha.through-ngn": {
        source: "iana"
      },
      "application/vnd.yamaha.tunnel-udpencap": {
        source: "iana"
      },
      "application/vnd.yaoweme": {
        source: "iana"
      },
      "application/vnd.yellowriver-custom-menu": {
        source: "iana",
        extensions: ["cmp"]
      },
      "application/vnd.youtube.yt": {
        source: "iana"
      },
      "application/vnd.zul": {
        source: "iana",
        extensions: ["zir", "zirz"]
      },
      "application/vnd.zzazz.deck+xml": {
        source: "iana",
        compressible: true,
        extensions: ["zaz"]
      },
      "application/voicexml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["vxml"]
      },
      "application/voucher-cms+json": {
        source: "iana",
        compressible: true
      },
      "application/vq-rtcpxr": {
        source: "iana"
      },
      "application/wasm": {
        source: "iana",
        compressible: true,
        extensions: ["wasm"]
      },
      "application/watcherinfo+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wif"]
      },
      "application/webpush-options+json": {
        source: "iana",
        compressible: true
      },
      "application/whoispp-query": {
        source: "iana"
      },
      "application/whoispp-response": {
        source: "iana"
      },
      "application/widget": {
        source: "iana",
        extensions: ["wgt"]
      },
      "application/winhlp": {
        source: "apache",
        extensions: ["hlp"]
      },
      "application/wita": {
        source: "iana"
      },
      "application/wordperfect5.1": {
        source: "iana"
      },
      "application/wsdl+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wsdl"]
      },
      "application/wspolicy+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wspolicy"]
      },
      "application/x-7z-compressed": {
        source: "apache",
        compressible: false,
        extensions: ["7z"]
      },
      "application/x-abiword": {
        source: "apache",
        extensions: ["abw"]
      },
      "application/x-ace-compressed": {
        source: "apache",
        extensions: ["ace"]
      },
      "application/x-amf": {
        source: "apache"
      },
      "application/x-apple-diskimage": {
        source: "apache",
        extensions: ["dmg"]
      },
      "application/x-arj": {
        compressible: false,
        extensions: ["arj"]
      },
      "application/x-authorware-bin": {
        source: "apache",
        extensions: ["aab", "x32", "u32", "vox"]
      },
      "application/x-authorware-map": {
        source: "apache",
        extensions: ["aam"]
      },
      "application/x-authorware-seg": {
        source: "apache",
        extensions: ["aas"]
      },
      "application/x-bcpio": {
        source: "apache",
        extensions: ["bcpio"]
      },
      "application/x-bdoc": {
        compressible: false,
        extensions: ["bdoc"]
      },
      "application/x-bittorrent": {
        source: "apache",
        extensions: ["torrent"]
      },
      "application/x-blorb": {
        source: "apache",
        extensions: ["blb", "blorb"]
      },
      "application/x-bzip": {
        source: "apache",
        compressible: false,
        extensions: ["bz"]
      },
      "application/x-bzip2": {
        source: "apache",
        compressible: false,
        extensions: ["bz2", "boz"]
      },
      "application/x-cbr": {
        source: "apache",
        extensions: ["cbr", "cba", "cbt", "cbz", "cb7"]
      },
      "application/x-cdlink": {
        source: "apache",
        extensions: ["vcd"]
      },
      "application/x-cfs-compressed": {
        source: "apache",
        extensions: ["cfs"]
      },
      "application/x-chat": {
        source: "apache",
        extensions: ["chat"]
      },
      "application/x-chess-pgn": {
        source: "apache",
        extensions: ["pgn"]
      },
      "application/x-chrome-extension": {
        extensions: ["crx"]
      },
      "application/x-cocoa": {
        source: "nginx",
        extensions: ["cco"]
      },
      "application/x-compress": {
        source: "apache"
      },
      "application/x-conference": {
        source: "apache",
        extensions: ["nsc"]
      },
      "application/x-cpio": {
        source: "apache",
        extensions: ["cpio"]
      },
      "application/x-csh": {
        source: "apache",
        extensions: ["csh"]
      },
      "application/x-deb": {
        compressible: false
      },
      "application/x-debian-package": {
        source: "apache",
        extensions: ["deb", "udeb"]
      },
      "application/x-dgc-compressed": {
        source: "apache",
        extensions: ["dgc"]
      },
      "application/x-director": {
        source: "apache",
        extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"]
      },
      "application/x-doom": {
        source: "apache",
        extensions: ["wad"]
      },
      "application/x-dtbncx+xml": {
        source: "apache",
        compressible: true,
        extensions: ["ncx"]
      },
      "application/x-dtbook+xml": {
        source: "apache",
        compressible: true,
        extensions: ["dtb"]
      },
      "application/x-dtbresource+xml": {
        source: "apache",
        compressible: true,
        extensions: ["res"]
      },
      "application/x-dvi": {
        source: "apache",
        compressible: false,
        extensions: ["dvi"]
      },
      "application/x-envoy": {
        source: "apache",
        extensions: ["evy"]
      },
      "application/x-eva": {
        source: "apache",
        extensions: ["eva"]
      },
      "application/x-font-bdf": {
        source: "apache",
        extensions: ["bdf"]
      },
      "application/x-font-dos": {
        source: "apache"
      },
      "application/x-font-framemaker": {
        source: "apache"
      },
      "application/x-font-ghostscript": {
        source: "apache",
        extensions: ["gsf"]
      },
      "application/x-font-libgrx": {
        source: "apache"
      },
      "application/x-font-linux-psf": {
        source: "apache",
        extensions: ["psf"]
      },
      "application/x-font-pcf": {
        source: "apache",
        extensions: ["pcf"]
      },
      "application/x-font-snf": {
        source: "apache",
        extensions: ["snf"]
      },
      "application/x-font-speedo": {
        source: "apache"
      },
      "application/x-font-sunos-news": {
        source: "apache"
      },
      "application/x-font-type1": {
        source: "apache",
        extensions: ["pfa", "pfb", "pfm", "afm"]
      },
      "application/x-font-vfont": {
        source: "apache"
      },
      "application/x-freearc": {
        source: "apache",
        extensions: ["arc"]
      },
      "application/x-futuresplash": {
        source: "apache",
        extensions: ["spl"]
      },
      "application/x-gca-compressed": {
        source: "apache",
        extensions: ["gca"]
      },
      "application/x-glulx": {
        source: "apache",
        extensions: ["ulx"]
      },
      "application/x-gnumeric": {
        source: "apache",
        extensions: ["gnumeric"]
      },
      "application/x-gramps-xml": {
        source: "apache",
        extensions: ["gramps"]
      },
      "application/x-gtar": {
        source: "apache",
        extensions: ["gtar"]
      },
      "application/x-gzip": {
        source: "apache"
      },
      "application/x-hdf": {
        source: "apache",
        extensions: ["hdf"]
      },
      "application/x-httpd-php": {
        compressible: true,
        extensions: ["php"]
      },
      "application/x-install-instructions": {
        source: "apache",
        extensions: ["install"]
      },
      "application/x-iso9660-image": {
        source: "apache",
        extensions: ["iso"]
      },
      "application/x-iwork-keynote-sffkey": {
        extensions: ["key"]
      },
      "application/x-iwork-numbers-sffnumbers": {
        extensions: ["numbers"]
      },
      "application/x-iwork-pages-sffpages": {
        extensions: ["pages"]
      },
      "application/x-java-archive-diff": {
        source: "nginx",
        extensions: ["jardiff"]
      },
      "application/x-java-jnlp-file": {
        source: "apache",
        compressible: false,
        extensions: ["jnlp"]
      },
      "application/x-javascript": {
        compressible: true
      },
      "application/x-keepass2": {
        extensions: ["kdbx"]
      },
      "application/x-latex": {
        source: "apache",
        compressible: false,
        extensions: ["latex"]
      },
      "application/x-lua-bytecode": {
        extensions: ["luac"]
      },
      "application/x-lzh-compressed": {
        source: "apache",
        extensions: ["lzh", "lha"]
      },
      "application/x-makeself": {
        source: "nginx",
        extensions: ["run"]
      },
      "application/x-mie": {
        source: "apache",
        extensions: ["mie"]
      },
      "application/x-mobipocket-ebook": {
        source: "apache",
        extensions: ["prc", "mobi"]
      },
      "application/x-mpegurl": {
        compressible: false
      },
      "application/x-ms-application": {
        source: "apache",
        extensions: ["application"]
      },
      "application/x-ms-shortcut": {
        source: "apache",
        extensions: ["lnk"]
      },
      "application/x-ms-wmd": {
        source: "apache",
        extensions: ["wmd"]
      },
      "application/x-ms-wmz": {
        source: "apache",
        extensions: ["wmz"]
      },
      "application/x-ms-xbap": {
        source: "apache",
        extensions: ["xbap"]
      },
      "application/x-msaccess": {
        source: "apache",
        extensions: ["mdb"]
      },
      "application/x-msbinder": {
        source: "apache",
        extensions: ["obd"]
      },
      "application/x-mscardfile": {
        source: "apache",
        extensions: ["crd"]
      },
      "application/x-msclip": {
        source: "apache",
        extensions: ["clp"]
      },
      "application/x-msdos-program": {
        extensions: ["exe"]
      },
      "application/x-msdownload": {
        source: "apache",
        extensions: ["exe", "dll", "com", "bat", "msi"]
      },
      "application/x-msmediaview": {
        source: "apache",
        extensions: ["mvb", "m13", "m14"]
      },
      "application/x-msmetafile": {
        source: "apache",
        extensions: ["wmf", "wmz", "emf", "emz"]
      },
      "application/x-msmoney": {
        source: "apache",
        extensions: ["mny"]
      },
      "application/x-mspublisher": {
        source: "apache",
        extensions: ["pub"]
      },
      "application/x-msschedule": {
        source: "apache",
        extensions: ["scd"]
      },
      "application/x-msterminal": {
        source: "apache",
        extensions: ["trm"]
      },
      "application/x-mswrite": {
        source: "apache",
        extensions: ["wri"]
      },
      "application/x-netcdf": {
        source: "apache",
        extensions: ["nc", "cdf"]
      },
      "application/x-ns-proxy-autoconfig": {
        compressible: true,
        extensions: ["pac"]
      },
      "application/x-nzb": {
        source: "apache",
        extensions: ["nzb"]
      },
      "application/x-perl": {
        source: "nginx",
        extensions: ["pl", "pm"]
      },
      "application/x-pilot": {
        source: "nginx",
        extensions: ["prc", "pdb"]
      },
      "application/x-pkcs12": {
        source: "apache",
        compressible: false,
        extensions: ["p12", "pfx"]
      },
      "application/x-pkcs7-certificates": {
        source: "apache",
        extensions: ["p7b", "spc"]
      },
      "application/x-pkcs7-certreqresp": {
        source: "apache",
        extensions: ["p7r"]
      },
      "application/x-pki-message": {
        source: "iana"
      },
      "application/x-rar-compressed": {
        source: "apache",
        compressible: false,
        extensions: ["rar"]
      },
      "application/x-redhat-package-manager": {
        source: "nginx",
        extensions: ["rpm"]
      },
      "application/x-research-info-systems": {
        source: "apache",
        extensions: ["ris"]
      },
      "application/x-sea": {
        source: "nginx",
        extensions: ["sea"]
      },
      "application/x-sh": {
        source: "apache",
        compressible: true,
        extensions: ["sh"]
      },
      "application/x-shar": {
        source: "apache",
        extensions: ["shar"]
      },
      "application/x-shockwave-flash": {
        source: "apache",
        compressible: false,
        extensions: ["swf"]
      },
      "application/x-silverlight-app": {
        source: "apache",
        extensions: ["xap"]
      },
      "application/x-sql": {
        source: "apache",
        extensions: ["sql"]
      },
      "application/x-stuffit": {
        source: "apache",
        compressible: false,
        extensions: ["sit"]
      },
      "application/x-stuffitx": {
        source: "apache",
        extensions: ["sitx"]
      },
      "application/x-subrip": {
        source: "apache",
        extensions: ["srt"]
      },
      "application/x-sv4cpio": {
        source: "apache",
        extensions: ["sv4cpio"]
      },
      "application/x-sv4crc": {
        source: "apache",
        extensions: ["sv4crc"]
      },
      "application/x-t3vm-image": {
        source: "apache",
        extensions: ["t3"]
      },
      "application/x-tads": {
        source: "apache",
        extensions: ["gam"]
      },
      "application/x-tar": {
        source: "apache",
        compressible: true,
        extensions: ["tar"]
      },
      "application/x-tcl": {
        source: "apache",
        extensions: ["tcl", "tk"]
      },
      "application/x-tex": {
        source: "apache",
        extensions: ["tex"]
      },
      "application/x-tex-tfm": {
        source: "apache",
        extensions: ["tfm"]
      },
      "application/x-texinfo": {
        source: "apache",
        extensions: ["texinfo", "texi"]
      },
      "application/x-tgif": {
        source: "apache",
        extensions: ["obj"]
      },
      "application/x-ustar": {
        source: "apache",
        extensions: ["ustar"]
      },
      "application/x-virtualbox-hdd": {
        compressible: true,
        extensions: ["hdd"]
      },
      "application/x-virtualbox-ova": {
        compressible: true,
        extensions: ["ova"]
      },
      "application/x-virtualbox-ovf": {
        compressible: true,
        extensions: ["ovf"]
      },
      "application/x-virtualbox-vbox": {
        compressible: true,
        extensions: ["vbox"]
      },
      "application/x-virtualbox-vbox-extpack": {
        compressible: false,
        extensions: ["vbox-extpack"]
      },
      "application/x-virtualbox-vdi": {
        compressible: true,
        extensions: ["vdi"]
      },
      "application/x-virtualbox-vhd": {
        compressible: true,
        extensions: ["vhd"]
      },
      "application/x-virtualbox-vmdk": {
        compressible: true,
        extensions: ["vmdk"]
      },
      "application/x-wais-source": {
        source: "apache",
        extensions: ["src"]
      },
      "application/x-web-app-manifest+json": {
        compressible: true,
        extensions: ["webapp"]
      },
      "application/x-www-form-urlencoded": {
        source: "iana",
        compressible: true
      },
      "application/x-x509-ca-cert": {
        source: "iana",
        extensions: ["der", "crt", "pem"]
      },
      "application/x-x509-ca-ra-cert": {
        source: "iana"
      },
      "application/x-x509-next-ca-cert": {
        source: "iana"
      },
      "application/x-xfig": {
        source: "apache",
        extensions: ["fig"]
      },
      "application/x-xliff+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xlf"]
      },
      "application/x-xpinstall": {
        source: "apache",
        compressible: false,
        extensions: ["xpi"]
      },
      "application/x-xz": {
        source: "apache",
        extensions: ["xz"]
      },
      "application/x-zmachine": {
        source: "apache",
        extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"]
      },
      "application/x400-bp": {
        source: "iana"
      },
      "application/xacml+xml": {
        source: "iana",
        compressible: true
      },
      "application/xaml+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xaml"]
      },
      "application/xcap-att+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xav"]
      },
      "application/xcap-caps+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xca"]
      },
      "application/xcap-diff+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xdf"]
      },
      "application/xcap-el+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xel"]
      },
      "application/xcap-error+xml": {
        source: "iana",
        compressible: true
      },
      "application/xcap-ns+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xns"]
      },
      "application/xcon-conference-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/xcon-conference-info-diff+xml": {
        source: "iana",
        compressible: true
      },
      "application/xenc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xenc"]
      },
      "application/xhtml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xhtml", "xht"]
      },
      "application/xhtml-voice+xml": {
        source: "apache",
        compressible: true
      },
      "application/xliff+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xlf"]
      },
      "application/xml": {
        source: "iana",
        compressible: true,
        extensions: ["xml", "xsl", "xsd", "rng"]
      },
      "application/xml-dtd": {
        source: "iana",
        compressible: true,
        extensions: ["dtd"]
      },
      "application/xml-external-parsed-entity": {
        source: "iana"
      },
      "application/xml-patch+xml": {
        source: "iana",
        compressible: true
      },
      "application/xmpp+xml": {
        source: "iana",
        compressible: true
      },
      "application/xop+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xop"]
      },
      "application/xproc+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xpl"]
      },
      "application/xslt+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xsl", "xslt"]
      },
      "application/xspf+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xspf"]
      },
      "application/xv+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mxml", "xhvml", "xvml", "xvm"]
      },
      "application/yang": {
        source: "iana",
        extensions: ["yang"]
      },
      "application/yang-data+json": {
        source: "iana",
        compressible: true
      },
      "application/yang-data+xml": {
        source: "iana",
        compressible: true
      },
      "application/yang-patch+json": {
        source: "iana",
        compressible: true
      },
      "application/yang-patch+xml": {
        source: "iana",
        compressible: true
      },
      "application/yin+xml": {
        source: "iana",
        compressible: true,
        extensions: ["yin"]
      },
      "application/zip": {
        source: "iana",
        compressible: false,
        extensions: ["zip"]
      },
      "application/zlib": {
        source: "iana"
      },
      "application/zstd": {
        source: "iana"
      },
      "audio/1d-interleaved-parityfec": {
        source: "iana"
      },
      "audio/32kadpcm": {
        source: "iana"
      },
      "audio/3gpp": {
        source: "iana",
        compressible: false,
        extensions: ["3gpp"]
      },
      "audio/3gpp2": {
        source: "iana"
      },
      "audio/aac": {
        source: "iana"
      },
      "audio/ac3": {
        source: "iana"
      },
      "audio/adpcm": {
        source: "apache",
        extensions: ["adp"]
      },
      "audio/amr": {
        source: "iana",
        extensions: ["amr"]
      },
      "audio/amr-wb": {
        source: "iana"
      },
      "audio/amr-wb+": {
        source: "iana"
      },
      "audio/aptx": {
        source: "iana"
      },
      "audio/asc": {
        source: "iana"
      },
      "audio/atrac-advanced-lossless": {
        source: "iana"
      },
      "audio/atrac-x": {
        source: "iana"
      },
      "audio/atrac3": {
        source: "iana"
      },
      "audio/basic": {
        source: "iana",
        compressible: false,
        extensions: ["au", "snd"]
      },
      "audio/bv16": {
        source: "iana"
      },
      "audio/bv32": {
        source: "iana"
      },
      "audio/clearmode": {
        source: "iana"
      },
      "audio/cn": {
        source: "iana"
      },
      "audio/dat12": {
        source: "iana"
      },
      "audio/dls": {
        source: "iana"
      },
      "audio/dsr-es201108": {
        source: "iana"
      },
      "audio/dsr-es202050": {
        source: "iana"
      },
      "audio/dsr-es202211": {
        source: "iana"
      },
      "audio/dsr-es202212": {
        source: "iana"
      },
      "audio/dv": {
        source: "iana"
      },
      "audio/dvi4": {
        source: "iana"
      },
      "audio/eac3": {
        source: "iana"
      },
      "audio/encaprtp": {
        source: "iana"
      },
      "audio/evrc": {
        source: "iana"
      },
      "audio/evrc-qcp": {
        source: "iana"
      },
      "audio/evrc0": {
        source: "iana"
      },
      "audio/evrc1": {
        source: "iana"
      },
      "audio/evrcb": {
        source: "iana"
      },
      "audio/evrcb0": {
        source: "iana"
      },
      "audio/evrcb1": {
        source: "iana"
      },
      "audio/evrcnw": {
        source: "iana"
      },
      "audio/evrcnw0": {
        source: "iana"
      },
      "audio/evrcnw1": {
        source: "iana"
      },
      "audio/evrcwb": {
        source: "iana"
      },
      "audio/evrcwb0": {
        source: "iana"
      },
      "audio/evrcwb1": {
        source: "iana"
      },
      "audio/evs": {
        source: "iana"
      },
      "audio/flexfec": {
        source: "iana"
      },
      "audio/fwdred": {
        source: "iana"
      },
      "audio/g711-0": {
        source: "iana"
      },
      "audio/g719": {
        source: "iana"
      },
      "audio/g722": {
        source: "iana"
      },
      "audio/g7221": {
        source: "iana"
      },
      "audio/g723": {
        source: "iana"
      },
      "audio/g726-16": {
        source: "iana"
      },
      "audio/g726-24": {
        source: "iana"
      },
      "audio/g726-32": {
        source: "iana"
      },
      "audio/g726-40": {
        source: "iana"
      },
      "audio/g728": {
        source: "iana"
      },
      "audio/g729": {
        source: "iana"
      },
      "audio/g7291": {
        source: "iana"
      },
      "audio/g729d": {
        source: "iana"
      },
      "audio/g729e": {
        source: "iana"
      },
      "audio/gsm": {
        source: "iana"
      },
      "audio/gsm-efr": {
        source: "iana"
      },
      "audio/gsm-hr-08": {
        source: "iana"
      },
      "audio/ilbc": {
        source: "iana"
      },
      "audio/ip-mr_v2.5": {
        source: "iana"
      },
      "audio/isac": {
        source: "apache"
      },
      "audio/l16": {
        source: "iana"
      },
      "audio/l20": {
        source: "iana"
      },
      "audio/l24": {
        source: "iana",
        compressible: false
      },
      "audio/l8": {
        source: "iana"
      },
      "audio/lpc": {
        source: "iana"
      },
      "audio/melp": {
        source: "iana"
      },
      "audio/melp1200": {
        source: "iana"
      },
      "audio/melp2400": {
        source: "iana"
      },
      "audio/melp600": {
        source: "iana"
      },
      "audio/mhas": {
        source: "iana"
      },
      "audio/midi": {
        source: "apache",
        extensions: ["mid", "midi", "kar", "rmi"]
      },
      "audio/mobile-xmf": {
        source: "iana",
        extensions: ["mxmf"]
      },
      "audio/mp3": {
        compressible: false,
        extensions: ["mp3"]
      },
      "audio/mp4": {
        source: "iana",
        compressible: false,
        extensions: ["m4a", "mp4a"]
      },
      "audio/mp4a-latm": {
        source: "iana"
      },
      "audio/mpa": {
        source: "iana"
      },
      "audio/mpa-robust": {
        source: "iana"
      },
      "audio/mpeg": {
        source: "iana",
        compressible: false,
        extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"]
      },
      "audio/mpeg4-generic": {
        source: "iana"
      },
      "audio/musepack": {
        source: "apache"
      },
      "audio/ogg": {
        source: "iana",
        compressible: false,
        extensions: ["oga", "ogg", "spx", "opus"]
      },
      "audio/opus": {
        source: "iana"
      },
      "audio/parityfec": {
        source: "iana"
      },
      "audio/pcma": {
        source: "iana"
      },
      "audio/pcma-wb": {
        source: "iana"
      },
      "audio/pcmu": {
        source: "iana"
      },
      "audio/pcmu-wb": {
        source: "iana"
      },
      "audio/prs.sid": {
        source: "iana"
      },
      "audio/qcelp": {
        source: "iana"
      },
      "audio/raptorfec": {
        source: "iana"
      },
      "audio/red": {
        source: "iana"
      },
      "audio/rtp-enc-aescm128": {
        source: "iana"
      },
      "audio/rtp-midi": {
        source: "iana"
      },
      "audio/rtploopback": {
        source: "iana"
      },
      "audio/rtx": {
        source: "iana"
      },
      "audio/s3m": {
        source: "apache",
        extensions: ["s3m"]
      },
      "audio/scip": {
        source: "iana"
      },
      "audio/silk": {
        source: "apache",
        extensions: ["sil"]
      },
      "audio/smv": {
        source: "iana"
      },
      "audio/smv-qcp": {
        source: "iana"
      },
      "audio/smv0": {
        source: "iana"
      },
      "audio/sofa": {
        source: "iana"
      },
      "audio/sp-midi": {
        source: "iana"
      },
      "audio/speex": {
        source: "iana"
      },
      "audio/t140c": {
        source: "iana"
      },
      "audio/t38": {
        source: "iana"
      },
      "audio/telephone-event": {
        source: "iana"
      },
      "audio/tetra_acelp": {
        source: "iana"
      },
      "audio/tetra_acelp_bb": {
        source: "iana"
      },
      "audio/tone": {
        source: "iana"
      },
      "audio/tsvcis": {
        source: "iana"
      },
      "audio/uemclip": {
        source: "iana"
      },
      "audio/ulpfec": {
        source: "iana"
      },
      "audio/usac": {
        source: "iana"
      },
      "audio/vdvi": {
        source: "iana"
      },
      "audio/vmr-wb": {
        source: "iana"
      },
      "audio/vnd.3gpp.iufp": {
        source: "iana"
      },
      "audio/vnd.4sb": {
        source: "iana"
      },
      "audio/vnd.audiokoz": {
        source: "iana"
      },
      "audio/vnd.celp": {
        source: "iana"
      },
      "audio/vnd.cisco.nse": {
        source: "iana"
      },
      "audio/vnd.cmles.radio-events": {
        source: "iana"
      },
      "audio/vnd.cns.anp1": {
        source: "iana"
      },
      "audio/vnd.cns.inf1": {
        source: "iana"
      },
      "audio/vnd.dece.audio": {
        source: "iana",
        extensions: ["uva", "uvva"]
      },
      "audio/vnd.digital-winds": {
        source: "iana",
        extensions: ["eol"]
      },
      "audio/vnd.dlna.adts": {
        source: "iana"
      },
      "audio/vnd.dolby.heaac.1": {
        source: "iana"
      },
      "audio/vnd.dolby.heaac.2": {
        source: "iana"
      },
      "audio/vnd.dolby.mlp": {
        source: "iana"
      },
      "audio/vnd.dolby.mps": {
        source: "iana"
      },
      "audio/vnd.dolby.pl2": {
        source: "iana"
      },
      "audio/vnd.dolby.pl2x": {
        source: "iana"
      },
      "audio/vnd.dolby.pl2z": {
        source: "iana"
      },
      "audio/vnd.dolby.pulse.1": {
        source: "iana"
      },
      "audio/vnd.dra": {
        source: "iana",
        extensions: ["dra"]
      },
      "audio/vnd.dts": {
        source: "iana",
        extensions: ["dts"]
      },
      "audio/vnd.dts.hd": {
        source: "iana",
        extensions: ["dtshd"]
      },
      "audio/vnd.dts.uhd": {
        source: "iana"
      },
      "audio/vnd.dvb.file": {
        source: "iana"
      },
      "audio/vnd.everad.plj": {
        source: "iana"
      },
      "audio/vnd.hns.audio": {
        source: "iana"
      },
      "audio/vnd.lucent.voice": {
        source: "iana",
        extensions: ["lvp"]
      },
      "audio/vnd.ms-playready.media.pya": {
        source: "iana",
        extensions: ["pya"]
      },
      "audio/vnd.nokia.mobile-xmf": {
        source: "iana"
      },
      "audio/vnd.nortel.vbk": {
        source: "iana"
      },
      "audio/vnd.nuera.ecelp4800": {
        source: "iana",
        extensions: ["ecelp4800"]
      },
      "audio/vnd.nuera.ecelp7470": {
        source: "iana",
        extensions: ["ecelp7470"]
      },
      "audio/vnd.nuera.ecelp9600": {
        source: "iana",
        extensions: ["ecelp9600"]
      },
      "audio/vnd.octel.sbc": {
        source: "iana"
      },
      "audio/vnd.presonus.multitrack": {
        source: "iana"
      },
      "audio/vnd.qcelp": {
        source: "iana"
      },
      "audio/vnd.rhetorex.32kadpcm": {
        source: "iana"
      },
      "audio/vnd.rip": {
        source: "iana",
        extensions: ["rip"]
      },
      "audio/vnd.rn-realaudio": {
        compressible: false
      },
      "audio/vnd.sealedmedia.softseal.mpeg": {
        source: "iana"
      },
      "audio/vnd.vmx.cvsd": {
        source: "iana"
      },
      "audio/vnd.wave": {
        compressible: false
      },
      "audio/vorbis": {
        source: "iana",
        compressible: false
      },
      "audio/vorbis-config": {
        source: "iana"
      },
      "audio/wav": {
        compressible: false,
        extensions: ["wav"]
      },
      "audio/wave": {
        compressible: false,
        extensions: ["wav"]
      },
      "audio/webm": {
        source: "apache",
        compressible: false,
        extensions: ["weba"]
      },
      "audio/x-aac": {
        source: "apache",
        compressible: false,
        extensions: ["aac"]
      },
      "audio/x-aiff": {
        source: "apache",
        extensions: ["aif", "aiff", "aifc"]
      },
      "audio/x-caf": {
        source: "apache",
        compressible: false,
        extensions: ["caf"]
      },
      "audio/x-flac": {
        source: "apache",
        extensions: ["flac"]
      },
      "audio/x-m4a": {
        source: "nginx",
        extensions: ["m4a"]
      },
      "audio/x-matroska": {
        source: "apache",
        extensions: ["mka"]
      },
      "audio/x-mpegurl": {
        source: "apache",
        extensions: ["m3u"]
      },
      "audio/x-ms-wax": {
        source: "apache",
        extensions: ["wax"]
      },
      "audio/x-ms-wma": {
        source: "apache",
        extensions: ["wma"]
      },
      "audio/x-pn-realaudio": {
        source: "apache",
        extensions: ["ram", "ra"]
      },
      "audio/x-pn-realaudio-plugin": {
        source: "apache",
        extensions: ["rmp"]
      },
      "audio/x-realaudio": {
        source: "nginx",
        extensions: ["ra"]
      },
      "audio/x-tta": {
        source: "apache"
      },
      "audio/x-wav": {
        source: "apache",
        extensions: ["wav"]
      },
      "audio/xm": {
        source: "apache",
        extensions: ["xm"]
      },
      "chemical/x-cdx": {
        source: "apache",
        extensions: ["cdx"]
      },
      "chemical/x-cif": {
        source: "apache",
        extensions: ["cif"]
      },
      "chemical/x-cmdf": {
        source: "apache",
        extensions: ["cmdf"]
      },
      "chemical/x-cml": {
        source: "apache",
        extensions: ["cml"]
      },
      "chemical/x-csml": {
        source: "apache",
        extensions: ["csml"]
      },
      "chemical/x-pdb": {
        source: "apache"
      },
      "chemical/x-xyz": {
        source: "apache",
        extensions: ["xyz"]
      },
      "font/collection": {
        source: "iana",
        extensions: ["ttc"]
      },
      "font/otf": {
        source: "iana",
        compressible: true,
        extensions: ["otf"]
      },
      "font/sfnt": {
        source: "iana"
      },
      "font/ttf": {
        source: "iana",
        compressible: true,
        extensions: ["ttf"]
      },
      "font/woff": {
        source: "iana",
        extensions: ["woff"]
      },
      "font/woff2": {
        source: "iana",
        extensions: ["woff2"]
      },
      "image/aces": {
        source: "iana",
        extensions: ["exr"]
      },
      "image/apng": {
        compressible: false,
        extensions: ["apng"]
      },
      "image/avci": {
        source: "iana",
        extensions: ["avci"]
      },
      "image/avcs": {
        source: "iana",
        extensions: ["avcs"]
      },
      "image/avif": {
        source: "iana",
        compressible: false,
        extensions: ["avif"]
      },
      "image/bmp": {
        source: "iana",
        compressible: true,
        extensions: ["bmp"]
      },
      "image/cgm": {
        source: "iana",
        extensions: ["cgm"]
      },
      "image/dicom-rle": {
        source: "iana",
        extensions: ["drle"]
      },
      "image/emf": {
        source: "iana",
        extensions: ["emf"]
      },
      "image/fits": {
        source: "iana",
        extensions: ["fits"]
      },
      "image/g3fax": {
        source: "iana",
        extensions: ["g3"]
      },
      "image/gif": {
        source: "iana",
        compressible: false,
        extensions: ["gif"]
      },
      "image/heic": {
        source: "iana",
        extensions: ["heic"]
      },
      "image/heic-sequence": {
        source: "iana",
        extensions: ["heics"]
      },
      "image/heif": {
        source: "iana",
        extensions: ["heif"]
      },
      "image/heif-sequence": {
        source: "iana",
        extensions: ["heifs"]
      },
      "image/hej2k": {
        source: "iana",
        extensions: ["hej2"]
      },
      "image/hsj2": {
        source: "iana",
        extensions: ["hsj2"]
      },
      "image/ief": {
        source: "iana",
        extensions: ["ief"]
      },
      "image/jls": {
        source: "iana",
        extensions: ["jls"]
      },
      "image/jp2": {
        source: "iana",
        compressible: false,
        extensions: ["jp2", "jpg2"]
      },
      "image/jpeg": {
        source: "iana",
        compressible: false,
        extensions: ["jpeg", "jpg", "jpe"]
      },
      "image/jph": {
        source: "iana",
        extensions: ["jph"]
      },
      "image/jphc": {
        source: "iana",
        extensions: ["jhc"]
      },
      "image/jpm": {
        source: "iana",
        compressible: false,
        extensions: ["jpm"]
      },
      "image/jpx": {
        source: "iana",
        compressible: false,
        extensions: ["jpx", "jpf"]
      },
      "image/jxr": {
        source: "iana",
        extensions: ["jxr"]
      },
      "image/jxra": {
        source: "iana",
        extensions: ["jxra"]
      },
      "image/jxrs": {
        source: "iana",
        extensions: ["jxrs"]
      },
      "image/jxs": {
        source: "iana",
        extensions: ["jxs"]
      },
      "image/jxsc": {
        source: "iana",
        extensions: ["jxsc"]
      },
      "image/jxsi": {
        source: "iana",
        extensions: ["jxsi"]
      },
      "image/jxss": {
        source: "iana",
        extensions: ["jxss"]
      },
      "image/ktx": {
        source: "iana",
        extensions: ["ktx"]
      },
      "image/ktx2": {
        source: "iana",
        extensions: ["ktx2"]
      },
      "image/naplps": {
        source: "iana"
      },
      "image/pjpeg": {
        compressible: false
      },
      "image/png": {
        source: "iana",
        compressible: false,
        extensions: ["png"]
      },
      "image/prs.btif": {
        source: "iana",
        extensions: ["btif"]
      },
      "image/prs.pti": {
        source: "iana",
        extensions: ["pti"]
      },
      "image/pwg-raster": {
        source: "iana"
      },
      "image/sgi": {
        source: "apache",
        extensions: ["sgi"]
      },
      "image/svg+xml": {
        source: "iana",
        compressible: true,
        extensions: ["svg", "svgz"]
      },
      "image/t38": {
        source: "iana",
        extensions: ["t38"]
      },
      "image/tiff": {
        source: "iana",
        compressible: false,
        extensions: ["tif", "tiff"]
      },
      "image/tiff-fx": {
        source: "iana",
        extensions: ["tfx"]
      },
      "image/vnd.adobe.photoshop": {
        source: "iana",
        compressible: true,
        extensions: ["psd"]
      },
      "image/vnd.airzip.accelerator.azv": {
        source: "iana",
        extensions: ["azv"]
      },
      "image/vnd.cns.inf2": {
        source: "iana"
      },
      "image/vnd.dece.graphic": {
        source: "iana",
        extensions: ["uvi", "uvvi", "uvg", "uvvg"]
      },
      "image/vnd.djvu": {
        source: "iana",
        extensions: ["djvu", "djv"]
      },
      "image/vnd.dvb.subtitle": {
        source: "iana",
        extensions: ["sub"]
      },
      "image/vnd.dwg": {
        source: "iana",
        extensions: ["dwg"]
      },
      "image/vnd.dxf": {
        source: "iana",
        extensions: ["dxf"]
      },
      "image/vnd.fastbidsheet": {
        source: "iana",
        extensions: ["fbs"]
      },
      "image/vnd.fpx": {
        source: "iana",
        extensions: ["fpx"]
      },
      "image/vnd.fst": {
        source: "iana",
        extensions: ["fst"]
      },
      "image/vnd.fujixerox.edmics-mmr": {
        source: "iana",
        extensions: ["mmr"]
      },
      "image/vnd.fujixerox.edmics-rlc": {
        source: "iana",
        extensions: ["rlc"]
      },
      "image/vnd.globalgraphics.pgb": {
        source: "iana"
      },
      "image/vnd.microsoft.icon": {
        source: "iana",
        compressible: true,
        extensions: ["ico"]
      },
      "image/vnd.mix": {
        source: "iana"
      },
      "image/vnd.mozilla.apng": {
        source: "iana"
      },
      "image/vnd.ms-dds": {
        compressible: true,
        extensions: ["dds"]
      },
      "image/vnd.ms-modi": {
        source: "iana",
        extensions: ["mdi"]
      },
      "image/vnd.ms-photo": {
        source: "apache",
        extensions: ["wdp"]
      },
      "image/vnd.net-fpx": {
        source: "iana",
        extensions: ["npx"]
      },
      "image/vnd.pco.b16": {
        source: "iana",
        extensions: ["b16"]
      },
      "image/vnd.radiance": {
        source: "iana"
      },
      "image/vnd.sealed.png": {
        source: "iana"
      },
      "image/vnd.sealedmedia.softseal.gif": {
        source: "iana"
      },
      "image/vnd.sealedmedia.softseal.jpg": {
        source: "iana"
      },
      "image/vnd.svf": {
        source: "iana"
      },
      "image/vnd.tencent.tap": {
        source: "iana",
        extensions: ["tap"]
      },
      "image/vnd.valve.source.texture": {
        source: "iana",
        extensions: ["vtf"]
      },
      "image/vnd.wap.wbmp": {
        source: "iana",
        extensions: ["wbmp"]
      },
      "image/vnd.xiff": {
        source: "iana",
        extensions: ["xif"]
      },
      "image/vnd.zbrush.pcx": {
        source: "iana",
        extensions: ["pcx"]
      },
      "image/webp": {
        source: "apache",
        extensions: ["webp"]
      },
      "image/wmf": {
        source: "iana",
        extensions: ["wmf"]
      },
      "image/x-3ds": {
        source: "apache",
        extensions: ["3ds"]
      },
      "image/x-cmu-raster": {
        source: "apache",
        extensions: ["ras"]
      },
      "image/x-cmx": {
        source: "apache",
        extensions: ["cmx"]
      },
      "image/x-freehand": {
        source: "apache",
        extensions: ["fh", "fhc", "fh4", "fh5", "fh7"]
      },
      "image/x-icon": {
        source: "apache",
        compressible: true,
        extensions: ["ico"]
      },
      "image/x-jng": {
        source: "nginx",
        extensions: ["jng"]
      },
      "image/x-mrsid-image": {
        source: "apache",
        extensions: ["sid"]
      },
      "image/x-ms-bmp": {
        source: "nginx",
        compressible: true,
        extensions: ["bmp"]
      },
      "image/x-pcx": {
        source: "apache",
        extensions: ["pcx"]
      },
      "image/x-pict": {
        source: "apache",
        extensions: ["pic", "pct"]
      },
      "image/x-portable-anymap": {
        source: "apache",
        extensions: ["pnm"]
      },
      "image/x-portable-bitmap": {
        source: "apache",
        extensions: ["pbm"]
      },
      "image/x-portable-graymap": {
        source: "apache",
        extensions: ["pgm"]
      },
      "image/x-portable-pixmap": {
        source: "apache",
        extensions: ["ppm"]
      },
      "image/x-rgb": {
        source: "apache",
        extensions: ["rgb"]
      },
      "image/x-tga": {
        source: "apache",
        extensions: ["tga"]
      },
      "image/x-xbitmap": {
        source: "apache",
        extensions: ["xbm"]
      },
      "image/x-xcf": {
        compressible: false
      },
      "image/x-xpixmap": {
        source: "apache",
        extensions: ["xpm"]
      },
      "image/x-xwindowdump": {
        source: "apache",
        extensions: ["xwd"]
      },
      "message/cpim": {
        source: "iana"
      },
      "message/delivery-status": {
        source: "iana"
      },
      "message/disposition-notification": {
        source: "iana",
        extensions: [
          "disposition-notification"
        ]
      },
      "message/external-body": {
        source: "iana"
      },
      "message/feedback-report": {
        source: "iana"
      },
      "message/global": {
        source: "iana",
        extensions: ["u8msg"]
      },
      "message/global-delivery-status": {
        source: "iana",
        extensions: ["u8dsn"]
      },
      "message/global-disposition-notification": {
        source: "iana",
        extensions: ["u8mdn"]
      },
      "message/global-headers": {
        source: "iana",
        extensions: ["u8hdr"]
      },
      "message/http": {
        source: "iana",
        compressible: false
      },
      "message/imdn+xml": {
        source: "iana",
        compressible: true
      },
      "message/news": {
        source: "iana"
      },
      "message/partial": {
        source: "iana",
        compressible: false
      },
      "message/rfc822": {
        source: "iana",
        compressible: true,
        extensions: ["eml", "mime"]
      },
      "message/s-http": {
        source: "iana"
      },
      "message/sip": {
        source: "iana"
      },
      "message/sipfrag": {
        source: "iana"
      },
      "message/tracking-status": {
        source: "iana"
      },
      "message/vnd.si.simp": {
        source: "iana"
      },
      "message/vnd.wfa.wsc": {
        source: "iana",
        extensions: ["wsc"]
      },
      "model/3mf": {
        source: "iana",
        extensions: ["3mf"]
      },
      "model/e57": {
        source: "iana"
      },
      "model/gltf+json": {
        source: "iana",
        compressible: true,
        extensions: ["gltf"]
      },
      "model/gltf-binary": {
        source: "iana",
        compressible: true,
        extensions: ["glb"]
      },
      "model/iges": {
        source: "iana",
        compressible: false,
        extensions: ["igs", "iges"]
      },
      "model/mesh": {
        source: "iana",
        compressible: false,
        extensions: ["msh", "mesh", "silo"]
      },
      "model/mtl": {
        source: "iana",
        extensions: ["mtl"]
      },
      "model/obj": {
        source: "iana",
        extensions: ["obj"]
      },
      "model/step": {
        source: "iana"
      },
      "model/step+xml": {
        source: "iana",
        compressible: true,
        extensions: ["stpx"]
      },
      "model/step+zip": {
        source: "iana",
        compressible: false,
        extensions: ["stpz"]
      },
      "model/step-xml+zip": {
        source: "iana",
        compressible: false,
        extensions: ["stpxz"]
      },
      "model/stl": {
        source: "iana",
        extensions: ["stl"]
      },
      "model/vnd.collada+xml": {
        source: "iana",
        compressible: true,
        extensions: ["dae"]
      },
      "model/vnd.dwf": {
        source: "iana",
        extensions: ["dwf"]
      },
      "model/vnd.flatland.3dml": {
        source: "iana"
      },
      "model/vnd.gdl": {
        source: "iana",
        extensions: ["gdl"]
      },
      "model/vnd.gs-gdl": {
        source: "apache"
      },
      "model/vnd.gs.gdl": {
        source: "iana"
      },
      "model/vnd.gtw": {
        source: "iana",
        extensions: ["gtw"]
      },
      "model/vnd.moml+xml": {
        source: "iana",
        compressible: true
      },
      "model/vnd.mts": {
        source: "iana",
        extensions: ["mts"]
      },
      "model/vnd.opengex": {
        source: "iana",
        extensions: ["ogex"]
      },
      "model/vnd.parasolid.transmit.binary": {
        source: "iana",
        extensions: ["x_b"]
      },
      "model/vnd.parasolid.transmit.text": {
        source: "iana",
        extensions: ["x_t"]
      },
      "model/vnd.pytha.pyox": {
        source: "iana"
      },
      "model/vnd.rosette.annotated-data-model": {
        source: "iana"
      },
      "model/vnd.sap.vds": {
        source: "iana",
        extensions: ["vds"]
      },
      "model/vnd.usdz+zip": {
        source: "iana",
        compressible: false,
        extensions: ["usdz"]
      },
      "model/vnd.valve.source.compiled-map": {
        source: "iana",
        extensions: ["bsp"]
      },
      "model/vnd.vtu": {
        source: "iana",
        extensions: ["vtu"]
      },
      "model/vrml": {
        source: "iana",
        compressible: false,
        extensions: ["wrl", "vrml"]
      },
      "model/x3d+binary": {
        source: "apache",
        compressible: false,
        extensions: ["x3db", "x3dbz"]
      },
      "model/x3d+fastinfoset": {
        source: "iana",
        extensions: ["x3db"]
      },
      "model/x3d+vrml": {
        source: "apache",
        compressible: false,
        extensions: ["x3dv", "x3dvz"]
      },
      "model/x3d+xml": {
        source: "iana",
        compressible: true,
        extensions: ["x3d", "x3dz"]
      },
      "model/x3d-vrml": {
        source: "iana",
        extensions: ["x3dv"]
      },
      "multipart/alternative": {
        source: "iana",
        compressible: false
      },
      "multipart/appledouble": {
        source: "iana"
      },
      "multipart/byteranges": {
        source: "iana"
      },
      "multipart/digest": {
        source: "iana"
      },
      "multipart/encrypted": {
        source: "iana",
        compressible: false
      },
      "multipart/form-data": {
        source: "iana",
        compressible: false
      },
      "multipart/header-set": {
        source: "iana"
      },
      "multipart/mixed": {
        source: "iana"
      },
      "multipart/multilingual": {
        source: "iana"
      },
      "multipart/parallel": {
        source: "iana"
      },
      "multipart/related": {
        source: "iana",
        compressible: false
      },
      "multipart/report": {
        source: "iana"
      },
      "multipart/signed": {
        source: "iana",
        compressible: false
      },
      "multipart/vnd.bint.med-plus": {
        source: "iana"
      },
      "multipart/voice-message": {
        source: "iana"
      },
      "multipart/x-mixed-replace": {
        source: "iana"
      },
      "text/1d-interleaved-parityfec": {
        source: "iana"
      },
      "text/cache-manifest": {
        source: "iana",
        compressible: true,
        extensions: ["appcache", "manifest"]
      },
      "text/calendar": {
        source: "iana",
        extensions: ["ics", "ifb"]
      },
      "text/calender": {
        compressible: true
      },
      "text/cmd": {
        compressible: true
      },
      "text/coffeescript": {
        extensions: ["coffee", "litcoffee"]
      },
      "text/cql": {
        source: "iana"
      },
      "text/cql-expression": {
        source: "iana"
      },
      "text/cql-identifier": {
        source: "iana"
      },
      "text/css": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["css"]
      },
      "text/csv": {
        source: "iana",
        compressible: true,
        extensions: ["csv"]
      },
      "text/csv-schema": {
        source: "iana"
      },
      "text/directory": {
        source: "iana"
      },
      "text/dns": {
        source: "iana"
      },
      "text/ecmascript": {
        source: "iana"
      },
      "text/encaprtp": {
        source: "iana"
      },
      "text/enriched": {
        source: "iana"
      },
      "text/fhirpath": {
        source: "iana"
      },
      "text/flexfec": {
        source: "iana"
      },
      "text/fwdred": {
        source: "iana"
      },
      "text/gff3": {
        source: "iana"
      },
      "text/grammar-ref-list": {
        source: "iana"
      },
      "text/html": {
        source: "iana",
        compressible: true,
        extensions: ["html", "htm", "shtml"]
      },
      "text/jade": {
        extensions: ["jade"]
      },
      "text/javascript": {
        source: "iana",
        compressible: true
      },
      "text/jcr-cnd": {
        source: "iana"
      },
      "text/jsx": {
        compressible: true,
        extensions: ["jsx"]
      },
      "text/less": {
        compressible: true,
        extensions: ["less"]
      },
      "text/markdown": {
        source: "iana",
        compressible: true,
        extensions: ["markdown", "md"]
      },
      "text/mathml": {
        source: "nginx",
        extensions: ["mml"]
      },
      "text/mdx": {
        compressible: true,
        extensions: ["mdx"]
      },
      "text/mizar": {
        source: "iana"
      },
      "text/n3": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["n3"]
      },
      "text/parameters": {
        source: "iana",
        charset: "UTF-8"
      },
      "text/parityfec": {
        source: "iana"
      },
      "text/plain": {
        source: "iana",
        compressible: true,
        extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"]
      },
      "text/provenance-notation": {
        source: "iana",
        charset: "UTF-8"
      },
      "text/prs.fallenstein.rst": {
        source: "iana"
      },
      "text/prs.lines.tag": {
        source: "iana",
        extensions: ["dsc"]
      },
      "text/prs.prop.logic": {
        source: "iana"
      },
      "text/raptorfec": {
        source: "iana"
      },
      "text/red": {
        source: "iana"
      },
      "text/rfc822-headers": {
        source: "iana"
      },
      "text/richtext": {
        source: "iana",
        compressible: true,
        extensions: ["rtx"]
      },
      "text/rtf": {
        source: "iana",
        compressible: true,
        extensions: ["rtf"]
      },
      "text/rtp-enc-aescm128": {
        source: "iana"
      },
      "text/rtploopback": {
        source: "iana"
      },
      "text/rtx": {
        source: "iana"
      },
      "text/sgml": {
        source: "iana",
        extensions: ["sgml", "sgm"]
      },
      "text/shaclc": {
        source: "iana"
      },
      "text/shex": {
        source: "iana",
        extensions: ["shex"]
      },
      "text/slim": {
        extensions: ["slim", "slm"]
      },
      "text/spdx": {
        source: "iana",
        extensions: ["spdx"]
      },
      "text/strings": {
        source: "iana"
      },
      "text/stylus": {
        extensions: ["stylus", "styl"]
      },
      "text/t140": {
        source: "iana"
      },
      "text/tab-separated-values": {
        source: "iana",
        compressible: true,
        extensions: ["tsv"]
      },
      "text/troff": {
        source: "iana",
        extensions: ["t", "tr", "roff", "man", "me", "ms"]
      },
      "text/turtle": {
        source: "iana",
        charset: "UTF-8",
        extensions: ["ttl"]
      },
      "text/ulpfec": {
        source: "iana"
      },
      "text/uri-list": {
        source: "iana",
        compressible: true,
        extensions: ["uri", "uris", "urls"]
      },
      "text/vcard": {
        source: "iana",
        compressible: true,
        extensions: ["vcard"]
      },
      "text/vnd.a": {
        source: "iana"
      },
      "text/vnd.abc": {
        source: "iana"
      },
      "text/vnd.ascii-art": {
        source: "iana"
      },
      "text/vnd.curl": {
        source: "iana",
        extensions: ["curl"]
      },
      "text/vnd.curl.dcurl": {
        source: "apache",
        extensions: ["dcurl"]
      },
      "text/vnd.curl.mcurl": {
        source: "apache",
        extensions: ["mcurl"]
      },
      "text/vnd.curl.scurl": {
        source: "apache",
        extensions: ["scurl"]
      },
      "text/vnd.debian.copyright": {
        source: "iana",
        charset: "UTF-8"
      },
      "text/vnd.dmclientscript": {
        source: "iana"
      },
      "text/vnd.dvb.subtitle": {
        source: "iana",
        extensions: ["sub"]
      },
      "text/vnd.esmertec.theme-descriptor": {
        source: "iana",
        charset: "UTF-8"
      },
      "text/vnd.familysearch.gedcom": {
        source: "iana",
        extensions: ["ged"]
      },
      "text/vnd.ficlab.flt": {
        source: "iana"
      },
      "text/vnd.fly": {
        source: "iana",
        extensions: ["fly"]
      },
      "text/vnd.fmi.flexstor": {
        source: "iana",
        extensions: ["flx"]
      },
      "text/vnd.gml": {
        source: "iana"
      },
      "text/vnd.graphviz": {
        source: "iana",
        extensions: ["gv"]
      },
      "text/vnd.hans": {
        source: "iana"
      },
      "text/vnd.hgl": {
        source: "iana"
      },
      "text/vnd.in3d.3dml": {
        source: "iana",
        extensions: ["3dml"]
      },
      "text/vnd.in3d.spot": {
        source: "iana",
        extensions: ["spot"]
      },
      "text/vnd.iptc.newsml": {
        source: "iana"
      },
      "text/vnd.iptc.nitf": {
        source: "iana"
      },
      "text/vnd.latex-z": {
        source: "iana"
      },
      "text/vnd.motorola.reflex": {
        source: "iana"
      },
      "text/vnd.ms-mediapackage": {
        source: "iana"
      },
      "text/vnd.net2phone.commcenter.command": {
        source: "iana"
      },
      "text/vnd.radisys.msml-basic-layout": {
        source: "iana"
      },
      "text/vnd.senx.warpscript": {
        source: "iana"
      },
      "text/vnd.si.uricatalogue": {
        source: "iana"
      },
      "text/vnd.sosi": {
        source: "iana"
      },
      "text/vnd.sun.j2me.app-descriptor": {
        source: "iana",
        charset: "UTF-8",
        extensions: ["jad"]
      },
      "text/vnd.trolltech.linguist": {
        source: "iana",
        charset: "UTF-8"
      },
      "text/vnd.wap.si": {
        source: "iana"
      },
      "text/vnd.wap.sl": {
        source: "iana"
      },
      "text/vnd.wap.wml": {
        source: "iana",
        extensions: ["wml"]
      },
      "text/vnd.wap.wmlscript": {
        source: "iana",
        extensions: ["wmls"]
      },
      "text/vtt": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["vtt"]
      },
      "text/x-asm": {
        source: "apache",
        extensions: ["s", "asm"]
      },
      "text/x-c": {
        source: "apache",
        extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"]
      },
      "text/x-component": {
        source: "nginx",
        extensions: ["htc"]
      },
      "text/x-fortran": {
        source: "apache",
        extensions: ["f", "for", "f77", "f90"]
      },
      "text/x-gwt-rpc": {
        compressible: true
      },
      "text/x-handlebars-template": {
        extensions: ["hbs"]
      },
      "text/x-java-source": {
        source: "apache",
        extensions: ["java"]
      },
      "text/x-jquery-tmpl": {
        compressible: true
      },
      "text/x-lua": {
        extensions: ["lua"]
      },
      "text/x-markdown": {
        compressible: true,
        extensions: ["mkd"]
      },
      "text/x-nfo": {
        source: "apache",
        extensions: ["nfo"]
      },
      "text/x-opml": {
        source: "apache",
        extensions: ["opml"]
      },
      "text/x-org": {
        compressible: true,
        extensions: ["org"]
      },
      "text/x-pascal": {
        source: "apache",
        extensions: ["p", "pas"]
      },
      "text/x-processing": {
        compressible: true,
        extensions: ["pde"]
      },
      "text/x-sass": {
        extensions: ["sass"]
      },
      "text/x-scss": {
        extensions: ["scss"]
      },
      "text/x-setext": {
        source: "apache",
        extensions: ["etx"]
      },
      "text/x-sfv": {
        source: "apache",
        extensions: ["sfv"]
      },
      "text/x-suse-ymp": {
        compressible: true,
        extensions: ["ymp"]
      },
      "text/x-uuencode": {
        source: "apache",
        extensions: ["uu"]
      },
      "text/x-vcalendar": {
        source: "apache",
        extensions: ["vcs"]
      },
      "text/x-vcard": {
        source: "apache",
        extensions: ["vcf"]
      },
      "text/xml": {
        source: "iana",
        compressible: true,
        extensions: ["xml"]
      },
      "text/xml-external-parsed-entity": {
        source: "iana"
      },
      "text/yaml": {
        compressible: true,
        extensions: ["yaml", "yml"]
      },
      "video/1d-interleaved-parityfec": {
        source: "iana"
      },
      "video/3gpp": {
        source: "iana",
        extensions: ["3gp", "3gpp"]
      },
      "video/3gpp-tt": {
        source: "iana"
      },
      "video/3gpp2": {
        source: "iana",
        extensions: ["3g2"]
      },
      "video/av1": {
        source: "iana"
      },
      "video/bmpeg": {
        source: "iana"
      },
      "video/bt656": {
        source: "iana"
      },
      "video/celb": {
        source: "iana"
      },
      "video/dv": {
        source: "iana"
      },
      "video/encaprtp": {
        source: "iana"
      },
      "video/ffv1": {
        source: "iana"
      },
      "video/flexfec": {
        source: "iana"
      },
      "video/h261": {
        source: "iana",
        extensions: ["h261"]
      },
      "video/h263": {
        source: "iana",
        extensions: ["h263"]
      },
      "video/h263-1998": {
        source: "iana"
      },
      "video/h263-2000": {
        source: "iana"
      },
      "video/h264": {
        source: "iana",
        extensions: ["h264"]
      },
      "video/h264-rcdo": {
        source: "iana"
      },
      "video/h264-svc": {
        source: "iana"
      },
      "video/h265": {
        source: "iana"
      },
      "video/iso.segment": {
        source: "iana",
        extensions: ["m4s"]
      },
      "video/jpeg": {
        source: "iana",
        extensions: ["jpgv"]
      },
      "video/jpeg2000": {
        source: "iana"
      },
      "video/jpm": {
        source: "apache",
        extensions: ["jpm", "jpgm"]
      },
      "video/jxsv": {
        source: "iana"
      },
      "video/mj2": {
        source: "iana",
        extensions: ["mj2", "mjp2"]
      },
      "video/mp1s": {
        source: "iana"
      },
      "video/mp2p": {
        source: "iana"
      },
      "video/mp2t": {
        source: "iana",
        extensions: ["ts"]
      },
      "video/mp4": {
        source: "iana",
        compressible: false,
        extensions: ["mp4", "mp4v", "mpg4"]
      },
      "video/mp4v-es": {
        source: "iana"
      },
      "video/mpeg": {
        source: "iana",
        compressible: false,
        extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"]
      },
      "video/mpeg4-generic": {
        source: "iana"
      },
      "video/mpv": {
        source: "iana"
      },
      "video/nv": {
        source: "iana"
      },
      "video/ogg": {
        source: "iana",
        compressible: false,
        extensions: ["ogv"]
      },
      "video/parityfec": {
        source: "iana"
      },
      "video/pointer": {
        source: "iana"
      },
      "video/quicktime": {
        source: "iana",
        compressible: false,
        extensions: ["qt", "mov"]
      },
      "video/raptorfec": {
        source: "iana"
      },
      "video/raw": {
        source: "iana"
      },
      "video/rtp-enc-aescm128": {
        source: "iana"
      },
      "video/rtploopback": {
        source: "iana"
      },
      "video/rtx": {
        source: "iana"
      },
      "video/scip": {
        source: "iana"
      },
      "video/smpte291": {
        source: "iana"
      },
      "video/smpte292m": {
        source: "iana"
      },
      "video/ulpfec": {
        source: "iana"
      },
      "video/vc1": {
        source: "iana"
      },
      "video/vc2": {
        source: "iana"
      },
      "video/vnd.cctv": {
        source: "iana"
      },
      "video/vnd.dece.hd": {
        source: "iana",
        extensions: ["uvh", "uvvh"]
      },
      "video/vnd.dece.mobile": {
        source: "iana",
        extensions: ["uvm", "uvvm"]
      },
      "video/vnd.dece.mp4": {
        source: "iana"
      },
      "video/vnd.dece.pd": {
        source: "iana",
        extensions: ["uvp", "uvvp"]
      },
      "video/vnd.dece.sd": {
        source: "iana",
        extensions: ["uvs", "uvvs"]
      },
      "video/vnd.dece.video": {
        source: "iana",
        extensions: ["uvv", "uvvv"]
      },
      "video/vnd.directv.mpeg": {
        source: "iana"
      },
      "video/vnd.directv.mpeg-tts": {
        source: "iana"
      },
      "video/vnd.dlna.mpeg-tts": {
        source: "iana"
      },
      "video/vnd.dvb.file": {
        source: "iana",
        extensions: ["dvb"]
      },
      "video/vnd.fvt": {
        source: "iana",
        extensions: ["fvt"]
      },
      "video/vnd.hns.video": {
        source: "iana"
      },
      "video/vnd.iptvforum.1dparityfec-1010": {
        source: "iana"
      },
      "video/vnd.iptvforum.1dparityfec-2005": {
        source: "iana"
      },
      "video/vnd.iptvforum.2dparityfec-1010": {
        source: "iana"
      },
      "video/vnd.iptvforum.2dparityfec-2005": {
        source: "iana"
      },
      "video/vnd.iptvforum.ttsavc": {
        source: "iana"
      },
      "video/vnd.iptvforum.ttsmpeg2": {
        source: "iana"
      },
      "video/vnd.motorola.video": {
        source: "iana"
      },
      "video/vnd.motorola.videop": {
        source: "iana"
      },
      "video/vnd.mpegurl": {
        source: "iana",
        extensions: ["mxu", "m4u"]
      },
      "video/vnd.ms-playready.media.pyv": {
        source: "iana",
        extensions: ["pyv"]
      },
      "video/vnd.nokia.interleaved-multimedia": {
        source: "iana"
      },
      "video/vnd.nokia.mp4vr": {
        source: "iana"
      },
      "video/vnd.nokia.videovoip": {
        source: "iana"
      },
      "video/vnd.objectvideo": {
        source: "iana"
      },
      "video/vnd.radgamettools.bink": {
        source: "iana"
      },
      "video/vnd.radgamettools.smacker": {
        source: "iana"
      },
      "video/vnd.sealed.mpeg1": {
        source: "iana"
      },
      "video/vnd.sealed.mpeg4": {
        source: "iana"
      },
      "video/vnd.sealed.swf": {
        source: "iana"
      },
      "video/vnd.sealedmedia.softseal.mov": {
        source: "iana"
      },
      "video/vnd.uvvu.mp4": {
        source: "iana",
        extensions: ["uvu", "uvvu"]
      },
      "video/vnd.vivo": {
        source: "iana",
        extensions: ["viv"]
      },
      "video/vnd.youtube.yt": {
        source: "iana"
      },
      "video/vp8": {
        source: "iana"
      },
      "video/vp9": {
        source: "iana"
      },
      "video/webm": {
        source: "apache",
        compressible: false,
        extensions: ["webm"]
      },
      "video/x-f4v": {
        source: "apache",
        extensions: ["f4v"]
      },
      "video/x-fli": {
        source: "apache",
        extensions: ["fli"]
      },
      "video/x-flv": {
        source: "apache",
        compressible: false,
        extensions: ["flv"]
      },
      "video/x-m4v": {
        source: "apache",
        extensions: ["m4v"]
      },
      "video/x-matroska": {
        source: "apache",
        compressible: false,
        extensions: ["mkv", "mk3d", "mks"]
      },
      "video/x-mng": {
        source: "apache",
        extensions: ["mng"]
      },
      "video/x-ms-asf": {
        source: "apache",
        extensions: ["asf", "asx"]
      },
      "video/x-ms-vob": {
        source: "apache",
        extensions: ["vob"]
      },
      "video/x-ms-wm": {
        source: "apache",
        extensions: ["wm"]
      },
      "video/x-ms-wmv": {
        source: "apache",
        compressible: false,
        extensions: ["wmv"]
      },
      "video/x-ms-wmx": {
        source: "apache",
        extensions: ["wmx"]
      },
      "video/x-ms-wvx": {
        source: "apache",
        extensions: ["wvx"]
      },
      "video/x-msvideo": {
        source: "apache",
        extensions: ["avi"]
      },
      "video/x-sgi-movie": {
        source: "apache",
        extensions: ["movie"]
      },
      "video/x-smv": {
        source: "apache",
        extensions: ["smv"]
      },
      "x-conference/x-cooltalk": {
        source: "apache",
        extensions: ["ice"]
      },
      "x-shader/x-fragment": {
        compressible: true
      },
      "x-shader/x-vertex": {
        compressible: true
      }
    };
  }
});

// node_modules/mime-db/index.js
var require_mime_db = __commonJS({
  "node_modules/mime-db/index.js"(exports2, module2) {
    module2.exports = require_db();
  }
});

// node_modules/mime-types/index.js
var require_mime_types = __commonJS({
  "node_modules/mime-types/index.js"(exports2) {
    "use strict";
    var db = require_mime_db();
    var extname = require("path").extname;
    var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
    var TEXT_TYPE_REGEXP = /^text\//i;
    exports2.charset = charset;
    exports2.charsets = { lookup: charset };
    exports2.contentType = contentType;
    exports2.extension = extension2;
    exports2.extensions = /* @__PURE__ */ Object.create(null);
    exports2.lookup = lookup;
    exports2.types = /* @__PURE__ */ Object.create(null);
    populateMaps(exports2.extensions, exports2.types);
    function charset(type) {
      if (!type || typeof type !== "string") {
        return false;
      }
      var match = EXTRACT_TYPE_REGEXP.exec(type);
      var mime = match && db[match[1].toLowerCase()];
      if (mime && mime.charset) {
        return mime.charset;
      }
      if (match && TEXT_TYPE_REGEXP.test(match[1])) {
        return "UTF-8";
      }
      return false;
    }
    function contentType(str) {
      if (!str || typeof str !== "string") {
        return false;
      }
      var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str;
      if (!mime) {
        return false;
      }
      if (mime.indexOf("charset") === -1) {
        var charset2 = exports2.charset(mime);
        if (charset2)
          mime += "; charset=" + charset2.toLowerCase();
      }
      return mime;
    }
    function extension2(type) {
      if (!type || typeof type !== "string") {
        return false;
      }
      var match = EXTRACT_TYPE_REGEXP.exec(type);
      var exts = match && exports2.extensions[match[1].toLowerCase()];
      if (!exts || !exts.length) {
        return false;
      }
      return exts[0];
    }
    function lookup(path4) {
      if (!path4 || typeof path4 !== "string") {
        return false;
      }
      var extension3 = extname("x." + path4).toLowerCase().substr(1);
      if (!extension3) {
        return false;
      }
      return exports2.types[extension3] || false;
    }
    function populateMaps(extensions, types) {
      var preference = ["nginx", "apache", void 0, "iana"];
      Object.keys(db).forEach(function forEachMimeType(type) {
        var mime = db[type];
        var exts = mime.extensions;
        if (!exts || !exts.length) {
          return;
        }
        extensions[type] = exts;
        for (var i = 0; i < exts.length; i++) {
          var extension3 = exts[i];
          if (types[extension3]) {
            var from = preference.indexOf(db[types[extension3]].source);
            var to = preference.indexOf(mime.source);
            if (types[extension3] !== "application/octet-stream" && (from > to || from === to && types[extension3].substr(0, 12) === "application/")) {
              continue;
            }
          }
          types[extension3] = type;
        }
      });
    }
  }
});

// node_modules/caseless/index.js
var require_caseless = __commonJS({
  "node_modules/caseless/index.js"(exports2, module2) {
    function Caseless(dict) {
      this.dict = dict || {};
    }
    Caseless.prototype.set = function(name, value, clobber) {
      if (typeof name === "object") {
        for (var i in name) {
          this.set(i, name[i], value);
        }
      } else {
        if (typeof clobber === "undefined")
          clobber = true;
        var has = this.has(name);
        if (!clobber && has)
          this.dict[has] = this.dict[has] + "," + value;
        else
          this.dict[has || name] = value;
        return has;
      }
    };
    Caseless.prototype.has = function(name) {
      var keys = Object.keys(this.dict), name = name.toLowerCase();
      for (var i = 0; i < keys.length; i++) {
        if (keys[i].toLowerCase() === name)
          return keys[i];
      }
      return false;
    };
    Caseless.prototype.get = function(name) {
      name = name.toLowerCase();
      var result, _key;
      var headers = this.dict;
      Object.keys(headers).forEach(function(key) {
        _key = key.toLowerCase();
        if (name === _key)
          result = headers[key];
      });
      return result;
    };
    Caseless.prototype.swap = function(name) {
      var has = this.has(name);
      if (has === name)
        return;
      if (!has)
        throw new Error('There is no header than matches "' + name + '"');
      this.dict[name] = this.dict[has];
      delete this.dict[has];
    };
    Caseless.prototype.del = function(name) {
      var has = this.has(name);
      return delete this.dict[has || name];
    };
    module2.exports = function(dict) {
      return new Caseless(dict);
    };
    module2.exports.httpify = function(resp, headers) {
      var c = new Caseless(headers);
      resp.setHeader = function(key, value, clobber) {
        if (typeof value === "undefined")
          return;
        return c.set(key, value, clobber);
      };
      resp.hasHeader = function(key) {
        return c.has(key);
      };
      resp.getHeader = function(key) {
        return c.get(key);
      };
      resp.removeHeader = function(key) {
        return c.del(key);
      };
      resp.headers = c.dict;
      return c;
    };
  }
});

// node_modules/forever-agent/index.js
var require_forever_agent = __commonJS({
  "node_modules/forever-agent/index.js"(exports2, module2) {
    module2.exports = ForeverAgent;
    ForeverAgent.SSL = ForeverAgentSSL;
    var util = require("util");
    var Agent = require("http").Agent;
    var net = require("net");
    var tls = require("tls");
    var AgentSSL = require("https").Agent;
    function getConnectionName(host, port) {
      var name = "";
      if (typeof host === "string") {
        name = host + ":" + port;
      } else {
        name = host.host + ":" + host.port + ":" + (host.localAddress ? host.localAddress + ":" : ":");
      }
      return name;
    }
    function ForeverAgent(options) {
      var self2 = this;
      self2.options = options || {};
      self2.requests = {};
      self2.sockets = {};
      self2.freeSockets = {};
      self2.maxSockets = self2.options.maxSockets || Agent.defaultMaxSockets;
      self2.minSockets = self2.options.minSockets || ForeverAgent.defaultMinSockets;
      self2.on("free", function(socket, host, port) {
        var name = getConnectionName(host, port);
        if (self2.requests[name] && self2.requests[name].length) {
          self2.requests[name].shift().onSocket(socket);
        } else if (self2.sockets[name].length < self2.minSockets) {
          if (!self2.freeSockets[name])
            self2.freeSockets[name] = [];
          self2.freeSockets[name].push(socket);
          var onIdleError = function() {
            socket.destroy();
          };
          socket._onIdleError = onIdleError;
          socket.on("error", onIdleError);
        } else {
          socket.destroy();
        }
      });
    }
    util.inherits(ForeverAgent, Agent);
    ForeverAgent.defaultMinSockets = 5;
    ForeverAgent.prototype.createConnection = net.createConnection;
    ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest;
    ForeverAgent.prototype.addRequest = function(req, host, port) {
      var name = getConnectionName(host, port);
      if (typeof host !== "string") {
        var options = host;
        port = options.port;
        host = options.host;
      }
      if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
        var idleSocket = this.freeSockets[name].pop();
        idleSocket.removeListener("error", idleSocket._onIdleError);
        delete idleSocket._onIdleError;
        req._reusedSocket = true;
        req.onSocket(idleSocket);
      } else {
        this.addRequestNoreuse(req, host, port);
      }
    };
    ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
      if (this.sockets[name]) {
        var index = this.sockets[name].indexOf(s);
        if (index !== -1) {
          this.sockets[name].splice(index, 1);
        }
      } else if (this.sockets[name] && this.sockets[name].length === 0) {
        delete this.sockets[name];
        delete this.requests[name];
      }
      if (this.freeSockets[name]) {
        var index = this.freeSockets[name].indexOf(s);
        if (index !== -1) {
          this.freeSockets[name].splice(index, 1);
          if (this.freeSockets[name].length === 0) {
            delete this.freeSockets[name];
          }
        }
      }
      if (this.requests[name] && this.requests[name].length) {
        this.createSocket(name, host, port).emit("free");
      }
    };
    function ForeverAgentSSL(options) {
      ForeverAgent.call(this, options);
    }
    util.inherits(ForeverAgentSSL, ForeverAgent);
    ForeverAgentSSL.prototype.createConnection = createConnectionSSL;
    ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest;
    function createConnectionSSL(port, host, options) {
      if (typeof port === "object") {
        options = port;
      } else if (typeof host === "object") {
        options = host;
      } else if (typeof options === "object") {
        options = options;
      } else {
        options = {};
      }
      if (typeof port === "number") {
        options.port = port;
      }
      if (typeof host === "string") {
        options.host = host;
      }
      return tls.connect(options);
    }
  }
});

// node_modules/form-data/lib/browser.js
var require_browser5 = __commonJS({
  "node_modules/form-data/lib/browser.js"(exports2, module2) {
    module2.exports = typeof self == "object" ? self.FormData : window.FormData;
  }
});

// node_modules/isstream/isstream.js
var require_isstream = __commonJS({
  "node_modules/isstream/isstream.js"(exports2, module2) {
    var stream = require("stream");
    function isStream(obj2) {
      return obj2 instanceof stream.Stream;
    }
    function isReadable(obj2) {
      return isStream(obj2) && typeof obj2._read == "function" && typeof obj2._readableState == "object";
    }
    function isWritable(obj2) {
      return isStream(obj2) && typeof obj2._write == "function" && typeof obj2._writableState == "object";
    }
    function isDuplex(obj2) {
      return isReadable(obj2) && isWritable(obj2);
    }
    module2.exports = isStream;
    module2.exports.isReadable = isReadable;
    module2.exports.isWritable = isWritable;
    module2.exports.isDuplex = isDuplex;
  }
});

// node_modules/is-typedarray/index.js
var require_is_typedarray = __commonJS({
  "node_modules/is-typedarray/index.js"(exports2, module2) {
    module2.exports = isTypedArray;
    isTypedArray.strict = isStrictTypedArray;
    isTypedArray.loose = isLooseTypedArray;
    var toString = Object.prototype.toString;
    var names = {
      "[object Int8Array]": true,
      "[object Int16Array]": true,
      "[object Int32Array]": true,
      "[object Uint8Array]": true,
      "[object Uint8ClampedArray]": true,
      "[object Uint16Array]": true,
      "[object Uint32Array]": true,
      "[object Float32Array]": true,
      "[object Float64Array]": true
    };
    function isTypedArray(arr) {
      return isStrictTypedArray(arr) || isLooseTypedArray(arr);
    }
    function isStrictTypedArray(arr) {
      return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array;
    }
    function isLooseTypedArray(arr) {
      return names[toString.call(arr)];
    }
  }
});

// node_modules/@cypress/request/lib/getProxyFromURI.js
var require_getProxyFromURI = __commonJS({
  "node_modules/@cypress/request/lib/getProxyFromURI.js"(exports2, module2) {
    "use strict";
    function formatHostname(hostname) {
      return hostname.replace(/^\.*/, ".").toLowerCase();
    }
    function parseNoProxyZone(zone) {
      zone = zone.trim().toLowerCase();
      var zoneParts = zone.split(":", 2);
      var zoneHost = formatHostname(zoneParts[0]);
      var zonePort = zoneParts[1];
      var hasPort = zone.indexOf(":") > -1;
      return { hostname: zoneHost, port: zonePort, hasPort };
    }
    function uriInNoProxy(uri, noProxy) {
      var port = uri.port || (uri.protocol === "https:" ? "443" : "80");
      var hostname = formatHostname(uri.hostname);
      var noProxyList = noProxy.split(",");
      return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) {
        var isMatchedAt = hostname.indexOf(noProxyZone.hostname);
        var hostnameMatched = isMatchedAt > -1 && isMatchedAt === hostname.length - noProxyZone.hostname.length;
        if (noProxyZone.hasPort) {
          return port === noProxyZone.port && hostnameMatched;
        }
        return hostnameMatched;
      });
    }
    function getProxyFromURI(uri) {
      var noProxy = process.env.NO_PROXY || process.env.no_proxy || "";
      if (noProxy === "*") {
        return null;
      }
      if (noProxy !== "" && uriInNoProxy(uri, noProxy)) {
        return null;
      }
      if (uri.protocol === "http:") {
        return process.env.HTTP_PROXY || process.env.http_proxy || null;
      }
      if (uri.protocol === "https:") {
        return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null;
      }
      return null;
    }
    module2.exports = getProxyFromURI;
  }
});

// node_modules/side-channel/index.js
var require_side_channel = __commonJS({
  "node_modules/side-channel/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var callBound = require_callBound();
    var inspect = require_object_inspect();
    var $TypeError = require_type();
    var $WeakMap = GetIntrinsic("%WeakMap%", true);
    var $Map = GetIntrinsic("%Map%", true);
    var $weakMapGet = callBound("WeakMap.prototype.get", true);
    var $weakMapSet = callBound("WeakMap.prototype.set", true);
    var $weakMapHas = callBound("WeakMap.prototype.has", true);
    var $mapGet = callBound("Map.prototype.get", true);
    var $mapSet = callBound("Map.prototype.set", true);
    var $mapHas = callBound("Map.prototype.has", true);
    var listGetNode = function(list, key) {
      var prev = list;
      var curr;
      for (; (curr = prev.next) !== null; prev = curr) {
        if (curr.key === key) {
          prev.next = curr.next;
          curr.next = /** @type {NonNullable<typeof list.next>} */
          list.next;
          list.next = curr;
          return curr;
        }
      }
    };
    var listGet = function(objects, key) {
      var node = listGetNode(objects, key);
      return node && node.value;
    };
    var listSet = function(objects, key, value) {
      var node = listGetNode(objects, key);
      if (node) {
        node.value = value;
      } else {
        objects.next = /** @type {import('.').ListNode<typeof value>} */
        {
          // eslint-disable-line no-param-reassign, no-extra-parens
          key,
          next: objects.next,
          value
        };
      }
    };
    var listHas = function(objects, key) {
      return !!listGetNode(objects, key);
    };
    module2.exports = function getSideChannel() {
      var $wm;
      var $m;
      var $o;
      var channel = {
        assert: function(key) {
          if (!channel.has(key)) {
            throw new $TypeError("Side channel does not contain " + inspect(key));
          }
        },
        get: function(key) {
          if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
            if ($wm) {
              return $weakMapGet($wm, key);
            }
          } else if ($Map) {
            if ($m) {
              return $mapGet($m, key);
            }
          } else {
            if ($o) {
              return listGet($o, key);
            }
          }
        },
        has: function(key) {
          if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
            if ($wm) {
              return $weakMapHas($wm, key);
            }
          } else if ($Map) {
            if ($m) {
              return $mapHas($m, key);
            }
          } else {
            if ($o) {
              return listHas($o, key);
            }
          }
          return false;
        },
        set: function(key, value) {
          if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
            if (!$wm) {
              $wm = new $WeakMap();
            }
            $weakMapSet($wm, key, value);
          } else if ($Map) {
            if (!$m) {
              $m = new $Map();
            }
            $mapSet($m, key, value);
          } else {
            if (!$o) {
              $o = { key: {}, next: null };
            }
            listSet($o, key, value);
          }
        }
      };
      return channel;
    };
  }
});

// node_modules/qs/lib/formats.js
var require_formats = __commonJS({
  "node_modules/qs/lib/formats.js"(exports2, module2) {
    "use strict";
    var replace = String.prototype.replace;
    var percentTwenties = /%20/g;
    var Format = {
      RFC1738: "RFC1738",
      RFC3986: "RFC3986"
    };
    module2.exports = {
      "default": Format.RFC3986,
      formatters: {
        RFC1738: function(value) {
          return replace.call(value, percentTwenties, "+");
        },
        RFC3986: function(value) {
          return String(value);
        }
      },
      RFC1738: Format.RFC1738,
      RFC3986: Format.RFC3986
    };
  }
});

// node_modules/qs/lib/utils.js
var require_utils8 = __commonJS({
  "node_modules/qs/lib/utils.js"(exports2, module2) {
    "use strict";
    var formats = require_formats();
    var has = Object.prototype.hasOwnProperty;
    var isArray = Array.isArray;
    var hexTable = function() {
      var array = [];
      for (var i = 0; i < 256; ++i) {
        array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
      }
      return array;
    }();
    var compactQueue = function compactQueue2(queue) {
      while (queue.length > 1) {
        var item = queue.pop();
        var obj2 = item.obj[item.prop];
        if (isArray(obj2)) {
          var compacted = [];
          for (var j = 0; j < obj2.length; ++j) {
            if (typeof obj2[j] !== "undefined") {
              compacted.push(obj2[j]);
            }
          }
          item.obj[item.prop] = compacted;
        }
      }
    };
    var arrayToObject = function arrayToObject2(source, options) {
      var obj2 = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
      for (var i = 0; i < source.length; ++i) {
        if (typeof source[i] !== "undefined") {
          obj2[i] = source[i];
        }
      }
      return obj2;
    };
    var merge = function merge2(target, source, options) {
      if (!source) {
        return target;
      }
      if (typeof source !== "object") {
        if (isArray(target)) {
          target.push(source);
        } else if (target && typeof target === "object") {
          if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
            target[source] = true;
          }
        } else {
          return [target, source];
        }
        return target;
      }
      if (!target || typeof target !== "object") {
        return [target].concat(source);
      }
      var mergeTarget = target;
      if (isArray(target) && !isArray(source)) {
        mergeTarget = arrayToObject(target, options);
      }
      if (isArray(target) && isArray(source)) {
        source.forEach(function(item, i) {
          if (has.call(target, i)) {
            var targetItem = target[i];
            if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
              target[i] = merge2(targetItem, item, options);
            } else {
              target.push(item);
            }
          } else {
            target[i] = item;
          }
        });
        return target;
      }
      return Object.keys(source).reduce(function(acc, key) {
        var value = source[key];
        if (has.call(acc, key)) {
          acc[key] = merge2(acc[key], value, options);
        } else {
          acc[key] = value;
        }
        return acc;
      }, mergeTarget);
    };
    var assign = function assignSingleSource(target, source) {
      return Object.keys(source).reduce(function(acc, key) {
        acc[key] = source[key];
        return acc;
      }, target);
    };
    var decode = function(str, decoder, charset) {
      var strWithoutPlus = str.replace(/\+/g, " ");
      if (charset === "iso-8859-1") {
        return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
      }
      try {
        return decodeURIComponent(strWithoutPlus);
      } catch (e) {
        return strWithoutPlus;
      }
    };
    var limit = 1024;
    var encode = function encode2(str, defaultEncoder, charset, kind, format) {
      if (str.length === 0) {
        return str;
      }
      var string = str;
      if (typeof str === "symbol") {
        string = Symbol.prototype.toString.call(str);
      } else if (typeof str !== "string") {
        string = String(str);
      }
      if (charset === "iso-8859-1") {
        return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
          return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
        });
      }
      var out = "";
      for (var j = 0; j < string.length; j += limit) {
        var segment = string.length >= limit ? string.slice(j, j + limit) : string;
        var arr = [];
        for (var i = 0; i < segment.length; ++i) {
          var c = segment.charCodeAt(i);
          if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
            arr[arr.length] = segment.charAt(i);
            continue;
          }
          if (c < 128) {
            arr[arr.length] = hexTable[c];
            continue;
          }
          if (c < 2048) {
            arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
            continue;
          }
          if (c < 55296 || c >= 57344) {
            arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
            continue;
          }
          i += 1;
          c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
          arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
        }
        out += arr.join("");
      }
      return out;
    };
    var compact = function compact2(value) {
      var queue = [{ obj: { o: value }, prop: "o" }];
      var refs = [];
      for (var i = 0; i < queue.length; ++i) {
        var item = queue[i];
        var obj2 = item.obj[item.prop];
        var keys = Object.keys(obj2);
        for (var j = 0; j < keys.length; ++j) {
          var key = keys[j];
          var val = obj2[key];
          if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
            queue.push({ obj: obj2, prop: key });
            refs.push(val);
          }
        }
      }
      compactQueue(queue);
      return value;
    };
    var isRegExp = function isRegExp2(obj2) {
      return Object.prototype.toString.call(obj2) === "[object RegExp]";
    };
    var isBuffer = function isBuffer2(obj2) {
      if (!obj2 || typeof obj2 !== "object") {
        return false;
      }
      return !!(obj2.constructor && obj2.constructor.isBuffer && obj2.constructor.isBuffer(obj2));
    };
    var combine = function combine2(a, b) {
      return [].concat(a, b);
    };
    var maybeMap = function maybeMap2(val, fn2) {
      if (isArray(val)) {
        var mapped = [];
        for (var i = 0; i < val.length; i += 1) {
          mapped.push(fn2(val[i]));
        }
        return mapped;
      }
      return fn2(val);
    };
    module2.exports = {
      arrayToObject,
      assign,
      combine,
      compact,
      decode,
      encode,
      isBuffer,
      isRegExp,
      maybeMap,
      merge
    };
  }
});

// node_modules/qs/lib/stringify.js
var require_stringify3 = __commonJS({
  "node_modules/qs/lib/stringify.js"(exports2, module2) {
    "use strict";
    var getSideChannel = require_side_channel();
    var utils = require_utils8();
    var formats = require_formats();
    var has = Object.prototype.hasOwnProperty;
    var arrayPrefixGenerators = {
      brackets: function brackets(prefix) {
        return prefix + "[]";
      },
      comma: "comma",
      indices: function indices(prefix, key) {
        return prefix + "[" + key + "]";
      },
      repeat: function repeat(prefix) {
        return prefix;
      }
    };
    var isArray = Array.isArray;
    var push = Array.prototype.push;
    var pushToArray = function(arr, valueOrArray) {
      push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
    };
    var toISO = Date.prototype.toISOString;
    var defaultFormat = formats["default"];
    var defaults = {
      addQueryPrefix: false,
      allowDots: false,
      allowEmptyArrays: false,
      arrayFormat: "indices",
      charset: "utf-8",
      charsetSentinel: false,
      delimiter: "&",
      encode: true,
      encodeDotInKeys: false,
      encoder: utils.encode,
      encodeValuesOnly: false,
      format: defaultFormat,
      formatter: formats.formatters[defaultFormat],
      // deprecated
      indices: false,
      serializeDate: function serializeDate(date) {
        return toISO.call(date);
      },
      skipNulls: false,
      strictNullHandling: false
    };
    var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
      return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
    };
    var sentinel = {};
    var stringify2 = function stringify3(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
      var obj2 = object;
      var tmpSc = sideChannel;
      var step = 0;
      var findFlag = false;
      while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
        var pos = tmpSc.get(object);
        step += 1;
        if (typeof pos !== "undefined") {
          if (pos === step) {
            throw new RangeError("Cyclic object value");
          } else {
            findFlag = true;
          }
        }
        if (typeof tmpSc.get(sentinel) === "undefined") {
          step = 0;
        }
      }
      if (typeof filter === "function") {
        obj2 = filter(prefix, obj2);
      } else if (obj2 instanceof Date) {
        obj2 = serializeDate(obj2);
      } else if (generateArrayPrefix === "comma" && isArray(obj2)) {
        obj2 = utils.maybeMap(obj2, function(value2) {
          if (value2 instanceof Date) {
            return serializeDate(value2);
          }
          return value2;
        });
      }
      if (obj2 === null) {
        if (strictNullHandling) {
          return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
        }
        obj2 = "";
      }
      if (isNonNullishPrimitive(obj2) || utils.isBuffer(obj2)) {
        if (encoder) {
          var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format);
          return [formatter(keyValue) + "=" + formatter(encoder(obj2, defaults.encoder, charset, "value", format))];
        }
        return [formatter(prefix) + "=" + formatter(String(obj2))];
      }
      var values = [];
      if (typeof obj2 === "undefined") {
        return values;
      }
      var objKeys;
      if (generateArrayPrefix === "comma" && isArray(obj2)) {
        if (encodeValuesOnly && encoder) {
          obj2 = utils.maybeMap(obj2, encoder);
        }
        objKeys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }];
      } else if (isArray(filter)) {
        objKeys = filter;
      } else {
        var keys = Object.keys(obj2);
        objKeys = sort ? keys.sort(sort) : keys;
      }
      var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix;
      var adjustedPrefix = commaRoundTrip && isArray(obj2) && obj2.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
      if (allowEmptyArrays && isArray(obj2) && obj2.length === 0) {
        return adjustedPrefix + "[]";
      }
      for (var j = 0; j < objKeys.length; ++j) {
        var key = objKeys[j];
        var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj2[key];
        if (skipNulls && value === null) {
          continue;
        }
        var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key;
        var keyPrefix = isArray(obj2) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
        sideChannel.set(object, step);
        var valueSideChannel = getSideChannel();
        valueSideChannel.set(sentinel, sideChannel);
        pushToArray(values, stringify3(
          value,
          keyPrefix,
          generateArrayPrefix,
          commaRoundTrip,
          allowEmptyArrays,
          strictNullHandling,
          skipNulls,
          encodeDotInKeys,
          generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj2) ? null : encoder,
          filter,
          sort,
          allowDots,
          serializeDate,
          format,
          formatter,
          encodeValuesOnly,
          charset,
          valueSideChannel
        ));
      }
      return values;
    };
    var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
      if (!opts) {
        return defaults;
      }
      if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
        throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
      }
      if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
        throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
      }
      if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
        throw new TypeError("Encoder has to be a function.");
      }
      var charset = opts.charset || defaults.charset;
      if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
        throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
      }
      var format = formats["default"];
      if (typeof opts.format !== "undefined") {
        if (!has.call(formats.formatters, opts.format)) {
          throw new TypeError("Unknown format option provided.");
        }
        format = opts.format;
      }
      var formatter = formats.formatters[format];
      var filter = defaults.filter;
      if (typeof opts.filter === "function" || isArray(opts.filter)) {
        filter = opts.filter;
      }
      var arrayFormat;
      if (opts.arrayFormat in arrayPrefixGenerators) {
        arrayFormat = opts.arrayFormat;
      } else if ("indices" in opts) {
        arrayFormat = opts.indices ? "indices" : "repeat";
      } else {
        arrayFormat = defaults.arrayFormat;
      }
      if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
        throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
      }
      var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
      return {
        addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
        allowDots,
        allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
        arrayFormat,
        charset,
        charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
        commaRoundTrip: opts.commaRoundTrip,
        delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
        encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
        encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
        encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
        encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
        filter,
        format,
        formatter,
        serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
        skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
        sort: typeof opts.sort === "function" ? opts.sort : null,
        strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
      };
    };
    module2.exports = function(object, opts) {
      var obj2 = object;
      var options = normalizeStringifyOptions(opts);
      var objKeys;
      var filter;
      if (typeof options.filter === "function") {
        filter = options.filter;
        obj2 = filter("", obj2);
      } else if (isArray(options.filter)) {
        filter = options.filter;
        objKeys = filter;
      }
      var keys = [];
      if (typeof obj2 !== "object" || obj2 === null) {
        return "";
      }
      var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
      var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
      if (!objKeys) {
        objKeys = Object.keys(obj2);
      }
      if (options.sort) {
        objKeys.sort(options.sort);
      }
      var sideChannel = getSideChannel();
      for (var i = 0; i < objKeys.length; ++i) {
        var key = objKeys[i];
        if (options.skipNulls && obj2[key] === null) {
          continue;
        }
        pushToArray(keys, stringify2(
          obj2[key],
          key,
          generateArrayPrefix,
          commaRoundTrip,
          options.allowEmptyArrays,
          options.strictNullHandling,
          options.skipNulls,
          options.encodeDotInKeys,
          options.encode ? options.encoder : null,
          options.filter,
          options.sort,
          options.allowDots,
          options.serializeDate,
          options.format,
          options.formatter,
          options.encodeValuesOnly,
          options.charset,
          sideChannel
        ));
      }
      var joined = keys.join(options.delimiter);
      var prefix = options.addQueryPrefix === true ? "?" : "";
      if (options.charsetSentinel) {
        if (options.charset === "iso-8859-1") {
          prefix += "utf8=%26%2310003%3B&";
        } else {
          prefix += "utf8=%E2%9C%93&";
        }
      }
      return joined.length > 0 ? prefix + joined : "";
    };
  }
});

// node_modules/qs/lib/parse.js
var require_parse = __commonJS({
  "node_modules/qs/lib/parse.js"(exports2, module2) {
    "use strict";
    var utils = require_utils8();
    var has = Object.prototype.hasOwnProperty;
    var isArray = Array.isArray;
    var defaults = {
      allowDots: false,
      allowEmptyArrays: false,
      allowPrototypes: false,
      allowSparse: false,
      arrayLimit: 20,
      charset: "utf-8",
      charsetSentinel: false,
      comma: false,
      decodeDotInKeys: false,
      decoder: utils.decode,
      delimiter: "&",
      depth: 5,
      duplicates: "combine",
      ignoreQueryPrefix: false,
      interpretNumericEntities: false,
      parameterLimit: 1e3,
      parseArrays: true,
      plainObjects: false,
      strictDepth: false,
      strictNullHandling: false
    };
    var interpretNumericEntities = function(str) {
      return str.replace(/&#(\d+);/g, function($0, numberStr) {
        return String.fromCharCode(parseInt(numberStr, 10));
      });
    };
    var parseArrayValue = function(val, options) {
      if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
        return val.split(",");
      }
      return val;
    };
    var isoSentinel = "utf8=%26%2310003%3B";
    var charsetSentinel = "utf8=%E2%9C%93";
    var parseValues = function parseQueryStringValues(str, options) {
      var obj2 = { __proto__: null };
      var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
      cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
      var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
      var parts = cleanStr.split(options.delimiter, limit);
      var skipIndex = -1;
      var i;
      var charset = options.charset;
      if (options.charsetSentinel) {
        for (i = 0; i < parts.length; ++i) {
          if (parts[i].indexOf("utf8=") === 0) {
            if (parts[i] === charsetSentinel) {
              charset = "utf-8";
            } else if (parts[i] === isoSentinel) {
              charset = "iso-8859-1";
            }
            skipIndex = i;
            i = parts.length;
          }
        }
      }
      for (i = 0; i < parts.length; ++i) {
        if (i === skipIndex) {
          continue;
        }
        var part = parts[i];
        var bracketEqualsPos = part.indexOf("]=");
        var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
        var key, val;
        if (pos === -1) {
          key = options.decoder(part, defaults.decoder, charset, "key");
          val = options.strictNullHandling ? null : "";
        } else {
          key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
          val = utils.maybeMap(
            parseArrayValue(part.slice(pos + 1), options),
            function(encodedVal) {
              return options.decoder(encodedVal, defaults.decoder, charset, "value");
            }
          );
        }
        if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
          val = interpretNumericEntities(val);
        }
        if (part.indexOf("[]=") > -1) {
          val = isArray(val) ? [val] : val;
        }
        var existing = has.call(obj2, key);
        if (existing && options.duplicates === "combine") {
          obj2[key] = utils.combine(obj2[key], val);
        } else if (!existing || options.duplicates === "last") {
          obj2[key] = val;
        }
      }
      return obj2;
    };
    var parseObject = function(chain, val, options, valuesParsed) {
      var leaf = valuesParsed ? val : parseArrayValue(val, options);
      for (var i = chain.length - 1; i >= 0; --i) {
        var obj2;
        var root = chain[i];
        if (root === "[]" && options.parseArrays) {
          obj2 = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
        } else {
          obj2 = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
          var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
          var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
          var index = parseInt(decodedRoot, 10);
          if (!options.parseArrays && decodedRoot === "") {
            obj2 = { 0: leaf };
          } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
            obj2 = [];
            obj2[index] = leaf;
          } else if (decodedRoot !== "__proto__") {
            obj2[decodedRoot] = leaf;
          }
        }
        leaf = obj2;
      }
      return leaf;
    };
    var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
      if (!givenKey) {
        return;
      }
      var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
      var brackets = /(\[[^[\]]*])/;
      var child = /(\[[^[\]]*])/g;
      var segment = options.depth > 0 && brackets.exec(key);
      var parent = segment ? key.slice(0, segment.index) : key;
      var keys = [];
      if (parent) {
        if (!options.plainObjects && has.call(Object.prototype, parent)) {
          if (!options.allowPrototypes) {
            return;
          }
        }
        keys.push(parent);
      }
      var i = 0;
      while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
        i += 1;
        if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
          if (!options.allowPrototypes) {
            return;
          }
        }
        keys.push(segment[1]);
      }
      if (segment) {
        if (options.strictDepth === true) {
          throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
        }
        keys.push("[" + key.slice(segment.index) + "]");
      }
      return parseObject(keys, val, options, valuesParsed);
    };
    var normalizeParseOptions = function normalizeParseOptions2(opts) {
      if (!opts) {
        return defaults;
      }
      if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
        throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
      }
      if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
        throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
      }
      if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
        throw new TypeError("Decoder has to be a function.");
      }
      if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
        throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
      }
      var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
      var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
      if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
        throw new TypeError("The duplicates option must be either combine, first, or last");
      }
      var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
      return {
        allowDots,
        allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
        allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
        allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
        arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
        charset,
        charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
        comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
        decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
        decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
        delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
        // eslint-disable-next-line no-implicit-coercion, no-extra-parens
        depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
        duplicates,
        ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
        interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
        parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
        parseArrays: opts.parseArrays !== false,
        plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
        strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
        strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
      };
    };
    module2.exports = function(str, opts) {
      var options = normalizeParseOptions(opts);
      if (str === "" || str === null || typeof str === "undefined") {
        return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
      }
      var tempObj = typeof str === "string" ? parseValues(str, options) : str;
      var obj2 = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
      var keys = Object.keys(tempObj);
      for (var i = 0; i < keys.length; ++i) {
        var key = keys[i];
        var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
        obj2 = utils.merge(obj2, newObj, options);
      }
      if (options.allowSparse === true) {
        return obj2;
      }
      return utils.compact(obj2);
    };
  }
});

// node_modules/qs/lib/index.js
var require_lib12 = __commonJS({
  "node_modules/qs/lib/index.js"(exports2, module2) {
    "use strict";
    var stringify2 = require_stringify3();
    var parse2 = require_parse();
    var formats = require_formats();
    module2.exports = {
      formats,
      parse: parse2,
      stringify: stringify2
    };
  }
});

// node_modules/@cypress/request/lib/querystring.js
var require_querystring = __commonJS({
  "node_modules/@cypress/request/lib/querystring.js"(exports2) {
    "use strict";
    var qs = require_lib12();
    var querystring = require("querystring");
    function Querystring(request) {
      this.request = request;
      this.lib = null;
      this.useQuerystring = null;
      this.parseOptions = null;
      this.stringifyOptions = null;
    }
    Querystring.prototype.init = function(options) {
      if (this.lib) {
        return;
      }
      this.useQuerystring = options.useQuerystring;
      this.lib = this.useQuerystring ? querystring : qs;
      this.parseOptions = options.qsParseOptions || {};
      this.stringifyOptions = options.qsStringifyOptions || {};
    };
    Querystring.prototype.stringify = function(obj2) {
      return this.useQuerystring ? this.rfc3986(this.lib.stringify(
        obj2,
        this.stringifyOptions.sep || null,
        this.stringifyOptions.eq || null,
        this.stringifyOptions
      )) : this.lib.stringify(obj2, this.stringifyOptions);
    };
    Querystring.prototype.parse = function(str) {
      return this.useQuerystring ? this.lib.parse(
        str,
        this.parseOptions.sep || null,
        this.parseOptions.eq || null,
        this.parseOptions
      ) : this.lib.parse(str, this.parseOptions);
    };
    Querystring.prototype.rfc3986 = function(str) {
      return str.replace(/[!'()*]/g, function(c) {
        return "%" + c.charCodeAt(0).toString(16).toUpperCase();
      });
    };
    Querystring.prototype.unescape = querystring.unescape;
    exports2.Querystring = Querystring;
  }
});

// node_modules/@cypress/request/lib/har.js
var require_har = __commonJS({
  "node_modules/@cypress/request/lib/har.js"(exports2) {
    "use strict";
    var fs = require("fs");
    var qs = require("querystring");
    var extend = require_extend();
    function Har(request) {
      this.request = request;
    }
    Har.prototype.reducer = function(obj2, pair) {
      if (obj2[pair.name] === void 0) {
        obj2[pair.name] = pair.value;
        return obj2;
      }
      var arr = [
        obj2[pair.name],
        pair.value
      ];
      obj2[pair.name] = arr;
      return obj2;
    };
    Har.prototype.prep = function(data) {
      data.queryObj = {};
      data.headersObj = {};
      data.postData.jsonObj = false;
      data.postData.paramsObj = false;
      if (data.queryString && data.queryString.length) {
        data.queryObj = data.queryString.reduce(this.reducer, {});
      }
      if (data.headers && data.headers.length) {
        data.headersObj = data.headers.reduceRight(function(headers, header) {
          headers[header.name] = header.value;
          return headers;
        }, {});
      }
      if (data.cookies && data.cookies.length) {
        var cookies = data.cookies.map(function(cookie) {
          return cookie.name + "=" + cookie.value;
        });
        if (cookies.length) {
          data.headersObj.cookie = cookies.join("; ");
        }
      }
      function some(arr) {
        return arr.some(function(type) {
          return data.postData.mimeType.indexOf(type) === 0;
        });
      }
      if (some([
        "multipart/mixed",
        "multipart/related",
        "multipart/form-data",
        "multipart/alternative"
      ])) {
        data.postData.mimeType = "multipart/form-data";
      } else if (some([
        "application/x-www-form-urlencoded"
      ])) {
        if (!data.postData.params) {
          data.postData.text = "";
        } else {
          data.postData.paramsObj = data.postData.params.reduce(this.reducer, {});
          data.postData.text = qs.stringify(data.postData.paramsObj);
        }
      } else if (some([
        "text/json",
        "text/x-json",
        "application/json",
        "application/x-json"
      ])) {
        data.postData.mimeType = "application/json";
        if (data.postData.text) {
          try {
            data.postData.jsonObj = JSON.parse(data.postData.text);
          } catch (e) {
            this.request.debug(e);
            data.postData.mimeType = "text/plain";
          }
        }
      }
      return data;
    };
    Har.prototype.options = function(options) {
      if (!options.har) {
        return options;
      }
      var har = {};
      extend(har, options.har);
      if (har.log && har.log.entries) {
        har = har.log.entries[0];
      }
      har.url = har.url || options.url || options.uri || options.baseUrl || "/";
      har.httpVersion = har.httpVersion || "HTTP/1.1";
      har.queryString = har.queryString || [];
      har.headers = har.headers || [];
      har.cookies = har.cookies || [];
      har.postData = har.postData || {};
      har.postData.mimeType = har.postData.mimeType || "application/octet-stream";
      har.bodySize = 0;
      har.headersSize = 0;
      har.postData.size = 0;
      var req = this.prep(har);
      if (req.url) {
        options.url = req.url;
      }
      if (req.method) {
        options.method = req.method;
      }
      if (Object.keys(req.queryObj).length) {
        options.qs = req.queryObj;
      }
      if (Object.keys(req.headersObj).length) {
        options.headers = req.headersObj;
      }
      function test(type) {
        return req.postData.mimeType.indexOf(type) === 0;
      }
      if (test("application/x-www-form-urlencoded")) {
        options.form = req.postData.paramsObj;
      } else if (test("application/json")) {
        if (req.postData.jsonObj) {
          options.body = req.postData.jsonObj;
          options.json = true;
        }
      } else if (test("multipart/form-data")) {
        options.formData = {};
        req.postData.params.forEach(function(param) {
          var attachment = {};
          if (!param.fileName && !param.contentType) {
            options.formData[param.name] = param.value;
            return;
          }
          if (param.fileName && !param.value) {
            attachment.value = fs.createReadStream(param.fileName);
          } else if (param.value) {
            attachment.value = param.value;
          }
          if (param.fileName) {
            attachment.options = {
              filename: param.fileName,
              contentType: param.contentType ? param.contentType : null
            };
          }
          options.formData[param.name] = attachment;
        });
      } else {
        if (req.postData.text) {
          options.body = req.postData.text;
        }
      }
      return options;
    };
    exports2.Har = Har;
  }
});

// node_modules/uuid/dist/esm-browser/rng.js
function rng() {
  if (!getRandomValues) {
    getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
    if (!getRandomValues) {
      throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
    }
  }
  return getRandomValues(rnds8);
}
var getRandomValues, rnds8;
var init_rng = __esm({
  "node_modules/uuid/dist/esm-browser/rng.js"() {
    rnds8 = new Uint8Array(16);
  }
});

// node_modules/uuid/dist/esm-browser/regex.js
var regex_default;
var init_regex = __esm({
  "node_modules/uuid/dist/esm-browser/regex.js"() {
    regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
  }
});

// node_modules/uuid/dist/esm-browser/validate.js
function validate(uuid) {
  return typeof uuid === "string" && regex_default.test(uuid);
}
var validate_default;
var init_validate = __esm({
  "node_modules/uuid/dist/esm-browser/validate.js"() {
    init_regex();
    validate_default = validate;
  }
});

// node_modules/uuid/dist/esm-browser/stringify.js
function stringify(arr) {
  var offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  var uuid = (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase();
  if (!validate_default(uuid)) {
    throw TypeError("Stringified UUID is invalid");
  }
  return uuid;
}
var byteToHex, i, stringify_default;
var init_stringify = __esm({
  "node_modules/uuid/dist/esm-browser/stringify.js"() {
    init_validate();
    byteToHex = [];
    for (i = 0; i < 256; ++i) {
      byteToHex.push((i + 256).toString(16).substr(1));
    }
    stringify_default = stringify;
  }
});

// node_modules/uuid/dist/esm-browser/v1.js
function v1(options, buf, offset2) {
  var i = buf && offset2 || 0;
  var b = buf || new Array(16);
  options = options || {};
  var node = options.node || _nodeId;
  var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
  if (node == null || clockseq == null) {
    var seedBytes = options.random || (options.rng || rng)();
    if (node == null) {
      node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
    }
    if (clockseq == null) {
      clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
    }
  }
  var msecs = options.msecs !== void 0 ? options.msecs : Date.now();
  var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1;
  var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
  if (dt < 0 && options.clockseq === void 0) {
    clockseq = clockseq + 1 & 16383;
  }
  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) {
    nsecs = 0;
  }
  if (nsecs >= 1e4) {
    throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  }
  _lastMSecs = msecs;
  _lastNSecs = nsecs;
  _clockseq = clockseq;
  msecs += 122192928e5;
  var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
  b[i++] = tl >>> 24 & 255;
  b[i++] = tl >>> 16 & 255;
  b[i++] = tl >>> 8 & 255;
  b[i++] = tl & 255;
  var tmh = msecs / 4294967296 * 1e4 & 268435455;
  b[i++] = tmh >>> 8 & 255;
  b[i++] = tmh & 255;
  b[i++] = tmh >>> 24 & 15 | 16;
  b[i++] = tmh >>> 16 & 255;
  b[i++] = clockseq >>> 8 | 128;
  b[i++] = clockseq & 255;
  for (var n = 0; n < 6; ++n) {
    b[i + n] = node[n];
  }
  return buf || stringify_default(b);
}
var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default;
var init_v1 = __esm({
  "node_modules/uuid/dist/esm-browser/v1.js"() {
    init_rng();
    init_stringify();
    _lastMSecs = 0;
    _lastNSecs = 0;
    v1_default = v1;
  }
});

// node_modules/uuid/dist/esm-browser/parse.js
function parse(uuid) {
  if (!validate_default(uuid)) {
    throw TypeError("Invalid UUID");
  }
  var v;
  var arr = new Uint8Array(16);
  arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  arr[1] = v >>> 16 & 255;
  arr[2] = v >>> 8 & 255;
  arr[3] = v & 255;
  arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  arr[5] = v & 255;
  arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  arr[7] = v & 255;
  arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  arr[9] = v & 255;
  arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
  arr[11] = v / 4294967296 & 255;
  arr[12] = v >>> 24 & 255;
  arr[13] = v >>> 16 & 255;
  arr[14] = v >>> 8 & 255;
  arr[15] = v & 255;
  return arr;
}
var parse_default;
var init_parse = __esm({
  "node_modules/uuid/dist/esm-browser/parse.js"() {
    init_validate();
    parse_default = parse;
  }
});

// node_modules/uuid/dist/esm-browser/v35.js
function stringToBytes(str) {
  str = unescape(encodeURIComponent(str));
  var bytes = [];
  for (var i = 0; i < str.length; ++i) {
    bytes.push(str.charCodeAt(i));
  }
  return bytes;
}
function v35_default(name, version2, hashfunc) {
  function generateUUID(value, namespace, buf, offset2) {
    if (typeof value === "string") {
      value = stringToBytes(value);
    }
    if (typeof namespace === "string") {
      namespace = parse_default(namespace);
    }
    if (namespace.length !== 16) {
      throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
    }
    var bytes = new Uint8Array(16 + value.length);
    bytes.set(namespace);
    bytes.set(value, namespace.length);
    bytes = hashfunc(bytes);
    bytes[6] = bytes[6] & 15 | version2;
    bytes[8] = bytes[8] & 63 | 128;
    if (buf) {
      offset2 = offset2 || 0;
      for (var i = 0; i < 16; ++i) {
        buf[offset2 + i] = bytes[i];
      }
      return buf;
    }
    return stringify_default(bytes);
  }
  try {
    generateUUID.name = name;
  } catch (err) {
  }
  generateUUID.DNS = DNS;
  generateUUID.URL = URL2;
  return generateUUID;
}
var DNS, URL2;
var init_v35 = __esm({
  "node_modules/uuid/dist/esm-browser/v35.js"() {
    init_stringify();
    init_parse();
    DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
    URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
  }
});

// node_modules/uuid/dist/esm-browser/md5.js
function md5(bytes) {
  if (typeof bytes === "string") {
    var msg = unescape(encodeURIComponent(bytes));
    bytes = new Uint8Array(msg.length);
    for (var i = 0; i < msg.length; ++i) {
      bytes[i] = msg.charCodeAt(i);
    }
  }
  return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
}
function md5ToHexEncodedArray(input) {
  var output = [];
  var length32 = input.length * 32;
  var hexTab = "0123456789abcdef";
  for (var i = 0; i < length32; i += 8) {
    var x = input[i >> 5] >>> i % 32 & 255;
    var hex = parseInt(hexTab.charAt(x >>> 4 & 15) + hexTab.charAt(x & 15), 16);
    output.push(hex);
  }
  return output;
}
function getOutputLength(inputLength8) {
  return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
}
function wordsToMd5(x, len) {
  x[len >> 5] |= 128 << len % 32;
  x[getOutputLength(len) - 1] = len;
  var a = 1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d = 271733878;
  for (var i = 0; i < x.length; i += 16) {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;
    a = md5ff(a, b, c, d, x[i], 7, -680876936);
    d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
    c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
    b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
    a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
    d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
    c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
    b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
    a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
    d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
    c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
    b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
    a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
    d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
    c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
    b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
    a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
    d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
    c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
    b = md5gg(b, c, d, a, x[i], 20, -373897302);
    a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
    d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
    c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
    b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
    a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
    d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
    c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
    b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
    a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
    d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
    c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
    b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
    a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
    d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
    c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
    b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
    a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
    d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
    c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
    b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
    a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
    d = md5hh(d, a, b, c, x[i], 11, -358537222);
    c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
    b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
    a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
    d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
    c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
    b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
    a = md5ii(a, b, c, d, x[i], 6, -198630844);
    d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
    c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
    b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
    a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
    d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
    c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
    b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
    a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
    d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
    c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
    b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
    a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
    d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
    c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
    b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
    a = safeAdd(a, olda);
    b = safeAdd(b, oldb);
    c = safeAdd(c, oldc);
    d = safeAdd(d, oldd);
  }
  return [a, b, c, d];
}
function bytesToWords(input) {
  if (input.length === 0) {
    return [];
  }
  var length8 = input.length * 8;
  var output = new Uint32Array(getOutputLength(length8));
  for (var i = 0; i < length8; i += 8) {
    output[i >> 5] |= (input[i / 8] & 255) << i % 32;
  }
  return output;
}
function safeAdd(x, y) {
  var lsw = (x & 65535) + (y & 65535);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return msw << 16 | lsw & 65535;
}
function bitRotateLeft(num, cnt) {
  return num << cnt | num >>> 32 - cnt;
}
function md5cmn(q2, a, b, x, s, t) {
  return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q2), safeAdd(x, t)), s), b);
}
function md5ff(a, b, c, d, x, s, t) {
  return md5cmn(b & c | ~b & d, a, b, x, s, t);
}
function md5gg(a, b, c, d, x, s, t) {
  return md5cmn(b & d | c & ~d, a, b, x, s, t);
}
function md5hh(a, b, c, d, x, s, t) {
  return md5cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5ii(a, b, c, d, x, s, t) {
  return md5cmn(c ^ (b | ~d), a, b, x, s, t);
}
var md5_default;
var init_md5 = __esm({
  "node_modules/uuid/dist/esm-browser/md5.js"() {
    md5_default = md5;
  }
});

// node_modules/uuid/dist/esm-browser/v3.js
var v3, v3_default;
var init_v3 = __esm({
  "node_modules/uuid/dist/esm-browser/v3.js"() {
    init_v35();
    init_md5();
    v3 = v35_default("v3", 48, md5_default);
    v3_default = v3;
  }
});

// node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset2) {
  options = options || {};
  var rnds = options.random || (options.rng || rng)();
  rnds[6] = rnds[6] & 15 | 64;
  rnds[8] = rnds[8] & 63 | 128;
  if (buf) {
    offset2 = offset2 || 0;
    for (var i = 0; i < 16; ++i) {
      buf[offset2 + i] = rnds[i];
    }
    return buf;
  }
  return stringify_default(rnds);
}
var v4_default;
var init_v4 = __esm({
  "node_modules/uuid/dist/esm-browser/v4.js"() {
    init_rng();
    init_stringify();
    v4_default = v4;
  }
});

// node_modules/uuid/dist/esm-browser/sha1.js
function f(s, x, y, z) {
  switch (s) {
    case 0:
      return x & y ^ ~x & z;
    case 1:
      return x ^ y ^ z;
    case 2:
      return x & y ^ x & z ^ y & z;
    case 3:
      return x ^ y ^ z;
  }
}
function ROTL(x, n) {
  return x << n | x >>> 32 - n;
}
function sha1(bytes) {
  var K = [1518500249, 1859775393, 2400959708, 3395469782];
  var H = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
  if (typeof bytes === "string") {
    var msg = unescape(encodeURIComponent(bytes));
    bytes = [];
    for (var i = 0; i < msg.length; ++i) {
      bytes.push(msg.charCodeAt(i));
    }
  } else if (!Array.isArray(bytes)) {
    bytes = Array.prototype.slice.call(bytes);
  }
  bytes.push(128);
  var l = bytes.length / 4 + 2;
  var N = Math.ceil(l / 16);
  var M = new Array(N);
  for (var _i = 0; _i < N; ++_i) {
    var arr = new Uint32Array(16);
    for (var j = 0; j < 16; ++j) {
      arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];
    }
    M[_i] = arr;
  }
  M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
  M[N - 1][14] = Math.floor(M[N - 1][14]);
  M[N - 1][15] = (bytes.length - 1) * 8 & 4294967295;
  for (var _i2 = 0; _i2 < N; ++_i2) {
    var W = new Uint32Array(80);
    for (var t = 0; t < 16; ++t) {
      W[t] = M[_i2][t];
    }
    for (var _t = 16; _t < 80; ++_t) {
      W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);
    }
    var a = H[0];
    var b = H[1];
    var c = H[2];
    var d = H[3];
    var e = H[4];
    for (var _t2 = 0; _t2 < 80; ++_t2) {
      var s = Math.floor(_t2 / 20);
      var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;
      e = d;
      d = c;
      c = ROTL(b, 30) >>> 0;
      b = a;
      a = T;
    }
    H[0] = H[0] + a >>> 0;
    H[1] = H[1] + b >>> 0;
    H[2] = H[2] + c >>> 0;
    H[3] = H[3] + d >>> 0;
    H[4] = H[4] + e >>> 0;
  }
  return [H[0] >> 24 & 255, H[0] >> 16 & 255, H[0] >> 8 & 255, H[0] & 255, H[1] >> 24 & 255, H[1] >> 16 & 255, H[1] >> 8 & 255, H[1] & 255, H[2] >> 24 & 255, H[2] >> 16 & 255, H[2] >> 8 & 255, H[2] & 255, H[3] >> 24 & 255, H[3] >> 16 & 255, H[3] >> 8 & 255, H[3] & 255, H[4] >> 24 & 255, H[4] >> 16 & 255, H[4] >> 8 & 255, H[4] & 255];
}
var sha1_default;
var init_sha1 = __esm({
  "node_modules/uuid/dist/esm-browser/sha1.js"() {
    sha1_default = sha1;
  }
});

// node_modules/uuid/dist/esm-browser/v5.js
var v5, v5_default;
var init_v5 = __esm({
  "node_modules/uuid/dist/esm-browser/v5.js"() {
    init_v35();
    init_sha1();
    v5 = v35_default("v5", 80, sha1_default);
    v5_default = v5;
  }
});

// node_modules/uuid/dist/esm-browser/nil.js
var nil_default;
var init_nil = __esm({
  "node_modules/uuid/dist/esm-browser/nil.js"() {
    nil_default = "00000000-0000-0000-0000-000000000000";
  }
});

// node_modules/uuid/dist/esm-browser/version.js
function version(uuid) {
  if (!validate_default(uuid)) {
    throw TypeError("Invalid UUID");
  }
  return parseInt(uuid.substr(14, 1), 16);
}
var version_default;
var init_version = __esm({
  "node_modules/uuid/dist/esm-browser/version.js"() {
    init_validate();
    version_default = version;
  }
});

// node_modules/uuid/dist/esm-browser/index.js
var esm_browser_exports = {};
__export(esm_browser_exports, {
  NIL: () => nil_default,
  parse: () => parse_default,
  stringify: () => stringify_default,
  v1: () => v1_default,
  v3: () => v3_default,
  v4: () => v4_default,
  v5: () => v5_default,
  validate: () => validate_default,
  version: () => version_default
});
var init_esm_browser = __esm({
  "node_modules/uuid/dist/esm-browser/index.js"() {
    init_v1();
    init_v3();
    init_v4();
    init_v5();
    init_nil();
    init_version();
    init_validate();
    init_stringify();
    init_parse();
  }
});

// node_modules/@cypress/request/lib/auth.js
var require_auth2 = __commonJS({
  "node_modules/@cypress/request/lib/auth.js"(exports2) {
    "use strict";
    var caseless = require_caseless();
    var { v4: uuid } = (init_esm_browser(), __toCommonJS(esm_browser_exports));
    var helpers = require_helpers3();
    var md52 = helpers.md5;
    var toBase64 = helpers.toBase64;
    function Auth(request) {
      this.request = request;
      this.hasAuth = false;
      this.sentAuth = false;
      this.bearerToken = null;
      this.user = null;
      this.pass = null;
    }
    Auth.prototype.basic = function(user, pass, sendImmediately) {
      var self2 = this;
      if (typeof user !== "string" || pass !== void 0 && typeof pass !== "string") {
        self2.request.emit("error", new Error("auth() received invalid user or password"));
      }
      self2.user = user;
      self2.pass = pass;
      self2.hasAuth = true;
      var header = user + ":" + (pass || "");
      if (sendImmediately || typeof sendImmediately === "undefined") {
        var authHeader = "Basic " + toBase64(header);
        self2.sentAuth = true;
        return authHeader;
      }
    };
    Auth.prototype.bearer = function(bearer, sendImmediately) {
      var self2 = this;
      self2.bearerToken = bearer;
      self2.hasAuth = true;
      if (sendImmediately || typeof sendImmediately === "undefined") {
        if (typeof bearer === "function") {
          bearer = bearer();
        }
        var authHeader = "Bearer " + (bearer || "");
        self2.sentAuth = true;
        return authHeader;
      }
    };
    Auth.prototype.digest = function(method, path4, authHeader) {
      var self2 = this;
      var challenge = {};
      var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;
      while (true) {
        var match = re.exec(authHeader);
        if (!match) {
          break;
        }
        challenge[match[1]] = match[2] || match[3];
      }
      var ha1Compute = function(algorithm2, user, realm, pass, nonce, cnonce2) {
        var ha12 = md52(user + ":" + realm + ":" + pass);
        if (algorithm2 && algorithm2.toLowerCase() === "md5-sess") {
          return md52(ha12 + ":" + nonce + ":" + cnonce2);
        } else {
          return ha12;
        }
      };
      var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && "auth";
      var nc = qop && "00000001";
      var cnonce = qop && uuid().replace(/-/g, "");
      var ha1 = ha1Compute(challenge.algorithm, self2.user, challenge.realm, self2.pass, challenge.nonce, cnonce);
      var ha2 = md52(method + ":" + path4);
      var digestResponse = qop ? md52(ha1 + ":" + challenge.nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + ha2) : md52(ha1 + ":" + challenge.nonce + ":" + ha2);
      var authValues = {
        username: self2.user,
        realm: challenge.realm,
        nonce: challenge.nonce,
        uri: path4,
        qop,
        response: digestResponse,
        nc,
        cnonce,
        algorithm: challenge.algorithm,
        opaque: challenge.opaque
      };
      authHeader = [];
      for (var k in authValues) {
        if (authValues[k]) {
          if (k === "qop" || k === "nc" || k === "algorithm") {
            authHeader.push(k + "=" + authValues[k]);
          } else {
            authHeader.push(k + '="' + authValues[k] + '"');
          }
        }
      }
      authHeader = "Digest " + authHeader.join(", ");
      self2.sentAuth = true;
      return authHeader;
    };
    Auth.prototype.onRequest = function(user, pass, sendImmediately, bearer) {
      var self2 = this;
      var request = self2.request;
      var authHeader;
      if (bearer === void 0 && user === void 0) {
        self2.request.emit("error", new Error("no auth mechanism defined"));
      } else if (bearer !== void 0) {
        authHeader = self2.bearer(bearer, sendImmediately);
      } else {
        authHeader = self2.basic(user, pass, sendImmediately);
      }
      if (authHeader) {
        request.setHeader("authorization", authHeader);
      }
    };
    Auth.prototype.onResponse = function(response) {
      var self2 = this;
      var request = self2.request;
      if (!self2.hasAuth || self2.sentAuth) {
        return null;
      }
      var c = caseless(response.headers);
      var authHeader = c.get("www-authenticate");
      var authVerb = authHeader && authHeader.split(" ")[0].toLowerCase();
      request.debug("reauth", authVerb);
      switch (authVerb) {
        case "basic":
          return self2.basic(self2.user, self2.pass, true);
        case "bearer":
          return self2.bearer(self2.bearerToken, true);
        case "digest":
          return self2.digest(request.method, request.path, authHeader);
      }
    };
    exports2.Auth = Auth;
  }
});

// node_modules/@cypress/request/lib/hawk.js
var require_hawk = __commonJS({
  "node_modules/@cypress/request/lib/hawk.js"(exports2) {
    "use strict";
    var crypto3 = require("crypto");
    function randomString(size) {
      var bits = (size + 1) * 6;
      var buffer = crypto3.randomBytes(Math.ceil(bits / 8));
      var string = buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
      return string.slice(0, size);
    }
    function calculatePayloadHash(payload, algorithm2, contentType) {
      var hash3 = crypto3.createHash(algorithm2);
      hash3.update("hawk.1.payload\n");
      hash3.update((contentType ? contentType.split(";")[0].trim().toLowerCase() : "") + "\n");
      hash3.update(payload || "");
      hash3.update("\n");
      return hash3.digest("base64");
    }
    exports2.calculateMac = function(credentials, opts) {
      var normalized = "hawk.1.header\n" + opts.ts + "\n" + opts.nonce + "\n" + (opts.method || "").toUpperCase() + "\n" + opts.resource + "\n" + opts.host.toLowerCase() + "\n" + opts.port + "\n" + (opts.hash || "") + "\n";
      if (opts.ext) {
        normalized = normalized + opts.ext.replace("\\", "\\\\").replace("\n", "\\n");
      }
      normalized = normalized + "\n";
      if (opts.app) {
        normalized = normalized + opts.app + "\n" + (opts.dlg || "") + "\n";
      }
      var hmac = crypto3.createHmac(credentials.algorithm, credentials.key).update(normalized);
      var digest = hmac.digest("base64");
      return digest;
    };
    exports2.header = function(uri, method, opts) {
      var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1e3);
      var credentials = opts.credentials;
      if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {
        return "";
      }
      if (["sha1", "sha256"].indexOf(credentials.algorithm) === -1) {
        return "";
      }
      var artifacts = {
        ts: timestamp,
        nonce: opts.nonce || randomString(6),
        method,
        resource: uri.pathname + (uri.search || ""),
        host: uri.hostname,
        port: uri.port || (uri.protocol === "http:" ? 80 : 443),
        hash: opts.hash,
        ext: opts.ext,
        app: opts.app,
        dlg: opts.dlg
      };
      if (!artifacts.hash && (opts.payload || opts.payload === "")) {
        artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType);
      }
      var mac = exports2.calculateMac(credentials, artifacts);
      var hasExt = artifacts.ext !== null && artifacts.ext !== void 0 && artifacts.ext !== "";
      var header = 'Hawk id="' + credentials.id + '", ts="' + artifacts.ts + '", nonce="' + artifacts.nonce + (artifacts.hash ? '", hash="' + artifacts.hash : "") + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, "\\\\").replace(/"/g, '\\"') : "") + '", mac="' + mac + '"';
      if (artifacts.app) {
        header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : "") + '"';
      }
      return header;
    };
  }
});

// node_modules/delayed-stream/lib/delayed_stream.js
var require_delayed_stream = __commonJS({
  "node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) {
    var Stream = require("stream").Stream;
    var util = require("util");
    module2.exports = DelayedStream;
    function DelayedStream() {
      this.source = null;
      this.dataSize = 0;
      this.maxDataSize = 1024 * 1024;
      this.pauseStream = true;
      this._maxDataSizeExceeded = false;
      this._released = false;
      this._bufferedEvents = [];
    }
    util.inherits(DelayedStream, Stream);
    DelayedStream.create = function(source, options) {
      var delayedStream = new this();
      options = options || {};
      for (var option in options) {
        delayedStream[option] = options[option];
      }
      delayedStream.source = source;
      var realEmit = source.emit;
      source.emit = function() {
        delayedStream._handleEmit(arguments);
        return realEmit.apply(source, arguments);
      };
      source.on("error", function() {
      });
      if (delayedStream.pauseStream) {
        source.pause();
      }
      return delayedStream;
    };
    Object.defineProperty(DelayedStream.prototype, "readable", {
      configurable: true,
      enumerable: true,
      get: function() {
        return this.source.readable;
      }
    });
    DelayedStream.prototype.setEncoding = function() {
      return this.source.setEncoding.apply(this.source, arguments);
    };
    DelayedStream.prototype.resume = function() {
      if (!this._released) {
        this.release();
      }
      this.source.resume();
    };
    DelayedStream.prototype.pause = function() {
      this.source.pause();
    };
    DelayedStream.prototype.release = function() {
      this._released = true;
      this._bufferedEvents.forEach(function(args) {
        this.emit.apply(this, args);
      }.bind(this));
      this._bufferedEvents = [];
    };
    DelayedStream.prototype.pipe = function() {
      var r = Stream.prototype.pipe.apply(this, arguments);
      this.resume();
      return r;
    };
    DelayedStream.prototype._handleEmit = function(args) {
      if (this._released) {
        this.emit.apply(this, args);
        return;
      }
      if (args[0] === "data") {
        this.dataSize += args[1].length;
        this._checkIfMaxDataSizeExceeded();
      }
      this._bufferedEvents.push(args);
    };
    DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
      if (this._maxDataSizeExceeded) {
        return;
      }
      if (this.dataSize <= this.maxDataSize) {
        return;
      }
      this._maxDataSizeExceeded = true;
      var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
      this.emit("error", new Error(message));
    };
  }
});

// node_modules/combined-stream/lib/combined_stream.js
var require_combined_stream = __commonJS({
  "node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) {
    var util = require("util");
    var Stream = require("stream").Stream;
    var DelayedStream = require_delayed_stream();
    module2.exports = CombinedStream;
    function CombinedStream() {
      this.writable = false;
      this.readable = true;
      this.dataSize = 0;
      this.maxDataSize = 2 * 1024 * 1024;
      this.pauseStreams = true;
      this._released = false;
      this._streams = [];
      this._currentStream = null;
      this._insideLoop = false;
      this._pendingNext = false;
    }
    util.inherits(CombinedStream, Stream);
    CombinedStream.create = function(options) {
      var combinedStream = new this();
      options = options || {};
      for (var option in options) {
        combinedStream[option] = options[option];
      }
      return combinedStream;
    };
    CombinedStream.isStreamLike = function(stream) {
      return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream);
    };
    CombinedStream.prototype.append = function(stream) {
      var isStreamLike = CombinedStream.isStreamLike(stream);
      if (isStreamLike) {
        if (!(stream instanceof DelayedStream)) {
          var newStream = DelayedStream.create(stream, {
            maxDataSize: Infinity,
            pauseStream: this.pauseStreams
          });
          stream.on("data", this._checkDataSize.bind(this));
          stream = newStream;
        }
        this._handleErrors(stream);
        if (this.pauseStreams) {
          stream.pause();
        }
      }
      this._streams.push(stream);
      return this;
    };
    CombinedStream.prototype.pipe = function(dest, options) {
      Stream.prototype.pipe.call(this, dest, options);
      this.resume();
      return dest;
    };
    CombinedStream.prototype._getNext = function() {
      this._currentStream = null;
      if (this._insideLoop) {
        this._pendingNext = true;
        return;
      }
      this._insideLoop = true;
      try {
        do {
          this._pendingNext = false;
          this._realGetNext();
        } while (this._pendingNext);
      } finally {
        this._insideLoop = false;
      }
    };
    CombinedStream.prototype._realGetNext = function() {
      var stream = this._streams.shift();
      if (typeof stream == "undefined") {
        this.end();
        return;
      }
      if (typeof stream !== "function") {
        this._pipeNext(stream);
        return;
      }
      var getStream = stream;
      getStream(function(stream2) {
        var isStreamLike = CombinedStream.isStreamLike(stream2);
        if (isStreamLike) {
          stream2.on("data", this._checkDataSize.bind(this));
          this._handleErrors(stream2);
        }
        this._pipeNext(stream2);
      }.bind(this));
    };
    CombinedStream.prototype._pipeNext = function(stream) {
      this._currentStream = stream;
      var isStreamLike = CombinedStream.isStreamLike(stream);
      if (isStreamLike) {
        stream.on("end", this._getNext.bind(this));
        stream.pipe(this, { end: false });
        return;
      }
      var value = stream;
      this.write(value);
      this._getNext();
    };
    CombinedStream.prototype._handleErrors = function(stream) {
      var self2 = this;
      stream.on("error", function(err) {
        self2._emitError(err);
      });
    };
    CombinedStream.prototype.write = function(data) {
      this.emit("data", data);
    };
    CombinedStream.prototype.pause = function() {
      if (!this.pauseStreams) {
        return;
      }
      if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function")
        this._currentStream.pause();
      this.emit("pause");
    };
    CombinedStream.prototype.resume = function() {
      if (!this._released) {
        this._released = true;
        this.writable = true;
        this._getNext();
      }
      if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function")
        this._currentStream.resume();
      this.emit("resume");
    };
    CombinedStream.prototype.end = function() {
      this._reset();
      this.emit("end");
    };
    CombinedStream.prototype.destroy = function() {
      this._reset();
      this.emit("close");
    };
    CombinedStream.prototype._reset = function() {
      this.writable = false;
      this._streams = [];
      this._currentStream = null;
    };
    CombinedStream.prototype._checkDataSize = function() {
      this._updateDataSize();
      if (this.dataSize <= this.maxDataSize) {
        return;
      }
      var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
      this._emitError(new Error(message));
    };
    CombinedStream.prototype._updateDataSize = function() {
      this.dataSize = 0;
      var self2 = this;
      this._streams.forEach(function(stream) {
        if (!stream.dataSize) {
          return;
        }
        self2.dataSize += stream.dataSize;
      });
      if (this._currentStream && this._currentStream.dataSize) {
        this.dataSize += this._currentStream.dataSize;
      }
    };
    CombinedStream.prototype._emitError = function(err) {
      this._reset();
      this.emit("error", err);
    };
  }
});

// node_modules/@cypress/request/lib/multipart.js
var require_multipart = __commonJS({
  "node_modules/@cypress/request/lib/multipart.js"(exports2) {
    "use strict";
    var { v4: uuid } = (init_esm_browser(), __toCommonJS(esm_browser_exports));
    var CombinedStream = require_combined_stream();
    var isstream = require_isstream();
    var Buffer3 = require_safe_buffer2().Buffer;
    function Multipart(request) {
      this.request = request;
      this.boundary = uuid();
      this.chunked = false;
      this.body = null;
    }
    Multipart.prototype.isChunked = function(options) {
      var self2 = this;
      var chunked = false;
      var parts = options.data || options;
      if (!parts.forEach) {
        self2.request.emit("error", new Error("Argument error, options.multipart."));
      }
      if (options.chunked !== void 0) {
        chunked = options.chunked;
      }
      if (self2.request.getHeader("transfer-encoding") === "chunked") {
        chunked = true;
      }
      if (!chunked) {
        parts.forEach(function(part) {
          if (typeof part.body === "undefined") {
            self2.request.emit("error", new Error("Body attribute missing in multipart."));
          }
          if (isstream(part.body)) {
            chunked = true;
          }
        });
      }
      return chunked;
    };
    Multipart.prototype.setHeaders = function(chunked) {
      var self2 = this;
      if (chunked && !self2.request.hasHeader("transfer-encoding")) {
        self2.request.setHeader("transfer-encoding", "chunked");
      }
      var header = self2.request.getHeader("content-type");
      if (!header || header.indexOf("multipart") === -1) {
        self2.request.setHeader("content-type", "multipart/related; boundary=" + self2.boundary);
      } else {
        if (header.indexOf("boundary") !== -1) {
          self2.boundary = header.replace(/.*boundary=([^\s;]+).*/, "$1");
        } else {
          self2.request.setHeader("content-type", header + "; boundary=" + self2.boundary);
        }
      }
    };
    Multipart.prototype.build = function(parts, chunked) {
      var self2 = this;
      var body = chunked ? new CombinedStream() : [];
      function add(part) {
        if (typeof part === "number") {
          part = part.toString();
        }
        return chunked ? body.append(part) : body.push(Buffer3.from(part));
      }
      if (self2.request.preambleCRLF) {
        add("\r\n");
      }
      parts.forEach(function(part) {
        var preamble = "--" + self2.boundary + "\r\n";
        Object.keys(part).forEach(function(key) {
          if (key === "body") {
            return;
          }
          preamble += key + ": " + part[key] + "\r\n";
        });
        preamble += "\r\n";
        add(preamble);
        add(part.body);
        add("\r\n");
      });
      add("--" + self2.boundary + "--");
      if (self2.request.postambleCRLF) {
        add("\r\n");
      }
      return body;
    };
    Multipart.prototype.onRequest = function(options) {
      var self2 = this;
      var chunked = self2.isChunked(options);
      var parts = options.data || options;
      self2.setHeaders(chunked);
      self2.chunked = chunked;
      self2.body = self2.build(parts, chunked);
    };
    exports2.Multipart = Multipart;
  }
});

// node_modules/@cypress/request/lib/redirect.js
var require_redirect = __commonJS({
  "node_modules/@cypress/request/lib/redirect.js"(exports2) {
    "use strict";
    var url = require("url");
    var isUrl = /^https?:/;
    function Redirect(request) {
      this.request = request;
      this.followRedirect = true;
      this.followRedirects = true;
      this.followAllRedirects = false;
      this.followOriginalHttpMethod = false;
      this.allowRedirect = function() {
        return true;
      };
      this.maxRedirects = 10;
      this.redirects = [];
      this.redirectsFollowed = 0;
      this.removeRefererHeader = false;
      this.allowInsecureRedirect = false;
    }
    Redirect.prototype.onRequest = function(options) {
      var self2 = this;
      if (options.maxRedirects !== void 0) {
        self2.maxRedirects = options.maxRedirects;
      }
      if (typeof options.followRedirect === "function") {
        self2.allowRedirect = options.followRedirect;
      }
      if (options.followRedirect !== void 0) {
        self2.followRedirects = !!options.followRedirect;
      }
      if (options.followAllRedirects !== void 0) {
        self2.followAllRedirects = options.followAllRedirects;
      }
      if (self2.followRedirects || self2.followAllRedirects) {
        self2.redirects = self2.redirects || [];
      }
      if (options.removeRefererHeader !== void 0) {
        self2.removeRefererHeader = options.removeRefererHeader;
      }
      if (options.followOriginalHttpMethod !== void 0) {
        self2.followOriginalHttpMethod = options.followOriginalHttpMethod;
      }
      if (options.allowInsecureRedirect !== void 0) {
        self2.allowInsecureRedirect = options.allowInsecureRedirect;
      }
    };
    Redirect.prototype.redirectTo = function(response) {
      var self2 = this;
      var request = self2.request;
      var redirectTo = null;
      if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has("location")) {
        var location = response.caseless.get("location");
        request.debug("redirect", location);
        if (self2.followAllRedirects) {
          redirectTo = location;
        } else if (self2.followRedirects) {
          switch (request.method) {
            case "PATCH":
            case "PUT":
            case "POST":
            case "DELETE":
              break;
            default:
              redirectTo = location;
              break;
          }
        }
      } else if (response.statusCode === 401) {
        var authHeader = request._auth.onResponse(response);
        if (authHeader) {
          request.setHeader("authorization", authHeader);
          redirectTo = request.uri;
        }
      }
      return redirectTo;
    };
    Redirect.prototype.onResponse = function(response, callback) {
      var self2 = this;
      var request = self2.request;
      var redirectTo = self2.redirectTo(response);
      if (!redirectTo)
        return callback(null, false);
      function processRedirect(shouldRedirect) {
        if (!shouldRedirect)
          return callback(null, false);
        if (typeof shouldRedirect === "string") {
          request.debug("redirect overridden", redirectTo);
          redirectTo = shouldRedirect;
        }
        request.debug("redirect to", redirectTo);
        if (response.resume) {
          response.resume();
        }
        if (self2.redirectsFollowed >= self2.maxRedirects) {
          return callback(new Error("Exceeded maxRedirects. Probably stuck in a redirect loop " + request.uri.href));
        }
        self2.redirectsFollowed += 1;
        if (!isUrl.test(redirectTo)) {
          redirectTo = url.resolve(request.uri.href, redirectTo);
        }
        var uriPrev = request.uri;
        request.uri = url.parse(redirectTo);
        if (request.uri.protocol !== uriPrev.protocol && self2.allowInsecureRedirect) {
          delete request.agent;
        }
        self2.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo });
        if (self2.followAllRedirects && request.method !== "HEAD" && response.statusCode !== 401 && response.statusCode !== 307) {
          request.method = self2.followOriginalHttpMethod ? request.method : "GET";
        }
        delete request.src;
        delete request.req;
        delete request._started;
        if (response.statusCode !== 401 && response.statusCode !== 307) {
          delete request.body;
          delete request._form;
          if (request.headers) {
            request.removeHeader("host");
            request.removeHeader("content-type");
            request.removeHeader("content-length");
            if (request.uri.hostname !== request.originalHost.split(":")[0]) {
              request.removeHeader("authorization");
            }
          }
        }
        if (!self2.removeRefererHeader) {
          request.setHeader("referer", uriPrev.href);
        }
        request.emit("redirect");
        request.init();
        callback(null, true);
      }
      if (self2.allowRedirect.length > 1) {
        return self2.allowRedirect.call(request, response, function(err, result) {
          if (err)
            return callback(err);
          processRedirect(result);
        });
      }
      var allowsRedirect = self2.allowRedirect.call(request, response);
      if (allowsRedirect && allowsRedirect.then) {
        return allowsRedirect.then(processRedirect, callback);
      }
      processRedirect(allowsRedirect);
    };
    exports2.Redirect = Redirect;
  }
});

// node_modules/tunnel-agent/index.js
var require_tunnel_agent = __commonJS({
  "node_modules/tunnel-agent/index.js"(exports2) {
    "use strict";
    var net = require("net");
    var tls = require("tls");
    var http = require("http");
    var https = require("https");
    var events = require("events");
    var assert = require("assert");
    var util = require("util");
    var Buffer3 = require_safe_buffer2().Buffer;
    exports2.httpOverHttp = httpOverHttp;
    exports2.httpsOverHttp = httpsOverHttp;
    exports2.httpOverHttps = httpOverHttps;
    exports2.httpsOverHttps = httpsOverHttps;
    function httpOverHttp(options) {
      var agent = new TunnelingAgent(options);
      agent.request = http.request;
      return agent;
    }
    function httpsOverHttp(options) {
      var agent = new TunnelingAgent(options);
      agent.request = http.request;
      agent.createSocket = createSecureSocket;
      agent.defaultPort = 443;
      return agent;
    }
    function httpOverHttps(options) {
      var agent = new TunnelingAgent(options);
      agent.request = https.request;
      return agent;
    }
    function httpsOverHttps(options) {
      var agent = new TunnelingAgent(options);
      agent.request = https.request;
      agent.createSocket = createSecureSocket;
      agent.defaultPort = 443;
      return agent;
    }
    function TunnelingAgent(options) {
      var self2 = this;
      self2.options = options || {};
      self2.proxyOptions = self2.options.proxy || {};
      self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets;
      self2.requests = [];
      self2.sockets = [];
      self2.on("free", function onFree(socket, host, port) {
        for (var i = 0, len = self2.requests.length; i < len; ++i) {
          var pending = self2.requests[i];
          if (pending.host === host && pending.port === port) {
            self2.requests.splice(i, 1);
            pending.request.onSocket(socket);
            return;
          }
        }
        socket.destroy();
        self2.removeSocket(socket);
      });
    }
    util.inherits(TunnelingAgent, events.EventEmitter);
    TunnelingAgent.prototype.addRequest = function addRequest(req, options) {
      var self2 = this;
      if (typeof options === "string") {
        options = {
          host: options,
          port: arguments[2],
          path: arguments[3]
        };
      }
      if (self2.sockets.length >= this.maxSockets) {
        self2.requests.push({ host: options.host, port: options.port, request: req });
        return;
      }
      self2.createConnection({ host: options.host, port: options.port, request: req });
    };
    TunnelingAgent.prototype.createConnection = function createConnection(pending) {
      var self2 = this;
      self2.createSocket(pending, function(socket) {
        socket.on("free", onFree);
        socket.on("close", onCloseOrRemove);
        socket.on("agentRemove", onCloseOrRemove);
        pending.request.onSocket(socket);
        function onFree() {
          self2.emit("free", socket, pending.host, pending.port);
        }
        function onCloseOrRemove(err) {
          self2.removeSocket(socket);
          socket.removeListener("free", onFree);
          socket.removeListener("close", onCloseOrRemove);
          socket.removeListener("agentRemove", onCloseOrRemove);
        }
      });
    };
    TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
      var self2 = this;
      var placeholder = {};
      self2.sockets.push(placeholder);
      var connectOptions = mergeOptions(
        {},
        self2.proxyOptions,
        {
          method: "CONNECT",
          path: options.host + ":" + options.port,
          agent: false
        }
      );
      if (connectOptions.proxyAuth) {
        connectOptions.headers = connectOptions.headers || {};
        connectOptions.headers["Proxy-Authorization"] = "Basic " + Buffer3.from(connectOptions.proxyAuth).toString("base64");
      }
      debug("making CONNECT request");
      var connectReq = self2.request(connectOptions);
      connectReq.useChunkedEncodingByDefault = false;
      connectReq.once("response", onResponse);
      connectReq.once("upgrade", onUpgrade);
      connectReq.once("connect", onConnect);
      connectReq.once("error", onError);
      connectReq.end();
      function onResponse(res) {
        res.upgrade = true;
      }
      function onUpgrade(res, socket, head) {
        process.nextTick(function() {
          onConnect(res, socket, head);
        });
      }
      function onConnect(res, socket, head) {
        connectReq.removeAllListeners();
        socket.removeAllListeners();
        if (res.statusCode === 200) {
          assert.equal(head.length, 0);
          debug("tunneling connection has established");
          self2.sockets[self2.sockets.indexOf(placeholder)] = socket;
          cb(socket);
        } else {
          debug("tunneling socket could not be established, statusCode=%d", res.statusCode);
          var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
          error.code = "ECONNRESET";
          options.request.emit("error", error);
          self2.removeSocket(placeholder);
        }
      }
      function onError(cause) {
        connectReq.removeAllListeners();
        debug("tunneling socket could not be established, cause=%s\n", cause.message, cause.stack);
        var error = new Error("tunneling socket could not be established, cause=" + cause.message);
        error.code = "ECONNRESET";
        options.request.emit("error", error);
        self2.removeSocket(placeholder);
      }
    };
    TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
      var pos = this.sockets.indexOf(socket);
      if (pos === -1)
        return;
      this.sockets.splice(pos, 1);
      var pending = this.requests.shift();
      if (pending) {
        this.createConnection(pending);
      }
    };
    function createSecureSocket(options, cb) {
      var self2 = this;
      TunnelingAgent.prototype.createSocket.call(self2, options, function(socket) {
        var secureSocket = tls.connect(0, mergeOptions(
          {},
          self2.options,
          {
            servername: options.host,
            socket
          }
        ));
        self2.sockets[self2.sockets.indexOf(socket)] = secureSocket;
        cb(secureSocket);
      });
    }
    function mergeOptions(target) {
      for (var i = 1, len = arguments.length; i < len; ++i) {
        var overrides = arguments[i];
        if (typeof overrides === "object") {
          var keys = Object.keys(overrides);
          for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
            var k = keys[j];
            if (overrides[k] !== void 0) {
              target[k] = overrides[k];
            }
          }
        }
      }
      return target;
    }
    var debug;
    if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
      debug = function() {
        var args = Array.prototype.slice.call(arguments);
        if (typeof args[0] === "string") {
          args[0] = "TUNNEL: " + args[0];
        } else {
          args.unshift("TUNNEL:");
        }
        console.error.apply(console, args);
      };
    } else {
      debug = function() {
      };
    }
    exports2.debug = debug;
  }
});

// node_modules/@cypress/request/lib/tunnel.js
var require_tunnel = __commonJS({
  "node_modules/@cypress/request/lib/tunnel.js"(exports2) {
    "use strict";
    var url = require("url");
    var tunnel = require_tunnel_agent();
    var defaultProxyHeaderWhiteList = [
      "accept",
      "accept-charset",
      "accept-encoding",
      "accept-language",
      "accept-ranges",
      "cache-control",
      "content-encoding",
      "content-language",
      "content-location",
      "content-md5",
      "content-range",
      "content-type",
      "connection",
      "date",
      "expect",
      "max-forwards",
      "pragma",
      "referer",
      "te",
      "user-agent",
      "via"
    ];
    var defaultProxyHeaderExclusiveList = [
      "proxy-authorization"
    ];
    function constructProxyHost(uriObject) {
      var port = uriObject.port;
      var protocol = uriObject.protocol;
      var proxyHost = uriObject.hostname + ":";
      if (port) {
        proxyHost += port;
      } else if (protocol === "https:") {
        proxyHost += "443";
      } else {
        proxyHost += "80";
      }
      return proxyHost;
    }
    function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) {
      var whiteList = proxyHeaderWhiteList.reduce(function(set, header) {
        set[header.toLowerCase()] = true;
        return set;
      }, {});
      return Object.keys(headers).filter(function(header) {
        return whiteList[header.toLowerCase()];
      }).reduce(function(set, header) {
        set[header] = headers[header];
        return set;
      }, {});
    }
    function constructTunnelOptions(request, proxyHeaders) {
      var proxy = request.proxy;
      var tunnelOptions = {
        proxy: {
          host: proxy.hostname,
          port: +proxy.port,
          proxyAuth: proxy.auth,
          headers: proxyHeaders
        },
        headers: request.headers,
        ca: request.ca,
        cert: request.cert,
        key: request.key,
        passphrase: request.passphrase,
        pfx: request.pfx,
        ciphers: request.ciphers,
        rejectUnauthorized: request.rejectUnauthorized,
        secureOptions: request.secureOptions,
        secureProtocol: request.secureProtocol
      };
      return tunnelOptions;
    }
    function constructTunnelFnName(uri, proxy) {
      var uriProtocol = uri.protocol === "https:" ? "https" : "http";
      var proxyProtocol = proxy.protocol === "https:" ? "Https" : "Http";
      return [uriProtocol, proxyProtocol].join("Over");
    }
    function getTunnelFn(request) {
      var uri = request.uri;
      var proxy = request.proxy;
      var tunnelFnName = constructTunnelFnName(uri, proxy);
      return tunnel[tunnelFnName];
    }
    function Tunnel(request) {
      this.request = request;
      this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList;
      this.proxyHeaderExclusiveList = [];
      if (typeof request.tunnel !== "undefined") {
        this.tunnelOverride = request.tunnel;
      }
    }
    Tunnel.prototype.isEnabled = function() {
      var self2 = this;
      var request = self2.request;
      if (typeof self2.tunnelOverride !== "undefined") {
        return self2.tunnelOverride;
      }
      if (request.uri.protocol === "https:") {
        return true;
      }
      return false;
    };
    Tunnel.prototype.setup = function(options) {
      var self2 = this;
      var request = self2.request;
      options = options || {};
      if (typeof request.proxy === "string") {
        request.proxy = url.parse(request.proxy);
      }
      if (!request.proxy || !request.tunnel) {
        return false;
      }
      if (options.proxyHeaderWhiteList) {
        self2.proxyHeaderWhiteList = options.proxyHeaderWhiteList;
      }
      if (options.proxyHeaderExclusiveList) {
        self2.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList;
      }
      var proxyHeaderExclusiveList = self2.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList);
      var proxyHeaderWhiteList = self2.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList);
      var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList);
      proxyHeaders.host = constructProxyHost(request.uri);
      proxyHeaderExclusiveList.forEach(request.removeHeader, request);
      var tunnelFn = getTunnelFn(request);
      var tunnelOptions = constructTunnelOptions(request, proxyHeaders);
      request.agent = tunnelFn(tunnelOptions);
      return true;
    };
    Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList;
    Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList;
    exports2.Tunnel = Tunnel;
  }
});

// node_modules/performance-now/lib/performance-now.js
var require_performance_now = __commonJS({
  "node_modules/performance-now/lib/performance-now.js"(exports2, module2) {
    (function() {
      var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
      if (typeof performance !== "undefined" && performance !== null && performance.now) {
        module2.exports = function() {
          return performance.now();
        };
      } else if (typeof process !== "undefined" && process !== null && process.hrtime) {
        module2.exports = function() {
          return (getNanoSeconds() - nodeLoadTime) / 1e6;
        };
        hrtime = process.hrtime;
        getNanoSeconds = function() {
          var hr;
          hr = hrtime();
          return hr[0] * 1e9 + hr[1];
        };
        moduleLoadTime = getNanoSeconds();
        upTime = process.uptime() * 1e9;
        nodeLoadTime = moduleLoadTime - upTime;
      } else if (Date.now) {
        module2.exports = function() {
          return Date.now() - loadTime;
        };
        loadTime = Date.now();
      } else {
        module2.exports = function() {
          return new Date().getTime() - loadTime;
        };
        loadTime = new Date().getTime();
      }
    }).call(exports2);
  }
});

// node_modules/@cypress/request/request.js
var require_request = __commonJS({
  "node_modules/@cypress/request/request.js"(exports2, module2) {
    "use strict";
    var http = require("http");
    var https = require("https");
    var url = require("url");
    var util = require("util");
    var stream = require("stream");
    var zlib = require("zlib");
    var aws2 = require_aws_sign2();
    var aws4 = require_aws4();
    var httpSignature = require_lib11();
    var mime = require_mime_types();
    var caseless = require_caseless();
    var ForeverAgent = require_forever_agent();
    var FormData = require_browser5();
    var extend = require_extend();
    var isstream = require_isstream();
    var isTypedArray = require_is_typedarray().strict;
    var helpers = require_helpers3();
    var cookies = require_cookies();
    var getProxyFromURI = require_getProxyFromURI();
    var Querystring = require_querystring().Querystring;
    var Har = require_har().Har;
    var Auth = require_auth2().Auth;
    var hawk = require_hawk();
    var Multipart = require_multipart().Multipart;
    var Redirect = require_redirect().Redirect;
    var Tunnel = require_tunnel().Tunnel;
    var now = require_performance_now();
    var Buffer3 = require_safe_buffer2().Buffer;
    var safeStringify = helpers.safeStringify;
    var isReadStream = helpers.isReadStream;
    var toBase64 = helpers.toBase64;
    var defer = helpers.defer;
    var copy = helpers.copy;
    var version2 = helpers.version;
    var globalCookieJar = cookies.jar();
    var globalPool = {};
    function filterForNonReserved(reserved, options) {
      var object = {};
      for (var i in options) {
        var notReserved = reserved.indexOf(i) === -1;
        if (notReserved) {
          object[i] = options[i];
        }
      }
      return object;
    }
    function filterOutReservedFunctions(reserved, options) {
      var object = {};
      for (var i in options) {
        var isReserved = !(reserved.indexOf(i) === -1);
        var isFunction = typeof options[i] === "function";
        if (!(isReserved && isFunction)) {
          object[i] = options[i];
        }
      }
      return object;
    }
    function requestToJSON() {
      var self2 = this;
      return {
        uri: self2.uri,
        method: self2.method,
        headers: self2.headers
      };
    }
    function responseToJSON() {
      var self2 = this;
      return {
        statusCode: self2.statusCode,
        body: self2.body,
        headers: self2.headers,
        request: requestToJSON.call(self2.request)
      };
    }
    function Request(options) {
      var self2 = this;
      if (options.har) {
        self2._har = new Har(self2);
        options = self2._har.options(options);
      }
      stream.Stream.call(self2);
      var reserved = Object.keys(Request.prototype);
      var nonReserved = filterForNonReserved(reserved, options);
      extend(self2, nonReserved);
      options = filterOutReservedFunctions(reserved, options);
      self2.readable = true;
      self2.writable = true;
      if (options.method) {
        self2.explicitMethod = true;
      }
      self2._qs = new Querystring(self2);
      self2._auth = new Auth(self2);
      self2._multipart = new Multipart(self2);
      self2._redirect = new Redirect(self2);
      self2._tunnel = new Tunnel(self2);
      self2.init(options);
    }
    util.inherits(Request, stream.Stream);
    Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG);
    function debug() {
      if (Request.debug) {
        console.error("REQUEST %s", util.format.apply(util, arguments));
      }
    }
    Request.prototype.debug = debug;
    Request.prototype.init = function(options) {
      var self2 = this;
      if (!options) {
        options = {};
      }
      self2.headers = self2.headers ? copy(self2.headers) : {};
      for (var headerName in self2.headers) {
        if (typeof self2.headers[headerName] === "undefined") {
          delete self2.headers[headerName];
        }
      }
      caseless.httpify(self2, self2.headers);
      if (!self2.method) {
        self2.method = options.method || "GET";
      }
      if (!self2.localAddress) {
        self2.localAddress = options.localAddress;
      }
      self2._qs.init(options);
      debug(options);
      if (!self2.pool && self2.pool !== false) {
        self2.pool = globalPool;
      }
      self2.dests = self2.dests || [];
      self2.__isRequestRequest = true;
      if (!self2._callback && self2.callback) {
        self2._callback = self2.callback;
        self2.callback = function() {
          if (self2._callbackCalled) {
            return;
          }
          self2._callbackCalled = true;
          self2._callback.apply(self2, arguments);
        };
        self2.on("error", self2.callback.bind());
        self2.on("complete", self2.callback.bind(self2, null));
      }
      if (!self2.uri && self2.url) {
        self2.uri = self2.url;
        delete self2.url;
      }
      if (self2.baseUrl) {
        if (typeof self2.baseUrl !== "string") {
          return self2.emit("error", new Error("options.baseUrl must be a string"));
        }
        if (typeof self2.uri !== "string") {
          return self2.emit("error", new Error("options.uri must be a string when using options.baseUrl"));
        }
        if (self2.uri.indexOf("//") === 0 || self2.uri.indexOf("://") !== -1) {
          return self2.emit("error", new Error("options.uri must be a path when using options.baseUrl"));
        }
        var baseUrlEndsWithSlash = self2.baseUrl.lastIndexOf("/") === self2.baseUrl.length - 1;
        var uriStartsWithSlash = self2.uri.indexOf("/") === 0;
        if (baseUrlEndsWithSlash && uriStartsWithSlash) {
          self2.uri = self2.baseUrl + self2.uri.slice(1);
        } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {
          self2.uri = self2.baseUrl + self2.uri;
        } else if (self2.uri === "") {
          self2.uri = self2.baseUrl;
        } else {
          self2.uri = self2.baseUrl + "/" + self2.uri;
        }
        delete self2.baseUrl;
      }
      if (!self2.uri) {
        return self2.emit("error", new Error("options.uri is a required argument"));
      }
      if (typeof self2.uri === "string") {
        self2.uri = url.parse(self2.uri);
      }
      if (!self2.uri.href) {
        self2.uri.href = url.format(self2.uri);
      }
      if (self2.uri.protocol === "unix:") {
        return self2.emit("error", new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));
      }
      if (self2.uri.host === "unix") {
        self2.enableUnixSocket();
      }
      if (self2.strictSSL === false) {
        self2.rejectUnauthorized = false;
      }
      if (!self2.uri.pathname) {
        self2.uri.pathname = "/";
      }
      if (!(self2.uri.host || self2.uri.hostname && self2.uri.port) && !self2.uri.isUnix) {
        var faultyUri = url.format(self2.uri);
        var message = 'Invalid URI "' + faultyUri + '"';
        if (Object.keys(options).length === 0) {
          message += ". This can be caused by a crappy redirection.";
        }
        self2.abort();
        return self2.emit("error", new Error(message));
      }
      if (!self2.hasOwnProperty("proxy")) {
        self2.proxy = getProxyFromURI(self2.uri);
      }
      self2.tunnel = self2._tunnel.isEnabled();
      if (self2.proxy) {
        self2._tunnel.setup(options);
      }
      self2._redirect.onRequest(options);
      self2.setHost = false;
      if (!self2.hasHeader("host")) {
        var hostHeaderName = self2.originalHostHeaderName || "host";
        self2.setHeader(hostHeaderName, self2.uri.host);
        if (self2.uri.port) {
          if (self2.uri.port === "80" && self2.uri.protocol === "http:" || self2.uri.port === "443" && self2.uri.protocol === "https:") {
            self2.setHeader(hostHeaderName, self2.uri.hostname);
          }
        }
        self2.setHost = true;
      }
      self2.jar(self2._jar || options.jar);
      if (!self2.uri.port) {
        if (self2.uri.protocol === "http:") {
          self2.uri.port = 80;
        } else if (self2.uri.protocol === "https:") {
          self2.uri.port = 443;
        }
      }
      if (self2.proxy && !self2.tunnel) {
        self2.port = self2.proxy.port;
        self2.host = self2.proxy.hostname;
      } else {
        self2.port = self2.uri.port;
        self2.host = self2.uri.hostname;
      }
      if (options.form) {
        self2.form(options.form);
      }
      if (options.formData) {
        var formData = options.formData;
        var requestForm = self2.form();
        var appendFormValue = function(key, value) {
          if (value && value.hasOwnProperty("value") && value.hasOwnProperty("options")) {
            requestForm.append(key, value.value, value.options);
          } else {
            requestForm.append(key, value);
          }
        };
        for (var formKey in formData) {
          if (formData.hasOwnProperty(formKey)) {
            var formValue = formData[formKey];
            if (formValue instanceof Array) {
              for (var j = 0; j < formValue.length; j++) {
                appendFormValue(formKey, formValue[j]);
              }
            } else {
              appendFormValue(formKey, formValue);
            }
          }
        }
      }
      if (options.qs) {
        self2.qs(options.qs);
      }
      if (self2.uri.path) {
        self2.path = self2.uri.path;
      } else {
        self2.path = self2.uri.pathname + (self2.uri.search || "");
      }
      if (self2.path.length === 0) {
        self2.path = "/";
      }
      if (options.aws) {
        self2.aws(options.aws);
      }
      if (options.hawk) {
        self2.hawk(options.hawk);
      }
      if (options.httpSignature) {
        self2.httpSignature(options.httpSignature);
      }
      if (options.auth) {
        if (Object.prototype.hasOwnProperty.call(options.auth, "username")) {
          options.auth.user = options.auth.username;
        }
        if (Object.prototype.hasOwnProperty.call(options.auth, "password")) {
          options.auth.pass = options.auth.password;
        }
        self2.auth(
          options.auth.user,
          options.auth.pass,
          options.auth.sendImmediately,
          options.auth.bearer
        );
      }
      if (self2.gzip && !self2.hasHeader("accept-encoding")) {
        self2.setHeader("accept-encoding", "gzip, deflate");
      }
      if (self2.uri.auth && !self2.hasHeader("authorization")) {
        var uriAuthPieces = self2.uri.auth.split(":").map(function(item) {
          return self2._qs.unescape(item);
        });
        self2.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(":"), true);
      }
      if (!self2.tunnel && self2.proxy && self2.proxy.auth && !self2.hasHeader("proxy-authorization")) {
        var proxyAuthPieces = self2.proxy.auth.split(":").map(function(item) {
          return self2._qs.unescape(item);
        });
        var authHeader = "Basic " + toBase64(proxyAuthPieces.join(":"));
        self2.setHeader("proxy-authorization", authHeader);
      }
      if (self2.proxy && !self2.tunnel) {
        self2.path = self2.uri.protocol + "//" + self2.uri.host + self2.path;
      }
      if (options.json) {
        self2.json(options.json);
      }
      if (options.multipart) {
        self2.multipart(options.multipart);
      }
      if (options.time) {
        self2.timing = true;
        self2.elapsedTime = self2.elapsedTime || 0;
      }
      function setContentLength() {
        if (isTypedArray(self2.body)) {
          self2.body = Buffer3.from(self2.body);
        }
        if (!self2.hasHeader("content-length")) {
          var length;
          if (typeof self2.body === "string") {
            length = Buffer3.byteLength(self2.body);
          } else if (Array.isArray(self2.body)) {
            length = self2.body.reduce(function(a, b) {
              return a + b.length;
            }, 0);
          } else {
            length = self2.body.length;
          }
          if (length) {
            self2.setHeader("content-length", length);
          } else {
            self2.emit("error", new Error("Argument error, options.body."));
          }
        }
      }
      if (self2.body && !isstream(self2.body)) {
        setContentLength();
      }
      var protocol = self2.proxy && !self2.tunnel ? self2.proxy.protocol : self2.uri.protocol;
      var defaultModules = { "http:": http, "https:": https };
      var httpModules = self2.httpModules || {};
      self2.httpModule = httpModules[protocol] || defaultModules[protocol];
      if (!self2.httpModule) {
        return self2.emit("error", new Error("Invalid protocol: " + protocol));
      }
      if (options.ca) {
        self2.ca = options.ca;
      }
      if (!self2.agent) {
        if (options.agentOptions) {
          self2.agentOptions = options.agentOptions;
        }
        if (options.agentClass) {
          self2.agentClass = options.agentClass;
        } else if (options.forever) {
          var v = version2();
          if (v.major === 0 && v.minor <= 10) {
            self2.agentClass = protocol === "http:" ? ForeverAgent : ForeverAgent.SSL;
          } else {
            self2.agentClass = self2.httpModule.Agent;
            self2.agentOptions = self2.agentOptions || {};
            self2.agentOptions.keepAlive = true;
          }
        } else {
          self2.agentClass = self2.httpModule.Agent;
        }
      }
      if (self2.pool === false) {
        self2.agent = false;
      } else {
        self2.agent = self2.agent || self2.getNewAgent();
      }
      self2.on("pipe", function(src) {
        if (self2.ntick && self2._started) {
          self2.emit("error", new Error("You cannot pipe to this stream after the outbound request has started."));
        }
        self2.src = src;
        if (isReadStream(src)) {
          if (!self2.hasHeader("content-type")) {
            self2.setHeader("content-type", mime.lookup(src.path));
          }
        } else {
          if (src.headers) {
            for (var i in src.headers) {
              if (!self2.hasHeader(i)) {
                self2.setHeader(i, src.headers[i]);
              }
            }
          }
          if (self2._json && !self2.hasHeader("content-type")) {
            self2.setHeader("content-type", "application/json");
          }
          if (src.method && !self2.explicitMethod) {
            self2.method = src.method;
          }
        }
      });
      defer(function() {
        if (self2._aborted) {
          return;
        }
        var end2 = function() {
          if (self2._form) {
            if (!self2._auth.hasAuth) {
              self2._form.pipe(self2);
            } else if (self2._auth.hasAuth && self2._auth.sentAuth) {
              self2._form.pipe(self2);
            }
          }
          if (self2._multipart && self2._multipart.chunked) {
            self2._multipart.body.pipe(self2);
          }
          if (self2.body) {
            if (isstream(self2.body)) {
              self2.body.pipe(self2);
            } else {
              setContentLength();
              if (Array.isArray(self2.body)) {
                self2.body.forEach(function(part) {
                  self2.write(part);
                });
              } else {
                self2.write(self2.body);
              }
              self2.end();
            }
          } else if (self2.requestBodyStream) {
            console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.");
            self2.requestBodyStream.pipe(self2);
          } else if (!self2.src) {
            if (self2._auth.hasAuth && !self2._auth.sentAuth) {
              self2.end();
              return;
            }
            if (self2.method !== "GET" && typeof self2.method !== "undefined") {
              self2.setHeader("content-length", 0);
            }
            self2.end();
          }
        };
        if (self2._form && !self2.hasHeader("content-length")) {
          self2.setHeader(self2._form.getHeaders(), true);
          self2._form.getLength(function(err, length) {
            if (!err && !isNaN(length)) {
              self2.setHeader("content-length", length);
            }
            end2();
          });
        } else {
          end2();
        }
        self2.ntick = true;
      });
    };
    Request.prototype.getNewAgent = function() {
      var self2 = this;
      var Agent = self2.agentClass;
      var options = {};
      if (self2.agentOptions) {
        for (var i in self2.agentOptions) {
          options[i] = self2.agentOptions[i];
        }
      }
      if (self2.ca) {
        options.ca = self2.ca;
      }
      if (self2.ciphers) {
        options.ciphers = self2.ciphers;
      }
      if (self2.secureProtocol) {
        options.secureProtocol = self2.secureProtocol;
      }
      if (self2.secureOptions) {
        options.secureOptions = self2.secureOptions;
      }
      if (typeof self2.rejectUnauthorized !== "undefined") {
        options.rejectUnauthorized = self2.rejectUnauthorized;
      }
      if (self2.cert && self2.key) {
        options.key = self2.key;
        options.cert = self2.cert;
      }
      if (self2.pfx) {
        options.pfx = self2.pfx;
      }
      if (self2.passphrase) {
        options.passphrase = self2.passphrase;
      }
      var poolKey = "";
      if (Agent !== self2.httpModule.Agent) {
        poolKey += Agent.name;
      }
      var proxy = self2.proxy;
      if (typeof proxy === "string") {
        proxy = url.parse(proxy);
      }
      var isHttps = proxy && proxy.protocol === "https:" || this.uri.protocol === "https:";
      if (isHttps) {
        if (options.ca) {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.ca;
        }
        if (typeof options.rejectUnauthorized !== "undefined") {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.rejectUnauthorized;
        }
        if (options.cert) {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.cert.toString("ascii") + options.key.toString("ascii");
        }
        if (options.pfx) {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.pfx.toString("ascii");
        }
        if (options.ciphers) {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.ciphers;
        }
        if (options.secureProtocol) {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.secureProtocol;
        }
        if (options.secureOptions) {
          if (poolKey) {
            poolKey += ":";
          }
          poolKey += options.secureOptions;
        }
      }
      if (self2.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self2.httpModule.globalAgent) {
        return self2.httpModule.globalAgent;
      }
      poolKey = self2.uri.protocol + poolKey;
      if (!self2.pool[poolKey]) {
        self2.pool[poolKey] = new Agent(options);
        if (self2.pool.maxSockets) {
          self2.pool[poolKey].maxSockets = self2.pool.maxSockets;
        }
      }
      return self2.pool[poolKey];
    };
    Request.prototype.start = function() {
      var self2 = this;
      if (self2.timing) {
        var startTime = new Date().getTime();
        var startTimeNow = now();
      }
      if (self2._aborted) {
        return;
      }
      self2._started = true;
      self2.method = self2.method || "GET";
      self2.href = self2.uri.href;
      if (self2.src && self2.src.stat && self2.src.stat.size && !self2.hasHeader("content-length")) {
        self2.setHeader("content-length", self2.src.stat.size);
      }
      if (self2._aws) {
        self2.aws(self2._aws, true);
      }
      var reqOptions = copy(self2);
      delete reqOptions.auth;
      debug("make request", self2.uri.href);
      delete reqOptions.timeout;
      try {
        self2.req = self2.httpModule.request(reqOptions);
      } catch (err) {
        self2.emit("error", err);
        return;
      }
      if (self2.timing) {
        self2.startTime = startTime;
        self2.startTimeNow = startTimeNow;
        self2.timings = {};
      }
      var timeout;
      if (self2.timeout && !self2.timeoutTimer) {
        if (self2.timeout < 0) {
          timeout = 0;
        } else if (typeof self2.timeout === "number" && isFinite(self2.timeout)) {
          timeout = self2.timeout;
        }
      }
      self2.req.on("response", self2.onRequestResponse.bind(self2));
      self2.req.on("error", self2.onRequestError.bind(self2));
      self2.req.on("drain", function() {
        self2.emit("drain");
      });
      self2.req.on("socket", function(socket) {
        var isConnecting = socket._connecting || socket.connecting;
        if (self2.timing) {
          self2.timings.socket = now() - self2.startTimeNow;
          if (isConnecting) {
            var onLookupTiming = function() {
              self2.timings.lookup = now() - self2.startTimeNow;
            };
            var onConnectTiming = function() {
              self2.timings.connect = now() - self2.startTimeNow;
            };
            socket.once("lookup", onLookupTiming);
            socket.once("connect", onConnectTiming);
            self2.req.once("error", function() {
              socket.removeListener("lookup", onLookupTiming);
              socket.removeListener("connect", onConnectTiming);
            });
          }
        }
        var setReqTimeout = function() {
          self2.req.setTimeout(timeout, function() {
            if (self2.req) {
              self2.abort();
              var e = new Error("ESOCKETTIMEDOUT");
              e.code = "ESOCKETTIMEDOUT";
              e.connect = false;
              self2.emit("error", e);
            }
          });
        };
        if (timeout !== void 0) {
          if (isConnecting) {
            var onReqSockConnect = function() {
              socket.removeListener("connect", onReqSockConnect);
              self2.clearTimeout();
              setReqTimeout();
            };
            socket.on("connect", onReqSockConnect);
            self2.req.on("error", function(err) {
              socket.removeListener("connect", onReqSockConnect);
            });
            self2.timeoutTimer = setTimeout(function() {
              socket.removeListener("connect", onReqSockConnect);
              self2.abort();
              var e = new Error("ETIMEDOUT");
              e.code = "ETIMEDOUT";
              e.connect = true;
              self2.emit("error", e);
            }, timeout);
          } else {
            setReqTimeout();
          }
        }
        self2.emit("socket", socket);
      });
      self2.emit("request", self2.req);
    };
    Request.prototype.onRequestError = function(error) {
      var self2 = this;
      if (self2._aborted) {
        return;
      }
      if (self2.req && self2.req._reusedSocket && error.code === "ECONNRESET" && self2.agent.addRequestNoreuse) {
        self2.agent = { addRequest: self2.agent.addRequestNoreuse.bind(self2.agent) };
        self2.start();
        self2.req.end();
        return;
      }
      self2.clearTimeout();
      self2.emit("error", error);
    };
    Request.prototype.onRequestResponse = function(response) {
      var self2 = this;
      if (self2.timing) {
        self2.timings.response = now() - self2.startTimeNow;
      }
      debug("onRequestResponse", self2.uri.href, response.statusCode, response.headers);
      response.on("end", function() {
        if (self2.timing) {
          self2.timings.end = now() - self2.startTimeNow;
          response.timingStart = self2.startTime;
          if (!self2.timings.socket) {
            self2.timings.socket = 0;
          }
          if (!self2.timings.lookup) {
            self2.timings.lookup = self2.timings.socket;
          }
          if (!self2.timings.connect) {
            self2.timings.connect = self2.timings.lookup;
          }
          if (!self2.timings.response) {
            self2.timings.response = self2.timings.connect;
          }
          debug("elapsed time", self2.timings.end);
          self2.elapsedTime += Math.round(self2.timings.end);
          response.elapsedTime = self2.elapsedTime;
          response.timings = self2.timings;
          response.timingPhases = {
            wait: self2.timings.socket,
            dns: self2.timings.lookup - self2.timings.socket,
            tcp: self2.timings.connect - self2.timings.lookup,
            firstByte: self2.timings.response - self2.timings.connect,
            download: self2.timings.end - self2.timings.response,
            total: self2.timings.end
          };
        }
        debug("response end", self2.uri.href, response.statusCode, response.headers);
      });
      if (self2._aborted) {
        debug("aborted", self2.uri.href);
        response.resume();
        return;
      }
      self2.response = response;
      response.request = self2;
      response.toJSON = responseToJSON;
      if (self2.httpModule === https && self2.strictSSL && (!response.hasOwnProperty("socket") || !response.socket.authorized)) {
        debug("strict ssl error", self2.uri.href);
        var sslErr = response.hasOwnProperty("socket") ? response.socket.authorizationError : self2.uri.href + " does not support SSL";
        self2.emit("error", new Error("SSL Error: " + sslErr));
        return;
      }
      self2.originalHost = self2.getHeader("host");
      if (!self2.originalHostHeaderName) {
        self2.originalHostHeaderName = self2.hasHeader("host");
      }
      if (self2.setHost) {
        self2.removeHeader("host");
      }
      self2.clearTimeout();
      var targetCookieJar = self2._jar && self2._jar.setCookie ? self2._jar : globalCookieJar;
      var addCookie = function(cookie) {
        try {
          targetCookieJar.setCookie(cookie, self2.uri.href, { ignoreError: true });
        } catch (e) {
          self2.emit("error", e);
        }
      };
      response.caseless = caseless(response.headers);
      if (response.caseless.has("set-cookie") && !self2._disableCookies) {
        var headerName = response.caseless.has("set-cookie");
        if (Array.isArray(response.headers[headerName])) {
          response.headers[headerName].forEach(addCookie);
        } else {
          addCookie(response.headers[headerName]);
        }
      }
      self2._redirect.onResponse(response, function(err, followingRedirect) {
        if (!err && followingRedirect)
          return;
        if (err)
          self2.emit("error", err);
        response.on("close", function() {
          if (!self2._ended) {
            self2._ended = true;
            self2.response.emit("end");
          }
        });
        response.once("end", function() {
          self2._ended = true;
        });
        var noBody = function(code) {
          return self2.method === "HEAD" || // Informational
          code >= 100 && code < 200 || // No Content
          code === 204 || // Not Modified
          code === 304;
        };
        var responseContent;
        if (self2.gzip && !noBody(response.statusCode)) {
          var contentEncoding = response.headers["content-encoding"] || "identity";
          contentEncoding = contentEncoding.trim().toLowerCase();
          var zlibOptions = {
            flush: zlib.Z_SYNC_FLUSH,
            finishFlush: zlib.Z_SYNC_FLUSH
          };
          if (contentEncoding === "gzip") {
            responseContent = zlib.createGunzip(zlibOptions);
            response.pipe(responseContent);
          } else if (contentEncoding === "deflate") {
            responseContent = zlib.createInflate(zlibOptions);
            response.pipe(responseContent);
          } else {
            if (contentEncoding !== "identity") {
              debug("ignoring unrecognized Content-Encoding " + contentEncoding);
            }
            responseContent = response;
          }
        } else {
          responseContent = response;
        }
        if (self2.encoding) {
          if (self2.dests.length !== 0) {
            console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.");
          } else {
            responseContent.setEncoding(self2.encoding);
          }
        }
        if (self2._paused) {
          responseContent.pause();
        }
        self2.responseContent = responseContent;
        self2.emit("response", response);
        self2.dests.forEach(function(dest) {
          self2.pipeDest(dest);
        });
        responseContent.on("data", function(chunk) {
          if (self2.timing && !self2.responseStarted) {
            self2.responseStartTime = new Date().getTime();
            response.responseStartTime = self2.responseStartTime;
          }
          self2._destdata = true;
          self2.emit("data", chunk);
        });
        responseContent.once("end", function(chunk) {
          self2.emit("end", chunk);
        });
        responseContent.on("error", function(error) {
          if (error.code === "ECONNRESET" && error.message === "aborted" && self2.listenerCount("error") === 0) {
            return;
          }
          self2.emit("error", error);
        });
        responseContent.on("close", function() {
          self2.emit("close");
        });
        if (self2.callback) {
          self2.readResponseBody(response);
        } else {
          self2.on("end", function() {
            if (self2._aborted) {
              debug("aborted", self2.uri.href);
              return;
            }
            self2.emit("complete", response);
          });
        }
        debug("finish init function", self2.uri.href);
      });
    };
    Request.prototype.readResponseBody = function(response) {
      var self2 = this;
      debug("reading response's body");
      var buffers = [];
      var bufferLength = 0;
      var strings = [];
      self2.on("data", function(chunk) {
        if (!Buffer3.isBuffer(chunk)) {
          strings.push(chunk);
        } else if (chunk.length) {
          bufferLength += chunk.length;
          buffers.push(chunk);
        }
      });
      self2.on("end", function() {
        debug("end event", self2.uri.href);
        if (self2._aborted) {
          debug("aborted", self2.uri.href);
          buffers = [];
          bufferLength = 0;
          return;
        }
        if (bufferLength) {
          debug("has body", self2.uri.href, bufferLength);
          response.body = Buffer3.concat(buffers, bufferLength);
          if (self2.encoding !== null) {
            response.body = response.body.toString(self2.encoding);
          }
          buffers = [];
          bufferLength = 0;
        } else if (strings.length) {
          if (self2.encoding === "utf8" && strings[0].length > 0 && strings[0][0] === "\uFEFF") {
            strings[0] = strings[0].substring(1);
          }
          response.body = strings.join("");
        }
        if (self2._json) {
          try {
            response.body = JSON.parse(response.body, self2._jsonReviver);
          } catch (e) {
            debug("invalid JSON received", self2.uri.href);
          }
        }
        debug("emitting complete", self2.uri.href);
        if (typeof response.body === "undefined" && !self2._json) {
          response.body = self2.encoding === null ? Buffer3.alloc(0) : "";
        }
        self2.emit("complete", response, response.body);
      });
    };
    Request.prototype.abort = function() {
      var self2 = this;
      self2._aborted = true;
      if (self2.req) {
        self2.req.abort();
      } else if (self2.response) {
        self2.response.destroy();
      }
      self2.clearTimeout();
      self2.emit("abort");
    };
    Request.prototype.pipeDest = function(dest) {
      var self2 = this;
      var response = self2.response;
      if (dest.headers && !dest.headersSent) {
        if (response.caseless.has("content-type")) {
          var ctname = response.caseless.has("content-type");
          if (dest.setHeader) {
            dest.setHeader(ctname, response.headers[ctname]);
          } else {
            dest.headers[ctname] = response.headers[ctname];
          }
        }
        if (response.caseless.has("content-length")) {
          var clname = response.caseless.has("content-length");
          if (dest.setHeader) {
            dest.setHeader(clname, response.headers[clname]);
          } else {
            dest.headers[clname] = response.headers[clname];
          }
        }
      }
      if (dest.setHeader && !dest.headersSent) {
        for (var i in response.headers) {
          if (!self2.gzip || i !== "content-encoding") {
            dest.setHeader(i, response.headers[i]);
          }
        }
        dest.statusCode = response.statusCode;
      }
      if (self2.pipefilter) {
        self2.pipefilter(response, dest);
      }
    };
    Request.prototype.qs = function(q2, clobber) {
      var self2 = this;
      var base;
      if (!clobber && self2.uri.query) {
        base = self2._qs.parse(self2.uri.query);
      } else {
        base = {};
      }
      for (var i in q2) {
        base[i] = q2[i];
      }
      var qs = self2._qs.stringify(base);
      if (qs === "") {
        return self2;
      }
      self2.uri = url.parse(self2.uri.href.split("?")[0] + "?" + qs);
      self2.url = self2.uri;
      self2.path = self2.uri.path;
      if (self2.uri.host === "unix") {
        self2.enableUnixSocket();
      }
      return self2;
    };
    Request.prototype.form = function(form) {
      var self2 = this;
      if (form) {
        if (!/^application\/x-www-form-urlencoded\b/.test(self2.getHeader("content-type"))) {
          self2.setHeader("content-type", "application/x-www-form-urlencoded");
        }
        self2.body = typeof form === "string" ? self2._qs.rfc3986(form.toString("utf8")) : self2._qs.stringify(form).toString("utf8");
        return self2;
      }
      self2._form = new FormData();
      self2._form.on("error", function(err) {
        err.message = "form-data: " + err.message;
        self2.emit("error", err);
        self2.abort();
      });
      return self2._form;
    };
    Request.prototype.multipart = function(multipart) {
      var self2 = this;
      self2._multipart.onRequest(multipart);
      if (!self2._multipart.chunked) {
        self2.body = self2._multipart.body;
      }
      return self2;
    };
    Request.prototype.json = function(val) {
      var self2 = this;
      if (!self2.hasHeader("accept")) {
        self2.setHeader("accept", "application/json");
      }
      if (typeof self2.jsonReplacer === "function") {
        self2._jsonReplacer = self2.jsonReplacer;
      }
      self2._json = true;
      if (typeof val === "boolean") {
        if (self2.body !== void 0) {
          if (!/^application\/x-www-form-urlencoded\b/.test(self2.getHeader("content-type"))) {
            self2.body = safeStringify(self2.body, self2._jsonReplacer);
          } else {
            self2.body = self2._qs.rfc3986(self2.body);
          }
          if (!self2.hasHeader("content-type")) {
            self2.setHeader("content-type", "application/json");
          }
        }
      } else {
        self2.body = safeStringify(val, self2._jsonReplacer);
        if (!self2.hasHeader("content-type")) {
          self2.setHeader("content-type", "application/json");
        }
      }
      if (typeof self2.jsonReviver === "function") {
        self2._jsonReviver = self2.jsonReviver;
      }
      return self2;
    };
    Request.prototype.getHeader = function(name, headers) {
      var self2 = this;
      var result, re, match;
      if (!headers) {
        headers = self2.headers;
      }
      Object.keys(headers).forEach(function(key) {
        if (key.length !== name.length) {
          return;
        }
        re = new RegExp(name, "i");
        match = key.match(re);
        if (match) {
          result = headers[key];
        }
      });
      return result;
    };
    Request.prototype.enableUnixSocket = function() {
      var unixParts = this.uri.path.split(":");
      var host = unixParts[0];
      var path4 = unixParts[1];
      this.socketPath = host;
      this.uri.pathname = path4;
      this.uri.path = path4;
      this.uri.host = host;
      this.uri.hostname = host;
      this.uri.isUnix = true;
    };
    Request.prototype.auth = function(user, pass, sendImmediately, bearer) {
      var self2 = this;
      self2._auth.onRequest(user, pass, sendImmediately, bearer);
      return self2;
    };
    Request.prototype.aws = function(opts, now2) {
      var self2 = this;
      if (!now2) {
        self2._aws = opts;
        return self2;
      }
      if (opts.sign_version === 4 || opts.sign_version === "4") {
        var options = {
          host: self2.uri.host,
          path: self2.uri.path,
          method: self2.method,
          headers: self2.headers,
          body: self2.body
        };
        if (opts.service) {
          options.service = opts.service;
        }
        var signRes = aws4.sign(options, {
          accessKeyId: opts.key,
          secretAccessKey: opts.secret,
          sessionToken: opts.session
        });
        self2.setHeader("authorization", signRes.headers.Authorization);
        self2.setHeader("x-amz-date", signRes.headers["X-Amz-Date"]);
        if (signRes.headers["X-Amz-Security-Token"]) {
          self2.setHeader("x-amz-security-token", signRes.headers["X-Amz-Security-Token"]);
        }
      } else {
        var date = new Date();
        self2.setHeader("date", date.toUTCString());
        var auth = {
          key: opts.key,
          secret: opts.secret,
          verb: self2.method.toUpperCase(),
          date,
          contentType: self2.getHeader("content-type") || "",
          md5: self2.getHeader("content-md5") || "",
          amazonHeaders: aws2.canonicalizeHeaders(self2.headers)
        };
        var path4 = self2.uri.path;
        if (opts.bucket && path4) {
          auth.resource = "/" + opts.bucket + path4;
        } else if (opts.bucket && !path4) {
          auth.resource = "/" + opts.bucket;
        } else if (!opts.bucket && path4) {
          auth.resource = path4;
        } else if (!opts.bucket && !path4) {
          auth.resource = "/";
        }
        auth.resource = aws2.canonicalizeResource(auth.resource);
        self2.setHeader("authorization", aws2.authorization(auth));
      }
      return self2;
    };
    Request.prototype.httpSignature = function(opts) {
      var self2 = this;
      httpSignature.signRequest({
        getHeader: function(header) {
          return self2.getHeader(header, self2.headers);
        },
        setHeader: function(header, value) {
          self2.setHeader(header, value);
        },
        method: self2.method,
        path: self2.path
      }, opts);
      debug("httpSignature authorization", self2.getHeader("authorization"));
      return self2;
    };
    Request.prototype.hawk = function(opts) {
      var self2 = this;
      self2.setHeader("Authorization", hawk.header(self2.uri, self2.method, opts));
    };
    Request.prototype.jar = function(jar) {
      var self2 = this;
      var cookies2;
      if (self2._redirect.redirectsFollowed === 0) {
        self2.originalCookieHeader = self2.getHeader("cookie");
      }
      if (!jar) {
        cookies2 = false;
        self2._disableCookies = true;
      } else {
        var targetCookieJar = jar.getCookieString ? jar : globalCookieJar;
        var urihref = self2.uri.href;
        if (targetCookieJar) {
          cookies2 = targetCookieJar.getCookieString(urihref);
        }
      }
      if (cookies2 && cookies2.length) {
        if (self2.originalCookieHeader) {
          self2.setHeader("cookie", self2.originalCookieHeader + "; " + cookies2);
        } else {
          self2.setHeader("cookie", cookies2);
        }
      }
      self2._jar = jar;
      return self2;
    };
    Request.prototype.pipe = function(dest, opts) {
      var self2 = this;
      if (self2.response) {
        if (self2._destdata) {
          self2.emit("error", new Error("You cannot pipe after data has been emitted from the response."));
        } else if (self2._ended) {
          self2.emit("error", new Error("You cannot pipe after the response has been ended."));
        } else {
          stream.Stream.prototype.pipe.call(self2, dest, opts);
          self2.pipeDest(dest);
          return dest;
        }
      } else {
        self2.dests.push(dest);
        stream.Stream.prototype.pipe.call(self2, dest, opts);
        return dest;
      }
    };
    Request.prototype.write = function() {
      var self2 = this;
      if (self2._aborted) {
        return;
      }
      if (!self2._started) {
        self2.start();
      }
      if (self2.req) {
        return self2.req.write.apply(self2.req, arguments);
      }
    };
    Request.prototype.end = function(chunk) {
      var self2 = this;
      if (self2._aborted) {
        return;
      }
      if (chunk) {
        self2.write(chunk);
      }
      if (!self2._started) {
        self2.start();
      }
      if (self2.req) {
        self2.req.end();
      }
    };
    Request.prototype.pause = function() {
      var self2 = this;
      if (!self2.responseContent) {
        self2._paused = true;
      } else {
        self2.responseContent.pause.apply(self2.responseContent, arguments);
      }
    };
    Request.prototype.resume = function() {
      var self2 = this;
      if (!self2.responseContent) {
        self2._paused = false;
      } else {
        self2.responseContent.resume.apply(self2.responseContent, arguments);
      }
    };
    Request.prototype.destroy = function() {
      var self2 = this;
      this.clearTimeout();
      if (!self2._ended) {
        self2.end();
      } else if (self2.response) {
        self2.response.destroy();
      }
    };
    Request.prototype.clearTimeout = function() {
      if (this.timeoutTimer) {
        clearTimeout(this.timeoutTimer);
        this.timeoutTimer = null;
      }
    };
    Request.defaultProxyHeaderWhiteList = Tunnel.defaultProxyHeaderWhiteList.slice();
    Request.defaultProxyHeaderExclusiveList = Tunnel.defaultProxyHeaderExclusiveList.slice();
    Request.prototype.toJSON = requestToJSON;
    module2.exports = Request;
  }
});

// node_modules/@cypress/request/index.js
var require_request3 = __commonJS({
  "node_modules/@cypress/request/index.js"(exports2, module2) {
    "use strict";
    var extend = require_extend();
    var cookies = require_cookies();
    var helpers = require_helpers3();
    var paramsHaveRequestBody = helpers.paramsHaveRequestBody;
    function initParams(uri, options, callback) {
      if (typeof options === "function") {
        callback = options;
      }
      var params = {};
      if (options !== null && typeof options === "object") {
        extend(params, options, { uri });
      } else if (typeof uri === "string") {
        extend(params, { uri });
      } else {
        extend(params, uri);
      }
      params.callback = callback || params.callback;
      return params;
    }
    function request(uri, options, callback) {
      if (typeof uri === "undefined") {
        throw new Error("undefined is not a valid uri or options object.");
      }
      var params = initParams(uri, options, callback);
      if (params.method === "HEAD" && paramsHaveRequestBody(params)) {
        throw new Error("HTTP HEAD requests MUST NOT include a request body.");
      }
      return new request.Request(params);
    }
    function verbFunc(verb) {
      var method = verb.toUpperCase();
      return function(uri, options, callback) {
        var params = initParams(uri, options, callback);
        params.method = method;
        return request(params, params.callback);
      };
    }
    request.get = verbFunc("get");
    request.head = verbFunc("head");
    request.options = verbFunc("options");
    request.post = verbFunc("post");
    request.put = verbFunc("put");
    request.patch = verbFunc("patch");
    request.del = verbFunc("delete");
    request["delete"] = verbFunc("delete");
    request.jar = function(store) {
      return cookies.jar(store);
    };
    request.cookie = function(str) {
      return cookies.parse(str);
    };
    function wrapRequestMethod(method, options, requester, verb) {
      return function(uri, opts, callback) {
        var params = initParams(uri, opts, callback);
        var target = {};
        extend(true, target, options, params);
        target.pool = params.pool || options.pool;
        if (verb) {
          target.method = verb.toUpperCase();
        }
        if (typeof requester === "function") {
          method = requester;
        }
        return method(target, target.callback);
      };
    }
    request.defaults = function(options, requester) {
      var self2 = this;
      options = options || {};
      if (typeof options === "function") {
        requester = options;
        options = {};
      }
      var defaults = wrapRequestMethod(self2, options, requester);
      var verbs = ["get", "head", "post", "put", "patch", "del", "delete"];
      verbs.forEach(function(verb) {
        defaults[verb] = wrapRequestMethod(self2[verb], options, requester, verb);
      });
      defaults.cookie = wrapRequestMethod(self2.cookie, options, requester);
      defaults.jar = self2.jar;
      defaults.defaults = self2.defaults;
      return defaults;
    };
    request.forever = function(agentOptions, optionsArg) {
      var options = {};
      if (optionsArg) {
        extend(options, optionsArg);
      }
      if (agentOptions) {
        options.agentOptions = agentOptions;
      }
      options.forever = true;
      return request.defaults(options);
    };
    module2.exports = request;
    request.Request = require_request();
    request.initParams = initParams;
    Object.defineProperty(request, "debug", {
      enumerable: true,
      get: function() {
        return request.Request.debug;
      },
      set: function(debug) {
        request.Request.debug = debug;
      }
    });
  }
});

// node_modules/@cypress/request-promise/lib/rp.js
var require_rp = __commonJS({
  "node_modules/@cypress/request-promise/lib/rp.js"(exports2, module2) {
    "use strict";
    var Bluebird = require_bluebird().getNewLibraryCopy();
    var configure = require_request2();
    var stealthyRequire = require_lib8();
    try {
      request = stealthyRequire(
        require.cache,
        function() {
          return require_request3();
        },
        function() {
          require_cookie();
        },
        module2
      );
    } catch (err) {
      EOL = require("os").EOL;
      console.error(EOL + "###" + EOL + '### The "request" library is not installed automatically anymore.' + EOL + '### But is a dependency of "request-promise".' + EOL + "### Please install it with:" + EOL + "### npm install request --save" + EOL + "###" + EOL);
      throw err;
    }
    var request;
    var EOL;
    Bluebird.config({ cancellation: true });
    configure({
      request,
      PromiseImpl: Bluebird,
      expose: [
        "then",
        "catch",
        "finally",
        "cancel",
        "promise"
        // Would you like to expose more Bluebird methods? Try e.g. `rp(...).promise().tap(...)` first. `.promise()` returns the full-fledged Bluebird promise.
      ],
      constructorMixin: function(resolve, reject, onCancel) {
        var self2 = this;
        onCancel(function() {
          self2.abort();
        });
      }
    });
    request.bindCLS = function RP$bindCLS() {
      throw new Error("CLS support was dropped. To get it back read: https://github.com/request/request-promise/wiki/Getting-Back-Support-for-Continuation-Local-Storage");
    };
    module2.exports = request;
  }
});

// node_modules/mime/types.json
var require_types2 = __commonJS({
  "node_modules/mime/types.json"(exports2, module2) {
    module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomsvc+xml": ["atomsvc"], "application/bdoc": ["bdoc"], "application/ccxml+xml": ["ccxml"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/font-tdpfr": ["pfr"], "application/font-woff": [], "application/font-woff2": [], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/prs.cww": ["cww"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": [], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": [], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": [], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": [], "application/x-msdownload": ["com", "bat"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["wmf", "emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": [], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "application/xaml+xml": ["xaml"], "application/xcap-diff+xml": ["xdf"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": [], "audio/adpcm": ["adp"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mp3": [], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/wav": ["wav"], "audio/wave": [], "audio/webm": ["weba"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": [], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": [], "audio/x-wav": [], "audio/xm": ["xm"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/apng": ["apng"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/ief": ["ief"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/ktx": ["ktx"], "image/png": ["png"], "image/prs.btif": ["btif"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/tiff": ["tiff", "tif"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": [], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/webp": ["webp"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": [], "image/x-pcx": ["pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/rfc822": ["eml", "mime"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.vtu": ["vtu"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["x3db", "x3dbz"], "model/x3d+vrml": ["x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/hjson": ["hjson"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/prs.lines.tag": ["dsc"], "text/richtext": ["rtx"], "text/rtf": [], "text/sgml": ["sgml", "sgm"], "text/slim": ["slim", "slm"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/vtt": ["vtt"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": [], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "text/xml": [], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/jpeg": ["jpgv"], "video/jpm": ["jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/webm": ["webm"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
  }
});

// node_modules/mime/mime.js
var require_mime2 = __commonJS({
  "node_modules/mime/mime.js"(exports2, module2) {
    var path4 = require("path");
    var fs = require("fs");
    function Mime() {
      this.types = /* @__PURE__ */ Object.create(null);
      this.extensions = /* @__PURE__ */ Object.create(null);
    }
    Mime.prototype.define = function(map) {
      for (var type in map) {
        var exts = map[type];
        for (var i = 0; i < exts.length; i++) {
          if (process.env.DEBUG_MIME && this.types[exts[i]]) {
            console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + " to " + type);
          }
          this.types[exts[i]] = type;
        }
        if (!this.extensions[type]) {
          this.extensions[type] = exts[0];
        }
      }
    };
    Mime.prototype.load = function(file) {
      this._loading = file;
      var map = {}, content = fs.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
      lines.forEach(function(line) {
        var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
        map[fields.shift()] = fields;
      });
      this.define(map);
      this._loading = null;
    };
    Mime.prototype.lookup = function(path5, fallback) {
      var ext = path5.replace(/^.*[\.\/\\]/, "").toLowerCase();
      return this.types[ext] || fallback || this.default_type;
    };
    Mime.prototype.extension = function(mimeType) {
      var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
      return this.extensions[type];
    };
    var mime = new Mime();
    mime.define(require_types2());
    mime.default_type = mime.lookup("bin");
    mime.Mime = Mime;
    mime.charsets = {
      lookup: function(mimeType, fallback) {
        return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback;
      }
    };
    module2.exports = mime;
  }
});

// node_modules/wrappy/wrappy.js
var require_wrappy = __commonJS({
  "node_modules/wrappy/wrappy.js"(exports2, module2) {
    module2.exports = wrappy;
    function wrappy(fn2, cb) {
      if (fn2 && cb)
        return wrappy(fn2)(cb);
      if (typeof fn2 !== "function")
        throw new TypeError("need wrapper function");
      Object.keys(fn2).forEach(function(k) {
        wrapper[k] = fn2[k];
      });
      return wrapper;
      function wrapper() {
        var args = new Array(arguments.length);
        for (var i = 0; i < args.length; i++) {
          args[i] = arguments[i];
        }
        var ret2 = fn2.apply(this, args);
        var cb2 = args[args.length - 1];
        if (typeof ret2 === "function" && ret2 !== cb2) {
          Object.keys(cb2).forEach(function(k) {
            ret2[k] = cb2[k];
          });
        }
        return ret2;
      }
    }
  }
});

// node_modules/once/once.js
var require_once = __commonJS({
  "node_modules/once/once.js"(exports2, module2) {
    var wrappy = require_wrappy();
    module2.exports = wrappy(once);
    module2.exports.strict = wrappy(onceStrict);
    once.proto = once(function() {
      Object.defineProperty(Function.prototype, "once", {
        value: function() {
          return once(this);
        },
        configurable: true
      });
      Object.defineProperty(Function.prototype, "onceStrict", {
        value: function() {
          return onceStrict(this);
        },
        configurable: true
      });
    });
    function once(fn2) {
      var f2 = function() {
        if (f2.called)
          return f2.value;
        f2.called = true;
        return f2.value = fn2.apply(this, arguments);
      };
      f2.called = false;
      return f2;
    }
    function onceStrict(fn2) {
      var f2 = function() {
        if (f2.called)
          throw new Error(f2.onceError);
        f2.called = true;
        return f2.value = fn2.apply(this, arguments);
      };
      var name = fn2.name || "Function wrapped with `once`";
      f2.onceError = name + " shouldn't be called more than once";
      f2.called = false;
      return f2;
    }
  }
});

// node_modules/end-of-stream/index.js
var require_end_of_stream = __commonJS({
  "node_modules/end-of-stream/index.js"(exports2, module2) {
    var once = require_once();
    var noop = function() {
    };
    var isRequest = function(stream) {
      return stream.setHeader && typeof stream.abort === "function";
    };
    var isChildProcess = function(stream) {
      return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
    };
    var eos = function(stream, opts, callback) {
      if (typeof opts === "function")
        return eos(stream, null, opts);
      if (!opts)
        opts = {};
      callback = once(callback || noop);
      var ws = stream._writableState;
      var rs = stream._readableState;
      var readable = opts.readable || opts.readable !== false && stream.readable;
      var writable = opts.writable || opts.writable !== false && stream.writable;
      var cancelled = false;
      var onlegacyfinish = function() {
        if (!stream.writable)
          onfinish();
      };
      var onfinish = function() {
        writable = false;
        if (!readable)
          callback.call(stream);
      };
      var onend = function() {
        readable = false;
        if (!writable)
          callback.call(stream);
      };
      var onexit = function(exitCode) {
        callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
      };
      var onerror = function(err) {
        callback.call(stream, err);
      };
      var onclose = function() {
        process.nextTick(onclosenexttick);
      };
      var onclosenexttick = function() {
        if (cancelled)
          return;
        if (readable && !(rs && (rs.ended && !rs.destroyed)))
          return callback.call(stream, new Error("premature close"));
        if (writable && !(ws && (ws.ended && !ws.destroyed)))
          return callback.call(stream, new Error("premature close"));
      };
      var onrequest = function() {
        stream.req.on("finish", onfinish);
      };
      if (isRequest(stream)) {
        stream.on("complete", onfinish);
        stream.on("abort", onclose);
        if (stream.req)
          onrequest();
        else
          stream.on("request", onrequest);
      } else if (writable && !ws) {
        stream.on("end", onlegacyfinish);
        stream.on("close", onlegacyfinish);
      }
      if (isChildProcess(stream))
        stream.on("exit", onexit);
      stream.on("end", onend);
      stream.on("finish", onfinish);
      if (opts.error !== false)
        stream.on("error", onerror);
      stream.on("close", onclose);
      return function() {
        cancelled = true;
        stream.removeListener("complete", onfinish);
        stream.removeListener("abort", onclose);
        stream.removeListener("request", onrequest);
        if (stream.req)
          stream.req.removeListener("finish", onfinish);
        stream.removeListener("end", onlegacyfinish);
        stream.removeListener("close", onlegacyfinish);
        stream.removeListener("finish", onfinish);
        stream.removeListener("exit", onexit);
        stream.removeListener("end", onend);
        stream.removeListener("error", onerror);
        stream.removeListener("close", onclose);
      };
    };
    module2.exports = eos;
  }
});

// node_modules/pump/index.js
var require_pump = __commonJS({
  "node_modules/pump/index.js"(exports2, module2) {
    var once = require_once();
    var eos = require_end_of_stream();
    var fs = require("fs");
    var noop = function() {
    };
    var ancient = /^v?\.0/.test(process.version);
    var isFn = function(fn2) {
      return typeof fn2 === "function";
    };
    var isFS = function(stream) {
      if (!ancient)
        return false;
      if (!fs)
        return false;
      return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close);
    };
    var isRequest = function(stream) {
      return stream.setHeader && isFn(stream.abort);
    };
    var destroyer = function(stream, reading, writing, callback) {
      callback = once(callback);
      var closed = false;
      stream.on("close", function() {
        closed = true;
      });
      eos(stream, { readable: reading, writable: writing }, function(err) {
        if (err)
          return callback(err);
        closed = true;
        callback();
      });
      var destroyed = false;
      return function(err) {
        if (closed)
          return;
        if (destroyed)
          return;
        destroyed = true;
        if (isFS(stream))
          return stream.close(noop);
        if (isRequest(stream))
          return stream.abort();
        if (isFn(stream.destroy))
          return stream.destroy();
        callback(err || new Error("stream was destroyed"));
      };
    };
    var call = function(fn2) {
      fn2();
    };
    var pipe = function(from, to) {
      return from.pipe(to);
    };
    var pump = function() {
      var streams = Array.prototype.slice.call(arguments);
      var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
      if (Array.isArray(streams[0]))
        streams = streams[0];
      if (streams.length < 2)
        throw new Error("pump requires two streams per minimum");
      var error;
      var destroys = streams.map(function(stream, i) {
        var reading = i < streams.length - 1;
        var writing = i > 0;
        return destroyer(stream, reading, writing, function(err) {
          if (!error)
            error = err;
          if (err)
            destroys.forEach(call);
          if (reading)
            return;
          destroys.forEach(call);
          callback(error);
        });
      });
      streams.reduce(pipe);
    };
    module2.exports = pump;
  }
});

// node_modules/node-telegram-bot-api/lib/telegram.js
var require_telegram2 = __commonJS({
  "node_modules/node-telegram-bot-api/lib/telegram.js"(exports2, module2) {
    "use strict";
    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
    var _slicedToArray = function() {
      function sliceIterator(arr, i) {
        var _arr = [];
        var _n = true;
        var _d = false;
        var _e = void 0;
        try {
          for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
            _arr.push(_s.value);
            if (i && _arr.length === i)
              break;
          }
        } catch (err) {
          _d = true;
          _e = err;
        } finally {
          try {
            if (!_n && _i["return"])
              _i["return"]();
          } finally {
            if (_d)
              throw _e;
          }
        }
        return _arr;
      }
      return function(arr, i) {
        if (Array.isArray(arr)) {
          return arr;
        } else if (Symbol.iterator in Object(arr)) {
          return sliceIterator(arr, i);
        } else {
          throw new TypeError("Invalid attempt to destructure non-iterable instance");
        }
      };
    }();
    var _createClass = function() {
      function defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor = props[i];
          descriptor.enumerable = descriptor.enumerable || false;
          descriptor.configurable = true;
          if ("value" in descriptor)
            descriptor.writable = true;
          Object.defineProperty(target, descriptor.key, descriptor);
        }
      }
      return function(Constructor, protoProps, staticProps) {
        if (protoProps)
          defineProperties(Constructor.prototype, protoProps);
        if (staticProps)
          defineProperties(Constructor, staticProps);
        return Constructor;
      };
    }();
    var _get = function get(object, property, receiver2) {
      if (object === null)
        object = Function.prototype;
      var desc = Object.getOwnPropertyDescriptor(object, property);
      if (desc === void 0) {
        var parent = Object.getPrototypeOf(object);
        if (parent === null) {
          return void 0;
        } else {
          return get(parent, property, receiver2);
        }
      } else if ("value" in desc) {
        return desc.value;
      } else {
        var getter = desc.get;
        if (getter === void 0) {
          return void 0;
        }
        return getter.call(receiver2);
      }
    };
    function _defineProperty(obj2, key, value) {
      if (key in obj2) {
        Object.defineProperty(obj2, key, { value, enumerable: true, configurable: true, writable: true });
      } else {
        obj2[key] = value;
      }
      return obj2;
    }
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
    function _possibleConstructorReturn(self2, call) {
      if (!self2) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return call && (typeof call === "object" || typeof call === "function") ? call : self2;
    }
    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
      }
      subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
      if (superClass)
        Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
    }
    require_array_prototype().shim();
    var errors = require_errors3();
    var TelegramBotWebHook = require_telegramWebHook();
    var TelegramBotPolling = require_telegramPolling();
    var debug = require_browser3()("node-telegram-bot-api");
    var EventEmitter = require_eventemitter3();
    var fileType = require_file_type();
    var request = require_rp();
    var streamedRequest = require_request3();
    var qs = require("querystring");
    var stream = require("stream");
    var mime = require_mime2();
    var path4 = require("path");
    var URL3 = require("url");
    var fs = require("fs");
    var pump = require_pump();
    var deprecate = require_utils5().deprecate;
    var _messageTypes = ["text", "animation", "audio", "channel_chat_created", "contact", "delete_chat_photo", "dice", "document", "game", "group_chat_created", "invoice", "left_chat_member", "location", "migrate_from_chat_id", "migrate_to_chat_id", "new_chat_members", "new_chat_photo", "new_chat_title", "passport_data", "photo", "pinned_message", "poll", "sticker", "successful_payment", "supergroup_chat_created", "video", "video_note", "voice", "video_chat_started", "video_chat_ended", "video_chat_participants_invited", "video_chat_scheduled", "message_auto_delete_timer_changed", "chat_invite_link", "chat_member_updated", "web_app_data", "message_reaction"];
    var _deprecatedMessageTypes = ["new_chat_participant", "left_chat_participant"];
    function stringify2(data) {
      if (typeof data === "string") {
        return data;
      }
      return JSON.stringify(data);
    }
    var TelegramBot2 = function(_EventEmitter) {
      _inherits(TelegramBot3, _EventEmitter);
      _createClass(TelegramBot3, [{
        key: "on",
        /**
         * Add listener for the specified [event](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events).
         * This is the usual `emitter.on()` method.
         * @param  {String} event
         * @param  {Function} listener
         * @see {@link https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events|Available events}
         * @see https://nodejs.org/api/events.html#events_emitter_on_eventname_listener
         */
        value: function on(event, listener) {
          if (_deprecatedMessageTypes.indexOf(event) !== -1) {
            var url = "https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events";
            deprecate("Events " + _deprecatedMessageTypes.join(",") + " are deprecated. See the updated list of events: " + url);
          }
          _get(TelegramBot3.prototype.__proto__ || Object.getPrototypeOf(TelegramBot3.prototype), "on", this).call(this, event, listener);
        }
        /**
         * Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
         * on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
         * Emits `message` when a message arrives.
         *
         * @class TelegramBot
         * @constructor
         * @param {String} token Bot Token
         * @param {Object} [options]
         * @param {Boolean|Object} [options.polling=false] Set true to enable polling or set options.
         *  If a WebHook has been set, it will be deleted automatically.
         * @param {String|Number} [options.polling.timeout=10] *Deprecated. Use `options.polling.params` instead*.
         *  Timeout in seconds for long polling.
         * @param {Boolean} [options.testEnvironment=false] Set true to  work with test enviroment.
         * When working with the test environment, you may use HTTP links without TLS to test your Web App.
         * @param {String|Number} [options.polling.interval=300] Interval between requests in miliseconds
         * @param {Boolean} [options.polling.autoStart=true] Start polling immediately
         * @param {Object} [options.polling.params] Parameters to be used in polling API requests.
         *  See https://core.telegram.org/bots/api#getupdates for more information.
         * @param  {Number} [options.polling.params.timeout=10] Timeout in seconds for long polling.
         * @param {Boolean|Object} [options.webHook=false] Set true to enable WebHook or set options
         * @param {String} [options.webHook.host="0.0.0.0"] Host to bind to
         * @param {Number} [options.webHook.port=8443] Port to bind to
         * @param {String} [options.webHook.key] Path to file with PEM private key for webHook server.
         *  The file is read **synchronously**!
         * @param {String} [options.webHook.cert] Path to file with PEM certificate (public) for webHook server.
         *  The file is read **synchronously**!
         * @param {String} [options.webHook.pfx] Path to file with PFX private key and certificate chain for webHook server.
         *  The file is read **synchronously**!
         * @param {Boolean} [options.webHook.autoOpen=true] Open webHook immediately
         * @param {Object} [options.webHook.https] Options to be passed to `https.createServer()`.
         *  Note that `options.webHook.key`, `options.webHook.cert` and `options.webHook.pfx`, if provided, will be
         *  used to override `key`, `cert` and `pfx` in this object, respectively.
         *  See https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener for more information.
         * @param {String} [options.webHook.healthEndpoint="/healthz"] An endpoint for health checks that always responds with 200 OK
         * @param {Boolean} [options.onlyFirstMatch=false] Set to true to stop after first match. Otherwise, all regexps are executed
         * @param {Object} [options.request] Options which will be added for all requests to telegram api.
         *  See https://github.com/request/request#requestoptions-callback for more information.
         * @param {String} [options.baseApiUrl="https://api.telegram.org"] API Base URl; useful for proxying and testing
         * @param {Boolean} [options.filepath=true] Allow passing file-paths as arguments when sending files,
         *  such as photos using `TelegramBot#sendPhoto()`. See [usage information][usage-sending-files-performance]
         *  for more information on this option and its consequences.
         * @param {Boolean} [options.badRejection=false] Set to `true`
         *  **if and only if** the Node.js version you're using terminates the
         *  process on unhandled rejections. This option is only for
         *  *forward-compatibility purposes*.
         * @see https://core.telegram.org/bots/api
         */
      }], [{
        key: "errors",
        /**
         * The different errors the library uses.
         * @type {Object}
         */
        get: function get() {
          return errors;
        }
        /**
         * The types of message updates the library handles.
         * @type {String[]}
         */
      }, {
        key: "messageTypes",
        get: function get() {
          return _messageTypes;
        }
      }]);
      function TelegramBot3(token) {
        var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        _classCallCheck(this, TelegramBot3);
        var _this = _possibleConstructorReturn(this, (TelegramBot3.__proto__ || Object.getPrototypeOf(TelegramBot3)).call(this));
        _this.token = token;
        _this.options = options;
        _this.options.polling = typeof options.polling === "undefined" ? false : options.polling;
        _this.options.webHook = typeof options.webHook === "undefined" ? false : options.webHook;
        _this.options.baseApiUrl = options.baseApiUrl || "https://api.telegram.org";
        _this.options.filepath = typeof options.filepath === "undefined" ? true : options.filepath;
        _this.options.badRejection = typeof options.badRejection === "undefined" ? false : options.badRejection;
        _this._textRegexpCallbacks = [];
        _this._replyListenerId = 0;
        _this._replyListeners = [];
        _this._polling = null;
        _this._webHook = null;
        if (options.polling) {
          var autoStart = options.polling.autoStart;
          if (typeof autoStart === "undefined" || autoStart === true) {
            _this.startPolling();
          }
        }
        if (options.webHook) {
          var autoOpen = options.webHook.autoOpen;
          if (typeof autoOpen === "undefined" || autoOpen === true) {
            _this.openWebHook();
          }
        }
        return _this;
      }
      _createClass(TelegramBot3, [{
        key: "_buildURL",
        value: function _buildURL(_path) {
          return this.options.baseApiUrl + "/bot" + this.token + (this.options.testEnvironment ? "/test" : "") + "/" + _path;
        }
        /**
         * Fix 'reply_markup' parameter by making it JSON-serialized, as
         * required by the Telegram Bot API
         * @param {Object} obj Object; either 'form' or 'qs'
         * @private
         * @see https://core.telegram.org/bots/api#sendmessage
         */
      }, {
        key: "_fixReplyMarkup",
        value: function _fixReplyMarkup(obj2) {
          var replyMarkup = obj2.reply_markup;
          if (replyMarkup && typeof replyMarkup !== "string") {
            obj2.reply_markup = stringify2(replyMarkup);
          }
        }
        /**
         * Fix 'entities' or 'caption_entities' or 'explanation_entities' parameter by making it JSON-serialized, as
         * required by the Telegram Bot API
         * @param {Object} obj Object;
         * @private
         * @see https://core.telegram.org/bots/api#sendmessage
         * @see https://core.telegram.org/bots/api#copymessage
         * @see https://core.telegram.org/bots/api#sendpoll
         */
      }, {
        key: "_fixEntitiesField",
        value: function _fixEntitiesField(obj2) {
          var entities = obj2.entities;
          var captionEntities = obj2.caption_entities;
          var explanationEntities = obj2.explanation_entities;
          if (entities && typeof entities !== "string") {
            obj2.entities = stringify2(entities);
          }
          if (captionEntities && typeof captionEntities !== "string") {
            obj2.caption_entities = stringify2(captionEntities);
          }
          if (explanationEntities && typeof explanationEntities !== "string") {
            obj2.explanation_entities = stringify2(explanationEntities);
          }
        }
      }, {
        key: "_fixAddFileThumbnail",
        value: function _fixAddFileThumbnail(options, opts) {
          if (options.thumb) {
            if (opts.formData === null) {
              opts.formData = {};
            }
            var attachName = "photo";
            var _formatSendData2 = this._formatSendData(attachName, options.thumb.replace("attach://", "")), _formatSendData3 = _slicedToArray(_formatSendData2, 1), formData = _formatSendData3[0];
            if (formData) {
              opts.formData[attachName] = formData[attachName];
              opts.qs.thumbnail = "attach://" + attachName;
            }
          }
        }
        /**
         * Fix 'reply_parameters' parameter by making it JSON-serialized, as
         * required by the Telegram Bot API
         * @param {Object} obj Object; either 'form' or 'qs'
         * @private
         * @see https://core.telegram.org/bots/api#sendmessage
         */
      }, {
        key: "_fixReplyParameters",
        value: function _fixReplyParameters(obj2) {
          if (obj2.hasOwnProperty("reply_parameters") && typeof obj2.reply_parameters !== "string") {
            obj2.reply_parameters = stringify2(obj2.reply_parameters);
          }
        }
        /**
         * Make request against the API
         * @param  {String} _path API endpoint
         * @param  {Object} [options]
         * @private
         * @return {Promise}
         */
      }, {
        key: "_request",
        value: function _request(_path) {
          var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          if (!this.token) {
            return Promise.reject(new errors.FatalError("Telegram Bot Token not provided!"));
          }
          if (this.options.request) {
            Object.assign(options, this.options.request);
          }
          if (options.form) {
            this._fixReplyMarkup(options.form);
            this._fixEntitiesField(options.form);
            this._fixReplyParameters(options.form);
          }
          if (options.qs) {
            this._fixReplyMarkup(options.qs);
            this._fixReplyParameters(options.qs);
          }
          options.method = "POST";
          options.url = this._buildURL(_path);
          options.simple = false;
          options.resolveWithFullResponse = true;
          options.forever = true;
          debug("HTTP request: %j", options);
          return request(options).then(function(resp) {
            var data = void 0;
            try {
              data = resp.body = JSON.parse(resp.body);
            } catch (err) {
              throw new errors.ParseError("Error parsing response: " + resp.body, resp);
            }
            if (data.ok) {
              return data.result;
            }
            throw new errors.TelegramError(data.error_code + " " + data.description, resp);
          }).catch(function(error) {
            if (error.response)
              throw error;
            throw new errors.FatalError(error);
          });
        }
        /**
         * Format data to be uploaded; handles file paths, streams and buffers
         * @param  {String} type
         * @param  {String|stream.Stream|Buffer} data
         * @param  {Object} fileOptions File options
         * @param  {String} [fileOptions.filename] File name
         * @param  {String} [fileOptions.contentType] Content type (i.e. MIME)
         * @return {Array} formatted
         * @return {Object} formatted[0] formData
         * @return {String} formatted[1] fileId
         * @throws Error if Buffer file type is not supported.
         * @see https://npmjs.com/package/file-type
         * @private
         */
      }, {
        key: "_formatSendData",
        value: function _formatSendData(type, data) {
          var fileOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var deprecationMessage = "See https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files for more information on how sending files has been improved and on how to disable this deprecation message altogether.";
          var filedata = data;
          var filename = fileOptions.filename;
          var contentType = fileOptions.contentType;
          if (data instanceof stream.Stream) {
            if (!filename && data.path) {
              var url = URL3.parse(path4.basename(data.path.toString()));
              if (url.pathname) {
                filename = qs.unescape(url.pathname);
              }
            }
          } else if (Buffer.isBuffer(data)) {
            if (!filename && !process.env.NTBA_FIX_350) {
              deprecate('Buffers will have their filenames default to "filename" instead of "data". ' + deprecationMessage);
              filename = "data";
            }
            if (!contentType) {
              var filetype = fileType(data);
              if (filetype) {
                contentType = filetype.mime;
                var ext = filetype.ext;
                if (ext && !process.env.NTBA_FIX_350) {
                  filename = filename + "." + ext;
                }
              } else if (!process.env.NTBA_FIX_350) {
                deprecate("An error will no longer be thrown if file-type of buffer could not be detected. " + deprecationMessage);
                throw new errors.FatalError("Unsupported Buffer file-type");
              }
            }
          } else if (data) {
            if (this.options.filepath && fs.existsSync(data)) {
              filedata = fs.createReadStream(data);
              if (!filename) {
                filename = path4.basename(data);
              }
            } else {
              return [null, data];
            }
          } else {
            return [null, data];
          }
          filename = filename || "filename";
          contentType = contentType || mime.lookup(filename);
          if (process.env.NTBA_FIX_350) {
            contentType = contentType || "application/octet-stream";
          } else {
            deprecate('In the future, content-type of files you send will default to "application/octet-stream". ' + deprecationMessage);
          }
          return [_defineProperty({}, type, {
            value: filedata,
            options: {
              filename,
              contentType
            }
          }), null];
        }
        /**
         * Start polling.
         * Rejects returned promise if a WebHook is being used by this instance.
         * @param  {Object} [options]
         * @param  {Boolean} [options.restart=true] Consecutive calls to this method causes polling to be restarted
         * @return {Promise}
         */
      }, {
        key: "startPolling",
        value: function startPolling() {
          var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          if (this.hasOpenWebHook()) {
            return Promise.reject(new errors.FatalError("Polling and WebHook are mutually exclusive"));
          }
          options.restart = typeof options.restart === "undefined" ? true : options.restart;
          if (!this._polling) {
            this._polling = new TelegramBotPolling(this);
          }
          return this._polling.start(options);
        }
        /**
         * Alias of `TelegramBot#startPolling()`. This is **deprecated**.
         * @param  {Object} [options]
         * @return {Promise}
         * @deprecated
         */
      }, {
        key: "initPolling",
        value: function initPolling() {
          deprecate("TelegramBot#initPolling() is deprecated. Use TelegramBot#startPolling() instead.");
          return this.startPolling();
        }
        /**
         * Stops polling after the last polling request resolves.
         * Multiple invocations do nothing if polling is already stopped.
         * Returning the promise of the last polling request is **deprecated**.
         * @param  {Object} [options] Options
         * @param  {Boolean} [options.cancel] Cancel current request
         * @param  {String} [options.reason] Reason for stopping polling
         * @return {Promise}
         */
      }, {
        key: "stopPolling",
        value: function stopPolling(options) {
          if (!this._polling) {
            return Promise.resolve();
          }
          return this._polling.stop(options);
        }
        /**
         * Get link for file.
         * Use this method to get link for file for subsequent use.
         * Attention: link will be valid for 1 hour.
         *
         * This method is a sugar extension of the (getFile)[#getfilefileid] method,
         * which returns just path to file on remote server (you will have to manually build full uri after that).
         *
         * @param  {String} fileId  File identifier to get info about
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Promise which will have  *fileURI* in resolve callback
         * @see https://core.telegram.org/bots/api#getfile
         */
      }, {
        key: "getFileLink",
        value: function getFileLink(fileId) {
          var _this2 = this;
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          return this.getFile(fileId, form).then(function(resp) {
            return _this2.options.baseApiUrl + "/file/bot" + _this2.token + "/" + resp.file_path;
          });
        }
        /**
         * Return a readable stream for file.
         *
         * `fileStream.path` is the specified file ID i.e. `fileId`.
         * `fileStream` emits event `info` passing a single argument i.e.
         * `info` with the interface `{ uri }` where `uri` is the URI of the
         * file on Telegram servers.
         *
         * This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method,
         * which returns the full URI to the file on remote server.
         *
         * @param  {String} fileId File identifier to get info about
         * @param  {Object} [options] Additional Telegram query options
         * @return {stream.Readable} fileStream
         */
      }, {
        key: "getFileStream",
        value: function getFileStream(fileId) {
          var _this3 = this;
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          var fileStream = new stream.PassThrough();
          fileStream.path = fileId;
          this.getFileLink(fileId, form).then(function(fileURI) {
            fileStream.emit("info", {
              uri: fileURI
            });
            pump(streamedRequest(Object.assign({ uri: fileURI }, _this3.options.request)), fileStream);
          }).catch(function(error) {
            fileStream.emit("error", error);
          });
          return fileStream;
        }
        /**
         * Downloads file in the specified folder.
         *
         * This method is a sugar extension of the [getFileStream](#TelegramBot+getFileStream) method,
         * which returns a readable file stream.
         *
         * @param  {String} fileId  File identifier to get info about
         * @param  {String} downloadDir Absolute path to the folder in which file will be saved
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Promise, which will have *filePath* of downloaded file in resolve callback
         */
      }, {
        key: "downloadFile",
        value: function downloadFile(fileId, downloadDir) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var resolve = void 0;
          var reject = void 0;
          var promise = new Promise(function(a, b) {
            resolve = a;
            reject = b;
          });
          var fileStream = this.getFileStream(fileId, form);
          fileStream.on("info", function(info) {
            var fileName = info.uri.slice(info.uri.lastIndexOf("/") + 1);
            var filePath = path4.join(downloadDir, fileName);
            pump(fileStream, fs.createWriteStream(filePath), function(error) {
              if (error) {
                return reject(error);
              }
              return resolve(filePath);
            });
          });
          fileStream.on("error", function(err) {
            reject(err);
          });
          return promise;
        }
        /**
         * Register a RegExp to test against an incomming text message.
         * @param  {RegExp}   regexpRexecuted with `exec`.
         * @param  {Function} callback     Callback will be called with 2 parameters,
         * the `msg` and the result of executing `regexp.exec` on message text.
         */
      }, {
        key: "onText",
        value: function onText(regexp, callback) {
          this._textRegexpCallbacks.push({ regexp, callback });
        }
        /**
         * Remove a listener registered with `onText()`.
         * @param  {RegExp} regexp RegExp used previously in `onText()`
         * @return {Object} deletedListener The removed reply listener if
         *   found. This object has `regexp` and `callback`
         *   properties. If not found, returns `null`.
         */
      }, {
        key: "removeTextListener",
        value: function removeTextListener(regexp) {
          var index = this._textRegexpCallbacks.findIndex(function(textListener) {
            return String(textListener.regexp) === String(regexp);
          });
          if (index === -1) {
            return null;
          }
          return this._textRegexpCallbacks.splice(index, 1)[0];
        }
        /**
         * Remove all listeners registered with `onText()`.
         */
      }, {
        key: "clearTextListeners",
        value: function clearTextListeners() {
          this._textRegexpCallbacks = [];
        }
        /**
         * Register a reply to wait for a message response.
         *
         * @param  {Number|String} chatId The chat id where the message cames from.
         * @param  {Number|String} messageId The message id to be replied.
         * @param  {Function} callback Callback will be called with the reply
         *  message.
         * @return {Number} id The ID of the inserted reply listener.
         */
      }, {
        key: "onReplyToMessage",
        value: function onReplyToMessage(chatId, messageId, callback) {
          var id = ++this._replyListenerId;
          this._replyListeners.push({
            id,
            chatId,
            messageId,
            callback
          });
          return id;
        }
        /**
         * Removes a reply that has been prev. registered for a message response.
         * @param   {Number} replyListenerId The ID of the reply listener.
         * @return  {Object} deletedListener The removed reply listener if
         *   found. This object has `id`, `chatId`, `messageId` and `callback`
         *   properties. If not found, returns `null`.
         */
      }, {
        key: "removeReplyListener",
        value: function removeReplyListener(replyListenerId) {
          var index = this._replyListeners.findIndex(function(replyListener) {
            return replyListener.id === replyListenerId;
          });
          if (index === -1) {
            return null;
          }
          return this._replyListeners.splice(index, 1)[0];
        }
        /**
         * Removes all replies that have been prev. registered for a message response.
         *
         * @return  {Array} deletedListeners An array of removed listeners.
         */
      }, {
        key: "clearReplyListeners",
        value: function clearReplyListeners() {
          this._replyListeners = [];
        }
        /**
         * Return true if polling. Otherwise, false.
         *
         * @return {Boolean}
         */
      }, {
        key: "isPolling",
        value: function isPolling() {
          return this._polling ? this._polling.isPolling() : false;
        }
        /**
         * Open webhook.
         * Multiple invocations do nothing if webhook is already open.
         * Rejects returned promise if Polling is being used by this instance.
         *
         * @return {Promise}
         */
      }, {
        key: "openWebHook",
        value: function openWebHook() {
          if (this.isPolling()) {
            return Promise.reject(new errors.FatalError("WebHook and Polling are mutually exclusive"));
          }
          if (!this._webHook) {
            this._webHook = new TelegramBotWebHook(this);
          }
          return this._webHook.open();
        }
        /**
         * Close webhook after closing all current connections.
         * Multiple invocations do nothing if webhook is already closed.
         *
         * @return {Promise} Promise
         */
      }, {
        key: "closeWebHook",
        value: function closeWebHook() {
          if (!this._webHook) {
            return Promise.resolve();
          }
          return this._webHook.close();
        }
        /**
         * Return true if using webhook and it is open i.e. accepts connections.
         * Otherwise, false.
         *
         * @return {Boolean}
         */
      }, {
        key: "hasOpenWebHook",
        value: function hasOpenWebHook() {
          return this._webHook ? this._webHook.isOpen() : false;
        }
        /**
         * Process an update; emitting the proper events and executing regexp
         * callbacks. This method is useful should you be using a different
         * way to fetch updates, other than those provided by TelegramBot.
         *
         * @param  {Object} update
         * @see https://core.telegram.org/bots/api#update
         */
      }, {
        key: "processUpdate",
        value: function processUpdate(update) {
          var _this4 = this;
          debug("Process Update %j", update);
          var message = update.message;
          var editedMessage = update.edited_message;
          var channelPost = update.channel_post;
          var editedChannelPost = update.edited_channel_post;
          var businessConnection = update.business_connection;
          var businesssMessage = update.business_message;
          var editedBusinessMessage = update.edited_business_message;
          var deletedBusinessMessage = update.deleted_business_messages;
          var messageReaction = update.message_reaction;
          var messageReactionCount = update.message_reaction_count;
          var inlineQuery = update.inline_query;
          var chosenInlineResult = update.chosen_inline_result;
          var callbackQuery = update.callback_query;
          var shippingQuery = update.shipping_query;
          var preCheckoutQuery = update.pre_checkout_query;
          var poll = update.poll;
          var pollAnswer = update.poll_answer;
          var myChatMember = update.my_chat_member;
          var chatMember = update.chat_member;
          var chatJoinRequest = update.chat_join_request;
          var chatBoost = update.chat_boost;
          var removedChatBoost = update.removed_chat_boost;
          if (message) {
            debug("Process Update message %j", message);
            var metadata = {};
            metadata.type = TelegramBot3.messageTypes.find(function(messageType) {
              return message[messageType];
            });
            this.emit("message", message, metadata);
            if (metadata.type) {
              debug("Emitting %s: %j", metadata.type, message);
              this.emit(metadata.type, message, metadata);
            }
            if (message.text) {
              debug("Text message");
              this._textRegexpCallbacks.some(function(reg) {
                debug("Matching %s with %s", message.text, reg.regexp);
                if (!(reg.regexp instanceof RegExp)) {
                  reg.regexp = new RegExp(reg.regexp);
                }
                var result = reg.regexp.exec(message.text);
                if (!result) {
                  return false;
                }
                reg.regexp.lastIndex = 0;
                debug("Matches %s", reg.regexp);
                reg.callback(message, result);
                return _this4.options.onlyFirstMatch;
              });
            }
            if (message.reply_to_message) {
              this._replyListeners.forEach(function(reply) {
                if (reply.chatId === message.chat.id) {
                  if (reply.messageId === message.reply_to_message.message_id) {
                    reply.callback(message);
                  }
                }
              });
            }
          } else if (editedMessage) {
            debug("Process Update edited_message %j", editedMessage);
            this.emit("edited_message", editedMessage);
            if (editedMessage.text) {
              this.emit("edited_message_text", editedMessage);
            }
            if (editedMessage.caption) {
              this.emit("edited_message_caption", editedMessage);
            }
          } else if (channelPost) {
            debug("Process Update channel_post %j", channelPost);
            this.emit("channel_post", channelPost);
          } else if (editedChannelPost) {
            debug("Process Update edited_channel_post %j", editedChannelPost);
            this.emit("edited_channel_post", editedChannelPost);
            if (editedChannelPost.text) {
              this.emit("edited_channel_post_text", editedChannelPost);
            }
            if (editedChannelPost.caption) {
              this.emit("edited_channel_post_caption", editedChannelPost);
            }
          } else if (businessConnection) {
            debug("Process Update business_connection %j", businessConnection);
            this.emit("business_connection", businessConnection);
          } else if (businesssMessage) {
            debug("Process Update business_message %j", businesssMessage);
            this.emit("business_message", businesssMessage);
          } else if (editedBusinessMessage) {
            debug("Process Update edited_business_message %j", editedBusinessMessage);
            this.emit("edited_business_message", editedBusinessMessage);
          } else if (deletedBusinessMessage) {
            debug("Process Update deleted_business_messages %j", deletedBusinessMessage);
            this.emit("deleted_business_messages", deletedBusinessMessage);
          } else if (messageReaction) {
            debug("Process Update message_reaction %j", messageReaction);
            this.emit("message_reaction", messageReaction);
          } else if (messageReactionCount) {
            debug("Process Update message_reaction_count %j", messageReactionCount);
            this.emit("message_reaction_count", messageReactionCount);
          } else if (inlineQuery) {
            debug("Process Update inline_query %j", inlineQuery);
            this.emit("inline_query", inlineQuery);
          } else if (chosenInlineResult) {
            debug("Process Update chosen_inline_result %j", chosenInlineResult);
            this.emit("chosen_inline_result", chosenInlineResult);
          } else if (callbackQuery) {
            debug("Process Update callback_query %j", callbackQuery);
            this.emit("callback_query", callbackQuery);
          } else if (shippingQuery) {
            debug("Process Update shipping_query %j", shippingQuery);
            this.emit("shipping_query", shippingQuery);
          } else if (preCheckoutQuery) {
            debug("Process Update pre_checkout_query %j", preCheckoutQuery);
            this.emit("pre_checkout_query", preCheckoutQuery);
          } else if (poll) {
            debug("Process Update poll %j", poll);
            this.emit("poll", poll);
          } else if (pollAnswer) {
            debug("Process Update poll_answer %j", pollAnswer);
            this.emit("poll_answer", pollAnswer);
          } else if (chatMember) {
            debug("Process Update chat_member %j", chatMember);
            this.emit("chat_member", chatMember);
          } else if (myChatMember) {
            debug("Process Update my_chat_member %j", myChatMember);
            this.emit("my_chat_member", myChatMember);
          } else if (chatJoinRequest) {
            debug("Process Update my_chat_member %j", chatJoinRequest);
            this.emit("chat_join_request", chatJoinRequest);
          } else if (chatBoost) {
            debug("Process Update chat_boost %j", chatBoost);
            this.emit("chat_boost", chatBoost);
          } else if (removedChatBoost) {
            debug("Process Update removed_chat_boost %j", removedChatBoost);
            this.emit("removed_chat_boost", removedChatBoost);
          }
        }
        /** Start Telegram Bot API methods */
        /**
        * Use this method to receive incoming updates using long polling.
        * This method has an [older, compatible signature][getUpdates-v0.25.0]
        * that is being deprecated.
        *
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise}
        * @see https://core.telegram.org/bots/api#getupdates
        */
      }, {
        key: "getUpdates",
        value: function getUpdates() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          if ((typeof form === "undefined" ? "undefined" : _typeof(form)) !== "object") {
            deprecate("The method signature getUpdates(timeout, limit, offset) has been deprecated since v0.25.0");
            form = {
              timeout: arguments[0],
              limit: arguments[1],
              offset: arguments[2]
            };
          }
          return this._request("getUpdates", { form });
        }
        /**
         * Specify an url to receive incoming updates via an outgoing webHook.
         * This method has an [older, compatible signature][setWebHook-v0.25.0]
         * that is being deprecated.
         *
         * @param  {String} url URL where Telegram will make HTTP Post. Leave empty to
         * delete webHook.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {String|stream.Stream} [options.certificate] PEM certificate key (public).
         * @param  {String} [options.secret_token] Optional secret token to be sent in a header `X-Telegram-Bot-Api-Secret-Token` in every webhook request.
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise}
         * @see https://core.telegram.org/bots/api#setwebhook
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
         */
      }, {
        key: "setWebHook",
        value: function setWebHook(url) {
          var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          var fileOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var cert = void 0;
          if ((typeof options === "undefined" ? "undefined" : _typeof(options)) !== "object" || options instanceof stream.Stream) {
            deprecate("The method signature setWebHook(url, cert) has been deprecated since v0.25.0");
            cert = options;
            options = {};
          } else {
            cert = options.certificate;
          }
          var opts = {
            qs: options
          };
          opts.qs.url = url;
          if (cert) {
            try {
              var sendData = this._formatSendData("certificate", cert, fileOptions);
              opts.formData = sendData[0];
              opts.qs.certificate = sendData[1];
            } catch (ex) {
              return Promise.reject(ex);
            }
          }
          return this._request("setWebHook", opts);
        }
        /**
         * Use this method to remove webhook integration if you decide to
         * switch back to getUpdates. Returns True on success.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}
         * @see https://core.telegram.org/bots/api#deletewebhook
         */
      }, {
        key: "deleteWebHook",
        value: function deleteWebHook() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("deleteWebhook", { form });
        }
        /**
         * Use this method to get current webhook status.
         * On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookinfo) object.
         * If the bot is using getUpdates, will return an object with the
         * url field empty.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}
         * @see https://core.telegram.org/bots/api#getwebhookinfo
         */
      }, {
        key: "getWebHookInfo",
        value: function getWebHookInfo() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getWebhookInfo", { form });
        }
        /**
         * A simple method for testing your bot's authentication token. Requires no parameters.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} basic information about the bot in form of a [User](https://core.telegram.org/bots/api#user) object.
         * @see https://core.telegram.org/bots/api#getme
         */
      }, {
        key: "getMe",
        value: function getMe() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getMe", { form });
        }
        /**
         * This method log out your bot from the cloud Bot API server before launching the bot locally.
         * You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
         * After a successful call, you will not be able to log in again using the same token for 10 minutes.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}  True on success
         * @see https://core.telegram.org/bots/api#logout
         */
      }, {
        key: "logOut",
        value: function logOut() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("logOut", { form });
        }
        /**
         * This method close the bot instance before moving it from one local server to another.
         * This method will return error 429 in the first 10 minutes after the bot is launched.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}  True on success
         * @see https://core.telegram.org/bots/api#close
         */
      }, {
        key: "close",
        value: function close() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("close", { form });
        }
        /**
         * Send text message.
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} text Text of the message to be sent
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendmessage
         */
      }, {
        key: "sendMessage",
        value: function sendMessage(chatId, text) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.text = text;
          return this._request("sendMessage", { form });
        }
        /**
         * Forward messages of any kind.
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * or username of the target channel (in the format `@channelusername`)
         * @param  {Number|String} fromChatId Unique identifier for the chat where the
         * original message was sent (or channel username in the format `@channelusername`)
         * @param  {Number|String} messageId  Unique message identifier in the chat specified in fromChatId
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}
         * @see https://core.telegram.org/bots/api#forwardmessage
         */
      }, {
        key: "forwardMessage",
        value: function forwardMessage(chatId, fromChatId, messageId) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.from_chat_id = fromChatId;
          form.message_id = messageId;
          return this._request("forwardMessage", { form });
        }
        /**
         * Use this method to forward multiple messages of any kind.
         * If some of the specified messages can't be found or forwarded, they are skipped.
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * or username of the target channel (in the format `@channelusername`)
         * @param  {Number|String} fromChatId Unique identifier for the chat where the
         * original message was sent (or channel username in the format `@channelusername`)
         * @param  {Array<Number|String>} messageIds Identifiers of 1-100 messages in the chat from_chat_id to forward.
         * The identifiers must be specified in a strictly increasing order.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} An array of MessageId of the sent messages on success
         * @see https://core.telegram.org/bots/api#forwardmessages
         */
      }, {
        key: "forwardMessages",
        value: function forwardMessages(chatId, fromChatId, messageIds) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.from_chat_id = fromChatId;
          form.message_ids = messageIds;
          return this._request("forwardMessages", { form });
        }
        /**
         * Copy messages of any kind. **Service messages and invoice messages can't be copied.**
         * The method is analogous to the method forwardMessages, but the copied message doesn't
         * have a link to the original message.
         * Returns the MessageId of the sent message on success.
         * @param  {Number|String} chatId     Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number|String} fromChatId Unique identifier for the chat where the
         * original message was sent
         * @param  {Number|String} messageId  Unique message identifier
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} The [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success
         * @see https://core.telegram.org/bots/api#copymessage
         */
      }, {
        key: "copyMessage",
        value: function copyMessage(chatId, fromChatId, messageId) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.from_chat_id = fromChatId;
          form.message_id = messageId;
          return this._request("copyMessage", { form });
        }
        /**
         * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
         * Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
         * Returns the MessageId of the sent message on success.
         * @param  {Number|String} chatId Unique identifier for the target chat
         * @param  {Number|String} fromChatId Unique identifier for the chat where the
         * original message was sent
         * @param  {Array} messageIds  Identifiers of 1-100 messages in the chat from_chat_id to copy.
         * The identifiers must be specified in a strictly increasing order.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} An array of MessageId of the sent messages
         * @see https://core.telegram.org/bots/api#copymessages
         */
      }, {
        key: "copyMessages",
        value: function copyMessages(chatId, fromChatId, messageIds) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.from_chat_id = fromChatId;
          form.message_ids = stringify2(messageIds);
          return this._request("copyMessages", { form });
        }
        /**
         * Send photo
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String|stream.Stream|Buffer} photo A file path or a Stream. Can
         * also be a `file_id` previously uploaded
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendphoto
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
         */
      }, {
        key: "sendPhoto",
        value: function sendPhoto(chatId, photo) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("photo", photo, fileOptions);
            opts.formData = sendData[0];
            opts.qs.photo = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendPhoto", opts);
        }
        /**
        * Send audio
        *
        * **Your audio must be in the .MP3 or .M4A format.**
        *
        * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {String|stream.Stream|Buffer} audio A file path, Stream or Buffer.
        * Can also be a `file_id` previously uploaded.
        * @param  {Object} [options] Additional Telegram query options
        * @param  {Object} [fileOptions] Optional file related meta-data
        * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
        * @see https://core.telegram.org/bots/api#sendaudio
        * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
        */
      }, {
        key: "sendAudio",
        value: function sendAudio(chatId, audio) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("audio", audio, fileOptions);
            opts.formData = sendData[0];
            opts.qs.audio = sendData[1];
            this._fixAddFileThumbnail(options, opts);
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendAudio", opts);
        }
        /**
        * Send Document
        * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {String|stream.Stream|Buffer} doc A file path, Stream or Buffer.
        * Can also be a `file_id` previously uploaded.
        * @param  {Object} [options] Additional Telegram query options
        * @param  {Object} [fileOptions] Optional file related meta-data
        * @return {Promise}  On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
        * @see https://core.telegram.org/bots/api#sendDocument
        * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
        */
      }, {
        key: "sendDocument",
        value: function sendDocument(chatId, doc) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("document", doc, fileOptions);
            opts.formData = sendData[0];
            opts.qs.document = sendData[1];
            this._fixAddFileThumbnail(options, opts);
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendDocument", opts);
        }
        /**
         * Use this method to send video files, **Telegram clients support mp4 videos** (other formats may be sent as Document).
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String|stream.Stream|Buffer} video A file path or Stream.
         * Can also be a `file_id` previously uploaded.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendvideo
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
         */
      }, {
        key: "sendVideo",
        value: function sendVideo(chatId, video) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("video", video, fileOptions);
            opts.formData = sendData[0];
            opts.qs.video = sendData[1];
            this._fixAddFileThumbnail(options, opts);
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendVideo", opts);
        }
        /**
         * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String|stream.Stream|Buffer} animation A file path, Stream or Buffer.
         * Can also be a `file_id` previously uploaded.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendanimation
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
         */
      }, {
        key: "sendAnimation",
        value: function sendAnimation(chatId, animation) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("animation", animation, fileOptions);
            opts.formData = sendData[0];
            opts.qs.animation = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendAnimation", opts);
        }
        /**
         * Send voice
         *
         * **Your audio must be in an .OGG file encoded with OPUS**, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String|stream.Stream|Buffer} voice A file path, Stream or Buffer.
         * Can also be a `file_id` previously uploaded.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendvoice
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
         */
      }, {
        key: "sendVoice",
        value: function sendVoice(chatId, voice) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("voice", voice, fileOptions);
            opts.formData = sendData[0];
            opts.qs.voice = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendVoice", opts);
        }
        /**
         * Use this method to send video messages
         * Telegram clients support **rounded square MPEG4 videos** of up to 1 minute long.
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String|stream.Stream|Buffer} videoNote A file path or Stream.
         * Can also be a `file_id` previously uploaded.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @info The length parameter is actually optional. However, the API (at time of writing) requires you to always provide it until it is fixed.
         * @see https://core.telegram.org/bots/api#sendvideonote
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
        */
      }, {
        key: "sendVideoNote",
        value: function sendVideoNote(chatId, videoNote) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("video_note", videoNote, fileOptions);
            opts.formData = sendData[0];
            opts.qs.video_note = sendData[1];
            this._fixAddFileThumbnail(options, opts);
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendVideoNote", opts);
        }
        /**
         * Use this method to send a group of photos or videos as an album.
         *
         * **Documents and audio files can be only grouped in an album with messages of the same type**
         *
         * If you wish to [specify file options](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files),
         * add a `fileOptions` property to the target input in `media`.
         *
         * @param  {String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Array} media A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
         * is returned.
         * @see https://core.telegram.org/bots/api#sendmediagroup
         * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
         */
      }, {
        key: "sendMediaGroup",
        value: function sendMediaGroup(chatId, media) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          opts.formData = {};
          var inputMedia = [];
          var index = 0;
          var _iteratorNormalCompletion = true;
          var _didIteratorError = false;
          var _iteratorError = void 0;
          try {
            for (var _iterator = media[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
              var input = _step.value;
              var payload = Object.assign({}, input);
              delete payload.media;
              delete payload.fileOptions;
              try {
                var attachName = String(index);
                var _formatSendData4 = this._formatSendData(attachName, input.media, input.fileOptions), _formatSendData5 = _slicedToArray(_formatSendData4, 2), formData = _formatSendData5[0], fileId = _formatSendData5[1];
                if (formData) {
                  opts.formData[attachName] = formData[attachName];
                  payload.media = "attach://" + attachName;
                } else {
                  payload.media = fileId;
                }
              } catch (ex) {
                return Promise.reject(ex);
              }
              inputMedia.push(payload);
              index++;
            }
          } catch (err) {
            _didIteratorError = true;
            _iteratorError = err;
          } finally {
            try {
              if (!_iteratorNormalCompletion && _iterator.return) {
                _iterator.return();
              }
            } finally {
              if (_didIteratorError) {
                throw _iteratorError;
              }
            }
          }
          opts.qs.media = stringify2(inputMedia);
          return this._request("sendMediaGroup", opts);
        }
        /**
         * Send location.
         * Use this method to send point on the map.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Float} latitude Latitude of location
         * @param  {Float} longitude Longitude of location
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendlocation
         */
      }, {
        key: "sendLocation",
        value: function sendLocation(chatId, latitude, longitude) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.latitude = latitude;
          form.longitude = longitude;
          return this._request("sendLocation", { form });
        }
        /**
         * Use this method to edit live location messages sent by
         * the bot or via the bot (for inline bots).
         *
         *  A location **can be edited until its live_period expires or editing is explicitly disabled by a call to [stopMessageLiveLocation](https://core.telegram.org/bots/api#stopmessagelivelocation)**
         *
         * Note that you must provide one of chat_id, message_id, or
         * inline_message_id in your request.
         *
         * @param  {Float} latitude Latitude of location
         * @param  {Float} longitude Longitude of location
         * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
         * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
         * @see https://core.telegram.org/bots/api#editmessagelivelocation
         */
      }, {
        key: "editMessageLiveLocation",
        value: function editMessageLiveLocation(latitude, longitude) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.latitude = latitude;
          form.longitude = longitude;
          return this._request("editMessageLiveLocation", { form });
        }
        /**
         * Use this method to stop updating a live location message sent by
         * the bot or via the bot (for inline bots) before live_period expires.
         *
         * Note that you must provide one of chat_id, message_id, or
         * inline_message_id in your request.
         *
         * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
         * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
         * @see https://core.telegram.org/bots/api#stopmessagelivelocation
         */
      }, {
        key: "stopMessageLiveLocation",
        value: function stopMessageLiveLocation() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("stopMessageLiveLocation", { form });
        }
        /**
         * Send venue.
         * Use this method to send information about a venue.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Float} latitude Latitude of location
         * @param  {Float} longitude Longitude of location
         * @param  {String} title Name of the venue
         * @param  {String} address Address of the venue
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
         * @see https://core.telegram.org/bots/api#sendvenue
         */
      }, {
        key: "sendVenue",
        value: function sendVenue(chatId, latitude, longitude, title, address) {
          var form = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
          form.chat_id = chatId;
          form.latitude = latitude;
          form.longitude = longitude;
          form.title = title;
          form.address = address;
          return this._request("sendVenue", { form });
        }
        /**
         * Send contact.
         * Use this method to send phone contacts.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} phoneNumber Contact's phone number
         * @param  {String} firstName Contact's first name
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendcontact
         */
      }, {
        key: "sendContact",
        value: function sendContact(chatId, phoneNumber, firstName) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.phone_number = phoneNumber;
          form.first_name = firstName;
          return this._request("sendContact", { form });
        }
        /**
         * Send poll.
         * Use this method to send a native poll.
         *
         * @param  {Number|String} chatId  Unique identifier for the group/channel
         * @param  {String} question Poll question, 1-300 characters
         * @param  {Array} pollOptions Poll options, between 2-10 options (only 1-100 characters each)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#sendpoll
         */
      }, {
        key: "sendPoll",
        value: function sendPoll(chatId, question, pollOptions) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.question = question;
          form.options = stringify2(pollOptions);
          return this._request("sendPoll", { form });
        }
        /**
         * Send Dice
         * Use this method to send an animated emoji that will display a random value.
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}  On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
         * @see https://core.telegram.org/bots/api#senddice
         */
      }, {
        key: "sendDice",
        value: function sendDice(chatId) {
          var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("dice");
            opts.formData = sendData[0];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendDice", opts);
        }
        /**
         * Send chat action.
         *
         * Use this method when you need to tell the user that something is happening on the bot's side.
         * **The status is set for 5 seconds or less** (when a message arrives from your bot, Telegram clients clear its typing status).
         *
         *  Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
         * `upload_photo` for [photos](https://core.telegram.org/bots/api#sendphoto), `record_video` or `upload_video` for [videos](https://core.telegram.org/bots/api#sendvideo),
         * `record_voice` or `upload_voice` for [voice notes](https://core.telegram.org/bots/api#sendvoice), `upload_document` for [general files](https://core.telegram.org/bots/api#senddocument),
         * `choose_sticker` for [stickers](https://core.telegram.org/bots/api#sendsticker), `find_location` for [location data](https://core.telegram.org/bots/api#sendlocation),
         * `record_video_note` or `upload_video_note` for [video notes](https://core.telegram.org/bots/api#sendvideonote).
         *
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} action Type of action to broadcast.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#sendchataction
         */
      }, {
        key: "sendChatAction",
        value: function sendChatAction(chatId, action) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.action = action;
          return this._request("sendChatAction", { form });
        }
        /**
         * Use this method to change the chosen reactions on a message.
         * - Service messages can't be reacted to.
         * - Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
         * - In albums, bots must react to the first message.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format @channelusername)
         * @param  {Number} messageId  Unique identifier of the target message
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise<Boolean>} True on success
         * @see https://core.telegram.org/bots/api#setmessagereaction
         */
      }, {
        key: "setMessageReaction",
        value: function setMessageReaction(chatId, messageId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_id = messageId;
          if (form.reaction) {
            form.reaction = stringify2(form.reaction);
          }
          return this._request("setMessageReaction", { form });
        }
        /**
         * Use this method to get a list of profile pictures for a user.
         * Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.
         * This method has an [older, compatible signature][getUserProfilePhotos-v0.25.0]
         * that is being deprecated.
         *
         * @param  {Number} userId  Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise}  Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object
         * @see https://core.telegram.org/bots/api#getuserprofilephotos
         */
      }, {
        key: "getUserProfilePhotos",
        value: function getUserProfilePhotos(userId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          if ((typeof form === "undefined" ? "undefined" : _typeof(form)) !== "object") {
            deprecate("The method signature getUserProfilePhotos(userId, offset, limit) has been deprecated since v0.25.0");
            form = {
              offset: arguments[1],
              limit: arguments[2]
            };
          }
          form.user_id = userId;
          return this._request("getUserProfilePhotos", { form });
        }
        /**
         * Get file.
         * Use this method to get basic info about a file and prepare it for downloading.
         *
         * Attention: **link will be valid for 1 hour.**
         *
         * @param  {String} fileId  File identifier to get info about
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, a [File](https://core.telegram.org/bots/api#file) object is returned
         * @see https://core.telegram.org/bots/api#getfile
         */
      }, {
        key: "getFile",
        value: function getFile(fileId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.file_id = fileId;
          return this._request("getFile", { form });
        }
        /**
          * Use this method to ban a user in a group, a supergroup or a channel.
          * In the case of supergroups and channels, the user will not be able to
          * return to the chat on their own using invite links, etc., unless unbanned first..
          *
          * The **bot must be an administrator in the group, supergroup or a channel** for this to work.
          *
          *
          * @param  {Number|String} chatId   Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
          * @param  {Number} userId  Unique identifier of the target user
          * @param  {Object} [options] Additional Telegram query options
          * @return {Promise} True on success.
          * @see https://core.telegram.org/bots/api#banchatmember
          */
      }, {
        key: "banChatMember",
        value: function banChatMember(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("banChatMember", { form });
        }
        /**
        * Use this method to unban a previously kicked user in a supergroup.
        * The user will not return to the group automatically, but will be
        * able to join via link, etc.
        *
        * The **bot must be an administrator** in the supergroup or channel for this to work.
        *
        * **By default**, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
        * So **if the user is a member of the chat they will also be removed from the chat**. If you don't want this, use the parameter *only_if_banned*
        *
        * @param  {Number|String} chatId   Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {Number} userId  Unique identifier of the target user
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#unbanchatmember
        */
      }, {
        key: "unbanChatMember",
        value: function unbanChatMember(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("unbanChatMember", { form });
        }
        /**
        * Use this method to restrict a user in a supergroup.
        * The bot **must be an administrator in the supergroup** for this to work
        * and must have the appropriate admin rights. Pass True for all boolean parameters
        * to lift restrictions from a user. Returns True on success.
        *
        * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {Number} userId Unique identifier of the target user
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#restrictchatmember
        */
      }, {
        key: "restrictChatMember",
        value: function restrictChatMember(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("restrictChatMember", { form });
        }
        /**
         * Use this method to promote or demote a user in a supergroup or a channel.
         * The bot **must be an administrator** in the chat for this to work
         * and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number} userId
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success.
         * @see https://core.telegram.org/bots/api#promotechatmember
         */
      }, {
        key: "promoteChatMember",
        value: function promoteChatMember(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("promoteChatMember", { form });
        }
        /**
         * Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number} userId Unique identifier of the target user
         * @param  {String} customTitle New custom title for the administrator; 0-16 characters, emoji are not allowed
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
         */
      }, {
        key: "setChatAdministratorCustomTitle",
        value: function setChatAdministratorCustomTitle(chatId, userId, customTitle) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          form.custom_title = customTitle;
          return this._request("setChatAdministratorCustomTitle", { form });
        }
        /**
         * Use this method to ban a channel chat in a supergroup or a channel.
         *
         * Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), the owner of the banned chat won't be able to send messages on behalf of any of their channels.
         * The bot **must be an administrator in the supergroup or channel** for this to work and must have the appropriate administrator rights
         *
         * @param  {Number|String} chatId   Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number} senderChatId  Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success.
         * @see https://core.telegram.org/bots/api#banchatsenderchat
         */
      }, {
        key: "banChatSenderChat",
        value: function banChatSenderChat(chatId, senderChatId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.sender_chat_id = senderChatId;
          return this._request("banChatSenderChat", { form });
        }
        /**
        * Use this method to unban a previously banned channel chat in a supergroup or channel.
        *
        * The bot **must be an administrator** for this to work and must have the appropriate administrator rights.
        *
        * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {Number} senderChatId Unique identifier of the target user
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#unbanchatsenderchat
        */
      }, {
        key: "unbanChatSenderChat",
        value: function unbanChatSenderChat(chatId, senderChatId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.sender_chat_id = senderChatId;
          return this._request("unbanChatSenderChat", { form });
        }
        /**
         * Use this method to set default chat permissions for all members.
         *
         * The bot **must be an administrator in the group or a supergroup** for this to
         * work and **must have the `can_restrict_members` admin rights.**
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Array} chatPermissions New default chat permissions
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchatpermissions
         */
      }, {
        key: "setChatPermissions",
        value: function setChatPermissions(chatId, chatPermissions) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.permissions = stringify2(chatPermissions);
          return this._request("setChatPermissions", { form });
        }
        /**
         * Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Exported invite link as String on success.
         * @see https://core.telegram.org/bots/api#exportchatinvitelink
         */
      }, {
        key: "exportChatInviteLink",
        value: function exportChatInviteLink(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("exportChatInviteLink", { form });
        }
        /**
         * Use this method to create an additional invite link for a chat.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
         *
         * The link generated with this method can be revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink)
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Object} The new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
         * @see https://core.telegram.org/bots/api#createchatinvitelink
         */
      }, {
        key: "createChatInviteLink",
        value: function createChatInviteLink(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("createChatInviteLink", { form });
        }
        /**
         * Use this method to edit a non-primary invite link created by the bot.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} inviteLink Text with the invite link to edit
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} The edited invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
         * @see https://core.telegram.org/bots/api#editchatinvitelink
         */
      }, {
        key: "editChatInviteLink",
        value: function editChatInviteLink(chatId, inviteLink) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.invite_link = inviteLink;
          return this._request("editChatInviteLink", { form });
        }
        /**
         * Use this method to revoke an invite link created by the bot.
         * Note: If the primary link is revoked, a new link is automatically generated
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} inviteLink The invite link to revoke
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} The revoked invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
         * @see https://core.telegram.org/bots/api#revokechatinvitelink
         */
      }, {
        key: "revokeChatInviteLink",
        value: function revokeChatInviteLink(chatId, inviteLink) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.invite_link = inviteLink;
          return this._request("revokeChatInviteLink", { form });
        }
        /**
         * Use this method to approve a chat join request.
         *
         * The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right.**
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number} userId  Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#approvechatjoinrequest
         */
      }, {
        key: "approveChatJoinRequest",
        value: function approveChatJoinRequest(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("approveChatJoinRequest", { form });
        }
        /**
         * Use this method to decline a chat join request.
         *
         * The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right**.
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number} userId  Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#declinechatjoinrequest
         */
      }, {
        key: "declineChatJoinRequest",
        value: function declineChatJoinRequest(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("declineChatJoinRequest", { form });
        }
        /**
         * Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {stream.Stream|Buffer} photo A file path or a Stream.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchatphoto
         */
      }, {
        key: "setChatPhoto",
        value: function setChatPhoto(chatId, photo) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("photo", photo, fileOptions);
            opts.formData = sendData[0];
            opts.qs.photo = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("setChatPhoto", opts);
        }
        /**
        * Use this method to delete a chat photo. **Photos can't be changed for private chats**.
        *
        * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
        *
        * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#deletechatphoto
        */
      }, {
        key: "deleteChatPhoto",
        value: function deleteChatPhoto(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("deleteChatPhoto", { form });
        }
        /**
         * Use this method to change the title of a chat. **Titles can't be changed for private chats**.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} title New chat title, 1-255 characters
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchattitle
         */
      }, {
        key: "setChatTitle",
        value: function setChatTitle(chatId, title) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.title = title;
          return this._request("setChatTitle", { form });
        }
        /**
         * Use this method to change the description of a group, a supergroup or a channel.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} description New chat title, 0-255 characters
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchatdescription
         */
      }, {
        key: "setChatDescription",
        value: function setChatDescription(chatId, description) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.description = description;
          return this._request("setChatDescription", { form });
        }
        /**
         * Use this method to pin a message in a supergroup.
         *
         * If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
         * right in a supergroup or `can_edit_messages` administrator right in a channel.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Number} messageId Identifier of a message to pin
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#pinchatmessage
         */
      }, {
        key: "pinChatMessage",
        value: function pinChatMessage(chatId, messageId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_id = messageId;
          return this._request("pinChatMessage", { form });
        }
        /**
         * Use this method to remove a message from the list of pinned messages in a chat
         *
         * If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
         * right in a supergroup or `can_edit_messages` administrator right in a channel.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#unpinchatmessage
         */
      }, {
        key: "unpinChatMessage",
        value: function unpinChatMessage(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("unpinChatMessage", { form });
        }
        /**
        * Use this method to clear the list of pinned messages in a chat.
        *
        * If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
        * right in a supergroup or `can_edit_messages` administrator right in a channel.
        *
        * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#unpinallchatmessages
        */
      }, {
        key: "unpinAllChatMessages",
        value: function unpinAllChatMessages(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("unpinAllChatMessages", { form });
        }
        /**
         * Use this method for your bot to leave a group, supergroup or channel
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#leavechat
         */
      }, {
        key: "leaveChat",
        value: function leaveChat(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("leaveChat", { form });
        }
        /**
         * Use this method to get up to date information about the chat
         * (current name of the user for one-on-one conversations, current
         * username of a user, group or channel, etc.).
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or channel
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success
         * @see https://core.telegram.org/bots/api#getchat
         */
      }, {
        key: "getChat",
        value: function getChat2(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("getChat", { form });
        }
        /**
         * Use this method to get a list of administrators in a chat
         *
         * @param  {Number|String} chatId  Unique identifier for the target group or username of the target supergroup
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects that contains information about all chat administrators except other bots.
         * If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned
         * @see https://core.telegram.org/bots/api#getchatadministrators
         */
      }, {
        key: "getChatAdministrators",
        value: function getChatAdministrators(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("getChatAdministrators", { form });
        }
        /**
        * Use this method to get the number of members in a chat.
        *
        * @param  {Number|String} chatId  Unique identifier for the target group or username of the target supergroup
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} Int on success
        * @see https://core.telegram.org/bots/api#getchatmembercount
        */
      }, {
        key: "getChatMemberCount",
        value: function getChatMemberCount(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("getChatMemberCount", { form });
        }
        /**
         * Use this method to get information about a member of a chat.
         *
         * @param  {Number|String} chatId  Unique identifier for the target group or username of the target supergroup
         * @param  {Number} userId  Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} [ChatMember](https://core.telegram.org/bots/api#chatmember) object on success
         * @see https://core.telegram.org/bots/api#getchatmember
         */
      }, {
        key: "getChatMember",
        value: function getChatMember(chatId, userId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.user_id = userId;
          return this._request("getChatMember", { form });
        }
        /**
         * Use this method to set a new group sticker set for a supergroup.
         *
         * The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
         *
         * **Note:** Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
         *
         * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param  {String} stickerSetName Name of the sticker set to be set as the group sticker set
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchatstickerset
         */
      }, {
        key: "setChatStickerSet",
        value: function setChatStickerSet(chatId, stickerSetName) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.sticker_set_name = stickerSetName;
          return this._request("setChatStickerSet", { form });
        }
        /**
         * Use this method to delete a group sticker set from a supergroup.
         *
         * Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
         *
         * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#deletechatstickerset
         */
      }, {
        key: "deleteChatStickerSet",
        value: function deleteChatStickerSet(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("deleteChatStickerSet", { form });
        }
        /**
         * Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
         *
         * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects
         * @see https://core.telegram.org/bots/api#getforumtopiciconstickers
         */
      }, {
        key: "getForumTopicIconStickers",
        value: function getForumTopicIconStickers(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("getForumTopicIconStickers", { form });
        }
        /**
         * Use this method to create a topic in a forum supergroup chat.
         * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
         *
         * Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.
         *
         * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param  {String} name Topic name, 1-128 characters
         * @param  {Object} [options] Additional Telegram query options
         * @see https://core.telegram.org/bots/api#createforumtopic
         */
      }, {
        key: "createForumTopic",
        value: function createForumTopic(chatId, name) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.name = name;
          return this._request("createForumTopic", { form });
        }
        /**
         * Use this method to edit name and icon of a topic in a forum supergroup chat.
         * The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#editforumtopic
         */
      }, {
        key: "editForumTopic",
        value: function editForumTopic(chatId, messageThreadId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_thread_id = messageThreadId;
          return this._request("editForumTopic", { form });
        }
        /**
         * Use this method to close an open topic in a forum supergroup chat.
         * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#closeforumtopic
         */
      }, {
        key: "closeForumTopic",
        value: function closeForumTopic(chatId, messageThreadId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_thread_id = messageThreadId;
          return this._request("closeForumTopic", { form });
        }
        /**
         * Use this method to reopen a closed topic in a forum supergroup chat.
         * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#reopenforumtopic
         */
      }, {
        key: "reopenForumTopic",
        value: function reopenForumTopic(chatId, messageThreadId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_thread_id = messageThreadId;
          return this._request("reopenForumTopic", { form });
        }
        /**
         * Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
         * The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#deleteforumtopic
         */
      }, {
        key: "deleteForumTopic",
        value: function deleteForumTopic(chatId, messageThreadId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_thread_id = messageThreadId;
          return this._request("deleteForumTopic", { form });
        }
        /**
         * Use this method to clear the list of pinned messages in a forum topic.
         * The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
         */
      }, {
        key: "unpinAllForumTopicMessages",
        value: function unpinAllForumTopicMessages(chatId, messageThreadId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_thread_id = messageThreadId;
          return this._request("unpinAllForumTopicMessages", { form });
        }
        /**
        * Use this method to edit the name of the 'General' topic in a forum supergroup chat.
        * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
        * The topic will be automatically unhidden if it was hidden.
        *
        * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
        * @param {String} name New topic name, 1-128 characters
        * @param {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#editgeneralforumtopic
        */
      }, {
        key: "editGeneralForumTopic",
        value: function editGeneralForumTopic(chatId, name) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.name = name;
          return this._request("editGeneralForumTopic", { form });
        }
        /**
        * Use this method to close an open 'General' topic in a forum supergroup chat.
        * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
        * The topic will be automatically unhidden if it was hidden.
        *
        * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
        * @param {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#closegeneralforumtopic
        */
      }, {
        key: "closeGeneralForumTopic",
        value: function closeGeneralForumTopic(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("closeGeneralForumTopic", { form });
        }
        /**
        * Use this method to reopen a closed 'General' topic in a forum supergroup chat.
        * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
        * The topic will be automatically unhidden if it was hidden.
        *
        * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
        * @param {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#reopengeneralforumtopic
        */
      }, {
        key: "reopenGeneralForumTopic",
        value: function reopenGeneralForumTopic(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("reopenGeneralForumTopic", { form });
        }
        /**
        * Use this method to hide the 'General' topic in a forum supergroup chat.
        * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
        * The topic will be automatically closed if it was open.
        *
        * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
        * @param {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#hidegeneralforumtopic
        */
      }, {
        key: "hideGeneralForumTopic",
        value: function hideGeneralForumTopic(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("hideGeneralForumTopic", { form });
        }
        /**
         * Use this method to unhide the 'General' topic in a forum supergroup chat.
         * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
         */
      }, {
        key: "unhideGeneralForumTopic",
        value: function unhideGeneralForumTopic(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("unhideGeneralForumTopic", { form });
        }
        /**
         * Use this method to clear the list of pinned messages in a General forum topic.
         * The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
         *
         * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
         * @param {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
         */
      }, {
        key: "unpinAllGeneralForumTopicMessages",
        value: function unpinAllGeneralForumTopicMessages(chatId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.chat_id = chatId;
          return this._request("unhideGeneralForumTopic", { form });
        }
        /**
         * Use this method to send answers to callback queries sent from
         * [inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).
         *
         * The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
         *
         * This method has **older, compatible signatures ([1][answerCallbackQuery-v0.27.1])([2][answerCallbackQuery-v0.29.0])**
         * that are being deprecated.
         *
         * @param  {String} callbackQueryId Unique identifier for the query to be answered
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#answercallbackquery
         */
      }, {
        key: "answerCallbackQuery",
        value: function answerCallbackQuery(callbackQueryId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          if ((typeof form === "undefined" ? "undefined" : _typeof(form)) !== "object") {
            deprecate("The method signature answerCallbackQuery(callbackQueryId, text, showAlert) has been deprecated since v0.27.1");
            form = {
              callback_query_id: arguments[0],
              text: arguments[1],
              show_alert: arguments[2]
            };
          }
          if ((typeof callbackQueryId === "undefined" ? "undefined" : _typeof(callbackQueryId)) === "object") {
            deprecate("The method signature answerCallbackQuery([options]) has been deprecated since v0.29.0");
            form = callbackQueryId;
          } else {
            form.callback_query_id = callbackQueryId;
          }
          return this._request("answerCallbackQuery", { form });
        }
        /**
         * Use this method to get the list of boosts added to a chat by a use.
         * Requires administrator rights in the chat
         *
         * @param  {Number|String} chatId  Unique identifier for the group/channel
         * @param  {Number} user_id Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object
         * @see https://core.telegram.org/bots/api#getuserchatboosts
         */
      }, {
        key: "getUserChatBoosts",
        value: function getUserChatBoosts(chatId, pollId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_id = pollId;
          return this._request("getUserChatBoosts", { form });
        }
        /**
         * Use this method to get information about the connection of the bot with a business account
         *
         * @param  {Number|String} businessConnectionId  Unique identifier for the group/channel
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, returns [BusinessConnection](https://core.telegram.org/bots/api#businessconnection) object
         * @see https://core.telegram.org/bots/api#getbusinessconnection
         */
      }, {
        key: "getBusinessConnection",
        value: function getBusinessConnection(businessConnectionId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.business_connection_id = businessConnectionId;
          return this._request("getBusinessConnection", { form });
        }
        /**
         * Use this method to change the list of the bot's commands.
         *
         * See https://core.telegram.org/bots#commands for more details about bot commands
         *
         * @param  {Array} commands  List of bot commands to be set as the list of the [bot's commands](https://core.telegram.org/bots/api#botcommand). At most 100 commands can be specified.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setmycommands
         */
      }, {
        key: "setMyCommands",
        value: function setMyCommands(commands) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.commands = stringify2(commands);
          if (form.scope) {
            form.scope = stringify2(form.scope);
          }
          return this._request("setMyCommands", { form });
        }
        /**
         * Use this method to delete the list of the bot's commands for the given scope and user language.
         *
         *  After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#deletemycommands
         */
      }, {
        key: "deleteMyCommands",
        value: function deleteMyCommands() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("deleteMyCommands", { form });
        }
        /**
         * Use this method to get the current list of the bot's commands for the given scope and user language.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Array of [BotCommand](https://core.telegram.org/bots/api#botcommand) on success. If commands aren't set, an empty list is returned.
         * @see https://core.telegram.org/bots/api#getmycommands
         */
      }, {
        key: "getMyCommands",
        value: function getMyCommands() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          if (form.scope) {
            form.scope = stringify2(form.scope);
          }
          return this._request("getMyCommands", { form });
        }
        /**
         * Use this method to change the bot's name.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setmyname
         */
      }, {
        key: "setMyName",
        value: function setMyName() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("setMyName", { form });
        }
        /**
         * Use this method to get the current bot name for the given user language.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} [BotName](https://core.telegram.org/bots/api#botname) on success
         * @see https://core.telegram.org/bots/api#getmyname
         */
      }, {
        key: "getMyName",
        value: function getMyName() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getMyName", { form });
        }
        /**
         * Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
         *
         * Returns True on success.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setmydescription
         */
      }, {
        key: "setMyDescription",
        value: function setMyDescription() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("setMyDescription", { form });
        }
        /**
         * Use this method to get the current bot description for the given user language.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Returns [BotDescription](https://core.telegram.org/bots/api#botdescription) on success.
         * @see https://core.telegram.org/bots/api#getmydescription
         */
      }, {
        key: "getMyDescription",
        value: function getMyDescription() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getMyDescription", { form });
        }
        /**
         * Use this method to change the bot's short description, which is shown on the bot's profile page
         * and is sent together with the link when users share the bot.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Returns True on success.
         * @see https://core.telegram.org/bots/api#setmyshortdescription
         */
      }, {
        key: "setMyShortDescription",
        value: function setMyShortDescription() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("setMyShortDescription", { form });
        }
        /**
         * Use this method to get the current bot short description for the given user language.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success.
         * @see https://core.telegram.org/bots/api#getmyshortdescription
         */
      }, {
        key: "getMyShortDescription",
        value: function getMyShortDescription() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getMyShortDescription", { form });
        }
        /**
         * Use this method to change the bot's menu button in a private chat, or the default menu button.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setchatmenubutton
         */
      }, {
        key: "setChatMenuButton",
        value: function setChatMenuButton() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("setChatMenuButton", { form });
        }
        /**
         * Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} [MenuButton](https://core.telegram.org/bots/api#menubutton) on success
         * @see https://core.telegram.org/bots/api#getchatmenubutton
         */
      }, {
        key: "getChatMenuButton",
        value: function getChatMenuButton() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getChatMenuButton", { form });
        }
        /**
         * Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
         *
         * These rights will be suggested to users, but they are are free to modify the list before adding the bot.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#getchatmenubutton
         */
      }, {
        key: "setMyDefaultAdministratorRights",
        value: function setMyDefaultAdministratorRights() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("setMyDefaultAdministratorRights", { form });
        }
        /**
         * Use this method to get the current default administrator rights of the bot.
         *
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} [ChatAdministratorRights](https://core.telegram.org/bots/api#chatadministratorrights) on success
         * @see https://core.telegram.org/bots/api#getmydefaultadministratorrights
         */
      }, {
        key: "getMyDefaultAdministratorRights",
        value: function getMyDefaultAdministratorRights() {
          var form = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          return this._request("getMyDefaultAdministratorRights", { form });
        }
        /**
         * Use this method to edit text or [game](https://core.telegram.org/bots/api#games) messages sent by the bot or via the bot (for inline bots).
         *
         * Note: that **you must provide one of chat_id, message_id, or inline_message_id** in your request.
         *
         * @param  {String} text  New text of the message
         * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
         * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
         * @see https://core.telegram.org/bots/api#editmessagetext
         */
      }, {
        key: "editMessageText",
        value: function editMessageText(text) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.text = text;
          return this._request("editMessageText", { form });
        }
        /**
         * Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
         *
         * Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
         *
         * @param  {String} caption  New caption of the message
         * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
         * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
         * @see https://core.telegram.org/bots/api#editmessagecaption
         */
      }, {
        key: "editMessageCaption",
        value: function editMessageCaption(caption) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.caption = caption;
          return this._request("editMessageCaption", { form });
        }
        /**
         * Use this method to edit animation, audio, document, photo, or video messages.
         *
         * If a message is a part of a message album, then it can be edited only to a photo or a video.
         *
         * Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
         * Use previously uploaded file via its file_id or specify a URL.
         *
         * Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
         *
         * @param  {Object} media  A JSON-serialized object for a new media content of the message
         * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
         * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
         * @see https://core.telegram.org/bots/api#editmessagemedia
         */
      }, {
        key: "editMessageMedia",
        value: function editMessageMedia(media) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          var regexAttach = /attach:\/\/.+/;
          if (typeof media.media === "string" && regexAttach.test(media.media)) {
            var opts = {
              qs: form
            };
            opts.formData = {};
            var payload = Object.assign({}, media);
            delete payload.media;
            try {
              var attachName = String(0);
              var _formatSendData6 = this._formatSendData(attachName, media.media.replace("attach://", ""), media.fileOptions), _formatSendData7 = _slicedToArray(_formatSendData6, 1), formData = _formatSendData7[0];
              if (formData) {
                opts.formData[attachName] = formData[attachName];
                payload.media = "attach://" + attachName;
              } else {
                throw new errors.FatalError("Failed to process the replacement action for your " + media.type);
              }
            } catch (ex) {
              return Promise.reject(ex);
            }
            opts.qs.media = stringify2(payload);
            return this._request("editMessageMedia", opts);
          }
          form.media = stringify2(media);
          return this._request("editMessageMedia", { form });
        }
        /**
         * Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
         *
         * Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
         *
         * @param  {Object} replyMarkup  A JSON-serialized object for an inline keyboard.
         * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
         * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
         * @see https://core.telegram.org/bots/api#editmessagetext
         */
      }, {
        key: "editMessageReplyMarkup",
        value: function editMessageReplyMarkup(replyMarkup) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.reply_markup = replyMarkup;
          return this._request("editMessageReplyMarkup", { form });
        }
        /**
         * Use this method to stop a poll which was sent by the bot.
         *
         * @param  {Number|String} chatId  Unique identifier for the group/channel
         * @param  {Number} pollId Identifier of the original message with the poll
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the stopped [Poll](https://core.telegram.org/bots/api#poll) is returned
         * @see https://core.telegram.org/bots/api#stoppoll
         */
      }, {
        key: "stopPoll",
        value: function stopPoll(chatId, pollId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_id = pollId;
          return this._request("stopPoll", { form });
        }
        /**
         * Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
         * or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String|stream.Stream|Buffer} sticker A file path, Stream or Buffer.
         * Can also be a `file_id` previously uploaded. Stickers are WebP format files.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
         * @see https://core.telegram.org/bots/api#sendsticker
         */
      }, {
        key: "sendSticker",
        value: function sendSticker(chatId, sticker) {
          var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          var fileOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var opts = {
            qs: options
          };
          opts.qs.chat_id = chatId;
          try {
            var sendData = this._formatSendData("sticker", sticker, fileOptions);
            opts.formData = sendData[0];
            opts.qs.sticker = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("sendSticker", opts);
        }
        /**
         * Use this method to get a sticker set.
         *
         * @param  {String} name Name of the sticker set
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned
         * @see https://core.telegram.org/bots/api#getstickerset
         */
      }, {
        key: "getStickerSet",
        value: function getStickerSet(name) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.name = name;
          return this._request("getStickerSet", { form });
        }
        /**
         * Use this method to get information about custom emoji stickers by their identifiers.
         *
         * @param  {Array} custom_emoji_ids List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.
         * @see https://core.telegram.org/bots/api#getcustomemojistickers
         */
      }, {
        key: "getCustomEmojiStickers",
        value: function getCustomEmojiStickers(customEmojiIds) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.custom_emoji_ids = stringify2(customEmojiIds);
          return this._request("getCustomEmojiStickers", { form });
        }
        /**
         * Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
         * times).
         *
         * @param  {Number} userId User identifier of sticker file owner
         * @param  {String|stream.Stream|Buffer} sticker A file path or a Stream with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. Can also be a `file_id` previously uploaded.
         * @param {String} stickerFormat Allow values:  `static`, `animated` or `video`
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} On success, a [File](https://core.telegram.org/bots/api#file) object is returned
         * @see https://core.telegram.org/bots/api#uploadstickerfile
         */
      }, {
        key: "uploadStickerFile",
        value: function uploadStickerFile(userId, sticker) {
          var stickerFormat = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "static";
          var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var fileOptions = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {};
          var opts = {
            qs: options
          };
          opts.qs.user_id = userId;
          opts.qs.sticker_format = stickerFormat;
          try {
            var sendData = this._formatSendData("sticker", sticker, fileOptions);
            opts.formData = sendData[0];
            opts.qs.sticker = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("uploadStickerFile", opts);
        }
        /**
         * Use this method to create new sticker set owned by a user.
         *
         * The bot will be able to edit the created sticker set.
         *
         * You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
         *
         * @param  {Number} userId User identifier of created sticker set owner
         * @param  {String} name Short name of sticker set, to be used in `t.me/addstickers/` URLs (e.g.,   *"animals"*). Can contain only english letters, digits and underscores.
         *  Must begin with a letter, can't contain consecutive underscores and must end in `"_by_<bot_username>"`. `<bot_username>` is case insensitive. 1-64 characters.
         * @param  {String} title Sticker set title, 1-64 characters
         * @param  {String|stream.Stream|Buffer} pngSticker Png image with the sticker, must be up to 512 kilobytes in size,
         *  dimensions must not exceed 512px, and either width or height must be exactly 512px.
         * @param  {String} emojis One or more emoji corresponding to the sticker
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise}  True on success
         * @see https://core.telegram.org/bots/api#createnewstickerset
         */
      }, {
        key: "createNewStickerSet",
        value: function createNewStickerSet(userId, name, title, pngSticker, emojis) {
          var options = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
          var fileOptions = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : {};
          var opts = {
            qs: options
          };
          opts.qs.user_id = userId;
          opts.qs.name = name;
          opts.qs.title = title;
          opts.qs.emojis = emojis;
          opts.qs.mask_position = stringify2(options.mask_position);
          try {
            var sendData = this._formatSendData("png_sticker", pngSticker, fileOptions);
            opts.formData = sendData[0];
            opts.qs.png_sticker = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("createNewStickerSet", opts);
        }
        /**
         * Use this method to add a new sticker to a set created by the bot.
         *
         * You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
         *
         * Animated stickers can be added to animated sticker sets and only to them
         *
         * Note:
         * - Emoji sticker sets can have up to 200 sticker
         * - Static or Animated sticker sets can have up to 120 stickers
         *
         * @param  {Number} userId User identifier of sticker set owner
         * @param  {String} name Sticker set name
         * @param  {String|stream.Stream|Buffer} sticker Png image with the sticker (must be up to 512 kilobytes in size,
         * dimensions must not exceed 512px, and either width or height must be exactly 512px, [TGS animation](https://core.telegram.org/stickers#animated-sticker-requirements)
         * with the sticker or [WEBM video](https://core.telegram.org/stickers#video-sticker-requirements) with the sticker.
         * @param  {String} emojis One or more emoji corresponding to the sticker
         * @param  {String} stickerType Allow values: `png_sticker`, `tgs_sticker`, or `webm_sticker`.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise}  True on success
         * @see https://core.telegram.org/bots/api#addstickertoset
         */
      }, {
        key: "addStickerToSet",
        value: function addStickerToSet(userId, name, sticker, emojis) {
          var stickerType = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "png_sticker";
          var options = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
          var fileOptions = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : {};
          var opts = {
            qs: options
          };
          opts.qs.user_id = userId;
          opts.qs.name = name;
          opts.qs.emojis = emojis;
          opts.qs.mask_position = stringify2(options.mask_position);
          if (typeof stickerType !== "string" || ["png_sticker", "tgs_sticker", "webm_sticker"].indexOf(stickerType) === -1) {
            return Promise.reject(new Error("stickerType must be a string and the allow types is: png_sticker, tgs_sticker, webm_sticker"));
          }
          try {
            var sendData = this._formatSendData(stickerType, sticker, fileOptions);
            opts.formData = sendData[0];
            opts.qs[stickerType] = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("addStickerToSet", opts);
        }
        /**
         * Use this method to move a sticker in a set created by the bot to a specific position.
         *
         * @param  {String} sticker File identifier of the sticker
         * @param  {Number} position New sticker position in the set, zero-based
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setstickerpositioninset
         */
      }, {
        key: "setStickerPositionInSet",
        value: function setStickerPositionInSet(sticker, position) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.sticker = sticker;
          form.position = position;
          return this._request("setStickerPositionInSet", { form });
        }
        /**
         * Use this method to delete a sticker from a set created by the bot.
         *
         * @param  {String} sticker File identifier of the sticker
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#deletestickerfromset
         * @todo Add tests for this method!
         */
      }, {
        key: "deleteStickerFromSet",
        value: function deleteStickerFromSet(sticker) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.sticker = sticker;
          return this._request("deleteStickerFromSet", { form });
        }
        /**
         * Use this method to replace an existing sticker in a sticker set with a new one
         *
         * @param  {Number} user_id User identifier of the sticker set owner
         * @param  {String} name Sticker set name
         * @param  {String} sticker File identifier of the sticker
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#replacestickerinset
         * @todo Add tests for this method!
         */
      }, {
        key: "replaceStickerInSet",
        value: function replaceStickerInSet(userId, name, oldSticker) {
          var form = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          form.user_id = userId;
          form.name = name;
          form.old_sticker = oldSticker;
          return this._request("deleteStickerFromSet", { form });
        }
        /**
         * Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
         *
         * The sticker must belong to a sticker set created by the bot.
         *
         * @param  {String} sticker File identifier of the sticker
         * @param { Array } emojiList A JSON-serialized list of 1-20 emoji associated with the sticker
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setstickeremojilist
         */
      }, {
        key: "setStickerEmojiList",
        value: function setStickerEmojiList(sticker, emojiList) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.sticker = sticker;
          form.emoji_list = stringify2(emojiList);
          return this._request("setStickerEmojiList", { form });
        }
        /**
         * Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.
         *
         * The sticker must belong to a sticker set created by the bot.
         *
         * @param  {String} sticker File identifier of the sticker
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setstickerkeywords
         */
      }, {
        key: "setStickerKeywords",
        value: function setStickerKeywords(sticker) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.sticker = sticker;
          if (form.keywords) {
            form.keywords = stringify2(form.keywords);
          }
          return this._request("setStickerKeywords", { form });
        }
        /**
         * Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.
         *
         * The sticker must belong to a sticker set created by the bot.
         *
         * @param  {String} sticker File identifier of the sticker
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setstickermaskposition
         */
      }, {
        key: "setStickerMaskPosition",
        value: function setStickerMaskPosition(sticker) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.sticker = sticker;
          if (form.mask_position) {
            form.mask_position = stringify2(form.mask_position);
          }
          return this._request("setStickerMaskPosition", { form });
        }
        /**
         * Use this method to set the title of a created sticker set.
         *
         * The sticker must belong to a sticker set created by the bot.
         *
         * @param  {String} name Sticker set name
         * @param  {String} title Sticker set title, 1-64 characters
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setstickersettitle
         */
      }, {
        key: "setStickerSetTitle",
        value: function setStickerSetTitle(name, title) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.name = name;
          form.title = title;
          return this._request("setStickerSetTitle", { form });
        }
        /**
         * Use this method to add a thumb to a set created by the bot.
         *
         * Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only
         *
         * @param  {Number} userId User identifier of sticker set owner
         * @param  {String} name Sticker set name
         * @param  {String|stream.Stream|Buffer} thumbnail A .WEBP or .PNG image with the thumbnail,
         * must be up to 128 kilobytes in size and have width and height exactly 100px,
         * a TGS animation with the thumbnail up to 32 kilobytes in size or a WEBM video with the thumbnail up to 32 kilobytes in size.
         *
         * Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram
         * to get a file from the Internet, or upload a new one. Animated sticker set thumbnails can't be uploaded via HTTP URL.
         * @param  {Object} [options] Additional Telegram query options
         * @param  {Object} [fileOptions] Optional file related meta-data
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setstickersetthumbnail
         */
      }, {
        key: "setStickerSetThumbnail",
        value: function setStickerSetThumbnail(userId, name, thumbnail) {
          var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
          var fileOptions = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {};
          var opts = {
            qs: options
          };
          opts.qs.user_id = userId;
          opts.qs.name = name;
          opts.qs.mask_position = stringify2(options.mask_position);
          try {
            var sendData = this._formatSendData("thumbnail", thumbnail, fileOptions);
            opts.formData = sendData[0];
            opts.qs.thumbnail = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
          return this._request("setStickerSetThumbnail", opts);
        }
        /**
         * Use this method to set the thumbnail of a custom emoji sticker set.
         *
         * The sticker must belong to a sticker set created by the bot.
         *
         * @param  {String} name Sticker set name
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
         */
      }, {
        key: "setCustomEmojiStickerSetThumbnail",
        value: function setCustomEmojiStickerSetThumbnail(name) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.name = name;
          return this._request("setCustomEmojiStickerSetThumbnail", { form });
        }
        /**
         * Use this method to delete a sticker set that was created by the bot.
         *
         * The sticker must belong to a sticker set created by the bot.
         *
         * @param  {String} name Sticker set name
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} True on success
         * @see https://core.telegram.org/bots/api#deletestickerset
         */
      }, {
        key: "deleteStickerSet",
        value: function deleteStickerSet(name) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.name = name;
          return this._request("deleteStickerSet", { form });
        }
        /**
         * Send answers to an inline query.
         *
         * Note: No more than 50 results per query are allowed.
         *
         * @param  {String} inlineQueryId Unique identifier of the query
         * @param  {InlineQueryResult[]} results An array of results for the inline query
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, True is returned
         * @see https://core.telegram.org/bots/api#answerinlinequery
         */
      }, {
        key: "answerInlineQuery",
        value: function answerInlineQuery(inlineQueryId, results) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.inline_query_id = inlineQueryId;
          form.results = stringify2(results);
          return this._request("answerInlineQuery", { form });
        }
        /**
         * Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
         * and send a corresponding message on behalf of the user to the chat from which the query originated.
         *
         * @param  {String} webAppQueryId Unique identifier for the query to be answered
         * @param  {InlineQueryResult} result object that represents one result of an inline query
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, a [SentWebAppMessage](https://core.telegram.org/bots/api#sentwebappmessage) object is returned
         * @see https://core.telegram.org/bots/api#answerwebappquery
         */
      }, {
        key: "answerWebAppQuery",
        value: function answerWebAppQuery(webAppQueryId, result) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.web_app_query_id = webAppQueryId;
          form.result = stringify2(result);
          return this._request("answerWebAppQuery", { form });
        }
        /**
         * Use this method to send an invoice.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} title Product name, 1-32 characters
         * @param  {String} description Product description, 1-255 characters
         * @param  {String} payload Bot defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
         * @param  {String} providerToken Payments provider token, obtained via `@BotFather`
         * @param  {String} currency Three-letter ISO 4217 currency code
         * @param  {Array} prices Breakdown of prices
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
         * @see https://core.telegram.org/bots/api#sendinvoice
         */
      }, {
        key: "sendInvoice",
        value: function sendInvoice(chatId, title, description, payload, providerToken, currency, prices) {
          var form = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : {};
          form.chat_id = chatId;
          form.title = title;
          form.description = description;
          form.payload = payload;
          form.provider_token = providerToken;
          form.currency = currency;
          form.prices = stringify2(prices);
          form.provider_data = stringify2(form.provider_data);
          if (form.suggested_tip_amounts) {
            form.suggested_tip_amounts = stringify2(form.suggested_tip_amounts);
          }
          return this._request("sendInvoice", { form });
        }
        /**
        * Use this method to create a link for an invoice.
        *
        * @param {String} title Product name, 1-32 characters
        * @param {String} description Product description, 1-255 characters
        * @param {String} payload Bot defined invoice payload
        * @param {String} providerToken Payment provider token
        * @param {String} currency Three-letter ISO 4217 currency code
        * @param {Array} prices Breakdown of prices
        * @param {Object} [options] Additional Telegram query options
        * @returns {Promise} The created invoice link as String on success.
        * @see https://core.telegram.org/bots/api#createinvoicelink
        */
      }, {
        key: "createInvoiceLink",
        value: function createInvoiceLink(title, description, payload, providerToken, currency, prices) {
          var form = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : {};
          form.title = title;
          form.description = description;
          form.payload = payload;
          form.provider_token = providerToken;
          form.currency = currency;
          form.prices = stringify2(prices);
          return this._request("createInvoiceLink", { form });
        }
        /**
        * Use this method to reply to shipping queries.
        *
        * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
        * the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a shipping_query field to the bot
        *
        * @param  {String} shippingQueryId  Unique identifier for the query to be answered
        * @param  {Boolean} ok Specify if delivery of the product is possible
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} On success, True is returned
        * @see https://core.telegram.org/bots/api#answershippingquery
        */
      }, {
        key: "answerShippingQuery",
        value: function answerShippingQuery(shippingQueryId, ok) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.shipping_query_id = shippingQueryId;
          form.ok = ok;
          form.shipping_options = stringify2(form.shipping_options);
          return this._request("answerShippingQuery", { form });
        }
        /**
         * Use this method to respond to such pre-checkout queries
         *
         * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of
         * an [Update](https://core.telegram.org/bots/api#update) with the field *pre_checkout_query*.
         *
         * **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
         *
         * @param  {String} preCheckoutQueryId  Unique identifier for the query to be answered
         * @param  {Boolean} ok Specify if every order details are ok
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, True is returned
         * @see https://core.telegram.org/bots/api#answerprecheckoutquery
         */
      }, {
        key: "answerPreCheckoutQuery",
        value: function answerPreCheckoutQuery(preCheckoutQueryId, ok) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.pre_checkout_query_id = preCheckoutQueryId;
          form.ok = ok;
          return this._request("answerPreCheckoutQuery", { form });
        }
        /**
         * Use this method to send a game.
         *
         * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
         * @param  {String} gameShortName name of the game to be sent. Set up your games via `@BotFather`.
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
         * @see https://core.telegram.org/bots/api#sendgame
         */
      }, {
        key: "sendGame",
        value: function sendGame(chatId, gameShortName) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.game_short_name = gameShortName;
          return this._request("sendGame", { form });
        }
        /**
         * Use this method to set the score of the specified user in a game message.
         *
         * @param  {Number} userId  Unique identifier of the target user
         * @param  {Number} score New score value, must be non-negative
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, if the message is not an inline message, the [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
         * @see https://core.telegram.org/bots/api#setgamescore
         */
      }, {
        key: "setGameScore",
        value: function setGameScore(userId, score) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.user_id = userId;
          form.score = score;
          return this._request("setGameScore", { form });
        }
        /**
         * Use this method to get data for high score tables.
         *
         * Will return the score of the specified user and several of their neighbors in a game.
         *
         * @param  {Number} userId  Unique identifier of the target user
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise} On success, returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects
         * @see https://core.telegram.org/bots/api#getgamehighscores
         */
      }, {
        key: "getGameHighScores",
        value: function getGameHighScores(userId) {
          var form = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          form.user_id = userId;
          return this._request("getGameHighScores", { form });
        }
        /**
        * Use this method to delete a message, including service messages, with the following limitations:
        * - A message can only be deleted if it was sent less than 48 hours ago.
        * - A dice message can only be deleted if it was sent more than 24 hours ago.
        * - Bots can delete outgoing messages in groups and supergroups.
        * - Bots can delete incoming messages in groups, supergroups and channels.
        * - Bots granted `can_post_messages` permissions can delete outgoing messages in channels.
        * - If the bot is an administrator of a group, it can delete any message there.
        * - If the bot has `can_delete_messages` permission in a supergroup, it can delete any message there.
        *
        * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format @channelusername)
        * @param  {Number} messageId  Unique identifier of the target message
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success
        * @see https://core.telegram.org/bots/api#deletemessage
        */
      }, {
        key: "deleteMessage",
        value: function deleteMessage(chatId, messageId) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_id = messageId;
          return this._request("deleteMessage", { form });
        }
        /**
         * Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
         *
         * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format @channelusername)
         * @param  {Array<Number|String>} messageIds  Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted
         * @param  {Object} [options] Additional Telegram query options
         * @return {Promise<Boolean>} True on success
         * @see https://core.telegram.org/bots/api#deletemessages
         */
      }, {
        key: "deleteMessages",
        value: function deleteMessages(chatId, messageIds) {
          var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          form.chat_id = chatId;
          form.message_ids = stringify2(messageIds);
          return this._request("deleteMessages", { form });
        }
      }]);
      return TelegramBot3;
    }(EventEmitter);
    module2.exports = TelegramBot2;
  }
});

// node_modules/node-telegram-bot-api/src/errors.js
var require_errors7 = __commonJS({
  "node_modules/node-telegram-bot-api/src/errors.js"(exports2) {
    exports2.BaseError = class BaseError extends Error {
      /**
       * @class BaseError
       * @constructor
       * @private
       * @param  {String} code Error code
       * @param  {String} message Error message
       */
      constructor(code, message) {
        super(`${code}: ${message}`);
        this.code = code;
      }
      toJSON() {
        return {
          code: this.code,
          message: this.message
        };
      }
    };
    exports2.FatalError = class FatalError extends exports2.BaseError {
      /**
       * Fatal Error. Error code is `"EFATAL"`.
       * @class FatalError
       * @constructor
       * @param  {String|Error} data Error object or message
       */
      constructor(data) {
        const error = typeof data === "string" ? null : data;
        const message = error ? error.message : data;
        super("EFATAL", message);
        if (error)
          this.stack = error.stack;
      }
    };
    exports2.ParseError = class ParseError extends exports2.BaseError {
      /**
       * Error during parsing. Error code is `"EPARSE"`.
       * @class ParseError
       * @constructor
       * @param  {String} message Error message
       * @param  {http.IncomingMessage} response Server response
       */
      constructor(message, response) {
        super("EPARSE", message);
        this.response = response;
      }
    };
    exports2.TelegramError = class TelegramError extends exports2.BaseError {
      /**
       * Error returned from Telegram. Error code is `"ETELEGRAM"`.
       * @class TelegramError
       * @constructor
       * @param  {String} message Error message
       * @param  {http.IncomingMessage} response Server response
       */
      constructor(message, response) {
        super("ETELEGRAM", message);
        this.response = response;
      }
    };
  }
});

// node_modules/node-telegram-bot-api/src/telegramWebHook.js
var require_telegramWebHook2 = __commonJS({
  "node_modules/node-telegram-bot-api/src/telegramWebHook.js"(exports2, module2) {
    var errors = require_errors7();
    var debug = require_browser3()("node-telegram-bot-api");
    var https = require("https");
    var http = require("http");
    var fs = require("fs");
    var bl = require_bl();
    var TelegramBotWebHook = class {
      /**
       * Sets up a webhook to receive updates
       * @param  {TelegramBot} bot
       * @see https://core.telegram.org/bots/api#getting-updates
       */
      constructor(bot) {
        this.bot = bot;
        this.options = typeof bot.options.webHook === "boolean" ? {} : bot.options.webHook;
        this.options.host = this.options.host || "0.0.0.0";
        this.options.port = this.options.port || 8443;
        this.options.https = this.options.https || {};
        this.options.healthEndpoint = this.options.healthEndpoint || "/healthz";
        this._healthRegex = new RegExp(this.options.healthEndpoint);
        this._webServer = null;
        this._open = false;
        this._requestListener = this._requestListener.bind(this);
        this._parseBody = this._parseBody.bind(this);
        if (this.options.key && this.options.cert) {
          debug("HTTPS WebHook enabled (by key/cert)");
          this.options.https.key = fs.readFileSync(this.options.key);
          this.options.https.cert = fs.readFileSync(this.options.cert);
          this._webServer = https.createServer(this.options.https, this._requestListener);
        } else if (this.options.pfx) {
          debug("HTTPS WebHook enabled (by pfx)");
          this.options.https.pfx = fs.readFileSync(this.options.pfx);
          this._webServer = https.createServer(this.options.https, this._requestListener);
        } else if (Object.keys(this.options.https).length) {
          debug("HTTPS WebHook enabled by (https)");
          this._webServer = https.createServer(this.options.https, this._requestListener);
        } else {
          debug("HTTP WebHook enabled");
          this._webServer = http.createServer(this._requestListener);
        }
      }
      /**
       * Open WebHook by listening on the port
       * @return {Promise}
       */
      open() {
        if (this.isOpen()) {
          return Promise.resolve();
        }
        return new Promise((resolve, reject) => {
          this._webServer.listen(this.options.port, this.options.host, () => {
            debug("WebHook listening on port %s", this.options.port);
            this._open = true;
            return resolve();
          });
          this._webServer.once("error", (err) => {
            reject(err);
          });
        });
      }
      /**
       * Close the webHook
       * @return {Promise}
       */
      close() {
        if (!this.isOpen()) {
          return Promise.resolve();
        }
        return new Promise((resolve, reject) => {
          this._webServer.close((error) => {
            if (error)
              return reject(error);
            this._open = false;
            return resolve();
          });
        });
      }
      /**
       * Return `true` if server is listening. Otherwise, `false`.
       */
      isOpen() {
        return this._open;
      }
      /**
       * Handle error thrown during processing of webhook request.
       * @private
       * @param  {Error} error
       */
      _error(error) {
        if (!this.bot.listeners("webhook_error").length) {
          return console.error("error: [webhook_error] %j", error);
        }
        return this.bot.emit("webhook_error", error);
      }
      /**
       * Handle request body by passing it to 'callback'
       * @private
       */
      _parseBody(error, body) {
        if (error) {
          return this._error(new errors.FatalError(error));
        }
        let data;
        try {
          data = JSON.parse(body.toString());
        } catch (parseError) {
          return this._error(new errors.ParseError(parseError.message));
        }
        return this.bot.processUpdate(data);
      }
      /**
       * Listener for 'request' event on server
       * @private
       * @see https://nodejs.org/docs/latest/api/http.html#http_http_createserver_requestlistener
       * @see https://nodejs.org/docs/latest/api/https.html#https_https_createserver_options_requestlistener
       */
      _requestListener(req, res) {
        debug("WebHook request URL: %s", req.url);
        debug("WebHook request headers: %j", req.headers);
        if (req.url.indexOf(this.bot.token) !== -1) {
          if (req.method !== "POST") {
            debug("WebHook request isn't a POST");
            res.statusCode = 418;
            res.end();
          } else {
            req.pipe(bl(this._parseBody)).on("finish", () => res.end("OK"));
          }
        } else if (this._healthRegex.test(req.url)) {
          debug("WebHook health check passed");
          res.statusCode = 200;
          res.end("OK");
        } else {
          debug("WebHook request unauthorized");
          res.statusCode = 401;
          res.end();
        }
      }
    };
    module2.exports = TelegramBotWebHook;
  }
});

// node_modules/node-telegram-bot-api/src/telegramPolling.js
var require_telegramPolling2 = __commonJS({
  "node_modules/node-telegram-bot-api/src/telegramPolling.js"(exports2, module2) {
    var errors = require_errors7();
    var debug = require_browser3()("node-telegram-bot-api");
    var deprecate = require_utils4().deprecate;
    var ANOTHER_WEB_HOOK_USED = 409;
    var TelegramBotPolling = class {
      /**
       * Handles polling against the Telegram servers.
       * @param  {TelegramBot} bot
       * @see https://core.telegram.org/bots/api#getting-updates
       */
      constructor(bot) {
        this.bot = bot;
        this.options = typeof bot.options.polling === "boolean" ? {} : bot.options.polling;
        this.options.interval = typeof this.options.interval === "number" ? this.options.interval : 300;
        this.options.params = typeof this.options.params === "object" ? this.options.params : {};
        this.options.params.offset = typeof this.options.params.offset === "number" ? this.options.params.offset : 0;
        this.options.params.timeout = typeof this.options.params.timeout === "number" ? this.options.params.timeout : 10;
        if (typeof this.options.timeout === "number") {
          deprecate("`options.polling.timeout` is deprecated. Use `options.polling.params` instead.");
          this.options.params.timeout = this.options.timeout;
        }
        this._lastUpdate = 0;
        this._lastRequest = null;
        this._abort = false;
        this._pollingTimeout = null;
      }
      /**
       * Start polling
       * @param  {Object} [options]
       * @param  {Object} [options.restart]
       * @return {Promise}
       */
      start(options = {}) {
        if (this._lastRequest) {
          if (!options.restart) {
            return Promise.resolve();
          }
          return this.stop({
            cancel: true,
            reason: "Polling restart"
          }).then(() => {
            return this._polling();
          });
        }
        return this._polling();
      }
      /**
       * Stop polling
       * @param  {Object} [options] Options
       * @param  {Boolean} [options.cancel] Cancel current request
       * @param  {String} [options.reason] Reason for stopping polling
       * @return {Promise}
       */
      stop(options = {}) {
        if (!this._lastRequest) {
          return Promise.resolve();
        }
        const lastRequest = this._lastRequest;
        this._lastRequest = null;
        clearTimeout(this._pollingTimeout);
        if (options.cancel) {
          const reason = options.reason || "Polling stop";
          lastRequest.cancel(reason);
          return Promise.resolve();
        }
        this._abort = true;
        return lastRequest.finally(() => {
          this._abort = false;
        });
      }
      /**
       * Return `true` if is polling. Otherwise, `false`.
       */
      isPolling() {
        return !!this._lastRequest;
      }
      /**
       * Handle error thrown during polling.
       * @private
       * @param  {Error} error
       */
      _error(error) {
        if (!this.bot.listeners("polling_error").length) {
          return console.error("error: [polling_error] %j", error);
        }
        return this.bot.emit("polling_error", error);
      }
      /**
       * Invokes polling (with recursion!)
       * @return {Promise} promise of the current request
       * @private
       */
      _polling() {
        this._lastRequest = this._getUpdates().then((updates) => {
          this._lastUpdate = Date.now();
          debug("polling data %j", updates);
          updates.forEach((update) => {
            this.options.params.offset = update.update_id + 1;
            debug("updated offset: %s", this.options.params.offset);
            try {
              this.bot.processUpdate(update);
            } catch (err) {
              err._processing = true;
              throw err;
            }
          });
          return null;
        }).catch((err) => {
          debug("polling error: %s", err.message);
          if (!err._processing) {
            return this._error(err);
          }
          delete err._processing;
          if (!this.bot.options.badRejection) {
            return this._error(err);
          }
          const opts = {
            offset: this.options.params.offset,
            limit: 1,
            timeout: 0
          };
          return this.bot.getUpdates(opts).then(() => {
            return this._error(err);
          }).catch((requestErr) => {
            const bugUrl = "https://github.com/yagop/node-telegram-bot-api/issues/36#issuecomment-268532067";
            console.error("error: Internal handling of The Offset Infinite Loop failed");
            console.error(`error: Due to error '${requestErr}'`);
            console.error("error: You may receive already-processed updates on app restart");
            console.error(`error: Please see ${bugUrl} for more information`);
            return this.bot.emit("error", new errors.FatalError(err));
          });
        }).finally(() => {
          if (this._abort) {
            debug("Polling is aborted!");
          } else {
            debug("setTimeout for %s miliseconds", this.options.interval);
            this._pollingTimeout = setTimeout(() => this._polling(), this.options.interval);
          }
        });
        return this._lastRequest;
      }
      /**
       * Unset current webhook. Used when we detect that a webhook has been set
       * and we are trying to poll. Polling and WebHook are mutually exclusive.
       * @see https://core.telegram.org/bots/api#getting-updates
       * @private
       */
      _unsetWebHook() {
        debug("unsetting webhook");
        return this.bot._request("setWebHook");
      }
      /**
       * Retrieve updates
       */
      _getUpdates() {
        debug("polling with options: %j", this.options.params);
        return this.bot.getUpdates(this.options.params).catch((err) => {
          if (err.response && err.response.statusCode === ANOTHER_WEB_HOOK_USED) {
            return this._unsetWebHook().then(() => {
              return this.bot.getUpdates(this.options.params);
            });
          }
          throw err;
        });
      }
    };
    module2.exports = TelegramBotPolling;
  }
});

// node_modules/node-telegram-bot-api/src/telegram.js
var require_telegram3 = __commonJS({
  "node_modules/node-telegram-bot-api/src/telegram.js"(exports2, module2) {
    require_array_prototype().shim();
    var errors = require_errors7();
    var TelegramBotWebHook = require_telegramWebHook2();
    var TelegramBotPolling = require_telegramPolling2();
    var debug = require_browser3()("node-telegram-bot-api");
    var EventEmitter = require_eventemitter3();
    var fileType = require_file_type();
    var request = require_rp();
    var streamedRequest = require_request3();
    var qs = require("querystring");
    var stream = require("stream");
    var mime = require_mime2();
    var path4 = require("path");
    var URL3 = require("url");
    var fs = require("fs");
    var pump = require_pump();
    var deprecate = require_utils4().deprecate;
    var _messageTypes = [
      "text",
      "animation",
      "audio",
      "channel_chat_created",
      "contact",
      "delete_chat_photo",
      "dice",
      "document",
      "game",
      "group_chat_created",
      "invoice",
      "left_chat_member",
      "location",
      "migrate_from_chat_id",
      "migrate_to_chat_id",
      "new_chat_members",
      "new_chat_photo",
      "new_chat_title",
      "passport_data",
      "photo",
      "pinned_message",
      "poll",
      "sticker",
      "successful_payment",
      "supergroup_chat_created",
      "video",
      "video_note",
      "voice",
      "video_chat_started",
      "video_chat_ended",
      "video_chat_participants_invited",
      "video_chat_scheduled",
      "message_auto_delete_timer_changed",
      "chat_invite_link",
      "chat_member_updated",
      "web_app_data",
      "message_reaction"
    ];
    var _deprecatedMessageTypes = [
      "new_chat_participant",
      "left_chat_participant"
    ];
    function stringify2(data) {
      if (typeof data === "string") {
        return data;
      }
      return JSON.stringify(data);
    }
    var TelegramBot2 = class extends EventEmitter {
      /**
       * The different errors the library uses.
       * @type {Object}
       */
      static get errors() {
        return errors;
      }
      /**
       * The types of message updates the library handles.
       * @type {String[]}
       */
      static get messageTypes() {
        return _messageTypes;
      }
      /**
       * Add listener for the specified [event](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events).
       * This is the usual `emitter.on()` method.
       * @param  {String} event
       * @param  {Function} listener
       * @see {@link https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events|Available events}
       * @see https://nodejs.org/api/events.html#events_emitter_on_eventname_listener
       */
      on(event, listener) {
        if (_deprecatedMessageTypes.indexOf(event) !== -1) {
          const url = "https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events";
          deprecate(`Events ${_deprecatedMessageTypes.join(",")} are deprecated. See the updated list of events: ${url}`);
        }
        super.on(event, listener);
      }
      /**
       * Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
       * on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
       * Emits `message` when a message arrives.
       *
       * @class TelegramBot
       * @constructor
       * @param {String} token Bot Token
       * @param {Object} [options]
       * @param {Boolean|Object} [options.polling=false] Set true to enable polling or set options.
       *  If a WebHook has been set, it will be deleted automatically.
       * @param {String|Number} [options.polling.timeout=10] *Deprecated. Use `options.polling.params` instead*.
       *  Timeout in seconds for long polling.
       * @param {Boolean} [options.testEnvironment=false] Set true to  work with test enviroment.
       * When working with the test environment, you may use HTTP links without TLS to test your Web App.
       * @param {String|Number} [options.polling.interval=300] Interval between requests in miliseconds
       * @param {Boolean} [options.polling.autoStart=true] Start polling immediately
       * @param {Object} [options.polling.params] Parameters to be used in polling API requests.
       *  See https://core.telegram.org/bots/api#getupdates for more information.
       * @param  {Number} [options.polling.params.timeout=10] Timeout in seconds for long polling.
       * @param {Boolean|Object} [options.webHook=false] Set true to enable WebHook or set options
       * @param {String} [options.webHook.host="0.0.0.0"] Host to bind to
       * @param {Number} [options.webHook.port=8443] Port to bind to
       * @param {String} [options.webHook.key] Path to file with PEM private key for webHook server.
       *  The file is read **synchronously**!
       * @param {String} [options.webHook.cert] Path to file with PEM certificate (public) for webHook server.
       *  The file is read **synchronously**!
       * @param {String} [options.webHook.pfx] Path to file with PFX private key and certificate chain for webHook server.
       *  The file is read **synchronously**!
       * @param {Boolean} [options.webHook.autoOpen=true] Open webHook immediately
       * @param {Object} [options.webHook.https] Options to be passed to `https.createServer()`.
       *  Note that `options.webHook.key`, `options.webHook.cert` and `options.webHook.pfx`, if provided, will be
       *  used to override `key`, `cert` and `pfx` in this object, respectively.
       *  See https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener for more information.
       * @param {String} [options.webHook.healthEndpoint="/healthz"] An endpoint for health checks that always responds with 200 OK
       * @param {Boolean} [options.onlyFirstMatch=false] Set to true to stop after first match. Otherwise, all regexps are executed
       * @param {Object} [options.request] Options which will be added for all requests to telegram api.
       *  See https://github.com/request/request#requestoptions-callback for more information.
       * @param {String} [options.baseApiUrl="https://api.telegram.org"] API Base URl; useful for proxying and testing
       * @param {Boolean} [options.filepath=true] Allow passing file-paths as arguments when sending files,
       *  such as photos using `TelegramBot#sendPhoto()`. See [usage information][usage-sending-files-performance]
       *  for more information on this option and its consequences.
       * @param {Boolean} [options.badRejection=false] Set to `true`
       *  **if and only if** the Node.js version you're using terminates the
       *  process on unhandled rejections. This option is only for
       *  *forward-compatibility purposes*.
       * @see https://core.telegram.org/bots/api
       */
      constructor(token, options = {}) {
        super();
        this.token = token;
        this.options = options;
        this.options.polling = typeof options.polling === "undefined" ? false : options.polling;
        this.options.webHook = typeof options.webHook === "undefined" ? false : options.webHook;
        this.options.baseApiUrl = options.baseApiUrl || "https://api.telegram.org";
        this.options.filepath = typeof options.filepath === "undefined" ? true : options.filepath;
        this.options.badRejection = typeof options.badRejection === "undefined" ? false : options.badRejection;
        this._textRegexpCallbacks = [];
        this._replyListenerId = 0;
        this._replyListeners = [];
        this._polling = null;
        this._webHook = null;
        if (options.polling) {
          const autoStart = options.polling.autoStart;
          if (typeof autoStart === "undefined" || autoStart === true) {
            this.startPolling();
          }
        }
        if (options.webHook) {
          const autoOpen = options.webHook.autoOpen;
          if (typeof autoOpen === "undefined" || autoOpen === true) {
            this.openWebHook();
          }
        }
      }
      /**
       * Generates url with bot token and provided path/method you want to be got/executed by bot
       * @param  {String} path
       * @return {String} url
       * @private
       * @see https://core.telegram.org/bots/api#making-requests
       */
      _buildURL(_path) {
        return `${this.options.baseApiUrl}/bot${this.token}${this.options.testEnvironment ? "/test" : ""}/${_path}`;
      }
      /**
       * Fix 'reply_markup' parameter by making it JSON-serialized, as
       * required by the Telegram Bot API
       * @param {Object} obj Object; either 'form' or 'qs'
       * @private
       * @see https://core.telegram.org/bots/api#sendmessage
       */
      _fixReplyMarkup(obj2) {
        const replyMarkup = obj2.reply_markup;
        if (replyMarkup && typeof replyMarkup !== "string") {
          obj2.reply_markup = stringify2(replyMarkup);
        }
      }
      /**
       * Fix 'entities' or 'caption_entities' or 'explanation_entities' parameter by making it JSON-serialized, as
       * required by the Telegram Bot API
       * @param {Object} obj Object;
       * @private
       * @see https://core.telegram.org/bots/api#sendmessage
       * @see https://core.telegram.org/bots/api#copymessage
       * @see https://core.telegram.org/bots/api#sendpoll
       */
      _fixEntitiesField(obj2) {
        const entities = obj2.entities;
        const captionEntities = obj2.caption_entities;
        const explanationEntities = obj2.explanation_entities;
        if (entities && typeof entities !== "string") {
          obj2.entities = stringify2(entities);
        }
        if (captionEntities && typeof captionEntities !== "string") {
          obj2.caption_entities = stringify2(captionEntities);
        }
        if (explanationEntities && typeof explanationEntities !== "string") {
          obj2.explanation_entities = stringify2(explanationEntities);
        }
      }
      _fixAddFileThumbnail(options, opts) {
        if (options.thumb) {
          if (opts.formData === null) {
            opts.formData = {};
          }
          const attachName = "photo";
          const [formData] = this._formatSendData(attachName, options.thumb.replace("attach://", ""));
          if (formData) {
            opts.formData[attachName] = formData[attachName];
            opts.qs.thumbnail = `attach://${attachName}`;
          }
        }
      }
      /**
       * Fix 'reply_parameters' parameter by making it JSON-serialized, as
       * required by the Telegram Bot API
       * @param {Object} obj Object; either 'form' or 'qs'
       * @private
       * @see https://core.telegram.org/bots/api#sendmessage
       */
      _fixReplyParameters(obj2) {
        if (obj2.hasOwnProperty("reply_parameters") && typeof obj2.reply_parameters !== "string") {
          obj2.reply_parameters = stringify2(obj2.reply_parameters);
        }
      }
      /**
       * Make request against the API
       * @param  {String} _path API endpoint
       * @param  {Object} [options]
       * @private
       * @return {Promise}
       */
      _request(_path, options = {}) {
        if (!this.token) {
          return Promise.reject(new errors.FatalError("Telegram Bot Token not provided!"));
        }
        if (this.options.request) {
          Object.assign(options, this.options.request);
        }
        if (options.form) {
          this._fixReplyMarkup(options.form);
          this._fixEntitiesField(options.form);
          this._fixReplyParameters(options.form);
        }
        if (options.qs) {
          this._fixReplyMarkup(options.qs);
          this._fixReplyParameters(options.qs);
        }
        options.method = "POST";
        options.url = this._buildURL(_path);
        options.simple = false;
        options.resolveWithFullResponse = true;
        options.forever = true;
        debug("HTTP request: %j", options);
        return request(options).then((resp) => {
          let data;
          try {
            data = resp.body = JSON.parse(resp.body);
          } catch (err) {
            throw new errors.ParseError(`Error parsing response: ${resp.body}`, resp);
          }
          if (data.ok) {
            return data.result;
          }
          throw new errors.TelegramError(`${data.error_code} ${data.description}`, resp);
        }).catch((error) => {
          if (error.response)
            throw error;
          throw new errors.FatalError(error);
        });
      }
      /**
       * Format data to be uploaded; handles file paths, streams and buffers
       * @param  {String} type
       * @param  {String|stream.Stream|Buffer} data
       * @param  {Object} fileOptions File options
       * @param  {String} [fileOptions.filename] File name
       * @param  {String} [fileOptions.contentType] Content type (i.e. MIME)
       * @return {Array} formatted
       * @return {Object} formatted[0] formData
       * @return {String} formatted[1] fileId
       * @throws Error if Buffer file type is not supported.
       * @see https://npmjs.com/package/file-type
       * @private
       */
      _formatSendData(type, data, fileOptions = {}) {
        const deprecationMessage = "See https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files for more information on how sending files has been improved and on how to disable this deprecation message altogether.";
        let filedata = data;
        let filename = fileOptions.filename;
        let contentType = fileOptions.contentType;
        if (data instanceof stream.Stream) {
          if (!filename && data.path) {
            const url = URL3.parse(path4.basename(data.path.toString()));
            if (url.pathname) {
              filename = qs.unescape(url.pathname);
            }
          }
        } else if (Buffer.isBuffer(data)) {
          if (!filename && !process.env.NTBA_FIX_350) {
            deprecate(`Buffers will have their filenames default to "filename" instead of "data". ${deprecationMessage}`);
            filename = "data";
          }
          if (!contentType) {
            const filetype = fileType(data);
            if (filetype) {
              contentType = filetype.mime;
              const ext = filetype.ext;
              if (ext && !process.env.NTBA_FIX_350) {
                filename = `${filename}.${ext}`;
              }
            } else if (!process.env.NTBA_FIX_350) {
              deprecate(`An error will no longer be thrown if file-type of buffer could not be detected. ${deprecationMessage}`);
              throw new errors.FatalError("Unsupported Buffer file-type");
            }
          }
        } else if (data) {
          if (this.options.filepath && fs.existsSync(data)) {
            filedata = fs.createReadStream(data);
            if (!filename) {
              filename = path4.basename(data);
            }
          } else {
            return [null, data];
          }
        } else {
          return [null, data];
        }
        filename = filename || "filename";
        contentType = contentType || mime.lookup(filename);
        if (process.env.NTBA_FIX_350) {
          contentType = contentType || "application/octet-stream";
        } else {
          deprecate(`In the future, content-type of files you send will default to "application/octet-stream". ${deprecationMessage}`);
        }
        return [{
          [type]: {
            value: filedata,
            options: {
              filename,
              contentType
            }
          }
        }, null];
      }
      /**
       * Start polling.
       * Rejects returned promise if a WebHook is being used by this instance.
       * @param  {Object} [options]
       * @param  {Boolean} [options.restart=true] Consecutive calls to this method causes polling to be restarted
       * @return {Promise}
       */
      startPolling(options = {}) {
        if (this.hasOpenWebHook()) {
          return Promise.reject(new errors.FatalError("Polling and WebHook are mutually exclusive"));
        }
        options.restart = typeof options.restart === "undefined" ? true : options.restart;
        if (!this._polling) {
          this._polling = new TelegramBotPolling(this);
        }
        return this._polling.start(options);
      }
      /**
       * Alias of `TelegramBot#startPolling()`. This is **deprecated**.
       * @param  {Object} [options]
       * @return {Promise}
       * @deprecated
       */
      initPolling() {
        deprecate("TelegramBot#initPolling() is deprecated. Use TelegramBot#startPolling() instead.");
        return this.startPolling();
      }
      /**
       * Stops polling after the last polling request resolves.
       * Multiple invocations do nothing if polling is already stopped.
       * Returning the promise of the last polling request is **deprecated**.
       * @param  {Object} [options] Options
       * @param  {Boolean} [options.cancel] Cancel current request
       * @param  {String} [options.reason] Reason for stopping polling
       * @return {Promise}
       */
      stopPolling(options) {
        if (!this._polling) {
          return Promise.resolve();
        }
        return this._polling.stop(options);
      }
      /**
       * Get link for file.
       * Use this method to get link for file for subsequent use.
       * Attention: link will be valid for 1 hour.
       *
       * This method is a sugar extension of the (getFile)[#getfilefileid] method,
       * which returns just path to file on remote server (you will have to manually build full uri after that).
       *
       * @param  {String} fileId  File identifier to get info about
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Promise which will have  *fileURI* in resolve callback
       * @see https://core.telegram.org/bots/api#getfile
       */
      getFileLink(fileId, form = {}) {
        return this.getFile(fileId, form).then((resp) => `${this.options.baseApiUrl}/file/bot${this.token}/${resp.file_path}`);
      }
      /**
       * Return a readable stream for file.
       *
       * `fileStream.path` is the specified file ID i.e. `fileId`.
       * `fileStream` emits event `info` passing a single argument i.e.
       * `info` with the interface `{ uri }` where `uri` is the URI of the
       * file on Telegram servers.
       *
       * This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method,
       * which returns the full URI to the file on remote server.
       *
       * @param  {String} fileId File identifier to get info about
       * @param  {Object} [options] Additional Telegram query options
       * @return {stream.Readable} fileStream
       */
      getFileStream(fileId, form = {}) {
        const fileStream = new stream.PassThrough();
        fileStream.path = fileId;
        this.getFileLink(fileId, form).then((fileURI) => {
          fileStream.emit("info", {
            uri: fileURI
          });
          pump(streamedRequest(Object.assign({ uri: fileURI }, this.options.request)), fileStream);
        }).catch((error) => {
          fileStream.emit("error", error);
        });
        return fileStream;
      }
      /**
       * Downloads file in the specified folder.
       *
       * This method is a sugar extension of the [getFileStream](#TelegramBot+getFileStream) method,
       * which returns a readable file stream.
       *
       * @param  {String} fileId  File identifier to get info about
       * @param  {String} downloadDir Absolute path to the folder in which file will be saved
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Promise, which will have *filePath* of downloaded file in resolve callback
       */
      downloadFile(fileId, downloadDir, form = {}) {
        let resolve;
        let reject;
        const promise = new Promise((a, b) => {
          resolve = a;
          reject = b;
        });
        const fileStream = this.getFileStream(fileId, form);
        fileStream.on("info", (info) => {
          const fileName = info.uri.slice(info.uri.lastIndexOf("/") + 1);
          const filePath = path4.join(downloadDir, fileName);
          pump(fileStream, fs.createWriteStream(filePath), (error) => {
            if (error) {
              return reject(error);
            }
            return resolve(filePath);
          });
        });
        fileStream.on("error", (err) => {
          reject(err);
        });
        return promise;
      }
      /**
       * Register a RegExp to test against an incomming text message.
       * @param  {RegExp}   regexpRexecuted with `exec`.
       * @param  {Function} callback     Callback will be called with 2 parameters,
       * the `msg` and the result of executing `regexp.exec` on message text.
       */
      onText(regexp, callback) {
        this._textRegexpCallbacks.push({ regexp, callback });
      }
      /**
       * Remove a listener registered with `onText()`.
       * @param  {RegExp} regexp RegExp used previously in `onText()`
       * @return {Object} deletedListener The removed reply listener if
       *   found. This object has `regexp` and `callback`
       *   properties. If not found, returns `null`.
       */
      removeTextListener(regexp) {
        const index = this._textRegexpCallbacks.findIndex((textListener) => {
          return String(textListener.regexp) === String(regexp);
        });
        if (index === -1) {
          return null;
        }
        return this._textRegexpCallbacks.splice(index, 1)[0];
      }
      /**
       * Remove all listeners registered with `onText()`.
       */
      clearTextListeners() {
        this._textRegexpCallbacks = [];
      }
      /**
       * Register a reply to wait for a message response.
       *
       * @param  {Number|String} chatId The chat id where the message cames from.
       * @param  {Number|String} messageId The message id to be replied.
       * @param  {Function} callback Callback will be called with the reply
       *  message.
       * @return {Number} id The ID of the inserted reply listener.
       */
      onReplyToMessage(chatId, messageId, callback) {
        const id = ++this._replyListenerId;
        this._replyListeners.push({
          id,
          chatId,
          messageId,
          callback
        });
        return id;
      }
      /**
       * Removes a reply that has been prev. registered for a message response.
       * @param   {Number} replyListenerId The ID of the reply listener.
       * @return  {Object} deletedListener The removed reply listener if
       *   found. This object has `id`, `chatId`, `messageId` and `callback`
       *   properties. If not found, returns `null`.
       */
      removeReplyListener(replyListenerId) {
        const index = this._replyListeners.findIndex((replyListener) => {
          return replyListener.id === replyListenerId;
        });
        if (index === -1) {
          return null;
        }
        return this._replyListeners.splice(index, 1)[0];
      }
      /**
       * Removes all replies that have been prev. registered for a message response.
       *
       * @return  {Array} deletedListeners An array of removed listeners.
       */
      clearReplyListeners() {
        this._replyListeners = [];
      }
      /**
       * Return true if polling. Otherwise, false.
       *
       * @return {Boolean}
       */
      isPolling() {
        return this._polling ? this._polling.isPolling() : false;
      }
      /**
       * Open webhook.
       * Multiple invocations do nothing if webhook is already open.
       * Rejects returned promise if Polling is being used by this instance.
       *
       * @return {Promise}
       */
      openWebHook() {
        if (this.isPolling()) {
          return Promise.reject(new errors.FatalError("WebHook and Polling are mutually exclusive"));
        }
        if (!this._webHook) {
          this._webHook = new TelegramBotWebHook(this);
        }
        return this._webHook.open();
      }
      /**
       * Close webhook after closing all current connections.
       * Multiple invocations do nothing if webhook is already closed.
       *
       * @return {Promise} Promise
       */
      closeWebHook() {
        if (!this._webHook) {
          return Promise.resolve();
        }
        return this._webHook.close();
      }
      /**
       * Return true if using webhook and it is open i.e. accepts connections.
       * Otherwise, false.
       *
       * @return {Boolean}
       */
      hasOpenWebHook() {
        return this._webHook ? this._webHook.isOpen() : false;
      }
      /**
       * Process an update; emitting the proper events and executing regexp
       * callbacks. This method is useful should you be using a different
       * way to fetch updates, other than those provided by TelegramBot.
       *
       * @param  {Object} update
       * @see https://core.telegram.org/bots/api#update
       */
      processUpdate(update) {
        debug("Process Update %j", update);
        const message = update.message;
        const editedMessage = update.edited_message;
        const channelPost = update.channel_post;
        const editedChannelPost = update.edited_channel_post;
        const businessConnection = update.business_connection;
        const businesssMessage = update.business_message;
        const editedBusinessMessage = update.edited_business_message;
        const deletedBusinessMessage = update.deleted_business_messages;
        const messageReaction = update.message_reaction;
        const messageReactionCount = update.message_reaction_count;
        const inlineQuery = update.inline_query;
        const chosenInlineResult = update.chosen_inline_result;
        const callbackQuery = update.callback_query;
        const shippingQuery = update.shipping_query;
        const preCheckoutQuery = update.pre_checkout_query;
        const poll = update.poll;
        const pollAnswer = update.poll_answer;
        const myChatMember = update.my_chat_member;
        const chatMember = update.chat_member;
        const chatJoinRequest = update.chat_join_request;
        const chatBoost = update.chat_boost;
        const removedChatBoost = update.removed_chat_boost;
        if (message) {
          debug("Process Update message %j", message);
          const metadata = {};
          metadata.type = TelegramBot2.messageTypes.find((messageType) => {
            return message[messageType];
          });
          this.emit("message", message, metadata);
          if (metadata.type) {
            debug("Emitting %s: %j", metadata.type, message);
            this.emit(metadata.type, message, metadata);
          }
          if (message.text) {
            debug("Text message");
            this._textRegexpCallbacks.some((reg) => {
              debug("Matching %s with %s", message.text, reg.regexp);
              if (!(reg.regexp instanceof RegExp)) {
                reg.regexp = new RegExp(reg.regexp);
              }
              const result = reg.regexp.exec(message.text);
              if (!result) {
                return false;
              }
              reg.regexp.lastIndex = 0;
              debug("Matches %s", reg.regexp);
              reg.callback(message, result);
              return this.options.onlyFirstMatch;
            });
          }
          if (message.reply_to_message) {
            this._replyListeners.forEach((reply) => {
              if (reply.chatId === message.chat.id) {
                if (reply.messageId === message.reply_to_message.message_id) {
                  reply.callback(message);
                }
              }
            });
          }
        } else if (editedMessage) {
          debug("Process Update edited_message %j", editedMessage);
          this.emit("edited_message", editedMessage);
          if (editedMessage.text) {
            this.emit("edited_message_text", editedMessage);
          }
          if (editedMessage.caption) {
            this.emit("edited_message_caption", editedMessage);
          }
        } else if (channelPost) {
          debug("Process Update channel_post %j", channelPost);
          this.emit("channel_post", channelPost);
        } else if (editedChannelPost) {
          debug("Process Update edited_channel_post %j", editedChannelPost);
          this.emit("edited_channel_post", editedChannelPost);
          if (editedChannelPost.text) {
            this.emit("edited_channel_post_text", editedChannelPost);
          }
          if (editedChannelPost.caption) {
            this.emit("edited_channel_post_caption", editedChannelPost);
          }
        } else if (businessConnection) {
          debug("Process Update business_connection %j", businessConnection);
          this.emit("business_connection", businessConnection);
        } else if (businesssMessage) {
          debug("Process Update business_message %j", businesssMessage);
          this.emit("business_message", businesssMessage);
        } else if (editedBusinessMessage) {
          debug("Process Update edited_business_message %j", editedBusinessMessage);
          this.emit("edited_business_message", editedBusinessMessage);
        } else if (deletedBusinessMessage) {
          debug("Process Update deleted_business_messages %j", deletedBusinessMessage);
          this.emit("deleted_business_messages", deletedBusinessMessage);
        } else if (messageReaction) {
          debug("Process Update message_reaction %j", messageReaction);
          this.emit("message_reaction", messageReaction);
        } else if (messageReactionCount) {
          debug("Process Update message_reaction_count %j", messageReactionCount);
          this.emit("message_reaction_count", messageReactionCount);
        } else if (inlineQuery) {
          debug("Process Update inline_query %j", inlineQuery);
          this.emit("inline_query", inlineQuery);
        } else if (chosenInlineResult) {
          debug("Process Update chosen_inline_result %j", chosenInlineResult);
          this.emit("chosen_inline_result", chosenInlineResult);
        } else if (callbackQuery) {
          debug("Process Update callback_query %j", callbackQuery);
          this.emit("callback_query", callbackQuery);
        } else if (shippingQuery) {
          debug("Process Update shipping_query %j", shippingQuery);
          this.emit("shipping_query", shippingQuery);
        } else if (preCheckoutQuery) {
          debug("Process Update pre_checkout_query %j", preCheckoutQuery);
          this.emit("pre_checkout_query", preCheckoutQuery);
        } else if (poll) {
          debug("Process Update poll %j", poll);
          this.emit("poll", poll);
        } else if (pollAnswer) {
          debug("Process Update poll_answer %j", pollAnswer);
          this.emit("poll_answer", pollAnswer);
        } else if (chatMember) {
          debug("Process Update chat_member %j", chatMember);
          this.emit("chat_member", chatMember);
        } else if (myChatMember) {
          debug("Process Update my_chat_member %j", myChatMember);
          this.emit("my_chat_member", myChatMember);
        } else if (chatJoinRequest) {
          debug("Process Update my_chat_member %j", chatJoinRequest);
          this.emit("chat_join_request", chatJoinRequest);
        } else if (chatBoost) {
          debug("Process Update chat_boost %j", chatBoost);
          this.emit("chat_boost", chatBoost);
        } else if (removedChatBoost) {
          debug("Process Update removed_chat_boost %j", removedChatBoost);
          this.emit("removed_chat_boost", removedChatBoost);
        }
      }
      /** Start Telegram Bot API methods */
      /**
      * Use this method to receive incoming updates using long polling.
      * This method has an [older, compatible signature][getUpdates-v0.25.0]
      * that is being deprecated.
      *
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise}
      * @see https://core.telegram.org/bots/api#getupdates
      */
      getUpdates(form = {}) {
        if (typeof form !== "object") {
          deprecate("The method signature getUpdates(timeout, limit, offset) has been deprecated since v0.25.0");
          form = {
            timeout: arguments[0],
            limit: arguments[1],
            offset: arguments[2]
          };
        }
        return this._request("getUpdates", { form });
      }
      /**
       * Specify an url to receive incoming updates via an outgoing webHook.
       * This method has an [older, compatible signature][setWebHook-v0.25.0]
       * that is being deprecated.
       *
       * @param  {String} url URL where Telegram will make HTTP Post. Leave empty to
       * delete webHook.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {String|stream.Stream} [options.certificate] PEM certificate key (public).
       * @param  {String} [options.secret_token] Optional secret token to be sent in a header `X-Telegram-Bot-Api-Secret-Token` in every webhook request.
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise}
       * @see https://core.telegram.org/bots/api#setwebhook
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
       */
      setWebHook(url, options = {}, fileOptions = {}) {
        let cert;
        if (typeof options !== "object" || options instanceof stream.Stream) {
          deprecate("The method signature setWebHook(url, cert) has been deprecated since v0.25.0");
          cert = options;
          options = {};
        } else {
          cert = options.certificate;
        }
        const opts = {
          qs: options
        };
        opts.qs.url = url;
        if (cert) {
          try {
            const sendData = this._formatSendData("certificate", cert, fileOptions);
            opts.formData = sendData[0];
            opts.qs.certificate = sendData[1];
          } catch (ex) {
            return Promise.reject(ex);
          }
        }
        return this._request("setWebHook", opts);
      }
      /**
       * Use this method to remove webhook integration if you decide to
       * switch back to getUpdates. Returns True on success.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}
       * @see https://core.telegram.org/bots/api#deletewebhook
       */
      deleteWebHook(form = {}) {
        return this._request("deleteWebhook", { form });
      }
      /**
       * Use this method to get current webhook status.
       * On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookinfo) object.
       * If the bot is using getUpdates, will return an object with the
       * url field empty.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}
       * @see https://core.telegram.org/bots/api#getwebhookinfo
       */
      getWebHookInfo(form = {}) {
        return this._request("getWebhookInfo", { form });
      }
      /**
       * A simple method for testing your bot's authentication token. Requires no parameters.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} basic information about the bot in form of a [User](https://core.telegram.org/bots/api#user) object.
       * @see https://core.telegram.org/bots/api#getme
       */
      getMe(form = {}) {
        return this._request("getMe", { form });
      }
      /**
       * This method log out your bot from the cloud Bot API server before launching the bot locally.
       * You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
       * After a successful call, you will not be able to log in again using the same token for 10 minutes.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}  True on success
       * @see https://core.telegram.org/bots/api#logout
       */
      logOut(form = {}) {
        return this._request("logOut", { form });
      }
      /**
       * This method close the bot instance before moving it from one local server to another.
       * This method will return error 429 in the first 10 minutes after the bot is launched.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}  True on success
       * @see https://core.telegram.org/bots/api#close
       */
      close(form = {}) {
        return this._request("close", { form });
      }
      /**
       * Send text message.
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} text Text of the message to be sent
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendmessage
       */
      sendMessage(chatId, text, form = {}) {
        form.chat_id = chatId;
        form.text = text;
        return this._request("sendMessage", { form });
      }
      /**
       * Forward messages of any kind.
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * or username of the target channel (in the format `@channelusername`)
       * @param  {Number|String} fromChatId Unique identifier for the chat where the
       * original message was sent (or channel username in the format `@channelusername`)
       * @param  {Number|String} messageId  Unique message identifier in the chat specified in fromChatId
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}
       * @see https://core.telegram.org/bots/api#forwardmessage
       */
      forwardMessage(chatId, fromChatId, messageId, form = {}) {
        form.chat_id = chatId;
        form.from_chat_id = fromChatId;
        form.message_id = messageId;
        return this._request("forwardMessage", { form });
      }
      /**
       * Use this method to forward multiple messages of any kind.
       * If some of the specified messages can't be found or forwarded, they are skipped.
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * or username of the target channel (in the format `@channelusername`)
       * @param  {Number|String} fromChatId Unique identifier for the chat where the
       * original message was sent (or channel username in the format `@channelusername`)
       * @param  {Array<Number|String>} messageIds Identifiers of 1-100 messages in the chat from_chat_id to forward.
       * The identifiers must be specified in a strictly increasing order.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} An array of MessageId of the sent messages on success
       * @see https://core.telegram.org/bots/api#forwardmessages
       */
      forwardMessages(chatId, fromChatId, messageIds, form = {}) {
        form.chat_id = chatId;
        form.from_chat_id = fromChatId;
        form.message_ids = messageIds;
        return this._request("forwardMessages", { form });
      }
      /**
       * Copy messages of any kind. **Service messages and invoice messages can't be copied.**
       * The method is analogous to the method forwardMessages, but the copied message doesn't
       * have a link to the original message.
       * Returns the MessageId of the sent message on success.
       * @param  {Number|String} chatId     Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number|String} fromChatId Unique identifier for the chat where the
       * original message was sent
       * @param  {Number|String} messageId  Unique message identifier
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} The [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success
       * @see https://core.telegram.org/bots/api#copymessage
       */
      copyMessage(chatId, fromChatId, messageId, form = {}) {
        form.chat_id = chatId;
        form.from_chat_id = fromChatId;
        form.message_id = messageId;
        return this._request("copyMessage", { form });
      }
      /**
       * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
       * Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
       * Returns the MessageId of the sent message on success.
       * @param  {Number|String} chatId Unique identifier for the target chat
       * @param  {Number|String} fromChatId Unique identifier for the chat where the
       * original message was sent
       * @param  {Array} messageIds  Identifiers of 1-100 messages in the chat from_chat_id to copy.
       * The identifiers must be specified in a strictly increasing order.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} An array of MessageId of the sent messages
       * @see https://core.telegram.org/bots/api#copymessages
       */
      copyMessages(chatId, fromChatId, messageIds, form = {}) {
        form.chat_id = chatId;
        form.from_chat_id = fromChatId;
        form.message_ids = stringify2(messageIds);
        return this._request("copyMessages", { form });
      }
      /**
       * Send photo
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String|stream.Stream|Buffer} photo A file path or a Stream. Can
       * also be a `file_id` previously uploaded
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendphoto
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
       */
      sendPhoto(chatId, photo, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("photo", photo, fileOptions);
          opts.formData = sendData[0];
          opts.qs.photo = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendPhoto", opts);
      }
      /**
      * Send audio
      *
      * **Your audio must be in the .MP3 or .M4A format.**
      *
      * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {String|stream.Stream|Buffer} audio A file path, Stream or Buffer.
      * Can also be a `file_id` previously uploaded.
      * @param  {Object} [options] Additional Telegram query options
      * @param  {Object} [fileOptions] Optional file related meta-data
      * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
      * @see https://core.telegram.org/bots/api#sendaudio
      * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
      */
      sendAudio(chatId, audio, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("audio", audio, fileOptions);
          opts.formData = sendData[0];
          opts.qs.audio = sendData[1];
          this._fixAddFileThumbnail(options, opts);
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendAudio", opts);
      }
      /**
      * Send Document
      * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {String|stream.Stream|Buffer} doc A file path, Stream or Buffer.
      * Can also be a `file_id` previously uploaded.
      * @param  {Object} [options] Additional Telegram query options
      * @param  {Object} [fileOptions] Optional file related meta-data
      * @return {Promise}  On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
      * @see https://core.telegram.org/bots/api#sendDocument
      * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
      */
      sendDocument(chatId, doc, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("document", doc, fileOptions);
          opts.formData = sendData[0];
          opts.qs.document = sendData[1];
          this._fixAddFileThumbnail(options, opts);
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendDocument", opts);
      }
      /**
       * Use this method to send video files, **Telegram clients support mp4 videos** (other formats may be sent as Document).
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String|stream.Stream|Buffer} video A file path or Stream.
       * Can also be a `file_id` previously uploaded.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendvideo
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
       */
      sendVideo(chatId, video, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("video", video, fileOptions);
          opts.formData = sendData[0];
          opts.qs.video = sendData[1];
          this._fixAddFileThumbnail(options, opts);
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendVideo", opts);
      }
      /**
       * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String|stream.Stream|Buffer} animation A file path, Stream or Buffer.
       * Can also be a `file_id` previously uploaded.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendanimation
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
       */
      sendAnimation(chatId, animation, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("animation", animation, fileOptions);
          opts.formData = sendData[0];
          opts.qs.animation = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendAnimation", opts);
      }
      /**
       * Send voice
       *
       * **Your audio must be in an .OGG file encoded with OPUS**, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String|stream.Stream|Buffer} voice A file path, Stream or Buffer.
       * Can also be a `file_id` previously uploaded.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendvoice
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
       */
      sendVoice(chatId, voice, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("voice", voice, fileOptions);
          opts.formData = sendData[0];
          opts.qs.voice = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendVoice", opts);
      }
      /**
       * Use this method to send video messages
       * Telegram clients support **rounded square MPEG4 videos** of up to 1 minute long.
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String|stream.Stream|Buffer} videoNote A file path or Stream.
       * Can also be a `file_id` previously uploaded.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @info The length parameter is actually optional. However, the API (at time of writing) requires you to always provide it until it is fixed.
       * @see https://core.telegram.org/bots/api#sendvideonote
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
      */
      sendVideoNote(chatId, videoNote, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("video_note", videoNote, fileOptions);
          opts.formData = sendData[0];
          opts.qs.video_note = sendData[1];
          this._fixAddFileThumbnail(options, opts);
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendVideoNote", opts);
      }
      /**
       * Use this method to send a group of photos or videos as an album.
       *
       * **Documents and audio files can be only grouped in an album with messages of the same type**
       *
       * If you wish to [specify file options](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files),
       * add a `fileOptions` property to the target input in `media`.
       *
       * @param  {String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Array} media A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
       * is returned.
       * @see https://core.telegram.org/bots/api#sendmediagroup
       * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
       */
      sendMediaGroup(chatId, media, options = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        opts.formData = {};
        const inputMedia = [];
        let index = 0;
        for (const input of media) {
          const payload = Object.assign({}, input);
          delete payload.media;
          delete payload.fileOptions;
          try {
            const attachName = String(index);
            const [formData, fileId] = this._formatSendData(attachName, input.media, input.fileOptions);
            if (formData) {
              opts.formData[attachName] = formData[attachName];
              payload.media = `attach://${attachName}`;
            } else {
              payload.media = fileId;
            }
          } catch (ex) {
            return Promise.reject(ex);
          }
          inputMedia.push(payload);
          index++;
        }
        opts.qs.media = stringify2(inputMedia);
        return this._request("sendMediaGroup", opts);
      }
      /**
       * Send location.
       * Use this method to send point on the map.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Float} latitude Latitude of location
       * @param  {Float} longitude Longitude of location
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendlocation
       */
      sendLocation(chatId, latitude, longitude, form = {}) {
        form.chat_id = chatId;
        form.latitude = latitude;
        form.longitude = longitude;
        return this._request("sendLocation", { form });
      }
      /**
       * Use this method to edit live location messages sent by
       * the bot or via the bot (for inline bots).
       *
       *  A location **can be edited until its live_period expires or editing is explicitly disabled by a call to [stopMessageLiveLocation](https://core.telegram.org/bots/api#stopmessagelivelocation)**
       *
       * Note that you must provide one of chat_id, message_id, or
       * inline_message_id in your request.
       *
       * @param  {Float} latitude Latitude of location
       * @param  {Float} longitude Longitude of location
       * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
       * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
       * @see https://core.telegram.org/bots/api#editmessagelivelocation
       */
      editMessageLiveLocation(latitude, longitude, form = {}) {
        form.latitude = latitude;
        form.longitude = longitude;
        return this._request("editMessageLiveLocation", { form });
      }
      /**
       * Use this method to stop updating a live location message sent by
       * the bot or via the bot (for inline bots) before live_period expires.
       *
       * Note that you must provide one of chat_id, message_id, or
       * inline_message_id in your request.
       *
       * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
       * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
       * @see https://core.telegram.org/bots/api#stopmessagelivelocation
       */
      stopMessageLiveLocation(form = {}) {
        return this._request("stopMessageLiveLocation", { form });
      }
      /**
       * Send venue.
       * Use this method to send information about a venue.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Float} latitude Latitude of location
       * @param  {Float} longitude Longitude of location
       * @param  {String} title Name of the venue
       * @param  {String} address Address of the venue
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
       * @see https://core.telegram.org/bots/api#sendvenue
       */
      sendVenue(chatId, latitude, longitude, title, address, form = {}) {
        form.chat_id = chatId;
        form.latitude = latitude;
        form.longitude = longitude;
        form.title = title;
        form.address = address;
        return this._request("sendVenue", { form });
      }
      /**
       * Send contact.
       * Use this method to send phone contacts.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} phoneNumber Contact's phone number
       * @param  {String} firstName Contact's first name
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendcontact
       */
      sendContact(chatId, phoneNumber, firstName, form = {}) {
        form.chat_id = chatId;
        form.phone_number = phoneNumber;
        form.first_name = firstName;
        return this._request("sendContact", { form });
      }
      /**
       * Send poll.
       * Use this method to send a native poll.
       *
       * @param  {Number|String} chatId  Unique identifier for the group/channel
       * @param  {String} question Poll question, 1-300 characters
       * @param  {Array} pollOptions Poll options, between 2-10 options (only 1-100 characters each)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#sendpoll
       */
      sendPoll(chatId, question, pollOptions, form = {}) {
        form.chat_id = chatId;
        form.question = question;
        form.options = stringify2(pollOptions);
        return this._request("sendPoll", { form });
      }
      /**
       * Send Dice
       * Use this method to send an animated emoji that will display a random value.
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}  On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
       * @see https://core.telegram.org/bots/api#senddice
       */
      sendDice(chatId, options = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("dice");
          opts.formData = sendData[0];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendDice", opts);
      }
      /**
       * Send chat action.
       *
       * Use this method when you need to tell the user that something is happening on the bot's side.
       * **The status is set for 5 seconds or less** (when a message arrives from your bot, Telegram clients clear its typing status).
       *
       *  Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
       * `upload_photo` for [photos](https://core.telegram.org/bots/api#sendphoto), `record_video` or `upload_video` for [videos](https://core.telegram.org/bots/api#sendvideo),
       * `record_voice` or `upload_voice` for [voice notes](https://core.telegram.org/bots/api#sendvoice), `upload_document` for [general files](https://core.telegram.org/bots/api#senddocument),
       * `choose_sticker` for [stickers](https://core.telegram.org/bots/api#sendsticker), `find_location` for [location data](https://core.telegram.org/bots/api#sendlocation),
       * `record_video_note` or `upload_video_note` for [video notes](https://core.telegram.org/bots/api#sendvideonote).
       *
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} action Type of action to broadcast.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#sendchataction
       */
      sendChatAction(chatId, action, form = {}) {
        form.chat_id = chatId;
        form.action = action;
        return this._request("sendChatAction", { form });
      }
      /**
       * Use this method to change the chosen reactions on a message.
       * - Service messages can't be reacted to.
       * - Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
       * - In albums, bots must react to the first message.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format @channelusername)
       * @param  {Number} messageId  Unique identifier of the target message
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise<Boolean>} True on success
       * @see https://core.telegram.org/bots/api#setmessagereaction
       */
      setMessageReaction(chatId, messageId, form = {}) {
        form.chat_id = chatId;
        form.message_id = messageId;
        if (form.reaction) {
          form.reaction = stringify2(form.reaction);
        }
        return this._request("setMessageReaction", { form });
      }
      /**
       * Use this method to get a list of profile pictures for a user.
       * Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.
       * This method has an [older, compatible signature][getUserProfilePhotos-v0.25.0]
       * that is being deprecated.
       *
       * @param  {Number} userId  Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise}  Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object
       * @see https://core.telegram.org/bots/api#getuserprofilephotos
       */
      getUserProfilePhotos(userId, form = {}) {
        if (typeof form !== "object") {
          deprecate("The method signature getUserProfilePhotos(userId, offset, limit) has been deprecated since v0.25.0");
          form = {
            offset: arguments[1],
            limit: arguments[2]
          };
        }
        form.user_id = userId;
        return this._request("getUserProfilePhotos", { form });
      }
      /**
       * Get file.
       * Use this method to get basic info about a file and prepare it for downloading.
       *
       * Attention: **link will be valid for 1 hour.**
       *
       * @param  {String} fileId  File identifier to get info about
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, a [File](https://core.telegram.org/bots/api#file) object is returned
       * @see https://core.telegram.org/bots/api#getfile
       */
      getFile(fileId, form = {}) {
        form.file_id = fileId;
        return this._request("getFile", { form });
      }
      /**
        * Use this method to ban a user in a group, a supergroup or a channel.
        * In the case of supergroups and channels, the user will not be able to
        * return to the chat on their own using invite links, etc., unless unbanned first..
        *
        * The **bot must be an administrator in the group, supergroup or a channel** for this to work.
        *
        *
        * @param  {Number|String} chatId   Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
        * @param  {Number} userId  Unique identifier of the target user
        * @param  {Object} [options] Additional Telegram query options
        * @return {Promise} True on success.
        * @see https://core.telegram.org/bots/api#banchatmember
        */
      banChatMember(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("banChatMember", { form });
      }
      /**
      * Use this method to unban a previously kicked user in a supergroup.
      * The user will not return to the group automatically, but will be
      * able to join via link, etc.
      *
      * The **bot must be an administrator** in the supergroup or channel for this to work.
      *
      * **By default**, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
      * So **if the user is a member of the chat they will also be removed from the chat**. If you don't want this, use the parameter *only_if_banned*
      *
      * @param  {Number|String} chatId   Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {Number} userId  Unique identifier of the target user
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#unbanchatmember
      */
      unbanChatMember(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("unbanChatMember", { form });
      }
      /**
      * Use this method to restrict a user in a supergroup.
      * The bot **must be an administrator in the supergroup** for this to work
      * and must have the appropriate admin rights. Pass True for all boolean parameters
      * to lift restrictions from a user. Returns True on success.
      *
      * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {Number} userId Unique identifier of the target user
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#restrictchatmember
      */
      restrictChatMember(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("restrictChatMember", { form });
      }
      /**
       * Use this method to promote or demote a user in a supergroup or a channel.
       * The bot **must be an administrator** in the chat for this to work
       * and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number} userId
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success.
       * @see https://core.telegram.org/bots/api#promotechatmember
       */
      promoteChatMember(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("promoteChatMember", { form });
      }
      /**
       * Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number} userId Unique identifier of the target user
       * @param  {String} customTitle New custom title for the administrator; 0-16 characters, emoji are not allowed
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
       */
      setChatAdministratorCustomTitle(chatId, userId, customTitle, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        form.custom_title = customTitle;
        return this._request("setChatAdministratorCustomTitle", { form });
      }
      /**
       * Use this method to ban a channel chat in a supergroup or a channel.
       *
       * Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), the owner of the banned chat won't be able to send messages on behalf of any of their channels.
       * The bot **must be an administrator in the supergroup or channel** for this to work and must have the appropriate administrator rights
       *
       * @param  {Number|String} chatId   Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number} senderChatId  Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success.
       * @see https://core.telegram.org/bots/api#banchatsenderchat
       */
      banChatSenderChat(chatId, senderChatId, form = {}) {
        form.chat_id = chatId;
        form.sender_chat_id = senderChatId;
        return this._request("banChatSenderChat", { form });
      }
      /**
      * Use this method to unban a previously banned channel chat in a supergroup or channel.
      *
      * The bot **must be an administrator** for this to work and must have the appropriate administrator rights.
      *
      * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {Number} senderChatId Unique identifier of the target user
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#unbanchatsenderchat
      */
      unbanChatSenderChat(chatId, senderChatId, form = {}) {
        form.chat_id = chatId;
        form.sender_chat_id = senderChatId;
        return this._request("unbanChatSenderChat", { form });
      }
      /**
       * Use this method to set default chat permissions for all members.
       *
       * The bot **must be an administrator in the group or a supergroup** for this to
       * work and **must have the `can_restrict_members` admin rights.**
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Array} chatPermissions New default chat permissions
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchatpermissions
       */
      setChatPermissions(chatId, chatPermissions, form = {}) {
        form.chat_id = chatId;
        form.permissions = stringify2(chatPermissions);
        return this._request("setChatPermissions", { form });
      }
      /**
       * Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Exported invite link as String on success.
       * @see https://core.telegram.org/bots/api#exportchatinvitelink
       */
      exportChatInviteLink(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("exportChatInviteLink", { form });
      }
      /**
       * Use this method to create an additional invite link for a chat.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
       *
       * The link generated with this method can be revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink)
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Object} The new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
       * @see https://core.telegram.org/bots/api#createchatinvitelink
       */
      createChatInviteLink(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("createChatInviteLink", { form });
      }
      /**
       * Use this method to edit a non-primary invite link created by the bot.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} inviteLink Text with the invite link to edit
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} The edited invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
       * @see https://core.telegram.org/bots/api#editchatinvitelink
       */
      editChatInviteLink(chatId, inviteLink, form = {}) {
        form.chat_id = chatId;
        form.invite_link = inviteLink;
        return this._request("editChatInviteLink", { form });
      }
      /**
       * Use this method to revoke an invite link created by the bot.
       * Note: If the primary link is revoked, a new link is automatically generated
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} inviteLink The invite link to revoke
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} The revoked invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
       * @see https://core.telegram.org/bots/api#revokechatinvitelink
       */
      revokeChatInviteLink(chatId, inviteLink, form = {}) {
        form.chat_id = chatId;
        form.invite_link = inviteLink;
        return this._request("revokeChatInviteLink", { form });
      }
      /**
       * Use this method to approve a chat join request.
       *
       * The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right.**
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number} userId  Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#approvechatjoinrequest
       */
      approveChatJoinRequest(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("approveChatJoinRequest", { form });
      }
      /**
       * Use this method to decline a chat join request.
       *
       * The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right**.
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number} userId  Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#declinechatjoinrequest
       */
      declineChatJoinRequest(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("declineChatJoinRequest", { form });
      }
      /**
       * Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {stream.Stream|Buffer} photo A file path or a Stream.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchatphoto
       */
      setChatPhoto(chatId, photo, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("photo", photo, fileOptions);
          opts.formData = sendData[0];
          opts.qs.photo = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("setChatPhoto", opts);
      }
      /**
      * Use this method to delete a chat photo. **Photos can't be changed for private chats**.
      *
      * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
      *
      * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#deletechatphoto
      */
      deleteChatPhoto(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("deleteChatPhoto", { form });
      }
      /**
       * Use this method to change the title of a chat. **Titles can't be changed for private chats**.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} title New chat title, 1-255 characters
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchattitle
       */
      setChatTitle(chatId, title, form = {}) {
        form.chat_id = chatId;
        form.title = title;
        return this._request("setChatTitle", { form });
      }
      /**
       * Use this method to change the description of a group, a supergroup or a channel.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} description New chat title, 0-255 characters
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchatdescription
       */
      setChatDescription(chatId, description, form = {}) {
        form.chat_id = chatId;
        form.description = description;
        return this._request("setChatDescription", { form });
      }
      /**
       * Use this method to pin a message in a supergroup.
       *
       * If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
       * right in a supergroup or `can_edit_messages` administrator right in a channel.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Number} messageId Identifier of a message to pin
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#pinchatmessage
       */
      pinChatMessage(chatId, messageId, form = {}) {
        form.chat_id = chatId;
        form.message_id = messageId;
        return this._request("pinChatMessage", { form });
      }
      /**
       * Use this method to remove a message from the list of pinned messages in a chat
       *
       * If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
       * right in a supergroup or `can_edit_messages` administrator right in a channel.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#unpinchatmessage
       */
      unpinChatMessage(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("unpinChatMessage", { form });
      }
      /**
      * Use this method to clear the list of pinned messages in a chat.
      *
      * If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
      * right in a supergroup or `can_edit_messages` administrator right in a channel.
      *
      * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#unpinallchatmessages
      */
      unpinAllChatMessages(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("unpinAllChatMessages", { form });
      }
      /**
       * Use this method for your bot to leave a group, supergroup or channel
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#leavechat
       */
      leaveChat(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("leaveChat", { form });
      }
      /**
       * Use this method to get up to date information about the chat
       * (current name of the user for one-on-one conversations, current
       * username of a user, group or channel, etc.).
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or channel
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success
       * @see https://core.telegram.org/bots/api#getchat
       */
      getChat(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("getChat", { form });
      }
      /**
       * Use this method to get a list of administrators in a chat
       *
       * @param  {Number|String} chatId  Unique identifier for the target group or username of the target supergroup
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects that contains information about all chat administrators except other bots.
       * If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned
       * @see https://core.telegram.org/bots/api#getchatadministrators
       */
      getChatAdministrators(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("getChatAdministrators", { form });
      }
      /**
      * Use this method to get the number of members in a chat.
      *
      * @param  {Number|String} chatId  Unique identifier for the target group or username of the target supergroup
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} Int on success
      * @see https://core.telegram.org/bots/api#getchatmembercount
      */
      getChatMemberCount(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("getChatMemberCount", { form });
      }
      /**
       * Use this method to get information about a member of a chat.
       *
       * @param  {Number|String} chatId  Unique identifier for the target group or username of the target supergroup
       * @param  {Number} userId  Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} [ChatMember](https://core.telegram.org/bots/api#chatmember) object on success
       * @see https://core.telegram.org/bots/api#getchatmember
       */
      getChatMember(chatId, userId, form = {}) {
        form.chat_id = chatId;
        form.user_id = userId;
        return this._request("getChatMember", { form });
      }
      /**
       * Use this method to set a new group sticker set for a supergroup.
       *
       * The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
       *
       * **Note:** Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
       *
       * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param  {String} stickerSetName Name of the sticker set to be set as the group sticker set
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchatstickerset
       */
      setChatStickerSet(chatId, stickerSetName, form = {}) {
        form.chat_id = chatId;
        form.sticker_set_name = stickerSetName;
        return this._request("setChatStickerSet", { form });
      }
      /**
       * Use this method to delete a group sticker set from a supergroup.
       *
       * Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
       *
       * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#deletechatstickerset
       */
      deleteChatStickerSet(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("deleteChatStickerSet", { form });
      }
      /**
       * Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
       *
       * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects
       * @see https://core.telegram.org/bots/api#getforumtopiciconstickers
       */
      getForumTopicIconStickers(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("getForumTopicIconStickers", { form });
      }
      /**
       * Use this method to create a topic in a forum supergroup chat.
       * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
       *
       * Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.
       *
       * @param  {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param  {String} name Topic name, 1-128 characters
       * @param  {Object} [options] Additional Telegram query options
       * @see https://core.telegram.org/bots/api#createforumtopic
       */
      createForumTopic(chatId, name, form = {}) {
        form.chat_id = chatId;
        form.name = name;
        return this._request("createForumTopic", { form });
      }
      /**
       * Use this method to edit name and icon of a topic in a forum supergroup chat.
       * The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#editforumtopic
       */
      editForumTopic(chatId, messageThreadId, form = {}) {
        form.chat_id = chatId;
        form.message_thread_id = messageThreadId;
        return this._request("editForumTopic", { form });
      }
      /**
       * Use this method to close an open topic in a forum supergroup chat.
       * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#closeforumtopic
       */
      closeForumTopic(chatId, messageThreadId, form = {}) {
        form.chat_id = chatId;
        form.message_thread_id = messageThreadId;
        return this._request("closeForumTopic", { form });
      }
      /**
       * Use this method to reopen a closed topic in a forum supergroup chat.
       * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#reopenforumtopic
       */
      reopenForumTopic(chatId, messageThreadId, form = {}) {
        form.chat_id = chatId;
        form.message_thread_id = messageThreadId;
        return this._request("reopenForumTopic", { form });
      }
      /**
       * Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
       * The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#deleteforumtopic
       */
      deleteForumTopic(chatId, messageThreadId, form = {}) {
        form.chat_id = chatId;
        form.message_thread_id = messageThreadId;
        return this._request("deleteForumTopic", { form });
      }
      /**
       * Use this method to clear the list of pinned messages in a forum topic.
       * The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Number} messageThreadId Unique identifier for the target message thread of the forum topic
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
       */
      unpinAllForumTopicMessages(chatId, messageThreadId, form = {}) {
        form.chat_id = chatId;
        form.message_thread_id = messageThreadId;
        return this._request("unpinAllForumTopicMessages", { form });
      }
      /**
      * Use this method to edit the name of the 'General' topic in a forum supergroup chat.
      * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
      * The topic will be automatically unhidden if it was hidden.
      *
      * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
      * @param {String} name New topic name, 1-128 characters
      * @param {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#editgeneralforumtopic
      */
      editGeneralForumTopic(chatId, name, form = {}) {
        form.chat_id = chatId;
        form.name = name;
        return this._request("editGeneralForumTopic", { form });
      }
      /**
      * Use this method to close an open 'General' topic in a forum supergroup chat.
      * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
      * The topic will be automatically unhidden if it was hidden.
      *
      * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
      * @param {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#closegeneralforumtopic
      */
      closeGeneralForumTopic(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("closeGeneralForumTopic", { form });
      }
      /**
      * Use this method to reopen a closed 'General' topic in a forum supergroup chat.
      * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
      * The topic will be automatically unhidden if it was hidden.
      *
      * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
      * @param {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#reopengeneralforumtopic
      */
      reopenGeneralForumTopic(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("reopenGeneralForumTopic", { form });
      }
      /**
      * Use this method to hide the 'General' topic in a forum supergroup chat.
      * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
      * The topic will be automatically closed if it was open.
      *
      * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
      * @param {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#hidegeneralforumtopic
      */
      hideGeneralForumTopic(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("hideGeneralForumTopic", { form });
      }
      /**
       * Use this method to unhide the 'General' topic in a forum supergroup chat.
       * The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
       */
      unhideGeneralForumTopic(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("unhideGeneralForumTopic", { form });
      }
      /**
       * Use this method to clear the list of pinned messages in a General forum topic.
       * The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
       *
       * @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
       * @param {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
       */
      unpinAllGeneralForumTopicMessages(chatId, form = {}) {
        form.chat_id = chatId;
        return this._request("unhideGeneralForumTopic", { form });
      }
      /**
       * Use this method to send answers to callback queries sent from
       * [inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).
       *
       * The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
       *
       * This method has **older, compatible signatures ([1][answerCallbackQuery-v0.27.1])([2][answerCallbackQuery-v0.29.0])**
       * that are being deprecated.
       *
       * @param  {String} callbackQueryId Unique identifier for the query to be answered
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#answercallbackquery
       */
      answerCallbackQuery(callbackQueryId, form = {}) {
        if (typeof form !== "object") {
          deprecate("The method signature answerCallbackQuery(callbackQueryId, text, showAlert) has been deprecated since v0.27.1");
          form = {
            callback_query_id: arguments[0],
            text: arguments[1],
            show_alert: arguments[2]
          };
        }
        if (typeof callbackQueryId === "object") {
          deprecate("The method signature answerCallbackQuery([options]) has been deprecated since v0.29.0");
          form = callbackQueryId;
        } else {
          form.callback_query_id = callbackQueryId;
        }
        return this._request("answerCallbackQuery", { form });
      }
      /**
       * Use this method to get the list of boosts added to a chat by a use.
       * Requires administrator rights in the chat
       *
       * @param  {Number|String} chatId  Unique identifier for the group/channel
       * @param  {Number} user_id Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object
       * @see https://core.telegram.org/bots/api#getuserchatboosts
       */
      getUserChatBoosts(chatId, pollId, form = {}) {
        form.chat_id = chatId;
        form.message_id = pollId;
        return this._request("getUserChatBoosts", { form });
      }
      /**
       * Use this method to get information about the connection of the bot with a business account
       *
       * @param  {Number|String} businessConnectionId  Unique identifier for the group/channel
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, returns [BusinessConnection](https://core.telegram.org/bots/api#businessconnection) object
       * @see https://core.telegram.org/bots/api#getbusinessconnection
       */
      getBusinessConnection(businessConnectionId, form = {}) {
        form.business_connection_id = businessConnectionId;
        return this._request("getBusinessConnection", { form });
      }
      /**
       * Use this method to change the list of the bot's commands.
       *
       * See https://core.telegram.org/bots#commands for more details about bot commands
       *
       * @param  {Array} commands  List of bot commands to be set as the list of the [bot's commands](https://core.telegram.org/bots/api#botcommand). At most 100 commands can be specified.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setmycommands
       */
      setMyCommands(commands, form = {}) {
        form.commands = stringify2(commands);
        if (form.scope) {
          form.scope = stringify2(form.scope);
        }
        return this._request("setMyCommands", { form });
      }
      /**
       * Use this method to delete the list of the bot's commands for the given scope and user language.
       *
       *  After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#deletemycommands
       */
      deleteMyCommands(form = {}) {
        return this._request("deleteMyCommands", { form });
      }
      /**
       * Use this method to get the current list of the bot's commands for the given scope and user language.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Array of [BotCommand](https://core.telegram.org/bots/api#botcommand) on success. If commands aren't set, an empty list is returned.
       * @see https://core.telegram.org/bots/api#getmycommands
       */
      getMyCommands(form = {}) {
        if (form.scope) {
          form.scope = stringify2(form.scope);
        }
        return this._request("getMyCommands", { form });
      }
      /**
       * Use this method to change the bot's name.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setmyname
       */
      setMyName(form = {}) {
        return this._request("setMyName", { form });
      }
      /**
       * Use this method to get the current bot name for the given user language.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} [BotName](https://core.telegram.org/bots/api#botname) on success
       * @see https://core.telegram.org/bots/api#getmyname
       */
      getMyName(form = {}) {
        return this._request("getMyName", { form });
      }
      /**
       * Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
       *
       * Returns True on success.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setmydescription
       */
      setMyDescription(form = {}) {
        return this._request("setMyDescription", { form });
      }
      /**
       * Use this method to get the current bot description for the given user language.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Returns [BotDescription](https://core.telegram.org/bots/api#botdescription) on success.
       * @see https://core.telegram.org/bots/api#getmydescription
       */
      getMyDescription(form = {}) {
        return this._request("getMyDescription", { form });
      }
      /**
       * Use this method to change the bot's short description, which is shown on the bot's profile page
       * and is sent together with the link when users share the bot.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Returns True on success.
       * @see https://core.telegram.org/bots/api#setmyshortdescription
       */
      setMyShortDescription(form = {}) {
        return this._request("setMyShortDescription", { form });
      }
      /**
       * Use this method to get the current bot short description for the given user language.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success.
       * @see https://core.telegram.org/bots/api#getmyshortdescription
       */
      getMyShortDescription(form = {}) {
        return this._request("getMyShortDescription", { form });
      }
      /**
       * Use this method to change the bot's menu button in a private chat, or the default menu button.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setchatmenubutton
       */
      setChatMenuButton(form = {}) {
        return this._request("setChatMenuButton", { form });
      }
      /**
       * Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} [MenuButton](https://core.telegram.org/bots/api#menubutton) on success
       * @see https://core.telegram.org/bots/api#getchatmenubutton
       */
      getChatMenuButton(form = {}) {
        return this._request("getChatMenuButton", { form });
      }
      /**
       * Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
       *
       * These rights will be suggested to users, but they are are free to modify the list before adding the bot.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#getchatmenubutton
       */
      setMyDefaultAdministratorRights(form = {}) {
        return this._request("setMyDefaultAdministratorRights", { form });
      }
      /**
       * Use this method to get the current default administrator rights of the bot.
       *
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} [ChatAdministratorRights](https://core.telegram.org/bots/api#chatadministratorrights) on success
       * @see https://core.telegram.org/bots/api#getmydefaultadministratorrights
       */
      getMyDefaultAdministratorRights(form = {}) {
        return this._request("getMyDefaultAdministratorRights", { form });
      }
      /**
       * Use this method to edit text or [game](https://core.telegram.org/bots/api#games) messages sent by the bot or via the bot (for inline bots).
       *
       * Note: that **you must provide one of chat_id, message_id, or inline_message_id** in your request.
       *
       * @param  {String} text  New text of the message
       * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
       * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
       * @see https://core.telegram.org/bots/api#editmessagetext
       */
      editMessageText(text, form = {}) {
        form.text = text;
        return this._request("editMessageText", { form });
      }
      /**
       * Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
       *
       * Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
       *
       * @param  {String} caption  New caption of the message
       * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
       * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
       * @see https://core.telegram.org/bots/api#editmessagecaption
       */
      editMessageCaption(caption, form = {}) {
        form.caption = caption;
        return this._request("editMessageCaption", { form });
      }
      /**
       * Use this method to edit animation, audio, document, photo, or video messages.
       *
       * If a message is a part of a message album, then it can be edited only to a photo or a video.
       *
       * Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
       * Use previously uploaded file via its file_id or specify a URL.
       *
       * Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
       *
       * @param  {Object} media  A JSON-serialized object for a new media content of the message
       * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
       * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
       * @see https://core.telegram.org/bots/api#editmessagemedia
       */
      editMessageMedia(media, form = {}) {
        const regexAttach = /attach:\/\/.+/;
        if (typeof media.media === "string" && regexAttach.test(media.media)) {
          const opts = {
            qs: form
          };
          opts.formData = {};
          const payload = Object.assign({}, media);
          delete payload.media;
          try {
            const attachName = String(0);
            const [formData] = this._formatSendData(
              attachName,
              media.media.replace("attach://", ""),
              media.fileOptions
            );
            if (formData) {
              opts.formData[attachName] = formData[attachName];
              payload.media = `attach://${attachName}`;
            } else {
              throw new errors.FatalError(`Failed to process the replacement action for your ${media.type}`);
            }
          } catch (ex) {
            return Promise.reject(ex);
          }
          opts.qs.media = stringify2(payload);
          return this._request("editMessageMedia", opts);
        }
        form.media = stringify2(media);
        return this._request("editMessageMedia", { form });
      }
      /**
       * Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
       *
       * Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
       *
       * @param  {Object} replyMarkup  A JSON-serialized object for an inline keyboard.
       * @param  {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
       * @return {Promise} On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
       * @see https://core.telegram.org/bots/api#editmessagetext
       */
      editMessageReplyMarkup(replyMarkup, form = {}) {
        form.reply_markup = replyMarkup;
        return this._request("editMessageReplyMarkup", { form });
      }
      /**
       * Use this method to stop a poll which was sent by the bot.
       *
       * @param  {Number|String} chatId  Unique identifier for the group/channel
       * @param  {Number} pollId Identifier of the original message with the poll
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the stopped [Poll](https://core.telegram.org/bots/api#poll) is returned
       * @see https://core.telegram.org/bots/api#stoppoll
       */
      stopPoll(chatId, pollId, form = {}) {
        form.chat_id = chatId;
        form.message_id = pollId;
        return this._request("stopPoll", { form });
      }
      /**
       * Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
       * or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String|stream.Stream|Buffer} sticker A file path, Stream or Buffer.
       * Can also be a `file_id` previously uploaded. Stickers are WebP format files.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
       * @see https://core.telegram.org/bots/api#sendsticker
       */
      sendSticker(chatId, sticker, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.chat_id = chatId;
        try {
          const sendData = this._formatSendData("sticker", sticker, fileOptions);
          opts.formData = sendData[0];
          opts.qs.sticker = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("sendSticker", opts);
      }
      /**
       * Use this method to get a sticker set.
       *
       * @param  {String} name Name of the sticker set
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned
       * @see https://core.telegram.org/bots/api#getstickerset
       */
      getStickerSet(name, form = {}) {
        form.name = name;
        return this._request("getStickerSet", { form });
      }
      /**
       * Use this method to get information about custom emoji stickers by their identifiers.
       *
       * @param  {Array} custom_emoji_ids List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.
       * @see https://core.telegram.org/bots/api#getcustomemojistickers
       */
      getCustomEmojiStickers(customEmojiIds, form = {}) {
        form.custom_emoji_ids = stringify2(customEmojiIds);
        return this._request("getCustomEmojiStickers", { form });
      }
      /**
       * Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
       * times).
       *
       * @param  {Number} userId User identifier of sticker file owner
       * @param  {String|stream.Stream|Buffer} sticker A file path or a Stream with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. Can also be a `file_id` previously uploaded.
       * @param {String} stickerFormat Allow values:  `static`, `animated` or `video`
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} On success, a [File](https://core.telegram.org/bots/api#file) object is returned
       * @see https://core.telegram.org/bots/api#uploadstickerfile
       */
      uploadStickerFile(userId, sticker, stickerFormat = "static", options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.user_id = userId;
        opts.qs.sticker_format = stickerFormat;
        try {
          const sendData = this._formatSendData("sticker", sticker, fileOptions);
          opts.formData = sendData[0];
          opts.qs.sticker = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("uploadStickerFile", opts);
      }
      /**
       * Use this method to create new sticker set owned by a user.
       *
       * The bot will be able to edit the created sticker set.
       *
       * You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
       *
       * @param  {Number} userId User identifier of created sticker set owner
       * @param  {String} name Short name of sticker set, to be used in `t.me/addstickers/` URLs (e.g.,   *"animals"*). Can contain only english letters, digits and underscores.
       *  Must begin with a letter, can't contain consecutive underscores and must end in `"_by_<bot_username>"`. `<bot_username>` is case insensitive. 1-64 characters.
       * @param  {String} title Sticker set title, 1-64 characters
       * @param  {String|stream.Stream|Buffer} pngSticker Png image with the sticker, must be up to 512 kilobytes in size,
       *  dimensions must not exceed 512px, and either width or height must be exactly 512px.
       * @param  {String} emojis One or more emoji corresponding to the sticker
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise}  True on success
       * @see https://core.telegram.org/bots/api#createnewstickerset
       */
      createNewStickerSet(userId, name, title, pngSticker, emojis, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.user_id = userId;
        opts.qs.name = name;
        opts.qs.title = title;
        opts.qs.emojis = emojis;
        opts.qs.mask_position = stringify2(options.mask_position);
        try {
          const sendData = this._formatSendData("png_sticker", pngSticker, fileOptions);
          opts.formData = sendData[0];
          opts.qs.png_sticker = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("createNewStickerSet", opts);
      }
      /**
       * Use this method to add a new sticker to a set created by the bot.
       *
       * You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
       *
       * Animated stickers can be added to animated sticker sets and only to them
       *
       * Note:
       * - Emoji sticker sets can have up to 200 sticker
       * - Static or Animated sticker sets can have up to 120 stickers
       *
       * @param  {Number} userId User identifier of sticker set owner
       * @param  {String} name Sticker set name
       * @param  {String|stream.Stream|Buffer} sticker Png image with the sticker (must be up to 512 kilobytes in size,
       * dimensions must not exceed 512px, and either width or height must be exactly 512px, [TGS animation](https://core.telegram.org/stickers#animated-sticker-requirements)
       * with the sticker or [WEBM video](https://core.telegram.org/stickers#video-sticker-requirements) with the sticker.
       * @param  {String} emojis One or more emoji corresponding to the sticker
       * @param  {String} stickerType Allow values: `png_sticker`, `tgs_sticker`, or `webm_sticker`.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise}  True on success
       * @see https://core.telegram.org/bots/api#addstickertoset
       */
      addStickerToSet(userId, name, sticker, emojis, stickerType = "png_sticker", options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.user_id = userId;
        opts.qs.name = name;
        opts.qs.emojis = emojis;
        opts.qs.mask_position = stringify2(options.mask_position);
        if (typeof stickerType !== "string" || ["png_sticker", "tgs_sticker", "webm_sticker"].indexOf(stickerType) === -1) {
          return Promise.reject(new Error("stickerType must be a string and the allow types is: png_sticker, tgs_sticker, webm_sticker"));
        }
        try {
          const sendData = this._formatSendData(stickerType, sticker, fileOptions);
          opts.formData = sendData[0];
          opts.qs[stickerType] = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("addStickerToSet", opts);
      }
      /**
       * Use this method to move a sticker in a set created by the bot to a specific position.
       *
       * @param  {String} sticker File identifier of the sticker
       * @param  {Number} position New sticker position in the set, zero-based
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setstickerpositioninset
       */
      setStickerPositionInSet(sticker, position, form = {}) {
        form.sticker = sticker;
        form.position = position;
        return this._request("setStickerPositionInSet", { form });
      }
      /**
       * Use this method to delete a sticker from a set created by the bot.
       *
       * @param  {String} sticker File identifier of the sticker
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#deletestickerfromset
       * @todo Add tests for this method!
       */
      deleteStickerFromSet(sticker, form = {}) {
        form.sticker = sticker;
        return this._request("deleteStickerFromSet", { form });
      }
      /**
       * Use this method to replace an existing sticker in a sticker set with a new one
       *
       * @param  {Number} user_id User identifier of the sticker set owner
       * @param  {String} name Sticker set name
       * @param  {String} sticker File identifier of the sticker
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#replacestickerinset
       * @todo Add tests for this method!
       */
      replaceStickerInSet(userId, name, oldSticker, form = {}) {
        form.user_id = userId;
        form.name = name;
        form.old_sticker = oldSticker;
        return this._request("deleteStickerFromSet", { form });
      }
      /**
       * Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
       *
       * The sticker must belong to a sticker set created by the bot.
       *
       * @param  {String} sticker File identifier of the sticker
       * @param { Array } emojiList A JSON-serialized list of 1-20 emoji associated with the sticker
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setstickeremojilist
       */
      setStickerEmojiList(sticker, emojiList, form = {}) {
        form.sticker = sticker;
        form.emoji_list = stringify2(emojiList);
        return this._request("setStickerEmojiList", { form });
      }
      /**
       * Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.
       *
       * The sticker must belong to a sticker set created by the bot.
       *
       * @param  {String} sticker File identifier of the sticker
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setstickerkeywords
       */
      setStickerKeywords(sticker, form = {}) {
        form.sticker = sticker;
        if (form.keywords) {
          form.keywords = stringify2(form.keywords);
        }
        return this._request("setStickerKeywords", { form });
      }
      /**
       * Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.
       *
       * The sticker must belong to a sticker set created by the bot.
       *
       * @param  {String} sticker File identifier of the sticker
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setstickermaskposition
       */
      setStickerMaskPosition(sticker, form = {}) {
        form.sticker = sticker;
        if (form.mask_position) {
          form.mask_position = stringify2(form.mask_position);
        }
        return this._request("setStickerMaskPosition", { form });
      }
      /**
       * Use this method to set the title of a created sticker set.
       *
       * The sticker must belong to a sticker set created by the bot.
       *
       * @param  {String} name Sticker set name
       * @param  {String} title Sticker set title, 1-64 characters
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setstickersettitle
       */
      setStickerSetTitle(name, title, form = {}) {
        form.name = name;
        form.title = title;
        return this._request("setStickerSetTitle", { form });
      }
      /**
       * Use this method to add a thumb to a set created by the bot.
       *
       * Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only
       *
       * @param  {Number} userId User identifier of sticker set owner
       * @param  {String} name Sticker set name
       * @param  {String|stream.Stream|Buffer} thumbnail A .WEBP or .PNG image with the thumbnail,
       * must be up to 128 kilobytes in size and have width and height exactly 100px,
       * a TGS animation with the thumbnail up to 32 kilobytes in size or a WEBM video with the thumbnail up to 32 kilobytes in size.
       *
       * Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram
       * to get a file from the Internet, or upload a new one. Animated sticker set thumbnails can't be uploaded via HTTP URL.
       * @param  {Object} [options] Additional Telegram query options
       * @param  {Object} [fileOptions] Optional file related meta-data
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setstickersetthumbnail
       */
      setStickerSetThumbnail(userId, name, thumbnail, options = {}, fileOptions = {}) {
        const opts = {
          qs: options
        };
        opts.qs.user_id = userId;
        opts.qs.name = name;
        opts.qs.mask_position = stringify2(options.mask_position);
        try {
          const sendData = this._formatSendData("thumbnail", thumbnail, fileOptions);
          opts.formData = sendData[0];
          opts.qs.thumbnail = sendData[1];
        } catch (ex) {
          return Promise.reject(ex);
        }
        return this._request("setStickerSetThumbnail", opts);
      }
      /**
       * Use this method to set the thumbnail of a custom emoji sticker set.
       *
       * The sticker must belong to a sticker set created by the bot.
       *
       * @param  {String} name Sticker set name
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
       */
      setCustomEmojiStickerSetThumbnail(name, form = {}) {
        form.name = name;
        return this._request("setCustomEmojiStickerSetThumbnail", { form });
      }
      /**
       * Use this method to delete a sticker set that was created by the bot.
       *
       * The sticker must belong to a sticker set created by the bot.
       *
       * @param  {String} name Sticker set name
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} True on success
       * @see https://core.telegram.org/bots/api#deletestickerset
       */
      deleteStickerSet(name, form = {}) {
        form.name = name;
        return this._request("deleteStickerSet", { form });
      }
      /**
       * Send answers to an inline query.
       *
       * Note: No more than 50 results per query are allowed.
       *
       * @param  {String} inlineQueryId Unique identifier of the query
       * @param  {InlineQueryResult[]} results An array of results for the inline query
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, True is returned
       * @see https://core.telegram.org/bots/api#answerinlinequery
       */
      answerInlineQuery(inlineQueryId, results, form = {}) {
        form.inline_query_id = inlineQueryId;
        form.results = stringify2(results);
        return this._request("answerInlineQuery", { form });
      }
      /**
       * Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
       * and send a corresponding message on behalf of the user to the chat from which the query originated.
       *
       * @param  {String} webAppQueryId Unique identifier for the query to be answered
       * @param  {InlineQueryResult} result object that represents one result of an inline query
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, a [SentWebAppMessage](https://core.telegram.org/bots/api#sentwebappmessage) object is returned
       * @see https://core.telegram.org/bots/api#answerwebappquery
       */
      answerWebAppQuery(webAppQueryId, result, form = {}) {
        form.web_app_query_id = webAppQueryId;
        form.result = stringify2(result);
        return this._request("answerWebAppQuery", { form });
      }
      /**
       * Use this method to send an invoice.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} title Product name, 1-32 characters
       * @param  {String} description Product description, 1-255 characters
       * @param  {String} payload Bot defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
       * @param  {String} providerToken Payments provider token, obtained via `@BotFather`
       * @param  {String} currency Three-letter ISO 4217 currency code
       * @param  {Array} prices Breakdown of prices
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
       * @see https://core.telegram.org/bots/api#sendinvoice
       */
      sendInvoice(chatId, title, description, payload, providerToken, currency, prices, form = {}) {
        form.chat_id = chatId;
        form.title = title;
        form.description = description;
        form.payload = payload;
        form.provider_token = providerToken;
        form.currency = currency;
        form.prices = stringify2(prices);
        form.provider_data = stringify2(form.provider_data);
        if (form.suggested_tip_amounts) {
          form.suggested_tip_amounts = stringify2(form.suggested_tip_amounts);
        }
        return this._request("sendInvoice", { form });
      }
      /**
      * Use this method to create a link for an invoice.
      *
      * @param {String} title Product name, 1-32 characters
      * @param {String} description Product description, 1-255 characters
      * @param {String} payload Bot defined invoice payload
      * @param {String} providerToken Payment provider token
      * @param {String} currency Three-letter ISO 4217 currency code
      * @param {Array} prices Breakdown of prices
      * @param {Object} [options] Additional Telegram query options
      * @returns {Promise} The created invoice link as String on success.
      * @see https://core.telegram.org/bots/api#createinvoicelink
      */
      createInvoiceLink(title, description, payload, providerToken, currency, prices, form = {}) {
        form.title = title;
        form.description = description;
        form.payload = payload;
        form.provider_token = providerToken;
        form.currency = currency;
        form.prices = stringify2(prices);
        return this._request("createInvoiceLink", { form });
      }
      /**
      * Use this method to reply to shipping queries.
      *
      * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
      * the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a shipping_query field to the bot
      *
      * @param  {String} shippingQueryId  Unique identifier for the query to be answered
      * @param  {Boolean} ok Specify if delivery of the product is possible
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} On success, True is returned
      * @see https://core.telegram.org/bots/api#answershippingquery
      */
      answerShippingQuery(shippingQueryId, ok, form = {}) {
        form.shipping_query_id = shippingQueryId;
        form.ok = ok;
        form.shipping_options = stringify2(form.shipping_options);
        return this._request("answerShippingQuery", { form });
      }
      /**
       * Use this method to respond to such pre-checkout queries
       *
       * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of
       * an [Update](https://core.telegram.org/bots/api#update) with the field *pre_checkout_query*.
       *
       * **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
       *
       * @param  {String} preCheckoutQueryId  Unique identifier for the query to be answered
       * @param  {Boolean} ok Specify if every order details are ok
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, True is returned
       * @see https://core.telegram.org/bots/api#answerprecheckoutquery
       */
      answerPreCheckoutQuery(preCheckoutQueryId, ok, form = {}) {
        form.pre_checkout_query_id = preCheckoutQueryId;
        form.ok = ok;
        return this._request("answerPreCheckoutQuery", { form });
      }
      /**
       * Use this method to send a game.
       *
       * @param  {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
       * @param  {String} gameShortName name of the game to be sent. Set up your games via `@BotFather`.
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
       * @see https://core.telegram.org/bots/api#sendgame
       */
      sendGame(chatId, gameShortName, form = {}) {
        form.chat_id = chatId;
        form.game_short_name = gameShortName;
        return this._request("sendGame", { form });
      }
      /**
       * Use this method to set the score of the specified user in a game message.
       *
       * @param  {Number} userId  Unique identifier of the target user
       * @param  {Number} score New score value, must be non-negative
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, if the message is not an inline message, the [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
       * @see https://core.telegram.org/bots/api#setgamescore
       */
      setGameScore(userId, score, form = {}) {
        form.user_id = userId;
        form.score = score;
        return this._request("setGameScore", { form });
      }
      /**
       * Use this method to get data for high score tables.
       *
       * Will return the score of the specified user and several of their neighbors in a game.
       *
       * @param  {Number} userId  Unique identifier of the target user
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise} On success, returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects
       * @see https://core.telegram.org/bots/api#getgamehighscores
       */
      getGameHighScores(userId, form = {}) {
        form.user_id = userId;
        return this._request("getGameHighScores", { form });
      }
      /**
      * Use this method to delete a message, including service messages, with the following limitations:
      * - A message can only be deleted if it was sent less than 48 hours ago.
      * - A dice message can only be deleted if it was sent more than 24 hours ago.
      * - Bots can delete outgoing messages in groups and supergroups.
      * - Bots can delete incoming messages in groups, supergroups and channels.
      * - Bots granted `can_post_messages` permissions can delete outgoing messages in channels.
      * - If the bot is an administrator of a group, it can delete any message there.
      * - If the bot has `can_delete_messages` permission in a supergroup, it can delete any message there.
      *
      * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format @channelusername)
      * @param  {Number} messageId  Unique identifier of the target message
      * @param  {Object} [options] Additional Telegram query options
      * @return {Promise} True on success
      * @see https://core.telegram.org/bots/api#deletemessage
      */
      deleteMessage(chatId, messageId, form = {}) {
        form.chat_id = chatId;
        form.message_id = messageId;
        return this._request("deleteMessage", { form });
      }
      /**
       * Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
       *
       * @param  {Number|String} chatId  Unique identifier for the target chat or username of the target channel (in the format @channelusername)
       * @param  {Array<Number|String>} messageIds  Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted
       * @param  {Object} [options] Additional Telegram query options
       * @return {Promise<Boolean>} True on success
       * @see https://core.telegram.org/bots/api#deletemessages
       */
      deleteMessages(chatId, messageIds, form = {}) {
        form.chat_id = chatId;
        form.message_ids = stringify2(messageIds);
        return this._request("deleteMessages", { form });
      }
    };
    module2.exports = TelegramBot2;
  }
});

// node_modules/node-telegram-bot-api/index.js
var require_node_telegram_bot_api = __commonJS({
  "node_modules/node-telegram-bot-api/index.js"(exports2, module2) {
    var majorVersion = parseInt(process.versions.node.split(".")[0], 10);
    if (majorVersion <= 5) {
      const deprecate = require_utils4().deprecate;
      deprecate("Node.js v5.x and below will no longer be supported in the future");
      module2.exports = require_telegram2();
    } else {
      module2.exports = require_telegram3();
    }
  }
});

// src/main.ts
var main_exports = {};
__export(main_exports, {
  default: () => TelegramSyncPlugin
});
module.exports = __toCommonJS(main_exports);
var import_obsidian16 = require("obsidian");

// src/settings/Settings.ts
var import_obsidian14 = require("obsidian");

// src/utils/logUtils.ts
var import_obsidian4 = require("obsidian");

// src/telegram/user/sync.ts
var import_telegram5 = __toESM(require_telegram());

// src/telegram/user/client.ts
var import_telegram3 = __toESM(require_telegram());
var import_sessions = __toESM(require_sessions());

// node_modules/compare-versions/lib/esm/utils.js
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
var validateAndParse = (version2) => {
  if (typeof version2 !== "string") {
    throw new TypeError("Invalid argument expected string");
  }
  const match = version2.match(semver);
  if (!match) {
    throw new Error(`Invalid argument not valid semver ('${version2}' received)`);
  }
  match.shift();
  return match;
};
var isWildcard = (s) => s === "*" || s === "x" || s === "X";
var tryParse = (v) => {
  const n = parseInt(v, 10);
  return isNaN(n) ? v : n;
};
var forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
var compareStrings = (a, b) => {
  if (isWildcard(a) || isWildcard(b))
    return 0;
  const [ap, bp] = forceType(tryParse(a), tryParse(b));
  if (ap > bp)
    return 1;
  if (ap < bp)
    return -1;
  return 0;
};
var compareSegments = (a, b) => {
  for (let i = 0; i < Math.max(a.length, b.length); i++) {
    const r = compareStrings(a[i] || "0", b[i] || "0");
    if (r !== 0)
      return r;
  }
  return 0;
};

// node_modules/compare-versions/lib/esm/compareVersions.js
var compareVersions = (v12, v2) => {
  const n1 = validateAndParse(v12);
  const n2 = validateAndParse(v2);
  const p1 = n1.pop();
  const p2 = n2.pop();
  const r = compareSegments(n1, n2);
  if (r !== 0)
    return r;
  if (p1 && p2) {
    return compareSegments(p1.split("."), p2.split("."));
  } else if (p1 || p2) {
    return p1 ? -1 : 1;
  }
  return 0;
};

// release-notes.mjs
var releaseVersion = "4.0.0";
var showNewFeatures = true;
var showBreakingChanges = true;
var newFeatures = `In this release, security has been enhanced by encrypting the bot token`;
var breakingChanges = `\u26A0\uFE0F <b><i>Breaking changes!

Bot token may need to be re-entered.</i></b> \u26A0\uFE0F`;
var telegramChannelLink = "https://t.me/obsidian_telegram_sync";
var insiderFeaturesLink = "https://github.com/soberhacker/obsidian-telegram-sync/blob/main/docs/Telegram%20Sync%20Insider%20Features.md";
var telegramChannelAHref = `<a href='${telegramChannelLink}'>channel</a>`;
var insiderFeaturesAHref = `<a href='${insiderFeaturesLink}'>insider features</a>`;
var telegramChannelIntroduction = `Subscribe for free to the plugin's ${telegramChannelAHref} and enjoy access to ${insiderFeaturesAHref} and the latest beta versions, several months ahead of public release.`;
var telegramChatLink = "<a href='https://t.me/tribute/app?startapp=sfFf'>chat</a>";
var telegramChatIntroduction = `Join the plugin's ${telegramChatLink} - your space to seek advice, ask questions, and share knowledge (access via the tribute bot).`;
var donation = `If you appreciate this plugin and would like to support its continued development, please consider donating through the buttons below or via Telegram Stars in the ${telegramChannelAHref}!`;
var bestRegards = "Best regards,\nYour soberhacker\u{1F343}\u{1F9D8}\u{1F4BB}\n\u231E";
var privacyPolicyLink = "https://github.com/soberhacker/obsidian-telegram-sync/blob/main/PRIVACY-POLICY.md";
var notes = `
<u><b>Telegram Sync ${releaseVersion}</b></u>

\u{1F195} ${newFeatures}

\u{1F4A1} ${telegramChannelIntroduction}

\u{1F4AC} ${telegramChatIntroduction}

\u{1F984} ${donation}

${bestRegards}`;
function versionALessThanVersionB(versionA, versionB) {
  if (!versionA || !versionB)
    return void 0;
  return compareVersions(versionA, versionB) == -1;
}
var check = process.argv[2] === "check";
if (check) {
  const packageVersion = process.env.npm_package_version;
  if (packageVersion !== releaseVersion) {
    console.error(`Failed! Release notes are outdated! ${packageVersion} !== ${releaseVersion}`);
    process.exit(1);
  }
}

// src/telegram/user/client.ts
var import_qrcode = __toESM(require_browser2());
var import_os = __toESM(require("os"));

// src/telegram/convertors/botFileToMessageMedia.ts
var import_big_integer = __toESM(require_BigInteger());
var import_telegram = __toESM(require_telegram());
var import_buffer = require("buffer");
var WEB_LOCATION_FLAG = 1 << 24;
var FILE_REFERENCE_FLAG = 1 << 25;
var FileType = /* @__PURE__ */ ((FileType2) => {
  FileType2[FileType2["THUMBNAIL"] = 0] = "THUMBNAIL";
  FileType2[FileType2["CHAT_PHOTO"] = 1] = "CHAT_PHOTO";
  FileType2[FileType2["PHOTO"] = 2] = "PHOTO";
  FileType2[FileType2["VOICE"] = 3] = "VOICE";
  FileType2[FileType2["VIDEO"] = 4] = "VIDEO";
  FileType2[FileType2["DOCUMENT"] = 5] = "DOCUMENT";
  FileType2[FileType2["ENCRYPTED"] = 6] = "ENCRYPTED";
  FileType2[FileType2["TEMP"] = 7] = "TEMP";
  FileType2[FileType2["STICKER"] = 8] = "STICKER";
  FileType2[FileType2["AUDIO"] = 9] = "AUDIO";
  FileType2[FileType2["ANIMATION"] = 10] = "ANIMATION";
  FileType2[FileType2["ENCRYPTED_THUMBNAIL"] = 11] = "ENCRYPTED_THUMBNAIL";
  FileType2[FileType2["WALLPAPER"] = 12] = "WALLPAPER";
  FileType2[FileType2["VIDEO_NOTE"] = 13] = "VIDEO_NOTE";
  FileType2[FileType2["SECURE_RAW"] = 14] = "SECURE_RAW";
  FileType2[FileType2["SECURE"] = 15] = "SECURE";
  FileType2[FileType2["BACKGROUND"] = 16] = "BACKGROUND";
  FileType2[FileType2["DOCUMENT_AS_FILE"] = 17] = "DOCUMENT_AS_FILE";
  return FileType2;
})(FileType || {});
var PHOTO_TYPES = /* @__PURE__ */ new Set([
  0 /* THUMBNAIL */,
  1 /* CHAT_PHOTO */,
  2 /* PHOTO */,
  12 /* WALLPAPER */,
  11 /* ENCRYPTED_THUMBNAIL */
]);
var DOCUMENT_TYPES = new Set(Object.values(FileType));
for (const item of PHOTO_TYPES) {
  DOCUMENT_TYPES.delete(item);
}
function convertBotFileToMessageMedia(fileId, fileSize) {
  const decoded = rle_decode(b64_decode(fileId));
  const major = decoded[decoded.length - 1];
  const buffer = major < 4 ? decoded.slice(0, -1) : decoded.slice(0, -2);
  let bufferPosition = 0;
  let fileType = buffer.readInt32LE(bufferPosition);
  bufferPosition += 4;
  const dcId = buffer.readInt32LE(bufferPosition);
  bufferPosition += 4;
  const hasWebLocation = Boolean(fileType & WEB_LOCATION_FLAG);
  const hasFileReference = Boolean(fileType & FILE_REFERENCE_FLAG);
  fileType &= ~WEB_LOCATION_FLAG;
  fileType &= ~FILE_REFERENCE_FLAG;
  if (!(fileType in FileType)) {
    throw new Error(`Unknown file_type ${fileType} of file_id ${fileId}`);
  }
  if (hasWebLocation) {
    const { result: url, newPosition } = readString(buffer, bufferPosition);
    bufferPosition = newPosition;
    const accessHash = buffer.readBigInt64LE(bufferPosition);
    bufferPosition += 8;
    const webpage = new import_telegram.Api.WebPage({
      id: (0, import_big_integer.default)(accessHash),
      hash: Number(accessHash.toString),
      url,
      displayUrl: url,
      attributes: []
    });
    return new import_telegram.Api.MessageMediaWebPage({
      webpage
    });
  }
  let fileReference;
  if (hasFileReference) {
    const { result, newPosition } = readBytes(buffer, bufferPosition);
    fileReference = result;
    bufferPosition = newPosition;
  } else {
    fileReference = import_buffer.Buffer.alloc(0);
  }
  const media_id = BigInt(buffer.readBigInt64LE(bufferPosition).toString());
  bufferPosition += 8;
  const access_hash = BigInt(buffer.readBigInt64LE(bufferPosition).toString());
  bufferPosition += 8;
  if (PHOTO_TYPES.has(fileType)) {
    const photo = new import_telegram.Api.Photo({
      id: (0, import_big_integer.default)(media_id),
      accessHash: (0, import_big_integer.default)(access_hash),
      fileReference,
      dcId,
      date: 0,
      sizes: []
    });
    return new import_telegram.Api.MessageMediaPhoto({
      photo
    });
  }
  const document2 = new import_telegram.Api.Document({
    id: (0, import_big_integer.default)(media_id),
    accessHash: (0, import_big_integer.default)(access_hash),
    mimeType: "",
    date: 0,
    size: (0, import_big_integer.default)(fileSize),
    dcId,
    fileReference,
    attributes: []
  });
  return new import_telegram.Api.MessageMediaDocument({
    document: document2
  });
}
function extractMediaId(fileId) {
  const decoded = rle_decode(b64_decode(fileId));
  const major = decoded[decoded.length - 1];
  const buffer = major < 4 ? decoded.slice(0, -1) : decoded.slice(0, -2);
  let bufferPosition = 0;
  let fileType = buffer.readInt32LE(bufferPosition);
  bufferPosition += 4;
  buffer.readInt32LE(bufferPosition);
  bufferPosition += 4;
  const hasFileReference = Boolean(fileType & FILE_REFERENCE_FLAG);
  fileType &= ~WEB_LOCATION_FLAG;
  fileType &= ~FILE_REFERENCE_FLAG;
  if (!(fileType in FileType)) {
    throw new Error(`Unknown file_type ${fileType} of file_id ${fileId}`);
  }
  if (hasFileReference) {
    const { newPosition } = readBytes(buffer, bufferPosition);
    bufferPosition = newPosition;
  }
  const mediaId = buffer.readBigInt64LE(bufferPosition);
  return mediaId.toString();
}
function b64_decode(s) {
  const base64Padded = s + "=".repeat(mod(-s.length, 4));
  return import_buffer.Buffer.from(base64Padded, "base64");
}
function rle_decode(s) {
  const r = [];
  let z = false;
  for (let i = 0; i < s.length; i++) {
    const b = s[i];
    if (!b) {
      z = true;
      continue;
    }
    if (z) {
      r.push(...Array(b).fill(0));
      z = false;
    } else {
      r.push(b);
    }
  }
  return import_buffer.Buffer.from(r);
}
function readBytes(buffer, position) {
  let length = buffer.readUInt8(position);
  position += 1;
  let padding = 0;
  if (length > 253) {
    length = buffer.readUIntLE(position, 3);
    position += 3;
    padding = mod(-length, 4);
  } else {
    padding = mod(-(length + 1), 4);
  }
  const result = buffer.slice(position, position + length);
  position += length + padding;
  return { result, newPosition: position };
}
function readString(buffer, position) {
  const { result, newPosition } = readBytes(buffer, position);
  return { result: result.toString("utf8"), newPosition };
}
function mod(n, m) {
  return (n % m + m) % m;
}

// src/telegram/convertors/botMessageToClientMessage.ts
var import_telegram2 = __toESM(require_telegram());

// src/telegram/bot/message/getters.ts
var import_linkify_it = __toESM(require_linkify_it());
var fileTypes = ["photo", "video", "voice", "document", "audio", "video_note"];
function getForwardFromName(msg) {
  let forwardFromName = "";
  if (msg.forward_from || msg.forward_from_chat || msg.forward_sender_name || msg.from) {
    if (msg.forward_from) {
      forwardFromName = msg.forward_from.first_name + (msg.forward_from.last_name ? " " + msg.forward_from.last_name : "");
    } else if (msg.forward_from_chat) {
      forwardFromName = msg.forward_from_chat.title + (msg.forward_signature ? `(${msg.forward_signature})` : "") || msg.forward_from_chat.username || "";
    } else if (msg.forward_sender_name) {
      forwardFromName = msg.forward_sender_name;
    } else if (msg.from) {
      forwardFromName = msg.from.first_name + (msg.from.last_name ? " " + msg.from.last_name : "");
    }
  }
  return forwardFromName;
}
function getForwardFromLink(msg) {
  let forwardFromLink = "";
  if (msg.forward_from || msg.forward_from_chat || msg.forward_sender_name || msg.from) {
    const forwardFromName = getForwardFromName(msg);
    let username = "";
    if (msg.forward_from) {
      const forward_from_id = msg.forward_from.id < 0 ? msg.forward_from.id.toString().slice(4) : msg.forward_from.id.toString();
      username = msg.forward_from.username || "no_username_" + forward_from_id;
    } else if (msg.forward_from_chat) {
      const forward_from_chat_id = msg.forward_from_chat.id < 0 ? msg.forward_from_chat.id.toString().slice(4) : msg.forward_from_chat.id.toString();
      username = (msg.forward_from_chat.username || "c/" + forward_from_chat_id) + "/" + (msg.forward_from_message_id || "999999999");
    } else if (msg.forward_sender_name) {
      username = "hidden_account_" + msg.forward_date;
    } else if (msg.from) {
      const from_id = msg.from.id < 0 ? msg.from.id.toString().slice(4) : msg.from.id.toString();
      username = msg.from.username || "no_username_" + from_id;
    }
    forwardFromLink = `[${forwardFromName}](https://t.me/${username})`;
  }
  return forwardFromLink;
}
function getUserLink(msg) {
  if (!msg.from)
    return "";
  const from_id = msg.from.id < 0 ? msg.from.id.toString().slice(4) : msg.from.id.toString();
  const username = msg.from.username || "no_username_" + from_id;
  const fullName = `${msg.from.first_name} ${msg.from.last_name || ""}`.trim();
  return `[${fullName}](https://t.me/${username})`;
}
function getChatName(msg, botUser) {
  var _a;
  let chatName = "";
  if ((botUser == null ? void 0 : botUser.username) && msg.chat.id == ((_a = msg.from) == null ? void 0 : _a.id)) {
    chatName = `${botUser.first_name} ${botUser.last_name || ""}`.trim() || botUser.username;
  } else if (msg.chat.type == "private") {
    chatName = `${msg.chat.first_name} ${msg.chat.last_name || ""}`.trim();
  } else {
    chatName = msg.chat.title || msg.chat.type + msg.chat.id;
  }
  return chatName;
}
function getChatId(msg, botUser) {
  var _a;
  let chatId = "";
  if ((botUser == null ? void 0 : botUser.username) && msg.chat.id == ((_a = msg.from) == null ? void 0 : _a.id)) {
    chatId = botUser.id.toString();
  } else {
    chatId = msg.chat.id.toString();
  }
  return chatId;
}
function getChatLink(msg, botUser) {
  var _a, _b;
  let userName = "";
  if ((botUser == null ? void 0 : botUser.username) && msg.chat.id == ((_a = msg.from) == null ? void 0 : _a.id)) {
    userName = botUser == null ? void 0 : botUser.username;
  } else if (msg.chat.type == "private") {
    const chat_id = msg.chat.id < 0 ? msg.chat.id.toString().slice(4) : msg.chat.id.toString();
    userName = msg.chat.username || "no_username_" + chat_id;
  } else {
    const threadId = msg.chat.is_forum ? msg.message_thread_id || ((_b = msg.reply_to_message) == null ? void 0 : _b.message_thread_id) || "1" : "";
    const chatId = msg.chat.id < 0 ? msg.chat.id.toString().slice(4) : msg.chat.id.toString();
    userName = msg.chat.username || `c/${chatId}/${threadId}/${msg.message_id}`;
    userName = userName.replace(/\/\//g, "/");
  }
  const chatName = getChatName(msg, botUser);
  const chatLink = `[${chatName}](https://t.me/${userName})`;
  return chatLink;
}
function getUrl(msg, num = 1, lookInCaptions = true) {
  const text = (msg.text || "") + (lookInCaptions && msg.caption ? msg.caption : "");
  if (!text)
    return "";
  const linkify = (0, import_linkify_it.default)();
  const matches = linkify.match(text);
  return matches ? matches[num - 1].url : "";
}
function getHashtag(msg, num = 1, lookInCaptions = true) {
  var _a;
  const text = (msg.text || "") + (lookInCaptions && msg.caption ? msg.caption : "");
  if (!text)
    return "";
  const hashtags = text.match(/#[\p{L}\p{N}_]+/gu) || [];
  return ((_a = hashtags[num - 1]) == null ? void 0 : _a.replace("#", "")) || "";
}
function getInlineUrls(msg) {
  var _a;
  let urls = "";
  if (!((_a = msg.reply_markup) == null ? void 0 : _a.inline_keyboard) || msg.reply_markup.inline_keyboard.length == 0)
    return "";
  msg.reply_markup.inline_keyboard.forEach((buttonsGroup) => {
    buttonsGroup.forEach((button) => {
      if (button.url) {
        urls += `[${button.text}](${button.url})
`;
      }
    });
  });
  return urls.trimEnd();
}
function getTopicId(msg) {
  var _a;
  return msg.chat.is_forum && (msg.message_thread_id || ((_a = msg.reply_to_message) == null ? void 0 : _a.message_thread_id) || 1) || void 0;
}
async function getTopic(plugin, msg, throwError = true) {
  var _a, _b;
  if (!msg.chat.is_forum)
    return void 0;
  const reply = msg.reply_to_message;
  const topicId = getTopicId(msg) || 1;
  let topic = plugin.settings.topicNames.find((tn) => tn.chatId == msg.chat.id && tn.topicId == topicId);
  if (!topic && ((_a = reply == null ? void 0 : reply.forum_topic_created) == null ? void 0 : _a.name)) {
    topic = {
      name: (_b = reply == null ? void 0 : reply.forum_topic_created) == null ? void 0 : _b.name,
      chatId: msg.chat.id,
      topicId
    };
    plugin.settings.topicNames.push(topic);
    await plugin.saveSettings();
  }
  if (!topic && throwError) {
    throw new Error(
      "Telegram bot has a limitation to get topic names. if the topic name displays incorrect, set the name manually using bot command `/topicName NAME`"
    );
  }
  return topic;
}
async function getTopicLink(plugin, msg) {
  if (!msg.chat.is_forum)
    return "";
  const topic = await getTopic(plugin, msg);
  if (!topic)
    return "";
  const chatId = topic.chatId < 0 ? topic.chatId.toString().slice(4) : topic.chatId.toString();
  const path4 = (msg.chat.username || `c/${chatId}`) + `/${topic.topicId}`;
  return `[${topic.name}](https://t.me/${path4})`;
}
function getReplyMessageId(msg) {
  const reply = msg.reply_to_message;
  if (reply && reply.message_thread_id != reply.message_id) {
    return reply.message_id.toString();
  }
  return "";
}
function getFileObject(msg) {
  for (const fileType of fileTypes) {
    if (msg[fileType]) {
      return { fileType, fileObject: msg[fileType] };
    }
  }
  return { fileType: "undefined", fileObject: void 0 };
}

// src/utils/dateUtils.ts
var import_obsidian = require("obsidian");
function formatDateTime(date, format) {
  return (0, import_obsidian.moment)(date).format(format);
}
function date2DateString(date) {
  return (0, import_obsidian.moment)(date).format("YYYYMMDD");
}
function date2TimeString(date) {
  return (0, import_obsidian.moment)(date).format("HHmmssSSS");
}
function unixTime2Date(unixTime, offset2 = 0) {
  return new Date(unixTime * 1e3 + new Date().getMilliseconds() + offset2 % 1e3);
}
function date2UnixTime(date) {
  return Math.floor(date.getTime() / 1e3);
}
function getOffsetDate(offsetDays = 0, startDate = new Date()) {
  startDate.setDate(startDate.getDate() - offsetDays);
  return date2UnixTime(startDate);
}

// src/telegram/convertors/botMessageToClientMessage.ts
var cantFindTheMessage = "Can't find the message for connected user.";
var cachedMessageCouples = [];
var cachedMessagesRequests = [];
var cachedUserCouples = [];
var cachedMessagesIntervalId = setInterval(() => {
  if (cachedMessageCouples.length < 5e3)
    return;
  const lastMessageCouple = cachedMessageCouples.last();
  if (lastMessageCouple && new Date().getTime() - lastMessageCouple.creationTime.getTime() > _1h) {
    cachedMessagesRequests = [];
    cachedMessageCouples = [];
  }
}, _2h);
function clearCachedMessagesInterval() {
  clearInterval(cachedMessagesIntervalId);
}
function getMediaId(media) {
  if (!media)
    return void 0;
  if (media.document && media.document.id)
    return media.document.id;
  if (media.photo && media.photo.id)
    return media.photo.id;
  return void 0;
}
async function getInputPeer(client2, user, botUser, botMsg, limit = 10) {
  let userCouple = cachedUserCouples.find(
    (usrCouple) => usrCouple.botChatId == botMsg.chat.id && usrCouple.botUserId == botUser.id && usrCouple.userId == user.id.toJSNumber()
  );
  if (userCouple)
    return userCouple.userChat;
  const chatId = botMsg.chat.id == user.id.toJSNumber() ? botUser.id : botMsg.chat.id;
  const dialogs = await client2.getDialogs({ limit });
  const dialog = dialogs.find((d) => {
    var _a;
    return ((_a = d.id) == null ? void 0 : _a.toJSNumber()) == chatId;
  });
  if (!dialog && limit <= 20)
    return await getInputPeer(client2, user, botUser, botMsg, limit + 10);
  else if (!dialog || !dialog.inputEntity) {
    console.log(`Telegram Sync => Dialogs:
${dialogs}`);
    throw new Error(
      `User ${user.username || user.firstName || user.id} does not have chat with ${botMsg.chat.username || botMsg.chat.title || botMsg.chat.first_name || botMsg.chat.id} `
    );
  }
  userCouple = {
    botChatId: botMsg.chat.id,
    botUserId: botUser.id,
    userId: user.id.toJSNumber(),
    userChat: dialog.inputEntity
  };
  cachedUserCouples.push(userCouple);
  return dialog.inputEntity;
}
async function getMessage(client2, inputPeer, botMsg, mediaId, limit = 50) {
  var _a;
  let messageCouple = cachedMessageCouples.find((msgCouple) => msgCouple.botMsgId == botMsg.message_id);
  if (messageCouple == null ? void 0 : messageCouple.userMsg)
    return messageCouple.userMsg;
  const messagesRequests = cachedMessagesRequests.filter(
    (rq) => {
      var _a2;
      return rq.botChatId == botMsg.chat.id && rq.msgDate <= botMsg.date && (((_a2 = rq.messages.last()) == null ? void 0 : _a2.date) || botMsg.date - 1) >= botMsg.date;
    }
  );
  if (!messagesRequests.find((rq) => rq.limit == limit)) {
    if (new Date().getTime() - unixTime2Date(botMsg.date, botMsg.message_id).getTime() < _1sec)
      await new Promise((resolve) => setTimeout(resolve, _1sec));
    let messages2 = await client2.getMessages(inputPeer, { limit, reverse: true, offsetDate: botMsg.date - 2 });
    messages2 = messages2.filter((m) => m.fromId || m.peerId instanceof import_telegram2.Api.PeerChannel) || [];
    messagesRequests.push({ botChatId: botMsg.chat.id, msgDate: botMsg.date, messages: messages2, limit });
    cachedMessagesRequests.push(messagesRequests[0]);
  }
  if (!botMsg.text && !mediaId) {
    const { fileObject } = getFileObject(botMsg);
    const fileObjectToUse = fileObject instanceof Array ? fileObject.pop() : fileObject;
    mediaId = extractMediaId(fileObjectToUse.file_id);
  }
  const skipMsgIds = cachedMessageCouples.filter((msgCouple) => Math.abs(botMsg.date - msgCouple.date) <= 1 && msgCouple.botMsgId != botMsg.message_id).map((msgCouple) => msgCouple.userMsg && msgCouple.userMsg.id);
  const messages = messagesRequests.map((rq) => rq.messages).reduce((accumulator, msgs) => accumulator.concat(msgs));
  const unprocessedMessages = messages.filter((msg) => !skipMsgIds.contains(msg.id));
  const userMsg = findUserMsg(unprocessedMessages, botMsg, mediaId);
  if (!userMsg && limit < 200 && messages.length > 0 && botMsg.date + 1 >= (((_a = messages.last()) == null ? void 0 : _a.date) || botMsg.date + 1))
    return await getMessage(client2, inputPeer, botMsg, mediaId, limit + 150);
  if (!userMsg) {
    throw new Error(cantFindTheMessage);
  }
  if (cachedMessageCouples.find((mc) => mc.userMsg.id == userMsg.id)) {
    throw new Error(
      "Because there may be several identical messages, it is not possible to pinpoint which message is needed."
    );
  }
  messageCouple = {
    date: botMsg.date,
    creationTime: new Date(),
    botMsgId: botMsg.message_id,
    userMsg
  };
  cachedMessageCouples.push(messageCouple);
  return userMsg;
}
function findUserMsgByOffset(messages, botMsg, dateOffset = 0, mediaId) {
  return messages.find((m) => {
    var _a, _b;
    const equalDates = m.date + dateOffset == botMsg.date;
    if (!equalDates)
      return false;
    if (m.editDate)
      return true;
    const equalTexts = (m.message || "") == (botMsg.text || botMsg.caption || "");
    if (!equalTexts)
      return false;
    const equalGroup = (((_a = m.groupedId) == null ? void 0 : _a.toJSNumber()) || 0) == (botMsg.media_group_id || 0);
    if (!equalGroup)
      return false;
    const equalMedia = !(mediaId && m.media) || mediaId == ((_b = getMediaId(m.media)) == null ? void 0 : _b.toString());
    return equalMedia;
  });
}
function findUserMsg(messages, botMsg, mediaId) {
  return findUserMsgByOffset(messages, botMsg, 0, mediaId) || findUserMsgByOffset(messages, botMsg, 1, mediaId) || findUserMsgByOffset(messages, botMsg, -1, mediaId);
}

// src/telegram/user/client.ts
var import_Logger = __toESM(require_Logger());

// src/utils/fsUtils.ts
var import_obsidian2 = require("obsidian");
var import_path = __toESM(require("path"));
var defaultDelimiter = "\n\n***\n\n";
async function createFolderIfNotExist(vault, folderPath) {
  if (!vault || !folderPath) {
    return;
  }
  const folder = vault.getAbstractFileByPath((0, import_obsidian2.normalizePath)(folderPath));
  if (folder && folder instanceof import_obsidian2.TFolder) {
    return;
  }
  if (folder && folder instanceof import_obsidian2.TFile) {
    throw new URIError(
      `Folder "${folderPath}" can't be created because there is a file with the same name. Change the path or rename the file.`
    );
  }
  await vault.createFolder(folderPath).catch((error) => {
    if (error.message !== "Folder already exists.") {
      throw error;
    }
  });
}
function sanitizeFileName(fileName) {
  const invalidCharacters = /[\\/:*?"<>|\n\r]/g;
  return fileName.replace(invalidCharacters, "_");
}
function sanitizeFilePath(filePath) {
  const invalidCharacters = /[\\:*?"<>|\n\r]/g;
  return (0, import_obsidian2.normalizePath)(truncatePathComponents(filePath.replace(invalidCharacters, "_")));
}
async function getUniqueFilePath(vault, createdFilePaths, initialFilePath, date, fileExtension) {
  let fileFolderPath = import_path.default.dirname(initialFilePath);
  if (fileFolderPath != ".")
    await createFolderIfNotExist(vault, fileFolderPath);
  else
    fileFolderPath = "";
  let filePath = initialFilePath;
  if (!(vault.getAbstractFileByPath(filePath) instanceof import_obsidian2.TFile))
    return filePath;
  const initialFileName = import_path.default.basename(filePath, "." + fileExtension);
  const dateString = date2DateString(date);
  let fileId = Number(date2TimeString(date));
  const collectFileName = () => `${initialFileName} - ${dateString}${fileId}.${fileExtension}`;
  let fileName = collectFileName();
  let previousFilePath = "";
  while (previousFilePath != filePath && (createdFilePaths.includes(filePath) || vault.getAbstractFileByPath(filePath) instanceof import_obsidian2.TFile)) {
    previousFilePath = filePath;
    fileId += 1;
    fileName = collectFileName();
    filePath = fileFolderPath ? `${fileFolderPath}/${fileName}` : fileName;
  }
  createdFilePaths.push(filePath);
  return filePath;
}
async function appendContentToNote(vault, notePath, newContent, startLine = "", delimiter = defaultDelimiter, reversedOrder = false) {
  if (!notePath || !newContent.trim())
    return;
  if (startLine == void 0)
    startLine = "";
  const noteFile = vault.getAbstractFileByPath(notePath);
  let currentContent = "";
  if (noteFile)
    currentContent = await vault.read(noteFile);
  let index = reversedOrder ? 0 : currentContent.length;
  if (currentContent.length == 0 && !startLine)
    delimiter = "";
  newContent = reversedOrder ? newContent + delimiter : delimiter + newContent;
  if (startLine) {
    const startLineIndex = currentContent.indexOf(startLine);
    if (startLineIndex > -1)
      index = reversedOrder ? startLineIndex : startLineIndex + startLine.length;
    else
      newContent = reversedOrder ? newContent + startLine : startLine + newContent;
  }
  const content = currentContent.slice(0, index) + newContent + currentContent.slice(index);
  if (!noteFile)
    await vault.create(notePath, content);
  else if (currentContent != content)
    await vault.modify(noteFile, content);
}
function base64ToString(base64) {
  return Buffer.from(base64, "base64").toString("utf-8");
}
function truncatePathComponents(filePath, maxLength = 200) {
  const parsedPath = import_path.default.parse(filePath);
  const pathComponents = parsedPath.dir.split("/");
  const truncatedComponents = pathComponents.map(
    (component) => component.length > maxLength ? component.substring(0, maxLength) : component
  );
  const truncatedFileName = parsedPath.name.length > maxLength ? parsedPath.name.substring(0, maxLength) : parsedPath.name;
  const truncatedPath = import_path.default.join(...truncatedComponents, truncatedFileName + parsedPath.ext);
  return truncatedPath;
}
async function replaceMainJs(vault, mainJs) {
  const mainJsPath = (0, import_obsidian2.normalizePath)(vault.configDir + "/plugins/telegram-sync/main.js");
  const mainProdJsPath = (0, import_obsidian2.normalizePath)(vault.configDir + "/plugins/telegram-sync/main-prod.js");
  if (mainJs instanceof Buffer) {
    await vault.adapter.writeBinary(mainProdJsPath, await vault.adapter.readBinary(mainJsPath));
    await vault.adapter.writeBinary(mainJsPath, mainJs);
  } else {
    if (!await vault.adapter.exists(mainProdJsPath))
      return;
    await vault.adapter.writeBinary(mainJsPath, await vault.adapter.readBinary(mainProdJsPath));
  }
}

// src/telegram/user/config.ts
var id1 = "MjgzNw==";
var id2 = "NTY3NA==";
var id3 = "MmJhZjAxODY2MGY2OWFk";
var id4 = "MzMzYzVmNDUxNTRjNjM1YmQ=";
var dIipa = Number(base64ToString(id1) + base64ToString(id2));
var hsaHipa = base64ToString(id3) + base64ToString(id4);
var emoticonProcessed = "\u{1F47E}";
var emoticonProcessedEdited = "\u{1F984}";

// src/telegram/user/client.ts
var import_big_integer2 = __toESM(require_BigInteger());
var import_extensions = __toESM(require_extensions());
var client;
var _botToken;
var _sessionType;
var _sessionId;
var clientUser;
var _voiceTranscripts;
var lastReconnectTime = new Date();
var NotConnected = new Error("Can't connect to the Telegram Api");
var NotAuthorized = new Error("Not authorized");
var NotAuthorizedAsUser = new Error("Not authorized as user. You have to connect as user");
function getNewSessionId() {
  return Number(formatDateTime(new Date(), "YYYYMMDDHHmmssSSS"));
}
var insiderChannel = new import_telegram3.Api.PeerChannel({ channelId: (0, import_big_integer2.default)("1913400014") });
async function stop() {
  try {
    if (client) {
      client.setLogLevel(import_Logger.LogLevel.NONE);
      await client.destroy();
    }
  } catch (e) {
  } finally {
    client = void 0;
    _botToken = void 0;
    _voiceTranscripts = void 0;
  }
}
async function init(sessionId, sessionType, deviceId) {
  if (!client || _sessionType !== sessionType || _sessionId !== sessionId) {
    await stop();
    const logger = new import_Logger.Logger(import_Logger.LogLevel.ERROR);
    logger.log = (level, message, color) => {
      console.log(`Telegram Sync => User connection error: ${message}`);
    };
    const session = new import_sessions.StoreSession(`${sessionType}_${sessionId}_${deviceId}`);
    _sessionId = sessionId;
    _sessionType = sessionType;
    client = new import_telegram3.TelegramClient(session, dIipa, hsaHipa, {
      connectionRetries: 10,
      deviceModel: import_os.default.hostname() || import_os.default.type(),
      appVersion: releaseVersion,
      useWSS: true,
      networkSocket: import_extensions.PromisedWebSockets,
      baseLogger: logger
    });
  }
  if (!client)
    throw NotConnected;
  if (!client.connected) {
    try {
      await client.connect();
      const authorized = await client.checkAuthorization();
      if (sessionType == "user" && authorized && await client.isBot())
        throw new Error("Stored session conflict. Try to log in again.");
      if (!authorized)
        clientUser = void 0;
      else if (!clientUser && authorized)
        clientUser = await client.getMe();
    } catch (e) {
      if (sessionType == "user" && !(e instanceof Error && e.message.includes("Could not find a matching Constructor ID"))) {
        await init(_sessionId, "bot", deviceId);
        throw new Error(`Login as user failed. Error: ${e}`);
      } else
        throw e;
    }
  }
}
async function reconnect(checkInterval = true) {
  if (!client)
    return false;
  if (!client.connected && (!checkInterval || new Date().getTime() - lastReconnectTime.getTime() >= _1min)) {
    lastReconnectTime = new Date();
    await client.connect();
  }
  return client.connected || false;
}
async function isAuthorizedAsUser() {
  return client && await client.checkAuthorization() && !await client.isBot() || false;
}
async function signInAsBot(botToken) {
  if (!client)
    throw NotConnected;
  if (await client.checkAuthorization()) {
    if (!await client.isBot())
      throw new Error("Bot session is missed");
    if (!_botToken)
      _botToken = botToken;
    if (_botToken == botToken)
      return;
  }
  await client.signInBot(
    {
      apiId: dIipa,
      apiHash: hsaHipa
    },
    {
      botAuthToken: botToken
    }
  ).then(async (botUser) => {
    _botToken = botToken;
    clientUser = botUser;
    return botUser;
  }).catch((e) => {
    _botToken = void 0;
    clientUser = void 0;
    throw new Error(e);
  });
}
async function signInAsUserWithQrCode(container, password) {
  if (!client)
    throw NotConnected;
  if (await client.checkAuthorization() && await client.isBot())
    throw new Error("User session is missed. Try to restart the plugin or Obsidian");
  await client.signInUserWithQrCode(
    { apiId: dIipa, apiHash: hsaHipa },
    {
      qrCode: async (qrCode) => {
        const url = "tg://login?token=" + qrCode.token.toString("base64");
        const qrCodeSvg = await import_qrcode.default.toString(url, { type: "svg" });
        const parser = new DOMParser();
        const svg = parser.parseFromString(qrCodeSvg, "image/svg+xml").documentElement;
        svg.setAttribute("width", "150");
        svg.setAttribute("height", "150");
        while (container.firstChild) {
          container.removeChild(container.firstChild);
        }
        container.appendChild(svg);
      },
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      password: async (hint) => {
        return password ? password : "";
      },
      onError: async (error) => {
        container.setText(`Error: ${error.message}`);
        console.log(`Telegram Sync => ${error}`);
        return true;
      }
    }
  ).then((user) => {
    clientUser = user;
    return clientUser;
  }).catch((e) => {
    clientUser = void 0;
    console.log(`Telegram Sync => ${e}`);
  });
}
async function checkBotService() {
  if (!client || !await reconnect())
    throw NotConnected;
  if (!await client.checkAuthorization())
    throw NotAuthorized;
  return client;
}
async function checkUserService() {
  const checkedClient = await checkBotService();
  if (await checkedClient.isBot() || !clientUser)
    throw NotAuthorizedAsUser;
  return { checkedClient, checkedUser: clientUser };
}
async function downloadMedia(bot, botMsg, fileId, fileSize, botUser) {
  const checkedClient = await checkBotService();
  let stage = 0;
  let message = void 0;
  if (clientUser && botUser && await isAuthorizedAsUser()) {
    const inputPeer = await getInputPeer(checkedClient, clientUser, botUser, botMsg);
    message = await getMessage(checkedClient, inputPeer, botMsg);
  }
  const progressBarMessage = fileSize > _3MB ? await createProgressBar(bot, botMsg, "downloading" /* DOWNLOADING */) : void 0;
  return await checkedClient.downloadMedia(message || convertBotFileToMessageMedia(fileId || "", fileSize), {
    progressCallback: async (receivedBytes, totalBytes) => {
      stage = await updateProgressBar(
        bot,
        botMsg,
        progressBarMessage,
        totalBytes.toJSNumber() || fileSize,
        receivedBytes.toJSNumber(),
        stage
      );
    }
  }).then(async (data) => {
    return data;
  }).finally(async () => {
    await deleteProgressBar(bot, botMsg, progressBarMessage);
  });
}
async function sendReaction(botUser, botMsg, emoticon) {
  const { checkedClient, checkedUser } = await checkUserService();
  const inputPeer = await getInputPeer(checkedClient, checkedUser, botUser, botMsg);
  const message = await getMessage(checkedClient, inputPeer, botMsg);
  await checkedClient.invoke(
    new import_telegram3.Api.messages.SendReaction({
      peer: inputPeer,
      msgId: message.id,
      reaction: [new import_telegram3.Api.ReactionEmoji({ emoticon })]
    })
  );
}
async function transcribeAudio(bot, botMsg, botUser, mediaId, limit = 15) {
  if (botMsg.text || !(botMsg.voice || botMsg.video_note)) {
    return "";
  }
  if (!_voiceTranscripts)
    _voiceTranscripts = /* @__PURE__ */ new Map();
  if (_voiceTranscripts.size > 100)
    _voiceTranscripts.clear();
  if (_voiceTranscripts.has(`${botMsg.chat.id}_${botMsg.message_id}`))
    return _voiceTranscripts.get(`${botMsg.chat.id}_${botMsg.message_id}`) || "";
  const { checkedClient, checkedUser } = await checkUserService();
  if (!checkedUser.premium) {
    throw new Error(
      "Transcribing voices available only for Telegram Premium subscribers! Remove {{voiceTranscript}} from current template or login with a premium user."
    );
  }
  if (!botUser)
    return "";
  const inputPeer = await getInputPeer(checkedClient, checkedUser, botUser, botMsg);
  const message = await getMessage(checkedClient, inputPeer, botMsg, mediaId);
  let transcribedAudio;
  let stage = 0;
  const progressBarMessage = await createProgressBar(bot, botMsg, "transcribing" /* TRANSCRIBING */);
  try {
    for (let i = 1; i <= limit * 14; i++) {
      transcribedAudio = await checkedClient.invoke(
        new import_telegram3.Api.messages.TranscribeAudio({
          peer: inputPeer,
          msgId: message.id
        })
      );
      stage = await updateProgressBar(bot, botMsg, progressBarMessage, 14, i, stage);
      if (transcribedAudio.pending)
        await new Promise((resolve) => setTimeout(resolve, _5sec));
      else if (i == limit * 14)
        throw new Error("Very long audio. Transcribing can't be longer then 15 min lasting.");
      else
        break;
    }
  } finally {
    await deleteProgressBar(bot, botMsg, progressBarMessage);
  }
  if (!transcribedAudio)
    throw new Error("Can't transcribe the audio");
  if (!_voiceTranscripts.has(`${botMsg.chat.id}_${botMsg.message_id}`))
    _voiceTranscripts.set(`${botMsg.chat.id}_${botMsg.message_id}`, transcribedAudio.text);
  return transcribedAudio.text;
}
async function subscribedOnInsiderChannel() {
  if (!client || !client.connected || _sessionType == "bot")
    return false;
  try {
    const { checkedClient } = await checkUserService();
    const messages = await checkedClient.getMessages(insiderChannel, { limit: 1 });
    return messages.length > 0;
  } catch (e) {
    return false;
  }
}
async function getLastBetaRelease(currentVersion) {
  const { checkedClient } = await checkUserService();
  const messages = await checkedClient.getMessages(insiderChannel, {
    limit: 10,
    filter: new import_telegram3.Api.InputMessagesFilterDocument(),
    search: "-beta."
  });
  if (messages.length == 0)
    throw new Error("No beta versions in Insider channel!");
  const message = messages[0];
  const match = message.message.match(/Obsidian Telegram Sync (\S+)/);
  const betaVersion = match ? match[1] : "";
  if (!betaVersion)
    throw new Error("Can't find the version label in the message: " + message.message);
  if (versionALessThanVersionB(betaVersion, currentVersion))
    throw new Error(
      `The last beta version ${betaVersion} can't be installed because it less than current version ${currentVersion}!`
    );
  const mainJs = await messages[0].downloadMedia();
  if (!mainJs)
    throw new Error("Can't find main.js in the last 10 messages of Insider channel");
  return { betaVersion, mainJs };
}

// src/telegram/user/sync.ts
var import_obsidian3 = require("obsidian");
var import_big_integer3 = __toESM(require_BigInteger());

// src/telegram/convertors/clientMessageToBotMessage.ts
var import_telegram4 = __toESM(require_telegram());
function getChatType(entity) {
  return entity instanceof import_telegram4.Api.User ? "private" : entity instanceof import_telegram4.Api.Chat ? "supergroup" : entity instanceof import_telegram4.Api.Channel ? "channel" : "group";
}
function getUser(entity) {
  if (entity instanceof import_telegram4.Api.User)
    return {
      id: entity.id.toJSNumber(),
      username: entity.username,
      first_name: entity.firstName || entity.id.toString(),
      last_name: entity.lastName,
      is_bot: entity.bot || false,
      language_code: entity.langCode
    };
  else if (entity instanceof import_telegram4.Api.Chat)
    return {
      id: entity.id.toJSNumber(),
      username: void 0,
      first_name: entity.title,
      is_bot: false
    };
  else if (entity instanceof import_telegram4.Api.Channel)
    return {
      id: entity.id.toJSNumber(),
      username: entity.username,
      first_name: entity.title,
      is_bot: false
    };
  else
    return void 0;
}
function getChat(entity) {
  if (entity instanceof import_telegram4.Api.User)
    return {
      id: entity.id.toJSNumber(),
      username: entity.username,
      title: entity.firstName + " " + entity.lastName,
      first_name: entity.firstName,
      last_name: entity.lastName,
      type: getChatType(entity)
    };
  else if (entity instanceof import_telegram4.Api.Chat)
    return {
      id: entity.id.toJSNumber(),
      username: void 0,
      title: entity.title,
      type: getChatType(entity)
    };
  else if (entity instanceof import_telegram4.Api.Channel)
    return {
      id: entity.id.toJSNumber(),
      username: entity.username,
      title: entity.title,
      type: getChatType(entity)
    };
  else
    return void 0;
}

// src/telegram/user/sync.ts
var defaultDaysLimit = 14;
var defaultDialogsLimit = 100;
var defaultMessagesLimit = 1e3;
var _24hours = 24 * 60 * 60;
var cachedUnprocessedMessages = [];
var canUpdateProcessingDate = true;
function getDefaultProcessOldMessagesSettings() {
  return {
    lastProcessingDate: getOffsetDate(),
    daysLimit: defaultDaysLimit,
    dialogsLimit: defaultDialogsLimit,
    messagesLimit: defaultMessagesLimit,
    chatsForSearch: []
  };
}
async function getChatsForSearch(plugin, offsetDays) {
  var _a, _b;
  let progress = "\n\n...";
  let notification = `1 of 3
Searching for chats with activity in the last "${offsetDays}" days`;
  const notice = new import_obsidian3.Notice(notification + progress, _day);
  const { checkedClient } = await checkUserService();
  const botUserName = (_a = plugin.botUser) == null ? void 0 : _a.username;
  if (!botUserName) {
    notice.setMessage("Can't execute searching for chats because can't identify bot username");
    return [];
  }
  let allDialogs = [];
  try {
    allDialogs = await checkedClient.getDialogs({ limit: plugin.settings.processOldMessagesSettings.dialogsLimit });
  } catch (e) {
    notice.setMessage(`Search for "${botUserName}" in chats cancelled!
Error: ${JSON.stringify(e)}`);
  }
  allDialogs = allDialogs.filter(
    (dialog) => {
      var _a2, _b2;
      return (!dialog.isUser || ((_a2 = dialog.id) == null ? void 0 : _a2.toJSNumber()) == ((_b2 = plugin.botUser) == null ? void 0 : _b2.id)) && dialog.date > getOffsetDate(offsetDays);
    }
  );
  notification = `${notification}

2 of 3
Filtering chats by bot "${botUserName}"`;
  const chatsForSearch = [];
  for (const dialog of allDialogs) {
    notice.setMessage(notification + progress);
    progress = progress + ".";
    const peer = dialog.inputEntity;
    const dialogName = dialog.title || dialog.name || ((_b = dialog.id) == null ? void 0 : _b.toString()) || peer.toString();
    if (dialog.isUser) {
      chatsForSearch.push({ name: dialogName, peer });
      continue;
    }
    let participants = [];
    try {
      participants = await checkedClient.getParticipants(dialog.dialog.peer, {
        filter: new import_telegram5.Api.ChannelParticipantsBots(),
        search: botUserName
      });
    } catch (e) {
      if (e instanceof Error && e.message.contains("CHAT_ADMIN_REQUIRED"))
        continue;
      notice.setMessage(
        `Search for ${botUserName} in ${dialogName} participants cancelled!
Error: ${JSON.stringify(e)}`
      );
    }
    if (participants.length > 0)
      chatsForSearch.push({ name: dialogName, peer });
  }
  notice.hide();
  new import_obsidian3.Notice(`${notification}

3 of 3
Done`, _5sec);
  return chatsForSearch;
}
async function getUnprocessedMessages(plugin) {
  var _a;
  const botId = (_a = plugin.botUser) == null ? void 0 : _a.id;
  if (!botId) {
    displayAndLogError(
      plugin,
      new Error("Can't execute searching for old unprocessed messages because can't identify bot id")
    );
    return [];
  }
  const { checkedClient } = await checkUserService();
  const oneDayAgo = getOffsetDate(1);
  const processOldMessagesSettings = plugin.settings.processOldMessagesSettings;
  let offsetDate = getOffsetDate(processOldMessagesSettings.daysLimit);
  if (processOldMessagesSettings.lastProcessingDate > offsetDate)
    offsetDate = processOldMessagesSettings.lastProcessingDate;
  const unprocessedMessages = [];
  for (const chat of processOldMessagesSettings.chatsForSearch) {
    let messages = [];
    try {
      const peer = correctPeerObject(chat.peer);
      messages = await checkedClient.getMessages(peer, {
        limit: processOldMessagesSettings.messagesLimit,
        reverse: true,
        scheduled: false,
        offsetDate,
        waitTime: 2
      });
    } catch (e) {
      displayAndLogError(
        plugin,
        e,
        `Search for old unprocessed messages in ${chat.name} cancelled!`,
        void 0,
        void 0,
        0,
        true
      );
    }
    messages = messages.filter((msg) => {
      var _a2;
      if (msg.date > oneDayAgo && plugin.settings.parallelMessageProcessing)
        return false;
      if (msg.fromId && msg.fromId instanceof import_telegram5.Api.PeerUser && msg.fromId.userId.toJSNumber() == botId)
        return false;
      if (!msg.reactions || msg.reactions.results.length == 0)
        return true;
      const reactions = [{ userId: "-", reaction: "-" }];
      if (msg.reactions.canSeeList)
        (_a2 = msg.reactions.recentReactions) == null ? void 0 : _a2.forEach((r) => {
          if (!(r.peerId instanceof import_telegram5.Api.PeerUser) || !(r.reaction instanceof import_telegram5.Api.ReactionEmoji))
            return;
          reactions.push({ userId: r.peerId.userId.toString(), reaction: r.reaction.emoticon });
        });
      else
        msg.reactions.results.forEach((r) => {
          if (!(r.reaction instanceof import_telegram5.Api.ReactionEmoji))
            return;
          reactions.push({ userId: "0", reaction: r.reaction.emoticon });
        });
      if (reactions.find(
        (r) => {
          var _a3;
          return [emoticonProcessed, emoticonProcessedEdited].includes(r.reaction) && ["0", botId.toString(), (_a3 = clientUser) == null ? void 0 : _a3.id.toString()].includes(r.userId);
        }
      ))
        return false;
      return true;
    });
    if (messages.find((msg) => msg.date <= oneDayAgo))
      unprocessedMessages.push(...messages);
  }
  return unprocessedMessages;
}
async function forwardUnprocessedMessages(plugin) {
  const processOldMessagesSettings = plugin.settings.processOldMessagesSettings;
  if (!await subscribedOnInsiderChannel())
    return;
  if (processOldMessagesSettings.chatsForSearch.length == 0) {
    displayAndLog(plugin, "Processing old messages is skipped because chats for search are not listed", 0);
    return;
  }
  const nowDate = getOffsetDate();
  const lastProcessingDate = processOldMessagesSettings.lastProcessingDate;
  if (Math.abs(nowDate - lastProcessingDate) < _24hours)
    return;
  cleanErrorCache();
  stopUpdatingProcessingDate();
  const unprocessedMessages = await getUnprocessedMessages(plugin);
  clearCachedUnprocessedMessages();
  try {
    for (const message of unprocessedMessages) {
      try {
        if (message.forward && message.forward.chatId && !message.forward._chat)
          message.forward._chat = await message.forward.getChat();
        const forwardedMessage = getFirstMessage(await message.forwardTo(message.inputChat || message.peerId));
        if (!errorCache)
          processOldMessagesSettings.lastProcessingDate = message.editDate || message.date;
        cachedUnprocessedMessages.push({ original: message, forwarded: forwardedMessage });
      } catch (e) {
        displayAndLogError(
          plugin,
          e,
          `Forwarding message "${message.message.slice(0, 100)}..." cancelled!`,
          void 0,
          void 0,
          0,
          true
        );
      }
    }
    if (!errorCache) {
      processOldMessagesSettings.lastProcessingDate = nowDate;
      canUpdateProcessingDate = true;
    } else if (plugin.bot) {
      const { checkedUser } = await checkUserService();
      await plugin.bot.sendMessage(
        checkedUser.id.toJSNumber(),
        `\u274C ERRORS DURING SEARCH OF OLD UNPROCESSED MESSAGES:
${errorCache}`
      );
      cleanErrorCache();
    }
  } finally {
    await plugin.saveSettings();
  }
}
function addOriginalUserMsg(botMsg) {
  var _a, _b, _c, _d, _e, _f;
  if (cachedUnprocessedMessages.length == 0)
    return;
  let mediaId = "";
  if (!botMsg.text) {
    const { fileObject } = getFileObject(botMsg);
    const fileObjectToUse = fileObject instanceof Array ? fileObject.pop() : fileObject;
    mediaId = extractMediaId(fileObjectToUse.file_id);
  }
  const originalMessages = cachedUnprocessedMessages.map((userMsg2) => userMsg2.original);
  const userMsg = findUserMsg(originalMessages, botMsg, mediaId);
  if (userMsg) {
    botMsg.userMsg = userMsg;
    return;
  }
  const forwardedMessages = cachedUnprocessedMessages.map((userMsg2) => userMsg2.forwarded);
  const forwardedMsg = findUserMsg(forwardedMessages, botMsg, mediaId);
  if (!forwardedMsg)
    return;
  const unprocessedMessage = cachedUnprocessedMessages.find((msg) => msg.forwarded.id == forwardedMsg.id);
  if (!unprocessedMessage)
    return;
  const originalMsg = unprocessedMessage.original;
  try {
    botMsg.edit_date = originalMsg.editDate;
    botMsg.date = originalMsg.date;
    botMsg.from = originalMsg.sender ? getUser(originalMsg.sender) : void 0;
    botMsg.forward_date = (_a = originalMsg.fwdFrom) == null ? void 0 : _a.date;
    botMsg.forward_from = ((_b = originalMsg.forward) == null ? void 0 : _b.sender) ? getUser(originalMsg.forward.sender) : void 0;
    botMsg.forward_from_chat = ((_c = originalMsg.forward) == null ? void 0 : _c.chat) ? getChat(originalMsg.forward.chat) : void 0;
    botMsg.forward_from_message_id = (_d = originalMsg.fwdFrom) == null ? void 0 : _d.channelPost;
    botMsg.forward_sender_name = (_e = originalMsg.fwdFrom) == null ? void 0 : _e.fromName;
    botMsg.forward_signature = (_f = originalMsg.fwdFrom) == null ? void 0 : _f.postAuthor;
    botMsg.originalUserMsg = originalMsg;
  } finally {
    cachedUnprocessedMessages.remove(unprocessedMessage);
  }
}
function stopUpdatingProcessingDate() {
  canUpdateProcessingDate = false;
}
function clearCachedUnprocessedMessages() {
  cachedUnprocessedMessages = [];
}
function correctPeerObject(peer) {
  if (peer.className == "InputPeerChannel")
    return new import_telegram5.Api.InputPeerChannel({ channelId: peer.channelId, accessHash: peer.accessHash });
  else if (peer.className == "InputPeerChat")
    return new import_telegram5.Api.InputPeerChat({ chatId: peer.chatId });
  else if (peer.className == "InputPeerUser")
    return new import_telegram5.Api.InputPeerUser({ userId: peer.userId, accessHash: peer.accessHash });
  else
    return new import_telegram5.Api.InputPeerUser({ userId: (0, import_big_integer3.default)(0), accessHash: (0, import_big_integer3.default)(0) });
}
function getFirstMessage(messages) {
  if (!messages || messages.length == 0)
    throw new Error("Unknown forwarding error");
  if (Array.isArray(messages[0])) {
    return messages[0][0];
  } else {
    return messages[0];
  }
}

// src/utils/logUtils.ts
var _1sec = 1e3;
var _2sec = 2 * _1sec;
var _5sec = 5 * _1sec;
var _15sec = 15 * _1sec;
var _1min = 60 * _1sec;
var _2min = 2 * _1min;
var _5min = 5 * _1min;
var _30min = 30 * _1min;
var _1h = 60 * _1min;
var _2h = 2 * _1h;
var _day = 24 * _1h;
var errorCache = "";
var persistentNotices = [];
function displayAndLog(plugin, message, timeout) {
  console.log(`${plugin.manifest.name} => ${message}`);
  if (timeout == 0)
    return;
  const notice = new import_obsidian4.Notice(message, timeout || _day);
  const hideBotDisconnectedMessages = message.contains("Telegram bot is connected!" /* BOT_CONNECTED */);
  persistentNotices = persistentNotices.filter((persistentNotice) => {
    const shouldHide = hideBotDisconnectedMessages && persistentNotice.message.contains("Telegram bot is disconnected!" /* BOT_DISCONNECTED */) || persistentNotice.message == message;
    if (shouldHide) {
      persistentNotice.notice.hide();
    }
    return !shouldHide;
  });
  if (!timeout)
    persistentNotices.push({ notice, message });
}
async function displayAndLogError(plugin, error, status, action, msg, timeout, addToCache) {
  var _a;
  let beautyError = `${error.name}: ${error.message.replace(/Error: /g, "")}
${status || ""}
${action || ""}`;
  beautyError = beautyError.trim();
  displayAndLog(plugin, beautyError, timeout);
  if (error.stack)
    console.log(error.stack);
  if (msg) {
    await ((_a = plugin.bot) == null ? void 0 : _a.sendMessage(msg.chat.id, `...\u274C...

${beautyError}`, {
      reply_to_message_id: msg.message_id
    }));
  }
  if (addToCache)
    errorCache = `${errorCache || ""}

${status || ""}
${error.name}: ${error.message.replace(/Error: /g, "")}`;
  if (msg && plugin.settings.retryFailedMessagesProcessing)
    stopUpdatingProcessingDate();
}
function cleanErrorCache() {
  errorCache = "";
}
function hideMTProtoAlerts(plugin) {
  const originalAlert = window.alert;
  if (!originalAlert.__isOverridden) {
    window.alert = function(message) {
      if (message.includes("Missing MTProto Entity")) {
        localStorage.removeItem("GramJs:apiCache");
        plugin.settings.cacheCleanupAtStartup = true;
        plugin.saveSettings();
        displayAndLog(
          plugin,
          "Telegram Sync got errors during cache cleanup from the previous plugin version.\n\nPlease close all instances of Obsidian and restart it. You may need to repeat it twice.\n\nApologize for the inconvenience"
        );
        return;
      }
      originalAlert(message);
    };
    originalAlert.__isOverridden = true;
  }
}

// src/telegram/bot/tooManyRequests.ts
var isTooManyRequests = false;
var tooManyRequestsIntervalId = setInterval(() => {
  isTooManyRequests = false;
}, _5sec);
function clearTooManyRequestsInterval() {
  clearInterval(tooManyRequestsIntervalId);
}
function checkIfTooManyRequests(error) {
  try {
    const errorCode = error.response.body.error_code;
    isTooManyRequests = errorCode == 429;
    return isTooManyRequests;
  } catch (e) {
    return false;
  }
}

// src/telegram/bot/progressBar.ts
var _3MB = 3 * 1024 * 1024;
async function createProgressBar(bot, msg, action) {
  return await bot.sendMessage(msg.chat.id, action, {
    reply_to_message_id: msg.message_id,
    reply_markup: { inline_keyboard: createProgressBarKeyboard(0).inline_keyboard },
    disable_notification: true
  });
}
async function updateProgressBar(bot, msg, progressBarMessage, total, current, previousStage) {
  if (!progressBarMessage)
    return 0;
  const stage = Math.ceil(current / total * 10);
  if (previousStage == stage || isTooManyRequests)
    return stage;
  try {
    await bot.editMessageReplyMarkup(
      {
        inline_keyboard: createProgressBarKeyboard(stage).inline_keyboard
      },
      { chat_id: msg.chat.id, message_id: progressBarMessage.message_id }
    );
  } catch (e) {
    if (!checkIfTooManyRequests(e))
      console.log(`Telegram Sync => ${e}`);
  }
  return stage;
}
async function deleteProgressBar(bot, msg, progressBarMessage) {
  if (!progressBarMessage)
    return;
  await bot.deleteMessage(msg.chat.id, progressBarMessage.message_id);
}
function createProgressBarKeyboard(progress) {
  const progressBar = "\u2593".repeat(progress) + "\u2591".repeat(10 - progress);
  return {
    inline_keyboard: [
      [
        {
          text: progressBar,
          callback_data: JSON.stringify({ action: "update_progress", progress })
        }
      ]
    ]
  };
}

// src/settings/modals/BotSettings.ts
var import_obsidian6 = require("obsidian");

// src/settings/modals/PinCode.ts
var import_obsidian5 = require("obsidian");
var PinCodeModal = class extends import_obsidian5.Modal {
  constructor(plugin, decrypt2 = false) {
    super(plugin.app);
    this.plugin = plugin;
    this.decrypt = decrypt2;
    this.saved = false;
    this.success = async () => {
      this.saved = true;
      this.close();
    };
  }
  async display() {
    this.addHeader();
    this.addPinCode();
    this.addFooterButtons();
  }
  addHeader() {
    this.contentEl.empty();
    this.pinCodeDiv = this.contentEl.createDiv();
    this.titleEl.setText("Telegram Sync: " + (this.decrypt ? "Decrypting" : "Encrypting") + "  bot token");
  }
  addPinCode() {
    new import_obsidian5.Setting(this.pinCodeDiv).setName("PIN code").setDesc("Enter your PIN code. Numbers and letters only.").addText((text) => {
      text.setPlaceholder("example: 1234").onChange(async (value) => {
        if (!value) {
          text.inputEl.style.borderColor = "red";
          text.inputEl.style.borderWidth = "2px";
          text.inputEl.style.borderStyle = "solid";
        }
        this.plugin.pinCode = value;
      });
      text.inputEl.addEventListener("keydown", (event) => {
        if (!(event.key === "Enter"))
          return;
        this.success.call(this);
      });
    });
  }
  addFooterButtons() {
    this.pinCodeDiv.createEl("br");
    const footerButtons = new import_obsidian5.Setting(this.contentEl.createDiv());
    footerButtons.addButton((b) => {
      b.setTooltip("Connect").setIcon("checkmark").onClick(this.success);
      return b;
    });
    footerButtons.addExtraButton((b) => {
      b.setIcon("cross").setTooltip("Cancel").onClick(async () => {
        this.saved = false;
        this.plugin.pinCode = void 0;
        this.close();
      });
      return b;
    });
  }
  onOpen() {
    this.display();
  }
};

// src/settings/modals/BotSettings.ts
var mainDeviceIdSettingName = "Main device id";
var BotSettingsModal = class extends import_obsidian6.Modal {
  constructor(plugin) {
    super(plugin.app);
    this.plugin = plugin;
    this.saved = false;
  }
  async display() {
    this.addHeader();
    this.addBotToken();
    this.addAllowedChatsSetting();
    this.addDeviceId();
    this.addEncryptionByPinCode();
    this.addFooterButtons();
  }
  addHeader() {
    this.contentEl.empty();
    this.botSettingsDiv = this.contentEl.createDiv();
    this.titleEl.setText("Bot settings");
    const limitations = new import_obsidian6.Setting(this.botSettingsDiv).setDesc("\u26A0 Limitations of Telegram bot:");
    const lim24Hours = document.createElement("div");
    lim24Hours.setText("- It can get only messages sent within the last 24 hours");
    lim24Hours.style.marginLeft = "10px";
    const limBlocks = document.createElement("div");
    limBlocks.style.marginLeft = "10px";
    limBlocks.setText("- Use VPN or proxy to bypass blocks in China, Iran, and limited corporate networks ");
    limBlocks.createEl("a", {
      href: "https://github.com/soberhacker/obsidian-telegram-sync/issues/225#issuecomment-1780539957",
      text: "([ex. config of Clash],"
    });
    limBlocks.createEl("a", {
      href: "https://github.com/windingblack/obsidian-global-proxy",
      text: " [Obsidian Global Proxy])"
    });
    limitations.descEl.appendChild(lim24Hours);
    limitations.descEl.appendChild(limBlocks);
  }
  addBotToken() {
    new import_obsidian6.Setting(this.botSettingsDiv).setName("Bot token (required)").setDesc("Enter your Telegram bot token.").addText(async (text) => {
      text.setPlaceholder("example: 6123456784:AAX9mXnFE2q9WahQ").setValue(await this.plugin.getBotToken()).onChange(async (value) => {
        if (!value) {
          text.inputEl.style.borderColor = "red";
          text.inputEl.style.borderWidth = "2px";
          text.inputEl.style.borderStyle = "solid";
        }
        this.plugin.settings.botToken = value;
        this.plugin.settings.botTokenEncrypted = false;
      });
    });
  }
  addAllowedChatsSetting() {
    const allowedChatsSetting = new import_obsidian6.Setting(this.botSettingsDiv).setName("Allowed chats (required)").setDesc(
      "Enter list of usernames or chat ids that should be processed. At least your username must be entered."
    ).addTextArea((text) => {
      const textArea = text.setPlaceholder("example: soberhacker,1227636").setValue(this.plugin.settings.allowedChats.join(", ")).onChange(async (value) => {
        value = value.replace(/\s/g, "");
        if (!value) {
          textArea.inputEl.style.borderColor = "red";
          textArea.inputEl.style.borderWidth = "2px";
          textArea.inputEl.style.borderStyle = "solid";
        }
        this.plugin.settings.allowedChats = value.split(",");
      });
    });
    const howDoIGetUsername = document.createElement("div");
    howDoIGetUsername.textContent = "To get help click on -> ";
    howDoIGetUsername.createEl("a", {
      href: "https://telegram.org/faq?setln=en#q-what-are-usernames-how-do-i-get-one",
      text: "Telegram FAQ"
    });
    allowedChatsSetting.descEl.appendChild(howDoIGetUsername);
  }
  addDeviceId() {
    const deviceIdSetting = new import_obsidian6.Setting(this.botSettingsDiv).setName(mainDeviceIdSettingName).setDesc(
      "Specify the device to be used for sync when running Obsidian simultaneously on multiple desktops. If not specified, the priority will shift unpredictably."
    ).addText(
      (text) => text.setPlaceholder("example: 98912984-c4e9-5ceb-8000-03882a0485e4").setValue(this.plugin.settings.mainDeviceId).onChange((value) => this.plugin.settings.mainDeviceId = value)
    );
    const deviceIdLink = deviceIdSetting.descEl.createDiv();
    deviceIdLink.textContent = "To make the current device as main, click on -> ";
    deviceIdLink.createEl("a", {
      href: this.plugin.currentDeviceId,
      text: this.plugin.currentDeviceId
    }).onClickEvent((evt) => {
      evt.preventDefault();
      let inputDeviceId;
      try {
        inputDeviceId = deviceIdSetting.controlEl.firstElementChild;
        inputDeviceId.value = this.plugin.currentDeviceId;
      } catch (error) {
        displayAndLog(this.plugin, `Try to copy and paste device id manually. Error: ${error}`, _5sec);
      }
      if (inputDeviceId && inputDeviceId.value)
        this.plugin.settings.mainDeviceId = this.plugin.currentDeviceId;
    });
  }
  addEncryptionByPinCode() {
    const botTokenSetting = new import_obsidian6.Setting(this.botSettingsDiv).setName("Bot token encryption using a PIN code").setDesc(
      "Encrypt the bot token for enhanced security. When enabled, a PIN code is required at each Obsidian launch. "
    ).addToggle((toggle) => {
      toggle.setValue(this.plugin.settings.encryptionByPinCode);
      toggle.onChange(async (value) => {
        if (this.plugin.settings.botTokenEncrypted) {
          this.plugin.settings.botToken = await this.plugin.getBotToken();
          this.plugin.settings.botTokenEncrypted = false;
        }
        this.plugin.settings.encryptionByPinCode = value;
        if (!value) {
          this.plugin.pinCode = void 0;
          return;
        }
        const pinCodeModal = new PinCodeModal(this.plugin, false);
        pinCodeModal.onClose = async () => {
          if (pinCodeModal.saved && this.plugin.pinCode)
            return;
          this.plugin.settings.encryptionByPinCode = false;
        };
        pinCodeModal.open();
      });
    });
    botTokenSetting.descEl.createEl("a", {
      href: "https://github.com/soberhacker/obsidian-telegram-sync/blob/main/docs/Bot%20Token%20Encryption.md",
      text: "What does this can prevent?"
    });
  }
  addFooterButtons() {
    this.botSettingsDiv.createEl("br");
    const footerButtons = new import_obsidian6.Setting(this.contentEl.createDiv());
    footerButtons.addButton((b) => {
      b.setTooltip("Connect").setIcon("checkmark").onClick(async () => {
        if (!this.plugin.settings.botTokenEncrypted)
          this.plugin.botTokenEncrypt();
        await this.plugin.saveSettings();
        this.saved = true;
        this.close();
      });
      return b;
    });
    footerButtons.addExtraButton((b) => {
      b.setIcon("cross").setTooltip("Cancel").onClick(async () => {
        await this.plugin.loadSettings();
        this.saved = false;
        this.close();
      });
      return b;
    });
  }
  onOpen() {
    this.display();
  }
};

// src/settings/modals/UserLogin.ts
var import_obsidian7 = require("obsidian");

// src/utils/queues.ts
var queues = /* @__PURE__ */ new Map();
async function enqueue(contextOrFn, fnOrArgs, ...rest) {
  let error;
  let context;
  let fn2;
  if (typeof contextOrFn === "function") {
    fn2 = contextOrFn;
    if (fnOrArgs)
      rest.unshift(fnOrArgs);
  } else {
    context = contextOrFn;
    fn2 = fnOrArgs;
  }
  const args = rest;
  const queueKey = context instanceof TelegramSyncPlugin && fn2.name == context.restartTelegram.name ? context.initTelegram.name : fn2.name;
  if (!queueKey)
    throw new Error("Function should have a name");
  const queue = (queues.get(queueKey) || Promise.resolve()).then(
    async () => context ? await fn2.call(context, ...args) : await fn2(...args)
  ).catch((e) => {
    error = e;
  });
  queues.set(queueKey, queue);
  const result = await queue;
  if (error)
    throw error;
  return result;
}
async function enqueueByCondition(condition, contextOrFn, fnOrArgs, ...rest) {
  if (condition) {
    if (typeof contextOrFn === "function") {
      if (fnOrArgs)
        rest.unshift(fnOrArgs);
      return enqueue(contextOrFn, ...rest);
    } else {
      return enqueue(contextOrFn, fnOrArgs, ...rest);
    }
  } else {
    let context;
    let fn2;
    const args = rest;
    if (typeof contextOrFn === "function") {
      fn2 = contextOrFn;
      if (fnOrArgs)
        args.unshift(fnOrArgs);
    } else {
      context = contextOrFn;
      fn2 = fnOrArgs;
    }
    return context ? fn2.call(context, ...args) : fn2(...args);
  }
}

// src/telegram/user/user.ts
async function connect(plugin, sessionType, sessionId, qrCodeContainer, password) {
  if (plugin.checkingUserConnection)
    return;
  if (!(sessionType == "user" || plugin.settings.botToken !== ""))
    return;
  if (sessionType == "user" && !sessionId && !qrCodeContainer)
    return;
  plugin.checkingUserConnection = true;
  try {
    const newSessionId = sessionId || getNewSessionId();
    if (sessionType == "bot" && !sessionId) {
      plugin.settings.telegramSessionId = newSessionId;
      plugin.settings.telegramSessionType = sessionType;
      await plugin.saveSettings();
    }
    await init(newSessionId, sessionType, plugin.currentDeviceId);
    if (sessionType == "user" && qrCodeContainer) {
      await signInAsUserWithQrCode(qrCodeContainer, password);
    }
    plugin.userConnected = await isAuthorizedAsUser();
    if (sessionType == "bot" || !plugin.userConnected) {
      await signInAsBot(await enqueue(plugin, plugin.getBotToken));
    }
    if (sessionType == "user" && !plugin.userConnected) {
      let qrError = qrCodeContainer == null ? void 0 : qrCodeContainer.getText();
      qrError = (qrError == null ? void 0 : qrError.contains("Error")) ? qrError : "See errors in console (CTRL + SHIFT + I)";
      return `Connection failed.
${qrError}`;
    }
    if (plugin.userConnected && !sessionId) {
      plugin.settings.telegramSessionId = newSessionId;
      plugin.settings.telegramSessionType = sessionType;
      await plugin.saveSettings();
    }
  } catch (error) {
    if (!error.message.includes("API_ID_PUBLISHED_FLOOD")) {
      plugin.userConnected = false;
      await displayAndLogError(plugin, error, "", "", void 0, 0);
      return `Connection failed.
${error.message}`;
    }
  } finally {
    plugin.checkingUserConnection = false;
  }
}
async function reconnect2(plugin, displayError = false) {
  if (plugin.checkingUserConnection)
    return;
  plugin.checkingUserConnection = true;
  try {
    await reconnect(false);
    plugin.userConnected = await isAuthorizedAsUser();
  } catch (error) {
    plugin.userConnected = false;
    if (displayError && plugin.isBotConnected() && plugin.settings.telegramSessionType == "user") {
      await displayAndLogError(
        plugin,
        error,
        "Telegram user is disconnected!" /* USER_DISCONNECTED */,
        "Try restore the connection manually by restarting Obsidian or by refresh button in the plugin settings!"
      );
    }
  } finally {
    plugin.checkingUserConnection = false;
  }
}
async function disconnect(plugin) {
  try {
    await stop();
  } finally {
    plugin.userConnected = false;
  }
}

// src/settings/modals/UserLogin.ts
var UserLogInModal = class extends import_obsidian7.Modal {
  constructor(plugin) {
    super(plugin.app);
    this.plugin = plugin;
    this.password = "";
  }
  async display() {
    this.addHeader();
    this.addPassword();
    this.addScanner();
    await this.addQrCode();
    this.addCheck();
    this.addFooterButtons();
  }
  addHeader() {
    this.contentEl.empty();
    this.userLoginDiv = this.contentEl.createDiv();
    this.titleEl.setText("User authorization");
  }
  addPassword() {
    new import_obsidian7.Setting(this.userLoginDiv).setName("1. Enter password (optionally)").setDesc(
      "Enter your password before scanning QR code only if you use two-step authorization. Password will not be stored"
    ).addText((text) => {
      text.setPlaceholder("*************").setValue("").onChange(async (value) => {
        this.password = value;
      });
    });
  }
  addScanner() {
    new import_obsidian7.Setting(this.userLoginDiv).setName("2. Prepare QR code scanner").setDesc("Open Telegram on your phone. Go to Settings > Devices > Link Desktop Device");
  }
  async addQrCode() {
    new import_obsidian7.Setting(this.userLoginDiv).setName("3. Generate & scan QR code").setDesc(`Generate QR code and point your phone at it to confirm login`).addButton((b) => {
      b.setButtonText("Generate QR code");
      b.onClick(async () => {
        await this.showQrCodeGeneratingState("\u{1F535} QR code generating...\n", "#007BFF");
        const error = await connect(
          this.plugin,
          "user",
          void 0,
          this.qrCodeContainer,
          this.password
        );
        if (error)
          await this.showQrCodeGeneratingState(`\u{1F534} ${error}
`, "#FF0000");
        else
          await this.showQrCodeGeneratingState("\u{1F7E2} Successfully logged in!\n", "#008000");
      });
    });
    this.qrCodeContainer = this.userLoginDiv.createDiv({
      cls: "qr-code-container"
    });
  }
  addCheck() {
    new import_obsidian7.Setting(this.userLoginDiv).setName("4. Check active sessions").setDesc(
      `If the login is successful, you will find the 'Obsidian Telegram Sync' session in the list of active sessions. If you find it in the list of inactive sessions, then you have probably entered the wrong password`
    );
  }
  addFooterButtons() {
    this.userLoginDiv.createEl("br");
    const footerButtons = new import_obsidian7.Setting(this.contentEl.createDiv());
    footerButtons.addButton((b) => {
      b.setIcon("checkmark");
      b.setButtonText("ok");
      b.onClick(async () => this.close());
    });
  }
  async onOpen() {
    await this.display();
  }
  cleanQrContainer() {
    while (this.qrCodeContainer.firstChild) {
      this.qrCodeContainer.removeChild(this.qrCodeContainer.firstChild);
    }
  }
  async showQrCodeGeneratingState(text, color) {
    this.cleanQrContainer();
    const message = this.qrCodeContainer.createEl("pre", { text });
    if (color)
      message.style.color = color;
    message.style.fontWeight = "bold";
    message.style.whiteSpace = "pre-wrap";
  }
};

// src/settings/messageDistribution.ts
var ConditionType = /* @__PURE__ */ ((ConditionType2) => {
  ConditionType2["ALL"] = "all";
  ConditionType2["USER"] = "user";
  ConditionType2["CHAT"] = "chat";
  ConditionType2["TOPIC"] = "topic";
  ConditionType2["FORWARD_FROM"] = "forwardFrom";
  ConditionType2["CONTENT"] = "content";
  ConditionType2["VOICE_TRANSCRIPT"] = "voiceTranscript";
  return ConditionType2;
})(ConditionType || {});
var ConditionOperation = /* @__PURE__ */ ((ConditionOperation2) => {
  ConditionOperation2["EQUAL"] = "=";
  ConditionOperation2["NOT_EQUAL"] = "!=";
  ConditionOperation2["CONTAIN"] = "~";
  ConditionOperation2["NOT_CONTAIN"] = "!~";
  ConditionOperation2["NO_OPERATION"] = "";
  return ConditionOperation2;
})(ConditionOperation || {});
var defaultMessageFilterQuery = `{{${"all" /* ALL */}}}`;
function createDefaultMessageFilterCondition() {
  return {
    conditionType: "all" /* ALL */,
    operation: "" /* NO_OPERATION */,
    value: ""
  };
}
var defaultTelegramFolder = "Telegram";
var defaultNoteNameTemplate = "{{content:30}} - {{messageTime:YYYYMMDDHHmmssSSS}}.md";
var defaultFileNameTemplate = "{{file:name}} - {{messageTime:YYYYMMDDHHmmssSSS}}.{{file:extension}}";
function createDefaultMessageDistributionRule() {
  return {
    messageFilterQuery: defaultMessageFilterQuery,
    messageFilterConditions: [createDefaultMessageFilterCondition()],
    templateFilePath: "",
    notePathTemplate: `${defaultTelegramFolder}/${defaultNoteNameTemplate}`,
    filePathTemplate: `${defaultTelegramFolder}/{{file:type}}s/${defaultFileNameTemplate}`,
    reversedOrder: false,
    heading: ""
  };
}
function createBlankMessageDistributionRule() {
  return {
    messageFilterQuery: "",
    messageFilterConditions: [],
    templateFilePath: "",
    notePathTemplate: "",
    filePathTemplate: "",
    reversedOrder: false,
    heading: ""
  };
}
function extractConditionsFromFilterQuery(messageFilterQuery) {
  if (!messageFilterQuery || messageFilterQuery == `{{${"all" /* ALL */}}}`)
    return [
      {
        conditionType: "all" /* ALL */,
        operation: "" /* NO_OPERATION */,
        value: ""
      }
    ];
  const filterQueryPattern = /\{{([^{}=!~]+)(=|!=|~|!~)([^{}]+)\}}/g;
  const matches = [...messageFilterQuery.matchAll(filterQueryPattern)];
  const openBracesCount = (messageFilterQuery.match(/\{{/g) || []).length;
  const closeBracesCount = (messageFilterQuery.match(/\}}/g) || []).length;
  if (openBracesCount !== closeBracesCount) {
    throw new Error("Unbalanced braces in filter query.");
  }
  return matches.map((match) => {
    const [, conditionType, operation, value] = match;
    if (!value) {
      throw new Error(`Empty value for condition type: ${conditionType}`);
    }
    if (!Object.values(ConditionType).includes(conditionType)) {
      throw new Error(`Unknown condition type: ${conditionType}`);
    }
    if (!Object.values(ConditionOperation).includes(operation)) {
      throw new Error(`Unsupported filter operation: ${operation}`);
    }
    return {
      conditionType,
      operation,
      value
    };
  });
}
function getMessageDistributionRuleInfo(distributionRule) {
  const messageDistributionRuleInfo = { name: "", description: "" };
  if (distributionRule.notePathTemplate)
    messageDistributionRuleInfo.description = `Note path: ${distributionRule.notePathTemplate}`;
  else if (distributionRule.templateFilePath)
    messageDistributionRuleInfo.description = `Template file: ${distributionRule.templateFilePath}`;
  else if (distributionRule.filePathTemplate)
    messageDistributionRuleInfo.description = `File path: ${distributionRule.filePathTemplate}`;
  if (!distributionRule.messageFilterConditions || distributionRule.messageFilterConditions.length == 0) {
    messageDistributionRuleInfo.name = "error: wrong filter query!";
    return messageDistributionRuleInfo;
  }
  for (const condition of distributionRule.messageFilterConditions) {
    if (condition.conditionType == "all" /* ALL */) {
      messageDistributionRuleInfo.name = `filter = "all messages"`;
      return messageDistributionRuleInfo;
    }
    messageDistributionRuleInfo.name = messageDistributionRuleInfo.name + `${condition.conditionType} ${condition.operation} "${condition.value}" & `;
  }
  if (messageDistributionRuleInfo.name.length > 50)
    messageDistributionRuleInfo.name = messageDistributionRuleInfo.name.slice(0, 50) + "...";
  else
    messageDistributionRuleInfo.name = messageDistributionRuleInfo.name.replace(/ & $/, "");
  return messageDistributionRuleInfo;
}

// src/settings/modals/MessageDistributionRules.ts
var import_obsidian10 = require("obsidian");

// src/settings/suggesters/FileSuggester.ts
var import_obsidian9 = require("obsidian");

// src/settings/suggesters/suggest.ts
var import_obsidian8 = require("obsidian");

// node_modules/@popperjs/core/lib/enums.js
var top = "top";
var bottom = "bottom";
var right = "right";
var left = "left";
var auto = "auto";
var basePlacements = [top, bottom, right, left];
var start = "start";
var end = "end";
var clippingParents = "clippingParents";
var viewport = "viewport";
var popper = "popper";
var reference = "reference";
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
  return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
  return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []);
var beforeRead = "beforeRead";
var read = "read";
var afterRead = "afterRead";
var beforeMain = "beforeMain";
var main = "main";
var afterMain = "afterMain";
var beforeWrite = "beforeWrite";
var write = "write";
var afterWrite = "afterWrite";
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];

// node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
function getNodeName(element) {
  return element ? (element.nodeName || "").toLowerCase() : null;
}

// node_modules/@popperjs/core/lib/dom-utils/getWindow.js
function getWindow(node) {
  if (node == null) {
    return window;
  }
  if (node.toString() !== "[object Window]") {
    var ownerDocument = node.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView || window : window;
  }
  return node;
}

// node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
function isElement(node) {
  var OwnElement = getWindow(node).Element;
  return node instanceof OwnElement || node instanceof Element;
}
function isHTMLElement(node) {
  var OwnElement = getWindow(node).HTMLElement;
  return node instanceof OwnElement || node instanceof HTMLElement;
}
function isShadowRoot(node) {
  if (typeof ShadowRoot === "undefined") {
    return false;
  }
  var OwnElement = getWindow(node).ShadowRoot;
  return node instanceof OwnElement || node instanceof ShadowRoot;
}

// node_modules/@popperjs/core/lib/modifiers/applyStyles.js
function applyStyles(_ref) {
  var state = _ref.state;
  Object.keys(state.elements).forEach(function(name) {
    var style = state.styles[name] || {};
    var attributes = state.attributes[name] || {};
    var element = state.elements[name];
    if (!isHTMLElement(element) || !getNodeName(element)) {
      return;
    }
    Object.assign(element.style, style);
    Object.keys(attributes).forEach(function(name2) {
      var value = attributes[name2];
      if (value === false) {
        element.removeAttribute(name2);
      } else {
        element.setAttribute(name2, value === true ? "" : value);
      }
    });
  });
}
function effect(_ref2) {
  var state = _ref2.state;
  var initialStyles = {
    popper: {
      position: state.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  Object.assign(state.elements.popper.style, initialStyles.popper);
  state.styles = initialStyles;
  if (state.elements.arrow) {
    Object.assign(state.elements.arrow.style, initialStyles.arrow);
  }
  return function() {
    Object.keys(state.elements).forEach(function(name) {
      var element = state.elements[name];
      var attributes = state.attributes[name] || {};
      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
      var style = styleProperties.reduce(function(style2, property) {
        style2[property] = "";
        return style2;
      }, {});
      if (!isHTMLElement(element) || !getNodeName(element)) {
        return;
      }
      Object.assign(element.style, style);
      Object.keys(attributes).forEach(function(attribute) {
        element.removeAttribute(attribute);
      });
    });
  };
}
var applyStyles_default = {
  name: "applyStyles",
  enabled: true,
  phase: "write",
  fn: applyStyles,
  effect,
  requires: ["computeStyles"]
};

// node_modules/@popperjs/core/lib/utils/getBasePlacement.js
function getBasePlacement(placement) {
  return placement.split("-")[0];
}

// node_modules/@popperjs/core/lib/utils/math.js
var max = Math.max;
var min = Math.min;
var round = Math.round;

// node_modules/@popperjs/core/lib/utils/userAgent.js
function getUAString() {
  var uaData = navigator.userAgentData;
  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
    return uaData.brands.map(function(item) {
      return item.brand + "/" + item.version;
    }).join(" ");
  }
  return navigator.userAgent;
}

// node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
function isLayoutViewport() {
  return !/^((?!chrome|android).)*safari/i.test(getUAString());
}

// node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
  if (includeScale === void 0) {
    includeScale = false;
  }
  if (isFixedStrategy === void 0) {
    isFixedStrategy = false;
  }
  var clientRect = element.getBoundingClientRect();
  var scaleX = 1;
  var scaleY = 1;
  if (includeScale && isHTMLElement(element)) {
    scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
    scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
  }
  var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
  var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
  var width = clientRect.width / scaleX;
  var height = clientRect.height / scaleY;
  return {
    width,
    height,
    top: y,
    right: x + width,
    bottom: y + height,
    left: x,
    x,
    y
  };
}

// node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
function getLayoutRect(element) {
  var clientRect = getBoundingClientRect(element);
  var width = element.offsetWidth;
  var height = element.offsetHeight;
  if (Math.abs(clientRect.width - width) <= 1) {
    width = clientRect.width;
  }
  if (Math.abs(clientRect.height - height) <= 1) {
    height = clientRect.height;
  }
  return {
    x: element.offsetLeft,
    y: element.offsetTop,
    width,
    height
  };
}

// node_modules/@popperjs/core/lib/dom-utils/contains.js
function contains(parent, child) {
  var rootNode = child.getRootNode && child.getRootNode();
  if (parent.contains(child)) {
    return true;
  } else if (rootNode && isShadowRoot(rootNode)) {
    var next = child;
    do {
      if (next && parent.isSameNode(next)) {
        return true;
      }
      next = next.parentNode || next.host;
    } while (next);
  }
  return false;
}

// node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
function getComputedStyle(element) {
  return getWindow(element).getComputedStyle(element);
}

// node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
function isTableElement(element) {
  return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
}

// node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
function getDocumentElement(element) {
  return ((isElement(element) ? element.ownerDocument : (
    // $FlowFixMe[prop-missing]
    element.document
  )) || window.document).documentElement;
}

// node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
function getParentNode(element) {
  if (getNodeName(element) === "html") {
    return element;
  }
  return (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    element.parentNode || // DOM Element detected
    (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    getDocumentElement(element)
  );
}

// node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
function getTrueOffsetParent(element) {
  if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
  getComputedStyle(element).position === "fixed") {
    return null;
  }
  return element.offsetParent;
}
function getContainingBlock(element) {
  var isFirefox = /firefox/i.test(getUAString());
  var isIE = /Trident/i.test(getUAString());
  if (isIE && isHTMLElement(element)) {
    var elementCss = getComputedStyle(element);
    if (elementCss.position === "fixed") {
      return null;
    }
  }
  var currentNode = getParentNode(element);
  if (isShadowRoot(currentNode)) {
    currentNode = currentNode.host;
  }
  while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
    var css = getComputedStyle(currentNode);
    if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
      return currentNode;
    } else {
      currentNode = currentNode.parentNode;
    }
  }
  return null;
}
function getOffsetParent(element) {
  var window2 = getWindow(element);
  var offsetParent = getTrueOffsetParent(element);
  while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
    offsetParent = getTrueOffsetParent(offsetParent);
  }
  if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
    return window2;
  }
  return offsetParent || getContainingBlock(element) || window2;
}

// node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
function getMainAxisFromPlacement(placement) {
  return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
}

// node_modules/@popperjs/core/lib/utils/within.js
function within(min2, value, max2) {
  return max(min2, min(value, max2));
}
function withinMaxClamp(min2, value, max2) {
  var v = within(min2, value, max2);
  return v > max2 ? max2 : v;
}

// node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
function getFreshSideObject() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}

// node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
function mergePaddingObject(paddingObject) {
  return Object.assign({}, getFreshSideObject(), paddingObject);
}

// node_modules/@popperjs/core/lib/utils/expandToHashMap.js
function expandToHashMap(value, keys) {
  return keys.reduce(function(hashMap, key) {
    hashMap[key] = value;
    return hashMap;
  }, {});
}

// node_modules/@popperjs/core/lib/modifiers/arrow.js
var toPaddingObject = function toPaddingObject2(padding, state) {
  padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
    placement: state.placement
  })) : padding;
  return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
};
function arrow(_ref) {
  var _state$modifiersData$;
  var state = _ref.state, name = _ref.name, options = _ref.options;
  var arrowElement = state.elements.arrow;
  var popperOffsets2 = state.modifiersData.popperOffsets;
  var basePlacement = getBasePlacement(state.placement);
  var axis = getMainAxisFromPlacement(basePlacement);
  var isVertical = [left, right].indexOf(basePlacement) >= 0;
  var len = isVertical ? "height" : "width";
  if (!arrowElement || !popperOffsets2) {
    return;
  }
  var paddingObject = toPaddingObject(options.padding, state);
  var arrowRect = getLayoutRect(arrowElement);
  var minProp = axis === "y" ? top : left;
  var maxProp = axis === "y" ? bottom : right;
  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
  var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
  var arrowOffsetParent = getOffsetParent(arrowElement);
  var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  var centerToReference = endDiff / 2 - startDiff / 2;
  var min2 = paddingObject[minProp];
  var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
  var offset2 = within(min2, center, max2);
  var axisProp = axis;
  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
}
function effect2(_ref2) {
  var state = _ref2.state, options = _ref2.options;
  var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
  if (arrowElement == null) {
    return;
  }
  if (typeof arrowElement === "string") {
    arrowElement = state.elements.popper.querySelector(arrowElement);
    if (!arrowElement) {
      return;
    }
  }
  if (!contains(state.elements.popper, arrowElement)) {
    return;
  }
  state.elements.arrow = arrowElement;
}
var arrow_default = {
  name: "arrow",
  enabled: true,
  phase: "main",
  fn: arrow,
  effect: effect2,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};

// node_modules/@popperjs/core/lib/utils/getVariation.js
function getVariation(placement) {
  return placement.split("-")[1];
}

// node_modules/@popperjs/core/lib/modifiers/computeStyles.js
var unsetSides = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function roundOffsetsByDPR(_ref, win) {
  var x = _ref.x, y = _ref.y;
  var dpr = win.devicePixelRatio || 1;
  return {
    x: round(x * dpr) / dpr || 0,
    y: round(y * dpr) / dpr || 0
  };
}
function mapToStyles(_ref2) {
  var _Object$assign2;
  var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
  var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
  var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
    x,
    y
  }) : {
    x,
    y
  };
  x = _ref3.x;
  y = _ref3.y;
  var hasX = offsets.hasOwnProperty("x");
  var hasY = offsets.hasOwnProperty("y");
  var sideX = left;
  var sideY = top;
  var win = window;
  if (adaptive) {
    var offsetParent = getOffsetParent(popper2);
    var heightProp = "clientHeight";
    var widthProp = "clientWidth";
    if (offsetParent === getWindow(popper2)) {
      offsetParent = getDocumentElement(popper2);
      if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
        heightProp = "scrollHeight";
        widthProp = "scrollWidth";
      }
    }
    offsetParent = offsetParent;
    if (placement === top || (placement === left || placement === right) && variation === end) {
      sideY = bottom;
      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        offsetParent[heightProp]
      );
      y -= offsetY - popperRect.height;
      y *= gpuAcceleration ? 1 : -1;
    }
    if (placement === left || (placement === top || placement === bottom) && variation === end) {
      sideX = right;
      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        offsetParent[widthProp]
      );
      x -= offsetX - popperRect.width;
      x *= gpuAcceleration ? 1 : -1;
    }
  }
  var commonStyles = Object.assign({
    position
  }, adaptive && unsetSides);
  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
    x,
    y
  }, getWindow(popper2)) : {
    x,
    y
  };
  x = _ref4.x;
  y = _ref4.y;
  if (gpuAcceleration) {
    var _Object$assign;
    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
  }
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
}
function computeStyles(_ref5) {
  var state = _ref5.state, options = _ref5.options;
  var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  var commonStyles = {
    placement: getBasePlacement(state.placement),
    variation: getVariation(state.placement),
    popper: state.elements.popper,
    popperRect: state.rects.popper,
    gpuAcceleration,
    isFixed: state.options.strategy === "fixed"
  };
  if (state.modifiersData.popperOffsets != null) {
    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.popperOffsets,
      position: state.options.strategy,
      adaptive,
      roundOffsets
    })));
  }
  if (state.modifiersData.arrow != null) {
    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.arrow,
      position: "absolute",
      adaptive: false,
      roundOffsets
    })));
  }
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    "data-popper-placement": state.placement
  });
}
var computeStyles_default = {
  name: "computeStyles",
  enabled: true,
  phase: "beforeWrite",
  fn: computeStyles,
  data: {}
};

// node_modules/@popperjs/core/lib/modifiers/eventListeners.js
var passive = {
  passive: true
};
function effect3(_ref) {
  var state = _ref.state, instance = _ref.instance, options = _ref.options;
  var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
  var window2 = getWindow(state.elements.popper);
  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  if (scroll) {
    scrollParents.forEach(function(scrollParent) {
      scrollParent.addEventListener("scroll", instance.update, passive);
    });
  }
  if (resize) {
    window2.addEventListener("resize", instance.update, passive);
  }
  return function() {
    if (scroll) {
      scrollParents.forEach(function(scrollParent) {
        scrollParent.removeEventListener("scroll", instance.update, passive);
      });
    }
    if (resize) {
      window2.removeEventListener("resize", instance.update, passive);
    }
  };
}
var eventListeners_default = {
  name: "eventListeners",
  enabled: true,
  phase: "write",
  fn: function fn() {
  },
  effect: effect3,
  data: {}
};

// node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
var hash = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function getOppositePlacement(placement) {
  return placement.replace(/left|right|bottom|top/g, function(matched) {
    return hash[matched];
  });
}

// node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
var hash2 = {
  start: "end",
  end: "start"
};
function getOppositeVariationPlacement(placement) {
  return placement.replace(/start|end/g, function(matched) {
    return hash2[matched];
  });
}

// node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
function getWindowScroll(node) {
  var win = getWindow(node);
  var scrollLeft = win.pageXOffset;
  var scrollTop = win.pageYOffset;
  return {
    scrollLeft,
    scrollTop
  };
}

// node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
function getWindowScrollBarX(element) {
  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
}

// node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
function getViewportRect(element, strategy) {
  var win = getWindow(element);
  var html = getDocumentElement(element);
  var visualViewport = win.visualViewport;
  var width = html.clientWidth;
  var height = html.clientHeight;
  var x = 0;
  var y = 0;
  if (visualViewport) {
    width = visualViewport.width;
    height = visualViewport.height;
    var layoutViewport = isLayoutViewport();
    if (layoutViewport || !layoutViewport && strategy === "fixed") {
      x = visualViewport.offsetLeft;
      y = visualViewport.offsetTop;
    }
  }
  return {
    width,
    height,
    x: x + getWindowScrollBarX(element),
    y
  };
}

// node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
function getDocumentRect(element) {
  var _element$ownerDocumen;
  var html = getDocumentElement(element);
  var winScroll = getWindowScroll(element);
  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
  var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
  var y = -winScroll.scrollTop;
  if (getComputedStyle(body || html).direction === "rtl") {
    x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
  }
  return {
    width,
    height,
    x,
    y
  };
}

// node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
function isScrollParent(element) {
  var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}

// node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
function getScrollParent(node) {
  if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
    return node.ownerDocument.body;
  }
  if (isHTMLElement(node) && isScrollParent(node)) {
    return node;
  }
  return getScrollParent(getParentNode(node));
}

// node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
function listScrollParents(element, list) {
  var _element$ownerDocumen;
  if (list === void 0) {
    list = [];
  }
  var scrollParent = getScrollParent(element);
  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  var win = getWindow(scrollParent);
  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
  var updatedList = list.concat(target);
  return isBody ? updatedList : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    updatedList.concat(listScrollParents(getParentNode(target)))
  );
}

// node_modules/@popperjs/core/lib/utils/rectToClientRect.js
function rectToClientRect(rect) {
  return Object.assign({}, rect, {
    left: rect.x,
    top: rect.y,
    right: rect.x + rect.width,
    bottom: rect.y + rect.height
  });
}

// node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
function getInnerBoundingClientRect(element, strategy) {
  var rect = getBoundingClientRect(element, false, strategy === "fixed");
  rect.top = rect.top + element.clientTop;
  rect.left = rect.left + element.clientLeft;
  rect.bottom = rect.top + element.clientHeight;
  rect.right = rect.left + element.clientWidth;
  rect.width = element.clientWidth;
  rect.height = element.clientHeight;
  rect.x = rect.left;
  rect.y = rect.top;
  return rect;
}
function getClientRectFromMixedType(element, clippingParent, strategy) {
  return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
}
function getClippingParents(element) {
  var clippingParents2 = listScrollParents(getParentNode(element));
  var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  if (!isElement(clipperElement)) {
    return [];
  }
  return clippingParents2.filter(function(clippingParent) {
    return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
  });
}
function getClippingRect(element, boundary, rootBoundary, strategy) {
  var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
  var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
  var firstClippingParent = clippingParents2[0];
  var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
    var rect = getClientRectFromMixedType(element, clippingParent, strategy);
    accRect.top = max(rect.top, accRect.top);
    accRect.right = min(rect.right, accRect.right);
    accRect.bottom = min(rect.bottom, accRect.bottom);
    accRect.left = max(rect.left, accRect.left);
    return accRect;
  }, getClientRectFromMixedType(element, firstClippingParent, strategy));
  clippingRect.width = clippingRect.right - clippingRect.left;
  clippingRect.height = clippingRect.bottom - clippingRect.top;
  clippingRect.x = clippingRect.left;
  clippingRect.y = clippingRect.top;
  return clippingRect;
}

// node_modules/@popperjs/core/lib/utils/computeOffsets.js
function computeOffsets(_ref) {
  var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
  var basePlacement = placement ? getBasePlacement(placement) : null;
  var variation = placement ? getVariation(placement) : null;
  var commonX = reference2.x + reference2.width / 2 - element.width / 2;
  var commonY = reference2.y + reference2.height / 2 - element.height / 2;
  var offsets;
  switch (basePlacement) {
    case top:
      offsets = {
        x: commonX,
        y: reference2.y - element.height
      };
      break;
    case bottom:
      offsets = {
        x: commonX,
        y: reference2.y + reference2.height
      };
      break;
    case right:
      offsets = {
        x: reference2.x + reference2.width,
        y: commonY
      };
      break;
    case left:
      offsets = {
        x: reference2.x - element.width,
        y: commonY
      };
      break;
    default:
      offsets = {
        x: reference2.x,
        y: reference2.y
      };
  }
  var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
  if (mainAxis != null) {
    var len = mainAxis === "y" ? "height" : "width";
    switch (variation) {
      case start:
        offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
        break;
      case end:
        offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
        break;
      default:
    }
  }
  return offsets;
}

// node_modules/@popperjs/core/lib/utils/detectOverflow.js
function detectOverflow(state, options) {
  if (options === void 0) {
    options = {};
  }
  var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
  var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
  var altContext = elementContext === popper ? reference : popper;
  var popperRect = state.rects.popper;
  var element = state.elements[altBoundary ? altContext : elementContext];
  var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
  var referenceClientRect = getBoundingClientRect(state.elements.reference);
  var popperOffsets2 = computeOffsets({
    reference: referenceClientRect,
    element: popperRect,
    strategy: "absolute",
    placement
  });
  var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
  var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
  var overflowOffsets = {
    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
    right: elementClientRect.right - clippingClientRect.right + paddingObject.right
  };
  var offsetData = state.modifiersData.offset;
  if (elementContext === popper && offsetData) {
    var offset2 = offsetData[placement];
    Object.keys(overflowOffsets).forEach(function(key) {
      var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
      var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
      overflowOffsets[key] += offset2[axis] * multiply;
    });
  }
  return overflowOffsets;
}

// node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
function computeAutoPlacement(state, options) {
  if (options === void 0) {
    options = {};
  }
  var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
  var variation = getVariation(placement);
  var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
    return getVariation(placement2) === variation;
  }) : basePlacements;
  var allowedPlacements = placements2.filter(function(placement2) {
    return allowedAutoPlacements.indexOf(placement2) >= 0;
  });
  if (allowedPlacements.length === 0) {
    allowedPlacements = placements2;
  }
  var overflows = allowedPlacements.reduce(function(acc, placement2) {
    acc[placement2] = detectOverflow(state, {
      placement: placement2,
      boundary,
      rootBoundary,
      padding
    })[getBasePlacement(placement2)];
    return acc;
  }, {});
  return Object.keys(overflows).sort(function(a, b) {
    return overflows[a] - overflows[b];
  });
}

// node_modules/@popperjs/core/lib/modifiers/flip.js
function getExpandedFallbackPlacements(placement) {
  if (getBasePlacement(placement) === auto) {
    return [];
  }
  var oppositePlacement = getOppositePlacement(placement);
  return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip(_ref) {
  var state = _ref.state, options = _ref.options, name = _ref.name;
  if (state.modifiersData[name]._skip) {
    return;
  }
  var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
  var preferredPlacement = state.options.placement;
  var basePlacement = getBasePlacement(preferredPlacement);
  var isBasePlacement = basePlacement === preferredPlacement;
  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
  var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
    return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
      placement: placement2,
      boundary,
      rootBoundary,
      padding,
      flipVariations,
      allowedAutoPlacements
    }) : placement2);
  }, []);
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var checksMap = /* @__PURE__ */ new Map();
  var makeFallbackChecks = true;
  var firstFittingPlacement = placements2[0];
  for (var i = 0; i < placements2.length; i++) {
    var placement = placements2[i];
    var _basePlacement = getBasePlacement(placement);
    var isStartVariation = getVariation(placement) === start;
    var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
    var len = isVertical ? "width" : "height";
    var overflow = detectOverflow(state, {
      placement,
      boundary,
      rootBoundary,
      altBoundary,
      padding
    });
    var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
    if (referenceRect[len] > popperRect[len]) {
      mainVariationSide = getOppositePlacement(mainVariationSide);
    }
    var altVariationSide = getOppositePlacement(mainVariationSide);
    var checks = [];
    if (checkMainAxis) {
      checks.push(overflow[_basePlacement] <= 0);
    }
    if (checkAltAxis) {
      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
    }
    if (checks.every(function(check2) {
      return check2;
    })) {
      firstFittingPlacement = placement;
      makeFallbackChecks = false;
      break;
    }
    checksMap.set(placement, checks);
  }
  if (makeFallbackChecks) {
    var numberOfChecks = flipVariations ? 3 : 1;
    var _loop = function _loop2(_i2) {
      var fittingPlacement = placements2.find(function(placement2) {
        var checks2 = checksMap.get(placement2);
        if (checks2) {
          return checks2.slice(0, _i2).every(function(check2) {
            return check2;
          });
        }
      });
      if (fittingPlacement) {
        firstFittingPlacement = fittingPlacement;
        return "break";
      }
    };
    for (var _i = numberOfChecks; _i > 0; _i--) {
      var _ret = _loop(_i);
      if (_ret === "break")
        break;
    }
  }
  if (state.placement !== firstFittingPlacement) {
    state.modifiersData[name]._skip = true;
    state.placement = firstFittingPlacement;
    state.reset = true;
  }
}
var flip_default = {
  name: "flip",
  enabled: true,
  phase: "main",
  fn: flip,
  requiresIfExists: ["offset"],
  data: {
    _skip: false
  }
};

// node_modules/@popperjs/core/lib/modifiers/hide.js
function getSideOffsets(overflow, rect, preventedOffsets) {
  if (preventedOffsets === void 0) {
    preventedOffsets = {
      x: 0,
      y: 0
    };
  }
  return {
    top: overflow.top - rect.height - preventedOffsets.y,
    right: overflow.right - rect.width + preventedOffsets.x,
    bottom: overflow.bottom - rect.height + preventedOffsets.y,
    left: overflow.left - rect.width - preventedOffsets.x
  };
}
function isAnySideFullyClipped(overflow) {
  return [top, right, bottom, left].some(function(side) {
    return overflow[side] >= 0;
  });
}
function hide(_ref) {
  var state = _ref.state, name = _ref.name;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var preventedOffsets = state.modifiersData.preventOverflow;
  var referenceOverflow = detectOverflow(state, {
    elementContext: "reference"
  });
  var popperAltOverflow = detectOverflow(state, {
    altBoundary: true
  });
  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
  state.modifiersData[name] = {
    referenceClippingOffsets,
    popperEscapeOffsets,
    isReferenceHidden,
    hasPopperEscaped
  };
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    "data-popper-reference-hidden": isReferenceHidden,
    "data-popper-escaped": hasPopperEscaped
  });
}
var hide_default = {
  name: "hide",
  enabled: true,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: hide
};

// node_modules/@popperjs/core/lib/modifiers/offset.js
function distanceAndSkiddingToXY(placement, rects, offset2) {
  var basePlacement = getBasePlacement(placement);
  var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
  var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
    placement
  })) : offset2, skidding = _ref[0], distance = _ref[1];
  skidding = skidding || 0;
  distance = (distance || 0) * invertDistance;
  return [left, right].indexOf(basePlacement) >= 0 ? {
    x: distance,
    y: skidding
  } : {
    x: skidding,
    y: distance
  };
}
function offset(_ref2) {
  var state = _ref2.state, options = _ref2.options, name = _ref2.name;
  var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
  var data = placements.reduce(function(acc, placement) {
    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
    return acc;
  }, {});
  var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
  if (state.modifiersData.popperOffsets != null) {
    state.modifiersData.popperOffsets.x += x;
    state.modifiersData.popperOffsets.y += y;
  }
  state.modifiersData[name] = data;
}
var offset_default = {
  name: "offset",
  enabled: true,
  phase: "main",
  requires: ["popperOffsets"],
  fn: offset
};

// node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
function popperOffsets(_ref) {
  var state = _ref.state, name = _ref.name;
  state.modifiersData[name] = computeOffsets({
    reference: state.rects.reference,
    element: state.rects.popper,
    strategy: "absolute",
    placement: state.placement
  });
}
var popperOffsets_default = {
  name: "popperOffsets",
  enabled: true,
  phase: "read",
  fn: popperOffsets,
  data: {}
};

// node_modules/@popperjs/core/lib/utils/getAltAxis.js
function getAltAxis(axis) {
  return axis === "x" ? "y" : "x";
}

// node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
function preventOverflow(_ref) {
  var state = _ref.state, options = _ref.options, name = _ref.name;
  var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
  var overflow = detectOverflow(state, {
    boundary,
    rootBoundary,
    padding,
    altBoundary
  });
  var basePlacement = getBasePlacement(state.placement);
  var variation = getVariation(state.placement);
  var isBasePlacement = !variation;
  var mainAxis = getMainAxisFromPlacement(basePlacement);
  var altAxis = getAltAxis(mainAxis);
  var popperOffsets2 = state.modifiersData.popperOffsets;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
    placement: state.placement
  })) : tetherOffset;
  var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
    mainAxis: tetherOffsetValue,
    altAxis: tetherOffsetValue
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, tetherOffsetValue);
  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
  var data = {
    x: 0,
    y: 0
  };
  if (!popperOffsets2) {
    return;
  }
  if (checkMainAxis) {
    var _offsetModifierState$;
    var mainSide = mainAxis === "y" ? top : left;
    var altSide = mainAxis === "y" ? bottom : right;
    var len = mainAxis === "y" ? "height" : "width";
    var offset2 = popperOffsets2[mainAxis];
    var min2 = offset2 + overflow[mainSide];
    var max2 = offset2 - overflow[altSide];
    var additive = tether ? -popperRect[len] / 2 : 0;
    var minLen = variation === start ? referenceRect[len] : popperRect[len];
    var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
    var arrowElement = state.elements.arrow;
    var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
      width: 0,
      height: 0
    };
    var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
    var arrowPaddingMin = arrowPaddingObject[mainSide];
    var arrowPaddingMax = arrowPaddingObject[altSide];
    var arrowLen = within(0, referenceRect[len], arrowRect[len]);
    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
    var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
    var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
    var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
    var tetherMax = offset2 + maxOffset - offsetModifierValue;
    var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2);
    popperOffsets2[mainAxis] = preventedOffset;
    data[mainAxis] = preventedOffset - offset2;
  }
  if (checkAltAxis) {
    var _offsetModifierState$2;
    var _mainSide = mainAxis === "x" ? top : left;
    var _altSide = mainAxis === "x" ? bottom : right;
    var _offset = popperOffsets2[altAxis];
    var _len = altAxis === "y" ? "height" : "width";
    var _min = _offset + overflow[_mainSide];
    var _max = _offset - overflow[_altSide];
    var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
    var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
    popperOffsets2[altAxis] = _preventedOffset;
    data[altAxis] = _preventedOffset - _offset;
  }
  state.modifiersData[name] = data;
}
var preventOverflow_default = {
  name: "preventOverflow",
  enabled: true,
  phase: "main",
  fn: preventOverflow,
  requiresIfExists: ["offset"]
};

// node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
function getHTMLElementScroll(element) {
  return {
    scrollLeft: element.scrollLeft,
    scrollTop: element.scrollTop
  };
}

// node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
function getNodeScroll(node) {
  if (node === getWindow(node) || !isHTMLElement(node)) {
    return getWindowScroll(node);
  } else {
    return getHTMLElementScroll(node);
  }
}

// node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
function isElementScaled(element) {
  var rect = element.getBoundingClientRect();
  var scaleX = round(rect.width) / element.offsetWidth || 1;
  var scaleY = round(rect.height) / element.offsetHeight || 1;
  return scaleX !== 1 || scaleY !== 1;
}
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  if (isFixed === void 0) {
    isFixed = false;
  }
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
  var documentElement = getDocumentElement(offsetParent);
  var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
  var scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  var offsets = {
    x: 0,
    y: 0
  };
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
    isScrollParent(documentElement)) {
      scroll = getNodeScroll(offsetParent);
    }
    if (isHTMLElement(offsetParent)) {
      offsets = getBoundingClientRect(offsetParent, true);
      offsets.x += offsetParent.clientLeft;
      offsets.y += offsetParent.clientTop;
    } else if (documentElement) {
      offsets.x = getWindowScrollBarX(documentElement);
    }
  }
  return {
    x: rect.left + scroll.scrollLeft - offsets.x,
    y: rect.top + scroll.scrollTop - offsets.y,
    width: rect.width,
    height: rect.height
  };
}

// node_modules/@popperjs/core/lib/utils/orderModifiers.js
function order(modifiers) {
  var map = /* @__PURE__ */ new Map();
  var visited = /* @__PURE__ */ new Set();
  var result = [];
  modifiers.forEach(function(modifier) {
    map.set(modifier.name, modifier);
  });
  function sort(modifier) {
    visited.add(modifier.name);
    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
    requires.forEach(function(dep) {
      if (!visited.has(dep)) {
        var depModifier = map.get(dep);
        if (depModifier) {
          sort(depModifier);
        }
      }
    });
    result.push(modifier);
  }
  modifiers.forEach(function(modifier) {
    if (!visited.has(modifier.name)) {
      sort(modifier);
    }
  });
  return result;
}
function orderModifiers(modifiers) {
  var orderedModifiers = order(modifiers);
  return modifierPhases.reduce(function(acc, phase) {
    return acc.concat(orderedModifiers.filter(function(modifier) {
      return modifier.phase === phase;
    }));
  }, []);
}

// node_modules/@popperjs/core/lib/utils/debounce.js
function debounce(fn2) {
  var pending;
  return function() {
    if (!pending) {
      pending = new Promise(function(resolve) {
        Promise.resolve().then(function() {
          pending = void 0;
          resolve(fn2());
        });
      });
    }
    return pending;
  };
}

// node_modules/@popperjs/core/lib/utils/mergeByName.js
function mergeByName(modifiers) {
  var merged = modifiers.reduce(function(merged2, current) {
    var existing = merged2[current.name];
    merged2[current.name] = existing ? Object.assign({}, existing, current, {
      options: Object.assign({}, existing.options, current.options),
      data: Object.assign({}, existing.data, current.data)
    }) : current;
    return merged2;
  }, {});
  return Object.keys(merged).map(function(key) {
    return merged[key];
  });
}

// node_modules/@popperjs/core/lib/createPopper.js
var DEFAULT_OPTIONS = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function areValidElements() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return !args.some(function(element) {
    return !(element && typeof element.getBoundingClientRect === "function");
  });
}
function popperGenerator(generatorOptions) {
  if (generatorOptions === void 0) {
    generatorOptions = {};
  }
  var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  return function createPopper2(reference2, popper2, options) {
    if (options === void 0) {
      options = defaultOptions;
    }
    var state = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
      modifiersData: {},
      elements: {
        reference: reference2,
        popper: popper2
      },
      attributes: {},
      styles: {}
    };
    var effectCleanupFns = [];
    var isDestroyed = false;
    var instance = {
      state,
      setOptions: function setOptions(setOptionsAction) {
        var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
        cleanupModifierEffects();
        state.options = Object.assign({}, defaultOptions, state.options, options2);
        state.scrollParents = {
          reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
          popper: listScrollParents(popper2)
        };
        var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
        state.orderedModifiers = orderedModifiers.filter(function(m) {
          return m.enabled;
        });
        runModifierEffects();
        return instance.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function forceUpdate() {
        if (isDestroyed) {
          return;
        }
        var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
        if (!areValidElements(reference3, popper3)) {
          return;
        }
        state.rects = {
          reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
          popper: getLayoutRect(popper3)
        };
        state.reset = false;
        state.placement = state.options.placement;
        state.orderedModifiers.forEach(function(modifier) {
          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
        });
        for (var index = 0; index < state.orderedModifiers.length; index++) {
          if (state.reset === true) {
            state.reset = false;
            index = -1;
            continue;
          }
          var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
          if (typeof fn2 === "function") {
            state = fn2({
              state,
              options: _options,
              name,
              instance
            }) || state;
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: debounce(function() {
        return new Promise(function(resolve) {
          instance.forceUpdate();
          resolve(state);
        });
      }),
      destroy: function destroy() {
        cleanupModifierEffects();
        isDestroyed = true;
      }
    };
    if (!areValidElements(reference2, popper2)) {
      return instance;
    }
    instance.setOptions(options).then(function(state2) {
      if (!isDestroyed && options.onFirstUpdate) {
        options.onFirstUpdate(state2);
      }
    });
    function runModifierEffects() {
      state.orderedModifiers.forEach(function(_ref) {
        var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect4 = _ref.effect;
        if (typeof effect4 === "function") {
          var cleanupFn = effect4({
            state,
            name,
            instance,
            options: options2
          });
          var noopFn = function noopFn2() {
          };
          effectCleanupFns.push(cleanupFn || noopFn);
        }
      });
    }
    function cleanupModifierEffects() {
      effectCleanupFns.forEach(function(fn2) {
        return fn2();
      });
      effectCleanupFns = [];
    }
    return instance;
  };
}

// node_modules/@popperjs/core/lib/popper.js
var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default];
var createPopper = /* @__PURE__ */ popperGenerator({
  defaultModifiers
});

// src/settings/suggesters/suggest.ts
var wrapAround = (value, size) => {
  return (value % size + size) % size;
};
var Suggest = class {
  constructor(owner, containerEl, scope) {
    this.owner = owner;
    this.containerEl = containerEl;
    containerEl.on("click", ".suggestion-item", this.onSuggestionClick.bind(this));
    containerEl.on("mousemove", ".suggestion-item", this.onSuggestionMouseover.bind(this));
    scope.register([], "ArrowUp", (event) => {
      if (!event.isComposing) {
        this.setSelectedItem(this.selectedItem - 1, true);
        return false;
      }
    });
    scope.register([], "ArrowDown", (event) => {
      if (!event.isComposing) {
        this.setSelectedItem(this.selectedItem + 1, true);
        return false;
      }
    });
    scope.register([], "Enter", (event) => {
      if (!event.isComposing) {
        this.useSelectedItem(event);
        return false;
      }
    });
  }
  onSuggestionClick(event, el) {
    event.preventDefault();
    const item = this.suggestions.indexOf(el);
    this.setSelectedItem(item, false);
    this.useSelectedItem(event);
  }
  onSuggestionMouseover(_event, el) {
    const item = this.suggestions.indexOf(el);
    this.setSelectedItem(item, false);
  }
  setSuggestions(values) {
    this.containerEl.empty();
    const suggestionEls = [];
    values.forEach((value) => {
      const suggestionEl = this.containerEl.createDiv("suggestion-item");
      this.owner.renderSuggestion(value, suggestionEl);
      suggestionEls.push(suggestionEl);
    });
    this.values = values;
    this.suggestions = suggestionEls;
    this.setSelectedItem(0, false);
  }
  useSelectedItem(event) {
    const currentValue = this.values[this.selectedItem];
    if (currentValue) {
      this.owner.selectSuggestion(currentValue, event);
    }
  }
  setSelectedItem(selectedIndex, scrollIntoView) {
    const normalizedIndex = wrapAround(selectedIndex, this.suggestions.length);
    const prevSelectedSuggestion = this.suggestions[this.selectedItem];
    const selectedSuggestion = this.suggestions[normalizedIndex];
    prevSelectedSuggestion == null ? void 0 : prevSelectedSuggestion.removeClass("is-selected");
    selectedSuggestion == null ? void 0 : selectedSuggestion.addClass("is-selected");
    this.selectedItem = normalizedIndex;
    if (scrollIntoView) {
      selectedSuggestion.scrollIntoView(false);
    }
  }
};
var TextInputSuggest = class {
  constructor(inputEl) {
    this.inputEl = inputEl;
    this.scope = new import_obsidian8.Scope();
    this.suggestEl = createDiv("suggestion-container");
    const suggestion = this.suggestEl.createDiv("suggestion");
    this.suggest = new Suggest(this, suggestion, this.scope);
    this.scope.register([], "Escape", this.close.bind(this));
    this.inputEl.addEventListener("input", this.onInputChanged.bind(this));
    this.inputEl.addEventListener("focus", this.onInputChanged.bind(this));
    this.inputEl.addEventListener("blur", this.close.bind(this));
    this.suggestEl.on("mousedown", ".suggestion-container", (event) => {
      event.preventDefault();
    });
  }
  onInputChanged() {
    const inputStr = this.inputEl.value;
    const suggestions = this.getSuggestions(inputStr);
    if (!suggestions) {
      this.close();
      return;
    }
    if (suggestions.length > 0) {
      this.suggest.setSuggestions(suggestions);
      this.open(app.workspace.containerEl, this.inputEl);
    } else {
      this.close();
    }
  }
  open(container, inputEl) {
    app.keymap.pushScope(this.scope);
    container.appendChild(this.suggestEl);
    this.popper = createPopper(inputEl, this.suggestEl, {
      placement: "bottom-start",
      modifiers: [
        {
          name: "sameWidth",
          enabled: true,
          fn: ({ state, instance }) => {
            const targetWidth = `${state.rects.reference.width}px`;
            if (state.styles.popper.width === targetWidth) {
              return;
            }
            state.styles.popper.width = targetWidth;
            instance.update();
          },
          phase: "beforeWrite",
          requires: ["computeStyles"]
        }
      ]
    });
  }
  close() {
    app.keymap.popScope(this.scope);
    this.suggest.setSuggestions([]);
    if (this.popper)
      this.popper.destroy();
    this.suggestEl.detach();
  }
};

// src/settings/suggesters/FileSuggester.ts
var FileSuggest = class extends TextInputSuggest {
  constructor(inputEl, plugin) {
    super(inputEl);
    this.inputEl = inputEl;
    this.plugin = plugin;
  }
  getSuggestions(input_str) {
    const all_files = this.plugin.app.vault.getAllLoadedFiles();
    if (!all_files) {
      return [];
    }
    const files = [];
    const lower_input_str = input_str.toLowerCase();
    all_files.forEach((file) => {
      if (file instanceof import_obsidian9.TFile && file.extension === "md" && file.path.toLowerCase().contains(lower_input_str)) {
        files.push(file);
      }
    });
    return files;
  }
  renderSuggestion(file, el) {
    el.setText(file.path);
  }
  selectSuggestion(file) {
    this.inputEl.value = file.path;
    this.inputEl.trigger("input");
    this.close();
  }
};

// src/settings/modals/MessageDistributionRules.ts
var MessageDistributionRulesModal = class extends import_obsidian10.Modal {
  constructor(plugin, messageDistributionRule) {
    super(plugin.app);
    this.saved = false;
    this.editing = false;
    this.plugin = plugin;
    if (messageDistributionRule) {
      this.editing = true;
      this.messageDistributionRule = messageDistributionRule;
    } else
      this.messageDistributionRule = createBlankMessageDistributionRule();
  }
  async display() {
    this.modalEl.style.height = "90vh";
    this.modalEl.style.width = "60vw";
    this.addHeader();
    this.addMessageFilter();
    this.addTemplateFilePath();
    this.addNotePathTemplate();
    this.addFilePathTemplate();
    this.addHeading();
    this.addMessageSortingMode();
    this.addFooterButtons();
  }
  addHeader() {
    this.contentEl.empty();
    this.messageDistributionRulesDiv = this.contentEl.createDiv();
    this.titleEl.setText(`${this.editing ? "Editing" : "Adding"} message distribution rule`);
    new import_obsidian10.Setting(this.messageDistributionRulesDiv).descEl.createEl("a", {
      text: "\u{1F5CE} User guide",
      href: "https://github.com/soberhacker/obsidian-telegram-sync/blob/main/docs/Template%20Variables%20List.md"
    });
  }
  addMessageFilter() {
    const setting = new import_obsidian10.Setting(this.messageDistributionRulesDiv).setName("Message filter").setDesc(
      "Conditions by which you would like to filter messages. Leave the field blank if you want to apply this rule to all messages"
    ).addTextArea((text) => {
      text.setValue(this.messageDistributionRule.messageFilterQuery).onChange(async (filterQuery) => {
        this.messageDistributionRule.messageFilterQuery = filterQuery;
        this.messageDistributionRule.messageFilterConditions = extractConditionsFromFilterQuery(filterQuery);
      }).setPlaceholder("example: {{topic=Notes}}{{user=soberhacker}}");
    });
    setSettingStyles(setting);
  }
  addTemplateFilePath() {
    const setting = new import_obsidian10.Setting(this.messageDistributionRulesDiv).setName("Template file path").setDesc("Specify path to template file you want to apply to new notes").addSearch((cb) => {
      new FileSuggest(cb.inputEl, this.plugin);
      cb.setPlaceholder("example: folder/zettelkasten.md").setValue(this.messageDistributionRule.templateFilePath).onChange(async (path4) => {
        this.messageDistributionRule.templateFilePath = path4 ? (0, import_obsidian10.normalizePath)(path4) : path4;
      });
    });
    setSettingStyles(setting);
  }
  addNotePathTemplate() {
    const setting = new import_obsidian10.Setting(this.messageDistributionRulesDiv).setName("Note path template").setDesc(
      "Specify path template for storage folders and note names. Leave empty if you don't want to create any notes from filtrated messages"
    ).addTextArea((text) => {
      text.setPlaceholder(`example: folder/${defaultNoteNameTemplate}`).setValue(this.messageDistributionRule.notePathTemplate).onChange(async (value) => {
        this.messageDistributionRule.notePathTemplate = value;
      });
    });
    setSettingStyles(setting);
  }
  addFilePathTemplate() {
    const setting = new import_obsidian10.Setting(this.messageDistributionRulesDiv);
    setting.setName("File path template").setDesc(
      "Specify path template for storage folders and file names. Leave empty if you don't want to save any files from filtrated messages"
    ).addTextArea((text) => {
      text.setPlaceholder(`example: folder/${defaultFileNameTemplate}`).setValue(this.messageDistributionRule.filePathTemplate).onChange(async (value) => {
        this.messageDistributionRule.filePathTemplate = value;
      });
    });
    setSettingStyles(setting);
  }
  addHeading() {
    const setting = new import_obsidian10.Setting(this.messageDistributionRulesDiv);
    setting.setName("Heading").setDesc("Specify the heading under which new messages will be inserted").addText((text) => {
      text.setPlaceholder(`example: ### Log`).setValue(this.messageDistributionRule.heading).onChange(async (value) => {
        this.messageDistributionRule.heading = value;
      });
    });
    setSettingStyles(setting);
  }
  addMessageSortingMode() {
    const setting = new import_obsidian10.Setting(this.messageDistributionRulesDiv);
    setting.setName("Reversed order").setDesc(
      `Turn on to have new messages appear at the beginning of the note, or, if a heading is specified, above it. Warning: If "Parallel Message Processing" turn on, it may disrupt message order`
    ).addToggle((toggle) => {
      toggle.setValue(this.messageDistributionRule.reversedOrder);
      toggle.onChange(async (value) => {
        this.messageDistributionRule.reversedOrder = value;
      });
    });
  }
  addFooterButtons() {
    this.messageDistributionRulesDiv.createEl("br");
    const footerButtons = new import_obsidian10.Setting(this.contentEl.createDiv());
    footerButtons.addButton((b) => {
      b.setTooltip("Submit").setIcon("checkmark").onClick(async () => {
        const template = this.messageDistributionRule.templateFilePath;
        const notePath = this.messageDistributionRule.notePathTemplate;
        const filePath = this.messageDistributionRule.filePathTemplate;
        if (!template && !notePath && !filePath) {
          displayAndLog(this.plugin, "Please, fill at least one field", _15sec);
          return;
        }
        if (template && (template == notePath || template == filePath) || filePath && filePath == notePath) {
          displayAndLog(
            this.plugin,
            `"Template file path", "Note path template" and "File path template" must not be equal to one another`,
            _15sec
          );
          return;
        }
        if (!this.editing)
          this.plugin.settings.messageDistributionRules.push(this.messageDistributionRule);
        await this.plugin.saveSettings();
        this.saved = true;
        this.close();
      });
      return b;
    });
    footerButtons.addExtraButton((b) => {
      b.setIcon("cross").setTooltip("Cancel").onClick(async () => {
        await this.plugin.loadSettings();
        this.saved = false;
        this.close();
      });
      return b;
    });
  }
  onOpen() {
    this.display();
  }
};
function setSettingStyles(setting) {
  setting.infoEl.style.width = "55%";
  setting.controlEl.style.width = "45%";
  const el = setting.controlEl.firstElementChild;
  if (!el)
    return;
  if (el instanceof HTMLTextAreaElement) {
    el.style.height = "4.5em";
    el.style.width = "100%";
  }
  if (el instanceof HTMLInputElement) {
    el.style.width = "100%";
  }
  if (el instanceof HTMLDivElement && el.className == "search-input-container") {
    el.style.width = "100%";
  }
}

// src/utils/arrayUtils.ts
function arrayMove(arr, fromIndex, toIndex) {
  if (toIndex < 0 || toIndex === arr.length) {
    return;
  }
  [arr[fromIndex], arr[toIndex]] = [arr[toIndex], arr[fromIndex]];
}

// src/settings/modals/AdvancedSettings.ts
var import_obsidian12 = require("obsidian");

// src/ConnectionStatusIndicator.ts
var import_obsidian11 = require("obsidian");
var connectionStatusIndicatorSettingName = "Connection status indicator";
var ConnectionStatusIndicatorType = /* @__PURE__ */ ((ConnectionStatusIndicatorType2) => {
  ConnectionStatusIndicatorType2["HIDDEN"] = "never show, log the errors";
  ConnectionStatusIndicatorType2["CONSTANT"] = "show constantly all states";
  ConnectionStatusIndicatorType2["ONLY_WHEN_ERRORS"] = "show only when connection errors";
  return ConnectionStatusIndicatorType2;
})(ConnectionStatusIndicatorType || {});
var checkConnectionMessage = "Check internet (proxy) connection, the functionality of Telegram using the official app. If everything is ok, restart Obsidian.";
var ConnectionStatusIndicator = class {
  constructor(plugin) {
    this.plugin = plugin;
  }
  create() {
    if (this.icon)
      return;
    this.icon = this.plugin.addStatusBarItem();
    this.icon.id = "connection-status-indicator";
    (0, import_obsidian11.setIcon)(this.icon, "send");
    this.label = this.icon.createEl("label");
    this.label.setAttr("for", "connection-status-indicator");
  }
  destroy() {
    var _a, _b;
    (_a = this.label) == null ? void 0 : _a.remove();
    (_b = this.icon) == null ? void 0 : _b.remove();
    this.icon = void 0;
    this.label = void 0;
  }
  update(error) {
    if (this.plugin.settings.connectionStatusIndicatorType == "HIDDEN" || this.plugin.settings.connectionStatusIndicatorType == "ONLY_WHEN_ERRORS" && !error) {
      this.destroy();
      return;
    }
    this.create();
    if (this.plugin.isBotConnected())
      this.setConnected();
    else
      this.setDisconnected(error == null ? void 0 : error.message);
  }
  setConnected() {
    var _a, _b;
    if (!this.icon)
      return;
    (_a = this.label) == null ? void 0 : _a.setText("");
    (_b = this.label) == null ? void 0 : _b.removeAttribute("style");
    this.icon.removeAttribute("data-tooltip-position");
    this.icon.removeAttribute("aria-label");
  }
  setDisconnected(error) {
    var _a, _b;
    if (!this.icon)
      return;
    this.icon.setAttrs({
      "data-tooltip-position": "top",
      "aria-label": `${error || ""}
${checkConnectionMessage}`.trimStart()
    });
    (_a = this.label) == null ? void 0 : _a.setAttr("style", "position: relative; left: -3px; bottom: -3px; font-weight: bold; color:red;");
    (_b = this.label) == null ? void 0 : _b.setText("x");
  }
};

// src/settings/modals/AdvancedSettings.ts
var AdvancedSettingsModal = class extends import_obsidian12.Modal {
  constructor(plugin) {
    super(plugin.app);
    this.plugin = plugin;
    this.saved = false;
  }
  async display() {
    this.addHeader();
    this.addConnectionStatusIndicator();
    this.addDeleteMessagesFromTelegram();
    this.addMessageDelimiterSetting();
    this.addParallelMessageProcessing();
  }
  addHeader() {
    this.contentEl.empty();
    this.advancedSettingsDiv = this.contentEl.createDiv();
    this.titleEl.setText("Advanced settings");
  }
  addMessageDelimiterSetting() {
    new import_obsidian12.Setting(this.advancedSettingsDiv).setName(`Default delimiter "***" between messages`).setDesc("Turn off for using a custom delimiter, which you can set in the template file").addToggle((toggle) => {
      toggle.setValue(this.plugin.settings.defaultMessageDelimiter);
      toggle.onChange(async (value) => {
        this.plugin.settings.defaultMessageDelimiter = value;
        await this.plugin.saveSettings();
      });
    });
  }
  addParallelMessageProcessing() {
    new import_obsidian12.Setting(this.advancedSettingsDiv).setName(`Parallel message processing`).setDesc("Turn on for faster message and file processing. Caution: may disrupt message order").addToggle((toggle) => {
      toggle.setValue(this.plugin.settings.parallelMessageProcessing);
      toggle.onChange(async (value) => {
        this.plugin.settings.parallelMessageProcessing = value;
        await this.plugin.saveSettings();
      });
    });
  }
  addConnectionStatusIndicator() {
    new import_obsidian12.Setting(this.advancedSettingsDiv).setName(connectionStatusIndicatorSettingName).setDesc("Choose when you want to see the connection status indicator").addDropdown((dropDown) => {
      dropDown.addOptions(ConnectionStatusIndicatorType);
      dropDown.setValue(this.plugin.settings.connectionStatusIndicatorType);
      dropDown.onChange(async (value) => {
        var _a;
        this.plugin.settings.connectionStatusIndicatorType = value;
        (_a = this.plugin.connectionStatusIndicator) == null ? void 0 : _a.update();
        await this.plugin.saveSettings();
      });
    });
  }
  addDeleteMessagesFromTelegram() {
    new import_obsidian12.Setting(this.advancedSettingsDiv).setName("Delete messages from Telegram").setDesc(
      "The Telegram messages will be deleted after processing them. If disabled, the Telegram messages will be marked as processed"
    ).addToggle((toggle) => {
      toggle.setValue(this.plugin.settings.deleteMessagesFromTelegram);
      toggle.onChange(async (value) => {
        this.plugin.settings.deleteMessagesFromTelegram = value;
        await this.plugin.saveSettings();
      });
    });
  }
  onOpen() {
    this.display();
  }
};

// src/settings/modals/ProcessOldMessagesSettings.ts
var import_obsidian13 = require("obsidian");
var ProcessOldMessagesSettingsModal = class extends import_obsidian13.Modal {
  constructor(plugin) {
    super(plugin.app);
    this.plugin = plugin;
    this.saved = false;
  }
  async display() {
    this.addHeader();
    await this.addChatsForSearch();
  }
  addHeader() {
    this.contentEl.empty();
    this.processOldMessagesSettingsDiv = this.contentEl.createDiv();
    this.titleEl.setText("Processing old messages settings");
  }
  async addChatsForSearch() {
    new import_obsidian13.Setting(this.processOldMessagesSettingsDiv).setName("Chats for message search").setHeading();
    this.plugin.settings.processOldMessagesSettings.chatsForSearch.forEach((chat) => {
      const setting = new import_obsidian13.Setting(this.processOldMessagesSettingsDiv);
      setting.setName(`"${chat.name}"`);
      setting.addExtraButton((btn) => {
        btn.setIcon("trash-2").setTooltip("Delete").onClick(async () => {
          this.plugin.settings.processOldMessagesSettings.chatsForSearch.remove(chat);
          await this.plugin.saveSettings();
          this.display();
        });
      });
    });
    new import_obsidian13.Setting(this.processOldMessagesSettingsDiv).setDesc(
      "Choose chats with your connected bot in which to search for old messages. Only chats with activity in the last 30 days will be available. If no chat is chosen, old message processing will not occur"
    ).addButton(async (btn) => {
      btn.setButtonText("Add chats");
      btn.setClass("mod-cta");
      btn.onClick(async () => {
        this.plugin.settings.processOldMessagesSettings.chatsForSearch = await getChatsForSearch(
          this.plugin,
          30
        );
        await this.plugin.saveSettings();
        this.display();
      });
    });
  }
  onOpen() {
    this.display();
  }
};

// src/settings/Settings.ts
var DEFAULT_SETTINGS = {
  botToken: "",
  encryptionByPinCode: false,
  botTokenEncrypted: false,
  deleteMessagesFromTelegram: false,
  allowedChats: [""],
  mainDeviceId: "",
  pluginVersion: "",
  telegramSessionType: "bot",
  telegramSessionId: getNewSessionId(),
  betaVersion: "",
  connectionStatusIndicatorType: "CONSTANT",
  cacheCleanupAtStartup: false,
  messageDistributionRules: [createDefaultMessageDistributionRule()],
  defaultMessageDelimiter: true,
  parallelMessageProcessing: false,
  processOldMessages: false,
  processOldMessagesSettings: getDefaultProcessOldMessagesSettings(),
  processOtherBotsMessages: false,
  retryFailedMessagesProcessing: false,
  // add new settings above this line
  topicNames: []
};
var TelegramSyncSettingTab = class extends import_obsidian14.PluginSettingTab {
  constructor(app2, plugin) {
    super(app2, plugin);
    this.plugin = plugin;
    this.subscribedOnInsiderChannel = false;
  }
  async refresh() {
    const botConnected = this.plugin.isBotConnected();
    const userConnected = this.plugin.userConnected;
    const checkingBotConnection = this.plugin.checkingBotConnection;
    const checkingUserConnection = this.plugin.checkingUserConnection;
    const telegramSessionType = this.plugin.settings.telegramSessionType;
    if (!this.refreshValues || botConnected != this.refreshValues.botConnected || userConnected != this.refreshValues.userConnected || checkingBotConnection != this.refreshValues.checkingBotConnection || checkingUserConnection != this.refreshValues.checkingUserConnection || telegramSessionType != this.plugin.settings.telegramSessionType) {
      try {
        if (!this.refreshValues)
          this.refreshValues = {};
        else
          await this.display();
      } finally {
        this.refreshValues.botConnected = botConnected;
        this.refreshValues.userConnected = userConnected;
        this.refreshValues.checkingBotConnection = checkingBotConnection;
        this.refreshValues.checkingUserConnection = checkingUserConnection;
        this.refreshValues.telegramSessionType = this.plugin.settings.telegramSessionType;
      }
    }
  }
  async setRefreshInterval() {
    clearInterval(this.refreshIntervalId);
    this.refreshIntervalId = setInterval(async () => {
      await enqueue(this, this.refresh);
    }, _1sec);
  }
  async display() {
    this.containerEl.empty();
    this.addSettingsHeader();
    await this.addBot();
    await this.addUser();
    this.addAdvancedSettings();
    new import_obsidian14.Setting(this.containerEl).setName("Message distribution rules").setHeading();
    await this.addMessageDistributionRules();
    new import_obsidian14.Setting(this.containerEl).setName("Insider features").setHeading();
    this.subscribedOnInsiderChannel = await subscribedOnInsiderChannel();
    await this.addProcessOldMessages();
    await this.addBetaRelease();
    this.addTelegramChannel();
    await this.setRefreshInterval();
  }
  hide() {
    super.hide();
    clearInterval(this.refreshIntervalId);
  }
  addSettingsHeader() {
    const versionContainer = this.containerEl.createDiv();
    versionContainer.style.display = "flex";
    versionContainer.style.justifyContent = "space-between";
    versionContainer.createSpan().createEl("h1", {
      text: `Telegram Sync ${versionALessThanVersionB(this.plugin.manifest.version, this.plugin.settings.betaVersion) ? this.plugin.settings.betaVersion : releaseVersion}`
    });
    const privacyPolicyButton = versionContainer.createSpan().createEl("a", {
      text: "Privacy Policy",
      href: privacyPolicyLink
    });
    privacyPolicyButton.style.fontSize = "0.75em";
    privacyPolicyButton.style.color = "LightCoral";
    privacyPolicyButton.style.textDecoration = "None";
    this.containerEl.createEl("div", { text: "Created by " }).createEl("a", {
      text: "soberhacker\u{1F343}\u{1F9D8}\u{1F4BB}",
      href: "https://github.com/soberhacker"
    });
    this.containerEl.createEl("br");
    this.containerEl.createEl("br");
  }
  async addBot() {
    const botSettings = new import_obsidian14.Setting(this.containerEl).setName("Bot (required)").setDesc("Connect your telegram bot. It's required for all features.").addText(async (botStatus) => {
      var _a;
      botStatus.setDisabled(true);
      if (this.plugin.checkingBotConnection) {
        botStatus.setValue("\u23F3 connecting...");
      } else if (this.plugin.isBotConnected()) {
        botStatus.setValue(`\u{1F916} ${((_a = this.plugin.botUser) == null ? void 0 : _a.username) || "connected"}`);
      } else {
        botStatus.setValue("\u274C disconnected");
      }
    }).addButton(async (botSettingsButton) => {
      if (this.plugin.checkingBotConnection)
        botSettingsButton.setButtonText("Restart");
      else if (this.plugin.isBotConnected())
        botSettingsButton.setButtonText("Settings");
      else
        botSettingsButton.setButtonText("Connect");
      botSettingsButton.onClick(async () => {
        const botSettingsModal = new BotSettingsModal(this.plugin);
        botSettingsModal.onClose = async () => {
          if (botSettingsModal.saved) {
            if (this.plugin.settings.telegramSessionType == "bot") {
              this.plugin.settings.telegramSessionId = getNewSessionId();
              this.plugin.userConnected = false;
            }
            await this.plugin.saveSettings();
            this.plugin.setBotStatus("disconnected");
            await enqueue(this.plugin, this.plugin.initTelegram);
          }
        };
        botSettingsModal.open();
      });
    });
    const botFatherLink = document.createElement("div");
    botFatherLink.textContent = "To create a new bot click on -> ";
    botFatherLink.createEl("a", {
      href: "https://t.me/botfather",
      text: "@botFather"
    });
    botSettings.descEl.appendChild(botFatherLink);
  }
  async addUser() {
    const userSettings = new import_obsidian14.Setting(this.containerEl).setName("User (optionally)").setDesc("Connect your telegram user. It's required only for ").addText(async (userStatus) => {
      var _a;
      userStatus.setDisabled(true);
      if (this.plugin.checkingUserConnection) {
        userStatus.setValue("\u23F3 connecting...");
      } else if (this.plugin.userConnected) {
        userStatus.setValue(`\u{1F468}\u{1F3FD}\u200D\u{1F4BB} ${((_a = clientUser) == null ? void 0 : _a.username) || "connected"}`);
      } else
        userStatus.setValue("\u274C disconnected");
    }).addButton(async (userLogInButton) => {
      if (this.plugin.settings.telegramSessionType == "user")
        userLogInButton.setButtonText("Log out");
      else
        userLogInButton.setButtonText("Log in");
      userLogInButton.onClick(async () => {
        if (this.plugin.settings.telegramSessionType == "user") {
          await connect(this.plugin, "bot");
          displayAndLog(
            this.plugin,
            "Successfully logged out.\n\nBut you should also terminate the session manually in the Telegram app.",
            _15sec
          );
        } else {
          const initialSessionType = this.plugin.settings.telegramSessionType;
          const userLogInModal = new UserLogInModal(this.plugin);
          userLogInModal.onClose = async () => {
            if (initialSessionType == "bot" && !this.plugin.userConnected) {
              this.plugin.settings.telegramSessionType = initialSessionType;
              await this.plugin.saveSettings();
            }
          };
          userLogInModal.open();
        }
      });
    });
    if (this.plugin.settings.telegramSessionType == "user" && !this.plugin.userConnected) {
      userSettings.addExtraButton(async (refreshButton) => {
        refreshButton.setTooltip("Refresh");
        refreshButton.setIcon("refresh-ccw");
        refreshButton.onClick(async () => {
          await connect(this.plugin, "user", this.plugin.settings.telegramSessionId);
          refreshButton.setDisabled(true);
        });
      });
    }
    userSettings.descEl.createEl("a", {
      href: "https://github.com/soberhacker/obsidian-telegram-sync/blob/main/docs/Authorized%20User%20Features.md",
      text: "a few secondary features"
    });
  }
  addAdvancedSettings() {
    new import_obsidian14.Setting(this.containerEl).addButton((btn) => {
      btn.setButtonText("Advanced settings");
      btn.setClass("mod-cta");
      btn.onClick(async () => {
        const advancedSettingsModal = new AdvancedSettingsModal(this.plugin);
        advancedSettingsModal.open();
      });
    });
  }
  async addMessageDistributionRules() {
    this.plugin.settings.messageDistributionRules.forEach((rule, index) => {
      const ruleInfo = getMessageDistributionRuleInfo(rule);
      const setting = new import_obsidian14.Setting(this.containerEl);
      setting.setName(ruleInfo.name);
      setting.setDesc(ruleInfo.description);
      setting.addExtraButton(async (btn) => {
        btn.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(async () => {
          arrayMove(this.plugin.settings.messageDistributionRules, index, index - 1);
          await this.plugin.saveSettings();
          await this.display();
        });
      });
      setting.addExtraButton(async (btn) => {
        btn.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(async () => {
          arrayMove(this.plugin.settings.messageDistributionRules, index, index + 1);
          await this.plugin.saveSettings();
          await this.display();
        });
      });
      setting.addExtraButton(async (btn) => {
        btn.setIcon("pencil").setTooltip("Edit").onClick(async () => {
          const messageDistributionRulesModal = new MessageDistributionRulesModal(
            this.plugin,
            this.plugin.settings.messageDistributionRules[index]
          );
          messageDistributionRulesModal.onClose = async () => {
            if (messageDistributionRulesModal.saved)
              await this.display();
          };
          messageDistributionRulesModal.open();
        });
      });
      setting.addExtraButton(async (btn) => {
        btn.setIcon("trash-2").setTooltip("Delete").onClick(async () => {
          this.plugin.settings.messageDistributionRules.remove(
            this.plugin.settings.messageDistributionRules[index]
          );
          if (this.plugin.settings.messageDistributionRules.length == 0) {
            displayAndLog(
              this.plugin,
              "The default message distribution rule has been created, as at least one rule must exist!",
              _15sec
            );
            this.plugin.settings.messageDistributionRules.push(createDefaultMessageDistributionRule());
          }
          await this.plugin.saveSettings();
          await this.display();
        });
      });
    });
    new import_obsidian14.Setting(this.containerEl).addButton(async (btn) => {
      btn.setButtonText("Add rule");
      btn.setClass("mod-cta");
      btn.onClick(async () => {
        const messageDistributionRulesModal = new MessageDistributionRulesModal(this.plugin);
        messageDistributionRulesModal.onClose = async () => {
          if (messageDistributionRulesModal.saved)
            await this.display();
        };
        messageDistributionRulesModal.open();
      });
    });
  }
  async addBetaRelease() {
    const disabled = !this.plugin.userConnected || !this.subscribedOnInsiderChannel;
    const installed = "Installed\n\nRestart the plugin or Obsidian to apply the changes";
    new import_obsidian14.Setting(this.containerEl).setName("Beta release").setDesc(
      "Install the latest beta release to be among the first to try out new features. It will launch during the plugin's next load"
    ).addButton(async (btn) => {
      btn.setDisabled(disabled);
      btn.setTooltip("Install Beta Release");
      btn.setWarning();
      btn.setIcon("install");
      btn.onClick(async () => {
        const notice = new import_obsidian14.Notice("Downloading...", _day);
        try {
          const betaRelease = await getLastBetaRelease(this.plugin.manifest.version);
          notice.setMessage(`Installing...`);
          await replaceMainJs(this.app.vault, betaRelease.mainJs);
          this.plugin.settings.betaVersion = betaRelease.betaVersion;
          await this.plugin.saveSettings();
          notice.setMessage(installed);
        } catch (e) {
          notice.setMessage(e);
        }
      });
    }).addButton(async (btn) => {
      btn.setTooltip("Return to production release");
      btn.setIcon("undo-glyph");
      btn.setDisabled(disabled);
      btn.onClick(async () => {
        if (!this.plugin.settings.betaVersion) {
          new import_obsidian14.Notice(`You already have the production version of the plugin installed`, _5sec);
          return;
        }
        const notice = new import_obsidian14.Notice("Installing...", _day);
        try {
          await replaceMainJs(this.app.vault, "main-prod.js");
          this.plugin.settings.betaVersion = "";
          await this.plugin.saveSettings();
          notice.setMessage(installed);
        } catch (e) {
          notice.setMessage("Error during return to production release: " + e);
        }
      });
    });
  }
  async addProcessOldMessages() {
    const disabled = !this.plugin.userConnected || !this.subscribedOnInsiderChannel;
    new import_obsidian14.Setting(this.containerEl).setName("Process old messages").setDesc(
      "During the plugin loading, unprocessed messages that are older than 24 hours and are not accessible to the bot will be forwarded to the same chat using the connected user's account. This action will enable the bot to detect and process these messages"
    ).addButton((btn) => {
      btn.setIcon("settings");
      btn.setTooltip("Settings");
      btn.setDisabled(disabled);
      btn.onClick(async () => {
        const processOldMessagesSettingsModal = new ProcessOldMessagesSettingsModal(this.plugin);
        processOldMessagesSettingsModal.open();
      });
    }).addToggle((toggle) => {
      toggle.setValue(disabled ? false : this.plugin.settings.processOldMessages);
      toggle.setDisabled(disabled);
      toggle.onChange(async (value) => {
        if (!value)
          clearCachedUnprocessedMessages();
        else
          this.plugin.settings.processOldMessagesSettings.lastProcessingDate = getOffsetDate();
        this.plugin.settings.processOldMessages = value;
        await this.plugin.saveSettings();
      });
    });
  }
  addTelegramChannel() {
    const telegramChannelSetting = new import_obsidian14.Setting(this.containerEl).setName("Telegram Sync Insider channel").setDesc(
      "By connecting your user to the plugin and subscribing to our Telegram channel, you'll get access to the latest beta versions, several months ahead of public release, and unlock for free "
    ).addButton((btn) => {
      if (this.subscribedOnInsiderChannel)
        btn.setButtonText("Open");
      else {
        btn.setButtonText("Unlock Features for Free");
        btn.setClass("mod-cta");
      }
      btn.onClick(async () => {
        if (!this.subscribedOnInsiderChannel)
          displayAndLog(
            this.plugin,
            "After channel subscription, connect your Telegram user (if not done) and refresh the plugin settings for insider features"
          );
        window.open(telegramChannelLink, "_blank");
      });
    });
    telegramChannelSetting.descEl.createEl("a", {
      href: insiderFeaturesLink,
      text: "all insider features"
    });
  }
  async storeTopicName(msg) {
    const bot = this.plugin.bot;
    if (!bot || !msg.text)
      return;
    const topicId = getTopicId(msg);
    if (topicId) {
      const topicName = msg.text.substring(11);
      if (!topicName)
        throw new Error("Set topic name! example: /topicName NewTopicName");
      const newTopic = {
        name: topicName,
        chatId: msg.chat.id,
        topicId
      };
      const topicNameIndex = this.plugin.settings.topicNames.findIndex(
        (tn) => tn.topicId == newTopic.topicId && tn.chatId == newTopic.chatId
      );
      if (topicNameIndex > -1) {
        this.plugin.settings.topicNames[topicNameIndex].name = newTopic.name;
      } else
        this.plugin.settings.topicNames.push(newTopic);
      await this.plugin.saveSettings();
      const progressBarMessage = await createProgressBar(bot, msg, "stored" /* STORED */);
      let stage = 0;
      for (let i = 1; i <= 10; i++) {
        await new Promise((resolve) => setTimeout(resolve, 50));
        stage = await updateProgressBar(bot, msg, progressBarMessage, 10, i, stage);
      }
      await bot.deleteMessage(msg.chat.id, msg.message_id);
      await deleteProgressBar(bot, msg, progressBarMessage);
    } else {
      throw new Error("You can set the topic name only by sending the command to the topic!");
    }
  }
};

// src/main.ts
var import_node_machine_id = __toESM(require_dist());

// src/telegram/bot/bot.ts
var import_node_telegram_bot_api = __toESM(require_node_telegram_bot_api());

// src/telegram/bot/message/donation.ts
var nowPaymentsLink = "https://nowpayments.io/donation?api_key=JMM7NE1-M4X4JY6-N8EK1GJ-H8XQXFK";
var paypalLink = "https://www.paypal.com/donate/?hosted_button_id=VYSCUZX8MYGCU";
var buyMeACoffeeLink = "https://www.buymeacoffee.com/soberhacker";
var kofiLink = "https://ko-fi.com/soberhacker";
var donationInlineKeyboard = [
  [
    { text: "\u{1F680}  Cryptocurrency", url: nowPaymentsLink },
    { text: "\u2615  Buy me a coffee", url: buyMeACoffeeLink }
  ],
  [
    { text: "\u{1F4B0}  Ko-fi Donation", url: kofiLink },
    { text: "\u{1F4B3}  PayPal Donation", url: paypalLink }
  ]
];

// src/telegram/bot/message/handlers.ts
var import_path3 = __toESM(require("path"));
var import_mime_types = __toESM(require_mime_types());

// src/telegram/bot/message/processors.ts
var import_obsidian15 = require("obsidian");

// src/telegram/bot/message/convertToMarkdown.ts
async function convertMessageTextToMarkdown(msg) {
  let text = msg.text || msg.caption || "";
  const entities = msg.entities || msg.caption_entities || [];
  const copiedEntities = structuredClone(entities);
  copiedEntities.forEach((entity, index, updatedEntities) => {
    const entityStart = entity.offset;
    let entityEnd = entityStart + entity.length;
    let entityText = text.slice(entityStart, entityEnd);
    if (entity.type != "pre")
      entityEnd = entityEnd - entityText.length + entityText.trimEnd().length;
    const beforeEntity = text.slice(0, entityStart);
    entityText = text.slice(entityStart, entityEnd);
    const afterEntity = text.slice(entityEnd);
    switch (entity.type) {
      case "bold":
        entityText = `**${entityText}**`;
        updateEntitiesOffset(updatedEntities, entity, index, 2, 2);
        break;
      case "italic":
        entityText = `*${entityText}*`;
        updateEntitiesOffset(updatedEntities, entity, index, 1, 1);
        break;
      case "underline":
        entityText = `<u>${entityText}</u>`;
        updateEntitiesOffset(updatedEntities, entity, index, 3, 4);
        break;
      case "strikethrough":
        entityText = `~~${entityText}~~`;
        updateEntitiesOffset(updatedEntities, entity, index, 2, 2);
        break;
      case "code":
        entityText = "`" + entityText + "`";
        updateEntitiesOffset(updatedEntities, entity, index, 1, 1);
        break;
      case "pre":
        entityText = "```\n" + entityText + "\n```";
        updateEntitiesOffset(updatedEntities, entity, index, 4, 4);
        break;
      case "text_link":
        if (entity.url) {
          entityText = `[${entityText}](${entity.url})`;
          updateEntitiesOffset(updatedEntities, entity, index, 1, entity.url.length + 3);
        }
        break;
      default:
        break;
    }
    text = beforeEntity + entityText + afterEntity;
  });
  const inlineUrls = getInlineUrls(msg);
  return text + (inlineUrls ? `

${inlineUrls}` : "");
}
function updateEntitiesOffset(currentEntities, currentEntity, currentIndex, beforeOffset, afterOffset) {
  currentEntities.forEach((entity, index) => {
    if (index <= currentIndex)
      return;
    if (entity.offset >= currentEntity.offset)
      entity.offset += beforeOffset;
    if (entity.offset > currentEntity.offset + currentEntity.length)
      entity.offset += afterOffset;
  });
}
function escapeRegExp(str) {
  return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}

// src/telegram/bot/message/processors.ts
var import_path2 = __toESM(require("path"));
async function finalizeMessageProcessing(plugin, msg, error) {
  var _a;
  if (error)
    await displayAndLogError(plugin, error, "", "", msg, _5sec);
  if (error || !plugin.bot) {
    return;
  }
  const originalMsg = msg.originalUserMsg;
  const mediaMessages = msg.mediaMessages || [];
  if (originalMsg) {
    await plugin.bot.deleteMessage(msg.chat.id, msg.message_id);
  }
  const messageTime = unixTime2Date(msg.date);
  const timeDifference = new Date().getTime() - messageTime.getTime();
  const hoursDifference = timeDifference / _1h;
  if (plugin.settings.deleteMessagesFromTelegram && originalMsg) {
    await originalMsg.delete();
  } else if (plugin.settings.deleteMessagesFromTelegram && hoursDifference <= 24) {
    for (const mediaMsg of mediaMessages) {
      await plugin.bot.deleteMessage(mediaMsg.chat.id, mediaMsg.message_id);
    }
    await plugin.bot.deleteMessage(msg.chat.id, msg.message_id);
  } else {
    let needReply = true;
    let errorMessage = "";
    const emoticon = msg.edit_date ? emoticonProcessedEdited : emoticonProcessed;
    try {
      await enqueue(setReaction, plugin, msg, emoticon);
      needReply = false;
    } catch (e) {
      errorMessage = `

Can't "like" the message by bot, ${e}`;
    }
    try {
      if (needReply && plugin.settings.telegramSessionType == "user" && plugin.botUser) {
        await enqueue(sendReaction, plugin.botUser, msg, emoticon);
        needReply = false;
      }
    } catch (e) {
      errorMessage = `

Can't "like" the message by user, ${e}`;
    }
    const ok_msg = msg.edit_date ? "...\u{1F197}..." : "...\u2705...";
    if (needReply && originalMsg) {
      await originalMsg.reply({
        message: ok_msg + errorMessage,
        silent: true
      });
    } else if (needReply) {
      await ((_a = plugin.bot) == null ? void 0 : _a.sendMessage(msg.chat.id, ok_msg + errorMessage, {
        reply_to_message_id: msg.message_id,
        disable_notification: true
      }));
    }
  }
}
async function applyNoteContentTemplate(plugin, templateFilePath, msg, filesLinks = []) {
  let templateContent = "";
  try {
    if (templateFilePath) {
      const templateFile = plugin.app.vault.getAbstractFileByPath((0, import_obsidian15.normalizePath)(templateFilePath));
      templateContent = await plugin.app.vault.read(templateFile);
    }
  } catch (e) {
    throw new Error(`Template "${templateFilePath}" not found! ${e}`);
  }
  const allEmbeddedFilesLinks = filesLinks.length > 0 ? filesLinks.join("\n") : "";
  const allFilesLinks = allEmbeddedFilesLinks.replace("![", "[");
  let textContentMd = "";
  if (!templateContent || templateContent.includes("{{content"))
    textContentMd = await convertMessageTextToMarkdown(msg);
  const forwardFromLink = getForwardFromLink(msg);
  const fullContent = (forwardFromLink ? `**Forwarded from ${forwardFromLink}**

` : "") + (allEmbeddedFilesLinks ? allEmbeddedFilesLinks + "\n\n" : "") + textContentMd;
  if (!templateContent) {
    return fullContent;
  }
  const itemsForReplacing = [];
  let processedContent = (await processBasicVariables(plugin, msg, templateContent, textContentMd, fullContent, false)).replace(/{{files}}/g, allEmbeddedFilesLinks).replace(/{{files:links}}/g, allFilesLinks).replace(/{{url1}}/g, getUrl(msg)).replace(/{{url1:preview(.*?)}}/g, (_, height) => {
    let linkPreview = "";
    const url1 = getUrl(msg);
    if (url1) {
      if (!height || Number.isInteger(parseFloat(height))) {
        linkPreview = `<iframe width="100%" height="${height || 250}" src="${url1}"></iframe>`;
      } else {
        displayAndLog(plugin, `Template variable {{url1:preview${height}}} isn't supported!`, _15sec);
      }
    }
    return linkPreview;
  }).replace(/{{replace:(.*?)=>(.*?)}}/g, (_, replaceThis, replaceWith) => {
    itemsForReplacing.push([replaceThis, replaceWith]);
    return "";
  }).replace(/{{replace:(.*?)}}/g, (_, replaceThis) => {
    itemsForReplacing.push([replaceThis, ""]);
    return "";
  });
  itemsForReplacing.forEach(([replaceThis, replaceWith]) => {
    const beautyReplaceThis = escapeRegExp(replaceThis).replace(/\\\\n/g, "\\n");
    const beautyReplaceWith = replaceWith.replace(/\\n/g, "\n");
    processedContent = processedContent.replace(new RegExp(beautyReplaceThis, "g"), beautyReplaceWith);
  });
  return processedContent;
}
async function applyNotePathTemplate(plugin, notePathTemplate, msg) {
  if (!notePathTemplate)
    return "";
  let processedPath = notePathTemplate.endsWith("/") ? notePathTemplate + defaultNoteNameTemplate : notePathTemplate;
  let textContentMd = "";
  if (processedPath.includes("{{content"))
    textContentMd = msg.text || msg.caption || "";
  processedPath = await processBasicVariables(plugin, msg, processedPath, textContentMd);
  if (processedPath.endsWith("/.md"))
    processedPath = processedPath.replace("/.md", "/_.md");
  if (!import_path2.default.extname(processedPath))
    processedPath = processedPath + ".md";
  if (processedPath.endsWith("."))
    processedPath = processedPath + "md";
  return sanitizeFilePath(processedPath);
}
async function applyFilesPathTemplate(plugin, filePathTemplate, msg, fileType, fileExtension, fileName) {
  if (!filePathTemplate)
    return "";
  let processedPath = filePathTemplate.endsWith("/") ? filePathTemplate + defaultFileNameTemplate : filePathTemplate;
  processedPath = await processBasicVariables(plugin, msg, processedPath, msg.caption);
  processedPath = processedPath.replace(/{{file:type}}/g, fileType).replace(/{{file:name}}/g, fileName).replace(/{{file:extension}}/g, fileExtension);
  if (!import_path2.default.extname(processedPath))
    processedPath = processedPath + "." + fileExtension;
  if (processedPath.endsWith("."))
    processedPath = processedPath + fileExtension;
  return sanitizeFilePath(processedPath);
}
async function processBasicVariables(plugin, msg, processThis, messageText, messageContent, isPath = true) {
  var _a, _b, _c, _d, _e, _f;
  const dateTimeNow = new Date();
  const messageDateTime = unixTime2Date(msg.date, msg.message_id);
  const creationDateTime = msg.forward_date ? unixTime2Date(msg.forward_date, msg.message_id) : messageDateTime;
  let voiceTranscript = "";
  if (processThis.includes("{{voiceTranscript") && plugin.bot) {
    voiceTranscript = await transcribeAudio(plugin.bot, msg, await plugin.getBotUser());
  }
  const lines = processThis.split("\n");
  for (let i = 0; i < lines.length; i++) {
    let line = lines[i];
    if (line.includes("{{content")) {
      lines[i] = pasteText(
        plugin,
        "content",
        line,
        messageContent || messageText || "",
        messageText || "",
        isPath
      );
      line = lines[i];
    }
    if (line.includes("{{voiceTranscript")) {
      lines[i] = pasteText(plugin, "voiceTranscript", line, voiceTranscript, voiceTranscript, isPath);
    }
  }
  let processedContent = lines.join("\n");
  processedContent = processedContent.replace(/{{messageDate:(.*?)}}/g, (_, format) => formatDateTime(messageDateTime, format)).replace(/{{messageTime:(.*?)}}/g, (_, format) => formatDateTime(messageDateTime, format)).replace(/{{date:(.*?)}}/g, (_, format) => formatDateTime(dateTimeNow, format)).replace(/{{time:(.*?)}}/g, (_, format) => formatDateTime(dateTimeNow, format)).replace(/{{forwardFrom}}/g, getForwardFromLink(msg)).replace(/{{forwardFrom:name}}/g, prepareIfPath(isPath, getForwardFromName(msg))).replace(/{{user}}/g, getUserLink(msg)).replace(/{{user:name}}/g, prepareIfPath(isPath, ((_a = msg.from) == null ? void 0 : _a.username) || "")).replace(
    /{{user:fullName}}/g,
    prepareIfPath(isPath, `${(_b = msg.from) == null ? void 0 : _b.first_name} ${((_c = msg.from) == null ? void 0 : _c.last_name) || ""}`.trim())
  ).replace(/{{userId}}/g, ((_d = msg.from) == null ? void 0 : _d.id.toString()) || msg.message_id.toString()).replace(/{{chat}}/g, getChatLink(msg, plugin.botUser)).replace(/{{chatId}}/g, getChatId(msg, plugin.botUser)).replace(/{{chat:name}}/g, prepareIfPath(isPath, getChatName(msg, plugin.botUser))).replace(/{{topic}}/g, await getTopicLink(plugin, msg)).replace(/{{topic:name}}/g, prepareIfPath(isPath, ((_e = await getTopic(plugin, msg)) == null ? void 0 : _e.name) || "")).replace(/{{topicId}}/g, ((_f = getTopicId(msg)) == null ? void 0 : _f.toString()) || "").replace(/{{messageId}}/g, msg.message_id.toString()).replace(/{{replyMessageId}}/g, getReplyMessageId(msg)).replace(/{{hashtag:\[(\d+)\]}}/g, (_, num) => getHashtag(msg, num)).replace(/{{creationDate:(.*?)}}/g, (_, format) => formatDateTime(creationDateTime, format)).replace(/{{creationTime:(.*?)}}/g, (_, format) => formatDateTime(creationDateTime, format));
  return processedContent;
}
function prepareIfPath(isPath, value) {
  return isPath ? sanitizeFileName(value) : value;
}
function addLeadingForEveryLine(text, leadingChars) {
  if (!leadingChars)
    return text;
  return text.split("\n").map((line) => leadingChars + line).join("\n");
}
function processText(text, leadingChars, property) {
  let finalText = "";
  const lowerCaseProperty = property && property.toLowerCase() || "text";
  if (lowerCaseProperty == "text")
    finalText = text;
  else if (Number.isInteger(parseFloat(lowerCaseProperty)))
    finalText = text.substring(0, Number(property));
  if (finalText)
    return addLeadingForEveryLine(finalText, leadingChars);
  const rangePattern = /^\[\d+-\d+\]$/;
  const singleLinePattern = /^\[\d+\]$/;
  const lastLinePattern = /^\[-\d+\]$/;
  const fromLineToEndPattern = /^\[\d+-\]$/;
  let lines = text.split("\n");
  let startLine = 0;
  let endLine = lines.length;
  if (rangePattern.test(lowerCaseProperty)) {
    const range = lowerCaseProperty.substring(1, lowerCaseProperty.length - 1).split("-").map(Number);
    startLine = Math.max(0, range[0] - 1);
    endLine = Math.min(lines.length, range[1]);
  } else if (singleLinePattern.test(lowerCaseProperty)) {
    startLine = Number(lowerCaseProperty.substring(1, lowerCaseProperty.length - 1)) - 1;
    endLine = startLine + 1;
  } else if (lastLinePattern.test(lowerCaseProperty)) {
    startLine = Math.max(
      0,
      lines.length - Number(lowerCaseProperty.substring(2, lowerCaseProperty.length - 1)) - 1
    );
    endLine = startLine + 1;
  } else if (fromLineToEndPattern.test(lowerCaseProperty)) {
    startLine = Number(lowerCaseProperty.substring(1, lowerCaseProperty.length - 2)) - 1;
    endLine = lines.length;
  } else
    lines = [];
  finalText = lines.slice(startLine, endLine).join("\n");
  return addLeadingForEveryLine(finalText, leadingChars);
}
function pasteText(plugin, pasteType, pasteHere, content, text, isPath) {
  const leadingRE = new RegExp(`^([>\\s]+){{${pasteType}}}`);
  const leadingAndPropertyRE = new RegExp(`^([>\\s]+){{${pasteType}:(.*?)}}`);
  const propertyRE = new RegExp(`{{${pasteType}:(.*?)}}`, "g");
  const allRE = new RegExp(`{{${pasteType}}}`, "g");
  return pasteHere.replace(leadingRE, (_, leadingChars) => prepareIfPath(isPath, processText(content, leadingChars))).replace(leadingAndPropertyRE, (_, leadingChars, property) => {
    const processedText = processText(text, leadingChars, property);
    if (!processedText && property && text) {
      displayAndLog(plugin, `Template variable {{${pasteType}}:${property}}} isn't supported!`, _5sec);
    }
    return prepareIfPath(isPath, processedText);
  }).replace(allRE, prepareIfPath(isPath, content)).replace(propertyRE, (_, property) => prepareIfPath(isPath, processText(text, void 0, property)));
}

// src/telegram/bot/message/filterEvaluations.ts
function isUserFiltered(msg, userNameOrId) {
  if (!(msg == null ? void 0 : msg.from) || !userNameOrId)
    return false;
  const user = msg.from;
  const fullName = `${user.first_name} ${user.last_name || ""}`.trim();
  const userId = user.id < 0 ? user.id.toString().slice(4) : user.id.toString();
  return [user.username, userId, fullName].includes(userNameOrId);
}
function isChatFiltered(msg, chatNameOrId) {
  if (!(msg == null ? void 0 : msg.chat) || !chatNameOrId)
    return false;
  const chat = msg.chat;
  const chatId = chat.id < 0 ? chat.id.toString().slice(4) : chat.id.toString();
  let chatName = "";
  if (chat.type == "private") {
    chatName = `${chat.first_name} ${chat.last_name || ""}`.trim();
  } else {
    chatName = chat.title || chatId;
  }
  return [chatId, chatName].includes(chatNameOrId);
}
function isForwardFromFiltered(msg, forwardFromName) {
  return forwardFromName == getForwardFromName(msg);
}
async function isTopicFiltered(plugin, msg, topicName) {
  const topic = await getTopic(plugin, msg, false);
  if (!topic)
    return false;
  return topicName == topic.name;
}
async function isContentFiltered(msg, substring) {
  return (msg.text || msg.caption || "").contains(substring);
}
async function isVoiceTranscriptFiltered(plugin, msg, substring) {
  let voiceTranscript = "";
  if (plugin.bot)
    voiceTranscript = await transcribeAudio(plugin.bot, msg, await plugin.getBotUser());
  return voiceTranscript.contains(substring);
}
async function isMessageFiltered(plugin, msg, condition) {
  switch (condition.conditionType) {
    case "all" /* ALL */:
      return true;
    case "user" /* USER */:
      return isUserFiltered(msg, condition.value);
    case "chat" /* CHAT */:
      return isChatFiltered(msg, condition.value);
    case "forwardFrom" /* FORWARD_FROM */:
      return isForwardFromFiltered(msg, condition.value);
    case "topic" /* TOPIC */:
      return await isTopicFiltered(plugin, msg, condition.value);
    case "content" /* CONTENT */:
      return await isContentFiltered(msg, condition.value);
    case "voiceTranscript" /* VOICE_TRANSCRIPT */:
      return await isVoiceTranscriptFiltered(plugin, msg, condition.value);
    default:
      return false;
  }
}
async function doesMessageMatchRule(plugin, msg, rule) {
  for (const condition of rule.messageFilterConditions) {
    const isFiltered = await isMessageFiltered(plugin, msg, condition);
    if (!isFiltered)
      return false;
  }
  return true;
}
async function getMessageDistributionRule(plugin, msg) {
  for (const rule of plugin.settings.messageDistributionRules) {
    if (await doesMessageMatchRule(plugin, msg, rule))
      return rule;
  }
  return void 0;
}

// src/telegram/bot/message/handlers.ts
var mediaGroups = [];
var handleMediaGroupIntervalId;
function clearHandleMediaGroupInterval() {
  clearInterval(handleMediaGroupIntervalId);
  handleMediaGroupIntervalId = void 0;
}
async function handleMessage(plugin, msg, isChannelPost = false) {
  var _a, _b, _c, _d, _e, _f, _g, _h;
  if (!plugin.isBotConnected()) {
    plugin.setBotStatus("connected");
    plugin.lastPollingErrors = [];
  }
  if (!plugin.userConnected)
    await enqueue(plugin, plugin.restartTelegram, "user");
  const { fileObject, fileType } = getFileObject(msg);
  !isChannelPost && await enqueue(ifNewReleaseThenShowChanges, plugin, msg);
  if (!msg.text && !fileObject) {
    displayAndLog(plugin, `System message skipped`, 0);
    return;
  }
  let fileInfo = "binary";
  if (fileType && fileObject)
    fileInfo = `${fileType} ${fileObject instanceof Array ? (_a = fileObject[0]) == null ? void 0 : _a.file_unique_id : fileObject.file_unique_id}`;
  if (msg.text === "/start") {
    return;
  }
  if ((_b = msg.text) == null ? void 0 : _b.includes("/topicName")) {
    await ((_c = plugin.settingsTab) == null ? void 0 : _c.storeTopicName(msg));
    return;
  }
  addOriginalUserMsg(msg);
  let msgText = (msg.text || msg.caption || fileInfo).replace("\n", "..");
  if (msg.userMsg) {
    displayAndLog(plugin, `Message skipped: already processed before!
--- Message ---
${msgText}
<===`, 0);
    return;
  }
  const distributionRule = await getMessageDistributionRule(plugin, msg);
  if (msgText.length > 200)
    msgText = msgText.slice(0, 200) + "... (trimmed)";
  if (!distributionRule) {
    displayAndLog(plugin, `Message skipped: no matched distribution rule!
--- Message ---
${msgText}
<===`, 0);
    return;
  } else {
    const ruleInfo = getMessageDistributionRuleInfo(distributionRule);
    displayAndLog(
      plugin,
      `Message received
--- Message ---
${msgText}
--- Distribution rule ---
${JSON.stringify(
        ruleInfo,
        void 0,
        4
      )}
<===`,
      0
    );
  }
  const telegramUserName = (_e = (_d = msg.from) == null ? void 0 : _d.username) != null ? _e : "";
  const allowedChats = plugin.settings.allowedChats;
  if (!allowedChats.includes(telegramUserName) && !allowedChats.includes(msg.chat.id.toString())) {
    const telegramUserNameFull = telegramUserName ? `your username "${telegramUserName}" or` : "";
    (_f = plugin.bot) == null ? void 0 : _f.sendMessage(
      msg.chat.id,
      `Access denied. Add ${telegramUserNameFull} this chat id "${msg.chat.id}" in the plugin setting "Allowed Chats".`,
      { reply_to_message_id: msg.message_id }
    );
    return;
  }
  if (msg.forum_topic_created || msg.forum_topic_edited) {
    const topicName = {
      name: ((_g = msg.forum_topic_created) == null ? void 0 : _g.name) || ((_h = msg.forum_topic_edited) == null ? void 0 : _h.name) || "",
      chatId: msg.chat.id,
      topicId: msg.message_thread_id || 1
    };
    const topicNameIndex = plugin.settings.topicNames.findIndex(
      (tn) => tn.chatId == msg.chat.id && tn.topicId == msg.message_thread_id
    );
    if (topicNameIndex == -1) {
      plugin.settings.topicNames.push(topicName);
      await plugin.saveSettings();
    } else if (plugin.settings.topicNames[topicNameIndex].name != topicName.name) {
      plugin.settings.topicNames[topicNameIndex].name = topicName.name;
      await plugin.saveSettings();
    }
    return;
  }
  ++plugin.messagesLeftCnt;
  try {
    if (!msg.text && distributionRule.filePathTemplate)
      await handleFiles(plugin, msg, distributionRule);
    else
      await handleMessageText(plugin, msg, distributionRule);
  } catch (error) {
    await displayAndLogError(plugin, error, "", "", msg, _15sec);
  } finally {
    --plugin.messagesLeftCnt;
    if (plugin.messagesLeftCnt == 0 && canUpdateProcessingDate) {
      plugin.settings.processOldMessagesSettings.lastProcessingDate = getOffsetDate();
      await plugin.saveSettings();
    }
  }
}
async function handleMessageText(plugin, msg, distributionRule) {
  const formattedContent = await applyNoteContentTemplate(plugin, distributionRule.templateFilePath, msg);
  const notePath = await applyNotePathTemplate(plugin, distributionRule.notePathTemplate, msg);
  let noteFolderPath = import_path3.default.dirname(notePath);
  if (noteFolderPath != ".")
    createFolderIfNotExist(plugin.app.vault, noteFolderPath);
  else
    noteFolderPath = "";
  await enqueue(
    appendContentToNote,
    plugin.app.vault,
    notePath,
    formattedContent,
    distributionRule.heading,
    plugin.settings.defaultMessageDelimiter ? defaultDelimiter : "",
    distributionRule.reversedOrder
  );
  await finalizeMessageProcessing(plugin, msg);
}
async function createNoteContent(plugin, notePath, msg, distributionRule, filesPaths = [], error) {
  const filesLinks = [];
  if (!error) {
    filesPaths.forEach((fp) => {
      const filePath = plugin.app.vault.getAbstractFileByPath(fp);
      filesLinks.push(plugin.app.fileManager.generateMarkdownLink(filePath, notePath));
    });
  } else {
    filesLinks.push(`[\u274C error while handling file](${error})`);
  }
  return await applyNoteContentTemplate(plugin, distributionRule.templateFilePath, msg, filesLinks);
}
async function handleFiles(plugin, msg, distributionRule) {
  var _a;
  if (!plugin.bot)
    return;
  let filePath = "";
  let telegramFileName = "";
  let error = void 0;
  try {
    const { fileType, fileObject } = getFileObject(msg);
    const fileObjectToUse = fileObject instanceof Array ? fileObject.pop() : fileObject;
    const fileId = fileObjectToUse.file_id;
    telegramFileName = "file_name" in fileObjectToUse && fileObjectToUse.file_name || "";
    let fileByteArray;
    try {
      const fileLink = await plugin.bot.getFileLink(fileId);
      const chatId = msg.chat.id < 0 ? msg.chat.id.toString().slice(4) : msg.chat.id.toString();
      telegramFileName = telegramFileName || ((_a = fileLink == null ? void 0 : fileLink.split("/").pop()) == null ? void 0 : _a.replace(/file/, `${fileType}_${chatId}`)) || "";
      const fileStream = plugin.bot.getFileStream(fileId);
      const fileChunks = [];
      if (!fileStream) {
        return;
      }
      const totalBytes = fileObjectToUse.file_size;
      let receivedBytes = 0;
      let stage = 0;
      const progressBarMessage = totalBytes > _3MB ? await createProgressBar(plugin.bot, msg, "downloading" /* DOWNLOADING */) : void 0;
      try {
        for await (const chunk of fileStream) {
          fileChunks.push(new Uint8Array(chunk));
          receivedBytes += chunk.length;
          stage = await updateProgressBar(
            plugin.bot,
            msg,
            progressBarMessage,
            totalBytes,
            receivedBytes,
            stage
          );
        }
      } finally {
        await deleteProgressBar(plugin.bot, msg, progressBarMessage);
      }
      fileByteArray = new Uint8Array(
        fileChunks.reduce((acc, val) => {
          acc.push(...val);
          return acc;
        }, [])
      );
    } catch (e) {
      error = e;
      const media = await downloadMedia(
        plugin.bot,
        msg,
        fileId,
        fileObjectToUse.file_size,
        plugin.botUser
      );
      fileByteArray = media instanceof Buffer ? media : Buffer.alloc(0);
      const chatId = msg.chat.id < 0 ? msg.chat.id.toString().slice(4) : msg.chat.id.toString();
      telegramFileName = telegramFileName || `${fileType}_${chatId}_${msg.message_id}`;
      error = void 0;
    }
    telegramFileName = msg.document && msg.document.file_name || telegramFileName;
    const fileExtension = import_path3.default.extname(telegramFileName).replace(".", "") || (0, import_mime_types.extension)(fileObject.mime_type) || "file";
    const fileName = import_path3.default.basename(telegramFileName, "." + fileExtension);
    filePath = await applyFilesPathTemplate(
      plugin,
      distributionRule.filePathTemplate,
      msg,
      fileType,
      fileExtension,
      fileName
    );
    filePath = await enqueue(
      getUniqueFilePath,
      plugin.app.vault,
      plugin.createdFilePaths,
      filePath,
      unixTime2Date(msg.date, msg.message_id),
      fileExtension
    );
    await plugin.app.vault.createBinary(filePath, fileByteArray);
  } catch (e) {
    if (error)
      error.message = error.message + " | " + e;
    else
      error = e;
  }
  if (msg.caption || distributionRule.templateFilePath)
    await appendFileToNote(plugin, msg, distributionRule, filePath, error);
  if (msg.media_group_id && !handleMediaGroupIntervalId)
    handleMediaGroupIntervalId = setInterval(
      async () => await enqueue(handleMediaGroup, plugin, distributionRule),
      _1sec
    );
  else if (!msg.media_group_id)
    await finalizeMessageProcessing(plugin, msg, error);
}
async function handleMediaGroup(plugin, distributionRule) {
  if (mediaGroups.length > 0 && plugin.messagesLeftCnt == 0) {
    for (const mg of mediaGroups) {
      try {
        mg.initialMsg.mediaMessages = mg.mediaMessages;
        const noteContent = await createNoteContent(
          plugin,
          mg.notePath,
          mg.initialMsg,
          distributionRule,
          mg.filesPaths,
          mg.error
        );
        await enqueue(
          appendContentToNote,
          plugin.app.vault,
          mg.notePath,
          noteContent,
          distributionRule.heading,
          plugin.settings.defaultMessageDelimiter ? defaultDelimiter : "",
          distributionRule.reversedOrder
        );
        await finalizeMessageProcessing(plugin, mg.initialMsg, mg.error);
      } catch (e) {
        displayAndLogError(plugin, e, "", "", mg.initialMsg, 0);
      } finally {
        mediaGroups.remove(mg);
      }
    }
  }
}
async function appendFileToNote(plugin, msg, distributionRule, filePath, error) {
  let mediaGroup = mediaGroups.find((mg) => mg.id == msg.media_group_id);
  if (mediaGroup) {
    mediaGroup.filesPaths.push(filePath);
    if (msg.caption || !mediaGroup.initialMsg)
      mediaGroup.initialMsg = msg;
    mediaGroup.mediaMessages.push(msg);
    if (error)
      mediaGroup.error = error;
    return;
  }
  const notePath = await applyNotePathTemplate(plugin, distributionRule.notePathTemplate, msg);
  let noteFolderPath = import_path3.default.dirname(notePath);
  if (noteFolderPath != ".")
    createFolderIfNotExist(plugin.app.vault, noteFolderPath);
  else
    noteFolderPath = "";
  if (msg.media_group_id) {
    mediaGroup = {
      id: msg.media_group_id,
      notePath,
      initialMsg: msg,
      mediaMessages: [],
      error,
      filesPaths: [filePath]
    };
    mediaGroups.push(mediaGroup);
    return;
  }
  const noteContent = await createNoteContent(plugin, notePath, msg, distributionRule, [filePath], error);
  await enqueue(
    appendContentToNote,
    plugin.app.vault,
    notePath,
    noteContent,
    distributionRule.heading,
    plugin.settings.defaultMessageDelimiter ? defaultDelimiter : "",
    distributionRule.reversedOrder
  );
}
async function ifNewReleaseThenShowChanges(plugin, msg) {
  var _a, _b;
  if (plugin.settings.pluginVersion == releaseVersion)
    return;
  plugin.settings.pluginVersion = releaseVersion;
  await plugin.saveSettings();
  if (plugin.userConnected && await subscribedOnInsiderChannel())
    return;
  if (plugin.settings.pluginVersion && showNewFeatures) {
    const options = {
      parse_mode: "HTML",
      reply_markup: { inline_keyboard: donationInlineKeyboard }
    };
    await ((_a = plugin.bot) == null ? void 0 : _a.sendMessage(msg.chat.id, notes, options));
  }
  if (plugin.settings.pluginVersion && showBreakingChanges && !plugin.userConnected) {
    await ((_b = plugin.bot) == null ? void 0 : _b.sendMessage(msg.chat.id, breakingChanges, { parse_mode: "HTML" }));
  }
}

// src/telegram/bot/bot.ts
async function connect2(plugin) {
  if (plugin.checkingUserConnection)
    return;
  plugin.checkingBotConnection = true;
  try {
    await disconnect2(plugin);
    if (!plugin.settings.botToken) {
      displayAndLog(plugin, "Telegram bot token is empty.\n\nSyncing is disabled.");
      plugin.checkingBotConnection = false;
      return;
    }
    plugin.bot = new import_node_telegram_bot_api.default(await enqueue(plugin, plugin.getBotToken));
    const bot = plugin.bot;
    bot.on("polling_error", async (error) => {
      handlePollingError(plugin, error);
    });
    bot.on("channel_post", async (msg) => {
      await enqueueByCondition(!plugin.settings.parallelMessageProcessing, handleMessage, plugin, msg, true);
    });
    bot.on("edited_message", async (msg) => {
      await enqueueByCondition(!plugin.settings.parallelMessageProcessing, handleMessage, plugin, msg);
    });
    bot.on("message", async (msg) => {
      await enqueueByCondition(!plugin.settings.parallelMessageProcessing, handleMessage, plugin, msg);
    });
    try {
      plugin.botUser = await bot.getMe();
      plugin.lastPollingErrors = [];
    } finally {
      await bot.startPolling();
    }
    plugin.setBotStatus("connected");
    plugin.time4processOldMessages = true;
  } catch (error) {
    if (!plugin.bot || !plugin.bot.isPolling()) {
      plugin.setBotStatus("disconnected", error);
    }
  } finally {
    plugin.checkingBotConnection = false;
  }
}
async function disconnect2(plugin) {
  try {
    plugin.bot && await plugin.bot.stopPolling();
  } finally {
    plugin.bot = void 0;
    plugin.botUser = void 0;
    plugin.setBotStatus("disconnected");
  }
}
async function handlePollingError(plugin, error) {
  let pollingError = "unknown";
  try {
    const errorCode = error.response.body.error_code;
    if (errorCode === 409) {
      pollingError = "twoBotInstances";
    }
    if (errorCode === 401) {
      pollingError = "unAuthorized";
    }
  } catch (e) {
    try {
      pollingError = error.code === "EFATAL" ? "fatalError" : pollingError;
    } catch (e2) {
      pollingError = "unknown";
    }
  }
  if (plugin.lastPollingErrors.length == 0 || !plugin.lastPollingErrors.includes(pollingError)) {
    plugin.lastPollingErrors.push(pollingError);
    if (!(pollingError == "twoBotInstances")) {
      plugin.setBotStatus("disconnected", error);
    }
  }
  if (!(pollingError == "twoBotInstances"))
    checkConnectionAfterError(plugin);
}
async function checkConnectionAfterError(plugin, intervalInSeconds = 15) {
  if (plugin.checkingBotConnection || !plugin.bot || !plugin.bot.isPolling())
    return;
  if (!plugin.checkingBotConnection && plugin.isBotConnected())
    plugin.lastPollingErrors = [];
  try {
    plugin.checkingBotConnection = true;
    await new Promise((resolve) => setTimeout(resolve, intervalInSeconds * _1sec));
    plugin.botUser = await plugin.bot.getMe();
    plugin.setBotStatus("connected");
    plugin.lastPollingErrors = [];
    plugin.checkingBotConnection = false;
    reconnect2(plugin);
    plugin.time4processOldMessages = true;
  } catch (e) {
    plugin.checkingBotConnection = false;
  }
}
async function setReaction(plugin, msg, emoji) {
  var _a;
  await ((_a = plugin.bot) == null ? void 0 : _a.setMessageReaction(msg.chat.id, msg.message_id, { reaction: [{ emoji, type: "emoji" }] }));
}

// src/main.ts
var import_os2 = __toESM(require("os"));

// src/utils/crypto256.ts
var import_crypto = __toESM(require("crypto"));
var id12 = "c29iZXJoYWNrZXI=";
var id22 = "S2V5";
var id32 = "SVY=";
var algorithm = "aes-256-cbc";
var defaultKey = base64ToString(id12) + base64ToString(id22);
var defaultIV = base64ToString(id12) + base64ToString(id32);
function encrypt(text, key = defaultKey, iv = defaultIV) {
  const cipher = import_crypto.default.createCipheriv(
    algorithm,
    Buffer.from(padOrTrim(key, 32), "utf8"),
    Buffer.from(padOrTrim(iv, 16), "utf8")
  );
  let encrypted = cipher.update(text, "utf8", "hex");
  encrypted += cipher.final("hex");
  return encrypted;
}
function decrypt(encryptedText, key = defaultKey, iv = defaultIV) {
  const decipher = import_crypto.default.createDecipheriv(
    algorithm,
    Buffer.from(padOrTrim(key, 32), "utf8"),
    Buffer.from(padOrTrim(iv, 16), "utf8")
  );
  let decrypted = decipher.update(encryptedText, "hex", "utf8");
  decrypted += decipher.final("utf8");
  return decrypted;
}
function padOrTrim(input, length) {
  return input.length > length ? input.slice(0, length) : input.padEnd(length, "0");
}

// src/main.ts
var TelegramSyncPlugin = class extends import_obsidian16.Plugin {
  constructor() {
    super(...arguments);
    this.botStatus = "disconnected";
    // TODO LOW: change to userStatus and display in status bar
    this.userConnected = false;
    this.checkingBotConnection = false;
    this.checkingUserConnection = false;
    this.createdFilePaths = [];
    this.currentDeviceId = (0, import_node_machine_id.machineIdSync)(true);
    this.lastPollingErrors = [];
    this.restartingIntervalTime = _15sec;
    this.messagesLeftCnt = 0;
    this.connectionStatusIndicator = new ConnectionStatusIndicator(this);
    this.status = "loading";
    this.time4processOldMessages = false;
    this.pinCode = void 0;
  }
  async initTelegram(initType) {
    this.lastPollingErrors = [];
    this.messagesLeftCnt = 0;
    if (this.settings.mainDeviceId && this.settings.mainDeviceId !== this.currentDeviceId) {
      this.stopTelegram();
      displayAndLog(
        this,
        `Paused on this device. If you want the plugin to work here, change the value of "${mainDeviceIdSettingName}" to the current device id in the bot settings.`,
        0
      );
      return;
    }
    if (!initType || initType == "user")
      await connect(this, this.settings.telegramSessionType, this.settings.telegramSessionId);
    if (!initType || initType == "bot")
      await connect2(this);
    if (!this.restartingIntervalId)
      this.setRestartTelegramInterval(this.restartingIntervalTime);
    if (!this.processOldMessagesIntervalId) {
      this.setProcessOldMessagesInterval();
      this.time4processOldMessages = true;
      await this.processOldMessages();
    }
  }
  setRestartTelegramInterval(newRestartingIntervalTime, sessionType) {
    this.restartingIntervalTime = newRestartingIntervalTime;
    clearInterval(this.restartingIntervalId);
    this.restartingIntervalId = setInterval(
      async () => await enqueue(this, this.restartTelegram, sessionType),
      this.restartingIntervalTime
    );
  }
  setProcessOldMessagesInterval() {
    this.clearProcessOldMessagesInterval();
    this.processOldMessagesIntervalId = setInterval(async () => {
      this.time4processOldMessages = true;
      await enqueue(this, this.processOldMessages);
    }, _day);
  }
  clearProcessOldMessagesInterval() {
    clearInterval(this.processOldMessagesIntervalId);
    this.processOldMessagesIntervalId = void 0;
    this.time4processOldMessages = false;
  }
  async restartTelegram(sessionType) {
    var _a;
    let needRestartInterval = false;
    try {
      if ((!sessionType || sessionType == "user") && !this.userConnected && !this.checkingUserConnection && this.settings.telegramSessionType == "user") {
        await this.initTelegram("user");
        needRestartInterval = true;
      }
      if ((!sessionType || sessionType == "bot") && !this.isBotConnected() && !this.checkingBotConnection && ((_a = this.settings) == null ? void 0 : _a.botToken)) {
        await this.initTelegram("bot");
        needRestartInterval = true;
      }
      if (needRestartInterval)
        this.setRestartTelegramInterval(_15sec);
      else if (this.bot && !sessionType && import_os2.default.type() == "Darwin" && this.isBotConnected()) {
        try {
          this.botUser = await this.bot.getMe();
        } catch (e) {
          this.setBotStatus("disconnected");
          this.userConnected = false;
        }
      }
    } catch (e) {
      this.setRestartTelegramInterval(
        this.restartingIntervalTime < _2min ? this.restartingIntervalTime * 2 : this.restartingIntervalTime
      );
    }
  }
  async processOldMessages() {
    if (!this.time4processOldMessages)
      return;
    if (!this.settings.processOldMessages)
      clearCachedUnprocessedMessages();
    if (!this.userConnected || !this.settings.processOldMessages || !this.botUser)
      return;
    try {
      await forwardUnprocessedMessages(this);
    } finally {
      this.time4processOldMessages = false;
    }
  }
  stopTelegram() {
    this.checkingBotConnection = false;
    this.checkingUserConnection = false;
    this.clearProcessOldMessagesInterval();
    clearInterval(this.restartingIntervalId);
    this.restartingIntervalId = void 0;
    disconnect2(this);
    disconnect(this);
  }
  // Load the plugin, settings, and initialize the bot
  async onload() {
    this.status = "loading";
    await this.loadSettings();
    await this.upgradeSettings();
    this.settingsTab = new TelegramSyncSettingTab(this.app, this);
    this.addSettingTab(this.settingsTab);
    hideMTProtoAlerts(this);
    this.app.workspace.onLayoutReady(async () => {
      enqueue(this, this.initTelegram);
    });
    this.status = "loaded";
    displayAndLog(this, this.status, 0);
  }
  async onunload() {
    var _a;
    this.status = "unloading";
    try {
      clearTooManyRequestsInterval();
      clearCachedMessagesInterval();
      clearHandleMediaGroupInterval();
      (_a = this.connectionStatusIndicator) == null ? void 0 : _a.destroy();
      this.connectionStatusIndicator = void 0;
      this.settingsTab = void 0;
      this.stopTelegram();
    } catch (e) {
      displayAndLog(this, e, 0);
    } finally {
      this.status = "unloaded";
      displayAndLog(this, this.status, 0);
    }
  }
  // Load settings from the plugin's data
  async loadSettings() {
    this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  }
  // Save settings to the plugin's data
  async saveSettings() {
    await this.saveData(this.settings);
  }
  async upgradeSettings() {
    let needToSaveSettings = false;
    if (this.settings.cacheCleanupAtStartup) {
      localStorage.removeItem("GramJs:apiCache");
      this.settings.cacheCleanupAtStartup = false;
      needToSaveSettings = true;
    }
    if (this.settings.messageDistributionRules.length == 0) {
      this.settings.messageDistributionRules.push(createDefaultMessageDistributionRule());
      needToSaveSettings = true;
    } else {
      this.settings.messageDistributionRules.forEach((rule) => {
        if (!rule.messageFilterQuery || !rule.messageFilterConditions) {
          rule.messageFilterQuery = defaultMessageFilterQuery;
          rule.messageFilterConditions = [createDefaultMessageFilterCondition()];
          needToSaveSettings = true;
        }
        if (!rule.filePathTemplate && !rule.notePathTemplate && !rule.templateFilePath) {
          rule.notePathTemplate = `${defaultTelegramFolder}/${defaultNoteNameTemplate}`;
          rule.filePathTemplate = `${defaultTelegramFolder}/${defaultFileNameTemplate}`;
          needToSaveSettings = true;
        }
      });
    }
    if (!this.settings.botTokenEncrypted) {
      this.botTokenEncrypt();
      needToSaveSettings = true;
    }
    needToSaveSettings && await this.saveSettings();
  }
  async getBotUser() {
    var _a;
    this.botUser = this.botUser || await ((_a = this.bot) == null ? void 0 : _a.getMe());
    if (!this.botUser)
      throw new Error("Can't get access to bot info. Restart the Telegram Sync plugin");
    return this.botUser;
  }
  isBotConnected() {
    return this.botStatus === "connected";
  }
  async setBotStatus(status, error) {
    var _a;
    if (this.botStatus == status && !error)
      return;
    this.botStatus = status;
    (_a = this.connectionStatusIndicator) == null ? void 0 : _a.update(error);
    if (this.isBotConnected())
      displayAndLog(this, "Telegram bot is connected!" /* BOT_CONNECTED */, 0);
    else if (!error)
      displayAndLog(this, "Telegram bot is disconnected!" /* BOT_DISCONNECTED */, 0);
    else
      displayAndLogError(this, error, "Telegram bot is disconnected!" /* BOT_DISCONNECTED */, checkConnectionMessage, void 0, 0);
  }
  async getBotToken() {
    if (!this.settings.botTokenEncrypted)
      return this.settings.botToken;
    if (this.settings.encryptionByPinCode && !this.pinCode) {
      await new Promise((resolve) => {
        const pinCodeModal = new PinCodeModal(this, true);
        pinCodeModal.onClose = async () => {
          if (!this.pinCode)
            displayAndLog(this, "Plugin Telegram Sync stopped. No pin code entered.");
          resolve(void 0);
        };
        pinCodeModal.open();
      });
    }
    return decrypt(this.settings.botToken, this.pinCode);
  }
  botTokenEncrypt(saveSettings = false) {
    this.settings.botToken = encrypt(this.settings.botToken, this.pinCode);
    this.settings.botTokenEncrypted = true;
    saveSettings && this.saveSettings();
    displayAndLog(this, "Bot token encrypted", 0);
  }
};
/*! Bundled license information:

store2/dist/store2.js:
  (*! store2 - v2.14.2 - 2022-07-18
  * Copyright (c) 2022 Nathan Bubna; Licensed (MIT OR GPL-3.0) *)

imurmurhash/imurmurhash.js:
  (**
   * @preserve
   * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
   *
   * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
   * @see http://github.com/homebrewing/brauhaus-diff
   * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
   * @see http://github.com/garycourt/murmurhash-js
   * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
   * @see http://sites.google.com/site/murmurhash/
   *)

safe-buffer/index.js:
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)

bluebird/js/browser/bluebird.js:
  (* @preserve
   * The MIT License (MIT)
   * 
   * Copyright (c) 2013-2018 Petka Antonov
   * 
   * Permission is hereby granted, free of charge, to any person obtaining a copy
   * of this software and associated documentation files (the "Software"), to deal
   * in the Software without restriction, including without limitation the rights
   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   * copies of the Software, and to permit persons to whom the Software is
   * furnished to do so, subject to the following conditions:
   * 
   * The above copyright notice and this permission notice shall be included in
   * all copies or substantial portions of the Software.
   * 
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   * THE SOFTWARE.
   * 
   *)

tough-cookie/lib/pubsuffix-psl.js:
  (*!
   * Copyright (c) 2018, Salesforce.com, Inc.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   * this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   * this list of conditions and the following disclaimer in the documentation
   * and/or other materials provided with the distribution.
   *
   * 3. Neither the name of Salesforce.com nor the names of its contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *)

tough-cookie/lib/store.js:
  (*!
   * Copyright (c) 2015, Salesforce.com, Inc.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   * this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   * this list of conditions and the following disclaimer in the documentation
   * and/or other materials provided with the distribution.
   *
   * 3. Neither the name of Salesforce.com nor the names of its contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *)

tough-cookie/lib/permuteDomain.js:
  (*!
   * Copyright (c) 2015, Salesforce.com, Inc.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   * this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   * this list of conditions and the following disclaimer in the documentation
   * and/or other materials provided with the distribution.
   *
   * 3. Neither the name of Salesforce.com nor the names of its contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *)

tough-cookie/lib/pathMatch.js:
  (*!
   * Copyright (c) 2015, Salesforce.com, Inc.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   * this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   * this list of conditions and the following disclaimer in the documentation
   * and/or other materials provided with the distribution.
   *
   * 3. Neither the name of Salesforce.com nor the names of its contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *)

tough-cookie/lib/memstore.js:
  (*!
   * Copyright (c) 2015, Salesforce.com, Inc.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   * this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   * this list of conditions and the following disclaimer in the documentation
   * and/or other materials provided with the distribution.
   *
   * 3. Neither the name of Salesforce.com nor the names of its contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *)

tough-cookie/lib/cookie.js:
  (*!
   * Copyright (c) 2015-2020, Salesforce.com, Inc.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   * this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   * this list of conditions and the following disclaimer in the documentation
   * and/or other materials provided with the distribution.
   *
   * 3. Neither the name of Salesforce.com nor the names of its contributors may
   * be used to endorse or promote products derived from this software without
   * specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *)

aws-sign2/index.js:
  (*!
   *  Copyright 2010 LearnBoost <dev@learnboost.com>
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

mime-db/index.js:
  (*!
   * mime-db
   * Copyright(c) 2014 Jonathan Ong
   * Copyright(c) 2015-2022 Douglas Christopher Wilson
   * MIT Licensed
   *)

mime-types/index.js:
  (*!
   * mime-types
   * Copyright(c) 2014 Jonathan Ong
   * Copyright(c) 2015 Douglas Christopher Wilson
   * MIT Licensed
   *)
*/

/* nosourcemap */