import{bY as X,bZ as tt,r as y,aO as et,b_ as nt,b$ as it,aP as ot,aS as o,O as rt,c0 as st,aT as at,ao as C,aU as T,aV as lt,aW as pt,c1 as L}from"./index-DlNZgIG9.js";function dt(n){return X("MuiCollapse",n)}tt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const ct=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],ut=n=>{const{orientation:e,classes:r}=n,d={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return pt(d,dt,r)},ht=T("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:r}=n;return[e.root,e[r.orientation],r.state==="entered"&&e.entered,r.state==="exited"&&!r.in&&r.collapsedSize==="0px"&&e.hidden]}})(({theme:n,ownerState:e})=>o({height:0,overflow:"hidden",transition:n.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:n.transitions.create("width")},e.state==="entered"&&o({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),mt=T("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(n,e)=>e.wrapper})(({ownerState:n})=>o({display:"flex",width:"100%"},n.orientation==="horizontal"&&{width:"auto",height:"100%"})),gt=T("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(n,e)=>e.wrapperInner})(({ownerState:n})=>o({width:"100%"},n.orientation==="horizontal"&&{width:"auto",height:"100%"})),ft=y.forwardRef(function(e,r){const d=et({props:e,name:"MuiCollapse"}),{addEndListener:S,children:N,className:U,collapsedSize:g="0px",component:_,easing:$,in:D,onEnter:W,onEntered:b,onEntering:j,onExit:I,onExited:A,onExiting:M,orientation:P="vertical",style:z,timeout:a=it.standard,TransitionComponent:O=nt}=d,V=ot(d,ct),f=o({},d,{orientation:P,collapsedSize:g}),c=ut(f),F=rt(),Y=st(),l=y.useRef(null),v=y.useRef(),x=typeof g=="number"?`${g}px`:g,u=P==="horizontal",h=u?"width":"height",E=y.useRef(null),Z=at(r,E),p=t=>i=>{if(t){const s=E.current;i===void 0?t(s):t(s,i)}},R=()=>l.current?l.current[u?"clientWidth":"clientHeight"]:0,k=p((t,i)=>{l.current&&u&&(l.current.style.position="absolute"),t.style[h]=x,W&&W(t,i)}),q=p((t,i)=>{const s=R();l.current&&u&&(l.current.style.position="");const{duration:m,easing:w}=L({style:z,timeout:a,easing:$},{mode:"enter"});if(a==="auto"){const H=F.transitions.getAutoHeightDuration(s);t.style.transitionDuration=`${H}ms`,v.current=H}else t.style.transitionDuration=typeof m=="string"?m:`${m}ms`;t.style[h]=`${s}px`,t.style.transitionTimingFunction=w,j&&j(t,i)}),B=p((t,i)=>{t.style[h]="auto",b&&b(t,i)}),G=p(t=>{t.style[h]=`${R()}px`,I&&I(t)}),J=p(A),K=p(t=>{const i=R(),{duration:s,easing:m}=L({style:z,timeout:a,easing:$},{mode:"exit"});if(a==="auto"){const w=F.transitions.getAutoHeightDuration(i);t.style.transitionDuration=`${w}ms`,v.current=w}else t.style.transitionDuration=typeof s=="string"?s:`${s}ms`;t.style[h]=x,t.style.transitionTimingFunction=m,M&&M(t)}),Q=t=>{a==="auto"&&Y.start(v.current||0,t),S&&S(E.current,t)};return C.jsx(O,o({in:D,onEnter:k,onEntered:B,onEntering:q,onExit:G,onExited:J,onExiting:K,addEndListener:Q,nodeRef:E,timeout:a==="auto"?null:a},V,{children:(t,i)=>C.jsx(ht,o({as:_,className:lt(c.root,U,{entered:c.entered,exited:!D&&x==="0px"&&c.hidden}[t]),style:o({[u?"minWidth":"minHeight"]:x},z),ref:Z},i,{ownerState:o({},f,{state:t}),children:C.jsx(mt,{ownerState:o({},f,{state:t}),className:c.wrapper,ref:l,children:C.jsx(gt,{ownerState:o({},f,{state:t}),className:c.wrapperInner,children:N})})}))}))});ft.muiSupportAuto=!0;export{ft as C};
