import{k as _,o as n,f as h,w as k,c as d,d as l,B as g,e as B,i as S,H as m,T as N,z as b,g as O,U as M,V as T,h as W,C as z}from"./index-ece68a0b.js";import{C as V}from"./CloseIcon-03fb94c4.js";const E={key:0,class:"bottom-drawer"},R=l("div",{class:"bottom-drawer__layer"},null,-1),U={class:"bottom-drawer__wrapper"},Y={class:"bottom-drawer__head"},j={class:"bottom-drawer__title"},F={class:"bottom-drawer__content"},H={__name:"BottomDrawer",props:{title:{type:String}},emits:["close"],setup(e,{expose:i,emit:r}){const o=_(!1),a=()=>{o.value=!0,document.body.style.overflowY="hidden"},t=()=>{o.value=!1,document.body.style.overflowY="auto",r("close")};return i({open:a,close:t}),(s,p)=>(n(),h(N,{name:"bt-animate"},{default:k(()=>[o.value?(n(),d("div",E,[R,l("div",U,[l("div",Y,[l("div",j,g(e.title),1),l("button",{class:"bottom-drawer__close-btn",onClick:t},[B(V)])]),l("div",F,[S(s.$slots,"default")])])])):m("",!0)]),_:3}))}};const I={key:0,class:"mod-dr-wrap__head"},P={class:"mod-dr-wrap__title"},q={class:"mod-dr-wrap__body"},J={__name:"ModalDrawerWrapper",props:{drawerStart:{type:Number,default:600},modalValue:{type:Boolean},title:{type:String},dialogConfig:{type:Object},closeCallback:{type:Function},isShowCloseBtn:{type:Boolean,default:!0}},emits:["close"],setup(e,{expose:i,emit:r}){const o=e,a=_(!1),t=_(),s=b(()=>O.windowWidth>o.drawerStart);M(s,u=>{!u&&a.value&&T(()=>{var c;(c=t.value)==null||c.open()})});const p=b(()=>s.value?"el-dialog":H);function x(){a.value=!0,t.value.open&&t.value.open()}function f(){r("close"),a.value=!1,o.closeCallback&&o.closeCallback(),t.value.close&&t.value.close()}function D(){r("close"),a.value=!1,o.closeCallback&&o.closeCallback()}return i({open:x,close:f}),(u,c)=>{var v,w,y,C;return n(),d("div",{class:z(["mod-dr-wrap",s.value?"modal":"drawer"])},[(n(),h(W(p.value),{ref_key:"currentComponentRef",ref:t,modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=$=>a.value=$),title:e.title,width:(v=e.dialogConfig)==null?void 0:v.width,"close-on-click-modal":(w=e.dialogConfig)==null?void 0:w.closeOnClickModal,"close-on-press-escape":(y=e.dialogConfig)==null?void 0:y.closeOnPressEscape,"destroy-on-close":(C=e.dialogConfig)==null?void 0:C.destroyOnClose,onClose:D},{default:k(()=>[s.value?(n(),d("div",I,[l("h4",P,g(e.title),1),e.isShowCloseBtn?(n(),d("button",{key:0,class:"mod-dr-wrap__close",onClick:f},[B(V)])):m("",!0)])):m("",!0),l("div",q,[S(u.$slots,"default")])]),_:3},40,["modelValue","title","width","close-on-click-modal","close-on-press-escape","destroy-on-close"]))],2)}}};export{J as _};
