"use strict";

exports.__esModule = true;
exports.MockedCheckboxList = exports.MockedCheckbox = void 0;
var _react = _interopRequireWildcard(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _ = require(".");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var MasterCheckbox = (0, _styledComponents["default"])(_.Checkbox).withConfig({
  displayName: "checkboxmock__MasterCheckbox",
  componentId: "sc-qsmiq4-0"
})(["margin-bottom:8px;"]);
var StyledCheckbox = (0, _styledComponents["default"])(_.Checkbox).withConfig({
  displayName: "checkboxmock__StyledCheckbox",
  componentId: "sc-qsmiq4-1"
})(["margin-left:10px;margin-bottom:8px;"]);
var CheckboxGroup = _styledComponents["default"].div.withConfig({
  displayName: "checkboxmock__CheckboxGroup",
  componentId: "sc-qsmiq4-2"
})([""]);
var MockedCheckbox = exports.MockedCheckbox = function MockedCheckbox(_ref) {
  var _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled;
  var _useState = (0, _react.useState)(false),
    checked = _useState[0],
    setChecked = _useState[1];
  var handleChange = function handleChange(value) {
    setChecked(value);
  };
  return /*#__PURE__*/_react["default"].createElement(_.Checkbox, {
    onChange: handleChange,
    checked: checked,
    disabled: disabled
  });
};
var MockedCheckboxList = exports.MockedCheckboxList = function MockedCheckboxList() {
  var _useState2 = (0, _react.useState)(false),
    checkedOne = _useState2[0],
    setCheckedOne = _useState2[1];
  var _useState3 = (0, _react.useState)(false),
    checkedTwo = _useState3[0],
    setCheckedTwo = _useState3[1];
  var _useState4 = (0, _react.useState)(false),
    checkedThree = _useState4[0],
    setCheckedThree = _useState4[1];
  var valuesList = [checkedOne, checkedTwo, checkedThree];
  var handlersList = [setCheckedOne, setCheckedTwo, setCheckedThree];
  var _useCheckboxesList = (0, _.useCheckboxesList)(valuesList, handlersList),
    allChecked = _useCheckboxesList[0],
    indeterminate = _useCheckboxesList[1],
    switchAll = _useCheckboxesList[2];
  var handleChange = function handleChange(setter) {
    return function (value) {
      setter(value);
    };
  };
  return /*#__PURE__*/_react["default"].createElement(CheckboxGroup, null, /*#__PURE__*/_react["default"].createElement(MasterCheckbox, {
    label: "The Boss checkbox",
    checked: allChecked,
    onChange: switchAll,
    indeterminate: indeterminate
  }), /*#__PURE__*/_react["default"].createElement(StyledCheckbox, {
    label: "Do you like greek salad?",
    onChange: handleChange(setCheckedTwo),
    checked: checkedTwo
  }), /*#__PURE__*/_react["default"].createElement(StyledCheckbox, {
    label: "Do you like sguschenka?",
    onChange: handleChange(setCheckedOne),
    checked: checkedOne
  }), /*#__PURE__*/_react["default"].createElement(StyledCheckbox, {
    label: "Was this story useful?",
    onChange: handleChange(setCheckedThree),
    checked: checkedThree
  }));
};