import{r as k,j as e,T as v,I as A,ef as B,J as t}from"./index-d2b25495.js";import{D as c,a as d}from"./DialogContent-cded694d.js";import{D as x}from"./DialogTitle-a145b392.js";import{D as p}from"./DialogContentText-43575e44.js";import{D as h}from"./DialogActions-7c802cc8.js";import{L as I}from"./LoadingButton-c8e88148.js";const z=({isOpen:u,title:m,children:f,onClose:o,onOK:g,okText:a,closeText:n,status:L,loading:j,showFooter:C=!0,maxWidth:b,...y})=>{const[D,r]=k.useState(!1),s=()=>{r(!0)},w=()=>{r(!1),o==null||o()},l=()=>{r(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(c,{open:u,onClose:s,sx:{"& .MuiDialog-paper":{borderRadius:"15px",overflow:"hidden"}},maxWidth:b||"sm",fullWidth:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",...y,children:[e.jsxs(x,{sx:{background:"linear-gradient(90deg, #5b6ef5 0%, #9b59b6 100%)",color:"white",p:2.5,display:"flex",alignItems:"center",justifyContent:"space-between"},id:"alert-dialog-title",children:[e.jsx(v,{variant:"h6",sx:{fontWeight:700},children:m}),e.jsx(A,{onClick:s,sx:{color:"white"},children:e.jsx(B,{size:20})})]}),e.jsx(d,{sx:i=>({p:"12px !important",bgcolor:i.palette.background.default}),children:e.jsx(p,{id:"alert-dialog-description",sx:i=>({p:2,borderRadius:"10px",bgcolor:i.palette.background.paper}),children:f})}),C&&e.jsxs(h,{sx:{display:"flex",justifyContent:"center"},children:[n&&e.jsx(t,{onClick:s,color:"secondary",variant:"outlined",children:n}),a&&e.jsx(I,{loading:j,onClick:g,variant:"contained",children:a})]})]}),e.jsxs(c,{open:D,onClose:l,children:[e.jsx(x,{children:"Confirm Close"}),e.jsx(d,{children:e.jsx(p,{children:"⚠️ Are you sure you want to close? Any unsaved changes will be lost."})}),e.jsxs(h,{children:[e.jsx(t,{onClick:l,color:"primary",children:"Cancel"}),e.jsx(t,{onClick:w,color:"error",variant:"contained",children:"Close"})]})]})]})};export{z as C};
