import{defineProperty as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{forwardRef as t,useRef as s,useMemo as n,Fragment as r}from"react";import{DialogPosition as l}from"../../constants/positions.js";import a from"classnames";import m from"../../hooks/useMergeRefs.js";import c from"../Tooltip/Tooltip.js";import p from"../Button/Button.js";import{BEMClass as d}from"../../helpers/bem-helper.js";import h from"../Icon/Icon.js";import u from"../Icon/Icons/components/CloseSmall.js";import f from"./TipseenTitle.js";import{TIPSEEN_CLOSE_BUTTON_ARIA_LABEL as j}from"./TipseenConstants.js";import{backwardCompatibilityForProperties as v}from"../../helpers/backwardCompatibilityForProperties.js";import g from"./Tipseen.module.scss.js";import{EMPTY_ARR as y}from"../../constants/common.js";import{AnimationType as T,JustifyType as O}from"../../constants/dialog.js";var b=d("l3-style-tipseen"),C=t((function(t,d){var C,B=t.className,N=t.id,w=t.position,R=void 0===w?l.BOTTOM:w,I=t.animationType,D=void 0===I?T.EXPAND:I,S=t.hideDelay,k=void 0===S?0:S,A=t.showDelay,E=void 0===A?0:A,P=t.title,W=t.hideCloseButton,_=void 0!==W&&W,H=t.isCloseButtonHidden,L=void 0!==H&&H,M=t.onClose,x=t.closeAriaLabel,z=t.children,F=void 0===z?null:z,Y=t.content,G=t.justify,K=void 0===G?O.CENTER:G,U=t.containerSelector,V=t.hideTrigger,X=void 0===V?y:V,q=t.closeButtonOnImage,J=t.isCloseButtonOnImage,Q=t.showTrigger,Z=void 0===Q?y:Q,$=t.width,ee=t.moveBy,oe=t.hideWhenReferenceHidden,ie=void 0!==oe&&oe,te=t.tip,se=void 0===te||te,ne=t.modifiers,re=void 0===ne?y:ne,le=s(null),ae=m({refs:[d,le]}),me=x||j,ce=v([q,J]),pe=v([_,L]),de=d||N?"div":r,he=n((function(){var t;return o("div",Object.assign({className:a("l3-style-tipseen")},{children:[o("div",Object.assign({className:a(g.tipseenHeader,b({element:"header"}))},{children:[pe?null:i(p,Object.assign({className:a(g.tipseenCloseButton,b({element:"close-button"}),(t={},e(t,g.tipseenCloseButtonOnImage,ce),e(t,b({element:"close-button",state:"on-image"}),ce),t)),onClick:M,size:p.sizes.SMALL,kind:p.kinds.TERTIARY,color:ce?p.colors.ON_INVERTED_BACKGROUND:p.colors.ON_PRIMARY_COLOR,ariaLabel:me},{children:i(h,{clickable:!1,icon:u,iconSize:20,ignoreFocusStyle:!0})})),i(f,{text:P,className:a(g.tipseenTitle,b({element:"title"}))})]})),i("div",Object.assign({className:a(g.tipseenContent,b({element:"content"}))},{children:Y}))]}))}),[Y,M,me,ce,pe,P]);return i(de,Object.assign({ref:ae,id:N},{children:i(c,Object.assign({className:a(g.tipseenWrapper,"".concat("l3-style-tipseen","-wrapper"),B,(C={},e(C,g.tipseenWrapperWithoutCustomWidth,!$),e(C,"".concat("l3-style-tipseen","-wrapper--without-custom-width"),!$),C)),style:$?{width:$}:void 0,shouldShowOnMount:!0,position:R,animationType:D,hideDelay:k,showDelay:E,hideTrigger:X,showTrigger:Z,content:he,theme:c.themes.Primary,justify:K,containerSelector:U,disableDialogSlide:!1,moveBy:ee,hideWhenReferenceHidden:ie,tip:se,modifiers:re},{children:F}))}))}));Object.assign(C,{positions:l,animationTypes:T,justifyTypes:O});var B=C;export{B as default};
