"use client";
import { jsx as n, jsxs as u, Fragment as K } from "react/jsx-runtime";
import * as s from "react";
import { c as r } from "./cn-ct4n7r74mh8y0f48.js";
import { u as U } from "./link-provider-mn2voeohon7cj9o4.js";
import { u as W } from "./portal-provider-hwmkdmkpvct0cb76.js";
import { CheckIcon as f, CaretRightIcon as B } from "@phosphor-icons/react";
import { ay as H, az as J, aA as q, aB as Q, aC as w, S as N, aD as M, aE as X, aF as Y, aG as y, aH as Z, aI as $, aJ as R, aK as ee, aL as te, aM as v, aN as x } from "./vendor-base-ui-ie71jahf0czyf58j.js";
const ae = {
  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"
    }
  }
}, oe = {
  variant: "default"
};
function D({
  variant: e = oe.variant
} = {}) {
  return r(ae.variant[e].classes);
}
const I = s.forwardRef(({ className: e, inset: t, children: a, icon: o, ...i }, l) => /* @__PURE__ */ u(
  v,
  {
    ref: l,
    className: r(
      "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:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand",
      // focus state
      "data-[state=open]:bg-kumo-tint",
      // open state
      t && "pl-8",
      // conditional inset
      e
    ),
    ...i,
    children: [
      o && /* @__PURE__ */ n(o, { className: "mr-2 h-4 w-4" }),
      a,
      /* @__PURE__ */ n(B, { className: "ml-auto h-4 w-4" })
    ]
  }
));
I.displayName = v.displayName;
const k = s.forwardRef(
  ({ className: e, sideOffset: t = 8, children: a, container: o, ...i }, l) => {
    const d = W();
    return /* @__PURE__ */ n(w, { container: o ?? d ?? void 0, children: /* @__PURE__ */ n(
      ee,
      {
        ref: l,
        sideOffset: t,
        ...i,
        children: /* @__PURE__ */ n(
          te,
          {
            className: r(
              "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
          }
        )
      }
    ) });
  }
), g = (e) => e ? s.isValidElement(e) ? e : /* @__PURE__ */ n(e, { className: "mr-2 h-4 w-4" }) : null, S = s.forwardRef(
  ({
    className: e,
    inset: t,
    icon: a,
    children: o,
    selected: i,
    render: l,
    href: d,
    variant: c = "default",
    ..._
  }, V) => {
    const b = U(), m = s.useMemo(
      () => /* @__PURE__ */ u(K, { children: [
        a && g(a),
        o,
        i && /* @__PURE__ */ n("span", { className: "inline-flex", children: /* @__PURE__ */ n(f, {}) })
      ] }),
      [a, o, i]
    ), j = s.useMemo(() => {
      if (!d) return;
      const F = /^(https?:)?\/\//.test(d), h = r(
        "flex items-center",
        c === "danger" && "text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger"
      );
      return F ? /* @__PURE__ */ n(
        "a",
        {
          className: r(h, "w-full text-inherit! no-underline!"),
          href: d,
          target: "_blank",
          rel: "noreferrer",
          onClick: (p) => p.stopPropagation(),
          children: m
        }
      ) : /* @__PURE__ */ n(
        b,
        {
          className: r(h, "w-full text-inherit! no-underline!"),
          href: d,
          to: d,
          onClick: (p) => p.stopPropagation(),
          children: m
        }
      );
    }, [d, m, c, b]), z = d || l;
    return /* @__PURE__ */ n(
      R,
      {
        ref: V,
        className: r(
          "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none focus:text-kumo-default focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay",
          t && "pl-8",
          D({ variant: c }),
          e
        ),
        render: d ? j : l,
        ..._,
        children: z ? void 0 : m
      }
    );
  }
);
S.displayName = R.displayName;
const C = s.forwardRef(
  ({
    className: e,
    inset: t,
    icon: a,
    children: o,
    variant: i = "default",
    ...l
  }, d) => /* @__PURE__ */ u(
    $,
    {
      ref: d,
      className: r(
        "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none",
        "focus:text-kumo-default focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay",
        "text-inherit no-underline",
        t && "pl-8",
        D({ variant: i }),
        e
      ),
      ...l,
      children: [
        a && g(a),
        o
      ]
    }
  )
);
C.displayName = "DropdownMenuLinkItem";
const L = s.forwardRef(({ className: e, children: t, checked: a, ...o }, i) => /* @__PURE__ */ u(
  y,
  {
    ref: i,
    className: r(
      "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 focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand data-disabled:pointer-events-none data-disabled:opacity-50",
      e
    ),
    checked: a,
    ...o,
    children: [
      /* @__PURE__ */ n(Z, { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center text-inherit", children: /* @__PURE__ */ n(f, { weight: "bold", size: 12 }) }),
      t
    ]
  }
));
L.displayName = y.displayName;
const P = s.forwardRef(({ className: e, inset: t, ...a }, o) => /* @__PURE__ */ n(
  M,
  {
    ref: o,
    className: r(
      "px-2 py-1.5 text-base font-semibold",
      t && "pl-8",
      e
    ),
    ...a
  }
));
P.displayName = M.displayName;
const T = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ n(
  N,
  {
    ref: a,
    className: r("-mx-1 my-1 h-px bg-kumo-hairline", e),
    ...t
  }
));
T.displayName = N.displayName;
const O = ({
  className: e,
  ...t
}) => /* @__PURE__ */ n(
  "span",
  {
    className: r("ml-auto text-xs tracking-widest opacity-60", e),
    ...t
  }
);
O.displayName = "DropdownMenuShortcut";
const A = s.forwardRef(({ className: e, children: t, inset: a, icon: o, ...i }, l) => /* @__PURE__ */ u(
  Y,
  {
    ref: l,
    className: r(
      "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
    ),
    ...i,
    children: [
      o && g(o),
      t
    ]
  }
));
A.displayName = "DropdownMenuRadioItem";
const E = s.forwardRef(({ className: e, children: t, ...a }, o) => /* @__PURE__ */ n(
  X,
  {
    ref: o,
    className: r("ml-auto", e),
    ...a,
    children: t ?? /* @__PURE__ */ n(f, { className: "h-4 w-4" })
  }
));
E.displayName = "DropdownMenuRadioItemIndicator";
const G = s.forwardRef(({ children: e, render: t, ...a }, o) => {
  if (t)
    return /* @__PURE__ */ n(x, { ref: o, ...a, render: t, children: e });
  const i = s.isValidElement(e) ? e : null;
  return /* @__PURE__ */ n(
    x,
    {
      ref: o,
      ...a,
      ...i && {
        render: i
      },
      children: i ? void 0 : e
    }
  );
});
G.displayName = "DropdownMenuTrigger";
const ue = Object.assign(H, {
  Trigger: G,
  Portal: w,
  Sub: Q,
  SubTrigger: I,
  SubContent: k,
  Content: k,
  Item: S,
  LinkItem: C,
  CheckboxItem: L,
  RadioGroup: q,
  RadioItem: A,
  RadioItemIndicator: E,
  Label: P,
  Separator: T,
  Shortcut: O,
  Group: J
});
export {
  ue as D
};
//# sourceMappingURL=dropdown-zbax0zowy6m9zhmt.js.map
