'use strict';

var index = require('./index-p7cvUYAE.js');
var badge = require('./badge-GBNtUypt.js');

exports.PaymentStatusBadge = void 0;
(function (PaymentStatusBadge) {
    PaymentStatusBadge["SUCCEEDED"] = "succeeded";
    PaymentStatusBadge["AUTHORIZED"] = "authorized";
    PaymentStatusBadge["PENDING"] = "pending";
    PaymentStatusBadge["ACH_FAILED"] = "achFailed";
    PaymentStatusBadge["FAILED"] = "failed";
    PaymentStatusBadge["CANCELED"] = "canceled";
    PaymentStatusBadge["DISPUTED"] = "disputed";
    PaymentStatusBadge["DISPUTE_LOST"] = "dispute_lost";
    PaymentStatusBadge["FULLY_REFUNDED"] = "fully_refunded";
    PaymentStatusBadge["PARTIALLY_REFUNDED"] = "partially_refunded";
})(exports.PaymentStatusBadge || (exports.PaymentStatusBadge = {}));
const MapPaymentStatusToBadge = (status) => {
    const statusToBadgeProps = {
        succeeded: {
            variant: badge.BadgeVariant.SUCCESS,
            title: 'This payment was successfully captured',
            text: 'Succeeded',
        },
        authorized: {
            variant: badge.BadgeVariant.PRIMARY,
            title: 'This card payment was authorized, but not captured. It could still succeed or fail.',
            text: 'Authorized',
        },
        pending: {
            variant: badge.BadgeVariant.PRIMARY,
            title: 'This ACH payment was processed, but the funds have not settled. It could still succeed or fail.',
            text: 'Pending',
        },
        achFailed: {
            variant: badge.BadgeVariant.DANGER,
            title: 'The funds couldn\'t be collected for this ACH payment (in addition to the original payment, an ACH return and fee will appear in a payout)',
            text: 'ACH Failed',
        },
        failed: {
            variant: badge.BadgeVariant.DANGER,
            title: 'This card payment did not go through (it will not appear in a payout)',
            text: 'Failed',
        },
        canceled: {
            variant: badge.BadgeVariant.DANGER,
            title: 'This payment was canceled',
            text: 'Canceled',
        },
        disputed: {
            variant: badge.BadgeVariant.WARNING,
            title: 'The account holder disputed this payment. The amount has been returned and a fee assessed.',
            text: 'Disputed',
        },
        dispute_lost: {
            variant: badge.BadgeVariant.SECONDARY,
            title: 'The cardholder has won the dispute.',
            text: 'Dispute Lost',
        },
        fully_refunded: {
            variant: badge.BadgeVariant.SECONDARY,
            title: 'The full amount of this payment has been refunded',
            text: 'Fully Refunded',
        },
        partially_refunded: {
            variant: badge.BadgeVariant.SECONDARY,
            title: 'A portion of this payment has been refunded',
            text: 'Partially Refunded',
        },
    };
    const badgeProps = statusToBadgeProps[status];
    return index.h(badge.Badge, Object.assign({}, badgeProps));
};

exports.MapPaymentStatusToBadge = MapPaymentStatusToBadge;
