import{__rest as e}from"../../../../_virtual/_tslib.js";import o,{forwardRef as t,useRef as i,useMemo as r}from"react";import l from"../../Tooltip/Tooltip.js";import{Icon as s}from"@vibe/icon/mockedClassNames";import a from"../../../hooks/useIsOverflowing/useIsOverflowing.js";import{withStaticProps as n}from"../../../types/withStaticProps.js";import"../../../utils/colors-vars-map.js";import c from"../../Label/Label.js";import p from"./MenuItem.module.scss.js";import m from"./components/BaseMenuItem/BaseMenuItem.js";import d from"./components/MenuItemIcon/MenuItemIcon.js";import{TooltipPositions as u}from"../../Tooltip/TooltipConstants.js";import{Flex as b}from"@vibe/layout/mockedClassNames";var g=t((function(t,s){var n=t.className,u=t.iconWrapperClassName,g=t.rightIconWrapperClassName,f=t.title,h=void 0===f?"":f,I=t.label,v=void 0===I?"":I,y=t.icon,C=void 0===y?"":y,j=t.rightIcon,k=void 0===j?"":j,N=t.rightIconType,T=t.rightIconBackgroundColor,w=t.rightIconAriaLabel,E=t.iconType,M=t.iconBackgroundColor,B=t.disabled,P=void 0!==B&&B,O=t.disableReason,L=t.selected,S=void 0!==L&&L,W=t.key,x=t.children,D=t.tooltipContent,R=t.tooltipPosition,A=void 0===R?"right":R,_=t.tooltipShowDelay,V=void 0===_?300:_,q=t.tooltipProps,z=t["aria-label"],F=e(t,["className","iconWrapperClassName","rightIconWrapperClassName","title","label","icon","rightIcon","rightIconType","rightIconBackgroundColor","rightIconAriaLabel","iconType","iconBackgroundColor","disabled","disableReason","selected","key","children","tooltipContent","tooltipPosition","tooltipShowDelay","tooltipProps","aria-label"]),G=i(),H=null!=z?z:h,J=null!=w?w:h,K=a({ref:G})||P||D,Q=r((function(){return P?O:D||h}),[O,P,h,D]),U=r((function(){if(v)return"string"==typeof v?o.createElement(c,{kind:"line",text:v}):o.isValidElement(v)&&v.type===c?v:void 0}),[v]);return o.createElement(l,Object.assign({content:K?Q:null,position:A,showDelay:V},q),o.createElement(m,Object.assign({key:W,ref:s,subMenu:x,className:n,disabled:P,selected:S},F),!!C&&o.createElement(d,{icon:C,type:E,label:H,disabled:P,selected:S,backgroundColor:M,wrapperClassName:u}),o.createElement("div",{ref:G,className:p.title},h),o.createElement(b,{gap:"xs"},!!k&&!x&&o.createElement(d,{icon:k,type:N,label:J,disabled:P,selected:S,backgroundColor:T,isRightIcon:!0,wrapperClassName:g}),U)))}));Object.assign(g,{isSelectable:!0,isMenuChild:!0});var f=n(g,{iconType:s.type,tooltipPositions:u});export{f as default};
//# sourceMappingURL=MenuItem.js.map
