exports.id = 7596;
exports.ids = [7596];
exports.modules = {

/***/ 26438:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ getParams)
/* harmony export */ });
function getParams(req) {
    if (req?.method == "POST") {
        return new Proxy({}, {
            get (_, key) {
                return req.body?.[key];
            }
        });
    /*
    // Disabled, since this could lead to a sneaky click on a link attack.
    // Should only be enabled for dev purposes.
    } else if (req?.method == "GET") {
    return new Proxy(
      {},
      {
        get(_, key) {
          if (typeof key != "string") {
            return undefined;
          }
          return req.query?.[key];
        },
      }
    );
*/ } else {
        // only support params for POST requests.
        return {};
    }
}


/***/ }),

/***/ 742626:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/*
Returns information about a given license, which
the user with the given account is *allowed* to get.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isManager = void 0;
const pool_1 = __importDefault(__webpack_require__(541808));
const util_1 = __webpack_require__(863563);
const analytics_1 = __webpack_require__(354012);
const misc_1 = __webpack_require__(854006);
async function isManager(license_id, account_id) {
    if (!(0, misc_1.isValidUUID)(account_id)) {
        return false;
    }
    const pool = (0, pool_1.default)("short");
    const { rows } = await pool.query("SELECT COUNT(*)::INT AS count FROM site_licenses WHERE id=$1 AND $2=ANY(managers)", [license_id, account_id]);
    return rows[0].count > 0;
}
exports.isManager = isManager;
async function getLicense(license_id, account_id) {
    const pool = (0, pool_1.default)();
    const is_manager = await isManager(license_id, account_id);
    const query = is_manager
        ? `SELECT id, title, description,
    expires, activates, last_used,
    managers, upgrades, quota, run_limit, info
    FROM site_licenses WHERE $1=id`
        : `SELECT title, expires, activates, upgrades, quota, run_limit
    FROM site_licenses WHERE $1=id`;
    const { rows } = await pool.query(query, [license_id]);
    if (rows.length == 0) {
        throw Error(`no license with id ${license_id}`);
    }
    (0, util_1.toEpoch)(rows, ["expires", "activates", "last_used"]);
    rows[0].is_manager = is_manager;
    if (is_manager) {
        const nr = await pool.query((0, analytics_1.numberRunningQuery)(license_id));
        rows[0].number_running = nr.rows[0].count;
    }
    return rows[0];
}
exports["default"] = getLicense;
//# sourceMappingURL=get-license.js.map

/***/ }),

/***/ 630900:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var crypto = __webpack_require__(706113);

var rn = function(max) {
  var rnBytes = crypto.randomBytes(2);
  var randomNum = rnBytes.readUInt8(0) * 256 + rnBytes.readUInt8(1);
  return randomNum % max;
}

var digits = '0123456789'
var base62 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'
var base30 = '0123456789ABCDFHKLMNPQRSTUVWXYZ'  // 1-9, A-Z exclude(E, G, I, J, O) for human read

exports.generate = function(len, chars) {
  len = len || 16;
  chars = chars || base62;
  var key = '';
  var charsLen = chars.length;
  for (var i=0; i<len; i++) {
    key += chars[rn(charsLen)];
  }
  return key;
};

exports.generateDigits = function(len) {
  len = len || 16;
  return exports.generate(len, digits)
};

exports.generateBase30 = function(len) {
  len = len || 16;
  return exports.generate(len, base30)
}


/***/ })

};
;