wysiwyg-rails 4.0.8 → 4.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +3 -3
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +3 -3
  4. data/app/assets/javascripts/languages/ar.js +2 -2
  5. data/app/assets/javascripts/languages/bs.js +2 -2
  6. data/app/assets/javascripts/languages/cs.js +2 -2
  7. data/app/assets/javascripts/languages/da.js +2 -2
  8. data/app/assets/javascripts/languages/de.js +2 -2
  9. data/app/assets/javascripts/languages/el.js +2 -2
  10. data/app/assets/javascripts/languages/en_ca.js +2 -2
  11. data/app/assets/javascripts/languages/en_gb.js +2 -2
  12. data/app/assets/javascripts/languages/es.js +2 -2
  13. data/app/assets/javascripts/languages/et.js +2 -2
  14. data/app/assets/javascripts/languages/fa.js +2 -2
  15. data/app/assets/javascripts/languages/fi.js +2 -2
  16. data/app/assets/javascripts/languages/fr.js +2 -2
  17. data/app/assets/javascripts/languages/he.js +2 -2
  18. data/app/assets/javascripts/languages/hr.js +2 -2
  19. data/app/assets/javascripts/languages/hu.js +2 -2
  20. data/app/assets/javascripts/languages/id.js +2 -2
  21. data/app/assets/javascripts/languages/it.js +2 -2
  22. data/app/assets/javascripts/languages/ja.js +2 -2
  23. data/app/assets/javascripts/languages/ko.js +2 -2
  24. data/app/assets/javascripts/languages/ku.js +2 -2
  25. data/app/assets/javascripts/languages/me.js +2 -2
  26. data/app/assets/javascripts/languages/nb.js +2 -2
  27. data/app/assets/javascripts/languages/nl.js +2 -2
  28. data/app/assets/javascripts/languages/pl.js +2 -2
  29. data/app/assets/javascripts/languages/pt_br.js +2 -2
  30. data/app/assets/javascripts/languages/pt_pt.js +2 -2
  31. data/app/assets/javascripts/languages/ro.js +2 -2
  32. data/app/assets/javascripts/languages/ru.js +2 -2
  33. data/app/assets/javascripts/languages/sk.js +2 -2
  34. data/app/assets/javascripts/languages/sl.js +2 -2
  35. data/app/assets/javascripts/languages/sr.js +2 -2
  36. data/app/assets/javascripts/languages/sv.js +2 -2
  37. data/app/assets/javascripts/languages/th.js +2 -2
  38. data/app/assets/javascripts/languages/tr.js +2 -2
  39. data/app/assets/javascripts/languages/uk.js +2 -2
  40. data/app/assets/javascripts/languages/vi.js +2 -2
  41. data/app/assets/javascripts/languages/zh_cn.js +2 -2
  42. data/app/assets/javascripts/languages/zh_tw.js +2 -2
  43. data/app/assets/javascripts/plugins/align.min.js +2 -2
  44. data/app/assets/javascripts/plugins/char_counter.min.js +2 -2
  45. data/app/assets/javascripts/plugins/code_beautifier.min.js +2 -2
  46. data/app/assets/javascripts/plugins/code_view.min.js +2 -2
  47. data/app/assets/javascripts/plugins/colors.min.js +2 -2
  48. data/app/assets/javascripts/plugins/cryptojs.min.js +2 -2
  49. data/app/assets/javascripts/plugins/draggable.min.js +2 -2
  50. data/app/assets/javascripts/plugins/edit_in_popup.min.js +2 -2
  51. data/app/assets/javascripts/plugins/emoticons.min.js +2 -2
  52. data/app/assets/javascripts/plugins/entities.min.js +2 -2
  53. data/app/assets/javascripts/plugins/file.min.js +2 -2
  54. data/app/assets/javascripts/plugins/files_manager.min.js +3 -3
  55. data/app/assets/javascripts/plugins/font_family.min.js +2 -2
  56. data/app/assets/javascripts/plugins/font_size.min.js +2 -2
  57. data/app/assets/javascripts/plugins/forms.min.js +2 -2
  58. data/app/assets/javascripts/plugins/fullscreen.min.js +2 -2
  59. data/app/assets/javascripts/plugins/help.min.js +2 -2
  60. data/app/assets/javascripts/plugins/image.min.js +3 -3
  61. data/app/assets/javascripts/plugins/image_manager.min.js +2 -2
  62. data/app/assets/javascripts/plugins/inline_class.min.js +2 -2
  63. data/app/assets/javascripts/plugins/inline_style.min.js +2 -2
  64. data/app/assets/javascripts/plugins/line_breaker.min.js +2 -2
  65. data/app/assets/javascripts/plugins/line_height.min.js +2 -2
  66. data/app/assets/javascripts/plugins/link.min.js +2 -2
  67. data/app/assets/javascripts/plugins/lists.min.js +2 -2
  68. data/app/assets/javascripts/plugins/markdown.min.js +3 -3
  69. data/app/assets/javascripts/plugins/paragraph_format.min.js +2 -2
  70. data/app/assets/javascripts/plugins/paragraph_style.min.js +2 -2
  71. data/app/assets/javascripts/plugins/print.min.js +2 -2
  72. data/app/assets/javascripts/plugins/quick_insert.min.js +2 -2
  73. data/app/assets/javascripts/plugins/quote.min.js +3 -3
  74. data/app/assets/javascripts/plugins/save.min.js +2 -2
  75. data/app/assets/javascripts/plugins/special_characters.min.js +2 -2
  76. data/app/assets/javascripts/plugins/table.min.js +2 -2
  77. data/app/assets/javascripts/plugins/track_changes.min.js +3 -3
  78. data/app/assets/javascripts/plugins/trim_video.min.js +2 -2
  79. data/app/assets/javascripts/plugins/url.min.js +2 -2
  80. data/app/assets/javascripts/plugins/video.min.js +2 -2
  81. data/app/assets/javascripts/plugins/word_paste.min.js +2 -2
  82. data/app/assets/javascripts/plugins.pkgd.min.js +3 -3
  83. data/app/assets/javascripts/third_party/embedly.min.js +2 -2
  84. data/app/assets/javascripts/third_party/font_awesome.min.js +2 -2
  85. data/app/assets/javascripts/third_party/image_tui.min.js +2 -2
  86. data/app/assets/javascripts/third_party/showdown.min.js +3 -3
  87. data/app/assets/javascripts/third_party/spell_checker.min.js +2 -2
  88. data/app/assets/stylesheets/froala_editor.css +2 -3
  89. data/app/assets/stylesheets/froala_editor.min.css +3 -3
  90. data/app/assets/stylesheets/froala_editor.pkgd.css +2 -3
  91. data/app/assets/stylesheets/froala_editor.pkgd.min.css +3 -3
  92. data/app/assets/stylesheets/froala_style.css +2 -2
  93. data/app/assets/stylesheets/froala_style.min.css +2 -2
  94. data/app/assets/stylesheets/plugins/char_counter.css +2 -2
  95. data/app/assets/stylesheets/plugins/char_counter.min.css +2 -2
  96. data/app/assets/stylesheets/plugins/code_view.css +2 -2
  97. data/app/assets/stylesheets/plugins/code_view.min.css +2 -2
  98. data/app/assets/stylesheets/plugins/colors.css +2 -2
  99. data/app/assets/stylesheets/plugins/colors.min.css +2 -2
  100. data/app/assets/stylesheets/plugins/draggable.css +2 -2
  101. data/app/assets/stylesheets/plugins/draggable.min.css +2 -2
  102. data/app/assets/stylesheets/plugins/emoticons.css +2 -2
  103. data/app/assets/stylesheets/plugins/emoticons.min.css +2 -2
  104. data/app/assets/stylesheets/plugins/file.css +2 -2
  105. data/app/assets/stylesheets/plugins/file.min.css +2 -2
  106. data/app/assets/stylesheets/plugins/files_manager.css +2 -2
  107. data/app/assets/stylesheets/plugins/files_manager.min.css +2 -2
  108. data/app/assets/stylesheets/plugins/fullscreen.css +2 -2
  109. data/app/assets/stylesheets/plugins/fullscreen.min.css +2 -2
  110. data/app/assets/stylesheets/plugins/help.css +2 -2
  111. data/app/assets/stylesheets/plugins/help.min.css +2 -2
  112. data/app/assets/stylesheets/plugins/image.css +2 -2
  113. data/app/assets/stylesheets/plugins/image.min.css +2 -2
  114. data/app/assets/stylesheets/plugins/image_manager.css +2 -2
  115. data/app/assets/stylesheets/plugins/image_manager.min.css +2 -2
  116. data/app/assets/stylesheets/plugins/line_breaker.css +2 -2
  117. data/app/assets/stylesheets/plugins/line_breaker.min.css +2 -2
  118. data/app/assets/stylesheets/plugins/markdown.css +2 -2
  119. data/app/assets/stylesheets/plugins/markdown.min.css +2 -2
  120. data/app/assets/stylesheets/plugins/quick_insert.css +2 -2
  121. data/app/assets/stylesheets/plugins/quick_insert.min.css +2 -2
  122. data/app/assets/stylesheets/plugins/special_characters.css +2 -2
  123. data/app/assets/stylesheets/plugins/special_characters.min.css +2 -2
  124. data/app/assets/stylesheets/plugins/table.css +2 -2
  125. data/app/assets/stylesheets/plugins/table.min.css +2 -2
  126. data/app/assets/stylesheets/plugins/trim_video.css +2 -2
  127. data/app/assets/stylesheets/plugins/trim_video.min.css +2 -2
  128. data/app/assets/stylesheets/plugins/video.css +2 -2
  129. data/app/assets/stylesheets/plugins/video.min.css +2 -2
  130. data/app/assets/stylesheets/plugins.pkgd.css +2 -2
  131. data/app/assets/stylesheets/plugins.pkgd.min.css +2 -2
  132. data/app/assets/stylesheets/themes/dark.css +2 -3
  133. data/app/assets/stylesheets/themes/dark.min.css +3 -3
  134. data/app/assets/stylesheets/themes/gray.css +2 -3
  135. data/app/assets/stylesheets/themes/gray.min.css +3 -3
  136. data/app/assets/stylesheets/themes/royal.css +2 -3
  137. data/app/assets/stylesheets/themes/royal.min.css +3 -3
  138. data/app/assets/stylesheets/third_party/embedly.css +2 -2
  139. data/app/assets/stylesheets/third_party/embedly.min.css +2 -2
  140. data/app/assets/stylesheets/third_party/font_awesome.css +2 -2
  141. data/app/assets/stylesheets/third_party/font_awesome.min.css +2 -2
  142. data/app/assets/stylesheets/third_party/image_tui.css +2 -2
  143. data/app/assets/stylesheets/third_party/image_tui.min.css +2 -2
  144. data/app/assets/stylesheets/third_party/spell_checker.css +2 -2
  145. data/app/assets/stylesheets/third_party/spell_checker.min.css +2 -2
  146. data/lib/wysiwyg-rails/version.rb +1 -1
  147. metadata +2 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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
7
  !function(a,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],e):e(a.FroalaEditor)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a["default"]:a,Object.assign(a.DEFAULTS,{paragraphStyles:{"fr-text-gray":"Gray","fr-text-bordered":"Bordered","fr-text-spaced":"Spaced","fr-text-uppercase":"Uppercase"},paragraphMultipleStyles:!0}),a.PLUGINS.paragraphStyle=function(i){var p=i.$;return{_init:function a(){},apply:function c(a,e,t){void 0===e&&(e=i.opts.paragraphStyles),void 0===t&&(t=i.opts.paragraphMultipleStyles);var r="";t||((r=Object.keys(e)).splice(r.indexOf(a),1),r=r.join(" ")),i.selection.save(),i.html.wrap(!0,!0,!0,!0),i.selection.restore();var l=i.selection.blocks();i.selection.save();for(var n=p(l[0]).hasClass(a),s=0;s<l.length;s++)p(l[s]).removeClass(r).toggleClass(a,!n),p(l[s]).hasClass("fr-temp-div")&&p(l[s]).removeClass("fr-temp-div"),""===p(l[s]).attr("class")&&p(l[s]).removeAttr("class");if(1===l.length&&"fr-text-bordered"===a&&null===l[0].nextSibling){var o=p("<br>");l[0].after(o[0])}i.html.unwrap(),i.selection.restore()},refreshOnShow:function l(a,e){var t=i.selection.blocks();if(t.length){var r=p(t[0]);e.find(".fr-command").each(function(){var a=p(this).data("param1"),e=r.hasClass(a);p(this).toggleClass("fr-active",e).attr("aria-selected",e)})}}}},a.RegisterCommand("paragraphStyle",{type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list" role="presentation">',e=this.opts.paragraphStyles;for(var t in e)e.hasOwnProperty(t)&&(a+='<li role="presentation"><a class="fr-command '.concat(t,'" tabIndex="-1" role="option" data-cmd="paragraphStyle" data-param1="').concat(t,'" title="').concat(this.language.translate(e[t]),'">').concat(this.language.translate(e[t]),"</a></li>"));return a+="</ul>"},title:"Paragraph Style",callback:function(a,e){this.paragraphStyle.apply(e)},refreshOnShow:function(a,e){this.paragraphStyle.refreshOnShow(a,e)},plugin:"paragraphStyle"}),a.DefineIcon("paragraphStyle",{NAME:"magic",SVG_KEY:"paragraphStyle"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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
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(e){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e,Object.assign(e.DEFAULTS,{html2pdf:window.html2pdf}),e.PLUGINS.print=function(a){return{run:function e(){!function l(e){var t=a.html.get(),n=null;a.shared.print_iframe?n=a.shared.print_iframe:((n=document.createElement("iframe")).name="fr-print",n.style.position="fixed",n.style.top="0",n.style.left="-9999px",n.style.height="100%",n.style.width="0",n.style.overflow="hidden",n.style["z-index"]="2147483647",n.style.tabIndex="-1",a.events.on("shared.destroy",function(){n.remove()}),a.shared.print_iframe=n);try{document.body.removeChild(n)}catch(d){}document.body.appendChild(n);var i=function i(){e(),n.removeEventListener("load",i)};n.addEventListener("load",i);var o=n.contentWindow;o.document.open(),o.document.write("<!DOCTYPE html><html "+(a.opts.documentReady?'style="margin: 0; padding: 0;"':"")+"><head><title>"+document.title+"</title>"),Array.prototype.forEach.call(document.querySelectorAll("style"),function(e){e=e.cloneNode(!0),o.document.write(e.outerHTML)});var r=document.querySelectorAll("link[rel=stylesheet]");Array.prototype.forEach.call(r,function(e){var t=document.createElement("link");t.rel=e.rel,t.href=e.href,t.media="print",t.type="text/css",t.media="all",o.document.write(t.outerHTML)}),o.document.write('</head><body style="height:auto;text-align: '+("rtl"==a.opts.direction?"right":"left")+"; direction: "+a.opts.direction+"; "+(a.opts.documentReady?" padding: 2cm; width: 17cm; margin: 0;":"")+'"><div class="fr-view">'),o.document.write(t),o.document.write("</div></body></html>"),o.document.close()}(function(){setTimeout(function(){a.events.disableBlur(),window.frames["fr-print"].focus(),window.frames["fr-print"].print(),a.$win.get(0).focus(),a.events.disableBlur(),a.events.focus()},0)})},toPDF:function t(){a.opts.html2pdf&&(a.$el.css("text-align","left"),a.opts.html2pdf().set({margin:[10,20],html2canvas:{useCORS:!0}}).from(a.el).save(),setTimeout(function(){a.$el.css("text-align","")},100))}}},e.DefineIcon("print",{NAME:"print",SVG_KEY:"print"}),e.RegisterCommand("print",{title:"Print",undo:!1,focus:!1,plugin:"print",callback:function(){this.print.run()}}),e.DefineIcon("getPDF",{NAME:"file-pdf-o",FA5NAME:"file-pdf",SVG_KEY:"pdfExport"}),e.RegisterCommand("getPDF",{title:"Download PDF",type:"button",focus:!1,undo:!1,callback:function(){this.print.toPDF()}})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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
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(h){"use strict";h=h&&h.hasOwnProperty("default")?h["default"]:h,Object.assign(h.DEFAULTS,{quickInsertButtons:["image","video","embedly","table","ul","ol","hr"],quickInsertTags:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote"],quickInsertEnabled:!0}),h.QUICK_INSERT_BUTTONS={},h.DefineIcon("quickInsert",{SVG_KEY:"add",template:"svg"}),h.RegisterQuickInsertButton=function(e,t){h.QUICK_INSERT_BUTTONS[e]=Object.assign({undo:!0},t)},h.RegisterQuickInsertButton("image",{icon:"insertImage",requiredPlugin:"image",title:"Insert Image",undo:!1,callback:function(){var e=this,t=e.$;e.shared.$qi_image_input||(e.shared.$qi_image_input=t(document.createElement("input")).attr("accept","image/"+e.opts.imageAllowedTypes.join(", image/").toLowerCase()).attr("name","quickInsertImage".concat(this.id)).attr("style","display: none;").attr("type","file"),t("body").first().append(e.shared.$qi_image_input),e.events.$on(e.shared.$qi_image_input,"change",function(){var e=t(this).data("inst");this.files&&(e.quickInsert.hide(),e.image.upload(this.files)),t(this).val("")},!0)),e.$qi_image_input=e.shared.$qi_image_input,e.helpers.isMobile()&&e.selection.save(),e.events.disableBlur(),e.$qi_image_input.data("inst",e)[0].click()}}),h.RegisterQuickInsertButton("video",{icon:"insertVideo",requiredPlugin:"video",title:"Insert Video",undo:!1,callback:function(){var e=prompt(this.language.translate("Paste the URL of the video you want to insert."));e&&this.video.insertByURL(e)}}),h.RegisterQuickInsertButton("embedly",{icon:"embedly",requiredPlugin:"embedly",title:"Embed URL",undo:!1,callback:function(){var e=prompt(this.language.translate("Paste the URL of any web content you want to insert."));e&&this.embedly.add(e)}}),h.RegisterQuickInsertButton("table",{icon:"insertTable",requiredPlugin:"table",title:"Insert Table",callback:function(){this.table.insert(2,2)}}),h.RegisterQuickInsertButton("ol",{icon:"formatOL",requiredPlugin:"lists",title:"Ordered List",callback:function(){this.lists.format("OL")}}),h.RegisterQuickInsertButton("ul",{icon:"formatUL",requiredPlugin:"lists",title:"Unordered List",callback:function(){this.lists.format("UL")}}),h.RegisterQuickInsertButton("hr",{icon:"insertHR",title:"Insert Horizontal Line",callback:function(){this.commands.insertHR()}}),h.PLUGINS.quickInsert=function(r){var a,l,c=r.$,u=!1;function n(e){var t,n,i;(t=e.offset().top-r.$box.offset().top,n=(r.$iframe&&r.$iframe.offset().left||0)+e.offset().left-e.position().left-4<a.outerWidth()?e.offset().left+a.outerWidth():0-a.outerWidth(),r.opts.enter!=h.ENTER_BR)?i=(a.outerHeight()-e.outerHeight())/2:(c(document.createElement("span")).html(h.INVISIBLE_SPACE).insertAfter(e),i=(a.outerHeight()-e.next().outerHeight())/2,e.next().remove());if(r.opts.iframe){var s=r.helpers.getPX(r.$wp.find(".fr-iframe").css("padding-top"));t+=r.$iframe.offset().top+s}a.hasClass("fr-on")&&0<=t&&l.css("top",t-i),0<=t&&t-Math.abs(i)<=r.$box.outerHeight()-e.outerHeight()?(a.hasClass("fr-hidden")&&(a.hasClass("fr-on")&&d(),a.removeClass("fr-hidden")),a.css("top",t-i)):a.hasClass("fr-visible")&&!r.opts.toolbarInline&&(a.addClass("fr-hidden"),f()),a.css("left",n)}function s(e){r.markdown&&r.markdown.isEnabled()||(a||function t(){r.shared.$quick_insert||(r.shared.$quick_insert=c(document.createElement("div")).attr("class","fr-quick-insert").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'.concat(r.language.translate("Quick Insert"),'">').concat(r.icon.create("quickInsert"),"</a>")));a=r.shared.$quick_insert,r.tooltip.bind(r.$box,".fr-quick-insert > a.fr-floating-btn"),r.events.on("destroy",function(){c("body").first().append(a.removeClass("fr-on")),l&&(f(),c("body").first().append(l.css("left",-9999).css("top",-9999)))},!0),r.events.on("shared.destroy",function(){a.html("").removeData().remove(),a=null,l&&(l.html("").removeData().remove(),l=null)},!0),r.events.on("commands.before",o),r.events.on("commands.after",function(){r.popups.areVisible()||i()}),r.events.bindClick(r.$box,".fr-quick-insert > a",d),r.events.bindClick(r.$box,".fr-qi-helper > a.fr-btn",function(e){var t=c(e.currentTarget).data("cmd");if(!1===r.events.trigger("quickInsert.commands.before",[t]))return!1;h.QUICK_INSERT_BUTTONS[t].callback.apply(r,[e.currentTarget]),h.QUICK_INSERT_BUTTONS[t].undo&&r.undo.saveStep(),r.events.trigger("quickInsert.commands.after",[t]),r.quickInsert.hide()}),r.events.$on(r.$wp,"scroll",p),r.events.$on(r.$tb,"transitionend",".fr-more-toolbar",p)}(),a.hasClass("fr-on")&&f(),r.$box.append(a),n(e),a.data("tag",e),a.addClass("fr-visible"))}function i(){if(r.core.hasFocus()){var e=r.selection.element();if(r.opts.enter==h.ENTER_BR||r.node.isBlock(e)||(e=r.node.blockParent(e)),r.opts.enter==h.ENTER_BR&&!r.node.isBlock(e)){var t=r.node.deepestParent(e);t&&(e=t)}var n=function n(){return r.opts.enter!=h.ENTER_BR&&r.node.isEmpty(e)&&0<=r.opts.quickInsertTags.indexOf(e.tagName.toLowerCase())},i=function i(){return r.opts.enter==h.ENTER_BR&&("BR"==e.tagName&&(!e.previousSibling||"BR"==e.previousSibling.tagName||r.node.isBlock(e.previousSibling))||r.node.isEmpty(e)&&(!e.previousSibling||"BR"==e.previousSibling.tagName||r.node.isBlock(e.previousSibling))&&(!e.nextSibling||"BR"==e.nextSibling.tagName||r.node.isBlock(e.nextSibling)))};e&&(n()||i())?a&&a.data("tag").is(c(e))&&a.hasClass("fr-on")?f():r.selection.isCollapsed()&&s(c(e)):o()}}function o(){a&&!u&&(a.hasClass("fr-on")&&f(),a.removeClass("fr-visible fr-on"),a.css("left",-9999).css("top",-9999))}function d(e){if(e&&e.preventDefault(),a.hasClass("fr-on")&&!a.hasClass("fr-hidden"))f();else{if(!r.shared.$qi_helper){for(var t=r.opts.quickInsertButtons,n='<div class="fr-qi-helper">',i=0,s=0;s<t.length;s++){var o=h.QUICK_INSERT_BUTTONS[t[s]];o&&(!o.requiredPlugin||h.PLUGINS[o.requiredPlugin]&&0<=r.opts.pluginsEnabled.indexOf(o.requiredPlugin))&&(n+='<a class="fr-btn fr-floating-btn" role="button" title="'.concat(r.language.translate(o.title),'" tabIndex="-1" data-cmd="').concat(t[s],'" style="transition-delay: ').concat(.025*i++,'s;">').concat(r.icon.create(o.icon),"</a>"))}n+="</div>",r.shared.$qi_helper=c(n),r.tooltip.bind(r.shared.$qi_helper,"a.fr-btn"),r.events.$on(r.shared.$qi_helper,"mousedown",function(e){e.preventDefault()},!0)}l=r.shared.$qi_helper,r.$box.append(l),u=!0,setTimeout(function(){u=!1,l.css("top",parseFloat(a.css("top"))),l.css("left",parseFloat(a.css("left"))+a.outerWidth()),l.find("a").addClass("fr-size-1"),a.addClass("fr-on")},10)}}function f(){var n=r.$box.find(".fr-qi-helper");n.length&&function(){for(var t=n.find("a"),e=0;e<t.length;e++)!function(e){setTimeout(function(){n.children().eq(t.length-1-e).removeClass("fr-size-1")},25*e)}(e);setTimeout(function(){n.css("left",-9999),a&&!a.hasClass("fr-hidden")&&a.removeClass("fr-on")},25*e)}()}function p(){a.hasClass("fr-visible")&&n(a.data("tag"))}return{_init:function e(){if(!r.$wp||!r.opts.quickInsertEnabled)return!1;r.popups.onShow("image.edit",o),r.events.on("mouseup",i),r.helpers.isMobile()&&r.events.$on(c(r.o_doc),"selectionchange",i),r.events.on("blur",o),r.events.on("keyup",i),r.events.on("keydown",function(){setTimeout(function(){i()},0)})},hide:o}}});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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(e){"use strict";(e=e&&e.hasOwnProperty("default")?e["default"]:e).PLUGINS.quote=function(r){var c=r.$;function s(e){for(;e.parentNode&&e.parentNode!=r.el;)e=e.parentNode;return e}return{apply:function t(e){r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore(),"increase"==e?function n(){r.html.unwrap();var e,t=r.selection.blocks();for(e=0;e<t.length;e++)t[e]=s(t[e]);r.selection.save();var o=c(document.createElement("blockquote"));for(o.insertBefore(t[0]),e=0;e<t.length;e++)o.append(t[e]);r.opts.trackChangesEnabled&&r.track_changes.addQuote(o),r.selection.isCollapsed()||r.selection.restore()}():"decrease"==e&&function a(){var e=r.opts.trackChangesEnabled;r.html.unwrap();var t,o=r.selection.blocks();for(t=0;t<o.length;t++)"BLOCKQUOTE"!=o[t].tagName&&(o[t]=e&&c(o[t]).parentsUntil(r.$el,"[data-track-id^=pending]").get(0)||c(o[t]).parentsUntil(r.$el,"BLOCKQUOTE").get(0));for(r.selection.save(),t=0;t<o.length;t++)o[t]&&(e?r.track_changes.removeQuote(c(o[t]),t):c(o[t]).replaceWith(o[t].innerHTML));r.selection.isCollapsed()||r.selection.restore()}()}}},e.RegisterShortcut(e.KEYCODE.SINGLE_QUOTE,"quote","increase","'"),e.RegisterShortcut(e.KEYCODE.SINGLE_QUOTE,"quote","decrease","'",!0),e.RegisterCommand("quote",{title:"Quote",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t={increase:"Increase",decrease:"Decrease"};for(var o in t)if(t.hasOwnProperty(o)){var n=this.shortcuts.get("quote.".concat(o));e+='<li role="presentation"><a class="fr-command fr-active '.concat(o,'" tabIndex="-1" role="option" data-cmd="quote" data-param1="').concat(o,'" title="').concat(t[o],'">').concat(this.language.translate(t[o])).concat(n?'<span class="fr-shortcut">'.concat(n,"</span>"):"","</a></li>")}return e+="</ul>"},callback:function(e,t){this.quote.apply(t)},plugin:"quote"}),e.DefineIcon("quote",{NAME:"quote-left",SVG_KEY:"blockquote"})});
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(e){"use strict";(e=e&&e.hasOwnProperty("default")?e["default"]:e).PLUGINS.quote=function(r){var c=r.$;function s(e){for(;e.parentNode&&e.parentNode!=r.el;)e=e.parentNode;return e}return{apply:function t(e){r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore(),"increase"==e?function o(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)t[e]=s(t[e]);r.selection.save();var n=c(document.createElement("blockquote"));for(n.insertBefore(t[0]),e=0;e<t.length;e++)n.append(t[e]);r.opts.trackChangesEnabled&&r.track_changes.addQuote(n),r.html.unwrap(),r.selection.restore()}():"decrease"==e&&function a(){var e,t=r.opts.trackChangesEnabled,n=r.selection.blocks();for(e=0;e<n.length;e++)"BLOCKQUOTE"!=n[e].tagName&&(n[e]=t&&c(n[e]).parentsUntil(r.$el,"[data-track-id^=pending]").get(0)||c(n[e]).parentsUntil(r.$el,"BLOCKQUOTE").get(0));for(r.selection.save(),e=0;e<n.length;e++)n[e]&&(t?r.track_changes.removeQuote(c(n[e]),e):c(n[e]).replaceWith(n[e].innerHTML));r.html.unwrap(),r.selection.restore()}()}}},e.RegisterShortcut(e.KEYCODE.SINGLE_QUOTE,"quote","increase","'"),e.RegisterShortcut(e.KEYCODE.SINGLE_QUOTE,"quote","decrease","'",!0),e.RegisterCommand("quote",{title:"Quote",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t={increase:"Increase",decrease:"Decrease"};for(var n in t)if(t.hasOwnProperty(n)){var o=this.shortcuts.get("quote.".concat(n));e+='<li role="presentation"><a class="fr-command fr-active '.concat(n,'" tabIndex="-1" role="option" data-cmd="quote" data-param1="').concat(n,'" title="').concat(t[n],'">').concat(this.language.translate(t[n])).concat(o?'<span class="fr-shortcut">'.concat(o,"</span>"):"","</a></li>")}return e+="</ul>"},callback:function(e,t){this.quote.apply(t)},plugin:"quote"}),e.DefineIcon("quote",{NAME:"quote-left",SVG_KEY:"blockquote"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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
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(e){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e,Object.assign(e.DEFAULTS,{saveInterval:1e4,saveURL:null,saveParams:{},saveParam:"body",saveMethod:"POST"}),e.PLUGINS.save=function(i){var f=i.$,n=null,l=null,t=!1,v=1,c=2,s={};function u(e,t){i.events.trigger("save.error",[{code:e,message:s[e]},t])}function a(e){void 0===e&&(e=i.html.get());var n=e,t=i.events.trigger("save.before",[e]);if(!1===t)return!1;if("string"==typeof t&&(e=t),i.opts.saveURL){var s={};for(var a in i.opts.saveParams)if(i.opts.saveParams.hasOwnProperty(a)){var o=i.opts.saveParams[a];s[a]="function"==typeof o?o.call(this):o}var r={};r[i.opts.saveParam]=e,f(this).ajax({method:i.opts.saveMethod,url:i.opts.saveURL,data:Object.assign(r,s),crossDomain:i.opts.requestWithCORS,withCredentials:i.opts.requestWithCredentials,headers:i.opts.requestHeaders,done:function(e,t,s){l=n,i.events.trigger("save.after",[e])},fail:function(e){u(c,e.response||e.responseText)}})}else u(v)}function o(){clearTimeout(n),n=setTimeout(function(){var e=i.html.get();(l!=e||t)&&(t=!1,a(l=e))},0)}return s[v]="Missing saveURL option.",s[c]="Something went wrong during save.",{_init:function r(){if(i.opts.letteringClass)for(var e=i.opts.letteringClass,t=i.$el.find(".".concat(e)).length,s=0;s<t;s++)i.$el.find(".".concat(e))[s].innerHTML=i.$el.find(".".concat(e))[s].innerText.replace(/([\w'-]+|[?.",])/g,"<span class = 'fr-word-select'>$1</span>");i.opts.saveInterval&&(l=i.html.get(),i.events.on("contentChanged",function(){setTimeout(o,i.opts.saveInterval)}),i.events.on("keydown destroy",function(){clearTimeout(n)}))},save:a,reset:function e(){o(),t=!1},force:function d(){t=!0}}},e.DefineIcon("save",{NAME:"floppy-o",FA5NAME:"save"}),e.RegisterCommand("save",{title:"Save",undo:!1,focus:!1,refreshAfterCallback:!1,callback:function(){this.save.save()},plugin:"save"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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
7
  !function(c,E){"object"==typeof exports&&"undefined"!=typeof module?E(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],E):E(c.FroalaEditor)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t,Object.assign(t.DEFAULTS,{specialCharactersSets:[{title:"Latin","char":"&iexcl;",list:[{"char":"&iexcl;",desc:"INVERTED EXCLAMATION MARK"},{"char":"&cent;",desc:"CENT SIGN"},{"char":"&pound;",desc:"POUND SIGN"},{"char":"&curren;",desc:"CURRENCY SIGN"},{"char":"&yen;",desc:"YEN SIGN"},{"char":"&brvbar;",desc:"BROKEN BAR"},{"char":"&sect;",desc:"SECTION SIGN"},{"char":"&uml;",desc:"DIAERESIS"},{"char":"&copy;",desc:"COPYRIGHT SIGN"},{"char":"&trade;",desc:"TRADEMARK SIGN"},{"char":"&ordf;",desc:"FEMININE ORDINAL INDICATOR"},{"char":"&laquo;",desc:"LEFT-POINTING DOUBLE ANGLE QUOTATION MARK"},{"char":"&not;",desc:"NOT SIGN"},{"char":"&reg;",desc:"REGISTERED SIGN"},{"char":"&macr;",desc:"MACRON"},{"char":"&deg;",desc:"DEGREE SIGN"},{"char":"&plusmn;",desc:"PLUS-MINUS SIGN"},{"char":"&sup2;",desc:"SUPERSCRIPT TWO"},{"char":"&sup3;",desc:"SUPERSCRIPT THREE"},{"char":"&acute;",desc:"ACUTE ACCENT"},{"char":"&micro;",desc:"MICRO SIGN"},{"char":"&para;",desc:"PILCROW SIGN"},{"char":"&middot;",desc:"MIDDLE DOT"},{"char":"&cedil;",desc:"CEDILLA"},{"char":"&sup1;",desc:"SUPERSCRIPT ONE"},{"char":"&ordm;",desc:"MASCULINE ORDINAL INDICATOR"},{"char":"&raquo;",desc:"RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK"},{"char":"&frac14;",desc:"VULGAR FRACTION ONE QUARTER"},{"char":"&frac12;",desc:"VULGAR FRACTION ONE HALF"},{"char":"&frac34;",desc:"VULGAR FRACTION THREE QUARTERS"},{"char":"&iquest;",desc:"INVERTED QUESTION MARK"},{"char":"&Agrave;",desc:"LATIN CAPITAL LETTER A WITH GRAVE"},{"char":"&Aacute;",desc:"LATIN CAPITAL LETTER A WITH ACUTE"},{"char":"&Acirc;",desc:"LATIN CAPITAL LETTER A WITH CIRCUMFLEX"},{"char":"&Atilde;",desc:"LATIN CAPITAL LETTER A WITH TILDE"},{"char":"&Auml;",desc:"LATIN CAPITAL LETTER A WITH DIAERESIS "},{"char":"&Aring;",desc:"LATIN CAPITAL LETTER A WITH RING ABOVE"},{"char":"&AElig;",desc:"LATIN CAPITAL LETTER AE"},{"char":"&Ccedil;",desc:"LATIN CAPITAL LETTER C WITH CEDILLA"},{"char":"&Egrave;",desc:"LATIN CAPITAL LETTER E WITH GRAVE"},{"char":"&Eacute;",desc:"LATIN CAPITAL LETTER E WITH ACUTE"},{"char":"&Ecirc;",desc:"LATIN CAPITAL LETTER E WITH CIRCUMFLEX"},{"char":"&Euml;",desc:"LATIN CAPITAL LETTER E WITH DIAERESIS"},{"char":"&Igrave;",desc:"LATIN CAPITAL LETTER I WITH GRAVE"},{"char":"&Iacute;",desc:"LATIN CAPITAL LETTER I WITH ACUTE"},{"char":"&Icirc;",desc:"LATIN CAPITAL LETTER I WITH CIRCUMFLEX"},{"char":"&Iuml;",desc:"LATIN CAPITAL LETTER I WITH DIAERESIS"},{"char":"&ETH;",desc:"LATIN CAPITAL LETTER ETH"},{"char":"&Ntilde;",desc:"LATIN CAPITAL LETTER N WITH TILDE"},{"char":"&Ograve;",desc:"LATIN CAPITAL LETTER O WITH GRAVE"},{"char":"&Oacute;",desc:"LATIN CAPITAL LETTER O WITH ACUTE"},{"char":"&Ocirc;",desc:"LATIN CAPITAL LETTER O WITH CIRCUMFLEX"},{"char":"&Otilde;",desc:"LATIN CAPITAL LETTER O WITH TILDE"},{"char":"&Ouml;",desc:"LATIN CAPITAL LETTER O WITH DIAERESIS"},{"char":"&times;",desc:"MULTIPLICATION SIGN"},{"char":"&Oslash;",desc:"LATIN CAPITAL LETTER O WITH STROKE"},{"char":"&Ugrave;",desc:"LATIN CAPITAL LETTER U WITH GRAVE"},{"char":"&Uacute;",desc:"LATIN CAPITAL LETTER U WITH ACUTE"},{"char":"&Ucirc;",desc:"LATIN CAPITAL LETTER U WITH CIRCUMFLEX"},{"char":"&Uuml;",desc:"LATIN CAPITAL LETTER U WITH DIAERESIS"},{"char":"&Yacute;",desc:"LATIN CAPITAL LETTER Y WITH ACUTE"},{"char":"&THORN;",desc:"LATIN CAPITAL LETTER THORN"},{"char":"&szlig;",desc:"LATIN SMALL LETTER SHARP S"},{"char":"&agrave;",desc:"LATIN SMALL LETTER A WITH GRAVE"},{"char":"&aacute;",desc:"LATIN SMALL LETTER A WITH ACUTE "},{"char":"&acirc;",desc:"LATIN SMALL LETTER A WITH CIRCUMFLEX"},{"char":"&atilde;",desc:"LATIN SMALL LETTER A WITH TILDE"},{"char":"&auml;",desc:"LATIN SMALL LETTER A WITH DIAERESIS"},{"char":"&aring;",desc:"LATIN SMALL LETTER A WITH RING ABOVE"},{"char":"&aelig;",desc:"LATIN SMALL LETTER AE"},{"char":"&ccedil;",desc:"LATIN SMALL LETTER C WITH CEDILLA"},{"char":"&egrave;",desc:"LATIN SMALL LETTER E WITH GRAVE"},{"char":"&eacute;",desc:"LATIN SMALL LETTER E WITH ACUTE"},{"char":"&ecirc;",desc:"LATIN SMALL LETTER E WITH CIRCUMFLEX"},{"char":"&euml;",desc:"LATIN SMALL LETTER E WITH DIAERESIS"},{"char":"&igrave;",desc:"LATIN SMALL LETTER I WITH GRAVE"},{"char":"&iacute;",desc:"LATIN SMALL LETTER I WITH ACUTE"},{"char":"&icirc;",desc:"LATIN SMALL LETTER I WITH CIRCUMFLEX"},{"char":"&iuml;",desc:"LATIN SMALL LETTER I WITH DIAERESIS"},{"char":"&eth;",desc:"LATIN SMALL LETTER ETH"},{"char":"&ntilde;",desc:"LATIN SMALL LETTER N WITH TILDE"},{"char":"&ograve;",desc:"LATIN SMALL LETTER O WITH GRAVE"},{"char":"&oacute;",desc:"LATIN SMALL LETTER O WITH ACUTE"},{"char":"&ocirc;",desc:"LATIN SMALL LETTER O WITH CIRCUMFLEX"},{"char":"&otilde;",desc:"LATIN SMALL LETTER O WITH TILDE"},{"char":"&ouml;",desc:"LATIN SMALL LETTER O WITH DIAERESIS"},{"char":"&divide;",desc:"DIVISION SIGN"},{"char":"&oslash;",desc:"LATIN SMALL LETTER O WITH STROKE"},{"char":"&ugrave;",desc:"LATIN SMALL LETTER U WITH GRAVE"},{"char":"&uacute;",desc:"LATIN SMALL LETTER U WITH ACUTE"},{"char":"&ucirc;",desc:"LATIN SMALL LETTER U WITH CIRCUMFLEX"},{"char":"&uuml;",desc:"LATIN SMALL LETTER U WITH DIAERESIS"},{"char":"&yacute;",desc:"LATIN SMALL LETTER Y WITH ACUTE"},{"char":"&thorn;",desc:"LATIN SMALL LETTER THORN"},{"char":"&yuml;",desc:"LATIN SMALL LETTER Y WITH DIAERESIS"}]},{title:"Greek","char":"&Alpha;",list:[{"char":"&Alpha;",desc:"GREEK CAPITAL LETTER ALPHA"},{"char":"&Beta;",desc:"GREEK CAPITAL LETTER BETA"},{"char":"&Gamma;",desc:"GREEK CAPITAL LETTER GAMMA"},{"char":"&Delta;",desc:"GREEK CAPITAL LETTER DELTA"},{"char":"&Epsilon;",desc:"GREEK CAPITAL LETTER EPSILON"},{"char":"&Zeta;",desc:"GREEK CAPITAL LETTER ZETA"},{"char":"&Eta;",desc:"GREEK CAPITAL LETTER ETA"},{"char":"&Theta;",desc:"GREEK CAPITAL LETTER THETA"},{"char":"&Iota;",desc:"GREEK CAPITAL LETTER IOTA"},{"char":"&Kappa;",desc:"GREEK CAPITAL LETTER KAPPA"},{"char":"&Lambda;",desc:"GREEK CAPITAL LETTER LAMBDA"},{"char":"&Mu;",desc:"GREEK CAPITAL LETTER MU"},{"char":"&Nu;",desc:"GREEK CAPITAL LETTER NU"},{"char":"&Xi;",desc:"GREEK CAPITAL LETTER XI"},{"char":"&Omicron;",desc:"GREEK CAPITAL LETTER OMICRON"},{"char":"&Pi;",desc:"GREEK CAPITAL LETTER PI"},{"char":"&Rho;",desc:"GREEK CAPITAL LETTER RHO"},{"char":"&Sigma;",desc:"GREEK CAPITAL LETTER SIGMA"},{"char":"&Tau;",desc:"GREEK CAPITAL LETTER TAU"},{"char":"&Upsilon;",desc:"GREEK CAPITAL LETTER UPSILON"},{"char":"&Phi;",desc:"GREEK CAPITAL LETTER PHI"},{"char":"&Chi;",desc:"GREEK CAPITAL LETTER CHI"},{"char":"&Psi;",desc:"GREEK CAPITAL LETTER PSI"},{"char":"&Omega;",desc:"GREEK CAPITAL LETTER OMEGA"},{"char":"&alpha;",desc:"GREEK SMALL LETTER ALPHA"},{"char":"&beta;",desc:"GREEK SMALL LETTER BETA"},{"char":"&gamma;",desc:"GREEK SMALL LETTER GAMMA"},{"char":"&delta;",desc:"GREEK SMALL LETTER DELTA"},{"char":"&epsilon;",desc:"GREEK SMALL LETTER EPSILON"},{"char":"&zeta;",desc:"GREEK SMALL LETTER ZETA"},{"char":"&eta;",desc:"GREEK SMALL LETTER ETA"},{"char":"&theta;",desc:"GREEK SMALL LETTER THETA"},{"char":"&iota;",desc:"GREEK SMALL LETTER IOTA"},{"char":"&kappa;",desc:"GREEK SMALL LETTER KAPPA"},{"char":"&lambda;",desc:"GREEK SMALL LETTER LAMBDA"},{"char":"&mu;",desc:"GREEK SMALL LETTER MU"},{"char":"&nu;",desc:"GREEK SMALL LETTER NU"},{"char":"&xi;",desc:"GREEK SMALL LETTER XI"},{"char":"&omicron;",desc:"GREEK SMALL LETTER OMICRON"},{"char":"&pi;",desc:"GREEK SMALL LETTER PI"},{"char":"&rho;",desc:"GREEK SMALL LETTER RHO"},{"char":"&sigmaf;",desc:"GREEK SMALL LETTER FINAL SIGMA"},{"char":"&sigma;",desc:"GREEK SMALL LETTER SIGMA"},{"char":"&tau;",desc:"GREEK SMALL LETTER TAU"},{"char":"&upsilon;",desc:"GREEK SMALL LETTER UPSILON"},{"char":"&phi;",desc:"GREEK SMALL LETTER PHI"},{"char":"&chi;",desc:"GREEK SMALL LETTER CHI"},{"char":"&psi;",desc:"GREEK SMALL LETTER PSI"},{"char":"&omega;",desc:"GREEK SMALL LETTER OMEGA"},{"char":"&thetasym;",desc:"GREEK THETA SYMBOL"},{"char":"&upsih;",desc:"GREEK UPSILON WITH HOOK SYMBOL"},{"char":"&straightphi;",desc:"GREEK PHI SYMBOL"},{"char":"&piv;",desc:"GREEK PI SYMBOL"},{"char":"&Gammad;",desc:"GREEK LETTER DIGAMMA"},{"char":"&gammad;",desc:"GREEK SMALL LETTER DIGAMMA"},{"char":"&varkappa;",desc:"GREEK KAPPA SYMBOL"},{"char":"&varrho;",desc:"GREEK RHO SYMBOL"},{"char":"&straightepsilon;",desc:"GREEK LUNATE EPSILON SYMBOL"},{"char":"&backepsilon;",desc:"GREEK REVERSED LUNATE EPSILON SYMBOL"}]},{title:"Cyrillic","char":"&#x400",list:[{"char":"&#x400",desc:"CYRILLIC CAPITAL LETTER IE WITH GRAVE"},{"char":"&#x401",desc:"CYRILLIC CAPITAL LETTER IO"},{"char":"&#x402",desc:"CYRILLIC CAPITAL LETTER DJE"},{"char":"&#x403",desc:"CYRILLIC CAPITAL LETTER GJE"},{"char":"&#x404",desc:"CYRILLIC CAPITAL LETTER UKRAINIAN IE"},{"char":"&#x405",desc:"CYRILLIC CAPITAL LETTER DZE"},{"char":"&#x406",desc:"CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I"},{"char":"&#x407",desc:"CYRILLIC CAPITAL LETTER YI"},{"char":"&#x408",desc:"CYRILLIC CAPITAL LETTER JE"},{"char":"&#x409",desc:"CYRILLIC CAPITAL LETTER LJE"},{"char":"&#x40A",desc:"CYRILLIC CAPITAL LETTER NJE"},{"char":"&#x40B",desc:"CYRILLIC CAPITAL LETTER TSHE"},{"char":"&#x40C",desc:"CYRILLIC CAPITAL LETTER KJE"},{"char":"&#x40D",desc:"CYRILLIC CAPITAL LETTER I WITH GRAVE"},{"char":"&#x40E",desc:"CYRILLIC CAPITAL LETTER SHORT U"},{"char":"&#x40F",desc:"CYRILLIC CAPITAL LETTER DZHE"},{"char":"&#x410",desc:"CYRILLIC CAPITAL LETTER A"},{"char":"&#x411",desc:"CYRILLIC CAPITAL LETTER BE"},{"char":"&#x412",desc:"CYRILLIC CAPITAL LETTER VE"},{"char":"&#x413",desc:"CYRILLIC CAPITAL LETTER GHE"},{"char":"&#x414",desc:"CYRILLIC CAPITAL LETTER DE"},{"char":"&#x415",desc:"CYRILLIC CAPITAL LETTER IE"},{"char":"&#x416",desc:"CYRILLIC CAPITAL LETTER ZHE"},{"char":"&#x417",desc:"CYRILLIC CAPITAL LETTER ZE"},{"char":"&#x418",desc:"CYRILLIC CAPITAL LETTER I"},{"char":"&#x419",desc:"CYRILLIC CAPITAL LETTER SHORT I"},{"char":"&#x41A",desc:"CYRILLIC CAPITAL LETTER KA"},{"char":"&#x41B",desc:"CYRILLIC CAPITAL LETTER EL"},{"char":"&#x41C",desc:"CYRILLIC CAPITAL LETTER EM"},{"char":"&#x41D",desc:"CYRILLIC CAPITAL LETTER EN"},{"char":"&#x41E",desc:"CYRILLIC CAPITAL LETTER O"},{"char":"&#x41F",desc:"CYRILLIC CAPITAL LETTER PE"},{"char":"&#x420",desc:"CYRILLIC CAPITAL LETTER ER"},{"char":"&#x421",desc:"CYRILLIC CAPITAL LETTER ES"},{"char":"&#x422",desc:"CYRILLIC CAPITAL LETTER TE"},{"char":"&#x423",desc:"CYRILLIC CAPITAL LETTER U"},{"char":"&#x424",desc:"CYRILLIC CAPITAL LETTER EF"},{"char":"&#x425",desc:"CYRILLIC CAPITAL LETTER HA"},{"char":"&#x426",desc:"CYRILLIC CAPITAL LETTER TSE"},{"char":"&#x427",desc:"CYRILLIC CAPITAL LETTER CHE"},{"char":"&#x428",desc:"CYRILLIC CAPITAL LETTER SHA"},{"char":"&#x429",desc:"CYRILLIC CAPITAL LETTER SHCHA"},{"char":"&#x42A",desc:"CYRILLIC CAPITAL LETTER HARD SIGN"},{"char":"&#x42B",desc:"CYRILLIC CAPITAL LETTER YERU"},{"char":"&#x42C",desc:"CYRILLIC CAPITAL LETTER SOFT SIGN"},{"char":"&#x42D",desc:"CYRILLIC CAPITAL LETTER E"},{"char":"&#x42E",desc:"CYRILLIC CAPITAL LETTER YU"},{"char":"&#x42F",desc:"CYRILLIC CAPITAL LETTER YA"},{"char":"&#x430",desc:"CYRILLIC SMALL LETTER A"},{"char":"&#x431",desc:"CYRILLIC SMALL LETTER BE"},{"char":"&#x432",desc:"CYRILLIC SMALL LETTER VE"},{"char":"&#x433",desc:"CYRILLIC SMALL LETTER GHE"},{"char":"&#x434",desc:"CYRILLIC SMALL LETTER DE"},{"char":"&#x435",desc:"CYRILLIC SMALL LETTER IE"},{"char":"&#x436",desc:"CYRILLIC SMALL LETTER ZHE"},{"char":"&#x437",desc:"CYRILLIC SMALL LETTER ZE"},{"char":"&#x438",desc:"CYRILLIC SMALL LETTER I"},{"char":"&#x439",desc:"CYRILLIC SMALL LETTER SHORT I"},{"char":"&#x43A",desc:"CYRILLIC SMALL LETTER KA"},{"char":"&#x43B",desc:"CYRILLIC SMALL LETTER EL"},{"char":"&#x43C",desc:"CYRILLIC SMALL LETTER EM"},{"char":"&#x43D",desc:"CYRILLIC SMALL LETTER EN"},{"char":"&#x43E",desc:"CYRILLIC SMALL LETTER O"},{"char":"&#x43F",desc:"CYRILLIC SMALL LETTER PE"},{"char":"&#x440",desc:"CYRILLIC SMALL LETTER ER"},{"char":"&#x441",desc:"CYRILLIC SMALL LETTER ES"},{"char":"&#x442",desc:"CYRILLIC SMALL LETTER TE"},{"char":"&#x443",desc:"CYRILLIC SMALL LETTER U"},{"char":"&#x444",desc:"CYRILLIC SMALL LETTER EF"},{"char":"&#x445",desc:"CYRILLIC SMALL LETTER HA"},{"char":"&#x446",desc:"CYRILLIC SMALL LETTER TSE"},{"char":"&#x447",desc:"CYRILLIC SMALL LETTER CHE"},{"char":"&#x448",desc:"CYRILLIC SMALL LETTER SHA"},{"char":"&#x449",desc:"CYRILLIC SMALL LETTER SHCHA"},{"char":"&#x44A",desc:"CYRILLIC SMALL LETTER HARD SIGN"},{"char":"&#x44B",desc:"CYRILLIC SMALL LETTER YERU"},{"char":"&#x44C",desc:"CYRILLIC SMALL LETTER SOFT SIGN"},{"char":"&#x44D",desc:"CYRILLIC SMALL LETTER E"},{"char":"&#x44E",desc:"CYRILLIC SMALL LETTER YU"},{"char":"&#x44F",desc:"CYRILLIC SMALL LETTER YA"},{"char":"&#x450",desc:"CYRILLIC SMALL LETTER IE WITH GRAVE"},{"char":"&#x451",desc:"CYRILLIC SMALL LETTER IO"},{"char":"&#x452",desc:"CYRILLIC SMALL LETTER DJE"},{"char":"&#x453",desc:"CYRILLIC SMALL LETTER GJE"},{"char":"&#x454",desc:"CYRILLIC SMALL LETTER UKRAINIAN IE"},{"char":"&#x455",desc:"CYRILLIC SMALL LETTER DZE"},{"char":"&#x456",desc:"CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I"},{"char":"&#x457",desc:"CYRILLIC SMALL LETTER YI"},{"char":"&#x458",desc:"CYRILLIC SMALL LETTER JE"},{"char":"&#x459",desc:"CYRILLIC SMALL LETTER LJE"},{"char":"&#x45A",desc:"CYRILLIC SMALL LETTER NJE"},{"char":"&#x45B",desc:"CYRILLIC SMALL LETTER TSHE"},{"char":"&#x45C",desc:"CYRILLIC SMALL LETTER KJE"},{"char":"&#x45D",desc:"CYRILLIC SMALL LETTER I WITH GRAVE"},{"char":"&#x45E",desc:"CYRILLIC SMALL LETTER SHORT U"},{"char":"&#x45F",desc:"CYRILLIC SMALL LETTER DZHE"}]},{title:"Punctuation","char":"&ndash;",list:[{"char":"&ndash;",desc:"EN DASH"},{"char":"&mdash;",desc:"EM DASH"},{"char":"&lsquo;",desc:"LEFT SINGLE QUOTATION MARK"},{"char":"&rsquo;",desc:"RIGHT SINGLE QUOTATION MARK"},{"char":"&sbquo;",desc:"SINGLE LOW-9 QUOTATION MARK"},{"char":"&ldquo;",desc:"LEFT DOUBLE QUOTATION MARK"},{"char":"&rdquo;",desc:"RIGHT DOUBLE QUOTATION MARK"},{"char":"&bdquo;",desc:"DOUBLE LOW-9 QUOTATION MARK"},{"char":"&dagger;",desc:"DAGGER"},{"char":"&Dagger;",desc:"DOUBLE DAGGER"},{"char":"&bull;",desc:"BULLET"},{"char":"&hellip;",desc:"HORIZONTAL ELLIPSIS"},{"char":"&permil;",desc:"PER MILLE SIGN"},{"char":"&prime;",desc:"PRIME"},{"char":"&Prime;",desc:"DOUBLE PRIME"},{"char":"&lsaquo;",desc:"SINGLE LEFT-POINTING ANGLE QUOTATION MARK"},{"char":"&rsaquo;",desc:"SINGLE RIGHT-POINTING ANGLE QUOTATION MARK"},{"char":"&oline;",desc:"OVERLINE"},{"char":"&frasl;",desc:"FRACTION SLASH"}]},{title:"Currency","char":"&#x20A0",list:[{"char":"&#x20A0",desc:"EURO-CURRENCY SIGN"},{"char":"&#x20A1",desc:"COLON SIGN"},{"char":"&#x20A2",desc:"CRUZEIRO SIGN"},{"char":"&#x20A3",desc:"FRENCH FRANC SIGN"},{"char":"&#x20A4",desc:"LIRA SIGN"},{"char":"&#x20A5",desc:"MILL SIGN"},{"char":"&#x20A6",desc:"NAIRA SIGN"},{"char":"&#x20A7",desc:"PESETA SIGN"},{"char":"&#x20A8",desc:"RUPEE SIGN"},{"char":"&#x20A9",desc:"WON SIGN"},{"char":"&#x20AA",desc:"NEW SHEQEL SIGN"},{"char":"&#x20AB",desc:"DONG SIGN"},{"char":"&#x20AC",desc:"EURO SIGN"},{"char":"&#x20AD",desc:"KIP SIGN"},{"char":"&#x20AE",desc:"TUGRIK SIGN"},{"char":"&#x20AF",desc:"DRACHMA SIGN"},{"char":"&#x20B0",desc:"GERMAN PENNY SYMBOL"},{"char":"&#x20B1",desc:"PESO SIGN"},{"char":"&#x20B2",desc:"GUARANI SIGN"},{"char":"&#x20B3",desc:"AUSTRAL SIGN"},{"char":"&#x20B4",desc:"HRYVNIA SIGN"},{"char":"&#x20B5",desc:"CEDI SIGN"},{"char":"&#x20B6",desc:"LIVRE TOURNOIS SIGN"},{"char":"&#x20B7",desc:"SPESMILO SIGN"},{"char":"&#x20B8",desc:"TENGE SIGN"},{"char":"&#x20B9",desc:"INDIAN RUPEE SIGN"}]},{title:"Arrows","char":"&#x2190",list:[{"char":"&#x2190",desc:"LEFTWARDS ARROW"},{"char":"&#x2191",desc:"UPWARDS ARROW"},{"char":"&#x2192",desc:"RIGHTWARDS ARROW"},{"char":"&#x2193",desc:"DOWNWARDS ARROW"},{"char":"&#x2194",desc:"LEFT RIGHT ARROW"},{"char":"&#x2195",desc:"UP DOWN ARROW"},{"char":"&#x2196",desc:"NORTH WEST ARROW"},{"char":"&#x2197",desc:"NORTH EAST ARROW"},{"char":"&#x2198",desc:"SOUTH EAST ARROW"},{"char":"&#x2199",desc:"SOUTH WEST ARROW"},{"char":"&#x219A",desc:"LEFTWARDS ARROW WITH STROKE"},{"char":"&#x219B",desc:"RIGHTWARDS ARROW WITH STROKE"},{"char":"&#x219C",desc:"LEFTWARDS WAVE ARROW"},{"char":"&#x219D",desc:"RIGHTWARDS WAVE ARROW"},{"char":"&#x219E",desc:"LEFTWARDS TWO HEADED ARROW"},{"char":"&#x219F",desc:"UPWARDS TWO HEADED ARROW"},{"char":"&#x21A0",desc:"RIGHTWARDS TWO HEADED ARROW"},{"char":"&#x21A1",desc:"DOWNWARDS TWO HEADED ARROW"},{"char":"&#x21A2",desc:"LEFTWARDS ARROW WITH TAIL"},{"char":"&#x21A3",desc:"RIGHTWARDS ARROW WITH TAIL"},{"char":"&#x21A4",desc:"LEFTWARDS ARROW FROM BAR"},{"char":"&#x21A5",desc:"UPWARDS ARROW FROM BAR"},{"char":"&#x21A6",desc:"RIGHTWARDS ARROW FROM BAR"},{"char":"&#x21A7",desc:"DOWNWARDS ARROW FROM BAR"},{"char":"&#x21A8",desc:"UP DOWN ARROW WITH BASE"},{"char":"&#x21A9",desc:"LEFTWARDS ARROW WITH HOOK"},{"char":"&#x21AA",desc:"RIGHTWARDS ARROW WITH HOOK"},{"char":"&#x21AB",desc:"LEFTWARDS ARROW WITH LOOP"},{"char":"&#x21AC",desc:"RIGHTWARDS ARROW WITH LOOP"},{"char":"&#x21AD",desc:"LEFT RIGHT WAVE ARROW"},{"char":"&#x21AE",desc:"LEFT RIGHT ARROW WITH STROKE"},{"char":"&#x21AF",desc:"DOWNWARDS ZIGZAG ARROW"},{"char":"&#x21B0",desc:"UPWARDS ARROW WITH TIP LEFTWARDS"},{"char":"&#x21B1",desc:"UPWARDS ARROW WITH TIP RIGHTWARDS"},{"char":"&#x21B2",desc:"DOWNWARDS ARROW WITH TIP LEFTWARDS"},{"char":"&#x21B3",desc:"DOWNWARDS ARROW WITH TIP RIGHTWARDS"},{"char":"&#x21B4",desc:"RIGHTWARDS ARROW WITH CORNER DOWNWARDS"},{"char":"&#x21B5",desc:"DOWNWARDS ARROW WITH CORNER LEFTWARDS"},{"char":"&#x21B6",desc:"ANTICLOCKWISE TOP SEMICIRCLE ARROW"},{"char":"&#x21B7",desc:"CLOCKWISE TOP SEMICIRCLE ARROW"},{"char":"&#x21B8",desc:"NORTH WEST ARROW TO LONG BAR"},{"char":"&#x21B9",desc:"LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR"},{"char":"&#x21BA",desc:"ANTICLOCKWISE OPEN CIRCLE ARROW"},{"char":"&#x21BB",desc:"CLOCKWISE OPEN CIRCLE ARROW"},{"char":"&#x21BC",desc:"LEFTWARDS HARPOON WITH BARB UPWARDS"},{"char":"&#x21BD",desc:"LEFTWARDS HARPOON WITH BARB DOWNWARDS"},{"char":"&#x21BE",desc:"UPWARDS HARPOON WITH BARB RIGHTWARDS"},{"char":"&#x21BF",desc:"UPWARDS HARPOON WITH BARB LEFTWARDS"},{"char":"&#x21C0",desc:"RIGHTWARDS HARPOON WITH BARB UPWARDS"},{"char":"&#x21C1",desc:"RIGHTWARDS HARPOON WITH BARB DOWNWARDS"},{"char":"&#x21C2",desc:"DOWNWARDS HARPOON WITH BARB RIGHTWARDS"},{"char":"&#x21C3",desc:"DOWNWARDS HARPOON WITH BARB LEFTWARDS"},{"char":"&#x21C4",desc:"RIGHTWARDS ARROW OVER LEFTWARDS ARROW"},{"char":"&#x21C5",desc:"UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW"},{"char":"&#x21C6",desc:"LEFTWARDS ARROW OVER RIGHTWARDS ARROW"},{"char":"&#x21C7",desc:"LEFTWARDS PAIRED ARROWS"},{"char":"&#x21C8",desc:"UPWARDS PAIRED ARROWS"},{"char":"&#x21C9",desc:"RIGHTWARDS PAIRED ARROWS"},{"char":"&#x21CA",desc:"DOWNWARDS PAIRED ARROWS"},{"char":"&#x21CB",desc:"LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON"},{"char":"&#x21CC",desc:"RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON"},{"char":"&#x21CD",desc:"LEFTWARDS DOUBLE ARROW WITH STROKE"},{"char":"&#x21CE",desc:"LEFT RIGHT DOUBLE ARROW WITH STROKE"},{"char":"&#x21CF",desc:"RIGHTWARDS DOUBLE ARROW WITH STROKE"},{"char":"&#x21D0",desc:"LEFTWARDS DOUBLE ARROW"},{"char":"&#x21D1",desc:"UPWARDS DOUBLE ARROW"},{"char":"&#x21D2",desc:"RIGHTWARDS DOUBLE ARROW"},{"char":"&#x21D3",desc:"DOWNWARDS DOUBLE ARROW"},{"char":"&#x21D4",desc:"LEFT RIGHT DOUBLE ARROW"},{"char":"&#x21D5",desc:"UP DOWN DOUBLE ARROW"},{"char":"&#x21D6",desc:"NORTH WEST DOUBLE ARROW"},{"char":"&#x21D7",desc:"NORTH EAST DOUBLE ARROW"},{"char":"&#x21D8",desc:"SOUTH EAST DOUBLE ARROW"},{"char":"&#x21D9",desc:"SOUTH WEST DOUBLE ARROW"},{"char":"&#x21DA",desc:"LEFTWARDS TRIPLE ARROW"},{"char":"&#x21DB",desc:"RIGHTWARDS TRIPLE ARROW"},{"char":"&#x21DC",desc:"LEFTWARDS SQUIGGLE ARROW"},{"char":"&#x21DD",desc:"RIGHTWARDS SQUIGGLE ARROW"},{"char":"&#x21DE",desc:"UPWARDS ARROW WITH DOUBLE STROKE"},{"char":"&#x21DF",desc:"DOWNWARDS ARROW WITH DOUBLE STROKE"},{"char":"&#x21E0",desc:"LEFTWARDS DASHED ARROW"},{"char":"&#x21E1",desc:"UPWARDS DASHED ARROW"},{"char":"&#x21E2",desc:"RIGHTWARDS DASHED ARROW"},{"char":"&#x21E3",desc:"DOWNWARDS DASHED ARROW"},{"char":"&#x21E4",desc:"LEFTWARDS ARROW TO BAR"},{"char":"&#x21E5",desc:"RIGHTWARDS ARROW TO BAR"},{"char":"&#x21E6",desc:"LEFTWARDS WHITE ARROW"},{"char":"&#x21E7",desc:"UPWARDS WHITE ARROW"},{"char":"&#x21E8",desc:"RIGHTWARDS WHITE ARROW"},{"char":"&#x21E9",desc:"DOWNWARDS WHITE ARROW"},{"char":"&#x21EA",desc:"UPWARDS WHITE ARROW FROM BAR"},{"char":"&#x21EB",desc:"UPWARDS WHITE ARROW ON PEDESTAL"},{"char":"&#x21EC",desc:"UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR"},{"char":"&#x21ED",desc:"UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR"},{"char":"&#x21EE",desc:"UPWARDS WHITE DOUBLE ARROW"},{"char":"&#x21EF",desc:"UPWARDS WHITE DOUBLE ARROW ON PEDESTAL"},{"char":"&#x21F0",desc:"RIGHTWARDS WHITE ARROW FROM WALL"},{"char":"&#x21F1",desc:"NORTH WEST ARROW TO CORNER"},{"char":"&#x21F2",desc:"SOUTH EAST ARROW TO CORNER"},{"char":"&#x21F3",desc:"UP DOWN WHITE ARROW"},{"char":"&#x21F4",desc:"RIGHT ARROW WITH SMALL CIRCLE"},{"char":"&#x21F5",desc:"DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW"},{"char":"&#x21F6",desc:"THREE RIGHTWARDS ARROWS"},{"char":"&#x21F7",desc:"LEFTWARDS ARROW WITH VERTICAL STROKE"},{"char":"&#x21F8",desc:"RIGHTWARDS ARROW WITH VERTICAL STROKE"},{"char":"&#x21F9",desc:"LEFT RIGHT ARROW WITH VERTICAL STROKE"},{"char":"&#x21FA",desc:"LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE"},{"char":"&#x21FB",desc:"RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE"},{"char":"&#x21FC",desc:"LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE"},{"char":"&#x21FD",desc:"LEFTWARDS OPEN-HEADED ARROW"},{"char":"&#x21FE",desc:"RIGHTWARDS OPEN-HEADED ARROW"},{"char":"&#x21FF",desc:"LEFT RIGHT OPEN-HEADED ARROW"}]},{title:"Math","char":"&forall;",list:[{"char":"&forall;",desc:"FOR ALL"},{"char":"&part;",desc:"PARTIAL DIFFERENTIAL"},{"char":"&exist;",desc:"THERE EXISTS"},{"char":"&empty;",desc:"EMPTY SET"},{"char":"&nabla;",desc:"NABLA"},{"char":"&isin;",desc:"ELEMENT OF"},{"char":"&notin;",desc:"NOT AN ELEMENT OF"},{"char":"&ni;",desc:"CONTAINS AS MEMBER"},{"char":"&prod;",desc:"N-ARY PRODUCT"},{"char":"&sum;",desc:"N-ARY SUMMATION"},{"char":"&minus;",desc:"MINUS SIGN"},{"char":"&lowast;",desc:"ASTERISK OPERATOR"},{"char":"&radic;",desc:"SQUARE ROOT"},{"char":"&prop;",desc:"PROPORTIONAL TO"},{"char":"&infin;",desc:"INFINITY"},{"char":"&ang;",desc:"ANGLE"},{"char":"&and;",desc:"LOGICAL AND"},{"char":"&or;",desc:"LOGICAL OR"},{"char":"&cap;",desc:"INTERSECTION"},{"char":"&cup;",desc:"UNION"},{"char":"&int;",desc:"INTEGRAL"},{"char":"&there4;",desc:"THEREFORE"},{"char":"&sim;",desc:"TILDE OPERATOR"},{"char":"&cong;",desc:"APPROXIMATELY EQUAL TO"},{"char":"&asymp;",desc:"ALMOST EQUAL TO"},{"char":"&ne;",desc:"NOT EQUAL TO"},{"char":"&equiv;",desc:"IDENTICAL TO"},{"char":"&le;",desc:"LESS-THAN OR EQUAL TO"},{"char":"&ge;",desc:"GREATER-THAN OR EQUAL TO"},{"char":"&sub;",desc:"SUBSET OF"},{"char":"&sup;",desc:"SUPERSET OF"},{"char":"&nsub;",desc:"NOT A SUBSET OF"},{"char":"&sube;",desc:"SUBSET OF OR EQUAL TO"},{"char":"&supe;",desc:"SUPERSET OF OR EQUAL TO"},{"char":"&oplus;",desc:"CIRCLED PLUS"},{"char":"&otimes;",desc:"CIRCLED TIMES"},{"char":"&perp;",desc:"UP TACK"}]},{title:"Misc","char":"&spades;",list:[{"char":"&spades;",desc:"BLACK SPADE SUIT"},{"char":"&clubs;",desc:"BLACK CLUB SUIT"},{"char":"&hearts;",desc:"BLACK HEART SUIT"},{"char":"&diams;",desc:"BLACK DIAMOND SUIT"},{"char":"&#x2669",desc:"QUARTER NOTE"},{"char":"&#x266A",desc:"EIGHTH NOTE"},{"char":"&#x266B",desc:"BEAMED EIGHTH NOTES"},{"char":"&#x266C",desc:"BEAMED SIXTEENTH NOTES"},{"char":"&#x266D",desc:"MUSIC FLAT SIGN"},{"char":"&#x266E",desc:"MUSIC NATURAL SIGN"},{"char":"&#x2600",desc:"BLACK SUN WITH RAYS"},{"char":"&#x2601",desc:"CLOUD"},{"char":"&#x2602",desc:"UMBRELLA"},{"char":"&#x2603",desc:"SNOWMAN"},{"char":"&#x2615",desc:"HOT BEVERAGE"},{"char":"&#x2618",desc:"SHAMROCK"},{"char":"&#x262F",desc:"YIN YANG"},{"char":"&#x2714",desc:"HEAVY CHECK MARK"},{"char":"&#x2716",desc:"HEAVY MULTIPLICATION X"},{"char":"&#x2744",desc:"SNOWFLAKE"},{"char":"&#x275B",desc:"HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT"},{"char":"&#x275C",desc:"HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT"},{"char":"&#x275D",desc:"HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT"},{"char":"&#x275E",desc:"HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT"},{"char":"&#x2764",desc:"HEAVY BLACK HEART"}]}],specialCharButtons:["specialCharBack","|"]}),Object.assign(t.POPUP_TEMPLATES,{specialCharacters:"[_BUTTONS_][_CUSTOM_LAYER_]"}),t.PLUGINS.specialCharacters=function(W){var N=W.$,T=W.opts.specialCharactersSets[0],L=W.opts.specialCharactersSets,a="";function I(){return'\n <div class="fr-buttons fr-tabs fr-tabs-scroll">\n '.concat(function E(c,T){var R="";return c.forEach(function(c){var E={elementClass:c.title===T.title?"fr-active fr-active-tab":"",title:c.title,dataParam1:c.title,desc:c["char"]};R+='<button class="fr-command fr-btn fr-special-character-category '.concat(E.elementClass,'" title="').concat(E.title,'" data-cmd="setSpecialCharacterCategory" data-param1="').concat(E.dataParam1,'"><span>').concat(E.desc,"</span></button>")}),R}(L,T),'\n </div>\n <div class="fr-icon-container fr-sc-container">\n ').concat(function R(c){var T="";return c.list.forEach(function(c){var E={dataParam1:c["char"],title:c.desc,splCharValue:c["char"]};T+='<span class="fr-command fr-special-character fr-icon" role="button" \n data-cmd="insertSpecialCharacter" data-param1="'.concat(E.dataParam1,'" \n title="').concat(E.title,'">').concat(E.splCharValue,"</span>")}),T}(T),"\n </div>")}return{setSpecialCharacterCategory:function R(E){T=L.filter(function(c){return c.title===E})[0],function c(){W.popups.get("specialCharacters").html(a+I())}()},showSpecialCharsPopup:function e(){var c=W.popups.get("specialCharacters");if(c||(c=function A(){W.opts.toolbarInline&&0<W.opts.specialCharButtons.length&&(a='<div class="fr-buttons fr-tabs">'.concat(W.button.buildList(W.opts.specialCharButtons),"</div>"));var c={buttons:a,custom_layer:I()},E=W.popups.create("specialCharacters",c);return function T(S){W.events.on("popup.tab",function(c){var E=N(c.currentTarget);if(!W.popups.isVisible("specialCharacters")||!E.is("span, a"))return!0;var T,R,L,A=c.which;if(t.KEYCODE.TAB==A){if(E.is("span.fr-icon")&&c.shiftKey||E.is("a")&&!c.shiftKey){var a=S.find(".fr-buttons");T=!W.accessibility.focusToolbar(a,!!c.shiftKey)}if(!1!==T){var I=S.find("span.fr-icon:focus").first().concat(S.findVisible(" span.fr-icon").first().concat(S.find("a")));E.is("span.fr-icon")&&(I=I.not("span.fr-icon:not(:focus)")),R=I.index(E),R=c.shiftKey?((R-1)%I.length+I.length)%I.length:(R+1)%I.length,L=I.get(R),W.events.disableBlur(),L.focus(),T=!1}}else if(t.KEYCODE.ARROW_UP==A||t.KEYCODE.ARROW_DOWN==A||t.KEYCODE.ARROW_LEFT==A||t.KEYCODE.ARROW_RIGHT==A){if(E.is("span.fr-icon")){var e=E.parent().find("span.fr-icon");R=e.index(E);var r=11,s=Math.floor(e.length/r),h=R%r,d=Math.floor(R/r),C=d*r+h,O=s*r;t.KEYCODE.ARROW_UP==A?C=((C-r)%O+O)%O:t.KEYCODE.ARROW_DOWN==A?C=(C+r)%O:t.KEYCODE.ARROW_LEFT==A?C=((C-1)%O+O)%O:t.KEYCODE.ARROW_RIGHT==A&&(C=(C+1)%O),L=N(e.get(C)),W.events.disableBlur(),L.focus(),T=!1}}else t.KEYCODE.ENTER==A&&(E.is("a")?E[0].click():W.button.exec(E),T=!1);return!1===T&&(c.preventDefault(),c.stopPropagation()),T},!0)}(E),E}()),!c.hasClass("fr-active")){W.popups.refresh("specialCharacters"),W.popups.setContainer("specialCharacters",W.$tb);var E=W.$tb.find('.fr-command[data-cmd="specialCharacters"]'),T=W.button.getPosition(E),R=T.left,L=T.top;W.popups.show("specialCharacters",R,L,outerHeight)}},back:function c(){W.popups.hide("specialCharacters"),W.toolbar.showInline()}}},t.DefineIcon("specialCharacters",{NAME:"dollar-sign",SVG_KEY:"symbols"}),t.RegisterCommand("specialCharacters",{title:"Special Characters",icon:"specialCharacters",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,plugin:"specialCharacters",showOnMobile:!0,callback:function(){this.popups.isVisible("specialCharacters")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("specialCharacters")):this.specialCharacters.showSpecialCharsPopup()}}),t.RegisterCommand("insertSpecialCharacter",{callback:function(c,E){this.undo.saveStep(),this.html.insert(E),this.undo.saveStep(),this.popups.hide("specialCharacters")}}),t.RegisterCommand("setSpecialCharacterCategory",{undo:!1,focus:!1,callback:function(c,E){this.specialCharacters.setSpecialCharacterCategory(E)}}),t.DefineIcon("specialCharBack",{NAME:"arrow-left",SVG_KEY:"back"}),t.RegisterCommand("specialCharBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.specialCharacters.back()}})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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
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(ve){"use strict";ve=ve&&ve.hasOwnProperty("default")?ve["default"]:ve,Object.assign(ve.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(ve.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableRemove","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableDefaultWidth:"100%",tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,tableInsertHelperOffset:15}),ve.PLUGINS.table=function(R){var A,f,n,r,l,o,O,y=R.$;function h(){var e=x();if(e){var t=R.popups.get("table.edit");if(t||(t=p()),t){R.popups.setContainer("table.edit",R.$sc);var a=T(e),l=a.left+(a.right-a.left)/2,n=a.bottom;R.popups.show("table.edit",l,n,a.bottom-a.top,!0),R.edit.isDisabled()&&(1<Q().length&&R.toolbar.disable(),R.$el.removeClass("fr-no-selection"),R.edit.on(),R.button.bulkRefresh(),R.selection.setAtEnd(R.$el.find(".fr-selected-cell").last().get(0)),R.selection.restore())}}}function s(){var e=x();if(e){var t=R.popups.get("table.colors");t||(t=function o(){var e="";0<R.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-tabs">'.concat(R.button.buildList(R.opts.tableColorsButtons),"</div>"));var t="";R.opts.colorsHEXInput&&(t='<div class="fr-color-hex-layer fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'.concat(R.id,'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-').concat(R.id,'" type="text" placeholder="').concat(R.language.translate("HEX Color"),'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="tableCellBackgroundCustomColor" tabIndex="2" role="button">').concat(R.language.translate("OK"),"</button></div></div>"));var a={buttons:e,colors:function n(){for(var e='<div class="fr-color-set fr-table-colors">',t=0;t<R.opts.tableColors.length;t++)0!==t&&t%R.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=R.opts.tableColors[t]?e+='<span class="fr-command" style="background: '.concat(R.opts.tableColors[t],';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="').concat(R.opts.tableColors[t],'"><span class="fr-sr-only">').concat(R.language.translate("Color")," ").concat(R.opts.tableColors[t],"&nbsp;&nbsp;&nbsp;</span></span>"):e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'.concat(R.language.translate("Clear Formatting"),'">').concat(R.icon.create("tableColorRemove"),'<span class="fr-sr-only">').concat(R.language.translate("Clear Formatting"),"</span></span>");return e+="</div>"}(),custom_color:t},l=R.popups.create("table.colors",a);return R.events.$on(R.$wp,"scroll.table-colors",function(){R.popups.isVisible("table.colors")&&s()}),function r(u){R.events.on("popup.tab",function(e){var t=y(e.currentTarget);if(!R.popups.isVisible("table.colors")||!t.is("span"))return!0;var a=e.which,l=!0;if(ve.KEYCODE.TAB==a){var n=u.find(".fr-buttons");l=!R.accessibility.focusToolbar(n,!!e.shiftKey)}else if(ve.KEYCODE.ARROW_UP==a||ve.KEYCODE.ARROW_DOWN==a||ve.KEYCODE.ARROW_LEFT==a||ve.KEYCODE.ARROW_RIGHT==a){var r=t.parent().find("span.fr-command"),o=r.index(t),s=R.opts.colorsStep,i=Math.floor(r.length/s),f=o%s,c=Math.floor(o/s),d=c*s+f,p=i*s;ve.KEYCODE.ARROW_UP==a?d=((d-s)%p+p)%p:ve.KEYCODE.ARROW_DOWN==a?d=(d+s)%p:ve.KEYCODE.ARROW_LEFT==a?d=((d-1)%p+p)%p:ve.KEYCODE.ARROW_RIGHT==a&&(d=(d+1)%p);var h=y(r.get(d));R.events.disableBlur(),h.focus(),l=!1}else ve.KEYCODE.ENTER==a&&(R.button.exec(t),l=!1);return!1===l&&(e.preventDefault(),e.stopPropagation()),l},!0)}(l),l}()),R.popups.setContainer("table.colors",R.$sc);var a=T(e),l=(a.left+a.right)/2,n=a.bottom;!function r(){var e=R.popups.get("table.colors"),t=R.$el.find(".fr-selected-cell").first(),a=R.helpers.RGBToHex(t.css("background-color")),l=e.find(".fr-table-colors-hex-layer input");e.find(".fr-selected-color").removeClass("fr-selected-color fr-active-item"),e.find('span[data-param1="'.concat(a,'"]')).addClass("fr-selected-color fr-active-item"),l.val(a).trigger("change")}(),R.popups.show("table.colors",l,n,a.bottom-a.top,!0)}}function i(){0===Q().length&&R.toolbar.enable()}function c(e){if(e)return R.popups.onHide("table.insert",function(){R.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseover")}),!0;var t="";0<R.opts.tableInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'.concat(R.button.buildList(R.opts.tableInsertButtons),"</div>"));var a={buttons:t,rows_columns:function r(){for(var e='<div class="fr-table-size"><div class="fr-table-size-info">1 &times; 1</div><div class="fr-select-table-size">',t=1;t<=R.opts.tableInsertMaxSize;t++){for(var a=1;a<=R.opts.tableInsertMaxSize;a++){var l="inline-block";2<t&&!R.helpers.isMobile()&&(l="none");var n="fr-table-cell ";1==t&&1==a&&(n+=" hover"),e+='<span class="fr-command '.concat(n,'" tabIndex="-1" data-cmd="tableInsert" data-row="').concat(t,'" data-col="').concat(a,'" data-param1="').concat(t,'" data-param2="').concat(a,'" style="display: ').concat(l,';" role="button"><span></span><span class="fr-sr-only">').concat(t," &times; ").concat(a,"&nbsp;&nbsp;&nbsp;</span></span>")}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},l=R.popups.create("table.insert",a);return R.events.$on(l,"mouseover",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){d(y(e.currentTarget))},!0),function n(e){R.events.$on(e,"focus","[tabIndex]",function(e){var t=y(e.currentTarget);d(t)}),R.events.on("popup.tab",function(e){var t=y(e.currentTarget);if(!R.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var a,l=e.which;if(ve.KEYCODE.ARROW_UP==l||ve.KEYCODE.ARROW_DOWN==l||ve.KEYCODE.ARROW_LEFT==l||ve.KEYCODE.ARROW_RIGHT==l){if(t.is("span.fr-table-cell")){var n=t.parent().find("span.fr-table-cell"),r=n.index(t),o=R.opts.tableInsertMaxSize,s=r%o,i=Math.floor(r/o);ve.KEYCODE.ARROW_UP==l?i=Math.max(0,i-1):ve.KEYCODE.ARROW_DOWN==l?i=Math.min(R.opts.tableInsertMaxSize-1,i+1):ve.KEYCODE.ARROW_LEFT==l?s=Math.max(0,s-1):ve.KEYCODE.ARROW_RIGHT==l&&(s=Math.min(R.opts.tableInsertMaxSize-1,s+1));var f=i*o+s,c=y(n.get(f));d(c),R.events.disableBlur(),c.focus(),a=!1}}else ve.KEYCODE.ENTER==l&&(R.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(l),l}function d(e){var t=e.data("row");null!==t&&(t=parseInt(t));var a=e.data("col");null!==a&&(a=parseInt(a));var l=e.parent();l.siblings(".fr-table-size-info").html("".concat(t," &times; ").concat(a)),l.find("> span").removeClass("hover fr-active-item");for(var n=1;n<=R.opts.tableInsertMaxSize;n++)for(var r=0;r<=R.opts.tableInsertMaxSize;r++){var o=l.find('> span[data-row="'.concat(n,'"][data-col="').concat(r,'"]'));n<=t&&r<=a?o.addClass("hover"):n<=t+1||n<=2&&!R.helpers.isMobile()?o.css("display","inline-block"):2<n&&!R.helpers.isMobile()&&o.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return R.popups.onHide("table.edit",i),!0;if(0<R.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'.concat(R.button.buildList(R.opts.tableEditButtons),"</div>")},a=R.popups.create("table.edit",t);return R.events.$on(R.$wp,"scroll.table-edit",function(){R.popups.isVisible("table.edit")&&h()}),a}return!1}function u(){if(0<Q().length){var e=ee();R.selection.setBefore(e.get(0))||R.selection.setAfter(e.get(0)),R.selection.restore(),R.popups.hide("table.edit"),R.opts.trackChangesEnabled?(R.track_changes.removedTable(e),D()):e.remove(),R.toolbar.enable()}}function b(e){var t=ee();if(0<t.length){if(0<R.$el.find("th.fr-selected-cell").length&&"above"==e)return;var a,l,n,r=x(),o=S(r);if(null==o)return;l="above"==e?o.min_i:o.max_i;var s="<tr>";for(a=0;a<r[l].length;a++){if("below"==e&&l<r.length-1&&r[l][a]==r[l+1][a]||"above"==e&&0<l&&r[l][a]==r[l-1][a]){if(0===a||0<a&&r[l][a]!=r[l][a-1]){var i=y(r[l][a]);i.attr("rowspan",parseInt(i.attr("rowspan"),10)+1)}}else s+='<td style="'+y(r[l][a]).attr("style")+'" ><br></td>'}s+="</tr>",n=0<R.$el.find("th.fr-selected-cell").length&&"below"==e?y(t.find("tbody").not(t.find("> table tbody"))):y(t.find("tr").not(t.find("> table tr")).get(l)),"below"==e?"TBODY"==n.attr("tagName")?n.prepend(s):n[0].parentNode&&n[0].insertAdjacentHTML("afterend",s):"above"==e&&(n.before(s),R.popups.isVisible("table.edit")&&h())}}function g(e,t,a){var l,n,r,o,s,i=0,f=x(a);if(e<(t=Math.min(t,f[0].length-1)))for(n=e;n<=t;n++)if(!(e<n&&f[0][n]==f[0][n-1])&&1<(o=Math.min(parseInt(f[0][n].getAttribute("colspan"),10)||1,t-e+1))&&f[0][n]==f[0][n+1])for(i=o-1,l=1;l<f.length;l++)if(f[l][n]!=f[l-1][n]){for(r=n;r<n+o;r++)if(f[l][r]!==undefined)if(1<(s=parseInt(f[l][r].getAttribute("colspan"),10)||1)&&f[l][r]==f[l][r+1])r+=i=Math.min(i,s-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&v(f,i,"colspan",0,f.length-1,e,t)}function m(e,t,a){var l,n,r,o,s,i=0,f=x(a);if(e<(t=Math.min(t,f.length-1)))for(l=e;l<=t;l++)if(!(e<l&&f[l][0]==f[l-1][0])&&f[l][0]!==undefined&&1<(o=Math.min(parseInt(f[l][0].getAttribute("rowspan"),10)||1,t-e+1))&&f[l][0]==f[l+1][0])for(i=o-1,n=1;n<f[0].length;n++)if(f[l][n]!=f[l][n-1]){for(r=l;r<l+o;r++)if(f[r][n]!==undefined)if(1<(s=parseInt(f[r][n].getAttribute("rowspan"),10)||1)&&f[r][n]==f[r+1][n])r+=i=Math.min(i,s-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&v(f,i,"rowspan",e,t,0,f[0].length-1)}function v(e,t,a,l,n,r,o){var s,i,f;for(s=l;s<=n;s++)for(i=r;i<=o;i++)l<s&&e[s][i]==e[s-1][i]||r<i&&e[s][i]==e[s][i-1]||e[s][i]!==undefined&&1<(f=parseInt(e[s][i].getAttribute(a),10)||1)&&(1<f-t?e[s][i].setAttribute(a,f-t):e[s][i].removeAttribute(a))}function w(e,t,a,l,n){m(e,t,n),g(a,l,n)}function t(e){var t=R.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",R.helpers.HEXtoRGB(e)):t.css("background-color",""),h()}function C(e){e.style.removeProperty("border"),e.style.removeProperty("border-top"),e.style.removeProperty("border-bottom"),e.style.removeProperty("border-left"),e.style.removeProperty("border-right")}function x(e){var f=[];if(null==(e=e||null)&&0<Q().length&&(e=ee()),e){for(var t=e.find("tr:empty"),a=t.length-1;0<=a;a--)y(t[a]).remove();e.findVisible("tr").not(e.find("> table tr")).each(function(s,e){var t=y(e),i=0;t.find("> th, > td").each(function(e,t){for(var a=y(t),l=parseInt(a.attr("colspan"),10)||1,n=parseInt(a.attr("rowspan"),10)||1,r=s;r<s+n;r++)for(var o=i;o<i+l;o++)f[r]||(f[r]=[]),f[r][o]?i++:f[r][o]=t;i+=l})})}return f}function $(e,t){for(var a=0;a<t.length;a++)for(var l=0;l<t[a].length;l++)if(t[a][l]==e)return{row:a,col:l}}function _(e,t,a){for(var l=e+1,n=t+1;l<a.length;){if(a[l][t]!=a[e][t]){l--;break}l++}for(l==a.length&&l--;n<a[e].length;){if(a[e][n]!=a[e][t]){n--;break}n++}return n==a[e].length&&n--,{row:l,col:n}}function E(){R.el.querySelector(".fr-cell-fixed")&&R.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),R.el.querySelector(".fr-cell-handler")&&R.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function D(){var e=R.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=y(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),E()}function M(){R.events.disableBlur(),R.selection.clear(),R.$el.addClass("fr-no-selection"),R.$el.blur(),R.events.enableBlur()}function S(e){var t=R.$el.find(".fr-selected-cell");if(0<t.length){var a,l=e.length,n=0,r=e[0].length,o=0;for(a=0;a<t.length;a++){var s=$(t[a],e),i=_(s.row,s.col,e);l=Math.min(s.row,l),n=Math.max(i.row,n),r=Math.min(s.col,r),o=Math.max(i.col,o)}return{min_i:l,max_i:n,min_j:r,max_j:o}}return null}function T(e){var t=S(e);if(null!=t){var a=y(e[t.min_i][t.min_j]),l=y(e[t.min_i][t.max_j]),n=y(e[t.max_i][t.min_j]);return{left:a.length&&a.offset().left,right:l.length&&l.offset().left+l.outerWidth(),top:a.length&&a.offset().top,bottom:n.length&&n.offset().top+n.outerHeight()}}}function I(e,t){if(y(e).is(t))D(),y(e).addClass("fr-selected-cell");else{M(),R.edit.off();var a=x(),l=$(e,a),n=$(t,a),r=function h(e,t,a,l,n){var r,o,s,i,f=e,c=t,d=a,p=l;for(r=f;r<=c;r++)(1<(parseInt(y(n[r][d]).attr("rowspan"),10)||1)||1<(parseInt(y(n[r][d]).attr("colspan"),10)||1))&&(i=_((s=$(n[r][d],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p)),(1<(parseInt(y(n[r][p]).attr("rowspan"),10)||1)||1<(parseInt(y(n[r][p]).attr("colspan"),10)||1))&&(i=_((s=$(n[r][p],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p));for(o=d;o<=p;o++)(1<(parseInt(y(n[f][o]).attr("rowspan"),10)||1)||1<(parseInt(y(n[f][o]).attr("colspan"),10)||1))&&(i=_((s=$(n[f][o],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p)),(1<(parseInt(y(n[c][o]).attr("rowspan"),10)||1)||1<(parseInt(y(n[c][o]).attr("colspan"),10)||1))&&(i=_((s=$(n[c][o],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p));return f==e&&c==t&&d==a&&p==l?{min_i:e,max_i:t,min_j:a,max_j:l}:h(f,c,d,p,n)}(Math.min(l.row,n.row),Math.max(l.row,n.row),Math.min(l.col,n.col),Math.max(l.col,n.col),a);D(),e.classList.add("fr-cell-fixed"),t.classList.add("fr-cell-handler");for(var o=r.min_i;o<=r.max_i;o++)for(var s=r.min_j;s<=r.max_j;s++)y(e).closest("table").is(y(a[o][s]).closest("table"))&&y(a[o][s]).addClass("fr-selected-cell")}}function N(e){var t=null,a=y(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<a.closest("th",a.closest("thead")[0]).length?t=a.closest("th",a.closest("thead")[0]).get(0):0<a.closest("td",a.closest("tr")[0]).length&&(t=a.closest("td",a.closest("tr")[0]).get(0)),-1===R.$el.html.toString().search(t)?null:t}function K(){D(),R.popups.hide("table.edit")}function e(e){var t=N(e);if("false"==y(t).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(0<Q().length&&!t&&K(),!R.edit.isDisabled()||R.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&R.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&R.helpers.isMac()&&e.ctrlKey)&&t&&K();else if(r=!0,t){0<Q().length&&!e.shiftKey&&K(),e.stopPropagation(),R.events.trigger("image.hideResizer"),R.events.trigger("video.hideResizer"),n=!0;var a=t.tagName.toLowerCase();e.shiftKey&&0<R.$el.find("".concat(a,".fr-selected-cell")).length?y(R.$el.find("".concat(a,".fr-selected-cell")).closest("table")).is(y(t).closest("table"))?I(l,t):M():((R.keys.ctrlKey(e)||e.shiftKey)&&"TD"===e.currentTarget.tagName&&(1<Q().length||0===y(t).find(R.selection.element()).length&&!y(t).is(R.selection.element()))&&M(),l=t,0<R.opts.tableEditButtons.length&&I(l,l))}}function a(e){if(!R.edit.isDisabled()&&R.popups.areVisible())return!0;var t=N(e);if(1===Q().length&&null===t&&(R.toolbar.enable(),D()),(1===Q().length&&t&&"TD"!==t.tagName&&"TH"!==t.tagName||!n&&!R.$tb.is(e.target)&&!R.$tb.is(y(e.target).closest(".fr-toolbar")))&&(R.toolbar.enable(),D()),("BODY"===e.target.tagName||"HTML"===e.target.tagName)&&!t&&0<Q().length&&R.toolbar.enable(),!(1!=e.which||1==e.which&&R.helpers.isMac()&&e.ctrlKey)){if(r=!1,n)n=!1,N(e)||1!=Q().length?0<Q().length?R.selection.isCollapsed()?(h(),R.toolbar.enable()):(D(),R.edit.on()):Q().length||(R.$el.removeClass("fr-no-selection"),R.edit.on()):D();if(O){O=!1,A.removeClass("fr-moving"),R.$el.removeClass("fr-no-selection"),R.edit.on();var a=parseFloat(A.css("left"))+R.opts.tableResizerOffset+R.$wp.offset().left;R.opts.iframe&&(a-=R.$iframe.offset().left),A.data("release-position",a),A.removeData("max-left"),A.removeData("max-right"),function C(){var e=A.data("origin"),t=A.data("release-position");if(e!==t){var a=A.data("first"),l=A.data("second"),n=A.data("table"),r=n.outerWidth();if(R.undo.canDo()||R.undo.saveStep(),null!=a&&null!=l){var o,s,i,f=x(n),c=[],d=[],p=[],h=[];for(o=0;o<f.length;o++)s=y(f[o][a]),i=y(f[o][l]),c[o]=s.outerWidth(),p[o]=i.outerWidth(),d[o]=c[o]/r*100,h[o]=p[o]/r*100;for(o=0;o<f.length;o++)if(s=y(f[o][a]),i=y(f[o][l]),f[o][a]!=f[o][l]){var u=(d[o]*(c[o]+t-e)/c[o]).toFixed(4);s.css("width",u+"%"),i.css("width",(d[o]+h[o]-u).toFixed(4)+"%")}}else{var b,g=n.parent(),m=r/g.width()*100,v=(parseInt(n.css("margin-left"),10)||0)/g.width()*100,w=(parseInt(n.css("margin-right"),10)||0)/g.width()*100;"rtl"==R.opts.direction&&0===l||"rtl"!=R.opts.direction&&0!==l?(b=(r+t-e)/r*m,n.css("margin-right","calc(100% - ".concat(Math.round(b).toFixed(4),"% - ").concat(Math.round(v).toFixed(4),"%)"))):("rtl"==R.opts.direction&&0!==l||"rtl"!=R.opts.direction&&0===l)&&(b=(r-t+e)/r*m,n.css("margin-left","calc(100% - ".concat(Math.round(b).toFixed(4),"% - ").concat(Math.round(w).toFixed(4),"%)"))),n.css("width","".concat(Math.round(b).toFixed(4),"%"))}R.selection.restore(),R.undo.saveStep(),R.events.trigger("table.resized",[n.get(0)])}A.removeData("origin"),A.removeData("release-position"),A.removeData("first"),A.removeData("second"),A.removeData("table")}(),W()}}}function k(e){if(!(y(e.currentTarget).is(y(e.originalEvent.relatedTarget))||e.currentTarget.contains(e.originalEvent.relatedTarget)||e.originalEvent.relatedTarget&&e.originalEvent.relatedTarget.contains(e.currentTarget))&&(R.events.$on(y("input"),"click",te),!0===n&&0<R.opts.tableEditButtons.length)){if(y(e.currentTarget).closest("table").is(ee())){if("TD"==e.currentTarget.tagName&&0===R.$el.find("th.fr-selected-cell").length)return void I(l,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===R.$el.find("td.fr-selected-cell").length)return void I(l,e.currentTarget)}M()}}function B(e,t,a,l){for(var n,r=t;r!=R.el&&"TD"!=r.tagName&&"TH"!=r.tagName&&("up"==l?n=r.previousElementSibling:"down"==l&&(n=r.nextElementSibling),!n);)r=r.parentNode;"TD"==r.tagName||"TH"==r.tagName?function o(e,t){for(var a=e;a&&"TABLE"!=a.tagName&&a.parentNode!=R.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName){var l=x(y(a));"up"==t?z($(e,l),a,l):"down"==t&&Y($(e,l),a,l)}}(r,l):n&&("up"==l&&R.selection.setAtEnd(n),"down"==l&&R.selection.setAtStart(n))}function z(e,t,a){0<y(".tribute-container").length&&"none"!=y(".tribute-container").css("display")||(0<e.row?R.selection.setAtEnd(a[e.row-1][e.col]):B(0,t,0,"up"))}function Y(e,t,a){if(!(0<y(".tribute-container").length&&"none"!=y(".tribute-container").css("display"))){var l=parseInt(a[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<a.length-l?R.selection.setAtStart(a[e.row+l][e.col]):B(0,t,0,"down")}}function W(){A&&(A.find("div").css("opacity",0),A.css("top",0),A.css("left",0),A.css("height",0),A.find("div").css("height",0),A.hide())}function L(){f&&f.removeClass("fr-visible").css("left","-9999px")}function H(e,t){var a=y(t),l=a.closest("table"),n=l.parent();if(t&&"TD"!=t.tagName&&"TH"!=t.tagName&&(0<a.closest("td").length?t=a.closest("td"):0<a.closest("th").length&&(t=a.closest("th"))),!t||"TD"!=t.tagName&&"TH"!=t.tagName)A&&a.get(0)!=A.get(0)&&a.parent().get(0)!=A.get(0)&&R.core.sameInstance(A)&&W();else{if(a=y(t),0===R.$el.find(a).length)return!1;var r=a.offset().left-1,o=r+a.outerWidth();if(Math.abs(e.pageX-r)<=R.opts.tableResizerOffset||Math.abs(o-e.pageX)<=R.opts.tableResizerOffset){var s,i,f,c,d,p=x(l),h=$(t,p),u=_(h.row,h.col,p),b=l.offset().top,g=l.outerHeight()-1;"rtl"!=R.opts.direction?e.pageX-r<=R.opts.tableResizerOffset?(f=r,0<h.col?(c=r-X(h.col-1,p)+R.opts.tableResizingLimit,d=r+X(h.col,p)-R.opts.tableResizingLimit,s=h.col-1,i=h.col):(s=null,i=0,c=l.offset().left-1-parseInt(l.css("margin-left"),10),d=l.offset().left-1+l.width()-p[0].length*R.opts.tableResizingLimit)):o-e.pageX<=R.opts.tableResizerOffset&&(f=o,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=o-X(u.col,p)+R.opts.tableResizingLimit,d=o+X(u.col+1,p)-R.opts.tableResizingLimit,s=u.col,i=u.col+1):(s=u.col,i=null,c=l.offset().left-1+p[0].length*R.opts.tableResizingLimit,d=n.offset().left-1+n.width()+parseFloat(n.css("padding-left")))):o-e.pageX<=R.opts.tableResizerOffset?(f=o,0<h.col?(c=o-X(h.col,p)+R.opts.tableResizingLimit,d=o+X(h.col-1,p)-R.opts.tableResizingLimit,s=h.col,i=h.col-1):(s=null,i=0,c=l.offset().left+p[0].length*R.opts.tableResizingLimit,d=n.offset().left-1+n.width()+parseFloat(n.css("padding-left")))):e.pageX-r<=R.opts.tableResizerOffset&&(f=r,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=r-X(u.col+1,p)+R.opts.tableResizingLimit,d=r+X(u.col,p)-R.opts.tableResizingLimit,s=u.col+1,i=u.col):(s=u.col,i=null,c=n.offset().left+parseFloat(n.css("padding-left")),d=l.offset().left-1+l.width()-p[0].length*R.opts.tableResizingLimit)),A||function E(){R.shared.$table_resizer||(R.shared.$table_resizer=y(document.createElement("div")).attr("class","fr-table-resizer").html("<div></div>")),A=R.shared.$table_resizer,R.events.$on(A,"mousedown",function(e){return!R.core.sameInstance(A)||(0<Q().length&&K(),1==e.which?(R.selection.save(),O=!0,A.addClass("fr-moving"),M(),R.edit.off(),A.find("div").css("opacity",1),!1):void 0)}),R.events.$on(A,"mousemove",function(e){if(!R.core.sameInstance(A))return!0;O&&(R.opts.iframe&&(e.pageX-=R.$iframe.offset().left),U(e))}),R.events.on("shared.destroy",function(){A.html("").removeData().remove(),A=null},!0),R.events.on("destroy",function(){R.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),y("body").first().append(A.hide())},!0)}(),A.data("table",l),A.data("first",s),A.data("second",i),A.data("instance",R),R.$wp.append(A);var m=f-R.win.pageXOffset-R.opts.tableResizerOffset-R.$wp.offset().left,v=b-R.$wp.offset().top+R.$wp.scrollTop();if(R.opts.iframe){var w=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-top")),C=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-left"));m+=R.$iframe.offset().left+C,v+=R.$iframe.offset().top+w,c+=R.$iframe.offset().left,d+=R.$iframe.offset().left}A.data("max-left",c),A.data("max-right",d),A.data("origin",f-R.win.pageXOffset),A.css("top",v),A.css("left",m),A.css("height",g),A.find("div").css("height",g),A.css("padding-left",R.opts.tableResizerOffset),A.css("padding-right",R.opts.tableResizerOffset),A.show()}else R.core.sameInstance(A)&&W()}}function F(e,t){if(R.$box.find(".fr-line-breaker").isVisible())return!1;f||J(),R.$box.append(f),f.data("instance",R);var a,l=y(t).find("tr").first(),n=e.pageX,r=0,o=0;if(R.opts.iframe){var s=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-top")),i=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-left"));r+=R.$iframe.offset().left-R.helpers.scrollLeft()+i,o+=R.$iframe.offset().top-R.helpers.scrollTop()+s}l.find("th, td").each(function(){var e=y(this);return e.offset().left<=n&&n<e.offset().left+e.outerWidth()/2?(a=parseInt(f.find("a").css("width"),10),f.css("top",o+e.offset().top-R.$box.offset().top-a-5),f.css("left",r+e.offset().left-R.$box.offset().left-a/2),f.data("selected-cell",e),f.data("position","before"),f.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=n&&n<e.offset().left+e.outerWidth()?(a=parseInt(f.find("a").css("width"),10),f.css("top",o+e.offset().top-R.$box.offset().top-a-5),f.css("left",r+e.offset().left-R.$box.offset().left+e.outerWidth()-a/2),f.data("selected-cell",e),f.data("position","after"),f.addClass("fr-visible"),!1):void 0})}function P(e,t){if(R.$box.find(".fr-line-breaker").isVisible())return!1;f||J(),R.$box.append(f),f.data("instance",R);var a,l=y(t),n=e.pageY,r=0,o=0;if(R.opts.iframe){var s=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-top")),i=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-left"));r+=R.$iframe.offset().left-R.helpers.scrollLeft()+i,o+=R.$iframe.offset().top-R.helpers.scrollTop()+s}l.find("tr").each(function(){var e=y(this);a=parseInt(f.find("a").css("width"),10);var t=r+e.offset().left-R.$box.offset().left;return t=0!==R.$box.offset().left?t-a-5:t+a-5,e.offset().top<=n&&n<e.offset().top+e.outerHeight()/2?(f.css("top",o+e.offset().top-R.$box.offset().top-a/2),f.css("left",t),f.data("selected-cell",e.find("td").first()),f.data("position","above"),f.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=n&&n<e.offset().top+e.outerHeight()?(f.css("top",o+e.offset().top-R.$box.offset().top+e.outerHeight()-a/2),f.css("left",t),f.data("selected-cell",e.find("td").first()),f.data("position","below"),f.addClass("fr-visible"),!1):void 0})}function V(e){o=null;var t=R.doc.elementFromPoint(e.pageX-R.win.pageXOffset,e.pageY-R.win.pageYOffset);R.opts.tableResizer&&(!R.popups.areVisible()||R.popups.areVisible()&&R.popups.isVisible("table.edit"))&&H(e,t),!R.opts.tableInsertHelper||R.popups.areVisible()||R.$tb.hasClass("fr-inline")&&R.$tb.isVisible()||function r(e,t){if(0===Q().length){var a,l,n;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||R.node.isElement(t)))for(a=1;a<=R.opts.tableInsertHelperOffset;a++){if(l=R.doc.elementFromPoint(e.pageX-R.win.pageXOffset,e.pageY-R.win.pageYOffset+a),y(l).hasClass("fr-tooltip"))return!0;if(l&&("TH"==l.tagName||"TD"==l.tagName||"TABLE"==l.tagName)&&(y(l).parents(".fr-wrapper").length||R.opts.iframe)&&"false"!=y(l).closest("table").attr("contenteditable"))return F(e,y(l).closest("table")),!0;if(n=R.doc.elementFromPoint(e.pageX-R.win.pageXOffset+a,e.pageY-R.win.pageYOffset),y(n).hasClass("fr-tooltip"))return!0;if(n&&("TH"==n.tagName||"TD"==n.tagName||"TABLE"==n.tagName)&&(y(n).parents(".fr-wrapper").length||R.opts.iframe)&&"false"!=y(n).closest("table").attr("contenteditable"))return P(e,y(n).closest("table")),!0}R.core.sameInstance(f)&&L()}}(e,t)}function j(){if(O){var e=A.data("table").offset().top-R.win.pageYOffset;if(R.opts.iframe){var t=R.helpers.getPX(R.$wp.find(".fr-iframe").css("padding-top"));e+=R.$iframe.offset().top-R.helpers.scrollTop()+t}A.css("top",e)}}function X(e,t){var a,l=y(t[0][e]).outerWidth();for(a=1;a<t.length;a++)l=Math.min(l,y(t[a][e]).outerWidth());return l}function G(e,t,a){var l,n=0;for(l=e;l<=t;l++)n+=X(l,a);return n}function U(e){if(1<Q().length&&r&&M(),!1===r&&!1===n&&!1===O)o&&clearTimeout(o),R.edit.isDisabled()&&!R.popups.isVisible("table.edit")||(o=setTimeout(V,30,e));else if(O){var t=e.pageX-R.win.pageXOffset;R.opts.iframe&&(t+=R.$iframe.offset().left);var a=A.data("max-left"),l=A.data("max-right");a<=t&&t<=l?A.css("left",t-R.opts.tableResizerOffset-R.$wp.offset().left):t<a&&parseFloat(A.css("left"),10)>a-R.opts.tableResizerOffset?A.css("left",a-R.opts.tableResizerOffset-R.$wp.offset().left):l<t&&parseFloat(A.css("left"),10)<l-R.opts.tableResizerOffset&&A.css("left",l-R.opts.tableResizerOffset-R.$wp.offset().left)}else r&&L()}function q(e){R.node.isEmpty(e.get(0))?e.prepend(ve.MARKERS):e.prepend(ve.START_MARKER).append(ve.END_MARKER)}function J(){R.shared.$ti_helper||(R.shared.$ti_helper=y(document.createElement("div")).attr("class","fr-insert-helper").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'.concat(R.language.translate("Insert"),'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a>')),R.events.bindClick(R.shared.$ti_helper,"a",function(){var e=f.data("selected-cell"),t=f.data("position"),a=f.data("instance")||R;"before"==t?(R.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),R.undo.saveStep()):"after"==t?(R.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),R.undo.saveStep()):"above"==t?(R.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),R.undo.saveStep()):"below"==t&&(R.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),R.undo.saveStep()),L()}),R.events.on("shared.destroy",function(){R.shared.$ti_helper.html("").removeData().remove(),R.shared.$ti_helper=null},!0),R.events.$on(R.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),R.events.$on(y(R.o_win),"scroll",function(){L()},!0),R.events.$on(R.$wp,"scroll",function(){L()},!0)),f=R.shared.$ti_helper,R.events.on("destroy",function(){f=null}),R.tooltip.bind(R.$box,".fr-insert-helper > a.fr-floating-btn")}function Z(){l=null,clearTimeout(o)}function Q(){return R.el.querySelectorAll(".fr-selected-cell")}function ee(){var e=Q();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=R.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?y(t):y([])}return y([])}function te(e){n=!1}return{_init:function ae(){if(!R.$wp)return!1;if(R.helpers.isMobile()&&(R.events.$on(R.$el,"mousedown",e),R.events.$on(R.$win,"mouseup",a)),!R.helpers.isMobile()){O=n=r=!1,R.events.$on(R.$el,"mousedown",e),R.popups.onShow("image.edit",function(){D(),n=r=!1}),R.popups.onShow("link.edit",function(){D(),n=r=!1}),R.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&D()}),R.events.$on(R.$el,"mouseover","th, td",k),R.events.$on(R.$win,"mouseup",a),R.opts.iframe&&R.events.$on(y(R.o_win),"mouseup",a),R.events.$on(R.$win,"mousemove",U),R.events.$on(y(R.o_win),"scroll",j),R.events.on("contentChanged",function(){0<Q().length&&(h(),R.$el.find("img").on("load.selected-cells",function(){y(this).off("load.selected-cells"),0<Q().length&&h()}))}),R.events.$on(y(R.o_win),"resize",function(){D()}),R.events.on("toolbar.esc",function(){if(0<Q().length)return R.events.disableBlur(),R.events.focus(),!1},!0),R.events.$on(y(R.o_win),"keydown",function(){r&&n&&(n=r=!1,R.$el.removeClass("fr-no-selection"),R.edit.on(),R.selection.setAtEnd(R.$el.find(".fr-selected-cell").last().get(0)),R.selection.restore(),D())}),R.events.$on(R.$el,"keydown",function(e){e.shiftKey?!1===function o(e){var t=Q();if(null!=t&&0<t.length){var a,l=x(),n=e.which,r=$(1==t.length?a=t[0]:(a=R.el.querySelector(".fr-cell-fixed"),R.el.querySelector(".fr-cell-handler")),l);if(ve.KEYCODE.ARROW_RIGHT==n){if(r.col<l[0].length-1)return I(a,l[r.row][r.col+1]),!1}else if(ve.KEYCODE.ARROW_DOWN==n){if(r.row<l.length-1)return I(a,l[r.row+1][r.col]),!1}else if(ve.KEYCODE.ARROW_LEFT==n){if(0<r.col)return I(a,l[r.row][r.col-1]),!1}else if(ve.KEYCODE.ARROW_UP==n&&0<r.row)return I(a,l[r.row-1][r.col]),!1}}(e)&&setTimeout(function(){h()},0):function s(e){var t=e.which,a=R.selection.blocks();if(a.length&&("TD"==(a=a[0]).tagName||"TH"==a.tagName)){for(var l=a;l&&"TABLE"!=l.tagName&&l.parentNode!=R.el;)l=l.parentNode;if(l&&"TABLE"==l.tagName&&(ve.KEYCODE.ARROW_LEFT==t||ve.KEYCODE.ARROW_UP==t||ve.KEYCODE.ARROW_RIGHT==t||ve.KEYCODE.ARROW_DOWN==t)&&(0<Q().length&&K(),R.browser.webkit&&(ve.KEYCODE.ARROW_UP==t||ve.KEYCODE.ARROW_DOWN==t))){var n=R.selection.ranges(0).startContainer;if(n.nodeType==Node.TEXT_NODE&&(ve.KEYCODE.ARROW_UP==t&&(n.previousSibling&&"BR"!==n.previousSibling.tagName||n.previousSibling&&"BR"===n.previousSibling.tagName&&n.previousSibling.previousSibling)||ve.KEYCODE.ARROW_DOWN==t&&(n.nextSibling&&"BR"!==n.nextSibling.tagName||n.nextSibling&&"BR"===n.nextSibling.tagName&&n.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var r=x(y(l)),o=$(a,r);return ve.KEYCODE.ARROW_UP==t?z(o,l,r):ve.KEYCODE.ARROW_DOWN==t&&Y(o,l,r),R.selection.restore(),!1}}}(e)}),R.events.on("keydown",function(e){if(!1===function l(e){if(e.which==ve.KEYCODE.TAB){var t;if(0<Q().length)t=R.$el.find(".fr-selected-cell").last();else{var a=R.selection.element();"TD"==a.tagName||"TH"==a.tagName?t=y(a):a!=R.el&&(0<y(a).parentsUntil(R.$el,"td").length?t=y(a).parents("td").first():0<y(a).parentsUntil(R.$el,"th").length&&(t=y(a).parents("th").first()))}if(t)return e.preventDefault(),!!(0===R.selection.get().focusOffset&&0<y(R.selection.element()).parentsUntil(R.$el,"ol, ul").length&&(0<y(R.selection.element()).closest("li").prev().length||y(R.selection.element()).is("li")&&0<y(R.selection.element()).prev().length))||(K(),e.shiftKey?0<t.prev().length?q(t.prev()):0<t.closest("tr").length&&0<t.closest("tr").prev().length?q(t.closest("tr").prev().find("td").last()):0<t.closest("tbody").length&&0<t.closest("table").find("thead tr").length&&q(t.closest("table").find("thead tr th").last()):0<t.next().length?q(t.next()):0<t.closest("tr").length&&0<t.closest("tr").next().length?q(t.closest("tr").next().find("td").first()):0<t.closest("thead").length&&0<t.closest("table").find("tbody tr").length?q(t.closest("table").find("tbody tr td").first()):(t.addClass("fr-selected-cell"),b("below"),D(),q(t.closest("tr").next().find("td").first())),R.selection.restore(),!1)}}(e))return!1;var t=Q();if(0<t.length){if(0<t.length&&R.keys.ctrlKey(e)&&e.which==ve.KEYCODE.A)return D(),R.popups.isVisible("table.edit")&&R.popups.hide("table.edit"),t=[],!0;if(e.which==ve.KEYCODE.ESC&&R.popups.isVisible("table.edit"))return D(),R.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==ve.KEYCODE.BACKSPACE||e.which==ve.KEYCODE.DELETE)){R.undo.saveStep();for(var a=0;a<t.length;a++)y(t[a]).html("<br>"),a==t.length-1&&y(t[a]).prepend(ve.MARKERS);return R.selection.restore(),R.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=ve.KEYCODE.F10&&!R.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function n(e){if(e.altKey&&e.which==ve.KEYCODE.SPACE){var t,a=R.selection.element();if("TD"==a.tagName||"TH"==a.tagName?t=a:0<y(a).closest("td").length?t=y(a).closest("td").get(0):0<y(a).closest("th").length&&(t=y(a).closest("th").get(0)),t)return e.preventDefault(),I(t,t),h(),!1}}(e))return!1},!0);var t=[];R.events.on("html.beforeGet",function(){t=Q();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),R.events.on("html.afterGet",function(){for(var e=0;e<t.length;e++)t[e].className=(t[e].className?t[e].className.trim()+" ":"")+"fr-selected-cell";t=[]}),c(!0),p(!0)}R.events.on("destroy",Z)},insert:function le(e,t){var a,l,n="<table "+(R.opts.tableDefaultWidth?'style="width: '+R.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',r=100/t;for(a=0;a<e;a++){for(n+="<tr>",l=0;l<t;l++)n+="<td"+(R.opts.tableDefaultWidth?' style="width: '+r.toFixed(4)+'%;"':"")+">",0===a&&0===l&&(n+=ve.MARKERS),n+="<br></td>";n+="</tr>"}if(n+="</tbody></table>",R.opts.trackChangesEnabled){R.edit.on(),R.events.focus(!0),R.selection.restore(),R.undo.saveStep(),R.markers.insert(),R.html.wrap();var o=R.$el.find(".fr-marker");R.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith(n),R.selection.clear()}else R.html.insert(n);R.selection.restore();var s=R.$el.find(".fr-inserted-table");s.removeClass("fr-inserted-table"),R.events.trigger("table.inserted",[s.get(0)])},remove:u,insertRow:b,deleteRow:function ne(){var e=ee();if(0<e.length){var t,a,l,n=x(),r=S(n);if(null==r)return;if(0===r.min_i&&r.max_i==n.length-1)u();else{for(t=r.max_i;t>=r.min_i;t--){for(l=y(e.find("tr").not(e.find("> table tr")).get(t)),a=0;a<n[t].length;a++)if(0===a||n[t][a]!=n[t][a-1]){var o=y(n[t][a]);if(1<parseInt(o.attr("rowspan"),10)){var s=parseInt(o.attr("rowspan"),10)-1;1==s?o.removeAttr("rowspan"):o.attr("rowspan",s)}if(t<n.length-1&&n[t][a]==n[t+1][a]&&(0===t||n[t][a]!=n[t-1][a])){for(var i=n[t][a],f=a;0<f&&n[t][f]==n[t][f-1];)f--;0===f?y(e.find("tr").not(e.find("> table tr")).get(t+1)).prepend(i):y(n[t+1][f-1])[0].parentNode&&y(n[t+1][f-1])[0].insertAdjacentElement("afterend",i)}}var c=l.parent();l.remove(),0===c.find("tr").length&&c.remove(),n=x(e)}w(0,n.length-1,0,n[0].length-1,e),0<r.min_i?R.selection.setAtEnd(n[r.min_i-1][0]):R.selection.setAtEnd(n[0][0]),R.selection.restore(),R.popups.hide("table.edit")}}},insertColumn:function re(i){var e=ee();if(0<e.length){var f,c=x(),t=S(c);f="before"==i?t.min_j:t.max_j;var a,d=100/c[0].length,p=100/(c[0].length+1);e.find("th, td").each(function(){(a=y(this)).data("old-width",a.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("> table tr")).each(function(e){for(var t,a=y(this),l=0,n=0;l-1<f;){if(!(t=a.find("> th, > td").get(n))){t=null;break}t==c[e][l]?(l+=parseInt(y(t).attr("colspan"),10)||1,n++):(l+=parseInt(y(c[e][l]).attr("colspan"),10)||1,"after"==i&&(t=0===n?-1:a.find("> th, > td").get(n-1)))}var r,o=y(t);if("after"==i&&f<l-1||"before"==i&&0<f&&c[e][f]==c[e][f-1]){if(0===e||0<e&&c[e][f]!=c[e-1][f]){var s=parseInt(o.attr("colspan"),10)+1;o.attr("colspan",s),o.css("width",(o.data("old-width")*p/d+p).toFixed(4)+"%"),o.removeData("old-width")}}else r=0<a.find("th").length?'<th style="width: '.concat(p.toFixed(4),'%;"><br></th>'):'<td style="width: '.concat(p.toFixed(4),'%;"><br></td>'),-1==t?a.prepend(r):null==t?a.append(r):"before"==i?o.before(r):"after"==i&&o[0].parentNode&&o[0].insertAdjacentHTML("afterend",r)}),e.find("th, td").each(function(){(a=y(this)).data("old-width")&&(a.css("width",(a.data("old-width")*p/d).toFixed(4)+"%"),a.removeData("old-width"))}),R.popups.isVisible("table.edit")&&h()}},deleteColumn:function oe(){var e=ee();if(0<e.length){var t,a,l,n=x(),r=S(n);if(null==r)return;if(0===r.min_j&&r.max_j==n[0].length-1)u();else{var o=0;for(t=0;t<n.length;t++)for(a=0;a<n[0].length;a++)(l=y(n[t][a])).hasClass("fr-selected-cell")||(l.data("old-width",l.outerWidth()/e.outerWidth()*100),(a<r.min_j||a>r.max_j)&&(o+=l.outerWidth()/e.outerWidth()*100));for(o/=n.length,a=r.max_j;a>=r.min_j;a--)for(t=0;t<n.length;t++)if(0===t||n[t][a]!=n[t-1][a])if(l=y(n[t][a]),1<(parseInt(l.attr("colspan"),10)||1)){var s=parseInt(l.attr("colspan"),10)-1;1==s?l.removeAttr("colspan"):l.attr("colspan",s),l.css("width",(100*(l.data("old-width")-X(a,n))/o).toFixed(4)+"%"),l.removeData("old-width")}else{var i=y(l.parent().get(0));l.remove(),0===i.find("> th, > td").length&&(0===i.prev().length||0===i.next().length||i.prev().find("> th[rowspan], > td[rowspan]").length<i.prev().find("> th, > td").length)&&i.remove()}w(0,n.length-1,0,n[0].length-1,e),0<r.min_j?R.selection.setAtEnd(n[r.min_i][r.min_j-1]):R.selection.setAtEnd(n[r.min_i][0]),R.selection.restore(),R.popups.hide("table.edit"),e.find("th, td").each(function(){(l=y(this)).data("old-width")&&(l.css("width",(100*l.data("old-width")/o).toFixed(4)+"%"),l.removeData("old-width"))})}}},mergeCells:function se(){if(1<Q().length&&(0===R.$el.find("th.fr-selected-cell").length||0===R.$el.find("td.fr-selected-cell").length)){E();var e,t,a=S(x());if(null==a)return;var l=R.$el.find(".fr-selected-cell"),n=y(l[0]),r=n.parent().find(".fr-selected-cell"),o=n.closest("table"),s=n.html(),i=0;for(e=0;e<r.length;e++)i+=y(r[e]).outerWidth();for(n.css("width",Math.min(100,i/o.outerWidth()*100).toFixed(4)+"%"),a.min_j<a.max_j&&n.attr("colspan",a.max_j-a.min_j+1),a.min_i<a.max_i&&n.attr("rowspan",a.max_i-a.min_i+1),e=1;e<l.length;e++)"<br>"!=(t=y(l[e])).html()&&""!==t.html()&&(s+="<br>".concat(t.html())),t.remove();n.html(s),R.selection.setAtEnd(n.get(0)),R.selection.restore(),R.toolbar.enable(),m(a.min_i,a.max_i,o);var f=o.find("tr:empty");for(e=f.length-1;0<=e;e--)y(f[e]).remove();g(a.min_j,a.max_j,o),h()}},splitCellVertically:function ie(){if(1==Q().length){var e=R.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,a=e.parent().outerWidth(),l=e.outerWidth(),n=e.clone().html("<br>"),r=x(),o=$(e.get(0),r);if(1<t){var s=Math.ceil(t/2);l=G(o.col,o.col+s-1,r)/a*100;var i=G(o.col+s,o.col+t-1,r)/a*100;1<s?e.attr("colspan",s):e.removeAttr("colspan"),1<t-s?n.attr("colspan",t-s):n.removeAttr("colspan"),e.css("width",l.toFixed(4)+"%"),n.css("width",i.toFixed(4)+"%")}else{var f;for(f=0;f<r.length;f++)if(0===f||r[f][o.col]!=r[f-1][o.col]){var c=y(r[f][o.col]);if(!c.is(e)){var d=(parseInt(c.attr("colspan"),10)||1)+1;c.attr("colspan",d)}}l=l/a*100/2,e.css("width","".concat(l.toFixed(4),"%")),n.css("width","".concat(l.toFixed(4),"%"))}e[0].parentNode&&e[0].insertAdjacentElement("afterend",n[0]),D(),R.popups.hide("table.edit")}},splitCellHorizontally:function fe(){if(1==Q().length){var e=R.$el.find(".fr-selected-cell"),t=e.parent(),a=e.closest("table"),l=parseInt(e.attr("rowspan"),10),n=x(),r=$(e.get(0),n),o=e.clone().html("<br>");if(1<l){var s=Math.ceil(l/2);1<s?e.attr("rowspan",s):e.removeAttr("rowspan"),1<l-s?o.attr("rowspan",l-s):o.removeAttr("rowspan");for(var i=r.row+s,f=0===r.col?r.col:r.col-1;0<=f&&(n[i][f]==n[i][f-1]||0<i&&n[i][f]==n[i-1][f]);)f--;-1==f?y(a.find("tr").not(a.find("> table tr")).get(i)).prepend(o):y(n[i][f])[0].parentNode&&y(n[i][f])[0].insertAdjacentElement("afterend",o[0])}else{var c,d=y(document.createElement("tr")).append(o);for(c=0;c<n[0].length;c++)if(0===c||n[r.row][c]!=n[r.row][c-1]){var p=y(n[r.row][c]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t[0].parentNode&&t[0].insertAdjacentElement("afterend",d[0])}D(),R.popups.hide("table.edit")}},addHeader:function ce(){var e=ee();if(0<e.length&&0===e.find("th").length){var t,a="<thead><tr>",l=0;for(e.find("tr").first().find("> td").each(function(){var e=y(this);l+=parseInt(e.attr("colspan"),10)||1}),t=0;t<l;t++)a+="<th><br></th>";a+="</tr></thead>",e.prepend(a),h()}},removeHeader:function de(){var e=ee(),t=e.find("thead");if(0<t.length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<Q().length)h();else{R.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(R.selection.setAtEnd(a),R.selection.restore())}},setBackground:t,showInsertPopup:function pe(){var e=R.$tb.find('.fr-command[data-cmd="insertTable"]'),t=R.popups.get("table.insert");if(t||(t=c()),!t.hasClass("fr-active")){R.popups.refresh("table.insert"),R.popups.setContainer("table.insert",R.$tb);var a=R.button.getPosition(e),l=a.left,n=a.top;R.popups.show("table.insert",l,n,e.outerHeight())}},showEditPopup:h,showColorsPopup:s,back:function he(){0<Q().length?h():(R.popups.hide("table.insert"),R.toolbar.showInline())},verticalAlign:function ue(e){R.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function be(e){R.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function ge(e,t,a,l){if(0<t.length){if(R.opts.useClasses||("TABLE"===t.get(0).tagName?function r(e,t){var a=e.childNodes;if(0<a.length)for(var l=0;l<a.length;l++)"TD"===a[l].tagName?"fr-dashed-borders"===t||"fr-highlighted"===t||"fr-thick"===t?C(a[l]):"fr-alternate-rows"===t&&a[l].style.removeProperty("background-color"):r(a[l],t)}(t.get(0),e):C(t.get(0))),!a){var n=Object.keys(l);n.splice(n.indexOf(e),1),t.removeClass(n.join(" "))}t.toggleClass(e)}},selectedTable:ee,selectedCells:Q,customColor:function me(){var e=R.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:I}},ve.DefineIcon("insertTable",{NAME:"table",SVG_KEY:"insertTable"}),ve.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),ve.RegisterCommand("tableInsert",{callback:function(e,t,a){this.table.insert(t,a),this.popups.hide("table.insert")}}),ve.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading",SVG_KEY:"tableHeader"}),ve.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]').hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("th").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),ve.DefineIcon("tableRows",{NAME:"bars",SVG_KEY:"row"}),ve.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ve.COMMANDS.tableRows.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableRows" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},callback:function(e,t){"above"==t||"below"==t?this.table.insertRow(t):this.table.deleteRow()}}),ve.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90",SVG_KEY:"columns"}),ve.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ve.COMMANDS.tableColumns.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableColumns" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){"before"==t||"after"==t?this.table.insertColumn(t):this.table.deleteColumn()}}),ve.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square",SVG_KEY:"cellOptions"}),ve.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ve.COMMANDS.tableCells.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCells" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){"merge"==t?this.table.mergeCells():"vertical-split"==t?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(e,t){1<this.$el.find(".fr-selected-cell").length?(t.find('a[data-param1="vertical-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="horizontal-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="merge"]').removeClass("fr-disabled").attr("aria-disabled",!1)):(t.find('a[data-param1="merge"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="vertical-split"]').removeClass("fr-disabled").attr("aria-disabled",!1),t.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled").attr("aria-disabled",!1))}}),ve.DefineIcon("tableRemove",{NAME:"trash",SVG_KEY:"removeTable"}),ve.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),ve.DefineIcon("tableStyle",{NAME:"paint-brush",SVG_KEY:"tableStyle"}),ve.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableStyle" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(e,t){var a=this.$,l=this.$el.find(".fr-selected-cell").closest("table");l&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=l.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ve.DefineIcon("tableCellBackground",{NAME:"tint",SVG_KEY:"cellBackground"}),ve.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),ve.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),ve.DefineIcon("tableBack",{NAME:"arrow-left",SVG_KEY:"back"}),ve.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(e){0!==this.table.selectedCells().length||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),ve.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"verticalAlignMiddle"}),ve.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ve.COMMANDS.tableCellVerticalAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellVerticalAlign" data-param1="'.concat(a.toLowerCase(),'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(a),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.verticalAlign(t)},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active").attr("aria-selected",!0)}}),ve.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left",SVG_KEY:"alignLeft"}),ve.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),ve.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),ve.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),ve.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),ve.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ve.COMMANDS.tableCellHorizontalAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="tableCellHorizontalAlign" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.icon.create("align-".concat(a)),'<span class="fr-sr-only">').concat(this.language.translate(t[a]),"</span></a></li>"));return e+="</ul>"},callback:function(e,t){this.table.horizontalAlign(t)},refresh:function(e){var t=this.table.selectedCells(),a=this.$;t.length&&e.find("> *").first().replaceWith(this.icon.create("align-".concat(this.helpers.getAlignment(a(t[0])))))},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell").first())+'"]').addClass("fr-active").attr("aria-selected",!0)}}),ve.DefineIcon("tableCellStyle",{NAME:"magic",SVG_KEY:"cellStyle"}),ve.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableCellStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellStyle" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(e,t){var a=this.$,l=this.$el.find(".fr-selected-cell").first();l&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=l.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ve.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),ve.DefineIcon("tableColorRemove",{NAME:"eraser",SVG_KEY:"remove"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.9 (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(U){"use strict";function j(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}U=U&&U.hasOwnProperty("default")?U["default"]:U,Object.assign(U.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),U.PLUGINS.track_changes=function(M){var _=M.$;_.fn.isAfter=function(e){var t=_(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=_(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=_(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var l,i,s=[],I="",w="",L="",T="",d=[],o=[],g=null,P=[],h=!1;function c(){return s.pop()}function f(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(M.opts.trackChangesEnabled){M.selection.restore(),e&&e.composing&&(M.selection.save(),M.selection.ranges()[0].collapse(!1));var r=M.selection.ranges(0).startContainer,i=_(r).parentsUntil(M.$el,"[data-tracking=true]");if(_(r).data("tracking")&&t){M.markers.insert();var s=M.$el.find(".fr-marker");return s[0].previousSibling&&"IMG"===s[0].previousSibling.tagName||M.selection.clear(),void _(s).remove()}if(!i.length||"TD"==r.tagName||a){if(M.selection.isCollapsed()){M.markers.insert();var l=M.$el.find(".fr-marker");if(e&&e.composing&&(l=_(l[1])),!l.length)return;var o="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),c=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!l[0].previousSibling||l[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!l[0].previousSibling.lastChild||l[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==l[0].previousSibling.lastChild.tagName){for(;_(l[0].previousSibling).data("tracking");)l.insertBefore(l.prev());_(l[0].previousSibling).find("[data-tracking=true]").length&&l.insertBefore(_(l[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(_(r).data("tracking")){if(!r.nextSibling)return void(l[0].nextSibling&&"IMG"===l[0].nextSibling.tagName&&l[0].nextSibling.remove());l.insertBefore(r.nextSibling),R(l)}else R(l);var d=l[0]&&l[0].previousSibling?l[0].previousSibling.nodeValue:"",g=d&&d.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(l[0].nextSibling&&"SPAN"!==l[0].nextSibling.tagName&&null===l[0].nextSibling.nodeValue&&l[0].nextSibling.firstChild&&l[0].nextSibling.firstChild.before(l[0]),g=(d=l[0].nextSibling?l[0].nextSibling.nodeValue:" ")&&d.slice(1)),n&&l[0].nextSibling&&"isPasted"===l[0].nextSibling.id?g=(d=l[0].nextSibling?l[0].nextSibling.textContent:" ")&&d.slice(1):t&&l[0].previousSibling&&"isPasted"===l[0].previousSibling.id&&(g=(d=l[0].previousSibling?l[0].previousSibling.textContent:" ")&&d.slice(0,-(e.selectionLength?e.selectionLength:1)));var h,f=_('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,"></span>")),p=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?p.addClass("fr-track-hide-mobile"):p.addClass("fr-track-hide"));var u=!1,k=!1;if(t)try{var m=l[0]&&l[0].previousSibling;if(l[0]&&l[0].previousElementSibling&&"I"===l[0].previousElementSibling.tagName&&!d&&(h=l[0].previousElementSibling),m&&3===m.nodeType&&"SPAN"!==m.parentNode.tagName&&m.previousSibling&&"SPAN"===m.previousSibling.tagName&&" "===m.nodeValue?h=m.previousSibling:m&&"SPAN"===m.parentNode.tagName&&0<_(m.parentNode).find(".fr-emoticon").length?(h=m.parentNode,u=!0):m&&("SPAN"===m.tagName&&"isPasted"!==m.id||"HR"===m.tagName)?h=m:_(l).parent().prev().is("hr")?(h=_(l).parent().prev().get(0),u=k=!0):m&&"IMG"===m.tagName&&(h=m,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),M.helpers.isMobile()&&l[0]&&!h&&!d&&!g)return;u?(_(l[0].parentNode).after(f),k?_(l).parent().remove():_(l).remove()):l[0]?e.composing?_(l).after(f):_(l).before(f):_(T).before(f)}catch(e){T&&_(T).before(f)}else if(n){var v=l[0].nextSibling;l[0].nextElementSibling&&"I"===l[0].nextElementSibling.tagName&&!l[0].nextSibling.nodeValue?h=l[0].nextElementSibling:v&&3===v.nodeType&&"SPAN"!==v.parentNode.tagName&&v.nextSibling&&"SPAN"===v.nextSibling.tagName&&" "===v.nodeValue?h=v.nextSibling:v&&"SPAN"===v.parentNode.tagName&&0<_(v.parentNode).find(".fr-emoticon").length?(h=v.parentNode,u=!0):v&&"SPAN"===v.tagName&&l[0].nextSibling&&"isPasted"!==l[0].nextSibling.id?h=v:v&&"IMG"===v.tagName&&(h=v,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),u?(_(l[0].parentNode).before(f),_(l).remove()):_(l).after(f)}if(e.composing?P.push({span:f,"delete":p}):(M.helpers.isIOS()&&P.push({"delete":p}),_(f).prepend(p)),!h&&(h=d&&d.replace(g,""),M.helpers.isMobile()&&I&&!e.composing)){var b=M.selection.get().focusNode,C=M.selection.get().focusOffset,S=1;w&&b&&w.isSameNode(b)&&(S=L-C),h=I.replace(/\u00a0/g," ").replace(d.replace(/\u00a0/g," "),"").slice(0,S)}if(h&&(u?(_(p).append(_(_(h).get(0).outerHTML)),M.markers.insert()):_(p).append(h)),h&&0==h.length)return;M.browser.msie&&t&&(_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),t&&(g||""===g)&&l[0].previousSibling?l[0].previousSibling.nodeValue=g:n&&(_(f).append("".concat(U.MARKERS)),l[0].nextSibling.nodeValue=g)}else{var N=U.INVISIBLE_SPACE;if(e&&M.helpers.isMobile()&&((N=l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue.slice(-1):U.INVISIBLE_SPACE)&&l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue=l[0].previousSibling.nodeValue.slice(0,-1):!l[0]||l[0].previousSibling||l[0].nextSibling||N!==U.INVISIBLE_SPACE||(N=M.selection.get().focusNode.nodeValue.slice(L,M.selection.get().focusOffset),M.selection.get().focusNode.nodeValue=M.selection.get().focusNode.nodeValue.slice(M.selection.get().focusOffset))),a){if(l.parent().parent().is("li"))return;var E=_("<p></p>");return void(0<l.closest("p").length&&(l.closest("p").after(E),E.append(l),M.markers.remove(),setTimeout(function(){E.prev().text()!==String.fromCharCode(8203)&&""!==E.prev().text()||E.prev().remove(),M.selection.setAfter(E[0])},1)))}l[0].previousSibling&&"BR"===l[0].previousSibling.tagName&&l[0].previousSibling.remove(),l.replaceWith('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,">").concat(N+U.MARKERS,"</span>"))}M.selection.restore(),M.track_changes.pushChange(o)}else{M.selection.save();var y=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),x=M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0);if(_(y).parent().hasClass("fr-emoticon")&&_(y).parent().before(y),_(y).isAfter(_(x))){var A=y;y=x,x=A}$(y,x,e&&e.deletion),M.selection.restore()}M.helpers.isMobile()&&I&&M.markers.remove()}}}function R(e){if(_(e[0].nextSibling).data("tracking")){for(;_(e[0].nextSibling).data("tracking")&&(!(0<_(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<_(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||_(e[0].previousSibling).data("tracking"));)_(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function $(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!_(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&$(_(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?$(e.firstChild.nextSibling,t,a):$(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;_(e).remove(),$(n,t)}var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(_(e).before(s),M.track_changes.pushChange(r);o&&_(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!_(o).hasClass("fr-marker")&&!_(o).is("[data-track-id]")&&0===_(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&_(o).data("tracking-img","true"),M.node.isBlock(o)&&"HR"!==e.tagName)return $(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,$(o.firstChild,t,a);break}c||(o=o.nextSibling,_(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||$(o,t,a),a?P.push({span:s,"delete":l}):(M.helpers.isIOS()&&P.push({"delete":l}),_(s).prepend(l)),M.browser.msie?_(s).prepend("".concat(U.INVISIBLE_SPACE+U.MARKERS)):_(s).prepend("".concat(U.INVISIBLE_SPACE)),_(s).append("".concat(U.INVISIBLE_SPACE+U.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!M.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(M.node.isBlock(p)?"HR"===p.tagName?$(p.nextSibling,t,a):(M.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&_(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),$(p.firstChild,t,a)):$(p,t,a))}}}}}function p(e){if(M.opts.trackChangesEnabled){M.selection.restore();var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");if(_(t).data("tracking"))return;if(!a.length&&!M.selection.isCollapsed()&&"quote"!=e){M.selection.save(),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0));var n=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)_(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;_(i).after(n)}M.selection.restore()}}}function u(e,t,a){if(e&&!("<br>"===_(e).html()&&_(e).parent().is("td")||(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&u(_(e).parent().next()[0],t,a),_(e).is("br")&&_(e).parent().length&&_(e).parent().is("td")&&0===_(e).parent().text().length))){for(a||(a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),M.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?u(e.firstChild.nextSibling,t,a):u(e.firstChild,t,a),!1;var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(_(e).before(r);s&&_(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!_(s).hasClass("fr-marker")&&0===_(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(M.node.isBlock(s)&&"HR"!==e.tagName)return u(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,u(s.firstChild,t,a);break}l||(s=s.nextSibling,_(i).append(o.cloneNode(!0)),_(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||u(s,t,a),_(s).hasClass("fr-marker")&&_(r).append(s),_(r).prepend(i),_(r).prepend("".concat(U.INVISIBLE_SPACE)),_(r).append("".concat(U.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!M.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(M.node.isBlock(h)?"HR"===h.tagName?u(h.nextSibling,t,a):u(h.firstChild,t,a):u(h,t,a))}}}}function k(e,t,a){var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function m(){if(M.events.trigger("image.hideResizer"),M.events.trigger("video.hideResizer"),M.html.cleanEmptyTags(!0),M.helpers.isMobile())for(var e=M.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=_(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){M.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=c();if(e){var t,a=M.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=_(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=_(a).data("tracking-deleted")?_(a):_(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):(M.selection.save(),0<_(s).find("IFRAME").length?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,M.selection.restore())}}t&&t.remove()}m()}function a(){var e=c();if(e){var t=M.$el.find("[data-track-id=".concat(e,"]"));if(t.length){M.selection.save();for(var a=t.length-1;0<=a;a--){var n=_(t).data("tracking-deleted")?_(t):_(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<_(t).find("IFRAME").length)_(t).removeData("tracking"),_(t).removeData("track-id"),_(t).removeClass("fr-highlight-change"),_(t).removeClass("fr-tracking-deleted"),_(t).removeData("tracking-deleted"),_(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(_(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}M.selection.restore()}}m()}return M.events.on("keydown",function(e){var t,a;if(!M.opts.trackChangesEnabled)return!0;if(l=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,M.helpers.isAndroid()){var n,r,i=M.selection.get();I=null==i?void 0:null===(n=i.focusNode)||void 0===n?void 0:n.nodeValue,w=null==i?void 0:i.focusNode,T=null===(r=w)||void 0===r?void 0:r.nextSibling,L=null==i?void 0:i.focusOffset}else if(function s(e){return(!M.keys.ctrlKey(e)||e.which!==U.KEYCODE.Z&&e.which!==U.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!M.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(M.keys.ctrlKey(e)&&"a"===e.key||M.keys.ctrlKey(e)&&"s"===e.key)return;f(e)}else p()},!0),M.events.on("keyup",function(e){if(!M.opts.trackChangesEnabled)return!0;var t,a;if(M.helpers.isMobile())if(i=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,h){for(var n=0;n<P.length;n++)M.opts.showChangesEnabled&&_(P[n].span).empty(),_(P[n].span).prepend(P[n]["delete"]);h=!(P=[])}else if(M.helpers.isIOS()){for(var r=0;r<P.length;r++)i&&1===i.length&&l&&1==l.length?(_(P[r]["delete"]).attr("contenteditable","true"),_(P[r]["delete"]).addClass("fr-ios-mobile-disable-select")):_(P[r]["delete"]).attr("contenteditable","false");P=[]}else{if(46===e.keyCode)return!0;f(e)}},!0),M.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!M.opts.trackChangesEnabled)return!0;if(M.helpers.isAndroid()){var n=M.selection.get(),r=M.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=_(i).parentsUntil(M.$el,"[data-tracking=true]"),o=_(s).parentsUntil(M.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return h=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||M.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c,d;if(h=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(d=c.item(0))&&void 0!==d&&d.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,f(e)}}},!0),M.events.on("paste.before",function(e){M.opts.trackChangesEnabled&&M.helpers.isMobile()&&f(e)},!0),M.events.on("paste.after",function(e){if(M.opts.trackChangesEnabled){M.markers.insert();for(var t=M.$el.find(".fr-marker"),a=t.parent().data("tracking")?t.parent():t.parent().find("[data-tracking=true]"),n=a.children().eq(0).is("ul"),r=t.next();r.is("br");)(r=r.next()).prev().remove(),r.next().is("br")&&r.next().remove();if(r.is("ul")){var i=r.find("li");i.find("[data-tracking=true]").addClass("fr-highlight-change");var s=i[0].innerHTML;if(i.html(""),i.insertAfter(t.closest("li")),0==r.parent().find("[data-tracking=true]").length)return void i.append(s);if(r.remove(),a.data("tracking")){var l=a[0].innerHTML;0<l.trim().length&&a.parent().append(l),i.append(a),a.html(s)}else if(!n)return a.insertBefore(a.closest("ul")),void a.next().remove();M.markers.remove(),i.next().length&&i.next().is("li")&&""==i.next().text().trim()&&i.next().remove();var o=i.prev().children().eq(0);o.is("br")&&o.remove()}}},!0),M.events.on("image.inserted",function(e){M.helpers.isMobile()&&M.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),M.events.on("image.removed",function(e){if(M.helpers.isMobile()&&M.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");M.markers.insert();var n=M.$el.find(".fr-marker"),r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),_(t).data("tracking")||a.length?(_(n).replaceWith(l),_(l).append(e),M.markers.remove()):(_(n).replaceWith(s),_(s).prepend(l),_(l).append(e),M.markers.remove(),M.track_changes.pushChange(r))}}),M.events.on("commands.before",function(t){if(!M.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)p(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){M.selection.save();for(var a=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;_(s).append(l),_(i).append(s),_(a.parentNode).after(_("<p></p>")),_(a.parentNode.nextSibling).append(i),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),_(a.parentNode.nextSibling).after(_("<p></p>")),_(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),M.track_changes.pushChange(r),M.selection.restore()}}else{if(U.COMMANDS[t]&&(U.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===U.COMMANDS[t].type||U.COMMANDS[t].more_btn||U.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t)return void(M.opts.trackChangesEnabled&&function(){g=M.selection.blocks();for(var a=[],n=0,e=0;e<g.length;e++){n=e<n?n:e;var t=_(g[e]);if(t.is("li"))t.siblings("li").each(function(e,t){_(t).find("li").length&&(a.push({index:n,item:t}),n+=1)});d[e]=_("<span>".concat(t.get(0).innerHTML,"</span>"))}for(var r=0,i=a;r<i.length;r++){var s=i[r],l=s.index,o=s.item,c=_(_(o).get(0).outerHTML);c.find("ul").remove(),c.find("ol").remove(),d=[].concat(j(d.slice(0,l+1)),[_("<span>".concat(c.get(0).innerHTML,"</span>"))],j(d.slice(l+1))),g=[].concat(j(g.slice(0,l+1)),[o],j(g.slice(l+1)))}}());f()}},!0),M.events.on("commands.after",function(e){if(!M.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=M.$el.find("[data-tracking=true]");s.splice(0,s.length);for(var t=0;t<e.length;t++){var a=_(e.get(t)).data("track-id");s[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&M.opts.trackChangesEnabled){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length);for(var a in g){var n=_(g[a]);d[a]&&(k(n,d[a],t),d[a]=null,o[a]=null)}M.track_changes.pushChange(t),d=[],g=null}},!0),M.events.on("quickInsert.commands.before",function(e){M.opts.trackChangesEnabled&&f(e)}),{toggleTracking:function n(){M.opts.trackChangesEnabled&&-1<M.html.get(!0,!0).indexOf("data-tracking")||M.opts.trackChangesEnabled&&0<M.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(M.commands.moreTrackChanges(),M.opts.trackChangesEnabled=!M.opts.trackChangesEnabled,M.opts.trackChangesEnabled||(M.opts.showChangesEnabled=!1))},pushChange:function r(e){s.push(e)},insertChangeAt:function v(e,t){s=[].concat(j(s.slice(0,e)),[t],j(s.slice(e)))},popChange:c,getPendingChanges:function b(){return s},showChanges:function C(){if(M.opts.showChangesEnabled=!M.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(_(e.get(a)).removeClass("fr-track-hide"),_(e.get(a)).removeClass("fr-track-hide-mobile")):M.helpers.isMobile()?_(e.get(a)).addClass("fr-track-hide-mobile"):_(e.get(a)).addClass("fr-track-hide")}(M.$el.find(".fr-tracking-deleted"),M.opts.showChangesEnabled),M.opts.showChangesEnabled)for(var e=M.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)_(e.get(t)).addClass("fr-highlight-change");else for(var a=M.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)_(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function S(){for(;0!=M.track_changes.getPendingChanges().length;)t();s=[],e(),M.$el.find("li").each(function(){!_(this).children()[0]||"OL"!==_(this).children()[0].tagName&&"UL"!==_(this).children()[0].tagName||e()})},rejectAllChanges:function N(){for(;0!=M.track_changes.getPendingChanges().length;)a();s=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function E(e){var t=M.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!s.length),e.toggleClass("fr-active",s.length).attr("aria-pressed",s.length),0<!t.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var a=M.$tb.find('.fr-command[data-cmd="markdown"]');a&&M.opts.trackChangesEnabled?a.addClass("fr-disabled"):a&&!_(".fr-active.fr-popup").length&&a.removeClass("fr-disabled");var n=M.$tb.find('.fr-command[data-cmd="showChanges"]');n&&M.opts.trackChangesEnabled&&n.removeClass("fr-disabled")},replaceSpecialItem:function y(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),$(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=_(this),n=a[0].innerText;_(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),M.track_changes.pushChange(r)}},addQuote:function O(e){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(t)},removeQuote:function V(e,t){if(!(0<t)){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(a)}},wrapInTracking:function D(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),M.track_changes.pushChange(a),r},wrapInDelete:function B(e){var t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||(M.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function H(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),M.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function K(e){var t=M.$el.find(".fr-highlight-change");_(t)[0].style.display="block",_(t)[0].innerHTML=e},pasteInEdior:function G(e){var t=M.$el.find(".fr-marker");_(t)[0].outerHTML=e,M.markers.remove()}}},U.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),U.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),U.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),U.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),U.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),U.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),U.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),U.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),U.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.track_changes.refresh(e)}}),U.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.track_changes.refresh(e)}}),U.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.track_changes.refresh(e)}}),U.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.track_changes.refresh(e)}})});
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(U){"use strict";function j(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}U=U&&U.hasOwnProperty("default")?U["default"]:U,Object.assign(U.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),U.PLUGINS.track_changes=function(M){var _=M.$;_.fn.isAfter=function(e){var t=_(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=_(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=_(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var l,i,s=[],I="",w="",L="",T="",d=[],o=[],g=null,P=[],h=!1;function c(){return s.pop()}function f(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(M.opts.trackChangesEnabled){M.selection.restore(),e&&e.composing&&(M.selection.save(),M.selection.ranges()[0].collapse(!1));var r=M.selection.ranges(0).startContainer,i=_(r).parentsUntil(M.$el,"[data-tracking=true]");if(_(r).data("tracking")&&t){M.markers.insert();var s=M.$el.find(".fr-marker");return s[0].previousSibling&&"IMG"===s[0].previousSibling.tagName||M.selection.clear(),void _(s).remove()}if(!i.length||"TD"==r.tagName||a){if(M.selection.isCollapsed()){M.markers.insert();var l=M.$el.find(".fr-marker");if(e&&e.composing&&(l=_(l[1])),!l.length)return;var o="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),c=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!l[0].previousSibling||l[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!l[0].previousSibling.lastChild||l[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==l[0].previousSibling.lastChild.tagName){for(;_(l[0].previousSibling).data("tracking");)l.insertBefore(l.prev());_(l[0].previousSibling).find("[data-tracking=true]").length&&l.insertBefore(_(l[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(_(r).data("tracking")){if(!r.nextSibling)return void(l[0].nextSibling&&"IMG"===l[0].nextSibling.tagName&&l[0].nextSibling.remove());l.insertBefore(r.nextSibling),R(l)}else R(l);var d=l[0]&&l[0].previousSibling?l[0].previousSibling.nodeValue:"",g=d&&d.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(l[0].nextSibling&&"SPAN"!==l[0].nextSibling.tagName&&null===l[0].nextSibling.nodeValue&&l[0].nextSibling.firstChild&&l[0].nextSibling.firstChild.before(l[0]),g=(d=l[0].nextSibling?l[0].nextSibling.nodeValue:" ")&&d.slice(1)),n&&l[0].nextSibling&&"isPasted"===l[0].nextSibling.id?g=(d=l[0].nextSibling?l[0].nextSibling.textContent:" ")&&d.slice(1):t&&l[0].previousSibling&&"isPasted"===l[0].previousSibling.id&&(g=(d=l[0].previousSibling?l[0].previousSibling.textContent:" ")&&d.slice(0,-(e.selectionLength?e.selectionLength:1)));var h,f=_('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,"></span>")),p=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?p.addClass("fr-track-hide-mobile"):p.addClass("fr-track-hide"));var u=!1,k=!1;if(t)try{var m=l[0]&&l[0].previousSibling;if(l[0]&&l[0].previousElementSibling&&"I"===l[0].previousElementSibling.tagName&&!d&&(h=l[0].previousElementSibling),m&&3===m.nodeType&&"SPAN"!==m.parentNode.tagName&&m.previousSibling&&"SPAN"===m.previousSibling.tagName&&" "===m.nodeValue?h=m.previousSibling:m&&"SPAN"===m.parentNode.tagName&&0<_(m.parentNode).find(".fr-emoticon").length?(h=m.parentNode,u=!0):m&&("SPAN"===m.tagName&&"isPasted"!==m.id||"HR"===m.tagName)?h=m:_(l).parent().prev().is("hr")?(h=_(l).parent().prev().get(0),u=k=!0):m&&"IMG"===m.tagName&&(h=m,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),M.helpers.isMobile()&&l[0]&&!h&&!d&&!g)return;u?(_(l[0].parentNode).after(f),k?_(l).parent().remove():_(l).remove()):l[0]?e.composing?_(l).after(f):_(l).before(f):_(T).before(f)}catch(e){T&&_(T).before(f)}else if(n){var b=l[0].nextSibling;l[0].nextElementSibling&&"I"===l[0].nextElementSibling.tagName&&!l[0].nextSibling.nodeValue?h=l[0].nextElementSibling:b&&3===b.nodeType&&"SPAN"!==b.parentNode.tagName&&b.nextSibling&&"SPAN"===b.nextSibling.tagName&&" "===b.nodeValue?h=b.nextSibling:b&&"SPAN"===b.parentNode.tagName&&0<_(b.parentNode).find(".fr-emoticon").length?(h=b.parentNode,u=!0):b&&"SPAN"===b.tagName&&l[0].nextSibling&&"isPasted"!==l[0].nextSibling.id?h=b:b&&"IMG"===b.tagName&&(h=b,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),u?(_(l[0].parentNode).before(f),_(l).remove()):_(l).after(f)}if(e.composing?P.push({span:f,"delete":p}):(M.helpers.isIOS()&&P.push({"delete":p}),_(f).prepend(p)),!h&&(h=d&&d.replace(g,""),M.helpers.isMobile()&&I&&!e.composing)){var v=M.selection.get().focusNode,C=M.selection.get().focusOffset,S=1;w&&v&&w.isSameNode(v)&&(S=L-C),h=I.replace(/\u00a0/g," ").replace(d.replace(/\u00a0/g," "),"").slice(0,S)}if(h&&(u?(_(p).append(_(_(h).get(0).outerHTML)),M.markers.insert()):_(p).append(h)),h&&0==h.length)return;M.browser.msie&&t&&(_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),t&&(g||""===g)&&l[0].previousSibling?l[0].previousSibling.nodeValue=g:n&&(_(f).append("".concat(U.MARKERS)),l[0].nextSibling.nodeValue=g)}else{var N=U.INVISIBLE_SPACE;if(e&&M.helpers.isMobile()&&((N=l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue.slice(-1):U.INVISIBLE_SPACE)&&l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue=l[0].previousSibling.nodeValue.slice(0,-1):!l[0]||l[0].previousSibling||l[0].nextSibling||N!==U.INVISIBLE_SPACE||(N=M.selection.get().focusNode.nodeValue.slice(L,M.selection.get().focusOffset),M.selection.get().focusNode.nodeValue=M.selection.get().focusNode.nodeValue.slice(M.selection.get().focusOffset))),a){if(l.parent().parent().is("li"))return;var E=_("<p></p>");return void(0<l.closest("p").length&&(l.closest("p").after(E),E.append(l),M.markers.remove(),setTimeout(function(){E.prev().text()!==String.fromCharCode(8203)&&""!==E.prev().text()||E.prev().remove(),M.selection.setAfter(E[0])},1)))}l[0].previousSibling&&"BR"===l[0].previousSibling.tagName&&l[0].previousSibling.remove(),l.replaceWith('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,">").concat(N+U.MARKERS,"</span>"))}M.selection.restore(),M.track_changes.pushChange(o)}else{M.selection.save();var y=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),x=M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0);if(_(y).parent().hasClass("fr-emoticon")&&_(y).parent().before(y),_(y).isAfter(_(x))){var A=y;y=x,x=A}$(y,x,e&&e.deletion),M.selection.restore()}M.helpers.isMobile()&&I&&M.markers.remove()}}}function R(e){if(_(e[0].nextSibling).data("tracking")){for(;_(e[0].nextSibling).data("tracking")&&(!(0<_(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<_(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||_(e[0].previousSibling).data("tracking"));)_(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function $(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!_(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&$(_(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?$(e.firstChild.nextSibling,t,a):$(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;_(e).remove(),$(n,t)}var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(_(e).before(s),M.track_changes.pushChange(r);o&&_(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!_(o).hasClass("fr-marker")&&!_(o).is("[data-track-id]")&&0===_(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&_(o).data("tracking-img","true"),M.node.isBlock(o)&&"HR"!==e.tagName)return $(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,$(o.firstChild,t,a);break}c||(o=o.nextSibling,_(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||$(o,t,a),a?P.push({span:s,"delete":l}):(M.helpers.isIOS()&&P.push({"delete":l}),_(s).prepend(l)),M.browser.msie?_(s).prepend("".concat(U.INVISIBLE_SPACE+U.MARKERS)):_(s).prepend("".concat(U.INVISIBLE_SPACE)),_(s).append("".concat(U.INVISIBLE_SPACE+U.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!M.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(M.node.isBlock(p)?"HR"===p.tagName?$(p.nextSibling,t,a):(M.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&_(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),$(p.firstChild,t,a)):$(p,t,a))}}}}}function p(e){if(M.opts.trackChangesEnabled){M.selection.restore();var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");if(_(t).data("tracking"))return;if(!a.length&&!M.selection.isCollapsed()&&"quote"!=e){M.selection.save(),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0));var n=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)_(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;_(i).after(n)}M.selection.restore()}}}function u(e,t,a){if(e&&!("<br>"===_(e).html()&&_(e).parent().is("td")||(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&u(_(e).parent().next()[0],t,a),_(e).is("br")&&_(e).parent().length&&_(e).parent().is("td")&&0===_(e).parent().text().length))){for(a||(a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),M.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?u(e.firstChild.nextSibling,t,a):u(e.firstChild,t,a),!1;var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(_(e).before(r);s&&_(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!_(s).hasClass("fr-marker")&&0===_(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(M.node.isBlock(s)&&"HR"!==e.tagName)return u(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,u(s.firstChild,t,a);break}l||(s=s.nextSibling,_(i).append(o.cloneNode(!0)),_(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||u(s,t,a),_(s).hasClass("fr-marker")&&_(r).append(s),_(r).prepend(i),_(r).prepend("".concat(U.INVISIBLE_SPACE)),_(r).append("".concat(U.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!M.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(M.node.isBlock(h)?"HR"===h.tagName?u(h.nextSibling,t,a):u(h.firstChild,t,a):u(h,t,a))}}}}function k(e,t,a){var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function m(){if(M.events.trigger("image.hideResizer"),M.events.trigger("video.hideResizer"),M.html.cleanEmptyTags(!0),M.helpers.isMobile())for(var e=M.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=_(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){M.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=c();if(e){var t,a=M.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=_(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=_(a).data("tracking-deleted")?_(a):_(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):(M.selection.save(),0<_(s).find("IFRAME").length?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,M.selection.restore())}}t&&t.remove()}m()}function a(){var e=c();if(e){var t=M.$el.find("[data-track-id=".concat(e,"]"));if(t.length){M.selection.save();for(var a=t.length-1;0<=a;a--){var n=_(t).data("tracking-deleted")?_(t):_(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<_(t).find("IFRAME").length)_(t).removeData("tracking"),_(t).removeData("track-id"),_(t).removeClass("fr-highlight-change"),_(t).removeClass("fr-tracking-deleted"),_(t).removeData("tracking-deleted"),_(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(_(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}M.selection.restore()}}m()}return M.events.on("keydown",function(e){var t,a;if(!M.opts.trackChangesEnabled)return!0;if(l=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,M.helpers.isAndroid()){var n,r,i=M.selection.get();I=null==i?void 0:null===(n=i.focusNode)||void 0===n?void 0:n.nodeValue,w=null==i?void 0:i.focusNode,T=null===(r=w)||void 0===r?void 0:r.nextSibling,L=null==i?void 0:i.focusOffset}else if(function s(e){return(!M.keys.ctrlKey(e)||e.which!==U.KEYCODE.Z&&e.which!==U.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!M.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(M.keys.ctrlKey(e)&&"a"===e.key||M.keys.ctrlKey(e)&&"s"===e.key)return;f(e)}else p()},!0),M.events.on("keyup",function(e){if(!M.opts.trackChangesEnabled)return!0;var t,a;if(M.helpers.isMobile())if(i=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,h){for(var n=0;n<P.length;n++)M.opts.showChangesEnabled&&_(P[n].span).empty(),_(P[n].span).prepend(P[n]["delete"]);h=!(P=[])}else if(M.helpers.isIOS()){for(var r=0;r<P.length;r++)i&&1===i.length&&l&&1==l.length?(_(P[r]["delete"]).attr("contenteditable","true"),_(P[r]["delete"]).addClass("fr-ios-mobile-disable-select")):_(P[r]["delete"]).attr("contenteditable","false");P=[]}else{if(46===e.keyCode)return!0;f(e)}},!0),M.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!M.opts.trackChangesEnabled)return!0;if(M.helpers.isAndroid()){var n=M.selection.get(),r=M.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=_(i).parentsUntil(M.$el,"[data-tracking=true]"),o=_(s).parentsUntil(M.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return h=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||M.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c,d;if(h=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(d=c.item(0))&&void 0!==d&&d.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,f(e)}}},!0),M.events.on("paste.before",function(e){M.opts.trackChangesEnabled&&M.helpers.isMobile()&&f(e)},!0),M.events.on("paste.after",function(e){if(M.opts.trackChangesEnabled){M.markers.insert();for(var t=M.$el.find(".fr-marker"),a=t.parent().data("tracking")?t.parent():t.parent().find("[data-tracking=true]"),n=a.children().eq(0).is("ul"),r=t.next();r.is("br");)(r=r.next()).prev().remove(),r.next().is("br")&&r.next().remove();if(r.is("ul")){var i=r.find("li");i.find("[data-tracking=true]").addClass("fr-highlight-change");var s=i[0].innerHTML;if(i.html(""),i.insertAfter(t.closest("li")),0==r.parent().find("[data-tracking=true]").length)return void i.append(s);if(r.remove(),a.data("tracking")){var l=a[0].innerHTML;0<l.trim().length&&a.parent().append(l),i.append(a),a.html(s)}else if(!n)return a.insertBefore(a.closest("ul")),void a.next().remove();M.markers.remove(),i.next().length&&i.next().is("li")&&""==i.next().text().trim()&&i.next().remove();var o=i.prev().children().eq(0);o.is("br")&&o.remove()}}},!0),M.events.on("image.inserted",function(e){M.helpers.isMobile()&&M.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),M.events.on("image.removed",function(e){if(M.helpers.isMobile()&&M.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");M.markers.insert();var n=M.$el.find(".fr-marker"),r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),_(t).data("tracking")||a.length?(_(n).replaceWith(l),_(l).append(e),M.markers.remove()):(_(n).replaceWith(s),_(s).prepend(l),_(l).append(e),M.markers.remove(),M.track_changes.pushChange(r))}}),M.events.on("commands.before",function(t){if(!M.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)p(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){M.selection.save();for(var a=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;_(s).append(l),_(i).append(s),_(a.parentNode).after(_("<p></p>")),_(a.parentNode.nextSibling).append(i),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),_(a.parentNode.nextSibling).after(_("<p></p>")),_(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),M.track_changes.pushChange(r),M.selection.restore()}}else{if(U.COMMANDS[t]&&(U.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===U.COMMANDS[t].type||U.COMMANDS[t].more_btn||U.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t)return void(M.opts.trackChangesEnabled&&function(){g=M.selection.blocks();for(var a=[],n=0,e=0;e<g.length;e++){n=e<n?n:e;var t=_(g[e]);if(t.is("li"))t.siblings("li").each(function(e,t){_(t).find("li").length&&(a.push({index:n,item:t}),n+=1)});d[e]=_("<span>".concat(t.get(0).innerHTML,"</span>"))}for(var r=0,i=a;r<i.length;r++){var s=i[r],l=s.index,o=s.item,c=_(_(o).get(0).outerHTML);c.find("ul").remove(),c.find("ol").remove(),d=[].concat(j(d.slice(0,l+1)),[_("<span>".concat(c.get(0).innerHTML,"</span>"))],j(d.slice(l+1))),g=[].concat(j(g.slice(0,l+1)),[o],j(g.slice(l+1)))}}());f()}},!0),M.events.on("commands.after",function(e){if(!M.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=M.$el.find("[data-tracking=true]");s.splice(0,s.length);for(var t=0;t<e.length;t++){var a=_(e.get(t)).data("track-id");s[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&M.opts.trackChangesEnabled){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length);for(var a in g){var n=_(g[a]);d[a]&&(k(n,d[a],t),d[a]=null,o[a]=null)}M.track_changes.pushChange(t),d=[],g=null}},!0),M.events.on("quickInsert.commands.before",function(e){M.opts.trackChangesEnabled&&f(e)}),{toggleTracking:function n(){M.opts.trackChangesEnabled&&-1<M.html.get(!0,!0).indexOf("data-tracking")||M.opts.trackChangesEnabled&&0<M.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(M.commands.moreTrackChanges(),M.opts.trackChangesEnabled=!M.opts.trackChangesEnabled,M.opts.trackChangesEnabled||(M.opts.showChangesEnabled=!1))},pushChange:function r(e){s.push(e)},insertChangeAt:function b(e,t){s=[].concat(j(s.slice(0,e)),[t],j(s.slice(e)))},popChange:c,getPendingChanges:function v(){return s},showChanges:function C(){if(M.opts.showChangesEnabled=!M.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(_(e.get(a)).removeClass("fr-track-hide"),_(e.get(a)).removeClass("fr-track-hide-mobile")):M.helpers.isMobile()?_(e.get(a)).addClass("fr-track-hide-mobile"):_(e.get(a)).addClass("fr-track-hide")}(M.$el.find(".fr-tracking-deleted"),M.opts.showChangesEnabled),M.opts.showChangesEnabled)for(var e=M.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)_(e.get(t)).addClass("fr-highlight-change");else for(var a=M.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)_(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function S(){for(;0!=M.track_changes.getPendingChanges().length;)t();s=[],e(),M.$el.find("li").each(function(){!_(this).children()[0]||"OL"!==_(this).children()[0].tagName&&"UL"!==_(this).children()[0].tagName||e()})},rejectAllChanges:function N(){for(;0!=M.track_changes.getPendingChanges().length;)a();s=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function E(e){var t=M.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!s.length),e.toggleClass("fr-active",s.length).attr("aria-pressed",s.length),0<!t.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var a=M.$tb.find('.fr-command[data-cmd="markdown"]');a&&M.opts.trackChangesEnabled?a.addClass("fr-disabled"):a&&!_(".fr-active.fr-popup").length&&a.removeClass("fr-disabled");var n=M.$tb.find('.fr-command[data-cmd="showChanges"]');n&&M.opts.trackChangesEnabled&&n.removeClass("fr-disabled")},replaceSpecialItem:function y(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),$(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=_(this),n=a[0].innerText;_(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),M.track_changes.pushChange(r)}},addQuote:function O(e){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(t)},removeQuote:function V(e,t){if(!(0<t)){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(a)}},wrapInTracking:function D(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),M.track_changes.pushChange(a),r},wrapInDelete:function B(e){var t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||(M.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function H(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),M.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function K(e){var t=M.$el.find(".fr-highlight-change");_(t)[0].style.display="block",_(t)[0].innerHTML=e},pasteInEdior:function G(e){var t=M.$el.find(".fr-marker");_(t)[0].outerHTML=e,M.markers.remove()}}},U.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),U.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),U.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),U.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),U.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),U.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),U.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),U.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),U.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}})});