"use strict";

exports.__esModule = true;
exports.ToggleContainer = exports.StyledToggle = exports.StyledLabel = exports.LabelText = exports.HiddenToggleInput = void 0;
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _utils = require("../../theme/utils");
var _mixins = require("../../mixins");
var _margin = _interopRequireDefault(require("../../mixins/margin"));
var _alignSelf = _interopRequireDefault(require("../../mixins/alignSelf"));
var _excluded = ["right"];
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
var ToggleContainer = exports.ToggleContainer = _styledComponents["default"].div.withConfig({
  displayName: "styled__ToggleContainer",
  componentId: "sc-dtjehx-0"
})(["display:block;box-sizing:border-box;width:40px;height:20px;"]);
var HiddenToggleInput = exports.HiddenToggleInput = _styledComponents["default"].input.attrs({
  type: "checkbox"
}).withConfig({
  displayName: "styled__HiddenToggleInput",
  componentId: "sc-dtjehx-1"
})(["display:none;"]);
var StyledToggle = exports.StyledToggle = _styledComponents["default"].div.withConfig({
  displayName: "styled__StyledToggle",
  componentId: "sc-dtjehx-2"
})(["box-sizing:border-box;width:40px;height:20px;background:", ";border:1px solid ", ";border-radius:100px;transition:", ";display:block;position:relative;-webkit-tap-highlight-color:transparent;flex-shrink:0;align-self:flex-start;cursor:pointer;pointer-events:", ";&:after{display:block;position:absolute;content:\"\";width:16px;height:16px;border-radius:50%;left:5%;top:50%;transform:translateY(-50%);transition:", ";opacity:", ";background-color:", ";}", " ", ":focus + &{", "}"], function (props) {
  return props.disabled ? (0, _utils.getColor)("mainBackgroundDisabled") : (0, _utils.getColor)("mainBackground");
}, (0, _utils.getColor)("border"), function (_ref) {
  var withTransition = _ref.withTransition;
  return withTransition ? "all 150ms" : "unset";
}, function (_ref2) {
  var disabled = _ref2.disabled;
  return disabled ? "none" : "auto";
}, function (_ref3) {
  var withTransition = _ref3.withTransition;
  return withTransition ? "left 0.2s ease" : "unset";
}, function (_ref4) {
  var disabled = _ref4.disabled;
  return disabled ? "0.4" : "1";
}, function (_ref5) {
  var colored = _ref5.colored,
    checked = _ref5.checked,
    checkedColor = _ref5.checkedColor,
    uncheckedColor = _ref5.uncheckedColor,
    defaultColor = _ref5.defaultColor;
  if (!colored) return (0, _utils.getColor)(defaultColor || "controlFocused");
  return checked ? (0, _utils.getColor)(checkedColor || "primary") : (0, _utils.getColor)(uncheckedColor || "error");
}, function (_ref6) {
  var checked = _ref6.checked;
  return checked && "\n    &:after {\n      left: 55%;\n    }\n  ";
}, HiddenToggleInput, _mixins.controlFocused);
var StyledLabel = exports.StyledLabel = _styledComponents["default"].label.withConfig({
  displayName: "styled__StyledLabel",
  componentId: "sc-dtjehx-3"
})(["", " ", " position:relative;cursor:pointer;display:flex;flex-flow:row nowrap;align-items:center;"], _margin["default"], _alignSelf["default"]);
var LabelText = exports.LabelText = _styledComponents["default"].span.withConfig({
  displayName: "styled__LabelText",
  componentId: "sc-dtjehx-4"
})(["", ""], function (_ref7) {
  var right = _ref7.right,
    props = _objectWithoutPropertiesLoose(_ref7, _excluded);
  return right ? "margin-left: " + (0, _utils.getSizeUnit)(props) + "px;" : "margin-right: " + (0, _utils.getSizeUnit)(props) + "px;";
});