"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = StepAddonComponent;
const contexts_1 = require("../../../contexts/index.js");
const events_1 = require("../../../events/index.js");
const react_1 = __importStar(require("react"));
const react_i18next_1 = require("react-i18next");
const react_router_dom_1 = require("react-router-dom");
const Translation_1 = require("translations/Translation");
const BackButton_1 = __importDefault(require("../../../components/generic/BackButton"));
const Headline_1 = __importDefault(require("../../../components/generic/Headline"));
const StepLayout_1 = require("../../../components/generic/Layout/StepLayout");
const LineBreak_1 = __importDefault(require("../../../components/generic/LineBreak"));
const PageTitle_1 = require("../../../components/generic/PageTitle");
const AddonList_1 = __importDefault(require("../../../components/steps/addons/AddonList"));
const StepRoomHotelDetails_1 = __importDefault(require("../../../components/steps/room/StepRoomHotelDetails"));
const BEMobileSummary_1 = __importDefault(require("../../../components/summary/BEMobileSummary"));
const EventHook_1 = require("../../../hooks/EventHook");
const ScreenSize_1 = __importDefault(require("../../../util/ScreenSize"));
const StepManager_1 = __importDefault(require("../../../util/StepManager"));
function StepAddonComponent() {
    const context = (0, react_1.useContext)(contexts_1.BookingEngineContext);
    const { currentStep } = (0, react_1.useContext)(contexts_1.FullPageEngineContext);
    const { currentBasketRows } = (0, react_1.useContext)(contexts_1.BasketContext);
    const location = (0, react_router_dom_1.useLocation)();
    const { t } = (0, react_i18next_1.useTranslation)();
    const { raise } = (0, EventHook_1.useEvent)();
    (0, react_1.useEffect)(() => {
        const event = new events_1.StepAddonViewEvent(currentBasketRows);
        raise(event);
    }, []);
    return (react_1.default.createElement("div", { className: "container rs-step-addon" },
        react_1.default.createElement(PageTitle_1.PageTitle, { step: "Addon" }),
        react_1.default.createElement(BEMobileSummary_1.default, null),
        react_1.default.createElement(StepLayout_1.StepLayoutContainer, null,
            react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null, context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(react_1.default.Fragment, null,
                react_1.default.createElement(react_router_dom_1.Link, { to: {
                        pathname: StepManager_1.default.getPreviousStepUrl(currentStep),
                        search: location.search,
                    } },
                    react_1.default.createElement(BackButton_1.default, null)),
                react_1.default.createElement("div", { className: "u-marg-top--light u-marg-bottom--heavy" },
                    react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Navigation.Steps.Addon)))))),
            context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(StepLayout_1.StepLayoutRightContent, null,
                react_1.default.createElement(StepRoomHotelDetails_1.default, null)))),
        context.screenSize > ScreenSize_1.default.Medium && react_1.default.createElement(LineBreak_1.default, null),
        react_1.default.createElement(AddonList_1.default, null)));
}
//# sourceMappingURL=StepAddonComponent.js.map