import{r,j as a,b1 as p,b8 as i,b9 as x}from"./index-Db-xuq0b.js";const u=r.createContext({open:!1,setOpen:()=>{}});function b({children:e,open:t,onOpenChange:s,defaultOpen:l=!1}){const[o,n]=r.useState(l),c=t!==void 0,f=c?t:o,g=r.useCallback(d=>{c||n(d),s==null||s(d)},[c,s]);return a.jsx(u.Provider,{value:{open:f,setOpen:g},children:e})}function j({children:e,asChild:t}){const{setOpen:s}=r.useContext(u);return t&&r.isValidElement(e)?r.cloneElement(e,{onClick:l=>{var o,n;(n=(o=e.props).onClick)==null||n.call(o,l),s(!0)}}):a.jsx("span",{"data-slot":"alert-dialog-trigger",onClick:()=>s(!0),style:{display:"contents",cursor:"pointer"},children:e})}function A({children:e,className:t,...s}){const{open:l,setOpen:o}=r.useContext(u);return a.jsx(p,{opened:l,onClose:()=>o(!1),withCloseButton:!1,centered:!0,padding:0,radius:"lg",classNames:{content:i("bg-background text-foreground",t),overlay:"bg-black/50"},...s,children:a.jsx("div",{className:"grid gap-4 p-6",children:e})})}function v({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:i("flex flex-col gap-2 text-center sm:text-left",e),...t})}function D({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:i("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function N({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-title",className:i("text-lg font-semibold",e),...t})}function y({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-description",className:i("text-muted-foreground text-sm",e),...t})}function C({className:e,onClick:t,children:s,...l}){const{setOpen:o}=r.useContext(u);return a.jsx("button",{type:"button",className:i(x(),e),onClick:n=>{t==null||t(n),o(!1)},...l,children:s})}function E({className:e,onClick:t,children:s,...l}){const{setOpen:o}=r.useContext(u);return a.jsx("button",{type:"button",className:i(x({variant:"outline"}),e),onClick:n=>{t==null||t(n),o(!1)},...l,children:s})}export{b as A,A as a,v as b,N as c,y as d,D as e,E as f,C as g,j as h};
