import { cn as e } from "../../lib/utils.js";
import { Breadcrumb as t, BreadcrumbEllipsis as n, BreadcrumbItem as r, BreadcrumbLink as i, BreadcrumbList as a, BreadcrumbPage as o, BreadcrumbSeparator as s } from "../ui/breadcrumb.js";
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
import { useNavigate as d } from "react-router-dom";
import { ChevronRight as f } from "lucide-react";
//#region src/components/page/PageBreadcrumbs.tsx
var p = ({ breadcrumbData: p, className: m }) => {
	let h = d(), g = (e, t) => {
		e.preventDefault(), h(t);
	}, _ = (e) => /* @__PURE__ */ u(c, { children: [e.icon, /* @__PURE__ */ l("span", {
		className: "min-w-0 truncate",
		children: e.label
	})] }), v = p.length > 2, y = p[0], b = p[p.length - 1];
	return /* @__PURE__ */ l("div", {
		className: e("ml-3 min-w-0 max-w-full", m),
		children: /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ l(a, {
			className: "flex-nowrap overflow-hidden sm:hidden",
			children: p.length <= 1 ? null : /* @__PURE__ */ u(c, { children: [
				/* @__PURE__ */ l(r, {
					className: "min-w-0",
					children: y.current ? /* @__PURE__ */ l(o, {
						className: "flex min-w-0 items-center gap-2",
						children: _(y)
					}) : /* @__PURE__ */ l(i, {
						href: y.href,
						onClick: (e) => y.href && g(e, y.href),
						className: "flex min-w-0 items-center gap-2",
						title: y.label,
						children: _(y)
					})
				}),
				v ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(f, { className: "h-4 w-4" }) }), /* @__PURE__ */ l(r, { children: /* @__PURE__ */ l(n, {}) })] }) : null,
				/* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(f, { className: "h-4 w-4" }) }),
				/* @__PURE__ */ l(r, {
					className: "min-w-0",
					children: /* @__PURE__ */ l(o, {
						className: "flex min-w-0 items-center gap-2",
						title: b.label,
						children: _(b)
					})
				})
			] })
		}), /* @__PURE__ */ l(a, {
			className: "hidden flex-nowrap overflow-hidden sm:flex",
			children: p.map((e, t) => {
				let n = t === p.length - 1;
				return /* @__PURE__ */ u("div", {
					className: "contents",
					children: [/* @__PURE__ */ l(r, {
						className: "min-w-0",
						children: n || e.current ? /* @__PURE__ */ l(o, {
							className: "flex min-w-0 items-center gap-2",
							title: e.label,
							children: _(e)
						}) : /* @__PURE__ */ l(i, {
							href: e.href,
							onClick: (t) => e.href && g(t, e.href),
							className: "flex min-w-0 items-center gap-2",
							title: e.label,
							children: _(e)
						})
					}), !n && /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(f, { className: "h-4 w-4" }) })]
				}, t);
			})
		})] })
	});
};
//#endregion
export { p as default };
