import { jsx } from "react/jsx-runtime";
import "react";
import { t as toast } from "../../toast-Ba42YgO0.js";
import { ToastContentInternal } from "./toast-provider.js";
const showToast = (message, options) => {
  const {
    dismissible = false,
    duration,
    icon,
    description,
    variant = "default",
    actionButton,
    cancelButton,
    ...rest
  } = options || {};
  const finalDuration = dismissible ? duration : duration !== void 0 ? duration : 4e3;
  const toastId = toast.custom(
    (t) => /* @__PURE__ */ jsx(
      ToastContentInternal,
      {
        title: message,
        description,
        icon,
        variant,
        actionButton,
        cancelButton,
        showDismiss: dismissible,
        toastId: t
      }
    ),
    {
      ...rest,
      duration: finalDuration,
      classNames: {
        toast: `!p-0 !bg-transparent !border-0 !shadow-none ${variant === "destructive" ? "[&_[data-slot=alert]]:text-destructive" : ""}`,
        content: "w-full"
      },
      unstyled: true
    }
  );
  return toastId;
};
const dismissToast = (toastId) => {
  toast.dismiss(toastId);
};
const dismissAllToasts = () => {
  toast.dismiss();
};
export {
  dismissAllToasts,
  dismissToast,
  showToast
};
