froala-editor
Version:
The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.
7 lines (6 loc) • 661 kB
JavaScript
/*!
* froala_editor v3.1.0 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2020 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FroalaEditor=t()}(this,function(){"use strict";function Fe(e){return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),a=1;a<arguments.length;a++){var r=arguments[a];if(null!=r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},writable:!0,configurable:!0}),function(){var i=/^\s*:scope/gi,s=/,\s*:scope/gi,l=document.createElement("div");function e(e,t){var o=e[t];e[t]=function(e){var t,n=!1,a=!1;if(e&&(e.match(i)||e.match(s))){this.parentNode||(l.appendChild(this),a=!0);var r=this.parentNode;return this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=o.call(r,e.replace(i,"#".concat(this.id)).replace(s,",#".concat(this.id))),n&&(this.id=""),a&&l.removeChild(this),t}return o.call(this,e)}}try{l.querySelectorAll(":scope *")}catch(t){e(Element.prototype,"querySelector"),e(Element.prototype,"querySelectorAll"),e(HTMLElement.prototype,"querySelector"),e(HTMLElement.prototype,"querySelectorAll")}}();function $e(e,t,n){if("string"!=typeof e)return new $e.Bootstrap(e,t,n);var a=document.querySelectorAll(e);t&&t.iframe_document&&(a=t.iframe_document.querySelectorAll(e));for(var r=[],o=0;o<a.length;o++){var i=a[o]["data-froala.editor"];i?r.push(i):r.push(new $e.Bootstrap(a[o],t,n))}return 1==r.length?r[0]:r}$e.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call($e)},Object.assign($e,{DEFAULTS:{initOnClick:!1,pluginsEnabled:null},MODULES:{},PLUGINS:{},VERSION:"3.1.0",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),$e.MODULES.node=function(i){var n=i.$;function s(e){return e&&"IFRAME"!==e.tagName?Array.prototype.slice.call(e.childNodes||[]):[]}function l(e){return!!e&&(e.nodeType===Node.ELEMENT_NODE&&0<=$e.BLOCK_TAGS.indexOf(e.tagName.toLowerCase()))}function c(e){var t={},n=e.attributes;if(n)for(var a=0;a<n.length;a++){var r=n[a];t[r.nodeName]=r.value}return t}function t(e){for(var t="",n=c(e),a=Object.keys(n).sort(),r=0;r<a.length;r++){var o=a[r],i=n[o];i.indexOf("'")<0&&0<=i.indexOf('"')?t+=" ".concat(o,"='").concat(i,"'"):(0<=i.indexOf('"')&&0<=i.indexOf("'")&&(i=i.replace(/"/g,""")),t+=" ".concat(o,'="').concat(i,'"'))}return t}function a(e){return e===i.el}return{isBlock:l,isEmpty:function d(e,t){if(!e)return!0;if(e.querySelector("table"))return!1;var n=s(e);1===n.length&&l(n[0])&&(n=s(n[0]));for(var a=!1,r=0;r<n.length;r++){var o=n[r];if(!(t&&i.node.hasClass(o,"fr-marker")||o.nodeType===Node.TEXT_NODE&&0===o.textContent.length)){if("BR"!==o.tagName&&0<(o.textContent||"").replace(/\u200B/gi,"").replace(/\n/g,"").length)return!1;if(a)return!1;"BR"===o.tagName&&(a=!0)}}return!(e.querySelectorAll($e.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(i.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll($e.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(i.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function r(e){for(;e&&e.parentNode!==i.el&&(!e.parentNode||!i.node.hasClass(e.parentNode,"fr-inner"));)if(l(e=e.parentNode))return e;return null},deepestParent:function o(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=!0),t.push(i.el),0<=t.indexOf(e.parentNode)||e.parentNode&&i.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=$e.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)&&n)return null;for(;t.indexOf(e.parentNode)<0&&e.parentNode&&!i.node.hasClass(e.parentNode,"fr-inner")&&($e.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)<0||!n)&&(!l(e)||l(e.parentNode))&&(!l(e)||!l(e.parentNode)||!n);)e=e.parentNode;return e},rawAttributes:c,attributes:t,clearAttributes:function f(e){for(var t=e.attributes,n=t.length-1;0<=n;n--){var a=t[n];e.removeAttribute(a.nodeName)}},openTagString:function p(e){return"<".concat(e.tagName.toLowerCase()).concat(t(e),">")},closeTagString:function u(e){return"</".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function h(e,t){void 0===t&&(t=!0);for(var n=e.previousSibling;n&&t&&i.node.hasClass(n,"fr-marker");)n=n.previousSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&h(n)},isLastSibling:function g(e,t){void 0===t&&(t=!0);for(var n=e.nextSibling;n&&t&&i.node.hasClass(n,"fr-marker");)n=n.nextSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&g(n)},isList:function m(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function v(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:a,contents:s,isVoid:function b(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=$e.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function E(e){return e===i.doc.activeElement&&(!i.doc.hasFocus||i.doc.hasFocus())&&Boolean(a(e)||e.type||e.href||~e.tabIndex)},isEditable:function T(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},isDeletable:function A(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function C(e,t){return e instanceof n&&(e=e.get(0)),e&&e.classList&&e.classList.contains(t)},filter:function S(e){return i.browser.msie?e:{acceptNode:e}}}},Object.assign($e.DEFAULTS,{htmlAllowedTags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","queue","rp","rt","ruby","s","samp","script","style","section","select","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video","wbr"],htmlRemoveTags:["script","style"],htmlAllowedAttrs:["accept","accept-charset","accesskey","action","align","allowfullscreen","allowtransparency","alt","async","autocomplete","autofocus","autoplay","autosave","background","bgcolor","border","charset","cellpadding","cellspacing","checked","cite","class","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","data","data-.*","datetime","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","frameborder","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","ismap","itemprop","keytype","kind","label","lang","language","list","loop","low","max","maxlength","media","method","min","mozallowfullscreen","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","src","srcdoc","srclang","srcset","start","step","summary","spellcheck","style","tabindex","target","title","type","translate","usemap","value","valign","webkitallowfullscreen","width","wrap"],htmlAllowedStyleProps:[".*"],htmlAllowComments:!0,htmlUntouched:!1,fullPage:!1}),$e.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},$e.MODULES.clean=function(f){var d,p,u,h,g=f.$;function r(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;var t,n=f.node.contents(e),a=[];for(t=0;t<n.length;t++)n[t].nodeType!==Node.ELEMENT_NODE||f.node.isVoid(n[t])?n[t].nodeType===Node.TEXT_NODE&&(n[t].textContent=n[t].textContent.replace(/\u200b/g,"")):n[t].textContent.replace(/\u200b/g,"").length!==n[t].textContent.length&&r(n[t]);if(e.nodeType===Node.ELEMENT_NODE&&!f.node.isVoid(e)&&(e.normalize(),n=f.node.contents(e),a=e.querySelectorAll(".fr-marker"),n.length-a.length==0)){for(t=0;t<n.length;t++)if(n[t].nodeType===Node.ELEMENT_NODE&&(n[t].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(t=0;t<a.length;t++)e.parentNode.insertBefore(a[t].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}function s(e,t){if(e.nodeType===Node.COMMENT_NODE)return"\x3c!--".concat(e.nodeValue,"--\x3e");if(e.nodeType===Node.TEXT_NODE)return t?e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").replace(/\u0009/g,"");if(e.nodeType!==Node.ELEMENT_NODE)return e.outerHTML;if(e.nodeType===Node.ELEMENT_NODE&&0<=["STYLE","SCRIPT","NOSCRIPT"].indexOf(e.tagName))return e.outerHTML;if(e.nodeType===Node.ELEMENT_NODE&&"svg"===e.tagName){var n=document.createElement("div"),a=e.cloneNode(!0);return n.appendChild(a),n.innerHTML}if("IFRAME"===e.tagName)return e.outerHTML.replace(/</g,"<").replace(/>/g,">");var r=e.childNodes;if(0===r.length)return e.outerHTML;for(var o="",i=0;i<r.length;i++)"PRE"===e.tagName&&(t=!0),o+=s(r[i],t);return f.node.openTagString(e)+o+f.node.closeTagString(e)}var l=[];function m(e){var t=e.replace(/;;/gi,";");return";"!==(t=t.replace(/^;/gi,"")).charAt(t.length)&&(t+=";"),t}function c(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=t.match(u),a=null;"style"===t&&f.opts.htmlAllowedStyleProps.length&&(a=e[t].match(h)),n&&a?e[t]=m(a.join(";")):n&&("style"!==t||a)||delete e[t]}for(var r="",o=Object.keys(e).sort(),i=0;i<o.length;i++)e[t=o[i]].indexOf('"')<0?r+=" ".concat(t,'="').concat(e[t],'"'):r+=" ".concat(t,"='").concat(e[t],"'");return r}function v(e,t){var n,a=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV");g(a).append(e);var r="";if(a){var o=f.node.contents(a);for(n=0;n<o.length;n++)t(o[n]);for(o=f.node.contents(a),n=0;n<o.length;n++)r+=s(o[n])}return r}function b(e,t,n){var a=e=function o(e){return l=[],e=(e=(e=(e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return l.push(e),"[FROALA.EDITOR.SCRIPT ".concat(l.length-1,"]")})).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return l.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(l.length-1,"]")})).replace(/<meta((?:[\w\W]*?)) http-equiv="/g,'<meta$1 data-fr-http-equiv="')).replace(/<img((?:[\w\W]*?)) src="/g,'<img$1 data-fr-src="')}(e),r=null;return f.opts.fullPage&&(a=f.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n&&(r=f.html.extractNode(e,"head")||"")),a=v(a,t),r&&(r=v(r,t)),function i(e){return e=(e=(e=e.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=f.opts.htmlRemoveTags.indexOf("script")?"":l[parseInt(t,10)]})).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){return 0<=f.opts.htmlRemoveTags.indexOf("noscript")?"":l[parseInt(t,10)].replace(/</g,"<").replace(/>/g,">")})).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}(function s(e,t,n){if(f.opts.fullPage){var a=f.html.extractDoctype(n),r=c(f.html.extractNodeAttrs(n,"html"));t=null===t?f.html.extractNode(n,"head")||"<title></title>":t;var o=c(f.html.extractNodeAttrs(n,"head")),i=c(f.html.extractNodeAttrs(n,"body"));return"".concat(a,"<html").concat(r,"><head").concat(o,">").concat(t,"</head><body").concat(i,">").concat(e,"</body></html>")}return e}(a,r,e))}function E(e){var t=f.doc.createElement("DIV");return t.innerText=e,t.textContent}function T(e){for(var t=f.node.contents(e),n=0;n<t.length;n++)t[n].nodeType!==Node.TEXT_NODE&&T(t[n]);!function c(i){if("SPAN"===i.tagName&&0<=(i.getAttribute("class")||"").indexOf("fr-marker"))return!1;if("PRE"===i.tagName&&function l(e){var t=e.innerHTML;0<=t.indexOf("\n")&&(e.innerHTML=t.replace(/\n/g,"<br>"))}(i),i.nodeType===Node.ELEMENT_NODE&&(i.getAttribute("data-fr-src")&&0!==i.getAttribute("data-fr-src").indexOf("blob:")&&i.setAttribute("data-fr-src",f.helpers.sanitizeURL(E(i.getAttribute("data-fr-src")))),i.getAttribute("href")&&i.setAttribute("href",f.helpers.sanitizeURL(E(i.getAttribute("href")))),i.getAttribute("src")&&i.setAttribute("src",f.helpers.sanitizeURL(E(i.getAttribute("src")))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(i.tagName)&&(i.innerHTML=i.innerHTML.trim())),!f.opts.pasteAllowLocalImages&&i.nodeType===Node.ELEMENT_NODE&&"IMG"===i.tagName&&i.getAttribute("data-fr-src")&&0===i.getAttribute("data-fr-src").indexOf("file://"))return i.parentNode.removeChild(i),!1;if(i.nodeType===Node.ELEMENT_NODE&&$e.HTML5Map[i.tagName]&&""===f.node.attributes(i)){var e=$e.HTML5Map[i.tagName],t="<".concat(e,">").concat(i.innerHTML,"</").concat(e,">");i.insertAdjacentHTML("beforebegin",t),(i=i.previousSibling).parentNode.removeChild(i.nextSibling)}if(f.opts.htmlAllowComments||i.nodeType!==Node.COMMENT_NODE)if(i.tagName&&i.tagName.match(p))"STYLE"==i.tagName&&f.helpers.isMac()&&function(){for(var e,n=i.innerHTML.trim(),a=[],t=/{([^}]+)}/g;e=t.exec(n);)a.push(e[1]);for(var r=function r(t){var e=n.substring(0,n.indexOf("{")).trim();i.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",a[t])}),n=n.substring(n.indexOf("}")+1)},o=0;-1!=n.indexOf("{");o++)r(o)}(),i.parentNode.removeChild(i);else if(i.tagName&&!i.tagName.match(d))"svg"===i.tagName?i.parentNode.removeChild(i):f.browser.safari&&"path"===i.tagName&&i.parentNode&&"svg"===i.parentNode.tagName||(i.outerHTML=i.innerHTML);else{var n=i.attributes;if(n)for(var a=n.length-1;0<=a;a--){var r=n[a],o=r.nodeName.match(u),s=null;"style"===r.nodeName&&f.opts.htmlAllowedStyleProps.length&&(s=r.value.match(h)),o&&s?r.value=m(s.join(";")):o&&("style"!==r.nodeName||s)||i.removeAttribute(r.nodeName)}}else 0!==i.data.indexOf("[FROALA.EDITOR")&&i.parentNode.removeChild(i)}(e)}return{_init:function e(){f.opts.fullPage&&g.merge(f.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function A(e,t,n,a){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===a&&(a=!1);var r,o=g.merge([],f.opts.htmlAllowedTags);for(r=0;r<t.length;r++)0<=o.indexOf(t[r])&&o.splice(o.indexOf(t[r]),1);var i=g.merge([],f.opts.htmlAllowedAttrs);for(r=0;r<n.length;r++)0<=i.indexOf(n[r])&&i.splice(i.indexOf(n[r]),1);return i.push("data-fr-.*"),i.push("fr-.*"),d=new RegExp("^".concat(o.join("$|^"),"$"),"gi"),u=new RegExp("^".concat(i.join("$|^"),"$"),"gi"),p=new RegExp("^".concat(f.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),h=f.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(f.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=b(e,T,!0)},toHTML5:function a(){var e=f.el.querySelectorAll(Object.keys($e.HTML5Map).join(","));if(e.length){var t=!1;f.el.querySelector(".fr-marker")||(f.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===f.node.attributes(e[n])&&g(e[n]).replaceWith("<".concat($e.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat($e.HTML5Map[e[n].tagName],">"));t&&f.selection.restore()}},tables:function t(){!function s(){for(var e=f.el.querySelectorAll("tr"),t=0;t<e.length;t++){for(var n=e[t].children,a=!0,r=0;r<n.length;r++)if("TH"!==n[r].tagName){a=!1;break}if(!1!==a&&0!==n.length){for(var o=e[t];o&&"TABLE"!==o.tagName&&"THEAD"!==o.tagName;)o=o.parentNode;var i=o;"THEAD"!==i.tagName&&(i=f.doc.createElement("THEAD"),o.insertBefore(i,o.firstChild)),i.appendChild(e[t])}}}()},lists:function C(){!function s(){var e,t=[];do{if(t.length){var n=t[0],a=f.doc.createElement("ul");n.parentNode.insertBefore(a,n);do{var r=n;n=n.nextSibling,a.appendChild(r)}while(n&&"LI"===n.tagName)}t=[];for(var o=f.el.querySelectorAll("li"),i=0;i<o.length;i++)e=o[i],f.node.isList(e.parentNode)||t.push(o[i])}while(0<t.length)}(),function o(){for(var e=f.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(f.node.isList(n.previousSibling)&&f.node.openTagString(n)===f.node.openTagString(n.previousSibling)){for(var a=f.node.contents(n),r=0;r<a.length;r++)n.previousSibling.appendChild(a[r]);n.parentNode.removeChild(n)}}}(),function i(){for(var e=f.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=f.node.contents(e[t]),a=null,r=n.length-1;0<=r;r--)"LI"!==n[r].tagName&&"UL"!=n[r].tagName&&"OL"!=n[r].tagName?(a||(a=g(f.doc.createElement("LI"))).insertBefore(n[r]),a.prepend(n[r])):a=null}(),function l(){var e,t,n;do{t=!1;var a=f.el.querySelectorAll("li:empty");for(e=0;e<a.length;e++)a[e].parentNode.removeChild(a[e]);var r=f.el.querySelectorAll("ul, ol");for(e=0;e<r.length;e++)(n=r[e]).querySelector("LI")||(t=!0,n.parentNode.removeChild(n))}while(!0===t)}(),function r(){for(var e=f.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),t=0;t<e.length;t++){var n=e[t],a=n.previousSibling;a&&("LI"===a.tagName?a.appendChild(n):g(n).wrap("<li></li>"))}}(),function c(){for(var e=f.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(n.nextSibling){var a=n.nextSibling,r=g(f.doc.createElement("LI"));g(n.parentNode).after(r.get(0));do{var o=a;a=a.nextSibling,r.append(o)}while(a)}}}(),function d(){for(var e=f.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(f.node.isFirstSibling(n))g(n).before("<br/>");else if(n.previousSibling&&"BR"===n.previousSibling.tagName){for(var a=n.previousSibling.previousSibling;a&&f.node.hasClass(a,"fr-marker");)a=a.previousSibling;a&&"BR"!==a.tagName&&g(n.previousSibling).remove()}}}(),function n(){for(var e=f.el.querySelectorAll("li:empty"),t=0;t<e.length;t++)g(e[t]).remove()}()},invisibleSpaces:function n(e){return e.replace(/\u200b/g,"").length===e.length?e:f.clean.exec(e,r)},exec:b}},$e.XS=0,$e.SM=1,$e.MD=2,$e.LG=3;$e.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),$e.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-z\\u00a1-\\uffff0-9@?\\|!^=%&\\/~+#-\\'*-_{}]*)|())",$e.LinkRegExTLD="((".concat($e.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))"),$e.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat($e.LinkRegExCommon,")"),$e.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat($e.LinkRegExCommon,")"),$e.LinkRegExWWW="(www\\.".concat($e.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),$e.LinkRegEx="(".concat($e.LinkRegExTLD,"|").concat($e.LinkRegExHTTP,"|").concat($e.LinkRegExWWW,"|").concat($e.LinkRegExAuth,")").concat($e.LinkRegExEnd),$e.LinkProtocols=["mailto","tel","sms","notes","data"],$e.MAIL_REGEX=/.+@.+\..+/i,$e.MODULES.helpers=function(o){var i,s=o.$;function e(){var e={},t=function o(){var e,t=-1;return"Microsoft Internet Explorer"===navigator.appName?(e=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(e=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))),t}();if(0<t)e.msie=!0;else{var n=navigator.userAgent.toLowerCase(),a=/(edge)[ /]([\w.]+)/.exec(n)||/(chrome)[ /]([\w.]+)/.exec(n)||/(webkit)[ /]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[],r=a[1]||"";a[2];a[1]&&(e[r]=!0),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0)}return e.msie&&(e.version=t),e}function t(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&!r()}function n(){return/(Android)/g.test(navigator.userAgent)&&!r()}function a(){return/(Blackberry)/g.test(navigator.userAgent)}function r(){return/(Windows Phone)/gi.test(navigator.userAgent)}var l=null;return{_init:function c(){o.browser=e()},isIOS:t,isMac:function d(){return null===l&&(l=0<=navigator.platform.toUpperCase().indexOf("MAC")),l},isAndroid:n,isBlackberry:a,isWindowsPhone:r,isMobile:function f(){return n()||t()||a()},isEmail:function p(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&$e.MAIL_REGEX.test(e)},requestAnimationFrame:function u(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function h(e){return parseInt(e,10)||0},screenSize:function g(){try{var e=s(".fr-box").width();if(e<768)return $e.XS;if(768<=e&&e<992)return $e.SM;if(992<=e&&e<1200)return $e.MD;if(1200<=e)return $e.LG}catch(t){return $e.LG}},isTouch:function m(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function v(e){return/^(https?:|ftps?:|)\/\//i.test(e)?e:/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)?e:new RegExp("^(".concat($e.LinkProtocols.join("|"),"):"),"i").test(e)?e:e=encodeURIComponent(e).replace(/%23/g,"#").replace(/%2F/g,"/").replace(/%25/g,"%").replace(/mailto%3A/gi,"mailto:").replace(/file%3A/gi,"file:").replace(/sms%3A/gi,"sms:").replace(/tel%3A/gi,"tel:").replace(/notes%3A/gi,"notes:").replace(/data%3Aimage/gi,"data:image").replace(/blob%3A/gi,"blob:").replace(/%3A(\d)/gi,":$1").replace(/webkit-fake-url%3A/gi,"webkit-fake-url:").replace(/%3F/g,"?").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/&/g,"&").replace(/%2C/g,",").replace(/%3B/g,";").replace(/%2B/g,"+").replace(/%40/g,"@").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%7B/g,"{").replace(/%7D/g,"}")},isArray:function b(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===Fe(e)&&"number"==typeof e.length},RGBToHex:function E(e){function t(e){return"0".concat(parseInt(e,10).toString(16)).slice(-2)}try{return e&&"transparent"!==e?/^#[0-9A-F]{6}$/i.test(e)?e:(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/),"#".concat(t(e[1])).concat(t(e[2])).concat(t(e[3])).toUpperCase()):""}catch(n){return null}},HEXtoRGB:function T(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,a){return t+t+n+n+a+a});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?"rgb(".concat(parseInt(t[1],16),", ").concat(parseInt(t[2],16),", ").concat(parseInt(t[3],16),")"):""},isURL:function A(e){return!!/^(https?:|ftps?:|)\/\//i.test(e)&&(e=String(e).replace(/</g,"%3C").replace(/>/g,"%3E").replace(/"/g,"%22").replace(/ /g,"%20"),new RegExp("^".concat($e.LinkRegExHTTP).concat($e.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function C(e){e.css||(e=s(e));var t=(e.css("text-align")||"").replace(/-(.*)-/g,"");if(["left","right","justify","center"].indexOf(t)<0){if(!i){var n=s('<div dir="'.concat("rtl"===o.opts.direction?"rtl":"auto",'" style="text-align: ').concat(o.$el.css("text-align"),'; position: fixed; left: -3000px;"><span id="s1">.</span><span id="s2">.</span></div>'));s("body").first().append(n);var a=n.find("#s1").get(0).getBoundingClientRect().left,r=n.find("#s2").get(0).getBoundingClientRect().left;n.remove(),i=a<r?"left":"right"}t=i}return t},scrollTop:function S(){return o.o_win.pageYOffset?o.o_win.pageYOffset:o.o_doc.documentElement&&o.o_doc.documentElement.scrollTop?o.o_doc.documentElement.scrollTop:o.o_doc.body.scrollTop?o.o_doc.body.scrollTop:0},scrollLeft:function y(){return o.o_win.pageXOffset?o.o_win.pageXOffset:o.o_doc.documentElement&&o.o_doc.documentElement.scrollLeft?o.o_doc.documentElement.scrollLeft:o.o_doc.body.scrollLeft?o.o_doc.body.scrollLeft:0},isInViewPort:function R(e){var t=e.getBoundingClientRect();return 0<=(t={top:Math.round(t.top),bottom:Math.round(t.bottom)}).top&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)||t.top<=0&&t.bottom>=(window.innerHeight||document.documentElement.clientHeight)}}},$e.MODULES.events=function(l){var e,o=l.$,i={};function s(e,t,n){m(e,t,n)}function c(e){if(void 0===e&&(e=!0),!l.$wp)return!1;if(l.helpers.isIOS()&&l.$win.get(0).focus(),l.core.hasFocus())return!1;if(!l.core.hasFocus()&&e){var t=l.$win.scrollTop();if(l.browser.msie&&l.$box&&l.$box.css("position","fixed"),l.browser.msie&&l.$wp&&l.$wp.css("overflow","visible"),l.browser.msie&&l.$sc&&l.$sc.css("position","fixed"),p(),l.el.focus(),l.events.trigger("focus"),f(),l.browser.msie&&l.$sc&&l.$sc.css("position",""),l.browser.msie&&l.$box&&l.$box.css("position",""),l.browser.msie&&l.$wp&&l.$wp.css("overflow","auto"),t!==l.$win.scrollTop()&&l.$win.scrollTop(t),!l.selection.info(l.el).atStart)return!1}if(!l.core.hasFocus()||0<l.$el.find(".fr-marker").length)return!1;if(l.selection.info(l.el).atStart&&l.selection.isCollapsed()&&null!==l.html.defaultTag()){var n=l.markers.insert();if(n&&!l.node.blockParent(n)){o(n).remove();var a=l.$el.find(l.html.blockTagsQuery()).get(0);a&&(o(a).prepend($e.MARKERS),l.selection.restore())}else n&&o(n).remove()}}var d=!1;function f(){e=!0}function p(){e=!1}function u(){return e}function h(e,t,n){var a,r=e.split(" ");if(1<r.length){for(var o=0;o<r.length;o++)h(r[o],t,n);return!0}void 0===n&&(n=!1),a=0!==e.indexOf("shared.")?(i[e]=i[e]||[],i[e]):(l.shared._events[e]=l.shared._events[e]||[],l.shared._events[e]),n?a.unshift(t):a.push(t)}var g=[];function m(e,t,n,a,r){"function"==typeof n&&(r=a,a=n,n=!1);var o=r?l.shared.$_events:g,i=r?l.sid:l.id,s="".concat(t.trim().split(" ").join(".ed".concat(i," ")),".ed").concat(i);n?e.on(s,n,a):e.on(s,a),o.push([e,s])}function t(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function v(e,t,n){if(!l.edit.isDisabled()||n){var a,r;if(0!==e.indexOf("shared."))a=i[e];else{if(0<l.shared.count)return!1;a=l.shared._events[e]}if(a)for(var o=0;o<a.length;o++)if(!1===(r=a[o].apply(l,t)))return!1;return(!l.opts.events||!l.opts.events[e]||!1!==(r=l.opts.events[e].apply(l,t)))&&r}}function b(){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&delete i[e]}function E(){for(var e in l.shared._events)Object.prototype.hasOwnProperty.call(l.shared._events,e)&&delete l.shared._events[e]}return{_init:function T(){l.shared.$_events=l.shared.$_events||[],l.shared._events={},function e(){l.helpers.isMobile()?(l._mousedown="touchstart",l._mouseup="touchend",l._move="touchmove",l._mousemove="touchmove"):(l._mousedown="mousedown",l._mouseup="mouseup",l._move="",l._mousemove="mousemove")}(),function t(){s(l.$el,"click mouseup mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){v(e.type,[e])}),h("mousedown",function(){for(var e=0;e<$e.INSTANCES.length;e++)$e.INSTANCES[e]!==l&&$e.INSTANCES[e].popups&&$e.INSTANCES[e].popups.areVisible()&&$e.INSTANCES[e].$el.find(".fr-marker").remove()})}(),function n(){s(l.$win,l._mousedown,function(e){v("window.mousedown",[e]),f()}),s(l.$win,l._mouseup,function(e){v("window.mouseup",[e])}),s(l.$win,"cut copy keydown keyup touchmove touchend",function(e){v("window.".concat(e.type),[e])})}(),function a(){s(l.$doc,"dragend drop",function(e){v("document.".concat(e.type),[e])})}(),function r(){s(l.$el,"keydown keypress keyup input",function(e){v(e.type,[e])})}(),function o(){s(l.$el,"focus",function(e){u()&&(c(!1),!1===d&&v(e.type,[e]))}),s(l.$el,"blur",function(e){u()&&!0===d&&(v(e.type,[e]),f())}),m(l.$el,"mousedown",'[contenteditable="true"]',function(){p(),l.$el.blur()}),h("focus",function(){d=!0}),h("blur",function(){d=!1})}(),f(),function i(){s(l.$el,"cut copy paste beforepaste",function(e){v(e.type,[e])})}(),h("destroy",b),h("shared.destroy",E)},on:h,trigger:v,bindClick:function a(e,t,n){m(e,l._mousedown,t,function(e){l.edit.isDisabled()||function n(e){var t=o(e.currentTarget);return l.edit.isDisabled()||l.node.hasClass(t.get(0),"fr-disabled")?(e.preventDefault(),!1):"mousedown"===e.type&&1!==e.which||(l.helpers.isMobile()||e.preventDefault(),(l.helpers.isAndroid()||l.helpers.isWindowsPhone())&&0===t.parents(".fr-dropdown-menu").length&&(e.preventDefault(),e.stopPropagation()),t.addClass("fr-selected"),void l.events.trigger("commands.mousedown",[t]))}(e)},!0),m(e,"".concat(l._mouseup," ").concat(l._move),t,function(e){l.edit.isDisabled()||function r(e,t){var n=o(e.currentTarget);if(l.edit.isDisabled()||l.node.hasClass(n.get(0),"fr-disabled"))return e.preventDefault(),!1;if("mouseup"===e.type&&1!==e.which)return!0;if(l.button.getButtons(".fr-selected",!0).get(0)==n.get(0)&&!l.node.hasClass(n.get(0),"fr-selected"))return!0;if("touchmove"!==e.type){if(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!l.node.hasClass(n.get(0),"fr-selected"))return l.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),!1;if(l.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),n.data("dragging")||n.attr("disabled"))return n.removeData("dragging"),!1;var a=n.data("timeout");a&&(clearTimeout(a),n.removeData("timeout")),t.apply(l,[e])}else n.data("timeout")||n.data("timeout",setTimeout(function(){n.data("dragging",!0)},100))}(e,n)},!0),m(e,"mousedown click mouseup",t,function(e){l.edit.isDisabled()||e.stopPropagation()},!0),h("window.mouseup",function(){l.edit.isDisabled()||(e.find(t).removeClass("fr-selected"),f())}),m(e,"mouseover",t,function(){o(this).hasClass("fr-options")&&o(this).prev(".fr-btn").addClass("fr-btn-hover"),o(this).next(".fr-btn").hasClass("fr-options")&&o(this).next(".fr-btn").addClass("fr-btn-hover")}),m(e,"mouseout",t,function(){o(this).hasClass("fr-options")&&o(this).prev(".fr-btn").removeClass("fr-btn-hover"),o(this).next(".fr-btn").hasClass("fr-options")&&o(this).next(".fr-btn").removeClass("fr-btn-hover")})},disableBlur:p,enableBlur:f,blurActive:u,focus:c,chainTrigger:function A(e,t,n){if(!l.edit.isDisabled()||n){var a,r;if(0!==e.indexOf("shared."))a=i[e];else{if(0<l.shared.count)return!1;a=l.shared._events[e]}if(a)for(var o=0;o<a.length;o++)void 0!==(r=a[o].apply(l,[t]))&&(t=r);return l.opts.events&&l.opts.events[e]&&void 0!==(r=l.opts.events[e].apply(l,[t]))&&(t=r),t}},$on:m,$off:function n(){t(g),g=[],0===l.shared.count&&(t(l.shared.$_events),l.shared.$_events=[])}}},Object.assign($e.DEFAULTS,{indentMargin:20}),$e.COMMANDS={bold:{title:"Bold",toggle:!0,refresh:function(e){var t=this.format.is("strong");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},italic:{title:"Italic",toggle:!0,refresh:function(e){var t=this.format.is("em");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},underline:{title:"Underline",toggle:!0,refresh:function(e){var t=this.format.is("u");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},strikeThrough:{title:"Strikethrough",toggle:!0,refresh:function(e){var t=this.format.is("s");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},subscript:{title:"Subscript",toggle:!0,refresh:function(e){var t=this.format.is("sub");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},superscript:{title:"Superscript",toggle:!0,refresh:function(e){var t=this.format.is("sup");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},outdent:{title:"Decrease Indent"},indent:{title:"Increase Indent"},undo:{title:"Undo",undo:!1,forcedRefresh:!0,disabled:!0},redo:{title:"Redo",undo:!1,forcedRefresh:!0,disabled:!0},insertHR:{title:"Insert Horizontal Line"},clearFormatting:{title:"Clear Formatting"},selectAll:{title:"Select All",undo:!1},moreText:{title:"More Text",undo:!1},moreParagraph:{title:"More Paragraph",undo:!1},moreRich:{title:"More Rich",undo:!1},moreMisc:{title:"More Misc",undo:!1}},$e.RegisterCommand=function(e,t){$e.COMMANDS[e]=t},$e.MODULES.commands=function(i){var s=i.$;function r(e){return i.html.defaultTag()&&(e="<".concat(i.html.defaultTag(),">").concat(e,"</").concat(i.html.defaultTag(),">")),e}var o={bold:function(){e("bold","strong")},subscript:function(){i.format.is("sup")&&i.format.remove("sup"),e("subscript","sub")},superscript:function(){i.format.is("sub")&&i.format.remove("sub"),e("superscript","sup")},italic:function(){e("italic","em")},strikeThrough:function(){e("strikeThrough","s")},underline:function(){e("underline","u")},undo:function(){i.undo.run()},redo:function(){i.undo.redo()},indent:function(){a(1)},outdent:function(){a(-1)},show:function(){i.opts.toolbarInline&&i.toolbar.showInline(null,!0)},insertHR:function(){i.selection.remove();var e="";i.core.isEmpty()&&(e=r(e="<br>")),i.html.insert('<hr id="fr-just" class="fr-just">'.concat(e));var t,n=i.$el.find("hr#fr-just").length?i.$el.find("hr#fr-just"):i.$el.find(".fr-just");if(n.removeAttr("id"),n.removeAttr("class"),0===n.next().length){var a=i.html.defaultTag();a?n.after(s(i.doc.createElement(a)).append("<br>").get(0)):n.after("<br>")}n.prev().is("hr")?t=i.selection.setAfter(n.get(0),!1):n.next().is("hr")?t=i.selection.setBefore(n.get(0),!1):i.selection.setAfter(n.get(0),!1)||i.selection.setBefore(n.get(0),!1),t||void 0===t||(e=r(e="".concat($e.MARKERS,"<br>")),n.after(e)),i.selection.restore()},clearFormatting:function(){i.format.remove()},selectAll:function(){i.doc.execCommand("selectAll",!1,!1)},moreText:function(e){t(e)},moreParagraph:function(e){t(e)},moreRich:function(e){t(e)},moreMisc:function(e){t(e)}};function t(e){!function n(e){var t=i.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("data-group-name"),'"]'));i.$tb.find(".fr-open").not(e).removeClass("fr-open"),e.toggleClass("fr-open"),i.$tb.find(".fr-more-toolbar").removeClass("fr-overflow-visible"),i.$tb.find(".fr-expanded").not(t).length?(i.$tb.find(".fr-expanded").toggleClass("fr-expanded"),t.toggleClass("fr-expanded")):(t.toggleClass("fr-expanded"),i.$box.toggleClass("fr-toolbar-open"),i.$tb.toggleClass("fr-toolbar-open"))}(i.$tb.find("[data-cmd=".concat(e,"]"))),i.toolbar.setMoreToolbarsHeight()}function n(e,t){if(!1!==i.events.trigger("commands.before",s.merge([e],t||[]))){var n=$e.COMMANDS[e]&&$e.COMMANDS[e].callback||o[e],a=!0,r=!1;$e.COMMANDS[e]&&("undefined"!=typeof $e.COMMANDS[e].focus&&(a=$e.COMMANDS[e].focus),"undefined"!=typeof $e.COMMANDS[e].accessibilityFocus&&(r=$e.COMMANDS[e].accessibilityFocus)),(!i.core.hasFocus()&&a&&!i.popups.areVisible()||!i.core.hasFocus()&&r&&i.accessibility.hasFocus())&&i.events.focus(!0),$e.COMMANDS[e]&&!1!==$e.COMMANDS[e].undo&&(i.$el.find(".fr-marker").length&&(i.events.disableBlur(),i.selection.restore()),i.undo.saveStep()),n&&n.apply(i,s.merge([e],t||[])),i.events.trigger("commands.after",s.merge([e],t||[])),$e.COMMANDS[e]&&!1!==$e.COMMANDS[e].undo&&i.undo.saveStep()}}function e(e,t){i.format.toggle(t)}function a(e){i.selection.save(),i.html.wrap(!0,!0,!0,!0),i.selection.restore();for(var t=i.selection.blocks(),n=0;n<t.length;n++)if("LI"!==t[n].tagName||"LI"!==t[n].parentNode.tagName){var a=s(t[n]);"LI"!=t[n].tagName&&"LI"==t[n].parentNode.tagName&&(a=s(t[n].parentNode));var r="rtl"===i.opts.direction||"rtl"===a.css("direction")?"margin-right":"margin-left",o=i.helpers.getPX(a.css(r));if(a.width()<2*i.opts.indentMargin&&0<e)continue;a.css(r,Math.max(o+e*i.opts.indentMargin,0)||""),a.removeClass("fr-temp-div")}i.selection.save(),i.html.unwrap(),i.selection.restore()}function l(e){return function(){n(e)}}var c={};for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(c[d]=l(d));return Object.assign(c,{exec:n,_init:function f(){i.events.on("keydown",function(e){var t=i.selection.element();if(t&&"HR"===t.tagName&&!i.keys.isArrow(e.which))return e.preventDefault(),!1}),i.events.on("keyup",function(e){var t=i.selection.element();if(t&&"HR"===t.tagName)if(e.which===$e.KEYCODE.ARROW_LEFT||e.which===$e.KEYCODE.ARROW_UP){if(t.previousSibling)return i.node.isBlock(t.previousSibling)?i.selection.setAtEnd(t.previousSibling):s(t).before($e.MARKERS),i.selection.restore(),!1}else if((e.which===$e.KEYCODE.ARROW_RIGHT||e.which===$e.KEYCODE.ARROW_DOWN)&&t.nextSibling)return i.node.isBlock(t.nextSibling)?i.selection.setAtStart(t.nextSibling):s(t).after($e.MARKERS),i.selection.restore(),!1}),i.events.on("mousedown",function(e){if(e.target&&"HR"===e.target.tagName)return e.preventDefault(),e.stopPropagation(),!1}),i.events.on("mouseup",function(){var e=i.selection.element();e===i.selection.endElement()&&e&&"HR"===e.tagName&&(e.nextSibling&&(i.node.isBlock(e.nextSibling)?i.selection.setAtStart(e.nextSibling):s(e).after($e.MARKERS)),i.selection.restore())})}})},$e.MODULES.cursorLists=function(g){var m=g.$;function v(e){for(var t=e;"LI"!==t.tagName;)t=t.parentNode;return t}function b(e){for(var t=e;!g.node.isList(t);)t=t.parentNode;return t}return{_startEnter:function E(e){var t,n=v(e),a=n.nextSibling,r=n.previousSibling,o=g.html.defaultTag();if(g.node.isEmpty(n,!0)&&a){for(var i="",s="",l=e.parentNode;!g.node.isList(l)&&l.parentNode&&("LI"!==l.parentNode.tagName||l.parentNode===n);)i=g.node.openTagString(l)+i,s+=g.node.closeTagString(l),l=l.parentNode;i=g.node.openTagString(l)+i,s+=g.node.closeTagString(l);var c="";for(c=l.parentNode&&"LI"===l.parentNode.tagName?"".concat(s,"<li>").concat($e.MARKERS,"<br>").concat(i):o?"".concat(s,"<").concat(o,">").concat($e.MARKERS,"<br></").concat(o,">").concat(i):"".concat(s+$e.MARKERS,"<br>").concat(i);["UL","OL"].indexOf(l.tagName)<0||l.parentNode&&"LI"===l.parentNode.tagName;)l=l.parentNode;m(n).replaceWith('<span id="fr-break"></span>');var d=g.node.openTagString(l)+m(l).html()+g.node.closeTagString(l);d=d.replace(/<span id="fr-break"><\/span>/g,c),m(l).replaceWith(d),g.$el.find("li:empty").remove()}else if(r&&a||!g.node.isEmpty(n,!0)){for(var f="<br>",p=e.parentNode;p&&"LI"!==p.tagName;)f=g.node.openTagString(p)+f+g.node.closeTagString(p),p=p.parentNode;m(n).before("<li>".concat(f,"</li>")),m(e).remove()}else if(r){t=b(n);for(var u="".concat($e.MARKERS,"<br>"),h=e.parentNode;h&&"LI"!==h.tagName;)u=g.node.openTagString(h)+u+g.node.closeTagString(h),h=h.parentNode;t.parentNode&&"LI"===t.parentNode.tagName?m(t.parentNode).after("<li>".concat(u,"</li>")):o?m(t).after("<".concat(o,">").concat(u,"</").concat(o,">")):m(t).after(u),m(n).remove()}else(t=b(n)).parentNode&&"LI"===t.parentNode.tagName?a?m(t.parentNode).before("".concat(g.node.openTagString(n)+$e.MARKERS,"<br></li>")):m(t.parentNode).after("".concat(g.node.openTagString(n)+$e.MARKERS,"<br></li>")):o?m(t).before("<".concat(o,">").concat($e.MARKERS,"<br></").concat(o,">")):m(t).before("".concat($e.MARKERS,"<br>")),m(n).remove()},_middleEnter:function c(e){for(var t=v(e),n="",a=e,r="",o="",i=!1;a!==t;){var s="A"===(a=a.parentNode).tagName&&g.cursor.isAtEnd(e,a)?"fr-to-remove":"";i||a==t||g.node.isBlock(a)||(i=!0,r+=$e.INVISIBLE_SPACE),r=g.node.openTagString(m(a).clone().addClass(s).get(0))+r,o=g.node.closeTagString(a)+o}n=o+n+r+$e.MARKERS+(g.opts.keepFormatOnDelete?$e.INVISIBLE_SPACE:""),m(e).replaceWith('<span id="fr-break"></span>');var l=g.node.openTagString(t)+m(t).html()+g.node.closeTagString(t);l=l.replace(/<span id="fr-break"><\/span>/g,n),m(t).replaceWith(l)},_endEnter:function l(e){for(var t=v(e),n=$e.MARKERS,a="",r=e,o=!1;r!==t;)if(!(r=r.parentNode).classList.contains("fr-img-space-wrap")&&!r.classList.contains("fr-img-space-wrap2")){var i="A"===r.tagName&&g.cursor.isAtEnd(e,r)?"fr-to-remove":"";o||r===t||g.node.isBlock(r)||(o=!0,a+=$e.INVISIBLE_SPACE),a=g.node.openTagString(m(r).clone().addClass(i).get(0))+a,n+=g.node.closeTagString(r)}var s=a+n;m(e).remove(),m(t).after(s)},_backspace:function d(e){var t=v(e),n=t.previousSibling;if(n){n=m(n).find(g.html.blockTagsQuery()).get(-1)||n,m(e).replaceWith($e.MARKERS);var a=g.node.contents(n);a.length&&"BR"===a[a.length-1].tagName&&m(a[a.length-1]).remove(),m(t).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===t&&m(this).replaceWith(m(this).html()+(g.node.isEmpty(this)?"":"<br>"))});for(var r,o=g.node.contents(t)[0];o&&!g.node.isList(o);)r=o.nextSibling,m(n).append(o),o=r;for(n=t.previousSibling;o;)r=o.nextSibling,m(n).append(o),o=r;1<(a=g.node.contents(n)).length&&"BR"===a[a.length-1].tagName&&m(a[a.length-1]).remove(),m(t).remove()}else{var i=b(t);if(m(e).replaceWith($e.MARKERS),i.parentNode&&"LI"===i.parentNode.tagName){var s=i.previousSibling;g.node.isBlock(s)?(m(t).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===t&&m(this).replaceWith(m(this).html()+(g.node.isEmpty(this)?"":"<br>"))}),m(s).append(m(t).html())):m(i).before(m(t).html())}else{var l=g.html.defaultTag();l&&0===m(t).find(g.html.blockTagsQuery()).length?m(i).before("<".concat(l,">").concat(m(t).html(),"</").concat(l,">")):m(i).before(m(t).html())}m(t).remove(),g.html.wrap(),0===m(i).find("li").length&&m(i).remove()}},_del:function f(e){var t,n=v(e),a=n.nextSibling;if(a){(t=g.node.contents(a)).length&&"BR"===t[0].tagName&&m(t[0]).remove(),m(a).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===a&&m(this).replaceWith(m(this).html()+(g.node.isEmpty(this)?"":"<br>"))});for(var r,o=e,i=g.node.contents(a)[0];i&&!g.node.isList(i);)r=i.nextSibling,m(o).after(i),o=i,i=r;for(;i;)r=i.nextSibling,m(n).append(i),i=r;m(e).replaceWith($e.MARKERS),m(a).remove()}else{for(var s=n;!s.nextSibling&&s!==g.el;)s=s.parentNode;if(s===g.el)return!1;if(s=s.nextSibling,g.node.isBlock(s))$e.NO_DELETE_TAGS.indexOf(s.tagName)<0&&(m(e).replaceWith($e.MARKERS),(t=g.node.contents(n)).length&&"BR"===t[t.length-1].tagName&&m(t[t.length-1]).remove(),m(n).append(m(s).html()),m(s).remove());else for((t=g.node.contents(n)).length&&"BR"===t[t.length-1].tagName&&m(t[t.length-1]).remove(),m(e).replaceWith($e.MARKERS);s&&!g.node.isBlock(s)&&"BR"!==s.tagName;)m(n).append(m(s)),s=s.nextSibling}}}},$e.NO_DELETE_TAGS=["TH","TD","TR","TABLE","FORM"],$e.SIMPLE_ENTER_TAGS=["TH","TD","LI","DL","DT","FORM"],$e.MODULES.cursor=function(u){var h=u.$;function o(e){return!!e&&(!!u.node.isBlock(e)||(e.nextSibling&&e.nextSibling.nodeType===Node.TEXT_NODE&&0===e.nextSibling.textContent.replace(/\u200b/g,"").length?o(e.nextSibling):!(e.nextSibling&&(!e.previousSibling||"BR"!==e.nextSibling.tagName||e.nextSibling.nextSibling))&&o(e.parentNode)))}function i(e){return!!e&&(!!u.node.isBlock(e)||(e.previousSibling&&e.previousSibling.nodeType===Node.TEXT_NODE&&0===e.previousSibling.textContent.replace(/\u200b/g,"").length?i(e.previousSibling):!e.previousSibling&&(!(e.previousSibling||!u.node.hasClass(e.parentNode,"fr-inner"))||i(e.parentNode))))}function g(e,t){return!!e&&(e!==u.$wp.get(0)&&(e.previousSibling&&e.previousSibling.nodeType===Node.TEXT_NODE&&0===e.previousSibling.textContent.replace(/\u200b/g,"").length?g(e.previousSibling,t):!e.previousSibling&&(e.parentNode===t||g(e.parentNode,t))))}function m(e,t){return!!e&&(e!==u.$wp.get(0)&&(e.nextSibling&&e.nextSibling.nodeType===Node.TEXT_NODE&&0===e.nextSibling.textContent.replace(/\u200b/g,"").length?m(e.nextSibling,t):!(e.nextSibling&&(!e.previousSibling||"BR"!==e.nextSibling.tagName||e.nextSibling.nextSibling))&&(e.parentNode===t||m(e.parentNode,t))))}function c(e){return 0<h(e).parentsUntil(u.$el,"LI").length&&0===h(e).parentsUntil("LI","TABLE").length}function d(e,t){var n=new RegExp("".concat(t?"^":"","(([\\uD83C-\\uDBFF\\uDC00-\\uDFFF]+\\u200D)*[\\uD83C-\\uDBFF\\uDC00-\\uDFFF]{2})").concat(t?"":"$"),"i"),a=e.match(n);return a?a[0].length:1}function f(e){for(var t,n=e;!n.previousSibling;)if(n=n.parentNode,u.node.isElement(n))return!1;if(n=n.previousSibling,!u.node.isBlock(n)&&u.node.isEditable(n)){for(t=u.node.contents(n);n.nodeType!==Node.TEXT_NODE&&!u.node.isDeletable(n)&&t.length&&u.node.isEditable(n);)n=t[t.length-1],t=u.node.contents(n);if(n.nodeType===Node.TEXT_NODE){var a=n.textContent,r=a.length;if(a.length&&"\n"===a[a.length-1])return n.textContent=a.substring(0,r-2),0===n.textContent.length&&n.parentNode.removeChild(n),f(e);if(u.opts.tabSpaces&&a.length>=u.opts.tabSpaces)0===a.substr(a.length-u.opts.tabSpaces,a.length-1).replace(/ /g,"").replace(new RegExp($e.UNICODE_NBSP,"g"),"").length&&(r=a.length-u.opts.tabSpaces+1);n.textContent=a.substring(0,r-d(a)),u.opts.htmlUntouched&&!e.nextSibling&&n.textContent.length&&" "===n.textContent[n.textContent.length-1]&&(n.textContent=n.textContent.substring(0,n.textContent.length-1)+$e.UNICODE_NBSP);var o=a.length!==n.textContent.length;if(0===n.textContent.length)if(o&&u.opts.keepFormatOnDelete)h(n).after($e.INVISIBLE_SPACE+$e.MARKERS);else if(0!==a.length&&u.node.isBlock(n.parentNode))h(n).after($e.MARKERS);else if((2!=n.parentNode.childNodes.length||n.parentNode!=e.parentNode)&&1!=n.parentNode.childNodes.length||u.node.isBlock(n.parentNode)||u.node.isElement(n.parentNode)||!u.node.isDeletable(n.parentNode)){for(;!u.node.isElement(n.parentNode)&&u.node.isEmpty(n.parentNode)&&$e.NO_DELETE_TAGS.indexOf(n.parentNode.tagName)<0;){var i=n;n=n.parentNode,i.parentNode.removeChild(i)}h(n).after($e.MARKERS),u.node.isElement(n.parentNode)&&!e.nextSibling&&n.previousSibling&&"BR"===n.previousSibling.tagName&&h(e).after("<br>"),n.parentNode.removeChild(n)}else h(n.parentNode).after($e.MARKERS),h(n.parentNode).remove();else h(n).after($e.MARKERS)}else u.node.isDeletable(n)?(h(n).after($e.MARKERS),h(n).remove()):e.nextSibling&&"BR"===e.nextSibling.tagName&&u.node.isVoid(n)&&"BR"!==n.tagName?(h(e.nextSibling).remove(),h(e).replaceWith($e.MARKERS)):!1!==u.events.trigger("node.remove",[h(n)])&&(h(n).after($e.MARKERS),h(n).remove())}else if($e.NO_DELETE_TAGS.indexOf(n.tagName)<0&&(u.node.isEditable(n)||u.node.isDeletable(n)))if(u.node.isDeletable(n))h(e).replaceWith($e.MARKERS),h(n).remove();else if(u.node.isEmpty(n)&&!u.node.isList(n))h(n).remove(),h(e).replaceWith($e.MARKERS);else{for(u.node.isList(n)&&(n=h(n).find("li").last().get(0)),(t=u.node.contents(n))&&"BR"===t[t.length-1].tagName&&h(t[t.length-1]).remove(),t=u.node.contents(n);t&&u.node.isBlock(t[t.length-1]);)n=t[t.length-1],t=u.node.contents(n);h(n).append($e.MARKERS);for(var s=e;!s.previousSibling;)s=s.parentNode;for(;s&&"BR"!==s.tagName&&!u.node.isBlock(s);){var l=s;s=s.nextSibling,h(n).append(l)}s&&"BR"===s.tagName&&h(s).remove(),h(e).remove()}else e.nextSibling&&"BR"===e.nextSibling.tagName&&h(e.nextSibling).remove();return!0}function s(e){var t=0<h(e).parentsUntil(u.$el,"BLOCKQUOTE").length,n=u.node.deepestParent(e,[],!t);if(n&&"BLOCKQUOTE"===n.tagName){var a=u.node.deepestParent(e,[h(e).parentsUntil(u.$el,"BLOCKQUOTE").get(0)]);a&&a.nextSibling&&(n=a)}if(null!==n){var r,o=n.nextSibling;if(u.node.isBlock(n)&&(u.node.isEditable(n)||u.node.isDeletable(n))&&o&&$e.NO_DELETE_TAGS.indexOf(o.tagName)<0)if(u.node.isDeletable(o))h(o).remove(),h(e).replaceWith($e.MARKERS);else if(u.node.isBlock(o)&&u.node.isEditable(o))if(u.node.isList(o))if(u.node.isEmpty(n,!0))h(n).remove(),h(o).find("li").first().prepend($e.MARKERS);else{var i=h(o).find("li").first();"BLOCKQUOTE"===n.tagName&&(r=u.node.contents(n)).length&&u.node.isBlock(r[r.length-1])&&(n=r[r.length-1]),0===i.find("ul, ol").length&&(h(e).replaceWith($e.MARKERS),i.find(u.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===i.get(0)&&h(this).replaceWith(h(this).html()+(u.node.isEmpty(this)?"":"<br>"))}),h(n).append(u.node.contents(i.get(0))),i.remove(),0===h(o).find("li").length&&h(o).remove())}else{if((r=u.node.contents(o)).length&&"BR"===r[0].tagName&&h(r[0]).remove(),"BLOCKQUOTE"!==o.tagName&&"BLOCKQUOTE"===n.tagName)for(r=u.node.contents(n);r.length&&u.node.isBlock(r[r.length-1]);)n=r[r.length-1],r=u.node.contents(n);else if("BLOCKQUOTE"===o.tagName&&"BLOCKQUOTE"!==n.tagName)for(r=u.node.contents(o);r.length&&u.node.isBlock(r[0]);)o=r[0],r=u.node.contents(o);h(e).replaceWith($e.MARKERS),h(n).append(o.innerHTML),h(o).remove()}else{for(h(e).replaceWith($e.MARKERS);o&&"BR"!==o.tagName&&!u.node.isBlock(o)&&u.node.isEditable(o);){var s=o;o=o.nextSibling,h(n).append(s)}o&&"BR"===o.tagName&&u.node.isEditable(o)&&h(o).remove()}}}function n(e){for(var t,n=e;!n.nextSibling;)if(n=n.parentNode,u.node.isElement(n))return!1;if("BR"===(n=n.nextSibling).tagName&&u.node.isEditable(n))if(n.nextSibling){if(u.node.isBlock(n.nextSibling)&&u.node.isEditable(n.nextSibling)){if(!($e.NO_DELETE_TAGS.indexOf(n.nextSibling.tagName)<0))return void h(n).remove();n=n.nextSibling,h(n.previousSibling).remove()}}else if(o(n)){if(c(e))u.cursorLists._del(e);else u.node.deepestParent(n)&&((!u.node.isEmpty(u.node.blockParent(n))||(u.node.blockParent(n).nextSibling&&$e.NO_DELETE_TAGS.indexOf(u.node.blockParent(n).nextSibling.tagName))<0)&&h(n).remove(),s(e));return}if(!u.node.isBlock(n)&&u.node.isEditable(n)){for(t=u.node.contents(n);n.nodeType!==Node.TEXT_NODE&&t.length&&!u.node.isDeletable(n)&&u.node.isEditable(n);)n=t[0],t=u.node.contents(n);n.nodeType===Node.TEXT_NODE?(h(n).before($e.MARKERS),n.textContent.length&&(n.textContent=n.textContent.substring(d(n.textContent,!0),n.textContent.length))):u.node.isDeletable(n)?(h(n).before($e.MARKERS),h(n).remove()):!1!==u.events.trigger("node.remove",[h(n)])&&(h(n).before($e.MARKERS),h(n).remove()),h(e).remove()}else if($e.NO_DELETE_TAGS.indexOf(n.tagName)<0&&(u.node.isEditable(n)||u.node.isDeletable(n)))if(u.node.isDeletable(n))h(e).replaceWith($e.MARKERS),h(n).remove();else if(u.node.isList(n))e.previousSibling?(h(n).find("li").first().prepend(e),u.cursorLists._backspace(e)):(h(n).find("li").first().prepend($e.MARKERS),h(e).remove());else if((t=u.node.contents(n))&&"BR"===t[0].tagName&&h(t[0]).remove(),t&&"BLOCKQUOTE"===n.tagName){var a=t[0]