import F from "./_Stack.js";
import S from "./_arrayEach.js";
import B from "./_assignValue.js";
import E from "./_baseAssign.js";
import I from "./_baseAssignIn.js";
import w from "./_cloneBuffer.js";
import M from "./_copyArray.js";
import O from "./_copySymbols.js";
import U from "./_copySymbolsIn.js";
import h from "./_getAllKeys.js";
import x from "./_getTag.js";
import L from "./_initCloneArray.js";
import D from "./_initCloneByTag.js";
import G from "./_initCloneObject.js";
import N from "./isArray.js";
import _ from "./isBuffer.js";
import K from "./isMap.js";
import R from "./isObject.js";
import W from "./isSet.js";
var l = 2, y = "[object Arguments]", q = "[object Array]", H = "[object Boolean]", J = "[object Date]", P = "[object Error]", s = "[object Function]", Q = "[object GeneratorFunction]", V = "[object Map]", X = "[object Number]", A = "[object Object]", Y = "[object RegExp]", Z = "[object Set]", $ = "[object String]", u = "[object Symbol]", z = "[object WeakMap]", k = "[object ArrayBuffer]", v = "[object DataView]", rr = "[object Float32Array]", or = "[object Float64Array]", tr = "[object Int8Array]", er = "[object Int16Array]", ir = "[object Int32Array]", nr = "[object Uint8Array]", ar = "[object Uint8ClampedArray]", fr = "[object Uint16Array]", mr = "[object Uint32Array]", o = {};
o[y] = o[q] = o[k] = o[v] = o[H] = o[J] = o[rr] = o[or] = o[tr] = o[er] = o[ir] = o[V] = o[X] = o[A] = o[Y] = o[Z] = o[$] = o[u] = o[nr] = o[ar] = o[fr] = o[mr] = !0;
o[P] = o[s] = o[z] = !1;
function c(r, f, m, cr, g, i) {
  var t, d = f & l;
  if (t !== void 0)
    return t;
  if (!R(r))
    return r;
  var b = N(r);
  if (b)
    return t = L(r), M(r, t);
  var a = x(r), p = a == s || a == Q;
  if (_(r))
    return w(r);
  if (a == A || a == y || p && !g)
    return t = p ? {} : G(r), d ? U(r, I(t, r)) : O(r, E(t, r));
  if (!o[a])
    return g ? r : {};
  t = D(r, a), i || (i = new F());
  var T = i.get(r);
  if (T)
    return T;
  i.set(r, t), W(r) ? r.forEach(function(e) {
    t.add(c(e, f, m, e, r, i));
  }) : K(r) && r.forEach(function(e, n) {
    t.set(n, c(e, f, m, n, r, i));
  });
  var C = h, j = b ? void 0 : C(r);
  return S(j || r, function(e, n) {
    j && (n = e, e = r[n]), B(t, n, c(e, f, m, n, r, i));
  }), t;
}
export {
  c as default
};
