"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.checkSession = void 0;
var _services = require("@mirai/services");
const MIRAI = 1;
const PESTANA = 3;
const checkSession = async function (idHotel, session) {
  let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  const {
    club: {
      club: {
        authentication: {
          type = MIRAI
        } = {},
        idClub
      } = {}
    } = {}
  } = config;
  const response = await _services.ServiceUser.check({
    idHotel,
    session
  });
  if (!response && type === PESTANA && idClub) document.location.href = "".concat(process.env.SERVICE_USER, "/club/v1/forwarder/expiration?idClub=").concat(idClub);
  return response;
};
exports.checkSession = checkSession;
//# sourceMappingURL=checkSession.js.map