"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.componentDecorator = exports.matchDecorator = void 0;
var React = require("react");
var LinkifyIt = require("linkify-it");
require("./NormalMessagingBubble.less");
require("./linkifyUtils.less");
// Customized to not link URLs/emails without protocol (i.e. google.com or dewey@clever.com)
// Based on https://github.com/tasti/react-linkify/blob/master/src/decorators/defaultMatchDecorator.js
var linkify = new LinkifyIt({ fuzzyLink: false, fuzzyEmail: false });
exports.matchDecorator = function (text) {
    return linkify.match(text);
};
// Customized to open links in new tabs
// Based on https://github.com/tasti/react-linkify/blob/master/src/decorators/defaultComponentDecorator.jsx
exports.componentDecorator = function (decoratedHref, decoratedText, key) {
    return (React.createElement("a", { className: "LinkifyUtils--Link", href: decoratedHref, key: key, rel: "noopener noreferrer", target: "_blank" }, decoratedText));
};
