UNPKG

@firestitch/froala

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.

1 lines 452 kB
!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 f(e){return(f="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))do{if(t.matches(e))return t}while(null!==(t=t.parentElement||t.parentNode)&&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),o=1;o<arguments.length;o++){var r=arguments[o];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},writable:!0,configurable:!0});var n,i=/^\s*:scope/gi,a=/,\s*:scope/gi,s=document.createElement("div");function t(e,t){var r=e[t];e[t]=function(e){var t,n=!1,o=!1;return e&&!Array.isArray(e)&&(e.match(i)||e.match(a))?(this.parentNode||(s.appendChild(this),o=!0),t=this.parentNode,this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=r.call(t,e.replace(i,"#".concat(this.id)).replace(a,",#".concat(this.id))),n&&(this.id=""),o&&s.removeChild(this),t):r.call(this,e)}}try{var o=s.querySelectorAll(":scope *");if(!o||Array.isArray(o))throw"error"}catch(e){t(Element.prototype,"querySelector"),t(Element.prototype,"querySelectorAll"),t(HTMLElement.prototype,"querySelector"),t(HTMLElement.prototype,"querySelectorAll")}if("document"in self){if(!("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&"Element"in(o=self)){var r="classList",e="prototype",o=o.Element[e],l=Object,c=String[e].trim||function(){return this.replace(/^\s+|\s+$/g,"")},_=Array[e].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},d=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},p=function(e,t){if(""===t)throw new d("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new d("INVALID_CHARACTER_ERR","The token must not contain space characters.");return _.call(e,t)},h=function(e){for(var t=c.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],o=0,r=n.length;o<r;o++)this.push(n[o]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=h[e]=[],g=function(){return new h(this)};if(d[e]=Error[e],u.item=function(e){return this[e]||null},u.contains=function(e){return~p(this,e+"")},u.add=function(){for(var e,t=arguments,n=0,o=t.length,r=!1;~p(this,e=t[n]+"")||(this.push(e),r=!0),++n<o;);r&&this._updateClassName()},u.remove=function(){var e,t,n=arguments,o=0,r=n.length,i=!1;do{for(t=p(this,e=n[o]+"");~t;)this.splice(t,1),i=!0,t=p(this,e)}while(++o<r);i&&this._updateClassName()},u.toggle=function(e,t){var n=this.contains(e),o=n?!0!==t&&"remove":!1!==t&&"add";return o&&this[o](e),!0===t||!1===t?t:!n},u.replace=function(e,t){e=p(e+"");~e&&(this.splice(e,1,t),this._updateClassName())},u.toString=function(){return this.join(" ")},l.defineProperty){u={get:g,enumerable:!0,configurable:!0};try{l.defineProperty(o,r,u)}catch(e){void 0!==e.number&&-2146823252!==e.number||(u.enumerable=!1,l.defineProperty(o,r,u))}}else l[e].__defineGetter__&&o.__defineGetter__(r,g)}(u=document.createElement("_")).classList.add("c1","c2"),u.classList.contains("c2")||((l=function(e){var o=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){for(var t=arguments.length,n=0;n<t;n++)o.call(this,arguments[n])}})("add"),l("remove")),u.classList.toggle("c3",!1),u.classList.contains("c3")&&(n=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}),"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(e,t){var n=this.toString().split(" "),e=n.indexOf(e+"");~e&&(n=n.slice(e),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))})}var C,e=-1;if("Microsoft Internet Explorer"===navigator.appName?(C=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(C)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(C=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(C))&&(e=parseFloat(RegExp.$1)),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||e<0)){var m,v=!1;try{var b=document.createElement("div");b.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),b.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&void 0!==navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return v=!1;v=!0}}))}catch(e){}void 0!==HTMLElement.prototype.nativeFocus||v||(HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus,m=function(e){for(var t=0;t<e.length;t++)e[t][0].scrollTop=e[t][1],e[t][0].scrollLeft=e[t][2]},HTMLElement.prototype.focus=function(e){var t,n;e&&e.preventScroll?(t=function(e){for(var t=e.parentNode,n=[],o=document.scrollingElement||document.documentElement;t&&t!==o;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return n.push([t=o,t.scrollTop,t.scrollLeft]),n}(this),"function"==typeof setTimeout?(n=this,setTimeout(function(){n.nativeFocus(),m(t)},0)):(this.nativeFocus(),m(t))):this.nativeFocus()})}function x(e,t,n){if("string"!=typeof e)return new x.Bootstrap(e,t,n);for(var o=document.querySelectorAll(e),r=(t&&t.iframe_document&&(o=t.iframe_document.querySelectorAll(e)),[]),i=0;i<o.length;i++){var a=o[i]["data-froala.editor"];r.push(a||new x.Bootstrap(o[i],t,n))}return 1==r.length?r[0]:r}x.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(x)},Object.assign(x,{DEFAULTS:{initOnClick:!1,pluginsEnabled:null},MODULES:{},PLUGINS:{},VERSION:"4.0.16",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),x.MODULES.node=function(a){var n=a.$;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<=x.BLOCK_TAGS.indexOf(e.tagName.toLowerCase())}function c(e){var t={},n=e.attributes;if(n)for(var o=0;o<n.length;o++){var r=n[o];t[r.nodeName]=r.value}return t}function t(e){for(var t="",n=c(e),o=Object.keys(n).sort(),r=0;r<o.length;r++){var i=o[r],a=n[i];a.indexOf("'")<0&&0<=a.indexOf('"')?t+=" ".concat(i,"='").concat(a,"'"):(0<=a.indexOf('"')&&0<=a.indexOf("'")&&(a=a.replace(/"/g,"&quot;")),t+=" ".concat(i,'="').concat(a,'"'))}return t}function o(e){return e===a.el}return{isBlock:l,isEmpty:function(e,t){if(!e)return!0;if(e.querySelector("table"))return!1;for(var n=s(e),o=(1===n.length&&l(n[0])&&(n=s(n[0])),!1),r=0;r<n.length;r++){var i=n[r];if((!t||!a.node.hasClass(i,"fr-marker"))&&(i.nodeType!==Node.TEXT_NODE||0!==i.textContent.length)){if("BR"!==i.tagName&&0<(i.textContent||"").replace(/\u200B/gi,"").replace(/\n/g,"").length)return!1;if(o)return!1;"BR"===i.tagName&&(o=!0)}}return!(e.querySelectorAll(x.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(a.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(x.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(a.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function(e){for(;e&&e.parentNode!==a.el&&(!e.parentNode||!a.node.hasClass(e.parentNode,"fr-inner"));)if(l(e=e.parentNode))return e;return null},deepestParent:function(e,t,n){if(void 0===n&&(n=!0),(t=void 0===t?[]:t).push(a.el),0<=t.indexOf(e.parentNode)||e.parentNode&&a.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=x.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)&&n)return null;for(;t.indexOf(e.parentNode)<0&&e.parentNode&&!a.node.hasClass(e.parentNode,"fr-inner")&&(x.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(e){for(var t=e.attributes,n=t.length-1;0<=n;n--){var o=t[n];e.removeAttribute(o.nodeName)}},openTagString:function(e){return"<".concat(e.tagName.toLowerCase()).concat(t(e),">")},closeTagString:function(e){return"</".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function e(t,n){void 0===n&&(n=!0);for(var o=t.previousSibling;o&&n&&a.node.hasClass(o,"fr-marker");)o=o.previousSibling;return!o||o.nodeType===Node.TEXT_NODE&&""===o.textContent&&e(o)},isLastSibling:function e(t,n){void 0===n&&(n=!0);for(var o=t.nextSibling;o&&n&&a.node.hasClass(o,"fr-marker");)o=o.nextSibling;return!o||o.nodeType===Node.TEXT_NODE&&""===o.textContent&&e(o)},isList:function(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:o,contents:s,isVoid:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=x.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function(e){return e===a.doc.activeElement&&(!a.doc.hasFocus||a.doc.hasFocus())&&Boolean(o(e)||e.type||e.href||~e.tabIndex)},isEditable:function(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},isDeletable:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function(e,t){return(e=e instanceof n?e.get(0):e)&&e.classList&&e.classList.contains(t)},filter:function(e){return a.browser.msie?e:{acceptNode:e}}}},Object.assign(x.DEFAULTS,{DOMPurify:window.DOMPurify,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}),x.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},x.MODULES.clean=function(N){var h,u,g,C,T=N.$;function r(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;for(var t=N.node.contents(e),n=[],o=0;o<t.length;o++)t[o].nodeType!==Node.ELEMENT_NODE||N.node.isVoid(t[o])?t[o].nodeType===Node.TEXT_NODE&&(t[o].textContent=t[o].textContent.replace(/\u200b/g,"")):t[o].textContent.replace(/\u200b/g,"").length!==t[o].textContent.length&&r(t[o]);if(e.nodeType===Node.ELEMENT_NODE&&!N.node.isVoid(e)&&(e.normalize(),t=N.node.contents(e),n=e.querySelectorAll(".fr-marker"),t.length-n.length==0)){for(o=0;o<t.length;o++)if(t[o].nodeType===Node.ELEMENT_NODE&&(t[o].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(o=0;o<n.length;o++)e.parentNode.insertBefore(n[o].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}var a=[];function m(e){e=e.replace(/;;/gi,";");return";"!==(e=e.replace(/^;/gi,"")).charAt(e.length)&&(e+=";"),e}function s(e){var t,n,o;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n=t.match(g),o=null,"style"===t&&N.opts.htmlAllowedStyleProps.length&&(o=e[t].match(C)),n&&o?e[t]=m(o.join(";")):n&&("style"!==t||o)||delete e[t]);for(var r="",i=Object.keys(e).sort(),a=0;a<i.length;a++)e[t=i[a]].indexOf('"')<0?r+=" ".concat(t,'="').concat(e[t],'"'):r+=" ".concat(t,"='").concat(e[t],"'");return r}function l(e,t){var n=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV"),o=(T(n).append(e),"");if(n){for(var r=N.node.contents(n),i=0;i<r.length;i++)t(r[i]);for(r=N.node.contents(n),i=0;i<r.length;i++)o+=function e(t,n){if(t.nodeType===Node.COMMENT_NODE)return"\x3c!--".concat(t.nodeValue,"--\x3e");if(t.nodeType===Node.TEXT_NODE)return n?t.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):t.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\u0009/g,"");if(t.nodeType!==Node.ELEMENT_NODE)return t.outerHTML;if(t.nodeType===Node.ELEMENT_NODE&&0<=["STYLE","SCRIPT","NOSCRIPT"].indexOf(t.tagName))return t.outerHTML;var o,r;if(t.nodeType===Node.ELEMENT_NODE&&"svg"===t.tagName)return o=document.createElement("div"),r=t.cloneNode(!0),o.appendChild(r),o.innerHTML;if("IFRAME"===t.tagName)return t.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">");var i=t.childNodes;if(0===i.length)return t.outerHTML;for(var a="",s=0;s<i.length;s++)"PRE"===t.tagName&&(n=!0),a+=e(i[s],n);return N.node.openTagString(t)+a+N.node.closeTagString(t)}(r[i])}return o}function c(e,t,n){a=[];var o,r=e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return a.push(e),"[FROALA.EDITOR.SCRIPT ".concat(a.length-1,"]")}).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return a.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(a.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="'),i=null,i=(N.opts.fullPage&&(r=N.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n)&&(i=N.html.extractNode(e,"head")||""),r=l(r,t),i=i&&l(i,t),n=r,t=i,r=e,N.opts.fullPage?(i=N.html.extractDoctype(r),e=s(N.html.extractNodeAttrs(r,"html")),t=null===t?N.html.extractNode(r,"head")||"<title></title>":t,o=s(N.html.extractNodeAttrs(r,"head")),r=s(N.html.extractNodeAttrs(r,"body")),"".concat(i,"<html").concat(e,"><head").concat(o,">").concat(t,"</head><body").concat(r,">").concat(n,"</body></html>")):n);return i.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=N.opts.htmlRemoveTags.indexOf("script")?"":a[parseInt(t,10)]}).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){var n,o;return 0<=N.opts.htmlRemoveTags.indexOf("noscript")?"":(t=a[parseInt(t,10)].replace(/&lt;/g,"<").replace(/&gt;/g,">"),(n=T(t))&&n.length&&(o=l(n.html(),d),n.html(o),t=n.get(0).outerHTML),t)}).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}function v(e){var t=N.doc.createElement("DIV");return t.innerText=e,t.textContent}function o(n){var e,t;if(!("SPAN"===n.tagName&&0<=(n.getAttribute("class")||"").indexOf("fr-marker")))if("PRE"===n.tagName&&0<=(t=(e=n).innerHTML).indexOf("\n")&&(e.innerHTML=t.replace(/\n/g,"<br>")),n.nodeType===Node.ELEMENT_NODE&&(n.getAttribute("data-fr-src")&&0!==n.getAttribute("data-fr-src").indexOf("blob:")&&n.setAttribute("data-fr-src",N.helpers.sanitizeURL(v(n.getAttribute("data-fr-src")))),n.getAttribute("href")&&n.setAttribute("href",N.helpers.sanitizeURL(v(n.getAttribute("href")))),n.getAttribute("src")&&n.setAttribute("src",N.helpers.sanitizeURL(v(n.getAttribute("src")))),n.getAttribute("srcdoc")&&n.setAttribute("srcdoc",N.clean.html(n.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(n.tagName))&&(n.innerHTML=n.innerHTML.trim()),!N.opts.pasteAllowLocalImages&&n.nodeType===Node.ELEMENT_NODE&&"IMG"===n.tagName&&n.getAttribute("data-fr-src")&&0===n.getAttribute("data-fr-src").indexOf("file://"))n.parentNode.removeChild(n);else if(n.nodeType===Node.ELEMENT_NODE&&x.HTML5Map[n.tagName]&&""===N.node.attributes(n)&&(e=x.HTML5Map[n.tagName],t="<".concat(e,">").concat(n.innerHTML,"</").concat(e,">"),n.insertAdjacentHTML("beforebegin",t),(n=n.previousSibling).parentNode.removeChild(n.nextSibling)),N.opts.htmlAllowComments||n.nodeType!==Node.COMMENT_NODE)if(n.tagName&&n.tagName.match(u)){if("STYLE"==n.tagName&&N.helpers.isMac()){for(var o,r=n.innerHTML.trim(),i=[],a=/{([^}]+)}/g,r=r.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");o=a.exec(r);)i.push(o[1]);for(var s=0;-1!=r.indexOf("{");s++)!function(t){var e=r.substring(0,r.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&n.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",i[t])}),r=r.substring(r.indexOf("}")+1)}(s)}n.parentNode.removeChild(n)}else if(n.tagName&&!n.tagName.match(h))"svg"===n.tagName?n.parentNode.removeChild(n):N.browser.safari&&"path"===n.tagName&&n.parentNode&&"svg"===n.parentNode.tagName||(n.outerHTML=n.innerHTML);else{var l=n.attributes;if(l)for(var c=l.length-1;0<=c;c--){var d=l[c],p=d.nodeName.match(g),f=null;"style"===d.nodeName&&N.opts.htmlAllowedStyleProps.length&&(f=d.value.match(C)),p&&f?d.value=m(f.join(";")):p&&("style"!==d.nodeName||f)||n.removeAttribute(d.nodeName)}}else 0!==n.data.indexOf("[FROALA.EDITOR")&&n.parentNode.removeChild(n)}function d(e){for(var t=N.node.contents(e),n=0;n<t.length;n++)t[n].nodeType!==Node.TEXT_NODE&&d(t[n]);o(e)}function M(){var e,t=[];do{if(t.length){var n=t[0],o=N.doc.createElement("ul");n.parentNode.insertBefore(o,n);do{var r=n,n=n.nextSibling}while(o.appendChild(r),n&&"LI"===n.tagName)}for(var t=[],i=N.el.querySelectorAll("li"),a=0;a<i.length;a++)e=i[a],N.node.isList(e.parentNode)||t.push(i[a])}while(0<t.length)}function A(){var e;do{for(var t=!1,n=N.el.querySelectorAll("li:empty"),o=0;o<n.length;o++)n[o].parentNode.removeChild(n[o]);var r=N.el.querySelectorAll("ul, ol");for(o=0;o<r.length;o++)(e=r[o]).querySelector("LI")||(t=!0,e.parentNode.removeChild(e))}while(!0===t)}return{_init:function(){N.opts.fullPage&&T.merge(N.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function(e,t,n,o){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===o&&(o=!1);for(var r=T.merge([],N.opts.htmlAllowedTags),i=0;i<t.length;i++)0<=r.indexOf(t[i])&&r.splice(r.indexOf(t[i]),1);var a=T.merge([],N.opts.htmlAllowedAttrs);for(i=0;i<n.length;i++)0<=a.indexOf(n[i])&&a.splice(a.indexOf(n[i]),1);return a.push("data-fr-.*"),a.push("fr-.*"),h=new RegExp("^".concat(r.join("$|^"),"$"),"gi"),g=new RegExp("^".concat(a.join("$|^"),"$"),"gi"),u=new RegExp("^".concat(N.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),C=N.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(N.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=c(e,d,!0),e=void 0!==N.opts.DOMPurify?N.opts.DOMPurify.sanitize(e,{ADD_TAGS:N.opts.htmlAllowedTags,ALLOW_UNKNOWN_PROTOCOLS:!0}):e},toHTML5:function(){var e=N.el.querySelectorAll(Object.keys(x.HTML5Map).join(","));if(e.length){var t=!1;N.el.querySelector(".fr-marker")||(N.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===N.node.attributes(e[n])&&T(e[n]).replaceWith("<".concat(x.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(x.HTML5Map[e[n].tagName],">"));t&&N.selection.restore()}},tables:function(){for(var e=N.el.querySelectorAll("tr"),t=0;t<e.length;t++){for(var n=e[t].children,o=!0,r=0;r<n.length;r++)if("TH"!==n[r].tagName){o=!1;break}if(!1!==o&&0!==n.length){for(var i=e[t];i&&"TABLE"!==i.tagName&&"THEAD"!==i.tagName;)i=i.parentNode;var a=i;"THEAD"!==a.tagName&&(a=N.doc.createElement("THEAD"),i.insertBefore(a,i.firstChild)),a.appendChild(e[t])}}},lists:function(){M();for(var e=N.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(N.node.isList(n.previousSibling)&&N.node.openTagString(n)===N.node.openTagString(n.previousSibling)){for(var o=N.node.contents(n),r=0;r<o.length;r++)n.previousSibling.appendChild(o[r]);n.parentNode.removeChild(n)}}for(var i=N.el.querySelectorAll("ul, ol"),a=0;a<i.length;a++)for(var s=N.node.contents(i[a]),l=null,c=s.length-1;0<=c;c--)(s[c].tagName||!N.opts.htmlUntouched)&&"LI"!==s[c].tagName&&"UL"!=s[c].tagName&&"OL"!=s[c].tagName?"BR"==s[c].tagName?T(s[c]).remove():(l||(l=T(N.doc.createElement("LI"))).insertBefore(s[c]),l.prepend(s[c])):l=null;A();for(var d=N.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),p=0;p<d.length;p++){var f=d[p],h=f.previousSibling;h&&("LI"===h.tagName?h.appendChild(f):T(f).wrap("<li></li>"))}for(var u=N.el.querySelectorAll("li > ul, li > ol"),g=0;g<u.length;g++){var C=u[g];if(C.nextSibling)for(var m=C.nextSibling;0<m.childNodes.length;)C.append(m.childNodes[0])}for(var v=N.el.querySelectorAll("li > ul, li > ol"),b=0;b<v.length;b++){var L=v[b];if(N.node.isFirstSibling(L)&&"none"!=L.parentNode.style.listStyleType)T(L).before("<br/>");else if(L.previousSibling&&"BR"===L.previousSibling.tagName){for(var E=L.previousSibling.previousSibling;E&&N.node.hasClass(E,"fr-marker");)E=E.previousSibling;E&&"BR"!==E.tagName&&T(L.previousSibling).remove()}}for(var y=N.el.querySelectorAll("li:empty"),S=0;S<y.length;S++)T(y[S]).remove()},invisibleSpaces:function(e){return e.replace(/\u200b/g,"").length===e.length?e:N.clean.exec(e,r)},exec:c}},x.XS=0,x.SM=1,x.MD=2,x.LG=3;function L(e,t){return{altKey:e.altKey,bubbles:e.bubbles,cancelable:e.cancelable,changedTouches:e.changedTouches,ctrlKey:e.ctrlKey,detail:e.detail,eventPhase:e.eventPhase,metaKey:e.metaKey,pageX:e.pageX,pageY:e.pageY,shiftKey:e.shiftKey,view:e.view,char:e.char,key:e.key,keyCode:e.keyCode,button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,pointerId:e.pointerId,pointerType:e.pointerType,screenX:e.screenX,screenY:e.screenY,targetTouches:e.targetTouches,toElement:e.toElement,touches:e.touches,type:e.type,which:e.which,target:e.target,currentTarget:t,originalEvent:e,stopPropagation:function(){e.stopPropagation()},stopImmediatePropagation:function(){e.stopImmediatePropagation()},preventDefault:function(){-1===N.indexOf(e.type)&&e.preventDefault()}}}function E(o,r){return function(e){var t,n=e.target;if(r)for(r=y(r);n&&n!==this;)Element.prototype.matches.call(n,y(r))&&o.call(n,L(e,n)),n=n.parentNode;else((t=n).ownerDocument&&t.ownerDocument.body&&t.ownerDocument.body.contains(t)||"#document"===t.nodeName||"HTML"===t.nodeName||t===window)&&o.call(n,L(e,n))}}function y(e){return e&&"string"==typeof e?e.replace(/^\s*>/g,":scope >").replace(/,\s*>/g,", :scope >"):e}function S(e){return"function"==typeof e&&"number"!=typeof e.nodeType}x.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),x.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-z\\u00a1-\\uffff0-9@?\\|!^=%&amp;\\/~+#-\\'*-_{}]*)|())",x.LinkRegExTLD="((".concat(x.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))"),x.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(x.LinkRegExCommon,")"),x.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(x.LinkRegExCommon,")"),x.LinkRegExWWW="(www\\.".concat(x.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),x.LinkRegEx="(".concat(x.LinkRegExTLD,"|").concat(x.LinkRegExHTTP,"|").concat(x.LinkRegExWWW,"|").concat(x.LinkRegExAuth,")").concat(x.LinkRegExEnd),x.LinkProtocols=["mailto","tel","sms","notes","data"],x.MAIL_REGEX=/.+@.+\..+/i,x.MODULES.helpers=function(r){var i,a=r.$;function e(){var e,t,n={},o=(e=-1,"Microsoft Internet Explorer"===navigator.appName?(o=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(o)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(o=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(o))&&(e=parseFloat(RegExp.$1)),e);return 0<o?n.msie=!0:(e=navigator.userAgent.toLowerCase(),t=(e=/(edge)[ /]([\w.]+)/.exec(e)||/(chrome)[ /]([\w.]+)/.exec(e)||/(webkit)[ /]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[])[1]||"",e[2],e[1]&&(n[t]=!0),n.chrome?n.webkit=!0:n.webkit&&(n.safari=!0)),n.msie&&(n.version=o),n}function t(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&!s()}function n(){return/(Android)/g.test(navigator.userAgent)&&!s()}function o(){return/(Blackberry)/g.test(navigator.userAgent)}function s(){return/(Windows Phone)/gi.test(navigator.userAgent)}var l=null;return{_init:function(){r.browser=e()},isIOS:t,isMac:function(){return l=null===l?0<=navigator.platform.toUpperCase().indexOf("MAC"):l},isAndroid:n,isBlackberry:o,isWindowsPhone:s,isMobile:function(){return n()||t()||o()},isEmail:function(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&x.MAIL_REGEX.test(e)},requestAnimationFrame:function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function(e){return parseInt(e,10)||0},screenSize:function(e){try{var t=0;return(t=(e?r.$box:r.$sc).width())<768?x.XS:768<=t&&t<992?x.SM:992<=t&&t<1200?x.MD:1200<=t?x.LG:void 0}catch(e){return x.LG}},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function(e){return r.opts.DOMPurify&&(e=r.opts.DOMPurify.sanitize(e,{ADD_TAGS:r.opts.htmlAllowedTags,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.]+(?:[^a-z+.\-:]|$))/i})),e=/^(https?:|ftps?:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||new RegExp("^(".concat(x.LinkProtocols.join("|"),"):"),"i").test(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(/&amp;/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,"}").replace(/%[0-1]+[0-9]+|%[0-1]+[A-F]+/g,"")},isArray:function(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===f(e)&&"number"==typeof e.length},RGBToHex:function(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(e){return null}},HEXtoRGB:function(e){return e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,o){return t+t+n+n+o+o}),(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?"rgb(".concat(parseInt(e[1],16),", ").concat(parseInt(e[2],16),", ").concat(parseInt(e[3],16),")"):""},isURL:function(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(x.LinkRegExHTTP).concat(x.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function(e){var t,n,o,e=((e=e.css?e:a(e)).css("text-align")||"").replace(/-(.*)-/g,"");return["left","right","justify","center"].indexOf(e)<0&&(i||(t=a('<div dir="'.concat("rtl"===r.opts.direction?"rtl":"auto",'" style="text-align: ').concat(r.$el.css("text-align"),'; position: fixed; left: -3000px;"><span id="s1">.</span><span id="s2">.</span></div>')),a("body").first().append(t),n=t.find("#s1").get(0).getBoundingClientRect().left,o=t.find("#s2").get(0).getBoundingClientRect().left,t.remove(),i=n<o?"left":"right"),e=i),e},scrollTop:function(){return r.o_win.pageYOffset||(r.o_doc.documentElement&&r.o_doc.documentElement.scrollTop?r.o_doc.documentElement.scrollTop:r.o_doc.body.scrollTop||0)},scrollLeft:function(){return r.o_win.pageXOffset||(r.o_doc.documentElement&&r.o_doc.documentElement.scrollLeft?r.o_doc.documentElement.scrollLeft:r.o_doc.body.scrollLeft||0)},isInViewPort:function(e){return e=e.getBoundingClientRect(),0<=(e={top:Math.round(e.top),bottom:Math.round(e.bottom)}).top&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)||e.top<=0&&e.bottom>=(window.innerHeight||document.documentElement.clientHeight)}}},x.MODULES.events=function(a){var t,i=a.$,s={};function e(e,t,n){f(e,t,n)}function n(e){var t;if(void 0===e&&(e=!0),!a.$wp)return!1;if(a.helpers.isIOS()&&a.$win.get(0).focus(),a.core.hasFocus())return!1;if(!a.core.hasFocus()&&e){var e=a.$win.scrollTop();if(a.browser.msie&&a.$box&&a.$box.css("position","fixed"),a.browser.msie&&a.$wp&&a.$wp.css("overflow","visible"),a.browser.msie&&a.$sc&&a.$sc.css("position","fixed"),a.browser.msie||(r(),a.el.focus(),a.events.trigger("focus"),l()),a.browser.msie&&a.$sc&&a.$sc.css("position",""),a.browser.msie&&a.$box&&a.$box.css("position",""),a.browser.msie&&a.$wp&&a.$wp.css("overflow","auto"),e!==a.$win.scrollTop()&&a.$win.scrollTop(e),!a.selection.info(a.el).atStart)return!1}if(!a.core.hasFocus()||0<a.$el.find(".fr-marker").length)return!1;a.selection.info(a.el).atStart&&a.selection.isCollapsed()&&null!==a.html.defaultTag()&&((e=a.markers.insert())&&!a.node.blockParent(e)?(i(e).remove(),(t=a.$el.find(a.html.blockTagsQuery()).get(0))&&(i(t).prepend(x.MARKERS),a.selection.restore())):e&&i(e).remove())}var o=!1;function l(){t=!0}function r(){t=!1}function c(){return t}function d(e,t,n){var o=e.split(" ");if(1<o.length){for(var r=0;r<o.length;r++)d(o[r],t,n);return!0}void 0===n&&(n=!1),e=(0!==e.indexOf("shared.")?(s[e]=s[e]||[],s):(a.shared._events[e]=a.shared._events[e]||[],a.shared._events))[e],n?e.unshift(t):e.push(t)}var p=[];function f(e,t,n,o,r){"function"==typeof n&&(r=o,o=n,n=!1);var i=r?a.shared.$_events:p,r=r?a.sid:a.id,t="".concat(t.trim().split(" ").join(".ed".concat(r," ")),".ed").concat(r);n?e.on(t,n,o):e.on(t,o),i.push([e,t])}function h(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function u(e,t,n){if(!a.edit.isDisabled()||n){var o,r;if(0!==e.indexOf("shared."))o=s[e];else{if(0<a.shared.count)return!1;o=a.shared._events[e]}if(o)for(var i=0;i<o.length;i++)if(!1===(r=o[i].apply(a,t)))return!1;return a.opts.events&&a.opts.events[e]&&!1===(r=a.opts.events[e].apply(a,t))?!1:r}}function g(){for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&delete s[e]}function C(){for(var e in a.shared._events)Object.prototype.hasOwnProperty.call(a.shared._events,e)&&delete a.shared._events[e]}return{_init:function(){a.shared.$_events=a.shared.$_events||[],a.shared._events={},a.helpers.isMobile()?(a._mousedown="touchstart",a._mouseup="touchend",a._move="touchmove",a._mousemove="touchmove"):(a._mousedown="mousedown",a._mouseup="mouseup",a._move="",a._mousemove="mousemove"),e(a.$el,"click mouseup mousemove mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){u(e.type,[e])}),d("mousedown",function(){for(var e=0;e<x.INSTANCES.length;e++)x.INSTANCES[e]!==a&&x.INSTANCES[e].popups&&x.INSTANCES[e].popups.areVisible()&&x.INSTANCES[e].$el.find(".fr-marker").remove()}),e(a.$win,a._mousedown,function(e){u("window.mousedown",[e]),l()}),e(a.$win,a._mouseup,function(e){u("window.mouseup",[e])}),e(a.$win,"beforeinput cut copy keydown keyup touchmove touchend",function(e){u("window.".concat(e.type),[e])}),e(a.$doc,"dragend drop",function(e){u("document.".concat(e.type),[e])}),e(a.$el,"beforeinput keydown keypress keyup input",function(e){u(e.type,[e])}),e(a.$el,"focus",function(e){t&&(n(!1),!1===o)&&(u(e.type,[e]),a.helpers.isMobile())&&r()}),e(a.$el,"blur",function(e){t&&!0===o&&(u(e.type,[e]),a.helpers.isMobile()&&a.opts.toolbarContainer&&(a.shared.selected_editor=a.id),l())}),f(a.$el,"mousedown",'[contenteditable="true"]',function(){r(),a.$el.blur()}),d("focus",function(){o=!0}),d("blur",function(){o=!1}),l(),e(a.$el,"cut copy paste beforepaste",function(e){u(e.type,[e])}),d("destroy",g),d("shared.destroy",C)},on:d,trigger:u,bindClick:function(e,t,r){f(e,a._mousedown,t,function(e){var t;a.edit.isDisabled()||(t=i((e=e).currentTarget),a.edit.isDisabled()||a.node.hasClass(t.get(0),"fr-disabled")?e.preventDefault():"mousedown"===e.type&&1!==e.which||(a.helpers.isMobile()||e.preventDefault(),(a.helpers.isAndroid()||a.helpers.isWindowsPhone())&&0===t.parents(".fr-dropdown-menu").length&&(e.preventDefault(),e.stopPropagation()),t.addClass("fr-selected"),a.events.trigger("commands.mousedown",[t])))},!0),f(e,"".concat(a._mouseup," ").concat(a._move),t,function(e){var t,n,o;a.edit.isDisabled()||(t=r,o=i((e=e).currentTarget),a.edit.isDisabled()||a.node.hasClass(o.get(0),"fr-disabled")?e.preventDefault():"mouseup"===e.type&&1!==e.which||a.button.getButtons(".fr-selected",!0).get(0)==o.get(0)&&!a.node.hasClass(o.get(0),"fr-selected")||("touchmove"!==e.type?(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),a.node.hasClass(o.get(0),"fr-selected")?(a.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),o.data("dragging")||o.attr("disabled")?o.removeData("dragging"):((n=o.data("timeout"))&&(clearTimeout(n),o.removeData("timeout")),t.apply(a,[e]))):a.button.getButtons(".fr-selected",!0).removeClass("fr-selected")):o.data("timeout")||o.data("timeout",setTimeout(function(){o.data("dragging",!0)},100))))},!0),f(e,"mousedown click mouseup",t,function(e){a.edit.isDisabled()||e.stopPropagation()},!0),d("window.mouseup",function(){a.edit.isDisabled()||(e.find(t).removeClass("fr-selected"),l())}),f(e,"mouseover",t,function(){i(this).hasClass("fr-options")&&i(this).prev(".fr-btn").addClass("fr-btn-hover"),i(this).next(".fr-btn").hasClass("fr-options")&&i(this).next(".fr-btn").addClass("fr-btn-hover")}),f(e,"mouseout",t,function(){i(this).hasClass("fr-options")&&i(this).prev(".fr-btn").removeClass("fr-btn-hover"),i(this).next(".fr-btn").hasClass("fr-options")&&i(this).next(".fr-btn").removeClass("fr-btn-hover")})},disableBlur:r,enableBlur:l,blurActive:c,focus:n,chainTrigger:function(e,t,n){if(!a.edit.isDisabled()||n){var o,r;if(0!==e.indexOf("shared."))o=s[e];else{if(0<a.shared.count)return!1;o=a.shared._events[e]}if(o)for(var i=0;i<o.length;i++)void 0!==(r=o[i].apply(a,[t]))&&(t=r);return t=a.opts.events&&a.opts.events[e]&&void 0!==(r=a.opts.events[e].apply(a,[t]))?r:t}},$on:f,$off:function(){h(p),p=[],0===a.shared.count&&(h(a.shared.$_events),a.shared.$_events=[])}}},Object.assign(x.DEFAULTS,{indentMargin:20}),x.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}},x.RegisterCommand=function(e,t){x.COMMANDS[e]=t},x.MODULES.commands=function(a){var s=a.$;function i(e){return e=a.html.defaultTag()?"<".concat(a.html.defaultTag(),">").concat(e,"</").concat(a.html.defaultTag(),">"):e}var l={bold:function(){e(0,"strong")},subscript:function(){a.format.is("sup")&&a.format.remove("sup"),e(0,"sub")},superscript:function(){a.format.is("sub")&&a.format.remove("sub"),e(0,"sup")},italic:function(){e(0,"em")},strikeThrough:function(){e(0,"s")},underline:function(){e(0,"u")},undo:function(){a.undo.run()},redo:function(){a.undo.redo()},indent:function(){o(1)},outdent:function(){o(-1)},show:function(){a.opts.toolbarInline&&a.toolbar.showInline(null,!0)},insertHR:function(){a.selection.remove();var e,t,n="",o=(a.core.isEmpty()&&(n=i(n="<br>")),'<hr id="fr-just" class="fr-just">'.concat(n)),o=(a.opts.trackChangesEnabled&&(o=a.track_changes.wrapInTracking(s(o),"hrWrapper").get(0).outerHTML),a.html.insert(o),a.$el.find("hr#fr-just").length?a.$el.find("hr#fr-just"):a.$el.find(".fr-just")),r=(o.removeAttr("id"),o.removeAttr("class"),a.opts.trackChangesEnabled&&"SPAN"===o[0].parentNode.tagName&&"P"===o[0].parentNode.parentNode.tagName);0===o.next().length&&((t=a.html.defaultTag())&&!r?o.after(s(a.doc.createElement(t)).append("<br>").get(0)):r?o[0].parentNode.after(s(a.doc.createElement(t)).append("<br>").get(0)):o.after("<br>")),o.prev().is("hr")?e=a.selection.setAfter(o.get(0),!1):o.next().is("hr")?e=a.selection.setBefore(o.get(0),!1):r||a.selection.setAfter(o.get(0),!1)?a.selection.setAfter(o[0].parentNode,!1):a.selection.setBefore(o.get(0),!1),e||void 0===e||(n=i(n="".concat(x.MARKERS,"<br>")),o.after(n)),a.selection.restore()},clearFormatting:function(){a.format.remove()},selectAll:function(){a.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)},moreTrackChanges:function(){t("trackChanges")}};function t(e){var e=a.$tb.find("[data-cmd=".concat(e,"]")),t=a.$tb.find("[data-cmd=html]"),n=(a.opts.trackChangesEnabled?t&&t.addClass("fr-disabled"):t&&t.removeClass("fr-disabled"),e),t=(a.helpers.isMobile()&&a.opts.toolbarInline&&a.events.disableBlur(),a.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("data-group-name"),'"]')));"trackChanges"===n.data("cmd")&&(t=a.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("id"),'"]'))),a.$tb.find(".fr-open").not(n).not('[data-cmd="trackChanges"]').removeClass("fr-open"),n.toggleClass("fr-open"),a.$tb.find(".fr-more-toolbar").removeClass("fr-overflow-visible"),a.$tb.find(".fr-expanded").not(t).length?(a.$tb.find(".fr-expanded").not(t).each(function(e,t){(0==s(t).data("name").indexOf("trackChanges-")||0==s(t).data("name").indexOf("moreRich-"))&&(n.parents('[data-name^="moreRich-"]').length||0==s(t).data("name").indexOf("trackChanges-")||s(t).find('[id^="trackChanges-"]').length&&a.opts.trackChangesEnabled)||s(t).toggleClass("fr-expanded")}),t.toggleClass("fr-expanded")):(t.toggleClass("fr-expanded"),a.$box.toggleClass("fr-toolbar-open"),a.$tb.toggleClass("fr-toolbar-open")),a.toolbar.setMoreToolbarsHeight()}function n(e,t){var n,o,r;a.markdown&&a.markdown.isEnabled()&&("bold"===e||"italic"===e||"underline"===e)||a.opts.trackChangesEnabled&&"markdown"===e||!1!==a.events.trigger("commands.before",s.merge([e],t||[]))&&(n=x.COMMANDS[e]&&x.COMMANDS[e].callback||l[e],r=!(o=!0),x.COMMANDS[e]&&(void 0!==x.COMMANDS[e].focus&&(o=x.COMMANDS[e].focus),void 0!==x.COMMANDS[e].accessibilityFocus)&&(r=x.COMMANDS[e].accessibilityFocus),(!a.core.hasFocus()&&o||!a.core.hasFocus()&&r&&a.accessibility.hasFocus())&&(a.el.focus({preventScroll:!0}),a.events.trigger("focus")),x.COMMANDS[e]&&!1!==x.COMMANDS[e].undo&&(a.$el.find(".fr-marker").length&&(a.events.disableBlur(),a.selection.restore()),a.undo.saveStep()),n&&n.apply(a,s.merge([e],t||[])),a.events.trigger("commands.after",s.merge([e],t||[])),x.COMMANDS[e])&&!1!==x.COMMANDS[e].undo&&a.undo.saveStep()}function e(e,t){a.format.toggle(t)}function o(e){a.selection.save(),a.html.wrap(!0,!0,!0,!0),a.selection.restore();for(var t,n,o,r=a.selection.blocks(),i=0;i<r.length;i++)"LI"===r[i].tagName||"LI"==r[i].parentNode.tagName||"LI"===r[i].tagName&&"LI"===r[i].parentNode.tagName||(t=s(r[i]),"LI"!=r[i].tagName&&"LI"==r[i].parentNode.tagName&&(t=s(r[i].parentNode)),n="rtl"===a.opts.direction||"rtl"===t.css("direction")?"margin-right":"margin-left",o=a.helpers.getPX(t.css(n)),t.width()<2*a.opts.indentMargin&&0<e)||("UL"!=r[i].parentNode.tagName&&"OL"!=r[i].parentNode.tagName&&"LI"!=r[i].parentNode.tagName&&t.css(n,Math.max(o+e*a.opts.indentMargin,0)||""),t.removeClass("fr-temp-div"));a.selection.save(),a.html.unwrap(),a.selection.restore()}var r,c={};for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(c[r]=function(e){return function(){n(e)}}(r));return Object.assign(c,{exec:n,_init:function(){a.events.on("keydown",function(e){var t=a.selection.element();if(t&&"HR"===t.tagName&&!a.keys.isArrow(e.which))return e.preventDefault(),!1}),a.events.on("keyup",function(e){var t=a.selection.element();if(t&&"HR"===t.tagName)if(e.which===x.KEYCODE.ARROW_LEFT||e.which===x.KEYCODE.ARROW_UP){if(t.previousSibling)return a.node.isBlock(t.previousSibling)?a.selection.setAtEnd(t.previousSibling):s(t).before(x.MARKERS),a.selection.restore(),!1}else if((e.which===x.KEYCODE.ARROW_RIGHT||e.which===x.KEYCODE.ARROW_DOWN)&&t.nextSibling)return a.node.isBlock(t.nextSibling)?a.selection.setAtStart(t.nextSibling):s(t).after(x.MARKERS),a.selection.restore(),!1}),a.events.on("mousedown",function(e){if(e.target&&"HR"===e.target.tagName)return e.preventDefault(),e.stopPropagation(),!1}),a.events.on("mouseup",function(){var e=a.selection.element();e===a.selection.endElement()&&e&&"HR"===e.tagName&&(e.nextSibling&&(a.node.isBlock(e.nextSibling)?a.selection.setAtStart(e.nextSibling):s(e).after(x.MARKERS)),a.selection.restore())})}})},x.MODULES.cursorLists=function(g){var C=g.$;function m(e){for(var t=e;"LI"!==t.tagName;)t=t.parentNode;return t}function v(e){for(var t=e;!g.node.isList(t);)t=t.parentNode;return t}function b(e){for(var t="",n=0;n<e.length;n++){var o=e[n];t+="".concat(o.name,"='").concat(o.value,"' ")}return t}return{_startEnter:function(e){var t=m(e),n=t.nextSibling,o=t.previousSibling,r=g.html.defaultTag();if(g.node.isEmpty(t,!0)&&n){for(var i="",a="",s=e.parentNode;!g.node.isList(s)&&s.parentNode&&("LI"!==s.parentNode.tagName||s.parentNode===t);)-1<["OL","LI","UL"].indexOf(s.tagName)&&(i=g.node.openTagString(s)+i,a+=g.node.closeTagString(s)),s=s.parentNode;i=g.node.openTagString(s)+i,a+=g.node.closeTagString(s);var l="";for(l=(s.parentNode&&"LI"===s.parentNode.tagName?(s.parentNode.attributes.length?(c=b(s.parentNode.attributes),"".concat(a,"<li ").concat(c,">")):"".concat(a,"<li>")).concat(x.MARKERS,"<br>"):r?"".concat(a,"<").concat(r,">").concat(x.MARKERS,"<br></").concat(r,">"):"".concat(a+x.MARKERS,"<br>")).concat(i);["UL","OL"].indexOf(s.tagName)<0||s.parentNode&&"LI"===s.parentNode.tagName;)s=s.parentNode;C(t).replaceWith('<span id="fr-break"></span>');var c=(c=g.node.openTagString(s)+C(s).html()+g.node.closeTagString(s)).replace(/<span id="fr-break"><\/span>/g,l);C(s).replaceWith(c),g.$el.find("li:empty").remove(),g.$el.find("li > p > span:empty").length&&g.$el.find("li > p > span:empty")[0].parentNode.parentNode.remove()}else if(o&&n||!g.node.isEmpty(t,!0)){var d="<br>",p=e.parentNode;for(p&&"A"===p.tagName&&(p=null);p&&"LI"!==p.tagName;)d=g.node.openTagString(p)+d+g.node.closeTagString(p),p=p.parentNode;p&&p.attributes.length?(l=b(p.attributes),C(t).before("<li ".concat(l,">").concat(d,"</li>"))):C(t).before("<li>".concat(d,"</li>")),C(e).remove()}else{if(o){for(var f=v(t),h="".concat(x.MARKERS,"<br>"),u=e.parentNode;u&&"LI"!==u.tagName;)h=g.node.openTagString(u)+h+g.node.closeTagString(u),u=u.parentNode;f.parentNode&&"LI"===f.parentNode.tagName?f.parentNode.attributes.length?(c=b(f.parentNode.attributes),C(f.parentNode).after("<li ".concat(c,">").concat(h,"</li>"))):C(f.parentNode).after("<li>".concat(h,"</li>")):r?C(f).after("<".concat(r,">").concat(h,"</").concat(r,">")):C(f).after(h)}else(f=v(t)).parentNode&&"LI"===f.parentNode.tagName?n?C(f.parentNode).before("".concat(g.node.openTagString(t)+x.MARKERS,"<br></li>")):C(f.parentNode).after("".concat(g.node.openTagString(t)+x.MARKERS,"<br></li>")):r?C(f).before("<".concat(r,">").concat(x.MARKERS,"<br></").concat(r,">")):C(f).before("".concat(x.MARKERS,"<br>"));C(t).remove()}},_middleEnter:function(e){for(var t,n=m(e),o=e,r="",i="",a=!1;o!==n;){var s="A"===(o=o.parentNode).tagName&&g.cursor.isAtEnd(e,o)?"fr-to-remove":"";a||o==n||g.node.isBlock(o)||(a=!0,r+=x.INVISIBLE_SPACE),r=g.node.openTagString(C(o).clone().addClass(s).get(0))+r,i+=g.node.closeTagString(o)}t=i+""+r+x.MARKERS+(g.opts.keepFormatOnDelete?x.INVISIBLE_SPACE:""),C(e).replaceWith('<span id="fr-break"></span>');var l=(l=g.node.openTagString(n)+C(n).html()+g.node.closeTagString(n)).replace(/<span id="fr-break"><\/span>/g,t);C(n).replaceWith(l)},_endEnter:function(e){for(var t,n=m(e),o=x.MARKERS,r="",i=e,a=!1;i!==n;)(i=i.parentNode).classList.contains("fr-img-space-wrap")||i.classList.contains("fr-img-space-wrap2")||(t="A"===i.tagName&&g.cursor.isAtEnd(e,i)?"fr-to-remove":"",a||i===n||g.node.isBlock(i)||(a=!0,r+=x.INVISIBLE_SPACE),r=g.node.openTagString(C(i).clone().addClass(t).get(0))+r,o+=g.node.closeTagString(i));var s=r+o;C(e).remove(),C(n).after(s)},_backspace:function(e){var t=m(e),n=t.previousSibling;if(n){n=C(n).find(g.html.blockTagsQuery()).get(-1)||n,C(e).replaceWith(x.MARKERS);for(var o,r=g.node.contents(n),i=(r.length&&"BR"===r[r.length-1].tagName&&C(r[r.length-1]).remove(),C(t).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===t&&C(this).replaceWith(C(this).html()+(g.node.isEmpty(this)?"":"<br>"))}),g.node.contents(t)[0]);i&&!g.node.isList(i);)o=i.nextSibling,C(n).append(i),i=o;for(n=t.previousSibling;i;)o=i.nextSibling,C(n).append(i),i=o;1<(r=g.node.contents(n)).length&&"BR"===r[r.length-1].tagName&&C(r[r.length-1]).remove(),C(t).remove()}else{r=v(t);C(e).replaceWith(x.MARKERS),r.parentNode&&"LI"===r.parentNode.tagName?(e=r.previousSibling,g.node.isBlock(e)?(C(t).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===t&&C(this).replaceWith(C(this).html()+(g.node.isEmpty(this)?"":"<br>"))}),C(e).append(C(t).html())):C(r).before(C(t).html())):(e=g.html.defaultTag())&&0===C(t).find(g.html.blockTagsQuery()).length?C(r).before("<".concat(e,">").concat(C(t).html(),"</").concat(e,">")):C(r).before(C(t).html()),C(t).remove(),g.html.wrap(),0===C(r).find("li").length&&C(r).remove()}},_del:function(e){var t,n=m(e),o=n.nextSibling;if(o){(t=g.node.contents(o)).length&&"BR"===t[0].tagName&&C(t[0]).remove(),C(o).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===o&&C(this).replaceWith(C(this).html()+(g.node.isEmpty(this)?"":"<br>"))});for(var r,i=e,a=g.node.contents(o)[0];a&&!g.node.isList(a);)r=a.nextSibling,C(i).after(a),i=a,a=r;for(;a;)r=a.nextSibling,C(n).append(a),a=r;C(e).replaceWith(x.MARKERS),C(o).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))x.NO_DELETE_TAGS.indexOf(s.tagName)<0&&(C(e).replaceWith(x.MARKERS),(t=g.node.contents(n)).length&&"BR"===t[t.length-1].tagName&&C(t[t.length-1]).remove(),!s.isContentEditable||"DIV"!==s.tagName||g.node.isBlock(s.previousSibling)&&"DIV"!==s.previousSibling.tagName)&&(C(n).append(C(s).html()),C(s).remove());else{for((t=g.node.contents(n)).length&&"BR"===t[t.length-1].tagName&&C(t[t.length-1]).remove(),C(e).replaceWith(x.MARKERS);s&&!g.node.isBlock(s)&&"BR"!==s.tagName;)C(n).append(C(s)),s=s.nextSibling;C(s).remove()}}}}},x.NO_DELETE_TAGS=["TH","TD","TR","TABLE","FORM"],x.SIMPLE_ENTER_TAGS=["TH","TD","LI","DL","DT","FORM"],x.MODULES.cursor=function(p){var f=p.$;function c(e){return!!e&&(p.node.isBlock(e)?"P"!==e.tagName||!e.nextElementSibling||!e.parentElement||"OL"!==e.nextElementSibling.tagName||"LI"!==e.parentElement.tagName:e.nextSibling&&e.nextSibling.nodeType===Node.TEXT_NODE&&0===e.nextSibling.textContent.replace(/\u200b/g,"").length?c(e.nextSibling):!(e.nextSibling&&(!e.previousSibling||"BR"!==e.nextSibling.tagName||e.nextSibling.nextSibling))&&c(e.parentNode))}function d(e){return!!e&&(!!p.node.isBlock(e)||(e.previousSibling&&e.previousSibling.nodeType===Node.TEXT_NODE&&0===e.previousSibling.textContent.replace(/