"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var filter_excessive_toolbar_separators_exports = {};
__export(filter_excessive_toolbar_separators_exports, {
  filterExcessiveToolbarSeparators: () => filterExcessiveToolbarSeparators
});
module.exports = __toCommonJS(filter_excessive_toolbar_separators_exports);
const filterExcessiveToolbarSeparators = (itemsConfig) => {
  const firstSeparatorIndex = itemsConfig.findIndex((item) => item.getId() !== "separator");
  const startIndex = firstSeparatorIndex === -1 ? 0 : firstSeparatorIndex;
  const endIndex = itemsConfig.slice(startIndex).reverse().findIndex((item) => item.getId() !== "separator");
  const trimmedItems = itemsConfig.slice(startIndex, itemsConfig.length - endIndex);
  return trimmedItems.filter((config, index, allConfigs) => {
    return config.getId() !== "separator" || index !== 0 && allConfigs[index - 1]?.getId() !== "separator";
  });
};
//# sourceMappingURL=filter-excessive-toolbar-separators.js.map
