"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_core_1 = require("@patternfly/react-core");
const utils_1 = require("./utils");
const TextAreaField_1 = tslib_1.__importDefault(require("./TextAreaField"));
const TextAreaSecretField = (_a) => {
    var { isSet, isEdit, helperTextHidden, onToggle, idPostfix } = _a, props = tslib_1.__rest(_a, ["isSet", "isEdit", "helperTextHidden", "onToggle", "idPostfix"]);
    const { label, name } = props;
    const fieldId = (0, utils_1.getFieldId)(name, 'input', idPostfix);
    if (isEdit) {
        return (React.createElement(TextAreaField_1.default, Object.assign({}, props), isSet && (React.createElement(react_core_1.Button, { onClick: () => onToggle(true), variant: "link" }, "Keep existing value"))));
    }
    return (React.createElement(react_core_1.FormGroup, { fieldId: fieldId, label: label, isRequired: props.isRequired },
        React.createElement(react_core_1.Button, { onClick: () => onToggle(false), variant: "link" }, "Change"),
        helperTextHidden && (React.createElement(react_core_1.FormHelperText, null,
            React.createElement(react_core_1.HelperText, null,
                React.createElement(react_core_1.HelperTextItem, { "data-testid": `input-textareasecret-${fieldId}-helper-text` },
                    ' ',
                    helperTextHidden))))));
};
exports.default = TextAreaSecretField;
//# sourceMappingURL=TextAreaSecretField.js.map