import { isNumber as s, isArray as u } from "lodash-unified";
function m(...n) {
  return n.reduce((r, e) => ({ ...r, ...e }), {});
}
function l(n, r = 0) {
  if (!n)
    return r;
  if (typeof n == "number")
    return n;
  const e = n.match(/^(-?\d+(?:\.\d+)?)px$/);
  if (!e)
    return r;
  const t = parseFloat(e[1]);
  return t > 0 ? t : r;
}
function d(n) {
  return s(n) ? String(n) : n;
}
let g = 0;
function w(n) {
  return `_${u(n) ? n.join("_") : String(n)}_${g++}`;
}
async function x(n, r, ...e) {
  for (const t of n) {
    const o = r(t);
    o && await o(...e);
  }
}
async function y(n, r, e, ...t) {
  let o = r;
  for (const i of n) {
    const c = e(i);
    if (c)
      try {
        const f = await c(o, ...t);
        f !== void 0 && (o = f);
      } catch {
      }
  }
  return o;
}
function a(n, r, e) {
  let t = {};
  if (!n.length)
    return t;
  for (const o of n)
    if (o.children?.length)
      t = {
        ...t,
        ...a(o.children, r)
      };
    else {
      const i = o.key;
      i && (t[i] = o[r] ?? e);
    }
  return t;
}
const p = {
  rowDragEntireRow: !1,
  suppressMoveWhenRowDragging: !1
};
function N(n) {
  return n ? {
    ...p,
    ...n
  } : {};
}
export {
  N as getRowDragConfig,
  w as getShadowName,
  d as getStringKey,
  m as mergeProps,
  a as pickColumnConfig,
  l as pxToNumber,
  x as runEffectHooks,
  y as runPipelineHooks
};
