"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getUrlBooking = void 0;
var _toUrlParams = require("./toUrlParams");
var _ButtonPayment = require("../ButtonPayment.constants");
const getUrlBooking = _ref => {
  let {
    code,
    environment,
    forwarder: {
      booking: url = "".concat(process.env.SERVICE_BOOKING, "/").concat(_ButtonPayment.ENDPOINT.BOOKING)
    } = {},
    id,
    locale,
    reservationCode,
    tracking,
    url: home,
    urlParams: {
      fingerprint,
      hsri = _ButtonPayment.DEFAULT_HSRI,
      idchain,
      miraiId,
      type,
      utm_source,
      variant
    } = {}
  } = _ref;
  if (!code || !id || !locale || !reservationCode) return;
  return "".concat(url).concat((0, _toUrlParams.toUrlParams)({
    code,
    env: environment,
    fingerprint,
    hsri,
    home,
    idchain,
    idHotel: id,
    lang: locale.split('-')[0],
    miraiId,
    reservationCode,
    type,
    tracking,
    utm_source,
    variant,
    version: 2
  }));
};
exports.getUrlBooking = getUrlBooking;
//# sourceMappingURL=getUrlBooking.js.map