import { jsxs as k, jsx as n } from "react/jsx-runtime";
import { Children as x, isValidElement as N } from "react";
import { AnimatePresence as R, motion as v } from "motion/react";
import A from "../../utils/classNames.js";
import w from "./RuleConnector.js";
const F = (a) => {
  const {
    show: l = !0,
    unchecked: r = !1,
    background: s = "bg-lightest",
    borderColor: d = "",
    hideConnector: c = !1,
    customConnector: o,
    className: m = "",
    children: u,
    ...p
  } = a;
  if (!l)
    return null;
  const y = A(
    "RuleContainerBox",
    "position-relative",
    "rounded padding-20",
    s,
    r && `border border-width border-style-dashed ${d}`,
    m
  ), t = x.toArray(u).filter(Boolean), h = t.length > 1 ? "sync" : "wait";
  return /* @__PURE__ */ k("div", { className: "RuleContainer", ...p, children: [
    /* @__PURE__ */ n("div", { className: y, "data-testid": "ruleContainerBox", children: /* @__PURE__ */ n(R, { mode: h, children: t.map((e, C) => {
      if (!e)
        return null;
      const i = e, f = N(e) && e.key != null ? String(e.key) : null, b = `${i.type?.name || i.type || "RuleContainerChild"}-${C}`, g = f || b;
      return /* @__PURE__ */ n(
        v.div,
        {
          initial: { opacity: 0 },
          animate: { opacity: 1 },
          exit: { opacity: 0 },
          children: e
        },
        g
      );
    }) }) }),
    o || /* @__PURE__ */ n(w, { hidden: r || c })
  ] });
};
export {
  F as default
};
//# sourceMappingURL=RuleContainer.js.map
