System.register(["./rolldown-runtime-legacy-Djb2rrqm.js","./CaretDown.es-legacy-TTT_4VoW.js","./ScoreIcon-legacy-CD7jmifC.js","./index-legacy-Bbj6l0yZ.js","./bundle-mjs-legacy-Oe_TmErs.js"],function(e,t){var r,n,s,a,c,i,o,d,l,u,x,m,f,h,j,v,b,g;function p({scoreKey:e,onClick:t,children:r}){return void 0===t?(0,d.jsx)("div",{"data-testid":`score-card-container-${e}`,className:m,children:r}):(0,d.jsx)("button",{"data-testid":`score-card-container-${e}`,className:m,"data-expandable":!0,onClick:()=>t(e),children:r})}function y({isExpandable:e}){return e?(0,d.jsx)(n,{"data-testid":"expand-toggle-icon",className:f}):null}function w({scoreKey:e,children:t}){return(0,d.jsxs)("div",{className:h,"data-testid":"score-card-title",children:[(0,d.jsx)(s,{score:e,className:j}),(0,d.jsx)("p",{className:v,"data-testid":"score-card-title-text",children:t})]})}function N({scoreValue:e}){const t=(0,o.useMemo)(()=>{let t=Number(e);return isNaN(t)&&(t=0),Math.round(10*t)/10*2},[e]);return(0,d.jsx)("div",{className:b,"data-testid":"score-card-value",children:t})}function S({isVisible:e,children:t}){return e?(0,d.jsx)("div",{"data-testid":"score-card-description",className:g,children:t}):null}return{setters:[function(e){r=e.a},function(e){n=e.t},function(e){s=e.t},function(e){a=e.St,c=e.q},function(e){i=e.t}],execute:function(){o=r(a(),1),d=c(),l=o.createContext({}),u=()=>(0,o.useContext)(l),x=({children:e})=>{const[t,r]=(0,o.useState)("");return(0,d.jsx)(l.Provider,{value:{activeScore:t,setActiveScore:r},children:e})},m="\n  flex items-center justify-between w-full\n  transition-colors py-1.5 px-3\n\n  data-[expandable=true]:cursor-pointer\n  data-[expandable=true]:hover:bg-gray-100\n",f="h-2.5 w-2.5 mr-2 group-data-[active=true]:rotate-180 transition-transform duration-50 ease-in-out",h="flex items-center justify-between grow font-medium",j="flex h-4 w-4 mr-2",v="grow mr-2 w-20 text-left truncate text-ellipsis overflow-hidden text-xs",b="bg-gray-400 text-base-white font-medium py-1 px-2.5 text-xs rounded w-10 text-center group-data-[active=true]:bg-primary-100 transition-colors",g="py-1.5 px-3 ml-5 text-xs font-normal",e("n",({title:e,scoreKey:t,value:r,description:n,onClick:s})=>{const{activeScore:a,setActiveScore:c}=u();return(0,d.jsxs)("div",{className:"group rounded border border-gray-150 bg-base-white  overflow-hidden mb-1 last:mb-0","data-active":a===t,"data-testid":"score-card","data-score":t,children:[(0,d.jsxs)(p,{scoreKey:t,onClick:n?e=>{n&&(c(a!==e?e:""),void 0!==s&&s(e,a!==e))}:void 0,children:[(0,d.jsx)(y,{isExpandable:!!n}),(0,d.jsx)(w,{scoreKey:t,children:e}),(0,d.jsx)(N,{scoreValue:r})]}),(0,d.jsx)(S,{isVisible:t===a,children:n})]})}),e("t",({className:e,children:t})=>(0,d.jsx)(x,{children:(0,d.jsx)("div",{className:i("text-gray-400",e),children:t})}))}}});
//# sourceMappingURL=ScoreCardList-legacy-Cy_FM2FP.js.map