import{d as L,aW as H,B as q,o as u,c as A,q as R,h as i,n as t,f as e,aa as Q,s as $,w as r,e as B,r as X,bk as x,E as _,g as N,al as O,j as E,bl as ee,a as oe,K as se,Y as K,a$ as ae,L as le,Z as te,bm as ne,y as M,F as re,l as ie}from"./index-BKKvzUDD.js";import{u as de}from"./index-BjEW7-SA.js";import{E as ce,u as ue}from"./index-DfyOU94W.js";import{F as fe,f as ge}from"./index-CWUnzf90.js";import{d as me,a as ve,b as j,c as be,e as ye,u as Ce}from"./use-dialog-DmridEEy.js";import{u as he}from"./index-CQXVR1Ud.js";const pe=(...o)=>f=>{o.forEach(g=>{g.value=f})},ke=["aria-level"],we=["aria-label"],Re=["id"];var $e=L({name:"ElDialogContent",__name:"dialog-content",props:ve,emits:me,setup(o,{expose:f}){const{t:g}=H(),{Close:F}=x,a=o,{dialogRef:m,headerRef:y,bodyId:v,ns:s,style:C}=q(j),{focusTrapRef:h}=q(fe),D=pe(h,m),p=E(()=>!!a.draggable),{resetPosition:k,updatePosition:I,isDragging:P}=he(m,y,p,E(()=>!!a.overflow)),T=E(()=>[s.b(),s.is("fullscreen",a.fullscreen),s.is("draggable",p.value),s.is("dragging",P.value),s.is("align-center",!!a.alignCenter),{[s.m("center")]:a.center}]);return f({resetPosition:k,updatePosition:I}),(n,w)=>(u(),A("div",{ref:e(D),class:t(T.value),style:O(e(C)),tabindex:"-1"},[R("header",{ref_key:"headerRef",ref:y,class:t([e(s).e("header"),o.headerClass,{"show-close":o.showClose}])},[i(n.$slots,"header",{},()=>[R("span",{role:"heading","aria-level":o.ariaLevel,class:t(e(s).e("title"))},Q(o.title),11,ke)]),o.showClose?(u(),A("button",{key:0,"aria-label":e(g)("el.dialog.close"),class:t(e(s).e("headerbtn")),type:"button",onClick:w[0]||(w[0]=z=>n.$emit("close"))},[$(e(_),{class:t(e(s).e("close"))},{default:r(()=>[(u(),B(X(o.closeIcon||e(F))))]),_:1},8,["class"])],10,we)):N("v-if",!0)],2),R("div",{id:e(v),class:t([e(s).e("body"),o.bodyClass])},[i(n.$slots,"default")],10,Re),n.$slots.footer?(u(),A("footer",{key:0,class:t([e(s).e("footer"),o.footerClass])},[i(n.$slots,"footer")],2)):N("v-if",!0)],6))}}),Ee=$e;const Fe=["aria-label","aria-labelledby","aria-describedby"];var De=L({name:"ElDialog",inheritAttrs:!1,__name:"dialog",props:ye,emits:be,setup(o,{expose:f}){const g=o,F=ee();de({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"},E(()=>!!F.title));const a=oe("dialog"),m=M(),y=M(),v=M(),{visible:s,titleId:C,bodyId:h,style:D,overlayDialogStyle:p,rendered:k,transitionConfig:I,zIndex:P,_draggable:T,_alignCenter:n,_overflow:w,penetrable:z,handleClose:S,onModalClick:V,onOpenAutoFocus:U,onCloseAutoFocus:Y,onCloseRequested:J,onFocusoutPrevented:W,bringToFront:Z,closing:G}=Ce(g,m);re(j,{dialogRef:m,headerRef:y,bodyId:h,ns:a,rendered:k,style:D});const d=ue(V);return f({visible:s,dialogContentRef:v,resetPosition:()=>{var l;(l=v.value)==null||l.resetPosition()},handleClose:S}),(l,c)=>(u(),B(ne,{to:o.appendTo,disabled:o.appendTo!=="body"?!1:!o.appendToBody},[$(te,K(e(I),{persisted:""}),{default:r(()=>[se($(e(ce),{"custom-mask-event":"",mask:o.modal,"overlay-class":[o.modalClass??"",`${e(a).namespace.value}-modal-dialog`,e(a).is("penetrable",e(z))],"z-index":e(P)},{default:r(()=>[R("div",{role:"dialog","aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e(C),"aria-describedby":e(h),class:t([`${e(a).namespace.value}-overlay-dialog`,e(a).is("closing",e(G))]),style:O(e(p)),onClick:c[0]||(c[0]=(...b)=>e(d).onClick&&e(d).onClick(...b)),onMousedown:c[1]||(c[1]=(...b)=>e(d).onMousedown&&e(d).onMousedown(...b)),onMouseup:c[2]||(c[2]=(...b)=>e(d).onMouseup&&e(d).onMouseup(...b))},[$(e(ge),{loop:"",trapped:e(s),"focus-start-el":"container",onFocusAfterTrapped:e(U),onFocusAfterReleased:e(Y),onFocusoutPrevented:e(W),onReleaseRequested:e(J)},{default:r(()=>[e(k)?(u(),B(Ee,K({key:0,ref_key:"dialogContentRef",ref:v},l.$attrs,{center:o.center,"align-center":e(n),"close-icon":o.closeIcon,draggable:e(T),overflow:e(w),fullscreen:o.fullscreen,"header-class":o.headerClass,"body-class":o.bodyClass,"footer-class":o.footerClass,"show-close":o.showClose,title:o.title,"aria-level":o.headerAriaLevel,onClose:e(S),onMousedown:e(Z)}),ae({header:r(()=>[l.$slots.title?i(l.$slots,"title",{key:1}):i(l.$slots,"header",{key:0,close:e(S),titleId:e(C),titleClass:e(a).e("title")})]),default:r(()=>[i(l.$slots,"default")]),_:2},[l.$slots.footer?{name:"footer",fn:r(()=>[i(l.$slots,"footer")]),key:"0"}:void 0]),1040,["center","align-center","close-icon","draggable","overflow","fullscreen","header-class","body-class","footer-class","show-close","title","aria-level","onClose","onMousedown"])):N("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,Fe)]),_:3},8,["mask","overlay-class","z-index"]),[[le,e(s)]])]),_:3},16)],8,["to","disabled"]))}}),Ie=De;const ze=ie(Ie);export{ze as E,pe as c};
