import { jsx, jsxs } from "react/jsx-runtime";
import "react";
import { cn } from "../../lib/utils.js";
import { menuItemVariants } from "../../lib/variants.js";
import Check from "../../node_modules/lucide-react/dist/esm/icons/check.js";
import ChevronRight from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
import { ContextMenuRoot } from "../../node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRoot.js";
import { ContextMenuTrigger as ContextMenuTrigger$1 } from "../../node_modules/@base-ui/react/esm/context-menu/trigger/ContextMenuTrigger.js";
import { MenuPortal } from "../../node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js";
import { MenuPositioner } from "../../node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js";
import { MenuPopup } from "../../node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js";
import { MenuItem } from "../../node_modules/@base-ui/react/esm/menu/item/MenuItem.js";
import { MenuCheckboxItem } from "../../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js";
import { MenuCheckboxItemIndicator } from "../../node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js";
import { MenuRadioItem } from "../../node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js";
import { MenuRadioItemIndicator } from "../../node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js";
import { MenuGroupLabel } from "../../node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js";
import { Separator } from "../../node_modules/@base-ui/react/esm/separator/Separator.js";
import { MenuGroup } from "../../node_modules/@base-ui/react/esm/menu/group/MenuGroup.js";
import { MenuSubmenuRoot } from "../../node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js";
import { MenuSubmenuTrigger } from "../../node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js";
import { MenuRadioGroup } from "../../node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js";
function ContextMenu({ ...props }) {
  return /* @__PURE__ */ jsx(ContextMenuRoot, { "data-slot": "context-menu", ...props });
}
function ContextMenuPortal({ ...props }) {
  return /* @__PURE__ */ jsx(MenuPortal, { "data-slot": "context-menu-portal", ...props });
}
function ContextMenuTrigger({ className, ...props }) {
  return /* @__PURE__ */ jsx(
    ContextMenuTrigger$1,
    {
      "data-slot": "context-menu-trigger",
      className: cn("select-none", className),
      ...props
    }
  );
}
function ContextMenuContent({
  className,
  align = "start",
  alignOffset = 4,
  side = "right",
  sideOffset = 0,
  ...props
}) {
  return /* @__PURE__ */ jsx(MenuPortal, { children: /* @__PURE__ */ jsx(
    MenuPositioner,
    {
      className: "isolate z-50 outline-none",
      align,
      alignOffset,
      side,
      sideOffset,
      children: /* @__PURE__ */ jsx(
        MenuPopup,
        {
          "data-slot": "context-menu-content",
          className: cn(
            "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none",
            className
          ),
          ...props
        }
      )
    }
  ) });
}
function ContextMenuGroup({ ...props }) {
  return /* @__PURE__ */ jsx(MenuGroup, { "data-slot": "context-menu-group", ...props });
}
function ContextMenuLabel({
  className,
  inset,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    MenuGroupLabel,
    {
      "data-slot": "context-menu-label",
      "data-inset": inset,
      className: cn(
        "text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8",
        className
      ),
      ...props
    }
  );
}
function ContextMenuItem({
  className,
  inset = false,
  variant = "default",
  ...props
}) {
  return /* @__PURE__ */ jsx(
    MenuItem,
    {
      "data-slot": "context-menu-item",
      className: cn(
        menuItemVariants({ variant, inset }),
        "group/context-menu-item",
        className
      ),
      ...props
    }
  );
}
function ContextMenuSub({ ...props }) {
  return /* @__PURE__ */ jsx(MenuSubmenuRoot, { "data-slot": "context-menu-sub", ...props });
}
function ContextMenuSubTrigger({
  className,
  inset,
  children,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    MenuSubmenuTrigger,
    {
      "data-slot": "context-menu-sub-trigger",
      "data-inset": inset,
      className: cn(
        "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        className
      ),
      ...props,
      children: [
        children,
        /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto" })
      ]
    }
  );
}
function ContextMenuSubContent({ ...props }) {
  return /* @__PURE__ */ jsx(
    ContextMenuContent,
    {
      "data-slot": "context-menu-sub-content",
      className: "shadow-lg",
      side: "right",
      ...props
    }
  );
}
function ContextMenuCheckboxItem({
  className,
  children,
  checked,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    MenuCheckboxItem,
    {
      "data-slot": "context-menu-checkbox-item",
      className: cn(
        "focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        className
      ),
      checked,
      ...props,
      children: [
        /* @__PURE__ */ jsx("span", { className: "absolute right-2 pointer-events-none", children: /* @__PURE__ */ jsx(MenuCheckboxItemIndicator, { children: /* @__PURE__ */ jsx(Check, {}) }) }),
        children
      ]
    }
  );
}
function ContextMenuRadioGroup({ ...props }) {
  return /* @__PURE__ */ jsx(
    MenuRadioGroup,
    {
      "data-slot": "context-menu-radio-group",
      ...props
    }
  );
}
function ContextMenuRadioItem({
  className,
  children,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    MenuRadioItem,
    {
      "data-slot": "context-menu-radio-item",
      className: cn(
        "focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        className
      ),
      ...props,
      children: [
        /* @__PURE__ */ jsx("span", { className: "absolute right-2 pointer-events-none", children: /* @__PURE__ */ jsx(MenuRadioItemIndicator, { children: /* @__PURE__ */ jsx(Check, {}) }) }),
        children
      ]
    }
  );
}
function ContextMenuSeparator({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    Separator,
    {
      "data-slot": "context-menu-separator",
      className: cn("bg-border -mx-1 my-1 h-px", className),
      ...props
    }
  );
}
function ContextMenuShortcut({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    "span",
    {
      "data-slot": "context-menu-shortcut",
      className: cn(
        "text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",
        className
      ),
      ...props
    }
  );
}
export {
  ContextMenu,
  ContextMenuCheckboxItem,
  ContextMenuContent,
  ContextMenuGroup,
  ContextMenuItem,
  ContextMenuLabel,
  ContextMenuPortal,
  ContextMenuRadioGroup,
  ContextMenuRadioItem,
  ContextMenuSeparator,
  ContextMenuShortcut,
  ContextMenuSub,
  ContextMenuSubContent,
  ContextMenuSubTrigger,
  ContextMenuTrigger
};
//# sourceMappingURL=context-menu.js.map
