import{_ as S,j as w,b as U,g as D,s as W,f as z,h as A,i as H}from"./styled-6f3628cf.js";import{_ as i}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-e1338cfd.js";import{r as k}from"./index-8ee6c85d.js";import{u as q}from"./useTheme-6d97fb94.js";import{T as G,r as I,g as _}from"./utils-a7649ee6.js";import{u as J}from"./useForkRef-8c462693.js";const K=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],O={entering:{opacity:1},entered:{opacity:1}},Q=k.forwardRef(function(e,r){const n=q(),g={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:d,appear:p=!0,children:u,easing:x,in:m,onEnter:y,onEntered:C,onEntering:T,onExit:v,onExited:P,onExiting:R,style:f,timeout:E=g,TransitionComponent:B=G}=e,b=S(e,K),a=k.useRef(null),l=J(a,u.ref,r),c=t=>s=>{if(t){const h=a.current;s===void 0?t(h):t(h,s)}},L=c(T),$=c((t,s)=>{I(t);const h=_({style:f,timeout:E,easing:x},{mode:"enter"});t.style.webkitTransition=n.transitions.create("opacity",h),t.style.transition=n.transitions.create("opacity",h),y&&y(t,s)}),j=c(C),F=c(R),M=c(t=>{const s=_({style:f,timeout:E,easing:x},{mode:"exit"});t.style.webkitTransition=n.transitions.create("opacity",s),t.style.transition=n.transitions.create("opacity",s),v&&v(t)}),N=c(P);return w(B,i({appear:p,in:m,nodeRef:a,onEnter:$,onEntered:j,onEntering:L,onExit:M,onExited:N,onExiting:F,addEndListener:t=>{d&&d(a.current,t)},timeout:E},b,{children:(t,s)=>k.cloneElement(u,i({style:i({opacity:0,visibility:t==="exited"&&!m?"hidden":void 0},O[t],f,u.props.style),ref:l},s))}))}),V=Q;function X(o){return U("MuiBackdrop",o)}D("MuiBackdrop",["root","invisible"]);const Y=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Z=o=>{const{classes:e,invisible:r}=o;return H({root:["root",r&&"invisible"]},X,e)},tt=W("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:r}=o;return[e.root,r.invisible&&e.invisible]}})(({ownerState:o})=>i({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},o.invisible&&{backgroundColor:"transparent"})),nt=k.forwardRef(function(e,r){var n,g,d;const p=z({props:e,name:"MuiBackdrop"}),{children:u,className:x,component:m="div",components:y={},componentsProps:C={},invisible:T=!1,open:v,slotProps:P={},slots:R={},TransitionComponent:f=V,transitionDuration:E}=p,B=S(p,Y),b=i({},p,{component:m,invisible:T}),a=Z(b),l=(n=P.root)!=null?n:C.root;return w(f,i({in:v,timeout:E},B,{children:w(tt,i({"aria-hidden":!0},l,{as:(g=(d=R.root)!=null?d:y.Root)!=null?g:m,className:A(a.root,x,l==null?void 0:l.className),ownerState:i({},b,l==null?void 0:l.ownerState),classes:a,ref:r,children:u}))}))}),ct=nt;export{ct as B};
