"use client";
import { jsx as o, jsxs as u, Fragment as F } from "react/jsx-runtime";
import * as s from "react";
import { c as i } from "./cn-Bhsu1vx2.js";
import { u as K } from "./link-provider-DPBGo-0n.js";
import { C as U } from "./checkbox-CfFoTNFI.js";
import { CheckIcon as b, CaretRightIcon as W } from "@phosphor-icons/react";
import { aw as B, ax as H, ay as J, az as q, aA as w, S as N, aB as M, aC as Q, aD as X, aE as k, aF as Y, aG as y, aH as Z, aI as $, aJ as R, aK as ee } from "./vendor-base-ui-Bsg5ebHI.js";
const te = {
  variant: {
    default: {
      classes: "",
      description: "Default dropdown item appearance"
    },
    danger: {
      classes: "text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger",
      description: "Destructive action item"
    }
  }
}, ae = {
  variant: "default"
};
function D({
  variant: e = ae.variant
} = {}) {
  return i(te.variant[e].classes);
}
const I = s.forwardRef(({ className: e, inset: a, children: t, icon: n, ...r }, d) => /* @__PURE__ */ u(
  R,
  {
    ref: d,
    className: i(
      "flex cursor-default items-center rounded-sm text-base outline-hidden select-none",
      // base styles
      "px-2 py-1.5",
      // spacing
      "focus:bg-kumo-tint",
      // focus state
      "data-[state=open]:bg-kumo-tint",
      // open state
      a && "pl-8",
      // conditional inset
      e
    ),
    ...r,
    children: [
      n && /* @__PURE__ */ o(n, { className: "mr-2 h-4 w-4" }),
      t,
      /* @__PURE__ */ o(W, { className: "ml-auto h-4 w-4" })
    ]
  }
));
I.displayName = R.displayName;
const x = s.forwardRef(({ className: e, sideOffset: a = 8, children: t, ...n }, r) => /* @__PURE__ */ o(w, { children: /* @__PURE__ */ o(
  Z,
  {
    ref: r,
    sideOffset: a,
    ...n,
    children: /* @__PURE__ */ o(
      $,
      {
        className: i(
          "overflow-hidden bg-kumo-control text-kumo-default",
          // background
          "rounded-lg shadow-lg ring ring-kumo-line",
          // border part
          "min-w-36 p-1.5",
          // spacing
          "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
          // open animation
          "data-[side=bottom]:slide-in-from-top-2",
          // bottom side animation
          "data-[side=left]:slide-in-from-right-2",
          // left side animation
          "data-[side=right]:slide-in-from-left-2",
          // right side animation
          "data-[side=top]:slide-in-from-bottom-2",
          // top side animation
          "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
          // close animation
          e
        ),
        children: t
      }
    )
  }
) })), f = (e) => e ? s.isValidElement(e) ? e : /* @__PURE__ */ o(e, { className: "mr-2 h-4 w-4" }) : null, v = s.forwardRef(
  ({
    className: e,
    inset: a,
    icon: t,
    children: n,
    selected: r,
    render: d,
    href: l,
    variant: c = "default",
    ...G
  }, _) => {
    const g = K(), m = s.useMemo(
      () => /* @__PURE__ */ u(F, { children: [
        t && f(t),
        n,
        r && /* @__PURE__ */ o("span", { className: "inline-flex", children: /* @__PURE__ */ o(b, {}) })
      ] }),
      [t, n, r]
    ), V = s.useMemo(() => {
      if (!l) return;
      const z = /^(https?:)?\/\//.test(l), h = i(
        "flex items-center",
        c === "danger" && "text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger"
      );
      return z ? /* @__PURE__ */ o(
        "a",
        {
          className: i(h, "w-full text-inherit! no-underline!"),
          href: l,
          target: "_blank",
          rel: "noreferrer",
          onClick: (p) => p.stopPropagation(),
          children: m
        }
      ) : /* @__PURE__ */ o(
        g,
        {
          className: i(h, "w-full text-inherit! no-underline!"),
          href: l,
          to: l,
          onClick: (p) => p.stopPropagation(),
          children: m
        }
      );
    }, [l, m, c, g]), j = l || d;
    return /* @__PURE__ */ o(
      y,
      {
        ref: _,
        className: i(
          "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay",
          a && "pl-8",
          D({ variant: c }),
          e
        ),
        render: l ? V : d,
        ...G,
        children: j ? void 0 : m
      }
    );
  }
);
v.displayName = y.displayName;
const S = s.forwardRef(
  ({
    className: e,
    inset: a,
    icon: t,
    children: n,
    variant: r = "default",
    ...d
  }, l) => /* @__PURE__ */ u(
    Y,
    {
      ref: l,
      className: i(
        "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none",
        "focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay",
        "text-inherit no-underline",
        a && "pl-8",
        D({ variant: r }),
        e
      ),
      ...d,
      children: [
        t && f(t),
        n
      ]
    }
  )
);
S.displayName = "DropdownMenuLinkItem";
const C = s.forwardRef(({ className: e, children: a, checked: t, ...n }, r) => /* @__PURE__ */ u(
  k,
  {
    ref: r,
    className: i(
      "relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden transition-colors select-none focus:bg-kumo-tint focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50",
      e
    ),
    checked: t,
    ...n,
    children: [
      /* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center text-inherit", children: /* @__PURE__ */ o(U, { checked: t }) }),
      a
    ]
  }
));
C.displayName = k.displayName;
const L = s.forwardRef(({ className: e, inset: a, ...t }, n) => /* @__PURE__ */ o(
  M,
  {
    ref: n,
    className: i(
      "px-2 py-1.5 text-base font-semibold",
      a && "pl-8",
      e
    ),
    ...t
  }
));
L.displayName = M.displayName;
const T = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
  N,
  {
    ref: t,
    className: i("-mx-1 my-1 h-px bg-kumo-line", e),
    ...a
  }
));
T.displayName = N.displayName;
const P = ({
  className: e,
  ...a
}) => /* @__PURE__ */ o(
  "span",
  {
    className: i("ml-auto text-xs tracking-widest opacity-60", e),
    ...a
  }
);
P.displayName = "DropdownMenuShortcut";
const O = s.forwardRef(({ className: e, children: a, inset: t, icon: n, ...r }, d) => /* @__PURE__ */ u(
  X,
  {
    ref: d,
    className: i(
      "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none",
      "data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-tint",
      t && "pl-8",
      e
    ),
    ...r,
    children: [
      n && f(n),
      a
    ]
  }
));
O.displayName = "DropdownMenuRadioItem";
const A = s.forwardRef(({ className: e, children: a, ...t }, n) => /* @__PURE__ */ o(
  Q,
  {
    ref: n,
    className: i("ml-auto", e),
    ...t,
    children: a ?? /* @__PURE__ */ o(b, { className: "h-4 w-4" })
  }
));
A.displayName = "DropdownMenuRadioItemIndicator";
const E = s.forwardRef(({ children: e, render: a, ...t }, n) => {
  const r = s.isValidElement(e) ? e : null, d = a ?? r;
  return /* @__PURE__ */ o(
    ee,
    {
      ref: n,
      ...t,
      ...d && {
        render: d
      },
      children: r ? void 0 : e
    }
  );
});
E.displayName = "DropdownMenuTrigger";
const le = Object.assign(B, {
  Trigger: E,
  Portal: w,
  Sub: q,
  SubTrigger: I,
  SubContent: x,
  Content: x,
  Item: v,
  LinkItem: S,
  CheckboxItem: C,
  RadioGroup: J,
  RadioItem: O,
  RadioItemIndicator: A,
  Label: L,
  Separator: T,
  Shortcut: P,
  Group: H
});
export {
  le as D
};
//# sourceMappingURL=dropdown-CfS4QcSR.js.map
