import { jsxs as k, jsx as s } from "react/jsx-runtime";
import { createRef as d } from "react";
import { SnackbarProvider as g, useSnackbar as b } from "notistack";
import { IconButton as h } from "@mui/material";
import { Close as S } from "@mui/icons-material";
import e from "lodash/noop";
let a = e, l = e, u = e, f = e, m = e;
const t = (o, r) => (i, n = {}) => o(i, {
  autoHideDuration: 5e3,
  variant: r,
  ...n
});
function j({ children: o, anchorOrigin: r, ...i }) {
  const n = d(), p = (c) => () => {
    n.current?.closeSnackbar(c);
  };
  return /* @__PURE__ */ k(
    g,
    {
      anchorOrigin: {
        vertical: "top",
        horizontal: "right",
        ...r
      },
      ...i,
      ref: n,
      action: (c) => /* @__PURE__ */ s(h, { "aria-label": "close", color: "inherit", onClick: p(c), size: "large", children: /* @__PURE__ */ s(S, { style: { fontSize: 16 } }) }, "close"),
      children: [
        /* @__PURE__ */ s(v, {}),
        o
      ]
    }
  );
}
function v() {
  const { enqueueSnackbar: o, closeSnackbar: r } = b();
  return a = t(o, "success"), l = t(o, "error"), u = t(o, "warning"), f = t(o, "info"), m = r, null;
}
const H = {
  success: (o, r = {}) => a(o, r),
  error: (o, r = { autoHideDuration: 15e3 }) => l(o, r),
  warning: (o, r = {}) => u(o, r),
  info: (o, r = {}) => f(o, r),
  close: (o) => m(o)
};
export {
  j as ToastProvider,
  H as default
};
