"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),i=require("../../utils/cn/cn.cjs.js"),t=require("../../src/modules/TypesOfTests/typesOfTests.module.css"),q=require("../../components/ComplexTooltip/components/ComplexTooltipContent/ComplexTooltipContent.cjs.js"),T=require("../../components/Typography/Typography.cjs.js"),w=require("../../components/ComplexTooltip/ComplexTooltip.cjs.js"),f=require("../../components/Button/Button.cjs.js"),S=7,V=({title:g,items:l,colorScheme:o,buttonLabel:m,className:y,expandByDefault:c=!1,withParenthesis:k=!0,size:h="lg"})=>{const[p,x]=n.useState(c),[r,C]=n.useState(null),[j,I]=n.useState(!1),d=n.useRef(null),N=c||p;n.useEffect(()=>{c||x(!1)},[c]);const v=()=>x(s=>!s),_=()=>{C(null)};return n.useLayoutEffect(()=>{var u;if(!d.current)return;const a=(((u=d.current.firstElementChild)==null?void 0:u.getBoundingClientRect().height)||0)*S;I(d.current.scrollHeight>a)},[l.length]),e.jsxs("section",{className:i.cn(t.root,y),"data-scheme":o,"data-size":h,children:[r!==null&&e.jsx("div",{className:i.cn(t.popover,t.mobile),children:e.jsx(q.ComplexTooltipContent,{title:l[r].title,description:l[r].description,onClose:_,style:o,link:l[r].link,className:t.popoverContent})}),e.jsxs("div",{className:t.container,children:[e.jsx("div",{className:t.header,children:e.jsx(T.Typography,{as:"h2",defaultVariant:h==="lg"?"displayMd":"headingMd",mobileVariant:h==="lg"?"headingLg":"headingSm",children:k?`(${g})`:g})}),e.jsx("div",{ref:d,className:i.cn(t.content,!N&&j&&t.contentLimited),children:l.map((s,a)=>e.jsx("div",{className:i.cn(t.item,r===a&&t.selectedItem),onClick:()=>C(u=>u===a?null:a),children:e.jsx(w.ComplexTooltip,{title:s.title,description:s.description,style:"light",trigger:"hover",isBlurred:o==="dark",link:s.link,children:e.jsx(T.Typography,{as:"p",defaultVariant:"headingLg",mobileVariant:"headingXxs",className:t.itemTitle,children:s.title})})},s.title))}),j&&!c&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:i.cn(t.actions,t.desktop),children:e.jsxs(f.Button,{variant:o==="light"?"muted":"muted-invert",size:"lg",onClick:v,children:[p?"Hide":"View All"," ",m]})}),e.jsx("div",{className:i.cn(t.actions,t.mobile),children:e.jsxs(f.Button,{variant:o==="light"?"muted":"muted-invert",size:"md",onClick:v,children:[p?"Hide":"View All"," ",m]})})]})]})]})};exports.TypesOfTests=V;
