"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Check_1 = require("../../Check");
var Check_styles_1 = require("../Check/Check.styles");
var DetailsRowCheck_styles_1 = require("./DetailsRowCheck.styles");
var Utilities_2 = require("../../Utilities");
var getCheckClassNames = Utilities_2.classNamesFunction();
var getClassNames = Utilities_2.classNamesFunction();
var DetailsRowCheckBase = function (props) {
    var _a = props.canSelect, canSelect = _a === void 0 ? false : _a, _b = props.isSelected, isSelected = _b === void 0 ? false : _b, _c = props.anySelected, anySelected = _c === void 0 ? false : _c, _d = props.selected, selected = _d === void 0 ? false : _d, _e = props.isHeader, isHeader = _e === void 0 ? false : _e, className = props.className, checkClassName = props.checkClassName, styles = props.styles, theme = props.theme, compact = props.compact, buttonProps = tslib_1.__rest(props, ["canSelect", "isSelected", "anySelected", "selected", "isHeader", "className", "checkClassName", "styles", "theme", "compact"]);
    var isPressed = props.isSelected || props.selected;
    var checkStyles = Check_styles_1.getStyles({ theme: theme });
    var checkClassNames = getCheckClassNames(checkStyles, {
        theme: theme
    });
    var classNames = getClassNames(styles, {
        theme: theme,
        canSelect: canSelect,
        selected: isPressed,
        anySelected: anySelected,
        className: className,
        isHeader: isHeader,
        compact: compact
    });
    return (React.createElement("div", tslib_1.__assign({}, buttonProps, { role: "checkbox", className: Utilities_1.css(classNames.root, classNames.check, checkClassNames.checkHost), "aria-checked": isPressed, "data-selection-toggle": true, "data-automationid": "DetailsRowCheck" }),
        React.createElement(Check_1.Check, { checked: isPressed })));
};
exports.DetailsRowCheck = Utilities_1.styled(DetailsRowCheckBase, DetailsRowCheck_styles_1.getStyles, undefined, { scope: 'DetailsRowCheck' });
//# sourceMappingURL=DetailsRowCheck.js.map