"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var styledComponents_1 = require("./styledComponents");
var textComponents_1 = require("./textComponents");
var Button_1 = require("../Button");
var TransactionButton_1 = require("../TransactionButton");
var PhaseCountdown_1 = require("../PhaseCountdown/");
var ChallengeResultsChart_1 = require("../ChallengeResultsChart");
var ChallengePhaseDetail_1 = require("./ChallengePhaseDetail");
var NeedHelp_1 = __importDefault(require("./NeedHelp"));
var QuestionToolTip_1 = require("../QuestionToolTip");
var RequestAppealButton = function (props) {
    if (props.requestAppealURI) {
        return (React.createElement(React.Fragment, null,
            React.createElement(Button_1.InvertedButton, { size: Button_1.buttonSizes.MEDIUM, to: props.requestAppealURI }, "Request an Appeal")));
    }
    return (React.createElement(TransactionButton_1.TransactionButtonNoModal, { transactions: props.transactions }, "Request Appeal from Civil Council"));
};
exports.ChallengeRequestAppealCard = function (props) {
    return (React.createElement(styledComponents_1.StyledListingDetailPhaseCardContainer, null,
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.StyledPhaseKicker, null,
                "Challenge ID ",
                props.challengeID),
            React.createElement(styledComponents_1.StyledPhaseDisplayName, null,
                React.createElement(textComponents_1.UnderChallengePhaseDisplayNameText, null),
                React.createElement(QuestionToolTip_1.QuestionToolTip, { explainerText: React.createElement(textComponents_1.UnderChallengeToolTipText, null), positionBottom: true })),
            React.createElement(PhaseCountdown_1.ProgressBarCountdownTimer, { endTime: props.endTime, totalSeconds: props.phaseLength, displayLabel: "Accepting Appeal Requests", toolTipText: React.createElement(textComponents_1.RequestAppealToolTipText, { phaseLength: props.phaseLength }), flavorText: "under challenge" })),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(ChallengePhaseDetail_1.ChallengePhaseDetail, { challengeID: props.challengeID, challenger: props.challenger, isViewingUserChallenger: props.isViewingUserChallenger, rewardPool: props.rewardPool, stake: props.stake, dispensationPct: props.dispensationPct })),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(ChallengeResultsChart_1.ChallengeResults, { collapsable: true, totalVotes: props.totalVotes, votesFor: props.votesFor, votesAgainst: props.votesAgainst, percentFor: props.percentFor, percentAgainst: props.percentAgainst, didChallengeSucceed: props.didChallengeOriginallySucceed })),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.CTACopy, null, "If you disagree with the community, you may request an appeal to the Civil Council."),
            React.createElement(RequestAppealButton, __assign({}, props))),
        React.createElement(NeedHelp_1.default, { faqURL: props.faqURL })));
};
//# sourceMappingURL=ChallengeRequestAppealCard.js.map