/*!
* froala_editor v3.0.3 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2019 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(M){"use strict";M=M&&M.hasOwnProperty("default")?M["default"]:M,Object.assign(M.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent","border","border-.*","line-height","list-style-type"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),M.PLUGINS.wordPaste=function(y){var l,n,p=y.$,o="word_paste",c={};function t(e){var t=y.opts.wordAllowedStyleProps;e||(y.opts.wordAllowedStyleProps=[]),0===n.indexOf("
")&&(n=""),n=function g(e,t){0<=e.indexOf("]*(]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));!function f(e){for(var t=e.split("v:shape"),r=1;r').remove()}}(e,t),!0});for(var a=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),o=a.length-1;0<=o;o--)a[o].previousElementSibling&&"LI"===a[o].previousElementSibling.tagName&&a[o].previousElementSibling.appendChild(a[o]);h(n,function(e){if(e.nodeType===Node.TEXT_NODE)return e.data=e.data.replace(/
(\n|\r)/gi,"
"),!1;if(e.nodeType===Node.ELEMENT_NODE){if(A(e)){var t=e.parentNode,r=e.previousSibling,i=function E(e,t,r){var i=/[0-9a-zA-Z]./gi;var n=!1;var a;var l;var o;var s=e.querySelector('span[style="mso-list:Ignore"]');var d;var f;var u;var g;s&&(n=n||i.test(s.textContent));if(1==n){var p=s.textContent.trim().split(".")[0];"a"==p?g="lower-alpha;":"A"==p?g="upper-alpha;":"1"==p?g="decimal;":"i"==p?g="lower-roman;":"I"==p?g="upper-roman;":"o"==p&&(g="circle;"),g="list-style-type: "+g,u="ol"}else u="ul";var c=g?"<"+u+' style = "'+g+'">':"<"+u+">";for(;e;){if(!A(e)){if(e.outerHTML&&0"+d+""):(f=E(e,t,h),c+=f.el.outerHTML,e=f.currentNode);var m=e&&e.nextElementSibling;m&&(o=m.previousElementSibling),e&&e.parentNode&&e.parentNode.removeChild(e),e=m}}c+=""+u+">";var v=document.createElement("div");v.innerHTML=c;var b=v.firstElementChild;return{el:b,currentNode:e}}(e,l).el,n=null;return(n=r?r.nextSibling:t.firstChild)?t.insertBefore(i,n):t.appendChild(i),!1}return"FONT"===e.tagName&&l["."+e.getAttribute("class")]&&(e=x(e,"span")),b(e,l)}if(e.nodeType!==Node.COMMENT_NODE)return!0;if(-1([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var r="",i=0;i++/gi,"")}function x(e,t){for(var r=document.createElement(t),i=0;i");for(var l=r.firstElementChild,o=1===r.children.length;l;)"P"!==l.tagName||A(l)||o&&T(l),l=l.nextElementSibling;if(t){var s=r.getAttribute("class");if(s){var d=(s=w(s)).match(/xl[0-9]+/gi);if(d){var f="."+d[0];t[f]&&S(r,t[f])}}t.td&&S(r,t.td)}var u=r.getAttribute("style");u&&(u=w(u))&&";"!==u.slice(-1)&&(u+=";");var g=r.getAttribute("valign");if(!g&&u){var p=u.match(/vertical-align:.+?[; "]{1,1}/gi);p&&(g=p[p.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var c=null;if(u){var h=u.match(/text-align:.+?[; "]{1,1}/gi);h&&(c=h[h.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===c&&(c=null)}var m=null;if(u){var v=u.match(/background:.+?[; "]{1,1}/gi);v&&(m=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var b=r.getAttribute("colspan"),E=r.getAttribute("rowspan");b&&r.setAttribute("colspan",b),E&&r.setAttribute("rowspan",E),g&&(r.style["vertical-align"]=g),c&&(r.style["text-align"]=c),m&&(r.style["background-color"]=m),a&&r.setAttribute("width",a),r=r.nextElementSibling}for(r=e.firstElementChild;r;)a=r.getAttribute("width"),n?r.removeAttribute("width"):r.setAttribute("width",100*parseInt(a,10)/i+"%"),r=r.nextElementSibling}(e,t),"A"!==r||e.attributes.getNamedItem("href")||e.attributes.getNamedItem("name")||!e.innerHTML||(e.outerHTML=e.innerHTML),"A"==r&&e.getAttribute("href")&&e.querySelector("img")){var v=e.querySelectorAll("span");for(i=0;i"),"TABLE"===r&&(e.style.width=e.style.width),e.getAttribute("lang")&&e.removeAttribute("lang"),e.getAttribute("style")&&-1!==e.getAttribute("style").toLowerCase().indexOf("mso")){var b=w(e.getAttribute("style"));(b=b.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",b):e.removeAttribute("style")}return!0}return{_init:function e(){y.events.on("paste.wordPaste",function(e){return n=e,y.opts.wordPasteModal?function a(){if(!l){var e=' '+y.language.translate("Word Paste Detected")+"
",t=function n(){var e='';return e+='
'+y.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"
",e+='
",e+="
"}(),r=y.modals.create(o,e,t),i=r.$body;l=r.$modal,r.$modal.addClass("fr-middle"),y.events.bindClick(i,"button.fr-remove-word",function(){var e=l.data("instance")||y;e.wordPaste.clean()}),y.events.bindClick(i,"button.fr-keep-word",function(){var e=l.data("instance")||y;e.wordPaste.clean(!0)}),y.events.$on(p(y.o_win),"resize",function(){y.modals.resize(o)})}y.modals.show(o),y.modals.resize(o)}():t(y.opts.wordPasteKeepFormatting),!1})},clean:t}}});