(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", "../utils/theme/getTheme", "../typography", "../Pallette/Shape", "../Pallette/themes", "./theme"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.Bracket = exports.ControlItem = exports.SegmentedControlBase = exports.SegmentedControlWrapper = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var getTheme_1 = require("../utils/theme/getTheme");
    var typography_1 = require("../typography");
    var Shape_1 = require("../Pallette/Shape");
    var themes_1 = require("../Pallette/themes");
    var theme_1 = require("./theme");
    var COMPONENT_NAME = "segmentedControl";
    exports.SegmentedControlWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  width: 100%;\n"], ["\n  display: flex;\n  width: 100%;\n"])));
    exports.SegmentedControlBase = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeSegmentedControl,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n  width: 100%;\n  z-index: 0;\n  padding: 8px;\n  display: flex;\n  position: relative;\n  vertical-align: middle;\n  background-color: ", ";\n  ", "\n"], ["\n  width: 100%;\n  z-index: 0;\n  padding: 8px;\n  display: flex;\n  position: relative;\n  vertical-align: middle;\n  background-color: ", ";\n  ", "\n"])), function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].backgroundDefault;
    }, function (_a) {
        var size = _a.size;
        switch (size) {
            case "l":
                return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n          height: 72px;\n          border-radius: 16px;\n          ", " {\n            border-radius: 16px;\n            height: 56px;\n          }\n        "], ["\n          height: 72px;\n          border-radius: 16px;\n          ", " {\n            border-radius: 16px;\n            height: 56px;\n          }\n        "])), exports.Bracket);
            case "m":
                return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n          height: 64px;\n          border-radius: 16px;\n          ", " {\n            border-radius: 16px;\n            height: 48px;\n          }\n        "], ["\n          height: 64px;\n          border-radius: 16px;\n          ", " {\n            border-radius: 16px;\n            height: 48px;\n          }\n        "])), exports.Bracket);
            case "s":
                return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n          height: 48px;\n          border-radius: 8px;\n          ", " {\n            border-radius: 8px;\n            height: 32px;\n          }\n        "], ["\n          height: 48px;\n          border-radius: 8px;\n          ", " {\n            border-radius: 8px;\n            height: 32px;\n          }\n        "])), exports.Bracket);
            case "xs":
                return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n          height: 40px;\n          border-radius: 8px;\n          ", " {\n            border-radius: 8px;\n            height: 24px;\n          }\n        "], ["\n          height: 40px;\n          border-radius: 8px;\n          ", " {\n            border-radius: 8px;\n            height: 24px;\n          }\n        "])), exports.Bracket);
        }
        return "";
    });
    exports.ControlItem = (0, styled_components_1.default)(typography_1.P1).attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeSegmentedControl,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n  height: 100%;\n  cursor: pointer;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  font-size: 16px;\n  gap: 12px;\n  line-height: 24px;\n  padding: 4px 8px;\n  min-width: 90px;\n  width: 100%;\n  vertical-align: middle;\n  background-color: transparent;\n  border-radius: ", ";\n  ", ";\n  z-index: 2;\n  & > svg {\n    color: currentColor;\n  }\n"], ["\n  height: 100%;\n  cursor: pointer;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  font-size: 16px;\n  gap: 12px;\n  line-height: 24px;\n  padding: 4px 8px;\n  min-width: 90px;\n  width: 100%;\n  vertical-align: middle;\n  background-color: transparent;\n  border-radius: ", ";\n  ", ";\n  z-index: 2;\n  & > svg {\n    color: currentColor;\n  }\n"])), Shape_1.Shape.borderRadiusMedium, function (_a) {
        var theme = _a.theme, isPressed = _a.isPressed, isDisabled = _a.isDisabled;
        if (isDisabled) {
            return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n        color: ", ";\n        cursor: not-allowed;\n      "], ["\n        color: ", ";\n        cursor: not-allowed;\n      "])), theme.components[COMPONENT_NAME].colorDisabled);
        }
        else if (isPressed) {
            return (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n        color: ", ";\n      "], ["\n        color: ", ";\n      "])), theme.components[COMPONENT_NAME].colorPressed);
        }
        return (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n      color: ", ";\n      :hover {\n        background: ", ";\n        color: ", ";\n      }\n    "], ["\n      color: ", ";\n      :hover {\n        background: ", ";\n        color: ", ";\n      }\n    "])), theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].backgroundHover, theme.components[COMPONENT_NAME].colorHover);
    });
    exports.Bracket = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            defaultTheme: theme_1.defaultThemeSegmentedControl,
            componentName: COMPONENT_NAME
        })
    }); })(templateObject_12 || (templateObject_12 = (0, tslib_1.__makeTemplateObject)(["\n  z-index: 1;\n  position: absolute;\n  transition: left 0.3s;\n  background-color: ", ";\n  ", "\n"], ["\n  z-index: 1;\n  position: absolute;\n  transition: left 0.3s;\n  background-color: ", ";\n  ", "\n"])), function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].backgroundPressed;
    }, function (_a) {
        var bracketPosition = _a.bracketPosition;
        return (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n    left: ", "px;\n    width: ", "px;\n  "], ["\n    left: ", "px;\n    width: ", "px;\n  "])), bracketPosition.left, bracketPosition.width);
    });
    exports.SegmentedControlBase.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.ControlItem.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.Bracket.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, templateObject_12;
});
