"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = LexicalAutoLinkPlugin;
const tslib_1 = require("tslib");
const LexicalAutoLinkPlugin_1 = require("@lexical/react/LexicalAutoLinkPlugin");
const React = tslib_1.__importStar(require("react"));
const constants_1 = require("../../../../utils/constants");
const URL_REGEX = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
const MATCHERS = [
    (0, LexicalAutoLinkPlugin_1.createLinkMatcherWithRegExp)(URL_REGEX, (text) => (text.startsWith('http') ? text : `https://${text}`)),
    (0, LexicalAutoLinkPlugin_1.createLinkMatcherWithRegExp)(constants_1.EMAIL_REGEX, (text) => `mailto:${text}`),
];
function LexicalAutoLinkPlugin() {
    return React.createElement(LexicalAutoLinkPlugin_1.AutoLinkPlugin, { matchers: MATCHERS });
}
//# sourceMappingURL=index.js.map