"use client";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { useState as l, useEffect as m } from "react";
import { CheckIcon as u, CopyIcon as p } from "@phosphor-icons/react";
import { B as d } from "./button-Bh96oxRL.js";
import { S as f } from "./skeleton-line-CtpS1u1J.js";
import { u as h } from "./link-provider-DPBGo-0n.js";
import { c } from "./cn-Bhsu1vx2.js";
const b = {
  size: {
    sm: {
      classes: "text-sm h-10 gap-0.5",
      description: "Compact breadcrumbs for dense UIs"
    },
    base: {
      classes: "text-base h-12 gap-1",
      description: "Default breadcrumbs size"
    }
  }
}, k = {
  size: "base"
};
function C({
  size: t = k.size
} = {}) {
  return c(
    "group mr-4 hidden min-w-0 grow items-center sm:flex",
    b.size[t].classes
  );
}
const x = ({
  href: t,
  icon: e,
  children: s
}) => {
  const o = h();
  return /* @__PURE__ */ i(
    o,
    {
      to: t,
      className: "flex min-w-0 items-center gap-1 text-kumo-subtle no-underline",
      children: [
        !!e && /* @__PURE__ */ r("span", { className: "flex shrink-0 items-center", children: e }),
        s
      ]
    }
  );
};
function g({
  children: t,
  icon: e,
  loading: s
}) {
  return s ? /* @__PURE__ */ i("div", { className: "flex w-[125px] min-w-0 items-center gap-1", children: [
    e && /* @__PURE__ */ r("span", { className: "flex shrink-0 items-center", children: e }),
    /* @__PURE__ */ r(f, {})
  ] }) : /* @__PURE__ */ i(
    "div",
    {
      className: "flex items-center gap-1 truncate font-medium",
      "aria-current": "page",
      children: [
        e && /* @__PURE__ */ r("span", { className: "flex shrink-0 items-center", children: e }),
        t
      ]
    }
  );
}
function N() {
  return /* @__PURE__ */ r("span", { className: "flex items-center text-kumo-inactive", "aria-hidden": "true", children: /* @__PURE__ */ r("svg", { width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ r(
    "path",
    {
      stroke: "currentColor",
      strokeLinecap: "round",
      strokeLinejoin: "round",
      strokeWidth: "1.5",
      d: "M10.75 8.75L14.25 12L10.75 15.25"
    }
  ) }) });
}
function w({ text: t }) {
  const [e, s] = l(!1);
  return m(() => {
    if (!e) return;
    const a = setTimeout(() => s(!1), 2e3);
    return () => clearTimeout(a);
  }, [e]), /* @__PURE__ */ r(
    d,
    {
      variant: "ghost",
      shape: "square",
      size: "sm",
      className: "opacity-0 transition-[opacity] group-hover:opacity-100",
      onClick: async () => {
        if (t)
          try {
            await navigator.clipboard.writeText(t), s(!0);
          } catch (a) {
            console.error("Failed to copy deeplink:", a);
          }
      },
      title: "Click to copy",
      "aria-label": "Copy",
      children: e ? /* @__PURE__ */ r(u, { weight: "bold", className: "text-kumo-success" }) : /* @__PURE__ */ r(p, { weight: "regular" })
    }
  );
}
function n({
  children: t,
  size: e = "base",
  className: s
}) {
  return /* @__PURE__ */ r(
    "nav",
    {
      className: c(C({ size: e }), s),
      "aria-label": "breadcrumb",
      children: t
    }
  );
}
n.Link = x;
n.Current = g;
n.Separator = N;
n.Clipboard = w;
export {
  n as B,
  b as K,
  k as a,
  C as b
};
//# sourceMappingURL=breadcrumbs-DyKi7BcP.js.map
