import{cM as _,cN as Z,cO as $e,cP as re,cy as X,cQ as je,cR as ie,cS as U,cT as ce,bN as Ie,az as Ee,cU as we,cV as Be,cW as Fe,cX as Oe,c4 as De,cY as Le,a6 as Pe,aq as ue,ab as Me,f as K,ac as ke,O as H,cZ as Ne,y as F,c_ as Re,o as O,c as q,a as N,R as w,a2 as S,k as t,t as Ue,b as R,w as E,m as W,a1 as _e,B as Ke,n as Y,a4 as de,_ as fe,c$ as Ve,ar as Q,af as ge,aO as Ge,bA as qe,aD as x,r as B,d0 as ze,d1 as We,bw as Ye,d2 as Ze,W as ee,X as Je,C as Xe,a5 as He,cJ as oe,aB as Qe,bk as xe,cb as te,N as eo,S as oo,$ as to,d3 as ao,d4 as no,bK as so,c3 as lo,a0 as ro,bm as io,bH as co,d5 as uo,as as fo}from"./entry.ae0eac90.js";import{k as ye,g as be,s as go,a as yo,b as bo,c as J,d as po}from"./_getTag.e4404448.js";import{i as mo}from"./isUndefined.aa0326a0.js";function vo(e,o){for(var a=-1,g=e==null?0:e.length;++ao=>{e.forEach(a=>{Pe(a)?a(o):a.value=o})},Ce=Symbol("dialogInjectionKey"),Ae=ue({center:Boolean,alignCenter:Boolean,closeIcon:{type:Me},customClass:{type:String,default:""},draggable:Boolean,fullscreen:Boolean,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}}),Pt={close:()=>!0},Mt=["aria-level"],kt=["aria-label"],Nt=["id"],Rt=K({name:"ElDialogContent"}),Ut=K({...Rt,props:Ae,emits:Pt,setup(e){const o=e,{t:a}=ke(),{Close:g}=Ve,{dialogRef:c,headerRef:u,bodyId:l,ns:r,style:y}=H(Ce),{focusTrapRef:f}=H(Ne),v=F(()=>[r.b(),r.is("fullscreen",o.fullscreen),r.is("draggable",o.draggable),r.is("align-center",o.alignCenter),{[r.m("center")]:o.center},o.customClass]),d=Lt(f,c),C=F(()=>o.draggable);return Re(c,u,C),(i,b)=>(O(),q("div",{ref:t(d),class:S(t(v)),style:de(t(y)),tabindex:"-1"},[N("header",{ref_key:"headerRef",ref:u,class:S(t(r).e("header"))},[w(i.$slots,"header",{},()=>[N("span",{role:"heading","aria-level":i.ariaLevel,class:S(t(r).e("title"))},Ue(i.title),11,Mt)]),i.showClose?(O(),q("button",{key:0,"aria-label":t(a)("el.dialog.close"),class:S(t(r).e("headerbtn")),type:"button",onClick:b[0]||(b[0]=$=>i.$emit("close"))},[R(t(Ke),{class:S(t(r).e("close"))},{default:E(()=>[(O(),W(_e(i.closeIcon||t(g))))]),_:1},8,["class"])],10,kt)):Y("v-if",!0)],2),N("div",{id:t(l),class:S(t(r).e("body"))},[w(i.$slots,"default")],10,Nt),i.$slots.footer?(O(),q("footer",{key:0,class:S(t(r).e("footer"))},[w(i.$slots,"footer")],2)):Y("v-if",!0)],6))}});var _t=fe(Ut,[["__file","dialog-content.vue"]]);const Kt=ue({...Ae,appendToBody:Boolean,appendTo:{type:Q(String),default:"body"},beforeClose:{type:Q(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1},headerAriaLevel:{type:String,default:"2"}}),Vt={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[ge]:e=>Ge(e),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},Gt=(e,o)=>{var a;const c=He().emit,{nextZIndex:u}=qe();let l="";const r=x(),y=x(),f=B(!1),v=B(!1),d=B(!1),C=B((a=e.zIndex)!=null?a:u());let i,b;const $=ze("namespace",We),p=F(()=>{const m={},I=`--${$.value}-dialog`;return e.fullscreen||(e.top&&(m[`${I}-margin-top`]=e.top),e.width&&(m[`${I}-width`]=Ye(e.width))),m}),T=F(()=>e.alignCenter?{display:"flex"}:{});function P(){c("opened")}function V(){c("closed"),c(ge,!1),e.destroyOnClose&&(d.value=!1)}function G(){c("close")}function M(){b==null||b(),i==null||i(),e.openDelay&&e.openDelay>0?{stop:i}=oe(()=>k(),e.openDelay):k()}function D(){i==null||i(),b==null||b(),e.closeDelay&&e.closeDelay>0?{stop:b}=oe(()=>n(),e.closeDelay):n()}function L(){function m(I){I||(v.value=!0,f.value=!1)}e.beforeClose?e.beforeClose(m):D()}function A(){e.closeOnClickModal&&L()}function k(){Qe&&(f.value=!0)}function n(){f.value=!1}function h(){c("openAutoFocus")}function j(){c("closeAutoFocus")}function he(m){var I;((I=m.detail)==null?void 0:I.focusReason)==="pointer"&&m.preventDefault()}e.lockScroll&&Ze(f);function Se(){e.closeOnPressEscape&&L()}return ee(()=>e.modelValue,m=>{m?(v.value=!1,M(),d.value=!0,C.value=mo(e.zIndex)?u():C.value++,Je(()=>{c("open"),o.value&&(o.value.scrollTop=0)})):f.value&&D()}),ee(()=>e.fullscreen,m=>{o.value&&(m?(l=o.value.style.transform,o.value.style.transform=""):o.value.style.transform=l)}),Xe(()=>{e.modelValue&&(f.value=!0,d.value=!0,M())}),{afterEnter:P,afterLeave:V,beforeLeave:G,handleClose:L,onModalClick:A,close:D,doClose:n,onOpenAutoFocus:h,onCloseAutoFocus:j,onCloseRequested:Se,onFocusoutPrevented:he,titleId:r,bodyId:y,closed:v,style:p,overlayDialogStyle:T,rendered:d,visible:f,zIndex:C}},qt=["aria-label","aria-labelledby","aria-describedby"],zt=K({name:"ElDialog",inheritAttrs:!1}),Wt=K({...zt,props:Kt,emits:Vt,setup(e,{expose:o}){const a=e,g=xe();te({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"},F(()=>!!g.title)),te({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"},F(()=>!!a.customClass));const c=eo("dialog"),u=B(),l=B(),r=B(),{visible:y,titleId:f,bodyId:v,style:d,overlayDialogStyle:C,rendered:i,zIndex:b,afterEnter:$,afterLeave:p,beforeLeave:T,handleClose:P,onModalClick:V,onOpenAutoFocus:G,onCloseAutoFocus:M,onCloseRequested:D,onFocusoutPrevented:L}=Gt(a,u);oo(Ce,{dialogRef:u,headerRef:l,bodyId:v,ns:c,rendered:i,style:d});const A=uo(V),k=F(()=>a.draggable&&!a.fullscreen);return o({visible:y,dialogContentRef:r}),(n,h)=>(O(),W(co,{to:n.appendTo,disabled:n.appendTo!=="body"?!1:!n.appendToBody},[R(io,{name:"dialog-fade",onAfterEnter:t($),onAfterLeave:t(p),onBeforeLeave:t(T),persisted:""},{default:E(()=>[to(R(t(ao),{"custom-mask-event":"",mask:n.modal,"overlay-class":n.modalClass,"z-index":t(b)},{default:E(()=>[N("div",{role:"dialog","aria-modal":"true","aria-label":n.title||void 0,"aria-labelledby":n.title?void 0:t(f),"aria-describedby":t(v),class:S(`${t(c).namespace.value}-overlay-dialog`),style:de(t(C)),onClick:h[0]||(h[0]=(...j)=>t(A).onClick&&t(A).onClick(...j)),onMousedown:h[1]||(h[1]=(...j)=>t(A).onMousedown&&t(A).onMousedown(...j)),onMouseup:h[2]||(h[2]=(...j)=>t(A).onMouseup&&t(A).onMouseup(...j))},[R(t(no),{loop:"",trapped:t(y),"focus-start-el":"container",onFocusAfterTrapped:t(G),onFocusAfterReleased:t(M),onFocusoutPrevented:t(L),onReleaseRequested:t(D)},{default:E(()=>[t(i)?(O(),W(_t,so({key:0,ref_key:"dialogContentRef",ref:r},n.$attrs,{"custom-class":n.customClass,center:n.center,"align-center":n.alignCenter,"close-icon":n.closeIcon,draggable:t(k),fullscreen:n.fullscreen,"show-close":n.showClose,title:n.title,"aria-level":n.headerAriaLevel,onClose:t(P)}),lo({header:E(()=>[n.$slots.title?w(n.$slots,"title",{key:1}):w(n.$slots,"header",{key:0,close:t(P),titleId:t(f),titleClass:t(c).e("title")})]),default:E(()=>[w(n.$slots,"default")]),_:2},[n.$slots.footer?{name:"footer",fn:E(()=>[w(n.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","aria-level","onClose"])):Y("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,qt)]),_:3},8,["mask","overlay-class","z-index"]),[[ro,t(y)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["to","disabled"]))}});var Yt=fe(Wt,[["__file","dialog.vue"]]);const Ht=fo(Yt);export{Ht as E,z as b};