"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var regexp_1 = require("../../utils/regexp");
var CommonListHighlight_1 = require("./common/CommonListHighlight");
// CommonListHighlight
var PureListHighlight = /** @class */ (function (_super) {
    __extends(PureListHighlight, _super);
    function PureListHighlight() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    PureListHighlight.prototype.getTextHighlightPattern = function () {
        var _a = this.props, textHighlightPattern = _a.textHighlightPattern, highlightedText = _a.highlightedText;
        return textHighlightPattern || regexp_1.getHighlightRegExp(highlightedText);
    };
    PureListHighlight.prototype.getTextFilterPattern = function () {
        var _a = this.props, textFilterPattern = _a.textFilterPattern, highlightedText = _a.highlightedText;
        return textFilterPattern || regexp_1.searchStringToRegExp(highlightedText);
    };
    PureListHighlight.prototype.render = function () {
        return (react_1.default.createElement(CommonListHighlight_1.CommonListHighlight, __assign({}, this.props, { textHighlightPattern: this.getTextHighlightPattern(), textFilterPattern: this.getTextFilterPattern() })));
    };
    PureListHighlight.propTypes = __assign({}, CommonListHighlight_1.CommonListHighlight.propTypes, { highlightedText: prop_types_1.default.string });
    PureListHighlight.defaultProps = __assign({}, CommonListHighlight_1.CommonListHighlight.defaultProps, { highlightedText: '' });
    PureListHighlight.HIGHLIGHT_TYPE_BACKGROUND = CommonListHighlight_1.CommonListHighlight.HIGHLIGHT_TYPE_BACKGROUND;
    PureListHighlight.HIGHLIGHT_TYPE_BOLD = CommonListHighlight_1.CommonListHighlight.HIGHLIGHT_TYPE_BOLD;
    return PureListHighlight;
}(react_1.default.Component));
exports.PureListHighlight = PureListHighlight;
//# sourceMappingURL=PureListHighlight.js.map