'use client';'use strict';

var chunkQL4GOF3V_cjs = require('./chunk-QL4GOF3V.cjs');
var reactDialog = require('@radix-ui/react-dialog');
var css = require('@onbeam/styled-system/css');
var react = require('react');
var icons = require('@onbeam/icons');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');

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

exports.a = k;
exports.b = _;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-KWKPXJMQ.cjs.map