"use client";
import { jsx as o, jsxs as l } from "react/jsx-runtime";
import { XIcon as s } from "lucide-react";
import { Button as d } from "./button.js";
import { cn as e } from "../../../lib/utils.js";
import { D as g } from "../../../DialogRoot-DPdhw92q.js";
import { D as n, a as u, b as c, c as m, d as f, e as p, f as D } from "../../../DialogTrigger-C5WbKc3Z.js";
function $({ ...a }) {
  return /* @__PURE__ */ o(g, { "data-slot": "dialog", ...a });
}
function k({ ...a }) {
  return /* @__PURE__ */ o(D, { "data-slot": "dialog-trigger", ...a });
}
function x({ ...a }) {
  return /* @__PURE__ */ o(f, { "data-slot": "dialog-portal", ...a });
}
function w({ ...a }) {
  return /* @__PURE__ */ o(n, { "data-slot": "dialog-close", ...a });
}
function b({
  className: a,
  ...t
}) {
  return /* @__PURE__ */ o(
    m,
    {
      className: e(
        "data-open:fade-in-0 data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 data-closed:animate-out data-open:animate-in supports-backdrop-filter:backdrop-blur-xs",
        a
      ),
      "data-slot": "dialog-overlay",
      ...t
    }
  );
}
function T({
  className: a,
  children: t,
  showCloseButton: r = !0,
  ...i
}) {
  return /* @__PURE__ */ l(x, { children: [
    /* @__PURE__ */ o(b, {}),
    /* @__PURE__ */ l(
      u,
      {
        className: e(
          "data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg bg-popover p-4 text-popover-foreground text-sm outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in sm:max-w-md",
          a
        ),
        "data-slot": "dialog-content",
        ...i,
        children: [
          t,
          r && /* @__PURE__ */ l(
            n,
            {
              "data-slot": "dialog-close",
              render: /* @__PURE__ */ o(
                d,
                {
                  className: "absolute top-2 right-2",
                  size: "icon-sm",
                  variant: "ghost"
                }
              ),
              children: [
                /* @__PURE__ */ o(s, {}),
                /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
              ]
            }
          )
        ]
      }
    )
  ] });
}
function j({ className: a, ...t }) {
  return /* @__PURE__ */ o(
    "div",
    {
      className: e("flex flex-col gap-2", a),
      "data-slot": "dialog-header",
      ...t
    }
  );
}
function P({
  className: a,
  showCloseButton: t = !1,
  children: r,
  ...i
}) {
  return /* @__PURE__ */ l(
    "div",
    {
      className: e(
        "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-lg border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
        a
      ),
      "data-slot": "dialog-footer",
      ...i,
      children: [
        r,
        t && /* @__PURE__ */ o(n, { render: /* @__PURE__ */ o(d, { variant: "outline" }), children: "Close" })
      ]
    }
  );
}
function B({ className: a, ...t }) {
  return /* @__PURE__ */ o(
    p,
    {
      className: e("font-medium text-base leading-none", a),
      "data-slot": "dialog-title",
      ...t
    }
  );
}
function F({
  className: a,
  ...t
}) {
  return /* @__PURE__ */ o(
    c,
    {
      className: e(
        "text-muted-foreground text-sm *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
        a
      ),
      "data-slot": "dialog-description",
      ...t
    }
  );
}
export {
  $ as Dialog,
  w as DialogClose,
  T as DialogContent,
  F as DialogDescription,
  P as DialogFooter,
  j as DialogHeader,
  b as DialogOverlay,
  x as DialogPortal,
  B as DialogTitle,
  k as DialogTrigger
};
