import{B as e,C as t,D as n,E as r,G as i,H as a,Q as o,R as s,S as c,b as l,f as u,ft as d,nt as f,o as p,rt as m,xt as h,y as g}from"./app-r2SMcdpu.js";var _={class:`fixed inset-0 z-50 overflow-y-auto px-4 py-6 sm:px-0`,"scroll-region":``},v=n({__name:`Modal`,props:{show:{type:Boolean,default:!1},maxWidth:{default:`2xl`},closeable:{type:Boolean,default:!0}},emits:[`close`],setup(n,{emit:v}){let y=n,b=v,x=d(),S=d(y.show);o(()=>y.show,()=>{y.show?(document.body.style.overflow=`hidden`,S.value=!0,x.value?.showModal()):(document.body.style.overflow=``,setTimeout(()=>{x.value?.close(),S.value=!1},200))});let C=()=>{y.closeable&&b(`close`)},w=e=>{e.key===`Escape`&&(e.preventDefault(),y.show&&C())};s(()=>document.addEventListener(`keydown`,w)),e(()=>{document.removeEventListener(`keydown`,w),document.body.style.overflow=``});let T=g(()=>({sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`})[y.maxWidth]);return(e,o)=>(a(),t(`dialog`,{class:`z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent`,ref_key:`dialog`,ref:x},[l(`div`,_,[r(p,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:f(()=>[m(l(`div`,{class:`fixed inset-0 transform transition-all`,onClick:C},[...o[0]||=[l(`div`,{class:`absolute inset-0 bg-gray-500 opacity-75 dark:bg-gray-900`},null,-1)]],512),[[u,n.show]])]),_:1}),r(p,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,"enter-to-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-to-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`},{default:f(()=>[m(l(`div`,{class:h([`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full dark:bg-gray-800`,T.value])},[S.value?i(e.$slots,`default`,{key:0}):c(``,!0)],2),[[u,n.show]])]),_:3})])],512))}});export{v as t};