import{defineProperty as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import o,{forwardRef as t,useRef as a,useCallback as s,useEffect as r,cloneElement as i}from"react";import n from"classnames";import{camelCase as p}from"es-toolkit";import{CSSTransition as l}from"react-transition-group";import c from"../../../hooks/useClickOutside/index.js";import{chainFunctions as d,NOOP as m}from"../../../utils/function-utils.js";import u from"../../../hooks/useKeyEvent/index.js";import{keyCodes as f}from"../../../constants/keyCodes.js";import"../../../constants/sizes.js";import{getStyle as v}from"../../../helpers/typesciptCssModulesHelper.js";import k from"./DialogContent.module.scss.js";import y from"../../../hooks/useDisableScroll/index.js";import C from"../../../hooks/useMergeRef.js";var x={},h=[f.ESCAPE],E=t((function(t,f){var E=t.onEsc,j=void 0===E?m:E,b=t.children,A=t.position,g=t.wrapperClassName,M=t.isOpen,N=void 0!==M&&M,S=t.startingEdge,w=t.animationType,O=void 0===w?"expand":w,D=t.onMouseEnter,H=void 0===D?m:D,L=t.onMouseLeave,P=void 0===L?m:L,R=t.onClickOutside,T=void 0===R?m:R,_=t.onClick,z=void 0===_?m:_,B=t.onContextMenu,K=void 0===B?m:B,W=t.showDelay,q=t.styleObject,F=void 0===q?x:q,G=t.isReferenceHidden,I=t.hasTooltip,J=void 0!==I&&I,Q=t.containerSelector,U=t.disableContainerScroll,V=void 0!==U&&U,X=t["data-testid"],Y=a(null),Z=a(null),$=C(f,Z),ee=s((function(e){if(N)return T(e,"clickoutside")}),[N,T]),oe=s((function(e){N&&K(e)}),[N,K]);u({keys:h,callback:j}),c({callback:ee,ref:Z}),c({eventName:"contextmenu",callback:oe,ref:Z});var te=y("string"==typeof V?V:Q),ae=te.disableScroll,se=te.enableScroll;r((function(){V&&(N?ae():se())}),[V,ae,se,N]);var re={classNames:void 0};switch(O){case"expand":re.classNames={appear:k.expandAppear,appearActive:k.expandAppearActive,exit:k.expandExit};break;case"opacity-and-slide":re.classNames={appear:k.opacitySlideAppear,appearActive:k.opacitySlideAppearActive}}return o.createElement("span",{className:n("monday-style-dialog-content-wrapper",k.contentWrapper,g),ref:$,"data-testid":X,style:F,onClickCapture:z,"data-popper-reference-hidden":G},o.createElement(l,{classNames:re.classNames,nodeRef:Y,in:N,appear:!!O,timeout:W},o.createElement("div",{className:n(k.contentComponent,v(k,p(A)),e(e({},v(k,p("edge-"+S)),S),k.hasTooltip,J)),ref:Y},o.Children.toArray(b).map((function(e){return i(e,{onMouseEnter:d([e.props.onMouseEnter,H]),onMouseLeave:d([e.props.onMouseLeave,P])})})))))}));export{E as default};
//# sourceMappingURL=DialogContent.js.map
