import{j as o,r as s}from"./app-C7YxHmQz.js";import{c as F,b as G}from"./index-CCZex4bU.js";import{u,b as H}from"./index-Cp62Blk_.js";import{c as A,R as W,P as k,W as V,C as Y,b as q,D as B,O as J,T as K,a as D}from"./index-w2AxdR7H.js";import{c as n}from"./utils-DjqsqOe8.js";import{b as v}from"./button-CJ9RiI_R.js";var N="AlertDialog",[Q,ye]=F(N,[A]),i=A(),x=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(W,{...r,...t,modal:!0})};x.displayName=N;var U="AlertDialogTrigger",X=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(K,{...l,...r,ref:a})});X.displayName=U;var Z="AlertDialogPortal",y=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(k,{...r,...t})};y.displayName=Z;var ee="AlertDialogOverlay",R=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(J,{...l,...r,ref:a})});R.displayName=ee;var c="AlertDialogContent",[ae,te]=Q(c),oe=H("AlertDialogContent"),_=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,children:r,...l}=e,g=i(t),p=s.useRef(null),L=u(a,p),m=s.useRef(null);return o.jsx(V,{contentName:c,titleName:b,docsSlug:"alert-dialog",children:o.jsx(ae,{scope:t,cancelRef:m,children:o.jsxs(Y,{role:"alertdialog",...g,...l,ref:L,onOpenAutoFocus:G(l.onOpenAutoFocus,d=>{var f;d.preventDefault(),(f=m.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(oe,{children:r}),o.jsx(se,{contentRef:p})]})})})});_.displayName=c;var b="AlertDialogTitle",j=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(q,{...l,...r,ref:a})});j.displayName=b;var C="AlertDialogDescription",h=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(B,{...l,...r,ref:a})});h.displayName=C;var re="AlertDialogAction",E=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(D,{...l,...r,ref:a})});E.displayName=re;var w="AlertDialogCancel",P=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,{cancelRef:l}=te(w,t),g=i(t),p=u(a,l);return o.jsx(D,{...g,...r,ref:p})});P.displayName=w;var se=({contentRef:e})=>{const a=`\`${c}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${c}\` by passing a \`${C}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${c}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(a)},[a,e]),null},le=x,ie=y,S=R,T=_,O=E,$=P,M=j,I=h;const Re=le,ne=ie,z=s.forwardRef(({className:e,...a},t)=>o.jsx(S,{className:n("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));z.displayName=S.displayName;const ce=s.forwardRef(({className:e,...a},t)=>o.jsxs(ne,{children:[o.jsx(z,{}),o.jsx(T,{ref:t,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a})]}));ce.displayName=T.displayName;const de=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col space-y-2 text-center sm:text-left",e),...a});de.displayName="AlertDialogHeader";const pe=s.forwardRef(({className:e,...a},t)=>o.jsx(M,{ref:t,className:n("text-lg font-semibold",e),...a}));pe.displayName=M.displayName;const ge=s.forwardRef(({className:e,...a},t)=>o.jsx(I,{ref:t,className:n("text-sm text-muted-foreground",e),...a}));ge.displayName=I.displayName;const me=s.forwardRef(({className:e,...a},t)=>o.jsx(O,{ref:t,className:n(v(),e),...a}));me.displayName=O.displayName;const fe=s.forwardRef(({className:e,...a},t)=>o.jsx($,{ref:t,className:n(v({variant:"outline"}),"mt-2 sm:mt-0",e),...a}));fe.displayName=$.displayName;export{Re as A,ce as a,de as b,pe as c,ge as d};
