diff --git a/lib/assets/summernote-lite-v2.min.js b/lib/assets/summernote-lite-v2.min.js
new file mode 100644
index 00000000..4750dcaa
--- /dev/null
+++ b/lib/assets/summernote-lite-v2.min.js
@@ -0,0 +1,5732 @@
+/*! For license information please see summernote-lite.min.js.LICENSE.txt */ ! function(t, e) {
+ if("object" == typeof exports && "object" == typeof module) module.exports = e(require("jquery"));
+ else if("function" == typeof define && define.amd) define(["jquery"], e);
+ else {
+ var n = "object" == typeof exports ? e(require("jquery")) : e(t.jQuery);
+ for(var o in n)("object" == typeof exports ? exports : t)[o] = n[o]
+ }
+}(window, (function(t) {
+ return function(t) {
+ var e = {};
+
+ function n(o) {
+ if(e[o]) return e[o].exports;
+ var i = e[o] = {
+ i: o,
+ l: !1,
+ exports: {}
+ };
+ return t[o].call(i.exports, i, i.exports, n), i.l = !0, i.exports
+ }
+ return n.m = t, n.c = e, n.d = function(t, e, o) {
+ n.o(t, e) || Object.defineProperty(t, e, {
+ enumerable: !0,
+ get: o
+ })
+ }, n.r = function(t) {
+ "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
+ value: "Module"
+ }), Object.defineProperty(t, "__esModule", {
+ value: !0
+ })
+ }, n.t = function(t, e) {
+ if(1 & e && (t = n(t)), 8 & e) return t;
+ if(4 & e && "object" == typeof t && t && t.__esModule) return t;
+ var o = Object.create(null);
+ if(n.r(o), Object.defineProperty(o, "default", {
+ enumerable: !0,
+ value: t
+ }), 2 & e && "string" != typeof t)
+ for(var i in t) n.d(o, i, function(e) {
+ return t[e]
+ }.bind(null, i));
+ return o
+ }, n.n = function(t) {
+ var e = t && t.__esModule ? function() {
+ return t.default
+ } : function() {
+ return t
+ };
+ return n.d(e, "a", e), e
+ }, n.o = function(t, e) {
+ return Object.prototype.hasOwnProperty.call(t, e)
+ }, n.p = "", n(n.s = 51)
+ }({
+ 0: function(e, n) {
+ e.exports = t
+ },
+ 1: function(t, e, n) {
+ "use strict";
+ var o = n(0),
+ i = n.n(o);
+
+ function r(t) {
+ return(r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
+ return typeof t
+ } : function(t) {
+ return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
+ })(t)
+ }
+
+ function a(t, e) {
+ for(var n = 0; n < e.length; n++) {
+ var o = e[n];
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
+ }
+ }
+ var s = function() {
+ function t(e, n, o, i) {
+ ! function(t, e) {
+ if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
+ }(this, t), this.markup = e, this.children = n, this.options = o, this.callback = i
+ }
+ var e, n, o;
+ return e = t, (n = [{
+ key: "render",
+ value: function(t) {
+ var e = i()(this.markup);
+ if(this.options && this.options.contents && e.html(this.options.contents), this.options && this.options.className && e.addClass(this.options.className), this.options && this.options.data && i.a.each(this.options.data, (function(t, n) {
+ e.attr("data-" + t, n)
+ })), this.options && this.options.click && e.on("click", this.options.click), this.children) {
+ var n = e.find(".note-children-container");
+ this.children.forEach((function(t) {
+ t.render(n.length ? n : e)
+ }))
+ }
+ return this.callback && this.callback(e, this.options), this.options && this.options.callback && this.options.callback(e), t && t.append(e), e
+ }
+ }]) && a(e.prototype, n), o && a(e, o), t
+ }();
+ e.a = {
+ create: function(t, e) {
+ return function() {
+ var n = "object" === r(arguments[1]) ? arguments[1] : arguments[0],
+ o = Array.isArray(arguments[0]) ? arguments[0] : [];
+ return n && n.children && (o = n.children), new s(t, o, n, e)
+ }
+ }
+ }
+ },
+ 2: function(t, e) {
+ (function(e) {
+ t.exports = e
+ }).call(this, {})
+ },
+ 3: function(t, e, n) {
+ "use strict";
+ var o = n(0),
+ i = n.n(o);
+ i.a.summernote = i.a.summernote || {
+ lang: {}
+ }, i.a.extend(i.a.summernote.lang, {
+ "en-US": {
+ font: {
+ bold: "Bold",
+ italic: "Italic",
+ underline: "Underline",
+ clear: "Remove Font Style",
+ height: "Line Height",
+ name: "Font Family",
+ strikethrough: "Strikethrough",
+ subscript: "Subscript",
+ superscript: "Superscript",
+ size: "Font Size",
+ sizeunit: "Font Size Unit"
+ },
+ image: {
+ image: "Picture",
+ insert: "Insert Image",
+ resizeFull: "Resize full",
+ resizeHalf: "Resize half",
+ resizeQuarter: "Resize quarter",
+ resizeNone: "Original size",
+ floatLeft: "Float Left",
+ floatRight: "Float Right",
+ floatNone: "Remove float",
+ shapeRounded: "Shape: Rounded",
+ shapeCircle: "Shape: Circle",
+ shapeThumbnail: "Shape: Thumbnail",
+ shapeNone: "Shape: None",
+ dragImageHere: "Drag image or text here",
+ dropImage: "Drop image or Text",
+ selectFromFiles: "Select from files",
+ maximumFileSize: "Maximum file size",
+ maximumFileSizeError: "Maximum file size exceeded.",
+ url: "Image URL",
+ remove: "Remove Image",
+ original: "Original"
+ },
+ video: {
+ video: "Video",
+ videoLink: "Video Link",
+ insert: "Insert Video",
+ url: "Video URL",
+ providers: "(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"
+ },
+ link: {
+ link: "Link",
+ insert: "Insert Link",
+ unlink: "Unlink",
+ edit: "Edit",
+ textToDisplay: "Text to display",
+ url: "To what URL should this link go?",
+ openInNewWindow: "Open in new window",
+ useProtocol: "Use default protocol"
+ },
+ table: {
+ table: "Table",
+ addRowAbove: "Add row above",
+ addRowBelow: "Add row below",
+ addColLeft: "Add column left",
+ addColRight: "Add column right",
+ delRow: "Delete row",
+ delCol: "Delete column",
+ delTable: "Delete table"
+ },
+ hr: {
+ insert: "Insert Horizontal Rule"
+ },
+ style: {
+ style: "Style",
+ p: "Normal",
+ blockquote: "Quote",
+ pre: "Code",
+ h1: "Header 1",
+ h2: "Header 2",
+ h3: "Header 3",
+ h4: "Header 4",
+ h5: "Header 5",
+ h6: "Header 6"
+ },
+ lists: {
+ unordered: "Unordered list",
+ ordered: "Ordered list"
+ },
+ options: {
+ help: "Help",
+ fullscreen: "Full Screen",
+ codeview: "Code View"
+ },
+ paragraph: {
+ paragraph: "Paragraph",
+ outdent: "Outdent",
+ indent: "Indent",
+ left: "Align left",
+ center: "Align center",
+ right: "Align right",
+ justify: "Justify full"
+ },
+ color: {
+ recent: "Recent Color",
+ more: "More Color",
+ background: "Background Color",
+ foreground: "Text Color",
+ transparent: "Transparent",
+ setTransparent: "Set transparent",
+ reset: "Reset",
+ resetToDefault: "Reset to default",
+ cpSelect: "Select"
+ },
+ shortcut: {
+ shortcuts: "Keyboard shortcuts",
+ close: "Close",
+ textFormatting: "Text formatting",
+ action: "Action",
+ paragraphFormatting: "Paragraph formatting",
+ documentStyle: "Document Style",
+ extraKeys: "Extra keys"
+ },
+ help: {
+ escape: "Escape",
+ insertParagraph: "Insert Paragraph",
+ undo: "Undo the last command",
+ redo: "Redo the last command",
+ tab: "Tab",
+ untab: "Untab",
+ bold: "Set a bold style",
+ italic: "Set a italic style",
+ underline: "Set a underline style",
+ strikethrough: "Set a strikethrough style",
+ removeFormat: "Clean a style",
+ justifyLeft: "Set left align",
+ justifyCenter: "Set center align",
+ justifyRight: "Set right align",
+ justifyFull: "Set full align",
+ insertUnorderedList: "Toggle unordered list",
+ insertOrderedList: "Toggle ordered list",
+ outdent: "Outdent on current paragraph",
+ indent: "Indent on current paragraph",
+ formatPara: "Change current block's format as a paragraph(P tag)",
+ formatH1: "Change current block's format as H1",
+ formatH2: "Change current block's format as H2",
+ formatH3: "Change current block's format as H3",
+ formatH4: "Change current block's format as H4",
+ formatH5: "Change current block's format as H5",
+ formatH6: "Change current block's format as H6",
+ insertHorizontalRule: "Insert horizontal rule",
+ "linkDialog.show": "Show Link Dialog"
+ },
+ history: {
+ undo: "Undo",
+ redo: "Redo"
+ },
+ specialChar: {
+ specialChar: "SPECIAL CHARACTERS",
+ select: "Select Special characters"
+ },
+ output: {
+ noSelection: "No Selection Made!"
+ }
+ }
+ });
+ var r = "function" == typeof define && n(2),
+ a = ["sans-serif", "serif", "monospace", "cursive", "fantasy"];
+
+ function s(t) {
+ return -1 === i.a.inArray(t.toLowerCase(), a) ? "'".concat(t, "'") : t
+ }
+ var l, c = navigator.userAgent,
+ u = /MSIE|Trident/i.test(c);
+ if(u) {
+ var d = /MSIE (\d+[.]\d+)/.exec(c);
+ d && (l = parseFloat(d[1])), (d = /Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(c)) && (l = parseFloat(d[1]))
+ }
+ var h = /Edge\/\d+/.test(c),
+ f = "ontouchstart" in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0,
+ p = u ? "DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted" : "input",
+ m = {
+ isMac: navigator.appVersion.indexOf("Mac") > -1,
+ isMSIE: u,
+ isEdge: h,
+ isFF: !h && /firefox/i.test(c),
+ isPhantom: /PhantomJS/i.test(c),
+ isWebkit: !h && /webkit/i.test(c),
+ isChrome: !h && /chrome/i.test(c),
+ isSafari: !h && /safari/i.test(c) && !/chrome/i.test(c),
+ browserVersion: l,
+ jqueryVersion: parseFloat(i.a.fn.jquery),
+ isSupportAmd: r,
+ isSupportTouch: f,
+ isFontInstalled: function(t) {
+ var e = "Comic Sans MS" === t ? "Courier New" : "Comic Sans MS",
+ n = document.createElement("canvas").getContext("2d");
+ n.font = "200px '" + e + "'";
+ var o = n.measureText("mmmmmmmmmmwwwww").width;
+ return n.font = "200px " + s(t) + ', "' + e + '"', o !== n.measureText("mmmmmmmmmmwwwww").width
+ },
+ isW3CRangeSupport: !!document.createRange,
+ inputEventName: p,
+ genericFontFamilies: a,
+ validFontName: s
+ };
+ var v = 0;
+ var g = {
+ eq: function(t) {
+ return function(e) {
+ return t === e
+ }
+ },
+ eq2: function(t, e) {
+ return t === e
+ },
+ peq2: function(t) {
+ return function(e, n) {
+ return e[t] === n[t]
+ }
+ },
+ ok: function() {
+ return !0
+ },
+ fail: function() {
+ return !1
+ },
+ self: function(t) {
+ return t
+ },
+ not: function(t) {
+ return function() {
+ return !t.apply(t, arguments)
+ }
+ },
+ and: function(t, e) {
+ return function(n) {
+ return t(n) && e(n)
+ }
+ },
+ invoke: function(t, e) {
+ return function() {
+ return t[e].apply(t, arguments)
+ }
+ },
+ resetUniqueId: function() {
+ v = 0
+ },
+ uniqueId: function(t) {
+ var e = ++v + "";
+ return t ? t + e : e
+ },
+ rect2bnd: function(t) {
+ var e = i()(document);
+ return {
+ top: t.top + e.scrollTop(),
+ left: t.left + e.scrollLeft(),
+ width: t.right - t.left,
+ height: t.bottom - t.top
+ }
+ },
+ invertObject: function(t) {
+ var e = {};
+ for(var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[t[n]] = n);
+ return e
+ },
+ namespaceToCamel: function(t, e) {
+ return(e = e || "") + t.split(".").map((function(t) {
+ return t.substring(0, 1).toUpperCase() + t.substring(1)
+ })).join("")
+ },
+ debounce: function(t, e, n) {
+ var o;
+ return function() {
+ var i = this,
+ r = arguments,
+ a = function() {
+ o = null, n || t.apply(i, r)
+ },
+ s = n && !o;
+ clearTimeout(o), o = setTimeout(a, e), s && t.apply(i, r)
+ }
+ },
+ isValidUrl: function(t) {
+ return /[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)
+ }
+ };
+
+ function b(t) {
+ return t[0]
+ }
+
+ function k(t) {
+ return t[t.length - 1]
+ }
+
+ function y(t) {
+ return t.slice(1)
+ }
+
+ function w(t, e) {
+ if(t && t.length && e) {
+ if(t.indexOf) return -1 !== t.indexOf(e);
+ if(t.contains) return t.contains(e)
+ }
+ return !1
+ }
+ var C = {
+ head: b,
+ last: k,
+ initial: function(t) {
+ return t.slice(0, t.length - 1)
+ },
+ tail: y,
+ prev: function(t, e) {
+ if(t && t.length && e) {
+ var n = t.indexOf(e);
+ return -1 === n ? null : t[n - 1]
+ }
+ return null
+ },
+ next: function(t, e) {
+ if(t && t.length && e) {
+ var n = t.indexOf(e);
+ return -1 === n ? null : t[n + 1]
+ }
+ return null
+ },
+ find: function(t, e) {
+ for(var n = 0, o = t.length; n < o; n++) {
+ var i = t[n];
+ if(e(i)) return i
+ }
+ },
+ contains: w,
+ all: function(t, e) {
+ for(var n = 0, o = t.length; n < o; n++)
+ if(!e(t[n])) return !1;
+ return !0
+ },
+ sum: function(t, e) {
+ return e = e || g.self, t.reduce((function(t, n) {
+ return t + e(n)
+ }), 0)
+ },
+ from: function(t) {
+ for(var e = [], n = t.length, o = -1; ++o < n;) e[o] = t[o];
+ return e
+ },
+ isEmpty: function(t) {
+ return !t || !t.length
+ },
+ clusterBy: function(t, e) {
+ return t.length ? y(t).reduce((function(t, n) {
+ var o = k(t);
+ return e(k(o), n) ? o[o.length] = n : t[t.length] = [n], t
+ }), [
+ [b(t)]
+ ]) : []
+ },
+ compact: function(t) {
+ for(var e = [], n = 0, o = t.length; n < o; n++) t[n] && e.push(t[n]);
+ return e
+ },
+ unique: function(t) {
+ for(var e = [], n = 0, o = t.length; n < o; n++) w(e, t[n]) || e.push(t[n]);
+ return e
+ }
+ },
+ x = String.fromCharCode(160);
+
+ function S(t) {
+ return t && i()(t).hasClass("note-editable")
+ }
+
+ function T(t) {
+ return t = t.toUpperCase(),
+ function(e) {
+ return e && e.nodeName.toUpperCase() === t
+ }
+ }
+
+ function E(t) {
+ return t && 3 === t.nodeType
+ }
+
+ function $(t) {
+ return t && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(t.nodeName.toUpperCase())
+ }
+
+ function N(t) {
+ return !S(t) && (t && /^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))
+ }
+ var I = T("PRE"),
+ P = T("LI");
+ var R = T("TABLE"),
+ L = T("DATA");
+
+ function A(t) {
+ return !(z(t) || F(t) || D(t) || N(t) || R(t) || B(t) || L(t))
+ }
+
+ function F(t) {
+ return t && /^UL|^OL/.test(t.nodeName.toUpperCase())
+ }
+ var D = T("HR");
+
+ function H(t) {
+ return t && /^TD|^TH/.test(t.nodeName.toUpperCase())
+ }
+ var B = T("BLOCKQUOTE");
+
+ function z(t) {
+ return H(t) || B(t) || S(t)
+ }
+ var M = T("A");
+ var O = T("BODY");
+ var j = m.isMSIE && m.browserVersion < 11 ? " " : "
";
+
+ function U(t) {
+ return E(t) ? t.nodeValue.length : t ? t.childNodes.length : 0
+ }
+
+ function W(t) {
+ var e = U(t);
+ return 0 === e || (!E(t) && 1 === e && t.innerHTML === j || !(!C.all(t.childNodes, E) || "" !== t.innerHTML))
+ }
+
+ function K(t) {
+ $(t) || U(t) || (t.innerHTML = j)
+ }
+
+ function V(t, e) {
+ for(; t;) {
+ if(e(t)) return t;
+ if(S(t)) break;
+ t = t.parentNode
+ }
+ return null
+ }
+
+ function q(t, e) {
+ e = e || g.fail;
+ var n = [];
+ return V(t, (function(t) {
+ return S(t) || n.push(t), e(t)
+ })), n
+ }
+
+ function _(t, e) {
+ e = e || g.fail;
+ for(var n = []; t && !e(t);) n.push(t), t = t.nextSibling;
+ return n
+ }
+
+ function G(t, e) {
+ var n = e.nextSibling,
+ o = e.parentNode;
+ return n ? o.insertBefore(t, n) : o.appendChild(t), t
+ }
+
+ function Y(t, e) {
+ return i.a.each(e, (function(e, n) {
+ t.appendChild(n)
+ })), t
+ }
+
+ function Z(t) {
+ return 0 === t.offset
+ }
+
+ function X(t) {
+ return t.offset === U(t.node)
+ }
+
+ function Q(t) {
+ return Z(t) || X(t)
+ }
+
+ function J(t, e) {
+ for(; t && t !== e;) {
+ if(0 !== et(t)) return !1;
+ t = t.parentNode
+ }
+ return !0
+ }
+
+ function tt(t, e) {
+ if(!e) return !1;
+ for(; t && t !== e;) {
+ if(et(t) !== U(t.parentNode) - 1) return !1;
+ t = t.parentNode
+ }
+ return !0
+ }
+
+ function et(t) {
+ for(var e = 0; t = t.previousSibling;) e += 1;
+ return e
+ }
+
+ function nt(t) {
+ return !!(t && t.childNodes && t.childNodes.length)
+ }
+
+ function ot(t, e) {
+ var n, o;
+ if(0 === t.offset) {
+ if(S(t.node)) return null;
+ n = t.node.parentNode, o = et(t.node)
+ } else nt(t.node) ? o = U(n = t.node.childNodes[t.offset - 1]) : (n = t.node, o = e ? 0 : t.offset - 1);
+ return {
+ node: n,
+ offset: o
+ }
+ }
+
+ function it(t, e) {
+ var n, o;
+ if(U(t.node) === t.offset) {
+ if(S(t.node)) return null;
+ var i = at(t.node);
+ i ? (n = i, o = 0) : (n = t.node.parentNode, o = et(t.node) + 1)
+ } else nt(t.node) ? (n = t.node.childNodes[t.offset], o = 0) : (n = t.node, o = e ? U(t.node) : t.offset + 1);
+ return {
+ node: n,
+ offset: o
+ }
+ }
+
+ function rt(t, e) {
+ var n, o;
+ if(W(t.node)) return {
+ node: n = t.node.nextSibling,
+ offset: o = 0
+ };
+ if(U(t.node) === t.offset) {
+ if(S(t.node)) return null;
+ var i = at(t.node);
+ i ? (n = i, o = 0) : (n = t.node.parentNode, o = et(t.node) + 1), S(n) && (n = t.node.nextSibling, o = 0)
+ } else if(nt(t.node)) {
+ if(o = 0, W(n = t.node.childNodes[t.offset])) return null
+ } else if(n = t.node, o = e ? U(t.node) : t.offset + 1, W(n)) return null;
+ return {
+ node: n,
+ offset: o
+ }
+ }
+
+ function at(t) {
+ if(t.nextSibling && t.parent === t.nextSibling.parent) return E(t.nextSibling) ? t.nextSibling : at(t.nextSibling)
+ }
+
+ function st(t, e) {
+ return t.node === e.node && t.offset === e.offset
+ }
+
+ function lt(t, e) {
+ var n = e && e.isSkipPaddingBlankHTML,
+ o = e && e.isNotSplitEdgePoint,
+ i = e && e.isDiscardEmptySplits;
+ if(i && (n = !0), Q(t) && (E(t.node) || o)) {
+ if(Z(t)) return t.node;
+ if(X(t)) return t.node.nextSibling
+ }
+ if(E(t.node)) return t.node.splitText(t.offset);
+ var r = t.node.childNodes[t.offset],
+ a = G(t.node.cloneNode(!1), t.node);
+ return Y(a, _(r)), n || (K(t.node), K(a)), i && (W(t.node) && dt(t.node), W(a)) ? (dt(a), t.node.nextSibling) : a
+ }
+
+ function ct(t, e, n) {
+ var o = q(e.node, g.eq(t));
+ return o.length ? 1 === o.length ? lt(e, n) : o.reduce((function(t, o) {
+ return t === e.node && (t = lt(e, n)), lt({
+ node: o,
+ offset: t ? et(t) : U(o)
+ }, n)
+ })) : null
+ }
+
+ function ut(t) {
+ return document.createElement(t)
+ }
+
+ function dt(t, e) {
+ if(t && t.parentNode) {
+ if(t.removeNode) return t.removeNode(e);
+ var n = t.parentNode;
+ if(!e) {
+ for(var o = [], i = 0, r = t.childNodes.length; i < r; i++) o.push(t.childNodes[i]);
+ for(var a = 0, s = o.length; a < s; a++) n.insertBefore(o[a], t)
+ }
+ n.removeChild(t)
+ }
+ }
+ var ht = T("TEXTAREA");
+
+ function ft(t, e) {
+ var n = ht(t[0]) ? t.val() : t.html();
+ return e ? n.replace(/[\n\r]/g, "") : n
+ }
+ var pt = {
+ NBSP_CHAR: x,
+ ZERO_WIDTH_NBSP_CHAR: "\ufeff",
+ blank: j,
+ emptyPara: "
".concat(j, "
"), + makePredByNodeName: T, + isEditable: S, + isControlSizing: function(t) { + return t && i()(t).hasClass("note-control-sizing") + }, + isText: E, + isElement: function(t) { + return t && 1 === t.nodeType + }, + isVoid: $, + isPara: N, + isPurePara: function(t) { + return N(t) && !P(t) + }, + isHeading: function(t) { + return t && /^H[1-7]/.test(t.nodeName.toUpperCase()) + }, + isInline: A, + isBlock: g.not(A), + isBodyInline: function(t) { + return A(t) && !V(t, N) + }, + isBody: O, + isParaInline: function(t) { + return A(t) && !!V(t, N) + }, + isPre: I, + isList: F, + isTable: R, + isData: L, + isCell: H, + isBlockquote: B, + isBodyContainer: z, + isAnchor: M, + isDiv: T("DIV"), + isLi: P, + isBR: T("BR"), + isSpan: T("SPAN"), + isB: T("B"), + isU: T("U"), + isS: T("S"), + isI: T("I"), + isImg: T("IMG"), + isTextarea: ht, + deepestChildIsEmpty: function(t) { + do { + if(null === t.firstElementChild || "" === t.firstElementChild.innerHTML) break + } while (t = t.firstElementChild); + return W(t) + }, + isEmpty: W, + isEmptyAnchor: g.and(M, W), + isClosestSibling: function(t, e) { + return t.nextSibling === e || t.previousSibling === e + }, + withClosestSiblings: function(t, e) { + e = e || g.ok; + var n = []; + return t.previousSibling && e(t.previousSibling) && n.push(t.previousSibling), n.push(t), t.nextSibling && e(t.nextSibling) && n.push(t.nextSibling), n + }, + nodeLength: U, + isLeftEdgePoint: Z, + isRightEdgePoint: X, + isEdgePoint: Q, + isLeftEdgeOf: J, + isRightEdgeOf: tt, + isLeftEdgePointOf: function(t, e) { + return Z(t) && J(t.node, e) + }, + isRightEdgePointOf: function(t, e) { + return X(t) && tt(t.node, e) + }, + prevPoint: ot, + nextPoint: it, + nextPointWithEmptyNode: rt, + isSamePoint: st, + isVisiblePoint: function(t) { + if(E(t.node) || !nt(t.node) || W(t.node)) return !0; + var e = t.node.childNodes[t.offset - 1], + n = t.node.childNodes[t.offset]; + return !(e && !$(e) || n && !$(n)) + }, + prevPointUntil: function(t, e) { + for(; t;) { + if(e(t)) return t; + t = ot(t) + } + return null + }, + nextPointUntil: function(t, e) { + for(; t;) { + if(e(t)) return t; + t = it(t) + } + return null + }, + isCharPoint: function(t) { + if(!E(t.node)) return !1; + var e = t.node.nodeValue.charAt(t.offset - 1); + return e && " " !== e && e !== x + }, + isSpacePoint: function(t) { + if(!E(t.node)) return !1; + var e = t.node.nodeValue.charAt(t.offset - 1); + return " " === e || e === x + }, + walkPoint: function(t, e, n, o) { + for(var i = t; i && (n(i), !st(i, e));) { + i = rt(i, o && t.node !== i.node && e.node !== i.node) + } + }, + ancestor: V, + singleChildAncestor: function(t, e) { + for(t = t.parentNode; t && 1 === U(t);) { + if(e(t)) return t; + if(S(t)) break; + t = t.parentNode + } + return null + }, + listAncestor: q, + lastAncestor: function(t, e) { + var n = q(t); + return C.last(n.filter(e)) + }, + listNext: _, + listPrev: function(t, e) { + e = e || g.fail; + for(var n = []; t && !e(t);) n.push(t), t = t.previousSibling; + return n + }, + listDescendant: function(t, e) { + var n = []; + return e = e || g.ok, + function o(i) { + t !== i && e(i) && n.push(i); + for(var r = 0, a = i.childNodes.length; r < a; r++) o(i.childNodes[r]) + }(t), n + }, + commonAncestor: function(t, e) { + for(var n = q(t), o = e; o; o = o.parentNode) + if(n.indexOf(o) > -1) return o; + return null + }, + wrap: function(t, e) { + var n = t.parentNode, + o = i()("<" + e + ">")[0]; + return n.insertBefore(o, t), o.appendChild(t), o + }, + insertAfter: G, + appendChildNodes: Y, + position: et, + hasChildren: nt, + makeOffsetPath: function(t, e) { + return q(e, g.eq(t)).map(et).reverse() + }, + fromOffsetPath: function(t, e) { + for(var n = t, o = 0, i = e.length; o < i; o++) n = n.childNodes.length <= e[o] ? n.childNodes[n.childNodes.length - 1] : n.childNodes[e[o]]; + return n + }, + splitTree: ct, + splitPoint: function(t, e) { + var n, o, i = e ? N : z, + r = q(t.node, i), + a = C.last(r) || t.node; + i(a) ? (n = r[r.length - 2], o = a) : o = (n = a).parentNode; + var s = n && ct(n, t, { + isSkipPaddingBlankHTML: e, + isNotSplitEdgePoint: e + }); + return s || o !== t.node || (s = t.node.childNodes[t.offset]), { + rightNode: s, + container: o + } + }, + create: ut, + createText: function(t) { + return document.createTextNode(t) + }, + remove: dt, + removeWhile: function(t, e) { + for(; t && !S(t) && e(t);) { + var n = t.parentNode; + dt(t), t = n + } + }, + replace: function(t, e) { + if(t.nodeName.toUpperCase() === e.toUpperCase()) return t; + var n = ut(e); + return t.style.cssText && (n.style.cssText = t.style.cssText), Y(n, C.from(t.childNodes)), G(n, t), dt(t), n + }, + html: function(t, e) { + var n = ft(t); + if(e) { + n = (n = n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g, (function(t, e, n) { + n = n.toUpperCase(); + var o = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n) && !!e, + i = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n); + return t + (o || i ? "\n" : "") + }))).trim() + } + return n + }, + value: ft, + posFromPlaceholder: function(t) { + var e = i()(t), + n = e.offset(), + o = e.outerHeight(!0); + return { + left: n.left, + top: n.top + o + } + }, + attachEvents: function(t, e) { + Object.keys(e).forEach((function(n) { + t.on(n, e[n]) + })) + }, + detachEvents: function(t, e) { + Object.keys(e).forEach((function(n) { + t.off(n, e[n]) + })) + }, + isCustomStyleTag: function(t) { + return t && !E(t) && C.contains(t.classList, "note-styletag") + } + }; + + function mt(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + var vt = function() { + function t(e, n) { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t), this.$note = e, this.memos = {}, this.modules = {}, this.layoutInfo = {}, this.options = i.a.extend(!0, {}, n), i.a.summernote.ui = i.a.summernote.ui_template(this.options), this.ui = i.a.summernote.ui, this.initialize() + } + var e, n, o; + return e = t, (n = [{ + key: "initialize", + value: function() { + return this.layoutInfo = this.ui.createLayout(this.$note), this._initialize(), this.$note.hide(), this + } + }, { + key: "destroy", + value: function() { + this._destroy(), this.$note.removeData("summernote"), this.ui.removeLayout(this.$note, this.layoutInfo) + } + }, { + key: "reset", + value: function() { + var t = this.isDisabled(); + this.code(pt.emptyPara), this._destroy(), this._initialize(), t && this.disable() + } + }, { + key: "_initialize", + value: function() { + var t = this; + this.options.id = g.uniqueId(i.a.now()), this.options.container = this.options.container || this.layoutInfo.editor; + var e = i.a.extend({}, this.options.buttons); + Object.keys(e).forEach((function(n) { + t.memo("button." + n, e[n]) + })); + var n = i.a.extend({}, this.options.modules, i.a.summernote.plugins || {}); + Object.keys(n).forEach((function(e) { + t.module(e, n[e], !0) + })), Object.keys(this.modules).forEach((function(e) { + t.initializeModule(e) + })) + } + }, { + key: "_destroy", + value: function() { + var t = this; + Object.keys(this.modules).reverse().forEach((function(e) { + t.removeModule(e) + })), Object.keys(this.memos).forEach((function(e) { + t.removeMemo(e) + })), this.triggerEvent("destroy", this) + } + }, { + key: "code", + value: function(t) { + var e = this.invoke("codeview.isActivated"); + if(void 0 === t) return this.invoke("codeview.sync"), e ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html(); + e ? this.invoke("codeview.sync", t) : this.layoutInfo.editable.html(t), this.$note.val(t), this.triggerEvent("change", t, this.layoutInfo.editable) + } + }, { + key: "isDisabled", + value: function() { + return "false" === this.layoutInfo.editable.attr("contenteditable") + } + }, { + key: "enable", + value: function() { + this.layoutInfo.editable.attr("contenteditable", !0), this.invoke("toolbar.activate", !0), this.triggerEvent("disable", !1), this.options.editing = !0 + } + }, { + key: "disable", + value: function() { + this.invoke("codeview.isActivated") && this.invoke("codeview.deactivate"), this.layoutInfo.editable.attr("contenteditable", !1), this.options.editing = !1, this.invoke("toolbar.deactivate", !0), this.triggerEvent("disable", !0) + } + }, { + key: "triggerEvent", + value: function() { + var t = C.head(arguments), + e = C.tail(C.from(arguments)), + n = this.options.callbacks[g.namespaceToCamel(t, "on")]; + n && n.apply(this.$note[0], e), this.$note.trigger("summernote." + t, e) + } + }, { + key: "initializeModule", + value: function(t) { + var e = this.modules[t]; + e.shouldInitialize = e.shouldInitialize || g.ok, e.shouldInitialize() && (e.initialize && e.initialize(), e.events && pt.attachEvents(this.$note, e.events)) + } + }, { + key: "module", + value: function(t, e, n) { + if(1 === arguments.length) return this.modules[t]; + this.modules[t] = new e(this), n || this.initializeModule(t) + } + }, { + key: "removeModule", + value: function(t) { + var e = this.modules[t]; + e.shouldInitialize() && (e.events && pt.detachEvents(this.$note, e.events), e.destroy && e.destroy()), delete this.modules[t] + } + }, { + key: "memo", + value: function(t, e) { + if(1 === arguments.length) return this.memos[t]; + this.memos[t] = e + } + }, { + key: "removeMemo", + value: function(t) { + this.memos[t] && this.memos[t].destroy && this.memos[t].destroy(), delete this.memos[t] + } + }, { + key: "createInvokeHandlerAndUpdateState", + value: function(t, e) { + var n = this; + return function(o) { + n.createInvokeHandler(t, e)(o), n.invoke("buttons.updateCurrentStyle") + } + } + }, { + key: "createInvokeHandler", + value: function(t, e) { + var n = this; + return function(o) { + o.preventDefault(); + var r = i()(o.target); + n.invoke(t, e || r.closest("[data-value]").data("value"), r) + } + } + }, { + key: "invoke", + value: function() { + var t = C.head(arguments), + e = C.tail(C.from(arguments)), + n = t.split("."), + o = n.length > 1, + i = o && C.head(n), + r = o ? C.last(n) : C.head(n), + a = this.modules[i || "editor"]; + return !i && this[r] ? this[r].apply(this, e) : a && a[r] && a.shouldInitialize() ? a[r].apply(a, e) : void 0 + } + }]) && mt(e.prototype, n), o && mt(e, o), t + }(); + + function gt(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + + function bt(t, e) { + var n, o, i = t.parentElement(), + r = document.body.createTextRange(), + a = C.from(i.childNodes); + for(n = 0; n < a.length; n++) + if(!pt.isText(a[n])) { + if(r.moveToElementText(a[n]), r.compareEndPoints("StartToStart", t) >= 0) break; + o = a[n] + } + if(0 !== n && pt.isText(a[n - 1])) { + var s = document.body.createTextRange(), + l = null; + s.moveToElementText(o || i), s.collapse(!o), l = o ? o.nextSibling : i.firstChild; + var c = t.duplicate(); + c.setEndPoint("StartToStart", s); + for(var u = c.text.replace(/[\r\n]/g, "").length; u > l.nodeValue.length && l.nextSibling;) u -= l.nodeValue.length, l = l.nextSibling; + l.nodeValue; + e && l.nextSibling && pt.isText(l.nextSibling) && u === l.nodeValue.length && (u -= l.nodeValue.length, l = l.nextSibling), i = l, n = u + } + return { + cont: i, + offset: n + } + } + + function kt(t) { + var e = document.body.createTextRange(), + n = function t(e, n) { + var o, i; + if(pt.isText(e)) { + var r = pt.listPrev(e, g.not(pt.isText)), + a = C.last(r).previousSibling; + o = a || e.parentNode, n += C.sum(C.tail(r), pt.nodeLength), i = !a + } else { + if(o = e.childNodes[n] || e, pt.isText(o)) return t(o, 0); + n = 0, i = !1 + } + return { + node: o, + collapseToStart: i, + offset: n + } + }(t.node, t.offset); + return e.moveToElementText(n.node), e.collapse(n.collapseToStart), e.moveStart("character", n.offset), e + } + i.a.fn.extend({ + summernote: function() { + var t = i.a.type(C.head(arguments)), + e = "string" === t, + n = "object" === t, + o = i.a.extend({}, i.a.summernote.options, n ? C.head(arguments) : {}); + o.langInfo = i.a.extend(!0, {}, i.a.summernote.lang["en-US"], i.a.summernote.lang[o.lang]), o.icons = i.a.extend(!0, {}, i.a.summernote.options.icons, o.icons), o.tooltip = "auto" === o.tooltip ? !m.isSupportTouch : o.tooltip, this.each((function(t, e) { + var n = i()(e); + if(!n.data("summernote")) { + var r = new vt(n, o); + n.data("summernote", r), n.data("summernote").triggerEvent("init", r.layoutInfo) + } + })); + var r = this.first(); + if(r.length) { + var a = r.data("summernote"); + if(e) return a.invoke.apply(a, C.from(arguments)); + o.focus && a.invoke("editor.focus") + } + return this + } + }); + var yt = function() { + function t(e, n, o, i) { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t), this.sc = e, this.so = n, this.ec = o, this.eo = i, this.isOnEditable = this.makeIsOn(pt.isEditable), this.isOnList = this.makeIsOn(pt.isList), this.isOnAnchor = this.makeIsOn(pt.isAnchor), this.isOnCell = this.makeIsOn(pt.isCell), this.isOnData = this.makeIsOn(pt.isData) + } + var e, n, o; + return e = t, (n = [{ + key: "nativeRange", + value: function() { + if(m.isW3CRangeSupport) { + var t = document.createRange(); + return t.setStart(this.sc, this.so), t.setEnd(this.ec, this.eo), t + } + var e = kt({ + node: this.sc, + offset: this.so + }); + return e.setEndPoint("EndToEnd", kt({ + node: this.ec, + offset: this.eo + })), e + } + }, { + key: "getPoints", + value: function() { + return { + sc: this.sc, + so: this.so, + ec: this.ec, + eo: this.eo + } + } + }, { + key: "getStartPoint", + value: function() { + return { + node: this.sc, + offset: this.so + } + } + }, { + key: "getEndPoint", + value: function() { + return { + node: this.ec, + offset: this.eo + } + } + }, { + key: "select", + value: function() { + var t = this.nativeRange(); + if(m.isW3CRangeSupport) { + var e = document.getSelection(); + e.rangeCount > 0 && e.removeAllRanges(), e.addRange(t) + } else t.select(); + return this + } + }, { + key: "scrollIntoView", + value: function(t) { + var e = i()(t).height(); + return t.scrollTop + e < this.sc.offsetTop && (t.scrollTop += Math.abs(t.scrollTop + e - this.sc.offsetTop)), this + } + }, { + key: "normalize", + value: function() { + var e = function(t, e) { + if(!t) return t; + if(pt.isVisiblePoint(t) && (!pt.isEdgePoint(t) || pt.isRightEdgePoint(t) && !e || pt.isLeftEdgePoint(t) && e || pt.isRightEdgePoint(t) && e && pt.isVoid(t.node.nextSibling) || pt.isLeftEdgePoint(t) && !e && pt.isVoid(t.node.previousSibling) || pt.isBlock(t.node) && pt.isEmpty(t.node))) return t; + var n = pt.ancestor(t.node, pt.isBlock), + o = !1; + if(!o) { + var i = pt.prevPoint(t) || { + node: null + }; + o = (pt.isLeftEdgePointOf(t, n) || pt.isVoid(i.node)) && !e + } + var r = !1; + if(!r) { + var a = pt.nextPoint(t) || { + node: null + }; + r = (pt.isRightEdgePointOf(t, n) || pt.isVoid(a.node)) && e + } + if(o || r) { + if(pt.isVisiblePoint(t)) return t; + e = !e + } + return(e ? pt.nextPointUntil(pt.nextPoint(t), pt.isVisiblePoint) : pt.prevPointUntil(pt.prevPoint(t), pt.isVisiblePoint)) || t + }, + n = e(this.getEndPoint(), !1), + o = this.isCollapsed() ? n : e(this.getStartPoint(), !0); + return new t(o.node, o.offset, n.node, n.offset) + } + }, { + key: "nodes", + value: function(t, e) { + t = t || g.ok; + var n = e && e.includeAncestor, + o = e && e.fullyContains, + i = this.getStartPoint(), + r = this.getEndPoint(), + a = [], + s = []; + return pt.walkPoint(i, r, (function(e) { + var i; + pt.isEditable(e.node) || (o ? (pt.isLeftEdgePoint(e) && s.push(e.node), pt.isRightEdgePoint(e) && C.contains(s, e.node) && (i = e.node)) : i = n ? pt.ancestor(e.node, t) : e.node, i && t(i) && a.push(i)) + }), !0), C.unique(a) + } + }, { + key: "commonAncestor", + value: function() { + return pt.commonAncestor(this.sc, this.ec) + } + }, { + key: "expand", + value: function(e) { + var n = pt.ancestor(this.sc, e), + o = pt.ancestor(this.ec, e); + if(!n && !o) return new t(this.sc, this.so, this.ec, this.eo); + var i = this.getPoints(); + return n && (i.sc = n, i.so = 0), o && (i.ec = o, i.eo = pt.nodeLength(o)), new t(i.sc, i.so, i.ec, i.eo) + } + }, { + key: "collapse", + value: function(e) { + return e ? new t(this.sc, this.so, this.sc, this.so) : new t(this.ec, this.eo, this.ec, this.eo) + } + }, { + key: "splitText", + value: function() { + var e = this.sc === this.ec, + n = this.getPoints(); + return pt.isText(this.ec) && !pt.isEdgePoint(this.getEndPoint()) && this.ec.splitText(this.eo), pt.isText(this.sc) && !pt.isEdgePoint(this.getStartPoint()) && (n.sc = this.sc.splitText(this.so), n.so = 0, e && (n.ec = n.sc, n.eo = this.eo - this.so)), new t(n.sc, n.so, n.ec, n.eo) + } + }, { + key: "deleteContents", + value: function() { + if(this.isCollapsed()) return this; + var e = this.splitText(), + n = e.nodes(null, { + fullyContains: !0 + }), + o = pt.prevPointUntil(e.getStartPoint(), (function(t) { + return !C.contains(n, t.node) + })), + r = []; + return i.a.each(n, (function(t, e) { + var n = e.parentNode; + o.node !== n && 1 === pt.nodeLength(n) && r.push(n), pt.remove(e, !1) + })), i.a.each(r, (function(t, e) { + pt.remove(e, !1) + })), new t(o.node, o.offset, o.node, o.offset).normalize() + } + }, { + key: "makeIsOn", + value: function(t) { + return function() { + var e = pt.ancestor(this.sc, t); + return !!e && e === pt.ancestor(this.ec, t) + } + } + }, { + key: "isLeftEdgeOf", + value: function(t) { + if(!pt.isLeftEdgePoint(this.getStartPoint())) return !1; + var e = pt.ancestor(this.sc, t); + return e && pt.isLeftEdgeOf(this.sc, e) + } + }, { + key: "isCollapsed", + value: function() { + return this.sc === this.ec && this.so === this.eo + } + }, { + key: "wrapBodyInlineWithPara", + value: function() { + if(pt.isBodyContainer(this.sc) && pt.isEmpty(this.sc)) return this.sc.innerHTML = pt.emptyPara, new t(this.sc.firstChild, 0, this.sc.firstChild, 0); + var e, n = this.normalize(); + if(pt.isParaInline(this.sc) || pt.isPara(this.sc)) return n; + if(pt.isInline(n.sc)) { + var o = pt.listAncestor(n.sc, g.not(pt.isInline)); + e = C.last(o), pt.isInline(e) || (e = o[o.length - 2] || n.sc.childNodes[n.so]) + } else e = n.sc.childNodes[n.so > 0 ? n.so - 1 : 0]; + if(e) { + var i = pt.listPrev(e, pt.isParaInline).reverse(); + if((i = i.concat(pt.listNext(e.nextSibling, pt.isParaInline))).length) { + var r = pt.wrap(C.head(i), "p"); + pt.appendChildNodes(r, C.tail(i)) + } + } + return this.normalize() + } + }, { + key: "insertNode", + value: function(t) { + var e = this; + (pt.isText(t) || pt.isInline(t)) && (e = this.wrapBodyInlineWithPara().deleteContents()); + var n = pt.splitPoint(e.getStartPoint(), pt.isInline(t)); + return n.rightNode ? (n.rightNode.parentNode.insertBefore(t, n.rightNode), pt.isEmpty(n.rightNode) && pt.isPara(t) && n.rightNode.parentNode.removeChild(n.rightNode)) : n.container.appendChild(t), t + } + }, { + key: "pasteHTML", + value: function(t) { + t = i.a.trim(t); + var e = i()("").html(t)[0], + n = C.from(e.childNodes), + o = this, + r = !1; + return o.so >= 0 && (n = n.reverse(), r = !0), n = n.map((function(t) { + return o.insertNode(t) + })), r && (n = n.reverse()), n + } + }, { + key: "toString", + value: function() { + var t = this.nativeRange(); + return m.isW3CRangeSupport ? t.toString() : t.text + } + }, { + key: "getWordRange", + value: function(e) { + var n = this.getEndPoint(); + if(!pt.isCharPoint(n)) return this; + var o = pt.prevPointUntil(n, (function(t) { + return !pt.isCharPoint(t) + })); + return e && (n = pt.nextPointUntil(n, (function(t) { + return !pt.isCharPoint(t) + }))), new t(o.node, o.offset, n.node, n.offset) + } + }, { + key: "getWordsRange", + value: function(e) { + var n = this.getEndPoint(), + o = function(t) { + return !pt.isCharPoint(t) && !pt.isSpacePoint(t) + }; + if(o(n)) return this; + var i = pt.prevPointUntil(n, o); + return e && (n = pt.nextPointUntil(n, o)), new t(i.node, i.offset, n.node, n.offset) + } + }, { + key: "getWordsMatchRange", + value: function(e) { + var n = this.getEndPoint(), + o = pt.prevPointUntil(n, (function(o) { + if(!pt.isCharPoint(o) && !pt.isSpacePoint(o)) return !0; + var i = new t(o.node, o.offset, n.node, n.offset), + r = e.exec(i.toString()); + return r && 0 === r.index + })), + i = new t(o.node, o.offset, n.node, n.offset), + r = i.toString(), + a = e.exec(r); + return a && a[0].length === r.length ? i : null + } + }, { + key: "bookmark", + value: function(t) { + return { + s: { + path: pt.makeOffsetPath(t, this.sc), + offset: this.so + }, + e: { + path: pt.makeOffsetPath(t, this.ec), + offset: this.eo + } + } + } + }, { + key: "paraBookmark", + value: function(t) { + return { + s: { + path: C.tail(pt.makeOffsetPath(C.head(t), this.sc)), + offset: this.so + }, + e: { + path: C.tail(pt.makeOffsetPath(C.last(t), this.ec)), + offset: this.eo + } + } + } + }, { + key: "getClientRects", + value: function() { + return this.nativeRange().getClientRects() + } + }]) && gt(e.prototype, n), o && gt(e, o), t + }(), + wt = { + create: function(t, e, n, o) { + if(4 === arguments.length) return new yt(t, e, n, o); + if(2 === arguments.length) return new yt(t, e, n = t, o = e); + var i = this.createFromSelection(); + if(!i && 1 === arguments.length) { + var r = arguments[0]; + return pt.isEditable(r) && (r = r.lastChild), this.createFromBodyElement(r, pt.emptyPara === arguments[0].innerHTML) + } + return i + }, + createFromBodyElement: function(t) { + var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], + n = this.createFromNode(t); + return n.collapse(e) + }, + createFromSelection: function() { + var t, e, n, o; + if(m.isW3CRangeSupport) { + var i = document.getSelection(); + if(!i || 0 === i.rangeCount) return null; + if(pt.isBody(i.anchorNode)) return null; + var r = i.getRangeAt(0); + t = r.startContainer, e = r.startOffset, n = r.endContainer, o = r.endOffset + } else { + var a = document.selection.createRange(), + s = a.duplicate(); + s.collapse(!1); + var l = a; + l.collapse(!0); + var c = bt(l, !0), + u = bt(s, !1); + pt.isText(c.node) && pt.isLeftEdgePoint(c) && pt.isTextNode(u.node) && pt.isRightEdgePoint(u) && u.node.nextSibling === c.node && (c = u), t = c.cont, e = c.offset, n = u.cont, o = u.offset + } + return new yt(t, e, n, o) + }, + createFromNode: function(t) { + var e = t, + n = 0, + o = t, + i = pt.nodeLength(o); + return pt.isVoid(e) && (n = pt.listPrev(e).length - 1, e = e.parentNode), pt.isBR(o) ? (i = pt.listPrev(o).length - 1, o = o.parentNode) : pt.isVoid(o) && (i = pt.listPrev(o).length, o = o.parentNode), this.create(e, n, o, i) + }, + createFromNodeBefore: function(t) { + return this.createFromNode(t).collapse(!0) + }, + createFromNodeAfter: function(t) { + return this.createFromNode(t).collapse() + }, + createFromBookmark: function(t, e) { + var n = pt.fromOffsetPath(t, e.s.path), + o = e.s.offset, + i = pt.fromOffsetPath(t, e.e.path), + r = e.e.offset; + return new yt(n, o, i, r) + }, + createFromParaBookmark: function(t, e) { + var n = t.s.offset, + o = t.e.offset, + i = pt.fromOffsetPath(C.head(e), t.s.path), + r = pt.fromOffsetPath(C.last(e), t.e.path); + return new yt(i, n, r, o) + } + }, + Ct = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + SPACE: 32, + DELETE: 46, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + NUM0: 48, + NUM1: 49, + NUM2: 50, + NUM3: 51, + NUM4: 52, + NUM5: 53, + NUM6: 54, + NUM7: 55, + NUM8: 56, + B: 66, + E: 69, + I: 73, + J: 74, + K: 75, + L: 76, + R: 82, + S: 83, + U: 85, + V: 86, + Y: 89, + Z: 90, + SLASH: 191, + LEFTBRACKET: 219, + BACKSLASH: 220, + RIGHTBRACKET: 221, + HOME: 36, + END: 35, + PAGEUP: 33, + PAGEDOWN: 34 + }, + xt = { + isEdit: function(t) { + return C.contains([Ct.BACKSPACE, Ct.TAB, Ct.ENTER, Ct.SPACE, Ct.DELETE], t) + }, + isMove: function(t) { + return C.contains([Ct.LEFT, Ct.UP, Ct.RIGHT, Ct.DOWN], t) + }, + isNavigation: function(t) { + return C.contains([Ct.HOME, Ct.END, Ct.PAGEUP, Ct.PAGEDOWN], t) + }, + nameFromCode: g.invertObject(Ct), + code: Ct + }; + + function St(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + var Tt = function() { + function t(e) { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t), this.stack = [], this.stackOffset = -1, this.context = e, this.$editable = e.layoutInfo.editable, this.editable = this.$editable[0] + } + var e, n, o; + return e = t, (n = [{ + key: "makeSnapshot", + value: function() { + var t = wt.create(this.editable); + return { + contents: this.$editable.html(), + bookmark: t && t.isOnEditable() ? t.bookmark(this.editable) : { + s: { + path: [], + offset: 0 + }, + e: { + path: [], + offset: 0 + } + } + } + } + }, { + key: "applySnapshot", + value: function(t) { + null !== t.contents && this.$editable.html(t.contents), null !== t.bookmark && wt.createFromBookmark(this.editable, t.bookmark).select() + } + }, { + key: "rewind", + value: function() { + this.$editable.html() !== this.stack[this.stackOffset].contents && this.recordUndo(), this.stackOffset = 0, this.applySnapshot(this.stack[this.stackOffset]) + } + }, { + key: "commit", + value: function() { + this.stack = [], this.stackOffset = -1, this.recordUndo() + } + }, { + key: "reset", + value: function() { + this.stack = [], this.stackOffset = -1, this.$editable.html(""), this.recordUndo() + } + }, { + key: "undo", + value: function() { + this.$editable.html() !== this.stack[this.stackOffset].contents && this.recordUndo(), this.stackOffset > 0 && (this.stackOffset--, this.applySnapshot(this.stack[this.stackOffset])) + } + }, { + key: "redo", + value: function() { + this.stack.length - 1 > this.stackOffset && (this.stackOffset++, this.applySnapshot(this.stack[this.stackOffset])) + } + }, { + key: "recordUndo", + value: function() { + this.stackOffset++, this.stack.length > this.stackOffset && (this.stack = this.stack.slice(0, this.stackOffset)), this.stack.push(this.makeSnapshot()), this.stack.length > this.context.options.historyLimit && (this.stack.shift(), this.stackOffset -= 1) + } + }]) && St(e.prototype, n), o && St(e, o), t + }(); + + function Et(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + var $t = function() { + function t() { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t) + } + var e, n, o; + return e = t, (n = [{ + key: "jQueryCSS", + value: function(t, e) { + if(m.jqueryVersion < 1.9) { + var n = {}; + return i.a.each(e, (function(e, o) { + n[o] = t.css(o) + })), n + } + return t.css(e) + } + }, { + key: "fromNode", + value: function(t) { + var e = this.jQueryCSS(t, ["font-family", "font-size", "text-align", "list-style-type", "line-height"]) || {}, + n = t[0].style.fontSize || e["font-size"]; + return e["font-size"] = parseInt(n, 10), e["font-size-unit"] = n.match(/[a-z%]+$/), e + } + }, { + key: "stylePara", + value: function(t, e) { + i.a.each(t.nodes(pt.isPara, { + includeAncestor: !0 + }), (function(t, n) { + i()(n).css(e) + })) + } + }, { + key: "styleNodes", + value: function(t, e) { + t = t.splitText(); + var n = e && e.nodeName || "SPAN", + o = !(!e || !e.expandClosestSibling), + r = !(!e || !e.onlyPartialContains); + if(t.isCollapsed()) return [t.insertNode(pt.create(n))]; + var a = pt.makePredByNodeName(n), + s = t.nodes(pt.isText, { + fullyContains: !0 + }).map((function(t) { + return pt.singleChildAncestor(t, a) || pt.wrap(t, n) + })); + if(o) { + if(r) { + var l = t.nodes(); + a = g.and(a, (function(t) { + return C.contains(l, t) + })) + } + return s.map((function(t) { + var e = pt.withClosestSiblings(t, a), + n = C.head(e), + o = C.tail(e); + return i.a.each(o, (function(t, e) { + pt.appendChildNodes(n, e.childNodes), pt.remove(e) + })), C.head(e) + })) + } + return s + } + }, { + key: "current", + value: function(t) { + var e = i()(pt.isElement(t.sc) ? t.sc : t.sc.parentNode), + n = this.fromNode(e); + try { + n = i.a.extend(n, { + "font-bold": document.queryCommandState("bold") ? "bold" : "normal", + "font-italic": document.queryCommandState("italic") ? "italic" : "normal", + "font-underline": document.queryCommandState("underline") ? "underline" : "normal", + "font-subscript": document.queryCommandState("subscript") ? "subscript" : "normal", + "font-superscript": document.queryCommandState("superscript") ? "superscript" : "normal", + "font-strikethrough": document.queryCommandState("strikethrough") ? "strikethrough" : "normal", + "font-family": document.queryCommandValue("fontname") || n["font-family"] + }) + } catch(t) {} + if(t.isOnList()) { + var o = ["circle", "disc", "disc-leading-zero", "square"].indexOf(n["list-style-type"]) > -1; + n["list-style"] = o ? "unordered" : "ordered" + } else n["list-style"] = "none"; + var r = pt.ancestor(t.sc, pt.isPara); + if(r && r.style["line-height"]) n["line-height"] = r.style.lineHeight; + else { + var a = parseInt(n["line-height"], 10) / parseInt(n["font-size"], 10); + n["line-height"] = a.toFixed(1) + } + return n.anchor = t.isOnAnchor() && pt.ancestor(t.sc, pt.isAnchor), n.ancestors = pt.listAncestor(t.sc, pt.isEditable), n.range = t, n + } + }]) && Et(e.prototype, n), o && Et(e, o), t + }(); + + function Nt(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + var It = function() { + function t() { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t) + } + var e, n, o; + return e = t, (n = [{ + key: "insertOrderedList", + value: function(t) { + this.toggleList("OL", t) + } + }, { + key: "insertUnorderedList", + value: function(t) { + this.toggleList("UL", t) + } + }, { + key: "indent", + value: function(t) { + var e = this, + n = wt.create(t).wrapBodyInlineWithPara(), + o = n.nodes(pt.isPara, { + includeAncestor: !0 + }), + r = C.clusterBy(o, g.peq2("parentNode")); + i.a.each(r, (function(t, n) { + var o = C.head(n); + if(pt.isLi(o)) { + var r = e.findList(o.previousSibling); + r ? n.map((function(t) { + return r.appendChild(t) + })) : (e.wrapList(n, o.parentNode.nodeName), n.map((function(t) { + return t.parentNode + })).map((function(t) { + return e.appendToPrevious(t) + }))) + } else i.a.each(n, (function(t, e) { + i()(e).css("marginLeft", (function(t, e) { + return(parseInt(e, 10) || 0) + 25 + })) + })) + })), n.select() + } + }, { + key: "outdent", + value: function(t) { + var e = this, + n = wt.create(t).wrapBodyInlineWithPara(), + o = n.nodes(pt.isPara, { + includeAncestor: !0 + }), + r = C.clusterBy(o, g.peq2("parentNode")); + i.a.each(r, (function(t, n) { + var o = C.head(n); + pt.isLi(o) ? e.releaseList([n]) : i.a.each(n, (function(t, e) { + i()(e).css("marginLeft", (function(t, e) { + return(e = parseInt(e, 10) || 0) > 25 ? e - 25 : "" + })) + })) + })), n.select() + } + }, { + key: "toggleList", + value: function(t, e) { + var n = this, + o = wt.create(e).wrapBodyInlineWithPara(), + r = o.nodes(pt.isPara, { + includeAncestor: !0 + }), + a = o.paraBookmark(r), + s = C.clusterBy(r, g.peq2("parentNode")); + if(C.find(r, pt.isPurePara)) { + var l = []; + i.a.each(s, (function(e, o) { + l = l.concat(n.wrapList(o, t)) + })), r = l + } else { + var c = o.nodes(pt.isList, { + includeAncestor: !0 + }).filter((function(e) { + return !i.a.nodeName(e, t) + })); + c.length ? i.a.each(c, (function(e, n) { + pt.replace(n, t) + })) : r = this.releaseList(s, !0) + } + wt.createFromParaBookmark(a, r).select() + } + }, { + key: "wrapList", + value: function(t, e) { + var n = C.head(t), + o = C.last(t), + i = pt.isList(n.previousSibling) && n.previousSibling, + r = pt.isList(o.nextSibling) && o.nextSibling, + a = i || pt.insertAfter(pt.create(e || "UL"), o); + return t = t.map((function(t) { + return pt.isPurePara(t) ? pt.replace(t, "LI") : t + })), pt.appendChildNodes(a, t), r && (pt.appendChildNodes(a, C.from(r.childNodes)), pt.remove(r)), t + } + }, { + key: "releaseList", + value: function(t, e) { + var n = this, + o = []; + return i.a.each(t, (function(t, r) { + var a = C.head(r), + s = C.last(r), + l = e ? pt.lastAncestor(a, pt.isList) : a.parentNode, + c = l.parentNode; + if("LI" === l.parentNode.nodeName) r.map((function(t) { + var e = n.findNextSiblings(t); + c.nextSibling ? c.parentNode.insertBefore(t, c.nextSibling) : c.parentNode.appendChild(t), e.length && (n.wrapList(e, l.nodeName), t.appendChild(e[0].parentNode)) + })), 0 === l.children.length && c.removeChild(l), 0 === c.childNodes.length && c.parentNode.removeChild(c); + else { + var u = l.childNodes.length > 1 ? pt.splitTree(l, { + node: s.parentNode, + offset: pt.position(s) + 1 + }, { + isSkipPaddingBlankHTML: !0 + }) : null, + d = pt.splitTree(l, { + node: a.parentNode, + offset: pt.position(a) + }, { + isSkipPaddingBlankHTML: !0 + }); + r = e ? pt.listDescendant(d, pt.isLi) : C.from(d.childNodes).filter(pt.isLi), !e && pt.isList(l.parentNode) || (r = r.map((function(t) { + return pt.replace(t, "P") + }))), i.a.each(C.from(r).reverse(), (function(t, e) { + pt.insertAfter(e, l) + })); + var h = C.compact([l, d, u]); + i.a.each(h, (function(t, e) { + var n = [e].concat(pt.listDescendant(e, pt.isList)); + i.a.each(n.reverse(), (function(t, e) { + pt.nodeLength(e) || pt.remove(e, !0) + })) + })) + } + o = o.concat(r) + })), o + } + }, { + key: "appendToPrevious", + value: function(t) { + return t.previousSibling ? pt.appendChildNodes(t.previousSibling, [t]) : this.wrapList([t], "LI") + } + }, { + key: "findList", + value: function(t) { + return t ? C.find(t.children, (function(t) { + return ["OL", "UL"].indexOf(t.nodeName) > -1 + })) : null + } + }, { + key: "findNextSiblings", + value: function(t) { + for(var e = []; t.nextSibling;) e.push(t.nextSibling), t = t.nextSibling; + return e + } + }]) && Nt(e.prototype, n), o && Nt(e, o), t + }(); + + function Pt(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + var Rt = function() { + function t(e) { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t), this.bullet = new It, this.options = e.options + } + var e, n, o; + return e = t, (n = [{ + key: "insertTab", + value: function(t, e) { + var n = pt.createText(new Array(e + 1).join(pt.NBSP_CHAR)); + (t = t.deleteContents()).insertNode(n, !0), (t = wt.create(n, e)).select() + } + }, { + key: "insertParagraph", + value: function(t, e) { + e = (e = (e = e || wt.create(t)).deleteContents()).wrapBodyInlineWithPara(); + var n, o = pt.ancestor(e.sc, pt.isPara); + if(o) { + if(pt.isLi(o) && (pt.isEmpty(o) || pt.deepestChildIsEmpty(o))) return void this.bullet.toggleList(o.parentNode.nodeName); + var r = null; + if(1 === this.options.blockquoteBreakingLevel ? r = pt.ancestor(o, pt.isBlockquote) : 2 === this.options.blockquoteBreakingLevel && (r = pt.lastAncestor(o, pt.isBlockquote)), r) { + n = i()(pt.emptyPara)[0], pt.isRightEdgePoint(e.getStartPoint()) && pt.isBR(e.sc.nextSibling) && i()(e.sc.nextSibling).remove(); + var a = pt.splitTree(r, e.getStartPoint(), { + isDiscardEmptySplits: !0 + }); + a ? a.parentNode.insertBefore(n, a) : pt.insertAfter(n, r) + } else { + n = pt.splitTree(o, e.getStartPoint()); + var s = pt.listDescendant(o, pt.isEmptyAnchor); + s = s.concat(pt.listDescendant(n, pt.isEmptyAnchor)), i.a.each(s, (function(t, e) { + pt.remove(e) + })), (pt.isHeading(n) || pt.isPre(n) || pt.isCustomStyleTag(n)) && pt.isEmpty(n) && (n = pt.replace(n, "p")) + } + } else { + var l = e.sc.childNodes[e.so]; + n = i()(pt.emptyPara)[0], l ? e.sc.insertBefore(n, l) : e.sc.appendChild(n) + } + wt.create(n, 0).normalize().select().scrollIntoView(t) + } + }]) && Pt(e.prototype, n), o && Pt(e, o), t + }(); + + function Lt(t, e) { + for(var n = 0; n < e.length; n++) { + var o = e[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) + } + } + var At = function t(e, n, o, i) { + var r = { + colPos: 0, + rowPos: 0 + }, + a = [], + s = []; + + function l(t, e, n, o, i, r, s) { + var l = { + baseRow: n, + baseCell: o, + isRowSpan: i, + isColSpan: r, + isVirtual: s + }; + a[t] || (a[t] = []), a[t][e] = l + } + + function c(t, e, n, o) { + return { + baseCell: t.baseCell, + action: e, + virtualTable: { + rowIndex: n, + cellIndex: o + } + } + } + + function u(t, e) { + if(!a[t]) return e; + if(!a[t][e]) return e; + for(var n = e; a[t][n];) + if(n++, !a[t][n]) return n + } + + function d(t, e) { + var n = u(t.rowIndex, e.cellIndex), + o = e.colSpan > 1, + i = e.rowSpan > 1, + a = t.rowIndex === r.rowPos && e.cellIndex === r.colPos; + l(t.rowIndex, n, t, e, i, o, !1); + var s = e.attributes.rowSpan ? parseInt(e.attributes.rowSpan.value, 10) : 0; + if(s > 1) + for(var c = 1; c < s; c++) { + var d = t.rowIndex + c; + h(d, n, e, a), l(d, n, t, e, !0, o, !0) + } + var f = e.attributes.colSpan ? parseInt(e.attributes.colSpan.value, 10) : 0; + if(f > 1) + for(var p = 1; p < f; p++) { + var m = u(t.rowIndex, n + p); + h(t.rowIndex, m, e, a), l(t.rowIndex, m, t, e, i, !0, !0) + } + } + + function h(t, e, n, o) { + t === r.rowPos && r.colPos >= n.cellIndex && n.cellIndex <= e && !o && r.colPos++ + } + + function f(e) { + switch(n) { + case t.where.Column: + if(e.isColSpan) return t.resultAction.SubtractSpanCount; + break; + case t.where.Row: + if(!e.isVirtual && e.isRowSpan) return t.resultAction.AddCell; + if(e.isRowSpan) return t.resultAction.SubtractSpanCount + } + return t.resultAction.RemoveCell + } + + function p(e) { + switch(n) { + case t.where.Column: + if(e.isColSpan) return t.resultAction.SumSpanCount; + if(e.isRowSpan && e.isVirtual) return t.resultAction.Ignore; + break; + case t.where.Row: + if(e.isRowSpan) return t.resultAction.SumSpanCount; + if(e.isColSpan && e.isVirtual) return t.resultAction.Ignore + } + return t.resultAction.AddCell + } + this.getActionList = function() { + for(var e = n === t.where.Row ? r.rowPos : -1, i = n === t.where.Column ? r.colPos : -1, l = 0, u = !0; u;) { + var d = e >= 0 ? e : l, + h = i >= 0 ? i : l, + m = a[d]; + if(!m) return u = !1, s; + var v = m[h]; + if(!v) return u = !1, s; + var g = t.resultAction.Ignore; + switch(o) { + case t.requestAction.Add: + g = p(v); + break; + case t.requestAction.Delete: + g = f(v) + } + s.push(c(v, g, d, h)), l++ + } + return s + }, e && e.tagName && ("td" === e.tagName.toLowerCase() || "th" === e.tagName.toLowerCase()) && (r.colPos = e.cellIndex, e.parentElement && e.parentElement.tagName && "tr" === e.parentElement.tagName.toLowerCase() && (r.rowPos = e.parentElement.rowIndex)), + function() { + for(var t = i.rows, e = 0; e < t.length; e++) + for(var n = t[e].cells, o = 0; o < n.length; o++) d(t[e], n[o]) + }() + }; + At.where = { + Row: 0, + Column: 1 + }, At.requestAction = { + Add: 0, + Delete: 1 + }, At.resultAction = { + Ignore: 0, + SubtractSpanCount: 1, + RemoveCell: 2, + AddCell: 3, + SumSpanCount: 4 + }; + var Ft = function() { + function t() { + ! function(t, e) { + if(!(t instanceof e)) throw new TypeError("Cannot call a class as a function") + }(this, t) + } + var e, n, o; + return e = t, (n = [{ + key: "tab", + value: function(t, e) { + var n = pt.ancestor(t.commonAncestor(), pt.isCell), + o = pt.ancestor(n, pt.isTable), + i = pt.listDescendant(o, pt.isCell), + r = C[e ? "prev" : "next"](i, n); + r && wt.create(r, 0).select() + } + }, { + key: "addRow", + value: function(t, e) { + for(var n = pt.ancestor(t.commonAncestor(), pt.isCell), o = i()(n).closest("tr"), r = this.recoverAttributes(o), a = i()("