"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("classnames"),n=require("@material-ui/core"),a=require("./RadioAndCheckboxGroup.scss.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(o),s={normal:a.spacing_normal,dense:a.spacing_dense},l={horizontal:a.horizontal,vertical:a.vertical};exports.RadioAndCheckboxGroup=function(o){var t=o.component,c=o.getOnChangeHandler,u=o.getOptionChecked,d=o.value,m=o.testId,p=o.className,v=o.label,h=o.status,x=o.message,f=o.options,g=void 0===f?[]:f,j=o.size,b=void 0===j?"medium":j,C=o.spacing,q=void 0===C?"normal":C,k=o.direction,z=void 0===k?"vertical":k,F=r.useMemo((function(){return null==g?void 0:g.map((function(e){var r=e.value;return c(r,d)}))}),[g,c,d]);return e.jsx("div",{className:i.default(a.root,s[q],l[z],p),"data-testid":m,children:e.jsxs(n.FormControl,{component:"fieldset",error:"error"===h,className:a.group,children:[v&&e.jsx(n.FormLabel,{component:"legend",className:a.label,children:v}),e.jsx(n.FormGroup,{children:g.map((function(r,o){return e.jsx(t,{label:r.label,checked:u(r.value,d),size:b,onChange:F[o]},o)}))}),x&&e.jsx(n.FormHelperText,{children:x})]})})};
