(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", "react", "../typography/P1", "../Label", "./helpers", "./style"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = require("tslib");
    var react_1 = (0, tslib_1.__importDefault)(require("react"));
    var P1_1 = (0, tslib_1.__importDefault)(require("../typography/P1"));
    var Label_1 = (0, tslib_1.__importDefault)(require("../Label"));
    var helpers_1 = require("./helpers");
    var style_1 = require("./style");
    var ProgressBar = function (_a) {
        var progress = _a.progress, variant = _a.variant, _b = _a.type, type = _b === void 0 ? "Linear" : _b, _c = _a.size, size = _c === void 0 ? "s" : _c, label = _a.label, isText = _a.isText, props = (0, tslib_1.__rest)(_a, ["progress", "variant", "type", "size", "label", "isText"]);
        return (react_1.default.createElement(style_1.ProgressBarBase, (0, tslib_1.__assign)({ variant: variant }, props),
            react_1.default.createElement(style_1.ProgressBarStyle, { className: "progressbar", size: size },
                react_1.default.createElement("div", { className: "background" },
                    react_1.default.createElement(style_1.Filler, { className: "filler", progress: (0, helpers_1.getProgress)({
                            type: type,
                            progress: progress,
                            step: 1,
                            current_progress: 0
                        }) })),
                size === "m" && isText && (react_1.default.createElement(P1_1.default, { className: "progress-text", type: "cygnus" },
                    progress,
                    "%"))),
            label && (react_1.default.createElement(Label_1.default, { status: variant === "info" ? "focused" : variant, isIcon: size === "s" }, label))));
    };
    exports.default = ProgressBar;
});
