const e=require(`./chunk-BcutgqC9.cjs`),t=require(`./dist-B9QvvA-B.cjs`),n=require(`./dist-C1zbYA0G.cjs`),r=require(`./dist-_OzWLRpv.cjs`),i=require(`./dist-CkjbCwvg.cjs`),a=require(`./dist-Dth0AO1S.cjs`),o=require(`./es2015-CjH07aGf.cjs`);let s=require(`react`);s=e.n(s,1);let c=require(`react/jsx-runtime`);var l=`Dialog`,[u,d]=t.a(l),[f,p]=u(l),m=e=>{let{__scopeDialog:n,children:r,open:a,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,p=s.useRef(null),m=s.useRef(null),[h,g]=t.t({prop:a,defaultProp:o??!1,onChange:u,caller:l});return(0,c.jsx)(f,{scope:n,triggerRef:p,contentRef:m,contentId:i.t(),titleId:i.t(),descriptionId:i.t(),open:h,onOpenChange:g,onOpenToggle:s.useCallback(()=>g(e=>!e),[g]),modal:d,children:r})};m.displayName=l;var h=`DialogTrigger`,g=s.forwardRef((e,r)=>{let{__scopeDialog:i,...a}=e,o=p(h,i),s=n.o(r,o.triggerRef);return(0,c.jsx)(n.t.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":o.open,"aria-controls":o.contentId,"data-state":I(o.open),...a,ref:s,onClick:t.r(e.onClick,o.onOpenToggle)})});g.displayName=h;var _=`DialogPortal`,[v,y]=u(_,{forceMount:void 0}),b=e=>{let{__scopeDialog:t,forceMount:n,children:i,container:o}=e,l=p(_,t);return(0,c.jsx)(v,{scope:t,forceMount:n,children:s.Children.map(i,e=>(0,c.jsx)(r.t,{present:n||l.open,children:(0,c.jsx)(a.t,{asChild:!0,container:o,children:e})}))})};b.displayName=_;var x=`DialogOverlay`,S=s.forwardRef((e,t)=>{let n=y(x,e.__scopeDialog),{forceMount:i=n.forceMount,...a}=e,o=p(x,e.__scopeDialog);return o.modal?(0,c.jsx)(r.t,{present:i||o.open,children:(0,c.jsx)(w,{...a,ref:t})}):null});S.displayName=x;var C=n.r(`DialogOverlay.RemoveScroll`),w=s.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,a=p(x,r);return(0,c.jsx)(o.n,{as:C,allowPinchZoom:!0,shards:[a.contentRef],children:(0,c.jsx)(n.t.div,{"data-state":I(a.open),...i,ref:t,style:{pointerEvents:`auto`,...i.style}})})}),T=`DialogContent`,E=s.forwardRef((e,t)=>{let n=y(T,e.__scopeDialog),{forceMount:i=n.forceMount,...a}=e,o=p(T,e.__scopeDialog);return(0,c.jsx)(r.t,{present:i||o.open,children:o.modal?(0,c.jsx)(D,{...a,ref:t}):(0,c.jsx)(O,{...a,ref:t})})});E.displayName=T;var D=s.forwardRef((e,r)=>{let i=p(T,e.__scopeDialog),a=s.useRef(null),l=n.o(r,i.contentRef,a);return s.useEffect(()=>{let e=a.current;if(e)return o.t(e)},[]),(0,c.jsx)(k,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:t.r(e.onCloseAutoFocus,e=>{e.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:t.r(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:t.r(e.onFocusOutside,e=>e.preventDefault())})}),O=s.forwardRef((e,t)=>{let n=p(T,e.__scopeDialog),r=s.useRef(!1),i=s.useRef(!1);return(0,c.jsx)(k,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),k=s.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,...d}=e,f=p(T,r),m=s.useRef(null),h=n.o(t,m);return o.r(),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o.i,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:(0,c.jsx)(a.r,{role:`dialog`,id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":I(f.open),...d,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(B,{titleId:f.titleId}),(0,c.jsx)(H,{contentRef:m,descriptionId:f.descriptionId})]})]})}),A=`DialogTitle`,j=s.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,a=p(A,r);return(0,c.jsx)(n.t.h2,{id:a.titleId,...i,ref:t})});j.displayName=A;var M=`DialogDescription`,N=s.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,a=p(M,r);return(0,c.jsx)(n.t.p,{id:a.descriptionId,...i,ref:t})});N.displayName=M;var P=`DialogClose`,F=s.forwardRef((e,r)=>{let{__scopeDialog:i,...a}=e,o=p(P,i);return(0,c.jsx)(n.t.button,{type:`button`,...a,ref:r,onClick:t.r(e.onClick,()=>o.onOpenChange(!1))})});F.displayName=P;function I(e){return e?`open`:`closed`}var L=`DialogTitleWarning`,[R,z]=t.i(L,{contentName:T,titleName:A,docsSlug:`dialog`}),B=({titleId:e})=>{let t=z(L),n=`\`${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 s.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},V=`DialogDescriptionWarning`,H=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${z(V).contentName}}.`;return s.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},U=m,W=g,G=b,K=S,q=E,J=j,Y=N,X=F;Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return X}});
//# sourceMappingURL=dist-YgKfMPGA.cjs.map