import{c as I}from"./use-auth-wvxHCDzg.js";import{r as n,j as a}from"./index-BH-cN4KT.js";import{u as x,b as he,c as d,d as Re,e as M}from"./button-ChRro_zr.js";import{b as _e,u as R,e as _,P as y,c as D,a as S,g as Ce}from"./index-JcJvmTtT.js";import{P as je,h as be,R as Ee,a as Pe,F as we,D as Oe}from"./Combination-CBlSanWE.js";const Te=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Rt=I("trash-2",Te);const Ie=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Me=I("x",Ie);var A="Dialog",[$,F]=S(A),[Se,p]=$(A),k=e=>{const{__scopeDialog:t,children:o,open:r,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=n.useRef(null),f=n.useRef(null),[u,h]=_e({prop:r,defaultProp:s??!1,onChange:i,caller:A});return a.jsx(Se,{scope:t,triggerRef:c,contentRef:f,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:h,onOpenToggle:n.useCallback(()=>h(Ae=>!Ae),[h]),modal:l,children:o})};k.displayName=A;var L="DialogTrigger",W=n.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=p(L,o),i=x(t,s.triggerRef);return a.jsx(y.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":b(s.open),...r,ref:i,onClick:D(e.onClick,s.onOpenToggle)})});W.displayName=L;var C="DialogPortal",[$e,G]=$(C,{forceMount:void 0}),z=e=>{const{__scopeDialog:t,forceMount:o,children:r,container:s}=e,i=p(C,t);return a.jsx($e,{scope:t,forceMount:o,children:n.Children.map(r,l=>a.jsx(_,{present:o||i.open,children:a.jsx(je,{asChild:!0,container:s,children:l})}))})};z.displayName=C;var N="DialogOverlay",H=n.forwardRef((e,t)=>{const o=G(N,e.__scopeDialog),{forceMount:r=o.forceMount,...s}=e,i=p(N,e.__scopeDialog);return i.modal?a.jsx(_,{present:r||i.open,children:a.jsx(ke,{...s,ref:t})}):null});H.displayName=N;var Fe=he("DialogOverlay.RemoveScroll"),ke=n.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=p(N,o);return a.jsx(Ee,{as:Fe,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(y.div,{"data-state":b(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),m="DialogContent",V=n.forwardRef((e,t)=>{const o=G(m,e.__scopeDialog),{forceMount:r=o.forceMount,...s}=e,i=p(m,e.__scopeDialog);return a.jsx(_,{present:r||i.open,children:i.modal?a.jsx(Le,{...s,ref:t}):a.jsx(We,{...s,ref:t})})});V.displayName=m;var Le=n.forwardRef((e,t)=>{const o=p(m,e.__scopeDialog),r=n.useRef(null),s=x(t,o.contentRef,r);return n.useEffect(()=>{const i=r.current;if(i)return be(i)},[]),a.jsx(B,{...e,ref:s,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:D(e.onCloseAutoFocus,i=>{i.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:D(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&i.preventDefault()}),onFocusOutside:D(e.onFocusOutside,i=>i.preventDefault())})}),We=n.forwardRef((e,t)=>{const o=p(m,e.__scopeDialog),r=n.useRef(!1),s=n.useRef(!1);return a.jsx(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||o.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;o.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),B=n.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,c=p(m,o),f=n.useRef(null),u=x(t,f);return Pe(),a.jsxs(a.Fragment,{children:[a.jsx(we,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Oe,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":b(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(ze,{titleId:c.titleId}),a.jsx(Ve,{contentRef:f,descriptionId:c.descriptionId})]})]})}),j="DialogTitle",Y=n.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=p(j,o);return a.jsx(y.h2,{id:s.titleId,...r,ref:t})});Y.displayName=j;var q="DialogDescription",K=n.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=p(q,o);return a.jsx(y.p,{id:s.descriptionId,...r,ref:t})});K.displayName=q;var U="DialogClose",X=n.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=p(U,o);return a.jsx(y.button,{type:"button",...r,ref:t,onClick:D(e.onClick,()=>s.onOpenChange(!1))})});X.displayName=U;function b(e){return e?"open":"closed"}var Z="DialogTitleWarning",[Ge,J]=Ce(Z,{contentName:m,titleName:j,docsSlug:"dialog"}),ze=({titleId:e})=>{const t=J(Z),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},He="DialogDescriptionWarning",Ve=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J(He).contentName}}.`;return n.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Q=k,Be=W,ee=z,E=H,P=V,w=Y,O=K,T=X;const _t=Q,Ye=ee,te=n.forwardRef(({className:e,...t},o)=>a.jsx(E,{ref:o,className:d("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),...t}));te.displayName=E.displayName;const qe=n.forwardRef(({className:e,children:t,...o},r)=>a.jsxs(Ye,{children:[a.jsx(te,{}),a.jsxs(P,{ref:r,className:d("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 sm:rounded-lg",e),...o,children:[t,a.jsxs(T,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Me,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qe.displayName=P.displayName;const Ke=({className:e,...t})=>a.jsx("div",{className:d("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ke.displayName="DialogHeader";const Ue=({className:e,...t})=>a.jsx("div",{className:d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ue.displayName="DialogFooter";const Xe=n.forwardRef(({className:e,...t},o)=>a.jsx(w,{ref:o,className:d("text-lg font-semibold leading-none tracking-tight",e),...t}));Xe.displayName=w.displayName;const Ze=n.forwardRef(({className:e,...t},o)=>a.jsx(O,{ref:o,className:d("text-sm text-muted-foreground",e),...t}));Ze.displayName=O.displayName;var oe="AlertDialog",[Je]=S(oe,[F]),g=F(),ae=e=>{const{__scopeAlertDialog:t,...o}=e,r=g(t);return a.jsx(Q,{...r,...o,modal:!0})};ae.displayName=oe;var Qe="AlertDialogTrigger",et=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...r}=e,s=g(o);return a.jsx(Be,{...s,...r,ref:t})});et.displayName=Qe;var tt="AlertDialogPortal",re=e=>{const{__scopeAlertDialog:t,...o}=e,r=g(t);return a.jsx(ee,{...r,...o})};re.displayName=tt;var ot="AlertDialogOverlay",se=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...r}=e,s=g(o);return a.jsx(E,{...s,...r,ref:t})});se.displayName=ot;var v="AlertDialogContent",[at,rt]=Je(v),st=Re("AlertDialogContent"),ne=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:r,...s}=e,i=g(o),l=n.useRef(null),c=x(t,l),f=n.useRef(null);return a.jsx(Ge,{contentName:v,titleName:ie,docsSlug:"alert-dialog",children:a.jsx(at,{scope:o,cancelRef:f,children:a.jsxs(P,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:D(s.onOpenAutoFocus,u=>{u.preventDefault(),f.current?.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(st,{children:r}),a.jsx(it,{contentRef:l})]})})})});ne.displayName=v;var ie="AlertDialogTitle",le=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...r}=e,s=g(o);return a.jsx(w,{...s,...r,ref:t})});le.displayName=ie;var ce="AlertDialogDescription",de=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...r}=e,s=g(o);return a.jsx(O,{...s,...r,ref:t})});de.displayName=ce;var nt="AlertDialogAction",pe=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...r}=e,s=g(o);return a.jsx(T,{...s,...r,ref:t})});pe.displayName=nt;var ue="AlertDialogCancel",ge=n.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...r}=e,{cancelRef:s}=rt(ue,o),i=g(o),l=x(t,s);return a.jsx(T,{...i,...r,ref:l})});ge.displayName=ue;var it=({contentRef:e})=>{const t=`\`${v}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${v}\` by passing a \`${ce}\` 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 \`${v}\`. 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 n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},lt=ae,ct=re,fe=se,me=ne,De=pe,ve=ge,xe=le,ye=de;const Ct=lt,dt=ct,Ne=n.forwardRef(({className:e,...t},o)=>a.jsx(fe,{className:d("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),...t,ref:o}));Ne.displayName=fe.displayName;const pt=n.forwardRef(({className:e,...t},o)=>a.jsxs(dt,{children:[a.jsx(Ne,{}),a.jsx(me,{ref:o,className:d("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 sm:rounded-lg",e),...t})]}));pt.displayName=me.displayName;const ut=({className:e,...t})=>a.jsx("div",{className:d("flex flex-col space-y-2 text-center sm:text-left",e),...t});ut.displayName="AlertDialogHeader";const gt=({className:e,...t})=>a.jsx("div",{className:d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gt.displayName="AlertDialogFooter";const ft=n.forwardRef(({className:e,...t},o)=>a.jsx(xe,{ref:o,className:d("text-lg font-semibold",e),...t}));ft.displayName=xe.displayName;const mt=n.forwardRef(({className:e,...t},o)=>a.jsx(ye,{ref:o,className:d("text-sm text-muted-foreground",e),...t}));mt.displayName=ye.displayName;const Dt=n.forwardRef(({className:e,...t},o)=>a.jsx(De,{ref:o,className:d(M(),e),...t}));Dt.displayName=De.displayName;const vt=n.forwardRef(({className:e,...t},o)=>a.jsx(ve,{ref:o,className:d(M({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));vt.displayName=ve.displayName;export{Ct as A,_t as D,Rt as T,Me as X,qe as a,Ke as b,Xe as c,Ue as d,pt as e,ut as f,ft as g,mt as h,gt as i,vt as j,Dt as k};
