{"version":3,"file":"getCheckboxGroupValues.utils.cjs","sources":["../../../../../src/components/forms/checkbox-group/utils/getCheckboxGroupValues.utils.ts"],"sourcesContent":["import { Children, isValidElement, type ReactElement, type ReactNode } from 'react'\r\n\r\ntype CheckboxValueProps = {\r\n    value: string\r\n}\r\n\r\nconst hasCheckboxValue = (child: ReactNode): child is ReactElement<CheckboxValueProps> =>\r\n    isValidElement<CheckboxValueProps>(child) && typeof child.props.value === 'string'\r\n\r\nexport const getCheckboxGroupValues = (children: ReactNode): string[] => {\r\n    const values = Children.toArray(children)\r\n        .filter(hasCheckboxValue)\r\n        .map((child) => child.props.value)\r\n\r\n    return [...new Set(values)]\r\n}\r\n"],"names":["hasCheckboxValue","child","isValidElement","getCheckboxGroupValues","children","values","Children"],"mappings":"yGAMMA,EAAoBC,GACtBC,iBAAmCD,CAAK,GAAK,OAAOA,EAAM,MAAM,OAAU,SAEjEE,EAA0BC,GAAkC,CACrE,MAAMC,EAASC,EAAAA,SAAS,QAAQF,CAAQ,EACnC,OAAOJ,CAAgB,EACvB,IAAKC,GAAUA,EAAM,MAAM,KAAK,EAErC,MAAO,CAAC,GAAG,IAAI,IAAII,CAAM,CAAC,CAC9B"}