import { jsxs as k, jsx as c } from "react/jsx-runtime";
import o from "prop-types";
import { Typography as N } from "@mui/material";
import { blueGrey as j } from "@mui/material/colors";
import n from "lodash/isUndefined";
import E from "../Icon/index.js";
import { mergeProps as O } from "../Util/index.js";
import t from "../Colors/themes/default.js";
import { styled as w } from "../Theme/index.js";
import { withDeprecated as $ } from "../Util/deprecate.js";
const i = {
  error: {
    icon: "exclamation-circle",
    color: t.error.main,
    borderColor: "#e35b54",
    backgroundColor: "rgba(227, 91, 84, 0.2)",
    variant: "solid"
  },
  warning: {
    icon: "exclamation-triangle",
    color: t.warning.main,
    borderColor: "#f7d040",
    backgroundColor: "rgba(247, 208, 64, 0.2)",
    variant: "solid"
  },
  success: {
    icon: "check-circle",
    color: t.success.main,
    borderColor: "#89ddd9",
    backgroundColor: "rgba(137, 221, 217, 0.2)"
  },
  tip: {
    icon: "info-circle",
    color: t.grey[500],
    borderColor: "#222222",
    backgroundColor: "#EEEEEE",
    variant: "solid"
  }
};
function a({ ...l }) {
  const r = Object.assign({}, l);
  n(r.type) && (r.type = "tip"), n(r.className) && (r.className = ""), n(r.style) && (r.style = {}), n(r.variant) && (r.variant = "border");
  const m = O(r, a, ["style"]), { type: s, children: p, style: d, className: f, variant: e, showIcon: g = !1, ...b } = m, { icon: y, color: u, backgroundColor: x, borderColor: v, variant: C } = i[s] || i.success, h = Object.assign(
    {
      color: j[500],
      backgroundColor: e === "border" ? x : "transparent",
      borderLeft: e === "border" ? `5px solid ${v}` : "none"
    },
    d
  );
  return /* @__PURE__ */ k(A, { ...b, className: `alert alert--${s} alert--${e} ${f}`.trim(), style: h, children: [
    (e === "icon" || g) && /* @__PURE__ */ c(E, { className: "alert-icon", name: y, size: 24, color: u, variant: C }),
    /* @__PURE__ */ c(N, { component: "div", className: "alert-content", children: p })
  ] });
}
a.propTypes = {
  type: o.oneOf(Object.keys(i)),
  children: o.any.isRequired,
  className: o.string,
  style: o.oneOfType([o.object, o.string]),
  variant: o.oneOf(["border", "icon"])
};
const V = $(a, { name: "Alert", alternative: "@mui/material/Alert" }), A = w("div")`
  display: flex;
  align-items: center;
  font-size: 16px;
  margin: 0;
  padding: 16px;
  margin: 16px 0;

  strong {
    margin: 0 5px;
  }

  .alert-icon {
    margin-right: 16px;
  }

  .alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
`;
export {
  V as default
};
