{"version":3,"file":"FormControlLabel.mjs","sources":["../../../../../../../../node_modules/@mui/material/FormControlLabel/FormControlLabel.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { useFormControl } from \"../FormControl/index.js\";\nimport { styled } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport Typography from \"../Typography/index.js\";\nimport capitalize from \"../utils/capitalize.js\";\nimport formControlLabelClasses, { getFormControlLabelUtilityClasses } from \"./formControlLabelClasses.js\";\nimport formControlState from \"../FormControl/formControlState.js\";\nimport useSlot from \"../utils/useSlot.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n  const {\n    classes,\n    disabled,\n    labelPlacement,\n    error,\n    required\n  } = ownerState;\n  const slots = {\n    root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error', required && 'required'],\n    label: ['label', disabled && 'disabled'],\n    asterisk: ['asterisk', error && 'error']\n  };\n  return composeClasses(slots, getFormControlLabelUtilityClasses, classes);\n};\nexport const FormControlLabelRoot = styled('label', {\n  name: 'MuiFormControlLabel',\n  slot: 'Root',\n  overridesResolver: (props, styles) => {\n    const {\n      ownerState\n    } = props;\n    return [{\n      [`& .${formControlLabelClasses.label}`]: styles.label\n    }, styles.root, styles[`labelPlacement${capitalize(ownerState.labelPlacement)}`]];\n  }\n})(memoTheme(({\n  theme\n}) => ({\n  display: 'inline-flex',\n  alignItems: 'center',\n  cursor: 'pointer',\n  // For correct alignment with the text.\n  verticalAlign: 'middle',\n  WebkitTapHighlightColor: 'transparent',\n  marginLeft: -11,\n  marginRight: 16,\n  // used for row presentation of radio/checkbox\n  [`&.${formControlLabelClasses.disabled}`]: {\n    cursor: 'default'\n  },\n  [`& .${formControlLabelClasses.label}`]: {\n    [`&.${formControlLabelClasses.disabled}`]: {\n      color: (theme.vars || theme).palette.text.disabled\n    }\n  },\n  variants: [{\n    props: {\n      labelPlacement: 'start'\n    },\n    style: {\n      flexDirection: 'row-reverse',\n      marginRight: -11\n    }\n  }, {\n    props: {\n      labelPlacement: 'top'\n    },\n    style: {\n      flexDirection: 'column-reverse'\n    }\n  }, {\n    props: {\n      labelPlacement: 'bottom'\n    },\n    style: {\n      flexDirection: 'column'\n    }\n  }, {\n    props: ({\n      labelPlacement\n    }) => labelPlacement === 'start' || labelPlacement === 'top' || labelPlacement === 'bottom',\n    style: {\n      marginLeft: 16 // used for row presentation of radio/checkbox\n    }\n  }]\n})));\nconst AsteriskComponent = styled('span', {\n  name: 'MuiFormControlLabel',\n  slot: 'Asterisk',\n  overridesResolver: (props, styles) => styles.asterisk\n})(memoTheme(({\n  theme\n}) => ({\n  [`&.${formControlLabelClasses.error}`]: {\n    color: (theme.vars || theme).palette.error.main\n  }\n})));\n\n/**\n * Drop-in replacement of the `Radio`, `Switch` and `Checkbox` component.\n * Use this component if you want to display an extra label.\n */\nconst FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {\n  const props = useDefaultProps({\n    props: inProps,\n    name: 'MuiFormControlLabel'\n  });\n  const {\n    checked,\n    className,\n    componentsProps = {},\n    control,\n    disabled: disabledProp,\n    disableTypography,\n    inputRef,\n    label: labelProp,\n    labelPlacement = 'end',\n    name,\n    onChange,\n    required: requiredProp,\n    slots = {},\n    slotProps = {},\n    value,\n    ...other\n  } = props;\n  const muiFormControl = useFormControl();\n  const disabled = disabledProp ?? control.props.disabled ?? muiFormControl?.disabled;\n  const required = requiredProp ?? control.props.required;\n  const controlProps = {\n    disabled,\n    required\n  };\n  ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(key => {\n    if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {\n      controlProps[key] = props[key];\n    }\n  });\n  const fcs = formControlState({\n    props,\n    muiFormControl,\n    states: ['error']\n  });\n  const ownerState = {\n    ...props,\n    disabled,\n    labelPlacement,\n    required,\n    error: fcs.error\n  };\n  const classes = useUtilityClasses(ownerState);\n  const externalForwardedProps = {\n    slots,\n    slotProps: {\n      ...componentsProps,\n      ...slotProps\n    }\n  };\n  const [TypographySlot, typographySlotProps] = useSlot('typography', {\n    elementType: Typography,\n    externalForwardedProps,\n    ownerState\n  });\n  let label = labelProp;\n  if (label != null && label.type !== Typography && !disableTypography) {\n    label = /*#__PURE__*/_jsx(TypographySlot, {\n      component: \"span\",\n      ...typographySlotProps,\n      className: clsx(classes.label, typographySlotProps?.className),\n      children: label\n    });\n  }\n  return /*#__PURE__*/_jsxs(FormControlLabelRoot, {\n    className: clsx(classes.root, className),\n    ownerState: ownerState,\n    ref: ref,\n    ...other,\n    children: [/*#__PURE__*/React.cloneElement(control, controlProps), required ? /*#__PURE__*/_jsxs(\"div\", {\n      children: [label, /*#__PURE__*/_jsxs(AsteriskComponent, {\n        ownerState: ownerState,\n        \"aria-hidden\": true,\n        className: classes.asterisk,\n        children: [\"\\u2009\", '*']\n      })]\n    }) : label]\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? FormControlLabel.propTypes /* remove-proptypes */ = {\n  // ┌────────────────────────────── Warning ──────────────────────────────┐\n  // │ These PropTypes are generated from the TypeScript type definitions. │\n  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │\n  // └─────────────────────────────────────────────────────────────────────┘\n  /**\n   * If `true`, the component appears selected.\n   */\n  checked: PropTypes.bool,\n  /**\n   * Override or extend the styles applied to the component.\n   */\n  classes: PropTypes.object,\n  /**\n   * @ignore\n   */\n  className: PropTypes.string,\n  /**\n   * The props used for each slot inside.\n   * @default {}\n   * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n   */\n  componentsProps: PropTypes.shape({\n    typography: PropTypes.object\n  }),\n  /**\n   * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.\n   */\n  control: PropTypes.element.isRequired,\n  /**\n   * If `true`, the control is disabled.\n   */\n  disabled: PropTypes.bool,\n  /**\n   * If `true`, the label is rendered as it is passed without an additional typography node.\n   */\n  disableTypography: PropTypes.bool,\n  /**\n   * Pass a ref to the `input` element.\n   */\n  inputRef: refType,\n  /**\n   * A text or an element to be used in an enclosing label element.\n   */\n  label: PropTypes.node,\n  /**\n   * The position of the label.\n   * @default 'end'\n   */\n  labelPlacement: PropTypes.oneOf(['bottom', 'end', 'start', 'top']),\n  /**\n   * @ignore\n   */\n  name: PropTypes.string,\n  /**\n   * Callback fired when the state is changed.\n   *\n   * @param {React.SyntheticEvent} event The event source of the callback.\n   * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n   */\n  onChange: PropTypes.func,\n  /**\n   * If `true`, the label will indicate that the `input` is required.\n   */\n  required: PropTypes.bool,\n  /**\n   * The props used for each slot inside.\n   * @default {}\n   */\n  slotProps: PropTypes.shape({\n    typography: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n  }),\n  /**\n   * The components used for each slot inside.\n   * @default {}\n   */\n  slots: PropTypes.shape({\n    typography: PropTypes.elementType\n  }),\n  /**\n   * The system prop that allows defining system overrides as well as additional CSS styles.\n   */\n  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n  /**\n   * The value of the component.\n   */\n  value: PropTypes.any\n} : void 0;\nexport default FormControlLabel;"],"names":["useUtilityClasses","AsteriskComponent","React.forwardRef","_jsx","_jsxs","React.cloneElement"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAMA,mBAAiB,GAAG,UAAU,IAAI;AACxC,EAAE,MAAM;AACR,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,cAAc;AAClB,IAAI,KAAK;AACT,IAAI;AACJ,GAAG,GAAG,UAAU;AAChB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