import{At as e,Ct as t,G as n,Nt as r,Q as i,Y as a,Z as o,dt as s,jt as c,nt as l,pt as u,rt as d}from"#entry";import{i as f}from"./DC04ikWQ.js";import{t as p}from"./CoM7_Rk8.js";var m={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)`}},h={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},g={key:0,class:`flex-1 overflow-y-auto p-5`},_={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)`}},v={class:`flex justify-end gap-2`},y=Object.assign(p(d({__name:`Modal`,props:{title:{}},emits:[`close`],setup(d,{expose:p,emit:y}){let b=y,x=t(),S=t(!1),C=t(!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`)},240)}return p({open:w,close:T}),(t,p)=>(s(),i(`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)`}},[a(`div`,{class:c([`modal-shell flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 sm:w-11/12`,e(S)?`is-open`:``]),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), inset 0 1px 0 0 color-mix(in oklch, var(--color-base-content) 6%, transparent)`},onContextmenu:p[0]||=n(()=>{},[`prevent`])},[a(`div`,m,[a(`div`,h,[u(t.$slots,`icon`,{},void 0,!0),a(`span`,null,r(d.title),1)]),a(`button`,{class:`modal-close flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-transparent`,style:{border:`1px solid var(--modal-border)`,color:`color-mix(in oklch, var(--color-base-content) 60%, transparent)`},onClick:T},[l(e(f),{size:18})])]),e(C)?(s(),i(`div`,g,[u(t.$slots,`default`,{},void 0,!0)])):o(``,!0),e(C)&&t.$slots.actions?(s(),i(`div`,_,[a(`div`,v,[u(t.$slots,`actions`,{},void 0,!0)])])):o(``,!0)],34),a(`form`,{method:`dialog`,class:`fixed inset-0 modal-backdrop -z-[1]`,style:{background:`color-mix(in oklch, var(--color-base-content) 50%, transparent)`}},[a(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:T})])],512))}}),[[`__scopeId`,`data-v-ec42d534`]]),{__name:`Modal`});export{y as t};