import { jsx as t, jsxs as n } from "react/jsx-runtime";
import { c as d } from "../../../index-UgeK3A8s.js";
import { Card as m, CardContent as c, CardHeader as x } from "../atoms/card.js";
import { JsonHighlight as f } from "../atoms/json-highlight.js";
import { cn as o } from "../../../lib/utils.js";
const h = d("my-2 gap-0 py-0", {
  variants: {
    status: {
      loading: "",
      pending: "",
      completed: "border-green-100 dark:border-green-950",
      failed: "border-red-100 dark:border-red-950"
    }
  },
  defaultVariants: { status: "loading" }
}), p = d("shrink-0 rounded-full p-2", {
  variants: {
    status: {
      loading: "bg-muted",
      pending: "bg-orange-50 dark:bg-orange-950/50",
      completed: "bg-green-50 dark:bg-green-950/50",
      failed: "bg-red-50 dark:bg-red-950/50"
    }
  },
  defaultVariants: { status: "loading" }
}), b = d("size-5", {
  variants: {
    status: {
      loading: "text-muted-foreground",
      pending: "text-orange-500 dark:text-orange-400",
      completed: "text-green-500 dark:text-green-400",
      failed: "text-red-500 dark:text-red-400"
    }
  },
  defaultVariants: { status: "loading" }
}), k = d(
  "flex items-center gap-2 rounded-md p-3 text-xs",
  {
    variants: {
      status: {
        loading: "bg-muted text-muted-foreground",
        pending: "bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300",
        completed: "bg-green-50 text-green-700 dark:bg-green-950/50 dark:text-green-300",
        failed: "bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300"
      }
    },
    defaultVariants: { status: "loading" }
  }
);
function C({
  className: e,
  status: a,
  ...r
}) {
  return /* @__PURE__ */ t(
    m,
    {
      className: o(h({ status: a }), e),
      "data-slot": "tool-authorization",
      ...r
    }
  );
}
function T({
  className: e,
  status: a,
  icon: r,
  toolkitIcon: l,
  title: s,
  description: i,
  children: g,
  ...u
}) {
  return /* @__PURE__ */ t(x, { className: "px-3 pt-3 pb-0", children: /* @__PURE__ */ n(
    "div",
    {
      className: o("flex items-start gap-3 sm:items-center", e),
      "data-slot": "tool-authorization-header",
      ...u,
      children: [
        r && /* @__PURE__ */ t("div", { className: o(p({ status: a })), children: /* @__PURE__ */ t(
          r,
          {
            className: o(b({ status: a }))
          }
        ) }),
        (s || i) && /* @__PURE__ */ n("div", { children: [
          s && /* @__PURE__ */ n("h3", { className: "flex items-center gap-1.5 font-medium text-card-foreground text-sm", children: [
            l && /* @__PURE__ */ t(l, { className: "size-4 shrink-0" }),
            s
          ] }),
          i && /* @__PURE__ */ t("p", { className: "mt-0.5 text-muted-foreground text-xs", children: i })
        ] }),
        g
      ]
    }
  ) });
}
function y({
  className: e,
  ...a
}) {
  return /* @__PURE__ */ t(c, { className: "p-3 pt-2", children: /* @__PURE__ */ t(
    "div",
    {
      className: o("flex flex-col gap-2", e),
      "data-slot": "tool-authorization-content",
      ...a
    }
  ) });
}
function j({
  className: e,
  status: a,
  ...r
}) {
  return /* @__PURE__ */ t(
    "div",
    {
      className: o(
        k({ status: a }),
        "items-start sm:items-center",
        e
      ),
      "data-slot": "tool-authorization-message",
      ...r
    }
  );
}
function H({
  args: e,
  className: a,
  ...r
}) {
  return Object.keys(e).length === 0 ? null : /* @__PURE__ */ n(
    "div",
    {
      className: o("w-full rounded-lg bg-muted p-2 sm:p-2.5", a),
      "data-slot": "tool-authorization-args",
      ...r,
      children: [
        /* @__PURE__ */ t("h4", { className: "mb-1 font-medium text-xs", children: "Tool Arguments:" }),
        /* @__PURE__ */ t(
          f,
          {
            className: "text-[11px] sm:text-xs",
            code: JSON.stringify(e, null, 2)
          }
        )
      ]
    }
  );
}
export {
  C as ToolAuthorization,
  H as ToolAuthorizationArgs,
  y as ToolAuthorizationContent,
  T as ToolAuthorizationHeader,
  j as ToolAuthorizationMessage
};
