"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getInitEvent = void 0;
var _Core = require("../../../../../Core.constants");
const ACCOMMODATION_TYPE_NAME = Object.keys(_Core.ACCOMMODATION_TYPE);
const getInitEvent = _ref => {
  var _variants$hotelId;
  let mobile = _ref.mobile,
    step = _ref.step,
    _ref$hotel = _ref.hotel,
    _ref$hotel2 = _ref$hotel === void 0 ? {} : _ref$hotel,
    accommodationType = _ref$hotel2.accommodationType,
    hotelId = _ref$hotel2.id,
    _ref$hotel2$variants = _ref$hotel2.variants,
    variants = _ref$hotel2$variants === void 0 ? {} : _ref$hotel2$variants,
    id = _ref.id,
    type = _ref.type;
  return {
    chainId: type === _Core.TYPE.CHAIN ? id : undefined,
    device: mobile ? 'MOBILE' : 'DESKTOP_TABLET',
    event: 'init',
    home: window.location.host,
    hotelId,
    lodgingDenomination: ACCOMMODATION_TYPE_NAME[((_variants$hotelId = variants[hotelId]) === null || _variants$hotelId === void 0 ? void 0 : _variants$hotelId.accommodationType) || accommodationType],
    step
  };
};
exports.getInitEvent = getInitEvent;
//# sourceMappingURL=getInitEvent.js.map