"use strict";
const React = require("react");
const classNames = require("../../_util/classNames.js");
const is = require("../../_util/is.js");
function useStickyClassNames(groupColumns, columns, prefixCls) {
  var colFixed = columns.map(function(c) {
    return c.fixed;
  });
  function getClassNameFromColumn(column, index) {
    var _a;
    return classNames((_a = {}, _a[prefixCls + "-col-fixed-left"] = column.fixed === "left", _a[prefixCls + "-col-fixed-right"] = column.fixed === "right", _a[prefixCls + "-col-fixed-left-last"] = column.fixed === "left" && (is.isObject(columns[index + 1]) ? columns[index + 1].fixed !== "left" : true), _a[prefixCls + "-col-fixed-right-first"] = column.fixed === "right" && (is.isObject(columns[index - 1]) ? columns[index - 1].fixed !== "right" : true), _a));
  }
  var stickyClassNames = React.useMemo(function() {
    return columns.map(function(column, index) {
      return getClassNameFromColumn(column, index);
    });
  }, [colFixed.join("-")]);
  var groupStickyClassNames = React.useMemo(function() {
    return groupColumns.map(function(gc) {
      return gc.map(function(column, index) {
        return getClassNameFromColumn(column, index);
      });
    });
  }, [groupColumns.map(function(c) {
    return "|" + c.map(function(a) {
      return a.fixed || "undefined";
    }).join("-") + "|";
  }).join("_")]);
  return [groupStickyClassNames, stickyClassNames];
}
module.exports = useStickyClassNames;
//# sourceMappingURL=useStickyClassNames.js.map
