'use client';import { a } from './chunk-LU4CTAVZ.js';
import { Overlay, Content, Root, Trigger, Portal, Title, Close, Description } from '@radix-ui/react-dialog';
import { cx } from '@onbeam/styled-system/css';
import { forwardRef, useRef, useEffect } from 'react';
import { CloseIcon } from '@onbeam/icons';
import { modal, customScrollbar } from '@onbeam/styled-system/recipes';
import { jsx, jsxs } from 'react/jsx-runtime';

var u=forwardRef(({className:t,...n},a)=>{let r=modal();return jsx(Overlay,{ref:a,className:cx(r.bgOverlay,t),...n})});u.displayName="ModalBackgroundOverlay";var N=forwardRef(({className:t,children:n,...a},r)=>{let s=modal();return jsx(Content,{ref:r,className:cx(customScrollbar(),s.content,t),onInteractOutside:l=>{let d=l.detail.originalEvent.target;d instanceof Element&&d.closest("[data-sonner-toast]")&&l.preventDefault();},...a,children:n})});N.displayName="ModalContent";var W=forwardRef(({children:t,open:n,onOpenChange:a$1,trigger:r,title:s,description:l,size:d="lg",hideTitle:p,hideDescription:k,hideCloseButton:C,...x},I)=>{let i=useRef(null),v=useRef(),o=modal();return useEffect(()=>{if(!i.current)return;i.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(v.current=i.current.getRootNode());},[]),jsxs(Root,{open:n,onOpenChange:a$1,children:[jsx(Trigger,{ref:i,asChild:!0,children:r??jsx("div",{"aria-hidden":!0,className:o.hidden})}),jsx(Portal,{container:v.current,children:jsx(u,{onWheel:c=>c.stopPropagation(),onTouchMove:c=>c.stopPropagation(),children:jsx(N,{ref:I,...x,children:jsxs(a,{size:d,noMaxWidth:!0,className:o.card,children:[!p||!C?jsxs("div",{className:o.header,children:[jsx(Title,{className:o.title,"data-hidden":p,children:s}),!C&&jsx(Close,{className:o.close,children:jsx(CloseIcon,{height:16,width:16})})]}):jsx(Title,{className:o.title,"data-hidden":p,children:s}),jsxs("div",{className:o.cardContent,children:[jsx(Description,{className:o.description,"data-hidden":k,children:l}),t]})]})})})})]})});W.displayName="Modal";var _={Root:Root,Trigger:Trigger,Portal:Portal,Close:Close,Overlay:u,Content:N,Title:Title,Description:Description};

export { W as a, _ as b };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-XTGRXX7W.js.map