import{E as e,G as t,V as n,_ as r,_t as i,b as a,ct as o,l as s,vt as c,w as l,xt as u,y as d}from"./CcHu_7lQ.js";import{i as f}from"./DCv6DWhr.js";var p={class:`sticky top-0 z-10 flex items-center justify-between px-5 py-4 max-sm:pt-[max(1rem,env(safe-area-inset-top))]`,style:{background:`var(--color-base-200)`,borderBottom:`1px solid var(--modal-border)`}},m={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},h={key:0,class:`flex-1 overflow-y-auto p-5`},g={key:1,class:`sticky bottom-0 z-10 flex items-center justify-end px-5 py-4`,style:{background:`var(--color-base-200)`,borderTop:`1px solid var(--modal-border)`}},_={class:`flex justify-end gap-2`},v=Object.assign(e({__name:`Modal`,props:{title:{}},emits:[`close`],setup(e,{expose:v,emit:y}){let b=y,x=o(),S=o(!1),C=o(!1);function w(){x.value?.showModal(),C.value=!0,requestAnimationFrame(()=>{S.value=!0})}function T(){S.value=!1,setTimeout(()=>{x.value?.close(),C.value=!1,b(`close`)},200)}return v({open:w,close:T}),(o,v)=>(n(),a(`dialog`,{ref_key:`dialogRef`,ref:x,class:`modal modal-bottom sm:modal-middle`,style:{"--modal-border":`color-mix(in oklch, var(--color-base-content) 10%, transparent)`}},[r(`div`,{class:c([`flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 transition-all duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] sm:w-11/12`,i(S)?`translate-y-0 scale-100 opacity-100`:`translate-y-2.5 scale-95 opacity-0`]),style:{background:`var(--color-base-100)`,border:`1px solid var(--modal-border)`,boxShadow:`0 25px 50px -12px color-mix(in oklch, var(--color-base-content) 25%, transparent), 0 0 0 1px var(--modal-border)`},onContextmenu:v[2]||=s(()=>{},[`prevent`])},[r(`div`,p,[r(`div`,m,[t(o.$slots,`icon`),r(`span`,null,u(e.title),1)]),r(`button`,{class:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-transparent transition-all duration-200 ease-in-out hover:rotate-90 hover:text-error`,style:{border:`1px solid var(--modal-border)`,color:`color-mix(in oklch, var(--color-base-content) 60%, transparent)`},onMouseover:v[0]||=e=>{e.target.style.background=`color-mix(in oklch, var(--color-error) 15%, transparent)`,e.target.style.borderColor=`color-mix(in oklch, var(--color-error) 30%, transparent)`},onMouseleave:v[1]||=e=>{e.target.style.background=`transparent`,e.target.style.borderColor=`var(--modal-border)`},onClick:T},[l(i(f),{size:18})],32)]),i(C)?(n(),a(`div`,h,[t(o.$slots,`default`)])):d(``,!0),i(C)&&o.$slots.actions?(n(),a(`div`,g,[r(`div`,_,[t(o.$slots,`actions`)])])):d(``,!0)],34),r(`form`,{method:`dialog`,class:`fixed inset-0 modal-backdrop -z-[1]`,style:{background:`color-mix(in oklch, var(--color-base-content) 50%, transparent)`}},[r(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:T})])],512))}}),{__name:`Modal`});export{v as t};