(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", "../hooks/useStateProps", "./styles"], 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 useStateProps_1 = require("../hooks/useStateProps");
    var styles_1 = require("./styles");
    var MapObject = react_1.default.forwardRef(function (_a, ref) {
        var className = _a.className, icon = _a.icon, typeColor = _a.typeColor, onClick = _a.onClick, isDisabled = _a.isDisabled, props = (0, tslib_1.__rest)(_a, ["className", "icon", "typeColor", "onClick", "isDisabled"]);
        var _b = (0, tslib_1.__read)((0, useStateProps_1.useStateProps)(props.isChecked), 2), isChecked = _b[0], setIsChecked = _b[1];
        var handleClick = function (event) {
            setIsChecked(function (prevState) { return !prevState; });
            onClick === null || onClick === void 0 ? void 0 : onClick(event);
        };
        return (react_1.default.createElement(styles_1.MapObjectRoot, (0, tslib_1.__assign)({ className: className, typeColor: typeColor, onClick: handleClick, isChecked: isChecked, isDisabled: isDisabled, ref: ref }, props),
            icon,
            !isDisabled && react_1.default.createElement(styles_1.StripeStyled, { isChecked: isChecked })));
    });
    MapObject.displayName = "MapObject";
    exports.default = MapObject;
});
