"use strict";

exports.__esModule = true;
exports.useFiltersLayout = useFiltersLayout;
var _react = require("react");
function useFiltersLayout({
  totalFilters = 0,
  filters = 0,
  inline,
  maxInlineFilters = 3,
  maxInlineLabels = 2,
  customInlineElements = 0,
  useNewFilters,
  forceShowSidePanel = false
}) {
  return (0, _react.useMemo)(() => {
    const totalInline = inline != null ? inline : totalFilters <= maxInlineFilters ? totalFilters : 0;
    let showFiltersPanelButton = forceShowSidePanel || totalFilters - totalInline > 0;
    let totalInlineFilters = forceShowSidePanel ? 0 : Math.max(totalInline - customInlineElements, 0);
    const totalInlineButtons = totalInline + (showFiltersPanelButton ? 1 : 0);
    const showLabels = totalInlineButtons <= maxInlineLabels;
    if (useNewFilters) {
      showFiltersPanelButton = forceShowSidePanel || customInlineElements > 0 || filters > 2;
      totalInlineFilters = showFiltersPanelButton ? 0 : totalInlineFilters;
    }
    return {
      showFiltersPanelButton,
      showLabels,
      totalInlineFilters
    };
  }, [totalFilters, inline, maxInlineFilters, maxInlineLabels, filters, useNewFilters]);
}
//# sourceMappingURL=useFiltersLayout.js.map