import { TAB_MAX_WIDTH as m, TAB_MAX_HEIGHT as f } from "../../constants.js";
import { getClusterTabs as i } from "../getClusterTabs/getClusterTabs.js";
const A = (n, a, o, l) => {
  const s = n.length;
  if (s === 0)
    return [];
  const r = l === "horizontal", e = r ? a.width : a.height, t = Math.floor(e / (r ? m : f));
  if (t >= s)
    return n;
  if (t <= 0 || t === 1)
    return [i(n, o)];
  const T = n.slice(0, t - 1), c = n.slice(t - 1), b = i(c, o);
  return [...T, b];
};
export {
  A as getFinalTabs
};
