define(["require", "exports", "tslib", "react", "../../Utilities", "../../Icon", "./Persona.types", "./Persona.scss"], function (require, exports, tslib_1, React, Utilities_1, Icon_1, Persona_types_1, stylesImport) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var styles = stylesImport;
    var coinSizeFontScaleFactor = 6;
    var coinSizePresenceScaleFactor = 3;
    var presenceMaxSize = 40;
    var presenceFontMaxSize = 20;
    var PersonaPresence = /** @class */ (function (_super) {
        tslib_1.__extends(PersonaPresence, _super);
        function PersonaPresence(props) {
            var _this = _super.call(this, props) || this;
            _this._determineIcon = function () {
                var presence = _this.props.presence;
                if (presence !== Persona_types_1.PersonaPresence.none) {
                    var userPresence = Persona_types_1.PersonaPresence[presence];
                    switch (userPresence) {
                        case 'online':
                            userPresence = 'SkypeCheck';
                            break;
                        case 'away':
                            userPresence = 'SkypeClock';
                            break;
                        case 'dnd':
                            userPresence = 'SkypeMinus';
                            break;
                        default:
                            userPresence = '';
                    }
                    return userPresence;
                }
            };
            return _this;
        }
        PersonaPresence.prototype.render = function () {
            var _a = this.props, presence = _a.presence, coinSize = _a.coinSize;
            var presenceHeightWidth = coinSize && (coinSize / coinSizePresenceScaleFactor < presenceMaxSize ? coinSize / coinSizePresenceScaleFactor : presenceMaxSize);
            var presenceFontSize = coinSize && (coinSize / coinSizeFontScaleFactor < presenceFontMaxSize ? coinSize / coinSizeFontScaleFactor : presenceFontMaxSize);
            var coinSizeWithPresenceIconStyle = coinSize ? { fontSize: presenceFontSize, lineHeight: presenceHeightWidth + 'px' } : undefined;
            var coinSizeWithPresenceStyle = coinSize ? { width: presenceHeightWidth, height: presenceHeightWidth } : undefined;
            if (presence === Persona_types_1.PersonaPresence.none) {
                return null;
            }
            return (React.createElement("div", { className: Utilities_1.css('ms-Persona-presence', styles.presence), style: coinSizeWithPresenceStyle },
                React.createElement(Icon_1.Icon, { className: Utilities_1.css('ms-Persona-presenceIcon', styles.presenceIcon), iconName: this._determineIcon(), style: coinSizeWithPresenceIconStyle })));
        };
        return PersonaPresence;
    }(React.Component));
    exports.PersonaPresence = PersonaPresence;
});
//# sourceMappingURL=PersonaPresence.js.map