import { jsx as f } from "@emotion/react/jsx-runtime";
import { useFormContext as S } from "react-hook-form";
import { useModuleDictionary as h } from "@m4l/core";
import { useComponentSize as x } from "../../../../hooks/useComponentSize/index.js";
import { classActionFormSubmitProgrammaticRoot as k } from "./constanst.js";
import { clsx as z } from "clsx";
import { DICTIONARY as A } from "../../dictionary.js";
import { ButtonActionFormSubmitProgrammaticRootStyled as C } from "./slots/ActionFormSubmitProgrammaticSlots.js";
function W(m) {
  const {
    onSubmit: i,
    variant: r = "contained",
    color: e = "primary",
    className: a,
    size: n = "medium",
    skeletonWidth: l,
    "aria-label": s,
    ...c
  } = m, { getLabel: u } = h(), { handleSubmit: p } = S(), { currentSize: o } = x(n), t = o === "small" || o === "medium" ? o : "medium", d = () => {
    p(i)();
  }, b = l || (t === "small" ? "80px" : "100px");
  return /* @__PURE__ */ f(
    C,
    {
      variant: r,
      type: "button",
      color: e,
      size: t,
      className: z(k, a),
      label: u(A.LABEL_INTRO),
      skeletonWidth: b,
      "aria-label": s,
      onClick: d,
      ...c
    }
  );
}
export {
  W as ActionFormSubmitProgrammatic
};
