(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "react", "@greenatom/icons", "../../Tooltip", "../style"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = require("tslib");
    var react_1 = (0, tslib_1.__importDefault)(require("react"));
    var icons_1 = require("@greenatom/icons");
    var Tooltip_1 = (0, tslib_1.__importDefault)(require("../../Tooltip"));
    var style_1 = require("../style");
    var IconsBox = function (_a) {
        var isHasValue = _a.isHasValue, isDisabled = _a.isDisabled, type = _a.type, isPasswordVisible = _a.isPasswordVisible, tooltipContent = _a.tooltipContent, tooltipPosition = _a.tooltipPosition, isShowClearIcon = _a.isShowClearIcon, onClear = _a.onClear, onPasswordToggle = _a.onPasswordToggle, _b = _a.testId, testId = _b === void 0 ? "" : _b, classNameIconBox = _a.classNameIconBox, isReadOnly = _a.isReadOnly;
        var onClickHandler = function () {
            !isDisabled && (onPasswordToggle === null || onPasswordToggle === void 0 ? void 0 : onPasswordToggle());
        };
        return (react_1.default.createElement(style_1.IconsBoxStyled, { className: classNameIconBox },
            isShowClearIcon && (react_1.default.createElement(style_1.IconWrapper, { onClick: onClear, "data-element": "input-clearFunc" }, isHasValue && !isDisabled && !isReadOnly && (react_1.default.createElement(icons_1.IconBrokenCloseCircle, { "data-element": "input-clearIcon", width: 14, height: 14 })))),
            type === "password" && !isReadOnly && !isDisabled && (react_1.default.createElement(style_1.IconWrapper, { onClick: onClickHandler }, isPasswordVisible ? (react_1.default.createElement(icons_1.IconBrokenEye, { "data-element": "input-hidePasswordIcon", "data-test-id": "input_eye_" + testId, width: 14, height: 14 })) : (react_1.default.createElement(icons_1.IconBrokenEyeSlash, { "data-element": "input-showPasswordIcon", "data-test-id": "input_eye_" + testId, width: 14, height: 14 })))),
            tooltipContent && (react_1.default.createElement(style_1.IconWrapper, null,
                react_1.default.createElement(Tooltip_1.default, { text: tooltipContent, direction: tooltipPosition },
                    react_1.default.createElement(icons_1.IconBrokenInfoCircle, { width: 14, height: 14 }))))));
    };
    exports.default = IconsBox;
});
