"use client";
import { jsx as t, jsxs as A } from "react/jsx-runtime";
import { CheckIcon as g } from "@phosphor-icons/react";
import { K as u, i as y } from "./input-k2ychlh2zo6hsocz.js";
import { c as s } from "./cn-ct4n7r74mh8y0f48.js";
import { r as C } from "./resolve-variant-gw6eh7fa4st8ej7m.js";
import { F as I } from "./field-hmucpi6d4sqci1zu.js";
import { a6 as v, ab as T, bu as k, a8 as z, S as G, a9 as L, aa as O, bt as P, am as _, an as w, ao as E, ac as S } from "./vendor-base-ui-ie71jahf0czyf58j.js";
const q = {
  size: u.size
}, l = {
  size: "base"
};
function B({
  size: o = l.size
} = {}) {
  return s(C(u.size, o, l.size).classes);
}
function p({
  label: o,
  required: e,
  labelTooltip: r,
  description: m,
  error: a,
  children: n,
  ...i
}) {
  const c = /* @__PURE__ */ t(k, { ...i, children: n });
  return o ? /* @__PURE__ */ t(
    I,
    {
      label: o,
      required: e,
      labelTooltip: r,
      description: m,
      error: a ? typeof a == "string" ? { message: a, match: !0 } : a : void 0,
      children: c
    }
  ) : c;
}
function d({
  className: o,
  size: e = l.size,
  placeholder: r
}) {
  return /* @__PURE__ */ t(
    S,
    {
      className: s(
        y({ size: e, focusIndicator: !0 }),
        "w-full",
        o
      ),
      placeholder: r
    }
  );
}
function b({
  children: o,
  className: e,
  align: r = "start",
  sideOffset: m = 4,
  alignOffset: a,
  side: n
}) {
  return /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
    w,
    {
      className: "outline-none",
      align: r,
      sideOffset: m,
      alignOffset: a,
      side: n,
      children: /* @__PURE__ */ t(
        E,
        {
          className: (i) => s(
            "flex flex-col",
            "max-h-[min(var(--available-height),24rem)] max-w-(--available-width) min-w-(--anchor-width) py-1.5",
            "bg-kumo-control text-kumo-default",
            "rounded-lg shadow-lg ring ring-kumo-line",
            i.empty && "hidden",
            e
          ),
          children: o
        }
      )
    }
  ) });
}
function U({
  className: o,
  ...e
}) {
  return /* @__PURE__ */ t(
    z,
    {
      ...e,
      className: s(
        "min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pt-2 scroll-pb-2",
        o
      )
    }
  );
}
function f({ children: o, ...e }) {
  return /* @__PURE__ */ A(
    P,
    {
      ...e,
      className: "group mx-1.5 grid cursor-pointer grid-cols-[1fr_16px] gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-overlay data-selected:font-medium",
      children: [
        /* @__PURE__ */ t("div", { className: "col-start-1", children: o }),
        /* @__PURE__ */ t("span", { className: "col-start-2 hidden items-center group-data-selected:flex", children: /* @__PURE__ */ t(g, { size: 14 }) })
      ]
    }
  );
}
function x(o) {
  return /* @__PURE__ */ t(
    O,
    {
      ...o,
      className: s(
        "mx-1.5 px-2 py-1.5 text-sm text-kumo-strong",
        o.className
      )
    }
  );
}
function N(o) {
  return /* @__PURE__ */ t(
    L,
    {
      ...o,
      className: "border-t border-kumo-line mt-2 pt-2 first:border-t-0 first:mt-0 first:pt-0"
    }
  );
}
function h(o) {
  return /* @__PURE__ */ t(
    G,
    {
      ...o,
      className: s("mx-0 my-1 h-px bg-kumo-line", o.className)
    }
  );
}
p.displayName = "Autocomplete.Root";
d.displayName = "Autocomplete.InputGroup";
b.displayName = "Autocomplete.Content";
f.displayName = "Autocomplete.Item";
x.displayName = "Autocomplete.GroupLabel";
N.displayName = "Autocomplete.Group";
h.displayName = "Autocomplete.Separator";
const H = Object.assign(p, {
  // Styled compound sub-components
  InputGroup: d,
  Content: b,
  Item: f,
  GroupLabel: x,
  Group: N,
  Separator: h,
  List: U,
  // Pass-through Base UI sub-components
  Empty: T,
  Collection: v
});
export {
  H as A,
  q as K,
  B as a,
  l as b
};
//# sourceMappingURL=autocomplete-hbs51xgjf9iglbmq.js.map
