"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),o=require("../../../../src/modules/ComparisonV2/comparisonV2.module.css"),h=require("../../../../utils/cn/cn.cjs.js"),l=require("../../../../components/Typography/Typography.cjs.js"),s=require("../../../../components/Icon/Icon.cjs.js"),c=require("../../../../components/Icon/constants.cjs.js"),y=({title:p,description:m,onClose:n,isOpening:u,isClosing:d})=>{const t=a.useRef(null);return a.useEffect(()=>{const i=r=>{r.stopPropagation(),t.current&&!t.current.contains(r.target)&&n()};return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[n]),e.jsxs("div",{className:h.cn(o.tooltip,u&&o.tooltipOpening,d&&o.tooltipClosing),ref:t,children:[e.jsxs("div",{className:o.tooltipHeader,children:[e.jsx(l.Typography,{as:"h4",defaultVariant:"headingSm",mobileVariant:"headingXs",className:o.tooltipTitle,children:p}),e.jsxs("button",{className:o.closeButtonWrapper,onClick:n,children:[e.jsx(s.Icon,{name:c.EIconName.BRACKET_LEFT}),e.jsx(s.Icon,{className:o.closeIcon,name:c.EIconName.CLOSE_BOLD}),e.jsx(s.Icon,{name:c.EIconName.BRACKET_RIGHT})]})]}),e.jsx(l.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:o.tooltipDescription,children:m})]})};exports.ComparisonV2Tooltip=y;
