import { jsxs as o, jsx as t } from "react/jsx-runtime";
import a from "@mui/material/Box";
import i from "@mui/material/Typography";
import d from "@mui/icons-material/ErrorOutline";
import { B as f } from "./Button-lr02bh_m.js";
import { C as p } from "./CopyButton-DPBgL0K8.js";
const g = {
  xs: 2,
  sm: 3,
  md: 4,
  lg: 6,
  xl: 8
};
function v({
  icon: l,
  title: s,
  description: r,
  primaryAction: c,
  secondaryAction: m,
  size: e = "md",
  sx: n
}) {
  const x = e === "xs" || e === "sm" ? 32 : e === "md" ? 40 : 48;
  return /* @__PURE__ */ o(
    a,
    {
      sx: {
        display: "flex",
        flexDirection: "column",
        alignItems: "center",
        justifyContent: "center",
        textAlign: "center",
        py: g[e],
        px: 2,
        ...typeof n == "object" && !Array.isArray(n) ? n : {}
      },
      children: [
        l && /* @__PURE__ */ t(
          a,
          {
            sx: {
              mb: 2,
              color: "var(--ov-fg-faint)",
              fontSize: x,
              display: "flex"
            },
            children: l
          }
        ),
        /* @__PURE__ */ t(
          i,
          {
            variant: e === "xs" || e === "sm" ? "subtitle2" : "h6",
            sx: { color: "var(--ov-fg-default)", fontWeight: 600, mb: r ? 0.5 : 0 },
            children: s
          }
        ),
        r && /* @__PURE__ */ t(
          i,
          {
            variant: "body2",
            sx: {
              color: "var(--ov-fg-muted)",
              maxWidth: 400,
              lineHeight: 1.5
            },
            children: r
          }
        ),
        (c || m) && /* @__PURE__ */ o(a, { sx: { display: "flex", gap: 1, mt: 2.5 }, children: [
          c,
          m
        ] })
      ]
    }
  );
}
v.displayName = "EmptyState";
function h({
  message: l,
  errorId: s,
  onRetry: r,
  variant: c = "panel"
}) {
  const m = c === "inline", e = c === "page", n = e ? 56 : m ? 20 : 40;
  return m ? /* @__PURE__ */ o(
    a,
    {
      sx: {
        display: "inline-flex",
        alignItems: "center",
        gap: 1,
        color: "var(--ov-danger-default)"
      },
      children: [
        /* @__PURE__ */ t(d, { sx: { fontSize: n } }),
        /* @__PURE__ */ t(i, { variant: "body2", sx: { color: "var(--ov-danger-default)" }, children: l }),
        r && /* @__PURE__ */ t(f, { size: "xs", emphasis: "ghost", color: "danger", onClick: r, children: "Retry" })
      ]
    }
  ) : /* @__PURE__ */ o(
    a,
    {
      sx: {
        display: "flex",
        flexDirection: "column",
        alignItems: "center",
        justifyContent: "center",
        textAlign: "center",
        py: e ? 8 : 4,
        px: 2,
        ...e && { minHeight: "60vh" }
      },
      children: [
        /* @__PURE__ */ t(
          d,
          {
            sx: {
              fontSize: n,
              color: "var(--ov-danger-default)",
              mb: 2
            }
          }
        ),
        /* @__PURE__ */ t(
          i,
          {
            variant: e ? "h5" : "subtitle1",
            sx: { color: "var(--ov-fg-default)", fontWeight: 600, mb: 0.5 },
            children: "Something went wrong"
          }
        ),
        /* @__PURE__ */ t(
          i,
          {
            variant: "body2",
            sx: {
              color: "var(--ov-fg-muted)",
              maxWidth: 420,
              lineHeight: 1.5,
              mb: 1
            },
            children: l
          }
        ),
        s && /* @__PURE__ */ o(
          a,
          {
            sx: {
              display: "inline-flex",
              alignItems: "center",
              gap: 0.5,
              mb: 2,
              px: 1.5,
              py: 0.5,
              borderRadius: "4px",
              bgcolor: "var(--ov-bg-surface-inset)"
            },
            children: [
              /* @__PURE__ */ o(
                i,
                {
                  variant: "caption",
                  sx: {
                    fontFamily: "var(--ov-font-mono)",
                    color: "var(--ov-fg-muted)",
                    fontSize: "var(--ov-text-xs)"
                  },
                  children: [
                    "Error ID: ",
                    s
                  ]
                }
              ),
              /* @__PURE__ */ t(p, { value: s, size: "xs" })
            ]
          }
        ),
        r && /* @__PURE__ */ t(f, { emphasis: "outline", color: "primary", size: "sm", onClick: r, children: "Try again" })
      ]
    }
  );
}
h.displayName = "ErrorState";
export {
  v as E,
  h as a
};
