import{a as x,j as e}from"./vendor-query-B2UbickB.js";import{a as c}from"./vendor-react-CXumBFUA.js";function o({open:r,onClose:t,title:a,children:i,maxWidth:n}){return x.useEffect(()=>{if(!r)return;const s=d=>{d.key==="Escape"&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[r,t]),r?c.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-text-primary/30",onClick:t}),e.jsxs("div",{className:`relative bg-surface-raised border border-surface-border rounded-lg shadow-xl w-full ${n??"max-w-md"} mx-4 max-h-[85vh] flex flex-col`,children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b shrink-0",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a}),e.jsx("button",{onClick:t,className:"text-text-tertiary hover:text-text-primary text-lg leading-none",children:"×"})]}),e.jsx("div",{className:"px-6 py-5 overflow-y-auto",children:i})]})]}),document.body):null}export{o as M};
//# sourceMappingURL=Modal-CSrxpXeM.js.map
