import { j as t } from "../../../_virtual/jsx-runtime.js";
import { ToastCompactWrapper as c, CompactWrapper as l, MessageWrapper as m, CompactActionWrapper as x } from "./styles.js";
import { getId as s } from "../../../utils/index.js";
import { Button as j } from "../../Button/index.js";
import { getAriaRole as f } from "./utils.js";
import u from "./ToastIcon.js";
function W({
  className: d,
  message: i,
  variant: a = "neutral",
  icon: o,
  primaryAction: r,
  ...e
}) {
  const p = s(e["data-testid"]), n = s(e["data-trackid"]);
  return /* @__PURE__ */ t.jsx(
    c,
    {
      className: d,
      variant: a,
      "data-testid": p("wrapper"),
      "data-trackid": n("wrapper"),
      "aria-label": e["aria-label"],
      role: f(a),
      children: /* @__PURE__ */ t.jsxs(l, { children: [
        a === "neutral" && o ? o : /* @__PURE__ */ t.jsx(u, { variant: a }),
        /* @__PURE__ */ t.jsx(m, { children: i }),
        r && /* @__PURE__ */ t.jsx(x, { children: /* @__PURE__ */ t.jsx(
          j,
          {
            size: "xSmall",
            variant: "inverse-ghost",
            onClick: r.onClick,
            "data-testid": p("action-button"),
            children: r.text
          }
        ) })
      ] })
    }
  );
}
export {
  W as ToastCompact
};
