"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePaymentHelper = void 0;
const react_1 = require("react");
const ConfirmationStepContext_1 = require("../contexts/ConfirmationStepContext/ConfirmationStepContext");
const usePaymentHelper = () => {
    const confirmationContext = (0, react_1.useContext)(ConfirmationStepContext_1.ConfirmationStepContext);
    const exclusivePayment = (0, react_1.useMemo)(() => {
        return confirmationContext.availablePaymentHandlers.find((handler) => handler.isAvailable && handler.isExclusive);
    }, [confirmationContext.availablePaymentHandlers]);
    return {
        /**
         * If this value is set, this will be the only payment handler available for frontend.
         */
        exclusivePayment,
    };
};
exports.usePaymentHelper = usePaymentHelper;
//# sourceMappingURL=usePaymentHelper.js.map