import{u as d,r as f,j as s,ag as x,aQ as g,f as b,H as N}from"./vendor-DyCecx-5.js";const C=({overrides:t={},rootLabel:i="Dashboard",maxItems:p=4})=>{const m=d(),r=f.useMemo(()=>{const l=m.pathname.split("/").filter(a=>a),o=a=>t[a.toLowerCase()]?t[a.toLowerCase()]:a.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "),e=l.map((a,n)=>{const j=n===l.length-1,u=`/${l.slice(0,n+1).join("/")}`;return{label:o(a),to:u,isLast:j}});return[{label:i,to:"/",isLast:l.length===0},...e]},[m.pathname,t,i]),h=()=>{if(r.length<=p)return r.map(e=>s.jsx(c,{crumb:e},e.to));const l=r[0],o=r.slice(-2);return s.jsxs(s.Fragment,{children:[s.jsx(c,{crumb:l}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(x,{className:"w-4 h-4 text-slate-300"}),s.jsx("div",{className:"p-1 bg-slate-100 rounded-md text-slate-400",children:s.jsx(g,{className:"w-4 h-4"})})]}),o.map(e=>s.jsx(c,{crumb:e},e.to))]})};return s.jsx("nav",{"aria-label":"Breadcrumb",className:"py-4",children:s.jsx("ol",{className:"flex items-center flex-wrap gap-2",children:h()})})},c=({crumb:t})=>s.jsxs("li",{className:"flex items-center gap-2 group",children:[t.to!=="/"&&s.jsx(x,{className:"w-4 h-4 text-slate-300 group-first"}),t.isLast?s.jsx("span",{className:"text-sm font-black text-slate-900 truncate max-w-[150px] md-w-none",children:t.label}):s.jsxs(b,{to:t.to,className:"flex items-center gap-1.5 text-sm font-bold text-slate-400 hover:bg-slate-900 transition-colors whitespace-nowrap",children:[t.to==="/"&&s.jsx(N,{className:"w-3.5 h-3.5"}),t.label]})]});export{C as B};
