activeadmin_froala_editor 0.4.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +11 -2
  4. data/app/assets/javascripts/activeadmin/froala_editor/froala_editor.min.js +3 -3
  5. data/app/assets/javascripts/activeadmin/froala_editor/froala_editor.pkgd.min.js +3 -3
  6. data/app/assets/javascripts/activeadmin/froala_editor/languages/ar.js +4 -4
  7. data/app/assets/javascripts/activeadmin/froala_editor/languages/bs.js +4 -4
  8. data/app/assets/javascripts/activeadmin/froala_editor/languages/cs.js +4 -4
  9. data/app/assets/javascripts/activeadmin/froala_editor/languages/da.js +4 -4
  10. data/app/assets/javascripts/activeadmin/froala_editor/languages/de.js +4 -4
  11. data/app/assets/javascripts/activeadmin/froala_editor/languages/el.js +4 -4
  12. data/app/assets/javascripts/activeadmin/froala_editor/languages/en_ca.js +4 -4
  13. data/app/assets/javascripts/activeadmin/froala_editor/languages/en_gb.js +4 -4
  14. data/app/assets/javascripts/activeadmin/froala_editor/languages/es.js +4 -4
  15. data/app/assets/javascripts/activeadmin/froala_editor/languages/et.js +4 -4
  16. data/app/assets/javascripts/activeadmin/froala_editor/languages/fa.js +4 -4
  17. data/app/assets/javascripts/activeadmin/froala_editor/languages/fi.js +4 -4
  18. data/app/assets/javascripts/activeadmin/froala_editor/languages/fr.js +4 -4
  19. data/app/assets/javascripts/activeadmin/froala_editor/languages/he.js +4 -4
  20. data/app/assets/javascripts/activeadmin/froala_editor/languages/hr.js +4 -4
  21. data/app/assets/javascripts/activeadmin/froala_editor/languages/hu.js +4 -4
  22. data/app/assets/javascripts/activeadmin/froala_editor/languages/id.js +4 -4
  23. data/app/assets/javascripts/activeadmin/froala_editor/languages/it.js +4 -4
  24. data/app/assets/javascripts/activeadmin/froala_editor/languages/ja.js +4 -4
  25. data/app/assets/javascripts/activeadmin/froala_editor/languages/ko.js +2 -2
  26. data/app/assets/javascripts/activeadmin/froala_editor/languages/ku.js +4 -4
  27. data/app/assets/javascripts/activeadmin/froala_editor/languages/me.js +4 -4
  28. data/app/assets/javascripts/activeadmin/froala_editor/languages/nb.js +4 -4
  29. data/app/assets/javascripts/activeadmin/froala_editor/languages/nl.js +4 -4
  30. data/app/assets/javascripts/activeadmin/froala_editor/languages/pl.js +4 -4
  31. data/app/assets/javascripts/activeadmin/froala_editor/languages/pt_br.js +4 -4
  32. data/app/assets/javascripts/activeadmin/froala_editor/languages/pt_pt.js +4 -4
  33. data/app/assets/javascripts/activeadmin/froala_editor/languages/ro.js +4 -4
  34. data/app/assets/javascripts/activeadmin/froala_editor/languages/ru.js +4 -4
  35. data/app/assets/javascripts/activeadmin/froala_editor/languages/sk.js +4 -4
  36. data/app/assets/javascripts/activeadmin/froala_editor/languages/sl.js +4 -4
  37. data/app/assets/javascripts/activeadmin/froala_editor/languages/sr.js +4 -4
  38. data/app/assets/javascripts/activeadmin/froala_editor/languages/sv.js +4 -4
  39. data/app/assets/javascripts/activeadmin/froala_editor/languages/th.js +4 -4
  40. data/app/assets/javascripts/activeadmin/froala_editor/languages/tr.js +4 -4
  41. data/app/assets/javascripts/activeadmin/froala_editor/languages/uk.js +4 -4
  42. data/app/assets/javascripts/activeadmin/froala_editor/languages/vi.js +2 -2
  43. data/app/assets/javascripts/activeadmin/froala_editor/languages/zh_cn.js +4 -4
  44. data/app/assets/javascripts/activeadmin/froala_editor/languages/zh_tw.js +4 -4
  45. data/app/assets/javascripts/activeadmin/froala_editor/plugins/align.min.js +2 -2
  46. data/app/assets/javascripts/activeadmin/froala_editor/plugins/char_counter.min.js +2 -2
  47. data/app/assets/javascripts/activeadmin/froala_editor/plugins/code_beautifier.min.js +2 -2
  48. data/app/assets/javascripts/activeadmin/froala_editor/plugins/code_view.min.js +2 -2
  49. data/app/assets/javascripts/activeadmin/froala_editor/plugins/colors.min.js +2 -2
  50. data/app/assets/javascripts/activeadmin/froala_editor/plugins/cryptojs.min.js +2 -2
  51. data/app/assets/javascripts/activeadmin/froala_editor/plugins/draggable.min.js +2 -2
  52. data/app/assets/javascripts/activeadmin/froala_editor/plugins/edit_in_popup.min.js +2 -2
  53. data/app/assets/javascripts/activeadmin/froala_editor/plugins/emoticons.min.js +2 -2
  54. data/app/assets/javascripts/activeadmin/froala_editor/plugins/entities.min.js +2 -2
  55. data/app/assets/javascripts/activeadmin/froala_editor/plugins/file.min.js +3 -3
  56. data/app/assets/javascripts/activeadmin/froala_editor/plugins/files_manager.min.js +3 -3
  57. data/app/assets/javascripts/activeadmin/froala_editor/plugins/font_family.min.js +2 -2
  58. data/app/assets/javascripts/activeadmin/froala_editor/plugins/font_size.min.js +2 -2
  59. data/app/assets/javascripts/activeadmin/froala_editor/plugins/forms.min.js +2 -2
  60. data/app/assets/javascripts/activeadmin/froala_editor/plugins/fullscreen.min.js +2 -2
  61. data/app/assets/javascripts/activeadmin/froala_editor/plugins/help.min.js +2 -2
  62. data/app/assets/javascripts/activeadmin/froala_editor/plugins/image.min.js +3 -3
  63. data/app/assets/javascripts/activeadmin/froala_editor/plugins/image_manager.min.js +2 -2
  64. data/app/assets/javascripts/activeadmin/froala_editor/plugins/inline_class.min.js +2 -2
  65. data/app/assets/javascripts/activeadmin/froala_editor/plugins/inline_style.min.js +2 -2
  66. data/app/assets/javascripts/activeadmin/froala_editor/plugins/line_breaker.min.js +2 -2
  67. data/app/assets/javascripts/activeadmin/froala_editor/plugins/line_height.min.js +3 -3
  68. data/app/assets/javascripts/activeadmin/froala_editor/plugins/link.min.js +3 -3
  69. data/app/assets/javascripts/activeadmin/froala_editor/plugins/lists.min.js +3 -3
  70. data/app/assets/javascripts/activeadmin/froala_editor/plugins/markdown.min.js +3 -3
  71. data/app/assets/javascripts/activeadmin/froala_editor/plugins/paragraph_format.min.js +3 -3
  72. data/app/assets/javascripts/activeadmin/froala_editor/plugins/paragraph_style.min.js +2 -2
  73. data/app/assets/javascripts/activeadmin/froala_editor/plugins/print.min.js +2 -2
  74. data/app/assets/javascripts/activeadmin/froala_editor/plugins/quick_insert.min.js +2 -2
  75. data/app/assets/javascripts/activeadmin/froala_editor/plugins/quote.min.js +3 -3
  76. data/app/assets/javascripts/activeadmin/froala_editor/plugins/save.min.js +2 -2
  77. data/app/assets/javascripts/activeadmin/froala_editor/plugins/special_characters.min.js +2 -2
  78. data/app/assets/javascripts/activeadmin/froala_editor/plugins/table.min.js +3 -3
  79. data/app/assets/javascripts/activeadmin/froala_editor/plugins/track_changes.min.js +3 -3
  80. data/app/assets/javascripts/activeadmin/froala_editor/plugins/trim_video.min.js +2 -2
  81. data/app/assets/javascripts/activeadmin/froala_editor/plugins/url.min.js +2 -2
  82. data/app/assets/javascripts/activeadmin/froala_editor/plugins/video.min.js +3 -3
  83. data/app/assets/javascripts/activeadmin/froala_editor/plugins/word_paste.min.js +3 -3
  84. data/app/assets/javascripts/activeadmin/froala_editor/plugins.pkgd.min.js +3 -3
  85. data/app/assets/javascripts/activeadmin/froala_editor/third_party/embedly.min.js +2 -2
  86. data/app/assets/javascripts/activeadmin/froala_editor/third_party/font_awesome.min.js +2 -2
  87. data/app/assets/javascripts/activeadmin/froala_editor/third_party/image_tui.min.js +2 -2
  88. data/app/assets/javascripts/activeadmin/froala_editor/third_party/showdown.min.js +3 -3
  89. data/app/assets/javascripts/activeadmin/froala_editor/third_party/spell_checker.min.js +2 -2
  90. data/app/assets/stylesheets/activeadmin/froala_editor/froala_editor.css +1427 -1423
  91. data/app/assets/stylesheets/activeadmin/froala_editor/froala_editor.min.css +3 -3
  92. data/app/assets/stylesheets/activeadmin/froala_editor/froala_editor.pkgd.css +4804 -4796
  93. data/app/assets/stylesheets/activeadmin/froala_editor/froala_editor.pkgd.min.css +3 -3
  94. data/app/assets/stylesheets/activeadmin/froala_editor/froala_style.css +358 -356
  95. data/app/assets/stylesheets/activeadmin/froala_editor/froala_style.min.css +3 -3
  96. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/char_counter.css +45 -45
  97. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/char_counter.min.css +3 -3
  98. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/code_view.css +93 -93
  99. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/code_view.min.css +3 -3
  100. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/colors.css +94 -94
  101. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/colors.min.css +3 -3
  102. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/draggable.css +37 -37
  103. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/draggable.min.css +3 -3
  104. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/emoticons.css +30 -30
  105. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/emoticons.min.css +3 -3
  106. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/file.css +124 -124
  107. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/file.min.css +3 -3
  108. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/files_manager.css +1236 -1236
  109. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/files_manager.min.css +3 -3
  110. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/fullscreen.css +75 -73
  111. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/fullscreen.min.css +3 -3
  112. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/help.css +41 -41
  113. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/help.min.css +3 -3
  114. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/image.css +209 -207
  115. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/image.min.css +3 -3
  116. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/image_manager.css +232 -232
  117. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/image_manager.min.css +3 -3
  118. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/line_breaker.css +34 -34
  119. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/line_breaker.min.css +3 -3
  120. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/markdown.css +145 -148
  121. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/markdown.min.css +3 -3
  122. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/quick_insert.css +68 -68
  123. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/quick_insert.min.css +3 -3
  124. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/special_characters.css +29 -29
  125. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/special_characters.min.css +3 -3
  126. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/table.css +107 -107
  127. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/table.min.css +3 -3
  128. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/trim_video.css +243 -243
  129. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/trim_video.min.css +3 -3
  130. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/video.css +197 -197
  131. data/app/assets/stylesheets/activeadmin/froala_editor/plugins/video.min.css +3 -3
  132. data/app/assets/stylesheets/activeadmin/froala_editor/plugins.pkgd.css +3021 -3019
  133. data/app/assets/stylesheets/activeadmin/froala_editor/plugins.pkgd.min.css +3 -3
  134. data/app/assets/stylesheets/activeadmin/froala_editor/themes/dark.css +2184 -2187
  135. data/app/assets/stylesheets/activeadmin/froala_editor/themes/dark.min.css +3 -3
  136. data/app/assets/stylesheets/activeadmin/froala_editor/themes/gray.css +2184 -2187
  137. data/app/assets/stylesheets/activeadmin/froala_editor/themes/gray.min.css +3 -3
  138. data/app/assets/stylesheets/activeadmin/froala_editor/themes/royal.css +2184 -2187
  139. data/app/assets/stylesheets/activeadmin/froala_editor/themes/royal.min.css +3 -3
  140. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/embedly.css +56 -56
  141. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/embedly.min.css +3 -3
  142. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/font_awesome.css +29 -29
  143. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/font_awesome.min.css +3 -3
  144. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/image_tui.css +37 -37
  145. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/image_tui.min.css +3 -3
  146. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/spell_checker.css +60 -60
  147. data/app/assets/stylesheets/activeadmin/froala_editor/third_party/spell_checker.min.css +3 -3
  148. data/lib/activeadmin/froala_editor/version.rb +2 -2
  149. metadata +11 -7
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.4 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.10 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2021 Froala Labs
4
+ * Copyright 2014-2022 Froala Labs
5
5
  */
6
6
 
7
- !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(T){var l,n,d=T.$,s="word_paste",g={};function t(e){var t=T.opts.wordAllowedStyleProps;e||(T.opts.wordAllowedStyleProps=[]),0===n.indexOf("<colgroup>")&&(n="<table>"+n+"</table>"),n=a(n=n.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var r="",i=0;i++<t.length;)r+="&nbsp;";return r}),T.paste.getRtfClipboard());var r=T.doc.createElement("DIV");r.innerHTML=n,T.html.cleanBlankSpaces(r),n=r.innerHTML,n=(n=T.paste.cleanEmptyTagsAndDivs(n)).replace(/\u200b/g,""),function i(){T.modals.hide(s)}(),T.paste.clean(n,!0,!0),T.opts.wordAllowedStyleProps=t}function A(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e,t){if(t(e))for(var r=e.firstChild;r;){var i=r,n=r.previousSibling;r=r.nextSibling,p(i,t),i.previousSibling||i.nextSibling||i.parentNode||!r||n===r.previousSibling||!r.parentNode?i.previousSibling||i.nextSibling||i.parentNode||!r||r.previousSibling||r.nextSibling||r.parentNode||(n?r=n.nextSibling?n.nextSibling.nextSibling:null:e.firstChild&&(r=e.firstChild.nextSibling)):r=n?n.nextSibling:e.firstChild}}function H(e){if(!e.getAttribute("style")||!/mso-list:[\s]*l/gi.test(e.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!e.querySelector('[style="mso-list:Ignore"]'))return!!(e.outerHTML&&0<=e.outerHTML.indexOf("\x3c!--[if !supportLists]--\x3e"))}catch(t){return!1}return!0}function O(e){return e.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1")}function I(e,i){var t=e.cloneNode(!0);if(-1!==["H1","H2","H3","H4","H5","H6"].indexOf(e.tagName)){var r=document.createElement(e.tagName.toLowerCase());r.setAttribute("style",e.getAttribute("style")),r.innerHTML=t.innerHTML,t.innerHTML=r.outerHTML}p(t,function(e){if(e.nodeType==Node.COMMENT_NODE&&(T.browser.msie||T.browser.safari||T.browser.edge))try{if("[if !supportLists]"===e.data){for(e=e.nextSibling;e&&e.nodeType!==Node.COMMENT_NODE;){var t=e.nextSibling;e.parentNode.removeChild(e),e=t}e&&e.nodeType==Node.COMMENT_NODE&&e.parentNode.removeChild(e)}}catch(r){}return e.nodeType===Node.ELEMENT_NODE&&("mso-list:\nIgnore"===e.getAttribute("style")&&e.setAttribute("style","mso-list:Ignore"),"mso-list:Ignore"===e.getAttribute("style")&&e.parentNode.removeChild(e),e.setAttribute("style",function n(e){var r="",i=e.getAttribute("style");i&&["line-height","font-family","font-size","color","background"].forEach(function(e){var t=i.match(new RegExp(e+":.*(;|)"));t&&(r+=t[0]+";")});return r}(e)),h(e,i)),!0});var n=t.innerHTML;return n=n.replace(/<!--[\s\S]*?-->/gi,"")}function C(e){var t=e.getAttribute("align");t&&(e.style["text-align"]=t,e.removeAttribute("align"))}function E(e){return e.replace(/\n|\r|\n\r|&quot;/g,"")}function L(e,t,r){if(t){var i=e.getAttribute("style");i&&";"!==i.slice(-1)&&(i+=";"),t&&";"!==t.slice(-1)&&(t+=";"),t=t.replace(/\n/gi,"");var n=null;n=r?(i||"")+t:t+(i||""),e.setAttribute("style",n)}}var c=null;function f(e,t,r){for(var i=e.split(r),n=1;n<i.length;n++){var a=i[n];if(1<(a=a.split("shplid")).length){a=a[1];for(var l="",s=0;s<a.length&&"\\"!==a[s]&&"{"!==a[s]&&" "!==a[s]&&"\r"!==a[s]&&"\n"!==a[s];)l+=a[s],s++;var o=a.split("bliptag");if(o&&o.length<2)continue;var d=null;if(-1!==o[0].indexOf("pngblip")?d="image/png":-1!==o[0].indexOf("jpegblip")&&(d="image/jpeg"),!d)continue;var f=o[1].split("}");if(f&&f.length<2)continue;var u=void 0;if(2<f.length&&-1!==f[0].indexOf("blipuid"))u=f[1].split(" ");else{if((u=f[0].split(" "))&&u.length<2)continue;u.shift()}var g=u.join("");c[t+l]={image_hex:g,image_type:d}}}}function m(e,t){if(t){var r;if("IMG"===e.tagName){var i=e.getAttribute("src");if(!i||-1===i.indexOf("file://"))return;if(0===i.indexOf("file://")&&T.helpers.isURL(e.getAttribute("alt")))return void e.setAttribute("src",e.getAttribute("alt"));(r=g[e.getAttribute("v:shapes")])||(r=e.getAttribute("v:shapes"),e.parentNode&&e.parentNode.parentNode&&0<=e.parentNode.parentNode.innerHTML.indexOf("msEquation")&&(r=null))}else r=e.parentNode.getAttribute("o:spid");if(e.removeAttribute("height"),r){!function s(e){c={},f(e,"i","\\shppict"),f(e,"s","\\shp{")}(t);var n=c[r.substring(7)];if(n){var a=function o(e){for(var t=e.match(/[0-9a-f]{2}/gi),r=[],i=0;i<t.length;i++)r.push(String.fromCharCode(parseInt(t[i],16)));var n=r.join("");return btoa(n)}(n.image_hex),l="data:"+n.image_type+";base64,"+a;"IMG"===e.tagName?(e.src=l,e.setAttribute("data-fr-image-pasted",!0)):d(e.parentNode).before('<img data-fr-image-pasted="true" src="'+l+'" style="'+e.parentNode.getAttribute("style")+'">').remove()}}}}function h(e,t){var r=e.tagName,i=r.toLowerCase();if(-1!==["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(r))return A(e),!1;for(var n=["META","LINK","XML","ST1:","O:","W:","FONT"],a=0;a<n.length;a++)if(-1!==r.indexOf(n[a]))return e.innerHTML&&(e.outerHTML=e.innerHTML),A(e),!1;for(var l=["I","U"],s=0;s<l.length;s++)if(r===l[s])return e.innerHTML&&(e.outerHTML=e.innerHTML),A(e),!1;if("TD"!==r){var o=e.getAttribute("class")||"MsoNormal";if(t&&o){for(var d=(o=E(o)).split(" "),f=0;f<d.length;f++){var u=[],g="."+d[f];u.push(g),g=i+g,u.push(g);for(var p=0;p<u.length;p++)t[u[p]]&&L(e,t[u[p]])}e.removeAttribute("class")}t&&t[i]&&L(e,t[i])}if(-1!==["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(r)){var c=e.getAttribute("class");if(c&&(t&&t[r.toLowerCase()+"."+c]&&L(e,t[r.toLowerCase()+"."+c]),-1!==c.toLowerCase().indexOf("mso"))){var m=E(c);(m=m.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?e.setAttribute("class",m):e.removeAttribute("class")}var h=e.getAttribute("style");if(h){var v=h.match(/text-align:.+?[; "]{1,1}/gi);v&&v[v.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}C(e)}if("TR"===r&&function N(e,t){T.node.clearAttributes(e);for(var r=e.firstElementChild,i=0,n=!1,a=null;r;){r.firstElementChild&&-1!==r.firstElementChild.tagName.indexOf("W:")&&(r.innerHTML=r.firstElementChild.innerHTML),(a=r.getAttribute("width"))||n||(n=!0),i+=parseInt(a,10),(!r.firstChild||r.firstChild&&r.firstChild.data===M.UNICODE_NBSP)&&(r.firstChild&&A(r.firstChild),r.innerHTML="<br>");for(var l=r.firstElementChild,s=1===r.children.length;l;)"P"!==l.tagName||H(l)||s&&C(l),l=l.nextElementSibling;if(t){var o=r.getAttribute("class");if(o){var d=(o=E(o)).match(/xl[0-9]+/gi);if(d){var f="."+d[0];t[f]&&L(r,t[f])}}t.td&&L(r,t.td)}var u=r.getAttribute("style");u&&(u=E(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 m=u.match(/text-align:.+?[; "]{1,1}/gi);m&&(c=m[m.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===c&&(c=null)}var h=null;if(u){var v=u.match(/background:.+?[; "]{1,1}/gi);v&&(h=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var b=r.getAttribute("colspan"),y=r.getAttribute("rowspan");b&&r.setAttribute("colspan",b),y&&r.setAttribute("rowspan",y),g&&(r.style["vertical-align"]=g),c&&(r.style["text-align"]=c),h&&(r.style["background-color"]=h),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"))for(var b=e.querySelectorAll("span"),y=0;y<b.length;y++)b[y].innerText||(b[y].outerHTML=b[y].innerHTML);if("TD"!==r&&"TH"!==r||e.innerHTML||(e.innerHTML="<br>"),"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 x=E(e.getAttribute("style"));(x=x.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",x):e.removeAttribute("style")}return!0}function a(e,t){0<=e.indexOf("<html")&&(e=e.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1")),function f(e){for(var t=e.split("v:shape"),r=1;r<t.length;r++){var i=t[r],n=i.split(' id="')[1];if(n&&1<n.length){n=n.split('"')[0];var a=i.split(' o:spid="')[1];a&&1<a.length&&(a=a.split('"')[0],g[n]=a)}}}(e);var r=(new DOMParser).parseFromString(e,"text/html"),i=r.head,n=r.body,o=function u(e){var t={},r=e.getElementsByTagName("style");if(r.length){var i=r[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(i)for(var n=0;n<i.length;n++){var a=i[n],l=a.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),s=a.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");l=l.replace(/^[\s]|[\s]$/gm,""),s=s.replace(/^[\s]|[\s]$/gm,""),l=l.replace(/\n|\r|\n\r/g,""),s=s.replace(/\n|\r|\n\r/g,"");for(var o=l.split(", "),d=0;d<o.length;d++)t[o[d]]=s}}return t}(i);p(n,function(e){if(e.nodeType===Node.TEXT_NODE&&/\n|\u00a0|\r/.test(e.data)){if(!/\S| /.test(e.data)&&!/[\u00a0]+/.test(e.data))return e.data===M.UNICODE_NBSP?(e.data="\u200b",!0):1===e.data.length&&10===e.data.charCodeAt(0)?(e.data=" ",!0):(A(e),!1);e.data=e.data.replace(/\n|\r/gi," ")}return!0}),p(n,function(e){return e.nodeType!==Node.ELEMENT_NODE||"V:IMAGEDATA"!==e.tagName&&"IMG"!==e.tagName||m(e,t),!0});for(var a=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),l=a.length-1;0<=l;l--)a[l].previousElementSibling&&"LI"===a[l].previousElementSibling.tagName&&a[l].previousElementSibling.appendChild(a[l]);p(n,function(e){if(e.nodeType===Node.TEXT_NODE)return e.data=e.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(e.nodeType===Node.ELEMENT_NODE){if(H(e)){var t=e.parentNode,r=e.previousSibling,i=function S(e,t,r,i){var n,a,l=/[0-9a-zA-Z]./gi,s=!1,o=navigator.userAgent.toLowerCase();-1!=o.indexOf("safari")&&(o=-1<o.indexOf("chrome")?1:"safari"),e.innerHTML.includes("mso-list:\nIgnore")&&(e.innerHTML=e.innerHTML.replace(/mso-list:\nIgnore/gi,"mso-list:Ignore"));var d,f,u,g,p=e.querySelector('span[style="mso-list:Ignore"]');null==p&&"safari"==o&&(p=e.querySelector('span[lang="PT-BR"]'));var c;p&&(s=s||l.test(p.textContent)),null!==p&&(c=p.textContent.trim().split(".")[0]),u=1==s?("1"==(c=p.textContent.trim().split(".")[0])?g="decimal;":"i"==c?g="lower-roman;":"I"==c?g="upper-roman;":"o"==c?g="circle;":c.match(/^v$/)||(c.match(/^[a-z]$/)||c.match(/^[a-z]\)$/)?g="lower-alpha;":(c.match(/^[A-Z]$/)||c.match(/^[A-Z]\)$/))&&(g="upper-alpha;")),g="list-style-type: "+g,"ol"):(null!=p&&(c=p.textContent.trim().split(".")[0]),"\xa7"==c?g="square;":"\xb7"==c&&(g="disc;"),g="list-style-type: "+g,"ul");var m,h="";p==undefined||p.textContent==undefined||isNaN(parseInt(p.textContent.trim().split(".")[1],10))||(h=' class="decimal_type" ');var v,b=O(e),y=e.style.marginLeft;if(y.includes("in")?(v="in",y=parseFloat(y)-.5):y.includes("pt")&&(v="px",y=parseFloat(y)-10),1==b)if(m=g?"<"+u+' style = "'+g+"; margin-left:"+y+v+';">':"<"+u+' style="margin-left:'+y+v+';">',"list-style-type: upper-alpha;"==g){var x=c.charCodeAt(0)-64;m=g?"<"+u+h+' start="'+x+'" style = "'+g+" margin-left:"+y+v+';">':"<"+u+">"}else if("list-style-type: lower-alpha;"==g){var N=c.charCodeAt(0)-96;m=g?"<"+u+h+' start="'+N+'" style = "'+g+"margin-left:"+y+v+';">':"<"+u+">"}else m=g?"<"+u+h+' style = "'+g+";margin-left:"+y+v+';">':"<"+u+' style="margin-left:'+y+v+';">';else if("list-style-type: upper-alpha;"==g){var T=c.charCodeAt(0)-64;m=g?"<"+u+h+' style = "'+g+' start="'+T+'">':"<"+u+">"}else if("list-style-type: lower-alpha;"==g){var A=c.charCodeAt(0)-96;m=g?"<"+u+h+' style = "'+g+' start="'+A+'">':"<"+u+">"}else m=g?"<"+u+h+' style = "'+g+'">':"<"+u+">";for(var C=!1;e;){if(!H(e)){if(e.outerHTML&&0<e.outerHTML.indexOf("mso-bookmark")&&0==(e.textContent||"").length){e=e.nextElementSibling;continue}break}var E=O(e);if((r=r||E)<E)m+=(f=S(e,t,E,e.style.marginLeft)).el.outerHTML,e=f.currentNode;else{if(E<r)break;e.firstElementChild&&e.firstElementChild.firstElementChild&&e.firstElementChild.firstElementChild.firstChild&&(l.lastIndex=0),a&&a.firstElementChild&&a.firstElementChild.firstElementChild&&a.firstElementChild.firstElementChild.firstChild&&(l.lastIndex=0,n=l.test(a.firstElementChild.firstElementChild.firstChild.data||a.firstElementChild.firstElementChild.firstChild.firstChild&&a.firstElementChild.firstElementChild.firstChild.firstChild.data||""));var L=!1;(!i&&!e.style.marginLeft||i&&e.style.marginLeft&&i===e.style.marginLeft)&&(L=!0),i=e.style.marginLeft,L||n===undefined?(d=I(e,t),e.nextSibling&&e.nextSibling.innerText!=undefined&&e.nextSibling.innerText!=undefined&&!m.includes('class="decimal_type"')&&(isNaN(parseInt(e.nextSibling.innerText.trim().split(".")[1],10))||(m=m.substring(3,0)+' class="decimal_type"'+m.substring(3,m.length))),m+="<li>"+d+"</li>"):(1==E&&(m+="</"+u+">",C=!0,a=null),m+=(f=S(e,t,E,e.style.marginLeft)).el.outerHTML,e=f.currentNode);var M=e&&e.nextElementSibling;if(M&&(a=M.previousElementSibling),e&&!H(e)){if(e.outerHTML&&0<e.outerHTML.indexOf("mso-bookmark")&&0==(e.textContent||"").length){e=e.nextElementSibling;continue}break}e&&e.parentNode&&e.parentNode.removeChild(e),e=M}}C||(m+="</"+u+">");var w=document.createElement("div");return w.innerHTML=m,{el:w,currentNode:e}}(e,o).el,n=null;return(n=r?r.nextSibling:t.firstChild)?t.insertBefore(i,n):t.appendChild(i),!1}return"FONT"===e.tagName&&o["."+e.getAttribute("class")]&&(e=function s(e,t){for(var r=document.createElement(t),i=0;i<e.attributes.length;i++){var n=e.attributes[i].name;r.setAttribute(n,e.getAttribute(n))}return r.innerHTML=e.innerHTML,e.parentNode.replaceChild(r,e),r}(e,"span")),h(e,o)}if(e.nodeType!==Node.COMMENT_NODE)return!0;if(-1<e.data.indexOf("[if !supportLineBreakNewLine]"))for(var a=e.nextSibling;a;)(a=e.nextSibling)&&A(a),a.data&&-1<a.data.indexOf("[endif]")&&(a=null);if(-1<e.data.indexOf("[if supportFields]")&&-1<e.data.indexOf("FORMCHECKBOX")){var l=document.createElement("input");l.type="checkbox",e.parentNode.insertBefore(l,e.nextSibling)}return A(e),!1}),p(n,function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e.tagName;if(!e.innerHTML&&-1===["BR","IMG","INPUT"].indexOf(t)){for(var r=e.parentNode;r&&(A(e),!(e=r).innerHTML)&&"TD"!==e.parentNode.tagName;)r=e.parentNode;return!1}!function f(e){var t=e.getAttribute("style");if(t){(t=E(t))&&";"!==t.slice(-1)&&(t+=";");var r=t.match(/(^|\S+?):.+?;{1,1}/gi);if(r){for(var i={},n=0;n<r.length;n++){var a=r[n].split(":");2===a.length&&("text-align"===a[0]&&"SPAN"===e.tagName||(i[a[0]]=a[1]))}var l="";for(var s in i)if(i.hasOwnProperty(s)){if("font-size"===s&&"pt;"===i[s].slice(-3)){var o=null;try{o=parseFloat(i[s].slice(0,-3),10)}catch(d){o=null}o&&(o=Math.round(1.33*o),i[s]=o+"px;")}l+=s+":"+i[s]}l&&e.setAttribute("style",l)}}}(e)}return!0}),p(n,function(e){if(e&&"A"===e.nodeName&&""===e.href){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}return!0}),p(n,function(e){return!e||"B"!==e.nodeName||(e.outerHTML=e.innerHTML,A(e),!1)});var s=n.outerHTML,d=T.opts.htmlAllowedStyleProps;return T.opts.htmlAllowedStyleProps=T.opts.wordAllowedStyleProps,s=T.clean.html(s,T.opts.wordDeniedTags,T.opts.wordDeniedAttrs,!1),T.opts.htmlAllowedStyleProps=d,s}return{_init:function e(){T.events.on("paste.wordPaste",function(e){return n=e,T.opts.wordPasteModal?function a(){if(!l){var e='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+T.language.translate("Word Paste Detected")+"</h4>",t=function n(){var e='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">';return e+='<p style="text-align: left;">'+T.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",e+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+T.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+T.language.translate("Keep")+"</button></div>",e+="</div>"}(),r=T.modals.create(s,e,t),i=r.$body;l=r.$modal,r.$modal.addClass("fr-middle"),T.events.bindClick(i,"button.fr-remove-word",function(){var e=l.data("instance")||T;e.wordPaste.clean()}),T.events.bindClick(i,"button.fr-keep-word",function(){var e=l.data("instance")||T;e.wordPaste.clean(!0)}),T.events.$on(d(T.o_win),"resize",function(){T.modals.resize(s)})}T.modals.show(s),T.modals.resize(s)}():t(T.opts.wordPasteKeepFormatting),!1})},clean:t,_wordClean:a}}});
7
+ !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(w){"use strict";w=w&&w.hasOwnProperty("default")?w["default"]:w,Object.assign(w.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}),w.PLUGINS.wordPaste=function(N){var l,n,d=N.$,s="word_paste",u={};function t(e){var t=N.opts.wordAllowedStyleProps;e||(N.opts.wordAllowedStyleProps=[]),0===n.indexOf("<colgroup>")&&(n="<table>"+n+"</table>"),n=a(n=n.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var r="",i=0;i++<t.length;)r+="&nbsp;";return r}),N.paste.getRtfClipboard());var r=N.doc.createElement("DIV");r.innerHTML=n,N.html.cleanBlankSpaces(r),n=r.innerHTML,n=(n=N.paste.cleanEmptyTagsAndDivs(n)).replace(/\u200b/g,""),function i(){N.modals.hide(s)}(),N.paste.clean(n,!0,!0),N.opts.wordAllowedStyleProps=t}function C(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e,t){if(t(e))for(var r=e.firstChild;r;){var i=r,n=r.previousSibling;r=r.nextSibling,p(i,t),i.previousSibling||i.nextSibling||i.parentNode||!r||n===r.previousSibling||!r.parentNode?i.previousSibling||i.nextSibling||i.parentNode||!r||r.previousSibling||r.nextSibling||r.parentNode||(n?r=n.nextSibling?n.nextSibling.nextSibling:null:e.firstChild&&(r=e.firstChild.nextSibling)):r=n?n.nextSibling:e.firstChild}}function H(e){if(!e.getAttribute("style")||!/mso-list:[\s]*l/gi.test(e.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!e.querySelector('[style="mso-list:Ignore"]'))return!!(e.outerHTML&&0<=e.outerHTML.indexOf("\x3c!--[if !supportLists]--\x3e"))}catch(t){return!1}return!0}function O(e){return e.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1")}function I(e,i){var t=e.cloneNode(!0);if(-1!==["H1","H2","H3","H4","H5","H6"].indexOf(e.tagName)){var r=document.createElement(e.tagName.toLowerCase());r.setAttribute("style",e.getAttribute("style")),r.innerHTML=t.innerHTML,t.innerHTML=r.outerHTML}p(t,function(e){if(e.nodeType==Node.COMMENT_NODE&&(N.browser.msie||N.browser.safari||N.browser.edge))try{if("[if !supportLists]"===e.data){for(e=e.nextSibling;e&&e.nodeType!==Node.COMMENT_NODE;){var t=e.nextSibling;e.parentNode.removeChild(e),e=t}e&&e.nodeType==Node.COMMENT_NODE&&e.parentNode.removeChild(e)}}catch(r){}return e.nodeType===Node.ELEMENT_NODE&&("mso-list:\nIgnore"===e.getAttribute("style")&&e.setAttribute("style","mso-list:Ignore"),"mso-list:Ignore"===e.getAttribute("style")&&e.parentNode.removeChild(e),e.setAttribute("style",function n(e){var r="",i=e.getAttribute("style");i&&["line-height","font-family","font-size","color","background"].forEach(function(e){var t=i.match(new RegExp(e+":.*(;|)"));t&&(r+=t[0]+";")});return r}(e)),h(e,i)),!0});var n=t.innerHTML;return n=n.replace(/<!--[\s\S]*?-->/gi,"")}function y(e,t){for(var r=document.createElement(t),i=0;i<e.attributes.length;i++){var n=e.attributes[i].name;r.setAttribute(n,e.getAttribute(n))}return r.innerHTML=e.innerHTML,e.parentNode.replaceChild(r,e),r}function A(e){var t=e.getAttribute("align");t&&(e.style["text-align"]=t,e.removeAttribute("align"))}function E(e){return e.replace(/\n|\r|\n\r|&quot;/g,"")}function T(e,t,r){if(t){var i=e.getAttribute("style");i&&";"!==i.slice(-1)&&(i+=";"),t&&";"!==t.slice(-1)&&(t+=";"),t=t.replace(/\n/gi,"");var n=null;n=r?(i||"")+t:t+(i||""),e.setAttribute("style",n)}}var c=null;function f(e,t,r){for(var i=e.split(r),n=1;n<i.length;n++){var a=i[n];if(1<(a=a.split("shplid")).length){a=a[1];for(var l="",s=0;s<a.length&&"\\"!==a[s]&&"{"!==a[s]&&" "!==a[s]&&"\r"!==a[s]&&"\n"!==a[s];)l+=a[s],s++;var o=a.split("bliptag");if(o&&o.length<2)continue;var d=null;if(-1!==o[0].indexOf("pngblip")?d="image/png":-1!==o[0].indexOf("jpegblip")&&(d="image/jpeg"),!d)continue;var f=o[1].split("}");if(f&&f.length<2)continue;var g=void 0;if(2<f.length&&-1!==f[0].indexOf("blipuid"))g=f[1].split(" ");else{if((g=f[0].split(" "))&&g.length<2)continue;g.shift()}var u=g.join("");c[t+l]={image_hex:u,image_type:d}}}}function m(e,t){if(t){var r;if("IMG"===e.tagName){var i=e.getAttribute("src");if(!i||-1===i.indexOf("file://"))return;if(0===i.indexOf("file://")&&N.helpers.isURL(e.getAttribute("alt")))return void e.setAttribute("src",e.getAttribute("alt"));(r=u[e.getAttribute("v:shapes")])||(r=e.getAttribute("v:shapes"),e.parentNode&&e.parentNode.parentNode&&0<=e.parentNode.parentNode.innerHTML.indexOf("msEquation")&&(r=null))}else r=e.parentNode.getAttribute("o:spid");if(e.removeAttribute("height"),r){!function s(e){c={},f(e,"i","\\shppict"),f(e,"s","\\shp{")}(t);var n=c[r.substring(7)];if(n){var a=function o(e){for(var t=e.match(/[0-9a-f]{2}/gi),r=[],i=0;i<t.length;i++)r.push(String.fromCharCode(parseInt(t[i],16)));var n=r.join("");return btoa(n)}(n.image_hex),l="data:"+n.image_type+";base64,"+a;"IMG"===e.tagName?(e.src=l,e.setAttribute("data-fr-image-pasted",!0)):d(e.parentNode).before('<img data-fr-image-pasted="true" src="'+l+'" style="'+e.parentNode.getAttribute("style")+'">').remove()}}}}function h(e,t){var r=e.tagName,i=r.toLowerCase();e.firstElementChild&&("I"===e.firstElementChild.tagName?y(e.firstElementChild,"em"):"B"===e.firstElementChild.tagName&&y(e.firstElementChild,"strong"));if(-1!==["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(r))return C(e),!1;for(var n=["META","LINK","XML","ST1:","O:","W:","FONT"],a=0;a<n.length;a++)if(-1!==r.indexOf(n[a]))return e.innerHTML&&(e.outerHTML=e.innerHTML),C(e),!1;if("TD"!==r){var l=e.getAttribute("class")||"MsoNormal";if(t&&l){for(var s=(l=E(l)).split(" "),o=0;o<s.length;o++){var d=[],f="."+s[o];d.push(f),f=i+f,d.push(f);for(var g=0;g<d.length;g++)t[d[g]]&&T(e,t[d[g]])}e.removeAttribute("class")}t&&t[i]&&T(e,t[i])}if(-1!==["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(r)){var u=e.getAttribute("class");if(u&&(t&&t[r.toLowerCase()+"."+u]&&T(e,t[r.toLowerCase()+"."+u]),-1!==u.toLowerCase().indexOf("mso"))){var p=E(u);(p=p.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?e.setAttribute("class",p):e.removeAttribute("class")}var c=e.getAttribute("style");if(c){var m=c.match(/text-align:.+?[; "]{1,1}/gi);m&&m[m.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}A(e)}if("TR"===r&&function x(e,t){N.node.clearAttributes(e);for(var r=e.firstElementChild,i=0,n=!1,a=null;r;){r.firstElementChild&&-1!==r.firstElementChild.tagName.indexOf("W:")&&(r.innerHTML=r.firstElementChild.innerHTML),(a=r.getAttribute("width"))||n||(n=!0),i+=parseInt(a,10),(!r.firstChild||r.firstChild&&r.firstChild.data===w.UNICODE_NBSP)&&(r.firstChild&&C(r.firstChild),r.innerHTML="<br>");for(var l=r.firstElementChild,s=1===r.children.length;l;)"P"!==l.tagName||H(l)||s&&A(l),l=l.nextElementSibling;if(t){var o=r.getAttribute("class");if(o){var d=(o=E(o)).match(/xl[0-9]+/gi);if(d){var f="."+d[0];t[f]&&T(r,t[f])}}t.td&&T(r,t.td)}var g=r.getAttribute("style");g&&(g=E(g))&&";"!==g.slice(-1)&&(g+=";");var u=r.getAttribute("valign");if(!u&&g){var p=g.match(/vertical-align:.+?[; "]{1,1}/gi);p&&(u=p[p.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var c=null;if(g){var m=g.match(/text-align:.+?[; "]{1,1}/gi);m&&(c=m[m.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===c&&(c=null)}var h=null;if(g){var v=g.match(/background:.+?[; "]{1,1}/gi);v&&(h=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var b=r.getAttribute("colspan"),y=r.getAttribute("rowspan");b&&r.setAttribute("colspan",b),y&&r.setAttribute("rowspan",y),u&&(r.style["vertical-align"]=u),c&&(r.style["text-align"]=c),h&&(r.style["background-color"]=h),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"))for(var h=e.querySelectorAll("span"),v=0;v<h.length;v++)h[v].innerText||(h[v].outerHTML=h[v].innerHTML);if("TD"!==r&&"TH"!==r||e.innerHTML||(e.innerHTML="<br>"),"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=E(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}function a(e,t){0<=e.indexOf("<html")&&(e=e.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1")),function f(e){for(var t=e.split("v:shape"),r=1;r<t.length;r++){var i=t[r],n=i.split(' id="')[1];if(n&&1<n.length){n=n.split('"')[0];var a=i.split(' o:spid="')[1];a&&1<a.length&&(a=a.split('"')[0],u[n]=a)}}}(e);var r=(new DOMParser).parseFromString(e,"text/html"),i=r.head,n=r.body,s=function g(e){var t={},r=e.getElementsByTagName("style");if(r.length){var i=r[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(i)for(var n=0;n<i.length;n++){var a=i[n],l=a.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),s=a.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");l=l.replace(/^[\s]|[\s]$/gm,""),s=s.replace(/^[\s]|[\s]$/gm,""),l=l.replace(/\n|\r|\n\r/g,""),s=s.replace(/\n|\r|\n\r/g,"");for(var o=l.split(", "),d=0;d<o.length;d++)t[o[d]]=s}}return t}(i);p(n,function(e){if(e.nodeType===Node.TEXT_NODE&&/\n|\u00a0|\r/.test(e.data)){if(!/\S| /.test(e.data)&&!/[\u00a0]+/.test(e.data))return e.data===w.UNICODE_NBSP?(e.data="\u200b",!0):1===e.data.length&&10===e.data.charCodeAt(0)?(e.data=" ",!0):(C(e),!1);e.data=e.data.replace(/\n|\r/gi," ")}return!0}),p(n,function(e){return e.nodeType!==Node.ELEMENT_NODE||"V:IMAGEDATA"!==e.tagName&&"IMG"!==e.tagName||m(e,t),!0});for(var a=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),l=a.length-1;0<=l;l--)a[l].previousElementSibling&&"LI"===a[l].previousElementSibling.tagName&&a[l].previousElementSibling.appendChild(a[l]);p(n,function(e){if(e.nodeType===Node.TEXT_NODE)return e.data=e.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(e.nodeType===Node.ELEMENT_NODE){if(H(e)){var t=e.parentNode,r=e.previousSibling,i=function M(e,t,r,i){var n,a,l=/[0-9a-zA-Z]./gi,s=!1,o=navigator.userAgent.toLowerCase();-1!=o.indexOf("safari")&&(o=-1<o.indexOf("chrome")?1:"safari"),e.innerHTML.includes("mso-list:\nIgnore")&&(e.innerHTML=e.innerHTML.replace(/mso-list:\nIgnore/gi,"mso-list:Ignore"));var d,f,g,u,p=e.querySelector('span[style="mso-list:Ignore"]');null==p&&"safari"==o&&(p=e.querySelector('span[lang="PT-BR"]'));var c;p&&(s=s||l.test(p.textContent)),null!==p&&(c=p.textContent.trim().split(".")[0]),g=1==s?("1"==(c=p.textContent.trim().split(".")[0])?u="decimal;":"i"==c?u="lower-roman;":"I"==c?u="upper-roman;":"o"==c?u="circle;":c.match(/^v$/)||(c.match(/^[a-z]$/)||c.match(/^[a-z]\)$/)?u="lower-alpha;":(c.match(/^[A-Z]$/)||c.match(/^[A-Z]\)$/))&&(u="upper-alpha;")),u="list-style-type: "+u,"ol"):(null!=p&&(c=p.textContent.trim().split(".")[0]),"\xa7"==c?u="square;":"\xb7"==c&&(u="disc;"),u="list-style-type: "+u,"ul");var m,h="";p==undefined||p.textContent==undefined||isNaN(parseInt(p.textContent.trim().split(".")[1],10))||(h=' class="decimal_type" ');var v,b=O(e),y=e.style.marginLeft;if(y.includes("in")?(v="in",y=parseFloat(y)-.5):y.includes("pt")&&(v="px",y=parseFloat(y)-10),1==b)if(m=u?"<"+g+' style = "'+u+"; margin-left:"+y+v+';">':"<"+g+' style="margin-left:'+y+v+';">',"list-style-type: upper-alpha;"==u){var x=c.charCodeAt(0)-64;m=u?"<"+g+h+' start="'+x+'" style = "'+u+" margin-left:"+y+v+';">':"<"+g+">"}else if("list-style-type: lower-alpha;"==u){var N=c.charCodeAt(0)-96;m=u?"<"+g+h+' start="'+N+'" style = "'+u+"margin-left:"+y+v+';">':"<"+g+">"}else m=u?"<"+g+h+' style = "'+u+";margin-left:"+y+v+';">':"<"+g+' style="margin-left:'+y+v+';">';else if("list-style-type: upper-alpha;"==u){var C=c.charCodeAt(0)-64;m=u?"<"+g+h+' style = "'+u+' start="'+C+'">':"<"+g+">"}else if("list-style-type: lower-alpha;"==u){var A=c.charCodeAt(0)-96;m=u?"<"+g+h+' style = "'+u+' start="'+A+'">':"<"+g+">"}else m=u?"<"+g+h+' style = "'+u+'">':"<"+g+">";for(var E=!1;e;){if(!H(e)){if(e.outerHTML&&0<e.outerHTML.indexOf("mso-bookmark")&&0==(e.textContent||"").length){e=e.nextElementSibling;continue}break}var T=O(e);if((r=r||T)<T)m+=(f=M(e,t,T,e.style.marginLeft)).el.outerHTML,e=f.currentNode;else{if(T<r)break;e.firstElementChild&&e.firstElementChild.firstElementChild&&e.firstElementChild.firstElementChild.firstChild&&(l.lastIndex=0),a&&a.firstElementChild&&a.firstElementChild.firstElementChild&&a.firstElementChild.firstElementChild.firstChild&&(l.lastIndex=0,n=l.test(a.firstElementChild.firstElementChild.firstChild.data||a.firstElementChild.firstElementChild.firstChild.firstChild&&a.firstElementChild.firstElementChild.firstChild.firstChild.data||""));var w=!1;(!i&&!e.style.marginLeft||i&&e.style.marginLeft&&i===e.style.marginLeft)&&(w=!0),i=e.style.marginLeft,w||n===undefined?(d=I(e,t),e.nextSibling&&e.nextSibling.innerText!=undefined&&e.nextSibling.innerText!=undefined&&!m.includes('class="decimal_type"')&&(isNaN(parseInt(e.nextSibling.innerText.trim().split(".")[1],10))||(m=m.substring(3,0)+' class="decimal_type"'+m.substring(3,m.length))),m+="<li>"+d+"</li>"):(1==T&&(m+="</"+g+">",E=!0,a=null),m+=(f=M(e,t,T,e.style.marginLeft)).el.outerHTML,e=f.currentNode);var S=e&&e.nextElementSibling;if(S&&(a=S.previousElementSibling),e&&!H(e)){if(e.outerHTML&&0<e.outerHTML.indexOf("mso-bookmark")&&0==(e.textContent||"").length){e=e.nextElementSibling;continue}break}e&&e.parentNode&&e.parentNode.removeChild(e),e=S}}E||(m+="</"+g+">");var L=document.createElement("div");return L.innerHTML=m,{el:L,currentNode:e}}(e,s).el,n=null;return(n=r?r.nextSibling:t.firstChild)?t.insertBefore(i,n):t.appendChild(i),!1}return"FONT"===e.tagName&&s["."+e.getAttribute("class")]&&(e=y(e,"span")),h(e,s)}if(e.nodeType!==Node.COMMENT_NODE)return!0;if(-1<e.data.indexOf("[if !supportLineBreakNewLine]"))for(var a=e.nextSibling;a;)(a=e.nextSibling)&&C(a),a.data&&-1<a.data.indexOf("[endif]")&&(a=null);if(-1<e.data.indexOf("[if supportFields]")&&-1<e.data.indexOf("FORMCHECKBOX")){var l=document.createElement("input");l.type="checkbox",e.parentNode.insertBefore(l,e.nextSibling)}return C(e),!1}),p(n,function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e.tagName;if(!e.innerHTML&&-1===["BR","IMG","INPUT"].indexOf(t)){for(var r=e.parentNode;r&&(C(e),!(e=r).innerHTML)&&"TD"!==e.parentNode.tagName;)r=e.parentNode;return!1}!function f(e){var t=e.getAttribute("style");if(t){(t=E(t))&&";"!==t.slice(-1)&&(t+=";");var r=t.match(/(^|\S+?):.+?;{1,1}/gi);if(r){for(var i={},n=0;n<r.length;n++){var a=r[n].split(":");2===a.length&&("text-align"===a[0]&&"SPAN"===e.tagName||(i[a[0]]=a[1]))}var l="";for(var s in i)if(i.hasOwnProperty(s)){if("font-size"===s&&"pt;"===i[s].slice(-3)){var o=null;try{o=parseFloat(i[s].slice(0,-3),10)}catch(d){o=null}o&&(o=Math.round(1.33*o),i[s]=o+"px;")}l+=s+":"+i[s]}l&&e.setAttribute("style",l)}}}(e)}return!0}),p(n,function(e){if(e&&"A"===e.nodeName&&""===e.href){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}return!0});var o=n.outerHTML,d=N.opts.htmlAllowedStyleProps;return N.opts.htmlAllowedStyleProps=N.opts.wordAllowedStyleProps,o=N.clean.html(o,N.opts.wordDeniedTags,N.opts.wordDeniedAttrs,!1),N.opts.htmlAllowedStyleProps=d,o}return{_init:function e(){N.events.on("paste.wordPaste",function(e){return n=e,N.opts.wordPasteModal?function a(){if(!l){var e='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+N.language.translate("Word Paste Detected")+"</h4>",t=function n(){var e='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">';return e+='<p style="text-align: left;">'+N.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",e+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+N.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+N.language.translate("Keep")+"</button></div>",e+="</div>"}(),r=N.modals.create(s,e,t),i=r.$body;l=r.$modal,r.$modal.addClass("fr-middle"),N.events.bindClick(i,"button.fr-remove-word",function(){var e=l.data("instance")||N;e.wordPaste.clean()}),N.events.bindClick(i,"button.fr-keep-word",function(){var e=l.data("instance")||N;e.wordPaste.clean(!0)}),N.events.$on(d(N.o_win),"resize",function(){N.modals.resize(s)})}N.modals.show(s),N.modals.resize(s)}():t(N.opts.wordPasteKeepFormatting),!1})},clean:t,_wordClean:a}}});