import { NodeViewWrapper as _, nodeViewProps as y, VueRenderer as w, VueNodeViewRenderer as v, EditorContent as H, BubbleMenu as j, Editor as F } from "../../node_modules/@tiptap/vue-2.js";
import { Node as N, mergeAttributes as m, InputRule as K, nodePasteRule as E, getMarksBetween as q, combineTransactionSteps as U, getChangedRanges as W, findChildrenInRange as V, Mark as z, nodeInputRule as X, Extension as J } from "@tiptap/core";
import Y from "@tiptap/extension-blockquote";
import G from "@tiptap/extension-code-block";
import Q from "@tiptap/extension-code";
import Z from "@tiptap/extension-document";
import B from "@tiptap/extension-paragraph";
import ee from "@tiptap/extension-placeholder";
import te from "@tiptap/extension-hard-break";
import ne from "@tiptap/extension-bold";
import re from "@tiptap/extension-bullet-list";
import se from "@tiptap/extension-italic";
import ie from "@tiptap/extension-link";
import oe from "@tiptap/extension-list-item";
import ae from "@tiptap/extension-ordered-list";
import le from "@tiptap/extension-strike";
import ce from "@tiptap/extension-underline";
import de from "@tiptap/extension-text";
import ue from "@tiptap/extension-text-align";
import me from "@tiptap/extension-history";
import he from "@tiptap/extension-text-style";
import fe from "@tiptap/extension-color";
import pe from "@tiptap/extension-font-family";
import { PluginKey as f, Plugin as ge } from "@tiptap/pm/state";
import _e from "@tiptap/suggestion";
import { emojiPattern as O } from "regex-combined-emojis";
import { n as c } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
import P from "../emoji/emoji.js";
import { stringToUnicode as ye, codeToEmojiData as L, emojiRegex as we, emojiShortCodeRegex as ve } from "../../common/emoji/index.js";
import { emojisIndexed as xe } from "@dialpad/dialtone-emojis";
import be from "../list-item/list-item.js";
import x from "../stack/stack.js";
import b from "tippy.js";
import { linkRegex as ke, getPhoneNumberRegex as Ce, warnIfUnmounted as Te } from "../../common/utils/index.js";
import Ee from "@tiptap/extension-image";
import R from "@tiptap/extension-mention";
import D from "../link/link.js";
import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Se, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Le, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as $ } from "./rich-text-editor-constants.js";
import Re from "../avatar/avatar.js";
import $e from "@dialpad/dialtone-icons/vue2/hash";
import Ie from "@dialpad/dialtone-icons/vue2/lock";
import Ae from "deep-equal";
import { DialtoneLocalization as Be } from "../../localization/index.js";
import Oe from "../button/button.js";
const Pe = {
  name: "EmojiComponent",
  components: {
    NodeViewWrapper: _,
    DtEmoji: P
  },
  props: y
};
var De = function() {
  var t = this, n = t._self._c;
  return n("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [n("dt-emoji", { attrs: { size: "500", code: t.node.attrs.code } })], 1);
}, Me = [], He = /* @__PURE__ */ c(
  Pe,
  De,
  Me
);
const je = He.exports, Fe = {
  name: "SuggestionList",
  components: {
    DtListItem: be
  },
  props: {
    items: {
      type: Array,
      required: !0
    },
    command: {
      type: Function,
      required: !0
    },
    itemComponent: {
      type: Object,
      required: !0
    },
    itemType: {
      type: String,
      required: !0
    }
  },
  data() {
    return {
      selectedIndex: 0
    };
  },
  watch: {
    items() {
      this.selectedIndex = 0;
    }
  },
  methods: {
    onKeyDown({ event: e }) {
      return e.key === "ArrowUp" ? (this.upHandler(), !0) : e.key === "ArrowDown" ? (this.downHandler(), !0) : e.key === "Enter" || e.key === "Tab" ? (this.selectHandler(), !0) : !1;
    },
    upHandler() {
      this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length, this.scrollActiveElementIntoView();
    },
    downHandler() {
      this.selectedIndex = (this.selectedIndex + 1) % this.items.length, this.scrollActiveElementIntoView();
    },
    async scrollActiveElementIntoView() {
      await this.$nextTick();
      const e = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
      e && e.scrollIntoView({
        behaviour: "smooth",
        block: "center"
      });
    },
    selectHandler() {
      this.selectItem(this.selectedIndex);
    },
    selectItem(e) {
      const t = this.items[e];
      switch (this.itemType) {
        case "emoji":
          this.command(t);
          return;
        case "mention":
          this.command({ name: t.name, id: t.id, avatarSrc: t.avatarSrc });
          break;
        case "channel":
          this.command({ name: t.name, id: t.id });
          break;
        case "slash-command":
          this.command({ command: t.command });
          break;
      }
    }
  }
};
var Ne = function() {
  var t = this, n = t._self._c;
  return n("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [n("ul", { directives: [{ name: "show", rawName: "v-show", value: t.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "d-suggestion-list" }, t._l(t.items, function(r, s) {
    return n("dt-list-item", { key: r.id, class: [
      "d-suggestion-list__item",
      { "d-list-item--highlighted": s === t.selectedIndex }
    ], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(o) {
      return t.selectItem(s);
    }, keydown: function(o) {
      return o.preventDefault(), t.onKeyDown.apply(null, arguments);
    } } }, [n(t.itemComponent, { tag: "component", attrs: { item: r } })], 1);
  }), 1)]);
}, Ke = [], qe = /* @__PURE__ */ c(
  Fe,
  Ne,
  Ke
);
const k = qe.exports, Ue = {
  name: "EmojiSuggestion",
  components: {
    DtEmoji: P,
    DtStack: x
  },
  props: {
    item: {
      type: Object,
      required: !0
    }
  }
};
var We = function() {
  var t = this, n = t._self._c;
  return n("dt-stack", { attrs: { direction: "row", gap: "400" } }, [n("dt-emoji", { attrs: { size: "200", code: t.item.code } }), t._v(" " + t._s(t.item.code) + " ")], 1);
}, Ve = [], ze = /* @__PURE__ */ c(
  Ue,
  We,
  Ve
);
const Xe = ze.exports, C = {
  name: "hideOnEsc",
  defaultValue: !0,
  fn({ hide: e }) {
    function t(n) {
      n.keyCode === 27 && e();
    }
    return {
      onShow() {
        document.addEventListener("keydown", t);
      },
      onHide() {
        document.removeEventListener("keydown", t);
      }
    };
  }
}, Je = 20, Ye = {
  items: ({ query: e }) => {
    if (e.length < 2)
      return [];
    const t = Object.values(xe);
    return e = e.toLowerCase(), t.filter(
      (r) => [
        r.name,
        r.shortname.replaceAll(":", ""),
        ...r.keywords
      ].some((s) => s.startsWith(e))
    ).splice(0, Je).map((r) => ({ code: r.shortname }));
  },
  command: ({ editor: e, range: t, props: n }) => {
    var o, i;
    const r = e.view.state.selection.$to.nodeAfter;
    ((o = r == null ? void 0 : r.text) == null ? void 0 : o.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
      {
        type: "emoji",
        attrs: n
      }
    ]).run(), (i = window.getSelection()) == null || i.collapseToEnd();
  },
  render: () => {
    let e, t, n = !1;
    return {
      onStart: (r) => {
        e = new w(k, {
          parent: void 0,
          propsData: {
            itemComponent: Xe,
            itemType: "emoji",
            ...r
          },
          editor: r.editor
        }), r.clientRect && (t = b("body", {
          getReferenceClientRect: r.clientRect,
          appendTo: () => document.body,
          content: e.element,
          showOnCreate: !1,
          onShow: () => {
            n = !0;
          },
          onHidden: () => {
            n = !1;
          },
          interactive: !0,
          trigger: "manual",
          placement: "top-start",
          zIndex: 650,
          plugins: [C]
        }), r.items.length > 0 && (t == null || t[0].show()));
      },
      onUpdate(r) {
        e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), t == null || t[0].setProps({
          getReferenceClientRect: r.clientRect
        });
      },
      onKeyDown(r) {
        var s;
        if (n)
          return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
      },
      onExit() {
        t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
      }
    };
  }
}, Ge = /(:\w+:)$/, Qe = new RegExp(O + "$"), Ze = (e) => {
  if (e && L(e[0]))
    return { text: e[2] || e[0] };
}, et = (e) => [...e.matchAll(ve)].filter((n) => L(n[0])).map((n) => ({
  index: n.index,
  text: n[0],
  match: n
})), tt = N.create({
  name: "emoji",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  group: "inline",
  inline: !0,
  selectable: !1,
  atom: !0,
  addNodeView() {
    return v(je);
  },
  addAttributes() {
    return {
      code: {
        default: null
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "emoji-component"
      }
    ];
  },
  renderText({ node: e }) {
    return ye(L(e.attrs.code).unicode_output);
  },
  renderHTML({ HTMLAttributes: e }) {
    return ["emoji-component", m(this.options.HTMLAttributes, e)];
  },
  addInputRules() {
    return [
      new K({
        find: (e) => {
          const t = e.match(Ge) || e.match(Qe);
          if (t)
            return Ze(t);
        },
        handler: ({ state: e, range: t, match: n, commands: r, chain: s, can: o }) => {
          const { tr: i } = e, a = t.from, l = t.to;
          i.replaceWith(a, l, this.type.create({ code: n[0] }));
        }
      })
    ];
  },
  addPasteRules() {
    return [
      E({
        find: et,
        type: this.type,
        getAttributes(e) {
          return {
            code: e[0]
          };
        }
      }),
      E({
        find: we,
        type: this.type,
        getAttributes(e) {
          return {
            code: e[0]
          };
        }
      })
    ];
  },
  addProseMirrorPlugins() {
    return [
      _e({
        char: ":",
        pluginKey: new f("emoji"),
        editor: this.editor,
        ...this.options.suggestion,
        ...Ye
      })
    ];
  },
  addKeyboardShortcuts() {
    return {
      Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
        let n = !1;
        const { selection: r } = t, { empty: s, anchor: o } = r;
        return s ? (t.doc.nodesBetween(o - 1, o, (i, a) => {
          if (i.type.name === this.name)
            return n = !0, e.insertText("", a, a + i.nodeSize), !1;
        }), n) : !1;
      })
    };
  }
});
function nt(e, t, n = () => !0) {
  const r = [];
  t.lastIndex = 0;
  let s;
  for (; s = t.exec(e); )
    n(e, s) && r.push(s);
  return r;
}
function rt(e, t) {
  return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
}
function st(e) {
  const t = new RegExp(
    "(?:" + [
      `[!?.,:;'"]`,
      "(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
    ].join("|"),
    "g"
  );
  return e.replace(t, "");
}
function it(e, t) {
  const n = e.slice(0, t + 1).search(/\S+\s*$/), r = e.slice(t).search(/\s/);
  if (r < 0) {
    const s = e.slice(n);
    return {
      text: s,
      from: n,
      to: n + s.length
    };
  }
  return {
    text: e.slice(n, r + t),
    from: n,
    to: r + t
  };
}
function S(e, t, n, r) {
  const s = it(e, t);
  if (r.lastIndex = 0, !r.test(s.text))
    return s;
  const o = n === "left" ? s.from - 1 : s.to + 1;
  return o <= 0 || o >= e.length || o === t ? s : S(e, o, n, r);
}
function ot(e, t, n, r) {
  const s = Math.max(e.from - 1, 0), o = Math.min(e.to + 1, t.content.size), i = q(s, o, t);
  for (const a of i)
    a.mark.type === r && n.removeMark(a.from, a.to, r);
}
const I = Ce(1, 15);
function A(e, t, n, r, s, o) {
  if (!e)
    return;
  let i = n - t - 1;
  i = i < 0 ? 0 : i;
  const a = r - t, l = S(
    e,
    i,
    "left",
    I
  ), d = S(
    e,
    a,
    "right",
    I
  ), u = e.slice(l.from, d.to);
  nt(u, ke, rt).forEach((T) => {
    const h = st(T[0]), g = t + l.from + T.index + 1, M = g + h.length;
    s.addMark(g, M, o.create());
  });
}
function at(e) {
  let t = !1;
  return new ge({
    key: new f("autolink"),
    appendTransaction: (n, r, s) => {
      const o = n.some((u) => u.docChanged) && !r.doc.eq(s.doc);
      if (t && !o)
        return;
      const { tr: i } = s, { textContent: a } = s.doc;
      t || A(a, 0, 0, a.length, i, e.type), t = !0;
      const l = U(
        r.doc,
        [...n]
      );
      return W(l).forEach(({ oldRange: u, newRange: p }) => {
        ot(p, s.doc, i, e.type), V(
          s.doc,
          p,
          (h) => h.isTextblock
        ).forEach(({ node: h, pos: g }) => {
          A(
            h.textContent,
            g,
            u.from,
            p.to,
            i,
            e.type
          );
        });
      }), i;
    }
  });
}
const lt = {
  class: "d-link d-c-text d-d-inline-block d-wb-break-all",
  rel: "noopener noreferrer nofollow"
}, ct = z.create({
  name: "CustomLink",
  renderHTML({ HTMLAttributes: e }) {
    return [
      "a",
      m(
        this.options.HTMLAttributes,
        e,
        lt
      )
    ];
  },
  renderText({ node: e }) {
    return e.attrs.text;
  },
  addProseMirrorPlugins() {
    return [
      at({ type: this.type })
    ];
  }
}), dt = Ee.extend({
  name: "ConfigurableImage",
  addAttributes() {
    return {
      src: {
        default: ""
      },
      alt: {
        default: void 0
      },
      title: {
        default: void 0
      },
      width: {
        default: void 0
      },
      height: {
        default: void 0
      },
      style: {
        default: void 0
      }
    };
  }
}).configure({ inline: !0, allowBase64: !0 }), ut = B.extend({
  parseHTML() {
    return [{ tag: "div" }];
  },
  renderHTML({ HTMLAttributes: e }) {
    return ["div", m(this.options.HTMLAttributes, e), 0];
  }
}), mt = {
  name: "MentionComponent",
  components: {
    NodeViewWrapper: _,
    DtLink: D
  },
  props: y,
  computed: {
    text() {
      return "@" + this.$props.node.attrs.name;
    }
  }
};
var ht = function() {
  var t = this, n = t._self._c;
  return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
}, ft = [], pt = /* @__PURE__ */ c(
  mt,
  ht,
  ft
);
const gt = pt.exports, _t = R.extend({
  addNodeView() {
    return v(gt);
  },
  parseHTML() {
    return [
      {
        tag: "mention-component"
      }
    ];
  },
  addAttributes() {
    return {
      name: {
        default: ""
      },
      avatarSrc: {
        default: ""
      },
      id: {
        default: ""
      }
    };
  },
  renderText({ node: e }) {
    return `@${e.attrs.id}`;
  },
  renderHTML({ HTMLAttributes: e }) {
    return ["mention-component", m(this.options.HTMLAttributes, e)];
  }
}).configure({
  suggestion: {
    char: "@",
    pluginKey: new f("mentionSuggestion")
  }
}), yt = {
  name: "ChannelComponent",
  components: {
    NodeViewWrapper: _,
    DtLink: D
  },
  props: y,
  computed: {
    text() {
      return "#" + this.$props.node.attrs.name;
    }
  }
};
var wt = function() {
  var t = this, n = t._self._c;
  return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
}, vt = [], xt = /* @__PURE__ */ c(
  yt,
  wt,
  vt
);
const bt = xt.exports, kt = R.extend({
  name: "channel",
  addNodeView() {
    return v(bt);
  },
  parseHTML() {
    return [
      {
        tag: "channel-component"
      }
    ];
  },
  addAttributes() {
    return {
      name: {
        default: ""
      },
      id: {
        default: ""
      },
      locked: {
        default: !1
      }
    };
  },
  renderText({ node: e }) {
    return `#${e.attrs.id}`;
  },
  renderHTML({ HTMLAttributes: e }) {
    return ["channel-component", m(this.options.HTMLAttributes, e)];
  }
}).configure({
  suggestion: {
    char: "#",
    pluginKey: new f("channelSuggestion")
  }
}), Ct = {
  name: "SlashCommandsComponent",
  components: {
    NodeViewWrapper: _
  },
  props: {
    ...y
  },
  emits: ["selected-command"],
  computed: {
    text() {
      return "/" + this.$props.node.attrs.command;
    }
  },
  created() {
    var n, r, s;
    const e = this.$props.node.attrs.command;
    this.$emit("selected-command", e);
    const t = (s = (r = (n = this.editor) == null ? void 0 : n.storage) == null ? void 0 : r["slash-commands"]) == null ? void 0 : s.onSelectedCommand;
    t && typeof t == "function" && t(e);
  }
};
var Tt = function() {
  var t = this, n = t._self._c;
  return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [t._v(" " + t._s(t.text) + " ")]);
}, Et = [], St = /* @__PURE__ */ c(
  Ct,
  Tt,
  Et
);
const Lt = St.exports, Rt = (e, t) => [...e.matchAll(t)].map((r) => {
  let s = r[2];
  return s.endsWith(" ") || (s += " "), {
    index: r.index,
    text: s,
    match: r
  };
}), $t = R.extend({
  name: "slash-commands",
  group: "inline",
  inline: !0,
  addOptions() {
    var e;
    return {
      ...(e = this.parent) == null ? void 0 : e.call(this),
      onSelectedCommand: null
    };
  },
  addStorage() {
    return {
      onSelectedCommand: this.options.onSelectedCommand
    };
  },
  addNodeView() {
    return v(Lt);
  },
  parseHTML() {
    return [
      {
        tag: "command-component"
      }
    ];
  },
  addAttributes() {
    return {
      command: {
        default: ""
      },
      parametersExample: {
        default: ""
      },
      description: {
        default: ""
      }
    };
  },
  renderText({ node: e }) {
    return `/${e.attrs.command}`;
  },
  renderHTML({ HTMLAttributes: e }) {
    return ["command-component", m(this.options.HTMLAttributes, e)];
  },
  addInputRules() {
    var n;
    const e = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) $`);
    return [
      X({
        find: t,
        type: this.type,
        getAttributes(r) {
          return { command: r[2] };
        }
      })
    ];
  },
  addPasteRules() {
    var n;
    const e = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
    return [
      E({
        find: (r) => Rt(r, t),
        type: this.type,
        getAttributes(r) {
          return { command: r[0].trim() };
        }
      })
    ];
  }
}).configure({
  suggestion: {
    char: "/",
    pluginKey: new f("slashCommandSuggestion")
  }
}), It = {
  name: "MentionSuggestion",
  components: {
    DtAvatar: Re,
    DtStack: x
  },
  props: {
    item: {
      type: Object,
      required: !0
    }
  },
  computed: {
    name() {
      return this.item.name;
    },
    avatarSrc() {
      return this.item.avatarSrc;
    },
    presence() {
      return this.item.presence;
    },
    status() {
      return this.item.status;
    },
    presenceText() {
      return this.item.presenceText;
    },
    presenceFontColorClass() {
      return {
        active: "d-recipe-contact-row--active",
        busy: "d-recipe-contact-row--busy",
        away: "d-recipe-contact-row--away",
        offline: "d-recipe-contact-row--busy"
      }[this.presence];
    },
    showDetails() {
      return this.item.showDetails;
    }
  }
};
var At = function() {
  var t = this, n = t._self._c;
  return n("dt-stack", { staticClass: "d-mention-suggestion__container", attrs: { direction: "row", gap: "400" } }, [n("dt-avatar", { attrs: { "full-name": t.name, "image-src": t.avatarSrc, "image-alt": t.name, "show-presence": t.showDetails, presence: t.presence, size: "sm" } }), n("dt-stack", { staticClass: "d-mention-suggestion__details-container", attrs: { gap: "100" } }, [n("span", { staticClass: "d-mention-suggestion__name" }, [t._v(" " + t._s(t.name) + " ")]), t.showDetails ? n("dt-stack", { staticClass: "d-label--sm-plain", attrs: { direction: "row", gap: "300" } }, [t.presenceText ? n("span", { staticClass: "d-mention-suggestion__presence", class: [t.presenceFontColorClass] }, [t._v(" " + t._s(t.presenceText) + " ")]) : t._e(), t.status && t.presenceText ? n("div", { staticClass: "d-mention-suggestion__divider" }, [t._v(" • ")]) : t._e(), t.status ? n("div", { staticClass: "d-mention-suggestion__status" }, [t._v(" " + t._s(t.status) + " ")]) : t._e()]) : t._e()], 1)], 1);
}, Bt = [], Ot = /* @__PURE__ */ c(
  It,
  At,
  Bt
);
const Pt = Ot.exports, Dt = {
  // This function comes from the user and passed to the editor directly.
  // This will also activate the mention plugin on the editor
  // items: ({ query }) => { return [] },
  allowSpaces: !0,
  render: () => {
    let e, t, n = !1;
    return {
      onStart: (r) => {
        e = new w(k, {
          parent: void 0,
          propsData: {
            itemComponent: Pt,
            itemType: "mention",
            ...r
          },
          editor: r.editor
        }), r.clientRect && (t = b("body", {
          getReferenceClientRect: r.clientRect,
          appendTo: () => document.body,
          content: e.element,
          showOnCreate: !1,
          onShow: () => {
            n = !0;
          },
          onHidden: () => {
            n = !1;
          },
          interactive: !0,
          trigger: "manual",
          placement: "top-start",
          zIndex: 650,
          plugins: [C]
        }), r.items.length > 0 && (t == null || t[0].show()));
      },
      onUpdate(r) {
        e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), r.clientRect && (t == null || t[0].setProps({
          getReferenceClientRect: r.clientRect
        }));
      },
      onKeyDown(r) {
        var s;
        if (n)
          return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
      },
      onExit() {
        t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
      }
    };
  }
}, Mt = {
  name: "ChannelSuggestion",
  components: {
    DtStack: x,
    DtIconHash: $e,
    DtIconLock: Ie
  },
  props: {
    item: {
      type: Object,
      required: !0
    }
  },
  computed: {
    name() {
      return this.item.name;
    }
  }
};
var Ht = function() {
  var t = this, n = t._self._c;
  return n("dt-stack", { attrs: { direction: "row", gap: "400" } }, [t.item.locked ? n("dt-icon-lock", { attrs: { size: "300" } }) : n("dt-icon-hash", { attrs: { size: "300" } }), n("span", [t._v(t._s(t.name))])], 1);
}, jt = [], Ft = /* @__PURE__ */ c(
  Mt,
  Ht,
  jt
);
const Nt = Ft.exports, Kt = {
  // This function comes from the user and passed to the editor directly.
  // This will also activate the mention plugin on the editor
  // items: ({ query }) => { return [] },
  allowSpaces: !0,
  render: () => {
    let e, t, n = !1;
    return {
      onStart: (r) => {
        e = new w(k, {
          parent: void 0,
          propsData: {
            itemComponent: Nt,
            itemType: "channel",
            ...r
          },
          editor: r.editor
        }), r.clientRect && (t = b("body", {
          getReferenceClientRect: r.clientRect,
          appendTo: () => document.body,
          content: e.element,
          showOnCreate: !1,
          onShow: () => {
            n = !0;
          },
          onHidden: () => {
            n = !1;
          },
          interactive: !0,
          trigger: "manual",
          placement: "top-start",
          zIndex: 650,
          plugins: [C]
        }), r.items.length > 0 && (t == null || t[0].show()));
      },
      onUpdate(r) {
        e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), r.clientRect && (t == null || t[0].setProps({
          getReferenceClientRect: r.clientRect
        }));
      },
      onKeyDown(r) {
        var s;
        if (n)
          return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
      },
      onExit() {
        t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
      }
    };
  }
}, qt = {
  name: "SlashCommandSuggestion",
  props: {
    item: {
      type: Object,
      required: !0
    }
  },
  computed: {
    command() {
      return this.item.command;
    },
    description() {
      return this.item.description;
    },
    parametersExample() {
      return this.item.parametersExample;
    }
  }
};
var Ut = function() {
  var t = this, n = t._self._c;
  return n("div", [n("div", { staticClass: "d-body--md-compact" }, [n("span", [t._v("/" + t._s(t.command))]), t.parametersExample ? n("span", [t._v(" " + t._s(t.parametersExample))]) : t._e()]), n("div", { staticClass: "d-body--sm d-fc-tertiary" }, [t._v(" " + t._s(t.description) + " ")])]);
}, Wt = [], Vt = /* @__PURE__ */ c(
  qt,
  Ut,
  Wt
);
const zt = Vt.exports, Xt = {
  // This function comes from the user and passed to the editor directly.
  // This will also activate the mention plugin on the editor
  // items: ({ query }) => { return [] },
  allowSpaces: !0,
  startOfLine: !0,
  render: () => {
    let e, t, n = !1;
    return {
      onStart: (r) => {
        e = new w(k, {
          parent: void 0,
          propsData: {
            itemComponent: zt,
            itemType: "slash-command",
            ...r
          },
          editor: r.editor
        }), r.clientRect && (t = b("body", {
          getReferenceClientRect: r.clientRect,
          appendTo: () => document.body,
          content: e.element,
          showOnCreate: !1,
          onShow: () => {
            n = !0;
          },
          onHidden: () => {
            n = !1;
          },
          interactive: !0,
          trigger: "manual",
          placement: "top-start",
          zIndex: 650,
          plugins: [C]
        }), r.items.length > 0 && (t == null || t[0].show()));
      },
      onUpdate(r) {
        e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), r.clientRect && (t == null || t[0].setProps({
          getReferenceClientRect: r.clientRect
        }));
      },
      onKeyDown(r) {
        var s;
        if (n)
          return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
      },
      onExit() {
        t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
      }
    };
  }
}, Jt = {
  name: "DtRichTextEditor",
  components: {
    EditorContent: H,
    BubbleMenu: j,
    DtButton: Oe,
    DtStack: x
  },
  props: {
    /**
     * Value of the input. The object format should match TipTap's JSON
     * document structure: https://tiptap.dev/guide/output#option-1-json
     */
    value: {
      type: [Object, String],
      default: ""
    },
    /**
     * Whether the input is editable
     */
    editable: {
      type: Boolean,
      default: !0
    },
    /**
     * Prevents the user from typing any further. Deleting text will still work.
     */
    preventTyping: {
      type: Boolean,
      default: !1
    },
    /**
     * When this option is false the editor will only ever paste plain text, no rich text formatting will be applied,
     * and any HTML will be rendered as text.
     */
    pasteRichText: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,
     * line breaks can still be entered by pressing shift+enter.
     */
    allowLineBreaks: {
      type: Boolean,
      default: !1
    },
    /**
     * Descriptive label for the input element
     */
    inputAriaLabel: {
      type: String,
      required: !0
    },
    /**
     * Additional class name for the input element. Only accepts a String value
     * because this is passed to the editor via options. For multiple classes,
     * join them into one string, e.g. "d-p8 d-hmx96"
     */
    inputClass: {
      type: String,
      default: ""
    },
    /**
     * Whether the input should receive focus after the component has been
     * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.
     * - `start`  Sets the focus to the beginning of the input
     * - `end`    Sets the focus to the end of the input
     * - `all`    Selects the whole contents of the input
     * - `Number` Sets the focus to a specific position in the input
     * - `true`   Defaults to `start`
     * - `false`  Disables autofocus
     * @values true, false, start, end, all, number
     */
    autoFocus: {
      type: [Boolean, String, Number],
      default: !1,
      validator(e) {
        return typeof e == "string" ? Se.includes(e) : !0;
      }
    },
    /**
     * The output format that the editor uses when emitting the "@input" event.
     * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for
     * examples.
     * @values text, json, html
     */
    outputFormat: {
      type: String,
      default: "html",
      validator(e) {
        return Le.includes(e);
      }
    },
    /**
     * Placeholder text
     */
    placeholder: {
      type: String,
      default: ""
    },
    /**
     * Enables the TipTap Link extension and optionally passes configurations to it
     *
     * It is not recommended to use this and the custom link extension at the same time.
     */
    link: {
      type: [Boolean, Object],
      default: !1
    },
    /**
     * Enables the Custom Link extension and optionally passes configurations to it
     *
     * It is not recommended to use this and the built in TipTap link extension at the same time.
     *
     * The custom link does some additional things on top of the built in TipTap link
     * extension such as styling phone numbers and IP adresses as links, and allows you
     * to linkify text without having to type a space after the link. Currently it is missing some
     * functionality such as editing links and will likely require more work to be fully usable,
     * so it is recommended to use the built in TipTap link for now.
     */
    customLink: {
      type: [Boolean, Object],
      default: !1
    },
    /**
     * suggestion object containing the items query function.
     * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion
     *
     * The only required key is the items function which is used to query the contacts for suggestion.
     * items({ query }) => { return [ContactObject]; }
     * ContactObject format:
     * { name: string, avatarSrc: string, id: string }
     *
     * When null, it does not add the plugin.
     */
    mentionSuggestion: {
      type: Object,
      default: null
    },
    /**
     * suggestion object containing the items query function.
     * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion
     *
     * The only required key is the items function which is used to query the channels for suggestion.
     * items({ query }) => { return [ChannelObject]; }
     * ChannelObject format:
     * { name: string, id: string, locked: boolean }
     *
     * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.
     */
    channelSuggestion: {
      type: Object,
      default: null
    },
    /**
     * suggestion object containing the items query function.
     * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion
     *
     * The only required key is the items function which is used to query the slash commands for suggestion.
     * items({ query }) => { return [SlashCommandObject]; }
     * SlashCommandObject format:
     * { command: string, description: string, parametersExample?: string }
     * The "parametersExample" parameter is optional, and describes an example
     * of the parameters that command can take.
     *
     * When null, it does not add the plugin.
     * Note that slash commands only work when they are the first word in the input.
     */
    slashCommandSuggestion: {
      type: Object,
      default: null
    },
    /**
     * Whether the input allows for block quote.
     */
    allowBlockquote: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows for bold to be introduced in the text.
     */
    allowBold: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows for bullet list to be introduced in the text.
     */
    allowBulletList: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows for italic to be introduced in the text.
     */
    allowItalic: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows for strike to be introduced in the text.
     */
    allowStrike: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows for underline to be introduced in the text.
     */
    allowUnderline: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows inline code (wrapped in backticks).
     */
    allowCode: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows codeblock to be introduced in the text.
     */
    allowCodeblock: {
      type: Boolean,
      default: !0
    },
    /**
     * Whether the input allows inline images to be rendered.
     */
    allowInlineImages: {
      type: Boolean,
      default: !1
    },
    /**
     * Whether the input allows color to be introduced in the text.
     */
    allowFontColor: {
      type: Boolean,
      default: !1
    },
    /**
     * Whether the input allows different font-families to be introduced in the text.
     */
    allowFontFamily: {
      type: Boolean,
      default: !1
    },
    /**
     * Additional TipTap extensions to be added to the editor.
     */
    additionalExtensions: {
      type: Array,
      default: () => []
    },
    /**
     * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.
     * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You
     * are showing a custom link editor popup.
     */
    hideLinkBubbleMenu: {
      type: Boolean,
      default: !1
    },
    /**
     * Show text in HTML div tags instead of paragraph tags
     */
    useDivTags: {
      type: Boolean,
      default: !1
    }
  },
  emits: [
    /**
     * Editor input event
     * @event input
     * @type {String|JSON}
     */
    "input",
    /**
     * Input event always in JSON format.
     * @event input
     * @type {JSON}
     */
    "json-input",
    /**
     * Input event always in HTML format.
     * @event input
     * @type {HTML}
     */
    "html-input",
    /**
     * Input event always in text format.
     * @event input
     * @type {String}
     */
    "text-input",
    /**
     * Event to sync the value with the parent
     * @event update:value
     * @type {String|JSON}
     */
    "update:value",
    /**
     * Editor blur event
     * @event blur
     * @type {FocusEvent}
     */
    "blur",
    /**
     * Editor focus event
     * @event focus
     * @type {FocusEvent}
     */
    "focus",
    /**
     * Enter was pressed. Note that shift enter must be pressed to line break the input.
     * @event enter
     * @type {String}
     */
    "enter",
    /**
     * "Edit link" button was clicked. Fires an event for the consuming component to handle the editing of the link.
     * event contains the link object with two properties href and text.
     * @event edit-link
     * @type {Object}
     */
    "edit-link",
    /**
     * "Selected" event is fired when the user selects text in the editor. returns the currently selected text.
     * If the selected text is partially a link, the full link text is returned.
     * @event selected
     * @type {String}
     */
    "selected",
    /**
     * Event fired when a slash command is selected
     * @event selected-command
     * @type {String}
     */
    "selected-command"
  ],
  data() {
    return {
      editor: null,
      tippyOptions: {
        appendTo: () => {
          var e;
          return (e = this.$refs.editor.$el.getRootNode()) == null ? void 0 : e.querySelector("body");
        },
        placement: "top-start"
      },
      i18n: new Be()
    };
  },
  computed: {
    editorListeners() {
      return {
        ...this.$listeners,
        input: () => {
        },
        focus: () => {
        },
        blur: () => {
        }
      };
    },
    // eslint-disable-next-line complexity
    extensions() {
      const e = [Z, de, me, te];
      e.push(this.useDivTags ? ut : B), this.allowBlockquote && e.push(Y), this.allowBold && e.push(ne), this.allowBulletList && (e.push(re), e.push(oe.extend({
        renderText({ node: r }) {
          return r.textContent;
        }
      })), e.push(ae)), this.allowItalic && e.push(se), this.allowStrike && e.push(le), this.allowUnderline && e.push(ce), this.placeholder && e.push(
        ee.configure({ placeholder: this.placeholder })
      );
      const t = this, n = J.create({
        addKeyboardShortcuts() {
          return {
            "Shift-Enter": ({ editor: r }) => t.allowLineBreaks ? !1 : (r.commands.first(({ commands: s }) => [
              () => s.newlineInCode(),
              () => t.allowBulletList && s.splitListItem("listItem"),
              () => s.createParagraphNear(),
              () => s.liftEmptyBlock(),
              () => s.splitBlock()
            ]), !0),
            Enter: () => t.allowLineBreaks ? !1 : (t.$emit("enter"), !0)
          };
        }
      });
      if (e.push(n), this.link && e.push(ie.extend({ inclusive: !1 }).configure({
        HTMLAttributes: {
          class: "d-link d-wb-break-all"
        },
        openOnClick: !1,
        autolink: !0,
        protocols: $
      })), this.customLink && e.push(this.getExtension(ct, this.customLink)), this.mentionSuggestion) {
        const r = { ...this.mentionSuggestion, ...Dt };
        e.push(_t.configure({ suggestion: r }));
      }
      if (this.channelSuggestion) {
        const r = { ...this.channelSuggestion, ...Kt };
        e.push(kt.configure({ suggestion: r }));
      }
      if (this.slashCommandSuggestion) {
        const r = { ...this.slashCommandSuggestion, ...Xt };
        e.push($t.configure({
          suggestion: r,
          onSelectedCommand: (s) => {
            this.$emit("selected-command", s);
          }
        }));
      }
      return e.push(tt), e.push(ue.configure({
        types: ["paragraph"]
      })), this.allowCode && e.push(Q), this.allowCodeblock && e.push(G.extend({
        renderText({ node: r }) {
          return `\`\`\`
${r.textContent}
\`\`\``;
        }
      }).configure({
        HTMLAttributes: {
          class: "d-rich-text-editor__code-block"
        }
      })), this.allowInlineImages && e.push(dt), (this.allowFontFamily || this.allowFontColor) && (e.push(he), this.allowFontColor && e.push(fe), this.allowFontFamily && e.push(pe)), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
    },
    inputAttrs() {
      const e = {
        "aria-label": this.inputAriaLabel,
        "aria-multiline": !0,
        role: "textbox"
      };
      return this.editable || (e["aria-readonly"] = !0), e;
    }
  },
  /**
   * Because the Editor instance is initialized when mounted it does not get
   * updated props automatically, so the ones that can change after mount have
   * to be hooked up to the Editor's own API.
   */
  watch: {
    editable(e) {
      this.editor.setEditable(e), this.updateEditorAttributes({ "aria-readonly": !e });
    },
    inputClass(e) {
      this.updateEditorAttributes({ class: e });
    },
    inputAriaLabel(e) {
      this.updateEditorAttributes({ "aria-label": e });
    },
    extensions() {
      this.destroyEditor(), this.createEditor();
    },
    value(e) {
      this.processValue(e);
    }
  },
  created() {
    this.createEditor();
  },
  beforeDestroy() {
    this.destroyEditor();
  },
  mounted() {
    Te(this.$el, this.$options.name), this.processValue(this.value, !1);
  },
  methods: {
    createEditor() {
      this.editor = new F({
        autofocus: this.autoFocus,
        content: this.value,
        editable: this.editable,
        extensions: this.extensions,
        parseOptions: {
          preserveWhitespace: "full"
        },
        editorProps: {
          attributes: {
            ...this.inputAttrs,
            class: this.inputClass
          },
          handleKeyDown: (e, t) => {
            if (!this.preventTyping) return !1;
            const n = ["Backspace"];
            return !this.allowLineBreaks && !t.shiftKey && n.push("Enter"), !n.includes(t.key);
          },
          handlePaste: (e, t, n) => {
            const r = t.clipboardData || window.clipboardData, s = r.getData("text/plain"), o = r.getData("text/html");
            return this.processPasteData(e, s, o);
          },
          // Moves the <br /> tags inside the previous closing tag to avoid
          // Prosemirror wrapping them within another </p> tag.
          transformPastedHTML(e) {
            return e.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
          }
        }
      }), this.addEditorListeners();
    },
    bubbleMenuShouldShow({ editor: e, view: t, state: n, oldState: r, from: s, to: o }) {
      return e.isActive("link");
    },
    /**
     * If the selection contains a link, return the existing link text.
     * Otherwise, use just the selected text.
     * @param editor the editor instance.
     */
    getSelectedLinkText(e) {
      var a, l, d;
      const { view: t, state: n } = e, { from: r, to: s } = t.state.selection, o = n.doc.textBetween(r, s, ""), i = this.editor.state.doc.nodeAt(r);
      return i && ((d = (l = (a = i.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : d.name) === "link" ? i.textContent : o;
    },
    editLink() {
      const e = this.getSelectedLinkText(this.editor), t = {
        href: this.editor.getAttributes("link").href,
        text: e
      };
      this.$emit("edit-link", t);
    },
    removeLink() {
      var e, t, n, r;
      (r = (n = (t = (e = this.editor) == null ? void 0 : e.chain()) == null ? void 0 : t.focus()) == null ? void 0 : n.unsetLink()) == null || r.run();
    },
    openLink() {
      var t, n;
      (n = (t = this.editor) == null ? void 0 : t.chain()) == null || n.focus();
      const e = this.editor.getAttributes("link").href;
      window.open(e, "_blank");
    },
    // eslint-disable-next-line complexity
    setLink(e, t, n, r = $, s) {
      var a, l, d;
      if (!e) {
        this.removeLink();
        return;
      }
      r.find((u) => u.test(e)) || (e = `${s}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
      const i = (d = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : d.selection;
      this.editor.chain().focus().insertContent(t).setTextSelection({ from: i.from, to: i.from + t.length }).setLink({ href: e, class: n.class }).run();
    },
    // eslint-disable-next-line complexity
    processValue(e, t = !0) {
      const n = this.getOutput();
      if (!(t && Ae(e, n))) {
        if (typeof e == "string" && this.outputFormat === "text") {
          const r = new RegExp(`(${O})`, "g");
          e = e == null ? void 0 : e.replace(r, '<emoji-component code="$1"></emoji-component>');
        }
        this.editor.commands.setContent(e, !1, { preserveWhitespace: "full" });
      }
    },
    destroyEditor() {
      this.editor.destroy();
    },
    insertPlainTextWithHardBreaks(e, t) {
      const { tr: n } = e.state, { from: r, to: s } = e.state.selection;
      n.deleteRange(r, s);
      const o = t.split(/\r?\n/);
      let i = r;
      for (let a = 0; a < o.length; a++)
        a > 0 && (n.insert(i, e.state.schema.nodes.hardBreak.create()), i++), n.insertText(o[a], i), i += o[a].length;
      e.dispatch(n);
    },
    shouldPreserveLineBreaks(e, t) {
      return this.pasteRichText ? !t && e && this.hasBlankLines(e) : !!e;
    },
    processPasteData(e, t, n) {
      if (this.shouldPreserveLineBreaks(t, n))
        return this.insertPlainTextWithHardBreaks(e, t), !0;
      if (this.shouldHandlePreformattedHTML(n)) {
        const r = this.extractPreformattedText(n);
        if (r && r.includes(`
`))
          return this.insertPlainTextWithHardBreaks(e, r), !0;
      }
      return !1;
    },
    shouldHandlePreformattedHTML(e) {
      return this.pasteRichText && e && this.containsPreformattedContent(e);
    },
    containsPreformattedContent(e) {
      const t = document.createElement("div");
      t.innerHTML = e;
      const n = t.querySelectorAll("*");
      for (const r of n)
        if (this.hasPreWhitespace(r) && this.hasLineBreaks(r))
          return !0;
      return !1;
    },
    hasPreWhitespace(e) {
      const t = e.getAttribute("style") || "", n = e.style.whiteSpace || "", r = n === "pre" || n === "pre-wrap", s = t.includes("white-space: pre");
      return r || s;
    },
    hasLineBreaks(e) {
      return e.textContent && e.textContent.includes(`
`);
    },
    hasBlankLines(e) {
      return e.includes(`

`) || /\n\s*\n/.test(e);
    },
    extractPreformattedText(e) {
      const t = document.createElement("div");
      return t.innerHTML = e, this.walkAndExtractText(t);
    },
    walkAndExtractText(e) {
      let t = "";
      if (e.nodeType === Node.TEXT_NODE)
        t += e.textContent;
      else if (e.nodeType === Node.ELEMENT_NODE)
        if (this.hasPreWhitespace(e))
          t += e.textContent;
        else
          for (const n of e.childNodes)
            t += this.walkAndExtractText(n);
      return t;
    },
    triggerInputChangeEvents() {
      const e = this.getOutput();
      this.$emit("input", e), this.$emit("update:value", e);
      const t = this.editor.getJSON();
      this.$emit("json-input", t);
      const n = this.editor.getHTML();
      this.$emit("html-input", n);
      const r = this.editor.getText({ blockSeparator: `
` });
      this.$emit("text-input", r);
    },
    /**
     * The Editor exposes event hooks that we have to map our emits into. See
     * https://tiptap.dev/api/events for all events.
     */
    addEditorListeners() {
      this.editor.on("create", () => {
        this.triggerInputChangeEvents();
      }), this.editor.on("update", () => {
        this.triggerInputChangeEvents();
      }), this.editor.on("selectionUpdate", ({ editor: e }) => {
        this.$emit("selected", this.getSelectedLinkText(e));
      }), this.editor.on("focus", ({ event: e }) => {
        this.$emit("focus", e);
      }), this.editor.on("blur", ({ event: e }) => {
        this.$emit("blur", e);
      });
    },
    getOutput() {
      switch (this.outputFormat) {
        case "json":
          return this.editor.getJSON();
        case "html":
          return this.editor.getHTML();
        case "text":
        default:
          return this.editor.getText({ blockSeparator: `
` });
      }
    },
    getExtension(e, t) {
      var n;
      return typeof t == "boolean" ? e : (n = e.configure) == null ? void 0 : n.call(e, t);
    },
    updateEditorAttributes(e) {
      this.editor.setOptions({
        editorProps: {
          attributes: {
            ...this.inputAttrs,
            class: this.inputClass,
            ...e
          }
        }
      });
    },
    focusEditor() {
      this.editor.commands.focus();
    }
  }
};
var Yt = function() {
  var t = this, n = t._self._c;
  return n("div", [t.editor && t.link && !t.hideLinkBubbleMenu ? n("bubble-menu", { staticStyle: { visibility: "visible" }, attrs: { editor: t.editor, "should-show": t.bubbleMenuShouldShow, "tippy-options": t.tippyOptions } }, [n("div", { staticClass: "d-popover__dialog" }, [n("dt-stack", { staticClass: "d-rich-text-editor-bubble-menu__button-stack", attrs: { direction: "row", gap: "0" } }, [n("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: t.editLink } }, [t._v(" " + t._s(t.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL")) + " ")]), n("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: t.openLink } }, [t._v(" " + t._s(t.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL")) + " ")]), n("dt-button", { attrs: { kind: "danger", importance: "clear" }, on: { click: t.removeLink } }, [t._v(" " + t._s(t.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL")) + " ")])], 1)], 1)]) : t._e(), n("editor-content", t._g({ ref: "editor", staticClass: "d-rich-text-editor", attrs: { editor: t.editor, "data-qa": "dt-rich-text-editor" } }, t.editorListeners))], 1);
}, Gt = [], Qt = /* @__PURE__ */ c(
  Jt,
  Yt,
  Gt
);
const Un = Qt.exports;
export {
  Un as default
};
//# sourceMappingURL=rich-text-editor.js.map
