import { jsxs as D, jsx as s } from "react/jsx-runtime";
import { C as M } from "./CheckCircle-DSloUas8.js";
import { s as _, r as E, _ as i, t as J, v as $, P as r, J as f, l as z, u as k, b as B, c as L } from "./PrizeCard-C2El3VOB.js";
import * as U from "react";
import { s as y, r as V, t as q, v as G, u as K, a as v, c as Q, T as g } from "./Button-DPGn5NZd.js";
import { S as X } from "./Stack-CNhi3qAZ.js";
function Y(e) {
  return _("MuiAlert", e);
}
E("MuiAlert", ["root", "startDecorator", "endDecorator", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
const Z = ["children", "className", "color", "invertedColors", "role", "variant", "size", "startDecorator", "endDecorator", "component", "slots", "slotProps"], w = (e) => {
  const {
    variant: o,
    color: a,
    size: t
  } = e, n = {
    root: ["root", t && `size${f(t)}`, a && `color${f(a)}`, o && `variant${f(o)}`],
    startDecorator: ["startDecorator"],
    endDecorator: ["endDecorator"]
  };
  return Q(n, Y, {});
}, rr = y("div", {
  name: "JoyAlert",
  slot: "Root",
  overridesResolver: (e, o) => o.root
})(({
  theme: e,
  ownerState: o
}) => {
  var a;
  const {
    p: t,
    padding: n,
    borderRadius: l
  } = V({
    theme: e,
    ownerState: o
  }, ["p", "padding", "borderRadius"]);
  return [i({
    "--Alert-radius": e.vars.radius.sm,
    "--Alert-decoratorChildRadius": "max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))",
    "--Button-minHeight": "var(--Alert-decoratorChildHeight)",
    "--IconButton-size": "var(--Alert-decoratorChildHeight)",
    "--Button-radius": "var(--Alert-decoratorChildRadius)",
    "--IconButton-radius": "var(--Alert-decoratorChildRadius)",
    "--Icon-color": "currentColor"
  }, o.size === "sm" && {
    "--Alert-padding": "0.5rem",
    "--Alert-decoratorChildHeight": "1.5rem",
    "--Icon-fontSize": e.vars.fontSize.xl,
    gap: "0.5rem"
  }, o.size === "md" && {
    "--Alert-padding": "0.75rem",
    "--Alert-decoratorChildHeight": "2rem",
    "--Icon-fontSize": e.vars.fontSize.xl,
    gap: "0.625rem"
  }, o.size === "lg" && {
    "--Alert-padding": "1rem",
    "--Alert-decoratorChildHeight": "2.375rem",
    "--Icon-fontSize": e.vars.fontSize.xl2,
    gap: "0.875rem"
  }, {
    backgroundColor: e.vars.palette.background.surface,
    display: "flex",
    position: "relative",
    alignItems: "center",
    padding: "var(--Alert-padding)",
    borderRadius: "var(--Alert-radius)"
  }, e.typography[`body-${{
    sm: "xs",
    md: "sm",
    lg: "md"
  }[o.size]}`], {
    fontWeight: e.vars.fontWeight.md
  }, o.variant === "solid" && o.color && o.invertedColors && q(o.color)(e), o.variant === "soft" && o.color && o.invertedColors && G(o.color)(e), (a = e.variants[o.variant]) == null ? void 0 : a[o.color]), t !== void 0 && {
    "--Alert-padding": t
  }, n !== void 0 && {
    "--Alert-padding": n
  }, l !== void 0 && {
    "--Alert-radius": l
  }];
}), or = y("span", {
  name: "JoyAlert",
  slot: "StartDecorator",
  overridesResolver: (e, o) => o.startDecorator
})({
  display: "inherit",
  flex: "none"
}), er = y("span", {
  name: "JoyAlert",
  slot: "EndDecorator",
  overridesResolver: (e, o) => o.endDecorator
})({
  display: "inherit",
  flex: "none",
  marginLeft: "auto"
}), C = /* @__PURE__ */ U.forwardRef(function(o, a) {
  const t = K({
    props: o,
    name: "JoyAlert"
  }), {
    children: n,
    className: l,
    color: c = "neutral",
    invertedColors: d = !1,
    role: x = "alert",
    variant: b = "soft",
    size: T = "md",
    startDecorator: h,
    endDecorator: A,
    component: I,
    slots: S = {},
    slotProps: R = {}
  } = t, O = J(t, Z), p = i({}, t, {
    color: c,
    invertedColors: d,
    variant: b,
    size: T
  }), u = w(p), m = i({}, O, {
    component: I,
    slots: S,
    slotProps: R
  }), [P, W] = v("root", {
    ref: a,
    className: $(u.root, l),
    elementType: rr,
    externalForwardedProps: m,
    ownerState: p,
    additionalProps: {
      role: x
    }
  }), [N, j] = v("startDecorator", {
    className: u.startDecorator,
    elementType: or,
    externalForwardedProps: m,
    ownerState: p
  }), [F, H] = v("endDecorator", {
    className: u.endDecorator,
    elementType: er,
    externalForwardedProps: m,
    ownerState: p
  });
  return /* @__PURE__ */ D(P, i({}, W, {
    children: [h && /* @__PURE__ */ s(N, i({}, j, {
      children: h
    })), n, A && /* @__PURE__ */ s(F, i({}, H, {
      children: A
    }))]
  }));
});
process.env.NODE_ENV !== "production" && (C.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * @ignore
   */
  children: r.node,
  /**
   * @ignore
   */
  className: r.string,
  /**
   * The color of the component. It supports those theme colors that make sense for this component.
   * @default 'neutral'
   */
  color: r.oneOfType([r.oneOf(["danger", "neutral", "primary", "success", "warning"]), r.string]),
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: r.elementType,
  /**
   * Element placed after the children.
   */
  endDecorator: r.node,
  /**
   * If `true`, the children with an implicit color prop invert their colors to match the component's variant and color.
   * @default false
   */
  invertedColors: r.bool,
  /**
   * The ARIA role attribute of the element.
   * @default 'alert'
   */
  role: r.string,
  /**
   * The size of the component.
   * @default 'md'
   */
  size: r.oneOfType([r.oneOf(["sm", "md", "lg"]), r.string]),
  /**
   * The props used for each slot inside.
   * @default {}
   */
  slotProps: r.shape({
    endDecorator: r.oneOfType([r.func, r.object]),
    root: r.oneOfType([r.func, r.object]),
    startDecorator: r.oneOfType([r.func, r.object])
  }),
  /**
   * The components used for each slot inside.
   * @default {}
   */
  slots: r.shape({
    endDecorator: r.elementType,
    root: r.elementType,
    startDecorator: r.elementType
  }),
  /**
   * Element placed before the children.
   */
  startDecorator: r.node,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
  /**
   * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
   * @default 'soft'
   */
  variant: r.oneOfType([r.oneOf(["outlined", "plain", "soft", "solid"]), r.string])
});
const tr = z(/* @__PURE__ */ s("path", {
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"
}), "Info"), sr = z(/* @__PURE__ */ s("path", {
  d: "M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"
}), "Warning"), ar = (e, o) => {
  switch (e) {
    case "success":
      return /* @__PURE__ */ s(M, {});
    case "error":
      return /* @__PURE__ */ s(sr, { sx: { color: o } });
    case "info":
    case "neutral":
      return /* @__PURE__ */ s(tr, {});
  }
}, nr = (e) => {
  switch (e) {
    case "success":
      return "success";
    case "error":
      return "danger";
    case "info":
      return "primary";
    case "neutral":
      return "neutral";
  }
}, ur = ({
  variant: e,
  title: o,
  message: a,
  description: t
}) => {
  const n = k(), l = B(), c = L().secondary, d = nr(e);
  return /* @__PURE__ */ s(
    C,
    {
      variant: "soft",
      color: d,
      startDecorator: ar(
        e,
        n.colorSchemes.light.palette.danger.plainColor
      ),
      sx: {
        gap: 1,
        borderRadius: l.sm,
        fontSize: "0.875em",
        "--Icon-fontSize": "1.25em"
      },
      children: /* @__PURE__ */ D(
        X,
        {
          sx: {
            fontSize: "1.5em"
          },
          children: [
            o && /* @__PURE__ */ s(
              g,
              {
                level: "title-md",
                color: d,
                fontWeight: "bold",
                sx: { fontFamily: c, fontSize: "0.875em" },
                children: o
              }
            ),
            a && /* @__PURE__ */ s(
              g,
              {
                level: "body-sm",
                sx: { fontFamily: c, fontSize: "0.675em" },
                children: a
              }
            ),
            t && /* @__PURE__ */ s(
              g,
              {
                level: "body-xs",
                sx: { fontFamily: c, fontSize: "0.6em" },
                children: t
              }
            )
          ]
        }
      )
    }
  );
};
export {
  C as A,
  tr as I,
  sr as W,
  ur as a
};
