import { jsx as a, jsxs as S } from "@emotion/react/jsx-runtime";
import o, { useState as c, useEffect as d, useMemo as u } from "react";
import { useIsLastVisibleValidStep as b } from "../../../../hooks/useIsLastVisibleValidStep/index.js";
import { StepperFooterRightActionsStyled as h } from "../../../../slots/StepperSlot.js";
import { StepperSubmitButton as s } from "../../../StepperButtons/StepperSubmitButton/index.js";
import { StepperNextButton as y } from "../../../StepperButtons/StepperNextButton/index.js";
function R(m) {
  const { children: r } = m, t = b(), [i, p] = c(!1);
  d(() => {
    const e = o.Children.toArray(r).some((n) => o.isValidElement(n) ? n.type === s : !1);
    p(e);
  }, [r]);
  const f = u(() => o.Children.toArray(r).filter((e) => !(o.isValidElement(e) && (!t && e.type === s || t && e.type === y))), [r, t]), l = u(() => t && !i ? /* @__PURE__ */ a(s, {}) : null, [t, i]);
  return /* @__PURE__ */ S(h, { children: [
    f,
    l
  ] });
}
export {
  R as StepperFooterRightActions
};
