import { __exports as c } from "../../../../../../_virtual/clean.js";
import { __require as m } from "../../../../lodash@4.17.21/node_modules/lodash/lodash.js";
import { __require as k } from "./utils.js";
var a;
function v() {
  if (a) return c;
  a = 1, Object.defineProperty(c, "__esModule", { value: !0 }), c.clean = c.cleanBy = void 0;
  const l = m(), d = k(), u = (e, n, i, f) => {
    if (!n.has(e)) {
      if ((0, l.isPlainObject)(e)) {
        n.add(e);
        for (const r in e) {
          const _ = !i && (0, d.isEmptyLike)(e[r]);
          if (f === r || _) {
            delete e[r];
            continue;
          }
          u(e[r], n, i, f);
        }
      } else if ((0, l.isArray)(e)) {
        n.add(e);
        for (const r of e)
          u(r, n, i, f);
      } else
        return;
      if (!i && (0, l.isPlainObject)(e))
        for (const r in e)
          (0, d.isEmptyLike)(e[r]) && delete e[r];
    }
  };
  function s(e, n, i) {
    (0, l.isArray)(n) || (n = [n]), i != null && i.clone && (e = (0, l.cloneDeep)(e));
    const f = !!(i != null && i.skipEmpty);
    for (const r of n)
      u(e, /* @__PURE__ */ new WeakSet(), f, r);
    return e;
  }
  c.cleanBy = s;
  function y(e, n) {
    n != null && n.clone && (e = (0, l.cloneDeep)(e));
    const i = !!(n != null && n.skipEmpty);
    return u(e, /* @__PURE__ */ new WeakSet(), i), e;
  }
  return c.clean = y, c;
}
export {
  v as __require
};
//# sourceMappingURL=clean.js.map
