"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.racMemberHandler = void 0;
const core_1 = require("@roomstay/core");
const react_1 = __importDefault(require("react"));
const react_i18next_1 = require("react-i18next");
const EmailAndFullnameMemberModal_1 = __importDefault(require("../../components/members/SignInModal/EmailAndFullnameMemberModal"));
const RoomstayThemeEngine_1 = __importDefault(require("../../providers/RoomstayThemeEngine"));
const Translation_1 = require("../../translations/Translation");
const racMemberHandler = (hotel) => {
    var _a, _b, _c;
    const { t } = (0, react_i18next_1.useTranslation)();
    return {
        provider: core_1.EMembershipProvider.RAC,
        isAvailable: (_b = (_a = hotel === null || hotel === void 0 ? void 0 : hotel.integrations) === null || _a === void 0 ? void 0 : _a.includes(core_1.EIntegration.RAC)) !== null && _b !== void 0 ? _b : false,
        renderSignInModal: () => {
            var _a, _b;
            return (react_1.default.createElement(EmailAndFullnameMemberModal_1.default, { title: t(Translation_1.Translation.ExternalMemberPopup.RACTitle), image: ((_a = hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalImages) === null || _a === void 0 ? void 0 : _a[core_1.EMembershipProvider.RAC]) || (hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalImage) || RoomstayThemeEngine_1.default.getImageAssetUrl('rac-login.png'), isOpen: true, imageSize: (_b = hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalImageSize) !== null && _b !== void 0 ? _b : 'contain', isMemberNumberRequired: hotel === null || hotel === void 0 ? void 0 : hotel.isRACMemberNoRequired, provider: core_1.EMembershipProvider.RAC }));
        },
        memberOnlyImage: ((_c = hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyImages) === null || _c === void 0 ? void 0 : _c[core_1.EMembershipProvider.RAC]) || (hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyImage) || RoomstayThemeEngine_1.default.getImageAssetUrl('rac-login.png'),
        title: t(Translation_1.Translation.ExternalMemberPopup.RACTitle),
        name: t(Translation_1.Translation.Step.Room.RoomInfo.MemberOnlyRow.RAC),
    };
};
exports.racMemberHandler = racMemberHandler;
//# sourceMappingURL=RACMemberHandler.js.map