"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConstructorBlock = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const pick_1 = tslib_1.__importDefault(require("lodash/pick.js"));
const BlockBase_1 = tslib_1.__importDefault(require("../../../../components/BlockBase/BlockBase.js"));
const BlockDecoration_1 = require("../../../../customization/BlockDecoration.js");
const usePCEditorItemWrap_1 = require("../../../../hooks/usePCEditorItemWrap.js");
const utils_1 = require("../../../../utils/index.js");
const b = (0, utils_1.block)('constructor-block');
const ConstructorBlock = ({ index = 0, data, children, }) => {
    const { blockRef, adminBlockMouseEvents } = (0, usePCEditorItemWrap_1.usePCEditorItemWrap)(index);
    const { type } = data;
    const blockBaseProps = React.useMemo(() => (0, pick_1.default)(data, ['anchor', 'visible', 'resetPaddings', 'indent']), [data]);
    return ((0, jsx_runtime_1.jsx)("div", { ref: blockRef, ...adminBlockMouseEvents, children: (0, jsx_runtime_1.jsx)(BlockDecoration_1.BlockDecoration, { type: type, index: index, ...blockBaseProps, children: (0, jsx_runtime_1.jsx)(BlockBase_1.default, { className: b({ type }), ...blockBaseProps, children: children }) }) }));
};
exports.ConstructorBlock = ConstructorBlock;
//# sourceMappingURL=ConstructorBlock.js.map
