"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var ReactDOM = __importStar(require("react-dom"));
var styledComponents_1 = require("../ListingDetailPhaseCard/styledComponents");
var ChallengePhaseDetail_1 = require("../ListingDetailPhaseCard/ChallengePhaseDetail");
var RevealVote_1 = require("../ListingDetailPhaseCard/RevealVote");
var textComponents_1 = require("../ListingDetailPhaseCard/textComponents");
var PhaseCountdown_1 = require("../PhaseCountdown/");
var ParameterizerStyledComponents_1 = require("./ParameterizerStyledComponents");
var textComponents_2 = require("./textComponents");
var ChallengeProposalRevealVote = /** @class */ (function (_super) {
    __extends(ChallengeProposalRevealVote, _super);
    function ChallengeProposalRevealVote() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.bucket = document.createElement("div");
        _this.renderRevealVote = function () {
            if (!_this.props.userHasCommittedVote) {
                return (React.createElement(React.Fragment, null,
                    React.createElement(styledComponents_1.FormHeader, null, "You did not participate in this challenge"),
                    React.createElement(styledComponents_1.FormCopy, null, "You did not commit a vote, so there is nothing here for you to reveal")));
            }
            else if (_this.props.userHasRevealedVote) {
                return (React.createElement(React.Fragment, null,
                    React.createElement(styledComponents_1.FormHeader, null, "You have revealed your vote"),
                    React.createElement(styledComponents_1.FormCopy, null,
                        "Thank you for participating! Please check back after the challenge ends to see if you have earned a reward",
                        " ")));
            }
            else {
                return (React.createElement(React.Fragment, null,
                    React.createElement(RevealVote_1.RevealVote, { voteOption: _this.props.voteOption, salt: _this.props.salt, onInputChange: _this.props.onInputChange, transactions: _this.props.transactions, postExecuteTransactions: _this.props.postExecuteTransactions, votingSmartContractFaqURL: _this.props.votingSmartContractFaqURL },
                        "Should this proposal be ",
                        React.createElement("b", null, "accepted"),
                        " or ",
                        React.createElement("b", null, "rejected"),
                        " from the Civil Registry?")));
            }
        };
        return _this;
    }
    ChallengeProposalRevealVote.prototype.componentDidMount = function () {
        document.body.appendChild(this.bucket);
    };
    ChallengeProposalRevealVote.prototype.componentWillUnmount = function () {
        document.body.removeChild(this.bucket);
    };
    ChallengeProposalRevealVote.prototype.render = function () {
        return ReactDOM.createPortal(React.createElement(ParameterizerStyledComponents_1.StyledCreateProposalOuter, null,
            React.createElement(ParameterizerStyledComponents_1.StyledChallengeProposalContainer, null,
                React.createElement(ParameterizerStyledComponents_1.StyledCreateProposalHeaderClose, { onClick: this.props.handleClose }, "\u2716"),
                React.createElement(ParameterizerStyledComponents_1.StyledCreateProposalContent, null,
                    React.createElement(ParameterizerStyledComponents_1.StyledSection, null,
                        React.createElement(styledComponents_1.StyledPhaseKicker, null,
                            "Challenge ID ",
                            this.props.challengeID),
                        React.createElement(styledComponents_1.StyledPhaseDisplayName, null,
                            React.createElement(textComponents_1.UnderChallengePhaseDisplayNameText, null)),
                        React.createElement(PhaseCountdown_1.TwoPhaseProgressBarCountdownTimer, { endTime: this.props.endTime, totalSeconds: this.props.phaseLength, displayLabel: "Accepting votes", secondaryDisplayLabel: "Confirming Votes", flavorText: "under challenge", activePhaseIndex: 0 })),
                    React.createElement(ParameterizerStyledComponents_1.StyledSection, null,
                        React.createElement(ParameterizerStyledComponents_1.StyledMetaName, null,
                            React.createElement(textComponents_2.CreateProposalParamNameLabelText, null)),
                        React.createElement(ParameterizerStyledComponents_1.StyledMetaValue, null, this.props.parameterDisplayName)),
                    React.createElement(ParameterizerStyledComponents_1.StyledSection, null,
                        React.createElement(ParameterizerStyledComponents_1.StyledMetaName, null,
                            React.createElement(textComponents_2.CreateProposalParamCurrentValueLabelText, null)),
                        React.createElement(ParameterizerStyledComponents_1.StyledMetaValue, null, this.props.parameterCurrentValue)),
                    React.createElement(ParameterizerStyledComponents_1.StyledSection, null,
                        React.createElement(ParameterizerStyledComponents_1.StyledMetaName, null,
                            React.createElement(textComponents_2.ChallengeProposalNewValueLabelText, null)),
                        React.createElement(ParameterizerStyledComponents_1.StyledMetaValue, null, this.props.parameterProposalValue)),
                    React.createElement(ParameterizerStyledComponents_1.StyledSection, null,
                        React.createElement(ChallengePhaseDetail_1.ChallengePhaseDetail, { challengeID: this.props.challengeID, challenger: this.props.challenger, rewardPool: this.props.rewardPool, stake: this.props.stake })),
                    React.createElement(ParameterizerStyledComponents_1.StyledSection, null,
                        React.createElement(styledComponents_1.StyledPhaseKicker, null,
                            "Challenge ID ",
                            this.props.challengeID),
                        this.renderRevealVote())))), this.bucket);
    };
    return ChallengeProposalRevealVote;
}(React.Component));
exports.ChallengeProposalRevealVote = ChallengeProposalRevealVote;
//# sourceMappingURL=ChallengeProposalRevealVote.js.map