define(["require", "exports", "tslib", "react", "../../Utilities", "../../Tooltip", "./PersonaCoin", "./Persona.types"], function (require, exports, tslib_1, React, Utilities_1, Tooltip_1, PersonaCoin_1, Persona_types_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var getClassNames = Utilities_1.classNamesFunction();
    /**
     * Persona with no default styles.
     * [Use the `getStyles` API to add your own styles.](https://github.com/OfficeDev/office-ui-fabric-react/wiki/Styling)
     */
    var PersonaBase = /** @class */ (function (_super) {
        tslib_1.__extends(PersonaBase, _super);
        function PersonaBase(props) {
            var _this = _super.call(this, props) || this;
            _this._renderElement = function (text, className, render) {
                return (React.createElement("div", { className: className }, render
                    ? render(_this.props)
                    : text && (React.createElement(Tooltip_1.TooltipHost, { content: text, overflowMode: Tooltip_1.TooltipOverflowMode.Parent, directionalHint: 0 /* topLeftEdge */ }, text))));
            };
            return _this;
        }
        PersonaBase.prototype.render = function () {
            var _a = this.props, hidePersonaDetails = _a.hidePersonaDetails, onRenderOptionalText = _a.onRenderOptionalText, onRenderPrimaryText = _a.onRenderPrimaryText, onRenderSecondaryText = _a.onRenderSecondaryText, onRenderTertiaryText = _a.onRenderTertiaryText;
            var size = this.props.size;
            // These properties are to be explicitly passed into PersonaCoin because they are the only props directly used
            var _b = this.props, allowPhoneInitials = _b.allowPhoneInitials, className = _b.className, coinProps = _b.coinProps, coinSize = _b.coinSize, getStyles = _b.getStyles, imageAlt = _b.imageAlt, imageInitials = _b.imageInitials, imageShouldFadeIn = _b.imageShouldFadeIn, imageShouldStartVisible = _b.imageShouldStartVisible, imageUrl = _b.imageUrl, initialsColor = _b.initialsColor, onPhotoLoadingStateChange = _b.onPhotoLoadingStateChange, onRenderCoin = _b.onRenderCoin, presence = _b.presence, primaryText = _b.primaryText, showSecondaryText = _b.showSecondaryText, theme = _b.theme;
            var personaCoinProps = {
                allowPhoneInitials: allowPhoneInitials,
                coinProps: coinProps,
                coinSize: coinSize,
                imageAlt: imageAlt,
                imageInitials: imageInitials,
                imageShouldFadeIn: imageShouldFadeIn,
                imageShouldStartVisible: imageShouldStartVisible,
                imageUrl: imageUrl,
                initialsColor: initialsColor,
                onPhotoLoadingStateChange: onPhotoLoadingStateChange,
                onRenderCoin: onRenderCoin,
                presence: presence,
                primaryText: primaryText,
                size: size,
            };
            var classNames = getClassNames(getStyles, {
                theme: theme,
                className: className,
                showSecondaryText: showSecondaryText,
                presence: presence,
                size: size,
            });
            var divProps = Utilities_1.getNativeProps(this.props, Utilities_1.divProperties);
            var personaDetails = (React.createElement("div", { className: classNames.details },
                this._renderElement(this.props.primaryText, classNames.primaryText, onRenderPrimaryText),
                this._renderElement(this.props.secondaryText, classNames.secondaryText, onRenderSecondaryText),
                this._renderElement(this.props.tertiaryText, classNames.tertiaryText, onRenderTertiaryText),
                this._renderElement(this.props.optionalText, classNames.optionalText, onRenderOptionalText),
                this.props.children));
            return (React.createElement("div", tslib_1.__assign({}, divProps, { className: classNames.root, style: coinSize ? { height: coinSize, minWidth: coinSize } : undefined }),
                React.createElement(PersonaCoin_1.PersonaCoin, tslib_1.__assign({}, personaCoinProps)),
                (!hidePersonaDetails || (size === Persona_types_1.PersonaSize.size10 || size === Persona_types_1.PersonaSize.tiny)) && personaDetails));
        };
        PersonaBase.defaultProps = {
            primaryText: '',
            size: Persona_types_1.PersonaSize.size48,
            presence: Persona_types_1.PersonaPresence.none,
            imageAlt: ''
        };
        PersonaBase = tslib_1.__decorate([
            Utilities_1.customizable('Persona', ['theme'])
        ], PersonaBase);
        return PersonaBase;
    }(Utilities_1.BaseComponent));
    exports.PersonaBase = PersonaBase;
});
//# sourceMappingURL=Persona.base.js.map