import{d as E,ae as X,p as B,e as v,o as f,f as I,M as h,r,n as t,a as e,O as Y,Q as k,w as n,c as S,X as G,V as T,g as N,b as H,u as W,q as F,y as Z,D as x,m as ee,aw as oe,E as se,T as ae,ah as le,h as te}from"./index-b8bd6c45.js";import{f as ne,g as re,d as ie,a as de,u as ce,b as ue,e as fe}from"./el-message-606f6f33.js";import{E as pe,_ as z,a4 as me,u as P}from"./el-button-46177dcd.js";import{F as ge,e as ve}from"./el-scrollbar-d5ea4c53.js";import{c as be}from"./el-dropdown-item-98b90066.js";import{u as ye}from"./el-message-box-1764db92.js";const O=Symbol("dialogInjectionKey"),Ce=["aria-level"],he=["aria-label"],ke=["id"],Ee=E({name:"ElDialogContent"}),Re=E({...Ee,props:ne,emits:re,setup(R){const l=R,{t:i}=X(),{Close:$}=me,{dialogRef:d,headerRef:p,bodyId:w,ns:s,style:m}=B(O),{focusTrapRef:b}=B(ge),y=v(()=>[s.b(),s.is("fullscreen",l.fullscreen),s.is("draggable",l.draggable),s.is("align-center",l.alignCenter),{[s.m("center")]:l.center},l.customClass]),D=be(b,d),A=v(()=>l.draggable);return ye(d,p,A),(a,C)=>(f(),I("div",{ref:e(D),class:t(e(y)),style:N(e(m)),tabindex:"-1"},[h("header",{ref_key:"headerRef",ref:p,class:t(e(s).e("header"))},[r(a.$slots,"header",{},()=>[h("span",{role:"heading","aria-level":a.ariaLevel,class:t(e(s).e("title"))},Y(a.title),11,Ce)]),a.showClose?(f(),I("button",{key:0,"aria-label":e(i)("el.dialog.close"),class:t(e(s).e("headerbtn")),type:"button",onClick:C[0]||(C[0]=L=>a.$emit("close"))},[k(e(pe),{class:t(e(s).e("close"))},{default:n(()=>[(f(),S(G(a.closeIcon||e($))))]),_:1},8,["class"])],10,he)):T("v-if",!0)],2),h("div",{id:e(w),class:t(e(s).e("body"))},[r(a.$slots,"default")],10,ke),a.$slots.footer?(f(),I("footer",{key:0,class:t(e(s).e("footer"))},[r(a.$slots,"footer")],2)):T("v-if",!0)],6))}});var $e=z(Re,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);const we=["aria-label","aria-labelledby","aria-describedby"],De=E({name:"ElDialog",inheritAttrs:!1}),Ae=E({...De,props:ie,emits:de,setup(R,{expose:l}){const i=R,$=H();P({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},v(()=>!!$.title)),P({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},v(()=>!!i.customClass));const d=W("dialog"),p=F(),w=F(),s=F(),{visible:m,titleId:b,bodyId:y,style:D,overlayDialogStyle:A,rendered:a,zIndex:C,afterEnter:L,afterLeave:q,beforeLeave:K,handleClose:M,onModalClick:V,onOpenAutoFocus:_,onCloseAutoFocus:j,onCloseRequested:U,onFocusoutPrevented:J}=ce(i,p);Z(O,{dialogRef:p,headerRef:w,bodyId:y,ns:d,rendered:a,style:D});const c=fe(V),Q=v(()=>i.draggable&&!i.fullscreen);return l({visible:m,dialogContentRef:s}),(o,u)=>(f(),S(le,{to:"body",disabled:!o.appendToBody},[k(ae,{name:"dialog-fade",onAfterEnter:e(L),onAfterLeave:e(q),onBeforeLeave:e(K),persisted:""},{default:n(()=>[x(k(e(ue),{"custom-mask-event":"",mask:o.modal,"overlay-class":o.modalClass,"z-index":e(C)},{default:n(()=>[h("div",{role:"dialog","aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e(b),"aria-describedby":e(y),class:t(`${e(d).namespace.value}-overlay-dialog`),style:N(e(A)),onClick:u[0]||(u[0]=(...g)=>e(c).onClick&&e(c).onClick(...g)),onMousedown:u[1]||(u[1]=(...g)=>e(c).onMousedown&&e(c).onMousedown(...g)),onMouseup:u[2]||(u[2]=(...g)=>e(c).onMouseup&&e(c).onMouseup(...g))},[k(e(ve),{loop:"",trapped:e(m),"focus-start-el":"container",onFocusAfterTrapped:e(_),onFocusAfterReleased:e(j),onFocusoutPrevented:e(J),onReleaseRequested:e(U)},{default:n(()=>[e(a)?(f(),S($e,ee({key:0,ref_key:"dialogContentRef",ref:s},o.$attrs,{"custom-class":o.customClass,center:o.center,"align-center":o.alignCenter,"close-icon":o.closeIcon,draggable:e(Q),fullscreen:o.fullscreen,"show-close":o.showClose,title:o.title,"aria-level":o.headerAriaLevel,onClose:e(M)}),oe({header:n(()=>[o.$slots.title?r(o.$slots,"title",{key:1}):r(o.$slots,"header",{key:0,close:e(M),titleId:e(b),titleClass:e(d).e("title")})]),default:n(()=>[r(o.$slots,"default")]),_:2},[o.$slots.footer?{name:"footer",fn:n(()=>[r(o.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","aria-level","onClose"])):T("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,we)]),_:3},8,["mask","overlay-class","z-index"]),[[se,e(m)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"]))}});var Ie=z(Ae,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);const Pe=te(Ie);export{Pe as E};