(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "styled-components", "polished", "../Pallette/themes", "../utils/theme/getTheme", "../Pallette/style-utils", "../Pallette/Typography", "./theme"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.TextAfter = exports.TextBefore = exports.SwitchComponent = exports.SwitchSliderIndeterminate = exports.SwitchInput = exports.SwitchSlider = exports.SwitchWrapper = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var polished_1 = require("polished");
    var themes_1 = require("../Pallette/themes");
    var getTheme_1 = require("../utils/theme/getTheme");
    var style_utils_1 = require("../Pallette/style-utils");
    var Typography_1 = require("../Pallette/Typography");
    var theme_1 = require("./theme");
    var COMPONENT_NAME = "switch";
    var getColorSwitch = function (options) {
        if (options.isDisabled) {
            return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n      background-color: ", ";\n      color: ", ";\n      pointer-events: none;\n\n      svg {\n        color: ", ";\n      }\n    "], ["\n      background-color: ", ";\n      color: ", ";\n      pointer-events: none;\n\n      svg {\n        color: ", ";\n      }\n    "])), options.theme.components[COMPONENT_NAME]
                .backgroundDisabled, options.theme.components[COMPONENT_NAME].colorDisabled, options.theme.components[COMPONENT_NAME].colorDisabled);
        }
        else if (options.isChecked || options.isIndeterminate) {
            return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n      background-color: ", ";\n      color: ", ";\n      svg {\n        color: ", ";\n      }\n    "], ["\n      background-color: ", ";\n      color: ", ";\n      svg {\n        color: ", ";\n      }\n    "])), options.theme.components[COMPONENT_NAME]
                .backgroundChecked, options.theme.components[COMPONENT_NAME].colorChecked, options.theme.components[COMPONENT_NAME].colorChecked);
        }
        return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n    background-color: ", ";\n    color: ", ";\n    svg {\n      color: ", ";\n    }\n    &:hover {\n      background: ", ";\n      color: ", ";\n\n      svg {\n        color: ", ";\n      }\n    }\n  "], ["\n    background-color: ", ";\n    color: ", ";\n    svg {\n      color: ", ";\n    }\n    &:hover {\n      background: ", ";\n      color: ", ";\n\n      svg {\n        color: ", ";\n      }\n    }\n  "])), options.theme.components[COMPONENT_NAME]
            .backgroundDefault, options.theme.components[COMPONENT_NAME].colorDefault, options.theme.components[COMPONENT_NAME].colorDefault, options.theme.components[COMPONENT_NAME].backgroundHover, options.theme.components[COMPONENT_NAME].colorHover, options.theme.components[COMPONENT_NAME].colorHover);
    };
    exports.SwitchWrapper = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeSwitch,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n  position: relative;\n  display: flex;\n  align-items: center;\n  border-radius: 16px;\n  ", "\n  cursor: pointer;\n  box-sizing: border-box;\n  ", ";\n\n  .beforeSVG {\n    margin-right: 6px;\n  }\n\n  .afterSVG {\n    margin-left: 6px;\n  }\n"], ["\n  position: relative;\n  display: flex;\n  align-items: center;\n  border-radius: 16px;\n  ", "\n  cursor: pointer;\n  box-sizing: border-box;\n  ", ";\n\n  .beforeSVG {\n    margin-right: 6px;\n  }\n\n  .afterSVG {\n    margin-left: 6px;\n  }\n"])), function (_a) {
        var hasTextOrIcon = _a.hasTextOrIcon, iconBefore = _a.iconBefore, iconAfter = _a.iconAfter, isIndeterminate = _a.isIndeterminate;
        if (isIndeterminate) {
            return style_utils_1.Padding.allSide(1.5, 4, 1.5, 4);
        }
        if (hasTextOrIcon && (iconAfter || iconBefore)) {
            return style_utils_1.Padding.allSide(1, 1.5, 1, 1);
        }
        return style_utils_1.Padding.allSide(1);
    }, function (props) { return getColorSwitch(props); });
    exports.SwitchSlider = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeSwitch,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n  object-fit: contain;\n  ", ";\n  display: inline-flex;\n  cursor: pointer;\n  align-items: center;\n  transition: all 0.2s;\n  position: relative;\n  text-align: left;\n\n  &:before {\n    content: \"\";\n    position: relative;\n    display: inline-block;\n    ", ";\n    transition: 0.2s;\n    border-radius: 16px;\n    box-sizing: border-box;\n    background-color: ", ";\n  }\n"], ["\n  object-fit: contain;\n  ", ";\n  display: inline-flex;\n  cursor: pointer;\n  align-items: center;\n  transition: all 0.2s;\n  position: relative;\n  text-align: left;\n\n  &:before {\n    content: \"\";\n    position: relative;\n    display: inline-block;\n    ", ";\n    transition: 0.2s;\n    border-radius: 16px;\n    box-sizing: border-box;\n    background-color: ", ";\n  }\n"])), function (_a) {
        var hasTextOrIcon = _a.hasTextOrIcon;
        return hasTextOrIcon
            ? ""
            : (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n          width: 36px;\n        "], ["\n          width: 36px;\n        "])));
    }, (0, polished_1.size)("16px", "16px"), function (_a) {
        var isDisabled = _a.isDisabled, theme = _a.theme;
        return isDisabled
            ? theme.components[COMPONENT_NAME].backgroundSwitchDisabled
            : theme.components[COMPONENT_NAME].backgroundSwitchDefault;
    });
    exports.SwitchInput = styled_components_1.default.input(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n  display: none;\n  &:checked + ", " {\n    justify-content: flex-end;\n  }\n"], ["\n  display: none;\n  &:checked + ", " {\n    justify-content: flex-end;\n  }\n"])), exports.SwitchSlider);
    exports.SwitchSliderIndeterminate = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeSwitch,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n  object-fit: contain;\n  display: inline-flex;\n  cursor: pointer;\n  align-items: center;\n  transition: all 0.2s;\n  position: relative;\n  border-radius: 16px;\n  ", ";\n  background-color: ", ";\n"], ["\n  object-fit: contain;\n  display: inline-flex;\n  cursor: pointer;\n  align-items: center;\n  transition: all 0.2s;\n  position: relative;\n  border-radius: 16px;\n  ", ";\n  background-color: ", ";\n"])), (0, polished_1.size)("12px", "12px"), function (_a) {
        var isDisabled = _a.isDisabled, theme = _a.theme;
        return isDisabled
            ? theme.components[COMPONENT_NAME].backgroundSwitchDisabled
            : theme.components[COMPONENT_NAME].backgroundSwitchDefault;
    });
    exports.SwitchComponent = styled_components_1.default.div(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n  font-family: ", ";\n  display: flex;\n  align-items: center;\n  user-select: none;\n  width: max-content;\n"], ["\n  font-family: ", ";\n  display: flex;\n  align-items: center;\n  user-select: none;\n  width: max-content;\n"])), Typography_1.Typography.fontFamily);
    exports.TextBefore = styled_components_1.default.div(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n  margin-right: 8px;\n  margin-left: 4px;\n"], ["\n  margin-right: 8px;\n  margin-left: 4px;\n"])));
    exports.TextAfter = styled_components_1.default.div(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n  margin-left: 8px;\n  margin-right: 4px;\n"], ["\n  margin-left: 8px;\n  margin-right: 4px;\n"])));
    exports.SwitchWrapper.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.SwitchSlider.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.SwitchSliderIndeterminate.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
});
