var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
define(["require", "exports", "react", "../../Utilities", "./ProgressIndicator.scss"], function (require, exports, React, Utilities_1, styles) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    // if the percentComplete is near 0, don't animate it.
    // This prevents animations on reset to 0 scenarios
    var ZERO_THRESHOLD = 0.01;
    var ProgressIndicator = (function (_super) {
        __extends(ProgressIndicator, _super);
        function ProgressIndicator(props) {
            var _this = _super.call(this, props) || this;
            _this._warnDeprecations({
                title: 'label'
            });
            return _this;
        }
        ProgressIndicator.prototype.render = function () {
            var _a = this.props, title = _a.title, label = _a.label, description = _a.description, percentComplete = _a.percentComplete, className = _a.className, ariaValueText = _a.ariaValueText;
            // Handle deprecated value.
            if (title) {
                label = title;
            }
            percentComplete = Math.min(100, Math.max(0, percentComplete * 100));
            return (React.createElement("div", { className: Utilities_1.css('ms-ProgressIndicator', styles.root, className) },
                React.createElement("div", { className: Utilities_1.css('ms-ProgressIndicator-itemName', styles.itemName) }, label),
                React.createElement("div", { className: Utilities_1.css('ms-ProgressIndicator-itemProgress', styles.itemProgress) },
                    React.createElement("div", { className: Utilities_1.css('ms-ProgressIndicator-progressTrack', styles.progressTrack) }),
                    React.createElement("div", { className: Utilities_1.css('ms-ProgressIndicator-progressBar', styles.progressBar, {
                            'smoothTransition': percentComplete > ZERO_THRESHOLD
                        }), style: { width: percentComplete + '%' }, role: 'progressbar', "aria-valuemin": '0', "aria-valuemax": '100', "aria-valuenow": percentComplete.toFixed().toString(), "aria-valuetext": ariaValueText })),
                React.createElement("div", { className: Utilities_1.css('ms-ProgressIndicator-itemDescription', styles.itemDescription) }, description)));
        };
        return ProgressIndicator;
    }(Utilities_1.BaseComponent));
    ProgressIndicator.defaultProps = {
        label: '',
        description: '',
        percentComplete: 0,
        width: 180
    };
    exports.ProgressIndicator = ProgressIndicator;
});

//# sourceMappingURL=ProgressIndicator.js.map
