"use client";
import { jsx as n, jsxs as u, Fragment as V } from "react/jsx-runtime";
import * as i from "react";
import { c as s } from "./cn-Bhsu1vx2.js";
import { u as z } from "./link-provider-DPBGo-0n.js";
import { C as U } from "./checkbox-BexIU_lZ.js";
import { CheckIcon as b, CaretRightIcon as W } from "@phosphor-icons/react";
import { ah as F, ai as K, aj as q, ak as B, al as x, S as w, am as N, an as H, ao as J, ap as M, aq as R, ar as Q, as as X, at as k, au as Y } from "./vendor-base-ui-DWIDNgE1.js";
const Z = {
  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"
    }
  }
}, $ = {
  variant: "default"
};
function ee({
  variant: e = $.variant
} = {}) {
  return s(Z.variant[e].classes);
}
const y = i.forwardRef(({ className: e, inset: t, children: a, icon: o, ...r }, d) => /* @__PURE__ */ u(
  k,
  {
    ref: d,
    className: s(
      "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
      t && "pl-8",
      // conditional inset
      e
    ),
    ...r,
    children: [
      o && /* @__PURE__ */ n(o, { className: "mr-2 h-4 w-4" }),
      a,
      /* @__PURE__ */ n(W, { className: "ml-auto h-4 w-4" })
    ]
  }
));
y.displayName = k.displayName;
const h = i.forwardRef(({ className: e, sideOffset: t = 8, children: a, ...o }, r) => /* @__PURE__ */ n(x, { children: /* @__PURE__ */ n(
  Q,
  {
    ref: r,
    sideOffset: t,
    ...o,
    children: /* @__PURE__ */ n(
      X,
      {
        className: s(
          "z-50 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: a
      }
    )
  }
) })), D = (e) => e ? i.isValidElement(e) ? e : /* @__PURE__ */ n(e, { className: "mr-2 h-4 w-4" }) : null, I = i.forwardRef(
  ({
    className: e,
    inset: t,
    icon: a,
    children: o,
    selected: r,
    render: d,
    href: l,
    variant: m = "default",
    ..._
  }, j) => {
    const f = z(), A = i.useMemo(() => {
      const c = /* @__PURE__ */ u(V, { children: [
        a && D(a),
        o,
        r && /* @__PURE__ */ n("span", { className: "inline-flex", children: /* @__PURE__ */ n(b, {}) })
      ] });
      if (!l) return c;
      const G = l.startsWith("https://"), g = s(
        "flex items-center",
        m === "danger" && "text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger"
      );
      return G ? /* @__PURE__ */ n(
        "a",
        {
          className: s(g, "w-full text-inherit! no-underline!"),
          href: l,
          target: "_blank",
          rel: "noreferrer",
          onClick: (p) => p.stopPropagation(),
          children: c
        }
      ) : /* @__PURE__ */ n(
        f,
        {
          className: s(g, "w-full text-inherit! no-underline!"),
          href: l,
          to: l,
          onClick: (p) => p.stopPropagation(),
          children: c
        }
      );
    }, [l, a, o, r, m, f]), E = l || d;
    return /* @__PURE__ */ n(
      R,
      {
        ref: j,
        className: s(
          "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",
          t && "pl-8",
          ee({ variant: m }),
          e
        ),
        render: l ? A : d,
        ..._,
        children: E ? void 0 : o
      }
    );
  }
);
I.displayName = R.displayName;
const S = i.forwardRef(({ className: e, children: t, checked: a, ...o }, r) => /* @__PURE__ */ u(
  M,
  {
    ref: r,
    className: s(
      "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: a,
    ...o,
    children: [
      /* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center text-inherit", children: /* @__PURE__ */ n(U, { checked: a }) }),
      t
    ]
  }
));
S.displayName = M.displayName;
const v = i.forwardRef(({ className: e, inset: t, ...a }, o) => /* @__PURE__ */ n(
  N,
  {
    ref: o,
    className: s(
      "px-2 py-1.5 text-base font-semibold",
      t && "pl-8",
      e
    ),
    ...a
  }
));
v.displayName = N.displayName;
const C = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ n(
  w,
  {
    ref: a,
    className: s("-mx-1 my-1 h-px bg-kumo-line", e),
    ...t
  }
));
C.displayName = w.displayName;
const T = ({
  className: e,
  ...t
}) => /* @__PURE__ */ n(
  "span",
  {
    className: s("ml-auto text-xs tracking-widest opacity-60", e),
    ...t
  }
);
T.displayName = "DropdownMenuShortcut";
const P = i.forwardRef(({ className: e, children: t, inset: a, icon: o, ...r }, d) => /* @__PURE__ */ u(
  J,
  {
    ref: d,
    className: s(
      "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",
      a && "pl-8",
      e
    ),
    ...r,
    children: [
      o && D(o),
      t
    ]
  }
));
P.displayName = "DropdownMenuRadioItem";
const O = i.forwardRef(({ className: e, children: t, ...a }, o) => /* @__PURE__ */ n(
  H,
  {
    ref: o,
    className: s("ml-auto", e),
    ...a,
    children: t ?? /* @__PURE__ */ n(b, { className: "h-4 w-4" })
  }
));
O.displayName = "DropdownMenuRadioItemIndicator";
const L = i.forwardRef(({ children: e, render: t, ...a }, o) => {
  const r = i.isValidElement(e) ? e : null, d = t ?? r;
  return /* @__PURE__ */ n(
    Y,
    {
      ref: o,
      ...a,
      ...d && {
        render: d
      },
      children: r ? void 0 : e
    }
  );
});
L.displayName = "DropdownMenuTrigger";
const ie = Object.assign(F, {
  Trigger: L,
  Portal: x,
  Sub: B,
  SubTrigger: y,
  SubContent: h,
  Content: h,
  Item: I,
  CheckboxItem: S,
  RadioGroup: q,
  RadioItem: P,
  RadioItemIndicator: O,
  Label: v,
  Separator: C,
  Shortcut: T,
  Group: K
});
export {
  ie as D
};
//# sourceMappingURL=dropdown-D0rhYKeG.js.map
