"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.bookingResponse = void 0;
var _helpers = require("../../../helpers");
var _legacy = require("../../helpers/legacy");
const bookingResponse = function () {
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
    checkin = _ref.checkin,
    checkout = _ref.checkout,
    hotelCurrency = _ref.hotelCurrency,
    idReservation = _ref.idReservation,
    reservedRooms = _ref.reservedRooms;
  (0, _helpers.dataLayerPush)({
    'duetto.data': reservedRooms.map(function () {
      let _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
        occupation = _ref2.occupation,
        rateName = _ref2.rateName,
        roomTypeName = _ref2.roomTypeName,
        totalPriceWithTaxes = _ref2.totalPriceWithTaxes;
      return {
        b: idReservation,
        r: (0, _legacy.formatPrice)(totalPriceWithTaxes, hotelCurrency),
        cc: hotelCurrency.code,
        rc: rateName,
        rt: roomTypeName,
        na: occupation.numAdults,
        nc: occupation.totalChildren,
        sd: checkin,
        ed: checkout
      };
    }),
    event: 'duetto.Booking'
  });
};
exports.bookingResponse = bookingResponse;
//# sourceMappingURL=bookingResponse.js.map