"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.decoratePinnedColumns = decoratePinnedColumns;
var _types = require("../types");
function decoratePinnedColumns(data) {
  // we need to filter reserved columns not to duplicate them below
  const pinnedWithoutReservedColumns = data?.left?.filter(column => ![_types.EXPAND_TOGGLE_COLUMN.ID, _types.CHECKBOXES_COLUMN.ID].includes(column)) ?? [];

  // we need to always add checkboxes and expand row toggle cell to the left pinned and row actions to the right
  // we do not care if either of them is actually enabled in the table, cause if they are not - they just won't be rendered
  return {
    left: [_types.EXPAND_TOGGLE_COLUMN.ID, _types.CHECKBOXES_COLUMN.ID, ...pinnedWithoutReservedColumns],
    right: [_types.ROW_ACTIONS_COLUMN.ID]
  };
}