import { compareByDepth as t } from "./compare-by-depth.es.js";
import { addUniqueItem as r, removeItem as e } from "../../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/array.es.js";
class c {
  constructor() {
    this.children = [], this.isDirty = !1;
  }
  add(i) {
    r(this.children, i), this.isDirty = !0;
  }
  remove(i) {
    e(this.children, i), this.isDirty = !0;
  }
  forEach(i) {
    this.isDirty && this.children.sort(t), this.isDirty = !1, this.children.forEach(i);
  }
}
export {
  c as FlatTree
};
//# sourceMappingURL=flat-tree.es.js.map
