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

export { k as a, A as b };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-JHMMPCWD.js.map