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) • 1.13 MB
JavaScript
/*!
* froala_editor v4.2.2 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2024 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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){return function n(e){if(Array.isArray(e))return e}(e)||function d(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n["return"]&&(i=n["return"](),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||o(e,t)||function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e){return function t(e){if(Array.isArray(e))return a(e)}(e)||function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(e){return(St="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)}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}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),r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a)for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[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,r=!1;if(!e||Array.isArray(e)||!e.match(i)&&!e.match(s))return o.call(this,e);this.parentNode||(l.appendChild(this),r=!0);var a=this.parentNode;return this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=o.call(a,e.replace(i,"#".concat(this.id)).replace(s,",#".concat(this.id))),n&&(this.id=""),r&&l.removeChild(this),t}}try{var t=l.querySelectorAll(":scope *");if(!t||Array.isArray(t))throw"error"}catch(n){e(Element.prototype,"querySelector"),e(Element.prototype,"querySelectorAll"),e(HTMLElement.prototype,"querySelector"),e(HTMLElement.prototype,"querySelectorAll")}}(),"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){if("Element"in e){var t="classList",n="prototype",r=e.Element[n],a=Object,o=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},i=Array[n].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s=function s(e,t){this.name=e,this.code=DOMException[e],this.message=t},l=function l(e,t){if(""===t)throw new s("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","The token must not contain space characters.");return i.call(e,t)},c=function c(e){for(var t=o.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],r=0,a=n.length;r<a;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},d=c[n]=[],f=function f(){return new c(this)};if(s[n]=Error[n],d.item=function(e){return this[e]||null},d.contains=function(e){return~l(this,e+"")},d.add=function(){for(var e,t=arguments,n=0,r=t.length,a=!1;e=t[n]+"",~l(this,e)||(this.push(e),a=!0),++n<r;);a&&this._updateClassName()},d.remove=function(){var e,t,n=arguments,r=0,a=n.length,o=!1;do{for(e=n[r]+"",t=l(this,e);~t;)this.splice(t,1),o=!0,t=l(this,e)}while(++r<a);o&&this._updateClassName()},d.toggle=function(e,t){var n=this.contains(e),r=n?!0!==t&&"remove":!1!==t&&"add";return r&&this[r](e),!0===t||!1===t?t:!n},d.replace=function(e,t){var n=l(e+"");~n&&(this.splice(n,1,t),this._updateClassName())},d.toString=function(){return this.join(" ")},a.defineProperty){var p={get:f,enumerable:!0,configurable:!0};try{a.defineProperty(r,t,p)}catch(u){void 0!==u.number&&-2146823252!==u.number||(p.enumerable=!1,a.defineProperty(r,t,p))}}else a[n].__defineGetter__&&r.__defineGetter__(t,f)}}(self),function(){var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function Fd(e){var Fd=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var t,n=arguments.length;for(t=0;t<n;t++)e=arguments[t],Fd.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var 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(" "),r=n.indexOf(e+"");~r&&(n=n.slice(r),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))}),e=null}()),function(){var e,t=-1;if("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))),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||t<0)){var n=!1;try{var r=document.createElement("div");r.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),r.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&"undefined"!=typeof navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return n=!1;n=!0}}))}catch(s){}if(HTMLElement.prototype.nativeFocus===undefined&&!n){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var a=function a(e){for(var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;t&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return t=r,n.push([t,t.scrollTop,t.scrollLeft]),n},o=function o(e){for(var t=0;t<e.length;t++)e[t][0].scrollTop=e[t][1],e[t][0].scrollLeft=e[t][2];e=[]},i=function i(e){if(e&&e.preventScroll){var t=a(this);if("function"==typeof setTimeout){var n=this;setTimeout(function(){n.nativeFocus(),o(t)},0)}else this.nativeFocus(),o(t)}else this.nativeFocus()};HTMLElement.prototype.focus=i}}}();function xt(e,t,n){if("string"!=typeof e)return new xt.Bootstrap(e,t,n);var r=document.querySelectorAll(e);t&&t.iframe_document&&(r=t.iframe_document.querySelectorAll(e));for(var a=[],o=0;o<r.length;o++){var i=r[o]["data-froala.editor"];i?a.push(i):a.push(new xt.Bootstrap(r[o],t,n))}return 1==a.length?a[0]:a}xt.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(xt)},Object.assign(xt,{DEFAULTS:{initOnClick:!1,pluginsEnabled:null},MODULES:{},PLUGINS:{},VERSION:"4.2.2",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),xt.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<=xt.BLOCK_TAGS.indexOf(e.tagName.toLowerCase()))}function c(e){var t={},n=e.attributes;if(n)for(var r=0;r<n.length;r++){var a=n[r];t[a.nodeName]=a.value}return t}function t(e){for(var t="",n=c(e),r=Object.keys(n),a=0;a<r.length;a++){var o=r[a],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 r(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 r=!1,a=0;a<n.length;a++){var o=n[a];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(r)return!1;"BR"===o.tagName&&(r=!0)}}return!(e.querySelectorAll(xt.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(i.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(xt.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(i.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function a(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<=xt.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")&&(xt.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 r=t[n];e.removeAttribute(r.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:r,contents:s,isVoid:function b(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=xt.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function C(e){return e===i.doc.activeElement&&(!i.doc.hasFocus||i.doc.hasFocus())&&Boolean(r(e)||e.type||e.href||~e.tabIndex)},isEditable:function E(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},isDeletable:function y(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function w(e,t){return e instanceof n&&(e=e.get(0)),e&&e.classList&&e.classList.contains(t)},filter:function L(e){return i.browser.msie?e:{acceptNode:e}}}},Object.assign(xt.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,preserveTabSpaces:!1,fullPage:!1}),xt.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},xt.MODULES.clean=function(m){var v,b,C,E,f=m.$;function a(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;var t,n=m.node.contents(e),r=[];for(t=0;t<n.length;t++)n[t].nodeType!==Node.ELEMENT_NODE||m.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&&a(n[t]);if(e.nodeType===Node.ELEMENT_NODE&&!m.node.isVoid(e)&&(e.normalize(),n=m.node.contents(e),r=e.querySelectorAll(".fr-marker"),n.length-r.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<r.length;t++)e.parentNode.insertBefore(r[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,">"):m.opts.preserveTabSpaces?e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").replace(/\t/g," ".repeat(m.opts.tabSpaces)||" ".repeat(4)):e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").replace(/\t/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"),r=e.cloneNode(!0);return n.appendChild(r),n.innerHTML}if("IFRAME"===e.tagName)return e.outerHTML.replace(/</g,"<").replace(/>/g,">");var a=e.childNodes;if(0===a.length)return e.outerHTML;for(var o="",i=0;i<a.length;i++)"PRE"===e.tagName&&(t=!0),o+=s(a[i],t);return m.node.openTagString(e)+o+m.node.closeTagString(e)}var l=[];function y(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(C),r=null;"style"===t&&m.opts.htmlAllowedStyleProps.length&&(r=e[t].match(E)),n&&r?e[t]=y(r.join(";")):n&&("style"!==t||r)||delete e[t]}for(var a="",o=Object.keys(e).sort(),i=0;i<o.length;i++)e[t=o[i]].indexOf('"')<0?a+=" ".concat(t,'="').concat(e[t],'"'):a+=" ".concat(t,"='").concat(e[t],"'");return a}function d(e,t){var n,r=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV");f(r).append(e);var a="";if(r){var o=m.node.contents(r);for(n=0;n<o.length;n++)t(o[n]);for(o=m.node.contents(r),n=0;n<o.length;n++)a+=s(o[n])}return a}function p(e,t,n){var r=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),a=null;return m.opts.fullPage&&(r=m.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n&&(a=m.html.extractNode(e,"head")||"")),r=d(r,t),a&&(a=d(a,t)),function i(e){return e=(e=(e=e.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=m.opts.htmlRemoveTags.indexOf("script")?"":l[parseInt(t,10)]})).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){if(0<=m.opts.htmlRemoveTags.indexOf("noscript"))return"";var n=l[parseInt(t,10)].replace(/</g,"<").replace(/>/g,">"),r=f(n);if(r&&r.length){var a=d(r.html(),u);r.html(a),n=r.get(0).outerHTML}return n})).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}(function s(e,t,n){if(m.opts.fullPage){var r=m.html.extractDoctype(n),a=c(m.html.extractNodeAttrs(n,"html"));t=null===t?m.html.extractNode(n,"head")||"<title></title>":t;var o=c(m.html.extractNodeAttrs(n,"head")),i=c(m.html.extractNodeAttrs(n,"body"));return"".concat(r,"<html").concat(a,"><head").concat(o,">").concat(t,"</head><body").concat(i,">").concat(e,"</body></html>")}return e}(r,a,e))}function w(e){var t=m.doc.createElement("DIV");return t.innerText=e,t.textContent}function u(e){for(var t=m.node.contents(e),n=0;n<t.length;n++)t[n].nodeType!==Node.TEXT_NODE&&u(t[n]);!function g(n){if("SPAN"===n.tagName&&0<=(n.getAttribute("class")||"").indexOf("fr-marker"))return!1;if("PRE"===n.tagName&&function h(e){var t=e.innerHTML;0<=t.indexOf("\n")&&(e.innerHTML=t.replace(/\n/g,"<br>"))}(n),n.nodeType===Node.ELEMENT_NODE&&(n.getAttribute("data-fr-src")&&0!==n.getAttribute("data-fr-src").indexOf("blob:")&&n.setAttribute("data-fr-src",m.helpers.sanitizeURL(w(n.getAttribute("data-fr-src")))),n.getAttribute("href")&&n.setAttribute("href",m.helpers.sanitizeURL(w(n.getAttribute("href")))),n.getAttribute("src")&&n.setAttribute("src",m.helpers.sanitizeURL(w(n.getAttribute("src")))),n.getAttribute("srcdoc")&&n.setAttribute("srcdoc",m.clean.html(n.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(n.tagName)&&(n.innerHTML=n.innerHTML.trim())),!m.opts.pasteAllowLocalImages&&n.nodeType===Node.ELEMENT_NODE&&"IMG"===n.tagName&&n.getAttribute("data-fr-src")&&0===n.getAttribute("data-fr-src").indexOf("file://"))return n.parentNode.removeChild(n),!1;if(n.nodeType===Node.ELEMENT_NODE&&xt.HTML5Map[n.tagName]&&""===m.node.attributes(n)){var e=xt.HTML5Map[n.tagName],t="<".concat(e,">").concat(n.innerHTML,"</").concat(e,">");n.insertAdjacentHTML("beforebegin",t),(n=n.previousSibling).parentNode.removeChild(n.nextSibling)}if(m.opts.htmlAllowComments||n.nodeType!==Node.COMMENT_NODE)if(n.tagName&&n.tagName.match(b)){if("STYLE"==n.tagName&&m.helpers.isMac()){var r,a=n.innerHTML.trim(),o=[],i=/{([^}]+)}/g;for(a=a.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");r=i.exec(a);)o.push(r[1]);for(var s=function s(t){var e=a.substring(0,a.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&n.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",o[t])}),a=a.substring(a.indexOf("}")+1)},l=0;-1!=a.indexOf("{");l++)s(l)}n.parentNode.removeChild(n)}else if(n.tagName&&!n.tagName.match(v))"svg"===n.tagName?n.parentNode.removeChild(n):m.browser.safari&&"path"===n.tagName&&n.parentNode&&"svg"===n.parentNode.tagName||(n.outerHTML=n.innerHTML);else{var c=n.attributes;if(c)for(var d=c.length-1;0<=d;d--){var f=c[d],p=f.nodeName.match(C),u=null;"style"===f.nodeName&&m.opts.htmlAllowedStyleProps.length&&(u=f.value.match(E)),p&&u?f.value=y(u.join(";")):p&&("style"!==f.nodeName||u)||n.removeAttribute(f.nodeName)}}else 0!==n.data.indexOf("[FROALA.EDITOR")&&n.parentNode.removeChild(n)}(e)}return{_init:function e(){m.opts.fullPage&&f.merge(m.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function h(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=!1);var a,o=f.merge([],m.opts.htmlAllowedTags);for(a=0;a<t.length;a++)0<=o.indexOf(t[a])&&o.splice(o.indexOf(t[a]),1);var i=f.merge([],m.opts.htmlAllowedAttrs);for(a=0;a<n.length;a++)0<=i.indexOf(n[a])&&i.splice(i.indexOf(n[a]),1);return i.push("data-fr-.*"),i.push("fr-.*"),v=new RegExp("^".concat(o.join("$|^"),"$"),"gi"),C=new RegExp("^".concat(i.join("$|^"),"$"),"gi"),b=new RegExp("^".concat(m.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),E=m.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(m.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=p(e,u,!0),"undefined"!=typeof m.opts.DOMPurify&&(e=m.opts.DOMPurify.sanitize(e,{ADD_TAGS:m.opts.htmlAllowedTags,ALLOW_UNKNOWN_PROTOCOLS:!0})),e},toHTML5:function r(){var e=m.el.querySelectorAll(Object.keys(xt.HTML5Map).join(","));if(e.length){var t=!1;m.el.querySelector(".fr-marker")||(m.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===m.node.attributes(e[n])&&f(e[n]).replaceWith("<".concat(xt.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(xt.HTML5Map[e[n].tagName],">"));t&&m.selection.restore()}},tables:function t(){!function c(){for(var e=m.el.querySelectorAll("tr"),t=0,n=0;n<e.length;n++){var r=e[n].outerHTML.match(/rowspan="([0-9]+)"/);r&&(t+=Number(r[1])-1);for(var a=e[n].children,o=!0,i=0;i<a.length;i++)if("TH"!==a[i].tagName){o=!1;break}if(!1!==o&&0!==a.length){var s=e[n];if(1===a.length&&"TH"===a[0].tagName&&t)t--;else{for(;s&&"TABLE"!==s.tagName&&"THEAD"!==s.tagName;)s=s.parentNode;var l=s;l.firstChild.nodeType===Node.ELEMENT_NODE&&"THEAD"===l.firstChild.tagName?l=l.firstChild:"THEAD"!==l.tagName&&(l=m.doc.createElement("THEAD"),s.insertBefore(l,s.firstChild)),l.appendChild(e[n])}}}}(),function s(){for(var e=m.$el.find("table[style]"),t=0;t<e.length;t++){var n=f(e[t]);n.attr("style").indexOf("width")<0&&n.css("width","100%")}for(var r=m.$el.find("td[width]"),a=0;a<r.length;a++){var o=f(r[a]),i=o.attr("width");i&&(o.css("width",i),o.removeAttr("width"))}}()},lists:function g(){!function s(){var e,t=[];do{if(t.length){var n=t[0],r=m.doc.createElement("ul");n.parentNode.insertBefore(r,n);do{var a=n;n=n.nextSibling,r.appendChild(a)}while(n&&"LI"===n.tagName)}t=[];for(var o=m.el.querySelectorAll("li"),i=0;i<o.length;i++)e=o[i],m.node.isList(e.parentNode)||t.push(o[i])}while(0<t.length)}(),function o(){for(var e=m.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(m.node.isList(n.previousSibling)&&m.node.openTagString(n)===m.node.openTagString(n.previousSibling)){for(var r=m.node.contents(n),a=0;a<r.length;a++)n.previousSibling.appendChild(r[a]);n.parentNode.removeChild(n)}}}(),function i(){for(var e=m.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=m.node.contents(e[t]),r=null,a=n.length-1;0<=a;a--)!n[a].tagName&&m.opts.htmlUntouched||"LI"===n[a].tagName||"UL"==n[a].tagName||"OL"==n[a].tagName?r=null:"BR"==n[a].tagName?f(n[a]).remove():(r||(r=f(m.doc.createElement("LI"))).insertBefore(n[a]),r.prepend(n[a]))}(),function l(){var e,t,n;do{t=!1;var r=m.el.querySelectorAll("li:empty");for(e=0;e<r.length;e++)r[e].parentNode.removeChild(r[e]);var a=m.el.querySelectorAll("ul, ol");for(e=0;e<a.length;e++)(n=a[e]).querySelector("LI")||(t=!0,n.parentNode.removeChild(n))}while(!0===t)}(),function a(){for(var e=m.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),t=0;t<e.length;t++){var n=e[t],r=n.previousSibling;r&&("LI"===r.tagName?r.appendChild(n):f(n).wrap("<li></li>"))}}(),function c(){for(var e=m.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(n.nextSibling)for(var r=n.nextSibling;0<r.childNodes.length;)n.append(r.childNodes[0])}}(),function d(){for(var e=m.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(m.node.isFirstSibling(n)&&"none"!=n.parentNode.style.listStyleType)f(n).before("<br/>");else if(n.previousSibling&&"BR"===n.previousSibling.tagName){for(var r=n.previousSibling.previousSibling;r&&m.node.hasClass(r,"fr-marker");)r=r.previousSibling;r&&"BR"!==r.tagName&&f(n.previousSibling).remove()}}}(),function n(){for(var e=m.el.querySelectorAll("li:empty"),t=0;t<e.length;t++)f(e[t]).remove()}(),function r(){for(var e=m.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=e[t],i=m.node.contents(n),s=function s(){var e=i[l],t=m.node.contents(e),n=e.querySelectorAll("ul, ol");if(0<n.length&&1==t.length&&t[0].nodeType===Node.ELEMENT_NODE){var r=n[0],a=r.closest("li"),o=a.querySelector("[data-tracking=true]")&&m.opts.trackChangesEnabled;we(r.querySelectorAll("li")).reverse().forEach(function(e){if(o){var t="pending-".concat(m.id,"-").concat(m.track_changes.getPendingChanges().length),n=m.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=e.innerHTML;e.innerHTML='<span data-tracking="true" data-track-id="'.concat(t,'" ').concat(n,">").concat(r,"</span>"),a.after(e),m.track_changes.pushChange(t)}else a.after(e)})}},l=0;l<i.length;l++)s()}()},invisibleSpaces:function n(e){return e.replace(/\u200b/g,"").length===e.length?e:m.clean.exec(e,a)},exec:p}},xt.XS=0,xt.SM=1,xt.MD=2,xt.LG=3;xt.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),xt.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-z\\u00a1-\\uffff0-9@?\\|!^=%&\\/~+#-\\'*-_{}]*)|())",xt.LinkRegExTLD="((".concat(xt.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))"),xt.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(xt.LinkRegExCommon,")"),xt.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(xt.LinkRegExCommon,")"),xt.LinkRegExWWW="(www\\.".concat(xt.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),xt.LinkRegEx="(".concat(xt.LinkRegExTLD,"|").concat(xt.LinkRegExHTTP,"|").concat(xt.LinkRegExWWW,"|").concat(xt.LinkRegExAuth,")").concat(xt.LinkRegExEnd),xt.LinkProtocols=["mailto","tel","sms","notes","data"],xt.MAIL_REGEX=/.+@.+\..+/i,xt.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(),r=/(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)||[],a=r[1]||"";r[2];r[1]&&(e[a]=!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)||function e(){return navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&/Macintosh/.test(navigator.userAgent)}())&&!a()}function n(){return/(Android)/g.test(navigator.userAgent)&&!a()}function r(){return/(Blackberry)/g.test(navigator.userAgent)}function a(){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},getIOSVersion:function f(){if(t()){var e=navigator.userAgent.match(/OS (\d)?\d_\d(_\d)?/i)||navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/);return e&&e.length&&Math.abs(e[0].split("_")[0].replace("OS ",""))||NaN}return NaN},getSafariVersion:function p(){var e=navigator.userAgent;if(-1!==e.indexOf("Safari")){var t=e.match(/Version\/(\d+\.\d+)/);if(t)return parseInt(t[1])}return null},isAndroid:n,isBlackberry:r,isWindowsPhone:a,isMobile:function u(){return n()||t()||r()},isEmail:function h(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&xt.MAIL_REGEX.test(e)},requestAnimationFrame:function g(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function m(e){return parseInt(e,10)||0},screenSize:function v(e){try{var t=0;if((t=e?o.$box.width():o.$sc.width())<768)return xt.XS;if(768<=t&&t<992)return xt.SM;if(992<=t&&t<1200)return xt.MD;if(1200<=t)return xt.LG}catch(n){return xt.LG}},isTouch:function b(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function C(e){return o.opts.DOMPurify&&(e=o.opts.DOMPurify.sanitize(e,{ADD_TAGS:o.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=e.replace(/\s*on\w+=(["'][^"']*["']|\S+)/gi,""),/^(https?:|ftps?:|)\/\//i.test(e)?e:/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)?e:new RegExp("^(".concat(xt.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,"}").replace(/%[0-1]+[0-9]+|%[0-1]+[A-F]+/g,"")},isArray:function E(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===St(e)&&"number"==typeof e.length},RGBToHex:function y(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 w(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r});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 L(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(xt.LinkRegExHTTP).concat(xt.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function T(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 r=n.find("#s1").get(0).getBoundingClientRect().left,a=n.find("#s2").get(0).getBoundingClientRect().left;n.remove(),i=r<a?"left":"right"}t=i}return t},scrollTop:function A(){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 _(){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 S(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)}}},xt.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"),l.browser.msie||(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 r=l.$el.find(l.html.blockTagsQuery()).get(0);r&&(o(r).prepend(xt.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 r,a=e.split(" ");if(1<a.length){for(var o=0;o<a.length;o++)h(a[o],t,n);return!0}void 0===n&&(n=!1),r=0!==e.indexOf("shared.")?(i[e]=i[e]||[],i[e]):(l.shared._events[e]=l.shared._events[e]||[],l.shared._events[e]),n?r.unshift(t):r.push(t)}var g=[];function m(e,t,n,r,a){"function"==typeof n&&(a=r,r=n,n=!1);var o=a?l.shared.$_events:g,i=a?l.sid:l.id,s="".concat(t.trim().split(" ").join(".ed".concat(i," ")),".ed").concat(i);n?e.on(s,n,r):e.on(s,r),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 r,a;if(0!==e.indexOf("shared."))r=i[e];else{if(0<l.shared.count)return!1;r=l.shared._events[e]}if(r)for(var o=0;o<r.length;o++)if(!1===(a=r[o].apply(l,t)))return!1;return(!l.opts.events||!l.opts.events[e]||!1!==(a=l.opts.events[e].apply(l,t)))&&a}}function b(){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&delete i[e]}function C(){for(var e in l.shared._events)Object.prototype.hasOwnProperty.call(l.shared._events,e)&&delete l.shared._events[e]}return{_init:function E(){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 mousemove mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){v(e.type,[e])}),h("mousedown",function(){for(var e=0;e<xt.INSTANCES.length;e++)xt.INSTANCES[e]!==l&&xt.INSTANCES[e].popups&&xt.INSTANCES[e].popups.areVisible()&&xt.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,"beforeinput cut copy keydown keyup touchmove touchend",function(e){v("window.".concat(e.type),[e])})}(),function r(){s(l.$doc,"dragend drop",function(e){v("document.".concat(e.type),[e])})}(),function a(){s(l.$el,"beforeinput 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]),l.helpers.isMobile()&&p()))}),s(l.$el,"blur",function(e){u()&&!0===d&&(v(e.type,[e]),l.helpers.isMobile()&&l.opts.toolbarContainer&&(l.shared.selected_editor=l.id),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",C)},on:h,trigger:v,bindClick:function r(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 a(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 r=n.data("timeout");r&&(clearTimeout(r),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 y(e,t,n){if(!l.edit.isDisabled()||n){var r,a;if(0!==e.indexOf("shared."))r=i[e];else{if(0<l.shared.count)return!1;r=l.shared._events[e]}if(r)for(var o=0;o<r.length;o++)void 0!==(a=r[o].apply(l,[t]))&&(t=a);return l.opts.events&&l.opts.events[e]&&void 0!==(a=l.opts.events[e].apply(l,[t]))&&(t=a),t}},$on:m,$off:function n(){t(g),g=[],0===l.shared.count&&(t(l.shared.$_events),l.shared.$_events=[])}}},Object.assign(xt.DEFAULTS,{indentMargin:20}),xt.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}},xt.RegisterCommand=function(e,t){xt.COMMANDS[e]=t},xt.MODULES.commands=function(i){var s=i.$;function l(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(){r(1)},outdent:function(){r(-1)},show:function(){i.opts.toolbarInline&&i.toolbar.showInline(null,!0)},insertHR:function(){i.selection.remove();var e="";i.core.isEmpty()&&(e=l(e="<br>"));var t='<hr id="fr-just" class="fr-just">'.concat(e);i.opts.trackChangesEnabled&&(t=i.track_changes.wrapInTracking(s(t),"hrWrapper").get(0).outerHTML);i.html.insert(t);var n,r=i.$el.find("hr#fr-just").length?i.$el.find("hr#fr-just"):i.$el.find(".fr-just");r.removeAttr("id"),r.removeAttr("class");var a=i.opts.trackChangesEnabled&&"SPAN"===r[0].parentNode.tagName&&"P"===r[0].parentNode.parentNode.tagName;if(0===r.next().length){var o=i.html.defaultTag();o&&!a?r.after(s(i.doc.createElement(o)).append("<br>").get(0)):a?r[0].parentNode.after(s(i.doc.createElement(o)).append("<br>").get(0)):r.after("<br>")}r.prev().is("hr")?n=i.selection.setAfter(r.get(0),!1):r.next().is("hr")?n=i.selection.setBefore(r.get(0),!1):a||i.selection.setAfter(r.get(0),!1)?i.selection.setAfter(r[0].parentNode,!1):i.selection.setBefore(r.get(0),!1),n||void 0===n||(e=l(e="".concat(xt.MARKERS,"<br>")),r.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)},moreTrackChanges:function(){t("trackChanges")}};function t(e){var t=i.$tb.find("[data-cmd=".concat(e,"]")),n=i.$tb.find("[data-cmd=html]");i.opts.trackChangesEnabled||i.markdown&&i.markdown.isEnabled()?n&&n.addClass("fr-disabled"):n&&n.removeClass("fr-disabled"),function r(n){i.helpers.isMobile()&&i.opts.toolbarInline&&i.events.disableBlur();var e=i.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("data-group-name"),'"]'));"trackChanges"===n.data("cmd")&&(e=i.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("id"),'"]')));if(i.$tb.find(".fr-open").not(n).not('[data-cmd="trackChanges"]').removeClass("fr-open"),n.toggleClass("fr-open"),i.$tb.find(".fr-more-toolbar").removeClass("fr-overflow-visible"),i.$tb.find(".fr-expanded").not(e).length){var t=i.$tb.find(".fr-expanded").not(e);t.each(function(e,t){0!=s(t).data("name").indexOf("trackChanges-")&&0!=s(t).data("name").indexOf("moreRich-")?s(t).toggleClass("fr-expanded"):n.parents('[data-name^="moreRich-"]').length||0==s(t).data("name").indexOf("trackChanges-")||s(t).find('[id^="trackChanges-"]').length&&i.opts.trackChangesEnabled||s(t).toggleClass("fr-expanded")}),e.toggleClass("fr-expanded")}else e.toggleClass("fr-expanded"),i.$box.toggleClass("fr-toolbar-open"),i.$tb.toggleClass("fr-toolbar-open")}(t),i.toolbar.setMoreToolbarsHeight()}function n(e,t){if(!(i.markdown&&i.markdown.isEnabled()&&("bold"===e||"italic"===e||"underline"===e)||i.opts.trackChangesEnabled&&"markdown"===e)&&!1!==i.events.trigger("commands.before",s.merge([e],t||[]))){var n=xt.COMMANDS[e]&&xt.COMMANDS[e].callback||o[e],r=!0,a=!1;xt.COMMANDS[e]&&("undefined"!=typeof xt.COMMANDS[e].focus&&(r=xt.COMMANDS[e].focus),"undefined"!=typeof xt.COMMANDS[e].accessibilityFocus&&(a=xt.COMMANDS[e].accessibilityFocus)),(!i.core.hasFocus()&&r||!i.core.hasFocus()&&a&&i.accessibility.hasFocus())&&(i.el.focus({preventScroll:!0}),i.events.trigger("focus")),xt.COMMANDS[e]&&!1!==xt.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||[])),xt.COMMANDS[e]&&!1!==xt.COMMANDS[e].undo&&i.undo.saveStep()}}function e(e,t){i.format.toggle(t)}function r(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&&("LI"!==t[n].tagName||"LI"!==t[n].parentNode.tagName)){var r=s(t[n]);"LI"!=t[n].tagName&&"LI"==t[n].parentNode.tagName&&(r=s(t[n].parentNode));var a="rtl"===i.opts.direction||"rtl"===r.css("direction")?"margin-right":"margin-left",o=i.helpers.getPX(r.css(a));if(r.width()<2*i.opts.indentMargin&&0<e)continue;"UL"!=t[n].parentNode.tagName&&"OL"!=t[n].parentNode.tagName&&"LI"!=t[n].parentNode.tagName&&r.css(a,Math.max(o+e*i.opts.indentMargin,0)||""),r.removeClass("fr-temp-div")}i.selection.save(),i.html.unwrap(),i.selection.restore()}function a(e){return function(){n(e)}}var c={};for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(c[d]=a(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===xt.KEYCODE.ARROW_LEFT||e.which===xt.KEYCODE.ARROW_UP){if(t.previousSibling)return i.node.isBlock(t.previousSibling)?i.selection.setAtEnd(t.previousSibling):s(t).before(xt.MARKERS),i.selection.restore(),!1}else if((e.which===xt.KEYCODE.ARROW_RIGHT||e.which===xt.KEYCODE.ARROW_DOWN)&&t.nextSibling)return i.node.isBlock(t.nextSibling)?i.selection.setAtStart(t.nextSibling):s(t).after(xt.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(xt.MARKERS)),i.selection.restore())})}})},xt.MODULES.cursorLists=function(b){var C=b.$;function E(e){for(var t=e;"LI"!==t.tagName;)t=t.parentNode;return t}function y(e){for(var t=e;!b.node.isList(t);)t=t.parentNode;return t}function w(e){for(var t="",n=0;n<e.length;n++){var r=e[n];t+="".concat(r.name,"='").concat(r.value,"' ")}return t}return{_startEnter:function L(e){var t,n=E(e),r=n.nextSibling,a=n.previousSibling,o=b.html.defaultTag();if(b.node.isEmpty(n,!0)&&r){for(var i="",s="",l=e.parentNode;!b.node.isList(l)&&l.parentNode&&("LI"!==l.parentNode.tagName||l.parentNode===n);)-1<["OL","LI","UL"].indexOf(l.tagName)&&(i=b.node.openTagString(l)+i,s+=b.node.closeTagString(l)),l=l.parentNode;i=b.node.openTagString(l)+i,s+=b.node.closeTagString(l);var c="";if(l.parentNode&&"LI"===l.parentNode.tagName)if(l.parentNode.attributes.length){var d=w(l.parentNode.attributes);c="".concat(s,"<li ").concat(d,">").concat(xt.MARKERS,"<br>").concat(i)}else c="".concat(s,"<li>").concat(xt.MARKERS,"<br>").concat(i);else c=o?"".concat(s,"<").concat(o,">").concat(xt.MARKERS,"<br></").concat(o,">").concat(i):"".concat(s+xt.MARKERS,"<br>").concat(i);for(;["UL","OL"].indexOf(l.tagName)<0||l.parentNode&&"LI"===l.parentNode.tagName;)l=l.parentNode;C(n).replaceWith('<span id="fr-break"></span>');var f=b.node.openTagString(l)+C(l).html()+b.node.closeTagString(l);f=f.replace(/<span id="fr-break"><\/span>/g,c),C(l).replaceWith(f),b.$el.find("li:empty").remove(),b.$el.find("li > p > span:empty").length&&b.$el.find("li > p > span:empty")[0].parentNode.parentNode.remove()}else if(a&&r||!b.node.isEmpty(n,!0)){var p="<br>",u=e.parentNode;for(u&&"A"===u.tagName&&(u=null);u&&"LI"!==u.tagName;)p=b.node.openTagString(u)+p+b.node.closeTagString(u),u=u.parentNode;if(u&&u.attributes.length){var h=w(u.attributes);C(n).before("<li ".concat(h,">").concat(p,"</li>"))}else C(n).before("<li>".concat(p,"</li>"));C(e).remove()}else if(a){t=y(n);for(var g="".concat(xt.MARKERS,"<br>"),m=e.parentNode;m&&"LI"!==m.tagName;)g=b.node.openTagString(m)+g+b.node.closeTagString(m),m=m.parentNode;if(t.parentNode&&"LI"===t.parentNode.tagName)if(t.parentNode.attributes.length){var v=w(t.parentNode.attributes);C(t.parentNode).after("<li ".concat(v,">").concat(g,"</li>"))}else C(t.parentNode).after("<li>".concat(g,"</li>"));else o?C(t).after("<".concat(o,">").concat(g,"</").concat(o,">")):C(t).after(g);C(n).remove()}else(t=y(n)).parentNode&&"LI"===t.parentNode.tagName?r?C(t.parentNode).before("".concat(b.node.openTagString(n)+xt.MARKERS,"<br></li>")):C(t.parentNode).after("".concat(b.node.openTagString(n)+xt.MARKERS,"<br></li>")):o?C(t).before("<".concat(o,">").concat(xt.MARKERS,"<br></").concat(o,">")):C(t).before("".concat(xt.MARKERS,"<br>")),C(n).remove()},_middleEnter:function c(e){for(var t=E(e),n="",r=e,a="",o="",i=!1;r!==t;){var s="A"===(r=r.parentNode).tagName&&b.cursor.isAtEnd(e,r)?"fr-to-remove":"";i||r==t||b.node.isBlock(r)||(i=!0,a+=xt.INVISIBLE_SPACE),a=b.node.openTagString(C(r).clone().addClass(s).get(0))+a,o+=b.node.closeTagString(r)}n=o+n+a+xt.MARKERS+(b.opts