import{Cr as e,E as t,Fr as n,Lr as r,Nr as i,S as a,Tr as o,Yr as s,fr as c,gr as l,ii as u,oi as d,ri as f,vr as p,yr as m}from"./KXnyWfWg.js";var h=[`aria-labelledby`],g={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)`}},_={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},v=[`id`],y={key:0,class:`flex-1 overflow-y-auto p-5 max-sm:pb-[max(1.25rem,env(safe-area-inset-bottom))]`},b={key:1,class:`sticky bottom-0 z-10 flex items-center justify-end px-5 py-4 max-sm:pb-[max(1rem,env(safe-area-inset-bottom))]`,style:{background:`var(--color-base-200)`,borderTop:`1px solid var(--modal-border)`}},x={class:`flex justify-end gap-2`},S=360,C=o({__name:`Modal`,props:{title:{}},emits:[`close`],setup(a,{expose:o,emit:C}){let w=C,T=s(),E=s(!1),D=s(!1),O=r(),k;function A(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function j(){k!==void 0&&(clearTimeout(k),k=void 0)}function M(){j(),T.value?.showModal(),D.value=!0,requestAnimationFrame(()=>{E.value=!0})}function N(){E.value=!1,j(),k=setTimeout(()=>{k=void 0,T.value?.close(),D.value=!1,w(`close`)},A()?0:S)}return o({open:M,close:N}),(r,o)=>(i(),m(`dialog`,{ref_key:`dialogRef`,ref:T,class:`modal modal-bottom sm:modal-middle`,"aria-modal":`true`,"aria-labelledby":a.title?f(O):void 0,style:{"--modal-border":`color-mix(in oklab, var(--color-base-content) 10%, transparent)`},onCancel:c(N,[`prevent`])},[l(`div`,{class:u([`modal-shell flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 sm:w-11/12`,f(E)?`is-open`:``]),style:{background:`var(--color-base-100)`,border:`1px solid var(--modal-border)`,boxShadow:`0 25px 50px -12px color-mix(in oklab, var(--color-base-content) 25%, transparent), 0 0 0 1px var(--modal-border), inset 0 1px 0 0 color-mix(in oklab, var(--color-base-content) 6%, transparent)`},onContextmenu:o[0]||=c(()=>{},[`prevent`])},[l(`div`,g,[l(`div`,_,[n(r.$slots,`icon`,{},void 0,!0),l(`span`,{id:f(O)},d(a.title),9,v)]),l(`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 oklab, var(--color-base-content) 60%, transparent)`},onClick:N},[e(f(t),{size:18})])]),f(D)?(i(),m(`div`,y,[n(r.$slots,`default`,{},void 0,!0)])):p(``,!0),f(D)&&r.$slots.actions?(i(),m(`div`,b,[l(`div`,x,[n(r.$slots,`actions`,{},void 0,!0)])])):p(``,!0)],34),l(`form`,{method:`dialog`,class:u([`fixed inset-0 modal-backdrop -z-[1]`,f(E)?`is-open`:``])},[l(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:N})],2)],40,h))}}),w=Object.assign(a(C,[[`__scopeId`,`data-v-fed32a7d`]]),{__name:`Modal`});export{w as t};