'use strict';

var ramda = require('ramda');

var EDITOR_OPTIONS = {
  // DEFAULT EDITOR OPTIONS
  BOLD: "bold",
  ITALIC: "italic",
  UNDERLINE: "underline",
  STRIKETHROUGH: "strike",
  LINK: "link",
  PARAGRAPH: "paragraph",
  H1: "h1",
  H2: "h2",
  H3: "h3",
  H4: "h4",
  H5: "h5",
  H6: "h6",
  LIST_BULLETS: "bullet-list",
  LIST_ORDERED: "ordered-list",
  CODE: "code",
  // ADDON EDITOR OPTIONS
  CODE_BLOCK: "code-block",
  BLOCKQUOTE: "block-quote",
  CALLOUT: "callout",
  ATTACHMENTS: "attachments",
  TODO_LIST: "todo-list",
  UNDO: "undo",
  REDO: "redo",
  HIGHLIGHT: "highlight",
  EMOJI: "emoji",
  IMAGE_UPLOAD: "image-upload",
  IMAGE_UPLOAD_UNSPLASH: "image-upload-unsplash",
  VIDEO_UPLOAD: "video-upload",
  DIVIDER: "divider",
  PASTE_UNFORMATTED: "paste-unformatted",
  TABLE: "table",
  TEXT_COLOR: "text-color"
};
var DIRECT_UPLOAD_ENDPOINT = "/api/direct_uploads";
var URL_REGEXP = /[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;

// HTTP/HTTPS/FTP with :// or Non-slash protocols like mailto:, tel: or Domain without protocol
var ALL_PROTOCOL_URL_REGEXP = /^[a-zA-Z]\w*:\/\/[a-zA-Z0-9@:%._+~#=-]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)|^[a-zA-Z]\w*:[^//][a-zA-Z0-9@:%._+~#=?&-]*|^[a-zA-Z0-9@:%._+~#=-]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/i;
var YOUTUBE_URL_REGEXP = /^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S*?)(\?[^#]*)?$/;
var VIMEO_URL_REGEXP = /((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)(\?[^#]*)?/;
var LOOM_URL_REGEXP = /((?:http|https):\/\/)?(www\.)?loom\.com\/(share|embed)\/([a-f0-9]{32})(?:\?sid=([a-f0-9-]{36}))?(?:\?t=(\d+))?(\?[^#]*)?/;
var NEETO_RECORD_URL_REGEXP = /((?:http|https):\/\/)?(www\.)?[a-zA-Z0-9-]+\.(neetorecord\.com)\/(watch)\/([0-9a-f]{20})/;
var SUPA_DEMO_URL_REGEXP = /((?:http|https):\/\/)?(www\.)?([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)\/(demo|embed)\/([0-9a-z]+)/;
var COMBINED_REGEX = new RegExp(ramda.pluck("source", [YOUTUBE_URL_REGEXP, VIMEO_URL_REGEXP, LOOM_URL_REGEXP, NEETO_RECORD_URL_REGEXP, SUPA_DEMO_URL_REGEXP]).join("|"), "g");
var URL_VALIDATORS = {
  youtube: function youtube(url) {
    var match = url.match(YOUTUBE_URL_REGEXP);
    return match && "https://www.youtube.com/embed/".concat(match[5]);
  },
  vimeo: function vimeo(url) {
    var match = url.match(VIMEO_URL_REGEXP);
    return match && "https://player.vimeo.com/video/".concat(match[4], "?h=").concat(match[5]);
  },
  loom: function loom(url) {
    var match = url.match(LOOM_URL_REGEXP);
    return match && "https://www.loom.com/embed/".concat(match[4], "?t=").concat(match[5] || "");
  },
  neetoRecord: function neetoRecord(url) {
    var match = url.match(NEETO_RECORD_URL_REGEXP);
    return match && url.replace("watch", "embeds");
  },
  supademo: function supademo(url) {
    var match = url.match(SUPA_DEMO_URL_REGEXP);
    return match && "https://".concat(match[3], ".").concat(match[4], "/embed/").concat(match[6], "?embed_v=2");
  }
};
var EDITOR_SIZES = {
  MEDIUM: "medium",
  LARGE: "large",
  SMALL: "small"
};

exports.ALL_PROTOCOL_URL_REGEXP = ALL_PROTOCOL_URL_REGEXP;
exports.COMBINED_REGEX = COMBINED_REGEX;
exports.DIRECT_UPLOAD_ENDPOINT = DIRECT_UPLOAD_ENDPOINT;
exports.EDITOR_OPTIONS = EDITOR_OPTIONS;
exports.EDITOR_SIZES = EDITOR_SIZES;
exports.URL_REGEXP = URL_REGEXP;
exports.URL_VALIDATORS = URL_VALIDATORS;
//# sourceMappingURL=chunk-BIWaAH5n.cjs.js.map
