import{j as t,f as p,ds as P,t as $,e2 as R,o as z,n as E,T as N,r as i,v as T,w as A,x as U}from"./index-c3f592b2.js";import{c as H}from"./Grow-f61cc5ca.js";import{u as L}from"./Select-9d10c4ab.js";const O=H(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),q=p(P,{name:"MuiBreadcrumbCollapsed"})($(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:R(e.palette.grey[200],.12)}:{backgroundColor:R(e.palette.grey[600],.12)}}}))),D=p(O)({width:24,height:16});function V(e){const{slots:r={},slotProps:a={},...l}=e,s=e;return t.jsx("li",{children:t.jsx(q,{focusRipple:!0,...l,ownerState:s,children:t.jsx(D,{as:r.CollapsedIcon,ownerState:s,...a.collapsedIcon})})})}function W(e){return E("MuiBreadcrumbs",e)}const F=z("MuiBreadcrumbs",["root","ol","li","separator"]),G=F,J=e=>{const{classes:r}=e;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},W,r)},K=p(N,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${G.li}`]:r.li},r.root]})({}),Q=p("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,r)=>r.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),X=p("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,r)=>r.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function Y(e,r,a,l){return e.reduce((s,d,n)=>(n<e.length-1?s=s.concat(d,t.jsx(X,{"aria-hidden":!0,className:r,ownerState:l,children:a},`separator-${n}`)):s.push(d),s),[])}const Z=i.forwardRef(function(r,a){const l=T({props:r,name:"MuiBreadcrumbs"}),{children:s,className:d,component:n="nav",slots:C={},slotProps:j={},expandText:h="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:g=1,maxItems:f=8,separator:B="/",...v}=l,[y,I]=i.useState(!1),c={...l,component:n,expanded:y,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:g,maxItems:f,separator:B},u=J(c),M=L({elementType:C.CollapsedIcon,externalSlotProps:j.collapsedIcon,ownerState:c}),S=i.useRef(null),k=o=>{const x=()=>{I(!0);const w=S.current.querySelector("a[href],button,[tabindex]");w&&w.focus()};return g+m>=o.length?o:[...o.slice(0,g),t.jsx(V,{"aria-label":h,slots:{CollapsedIcon:C.CollapsedIcon},slotProps:{collapsedIcon:M},onClick:x},"ellipsis"),...o.slice(o.length-m,o.length)]},b=i.Children.toArray(s).filter(o=>i.isValidElement(o)).map((o,x)=>t.jsx("li",{className:u.li,children:o},`child-${x}`));return t.jsx(K,{ref:a,component:n,color:"textSecondary",className:A(u.root,d),ownerState:c,...v,children:t.jsx(Q,{className:u.ol,ref:S,ownerState:c,children:Y(y||f&&b.length<=f?b:k(b),u.separator,B,c)})})}),oe=Z;export{oe as B};
