import{j as t,f as p,d2 as P,cJ as $,dG as R,cG as z,cH as E,T as N,r as i,cK as T,cL as A,cM as U}from"./index-4dfc510b.js";import"./index-e5978b8b.js";import{c as H,a as L}from"./Grow-a7315f12.js";const G=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"),O=p(P)($(({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)}}}))),q=p(G)({width:24,height:16});function D(e){const{slots:r={},slotProps:a={},...l}=e,s=e;return t.jsx("li",{children:t.jsx(O,{focusRipple:!0,...l,ownerState:s,children:t.jsx(q,{as:r.CollapsedIcon,ownerState:s,...a.collapsedIcon})})})}function J(e){return E("MuiBreadcrumbs",e)}const K=z("MuiBreadcrumbs",["root","ol","li","separator"]),V=K,W=e=>{const{classes:r}=e;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},J,r)},F=p(N,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${V.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:y="/",...v}=l,[B,I]=i.useState(!1),c={...l,component:n,expanded:B,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:g,maxItems:f,separator:y},u=W(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(D,{"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(F,{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(B||f&&b.length<=f?b:k(b),u.separator,y,c)})})}),oe=Z;export{oe as B};
