import{A as e,E as r,N as a,O as o,R as t,S as l,W as i,_t as n,gt as s,lt as p,mt as d,pt as c,yt as m}from"./render-cqdoDfd9.js";import{a as u,i as h,o as x}from"./formControlState-ClbFzec2.js";import{n as b,t as y}from"./Paper-DtiadJnq.js";import{t as w}from"./DialogContext-CWuRPZWu.js";function f(e){return d("MuiDialog",e)}var S=i("MuiDialog",["root","backdrop","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),g=m(n()),W=p(),k=e(u,{name:"MuiDialog",slot:"Backdrop"})({zIndex:-1}),v=e(h,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),P=e("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,a)=>{const{ownerState:o}=e;return[a.container,a[`scroll${r(o.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),C=e(y,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,a)=>{const{ownerState:o}=e;return[a.paper,a[`scrollPaper${r(o.scroll)}`],a[`paperWidth${r(String(o.maxWidth))}`],o.fullWidth&&a.paperFullWidth,o.fullScreen&&a.paperFullScreen]}})(l(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${S.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(e=>"xs"!==e).map(r=>({props:{maxWidth:r},style:{maxWidth:`${e.breakpoints.values[r]}${e.breakpoints.unit}`,[`&.${S.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[r]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${S.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),D=g.forwardRef(function(e,l){const i=o({props:e,name:"MuiDialog"}),n=a(),p={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{"aria-describedby":d,"aria-labelledby":m,"aria-modal":u=!0,BackdropComponent:h,BackdropProps:S,children:D,className:F,disableEscapeKeyDown:$=!1,fullScreen:M=!1,fullWidth:j=!1,maxWidth:T="sm",onClick:B,onClose:N,open:R,PaperComponent:A=y,PaperProps:E={},scroll:I="paper",slots:K={},slotProps:X={},TransitionComponent:Y=x,transitionDuration:H=p,TransitionProps:O,...z}=i,L={...i,disableEscapeKeyDown:$,fullScreen:M,fullWidth:j,maxWidth:T,scroll:I},_=(e=>{const{classes:a,scroll:o,maxWidth:t,fullWidth:l,fullScreen:i}=e;return c({root:["root"],backdrop:["backdrop"],container:["container",`scroll${r(o)}`],paper:["paper",`paperScroll${r(o)}`,`paperWidth${r(String(t))}`,l&&"paperFullWidth",i&&"paperFullScreen"]},f,a)})(L),q=g.useRef(),G=t(m),J=g.useMemo(()=>({titleId:G}),[G]),Q={slots:{transition:Y,...K},slotProps:{transition:O,paper:E,backdrop:S,...X}},[U,V]=b("root",{elementType:v,shouldForwardComponentProp:!0,externalForwardedProps:Q,ownerState:L,className:s(_.root,F),ref:l}),[Z,ee]=b("backdrop",{elementType:k,shouldForwardComponentProp:!0,externalForwardedProps:Q,ownerState:L,className:_.backdrop}),[re,ae]=b("paper",{elementType:C,shouldForwardComponentProp:!0,externalForwardedProps:Q,ownerState:L,className:s(_.paper,E.className)}),[oe,te]=b("container",{elementType:P,externalForwardedProps:Q,ownerState:L,className:_.container}),[le,ie]=b("transition",{elementType:x,externalForwardedProps:Q,ownerState:L,additionalProps:{appear:!0,in:R,timeout:H,role:"presentation"}});return(0,W.jsx)(U,{closeAfterTransition:!0,slots:{backdrop:Z},slotProps:{backdrop:{transitionDuration:H,as:h,...ee}},disableEscapeKeyDown:$,onClose:N,open:R,onClick:e=>{B&&B(e),q.current&&(q.current=null,N&&N(e,"backdropClick"))},...V,...z,children:(0,W.jsx)(le,{...ie,children:(0,W.jsx)(oe,{onMouseDown:e=>{q.current=e.target===e.currentTarget},...te,children:(0,W.jsx)(re,{as:A,elevation:24,role:"dialog","aria-describedby":d,"aria-labelledby":G,"aria-modal":u,...ae,children:(0,W.jsx)(w.Provider,{value:J,children:D})})})})})});export{D as t};