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 d from"./DialogContent.module.scss.js";import c from"./useDisableScroll.js";import m from"../../../../../hooks/dist/useClickOutside/index.js";import{getStyle as u}from"../../../../../shared/dist/utils/typesciptCssModulesHelper.js";import{chainFunctions as f,NOOP as v}from"../../../../../shared/dist/utils/function-utils.js";import{useMergeRef as y}from"../../../../../shared/dist/hooks/useMergeRef.js";import{useKeyEvent as h}from"../../../../../shared/dist/hooks/useKeyEvent.js";import{keyCodes as k}from"../../../../../shared/dist/constants/keyCodes.js";var C={},E=[k.ESCAPE],x=t((function(t,k){var x=t.onEsc,b=void 0===x?v:x,j=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?v:D,L=t.onMouseLeave,P=void 0===L?v:L,R=t.onClickOutside,T=void 0===R?v:R,_=t.onClick,B=void 0===_?v:_,K=t.onContextMenu,W=void 0===K?v:K,q=t.showDelay,z=t.styleObject,F=void 0===z?C:z,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),$=y(k,Z),ee=s((function(e){if(N)return T(e,"clickoutside")}),[N,T]),oe=s((function(e){N&&W(e)}),[N,W]);h({keys:E,callback:b}),m({callback:ee,ref:Z}),m({eventName:"contextmenu",callback:oe,ref:Z});var te=c("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:d.expandAppear,appearActive:d.expandAppearActive,exit:d.expandExit};break;case"opacity-and-slide":re.classNames={appear:d.opacitySlideAppear,appearActive:d.opacitySlideAppearActive}}return o.createElement("span",{className:n("monday-style-dialog-content-wrapper",d.contentWrapper,g),ref:$,"data-testid":X,style:F,onClickCapture:B,"data-popper-reference-hidden":G},o.createElement(l,{classNames:re.classNames,nodeRef:Y,in:N,appear:!!O,timeout:q},o.createElement("div",{className:n(d.contentComponent,u(d,p(A)),e(e({},u(d,p("edge-"+S)),S),d.hasTooltip,J)),ref:Y},o.Children.toArray(j).map((function(e){return i(e,{onMouseEnter:f([e.props.onMouseEnter,H]),onMouseLeave:f([e.props.onMouseLeave,P])})})))))}));export{x as default};
//# sourceMappingURL=DialogContent.js.map
