import * as React from "react";
import * as LinkifyIt from "linkify-it";
import "./NormalMessagingBubble.less";
import "./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 });
export var 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
export var componentDecorator = function (decoratedHref, decoratedText, key) {
    return (React.createElement("a", { className: "LinkifyUtils--Link", href: decoratedHref, key: key, rel: "noopener noreferrer", target: "_blank" }, decoratedText));
};
