wysiwyg-rails 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +2 -2
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +2 -2
  4. data/app/assets/javascripts/languages/ar.js +3 -3
  5. data/app/assets/javascripts/languages/bs.js +3 -3
  6. data/app/assets/javascripts/languages/cs.js +3 -3
  7. data/app/assets/javascripts/languages/da.js +3 -3
  8. data/app/assets/javascripts/languages/de.js +3 -3
  9. data/app/assets/javascripts/languages/el.js +3 -3
  10. data/app/assets/javascripts/languages/en_ca.js +3 -3
  11. data/app/assets/javascripts/languages/en_gb.js +3 -3
  12. data/app/assets/javascripts/languages/es.js +3 -3
  13. data/app/assets/javascripts/languages/et.js +3 -3
  14. data/app/assets/javascripts/languages/fa.js +3 -3
  15. data/app/assets/javascripts/languages/fi.js +3 -3
  16. data/app/assets/javascripts/languages/fr.js +2 -2
  17. data/app/assets/javascripts/languages/he.js +3 -3
  18. data/app/assets/javascripts/languages/hr.js +3 -3
  19. data/app/assets/javascripts/languages/hu.js +3 -3
  20. data/app/assets/javascripts/languages/id.js +3 -3
  21. data/app/assets/javascripts/languages/it.js +3 -3
  22. data/app/assets/javascripts/languages/ja.js +1 -1
  23. data/app/assets/javascripts/languages/ko.js +3 -3
  24. data/app/assets/javascripts/languages/ku.js +3 -3
  25. data/app/assets/javascripts/languages/me.js +3 -3
  26. data/app/assets/javascripts/languages/nb.js +3 -3
  27. data/app/assets/javascripts/languages/nl.js +3 -3
  28. data/app/assets/javascripts/languages/pl.js +3 -3
  29. data/app/assets/javascripts/languages/pt_br.js +3 -3
  30. data/app/assets/javascripts/languages/pt_pt.js +3 -3
  31. data/app/assets/javascripts/languages/ro.js +3 -3
  32. data/app/assets/javascripts/languages/ru.js +3 -3
  33. data/app/assets/javascripts/languages/sk.js +3 -3
  34. data/app/assets/javascripts/languages/sr.js +3 -3
  35. data/app/assets/javascripts/languages/sv.js +3 -3
  36. data/app/assets/javascripts/languages/th.js +3 -3
  37. data/app/assets/javascripts/languages/tr.js +3 -3
  38. data/app/assets/javascripts/languages/uk.js +3 -3
  39. data/app/assets/javascripts/languages/vi.js +1 -1
  40. data/app/assets/javascripts/languages/zh_cn.js +3 -3
  41. data/app/assets/javascripts/languages/zh_tw.js +3 -3
  42. data/app/assets/javascripts/plugins.pkgd.min.js +2 -2
  43. data/app/assets/javascripts/plugins/align.min.js +1 -1
  44. data/app/assets/javascripts/plugins/char_counter.min.js +1 -1
  45. data/app/assets/javascripts/plugins/code_beautifier.min.js +2 -2
  46. data/app/assets/javascripts/plugins/code_view.min.js +1 -1
  47. data/app/assets/javascripts/plugins/colors.min.js +1 -1
  48. data/app/assets/javascripts/plugins/draggable.min.js +1 -1
  49. data/app/assets/javascripts/plugins/edit_in_popup.min.js +1 -1
  50. data/app/assets/javascripts/plugins/emoticons.min.js +1 -1
  51. data/app/assets/javascripts/plugins/entities.min.js +1 -1
  52. data/app/assets/javascripts/plugins/file.min.js +1 -1
  53. data/app/assets/javascripts/plugins/font_family.min.js +1 -1
  54. data/app/assets/javascripts/plugins/font_size.min.js +1 -1
  55. data/app/assets/javascripts/plugins/forms.min.js +1 -1
  56. data/app/assets/javascripts/plugins/fullscreen.min.js +1 -1
  57. data/app/assets/javascripts/plugins/help.min.js +1 -1
  58. data/app/assets/javascripts/plugins/image.min.js +2 -2
  59. data/app/assets/javascripts/plugins/image_manager.min.js +1 -1
  60. data/app/assets/javascripts/plugins/inline_class.min.js +1 -1
  61. data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
  62. data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
  63. data/app/assets/javascripts/plugins/line_height.min.js +1 -1
  64. data/app/assets/javascripts/plugins/link.min.js +1 -1
  65. data/app/assets/javascripts/plugins/lists.min.js +1 -1
  66. data/app/assets/javascripts/plugins/paragraph_format.min.js +1 -1
  67. data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
  68. data/app/assets/javascripts/plugins/print.min.js +1 -1
  69. data/app/assets/javascripts/plugins/quick_insert.min.js +1 -1
  70. data/app/assets/javascripts/plugins/quote.min.js +1 -1
  71. data/app/assets/javascripts/plugins/save.min.js +1 -1
  72. data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
  73. data/app/assets/javascripts/plugins/table.min.js +1 -1
  74. data/app/assets/javascripts/plugins/url.min.js +1 -1
  75. data/app/assets/javascripts/plugins/video.min.js +1 -1
  76. data/app/assets/javascripts/plugins/word_paste.min.js +1 -1
  77. data/app/assets/javascripts/third_party/embedly.min.js +1 -1
  78. data/app/assets/javascripts/third_party/font_awesome.min.js +1 -1
  79. data/app/assets/javascripts/third_party/image_tui.min.js +1 -1
  80. data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
  81. data/app/assets/stylesheets/froala_editor.css +1351 -1350
  82. data/app/assets/stylesheets/froala_editor.min.css +2 -2
  83. data/app/assets/stylesheets/froala_editor.pkgd.css +3090 -3088
  84. data/app/assets/stylesheets/froala_editor.pkgd.min.css +2 -2
  85. data/app/assets/stylesheets/froala_style.css +348 -348
  86. data/app/assets/stylesheets/froala_style.min.css +2 -2
  87. data/app/assets/stylesheets/plugins.pkgd.css +1391 -1390
  88. data/app/assets/stylesheets/plugins.pkgd.min.css +2 -2
  89. data/app/assets/stylesheets/plugins/char_counter.css +44 -44
  90. data/app/assets/stylesheets/plugins/char_counter.min.css +2 -2
  91. data/app/assets/stylesheets/plugins/code_view.css +92 -92
  92. data/app/assets/stylesheets/plugins/code_view.min.css +2 -2
  93. data/app/assets/stylesheets/plugins/colors.css +93 -93
  94. data/app/assets/stylesheets/plugins/colors.min.css +2 -2
  95. data/app/assets/stylesheets/plugins/draggable.css +36 -36
  96. data/app/assets/stylesheets/plugins/draggable.min.css +2 -2
  97. data/app/assets/stylesheets/plugins/emoticons.css +29 -29
  98. data/app/assets/stylesheets/plugins/emoticons.min.css +2 -2
  99. data/app/assets/stylesheets/plugins/file.css +123 -123
  100. data/app/assets/stylesheets/plugins/file.min.css +2 -2
  101. data/app/assets/stylesheets/plugins/fullscreen.css +72 -72
  102. data/app/assets/stylesheets/plugins/fullscreen.min.css +2 -2
  103. data/app/assets/stylesheets/plugins/help.css +40 -40
  104. data/app/assets/stylesheets/plugins/help.min.css +2 -2
  105. data/app/assets/stylesheets/plugins/image.css +206 -205
  106. data/app/assets/stylesheets/plugins/image.min.css +2 -2
  107. data/app/assets/stylesheets/plugins/image_manager.css +231 -231
  108. data/app/assets/stylesheets/plugins/image_manager.min.css +2 -2
  109. data/app/assets/stylesheets/plugins/line_breaker.css +33 -33
  110. data/app/assets/stylesheets/plugins/line_breaker.min.css +2 -2
  111. data/app/assets/stylesheets/plugins/quick_insert.css +67 -67
  112. data/app/assets/stylesheets/plugins/quick_insert.min.css +2 -2
  113. data/app/assets/stylesheets/plugins/special_characters.css +28 -28
  114. data/app/assets/stylesheets/plugins/special_characters.min.css +2 -2
  115. data/app/assets/stylesheets/plugins/table.css +106 -106
  116. data/app/assets/stylesheets/plugins/table.min.css +2 -2
  117. data/app/assets/stylesheets/plugins/video.css +193 -193
  118. data/app/assets/stylesheets/plugins/video.min.css +2 -2
  119. data/app/assets/stylesheets/themes/dark.css +1909 -1907
  120. data/app/assets/stylesheets/themes/dark.min.css +2 -2
  121. data/app/assets/stylesheets/themes/gray.css +1909 -1907
  122. data/app/assets/stylesheets/themes/gray.min.css +2 -2
  123. data/app/assets/stylesheets/themes/royal.css +1909 -1907
  124. data/app/assets/stylesheets/themes/royal.min.css +2 -2
  125. data/app/assets/stylesheets/third_party/embedly.css +56 -56
  126. data/app/assets/stylesheets/third_party/embedly.min.css +2 -2
  127. data/app/assets/stylesheets/third_party/font_awesome.css +28 -28
  128. data/app/assets/stylesheets/third_party/font_awesome.min.css +2 -2
  129. data/app/assets/stylesheets/third_party/image_tui.css +36 -36
  130. data/app/assets/stylesheets/third_party/image_tui.min.css +2 -2
  131. data/app/assets/stylesheets/third_party/spell_checker.css +59 -59
  132. data/app/assets/stylesheets/third_party/spell_checker.min.css +2 -2
  133. data/lib/wysiwyg-rails/version.rb +1 -1
  134. metadata +4 -4
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Polish
15
+ /**
16
+ * Polish
17
17
  */
18
18
  FE.LANGUAGE['pl'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Portuguese spoken in Brazil
15
+ /**
16
+ * Portuguese spoken in Brazil
17
17
  */
18
18
  FE.LANGUAGE['pt_br'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Portuguese spoken in Portugal
15
+ /**
16
+ * Portuguese spoken in Portugal
17
17
  */
18
18
  FE.LANGUAGE['pt_pt'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Romanian
15
+ /**
16
+ * Romanian
17
17
  */
18
18
  FE.LANGUAGE['ro'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Russian
15
+ /**
16
+ * Russian
17
17
  */
18
18
  FE.LANGUAGE['ru'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Slovak
15
+ /**
16
+ * Slovak
17
17
  */
18
18
  FE.LANGUAGE['sk'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Serbian (Latin)
15
+ /**
16
+ * Serbian (Latin)
17
17
  */
18
18
  FE.LANGUAGE['sr'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Swedish
15
+ /**
16
+ * Swedish
17
17
  */
18
18
  FE.LANGUAGE['sv'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Thai
15
+ /**
16
+ * Thai
17
17
  */
18
18
  FE.LANGUAGE['th'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Turkish
15
+ /**
16
+ * Turkish
17
17
  */
18
18
  FE.LANGUAGE['tr'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Ukrainian
15
+ /**
16
+ * Ukrainian
17
17
  */
18
18
  FE.LANGUAGE['uk'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Simplified Chinese spoken in China.
15
+ /**
16
+ * Simplified Chinese spoken in China.
17
17
  */
18
18
  FE.LANGUAGE['zh_cn'] = {
19
19
  translation: {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -12,8 +12,8 @@
12
12
 
13
13
  FE = FE && FE.hasOwnProperty('default') ? FE['default'] : FE;
14
14
 
15
- /**
16
- * Traditional Chinese spoken in Taiwan.
15
+ /**
16
+ * Traditional Chinese spoken in Taiwan.
17
17
  */
18
18
  FE.LANGUAGE['zh_tw'] = {
19
19
  translation: {
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 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(Be){"use strict";function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if((Be=Be&&Be.hasOwnProperty("default")?Be["default"]:Be).PLUGINS.align=function(r){var i=r.$;return{apply:function s(e){var t=r.selection.element();if(i(t).parents(".fr-img-caption").length)i(t).css("text-align",e);else{r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();for(var a=r.selection.blocks(),n=0;n<a.length;n++)i(a[n]).css("text-align",e).removeClass("fr-temp-div"),""===i(a[n]).attr("class")&&i(a[n]).removeAttr("class"),""===i(a[n]).attr("style")&&i(a[n]).removeAttr("style");r.selection.save(),r.html.unwrap(),r.selection.restore()}},refresh:function n(e){var t=r.selection.blocks();if(t.length){var a=r.helpers.getAlignment(i(t[0]));e.find("> *").first().replaceWith(r.icon.create("align-"+a))}},refreshOnShow:function o(e,t){var a=r.selection.blocks();if(a.length){var n=r.helpers.getAlignment(i(a[0]));t.find('a.fr-command[data-param1="'+n+'"]').addClass("fr-active").attr("aria-selected",!0)}},refreshForToolbar:function l(e){var t=r.selection.blocks();if(t.length){var a=r.helpers.getAlignment(i(t[0]));"align"+(a=a.charAt(0).toUpperCase()+a.slice(1))===e.attr("data-cmd")&&e.addClass("fr-active")}}}},Be.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),Be.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.RegisterCommand("align",{type:"dropdown",title:"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=Be.COMMANDS.align.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="align" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,t){this.align.refreshOnShow(e,t)},plugin:"align"}),Be.RegisterCommand("alignLeft",{type:"button",icon:"align-left",title:"Align Left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Be.RegisterCommand("alignRight",{type:"button",icon:"align-right",title:"Align Right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Be.RegisterCommand("alignCenter",{type:"button",icon:"align-center",title:"Align Center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Be.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",title:"Align Justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Object.assign(Be.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),Be.PLUGINS.charCounter=function(a){var n,t=a.$;function r(){return(a.el.textContent||"").replace(/\u200B/g,"").length}function e(e){if(a.opts.charCounterMax<0)return!0;if(r()<a.opts.charCounterMax)return!0;var t=e.which;return!(!a.keys.ctrlKey(e)&&a.keys.isCharacter(t)||t===Be.KEYCODE.IME)||(e.preventDefault(),e.stopPropagation(),a.events.trigger("charCounter.exceeded"),!1)}function i(e){return a.opts.charCounterMax<0?e:t("<div>").html(e).text().length+r()<=a.opts.charCounterMax?e:(a.events.trigger("charCounter.exceeded"),"")}function s(){if(a.opts.charCounterCount){var e=r()+(0<a.opts.charCounterMax?"/"+a.opts.charCounterMax:"");n.text("".concat(a.language.translate("Characters")," : ").concat(e)),a.opts.toolbarBottom&&n.css("margin-bottom",a.$tb.outerHeight(!0));var t=a.$wp.get(0).offsetWidth-a.$wp.get(0).clientWidth;0<=t&&("rtl"==a.opts.direction?n.css("margin-left",t):n.css("margin-right",t))}}return{_init:function o(){return!!a.$wp&&!!a.opts.charCounterCount&&((n=t(document.createElement("span")).attr("class","fr-counter")).css("bottom",a.$wp.css("border-bottom-width")),a.$second_tb&&a.$second_tb.append(n),a.events.on("keydown",e,!0),a.events.on("paste.afterCleanup",i),a.events.on("keyup contentChanged input",function(){a.events.trigger("charCounter.update")}),a.events.on("charCounter.update",s),a.events.trigger("charCounter.update"),void a.events.on("destroy",function(){t(a.o_win).off("resize.char"+a.id),n.removeData().remove(),n=null}))},count:r}},Be.PLUGINS.codeBeautifier=function(){var e,t,a,n,j={};function I(n,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},a={"@media":!0,"@supports":!0,"@document":!0};e=e||{},n=(n=n||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,i=e.indent_char||" ",s=e.selector_separator_newline===undefined||e.selector_separator_newline,o=e.end_with_newline!==undefined&&e.end_with_newline,l=e.newline_between_rules===undefined||e.newline_between_rules,c=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(i="\t",r=1),c=c.replace(/\\r/,"\r").replace(/\\n/,"\n");var d,f=/^\s+$/,p=-1,u=0;function h(){return(d=n.charAt(++p))||""}function g(e){var t,a=p;return e&&v(),t=n.charAt(p+1)||"",p=a-1,h(),t}function m(e){for(var t=p;h();)if("\\"===d)h();else{if(-1!==e.indexOf(d))break;if("\n"===d)break}return n.substring(t,p+1)}function v(){for(var e="";f.test(g());)h(),e+=d;return e}function E(){var e="";for(d&&f.test(d)&&(e=d);f.test(h());)e+=d;return e}function b(e){var t=p;for(e="/"===g(),h();h();){if(!e&&"*"===d&&"/"===g()){h();break}if(e&&"\n"===d)return n.substring(t,p)}return n.substring(t,p)+d}function A(e){return n.substring(p-e.length,p).toLowerCase()===e}function T(){for(var e=0,t=p+1;t<n.length;t++){var a=n.charAt(t);if("{"===a)return!0;if("("===a)e+=1;else if(")"===a){if(0===e)return!1;e-=1}else if(" "===a||"}"===a)return!1}return!1}var C=n.match(/^[\t ]*/)[0],R=new Array(r+1).join(i),S=0,L=0;for(var _,w,y={"{":function(e){y.singleSpace(),I.push(e),y.newLine()},"}":function(e){y.newLine(),I.push(e),y.newLine()},_lastCharWhitespace:function(){return f.test(I[I.length-1])},newLine:function(e){I.length&&(e||"\n"===I[I.length-1]||y.trim(),I.push("\n"),C&&I.push(C))},singleSpace:function(){I.length&&!y._lastCharWhitespace()&&I.push(" ")},preserveSingleSpace:function(){isAfterSpace&&y.singleSpace()},trim:function(){for(;y._lastCharWhitespace();)I.pop()}},I=[],O=!1,x=!1,F=!1,k="",N="";;){var D=-1!==E().indexOf("\n");if(N=k,!(k=d))break;if("/"===d&&"*"===g()){var M=0===S;(D||M)&&y.newLine(),I.push(b()),y.newLine(),M&&y.newLine(!0)}else if("/"===d&&"/"===g())D||"{"===N||y.trim(),y.singleSpace(),I.push(b()),y.newLine();else if("@"===d){y.preserveSingleSpace(),I.push(d);var B=(void 0,_=p,w=m(": , {}()[]/='\""),p=_-1,h(),w);B.match(/[ :]$/)&&(h(),B=m(": ").replace(/\s$/,""),I.push(B),y.singleSpace()),(B=B.replace(/\s$/,""))in t&&(L+=1,B in a&&(F=!0))}else"#"===d&&"{"===g()?(y.preserveSingleSpace(),I.push(m("}"))):"{"===d?"}"===g(!0)?(v(),h(),y.singleSpace(),I.push("{}"),y.newLine(),l&&0===S&&y.newLine(!0)):(S++,C+=R,y["{"](d),O=F?(F=!1,L<S):L<=S):"}"===d?(S--,C=C.slice(0,-r),y["}"](d),x=O=!1,L&&L--,l&&0===S&&y.newLine(!0)):":"===d?(v(),!O&&!F||A("&")||T()?":"===g()?(h(),I.push("::")):I.push(":"):(x=!0,I.push(":"),y.singleSpace())):'"'===d||"'"===d?(y.preserveSingleSpace(),I.push(m(d))):" "===d?(x=!1,I.push(d),y.newLine()):"("===d?A("url")?(I.push(d),v(),h()&&(")"!==d&&'"'!==d&&"'"!==d?I.push(m(")")):p--)):(u++,y.preserveSingleSpace(),I.push(d),v()):")"===d?(I.push(d),u--):","===d?(I.push(d),v(),s&&!x&&u<1?y.newLine():y.singleSpace()):("]"===d||("["===d?y.preserveSingleSpace():"="===d?(v(),d="="):y.preserveSingleSpace()),I.push(d))}var P="";return C&&(P+=C),P+=I.join("").replace(/[\r\n\t ]+$/,""),o&&(P+="\n"),"\n"!=c&&(P=P.replace(/[\n]/g,c)),P}function q(e,t){for(var a=0;a<t.length;a+=1)if(t[a]===e)return!0;return!1}function X(e){return e.replace(/^\s+|\s+$/g,"")}function O(e,t){return new r(e,t).beautify()}e=j,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",a=new RegExp("["+t+"]"),n=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&a.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e))))};var Q={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(n,e){var c,r,i,d,s,o,l,f,p,t,a,u,h,g=[],m="";function v(e,t){var a=0;return e&&(a=e.indentation_level,!c.just_added_newline()&&e.line_indent_level>a&&(a=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:a,line_indent_level:e?e.line_indent_level:a,start_line_index:c.get_line_number(),ternary_depth:0}}for(u={TK_START_EXPR:function N(){O();var e=Q.Expression;if("["===d.text){if("TK_WORD"===s||")"===f.last_text)return"TK_RESERVED"===s&&q(f.last_text,i.line_starters)&&(c.space_before_token=!0),L(e),R(),S(),void(h.space_in_paren&&(c.space_before_token=!0));e=Q.ArrayLiteral,_(f.mode)&&("["!==f.last_text&&(","!==f.last_text||"]"!==o&&"}"!==o)||h.keep_array_indentation||T())}else"TK_RESERVED"===s&&"for"===f.last_text?e=Q.ForInitializer:"TK_RESERVED"===s&&q(f.last_text,["if","while"])&&(e=Q.Conditional);" "===f.last_text||"TK_START_BLOCK"===s?T():"TK_END_EXPR"===s||"TK_START_EXPR"===s||"TK_END_BLOCK"===s||"."===f.last_text?A(d.wanted_newline):"TK_RESERVED"===s&&"("===d.text||"TK_WORD"===s||"TK_OPERATOR"===s?"TK_RESERVED"===s&&("function"===f.last_word||"typeof"===f.last_word)||"*"===f.last_text&&"function"===o?h.space_after_anon_function&&(c.space_before_token=!0):"TK_RESERVED"!==s||!q(f.last_text,i.line_starters)&&"catch"!==f.last_text||h.space_before_conditional&&(c.space_before_token=!0):c.space_before_token=!0;"("===d.text&&"TK_RESERVED"===s&&"await"===f.last_word&&(c.space_before_token=!0);"("===d.text&&("TK_EQUALS"!==s&&"TK_OPERATOR"!==s||I()||A());L(e),R(),h.space_in_paren&&(c.space_before_token=!0);S()},TK_END_EXPR:function D(){for(;f.mode===Q.Statement;)y();f.multiline_frame&&A("]"===d.text&&_(f.mode)&&!h.keep_array_indentation);h.space_in_paren&&("TK_START_EXPR"!==s||h.space_in_empty_paren?c.space_before_token=!0:(c.trim(),c.space_before_token=!1));"]"===d.text&&h.keep_array_indentation?(R(),y()):(y(),R());c.remove_redundant_indentation(p),f.do_while&&p.mode===Q.Conditional&&(p.mode=Q.Expression,f.do_block=!1,f.do_while=!1)},TK_START_BLOCK:function M(){var e=F(1),t=F(2);t&&(":"===t.text&&q(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||q(e.text,["get","set"])&&q(t.type,["TK_WORD","TK_RESERVED"]))?q(o,["class","interface"])?L(Q.BlockStatement):L(Q.ObjectLiteral):L(Q.BlockStatement);var a=!e.comments_before.length&&"}"===e.text&&"function"===f.last_word&&"TK_END_EXPR"===s;"expand"===h.brace_style||"none"===h.brace_style&&d.wanted_newline?"TK_OPERATOR"!==s&&(a||"TK_EQUALS"===s||"TK_RESERVED"===s&&x(f.last_text)&&"else"!==f.last_text)?c.space_before_token=!0:T(!1,!0):"TK_OPERATOR"!==s&&"TK_START_EXPR"!==s?"TK_START_BLOCK"===s?T():c.space_before_token=!0:_(p.mode)&&","===f.last_text&&("}"===o?c.space_before_token=!0:T());R(),S()},TK_END_BLOCK:function B(){for(;f.mode===Q.Statement;)y();var e="TK_START_BLOCK"===s;"expand"===h.brace_style?e||T():e||(_(f.mode)&&h.keep_array_indentation?(h.keep_array_indentation=!1,T(),h.keep_array_indentation=!0):T());y(),R()},TK_WORD:k,TK_RESERVED:k,TK_SEMICOLON:function P(){O()&&(c.space_before_token=!1);for(;f.mode===Q.Statement&&!f.if_block&&!f.do_block;)y();R()},TK_STRING:function U(){O()?c.space_before_token=!0:"TK_RESERVED"===s||"TK_WORD"===s?c.space_before_token=!0:"TK_COMMA"===s||"TK_START_EXPR"===s||"TK_EQUALS"===s||"TK_OPERATOR"===s?I()||A():T();R()},TK_EQUALS:function W(){O();f.declaration_statement&&(f.declaration_assignment=!0);c.space_before_token=!0,R(),c.space_before_token=!0},TK_OPERATOR:function K(){O();if("TK_RESERVED"===s&&x(f.last_text))return c.space_before_token=!0,void R();if("*"===d.text&&"TK_DOT"===s)return void R();if(":"===d.text&&f.in_case)return f.case_body=!0,S(),R(),T(),void(f.in_case=!1);if("::"===d.text)return void R();"TK_OPERATOR"===s&&A();var e=!0,t=!0;q(d.text,["--","++","!","~"])||q(d.text,["-","+"])&&(q(s,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||q(f.last_text,i.line_starters)||","===f.last_text)?(t=e=!1,!d.wanted_newline||"--"!==d.text&&"++"!==d.text||T(!1,!0)," "===f.last_text&&w(f.mode)&&(e=!0),"TK_RESERVED"===s?e=!0:"TK_END_EXPR"===s?e=!("]"===f.last_text&&("--"===d.text||"++"===d.text)):"TK_OPERATOR"===s&&(e=q(d.text,["--","-","++","+"])&&q(f.last_text,["--","-","++","+"]),q(d.text,["+","-"])&&q(f.last_text,["--","++"])&&(t=!0)),f.mode!==Q.BlockStatement&&f.mode!==Q.Statement||"{"!==f.last_text&&" "!==f.last_text||T()):":"===d.text?0===f.ternary_depth?e=!1:f.ternary_depth-=1:"?"===d.text?f.ternary_depth+=1:"*"===d.text&&"TK_RESERVED"===s&&"function"===f.last_text&&(t=e=!1);c.space_before_token=c.space_before_token||e,R(),c.space_before_token=t},TK_COMMA:function H(){if(f.declaration_statement)return w(f.parent.mode)&&(f.declaration_assignment=!1),R(),void(f.declaration_assignment?T(f.declaration_assignment=!1,!0):(c.space_before_token=!0,h.comma_first&&A()));R(),f.mode===Q.ObjectLiteral||f.mode===Q.Statement&&f.parent.mode===Q.ObjectLiteral?(f.mode===Q.Statement&&y(),T()):(c.space_before_token=!0,h.comma_first&&A())},TK_BLOCK_COMMENT:function $(){if(c.raw)return c.add_raw_token(d),void(d.directives&&"end"===d.directives.preserve&&(h.test_output_raw||(c.raw=!1)));if(d.directives)return T(!1,!0),R(),"start"===d.directives.preserve&&(c.raw=!0),void T(!1,!0);if(!j.newline.test(d.text)&&!d.wanted_newline)return c.space_before_token=!0,R(),void(c.space_before_token=!0);var e,t=function s(e){var t;e=e.replace(/\x0d/g,"");var a=[];t=e.indexOf("\n");for(;-1!==t;)a.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&a.push(e);return a}(d.text),a=!1,n=!1,r=d.whitespace_before,i=r.length;T(!1,!0),1<t.length&&(!function o(e,t){for(var a=0;a<e.length;a++){var n=X(e[a]);if(n.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function l(e,t){for(var a,n=0,r=e.length;n<r;n++)if((a=e[n])&&0!==a.indexOf(t))return!1;return!0}(t.slice(1),r)&&(n=!0):a=!0);for(R(t[0]),e=1;e<t.length;e++)T(!1,!0),a?R(" "+t[e].replace(/^\s+/g,"")):n&&t[e].length>i?R(t[e].substring(i)):c.add_token(t[e]);T(!1,!0)},TK_COMMENT:function G(){d.wanted_newline?T(!1,!0):c.trim(!0);c.space_before_token=!0,R(),T(!1,!0)},TK_DOT:function Y(){O();"TK_RESERVED"===s&&x(f.last_text)?c.space_before_token=!0:A(")"===f.last_text&&h.break_chained_methods);R()},TK_UNKNOWN:function V(){R(),"\n"===d.text[d.text.length-1]&&T()},TK_EOF:function z(){for(;f.mode===Q.Statement;)y()}},h={},(e=e||{}).braces_on_own_line!==undefined&&(h.brace_style=e.braces_on_own_line?"expand":"collapse"),h.brace_style=e.brace_style?e.brace_style:h.brace_style?h.brace_style:"collapse","expand-strict"===h.brace_style&&(h.brace_style="expand"),h.indent_size=e.indent_size?parseInt(e.indent_size,10):4,h.indent_char=e.indent_char?e.indent_char:" ",h.eol=e.eol?e.eol:"\n",h.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,h.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,h.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),h.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,h.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,h.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,h.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,h.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,h.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,h.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,h.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),h.e4x=e.e4x!==undefined&&e.e4x,h.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,h.comma_first=e.comma_first!==undefined&&e.comma_first,h.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,h.jslint_happy&&(h.space_after_anon_function=!0),e.indent_with_tabs&&(h.indent_char="\t",h.indent_size=1),h.eol=h.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),l="";0<h.indent_size;)l+=h.indent_char,h.indent_size-=1;var E=0;if(n&&n.length){for(;" "===n.charAt(E)||"\t"===n.charAt(E);)m+=n.charAt(E),E+=1;n=n.substring(E)}function b(e){var t=e.newlines;if(h.keep_array_indentation&&_(f.mode))for(var a=0;a<t;a+=1)T(0<a);else if(h.max_preserve_newlines&&t>h.max_preserve_newlines&&(t=h.max_preserve_newlines),h.preserve_newlines&&1<e.newlines){T();for(var n=1;n<t;n+=1)T(!0)}u[(d=e).type]()}function A(e){if(e=e!==undefined&&e,!c.just_added_newline())if(h.preserve_newlines&&d.wanted_newline||e)T(!1,!0);else if(h.wrap_line_length){c.current_line.get_character_count()+d.text.length+(c.space_before_token?1:0)>=h.wrap_line_length&&T(!1,!0)}}function T(e,t){if(!t&&" "!==f.last_text&&","!==f.last_text&&"="!==f.last_text&&"TK_OPERATOR"!==s)for(;f.mode===Q.Statement&&!f.if_block&&!f.do_block;)y();c.add_new_line(e)&&(f.multiline_frame=!0)}function C(){c.just_added_newline()&&(h.keep_array_indentation&&_(f.mode)&&d.wanted_newline?(c.current_line.push(d.whitespace_before),c.space_before_token=!1):c.set_indent(f.indentation_level)&&(f.line_indent_level=f.indentation_level))}function R(e){c.raw?c.add_raw_token(d):(h.comma_first&&"TK_COMMA"===s&&c.just_added_newline()&&","===c.previous_line.last()&&(c.previous_line.pop(),C(),c.add_token(","),c.space_before_token=!0),e=e||d.text,C(),c.add_token(e))}function S(){f.indentation_level+=1}function L(e){p=f?(t.push(f),f):v(null,e),f=v(p,e)}function _(e){return e===Q.ArrayLiteral}function w(e){return q(e,[Q.Expression,Q.ForInitializer,Q.Conditional])}function y(){0<t.length&&(p=f,f=t.pop(),p.mode===Q.Statement&&c.remove_redundant_indentation(p))}function I(){return f.parent.mode===Q.ObjectLiteral&&f.mode===Q.Statement&&(":"===f.last_text&&0===f.ternary_depth||"TK_RESERVED"===s&&q(f.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===s&&q(f.last_text,["const","let","const"])&&"TK_WORD"===d.type||"TK_RESERVED"===s&&"do"===f.last_text||"TK_RESERVED"===s&&"return"===f.last_text&&!d.wanted_newline||"TK_RESERVED"===s&&"else"===f.last_text&&("TK_RESERVED"!==d.type||"if"!==d.text)||"TK_END_EXPR"===s&&(p.mode===Q.ForInitializer||p.mode===Q.Conditional)||"TK_WORD"===s&&f.mode===Q.BlockStatement&&!f.in_case&&"--"!==d.text&&"++"!==d.text&&"function"!==o&&"TK_WORD"!==d.type&&"TK_RESERVED"!==d.type||f.mode===Q.ObjectLiteral&&(":"===f.last_text&&0===f.ternary_depth||"TK_RESERVED"===s&&q(f.last_text,["get","set"])))&&(L(Q.Statement),S(),"TK_RESERVED"===s&&q(f.last_text,["const","let","const"])&&"TK_WORD"===d.type&&(f.declaration_statement=!0),I()||A("TK_RESERVED"===d.type&&q(d.text,["do","for","if","while"])),!0)}function x(e){return q(e,["case","return","do","if","throw","else"])}function F(e){var t=r+(e||0);return t<0||t>=g.length?null:g[t]}function k(){("TK_RESERVED"===d.type&&f.mode!==Q.ObjectLiteral&&q(d.text,["set","get"])&&(d.type="TK_WORD"),"TK_RESERVED"===d.type&&f.mode===Q.ObjectLiteral)&&(":"===F(1).text&&(d.type="TK_WORD"));if(O()||!d.wanted_newline||w(f.mode)||"TK_OPERATOR"===s&&"--"!==f.last_text&&"++"!==f.last_text||"TK_EQUALS"===s||!h.preserve_newlines&&"TK_RESERVED"===s&&q(f.last_text,["const","let","const","set","get"])||T(),f.do_block&&!f.do_while){if("TK_RESERVED"===d.type&&"while"===d.text)return c.space_before_token=!0,R(),c.space_before_token=!0,void(f.do_while=!0);T(),f.do_block=!1}if(f.if_block)if(f.else_block||"TK_RESERVED"!==d.type||"else"!==d.text){for(;f.mode===Q.Statement;)y();f.if_block=!1,f.else_block=!1}else f.else_block=!0;if("TK_RESERVED"===d.type&&("case"===d.text||"default"===d.text&&f.in_case_statement))return T(),(f.case_body||h.jslint_happy)&&(!function e(){0<f.indentation_level&&(!f.parent||f.indentation_level>f.parent.indentation_level)&&(f.indentation_level-=1)}(),f.case_body=!1),R(),f.in_case=!0,void(f.in_case_statement=!0);if("TK_RESERVED"===d.type&&"function"===d.text&&((q(f.last_text,["}"," "])||c.just_added_newline()&&!q(f.last_text,["[","{",":","=",","]))&&(c.just_added_blankline()||d.comments_before.length||(T(),T(!0))),"TK_RESERVED"===s||"TK_WORD"===s?"TK_RESERVED"===s&&q(f.last_text,["get","set","new","return","export","async"])?c.space_before_token=!0:"TK_RESERVED"===s&&"default"===f.last_text&&"export"===o?c.space_before_token=!0:T():"TK_OPERATOR"===s||"="===f.last_text?c.space_before_token=!0:(f.multiline_frame||!w(f.mode)&&!_(f.mode))&&T()),"TK_COMMA"!==s&&"TK_START_EXPR"!==s&&"TK_EQUALS"!==s&&"TK_OPERATOR"!==s||I()||A(),"TK_RESERVED"===d.type&&q(d.text,["function","get","set"]))return R(),void(f.last_word=d.text);(a="NONE","TK_END_BLOCK"===s?"TK_RESERVED"===d.type&&q(d.text,["else","catch","finally"])?"expand"===h.brace_style||"end-expand"===h.brace_style||"none"===h.brace_style&&d.wanted_newline?a="NEWLINE":(a="SPACE",c.space_before_token=!0):a="NEWLINE":"TK_SEMICOLON"===s&&f.mode===Q.BlockStatement?a="NEWLINE":"TK_SEMICOLON"===s&&w(f.mode)?a="SPACE":"TK_STRING"===s?a="NEWLINE":"TK_RESERVED"===s||"TK_WORD"===s||"*"===f.last_text&&"function"===o?a="SPACE":"TK_START_BLOCK"===s?a="NEWLINE":"TK_END_EXPR"===s&&(c.space_before_token=!0,a="NEWLINE"),"TK_RESERVED"===d.type&&q(d.text,i.line_starters)&&")"!==f.last_text&&(a="else"===f.last_text||"export"===f.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===d.type&&q(d.text,["else","catch","finally"]))?"TK_END_BLOCK"!==s||"expand"===h.brace_style||"end-expand"===h.brace_style||"none"===h.brace_style&&d.wanted_newline?T():(c.trim(!0),"}"!==c.current_line.last()&&T(),c.space_before_token=!0):"NEWLINE"===a?"TK_RESERVED"===s&&x(f.last_text)?c.space_before_token=!0:"TK_END_EXPR"!==s?"TK_START_EXPR"===s&&"TK_RESERVED"===d.type&&q(d.text,["const","let","const"])||":"===f.last_text||("TK_RESERVED"===d.type&&"if"===d.text&&"else"===f.last_text?c.space_before_token=!0:T()):"TK_RESERVED"===d.type&&q(d.text,i.line_starters)&&")"!==f.last_text&&T():f.multiline_frame&&_(f.mode)&&","===f.last_text&&"}"===o?T():"SPACE"===a&&(c.space_before_token=!0);R(),f.last_word=d.text,"TK_RESERVED"===d.type&&"do"===d.text&&(f.do_block=!0),"TK_RESERVED"===d.type&&"if"===d.text&&(f.if_block=!0)}s="TK_START_BLOCK",o="",(c=new J(l,m)).raw=h.test_output_raw,t=[],L(Q.BlockStatement),this.beautify=function(){var e,t;for(i=new ee(n,h,l),g=i.tokenize(),r=0;e=F();){for(var a=0;a<e.comments_before.length;a++)b(e.comments_before[a]);b(e),o=f.last_text,s=e.type,f.last_text=e.text,r+=1}return t=c.get_code(),h.end_with_newline&&(t+="\n"),"\n"!=h.eol&&(t=t.replace(/[\n]/g,h.eol)),t}}function i(t){var a=0,n=-1,r=[],i=!0;this.set_indent=function(e){a=t.baseIndentLength+e*t.indent_length,n=e},this.get_character_count=function(){return a},this.is_empty=function(){return i},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),a+=e.length,i=!1},this.pop=function(){var e=null;return i||(e=r.pop(),a-=e.length,i=0===r.length),e},this.remove_indent=function(){0<n&&(n-=1,a-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),a-=1;i=0===r.length},this.toString=function(){var e="";return this._empty||(0<=n&&(e=t.indent_cache[n]),e+=r.join("")),e}}function J(t,a){a=a||"",this.indent_cache=[a],this.baseIndentLength=a.length,this.indent_length=t.length,this.raw=!1;var n=[];this.baseIndentString=a,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new i(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return n.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<n.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==Q.ForInitializer&&e.mode!==Q.Conditional)for(var t=e.start_line_index,a=n.length;t<a;)n[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,a);e&&1<n.length&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=1<n.length?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===n.length||n[n.length-2].is_empty())}}var Z=function Z(e,t,a,n,r,i){this.type=e,this.text=t,this.comments_before=[],this.newlines=a||0,this.wanted_newline=0<a,this.whitespace_before=n||"",this.parent=null,this.directives=null};function ee(y,I,e){var O="\n\r\t ".split(""),x=/[0-9]/,F=/[01234567]/,k=/[0123456789abcdefABCDEF]/,N="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var D,M,B,P,U,W,K=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),H=/([\s\S]*?)((?:\*\/)|$)/g,$=/([^\n\r\u2028\u2029]*)/g,G=/\/\* beautify( \w+[:]\w+)+ \*\//g,Y=/ (\w+)[:](\w+)/g,V=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,z=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function s(){var e,t,a=[];if(D=0,M="",W<=U)return["","TK_EOF"];t=P.length?P[P.length-1]:new Z("TK_START_BLOCK","{");var n=y.charAt(U);for(U+=1;q(n,O);){if(j.newline.test(n)?"\n"===n&&"\r"===y.charAt(U-2)||(D+=1,a=[]):a.push(n),W<=U)return["","TK_EOF"];n=y.charAt(U),U+=1}if(a.length&&(M=a.join("")),x.test(n)){var r=!0,i=!0,s=x;for("0"===n&&U<W&&/[Xxo]/.test(y.charAt(U))?(i=r=!1,n+=y.charAt(U),U+=1,s=/[o]/.test(y.charAt(U))?F:k):(n="",U-=1);U<W&&s.test(y.charAt(U));)n+=y.charAt(U),U+=1,r&&U<W&&"."===y.charAt(U)&&(n+=y.charAt(U),U+=1,r=!1),i&&U<W&&/[Ee]/.test(y.charAt(U))&&(n+=y.charAt(U),(U+=1)<W&&/[+-]/.test(y.charAt(U))&&(n+=y.charAt(U),U+=1),r=i=!1);return[n,"TK_WORD"]}if(j.isIdentifierStart(y.charCodeAt(U-1))){if(U<W)for(;j.isIdentifierChar(y.charCodeAt(U))&&(n+=y.charAt(U),(U+=1)!==W););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&q(t.text,["set","get"])||!q(n,K)?[n,"TK_WORD"]:"in"===n?[n,"TK_OPERATOR"]:[n,"TK_RESERVED"]}if("("===n||"["===n)return[n,"TK_START_EXPR"];if(")"===n||"]"===n)return[n,"TK_END_EXPR"];if("{"===n)return[n,"TK_START_BLOCK"];if("}"===n)return[n,"TK_END_BLOCK"];if(" "===n)return[n,"TK_SEMICOLON"];if("/"===n){var o="";if("*"===y.charAt(U)){U+=1,H.lastIndex=U;var l=H.exec(y);o="/*"+l[0],U+=l[0].length;var c=function _(e){if(!e.match(G))return null;var t={};Y.lastIndex=0;for(var a=Y.exec(e);a;)t[a[1]]=a[2],a=Y.exec(e);return t}(o);return c&&"start"===c.ignore&&(V.lastIndex=U,o+=(l=V.exec(y))[0],U+=l[0].length),[o=o.replace(j.lineBreak,"\n"),"TK_BLOCK_COMMENT",c]}if("/"===y.charAt(U)){U+=1,$.lastIndex=U;var d=$.exec(y);return o="//"+d[0],U+=d[0].length,[o,"TK_COMMENT"]}}if("`"===n||"'"===n||'"'===n||("/"===n||I.e4x&&"<"===n&&y.slice(U-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&q(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&q(t.parent.text,["if","while","for"])||q(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var f=n,p=!1,u=!1;if(e=n,"/"===f)for(var h=!1;U<W&&(p||h||y.charAt(U)!==f)&&!j.newline.test(y.charAt(U));)e+=y.charAt(U),p?p=!1:(p="\\"===y.charAt(U),"["===y.charAt(U)?h=!0:"]"===y.charAt(U)&&(h=!1)),U+=1;else if(I.e4x&&"<"===f){var g=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,m=y.slice(U-1),v=g.exec(m);if(v&&0===v.index){for(var E=v[2],b=0;v;){var A=!!v[1],T=v[2],C=!!v[v.length-1]||"![CDATA["===T.slice(0,8);if(T!==E||C||(A?--b:++b),b<=0)break;v=g.exec(m)}var R=v?v.index+v[0].length:m.length;return m=m.slice(0,R),U+=R-1,[m=m.replace(j.lineBreak,"\n"),"TK_STRING"]}}else for(;U<W&&(p||y.charAt(U)!==f&&("`"===f||!j.newline.test(y.charAt(U))));)(p||"`"===f)&&j.newline.test(y.charAt(U))?("\r"===y.charAt(U)&&"\n"===y.charAt(U+1)&&(U+=1),e+="\n"):e+=y.charAt(U),p=p?("x"!==y.charAt(U)&&"u"!==y.charAt(U)||(u=!0),!1):"\\"===y.charAt(U),U+=1;if(u&&I.unescape_strings&&(e=function w(e){var t,a=!1,n="",r=0,i="",s=0;for(;a||r<e.length;)if(t=e.charAt(r),r++,a){if(a=!1,"x"===t)i=e.substr(r,2),r+=2;else{if("u"!==t){n+="\\"+t;continue}i=e.substr(r,4),r+=4}if(!i.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(s=parseInt(i,16))&&s<32){n+="x"===t?"\\x"+i:"\\u"+i;continue}if(34===s||39===s||92===s)n+="\\"+String.fromCharCode(s);else{if("x"===t&&126<s&&s<=255)return e;n+=String.fromCharCode(s)}}else"\\"===t?a=!0:n+=t;return n}(e)),U<W&&y.charAt(U)===f&&(e+=f,U+=1,"/"===f))for(;U<W&&j.isIdentifierStart(y.charCodeAt(U));)e+=y.charAt(U),U+=1;return[e,"TK_STRING"]}if("#"===n){if(0===P.length&&"!"===y.charAt(U)){for(e=n;U<W&&"\n"!==n;)e+=n=y.charAt(U),U+=1;return[X(e)+"\n","TK_UNKNOWN"]}var S="#";if(U<W&&x.test(y.charAt(U))){for(;S+=n=y.charAt(U),(U+=1)<W&&"#"!==n&&"="!==n;);return"#"===n||("["===y.charAt(U)&&"]"===y.charAt(U+1)?(S+="[]",U+=2):"{"===y.charAt(U)&&"}"===y.charAt(U+1)&&(S+="{}",U+=2)),[S,"TK_WORD"]}}if("<"===n&&("?"===y.charAt(U)||"%"===y.charAt(U))){z.lastIndex=U-1;var L=z.exec(y);if(L)return n=L[0],U+=n.length-1,[n=n.replace(j.lineBreak,"\n"),"TK_STRING"]}if("<"===n&&"\x3c!--"===y.substring(U-1,U+3)){for(U+=3,n="\x3c!--";!j.newline.test(y.charAt(U))&&U<W;)n+=y.charAt(U),U++;return B=!0,[n,"TK_COMMENT"]}if("-"===n&&B&&"--\x3e"===y.substring(U-1,U+2))return B=!1,U+=2,["--\x3e","TK_COMMENT"];if("."===n)return[n,"TK_DOT"];if(q(n,N)){for(;U<W&&q(n+y.charAt(U),N)&&(n+=y.charAt(U),!(W<=(U+=1))););return","===n?[n,"TK_COMMA"]:"="===n?[n,"TK_EQUALS"]:[n,"TK_OPERATOR"]}return[n,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,a;W=y.length,U=0,B=!1,P=[];for(var n=null,r=[],i=[];!t||"TK_EOF"!==t.type;){for(a=s(),e=new Z(a[1],a[0],D,M);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=a[2]),i.push(e),a=s(),e=new Z(a[1],a[0],D,M);i.length&&(e.comments_before=i,i=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(n),n=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&n&&("]"===e.text&&"["===n.text||")"===e.text&&"("===n.text||"}"===e.text&&"{"===n.text)&&(e.parent=n.parent,n=r.pop()),P.push(e),t=e}return P}}return{run:function x(e,t){function s(e){return e.replace(/\s+$/g,"")}var a,n,r,m,i,o,v,l,c,E,b,A,d,f;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),n=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),m=t.indent_char===undefined?" ":t.indent_char,o=t.brace_style===undefined?"collapse":t.brace_style,i=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),v=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],l=t.preserve_newlines===undefined||t.preserve_newlines,c=l?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,E=t.indent_handlebars!==undefined&&t.indent_handlebars,b=t.wrap_attributes===undefined?"auto":t.wrap_attributes,A=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,d=t.end_with_newline!==undefined&&t.end_with_newline,f=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(m="\t",r=1),(a=new function y(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=n,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:f,in_array:function(e,t){for(var a=0;a<t.length;a++)if(e===t[a])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)l&&"\n"===e&&this.newlines<=c&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(E){var a=this.input.substr(this.pos,3);if("{{#"===a||"{{/"===a)break;if("{{!"===a)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",a=new RegExp("</"+e+"\\s*>","igm");a.lastIndex=this.pos;var n=a.exec(this.input),r=n?n.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1===this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,a,n="",r=[],i="",s=!1,o=!0,l=this.pos,c=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=l,this.line_char_count=c),r.length?r.join(""):["","TK_EOF"];if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace))s=!0;else{if("'"!==n&&'"'!==n||(n+=this.get_unformatted(n),s=!0),"="===n&&(s=!1),r.length&&"="!=r[r.length-1]&&">"!=n&&s){if(this.space_or_wrap(r),s=!1,!o&&"force"===b&&"/"!=n){this.print_newline(!0,r),this.print_indentation(r);for(var d=0;d<A;d++)r.push(m)}for(var f=0;f<r.length;f++)if(" "===r[f]){o=!1;break}}if(E&&"<"===a&&n+this.input.charAt(this.pos)==="{{"&&(n+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(n=" "+n),s=!0),"<"!==n||a||(t=this.pos-1,a="<"),E&&!a&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===n||"/"===n||"!"===n?this.pos-3:this.pos-2,a="{"),this.line_char_count++,r.push(n),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(E&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(E&&"{"===a&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=n);var p,u,h=r.join("");p=-1!=h.indexOf(" ")?h.indexOf(" "):"{"===h[0]?h.indexOf("}"):h.indexOf(">"),u="<"!==h[0]&&E?"#"===h[2]?3:2:1;var g=h.substring(u,p).toLowerCase();return"/"===h.charAt(h.length-2)||this.Utils.in_array(g,this.Utils.single_token)?e||(this.tag_type="SINGLE"):E&&"{"===h[0]&&"else"===g?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(g,v)?(i=this.get_unformatted("</"+g+">",h),r.push(i),this.pos,this.tag_type="SINGLE"):"script"===g&&(-1===h.search("type")||-1<h.search("type")&&-1<h.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(g),this.tag_type="SCRIPT"):"style"===g&&(-1===h.search("type")||-1<h.search("type")&&-1<h.search("text/css"))?e||(this.record_tag(g),this.tag_type="STYLE"):"!"===g.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===g.charAt(0)?(this.retrieve_tag(g.substring(1)),this.tag_type="END"):(this.record_tag(g),"html"!=g.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(g,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=l,this.line_char_count=c),r.join("")},this.get_comment=function(e){var t="",a=">",n=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!==a[a.length-1]||-1==t.indexOf(a));)!n&&t.length<10&&(0===t.indexOf("<![if")?(a="<![endif]>",n=!0):0===t.indexOf("<![cdata[")?(a="]]>",n=!0):0===t.indexOf("<![")?(a="]>",n=!0):0===t.indexOf("\x3c!--")?(a="--\x3e",n=!0):0===t.indexOf("{{!")?(a="}}",n=!0):0===t.indexOf("<?")?(a="?>",n=!0):0===t.indexOf("<%")&&(a="%>",n=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var a="",n="",r=0,i=!0;do{if(this.pos>=this.input.length)return n;if(a=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(a,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===a||"\r"===a){n+="\n",this.line_char_count=0;continue}}n+=a,this.line_char_count++,i=!0,E&&"{"===a&&n.length&&"{"===n[n.length-2]&&(r=(n+=this.get_unformatted("}}")).length)}while(-1===n.toLowerCase().indexOf(e,r));return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var a=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(a&&!this.Utils.in_array(a,t))},this.printer=function(e,t,a,n,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=a,this.brace_style=r,this.indent_level=0,this.wrap_line_length=n;for(var i=this.line_char_count=0;i<this.indent_size;i++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=s(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=function t(e){return e.replace(/^\s+/g,"")}(e)),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=s(e)),e&&""!==e&&(1<e.length&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,m,r,i,o);;){var p=a.get_token();if(a.token_text=p[0],a.token_type=p[1],"TK_EOF"===a.token_type)break;switch(a.token_type){case"TK_TAG_START":a.print_newline(!1,a.output),a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===a.last_token&&""===a.last_text){var u=a.token_text.match(/\w+/)[0],h=null;a.output.length&&(h=a.output[a.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/)),(null===h||h[1]!=u&&!a.Utils.in_array(h[1],v))&&a.print_newline(!1,a.output)}a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var g=a.token_text.match(/^\s*<([a-z-]+)/i);g&&a.Utils.in_array(g[1],v)||a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":a.print_token(a.token_text),a.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==a.token_text){a.print_newline(!1,a.output);var T=a.token_text,C=void 0,R=1;"TK_SCRIPT"===a.token_type?C=O:"TK_STYLE"===a.token_type&&(C=I),"keep"===t.indent_scripts?R=0:"separate"===t.indent_scripts&&(R=-a.indent_level);var S=a.get_full_indent(R);if(C)T=C(T.replace(/^\s*/,S),t);else{var L=T.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(a.indent_string).length-1,_=a.get_full_indent(R-L);T=T.replace(/^\s*/,S).replace(/\r\n|\r|\n/g,"\n"+_).replace(/\s+$/,"")}T&&(a.print_token_raw(T),a.print_newline(!0,a.output))}a.current_mode="TAG";break;default:""!==a.token_text&&a.print_token(a.token_text)}a.last_token=a.token_type,a.last_text=a.token_text}var w=a.output.join("").replace(/[\r\n\t ]+$/,"");return d&&(w+="\n"),w}}},Object.assign(Be.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),Be.PLUGINS.codeView=function(c){var d,f,p=c.$;function u(){return c.$box.hasClass("fr-code-view")}function h(){return f?f.getValue():d.val()}function g(){u()&&(f&&f.setSize(null,c.opts.height?c.opts.height:"auto"),c.opts.heightMin||c.opts.height?(c.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",c.opts.heightMin||c.opts.height),d.css("height",c.opts.height)):c.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var m,v=!1;function E(){u()&&c.events.trigger("blur")}function b(){u()&&v&&c.events.trigger("focus")}function n(e){d||(!function l(){d=p('<textarea class="fr-code" tabIndex="-1">'),c.$wp.append(d),d.attr("dir",c.opts.direction),c.$box.hasClass("fr-basic")||(m=p('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(c.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),c.$box.append(m),c.events.bindClick(c.$box,"a.html-switch",function(){c.events.trigger("commands.before",["html"]),A(!1),c.events.trigger("commands.after",["html"])}));var e=function e(){return!u()};c.events.on("buttons.refresh",e),c.events.on("copy",e,!0),c.events.on("cut",e,!0),c.events.on("paste",e,!0),c.events.on("destroy",T,!0),c.events.on("html.set",function(){u()&&A(!0)}),c.events.on("codeView.update",g),c.events.on("codeView.toggle",function(){c.$box.hasClass("fr-code-view")&&A()}),c.events.on("form.submit",function(){u()&&(c.html.set(h()),c.events.trigger("contentChanged",[],!0))},!0)}(),!f&&c.opts.codeMirror?((f=c.opts.codeMirror.fromTextArea(d.get(0),c.opts.codeMirrorOptions)).on("blur",E),f.on("focus",b)):(c.events.$on(d,"keydown keyup change input",function(){c.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")}),c.events.$on(d,"blur",E),c.events.$on(d,"focus",b))),c.undo.saveStep(),c.html.cleanEmptyTags(),c.html.cleanWhiteTags(!0),c.core.hasFocus()&&(c.core.isEmpty()||(c.selection.save(),c.$el.find('.fr-marker[data-type="true"]').first().replaceWith('<span class="fr-tmp fr-sm">F</span>'),c.$el.find('.fr-marker[data-type="false"]').last().replaceWith('<span class="fr-tmp fr-em">F</span>')));var t=c.html.get(!1,!0);c.$el.find("span.fr-tmp").remove(),c.$box.toggleClass("fr-code-view",!0);var a,n,r=!1;if(c.core.hasFocus()&&(r=!0,c.events.disableBlur(),c.$el.blur()),t=(t=t.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),c.codeBeautifier&&!t.includes("fr-embedly")&&(t=c.codeBeautifier.run(t,c.opts.codeBeautifierOptions)),f){a=t.indexOf("FROALA-SM"),(n=t.indexOf("FROALA-EM"))<a?a=n:n-=9;var i=(t=t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,a).length-t.substring(0,a).replace(/\n/g,"").length,s=t.substring(0,n).length-t.substring(0,n).replace(/\n/g,"").length;a=t.substring(0,a).length-t.substring(0,t.substring(0,a).lastIndexOf("\n")+1).length,n=t.substring(0,n).length-t.substring(0,t.substring(0,n).lastIndexOf("\n")+1).length,f.setSize(null,c.opts.height?c.opts.height:"auto"),c.opts.heightMin&&c.$box.find(".CodeMirror-scroll").css("min-height",c.opts.heightMin),f.setValue(t),v=!r,f.focus(),v=!0,f.setSelection({line:i,ch:a},{line:s,ch:n}),f.refresh(),f.clearHistory()}else{a=t.indexOf("FROALA-SM"),n=t.indexOf("FROALA-EM")-9,c.opts.heightMin&&d.css("min-height",c.opts.heightMin),c.opts.height&&d.css("height",c.opts.height),c.opts.heightMax&&d.css("max-height",c.opts.height||c.opts.heightMax),d.val(t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var o=p(c.o_doc).scrollTop();v=!r,d.focus(),v=!0,d.get(0).setSelectionRange(a,n),p(c.o_doc).scrollTop(o)}c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).filter(function(){return c.opts.codeViewKeepActiveButtons.indexOf(p(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!c.helpers.isMobile()&&c.opts.toolbarInline&&c.toolbar.hide()}function A(e){void 0===e&&(e=!u());var t=c.$tb.find('.fr-command[data-cmd="html"]');e?(c.popups.hideAll(),n(t)):(c.$box.toggleClass("fr-code-view",!1),function a(e){var t=h();c.html.set(t),c.$el.blur(),c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1),c.selection.setAtStart(c.el),c.selection.restore(),c.placeholder.refresh(),c.undo.saveStep()}(t))}function T(){u()&&A(!1),f&&f.toTextArea(),d.val("").removeData().remove(),d=null,m&&(m.remove(),m=null)}return{_init:function e(){if(c.events.on("focus",function(){c.opts.toolbarContainer&&function t(){var e=c.$tb.find('.fr-command[data-cmd="html"]');u()?(c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).filter(function(){return c.opts.codeViewKeepActiveButtons.indexOf(p(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!1),e.addClass("fr-active").attr("aria-pressed",!1)):(c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1))}()}),!c.$wp)return!1},toggle:A,isActive:u,get:h}},Be.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),Be.DefineIcon("html",{NAME:"code",SVG_KEY:"codeView"}),Object.assign(Be.POPUP_TEMPLATES,{"textColor.picker":"[_BUTTONS_][_TEXT_COLORS_][_CUSTOM_COLOR_]","backgroundColor.picker":"[_BUTTONS_][_BACKGROUND_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(Be.DEFAULTS,{colorsText:["#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"],colorsBackground:["#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"],colorsStep:7,colorsHEXInput:!0,colorsButtons:["colorsBack","|","-"]}),Be.PLUGINS.colors=function(m){var v=m.$,o='<div class="fr-color-hex-layer fr-active fr-layer" id="fr-color-hex-layer- \n '.concat(m.id,'"><div class="fr-input-line"><input maxlength="7" id="[ID]"\n type="text" placeholder="').concat(m.language.translate("HEX Color"),'" \n tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button \n type="button" class="fr-command fr-submit" data-cmd="[COMMAND]" tabIndex="2" role="button">\n ').concat(m.language.translate("OK"),"</button></div></div>");function l(e){for(var t="text"===e?m.opts.colorsText:m.opts.colorsBackground,a='<div class="fr-color-set fr-'.concat(e,'-color fr-selected-set">'),n=0;n<t.length;n++)0!==n&&n%m.opts.colorsStep==0&&(a+="<br>"),"REMOVE"!==t[n]?a+='<span class="fr-command fr-select-color" style="background:'.concat(t[n],';" \n tabIndex="-1" aria-selected="false" role="button" data-cmd="apply').concat(e,'Color" \n data-param1="').concat(t[n],'"><span class="fr-sr-only"> ').concat(m.language.translate("Color")).concat(t[n]," \n &nbsp;&nbsp;&nbsp;</span></span>"):a+='<span class="fr-command fr-select-color" data-cmd="apply'.concat(e,'Color"\n tabIndex="-1" role="button" data-param1="REMOVE" \n title="').concat(m.language.translate("Clear Formatting"),'">').concat(m.icon.create("remove"),' \n <span class="fr-sr-only"> ').concat(m.language.translate("Clear Formatting")," </span></span>");return a+"</div>"}function c(e){var t,a=m.popups.get("".concat(e,"Color.picker")),n=v(m.selection.element());t="background"===e?"background-color":"color";var r=a.find(".fr-".concat(e,"-color .fr-select-color"));for(r.find(".fr-selected-color").remove(),r.removeClass("fr-active-item"),r.not('[data-param1="REMOVE"]').attr("aria-selected",!1);n.get(0)!==m.el;){if("transparent"!==n.css(t)&&"rgba(0, 0, 0, 0)"!==n.css(t)){var i=a.find(".fr-".concat(e,'-color .fr-select-color[data-param1="').concat(m.helpers.RGBToHex(n.css(t)),'"]'));i.append('<span class="fr-selected-color" aria-hidden="true">\uf00c</span>'),i.addClass("fr-active-item").attr("aria-selected",!0);break}n=n.parent()}!function s(e){var t=m.popups.get("".concat(e,"Color.picker")),a=t.find(".fr-".concat(e,"-color .fr-active-item")).attr("data-param1"),n=t.find(".fr-color-hex-layer input");a||(a="");n.length&&v(n.val(a).input).trigger("change")}(e)}function n(e){"REMOVE"!==e?m.format.applyStyle("background-color",m.helpers.HEXtoRGB(e)):m.format.removeStyle("background-color"),m.popups.hide("backgroundColor.picker")}function r(e){"REMOVE"!==e?m.format.applyStyle("color",m.helpers.HEXtoRGB(e)):m.format.removeStyle("color"),m.popups.hide("textColor.picker")}return{showColorsPopup:function d(e){var t=m.$tb.find('.fr-command[data-cmd="'.concat(e,'"]')),a=m.popups.get("".concat(e,".picker"));if(a||(a=function s(e){var t="";m.opts.toolbarInline&&0<m.opts.colorsButtons.length&&(t+='<div class="fr-buttons fr-colors-buttons fr-tabs">\n '.concat(m.button.buildList(m.opts.colorsButtons),"\n </div>"));var a,n="";a="textColor"===e?(m.opts.colorsHEXInput&&(n=o.replace(/\[ID\]/g,"fr-color-hex-layer-text-".concat(m.id)).replace(/\[COMMAND\]/g,"customTextColor")),{buttons:t,text_colors:l("text"),custom_color:n}):(m.opts.colorsHEXInput&&(n=o.replace(/\[ID\]/g,"fr-color-hex-layer-background-".concat(m.id)).replace(/\[COMMAND\]/g,"customBackgroundColor")),{buttons:t,background_colors:l("background"),custom_color:n});var r=m.popups.create("".concat(e,".picker"),a);return function i(h,g){m.events.on("popup.tab",function(e){var t=v(e.currentTarget);if(!m.popups.isVisible(g)||!t.is("span"))return!0;var a=e.which,n=!0;if(Be.KEYCODE.TAB===a){var r=h.find(".fr-buttons");n=!m.accessibility.focusToolbar(r,!!e.shiftKey)}else if(Be.KEYCODE.ARROW_UP===a||Be.KEYCODE.ARROW_DOWN===a||Be.KEYCODE.ARROW_LEFT===a||Be.KEYCODE.ARROW_RIGHT===a){if(t.is("span.fr-select-color")){var i=t.parent().find("span.fr-select-color"),s=i.index(t),o=m.opts.colorsStep,l=Math.floor(i.length/o),c=s%o,d=Math.floor(s/o),f=d*o+c,p=l*o;Be.KEYCODE.ARROW_UP===a?f=((f-o)%p+p)%p:Be.KEYCODE.ARROW_DOWN===a?f=(f+o)%p:Be.KEYCODE.ARROW_LEFT===a?f=((f-1)%p+p)%p:Be.KEYCODE.ARROW_RIGHT===a&&(f=(f+1)%p);var u=v(i.get(f));m.events.disableBlur(),u.focus(),n=!1}}else Be.KEYCODE.ENTER===a&&(m.button.exec(t),n=!1);return!1===n&&(e.preventDefault(),e.stopPropagation()),n},!0)}(r,"".concat(e,".picker")),r}(e)),!a.hasClass("fr-active"))if(m.popups.setContainer("".concat(e,".picker"),m.$tb),c("textColor"===e?"text":"background"),t.isVisible()){var n=m.button.getPosition(t),r=n.left,i=n.top;m.popups.show("".concat(e,".picker"),r,i,t.outerHeight())}else m.position.forSelection(a),m.popups.show("".concat(e,".picker"))},background:n,customColor:function i(e){var t=m.popups.get("".concat(e,"Color.picker")).find(".fr-color-hex-layer input");if(t.length){var a=t.val();"background"===e?n(a):r(a)}},text:r,back:function e(){m.popups.hide("textColor.picker"),m.popups.hide("backgroundColor.picker"),m.toolbar.showInline()}}},Be.DefineIcon("textColor",{NAME:"tint",SVG_KEY:"textColor"}),Be.RegisterCommand("textColor",{title:"Text Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("textColor.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("textColor.picker")):this.colors.showColorsPopup("textColor")}}),Be.RegisterCommand("applytextColor",{undo:!0,callback:function(e,t){this.colors.text(t)}}),Be.RegisterCommand("customTextColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("text")}}),Be.DefineIcon("backgroundColor",{NAME:"paint-brush",SVG_KEY:"backgroundColor"}),Be.RegisterCommand("backgroundColor",{title:"Background Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("backgroundColor.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("backgroundColor.picker")):this.colors.showColorsPopup("backgroundColor")}}),Be.RegisterCommand("applybackgroundColor",{undo:!0,callback:function(e,t){this.colors.background(t)}}),Be.RegisterCommand("customBackgroundColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("background")}}),Be.DefineIcon("colorsBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("colorsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.colors.back()}}),Be.DefineIcon("remove",{NAME:"eraser",SVG_KEY:"remove"}),Object.assign(Be.DEFAULTS,{dragInline:!0}),Be.PLUGINS.draggable=function(d){var f,p=d.$;function e(e){return!(!e.originalEvent||!e.originalEvent.target||e.originalEvent.target.nodeType!==Node.TEXT_NODE)||(e.target&&"A"===e.target.tagName&&1===e.target.childNodes.length&&"IMG"===e.target.childNodes[0].tagName&&(e.target=e.target.childNodes[0]),p(e.target).hasClass("fr-draggable")?(d.undo.canDo()||d.undo.saveStep(),d.opts.dragInline?d.$el.attr("contenteditable",!0):d.$el.attr("contenteditable",!1),d.opts.toolbarInline&&d.toolbar.hide(),p(e.target).addClass("fr-dragging"),d.browser.msie||d.browser.edge||d.selection.clear(),void e.originalEvent.dataTransfer.setData("text","Froala")):(e.preventDefault(),!1))}function u(e){return!(e&&("HTML"===e.tagName||"BODY"===e.tagName||d.node.isElement(e)))}function h(e,t,a){if(d.opts.iframe){var n=d.helpers.getPX(d.$wp.find(".fr-iframe").css("padding-top")),r=d.helpers.getPX(d.$wp.find(".fr-iframe").css("padding-left"));e+=d.$iframe.offset().top+n,t+=d.$iframe.offset().left+r}f.offset().top!==e&&f.css("top",e),f.offset().left!==t&&f.css("left",t),f.width()!==a&&f.css("width",a)}function t(e){e.originalEvent.dataTransfer.dropEffect="move",d.opts.dragInline?(!function a(){for(var e=null,t=0;t<Be.INSTANCES.length;t++)if((e=Be.INSTANCES[t].$el.find(".fr-dragging")).length)return e.get(0)}()||d.browser.msie||d.browser.edge)&&e.preventDefault():(e.preventDefault(),function c(e){var t=d.doc.elementFromPoint(e.originalEvent.pageX-d.win.pageXOffset,e.originalEvent.pageY-d.win.pageYOffset);if(!u(t)){for(var a=0,n=t;!u(n)&&n===t&&0<e.originalEvent.pageY-d.win.pageYOffset-a;)a++,n=d.doc.elementFromPoint(e.originalEvent.pageX-d.win.pageXOffset,e.originalEvent.pageY-d.win.pageYOffset-a);(!u(n)||f&&0===d.$el.find(n).length&&n!==f.get(0))&&(n=null);for(var r=0,i=t;!u(i)&&i===t&&e.originalEvent.pageY-d.win.pageYOffset+r<p(d.doc).height();)r++,i=d.doc.elementFromPoint(e.originalEvent.pageX-d.win.pageXOffset,e.originalEvent.pageY-d.win.pageYOffset+r);(!u(i)||f&&0===d.$el.find(i).length&&i!==f.get(0))&&(i=null),t=null===i&&n?n:i&&null===n?i:i&&n?a<r?n:i:null}if(p(t).hasClass("fr-drag-helper"))return!1;if(t&&!d.node.isBlock(t)&&(t=d.node.blockParent(t)),t&&0<=["TD","TH","TR","THEAD","TBODY"].indexOf(t.tagName)&&(t=p(t).parents("table").get(0)),t&&0<=["LI"].indexOf(t.tagName)&&(t=p(t).parents("UL, OL").get(0)),t&&!p(t).hasClass("fr-drag-helper")){var s;f||(Be.$draggable_helper||(Be.$draggable_helper=p(document.createElement("div")).attr("class","fr-drag-helper")),f=Be.$draggable_helper,d.events.on("shared.destroy",function(){f.html("").removeData().remove(),f=null},!0)),s=e.originalEvent.pageY<p(t).offset().top+p(t).outerHeight()/2;var o=p(t),l=0;s||0!==o.next().length?(s||(o=o.next()),"before"===f.data("fr-position")&&o.is(f.data("fr-tag"))||(0<o.prev().length&&(l=parseFloat(o.prev().css("margin-bottom"))||0),l=Math.max(l,parseFloat(o.css("margin-top"))||0),h(o.offset().top-l/2-d.$box.offset().top,o.offset().left-d.win.pageXOffset-d.$box.offset().left,o.width()),f.data("fr-position","before"))):"after"===f.data("fr-position")&&o.is(f.data("fr-tag"))||(l=parseFloat(o.css("margin-bottom"))||0,h(o.offset().top+p(t).height()+l/2-d.$box.offset().top,o.offset().left-d.win.pageXOffset-d.$box.offset().left,o.width()),f.data("fr-position","after")),f.data("fr-tag",o),f.addClass("fr-visible"),d.$box.append(f)}else f&&0<d.$box.find(f).length&&f.removeClass("fr-visible")}(e))}function a(e){e.originalEvent.dataTransfer.dropEffect="move",d.opts.dragInline||e.preventDefault()}function n(e){d.$el.attr("contenteditable",!0);var t=d.$el.find(".fr-dragging");f&&f.hasClass("fr-visible")&&d.$box.find(f).length?r(e):t.length&&(e.preventDefault(),e.stopPropagation()),f&&d.$box.find(f).length&&f.removeClass("fr-visible"),t.removeClass("fr-dragging")}function r(e){var t,a;d.$el.attr("contenteditable",!0);for(var n=0;n<Be.INSTANCES.length;n++)if((t=Be.INSTANCES[n].$el.find(".fr-dragging")).length){a=Be.INSTANCES[n];break}if(t.length){if(e.preventDefault(),e.stopPropagation(),f&&f.hasClass("fr-visible")&&d.$box.find(f).length)f.data("fr-tag")[f.data("fr-position")]('<span class="fr-marker"></span>'),f.removeClass("fr-visible");else if(!1===d.markers.insertAtPoint(e.originalEvent))return!1;if(t.removeClass("fr-dragging"),!1===(t=d.events.chainTrigger("element.beforeDrop",t)))return!1;var r=t;if(t.parent().is("A")&&1===t.parent().get(0).childNodes.length&&(r=t.parent()),d.core.isEmpty())d.events.focus();else d.$el.find(".fr-marker").replaceWith(Be.MARKERS),d.selection.restore();if(a===d||d.undo.canDo()||d.undo.saveStep(),d.core.isEmpty())d.$el.html(r);else{var i=d.markers.insert();0===r.find(i).length?p(i).replaceWith(r):0===t.find(i).length&&p(i).replaceWith(t),t.after(Be.MARKERS),d.selection.restore()}return d.popups.hideAll(),d.selection.save(),d.$el.find(d.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").not(d.opts.htmlAllowedEmptyTags.join(",")).remove(),d.html.wrap(),d.html.fillEmptyBlocks(),d.selection.restore(),d.undo.saveStep(),d.opts.iframe&&d.size.syncIframe(),a!==d&&(a.popups.hideAll(),a.$el.find(a.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),a.html.wrap(),a.html.fillEmptyBlocks(),a.undo.saveStep(),a.events.trigger("element.dropped"),a.opts.iframe&&a.size.syncIframe()),d.events.trigger("element.dropped",[r]),!1}f&&f.removeClass("fr-visible"),d.undo.canDo()||d.undo.saveStep(),setTimeout(function(){d.undo.saveStep()},0)}function i(e){if(e&&"DIV"===e.tagName&&d.node.hasClass(e,"fr-drag-helper"))e.parentNode.removeChild(e);else if(e&&e.nodeType===Node.ELEMENT_NODE)for(var t=e.querySelectorAll("div.fr-drag-helper"),a=0;a<t.length;a++)t[a].parentNode.removeChild(t[a])}return{_init:function s(){d.opts.enter===Be.ENTER_BR&&(d.opts.dragInline=!0),d.events.on("dragstart",e,!0),d.events.on("dragover",t,!0),d.events.on("dragenter",a,!0),d.events.on("document.dragend",n,!0),d.events.on("document.drop",n,!0),d.events.on("drop",r,!0),d.events.on("html.processGet",i)}}},Object.assign(Be.DEFAULTS,{editInPopup:!1}),Be.MODULES.editInPopup=function(n){function e(){n.events.$on(n.$el,n._mouseup,function(){setTimeout(function(){!function a(){var e,t=n.popups.get("text.edit");e="INPUT"===n.el.tagName?n.$el.attr("placeholder"):n.$el.text(),t.find("input").val(e).trigger("change"),n.popups.setContainer("text.edit",n.$sc),n.popups.show("text.edit",n.$el.offset().left+n.$el.outerWidth()/2,n.$el.offset().top+n.$el.outerHeight(),n.$el.outerHeight())}()},10)})}return{_init:function a(){n.opts.editInPopup&&(function t(){var e={edit:'<div id="fr-text-edit-'.concat(n.id,'" class="fr-layer fr-text-edit-layer"><div class="fr-input-line"><input type="text" placeholder="').concat(n.language.translate("Text"),'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="updateText" tabIndex="2">').concat(n.language.translate("Update"),"</button></div></div>")};n.popups.create("text.edit",e)}(),e())},update:function t(){var e=n.popups.get("text.edit").find("input").val();0===e.length&&(e=n.opts.placeholderText),"INPUT"===n.el.tagName?n.$el.attr("placeholder",e):n.$el.text(e),n.events.trigger("contentChanged"),n.popups.hide("text.edit")}}},Be.RegisterCommand("updateText",{focus:!1,undo:!1,callback:function(){this.editInPopup.update()}}),Object.assign(Be.POPUP_TEMPLATES,{emoticons:"[_BUTTONS_][_CUSTOM_LAYER_]"}),Object.assign(Be.DEFAULTS,{emoticonsSet:[{id:"people",name:"Smileys & People",code:"1f600",emoticons:[{code:"1f600",desc:"Grinning face"},{code:"1f601",desc:"Grinning Face with Smiling Eyes"},{code:"1f602",desc:"Face with Tears of Joy"},{code:"1f603",desc:"Smiling Face with Open Mouth"},{code:"1f604",desc:"Smiling Face with Open Mouth and Smiling Eyes"},{code:"1f605",desc:"Smiling Face with Open Mouth and Cold Sweat"},{code:"1f606",desc:"Smiling Face with Open Mouth and Tightly-Closed Eyes"},{code:"1f609",desc:"Winking Face"},{code:"1f60a",desc:"Smiling Face with Smiling Eyes"},{code:"1f608",desc:"Face Savouring Delicious Food"},{code:"1f60e",desc:"Smiling Face with Sunglasses"},{code:"1f60d",desc:"Smiling Face with Heart-Shaped Eyes"},{code:"1f618",desc:"Face Throwing a Kiss"},{code:"1f617",desc:"Kissing Face"},{code:"1f619",desc:"Kissing Face with Smiling Eyes"},{code:"1f61a",desc:"Kissing Face with Closed Eyes"},{code:"263a",desc:"White Smiling Face"},{code:"1f642",desc:"Slightly Smiling Face"},{code:"1f610",desc:"Neutral Face"},{code:"1f611",desc:"Expressionless Face"},{code:"1f636",desc:"Face Without Mouth"},{code:"1f60f",desc:"Smirking Face"},{code:"1f623",desc:"Persevering Face"},{code:"1f625",desc:"Disappointed but Relieved Face"},{code:"1f62e",desc:"Face with Open Mouth"},{code:"1f62f",desc:"Hushed Face"},{code:"1f62a",desc:"Sleepy Face"},{code:"1f62b",desc:"Tired Face"},{code:"1f634",desc:"Sleeping Face"},{code:"1f60c",desc:"Relieved Face"},{code:"1f61b",desc:"Face with Stuck-out Tongue"},{code:"1f61c",desc:"Face with Stuck-out Tongue and Winking Eye"},{code:"1f61d",desc:"Face with Stuck-out Tongue and Tightly-Closed Eyes"},{code:"1f612",desc:"Unamused Face"},{code:"1f613",desc:"Face with Cold Sweat"},{code:"1f613",desc:"Face with Cold Sweat"},{code:"1f614",desc:"Pensive Face"},{code:"1f615",desc:"Confused Face"},{code:"1f632",desc:"Astonished Face"},{code:"1f616",desc:"Confounded Face"},{code:"1f61e",desc:"Disappointed Face"},{code:"1f61f",desc:"Worried Face"},{code:"1f624",desc:"Face with Look of Triumph"},{code:"1f622",desc:"Crying Face"},{code:"1f62d",desc:"Loudly Crying Face"},{code:"1f626",desc:"Frowning Face with Open Mouth"},{code:"1f627",desc:"Anguished Face"},{code:"1f628",desc:"Fearful Face"},{code:"1f629",desc:"Weary Face"},{code:"1f62c",desc:"Grimacing Face"},{code:"1f630",desc:"Face with Open Mouth and Cold Sweat"},{code:"1f631",desc:"Face Screaming in Fear"},{code:"1f633",desc:"Flushed Face"},{code:"1f635",desc:"Dizzy Face"},{code:"1f621",desc:"Pouting Face"},{code:"1f620",desc:"Angry Face"},{code:"1f637",desc:"Face with Medical Mask"},{code:"1f607",desc:"Smiling Face with Halo"},{code:"1f608",desc:"Smiling Face with Horns"},{code:"1f47f",desc:"Imp"},{code:"1f479",desc:"Japanese Ogre"},{code:"1f47a",desc:"Japanese Goblin"},{code:"1f480",desc:"Skull"},{code:"1f47b",desc:"Ghost"},{code:"1f47d",desc:"Extraterrestrial Alien"},{code:"1f47e",desc:"Alien Monster"},{code:"1f4a9",desc:"Pile of Poo"},{code:"1f63a",desc:"Smiling Cat Face with Open Mouth"},{code:"1f638",desc:"Grinning Cat Face with Smiling Eyes"},{code:"1f639",desc:"Cat Face with Tears of Joy"},{code:"1f63b",desc:"Smiling Cat Face with Heart-Shaped Eyes"},{code:"1f63c",desc:"Cat Face with Wry Smile"},{code:"1f63d",desc:"Kissing Cat Face with Closed Eyes"},{code:"1f640",desc:"Weary Cat Face"},{code:"1f63f",desc:"Crying Cat Face"},{code:"1f63e",desc:"Pouting Cat Face"},{code:"1f648",desc:"See-No-Evil Monkey"},{code:"1f649",desc:"Hear-No-Evil Monkey"},{code:"1f64a",desc:"Speak-No-Evil Monkey"},{code:"1f476",desc:"Baby"},{code:"1f466",desc:"Boy"},{code:"1f467",desc:"Girl"},{code:"1f468",desc:"Man"},{code:"1f469",desc:"Woman"},{code:"1f474",desc:"Older Man"},{code:"1f475",desc:"Older Woman"},{code:"1f46e",desc:"Police Officer"},{code:"1f482",desc:" Guardsman"},{code:"1f477",desc:" Construction Worker"},{code:"1f478",desc:"Princess"},{code:"1f473",desc:"Man with Turban"},{code:"1f472",desc:"Man with Gua Pi Mao"},{code:"1f471",desc:"Person with Blond Hair"},{code:"1f470",desc:"Bride with Veil"},{code:"1f47c",desc:"Baby Angel"},{code:"1f385",desc:"Father Christmas"},{code:"1f64e",desc:"Person with Pouting Face"},{code:"1f645",desc:"Face with No Good Gesture"},{code:"1f646",desc:"Face with Ok Gesture"},{code:"1f481",desc:"Information Desk Person"},{code:"1f64b",desc:"Happy Person Raising One Hand"},{code:"1f647",desc:"Person Bowing Deeply"},{code:"1f486",desc:"Face Massage"},{code:"1f487",desc:"Haircut"},{code:"1f6b6",desc:"Pedestrian"},{code:"1f3c3",desc:"Runner"},{code:"1f483",desc:"Dancer"},{code:"1f46f",desc:"Woman with Bunny Ears"},{code:"1f6c0",desc:"Bath"},{code:"1f464",desc:"Bust in Silhouette"},{code:"1f465",desc:"Busts in Silhouette"},{code:"1f3c7",desc:"Horse Racing"},{code:"1f3c2",desc:" Snowboarder"},{code:"1f3c4",desc:" Surfer"},{code:"1f6a3",desc:" Rowboat"},{code:"1f3ca",desc:" Swimmer"},{code:"1f6b4",desc:" Bicyclist"},{code:"1f6b5",desc:"Mountain Bicyclist"},{code:"1f46b",desc:" Man and Woman Holding Hands"},{code:"1f46c",desc:"Two Men Holding Hands"},{code:"1f46d",desc:"Two Women Holding Hands"},{code:"1f48f",desc:"Kiss"},{code:"1f468-2764-1f48b-1f468",uCode:"\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68",desc:"Man Kiss Man"},{code:"1f469-2764-1f48b-1f469",uCode:"\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69",desc:"Woman Kiss Woman"},{code:"1f491",desc:"Couple with Heart"},{code:"1f468-2764-1f468",uCode:"\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68",desc:"Man Heart Man"},{code:"1f469-2764-1f469",uCode:"\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69",desc:"Woman Heart Woman"},{code:"1f46a",desc:"Family"},{code:"1f468",desc:"Man Woman Boy"},{code:"1f468-1f469-1f467",desc:"Man Woman Girl"},{code:"1f468-1f469-1f467-1f466",desc:"Man Woman Girl Boy"},{code:"1f468-1f469-1f466-1f466",desc:"Man Woman Boy Boy"},{code:"1f468-1f469-1f467-1f467",desc:"Man Woman Girl Girl"},{code:"1f468-1f468-1f466",desc:"Man Man Boy"},{code:"1f468-1f468-1f467",desc:"Man Man Girl"},{code:"1f468-1f468-1f467-1f466",desc:"Man Man Girl Boy"},{code:"1f468-1f468-1f466-1f466",desc:"Man Man Boy Boy"},{code:"1f469-1f469-1f466",desc:"Woman Woman Boy"},{code:"1f469-1f469-1f467",desc:"Woman Woman Girl"},{code:"1f469-1f469-1f467-1f466",desc:"Woman Woman Girl Boy"},{code:"1f469-1f469-1f467-1f467",desc:"Woman Woman Girl Girl"},{code:"1f4aa",desc:"Flexed Biceps"},{code:"1f448",desc:"White Left Pointing Backhand Index"},{code:"1f449",desc:"White Right Pointing Backhand Index"},{code:"1f446",desc:"White Up Pointing Backhand Index"},{code:"1f447",desc:"White Down Pointing Backhand Index"},{code:"270c",desc:"Victory Hand"},{code:"270b",desc:"Raised Hand"},{code:"1f44c",desc:"Ok Hand Sign"},{code:"1f44d",desc:"Thumbs Up Sign"},{code:"1f44e",desc:"Thumbs Down Sign"},{code:"270a",desc:"Raised Fist"},{code:"1f44a",desc:"Fisted Hand Sign"},{code:"1f44b",desc:"Waving Hand Sign"},{code:"1f44f",desc:"Clapping Hands Sign"},{code:"1f450",desc:"Open Hands Sign"},{code:"1f64c",desc:"Person Raising Both Hands in Celebration"},{code:"1f64f",desc:"Person with Folded Hands"},{code:"1f485",desc:"Nail Polish"},{code:"1f442",desc:"Ear"},{code:"1f443",desc:"Nose"},{code:"1f463",desc:"Footprints"},{code:"1f440",desc:"Eyes"},{code:"1f445",desc:"Tongue"},{code:"1f444",desc:"Mouth"},{code:"1f48b",desc:"Kiss Mark"},{code:"1f498",desc:"Heart with Arrow"},{code:"2764",desc:"Heavy Black Heart"},{code:"1f493",desc:"Heavy Black Heart"},{code:"1f494",desc:"Broken Heart"},{code:"1f495",desc:"Two Hearts"},{code:"1f496",desc:"Sparkling Hearts"},{code:"1f497",desc:"Growing Hearts"},{code:"1f499",desc:"Blue Heart"},{code:"1f49a",desc:"Green Heart"},{code:"1f49b",desc:"Yellow Heart"},{code:"1f49c",desc:"Purple Heart"},{code:"1f49d",desc:"Heart with Ribbon"},{code:"1f49e",desc:"Revolving Hearts"},{code:"1f49f",desc:"Heart Decoration"},{code:"1f48c",desc:"Love Letter"},{code:"1f4a4",desc:"Sleeping Symbol"},{code:"1f4a2",desc:"Anger Symbol"},{code:"1f4a3",desc:"Bomb"},{code:"1f4a5",desc:"Collision Symbol"},{code:"1f4a6",desc:"Splashing Sweat Symbol"},{code:"1f4a8",desc:"Dash Symbol"},{code:"1f4ab",desc:"Dizzy Symbol"},{code:"1f4ab",desc:"Dizzy Symbol"},{code:"1f4ac",desc:"Speech Balloon"},{code:"1f4ad",desc:"Thought Balloon"},{code:"1f453",desc:"Eyeglasses"},{code:"1f454",desc:"Necktie"},{code:"1f455",desc:"T-Shirt"},{code:"1f456",desc:"Jeans"},{code:"1f457",desc:"Dress"},{code:"1f458",desc:"Kimono"},{code:"1f459",desc:"Bikini"},{code:"1f45a",desc:"Womans Clothes"},{code:"1f45b",desc:"Purse"},{code:"1f45c",desc:"Handbag"},{code:"1f45d",desc:"Pouch"},{code:"1f392",desc:"School Satchel"},{code:"1f45e",desc:"Mans Shoe"},{code:"1f45f",desc:"Athletic Shoe"},{code:"1f460",desc:"High-Heeled Shoe"},{code:"1f461",desc:"Womans Sandal"},{code:"1f462",desc:"Womans Boots"},{code:"1f451",desc:"Crown"},{code:"1f452",desc:"Womans Hat"},{code:"1f462",desc:"Top Hat"},{code:"1f393",desc:"Graduation Cap"},{code:"1f484",desc:"Lipstick"},{code:"1f48d",desc:"Ring"},{code:"1f48e",desc:"Gem Stone"}]},{id:"nature",name:"Animals & Nature",code:"1F435",emoticons:[{code:"1F435",desc:"Monkey Face"},{code:"1F412",desc:"Monkey"},{code:"1F436",desc:"Dog Face"},{code:"1F415",desc:"Dog"},{code:"1F429",desc:"Poodle"},{code:"1F43A",desc:"Wolf Face"},{code:"1F431",desc:"Cat Face"},{code:"1F408",desc:"Cat"},{code:"1F42F",desc:"Tiger Face"},{code:"1F405",desc:"Tiger"},{code:"1F406",desc:"Leopard"},{code:"1F434",desc:"Horse Face"},{code:"1F40E",desc:"Horse"},{code:"1F42E",desc:"Cow Face"},{code:"1F402",desc:"Ox"},{code:"1F403",desc:"Water Buffalo"},{code:"1F404",desc:"Cow"},{code:"1F437",desc:"Pig Face"},{code:"1F416",desc:"Pig"},{code:"1F417",desc:"Boar"},{code:"1F43D",desc:"Pig Nose"},{code:"1F40F",desc:"Ram"},{code:"1F411",desc:"Sheep"},{code:"1F410",desc:"Goat"},{code:"1F42A",desc:"Dromedary Camel"},{code:"1F42B",desc:"Bactrian Camel"},{code:"1F418",desc:"Elephant"},{code:"1F42D",desc:"Mouse Face"},{code:"1F401",desc:"Mouse"},{code:"1F400",desc:"Rat"},{code:"1F439",desc:"Hamster Face"},{code:"1F430",desc:"Rabbit Face"},{code:"1F407",desc:"Rabbit"},{code:"1F43B",desc:"Bear Face"},{code:"1F428",desc:"Koala"},{code:"1F43C",desc:"Panda Face"},{code:"1F43E",desc:"Paw Prints"},{code:"1F414",desc:"Chicken"},{code:"1F413",desc:"Rooster"},{code:"1F423",desc:"Hatching Chick"},{code:"1F424",desc:"Baby Chick"},{code:"1F425",desc:"Front-Facing Baby Chick"},{code:"1F426",desc:"Bird"},{code:"1F427",desc:"Penguin"},{code:"1F438",desc:"Frog Face"},{code:"1F40A",desc:"Crocodile"},{code:"1F422",desc:"Turtle"},{code:"1F40D",desc:"Snake"},{code:"1F432",desc:"Dragon Face"},{code:"1F409",desc:"Dragon"},{code:"1F433",desc:"Spouting Whale"},{code:"1F40B",desc:"Whale"},{code:"1F42C",desc:"Dolphin"},{code:"1F41F",desc:"Fish"},{code:"1F420",desc:"Tropical Fish"},{code:"1F421",desc:"Blowfish"},{code:"1F419",desc:"Octopus"},{code:"1F41A",desc:"Spiral Shell"},{code:"1F40C",desc:"Snail"},{code:"1F41B",desc:"Bug"},{code:"1F41C",desc:"Ant"},{code:"1F41D",desc:"Honeybee"},{code:"1F41E",desc:"Lady Beetle"},{code:"1F490",desc:"Bouquet"},{code:"1F338",desc:"Cherry Blossom"},{code:"1F4AE",desc:"White Flower"},{code:"1F339",desc:"Rose"},{code:"1F33A",desc:"Hibiscus"},{code:"1F33B",desc:"Sunflower"},{code:"1F33C",desc:"Blossom"},{code:"1F337",desc:"Tulip"},{code:"1F331",desc:"Seedling"},{code:"1F332",desc:"Evergreen Tree"},{code:"1F333",desc:"Deciduous Tree"},{code:"1F334",desc:"Palm Tree"},{code:"1F335",desc:"Cactus"},{code:"1F33E",desc:"Ear of Rice"},{code:"1F33F",desc:"Herb"},{code:"2618",desc:"Four Leaf Clover"},{code:"1F341",desc:"Maple Leaf"},{code:"1F342",desc:"Fallen Leaf"},{code:"1F343",desc:"Leaf Fluttering in Wind"}]},{id:"foods",name:"Food & Drink",code:"1F347",emoticons:[{code:"1F347",desc:"Grapes"},{code:"1F348",desc:"Melon"},{code:"1F349",desc:"Watermelon"},{code:"1F34A",desc:"Tangerine"},{code:"1F34B",desc:"Lemon"},{code:"1F34C",desc:"Banana"},{code:"1F34D",desc:"Pineapple"},{code:"1F34E",desc:"Red Apple"},{code:"1F34F",desc:"Green Apple"},{code:"1F350",desc:"Pear"},{code:"1F351",desc:"Peach"},{code:"1F352",desc:"Cherries"},{code:"1F353",desc:"Strawberry"},{code:"1F345",desc:"Tomato"},{code:"1F346",desc:"Aubergine"},{code:"1F33D",desc:"Ear of Maize"},{code:"1F344",desc:"Mushroom"},{code:"1F330",desc:"Chestnut"},{code:"1F35E",desc:"Bread"},{code:"1F356",desc:"Meat on Bone"},{code:"1F357",desc:"Poultry Leg"},{code:"1F354",desc:"Hamburger"},{code:"1F35F",desc:"French Fries"},{code:"1F355",desc:"Slice of Pizza"},{code:"1F373",desc:"Cooking"},{code:"1F372",desc:"Pot of Food"},{code:"1F371",desc:"Bento Box"},{code:"1F358",desc:"Rice Cracker"},{code:"1F359",desc:"Rice Ball"},{code:"1F35A",desc:"Cooked Rice"},{code:"1F35B",desc:"Curry and Rice"},{code:"1F35C",desc:"Steaming Bowl"},{code:"1F35D",desc:"Spaghetti"},{code:"1F360",desc:"Roasted Sweet Potato"},{code:"1F362",desc:"Oden"},{code:"1F363",desc:"Sushi"},{code:"1F364",desc:"Fried Shrimp"},{code:"1F365",desc:"Fish Cake with Swirl Design"},{code:"1F361",desc:"Dango"},{code:"1F366",desc:"Soft Ice Cream"},{code:"1F367",desc:"Shaved Ice"},{code:"1F368",desc:"Ice Cream"},{code:"1F369",desc:"Doughnut"},{code:"1F36A",desc:"Cookie"},{code:"1F382",desc:"Birthday Cake"},{code:"1F370",desc:"Shortcake"},{code:"1F36B",desc:"Chocolate Bar"},{code:"1F36C",desc:"Candy"},{code:"1F36D",desc:"Lollipop"},{code:"1F36E",desc:"Custard"},{code:"1F36F",desc:"Honey Pot"},{code:"1F37C",desc:"Baby Bottle"},{code:"2615",desc:"Hot Beverage"},{code:"1F375",desc:"Teacup Without Handle"},{code:"1F376",desc:"Sake Bottle and Cup"},{code:"1F377",desc:"Wine Glass"},{code:"1F378",desc:"Cocktail Glass"},{code:"1F379",desc:"Tropical Drink"},{code:"1F37A",desc:"Beer Mug"},{code:"1F37B",desc:"Clinking Beer Mugs"},{code:"1F374",desc:"Fork and Knife"},{code:"1F52A",desc:"Hocho"}]},{id:"activity",name:"Activities",code:"1f383",emoticons:[{code:"1f383",desc:" Jack-O-Lantern"},{code:"1f384",desc:"Christmas Tree"},{code:"1f386",desc:" Fireworks"},{code:"1f387",desc:"Firework Sparkler"},{code:"2728",desc:" Sparkles"},{code:"1f388",desc:"Balloon"},{code:"1f389",desc:"Party Popper"},{code:"1f38a",desc:"Confetti Ball"},{code:"1f38b",desc:"Tanabata Tree"},{code:"1f38d",desc:"Pine Decoration"},{code:"1f38e",desc:"Japanese Dolls"},{code:"1f38f",desc:"Carp Streamer"},{code:"1f390",desc:"Wind Chime"},{code:"1f391",desc:"Moon Viewing Ceremony"},{code:"1f380",desc:"Ribbon"},{code:"1f381",desc:"Wrapped Present"},{code:"1f3ab",desc:"Ticket"},{code:"1f3c6",desc:"Trophy"},{code:"1f388",desc:"Balloon"},{code:"26bd",desc:"Soccer Ball"},{code:"26be",desc:"Baseball"},{code:"1f3c0",desc:"Basketball and Hoop"},{code:"1f3c8",desc:"American Football"},{code:"1f3c9",desc:"Rugby Football"},{code:"1f3be",desc:"Tennis Racquet and Ball"},{code:"1f3b1",desc:"Billiards"},{code:"1f3b3",desc:"Bowling"},{code:"1f3af",desc:"Direct Hit"},{code:"26f3",desc:"Flag in Hole"},{code:"1f3a3",desc:"Fishing Pole and Fish"},{code:"1f3bd",desc:"Running Shirt with Sash"},{code:"1f3bf",desc:"Ski and Ski Boot"},{code:"1f3ae",desc:"Video Game"},{code:"1f3b2",desc:"Game Die"},{code:"2660",desc:"Black Spade Suit"},{code:"2665",desc:"Black Heart SuiT"},{code:"2666",desc:"Black Diamond Suit"},{code:"2663",desc:"Black Club Suit"},{code:"1f0cf",desc:"Playing Card Black Joker"},{code:"1f004",desc:"Mahjong Tile Red Dragon"},{code:"1f3b4",desc:"Flower Playing Cards"}]},{id:"places",name:"Travel & Places",code:"1f30d",emoticons:[{code:"1f30d",desc:"Earth Globe Europe-Africa"},{code:"1f30e",desc:"Earth Globe Americas"},{code:"1f30f",desc:"Earth Globe Asia-Australia"},{code:"1f310",desc:"Globe with Meridians"},{code:"1f5fe",desc:"Silhouette of Japan"},{code:"1f30b",desc:"Volcano"},{code:"1f5fb",desc:"Mount Fuji"},{code:"1f3e0",desc:"House Building"},{code:"1f3e1",desc:"House with Garden"},{code:"1f3e2",desc:"Office Building"},{code:"1f3e3",desc:"Japanese Post Office"},{code:"1f3e4",desc:"European Post Office"},{code:"1f3e5",desc:"Hospital"},{code:"1f3e6",desc:"Bank"},{code:"1f3e8",desc:"Hotel"},{code:"1f3e9",desc:"Love Hotel"},{code:"1f3ea",desc:"Convenience Store"},{code:"1f3eb",desc:"School"},{code:"1f3ec",desc:"Department Store"},{code:"1f3ed",desc:"Factory"},{code:"1f3ef",desc:"Japanese Castle"},{code:"1f3f0",desc:"European Castle"},{code:"1f492",desc:"Wedding"},{code:"1f5fc",desc:"Tokyo Tower"},{code:"1f5fd",desc:"Statue of Liberty"},{code:"26ea",desc:"Church"},{code:"26f2",desc:"Fountain"},{code:"26fa",desc:"Tent"},{code:"1f301",desc:"Foggy"},{code:"1f303",desc:"Night with Stars"},{code:"1f304",desc:"Sunrise over Mountains"},{code:"1f305",desc:"Sunrise"},{code:"1f306",desc:"Cityscape at Dusk"},{code:"1f307",desc:"Sunset over Buildings"},{code:"1f309",desc:"Bridge at Night"},{code:"2668",desc:"Hot Springs"},{code:"1f30c",desc:"Milky Way"},{code:"1f3a0",desc:"Carousel Horse"},{code:"1f3a1",desc:"Ferris Wheel"},{code:"1f3a2",desc:"Roller Coaster"},{code:"1f488",desc:"Barber Pole"},{code:"1f3aa",desc:"Circus Tent"},{code:"1f3ad",desc:"Performing Arts"},{code:"1f3a8",desc:"Artist Palette"},{code:"1f3b0",desc:"Slot Machine"},{code:"1f682",desc:"Steam Locomotive"},{code:"1f683",desc:"Railway Car"},{code:"1f684",desc:"High-Speed Train"},{code:"1f685",desc:"High-Speed Train with Bullet Nose"},{code:"1f686",desc:"Train"},{code:"1f687",desc:"Metro"},{code:"1f688",desc:"Light Rail"},{code:"1f689",desc:"Station"},{code:"1f68a",desc:"Tram"},{code:"1f69d",desc:"Monorail"},{code:"1f69e",desc:"Mountain Railway"},{code:"1f68b",desc:"Tram Car"},{code:"1f68c",desc:"Bus"},{code:"1f68d",desc:"Oncoming Bus"},{code:"1f68e",desc:"Trolleybus"},{code:"1f690",desc:"Minibus"},{code:"1f691",desc:"Ambulance"},{code:"1f692",desc:"Fire Engine"},{code:"1f693",desc:"Police Car"},{code:"1f694",desc:"Oncoming Police Car"},{code:"1f695",desc:"Taxi"},{code:"1f695",desc:"Oncoming Taxi"},{code:"1f697",desc:"Automobile"},{code:"1f698",desc:"Oncoming Automobile"},{code:"1f699",desc:"Recreational Vehicle"},{code:"1f69a",desc:"Delivery Truck"},{code:"1f69b",desc:"Articulated Lorry"},{code:"1f69c",desc:"Tractor"},{code:"1f6b2",desc:"Bicycle"},{code:"1f68f",desc:"Bus Stop"},{code:"26fd",desc:"Fuel Pump"},{code:"1f6a8",desc:"Police Cars Revolving Light"},{code:"1f6a5",desc:"Horizontal Traffic Light"},{code:"1f6a6",desc:"Vertical Traffic Light"},{code:"1f6a7",desc:"Construction Sign"},{code:"2693",desc:"Anchor"},{code:"26f5",desc:"Sailboat"},{code:"1f6a4",desc:"Speedboat"},{code:"1f6a2",desc:"Ship"},{code:"2708",desc:"Airplane"},{code:"1f4ba",desc:"Seat"},{code:"1f681",desc:"Helicopter"},{code:"1f69f",desc:"Suspension Railway"},{code:"1f6a0",desc:"Mountain Cableway"},{code:"1f6a1",desc:"Aerial Tramway"},{code:"1f680",desc:"Rocket"},{code:"1f6aa",desc:"Door"},{code:"1f6bd",desc:"Toilet"},{code:"1f6bf",desc:"Shower"},{code:"1f6c1",desc:"Bathtub"},{code:"231b",desc:"Hourglass"},{code:"23f3",desc:"Hourglass with Flowing Sand"},{code:"231a",desc:"Watch"},{code:"23f0",desc:"Alarm Clock"},{code:"1f55b",desc:"Clock Face Twelve Oclock"},{code:"1f567",desc:"Clock Face Twelve-Thirty"},{code:"1f550",desc:"Clock Face One Oclock"},{code:"1f55c",desc:"Clock Face One-thirty"},{code:"1f551",desc:"Clock Face Two Oclock"},{code:"1f55d",desc:"Clock Face Two-thirty"},{code:"1f552",desc:"Clock Face Three Oclock"},{code:"1f55e",desc:"Clock Face Three-thirty"},{code:"1f553",desc:"Clock Face Four Oclock"},{code:"1f55f",desc:"Clock Face Four-thirty"},{code:"1f554",desc:"Clock Face Five Oclock"},{code:"1f560",desc:"Clock Face Five-thirty"},{code:"1f555",desc:"Clock Face Six Oclock"},{code:"1f561",desc:"Clock Face Six-thirty"},{code:"1f556",desc:"Clock Face Seven Oclock"},{code:"1f562",desc:"Clock Face Seven-thirty"},{code:"1f557",desc:"Clock Face Eight Oclock"},{code:"1f563",desc:"Clock Face Eight-thirty"},{code:"1f558",desc:"Clock Face Nine Oclock"},{code:"1f564",desc:"Clock Face Nine-thirty"},{code:"1f559",desc:"Clock Face Ten Oclock"},{code:"1f565",desc:"Clock Face Ten-thirty"},{code:"1f55a",desc:"Clock Face Eleven Oclock"},{code:"1f566",desc:"Clock Face Eleven-thirty"},{code:"1f311",desc:"New Moon Symbol"},{code:"1f312",desc:"Waxing Crescent Moon Symbol"},{code:"1f313",desc:"First Quarter Moon Symbol"},{code:"1f314",desc:"Waxing Gibbous Moon Symbol"},{code:"1f315",desc:"Full Moon Symbol"},{code:"1f316",desc:"Waning Gibbous Moon Symbol"},{code:"1f317",desc:"Last Quarter Moon Symbol"},{code:"1f318",desc:"Waning Crescent Moon Symbol"},{code:"1f319",desc:"Crescent Moon"},{code:"1f31a",desc:"New Moon with Face"},{code:"1f31b",desc:"First Quarter Moon with Face"},{code:"1f31c",desc:"Last Quarter Moon with Face"},{code:"2600",desc:"Black Sun with Rays"},{code:"1f31d",desc:"Full Moon with Face"},{code:"1f31e",desc:"Sun with Face"},{code:"2b50",desc:"White Medium Star"},{code:"1f31f",desc:"Glowing Star"},{code:"1f320",desc:"Shooting Star"},{code:"2601",desc:"Cloud"},{code:"26c5",desc:"Sun Behind Cloud"},{code:"1f300",desc:"Cyclone"},{code:"1f308",desc:"Rainbow"},{code:"1f302",desc:"Closed Umbrella"},{code:"2614",desc:"Umbrella with Rain Drops"},{code:"26a1",desc:"High Voltage Sign"},{code:"2744",desc:"Snowflake"},{code:"2603",desc:"Snowman Without Snow"},{code:"1f525",desc:"Fire"},{code:"1f4a7",desc:"Droplet"},{code:"1F30A",desc:"Water Wave"}]},{id:"objects",name:"Objects",code:"1F507",emoticons:[{code:"1F507",desc:"Speaker with Cancellation Stroke"},{code:"1F508",desc:"Speaker"},{code:"1F509",desc:"Speaker with One Sound Wave"},{code:"1F50A",desc:"Speaker with Three Sound Wave"},{code:"1F4E2",desc:"Public Address Loudspeaker"},{code:"1F4E3",desc:"Cheering Megaphone"},{code:"1F4EF",desc:"Postal Horn"},{code:"1F514",desc:"Bell"},{code:"1F515",desc:"Bell with Cancellation Stroke"},{code:"1F3BC",desc:"Musical Score"},{code:"1F3B5",desc:"Musical Note"},{code:"1F3B6",desc:"Multiple Musical Notes"},{code:"1F3A4",desc:"Microphone"},{code:"1F3A7",desc:"Headphone"},{code:"1F4FB",desc:"Radio"},{code:"1F3B7",desc:"Saxophone"},{code:"1F3B8",desc:"Guitar"},{code:"1F3B9",desc:"Musical Keyboard"},{code:"1F3BA",desc:"Trumpet"},{code:"1F3BB",desc:"Violin"},{code:"1F4F1",desc:"Mobile Phone"},{code:"1F4F2",desc:"Mobile Phone with Rightwards Arrow at Left"},{code:"260E",desc:"Black Telephone"},{code:"1F4DE",desc:"Telephone Receiver"},{code:"1F4DF",desc:"Pager"},{code:"1F4E0",desc:"Fax Machine"},{code:"1F50B",desc:"Battery"},{code:"1F50C",desc:"Electric Plug"},{code:"1F4BB",desc:"Personal Computer"},{code:"1F4BD",desc:"Minidisc"},{code:"1F4BE",desc:"Floppy Disk"},{code:"1F4BF",desc:"Optical Disk"},{code:"1F4C0",desc:"Dvd"},{code:"1F3A5",desc:"Movie Camera"},{code:"1F3AC",desc:"Clapper Board"},{code:"1F4FA",desc:"Television"},{code:"1F4F7",desc:"Camera"},{code:"1F4F9",desc:"Video Camera"},{code:"1F4FC",desc:"Videocassette"},{code:"1F50D",desc:"Left-Pointing Magnifying Glass"},{code:"1F50E",desc:"Right-Pointing Magnifying Glass"},{code:"1F52C",desc:"Microscope"},{code:"1F52D",desc:"Telelscope"},{code:"1F4E1",desc:"Satellite Antenna"},{code:"1F4A1",desc:"Electric Light Bulb"},{code:"1F526",desc:"Electric Torch"},{code:"1F3EE",desc:"Izakaya Lantern"},{code:"1F4D4",desc:"Notebook with Decorative Cover"},{code:"1F4D5",desc:"Closed Book"},{code:"1F4D6",desc:"Open Book"},{code:"1F4D7",desc:"Green Book"},{code:"1F4D8",desc:"Blue Book"},{code:"1F4D9",desc:"Orange Book"},{code:"1F4DA",desc:"Books"},{code:"1F4D3",desc:"Notebook"},{code:"1F4D2",desc:"Ledger"},{code:"1F4C3",desc:"Curl"},{code:"1F4DC",desc:"Scroll"},{code:"1F4C4",desc:"Page Facing Up"},{code:"1F4F0",desc:"Newspaper"},{code:"1F4D1",desc:"Bookmark Tabs"},{code:"1F516",desc:"Bookmark"},{code:"1F4B0",desc:"Money Bag"},{code:"1F4B4",desc:"Banknote with Yen Sign"},{code:"1F4B5",desc:"Banknote with Dollar Sign"},{code:"1F4B6",desc:"Banknote with Euro Sign"},{code:"1F4B7",desc:"Banknote with Pound Sign"},{code:"1F4B8",desc:"Money with Wings"},{code:"1F4B3",desc:"Credit Card"},{code:"1F4B9",desc:"Chart with Upwards Trend and Yen Sign"},{code:"1F4B1",desc:"Currency Exchange"},{code:"1F4B2",desc:"Heavy Dollar Sign"},{code:"2709",desc:"Envelope"},{code:"1F4E7",desc:"E-Mail Symbol"},{code:"1F4E8",desc:"Incoming Envelope"},{code:"1F4E9",desc:"Envelope with Downwards Arrow Above"},{code:"1F4E4",desc:"Outbox Tray"},{code:"1F4E5",desc:"Inbox Tray"},{code:"1F4E6",desc:"Package"},{code:"1F4BE",desc:"Closed Mailbox with Raised Flag"},{code:"1F4EA",desc:"Closed Mailbox with Lowered Flag"},{code:"1F4EC",desc:"Open Mailbox with Raised Flag"},{code:"1F4ED",desc:"Open Mailbox with Lowered Flag"},{code:"1F5F3",desc:"Postbox"},{code:"270F",desc:"Pencil"},{code:"2712",desc:"Black Nib"},{code:"1F4DD",desc:"Memo"},{code:"1F4BC",desc:"Briefcase"},{code:"1F4C1",desc:"File Folder"},{code:"1F4C2",desc:"Open File Folder"},{code:"1F4C5",desc:"Calender"},{code:"1F4C6",desc:"Tear-off Calender"},{code:"1F4C7",desc:"Card Index"},{code:"1F4C8",desc:"Chart with Upwards Trend"},{code:"1F4C9",desc:"Chart with Downwards Trend"},{code:"1F4CA",desc:"Bar Chart"},{code:"1F4CB",desc:"Clipboard"},{code:"1F4CC",desc:"Pushpin"},{code:"1F4CD",desc:"Round Pushpin"},{code:"1F4CE",desc:"Paperclip"},{code:"1F4CF",desc:"Straight Ruler"},{code:"1F4D0",desc:"Triangular Ruler"},{code:"2702",desc:"Black Scissors"},{code:"1F512",desc:"Lock"},{code:"1F513",desc:"Open Lock"},{code:"1F50F",desc:"Lock with Ink Pen"},{code:"1F510",desc:"Closed Lock with Key"},{code:"1F511",desc:"Key"},{code:"1F528",desc:"Hammer"},{code:"1F52B",desc:"Pistol"},{code:"1F527",desc:"Wrench"},{code:"1F529",desc:"Nut and Bolt"},{code:"1F517",desc:"Link Symbol"},{code:"1F489",desc:"Syringe"},{code:"1F48A",desc:"Pill"},{code:"1F6AC",desc:"Smoking Symbol"},{code:"1F5FF",desc:"Moyai"},{code:"1F52E",desc:"Crystal Ball"}]},{id:"symbols",name:"Symbols",code:"1F3E7",emoticons:[{code:"1F3E7",desc:"Automated Teller Machine"},{code:"1F6AE",desc:"Put Litter in Its Place Symbol"},{code:"1F6B0",desc:"Potable Water Symbol"},{code:"267F",desc:"Wheelchair Symbol"},{code:"1F6B9",desc:"Mens Symbol"},{code:"1F6BA",desc:"Womens Symbol"},{code:"1F6BB",desc:"Restroom"},{code:"1F6BC",desc:"Baby Symbol"},{code:"1F6BE",desc:"Water Closet"},{code:"1F6C2",desc:"Passport Control"},{code:"1F6C3",desc:"Customs"},{code:"1F6C4",desc:"Baggage Claim"},{code:"1F6C5",desc:"Left Luggage"},{code:"26A0",desc:"Warning Sign"},{code:"1F6B8",desc:"Children Crossing"},{code:"26D4",desc:"No Entry"},{code:"1F6AB",desc:"No Entry Sign"},{code:"1F6B3",desc:"No Bicycles"},{code:"1F6AD",desc:"No Smoking Symbol"},{code:"1F6AF",desc:"Do Not Litter Symbol"},{code:"1F6B1",desc:"Non-Potable Water Symbol"},{code:"1F6B7",desc:"No Pedestrians"},{code:"1F4F5",desc:"No Mobile Phones"},{code:"1F51E",desc:"No One Under Eighteen Symbol"},{code:"2B06",desc:"Upwards Black Arrow"},{code:"2197",desc:"North East Arrow"},{code:"27A1",desc:"Black Rightwards Arrow"},{code:"2198",desc:"South East Arrow"},{code:"2B07",desc:"Downwards Black Arrow"},{code:"2199",desc:"South West Arrow"},{code:"2B05",desc:"Leftwards Black Arrow"},{code:"2196",desc:"North West Arrow"},{code:"2195",desc:"Up Down Arrow"},{code:"2194",desc:"Left Right Arrow"},{code:"21A9",desc:"Leftwards Arrow with Hook"},{code:"21AA",desc:"Rightwards Arrow with Hook"},{code:"2934",desc:"Arrow Pointing Rightwards Then Curving Upwards"},{code:"2935",desc:"Arrow Pointing Rightwards Then Curving Downwards"},{code:"1F503",desc:"Clockwise Downwards and Upwards Open Circle Arrows"},{code:"1F504",desc:"Anticlockwise Downwards and Upwards Open Circle Arrows"},{code:"1F519",desc:"Back with Leftwards Arrow Above"},{code:"1F51A",desc:"End with Leftwards Arrow Above"},{code:"1F51B",desc:"On with Exclamation Mark with Left Right Arrow Above"},{code:"1F51C",desc:"Soon with Rightwards Arrow Above"},{code:"1F51D",desc:"Top with Upwards Arrow Above"},{code:"1F52F",desc:"Six Pointed Star with Middle Dot"},{code:"2648",desc:"Aries"},{code:"2649",desc:"Taurus"},{code:"264A",desc:"Gemini"},{code:"264B",desc:"Cancer"},{code:"264C",desc:"Leo"},{code:"264D",desc:"Virgo"},{code:"264E",desc:"Libra"},{code:"264F",desc:"Scorpius"},{code:"2650",desc:"Sagittarius"},{code:"2651",desc:"Capricorn"},{code:"2652",desc:"Aquarius"},{code:"2653",desc:"Pisces"},{code:"26CE",desc:"Ophiuchus"},{code:"1F500",desc:"Twisted Rightwards Arrows"},{code:"1F501",desc:"Clockwise Rightwards and Leftwards Open Circle Arrows"},{code:"1F502",desc:"Clockwise Rightwards and Leftwards Open Circle Arrows with Circled One Overlay"},{code:"25B6",desc:"Black Right-Pointing Triangle"},{code:"23E9",desc:"Black Right-Pointing Double Triangle"},{code:"25C0",desc:"Black Left-Pointing Triangle"},{code:"23EA",desc:"Black Left-Pointing Double Triangle"},{code:"1F53C",desc:"Up-Pointing Small Red Triangle"},{code:"23EB",desc:"Black Up-Pointing Double Triangle"},{code:"1F53D",desc:"Down-Pointing Small Red Triangle"},{code:"23EC",desc:"Black Down-Pointing Double Triangle"},{code:"1F3A6",desc:"Cinema"},{code:"1F505",desc:"Low Brightness Symbol"},{code:"1F506",desc:"High Brightness Symbol"},{code:"1F4F6",desc:"Antenna with Bars"},{code:"1F4F3",desc:"Vibration Mode"},{code:"1F4F4",desc:"Mobile Phone off"},{code:"267B",desc:"Black Universal Recycling Symbol"},{code:"1F531",desc:"Trident Emblem"},{code:"1F4DB",desc:"Name Badge"},{code:"1F530",desc:"Japanese Symbol for Beginner"},{code:"2B55",desc:"Heavy Large Circle"},{code:"2705",desc:"White Heavy Check Mark"},{code:"2611",desc:"Ballot Box with Check"},{code:"2714",desc:"Heavy Check Mark"},{code:"2716",desc:"Heavy Multiplication X"},{code:"274C",desc:"Cross Mark"},{code:"274E",desc:"Negative Squared Cross Mark"},{code:"2795",desc:"Heavy Plus Sign"},{code:"2796",desc:"Heavy Minus Sign"},{code:"2797",desc:"Heavy Division Sign"},{code:"27B0",desc:"Curly Loop"},{code:"27BF",desc:"Double Curly Loop"},{code:"303D",desc:"Part Alternation Mark"},{code:"2733",desc:"Eight Spoked Asterisk"},{code:"2734",desc:"Eight Pointed Black Star"},{code:"2747",desc:"Sparkle"},{code:"203C",desc:"Double Exclamation Mark"},{code:"2049",desc:"Exclamation Question Mark"},{code:"2753",desc:"Black Question Mark Ornament"},{code:"2754",desc:"White Question Mark Ornament"},{code:"2755",desc:"White Exclamation Mark Ornament"},{code:"2757",desc:"Heavy Exclamation Mark Symbol"},{code:"3030",desc:"Wavy Dash"},{code:"2122",desc:"Trade Mark Sign"},{code:"1F51F",desc:"Keycap Ten"},{code:"1F4AF",desc:"Hundred Points Symbol"},{code:"1F520",desc:"Input Symbol for Latin Capital Letters"},{code:"1F521",desc:"Input Symbol for Latin Small Letters"},{code:"1F522",desc:"Input Symbol for Numbers"},{code:"1F523",desc:"Input Symbol for Symbols"},{code:"1F524",desc:"Input Symbol for Latin Letters"},{code:"1F170",desc:"Negative Squared Latin Capital Letter a"},{code:"1F18E",desc:"Negative Squared Ab"},{code:"1F171",desc:"Negative Squared Latin Capital Letter B"},{code:"1F191",desc:"Squared Cl"},{code:"1F192",desc:"Squared Cool"},{code:"1F193",desc:"Squared Free"},{code:"2139",desc:"Information Source"},{code:"1F194",desc:"Squared Id"},{code:"24C2",desc:"Circled Latin Capital Letter M"},{code:"1F195",desc:"Squared New"},{code:"1F196",desc:"Squared Ng"},{code:"1F17E",desc:"Negative Squared Latin Capital Letter O"},{code:"1F197",desc:"Squared Ok"},{code:"1F17F",desc:"Negative Squared Latin Capital Letter P"},{code:"1F198",desc:"Squared Sos"},{code:"1F199",desc:"Squared Up with Exclamation Mark"},{code:"1F19A",desc:"Squared Vs"},{code:"1F201",desc:"Squared Katakana Koko"},{code:"1F202",desc:"Squared Katakana Sa"},{code:"1F237",desc:"Squared Cjk Unified Ideograph-6708"},{code:"1F236",desc:"Squared Cjk Unified Ideograph-6709"},{code:"1F22F",desc:"Squared Cjk Unified Ideograph-6307"},{code:"1F250",desc:"Circled Ideograph Advantage"},{code:"1F239",desc:"Squared Cjk Unified Ideograph-5272"},{code:"1F21A",desc:"Squared Cjk Unified Ideograph-7121"},{code:"1F232",desc:"Squared Cjk Unified Ideograph-7981"},{code:"1F251",desc:"Circled Ideograph Accept"},{code:"1F238",desc:"Squared Cjk Unified Ideograph-7533"},{code:"1F234",desc:"Squared Cjk Unified Ideograph-5408"},{code:"1F233",desc:"Squared Cjk Unified Ideograph-7a7a"},{code:"3297",desc:"Circled Ideograph Congratulation"},{code:"3299",desc:"Circled Ideograph Secret"},{code:"1F23A",desc:"Squared Cjk Unified Ideograph-55b6"},{code:"1F235",desc:"Squared Cjk Unified Ideograph-6e80"},{code:"25AA",desc:"Black Small Square"},{code:"25AB",desc:"White Small Square"},{code:"25FB",desc:"White Medium Square"},{code:"25FC",desc:"Black Medium Square"},{code:"25FD",desc:"White Medium Small Square"},{code:"25FE",desc:"Black Medium Small Square"},{code:"2B1B",desc:"Black Large Square"},{code:"2B1C",desc:"White Large Square"},{code:"1F536",desc:"Large Orange Diamond"},{code:"1F537",desc:"Large Blue Diamond"},{code:"1F538",desc:"Small Orange Diamond"},{code:"1F539",desc:"Small Blue Diamond"},{code:"1F53A",desc:"Up-Pointing Red Triangle"},{code:"1F53B",desc:"Down-Pointing Red Triangle"},{code:"1F4A0",desc:"Diamond Shape with a Dot Inside"},{code:"1F518",desc:"Radio Button"},{code:"1F532",desc:"Black Square Button"},{code:"1F533",desc:"White Square Button"},{code:"26AA",desc:"Medium White Circle"},{code:"26AB",desc:"Medium Black Circle"},{code:"1F534",desc:"Large Red Circle"},{code:"1F535",desc:"Large Blue Circle"}]},{id:"flags",name:"Flags",code:"1F3C1",emoticons:[{code:"1f3c1",desc:"Chequered Flag"},{code:"1f1e8-1f1f3",desc:"China Flag"},{code:"1f38c",desc:"Crossed Flags"},{code:"1f1e9-1f1ea",desc:"Germany Flag"},{code:"1f1ea-1f1f8",desc:"Spain Flag"},{code:"1f1e6-1f1e8",desc:"Ascension Island Flag"},{code:"1f1e6-1f1e9",desc:"Andorra Flag"},{code:"1f1e6-1f1ea",desc:"United Arab Emirates Flag"},{code:"1f1e6-1f1eb",desc:"Afghanistan Flag"},{code:"1f1e6-1f1ec",desc:"Antigua & Barbuda Flag"},{code:"1f1e6-1f1ee",desc:"Anguilla Flag"},{code:"1f1e6-1f1f1",desc:"Albania Flag"},{code:"1f1e6-1f1f2",desc:"Armenia Flag"},{code:"1f1e6-1f1f4",desc:"Angola Flag"},{code:"1f1e6-1f1f6",desc:"Antarctica Flag"},{code:"1f1e6-1f1f7",desc:"Argentina Flag"},{code:"1f1e6-1f1f8",desc:"American Samoa Flag"},{code:"1f1e6-1f1f9",desc:"Austria Flag"},{code:"1f1e6-1f1fa",desc:"Australia Flag"},{code:"1f1e6-1f1fc",desc:"Aruba Flag"},{code:"1f1e6-1f1fd",desc:"\xc5land Islands Flag"},{code:"1f1e6-1f1ff",desc:"Azerbaijan Flag"},{code:"1f1e7-1f1e7",desc:"Barbados Flag"},{code:"1f1e7-1f1e9",desc:"Bangladesh Flag"},{code:"1f1e7-1f1ea",desc:"Belgium Flag"},{code:"1f1e7-1f1eb",desc:"Burkina Faso Flag"},{code:"1f1e7-1f1ec",desc:"Bulgaria Flag"},{code:"1f1e7-1f1ed",desc:"Bahrain Flag"},{code:"1f1e7-1f1ee",desc:"Burundi Flag"},{code:"1f1e7-1f1ef",desc:"Benin Flag"},{code:"1f1e7-1f1f1",desc:"St. Barth\xe9lemy Flag"},{code:"1f1e7-1f1f2",desc:"Bermuda Flag"},{code:"1f1e7-1f1f4",desc:"Bolivia Flag"},{code:"1f1e7-1f1f6",desc:"Caribbean Netherlands Flag"},{code:"1f1e7-1f1f7",desc:"Brazil Flag"},{code:"1f1e7-1f1f8",desc:"Bahamas Flag"},{code:"1f1e7-1f1f9",desc:"Bhutan Flag"},{code:"1f1e7-1f1fb",desc:"Bouvet Island Flag"},{code:"1f1e7-1f1fc",desc:"Botswana Flag"},{code:"1f1e7-1f1fe",desc:"Belarus Flag"},{code:"1f1e7-1f1ff",desc:"Belize Flag"},{code:"1f1e8-1f1e6",desc:"Canada Flag"},{code:"1f1e8-1f1e8",desc:"Cocos (keeling) Islands Flag"},{code:"1f1e8-1f1e9",desc:"Congo - Kinshasa Flag"},{code:"1f1e8-1f1eb",desc:"Central African Republic Flag"},{code:"1f1e8-1f1ec",desc:"Congo - Brazzaville Flag"},{code:"1f1e8-1f1ed",desc:"Switzerland Flag"},{code:"1f1e8-1f1ee",desc:"C\xf4te D\u2019ivoire Flag"},{code:"1f1e8-1f1f0",desc:"Cook Islands Flag"},{code:"1f1e8-1f1f1",desc:"Chile Flag"},{code:"1f1e8-1f1f2",desc:"Cameroon Flag"},{code:"1f1e8-1f1f4",desc:"Colombia Flag"},{code:"1f1e8-1f1f7",desc:"Costa Rica Flag"},{code:"1f1e8-1f1fa",desc:"Cuba Flag"},{code:"1f1e8-1f1fb",desc:"Cape Verde Flag"},{code:"1f1e8-1f1fc",desc:"Cura\xe7ao Flag"},{code:"1f1e8-1f1fd",desc:"Christmas Island Flag"},{code:"1f1e8-1f1fe",desc:"Cyprus Flag"},{code:"1f1e8-1f1ff",desc:'Czechia Flag"'},{code:"1f1e9-1f1ec",desc:"Diego Garcia Flag"},{code:"1f1e9-1f1ef",desc:"Djibouti Flag"},{code:"1f1e9-1f1f0",desc:"Denmark Flag"},{code:"1f1e9-1f1f2",desc:"Dominica Flag"},{code:"1f1e9-1f1f4",desc:"Dominican Republic Flag"},{code:"1f1e9-1f1ff",desc:"Algeria Flag"},{code:"1f1ea-1f1e6",desc:"Ceuta & Melilla Flag"},{code:"1f1ea-1f1e8",desc:"Ecuador Flag"},{code:"1f1ea-1f1ea",desc:"Estonia Flag"},{code:"1f1ea-1f1ec",desc:"Egypt Flag"},{code:"1f1ea-1f1ed",desc:"Western Sahara Flag"},{code:"1f1ea-1f1f7",desc:"Eritrea Flag"},{code:"1f1ea-1f1f9",desc:"Ethiopia Flag"},{code:"1f1ea-1f1fa",desc:"European Union Flag"},{code:"1f1eb-1f1ee",desc:"Finland Flag"},{code:"1f1eb-1f1ef",desc:"Fiji Flag"},{code:"1f1eb-1f1f0",desc:"Falkland Islands Flag"},{code:"1f1eb-1f1f2",desc:"Micronesia Flag"},{code:"1f1eb-1f1f4",desc:"Faroe Islands Flag"},{code:"1f1ec-1f1e6",desc:"Gabon Flag"},{code:"1f1ec-1f1e9",desc:"Grenada Flag"},{code:"1f1ec-1f1ea",desc:"Georgia Flag"},{code:"1f1ec-1f1eb",desc:"French Guiana Flag"},{code:"1f1ec-1f1ec",desc:"Guernsey Flag"},{code:"1f1ec-1f1ed",desc:"Ghana Flag"},{code:"1f1ec-1f1ee",desc:"Gibraltar Flag"},{code:"1f1ec-1f1f1",desc:"Greenland Flag"},{code:"1f1ec-1f1f2",desc:"Gambia Flag"},{code:"1f1ec-1f1f3",desc:"Guinea Flag"},{code:"1f1ec-1f1f5",desc:"Guadeloupe Flag"},{code:"1f1ec-1f1f6",desc:"Equatorial Guinea Flag"},{code:"1f1ec-1f1f7",desc:"Greece Flag"},{code:"1f1ec-1f1f8",desc:"South Georgia & South Sandwich Islands Flag"},{code:"1f1ec-1f1f9",desc:"Guatemala Flag"},{code:"1f1ec-1f1fa",desc:"Guam Flag"},{code:"1f1ec-1f1fc",desc:"Guinea-Bissau Flag"},{code:"1f1ec-1f1fe",desc:"Guyana Flag"},{code:"1f1ed-1f1f0",desc:"Hong Kong Sar China Flag"},{code:"1f1ed-1f1f2",desc:"Heard & Mcdonald Islands Flag"},{code:"1f1ed-1f1f3",desc:"Honduras Flag"},{code:"1f1ed-1f1f7",desc:"Croatia Flag"},{code:"1f1ed-1f1f9",desc:"Haiti Flag"},{code:"1f1ed-1f1fa",desc:"Hungary Flag"},{code:"1f1ee-1f1e8",desc:"Canary Islands Flag"},{code:"1f1ee-1f1e9",desc:"Indonesia Flag"},{code:"1f1ee-1f1ea",desc:"Ireland Flag"},{code:"1f1ee-1f1f1",desc:"Israel Flag"},{code:"1f1ee-1f1f2",desc:"Isle of Man Flag"},{code:"1f1ee-1f1f3",desc:"India Flag"},{code:"1f1ee-1f1f4",desc:"British Indian Ocean Territory Flag"},{code:"1f1ee-1f1f6",desc:"Iraq Flag"},{code:"1f1ee-1f1f7",desc:"Iran Flag"},{code:"1f1ee-1f1f8",desc:"Iceland Flag"},{code:"1f1ef-1f1ea",desc:"Jersey Flag"},{code:"1f1ef-1f1f2",desc:"Jamaica Flag"},{code:"1f1ef-1f1f4",desc:"Jordan Flag"},{code:"1f1f0-1f1ea",desc:"Kenya Flag"},{code:"1f1f0-1f1ec",desc:"Kyrgyzstan Flag"},{code:"1f1f0-1f1ed",desc:"Cambodia Flag"},{code:"1f1f0-1f1ee",desc:"Kiribati Flag"},{code:"1f1f0-1f1f2",desc:"Comoros Flag"},{code:"1f1f0-1f1f3",desc:"St. Kitts & Nevis Flag"},{code:"1f1f0-1f1f5",desc:"North Korea Flag"},{code:"1f1f0-1f1fc",desc:"Kuwait Flag"},{code:"1f1f0-1f1fe",desc:"Cayman Islands Flag"},{code:"1f1f0-1f1ff",desc:"Kazakhstan Flag"},{code:"1f1f1-1f1e6",desc:"Laos Flag"},{code:"1f1f1-1f1e7",desc:"Lebanon Flag"},{code:"1f1f1-1f1e8",desc:"St. Lucia Flag"},{code:"1f1f1-1f1ee",desc:"Liechtenstein Flag"},{code:"1f1f1-1f1f0",desc:"Sri Lanka Flag"},{code:"1f1f1-1f1f7",desc:"Liberia Flag"},{code:"1f1f1-1f1f8",desc:"Lesotho Flag"},{code:"1f1f1-1f1f9",desc:"Lithuania Flag"},{code:"1f1f1-1f1fa",desc:"Luxembourg Flag"},{code:"1f1f1-1f1fb",desc:"Latvia Flag"},{code:"1f1f1-1f1fe",desc:"Libya Flag"},{code:"1f1f2-1f1e6",desc:"Morocco Flag"},{code:"1f1f2-1f1e8",desc:"Monaco Flag"},{code:"1f1f2-1f1e9",desc:"Moldova Flag"},{code:"1f1f2-1f1ea",desc:"Montenegro Flag"},{code:"1f1f2-1f1eb",desc:"St. Martin Flag"},{code:"1f1f2-1f1ec",desc:"Madagascar Flag"},{code:"1f1f2-1f1ed",desc:"Marshall Islands Flag"},{code:"1f1f2-1f1f0",desc:"Macedonia Flag"},{code:"1f1f2-1f1f1",desc:"Mali Flag"},{code:"1f1f2-1f1f2",desc:"Myanmar (burma) Flag"},{code:"1f1f2-1f1f3",desc:"Mongolia Flag"},{code:"1f1f2-1f1f4",desc:"Macau Sar China Flag"},{code:"1f1f2-1f1f5",desc:"Northern Mariana Islands Flag"},{code:"1f1f2-1f1f6",desc:"Martinique Flag"},{code:"1f1f2-1f1f7",desc:"Mauritania Flag"},{code:"1f1f2-1f1f8",desc:"Montserrat Flag"},{code:"1f1f2-1f1f9",desc:"Malta Flag"},{code:"1f1f2-1f1fa",desc:"Mauritius Flag"},{code:"1f1f2-1f1fb",desc:"Maldives Flag"},{code:"1f1f2-1f1fc",desc:"Malawi Flag"},{code:"1f1f2-1f1fd",desc:"Mexico Flag"},{code:"1f1f2-1f1fe",desc:"Malaysia Flag"},{code:"1f1f2-1f1ff",desc:"Mozambique Flag"},{code:"1f1f3-1f1e6",desc:"Namibia Flag"},{code:"1f1f3-1f1e8",desc:"New Caledonia Flag"},{code:"1f1f3-1f1ea",desc:"Niger Flag"},{code:"1f1f3-1f1eb",desc:"Norfolk Island Flag"},{code:"1f1f3-1f1ec",desc:"Nigeria Flag"},{code:"1f1f3-1f1ee",desc:"Nicaragua Flag"},{code:"1f1f3-1f1f1",desc:"Netherlands Flag"},{code:"1f1f3-1f1f4",desc:"Norway Flag"},{code:"1f1f3-1f1f5",desc:"Nepal Flag"},{code:"1f1f3-1f1f7",desc:"Nauru Flag"},{code:"1f1f3-1f1fa",desc:"Niue Flag"},{code:"1f1f3-1f1ff",desc:"New Zealand Flag"},{code:"1f1f4-1f1f2",desc:"Oman Flag"},{code:"1f1f8-1f1ff",desc:"Swaziland Flag"},{code:"1f1f5-1f1e6",desc:"Panama Flag"},{code:"1f1f5-1f1ea",desc:"Peru Flag"},{code:"1f1f5-1f1eb",desc:"French Polynesia Flag"},{code:"1f1f5-1f1ec",desc:"Papua New Guinea Flag"},{code:"1f1f5-1f1ed",desc:"Philippines Flag"},{code:"1f1f5-1f1f0",desc:"Pakistan Flag"},{code:"1f1f5-1f1f1",desc:"Poland Flag"},{code:"1f1f5-1f1f2",desc:"St. Pierre & Miquelon Flag"},{code:"1f1f5-1f1f3",desc:"Pitcairn Islands Flag"},{code:"1f1f5-1f1f7",desc:"Puerto Rico Flag"},{code:"1f1f5-1f1f8",desc:"Palestinian Territories Flag"},{code:"1f1f5-1f1f9",desc:"Portugal Flag"},{code:"1f1f5-1f1fc",desc:"Palau Flag"},{code:"1f1f5-1f1fe",desc:"Paraguay Flag"},{code:"1f1f6-1f1e6",desc:"Qatar Flag"},{code:"1f1f7-1f1ea",desc:"R\xe9union Flag"},{code:"1f1f7-1f1f4",desc:"Romania Flag"},{code:"1f1f7-1f1f8",desc:"Serbia Flag"},{code:"1f1f7-1f1fc",desc:"Rwanda Flag"},{code:"1f1f8-1f1e6",desc:"Saudi Arabia Flag"},{code:"1f1f8-1f1e7",desc:"Solomon Islands Flag"},{code:"1f1f8-1f1e8",desc:"Seychelles Flag"},{code:"1f1f8-1f1e9",desc:"Sudan Flag"},{code:"1f1f8-1f1ea",desc:"Sweden Flag"},{code:"1f1f8-1f1ec",desc:"Singapore Flag"},{code:"1f1f8-1f1ee",desc:"Slovenia Flag"},{code:"1f1f8-1f1ed",desc:"St. Helena Flag"},{code:"1f1f8-1f1ef",desc:"Svalbard & Jan Mayen Flag"},{code:"1f1f8-1f1f1",desc:"Sierra Leone Flag"},{code:"1f1f8-1f1f2",desc:"San Marino Flag"},{code:"1f1f8-1f1f3",desc:"Senegal Flag"},{code:"1f1f8-1f1f4",desc:"Somalia Flag"},{code:"1f1f8-1f1f7",desc:"Suriname Flag"},{code:"1f1f8-1f1f8",desc:"South Sudan Flag"},{code:"1f1f8-1f1f9",desc:"S\xe3o Tom\xe9 & Pr\xedncipe Flag"},{code:"1f1f8-1f1fb",desc:"El Salvador Flag"},{code:"1f1f8-1f1fd",desc:"Sint Maarten Flag"},{code:"1f1f8-1f1fe",desc:"Syria Flag"},{code:"1f1f9-1f1e6",desc:"Tristan Da Cunha Flag"},{code:"1f1f9-1f1e8",desc:"Turks & Caicos Islands Flag"},{code:"1f1f9-1f1eb",desc:"French Southern Territories Flag"},{code:"1f1f9-1f1ec",desc:"Togo Flag"},{code:"1f1f9-1f1ed",desc:"Thailand Flag"},{code:"1f1f9-1f1ef",desc:"Tajikistan Flag"},{code:"1f1f9-1f1f0",desc:"Tokelau Flag"},{code:"1f1f9-1f1f1",desc:"Timor-Leste Flag"},{code:"1f1f9-1f1f2",desc:"Turkmenistan Flag"},{code:"1f1f9-1f1f3",desc:"Tunisia Flag"},{code:"1f1f9-1f1f4",desc:"Tonga Flag"},{code:"1f1f9-1f1f7",desc:"Turkey Flag"},{code:"1f1f9-1f1f9",desc:"Trinidad & Tobago Flag"},{code:"1f1f9-1f1fb",desc:"Tuvalu Flag"},{code:"1f1f9-1f1fc",desc:"Taiwan Flag"},{code:"1f1f9-1f1ff",desc:"Tanzania Flag"},{code:"1f1fa-1f1e6",desc:"Ukraine City Flag"},{code:"1f1fa-1f1ec",desc:"Uganda Flag"},{code:"1f1fa-1f1f2",desc:"U.s. Outlying Islands Flag"},{code:"1f1fa-1f1fe",desc:"Uruguay Flag"},{code:"1f1fa-1f1ff",desc:"Uzbekistan Flag"},{code:"1f1fb-1f1e6",desc:"Vatican City Flag"},{code:"1f1fb-1f1e8",desc:"St. Vincent & Grenadines Flag"},{code:"1f1fb-1f1ea",desc:"Venezuela Flag"},{code:"1f1fb-1f1ec",desc:"British Virgin Islands Flag"},{code:"1f1fb-1f1ee",desc:"U.s. Virgin Islands Flag"},{code:"1f1fb-1f1f3",desc:"Vietnam Flag"},{code:"1f1fc-1f1f8",desc:"Samoa Flag"},{code:"1f1fb-1f1fa",desc:"Vanuatu Flag"},{code:"1f1fc-1f1eb",desc:'"Wallis & Futuna Flag'},{code:"1f1fd-1f1f0",desc:"Kosovo Flag"},{code:"1f1fe-1f1ea",desc:"Yemen Flag"},{code:"1f1fe-1f1f9",desc:"Mayotte Flag"},{code:"1f1ff-1f1e6",desc:"South Africa Flag"},{code:"1f1ff-1f1f2",desc:"Zambia Flag"},{code:"1f1ff-1f1fc",desc:"Zimbabwe Flag"},{code:"1f1eb-1f1f7",desc:"France Flag"},{code:"1f1ec-1f1e7",desc:"United Kingdom Flag"},{code:"1f1ee-1f1f9",desc:"Italy Flag"},{code:"1f1ef-1f1f5",desc:"Japan Flag"},{code:"1f1f0-1f1f7",desc:"South Korea Flag"},{code:"1f1f7-1f1fa",desc:"Russia Flag"},{code:"1F6A9",desc:"Triangular Flag on Post"},{code:"1f1fa-1f1f8",desc:"United States Flag"}]}],emoticonsButtons:["emoticonsBack","|"],emoticonsUseImage:!0}),Be.PLUGINS.emoticons=function(m){var v=m.$,r=m.opts.emoticonsSet,i=r&&r[0],s="";function o(){if(!m.selection.isCollapsed())return!1;var e=m.selection.element(),t=m.selection.endElement();if(e&&m.node.hasClass(e,"fr-emoticon"))return e;if(t&&m.node.hasClass(t,"fr-emoticon"))return t;var a=m.selection.ranges(0),n=a.startContainer;if(n.nodeType==Node.ELEMENT_NODE&&0<n.childNodes.length&&0<a.startOffset){var r=n.childNodes[a.startOffset-1];if(m.node.hasClass(r,"fr-emoticon"))return r}return!1}function l(){return"".concat(function n(e,t){return'<div class="fr-buttons fr-tabs fr-tabs-scroll">\n '.concat(function a(e,n){var r="";return e.forEach(function(e){var t={image:e.code.toLowerCase()},a={elementClass:e.id===n.id?"fr-active fr-active-tab":"",emoticonsUnicodeClass:m.opts.emoticonsUseImage?"":"fr-tabs-unicode",title:m.language.translate(e.name),dataCmd:"setEmoticonCategory",dataParam1:e.id,image:m.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'.concat(t.image,'.svg"/>'):"&#x".concat(t.image,";")};r+='<button class="fr-command fr-btn '.concat(a.elementClass," ").concat(a.emoticonsUnicodeClass,'" \n title="').concat(a.title,'" data-cmd="').concat(a.dataCmd,'" data-param1="').concat(a.dataParam1,'">\n ').concat(a.image," </button>")}),r}(e,t),"\n </div>")}(r,i),"\n ").concat(function a(e){return'\n <div class="fr-icon-container fr-emoticon-container">\n '.concat(function t(e){var r="";return e.emoticons.forEach(function(e){var t=e.code.split("-").reduce(function(e,t){return e?e+"&zwj;&#x"+t.toLowerCase()+";":"&#x"+t.toLowerCase()+";"},""),a={image:e.code.toLowerCase(),compiledCode:e.uCode?e.uCode:t},n={dataParam1:e.code.toLowerCase(),dataParam2:a.compiledCode,title:m.language.translate(e.desc),image:m.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'.concat(a.image,'.svg"/>'):"".concat(a.compiledCode),desc:m.language.translate(e.desc)};r+='<span class="fr-command fr-emoticon fr-icon" role="button" \n data-cmd="insertEmoticon" data-param1="'.concat(n.dataParam1,'" \n data-param2="').concat(n.dataParam2,'" title="').concat(n.title,'" >\n ').concat(n.image,'<span class="fr-sr-only">').concat(n.desc,"&nbsp;&nbsp;&nbsp;</span></span>")}),r}(e),"\n </div>\n ")}(i),"\n ").concat(function e(){return m.opts.emoticonsUseImage?'<p style="font-size: 12px; text-align: center; padding: 0 5px;">Emoji free by <a class="fr-link" tabIndex="-1" href="http://emojione.com/" target="_blank" rel="nofollow noopener noreferrer" role="link" aria-label="Open Emoji One website.">Emoji One</a></p>':""}())}return{_init:function e(){var a=function a(){for(var e=m.el.querySelectorAll(".fr-emoticon:not(.fr-deletable)"),t=0;t<e.length;t++)e[t].className+=" fr-deletable"};a(),m.events.on("html.set",a),m.events.on("keydown",function(e){if(m.keys.isCharacter(e.which)&&m.selection.inEditor()){var t=m.selection.ranges(0),a=o();m.node.hasClass(a,"fr-emoticon-img")&&a&&(0===t.startOffset&&m.selection.element()===a?v(a).before(Be.MARKERS+Be.INVISIBLE_SPACE):v(a).after(Be.INVISIBLE_SPACE+Be.MARKERS),m.selection.restore())}}),m.events.on("keyup",function(e){for(var t=m.el.querySelectorAll(".fr-emoticon"),a=0;a<t.length;a++)"undefined"!=typeof t[a].textContent&&0===t[a].textContent.replace(/\u200B/gi,"").length&&v(t[a]).remove();if(!(e.which>=Be.KEYCODE.ARROW_LEFT&&e.which<=Be.KEYCODE.ARROW_DOWN)){var n=o();m.node.hasClass(n,"fr-emoticon-img")&&(v(n).append(Be.MARKERS),m.selection.restore())}})},insert:function c(e,t){var a=o(),n=m.selection.ranges(0);a?(0===n.startOffset&&m.selection.element()===a?v(a).before(Be.MARKERS+Be.INVISIBLE_SPACE):0<n.startOffset&&m.selection.element()===a&&n.commonAncestorContainer.parentNode.classList.contains("fr-emoticon")&&v(a).after(Be.INVISIBLE_SPACE+Be.MARKERS),m.selection.restore(),m.html.insert('<span class="fr-emoticon fr-deletable'.concat(t?" fr-emoticon-img":"",'"').concat(t?' style="background: url('.concat(t,');"'):"",">").concat(t?"&nbsp;":e,"</span>&nbsp;").concat(Be.MARKERS),!0)):m.html.insert('<span class="fr-emoticon fr-deletable'.concat(t?" fr-emoticon-img":"",'"').concat(t?' style="background: url('.concat(t,');"'):"",">").concat(t?"&nbsp;":e,"</span>&nbsp;"),!0)},setEmoticonCategory:function a(t){i=r.filter(function(e){return e.id===t})[0],function e(){m.popups.get("emoticons").html(s+l())}()},showEmoticonsPopup:function d(){var e=m.popups.get("emoticons");if(e||(e=function i(){m.opts.toolbarInline&&0<m.opts.emoticonsButtons.length&&(s='<div class="fr-buttons fr-emoticons-buttons fr-tabs">'.concat(m.button.buildList(m.opts.emoticonsButtons),"</div>"));var e={buttons:s,custom_layer:l()},t=m.popups.create("emoticons",e);return function a(g){m.events.on("popup.tab",function(e){var t=v(e.currentTarget);if(!m.popups.isVisible("emoticons")||!t.is("span, a"))return!0;var a,n,r,i=e.which;if(Be.KEYCODE.TAB==i){if(t.is("span.fr-emoticon")&&e.shiftKey||t.is("a")&&!e.shiftKey){var s=g.find(".fr-buttons");a=!m.accessibility.focusToolbar(s,!!e.shiftKey)}if(!1!==a){var o=g.find("span.fr-emoticon:focus").first().concat(g.findVisible(" div.fr-tabs").first().concat(g.find("a")));t.is("span.fr-emoticon")&&(o=o.not("span.fr-emoticon:not(:focus)")),n=o.index(t),n=e.shiftKey?((n-1)%o.length+o.length)%o.length:(n+1)%o.length,r=o.get(n),m.events.disableBlur(),r.focus(),a=!1}}else if(Be.KEYCODE.ARROW_UP==i||Be.KEYCODE.ARROW_DOWN==i||Be.KEYCODE.ARROW_LEFT==i||Be.KEYCODE.ARROW_RIGHT==i){if(t.is("span.fr-emoticon")){var l=t.parent().find("span.fr-emoticon");n=l.index(t);var c=m.opts.emoticonsStep,d=Math.floor(l.length/c),f=n%c,p=Math.floor(n/c),u=p*c+f,h=d*c;Be.KEYCODE.ARROW_UP==i?u=((u-c)%h+h)%h:Be.KEYCODE.ARROW_DOWN==i?u=(u+c)%h:Be.KEYCODE.ARROW_LEFT==i?u=((u-1)%h+h)%h:Be.KEYCODE.ARROW_RIGHT==i&&(u=(u+1)%h),r=v(l.get(u)),m.events.disableBlur(),r.focus(),a=!1}}else Be.KEYCODE.ENTER==i&&(t.is("a")?t[0].click():m.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(t),t}()),!e.hasClass("fr-active")){m.popups.refresh("emoticons"),m.popups.setContainer("emoticons",m.$tb);var t=m.$tb.find('.fr-command[data-cmd="emoticons"]'),a=m.button.getPosition(t),n=a.left,r=a.top;m.popups.show("emoticons",n,r,t.outerHeight())}},back:function t(){m.popups.hide("emoticons"),m.toolbar.showInline()}}},Be.DefineIcon("emoticons",{NAME:"smile-o",FA5NAME:"smile",SVG_KEY:"smile"}),Be.RegisterCommand("emoticons",{title:"Emoticons",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("emoticons")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("emoticons")):this.emoticons.showEmoticonsPopup()},plugin:"emoticons"}),Be.RegisterCommand("insertEmoticon",{callback:function(e,t,a){this.emoticons.insert(a,this.opts.emoticonsUseImage?"https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/".concat(t,".svg"):null),this.popups.hide("emoticons")}}),Be.RegisterCommand("setEmoticonCategory",{undo:!1,focus:!1,callback:function(e,t){this.emoticons.setEmoticonCategory(t)}}),Be.DefineIcon("emoticonsBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("emoticonsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.emoticons.back()}}),Object.assign(Be.DEFAULTS,{entities:"&quot;&#39;&iexcl;&cent;&pound;&curren;&yen;&brvbar;&sect;&uml;&copy;&ordf;&laquo;&not;&shy;&reg;&macr;&deg;&plusmn;&sup2;&sup3;&acute;&micro;&para;&middot;&cedil;&sup1;&ordm;&raquo;&frac14;&frac12;&frac34;&iquest;&Agrave;&Aacute;&Acirc;&Atilde;&Auml;&Aring;&AElig;&Ccedil;&Egrave;&Eacute;&Ecirc;&Euml;&Igrave;&Iacute;&Icirc;&Iuml;&ETH;&Ntilde;&Ograve;&Oacute;&Ocirc;&Otilde;&Ouml;&times;&Oslash;&Ugrave;&Uacute;&Ucirc;&Uuml;&Yacute;&THORN;&szlig;&agrave;&aacute;&acirc;&atilde;&auml;&aring;&aelig;&ccedil;&egrave;&eacute;&ecirc;&euml;&igrave;&iacute;&icirc;&iuml;&eth;&ntilde;&ograve;&oacute;&ocirc;&otilde;&ouml;&divide;&oslash;&ugrave;&uacute;&ucirc;&uuml;&yacute;&thorn;&yuml;&OElig;&oelig;&Scaron;&scaron;&Yuml;&fnof;&circ;&tilde;&Alpha;&Beta;&Gamma;&Delta;&Epsilon;&Zeta;&Eta;&Theta;&Iota;&Kappa;&Lambda;&Mu;&Nu;&Xi;&Omicron;&Pi;&Rho;&Sigma;&Tau;&Upsilon;&Phi;&Chi;&Psi;&Omega;&alpha;&beta;&gamma;&delta;&epsilon;&zeta;&eta;&theta;&iota;&kappa;&lambda;&mu;&nu;&xi;&omicron;&pi;&rho;&sigmaf;&sigma;&tau;&upsilon;&phi;&chi;&psi;&omega;&thetasym;&upsih;&piv;&ensp;&emsp;&thinsp;&zwnj;&zwj;&lrm;&rlm;&ndash;&mdash;&lsquo;&rsquo;&sbquo;&ldquo;&rdquo;&bdquo;&dagger;&Dagger;&bull;&hellip;&permil;&prime;&Prime;&lsaquo;&rsaquo;&oline;&frasl;&euro;&image;&weierp;&real;&trade;&alefsym;&larr;&uarr;&rarr;&darr;&harr;&crarr;&lArr;&uArr;&rArr;&dArr;&hArr;&forall;&part;&exist;&empty;&nabla;&isin;&notin;&ni;&prod;&sum;&minus;&lowast;&radic;&prop;&infin;&ang;&and;&or;&cap;&cup;&int;&there4;&sim;&cong;&asymp;&ne;&equiv;&le;&ge;&sub;&sup;&nsub;&sube;&supe;&oplus;&otimes;&perp;&sdot;&lceil;&rceil;&lfloor;&rfloor;&lang;&rang;&loz;&spades;&clubs;&hearts;&diams;"}),Be.PLUGINS.entities=function(r){var i,s,o=r.$;function n(e){var t=e.textContent;if(t.match(i)){for(var a="",n=0;n<t.length;n++)s[t[n]]?a+=s[t[n]]:a+=t[n];e.textContent=a}}function l(e){if(e&&0<=["STYLE","SCRIPT","svg","IFRAME"].indexOf(e.tagName))return!0;for(var t=r.node.contents(e),a=0;a<t.length;a++)t[a].nodeType===Node.TEXT_NODE?n(t[a]):l(t[a]);return e.nodeType===Node.TEXT_NODE&&n(e),!1}function c(e){return 0===e.length?"":r.clean.exec(e,l).replace(/\&amp;/g,"&")}return{_init:function d(){r.opts.htmlSimpleAmpersand||(r.opts.entities=r.opts.entities+"&amp;");var e=o(document.createElement("div")).html(r.opts.entities).text(),t=r.opts.entities.split(";");s={},i="";for(var a=0;a<e.length;a++){var n=e.charAt(a);s[n]=t[a]+";",i+="\\"+n+(a<e.length-1?"|":"")}i=new RegExp("("+i+")","g"),r.events.on("html.get",c,!0)}}},Object.assign(Be.POPUP_TEMPLATES,{"file.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_PROGRESS_BAR_]"}),Object.assign(Be.DEFAULTS,{fileUpload:!0,fileUploadURL:null,fileUploadParam:"file",fileUploadParams:{},fileUploadToS3:!1,fileUploadMethod:"POST",fileMaxSize:10485760,fileAllowedTypes:["*"],fileInsertButtons:["fileBack","|"],fileUseSelectedText:!1}),Be.PLUGINS.file=function(d){var n,f=d.$,l="https://i.froala.com/upload",p=2,u=3,h=4,c=5,g=6,a={};function m(){var e=d.popups.get("file.insert");e||(e=R()),e.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),e.find(".fr-file-progress-bar-layer").addClass("fr-active"),e.find(".fr-buttons").hide(),r(d.language.translate("Uploading"),0)}function i(e){var t=d.popups.get("file.insert");t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-file-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e&&(d.events.focus(),d.popups.hide("file.insert")))}function r(e,t){var a=d.popups.get("file.insert");if(a){var n=a.find(".fr-file-progress-bar-layer");n.find("h3").text(e+(t?" "+t+"%":"")),n.removeClass("fr-error"),t?(n.find("div").removeClass("fr-indeterminate"),n.find("div > span").css("width",t+"%")):n.find("div").addClass("fr-indeterminate")}}function v(e,t,a){d.edit.on(),d.events.focus(!0),d.selection.restore(),d.opts.fileUseSelectedText&&d.selection.text().length&&(t=d.selection.text()),d.html.insert('<a href="'+e+'" target="_blank" id="fr-inserted-file" class="fr-file">'+t+"</a>");var n=d.$el.find("#fr-inserted-file");n.removeAttr("id"),d.popups.hide("file.insert"),d.undo.saveStep(),L(),d.events.trigger("file.inserted",[n,a])}function E(e){var t=this.status,a=this.response,n=this.responseXML,r=this.responseText;try{if(d.opts.fileUploadToS3)if(201===t){var i=function o(e){try{var t=f(e).find("Location").text(),a=f(e).find("Key").text();return!1===d.events.trigger("file.uploadedToS3",[t,a,e],!0)?(d.edit.on(),!1):t}catch(n){return T(h,e),!1}}(n);i&&v(i,e,a||n)}else T(h,a||n);else if(200<=t&&t<300){var s=function l(e){try{if(!1===d.events.trigger("file.uploaded",[e],!0))return d.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(T(p,e),!1)}catch(a){return T(h,e),!1}}(r);s&&v(s.link,e,a||r)}else T(u,a||r)}catch(c){T(h,a||r)}}function b(){T(h,this.response||this.responseText||this.responseXML)}function A(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;r(d.language.translate("Uploading"),t)}}function T(e,t){d.edit.on(),function n(e){m();var t=d.popups.get("file.insert").find(".fr-file-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),d.events.disableBlur(),a.focus()}(d.language.translate("Something went wrong. Please try again.")),d.events.trigger("file.error",[{code:e,message:a[e]},t])}function C(){d.edit.on(),i(!0)}function s(e){if(void 0!==e&&0<e.length){if(!1===d.events.trigger("file.beforeUpload",[e]))return!1;var t,a=e[0];if((null===d.opts.fileUploadURL||d.opts.fileUploadURL===l)&&!d.opts.fileUploadToS3)return function o(r){var i=new FileReader;i.onload=function(){for(var e=i.result,t=atob(i.result.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:r.type})),d.file.insert(e,r.name,null)},m(),i.readAsDataURL(r)}(a),!1;if(a.size>d.opts.fileMaxSize)return T(c),!1;if(d.opts.fileAllowedTypes.indexOf("*")<0&&d.opts.fileAllowedTypes.indexOf(a.type.replace(/file\//g,""))<0)return T(g),!1;if(d.drag_support.formdata&&(t=d.drag_support.formdata?new FormData:null),t){var n;if(!1!==d.opts.fileUploadToS3)for(n in t.append("key",d.opts.fileUploadToS3.keyStart+(new Date).getTime()+"-"+(a.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",a.type),d.opts.fileUploadToS3.params)d.opts.fileUploadToS3.params.hasOwnProperty(n)&&t.append(n,d.opts.fileUploadToS3.params[n]);for(n in d.opts.fileUploadParams)d.opts.fileUploadParams.hasOwnProperty(n)&&t.append(n,d.opts.fileUploadParams[n]);t.append(d.opts.fileUploadParam,a);var r=d.opts.fileUploadURL;d.opts.fileUploadToS3&&(r=d.opts.fileUploadToS3.uploadURL?d.opts.fileUploadToS3.uploadURL:"https://"+d.opts.fileUploadToS3.region+".amazonaws.com/"+d.opts.fileUploadToS3.bucket);var i=d.core.getXHR(r,d.opts.fileUploadMethod);i.onload=function(){E.call(i,a.name)},i.onerror=b,i.upload.onprogress=A,i.onabort=C,m();var s=d.popups.get("file.insert");s&&(s.off("abortUpload"),s.on("abortUpload",function(){4!==i.readyState&&i.abort()})),i.send(t)}}}function o(){i()}function R(e){if(e)return d.popups.onHide("file.insert",o),!0;var t;d.opts.fileUpload||d.opts.fileInsertButtons.splice(d.opts.fileInsertButtons.indexOf("fileUpload"),1),t='<div class="fr-buttons fr-tabs">'+d.button.buildList(d.opts.fileInsertButtons)+"</div>";var a="";d.opts.fileUpload&&(a='<div class="fr-file-upload-layer fr-layer fr-active" id="fr-file-upload-layer-'+d.id+'"><strong>'+d.language.translate("Drop file")+"</strong><br>("+d.language.translate("or click")+')<div class="fr-form"><input type="file" name="'+d.opts.fileUploadParam+'" accept="'+(0<=d.opts.fileAllowedTypes.indexOf("*")?"/":"")+d.opts.fileAllowedTypes.join(", ").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-file-upload-layer-'+d.id+'" role="button"></div></div>');var n={buttons:t,upload_layer:a,progress_bar:'<div class="fr-file-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="fileDismissError" tabIndex="2" role="button">OK</button></div></div>'},r=d.popups.create("file.insert",n);return function i(a){d.events.$on(a,"dragover dragenter",".fr-file-upload-layer",function(){return f(this).addClass("fr-drop"),!1},!0),d.events.$on(a,"dragleave dragend",".fr-file-upload-layer",function(){return f(this).removeClass("fr-drop"),!1},!0),d.events.$on(a,"drop",".fr-file-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),f(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;t&&t.files&&(a.data("instance")||d).file.upload(t.files)},!0),d.helpers.isIOS()&&d.events.$on(a,"touchstart",'.fr-file-upload-layer input[type="file"]',function(){f(this).trigger("click")}),d.events.$on(a,"change",'.fr-file-upload-layer input[type="file"]',function(){if(this.files){var e=a.data("instance")||d;e.events.disableBlur(),a.find("input:focus").blur(),e.events.enableBlur(),e.file.upload(this.files)}f(this).val("")},!0)}(r),r}function t(e){d.node.hasClass(e,"fr-file")}function S(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&"undefined"!=typeof a.type){if(a.type.indexOf("image")<0){if(!d.opts.fileUpload)return e.preventDefault(),e.stopPropagation(),!1;d.markers.remove(),d.markers.insertAtPoint(e.originalEvent),d.$el.find(".fr-marker").replaceWith(Be.MARKERS),d.popups.hideAll();var n=d.popups.get("file.insert");return n||(n=R()),d.popups.setContainer("file.insert",d.$sc),d.popups.show("file.insert",e.originalEvent.pageX,e.originalEvent.pageY),m(),s(t.files),e.preventDefault(),e.stopPropagation(),!1}}else a.type.indexOf("image")<0&&(e.preventDefault(),e.stopPropagation())}}function L(){var e,t=Array.prototype.slice.call(d.el.querySelectorAll("a.fr-file")),a=[];for(e=0;e<t.length;e++)a.push(t[e].getAttribute("href"));if(n)for(e=0;e<n.length;e++)a.indexOf(n[e].getAttribute("href"))<0&&d.events.trigger("file.unlink",[n[e]]);n=t}return a[1]="File cannot be loaded from the passed link.",a[p]="No link in upload response.",a[u]="Error during file upload.",a[h]="Parsing response failed.",a[c]="File is too large.",a[g]="File file type is invalid.",a[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",{_init:function _(){!function e(){d.events.on("drop",S),d.events.$on(d.$win,"keydown",function(e){var t=e.which,a=d.popups.get("file.insert");a&&t===Be.KEYCODE.ESC&&a.trigger("abortUpload")}),d.events.on("destroy",function(){var e=d.popups.get("file.insert");e&&e.trigger("abortUpload")})}(),d.events.on("link.beforeRemove",t),d.$wp&&(L(),d.events.on("contentChanged",L)),R(!0)},showInsertPopup:function w(){var e=d.$tb.find('.fr-command[data-cmd="insertFile"]'),t=d.popups.get("file.insert");if(t||(t=R()),i(),!t.hasClass("fr-active"))if(d.popups.refresh("file.insert"),d.popups.setContainer("file.insert",d.$tb),e.isVisible){var a=d.button.getPosition(e),n=a.left,r=a.top;d.popups.show("file.insert",n,r,e.outerHeight())}else d.position.forSelection(t),d.popups.show("file.insert")},upload:s,insert:v,back:function e(){d.events.disableBlur(),d.selection.restore(),d.events.enableBlur(),d.popups.hide("file.insert"),d.toolbar.showInline()},hideProgressBar:i}},Be.DefineIcon("insertFile",{NAME:"file-o",FA5NAME:"file",SVG_KEY:"insertFile"}),Be.RegisterCommand("insertFile",{title:"Upload File",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("file.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("file.insert")):this.file.showInsertPopup()},plugin:"file"}),Be.DefineIcon("fileBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("fileBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.file.back()},refresh:function(e){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"))}}),Be.RegisterCommand("fileDismissError",{title:"OK",callback:function(){this.file.hideProgressBar(!0)}}),Object.assign(Be.DEFAULTS,{fontFamily:{"Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","Times New Roman,Times,serif,-webkit-standard":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},fontFamilySelection:!1,fontFamilyDefaultSelection:"Font Family"}),Be.PLUGINS.fontFamily=function(r){var i=r.$;function s(e){var t=e.replace(/(sans-serif|serif|monospace|cursive|fantasy)/gi,"").replace(/"|'| /g,"").split(",");return i(this).grep(t,function(e){return 0<e.length})}function o(e,t){for(var a=0;a<e.length;a++)for(var n=0;n<t.length;n++)if(e[a].toLowerCase()===t[n].toLowerCase())return[a,n];return null}function a(){var e=s(i(r.selection.element()).css("font-family")),t=[];for(var a in r.opts.fontFamily)if(r.opts.fontFamily.hasOwnProperty(a)){var n=o(e,s(a));n&&t.push([a,n])}return 0===t.length?null:(t.sort(function(e,t){var a=e[1][0]-t[1][0];return 0===a?e[1][1]-t[1][1]:a}),t[0][0])}return{apply:function t(e){r.format.applyStyle("font-family",e)},refreshOnShow:function n(e,t){t.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),t.find('.fr-command[data-param1="'+a()+'"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function l(e){if(r.opts.fontFamilySelection){var t=i(r.selection.element()).css("font-family").replace(/(sans-serif|serif|monospace|cursive|fantasy)/gi,"").replace(/"|'|/g,"").split(",");e.find("> span").text(r.opts.fontFamily[a()]||t[0]||r.language.translate(r.opts.fontFamilyDefaultSelection))}}}},Be.RegisterCommand("fontFamily",{type:"dropdown",displaySelection:function(e){return e.opts.fontFamilySelection},defaultSelection:function(e){return e.opts.fontFamilyDefaultSelection},displaySelectionWidth:120,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.fontFamily;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="fontFamily" data-param1="'+a+'" style="font-family: '+a+'" title="'+t[a]+'">'+t[a]+"</a></li>");return e+="</ul>"},title:"Font Family",callback:function(e,t){this.fontFamily.apply(t)},refresh:function(e){this.fontFamily.refresh(e)},refreshOnShow:function(e,t){this.fontFamily.refreshOnShow(e,t)},plugin:"fontFamily"}),Be.DefineIcon("fontFamily",{NAME:"font",SVG_KEY:"fontFamily"}),Object.assign(Be.DEFAULTS,{fontSize:["8","9","10","11","12","14","18","24","30","36","48","60","72","96"],fontSizeSelection:!1,fontSizeDefaultSelection:"12",fontSizeUnit:"px"}),Be.PLUGINS.fontSize=function(n){var r=n.$;return{apply:function t(e){n.format.applyStyle("font-size",e)},refreshOnShow:function i(e,t){var a=r(n.selection.element()).css("font-size");"pt"===n.opts.fontSizeUnit&&(a=Math.round(72*parseFloat(a,10)/96)+"pt"),t.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),t.find('.fr-command[data-param1="'+a+'"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function a(e){if(n.opts.fontSizeSelection){var t=n.helpers.getPX(r(n.selection.element()).css("font-size"));"pt"===n.opts.fontSizeUnit&&(t=Math.round(72*parseFloat(t,10)/96)+"pt"),e.find("> span").text(t)}}}},Be.RegisterCommand("fontSize",{type:"dropdown",title:"Font Size",displaySelection:function(e){return e.opts.fontSizeSelection},displaySelectionWidth:30,defaultSelection:function(e){return e.opts.fontSizeDefaultSelection},html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.fontSize,a=0;a<t.length;a++){var n=t[a];e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="fontSize" data-param1="'+n+this.opts.fontSizeUnit+'" title="'+n+'">'+n+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.fontSize.apply(t)},refresh:function(e){this.fontSize.refresh(e)},refreshOnShow:function(e,t){this.fontSize.refreshOnShow(e,t)},plugin:"fontSize"}),Be.DefineIcon("fontSize",{NAME:"text-height",SVG_KEY:"fontSize"}),Object.assign(Be.POPUP_TEMPLATES,{"forms.edit":"[_BUTTONS_]","forms.update":"[_BUTTONS_][_TEXT_LAYER_]"}),Object.assign(Be.DEFAULTS,{formEditButtons:["inputStyle","inputEdit"],formStyles:{"fr-rounded":"Rounded","fr-large":"Large"},formMultipleStyles:!0,formUpdateButtons:["inputBack","|"]}),Be.PLUGINS.forms=function(s){var o,l=s.$;function t(e){e.preventDefault(),s.selection.clear(),l(this).data("mousedown",!0)}function a(e){l(this).data("mousedown")&&(e.stopPropagation(),l(this).removeData("mousedown"),d(o=this)),e.preventDefault()}function n(){s.$el.find("input, textarea, button").removeData("mousedown")}function r(){l(this).removeData("mousedown")}function c(){return o||null}function d(e){var t=s.popups.get("forms.edit");t||(t=function i(){var e="";0<s.opts.formEditButtons.length&&(e='<div class="fr-buttons">'.concat(s.button.buildList(s.opts.formEditButtons),"</div>"));var t={buttons:e},a=s.popups.create("forms.edit",t);return s.$wp&&s.events.$on(s.$wp,"scroll.link-edit",function(){c()&&s.popups.isVisible("forms.edit")&&d(c())}),a}());var a=l(o=e);s.popups.refresh("forms.edit"),s.popups.setContainer("forms.edit",s.$sc);var n=a.offset().left+a.outerWidth()/2,r=a.offset().top+a.outerHeight();s.popups.show("forms.edit",n,r,a.outerHeight())}function i(){var e=s.popups.get("forms.update"),t=c();if(t){var a=l(t);a.is("button")?e.find('input[type="text"][name="text"]').val(a.text()):e.find('input[type="text"][name="text"]').val(a.attr("placeholder"))}e.find('input[type="text"][name="text"]').trigger("change")}function f(){o=null}function p(e){if(e)return s.popups.onRefresh("forms.update",i),s.popups.onHide("forms.update",f),!0;var t="";1<=s.opts.formUpdateButtons.length&&(t='<div class="fr-buttons">'.concat(s.button.buildList(s.opts.formUpdateButtons),"</div>"));var a=0,n={buttons:t,text_layer:'<div class="fr-forms-text-layer fr-layer fr-active"> \n <div class="fr-input-line"><input name="text" type="text" placeholder="Text" tabIndex=" '.concat(++a,' "></div>\n <div class="fr-action-buttons"><button class="fr-command fr-submit" data-cmd="updateInput" href="#" tabIndex="').concat(2,'" type="button">').concat(s.language.translate("Update"),"</button></div></div>")};return s.popups.create("forms.update",n)}return{_init:function u(){!function e(){s.events.$on(s.$el,s._mousedown,"input, textarea, button",t),s.events.$on(s.$el,s._mouseup,"input, textarea, button",a),s.events.$on(s.$el,"touchmove","input, textarea, button",r),s.events.$on(s.$el,s._mouseup,n),s.events.$on(s.$win,s._mouseup,n),p(!0)}(),s.events.$on(s.$el,"submit","form",function(e){return e.preventDefault(),!1})},updateInput:function h(){var e=s.popups.get("forms.update"),t=c();if(t){var a=l(t),n=e.find('input[type="text"][name="text"]').val()||"";n.length&&(a.is("button")?a.text(n):a.attr("placeholder",n)),s.popups.hide("forms.update"),d(t)}},getInput:c,applyStyle:function g(e,t,a){void 0===t&&(t=s.opts.formStyles),void 0===a&&(a=s.opts.formMultipleStyles);var n=c();if(!n)return!1;if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),l(n).removeClass(r.join(" "))}l(n).toggleClass(e)},showUpdatePopup:function m(){var e=c();if(e){var t=l(e),a=s.popups.get("forms.update");a||(a=p()),s.popups.isVisible("forms.update")||s.popups.refresh("forms.update"),s.popups.setContainer("forms.update",s.$sc);var n=t.offset().left+t.outerWidth()/2,r=t.offset().top+t.outerHeight();s.popups.show("forms.update",n,r,t.outerHeight())}},showEditPopup:d,back:function v(){s.events.disableBlur(),s.selection.restore(),s.events.enableBlur();var e=c();e&&s.$wp&&("BUTTON"===e.tagName&&s.selection.restore(),d(e))}}},Be.RegisterCommand("updateInput",{undo:!1,focus:!1,title:"Update",callback:function(){this.forms.updateInput()}}),Be.DefineIcon("inputStyle",{NAME:"magic",SVG_KEY:"inlineStyle"}),Be.RegisterCommand("inputStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list">',t=this.opts.formStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li><a class="fr-command" tabIndex="-1" data-cmd="inputStyle" data-param1="'.concat(a,'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){var a=this.forms.getInput();a&&(this.forms.applyStyle(t),this.forms.showEditPopup(a))},refreshOnShow:function(e,t){var a=this.$,n=this.forms.getInput();if(n){var r=a(n);t.find(".fr-command").each(function(){var e=a(this).data("param1");a(this).toggleClass("fr-active",r.hasClass(e))})}}}),Be.DefineIcon("inputEdit",{NAME:"edit"}),Be.RegisterCommand("inputEdit",{title:"Edit Button",undo:!1,refreshAfterCallback:!1,callback:function(){this.forms.showUpdatePopup()}}),Be.DefineIcon("inputBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("inputBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.forms.back()}}),Be.RegisterCommand("updateInput",{undo:!1,focus:!1,title:"Update",callback:function(){this.forms.updateInput()}}),Be.PLUGINS.fullscreen=function(r){var t,a,n,i,s=r.$;function o(){return r.$box.hasClass("fr-fullscreen")}function l(){if(r.helpers.isIOS()&&r.core.hasFocus())return r.$el.blur(),setTimeout(d,250),!1;t=r.helpers.scrollTop(),r.$box.toggleClass("fr-fullscreen"),s("body").first().toggleClass("fr-fullscreen"),r.helpers.isMobile()&&(r.$tb.data("parent",r.$tb.parent()),r.$box.prepend(r.$tb),r.$tb.data("sticky-dummy")&&r.$tb.after(r.$tb.data("sticky-dummy"))),a=r.opts.height,n=r.opts.heightMax,i=r.opts.zIndex,r.opts.height=r.o_win.innerHeight-(r.opts.toolbarInline?0:r.$tb.outerHeight()+(r.$second_tb?r.$second_tb.outerHeight():0)),r.opts.zIndex=2147483641,r.opts.heightMax=null,r.size.refresh(),r.opts.toolbarInline&&r.toolbar.showInline();for(var e=r.$box.parent();!e.first().is("body");)e.addClass("fr-fullscreen-wrapper"),e=e.parent();r.opts.toolbarContainer&&r.$box.prepend(r.$tb),r.events.trigger("charCounter.update"),r.events.trigger("codeView.update"),r.$win.trigger("scroll")}function c(){if(r.helpers.isIOS()&&r.core.hasFocus())return r.$el.blur(),setTimeout(d,250),!1;r.$box.toggleClass("fr-fullscreen"),s("body").first().toggleClass("fr-fullscreen"),r.$tb.data("parent")&&r.$tb.data("parent").prepend(r.$tb),r.$tb.data("sticky-dummy")&&r.$tb.after(r.$tb.data("sticky-dummy")),r.opts.height=a,r.opts.heightMax=n,r.opts.zIndex=i,r.size.refresh(),s(r.o_win).scrollTop(t),r.opts.toolbarInline&&r.toolbar.showInline(),r.events.trigger("charCounter.update"),r.opts.toolbarSticky&&r.opts.toolbarStickyOffset&&(r.opts.toolbarBottom?r.$tb.css("bottom",r.opts.toolbarStickyOffset).data("bottom",r.opts.toolbarStickyOffset):r.$tb.css("top",r.opts.toolbarStickyOffset).data("top",r.opts.toolbarStickyOffset));for(var e=r.$box.parent();!e.first().is("body");)e.removeClass("fr-fullscreen-wrapper"),e=e.parent();r.opts.toolbarContainer&&s(r.opts.toolbarContainer).append(r.$tb),s(r.o_win).trigger("scroll"),r.events.trigger("codeView.update")}function d(){o()?c():l(),f(r.$tb.find('.fr-command[data-cmd="fullscreen"]'));var e=r.$tb.find('.fr-command[data-cmd="moreText"]'),t=r.$tb.find('.fr-command[data-cmd="moreParagraph"]'),a=r.$tb.find('.fr-command[data-cmd="moreRich"]'),n=r.$tb.find('.fr-command[data-cmd="moreMisc"]');e.length&&r.refresh.moreText(e),t.length&&r.refresh.moreParagraph(t),a.length&&r.refresh.moreRich(a),n.length&&r.refresh.moreMisc(n)}function f(e){var t=o();e.toggleClass("fr-active",t).attr("aria-pressed",t),e.find("> *").not(".fr-sr-only").replaceWith(t?r.icon.create("fullscreenCompress"):r.icon.create("fullscreen"))}return{_init:function e(){if(!r.$wp)return!1;r.events.$on(s(r.o_win),"resize",function(){o()&&(c(),l())}),r.events.on("toolbar.hide",function(){if(o()&&r.helpers.isMobile())return!1}),r.events.on("position.refresh",function(){if(r.helpers.isIOS())return!o()}),r.events.on("destroy",function(){o()&&c()},!0)},toggle:d,refresh:f,isActive:o}},Be.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,toggle:!0,callback:function(){this.fullscreen.toggle()},refresh:function(e){this.fullscreen.refresh(e)},plugin:"fullscreen"}),Be.DefineIcon("fullscreen",{NAME:"expand",SVG_KEY:"fullscreen"}),Be.DefineIcon("fullscreenCompress",{NAME:"compress",SVG_KEY:"exitFullscreen"}),Object.assign(Be.DEFAULTS,{helpSets:[{title:"Inline Editor",commands:[{val:"OSkeyE",desc:"Show the editor"}]},{title:"Common actions",commands:[{val:"OSkeyC",desc:"Copy"},{val:"OSkeyX",desc:"Cut"},{val:"OSkeyV",desc:"Paste"},{val:"OSkeyZ",desc:"Undo"},{val:"OSkeyShift+Z",desc:"Redo"},{val:"OSkeyK",desc:"Insert Link"},{val:"OSkeyP",desc:"Insert Image"}]},{title:"Basic Formatting",commands:[{val:"OSkeyA",desc:"Select All"},{val:"OSkeyB",desc:"Bold"},{val:"OSkeyI",desc:"Italic"},{val:"OSkeyU",desc:"Underline"},{val:"OSkeyS",desc:"Strikethrough"},{val:"OSkey]",desc:"Increase Indent"},{val:"OSkey[",desc:"Decrease Indent"}]},{title:"Quote",commands:[{val:"OSkey'",desc:"Increase quote level"},{val:"OSkeyShift+'",desc:"Decrease quote level"}]},{title:"Image / Video",commands:[{val:"OSkey+",desc:"Resize larger"},{val:"OSkey-",desc:"Resize smaller"}]},{title:"Table",commands:[{val:"Alt+Space",desc:"Select table cell"},{val:"Shift+Left/Right arrow",desc:"Extend selection one cell"},{val:"Shift+Up/Down arrow",desc:"Extend selection one row"}]},{title:"Navigation",commands:[{val:"OSkey/",desc:"Shortcuts"},{val:"Alt+F10",desc:"Focus popup / toolbar"},{val:"Esc",desc:"Return focus to previous position"}]}]}),Be.PLUGINS.help=function(o){var n,r=o.$,i="help";return{_init:function e(){},show:function l(){if(!n){var e="<h4>"+o.language.translate("Shortcuts")+"</h4>",t=function s(){for(var e='<div class="fr-help-modal">',t=0;t<o.opts.helpSets.length;t++){var a=o.opts.helpSets[t],n="<table>";n+="<thead><tr><th>"+o.language.translate(a.title)+"</th></tr></thead>",n+="<tbody>";for(var r=0;r<a.commands.length;r++){var i=a.commands[r];n+="<tr>",n+="<td>"+o.language.translate(i.desc)+"</td>",n+="<td>"+i.val.replace("OSkey",o.helpers.isMac()?"&#8984;":"Ctrl+")+"</td>",n+="</tr>"}e+=n+="</tbody></table>"}return e+="</div>"}(),a=o.modals.create(i,e,t);n=a.$modal,o.events.$on(r(o.o_win),"resize",function(){o.modals.resize(i)})}o.modals.show(i),o.modals.resize(i)},hide:function t(){o.modals.hide(i)}}},Be.DefineIcon("help",{NAME:"question",SVG_KEY:"help"}),Be.RegisterShortcut(Be.KEYCODE.SLASH,"help",null,"/"),Be.RegisterCommand("help",{title:"Help",icon:"help",undo:!1,focus:!1,modal:!0,callback:function(){this.help.show()},plugin:"help",showOnMobile:!1}),Object.assign(Be.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(Be.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","webp"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),Be.PLUGINS.image=function(f){var p,l,c,d,o,a,u=f.$,s="https://i.froala.com/upload",t=!1,n=1,h=2,g=3,m=4,v=5,E=6,r={};function b(){var e=f.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),p&&e.val(p.attr("src")),e.trigger("change")}function i(){var e=f.popups.get("image.edit");if(e||(e=x()),e){var t=Ae();Te()&&(t=t.find(".fr-img-wrap")),f.popups.setContainer("image.edit",f.$sc),f.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();p.hasClass("fr-uploading")?F():f.popups.show("image.edit",a,n,t.outerHeight(),!0)}}function A(){k()}function T(e){0<e.parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first());var t=e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,a=e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":ge(e);he(e,t,a),e.removeClass("fr-dib fr-dii fr-fir fr-fil")}function C(){for(var e,t="IMG"==f.el.tagName?[f.el]:f.el.querySelectorAll("img"),a=0;a<t.length;a++){var n=u(t[a]);!f.opts.htmlUntouched&&f.opts.useClasses?((f.opts.imageDefaultAlign||f.opts.imageDefaultDisplay)&&(0<(e=n).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first()),e.hasClass("fr-dii")||e.hasClass("fr-dib")||(e.addClass("fr-fi"+ge(e)[0]),e.addClass("fr-di"+me(e)[0]),e.css("margin",""),e.css("float",""),e.css("display",""),e.css("z-index",""),e.css("position",""),e.css("overflow",""),e.css("vertical-align",""))),f.opts.imageTextNear||(0<n.parents(".fr-img-caption").length?n.parents(".fr-img-caption").first().removeClass("fr-dii").addClass("fr-dib"):n.removeClass("fr-dii").addClass("fr-dib"))):f.opts.htmlUntouched||f.opts.useClasses||(f.opts.imageDefaultAlign||f.opts.imageDefaultDisplay)&&T(n),f.opts.iframe&&n.on("load",f.size.syncIframe)}}function R(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(f.el.querySelectorAll("img")),n=[];for(t=0;t<a.length;t++)if(n.push(a[t].getAttribute("src")),u(a[t]).toggleClass("fr-draggable",f.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&f.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;f.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var i=a[t].nextSibling;i&&!f.browser.mozilla&&i.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)n.indexOf(o[t].getAttribute("src"))<0&&f.events.trigger("image.removed",[u(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&f.events.trigger("image.loaded",[u(a[t])])}o=a}function S(){if(l||function s(){var e;f.shared.$image_resizer?(l=f.shared.$image_resizer,d=f.shared.$img_overlay,f.events.on("destroy",function(){u("body").first().append(l.removeClass("fr-active"))},!0)):(f.shared.$image_resizer=u(document.createElement("div")).attr("class","fr-image-resizer"),l=f.shared.$image_resizer,f.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),f.opts.imageResize&&(l.append(L("nw")+L("ne")+L("sw")+L("se")),f.shared.$img_overlay=u(document.createElement("div")).attr("class","fr-image-overlay"),d=f.shared.$img_overlay,e=l.get(0).ownerDocument,u(e).find("body").first().append(d)));f.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,f.opts.imageResize&&(d.remove(),d=null)},!0),f.helpers.isMobile()||f.events.$on(u(f.o_win),"resize",function(){p&&!p.hasClass("fr-uploading")?de(!0):p&&(S(),ve(),F(!1))});if(f.opts.imageResize){e=l.get(0).ownerDocument,f.events.$on(l,f._mousedown,".fr-handler",w),f.events.$on(u(e),f._mousemove,y),f.events.$on(u(e.defaultView||e.parentWindow),f._mouseup,I),f.events.$on(d,"mouseleave",I);var n=1,r=null,i=0;f.events.on("keydown",function(e){if(p){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-i)&&(n=1),(a==Be.KEYCODE.EQUALS||f.browser.mozilla&&a==Be.KEYCODE.FF_EQUALS)&&t&&!e.altKey?n=ee.call(this,e,1,1,n):(a==Be.KEYCODE.HYPHEN||f.browser.mozilla&&a==Be.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?n=ee.call(this,e,2,-1,n):f.keys.ctrlKey(e)||a!=Be.KEYCODE.ENTER||(p.before("<br>"),M(p)),r=a,i=e.timeStamp}},!0),f.events.on("keyup",function(){n=1})}}(),!p)return!1;var e=f.$wp||f.$sc;e.append(l),l.data("instance",f);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=f.helpers.getPX(e.css("border-left-width")),t-=f.helpers.getPX(e.css("border-top-width")),f.$el.is("img")&&f.$sc.is("body")&&(a=t=0);var n=Ae();Te()&&(n=n.find(".fr-img-wrap"));var r=0,i=0;f.opts.iframe&&(r=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-top")),i=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-left"))),l.css("top",(f.opts.iframe?n.offset().top+r:n.offset().top+t)-1).css("left",(f.opts.iframe?n.offset().left+i:n.offset().left+a)-1).css("width",n.get(0).getBoundingClientRect().width).css("height",n.get(0).getBoundingClientRect().height).addClass("fr-active")}function L(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function _(e){Te()?p.parents(".fr-img-caption").css("width",e):p.css("width",e)}function w(e){if(!f.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),f.$el.find("img.fr-error").left)return!1;f.undo.canDo()||f.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=f.$oel.get(0).ownerDocument,n=a.defaultView||a.parentWindow,r=!1;try{r=n.location!=n.parent.location&&!(n.$&&n.$.FE)}catch(o){}r&&n.frameElement&&(t+=f.helpers.getPX(u(n.frameElement).offset().left)+n.frameElement.clientLeft)}(c=u(this)).data("start-x",t),c.data("start-width",p.width()),c.data("start-height",p.height());var i=p.width();if(f.opts.imageResizeWithPercent){var s=p.parentsUntil(f.$el,f.html.blockTagsQuery()).get(0)||f.el;i=(i/u(s).outerWidth()*100).toFixed(2)+"%"}_(i),d.show(),f.popups.hideAll(),ue()}function y(e){if(!f.core.sameInstance(l))return!0;var t;if(c&&p){if(e.preventDefault(),f.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var n=a-c.data("start-x"),r=c.data("start-width");if((c.hasClass("fr-hnw")||c.hasClass("fr-hsw"))&&(n=0-n),f.opts.imageResizeWithPercent){var i=p.parentsUntil(f.$el,f.html.blockTagsQuery()).get(0)||f.el;r=((r+n)/u(i).outerWidth()*100).toFixed(2),f.opts.imageRoundPercent&&(r=Math.round(r)),_(r+"%"),(t=Te()?(f.helpers.getPX(p.parents(".fr-img-caption").css("width"))/u(i).outerWidth()*100).toFixed(2):(f.helpers.getPX(p.css("width"))/u(i).outerWidth()*100).toFixed(2))===r||f.opts.imageRoundPercent||_(t+"%"),p.css("height","").removeAttr("height")}else r+n>=f.opts.imageMinWidth&&(_(r+n),t=Te()?f.helpers.getPX(p.parents(".fr-img-caption").css("width")):f.helpers.getPX(p.css("width"))),t!==r+n&&_(t),((p.attr("style")||"").match(/(^height:)|(; *height:)/)||p.attr("height"))&&(p.css("height",c.data("start-height")*p.width()/c.data("start-width")),p.removeAttr("height"));S(),f.events.trigger("image.resize",[be()])}}function I(e){if(!f.core.sameInstance(l))return!0;if(c&&p){if(e&&e.stopPropagation(),f.$el.find("img.fr-error").left)return!1;c=null,d.hide(),S(),i(),f.undo.saveStep(),f.events.trigger("image.resizeEnd",[be()])}}function O(e,t,a){f.edit.on(),p&&p.addClass("fr-error"),r[e]?D(r[e]):D(f.language.translate("Something went wrong. Please try again.")),!p&&a&&te(a),f.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function x(e){if(e)return f.$wp&&f.events.$on(f.$wp,"scroll.image-edit",function(){p&&f.popups.isVisible("image.edit")&&(f.events.disableBlur(),i())}),!0;var t="";if(0<f.opts.imageEditButtons.length){var a={buttons:t+='<div class="fr-buttons"> \n '.concat(f.button.buildList(f.opts.imageEditButtons),"\n </div>")};return f.popups.create("image.edit",a)}return!1}function F(e){var t=f.popups.get("image.insert");if(t||(t=z()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),p){var a=Ae();f.popups.setContainer("image.insert",f.$sc);var n=a.offset().left,r=a.offset().top+a.height();f.popups.show("image.insert",n,r,a.outerHeight())}void 0===e&&N(f.language.translate("Uploading"),0)}function k(e){var t=f.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||f.$el.find("img.fr-error").length)){if(f.events.focus(),f.$el.find("img.fr-error").length&&(f.$el.find("img.fr-error").remove(),f.undo.saveStep(),f.undo.run(),f.undo.dropRedo()),!f.$wp&&p){var a=p;de(!0),f.selection.setAfter(a.get(0)),f.selection.restore()}f.popups.hide("image.insert")}}function N(e,t){var a=f.popups.get("image.insert");if(a){var n=a.find(".fr-image-progress-bar-layer");n.find("h3").text(e+(t?" "+t+"%":"")),n.removeClass("fr-error"),t?(n.find("div").removeClass("fr-indeterminate"),n.find("div > span").css("width",t+"%")):n.find("div").addClass("fr-indeterminate")}}function D(e){F();var t=f.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),f.events.disableBlur(),a.focus()}function M(e){ce.call(e.get(0))}function B(){var e=u(this);f.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),M(e),f.events.trigger("image.loaded",[e])}function P(s,e,o,l,c){f.edit.off(),N(f.language.translate("Loading image")),e&&(s=f.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){f.undo.canDo()||l.hasClass("fr-uploading")||f.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),f.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var n=e.get(0).attributes,r=0;r<n.length;r++){var i=n[r];0===i.nodeName.indexOf("data-")&&e.removeAttr(i.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",B),e.attr("src",s),f.edit.on(),R(!1),f.undo.saveStep(),f.events.disableBlur(),f.$el.blur(),f.events.trigger(a?"image.replaced":"image.inserted",[e,c])}else e=H(s,o,B),R(!1),f.undo.saveStep(),f.events.disableBlur(),f.$el.blur(),f.events.trigger("image.inserted",[e,c])},t.onerror=function(){O(n)},F(f.language.translate("Loading image")),t.src=s}function U(e){N(f.language.translate("Loading image"));var t=this.status,a=this.response,n=this.responseXML,r=this.responseText;try{if(f.opts.imageUploadToS3)if(201==t){var i=function o(e){try{var t=u(e).find("Location").text(),a=u(e).find("Key").text();return!1===f.events.trigger("image.uploadedToS3",[t,a,e],!0)?(f.edit.on(),!1):t}catch(n){return O(m,e),!1}}(n);i&&P(i,!1,[],e,a||n)}else O(m,a||n,e);else if(200<=t&&t<300){var s=function l(e){try{if(!1===f.events.trigger("image.uploaded",[e],!0))return f.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(O(h,e),!1)}catch(a){return O(m,e),!1}}(r);s&&P(s.link,!1,s,e,a||r)}else O(g,a||r,e)}catch(c){O(m,a||r,e)}}function W(){O(m,this.response||this.responseText||this.responseXML)}function K(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;N(f.language.translate("Uploading"),t)}}function H(e,t,a){var n,r=u(document.createElement("img")).attr("src",e);if(t&&void 0!==t)for(n in t)t.hasOwnProperty(n)&&"link"!=n&&(" data-"+n+'="'+t[n]+'"',r.attr("data-str"+n,t[n]));var i=f.opts.imageDefaultWidth;i&&"auto"!=i&&(i=f.opts.imageResizeWithPercent?"100%":i+"px"),r.attr("style",i?"width: "+i+";":""),he(r,f.opts.imageDefaultDisplay,f.opts.imageDefaultAlign),r.on("load",a),r.on("error",a),f.edit.on(),f.events.focus(!0),f.selection.restore(),f.undo.saveStep(),f.opts.imageSplitHTML?f.markers.split():f.markers.insert(),f.html.wrap();var s=f.$el.find(".fr-marker");return s.length?(s.parent().is("hr")&&s.parent().after(s),f.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(r)):f.$el.append(r),f.selection.clear(),r}function $(){f.edit.on(),k(!0)}function G(e,t){if(void 0!==e&&0<e.length){if(!1===f.events.trigger("image.beforeUpload",[e,t]))return!1;var a,n=e[0];if((null===f.opts.imageUploadURL||f.opts.imageUploadURL==s)&&!f.opts.imageUploadToS3)return function o(r,i){var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:r.type})),f.image.insert(e,!1,null,i)}},F(),s.readAsDataURL(r)}(n,t||p),!1;if(n.name||(n.name=(new Date).getTime()+"."+(n.type||"image/jpeg").replace(/image\//g,"")),n.size>f.opts.imageMaxSize)return O(v),!1;if(f.opts.imageAllowedTypes.indexOf(n.type.replace(/image\//g,""))<0)return O(E),!1;if(f.drag_support.formdata&&(a=f.drag_support.formdata?new FormData:null),a){var r;if(!1!==f.opts.imageUploadToS3)for(r in a.append("key",f.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(n.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",n.type),f.opts.imageUploadToS3.params)f.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,f.opts.imageUploadToS3.params[r]);for(r in f.opts.imageUploadParams)f.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,f.opts.imageUploadParams[r]);a.append(f.opts.imageUploadParam,n,n.name);var i=f.opts.imageUploadURL;f.opts.imageUploadToS3&&(i=f.opts.imageUploadToS3.uploadURL?f.opts.imageUploadToS3.uploadURL:"https://"+f.opts.imageUploadToS3.region+".amazonaws.com/"+f.opts.imageUploadToS3.bucket),function l(t,a,e,r){function i(){var e=u(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),f.placeholder.refresh(),M(e),S(),F(),f.edit.off(),t.onload=function(){U.call(t,e)},t.onerror=W,t.upload.onprogress=K,t.onabort=$,u(e.off("abortUpload")).on("abortUpload",function(){4!=t.readyState&&(t.abort(),r?(r.attr("src",r.data("fr-old-src")),r.removeClass("fr-uploading")):e.remove(),de(!0))}),t.send(a)}var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.on("load",i),r.on("error",function(){i(),u(this).off("error")}),f.edit.on(),f.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):H(e,null,i)},s.readAsDataURL(e)}(f.core.getXHR(i,f.opts.imageUploadMethod),a,n,t||p)}}}function Y(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function V(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=f.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!f.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;f.markers.remove(),f.markers.insertAtPoint(e.originalEvent),f.$el.find(".fr-marker").replaceWith(Be.MARKERS),0===f.$el.find(".fr-marker").length&&f.selection.setAtEnd(f.el),f.popups.hideAll();var n=f.popups.get("image.insert");n||(n=z()),f.popups.setContainer("image.insert",f.$sc);var r=e.originalEvent.pageX,i=e.originalEvent.pageY;if(f.opts.iframe){var s=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-top")),o=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-left"));i+=f.$iframe.offset().top+s,r+=f.$iframe.offset().left+o}return f.popups.show("image.insert",r,i),F(),0<=f.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(de(!0),G(t.files)):O(E),e.preventDefault(),e.stopPropagation(),!1}}}function z(e){if(e)return f.popups.onRefresh("image.insert",b),f.popups.onHide("image.insert",A),!0;var t,a,n="";f.opts.imageUpload||-1===f.opts.imageInsertButtons.indexOf("imageUpload")||f.opts.imageInsertButtons.splice(f.opts.imageInsertButtons.indexOf("imageUpload"),1);var r=f.button.buildList(f.opts.imageInsertButtons);""!==r&&(n='<div class="fr-buttons fr-tabs">'+r+"</div>");var i=f.opts.imageInsertButtons.indexOf("imageUpload"),s=f.opts.imageInsertButtons.indexOf("imageByURL"),o="";0<=i&&(t=" fr-active",0<=s&&s<i&&(t=""),o='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+f.id+'"><strong>'+f.language.translate("Drop image")+"</strong><br>("+f.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+f.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+f.id+'" role="button"></div></div>');var l="";0<=s&&(t=" fr-active",0<=i&&i<s&&(t=""),l='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+f.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+f.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+f.language.translate("Insert")+"</button></div></div>");var c={buttons:n,upload_layer:o,by_url_layer:l,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'};return 1<=f.opts.imageInsertButtons.length&&(a=f.popups.create("image.insert",c)),f.$wp&&f.events.$on(f.$wp,"scroll",function(){p&&f.popups.isVisible("image.insert")&&ve()}),function d(n){f.events.$on(n,"dragover dragenter",".fr-image-upload-layer",function(){return u(this).addClass("fr-drop"),!1},!0),f.events.$on(n,"dragleave dragend",".fr-image-upload-layer",function(){return u(this).removeClass("fr-drop"),!1},!0),f.events.$on(n,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),u(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=n.data("instance")||f;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),f.helpers.isIOS()&&f.events.$on(n,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){u(this).trigger("click")},!0),f.events.$on(n,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=n.data("instance")||f;e.events.disableBlur(),n.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,p)}u(this).val("")},!0)}(a),a}function j(){p&&f.popups.get("image.alt").find("input").val(p.attr("alt")||"").trigger("change")}function q(){var e=f.popups.get("image.alt");e||(e=X()),k(),f.popups.refresh("image.alt"),f.popups.setContainer("image.alt",f.$sc);var t=Ae();Te()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();f.popups.show("image.alt",a,n,t.outerHeight(),!0)}function X(e){if(e)return f.popups.onRefresh("image.alt",j),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+f.button.buildList(f.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+f.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+f.id+'" type="text" placeholder="'+f.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+f.language.translate("Update")+"</button></div></div>"},a=f.popups.create("image.alt",t);return f.$wp&&f.events.$on(f.$wp,"scroll.image-alt",function(){p&&f.popups.isVisible("image.alt")&&q()}),a}function Q(){var e=f.popups.get("image.size");if(p)if(Te()){var t=p.parent();t.get(0).style.width||(t=p.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(p.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(p.get(0).style.height).trigger("change")}function J(){var e=f.popups.get("image.size");e||(e=Z()),k(),f.popups.refresh("image.size"),f.popups.setContainer("image.size",f.$sc);var t=Ae();Te()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();f.popups.show("image.size",a,n,t.outerHeight(),!0)}function Z(e){if(e)return f.popups.onRefresh("image.size",Q),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+f.button.buildList(f.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+f.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+f.id+'" type="text" name="width" placeholder="'+f.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+f.id+'" type="text" name="height" placeholder="'+f.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+f.language.translate("Update")+"</button></div></div>"},a=f.popups.create("image.size",t);return f.$wp&&f.events.$on(f.$wp,"scroll.image-size",function(){p&&f.popups.isVisible("image.size")&&J()}),a}function ee(e,t,a,n){return e.pageX=t,w.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,n)),y.call(this,e),I.call(this,e),++n}function te(e){(e=e||Ae())&&!1!==f.events.trigger("image.beforeRemove",[e])&&(f.popups.hideAll(),Ee(),de(!0),f.undo.canDo()||f.undo.saveStep(),e.get(0)==f.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(f.selection.setBefore(e.get(0).parentNode)||f.selection.setAfter(e.get(0).parentNode)||e.parent().after(Be.MARKERS),u(e.get(0).parentNode).remove()):(f.selection.setBefore(e.get(0))||f.selection.setAfter(e.get(0))||e.after(Be.MARKERS),e.remove()),f.html.fillEmptyBlocks(),f.selection.restore()),f.undo.saveStep())}function ae(e){var t=e.which;if(p&&(t==Be.KEYCODE.BACKSPACE||t==Be.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),te(),!1;if(p&&t==Be.KEYCODE.ESC){var a=p;return de(!0),f.selection.setAfter(a.get(0)),f.selection.restore(),e.preventDefault(),!1}if(!p||t!=Be.KEYCODE.ARROW_LEFT&&t!=Be.KEYCODE.ARROW_RIGHT)return p&&t===Be.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),de(!0),!1):p&&t!=Be.KEYCODE.F10&&!f.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0;var n=p.get(0);return de(!0),t==Be.KEYCODE.ARROW_LEFT?f.selection.setBefore(n):f.selection.setAfter(n),f.selection.restore(),e.preventDefault(),!1}function ne(e){if(e&&"IMG"==e.tagName){if(f.node.hasClass(e,"fr-uploading")||f.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):f.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&f.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var n=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<n.length;r++)ne(n[r])}function re(e){if(!1===f.events.trigger("image.beforePasteUpload",[e]))return!1;p=u(e),S(),i(),ve(),F(),p.on("load",function(){S(),u(f.popups.get("image.insert").get(0)).find("div.fr-active.fr-error").length<1&&F(),u(this).off("load")});for(var t=u(e).attr("src").split(","),a=atob(t[1]),n=[],r=0;r<a.length;r++)n.push(a.charCodeAt(r));G([new Blob([new Uint8Array(n)],{type:t[0].replace(/data\:/g,"").replace(/;base64/g,"")})],p)}function ie(){f.opts.imagePaste?f.$el.find("img[data-fr-image-pasted]").each(function(e,n){if(f.opts.imagePasteProcess){var t=f.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=f.opts.imageResizeWithPercent?"%":"px"),u(n).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),he(u(n),f.opts.imageDefaultDisplay,f.opts.imageDefaultAlign)}if(0===n.src.indexOf("data:"))re(n);else if(0===n.src.indexOf("blob:")||0===n.src.indexOf("http")&&f.opts.imageUploadRemoteUrls&&f.opts.imageCORSProxy){var a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var e,t=f.o_doc.createElement("CANVAS"),a=t.getContext("2d");t.height=this.naturalHeight,t.width=this.naturalWidth,a.drawImage(this,0,0),setTimeout(function(){re(n)},0),e=2e3<this.naturalWidth||1500<this.naturalHeight?"jpeg":"png",n.src=t.toDataURL("image/"+e)},a.src=(0===n.src.indexOf("blob:")?"":f.opts.imageCORSProxy+"/")+n.src}else 0!==n.src.indexOf("http")||0===n.src.indexOf("https://mail.google.com/mail")?(f.selection.save(),u(n).remove(),f.selection.restore()):u(n).removeAttr("data-fr-image-pasted")}):f.$el.find("img[data-fr-image-pasted]").remove()}function se(e){var t=e.target.result,a=f.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=f.opts.imageResizeWithPercent?"%":"px"),f.undo.saveStep(),f.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var n=f.$el.find('img[data-fr-image-pasted="true"]');n&&he(n,f.opts.imageDefaultDisplay,f.opts.imageDefaultAlign),f.events.trigger("paste.after")}function oe(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.types&&-1!=[].indexOf.call(e.clipboardData.types,"text/rtf")||e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return function n(e){var t=new FileReader;t.onload=se,t.readAsDataURL(e)}(t),!1}}function le(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ce(e){if("false"==u(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&f.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<Be.INSTANCES.length;t++)Be.INSTANCES[t]!=f&&Be.INSTANCES[t].events.trigger("image.hideResizer");f.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),f.helpers.isMobile()&&(f.events.disableBlur(),f.$el.blur(),f.events.enableBlur()),f.opts.iframe&&f.size.syncIframe(),p=u(this),Ee(),S(),i(),f.browser.msie?(f.popups.areVisible()&&f.events.disableBlur(),f.win.getSelection&&(f.win.getSelection().removeAllRanges(),f.win.getSelection().addRange(f.doc.createRange()))):f.selection.clear(),f.helpers.isIOS()&&(f.events.disableBlur(),f.$el.blur()),f.button.bulkRefresh(),f.events.trigger("video.hideResizer")}function de(e){p&&(function t(){return fe}()||!0===e)&&(f.toolbar.enable(),l.removeClass("fr-active"),f.popups.hide("image.edit"),p=null,ue(),c=null,d&&d.hide())}r[n]="Image cannot be loaded from the passed link.",r[h]="No link in upload response.",r[g]="Error during file upload.",r[m]="Parsing response failed.",r[v]="File is too large.",r[E]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var fe=!(r[8]="Image file is corrupted.");function pe(){fe=!0}function ue(){fe=!1}function he(e,t,a){!f.opts.htmlUntouched&&f.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:f.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*f.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+f.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+f.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:f.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function ge(e){if(void 0===e&&(e=Ae()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function me(e){void 0===e&&(e=Ae());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ve(){var e=f.popups.get("image.insert");e||(e=z()),f.popups.isVisible("image.insert")||(k(),f.popups.refresh("image.insert"),f.popups.setContainer("image.insert",f.$sc));var t=Ae();Te()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();f.popups.show("image.insert",a,n,t.outerHeight(!0),!0)}function Ee(){if(p){f.events.disableBlur(),f.selection.clear();var e=f.doc.createRange();e.selectNode(p.get(0)),f.browser.msie&&e.collapse(!0),f.selection.get().addRange(e),f.events.enableBlur()}}function be(){return p}function Ae(){return Te()?p.parents(".fr-img-caption").first():p}function Te(){return!!p&&0<p.parents(".fr-img-caption").length}return{_init:function Ce(){var n;(function e(){f.events.$on(f.$el,f._mousedown,"IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==u(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;f.helpers.isMobile()||f.selection.clear(),t=!0,f.popups.areVisible()&&f.events.disableBlur(),f.browser.msie&&(f.events.disableBlur(),f.$el.attr("contenteditable",!1)),f.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),f.events.$on(f.$el,f._mousedown,".fr-img-caption .fr-inner",function(e){f.core.hasFocus()||f.events.focus(),e.stopPropagation()}),f.events.$on(f.$el,"paste",".fr-img-caption .fr-inner",function(e){f.toolbar.hide(),e.stopPropagation()}),f.events.$on(f.$el,f._mouseup,"IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==u(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),f.browser.msie&&(f.$el.attr("contenteditable",!0),f.events.enableBlur()))}),f.events.on("keyup",function(e){if(e.shiftKey&&""===f.selection.text().replace(/\n/g,"")&&f.keys.isArrow(e.which)){var t=f.selection.element(),a=f.selection.endElement();t&&"IMG"==t.tagName?M(u(t)):a&&"IMG"==a.tagName&&M(u(a))}},!0),f.events.on("drop",V),f.events.on("element.beforeDrop",Y),f.events.on("mousedown window.mousedown",pe),f.events.on("window.touchmove",ue),f.events.on("mouseup window.mouseup",function(){if(p)return de(),!1;ue()}),f.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&de()}),f.events.on("image.resizeEnd",function(){f.opts.iframe&&f.size.syncIframe()}),f.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){de(!(t=!1))}),f.events.on("modals.hide",function(){p&&(Ee(),f.selection.clear())}),f.events.on("image.resizeEnd",function(){f.win.getSelection&&M(p)}),f.opts.imageAddNewLine&&f.events.on("image.inserted",function(e){var t=e.get(0);for(t.nextSibling&&"BR"===t.nextSibling.tagName&&(t=t.nextSibling);t&&!f.node.isElement(t);)t=f.node.isLastSibling(t)?t.parentNode:null;f.node.isElement(t)&&(f.opts.enter===Be.ENTER_BR?e.after("<br>"):u(f.node.blockParent(e.get(0))).after("<"+f.html.defaultTag()+"><br></"+f.html.defaultTag()+">"))})})(),"IMG"==f.el.tagName&&f.$el.addClass("fr-view"),f.events.$on(f.$el,f.helpers.isMobile()&&!f.helpers.isWindowsPhone()?"touchend":"click","IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',ce),f.helpers.isMobile()&&(f.events.$on(f.$el,"touchstart","IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),f.events.$on(f.$el,"touchmove",function(){a=!0})),f.$wp?(f.events.on("window.keydown keydown",ae,!0),f.events.on("keyup",function(e){if(p&&e.which==Be.KEYCODE.ENTER)return!1},!0),f.events.$on(f.$el,"keydown",function(){var e=f.selection.element();(e.nodeType===Node.TEXT_NODE||"BR"==e.tagName&&f.node.isLastSibling(e))&&(e=e.parentNode),f.node.hasClass(e,"fr-inner")||(f.node.hasClass(e,"fr-img-caption")||(e=u(e).parents(".fr-img-caption").get(0)),f.node.hasClass(e,"fr-img-caption")&&(u(e).after(Be.INVISIBLE_SPACE+Be.MARKERS),f.selection.restore()))})):f.events.$on(f.$win,"keydown",ae),f.events.on("toolbar.esc",function(){if(p){if(f.$wp)f.events.disableBlur(),f.events.focus();else{var e=p;de(!0),f.selection.setAfter(e.get(0)),f.selection.restore()}return!1}},!0),f.events.on("toolbar.focusEditor",function(){if(p)return!1},!0),f.events.on("window.cut window.copy",function(e){if(p&&f.popups.isVisible("image.edit")&&!f.popups.get("image.edit").find(":focus").length){var t=Ae();Te()?(t.before(Be.START_MARKER),t.after(Be.END_MARKER),f.selection.restore(),f.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(Ee(),f.paste.saveCopiedText(p.get(0).outerHTML,p.attr("alt"))),"copy"==e.type?setTimeout(function(){M(p)}):(de(!0),f.undo.saveStep(),setTimeout(function(){f.undo.saveStep()},0))}},!0),f.browser.msie&&f.events.on("keydown",function(e){if(!f.selection.isCollapsed()||!p)return!0;var t=e.which;t==Be.KEYCODE.C&&f.keys.ctrlKey(e)?f.events.trigger("window.copy"):t==Be.KEYCODE.X&&f.keys.ctrlKey(e)&&f.events.trigger("window.cut")}),f.events.$on(u(f.o_win),"keydown",function(e){var t=e.which;if(p&&t==Be.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),f.events.$on(f.$win,"keydown",function(e){var t=e.which;p&&p.hasClass("fr-uploading")&&t==Be.KEYCODE.ESC&&p.trigger("abortUpload")}),f.events.on("destroy",function(){p&&p.hasClass("fr-uploading")&&p.trigger("abortUpload")}),f.events.on("paste.before",oe),f.events.on("paste.beforeCleanup",le),f.events.on("paste.after",ie),f.events.on("html.set",C),f.events.on("html.inserted",C),C(),f.events.on("destroy",function(){o=[]}),f.events.on("html.processGet",ne),f.opts.imageOutputSize&&f.events.on("html.beforeGet",function(){n=f.el.querySelectorAll("img");for(var e=0;e<n.length;e++){var t=n[e].style.width||u(n[e]).width(),a=n[e].style.height||u(n[e]).height();t&&n[e].setAttribute("width",(""+t).replace(/px/,"")),a&&n[e].setAttribute("height",(""+a).replace(/px/,""))}}),f.opts.iframe&&f.events.on("image.loaded",f.size.syncIframe),f.$wp&&(R(),f.events.on("contentChanged",R)),f.events.$on(u(f.o_win),"orientationchange.image",function(){setTimeout(function(){p&&M(p)},100)}),x(!0),z(!0),Z(!0),X(!0),f.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return te(e),!1})},showInsertPopup:function Re(){var e=f.$tb.find('.fr-command[data-cmd="insertImage"]'),t=f.popups.get("image.insert");if(t||(t=z()),k(),!t.hasClass("fr-active"))if(f.popups.refresh("image.insert"),f.popups.setContainer("image.insert",f.$tb),e.isVisible()){var a=f.button.getPosition(e),n=a.left,r=a.top;f.popups.show("image.insert",n,r,e.outerHeight())}else f.position.forSelection(t),f.popups.show("image.insert")},showLayer:function Se(e){var t,a,n=f.popups.get("image.insert");if(p||f.opts.toolbarInline){if(p){var r=Ae();Te()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left}}else{var i=f.$tb.find('.fr-command[data-cmd="insertImage"]');t=i.offset().left,a=i.offset().top+(f.opts.toolbarBottom?10:i.outerHeight()-10)}!p&&f.opts.toolbarInline&&(a=n.offset().top-f.helpers.getPX(n.css("margin-top")),n.hasClass("fr-above")&&(a+=n.outerHeight())),n.find(".fr-layer").removeClass("fr-active"),n.find(".fr-"+e+"-layer").addClass("fr-active"),f.popups.show("image.insert",t,a,p?p.outerHeight():0),f.accessibility.focusPopup(n)},refreshUploadButton:function Le(e){var t=f.popups.get("image.insert");t&&t.find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function _e(e){var t=f.popups.get("image.insert");t&&t.find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:G,insertByURL:function we(){var e=f.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){F(),N(f.language.translate("Loading image"));var t=e.val().trim();if(f.opts.imageUploadRemoteUrls&&f.opts.imageCORSProxy&&f.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?G([new Blob([this.response],{type:this.response.type||"image/png"})],p):O(n)},a.onerror=function(){P(t,!0,[],p)},a.open("GET",f.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else P(t,!0,[],p);e.val(""),e.blur()}},align:function ye(e){var t=Ae();t.removeClass("fr-fir fr-fil"),!f.opts.htmlUntouched&&f.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):he(t,me(),e),Ee(),S(),i(),f.selection.clear()},refreshAlign:function Ie(e){p&&e.find("> *").first().replaceWith(f.icon.create("image-align-"+ge()))},refreshAlignOnShow:function Oe(e,t){p&&t.find('.fr-command[data-param1="'+ge()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function xe(e){var t=Ae();t.removeClass("fr-dii fr-dib"),!f.opts.htmlUntouched&&f.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):he(t,e,ge()),Ee(),S(),i(),f.selection.clear()},refreshDisplayOnShow:function Fe(e,t){p&&t.find('.fr-command[data-param1="'+me()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ve,back:function e(){p?(f.events.disableBlur(),u(".fr-popup input:focus").blur(),M(p)):(f.events.disableBlur(),f.selection.restore(),f.events.enableBlur(),f.popups.hide("image.insert"),f.toolbar.showInline())},get:be,getEl:Ae,insert:P,showProgressBar:F,remove:te,hideProgressBar:k,applyStyle:function ke(e,t,a){if(void 0===t&&(t=f.opts.imageStyles),void 0===a&&(a=f.opts.imageMultipleStyles),!p)return!1;var n=Ae();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),n.removeClass(r.join(" "))}"object"==Pe(t[e])?(n.removeAttr("style"),n.css(t[e].style)):n.toggleClass(e),M(p)},showAltPopup:q,showSizePopup:J,setAlt:function Ne(e){if(p){var t=f.popups.get("image.alt");p.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),M(p)}},setSize:function De(e,t){if(p){var a=f.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var n=/^[\d]+((px)|%)*$/g;p.removeAttr("width").removeAttr("height"),e.match(n)?p.css("width",e):p.css("width",""),t.match(n)?p.css("height",t):p.css("height",""),Te()&&(p.parents(".fr-img-caption").removeAttr("width").removeAttr("height"),e.match(n)?p.parents(".fr-img-caption").css("width",e):p.parents(".fr-img-caption").css("width",""),t.match(n)?p.parents(".fr-img-caption").css("height",t):p.parents(".fr-img-caption").css("height","")),a&&a.find("input:focus").blur(),M(p)}},toggleCaption:function Me(){var e;if(p&&!Te()){var t,a;(e=p).parent().is("a")&&(e=p.parent()),e.attr("style")&&(a=-1<(t=e.attr("style").split(":")).indexOf("width")?t[t.indexOf("width")+1].replace(";",""):"");var n=f.opts.imageResizeWithPercent?(-1<a.indexOf("px")?null:a)||"100%":p.width()+"px";e.wrap("<span "+(f.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+p.attr("class")+'" style="'+(f.opts.useClasses?"":e.attr("style"))+'" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),p.after('<span class="fr-inner"'+(f.browser.mozilla?"":' contenteditable="true"')+">"+Be.START_MARKER+f.language.translate("Image Caption")+Be.END_MARKER+"</span>"),p.removeAttr("class").removeAttr("style").removeAttr("width"),p.parents(".fr-img-caption").css("width",n),de(!0),f.selection.restore()}else e=Ae(),p.insertAfter(e),p.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),M(p)},hasCaption:Te,exitEdit:de,edit:M}},Be.DefineIcon("insertImage",{NAME:"image",SVG_KEY:"insertImage"}),Be.RegisterShortcut(Be.KEYCODE.P,"insertImage",null,"P"),Be.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),Be.DefineIcon("imageUpload",{NAME:"upload",SVG_KEY:"upload"}),Be.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),Be.DefineIcon("imageByURL",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),Be.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),Be.DefineIcon("imageDisplay",{NAME:"star",SVG_KEY:"imageDisplay"}),Be.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),Be.DefineIcon("image-align",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("image-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("image-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("image-align-center",{NAME:"align-justify",SVG_KEY:"alignCenter"}),Be.DefineIcon("imageAlign",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Be.COMMANDS.imageAlign.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="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),Be.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),Be.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),Be.DefineIcon("imageRemove",{NAME:"trash",SVG_KEY:"remove"}),Be.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),Be.DefineIcon("imageBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.$;this.image.get()||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"))}}),Be.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),Be.DefineIcon("imageStyle",{NAME:"magic",SVG_KEY:"imageClass"}),Be.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var n=t[a];"object"==Pe(n)&&(n=n.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(n)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.$,n=this.image.getEl();n&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=n.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Be.DefineIcon("imageAlt",{NAME:"info",SVG_KEY:"imageAltText"}),Be.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),Be.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),Be.DefineIcon("imageSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),Be.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),Be.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),Be.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt",SVG_KEY:"imageCaption"}),Be.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}}),Object.assign(Be.DEFAULTS,{imageManagerLoadURL:"https://i.froala.com/load-files",imageManagerLoadMethod:"get",imageManagerLoadParams:{},imageManagerPreloader:null,imageManagerDeleteURL:"",imageManagerDeleteMethod:"post",imageManagerDeleteParams:{},imageManagerPageSize:12,imageManagerScrollOffset:20,imageManagerToggleTags:!0}),Be.PLUGINS.imageManager=function(o){var l,c,i,s,d,f,p,u,h,g,m,v=o.$,E="image_manager",e=10,b=11,A=12,T=13,C=14,R=15,a=21,n=22,r={};function S(){var e=v(window).outerWidth();return e<768?2:e<1200?3:4}function L(){d.empty();for(var e=0;e<m;e++)d.append('<div class="fr-list-column"></div>')}function _(){if(h<p.length&&(d.outerHeight()<=i.outerHeight()+o.opts.imageManagerScrollOffset||i.scrollTop()+o.opts.imageManagerScrollOffset>d.outerHeight()-i.outerHeight())){u++;for(var e=o.opts.imageManagerPageSize*(u-1);e<Math.min(p.length,o.opts.imageManagerPageSize*u);e++)t(p[e])}}function t(r){var i=new Image,s=v(document.createElement("div")).attr("class","fr-image-container fr-empty fr-image-"+g++).attr("data-loading",o.language.translate("Loading")+"..").attr("data-deleting",o.language.translate("Deleting")+"..");O(!1),i.onload=function(){s.height(Math.floor(s.width()/i.width*i.height));var a=v(document.createElement("img"));if(r.thumb)a.attr("src",r.thumb);else{if(N(C,r),!r.url)return N(R,r),!1;a.attr("src",r.url)}if(r.url&&a.attr("data-url",r.url),r.tag)if(c.find(".fr-modal-more.fr-not-available").removeClass("fr-not-available"),c.find(".fr-modal-tags").show(),0<=r.tag.indexOf(",")){for(var e=r.tag.split(","),t=0;t<e.length;t++)e[t]=e[t].trim(),0===f.find('a[title="'+e[t]+'"]').length&&f.append('<a role="button" title="'+e[t]+'">'+e[t]+"</a>");a.attr("data-tag",e.join())}else 0===f.find('a[title="'+r.tag.trim()+'"]').length&&f.append('<a role="button" title="'+r.tag.trim()+'">'+r.tag.trim()+"</a>"),a.attr("data-tag",r.tag.trim());for(var n in r.name&&a.attr("alt",r.name),r)r.hasOwnProperty(n)&&"thumb"!==n&&"url"!==n&&"tag"!==n&&a.attr("data-"+n,r[n]);s.append(a).append(v(o.icon.create("imageManagerDelete")).addClass("fr-delete-img").attr("title",o.language.translate("Delete"))).append(v(o.icon.create("imageManagerInsert")).addClass("fr-insert-img").attr("title",o.language.translate("Insert"))),f.find(".fr-selected-tag").each(function(e,t){P(a,t.text)||s.hide()}),a.on("load",function(){s.removeClass("fr-empty"),s.height("auto"),h++,I(y(parseInt(a.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1)),O(!1),h%o.opts.imageManagerPageSize==0&&_()}),o.events.trigger("imageManager.imageLoaded",[a])},i.onerror=function(){h++,s.remove(),I(y(parseInt(s.attr("class").match(/fr-image-(\d+)/)[1],10)+1)),N(e,r),h%o.opts.imageManagerPageSize==0&&_()},i.src=r.thumb||r.url,w().append(s)}function w(){var n,r;return d.find(".fr-list-column").each(function(e,t){var a=v(t);0===e?(r=a.outerHeight(),n=a):a.outerHeight()<r&&(r=a.outerHeight(),n=a)}),n}function y(e){e===undefined&&(e=0);for(var t=[],a=g-1;e<=a;a--){var n=d.find(".fr-image-"+a);n.length&&(t.push(n),v(document.createElement("div")).attr("id","fr-image-hidden-container").append(n),d.find(".fr-image-"+a).remove())}return t}function I(e){for(var t=e.length-1;0<=t;t--)w().append(e[t])}function O(e){if(e===undefined&&(e=!0),!l.isVisible())return!0;var t=S();if(t!==m){m=t;var a=y();L(),I(a)}o.modals.resize(E),e&&_()}function x(e){var t={},a=e.data();for(var n in a)a.hasOwnProperty(n)&&"url"!==n&&"tag"!==n&&(t[n]=a[n]);return t}function F(e){var t=v(e.currentTarget).siblings("img"),a=l.data("instance")||o,n=l.data("current-image");if(o.modals.hide(E),a.image.showProgressBar(),n)n.data("fr-old-src",n.attr("src")),n.trigger("click");else{a.events.focus(!0),a.selection.restore();var r=a.position.getBoundingRect(),i=r.left+r.width/2+v(o.doc).scrollLeft(),s=r.top+r.height+v(o.doc).scrollTop();a.popups.setContainer("image.insert",o.$sc),a.popups.show("image.insert",i,s)}a.image.insert(t.data("url"),!1,x(t),n)}function k(e){var i=v(e.currentTarget).siblings("img"),t=o.language.translate("Are you sure? Image will be deleted.");confirm(t)&&(o.opts.imageManagerDeleteURL?!1!==o.events.trigger("imageManager.beforeDeleteImage",[i])&&(i.parent().addClass("fr-image-deleting"),v(this).ajax({method:o.opts.imageManagerDeleteMethod,url:o.opts.imageManagerDeleteURL,data:Object.assign(Object.assign({src:i.attr("src")},x(i)),o.opts.imageManagerDeleteParams),crossDomain:o.opts.requestWithCORS,withCredentials:o.opts.requestWithCredentials,headers:o.opts.requestHeaders,done:function(e,t,a){o.events.trigger("imageManager.imageDeleted",[e]);var n=y(parseInt(i.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);i.parent().remove(),I(n),function r(){l.find("#fr-modal-tags > a").each(function(){0===l.find('#fr-image-list [data-tag*="'+v(this).text()+'"]').length&&v(this).removeClass("fr-selected-tag").hide()}),M()}(),O(!0)},fail:function(e){N(a,e.response||e.responseText)}})):N(n))}function N(e,t){10<=e&&e<20?s.hide():20<=e&&e<30&&v(".fr-image-deleting").removeClass("fr-image-deleting"),o.events.trigger("imageManager.error",[{code:e,message:r[e]},t])}function D(){var e=c.find(".fr-modal-head-line").outerHeight(),t=f.outerHeight();c.toggleClass("fr-show-tags"),c.hasClass("fr-show-tags")?(c.css("height",e+t),i.css("marginTop",e+t),f.find("a").css("opacity",1)):(c.css("height",e),i.css("marginTop",e),f.find("a").css("opacity",0))}function M(){var e=f.find(".fr-selected-tag");0<e.length?(d.find("img").parents().show(),e.each(function(e,n){d.find("img").each(function(e,t){var a=v(t);P(a,n.text)||a.parent().hide()})})):d.find("img").parents().show(),I(y()),_()}function B(e){e.preventDefault();var t=v(e.currentTarget);t.toggleClass("fr-selected-tag"),o.opts.imageManagerToggleTags&&t.siblings("a").removeClass("fr-selected-tag"),M()}function P(e,t){for(var a=(e.attr("data-tag")||"").split(","),n=0;n<a.length;n++)if(a[n]===t)return!0;return!1}return r[e]="Image cannot be loaded from the passed link.",r[b]="Error during load images request.",r[A]="Missing imageManagerLoadURL option.",r[T]="Parsing load response failed.",r[C]="Missing image thumb.",r[R]="Missing image URL.",r[a]="Error during delete image request.",r[n]="Missing imageManagerDeleteURL option.",{require:["image"],_init:function U(){if(!o.$wp&&"IMG"!==o.el.tagName)return!1},show:function W(){if(!l){var e,t='<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'.concat(o.sid,'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="').concat(Be.SVG.tags,'"/></svg></button><h4 data-text="true">').concat(o.language.translate("Manage Images"),'</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');e=o.opts.imageManagerPreloader?'<img class="fr-preloader" id="fr-preloader" alt="'+o.language.translate("Loading")+'.." src="'+o.opts.imageManagerPreloader+'" style="display: none;">':'<span class="fr-preloader" id="fr-preloader" style="display: none;">'+o.language.translate("Loading")+"</span>",e+='<div class="fr-image-list" id="fr-image-list"></div>';var a=o.modals.create(E,t,e);l=a.$modal,c=a.$head,i=a.$body}l.data("current-image",o.image.get()),o.modals.show(E),s||function n(){s=l.find("#fr-preloader"),d=l.find("#fr-image-list"),f=l.find("#fr-modal-tags"),m=S(),L(),c.css("height",c.find(".fr-modal-head-line").outerHeight()),o.events.$on(v(o.o_win),"resize",function(){O(!!p)}),o.events.bindClick(d,".fr-insert-img",F),o.events.bindClick(d,".fr-delete-img",k),o.helpers.isMobile()&&(o.events.bindClick(d,"div.fr-image-container",function(e){l.find(".fr-mobile-selected").removeClass("fr-mobile-selected"),v(e.currentTarget).addClass("fr-mobile-selected")}),l.on(o._mousedown,function(){l.find(".fr-mobile-selected").removeClass("fr-mobile-selected")})),l.on(o._mousedown+" "+o._mouseup,function(e){e.stopPropagation()}),l.on(o._mousedown,"*",function(){o.events.disableBlur()}),i.on("scroll",_),o.events.bindClick(l,"button#fr-modal-more-"+o.sid,D),o.events.bindClick(f,"a",B)}(),function r(){s.show(),d.find(".fr-list-column").empty(),o.opts.imageManagerLoadURL?v(this).ajax({url:o.opts.imageManagerLoadURL,method:o.opts.imageManagerLoadMethod,data:o.opts.imageManagerLoadParams,dataType:"json",crossDomain:o.opts.requestWithCORS,withCredentials:o.opts.requestWithCredentials,headers:o.opts.requestHeaders,done:function(e,t,a){o.events.trigger("imageManager.imagesLoaded",[e]),function n(e,t){try{d.find(".fr-list-column").empty(),g=h=u=0,p=e,_()}catch(a){N(T,t)}}(e,a.response),s.hide()},fail:function(e){N(b,e.response||e.responseText)}}):N(A)}()},hide:function K(){o.modals.hide(E)}}},!Be.PLUGINS.image)throw new Error("Image manager plugin requires image plugin.");Be.DEFAULTS.imageInsertButtons.push("imageManager"),Be.RegisterCommand("imageManager",{title:"Browse",undo:!1,focus:!1,modal:!0,callback:function(){this.imageManager.show()},plugin:"imageManager"}),Be.DefineIcon("imageManager",{NAME:"folder",SVG_KEY:"imageManager"}),Be.DefineIcon("imageManagerInsert",{NAME:"plus",SVG_KEY:"add"}),Be.DefineIcon("imageManagerDelete",{NAME:"trash",SVG_KEY:"remove"}),Object.assign(Be.DEFAULTS,{inlineClasses:{"fr-class-code":"Code","fr-class-highlighted":"Highlighted","fr-class-transparency":"Transparent"}}),Be.PLUGINS.inlineClass=function(a){var n=a.$;return{apply:function t(e){a.format.toggle("span",{"class":e})},refreshOnShow:function r(e,t){t.find(".fr-command").each(function(){var e=n(this).data("param1"),t=a.format.is("span",{"class":e});n(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}},Be.RegisterCommand("inlineClass",{type:"dropdown",title:"Inline Class",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.inlineClasses;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineClass" data-param1="'+a+'" title="'+t[a]+'">'+t[a]+"</a></li>");return e+="</ul>"},callback:function(e,t){this.inlineClass.apply(t)},refreshOnShow:function(e,t){this.inlineClass.refreshOnShow(e,t)},plugin:"inlineClass"}),Be.DefineIcon("inlineClass",{NAME:"tag",SVG_KEY:"inlineClass"}),Object.assign(Be.DEFAULTS,{inlineStyles:{"Big Red":"font-size: 20px; color: red;","Small Blue":"font-size: 14px; color: blue;"}}),Be.PLUGINS.inlineStyle=function(r){return{apply:function i(e){if(""!==r.selection.text())for(var t=e.split(";"),a=0;a<t.length;a++){var n=t[a].split(":");t[a].length&&2==n.length&&r.format.applyStyle(n[0].trim(),n[1].trim())}else r.html.insert('<span style="'+e+'">'+Be.INVISIBLE_SPACE+Be.MARKERS+"</span>")}}},Be.RegisterCommand("inlineStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.inlineStyles;for(var a in t){if(t.hasOwnProperty(a))e+='<li role="presentation"><span style="'+(t[a]+(-1===t[a].indexOf("display:block;")?" display:block;":""))+'" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineStyle" data-param1="'+t[a]+'" title="'+this.language.translate(a)+'">'+this.language.translate(a)+"</a></span></li>"}return e+="</ul>"},title:"Inline Style",callback:function(e,t){this.inlineStyle.apply(t)},plugin:"inlineStyle"}),Be.DefineIcon("inlineStyle",{NAME:"paint-brush",SVG_KEY:"inlineStyle"}),Object.assign(Be.DEFAULTS,{lineBreakerTags:["table","hr","form","dl","span.fr-video",".fr-embedly","img"],lineBreakerOffset:15,lineBreakerHorizontalOffset:10}),Be.PLUGINS.lineBreaker=function(h){var g,t,r,m=h.$;function l(e,t){var a,n,r,i,s,o,l,c;if(null==e)s=(i=t.parent()).offset().top,a=(l=t.offset().top)-Math.min((l-s)/2,h.opts.lineBreakerOffset),r=i.outerWidth(),n=i.offset().left;else if(null==t)(o=(i=e.parent()).offset().top+i.outerHeight())<(c=e.offset().top+e.outerHeight())&&(o=(i=m(i).parent()).offset().top+i.outerHeight()),a=c+Math.min(Math.abs(o-c)/2,h.opts.lineBreakerOffset),r=i.outerWidth(),n=i.offset().left;else{i=e.parent();var d=e.offset().top+e.height(),f=t.offset().top;if(f<d)return!1;a=(d+f)/2,r=i.outerWidth(),n=i.offset().left}if(h.opts.iframe){var p=h.helpers.getPX(h.$wp.find(".fr-iframe").css("padding-top")),u=h.helpers.getPX(h.$wp.find(".fr-iframe").css("padding-left"));n+=h.$iframe.offset().left-h.helpers.scrollLeft()+u,a+=h.$iframe.offset().top-h.helpers.scrollTop()+p}h.$box.append(g),g.css("top",a-h.win.pageYOffset),g.css("left",n-h.win.pageXOffset),g.css("width",r),g.data("tag1",e),g.data("tag2",t),g.addClass("fr-visible").data("instance",h)}function c(e){if(e){var t=m(e);if(0===h.$el.find(t).length)return null;if(e.nodeType!=Node.TEXT_NODE&&t.is(h.opts.lineBreakerTags.join(",")))return t;if(0<t.parents(h.opts.lineBreakerTags.join(",")).length)return e=t.parents(h.opts.lineBreakerTags.join(",")).get(0),0!==h.$el.find(m(e)).length&&m(e).is(h.opts.lineBreakerTags.join(","))?m(e):null}return null}function i(e,t){var a=h.doc.elementFromPoint(e,t);return a&&!m(a).closest(".fr-line-breaker").length&&!h.node.isElement(a)&&a!=h.$wp.get(0)&&function n(e){if("undefined"!=typeof e.inFroalaWrapper)return e.inFroalaWrapper;for(var t=e;e.parentNode&&e.parentNode!==h.$wp.get(0);)e=e.parentNode;return t.inFroalaWrapper=e.parentNode==h.$wp.get(0),t.inFroalaWrapper}(a)?a:null}function s(e,t,a){for(var n=a,r=null;n<=h.opts.lineBreakerOffset&&!r;)(r=i(e,t-n))||(r=i(e,t+n)),n+=a;return r}function d(e,t,a){for(var n=null,r=100;!n&&e>h.$box.offset().left&&e<h.$box.offset().left+h.$box.outerWidth()&&0<r;)(n=i(e,t))||(n=s(e,t,5)),"left"==a?e-=h.opts.lineBreakerHorizontalOffset:e+=h.opts.lineBreakerHorizontalOffset,r-=h.opts.lineBreakerHorizontalOffset;return n}function a(e){var t=r=null,a=null,n=h.doc.elementFromPoint(e.pageX-h.win.pageXOffset,e.pageY-h.win.pageYOffset);(t=n&&("HTML"==n.tagName||"BODY"==n.tagName||h.node.isElement(n)||0<=(n.getAttribute("class")||"").indexOf("fr-line-breaker"))?((a=s(e.pageX-h.win.pageXOffset,e.pageY-h.win.pageYOffset,1))||(a=d(e.pageX-h.win.pageXOffset-h.opts.lineBreakerHorizontalOffset,e.pageY-h.win.pageYOffset,"left")),a||(a=d(e.pageX-h.win.pageXOffset+h.opts.lineBreakerHorizontalOffset,e.pageY-h.win.pageYOffset,"right")),c(a)):c(n))?function o(e,t){var a,n,r=e.offset().top,i=e.offset().top+e.outerHeight();if(Math.abs(i-t)<=h.opts.lineBreakerOffset||Math.abs(t-r)<=h.opts.lineBreakerOffset)if(Math.abs(i-t)<Math.abs(t-r)){for(var s=(n=e.get(0)).nextSibling;s&&s.nodeType==Node.TEXT_NODE&&0===s.textContent.length;)s=s.nextSibling;if(!s)return l(e,null),!0;if(a=c(s))return l(e,a),!0}else{if(!(n=e.get(0)).previousSibling)return l(null,e),!0;if(a=c(n.previousSibling))return l(a,e),!0}g.removeClass("fr-visible").removeData("instance")}(t,e.pageY):h.core.sameInstance(g)&&g.removeClass("fr-visible").removeData("instance")}function n(e){return!(g.hasClass("fr-visible")&&!h.core.sameInstance(g))&&(h.popups.areVisible()||h.el.querySelector(".fr-selected-cell")?(g.removeClass("fr-visible"),!0):void(!1!==t||h.edit.isDisabled()||(r&&clearTimeout(r),r=setTimeout(a,30,e))))}function o(){r&&clearTimeout(r),g&&g.hasClass("fr-visible")&&g.removeClass("fr-visible").removeData("instance")}function f(){t=!0,o()}function p(){t=!1}function u(e){e.preventDefault();var t=g.data("instance")||h;g.removeClass("fr-visible").removeData("instance");var a=g.data("tag1"),n=g.data("tag2"),r=h.html.defaultTag();null==a?r&&"TD"!=n.parent().get(0).tagName&&0===n.parents(r).length?n.before("<"+r+">"+Be.MARKERS+"<br></"+r+">"):n.before(Be.MARKERS+"<br>"):r&&"TD"!=a.parent().get(0).tagName&&0===a.parents(r).length?a.after("<"+r+">"+Be.MARKERS+"<br></"+r+">"):a.after(Be.MARKERS+"<br>"),t.selection.restore(),h.toolbar.enable()}return{_init:function v(){if(!h.$wp)return!1;!function e(){h.shared.$line_breaker||(h.shared.$line_breaker=m(document.createElement("div")).attr("class","fr-line-breaker").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'+h.language.translate("Break")+'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="17" y="7" width="2" height="8"/><rect x="10" y="13" width="7" height="2"/><path d="M10.000,10.000 L10.000,18.013 L5.000,14.031 L10.000,10.000 Z"/></svg></a>')),g=h.shared.$line_breaker,h.events.on("shared.destroy",function(){g.html("").removeData().remove(),g=null},!0),h.events.on("destroy",function(){g.removeData("instance").removeClass("fr-visible"),m("body").first().append(g),clearTimeout(r)},!0),h.events.$on(g,"mousemove",function(e){e.stopPropagation()},!0),h.events.bindClick(g,"a",u)}(),t=!1,h.events.$on(h.$win,"mousemove",n),h.events.$on(m(h.win),"scroll",o),h.events.on("popups.show.table.edit",o),h.events.on("commands.after",o),h.events.$on(m(h.win),"mousedown",f),h.events.$on(m(h.win),"mouseup",p)}}},Object.assign(Be.DEFAULTS,{lineHeights:{Default:"",Single:"1",1.15:"1.15",1.5:"1.5",Double:"2"}}),Be.PLUGINS.lineHeight=function(r){var i=r.$;return{_init:function e(){},apply:function n(e){r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();var t=r.selection.blocks();t.length&&i(t[0]).parent().is("td")&&r.format.applyStyle("line-height",e.toString()),r.selection.save();for(var a=0;a<t.length;a++)i(t[a]).css("line-height",e),""===i(t[a]).attr("style")&&i(t[a]).removeAttr("style");r.html.unwrap(),r.selection.restore()},refreshOnShow:function s(e,t){var a=r.selection.blocks();if(a.length){var n=i(a[0]);t.find(".fr-command").each(function(){var e=i(this).data("param1"),t=0<=(n.attr("style")||"").indexOf("line-height: "+e+";");i(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}}},Be.RegisterCommand("lineHeight",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.lineHeights;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command '+a+'" tabIndex="-1" role="option" data-cmd="lineHeight" data-param1="'+t[a]+'" title="'+this.language.translate(a)+'">'+this.language.translate(a)+"</a></li>");return e+="</ul>"},title:"Line Height",callback:function(e,t){this.lineHeight.apply(t)},refreshOnShow:function(e,t){this.lineHeight.refreshOnShow(e,t)},plugin:"lineHeight"}),Be.DefineIcon("lineHeight",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"lineHeight"}),Object.assign(Be.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),Object.assign(Be.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkNoOpener:!0,linkNoReferrer:!0,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),Be.PLUGINS.link=function(p){var u=p.$;function h(){var e=p.image?p.image.get():null;if(e||!p.$wp)return"A"==p.el.tagName?p.el:e&&e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?e.get(0).parentNode:void 0;var t=p.selection.ranges(0).commonAncestorContainer;try{t&&(t.contains&&t.contains(p.el)||!p.el.contains(t)||p.el==t)&&(t=null)}catch(r){t=null}if(t&&"A"===t.tagName)return t;var a=p.selection.element(),n=p.selection.endElement();"A"==a.tagName||p.node.isElement(a)||(a=u(a).parentsUntil(p.$el,"a").first().get(0)),"A"==n.tagName||p.node.isElement(n)||(n=u(n).parentsUntil(p.$el,"a").first().get(0));try{n&&(n.contains&&n.contains(p.el)||!p.el.contains(n)||p.el==n)&&(n=null)}catch(r){n=null}try{a&&(a.contains&&a.contains(p.el)||!p.el.contains(a)||p.el==a)&&(a=null)}catch(r){a=null}return n&&n==a&&"A"==n.tagName?(p.browser.msie||p.helpers.isMobile())&&(p.selection.info(a).atEnd||p.selection.info(a).atStart)?null:a:null}function g(){var e,t,a,n,r=p.image?p.image.get():null,i=[];if(r)"A"==r.get(0).parentNode.tagName&&i.push(r.get(0).parentNode);else if(p.win.getSelection){var s=p.win.getSelection();if(s.getRangeAt&&s.rangeCount){n=p.doc.createRange();for(var o=0;o<s.rangeCount;++o)if((t=(e=s.getRangeAt(o)).commonAncestorContainer)&&1!=t.nodeType&&(t=t.parentNode),t&&"a"==t.nodeName.toLowerCase())i.push(t);else{a=t.getElementsByTagName("a");for(var l=0;l<a.length;++l)n.selectNodeContents(a[l]),n.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<n.compareBoundaryPoints(e.START_TO_END,e)&&i.push(a[l])}}}else if(p.doc.selection&&"Control"!=p.doc.selection.type)if("a"==(t=(e=p.doc.selection.createRange()).parentElement()).nodeName.toLowerCase())i.push(t);else{a=t.getElementsByTagName("a"),n=p.doc.body.createTextRange();for(var c=0;c<a.length;++c)n.moveToElementText(a[c]),-1<n.compareEndPoints("StartToEnd",e)&&n.compareEndPoints("EndToStart",e)<1&&i.push(a[c])}return i}function m(r){if(p.core.hasFocus()){if(i(),r&&"keyup"===r.type&&(r.altKey||r.which==Be.KEYCODE.ALT))return!0;setTimeout(function(){if(!r||r&&(1==r.which||"mouseup"!=r.type)){var e=h(),t=p.image?p.image.get():null;if(e&&!t){if(p.image){var a=p.node.contents(e);if(1==a.length&&"IMG"==a[0].tagName){var n=p.selection.ranges(0);return 0===n.startOffset&&0===n.endOffset?u(e).before(Be.MARKERS):u(e).after(Be.MARKERS),p.selection.restore(),!1}}r&&r.stopPropagation(),s(e)}}},p.helpers.isIOS()?100:0)}}function s(e){var t=p.popups.get("link.edit");t||(t=function i(){var e="";1<=p.opts.linkEditButtons.length&&("A"==p.el.tagName&&0<=p.opts.linkEditButtons.indexOf("linkRemove")&&p.opts.linkEditButtons.splice(p.opts.linkEditButtons.indexOf("linkRemove"),1),e='<div class="fr-buttons">'.concat(p.button.buildList(p.opts.linkEditButtons),"</div>"));var t={buttons:e},a=p.popups.create("link.edit",t);p.$wp&&p.events.$on(p.$wp,"scroll.link-edit",function(){h()&&p.popups.isVisible("link.edit")&&s(h())});return a}());var a=u(e);p.popups.isVisible("link.edit")||p.popups.refresh("link.edit"),p.popups.setContainer("link.edit",p.$sc);var n=a.offset().left+a.outerWidth()/2,r=a.offset().top+a.outerHeight();p.popups.show("link.edit",n,r,a.outerHeight(),!0)}function i(){p.popups.hide("link.edit")}function l(){var e=p.popups.get("link.insert"),t=h();if(t){var a,n,r=u(t),i=e.find('input.fr-link-attr[type="text"]'),s=e.find('input.fr-link-attr[type="checkbox"]');for(a=0;a<i.length;a++)(n=u(i[a])).val(r.attr(n.attr("name")||""));for(s.attr("checked",!1),a=0;a<s.length;a++)n=u(s[a]),r.attr(n.attr("name"))==n.data("checked")&&n.attr("checked",!0);e.find('input.fr-link-attr[type="text"][name="text"]').val(r.text())}else e.find('input.fr-link-attr[type="text"]').val(""),e.find('input.fr-link-attr[type="checkbox"]').attr("checked",!1),e.find('input.fr-link-attr[type="text"][name="text"]').val(p.selection.text());e.find("input.fr-link-attr").trigger("change"),(p.image?p.image.get():null)?e.find('.fr-link-attr[name="text"]').parent().hide():e.find('.fr-link-attr[name="text"]').parent().show()}function o(e){if(e)return p.popups.onRefresh("link.insert",l),!0;var t="";1<=p.opts.linkInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'+p.button.buildList(p.opts.linkInsertButtons)+"</div>");var a="",n=0;for(var r in a='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'+p.id+'">',a+='<div class="fr-input-line"><input id="fr-link-insert-layer-url-'+p.id+'" name="href" type="text" class="fr-link-attr" placeholder="'+p.language.translate("URL")+'" tabIndex="'+ ++n+'"></div>',p.opts.linkText&&(a+='<div class="fr-input-line"><input id="fr-link-insert-layer-text-'+p.id+'" name="text" type="text" class="fr-link-attr" placeholder="'+p.language.translate("Text")+'" tabIndex="'+ ++n+'"></div>'),p.opts.linkAttributes)if(p.opts.linkAttributes.hasOwnProperty(r)){var i=p.opts.linkAttributes[r];a+='<div class="fr-input-line"><input name="'+r+'" type="text" class="fr-link-attr" placeholder="'+p.language.translate(i)+'" tabIndex="'+ ++n+'"></div>'}p.opts.linkAlwaysBlank||(a+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'.concat(p.id,'" tabIndex="').concat(++n,'"><span>').concat('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg>','</span></span><label id="fr-label-target-').concat(p.id,'">').concat(p.language.translate("Open in new tab"),"</label></div>"));var s={buttons:t,input_layer:a+='<div class="fr-action-buttons"><button class="fr-command fr-submit" role="button" data-cmd="linkInsert" href="#" tabIndex="'+ ++n+'" type="button">'+p.language.translate("Insert")+"</button></div></div>"},o=p.popups.create("link.insert",s);return p.$wp&&p.events.$on(p.$wp,"scroll.link-insert",function(){(p.image?p.image.get():null)&&p.popups.isVisible("link.insert")&&f(),p.popups.isVisible("link.insert")&&d()}),o}function c(e,t,a){if(void 0===a&&(a={}),!1===p.events.trigger("link.beforeInsert",[e,t,a]))return!1;var n=p.image?p.image.get():null;n||"A"==p.el.tagName?"A"==p.el.tagName&&p.$el.focus():(p.selection.restore(),p.popups.hide("link.insert"));var r=e;p.opts.linkConvertEmailAddress&&p.helpers.isEmail(e)&&!/^mailto:.*/i.test(e)&&(e="mailto:"+e);if(""===p.opts.linkAutoPrefix||new RegExp("^("+Be.LinkProtocols.join("|")+"):.","i").test(e)||/^data:image.*/i.test(e)||/^(https?:|ftps?:|file:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||["/","{","[","#","(","."].indexOf((e||"")[0])<0&&(e=p.opts.linkAutoPrefix+p.helpers.sanitizeURL(e)),e=p.helpers.sanitizeURL(e),p.opts.linkAlwaysBlank&&(a.target="_blank"),p.opts.linkAlwaysNoFollow&&(a.rel="nofollow"),p.helpers.isEmail(r)&&(a.target=null,a.rel=null),"_blank"==a.target?(p.opts.linkNoOpener&&(a.rel?a.rel+=" noopener":a.rel="noopener"),p.opts.linkNoReferrer&&(a.rel?a.rel+=" noreferrer":a.rel="noreferrer")):null==a.target&&(a.rel?a.rel=a.rel.replace(/noopener/,"").replace(/noreferrer/,""):a.rel=null),t=t||"",e===p.opts.linkAutoPrefix)return p.popups.get("link.insert").find('input[name="href"]').addClass("fr-error"),p.events.trigger("link.bad",[r]),!1;var i,s=h();if(s){if((i=u(s)).attr("href",e),0<t.length&&i.text()!=t&&!n){for(var o=i.get(0);1===o.childNodes.length&&o.childNodes[0].nodeType==Node.ELEMENT_NODE;)o=o.childNodes[0];u(o).text(t)}n||i.prepend(Be.START_MARKER).append(Be.END_MARKER),i.attr(a),n||p.selection.restore()}else{n?(n.wrap('<a href="'+e+'"></a>'),p.image.hasCaption()&&n.parent().append(n.parents(".fr-img-caption").find(".fr-inner"))):(p.format.remove("a"),p.selection.isCollapsed()?(t=0===t.length?r:t,p.html.insert('<a href="'+e+'">'+Be.START_MARKER+t.replace(/&/g,"&amp;").replace(/</,"&lt;",">","&gt;")+Be.END_MARKER+"</a>"),p.selection.restore()):0<t.length&&t!=p.selection.text().replace(/\n/g,"")?(p.selection.remove(),p.html.insert('<a href="'+e+'">'+Be.START_MARKER+t.replace(/&/g,"&amp;")+Be.END_MARKER+"</a>"),p.selection.restore()):(!function f(){if(!p.selection.isCollapsed()){p.selection.save();for(var e=p.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();e.length;){var t=u(e.pop());t.removeClass("fr-unprocessed");var a=p.node.deepestParent(t.get(0));if(a){for(var n=t.get(0),r="",i="";n=n.parentNode,p.node.isBlock(n)||(r+=p.node.closeTagString(n),i=p.node.openTagString(n)+i),n!=a;);var s=p.node.openTagString(t.get(0))+t.html()+p.node.closeTagString(t.get(0));t.replaceWith('<span id="fr-break"></span>');var o=a.outerHTML;o=(o=o.replace(/<span id="fr-break"><\/span>/g,r+s+i)).replace(i+r,""),a.outerHTML=o}e=p.$el.find(".fr-marker.fr-unprocessed").toArray()}p.html.cleanEmptyTags(),p.selection.restore()}}(),p.format.apply("a",{href:e})));for(var l=g(),c=0;c<l.length;c++)(i=u(l[c])).attr(a),i.removeAttr("_moz_dirty");1==l.length&&p.$wp&&!n&&(u(l[0]).prepend(Be.START_MARKER).append(Be.END_MARKER),p.selection.restore())}if(n){var d=p.popups.get("link.insert");d&&d.find("input:focus").blur(),p.image.edit(n)}else m()}function d(){i();var e=h();if(e){var t=p.popups.get("link.insert");t||(t=o()),p.popups.isVisible("link.insert")||(p.popups.refresh("link.insert"),p.selection.save(),p.helpers.isMobile()&&(p.events.disableBlur(),p.$el.blur(),p.events.enableBlur())),p.popups.setContainer("link.insert",p.$sc);var a=(p.image?p.image.get():null)||u(e),n=a.offset().left+a.outerWidth()/2,r=a.offset().top+a.outerHeight();p.popups.show("link.insert",n,r,a.outerHeight(),!0)}}function f(){var e=p.image?p.image.getEl():null;if(e){var t=p.popups.get("link.insert");p.image.hasCaption()&&(e=e.find(".fr-img-wrap")),t||(t=o()),l(),p.popups.setContainer("link.insert",p.$sc);var a=e.offset().left+e.outerWidth()/2,n=e.offset().top+e.outerHeight();p.popups.show("link.insert",a,n,e.outerHeight(),!0)}}return{_init:function e(){p.events.on("keyup",function(e){e.which!=Be.KEYCODE.ESC&&m(e)}),p.events.on("window.mouseup",m),p.events.$on(p.$el,"click","a",function(e){p.edit.isDisabled()&&e.preventDefault()}),p.helpers.isMobile()&&p.events.$on(p.$doc,"selectionchange",m),o(!0),"A"==p.el.tagName&&p.$el.addClass("fr-view"),p.events.on("toolbar.esc",function(){if(p.popups.isVisible("link.edit"))return p.events.disableBlur(),p.events.focus(),!1},!0)},remove:function a(){var e=h(),t=p.image?p.image.get():null;if(!1===p.events.trigger("link.beforeRemove",[e]))return!1;t&&e?(t.unwrap(),p.image.edit(t)):e&&(p.selection.save(),u(e).replaceWith(u(e).html()),p.selection.restore(),i())},showInsertPopup:function v(){var e=p.$tb.find('.fr-command[data-cmd="insertLink"]'),t=p.popups.get("link.insert");if(t||(t=o()),!t.hasClass("fr-active"))if(p.popups.refresh("link.insert"),p.popups.setContainer("link.insert",p.$tb||p.$sc),e.isVisible()){var a=p.button.getPosition(e),n=a.left,r=a.top;p.popups.show("link.insert",n,r,e.outerHeight())}else p.position.forSelection(t),p.popups.show("link.insert")},usePredefined:function E(e){var t,a,n=p.opts.linkList[e],r=p.popups.get("link.insert"),i=r.find('input.fr-link-attr[type="text"]'),s=r.find('input.fr-link-attr[type="checkbox"]');for(n.rel&&(r.rel=n.rel),a=0;a<i.length;a++)n[(t=u(i[a])).attr("name")]?(t.val(n[t.attr("name")]),t.toggleClass("fr-not-empty",!0)):"text"!=t.attr("name")&&t.val("");for(a=0;a<s.length;a++)(t=u(s[a])).attr("checked",t.data("checked")==n[t.attr("name")]);p.accessibility.focusPopup(r)},insertCallback:function b(){var e,t,a=p.popups.get("link.insert"),n=a.find('input.fr-link-attr[type="text"]'),r=a.find('input.fr-link-attr[type="checkbox"]'),i=(n.filter('[name="href"]').val()||"").trim(),s=n.filter('[name="text"]').val(),o={};for(t=0;t<n.length;t++)e=u(n[t]),["href","text"].indexOf(e.attr("name"))<0&&(o[e.attr("name")]=e.val());for(t=0;t<r.length;t++)(e=u(r[t])).is(":checked")?o[e.attr("name")]=e.data("checked"):o[e.attr("name")]=e.data("unchecked")||null;a.rel&&(o.rel=a.rel);var l=p.helpers.scrollTop();c(i,s,o),u(p.o_win).scrollTop(l)},insert:c,update:d,get:h,allSelected:g,back:function t(){p.image&&p.image.get()?p.image.back():(p.events.disableBlur(),p.selection.restore(),p.events.enableBlur(),h()&&p.$wp?(p.selection.restore(),i(),m()):"A"==p.el.tagName?(p.$el.focus(),m()):(p.popups.hide("link.insert"),p.toolbar.showInline()))},imageLink:f,applyStyle:function A(e,t,a){void 0===a&&(a=p.opts.linkMultipleStyles),void 0===t&&(t=p.opts.linkStyles);var n=h();if(!n)return!1;if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),u(n).removeClass(r.join(" "))}u(n).toggleClass(e),m()}}},Be.DefineIcon("insertLink",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterShortcut(Be.KEYCODE.K,"insertLink",null,"K"),Be.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),Be.DefineIcon("linkOpen",{NAME:"external-link",FA5NAME:"external-link-alt",SVG_KEY:"openLink"}),Be.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},callback:function(){var e=this.link.get();e&&(-1!==e.href.indexOf("mailto:")?this.o_win.open(e.href).close():this.o_win.open(e.href,"_blank","noopener"),this.popups.hide("link.edit"))},plugin:"link"}),Be.DefineIcon("linkEdit",{NAME:"edit",SVG_KEY:"editLink"}),Be.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,popup:!0,callback:function(){this.link.update()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),Be.DefineIcon("linkRemove",{NAME:"unlink",SVG_KEY:"unlink"}),Be.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),Be.DefineIcon("linkBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(e){var t=this.link.get()&&this.doc.hasFocus();(this.image?this.image.get():null)||t||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"))},plugin:"link"}),Be.DefineIcon("linkList",{NAME:"search",SVG_KEY:"search"}),Be.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkList,a=0;a<t.length;a++)e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkList" data-param1="'+a+'">'+(t[a].displayText||t[a].text)+"</a></li>";return e+="</ul>"},callback:function(e,t){this.link.usePredefined(t)},plugin:"link"}),Be.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(e){this.link.get()?e.text(this.language.translate("Update")):e.text(this.language.translate("Insert"))},plugin:"link"}),Be.DefineIcon("imageLink",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,popup:!0,callback:function(){this.link.imageLink()},refresh:function(e){var t;this.link.get()?((t=e.prev()).hasClass("fr-separator")&&t.removeClass("fr-hidden"),e.addClass("fr-hidden")):((t=e.prev()).hasClass("fr-separator")&&t.addClass("fr-hidden"),e.removeClass("fr-hidden"))},plugin:"link"}),Be.DefineIcon("linkStyle",{NAME:"magic",SVG_KEY:"linkStyles"}),Be.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkStyle" data-param1="'+a+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.link.applyStyle(t)},refreshOnShow:function(e,t){var a=this.$,n=this.link.get();if(n){var r=a(n);t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=r.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),Object.assign(Be.DEFAULTS,{listAdvancedTypes:!0}),Be.PLUGINS.lists=function(f){var p=f.$;function u(e){return'<span class="fr-open-'+e.toLowerCase()+'"></span>'}function h(e){return'<span class="fr-close-'+e.toLowerCase()+'"></span>'}function i(e,t){!function c(e,t){for(var a=[],n=0;n<e.length;n++){var r=e[n].parentNode;"LI"==e[n].tagName&&r.tagName!=t&&a.indexOf(r)<0&&a.push(r)}for(var i=a.length-1;0<=i;i--){var s=p(a[i]);s.replaceWith("<"+t.toLowerCase()+" "+f.node.attributes(s.get(0))+">"+s.html()+"</"+t.toLowerCase()+">")}}(e,t);var a,n=f.html.defaultTag(),r=null;e.length&&(a="rtl"==f.opts.direction||"rtl"==p(e[0]).css("direction")?"margin-right":"margin-left");for(var i=0;i<e.length;i++)if("TD"!=e[i].tagName&&"TH"!=e[i].tagName&&"LI"!=e[i].tagName){var s=f.helpers.getPX(p(e[i]).css(a))||0;(e[i].style.marginLeft=null)===r&&(r=s);var o=0<r?"<"+t+' style="'+a+": "+r+'px ">':"<"+t+">",l="</"+t+">";for(s-=r;0<s/f.opts.indentMargin;)o+="<"+t+">",l+=l,s-=f.opts.indentMargin;n&&e[i].tagName.toLowerCase()==n?p(e[i]).replaceWith(o+"<li"+f.node.attributes(e[i])+">"+p(e[i]).html()+"</li>"+l):p(e[i]).wrap(o+"<li></li>"+l)}f.clean.lists()}function s(e){var t,a;for(t=e.length-1;0<=t;t--)for(a=t-1;0<=a;a--)if(p(e[a]).find(e[t]).length||e[a]==e[t]){e.splice(t,1);break}var n=[];for(t=0;t<e.length;t++){var r=p(e[t]),i=e[t].parentNode,s=r.attr("class");if(r.before(h(i.tagName)),"LI"==i.parentNode.tagName)r.before(h("LI")),r.after(u("LI"));else{var o="";s&&(o+=' class="'+s+'"');var l="rtl"==f.opts.direction||"rtl"==r.css("direction")?"margin-right":"margin-left";f.helpers.getPX(p(i).css(l))&&0<=(p(i).attr("style")||"").indexOf(l+":")&&(o+=' style="'+l+":"+f.helpers.getPX(p(i).css(l))+'px;"'),f.html.defaultTag()&&0===r.find(f.html.blockTagsQuery()).length&&r.wrapInner(f.html.defaultTag()+o),f.node.isEmpty(r.get(0),!0)||0!==r.find(f.html.blockTagsQuery()).length||r.append("<br>"),r.append(u("LI")),r.prepend(h("LI"))}r.after(u(i.tagName)),"LI"==i.parentNode.tagName&&(i=i.parentNode.parentNode),n.indexOf(i)<0&&n.push(i)}for(t=0;t<n.length;t++){var c=p(n[t]),d=c.html();d=(d=d.replace(/<span class="fr-close-([a-z]*)"><\/span>/g,"</$1>")).replace(/<span class="fr-open-([a-z]*)"><\/span>/g,"<$1>"),c.replaceWith(f.node.openTagString(c.get(0))+d+f.node.closeTagString(c.get(0)))}f.$el.find("li:empty").remove(),f.$el.find("ul:empty, ol:empty").remove(),f.clean.lists(),f.html.wrap()}function o(e){f.selection.save();for(var t=0;t<e.length;t++){var a=e[t].previousSibling;if(a){var n=p(e[t]).find("> ul, > ol").last().get(0);if(n){var r=p(document.createElement("li"));p(n).prepend(r);for(var i=f.node.contents(e[t])[0];i&&!f.node.isList(i);){var s=i.nextSibling;r.append(i),i=s}p(a).append(p(n)),p(e[t]).remove()}else{var o=p(a).find("> ul, > ol").last().get(0);if(o)p(o).append(p(e[t]));else{var l=p("<"+e[t].parentNode.tagName+">");p(a).append(l),l.append(p(e[t]))}}}}f.clean.lists(),f.selection.restore()}function l(e){f.selection.save(),s(e),f.selection.restore()}function e(e){if("indent"==e||"outdent"==e){var t=!1,a=f.selection.blocks(),n=[],r=a[0].previousSibling||a[0].parentElement;if("outdent"==e){if("LI"==r.tagName||"LI"!=r.parentNode.tagName)return}else if(!a[0].previousSibling||"LI"!=a[0].previousSibling.tagName)return;for(var i=0;i<a.length;i++)"LI"==a[i].tagName?(t=!0,n.push(a[i])):"LI"==a[i].parentNode.tagName&&(t=!0,n.push(a[i].parentNode));t&&("indent"==e?o(n):l(n))}}return{_init:function t(){f.events.on("commands.after",e),f.events.on("keydown",function(e){if(e.which==Be.KEYCODE.TAB){for(var t=f.selection.blocks(),a=[],n=0;n<t.length;n++)"LI"==t[n].tagName?a.push(t[n]):"LI"==t[n].parentNode.tagName&&a.push(t[n].parentNode);if(1<a.length||a.length&&(f.selection.info(a[0]).atStart||f.node.isEmpty(a[0])))return e.preventDefault(),e.stopPropagation(),e.shiftKey?l(a):o(a),!1}},!0)},format:function c(e,t){var a,n;for(f.selection.save(),f.html.wrap(!0,!0,!0,!0),f.selection.restore(),n=f.selection.blocks(),a=0;a<n.length;a++)"LI"!=n[a].tagName&&"LI"==n[a].parentNode.tagName&&(n[a]=n[a].parentNode);if(f.selection.save(),function r(e,t){for(var a=!0,n=0;n<e.length;n++){if("LI"!=e[n].tagName)return!1;e[n].parentNode.tagName!=t&&(a=!1)}return a}(n,e)?t||s(n):i(n,e),f.html.unwrap(),f.selection.restore(),t=t||"default"){for(n=f.selection.blocks(),a=0;a<n.length;a++)"LI"!=n[a].tagName&&"LI"==n[a].parentNode.tagName&&(n[a]=n[a].parentNode);for(a=0;a<n.length;a++)"LI"==n[a].tagName&&(p(n[a].parentNode).css("list-style-type","default"===t?"":t),0===(p(n[a].parentNode).attr("style")||"").length&&p(n[a].parentNode).removeAttr("style"))}},refresh:function r(e,t){var a=p(f.selection.element());if(a.get(0)!=f.el){var n=a.get(0);(n="LI"!=n.tagName&&n.firstElementChild&&"LI"!=n.firstElementChild.tagName?a.parents("li").get(0):"LI"==n.tagName||n.firstElementChild?n.firstElementChild&&"LI"==n.firstElementChild.tagName?a.get(0).firstChild:a.get(0):a.parents("li").get(0))&&n.parentNode.tagName==t&&f.el.contains(n.parentNode)&&e.addClass("fr-active")}}}},Be.DefineIcon("formatOLSimple",{NAME:"list-ol",SVG_KEY:"orderedList"}),Be.RegisterCommand("formatOLSimple",{title:"Ordered List",type:"button",options:{"default":"Default",circle:"Circle",disc:"Disc",square:"Square"},refresh:function(e){this.lists.refresh(e,"OL")},callback:function(e,t){this.lists.format("OL",t)},plugin:"lists"}),Be.RegisterCommand("formatUL",{title:"Unordered List",type:"button",hasOptions:function(){return this.opts.listAdvancedTypes},options:{"default":"Default",circle:"Circle",disc:"Disc",square:"Square"},refresh:function(e){this.lists.refresh(e,"UL")},callback:function(e,t){this.lists.format("UL",t)},plugin:"lists"}),Be.RegisterCommand("formatOL",{title:"Ordered List",hasOptions:function(){return this.opts.listAdvancedTypes},options:{"default":"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},refresh:function(e){this.lists.refresh(e,"OL")},callback:function(e,t){this.lists.format("OL",t)},plugin:"lists"}),Be.DefineIcon("formatUL",{NAME:"list-ul",SVG_KEY:"unorderedList"}),Be.DefineIcon("formatOL",{NAME:"list-ol",SVG_KEY:"orderedList"}),Object.assign(Be.DEFAULTS,{paragraphFormat:{N:"Normal",H1:"Heading 1",H2:"Heading 2",H3:"Heading 3",H4:"Heading 4",PRE:"Code"},paragraphFormatSelection:!1,paragraphDefaultSelection:"Paragraph Format"}),Be.PLUGINS.paragraphFormat=function(p){var u=p.$;function h(e,t){var a=p.html.defaultTag();if(t&&t.toLowerCase()!=a)if(0<e.find("ul, ol").length){var n=u("<"+t+">");e.prepend(n);for(var r=p.node.contents(e.get(0))[0];r&&["UL","OL"].indexOf(r.tagName)<0;){var i=r.nextSibling;n.append(r),r=i}}else e.html("<"+t+">"+e.html()+"</"+t+">")}return{apply:function g(e){"N"==e&&(e=p.html.defaultTag()),p.selection.save(),p.html.wrap(!0,!0,!p.opts.paragraphFormat.BLOCKQUOTE,!0,!0),p.selection.restore();var t,a,n,r,i,s,o,l,c=p.selection.blocks();p.selection.save(),p.$el.find("pre").attr("skip",!0);for(var d=0;d<c.length;d++)if(c[d].tagName!=e&&!p.node.isList(c[d])){var f=u(c[d]);"LI"==c[d].tagName?h(f,e):"LI"==c[d].parentNode.tagName&&c[d]?(s=f,o=e,l=p.html.defaultTag(),o&&o.toLowerCase()!=l||(o='div class="fr-temp-div"'),s.replaceWith(u("<"+o+">").html(s.html()))):0<=["TD","TH"].indexOf(c[d].parentNode.tagName)?(n=f,r=e,i=p.html.defaultTag(),r||(r='div class="fr-temp-div"'+(p.node.isEmpty(n.get(0),!0)?' data-empty="true"':"")),r.toLowerCase()==i?(p.node.isEmpty(n.get(0),!0)||n.append("<br/>"),n.replaceWith(n.html())):n.replaceWith(u("<"+r+">").html(n.html()))):(t=f,(a=e)||(a='div class="fr-temp-div"'+(p.node.isEmpty(t.get(0),!0)?' data-empty="true"':"")),t.replaceWith(u("<"+a+" "+p.node.attributes(t.get(0))+">").html(t.html()).removeAttr("data-empty")))}p.$el.find('pre:not([skip="true"]) + pre:not([skip="true"])').each(function(){u(this).prev().append("<br>"+u(this).html()),u(this).remove()}),p.$el.find("pre").removeAttr("skip"),p.html.unwrap(),p.selection.restore()},refreshOnShow:function s(e,t){var a=p.selection.blocks();if(a.length){var n=a[0],r="N",i=p.html.defaultTag();n.tagName.toLowerCase()!=i&&n!=p.el&&(r=n.tagName),t.find('.fr-command[data-param1="'+r+'"]').addClass("fr-active").attr("aria-selected",!0)}else t.find('.fr-command[data-param1="N"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function i(e){if(p.opts.paragraphFormatSelection){var t=p.selection.blocks();if(t.length){var a=t[0],n="N",r=p.html.defaultTag();a.tagName.toLowerCase()!=r&&a!=p.el&&(n=a.tagName),0<=["LI","TD","TH"].indexOf(n)&&(n="N"),e.find(">span").text(p.language.translate(p.opts.paragraphFormat[n]))}else e.find(">span").text(p.language.translate(p.opts.paragraphFormat.N))}}}},Be.RegisterCommand("paragraphFormat",{type:"dropdown",displaySelection:function(e){return e.opts.paragraphFormatSelection},defaultSelection:function(e){return e.language.translate(e.opts.paragraphDefaultSelection)},displaySelectionWidth:80,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.paragraphFormat;for(var a in t)if(t.hasOwnProperty(a)){var n=this.shortcuts.get("paragraphFormat."+a);n=n?'<span class="fr-shortcut">'+n+"</span>":"",e+='<li role="presentation"><'+("N"==a?this.html.defaultTag()||"DIV":a)+' style="padding: 0 !important; margin: 0 !important;" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="paragraphFormat" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></"+("N"==a?this.html.defaultTag()||"DIV":a)+"></li>"}return e+="</ul>"},title:"Paragraph Format",callback:function(e,t){this.paragraphFormat.apply(t)},refresh:function(e){this.paragraphFormat.refresh(e)},refreshOnShow:function(e,t){this.paragraphFormat.refreshOnShow(e,t)},plugin:"paragraphFormat"}),Be.DefineIcon("paragraphFormat",{NAME:"paragraph",SVG_KEY:"paragraphFormat"}),Object.assign(Be.DEFAULTS,{paragraphStyles:{"fr-text-gray":"Gray","fr-text-bordered":"Bordered","fr-text-spaced":"Spaced","fr-text-uppercase":"Uppercase"},paragraphMultipleStyles:!0}),Be.PLUGINS.paragraphStyle=function(o){var l=o.$;return{_init:function e(){},apply:function c(e,t,a){void 0===t&&(t=o.opts.paragraphStyles),void 0===a&&(a=o.opts.paragraphMultipleStyles);var n="";a||((n=Object.keys(t)).splice(n.indexOf(e),1),n=n.join(" ")),o.selection.save(),o.html.wrap(!0,!0,!0,!0),o.selection.restore();var r=o.selection.blocks();o.selection.save();for(var i=l(r[0]).hasClass(e),s=0;s<r.length;s++)l(r[s]).removeClass(n).toggleClass(e,!i),l(r[s]).hasClass("fr-temp-div")&&l(r[s]).removeClass("fr-temp-div"),""===l(r[s]).attr("class")&&l(r[s]).removeAttr("class");o.html.unwrap(),o.selection.restore()},refreshOnShow:function r(e,t){var a=o.selection.blocks();if(a.length){var n=l(a[0]);t.find(".fr-command").each(function(){var e=l(this).data("param1"),t=n.hasClass(e);l(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}}},Be.RegisterCommand("paragraphStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.paragraphStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command '+a+'" tabIndex="-1" role="option" data-cmd="paragraphStyle" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},title:"Paragraph Style",callback:function(e,t){this.paragraphStyle.apply(t)},refreshOnShow:function(e,t){this.paragraphStyle.refreshOnShow(e,t)},plugin:"paragraphStyle"}),Be.DefineIcon("paragraphStyle",{NAME:"magic",SVG_KEY:"paragraphStyle"}),Object.assign(Be.DEFAULTS,{html2pdf:window.html2pdf}),Be.PLUGINS.print=function(l){return{run:function e(){!function o(e){var t=l.$el.html(),a=null;l.shared.print_iframe?a=l.shared.print_iframe:((a=document.createElement("iframe")).name="fr-print",a.style.position="fixed",a.style.top="0",a.style.left="-9999px",a.style.height="100%",a.style.width="0",a.style.overflow="hidden",a.style["z-index"]="2147483647",a.style.tabIndex="-1",l.events.on("shared.destroy",function(){a.remove()}),l.shared.print_iframe=a);try{document.body.removeChild(a)}catch(s){}document.body.appendChild(a);var n=function n(){e(),a.removeEventListener("load",n)};a.addEventListener("load",n);var r=a.contentWindow;r.document.open(),r.document.write("<!DOCTYPE html><html "+(l.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),r.document.write(e.outerHTML)});var i=document.querySelectorAll("link[rel=stylesheet]");Array.prototype.forEach.call(i,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",r.document.write(t.outerHTML)}),r.document.write('</head><body style="height:auto;text-align: '+("rtl"==l.opts.direction?"right":"left")+"; direction: "+l.opts.direction+"; "+(l.opts.documentReady?" padding: 2cm; width: 17cm; margin: 0;":"")+'"><div class="fr-view">'),r.document.write(t),r.document.write("</div></body></html>"),r.document.close()}(function(){setTimeout(function(){l.events.disableBlur(),window.frames["fr-print"].focus(),window.frames["fr-print"].print(),l.$win.get(0).focus(),l.events.disableBlur(),l.events.focus()},0)})},toPDF:function t(){l.opts.html2pdf&&(l.$el.css("text-align","left"),l.opts.html2pdf().set({margin:[10,20],html2canvas:{useCORS:!0}}).from(l.el).save(),setTimeout(function(){l.$el.css("text-align","")},100))}}},Be.DefineIcon("print",{NAME:"print",SVG_KEY:"print"}),Be.RegisterCommand("print",{title:"Print",undo:!1,focus:!1,plugin:"print",callback:function(){this.print.run()}}),Be.DefineIcon("getPDF",{NAME:"file-pdf-o",FA5NAME:"file-pdf",SVG_KEY:"pdfExport"}),Be.RegisterCommand("getPDF",{title:"Download PDF",type:"button",focus:!1,undo:!1,callback:function(){this.print.toPDF()}}),Object.assign(Be.DEFAULTS,{quickInsertButtons:["image","video","embedly","table","ul","ol","hr"],quickInsertTags:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote"],quickInsertEnabled:!0}),Be.QUICK_INSERT_BUTTONS={},Be.DefineIcon("quickInsert",{SVG_KEY:"add",template:"svg"}),Be.RegisterQuickInsertButton=function(e,t){Be.QUICK_INSERT_BUTTONS[e]=Object.assign({undo:!0},t)},Be.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"+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()}}),Be.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)}}),Be.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)}}),Be.RegisterQuickInsertButton("table",{icon:"insertTable",requiredPlugin:"table",title:"Insert Table",callback:function(){this.table.insert(2,2)}}),Be.RegisterQuickInsertButton("ol",{icon:"formatOL",requiredPlugin:"lists",title:"Ordered List",callback:function(){this.lists.format("OL")}}),Be.RegisterQuickInsertButton("ul",{icon:"formatUL",requiredPlugin:"lists",title:"Unordered List",callback:function(){this.lists.format("UL")}}),Be.RegisterQuickInsertButton("hr",{icon:"insertHR",title:"Insert Horizontal Line",callback:function(){this.commands.insertHR()}}),Be.PLUGINS.quickInsert=function(s){var o,l,c=s.$;function a(e){var t,a,n;(t=e.offset().top-s.$box.offset().top,a=(s.$iframe&&s.$iframe.offset().left||0)+e.offset().left<o.outerWidth()?e.offset().left+o.outerWidth():0-o.outerWidth(),s.opts.enter!=Be.ENTER_BR)?n=(o.outerHeight()-e.outerHeight())/2:(c(document.createElement("span")).html(Be.INVISIBLE_SPACE).insertAfter(e),n=(o.outerHeight()-e.next().outerHeight())/2,e.next().remove());if(s.opts.iframe){var r=s.helpers.getPX(s.$wp.find(".fr-iframe").css("padding-top"));t+=s.$iframe.offset().top+r}o.hasClass("fr-on")&&0<=t&&l.css("top",t-n),0<=t&&t-Math.abs(n)<=s.$box.outerHeight()-e.outerHeight()?(o.hasClass("fr-hidden")&&(o.hasClass("fr-on")&&d(),o.removeClass("fr-hidden")),o.css("top",t-n)):o.hasClass("fr-visible")&&(o.addClass("fr-hidden"),f()),o.css("left",a)}function r(e){o||function t(){s.shared.$quick_insert||(s.shared.$quick_insert=c(document.createElement("div")).attr("class","fr-quick-insert").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'+s.language.translate("Quick Insert")+'">'+s.icon.create("quickInsert")+"</a>"));o=s.shared.$quick_insert,s.tooltip.bind(s.$box,".fr-quick-insert > a.fr-floating-btn"),s.events.on("destroy",function(){c("body").first().append(o.removeClass("fr-on")),l&&(f(),c("body").first().append(l.css("left",-9999).css("top",-9999)))},!0),s.events.on("shared.destroy",function(){o.html("").removeData().remove(),o=null,l&&(l.html("").removeData().remove(),l=null)},!0),s.events.on("commands.before",i),s.events.on("commands.after",function(){s.popups.areVisible()||n()}),s.events.bindClick(s.$box,".fr-quick-insert > a",d),s.events.bindClick(s.$box,".fr-qi-helper > a.fr-btn",function(e){var t=c(e.currentTarget).data("cmd");if(!1===s.events.trigger("quickInsert.commands.before",[t]))return!1;Be.QUICK_INSERT_BUTTONS[t].callback.apply(s,[e.currentTarget]),Be.QUICK_INSERT_BUTTONS[t].undo&&s.undo.saveStep(),s.events.trigger("quickInsert.commands.after",[t]),s.quickInsert.hide()}),s.events.$on(s.$wp,"scroll",p),s.events.$on(s.$tb,"transitionend",".fr-more-toolbar",p)}(),o.hasClass("fr-on")&&f(),s.$box.append(o),a(e),o.data("tag",e),o.addClass("fr-visible")}function n(){if(s.core.hasFocus()){var e=s.selection.element();if(s.opts.enter==Be.ENTER_BR||s.node.isBlock(e)||(e=s.node.blockParent(e)),s.opts.enter==Be.ENTER_BR&&!s.node.isBlock(e)){var t=s.node.deepestParent(e);t&&(e=t)}var a=function a(){return s.opts.enter!=Be.ENTER_BR&&s.node.isEmpty(e)&&0<=s.opts.quickInsertTags.indexOf(e.tagName.toLowerCase())},n=function n(){return s.opts.enter==Be.ENTER_BR&&("BR"==e.tagName&&(!e.previousSibling||"BR"==e.previousSibling.tagName||s.node.isBlock(e.previousSibling))||s.node.isEmpty(e)&&(!e.previousSibling||"BR"==e.previousSibling.tagName||s.node.isBlock(e.previousSibling))&&(!e.nextSibling||"BR"==e.nextSibling.tagName||s.node.isBlock(e.nextSibling)))};e&&(a()||n())?o&&o.data("tag").is(c(e))&&o.hasClass("fr-on")?f():s.selection.isCollapsed()&&r(c(e)):i()}}function i(){o&&(o.hasClass("fr-on")&&f(),o.removeClass("fr-visible fr-on"),o.css("left",-9999).css("top",-9999))}function d(e){if(e&&e.preventDefault(),o.hasClass("fr-on")&&!o.hasClass("fr-hidden"))f();else{if(!s.shared.$qi_helper){for(var t=s.opts.quickInsertButtons,a='<div class="fr-qi-helper">',n=0,r=0;r<t.length;r++){var i=Be.QUICK_INSERT_BUTTONS[t[r]];i&&(!i.requiredPlugin||Be.PLUGINS[i.requiredPlugin]&&0<=s.opts.pluginsEnabled.indexOf(i.requiredPlugin))&&(a+='<a class="fr-btn fr-floating-btn" role="button" title="'+s.language.translate(i.title)+'" tabIndex="-1" data-cmd="'+t[r]+'" style="transition-delay: '+.025*n+++'s;">'+s.icon.create(i.icon)+"</a>")}a+="</div>",s.shared.$qi_helper=c(a),s.tooltip.bind(s.shared.$qi_helper,"a.fr-btn"),s.events.$on(s.shared.$qi_helper,"mousedown",function(e){e.preventDefault()},!0)}l=s.shared.$qi_helper,s.$box.append(l),setTimeout(function(){l.css("top",parseFloat(o.css("top"))),l.css("left",parseFloat(o.css("left"))+o.outerWidth()),l.find("a").addClass("fr-size-1"),o.addClass("fr-on")},10)}}function f(){var a=s.$box.find(".fr-qi-helper");a.length&&function(){for(var t=a.find("a"),e=0;e<t.length;e++)!function(e){setTimeout(function(){a.children().eq(t.length-1-e).removeClass("fr-size-1")},25*e)}(e);setTimeout(function(){a.css("left",-9999),o&&!o.hasClass("fr-hidden")&&o.removeClass("fr-on")},25*e)}()}function p(){o.hasClass("fr-visible")&&a(o.data("tag"))}return{_init:function e(){if(!s.$wp||!s.opts.quickInsertEnabled)return!1;s.popups.onShow("image.edit",i),s.events.on("mouseup",n),s.helpers.isMobile()&&s.events.$on(c(s.o_doc),"selectionchange",n),s.events.on("blur",i),s.events.on("keyup",n),s.events.on("keydown",function(){setTimeout(function(){n()},0)})},hide:i}},Be.PLUGINS.quote=function(r){var i=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(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)t[e]=s(t[e]);r.selection.save();var a=i(document.createElement("blockquote"));for(a.insertBefore(t[0]),e=0;e<t.length;e++)a.append(t[e]);r.html.unwrap(),r.selection.restore()}():"decrease"==e&&function a(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)"BLOCKQUOTE"!=t[e].tagName&&(t[e]=i(t[e]).parentsUntil(r.$el,"BLOCKQUOTE").get(0));for(r.selection.save(),e=0;e<t.length;e++)t[e]&&i(t[e]).replaceWith(t[e].innerHTML);r.html.unwrap(),r.selection.restore()}()}}},Be.RegisterShortcut(Be.KEYCODE.SINGLE_QUOTE,"quote","increase","'"),Be.RegisterShortcut(Be.KEYCODE.SINGLE_QUOTE,"quote","decrease","'",!0),Be.RegisterCommand("quote",{title:"Quote",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t={increase:"Increase",decrease:"Decrease"};for(var a in t)if(t.hasOwnProperty(a)){var n=this.shortcuts.get("quote."+a);e+='<li role="presentation"><a class="fr-command fr-active '+a+'" tabIndex="-1" role="option" data-cmd="quote" data-param1="'+a+'" title="'+t[a]+'">'+this.language.translate(t[a])+(n?'<span class="fr-shortcut">'+n+"</span>":"")+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.quote.apply(t)},plugin:"quote"}),Be.DefineIcon("quote",{NAME:"quote-left",SVG_KEY:"blockquote"}),Object.assign(Be.DEFAULTS,{saveInterval:1e4,saveURL:null,saveParams:{},saveParam:"body",saveMethod:"POST"}),Be.PLUGINS.save=function(o){var l=o.$,e=null,c=null,t=!1,d=1,f=2,a={};function p(e,t){o.events.trigger("save.error",[{code:e,message:a[e]},t])}function n(e){void 0===e&&(e=o.html.get());var n=e,t=o.events.trigger("save.before",[e]);if(!1===t)return!1;if("string"==typeof t&&(e=t),o.opts.saveURL){var a={};for(var r in o.opts.saveParams)if(o.opts.saveParams.hasOwnProperty(r)){var i=o.opts.saveParams[r];a[r]="function"==typeof i?i.call(this):i}var s={};s[o.opts.saveParam]=e,l(this).ajax({method:o.opts.saveMethod,url:o.opts.saveURL,data:Object.assign(s,a),crossDomain:o.opts.requestWithCORS,withCredentials:o.opts.requestWithCredentials,headers:o.opts.requestHeaders,done:function(e,t,a){c=n,o.events.trigger("save.after",[e])},fail:function(e){p(f,e.response||e.responseText)}})}else p(d)}function r(){clearTimeout(e),e=setTimeout(function(){var e=o.html.get();(c!=e||t)&&(t=!1,n(c=e))},o.opts.saveInterval)}return a[d]="Missing saveURL option.",a[f]="Something went wrong during save.",{_init:function i(){o.opts.saveInterval&&(c=o.html.get(),o.events.on("contentChanged",r),o.events.on("keydown destroy",function(){clearTimeout(e)}))},save:n,reset:function s(){r(),t=!1},force:function u(){t=!0}}},Be.DefineIcon("save",{NAME:"floppy-o",FA5NAME:"save"}),Be.RegisterCommand("save",{title:"Save",undo:!1,focus:!1,refreshAfterCallback:!1,callback:function(){this.save.save()},plugin:"save"}),Object.assign(Be.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(Be.POPUP_TEMPLATES,{specialCharacters:"[_BUTTONS_][_CUSTOM_LAYER_]"}),Be.PLUGINS.specialCharacters=function(g){var m=g.$,a=g.opts.specialCharactersSets[0],r=g.opts.specialCharactersSets,s="";function o(){return'\n <div class="fr-buttons fr-tabs fr-tabs-scroll">\n '.concat(function t(e,a){var n="";return e.forEach(function(e){var t={elementClass:e.title===a.title?"fr-active fr-active-tab":"",title:e.title,dataParam1:e.title,desc:e["char"]};n+='<button class="fr-command fr-btn fr-special-character-category '.concat(t.elementClass,'" title="').concat(t.title,'" data-cmd="setSpecialCharacterCategory" data-param1="').concat(t.dataParam1,'"><span>').concat(t.desc,"</span></button>")}),n}(r,a),'\n </div>\n <div class="fr-icon-container fr-sc-container">\n ').concat(function n(e){var a="";return e.list.forEach(function(e){var t={dataParam1:e["char"],title:e.desc,splCharValue:e["char"]};a+='<span class="fr-command fr-special-character fr-icon" role="button" \n data-cmd="insertSpecialCharacter" data-param1="'.concat(t.dataParam1,'" \n title="').concat(t.title,'">').concat(t.splCharValue,"</span>")}),a}(a),"\n </div>")}return{setSpecialCharacterCategory:function n(t){a=r.filter(function(e){return e.title===t})[0],function e(){g.popups.get("specialCharacters").html(s+o())}()},showSpecialCharsPopup:function l(){var e=g.popups.get("specialCharacters");if(e||(e=function i(){g.opts.toolbarInline&&0<g.opts.specialCharButtons.length&&(s='<div class="fr-buttons fr-tabs">'.concat(g.button.buildList(g.opts.specialCharButtons),"</div>"));var e={buttons:s,custom_layer:o()},t=g.popups.create("specialCharacters",e);return function a(h){g.events.on("popup.tab",function(e){var t=m(e.currentTarget);if(!g.popups.isVisible("specialCharacters")||!t.is("span, a"))return!0;var a,n,r,i=e.which;if(Be.KEYCODE.TAB==i){if(t.is("span.fr-icon")&&e.shiftKey||t.is("a")&&!e.shiftKey){var s=h.find(".fr-buttons");a=!g.accessibility.focusToolbar(s,!!e.shiftKey)}if(!1!==a){var o=h.find("span.fr-icon:focus").first().concat(h.findVisible(" span.fr-icon").first().concat(h.find("a")));t.is("span.fr-icon")&&(o=o.not("span.fr-icon:not(:focus)")),n=o.index(t),n=e.shiftKey?((n-1)%o.length+o.length)%o.length:(n+1)%o.length,r=o.get(n),g.events.disableBlur(),r.focus(),a=!1}}else if(Be.KEYCODE.ARROW_UP==i||Be.KEYCODE.ARROW_DOWN==i||Be.KEYCODE.ARROW_LEFT==i||Be.KEYCODE.ARROW_RIGHT==i){if(t.is("span.fr-icon")){var l=t.parent().find("span.fr-icon");n=l.index(t);var c=Math.floor(l.length/11),d=n%11,f=Math.floor(n/11),p=11*f+d,u=11*c;Be.KEYCODE.ARROW_UP==i?p=((p-11)%u+u)%u:Be.KEYCODE.ARROW_DOWN==i?p=(p+11)%u:Be.KEYCODE.ARROW_LEFT==i?p=((p-1)%u+u)%u:Be.KEYCODE.ARROW_RIGHT==i&&(p=(p+1)%u),r=m(l.get(p)),g.events.disableBlur(),r.focus(),a=!1}}else Be.KEYCODE.ENTER==i&&(t.is("a")?t[0].click():g.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(t),t}()),!e.hasClass("fr-active")){g.popups.refresh("specialCharacters"),g.popups.setContainer("specialCharacters",g.$tb);var t=g.$tb.find('.fr-command[data-cmd="specialCharacters"]'),a=g.button.getPosition(t),n=a.left,r=a.top;g.popups.show("specialCharacters",n,r,outerHeight)}},back:function e(){g.popups.hide("specialCharacters"),g.toolbar.showInline()}}},Be.DefineIcon("specialCharacters",{NAME:"dollar-sign",SVG_KEY:"symbols"}),Be.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()}}),Be.RegisterCommand("insertSpecialCharacter",{callback:function(e,t){this.undo.saveStep(),this.html.insert(t),this.undo.saveStep(),this.popups.hide("specialCharacters")}}),Be.RegisterCommand("setSpecialCharacterCategory",{undo:!1,focus:!1,callback:function(e,t){this.specialCharacters.setSpecialCharacterCategory(t)}}),Be.DefineIcon("specialCharBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("specialCharBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.specialCharacters.back()}}),Object.assign(Be.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(Be.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}),Be.PLUGINS.table=function(C){var R,c,r,i,n,s,S,L=C.$;function u(){var e=_();if(e){var t=C.popups.get("table.edit");if(t||(t=p()),t){C.popups.setContainer("table.edit",C.$sc);var a=x(e),n=a.left+(a.right-a.left)/2,r=a.bottom;C.popups.show("table.edit",n,r,a.bottom-a.top,!0),C.edit.isDisabled()&&(1<J().length&&C.toolbar.disable(),C.$el.removeClass("fr-no-selection"),C.edit.on(),C.button.bulkRefresh(),C.selection.setAtEnd(C.$el.find(".fr-selected-cell").last().get(0)),C.selection.restore())}}}function o(){var e=_();if(e){var t=C.popups.get("table.colors");t||(t=function s(){var e="";0<C.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-tabs">'+C.button.buildList(C.opts.tableColorsButtons)+"</div>");var t="";C.opts.colorsHEXInput&&(t='<div class="fr-color-hex-layer fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'+C.id+'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-'+C.id+'" type="text" placeholder="'+C.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">'+C.language.translate("OK")+"</button></div></div>");var a={buttons:e,colors:function r(){for(var e='<div class="fr-color-set fr-table-colors">',t=0;t<C.opts.tableColors.length;t++)0!==t&&t%C.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=C.opts.tableColors[t]?e+='<span class="fr-command" style="background: '+C.opts.tableColors[t]+';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="'+C.opts.tableColors[t]+'"><span class="fr-sr-only">'+C.language.translate("Color")+" "+C.opts.tableColors[t]+"&nbsp;&nbsp;&nbsp;</span></span>":e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'+C.language.translate("Clear Formatting")+'">'+C.icon.create("tableColorRemove")+'<span class="fr-sr-only">'+C.language.translate("Clear Formatting")+"</span></span>";return e+="</div>"}(),custom_color:t},n=C.popups.create("table.colors",a);return C.events.$on(C.$wp,"scroll.table-colors",function(){C.popups.isVisible("table.colors")&&o()}),function i(h){C.events.on("popup.tab",function(e){var t=L(e.currentTarget);if(!C.popups.isVisible("table.colors")||!t.is("span"))return!0;var a=e.which,n=!0;if(Be.KEYCODE.TAB==a){var r=h.find(".fr-buttons");n=!C.accessibility.focusToolbar(r,!!e.shiftKey)}else if(Be.KEYCODE.ARROW_UP==a||Be.KEYCODE.ARROW_DOWN==a||Be.KEYCODE.ARROW_LEFT==a||Be.KEYCODE.ARROW_RIGHT==a){var i=t.parent().find("span.fr-command"),s=i.index(t),o=C.opts.colorsStep,l=Math.floor(i.length/o),c=s%o,d=Math.floor(s/o),f=d*o+c,p=l*o;Be.KEYCODE.ARROW_UP==a?f=((f-o)%p+p)%p:Be.KEYCODE.ARROW_DOWN==a?f=(f+o)%p:Be.KEYCODE.ARROW_LEFT==a?f=((f-1)%p+p)%p:Be.KEYCODE.ARROW_RIGHT==a&&(f=(f+1)%p);var u=L(i.get(f));C.events.disableBlur(),u.focus(),n=!1}else Be.KEYCODE.ENTER==a&&(C.button.exec(t),n=!1);return!1===n&&(e.preventDefault(),e.stopPropagation()),n},!0)}(n),n}()),C.popups.setContainer("table.colors",C.$sc);var a=x(e),n=(a.left+a.right)/2,r=a.bottom;!function i(){var e=C.popups.get("table.colors"),t=C.$el.find(".fr-selected-cell").first(),a=C.helpers.RGBToHex(t.css("background-color")),n=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="'+a+'"]').addClass("fr-selected-color fr-active-item"),n.val(a).trigger("change")}(),C.popups.show("table.colors",n,r,a.bottom-a.top,!0)}}function l(){0===J().length&&C.toolbar.enable()}function d(e){if(e)return C.popups.onHide("table.insert",function(){C.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<C.opts.tableInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'+C.button.buildList(C.opts.tableInsertButtons)+"</div>");var a={buttons:t,rows_columns:function i(){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<=C.opts.tableInsertMaxSize;t++){for(var a=1;a<=C.opts.tableInsertMaxSize;a++){var n="inline-block";2<t&&!C.helpers.isMobile()&&(n="none");var r="fr-table-cell ";1==t&&1==a&&(r+=" hover"),e+='<span class="fr-command '+r+'" tabIndex="-1" data-cmd="tableInsert" data-row="'+t+'" data-col="'+a+'" data-param1="'+t+'" data-param2="'+a+'" style="display: '+n+';" role="button"><span></span><span class="fr-sr-only">'+t+" &times; "+a+"&nbsp;&nbsp;&nbsp;</span></span>"}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},n=C.popups.create("table.insert",a);return C.events.$on(n,"mouseover",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){f(L(e.currentTarget))},!0),function r(e){C.events.$on(e,"focus","[tabIndex]",function(e){var t=L(e.currentTarget);f(t)}),C.events.on("popup.tab",function(e){var t=L(e.currentTarget);if(!C.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var a,n=e.which;if(Be.KEYCODE.ARROW_UP==n||Be.KEYCODE.ARROW_DOWN==n||Be.KEYCODE.ARROW_LEFT==n||Be.KEYCODE.ARROW_RIGHT==n){if(t.is("span.fr-table-cell")){var r=t.parent().find("span.fr-table-cell"),i=r.index(t),s=C.opts.tableInsertMaxSize,o=i%s,l=Math.floor(i/s);Be.KEYCODE.ARROW_UP==n?l=Math.max(0,l-1):Be.KEYCODE.ARROW_DOWN==n?l=Math.min(C.opts.tableInsertMaxSize-1,l+1):Be.KEYCODE.ARROW_LEFT==n?o=Math.max(0,o-1):Be.KEYCODE.ARROW_RIGHT==n&&(o=Math.min(C.opts.tableInsertMaxSize-1,o+1));var c=l*s+o,d=L(r.get(c));f(d),C.events.disableBlur(),d.focus(),a=!1}}else Be.KEYCODE.ENTER==n&&(C.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(n),n}function f(e){var t=e.data("row");null!==t&&(t=parseInt(t));var a=e.data("col");null!==a&&(a=parseInt(a));var n=e.parent();n.siblings(".fr-table-size-info").html(t+" &times; "+a),n.find("> span").removeClass("hover fr-active-item");for(var r=1;r<=C.opts.tableInsertMaxSize;r++)for(var i=0;i<=C.opts.tableInsertMaxSize;i++){var s=n.find('> span[data-row="'+r+'"][data-col="'+i+'"]');r<=t&&i<=a?s.addClass("hover"):r<=t+1||r<=2&&!C.helpers.isMobile()?s.css("display","inline-block"):2<r&&!C.helpers.isMobile()&&s.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return C.popups.onHide("table.edit",l),!0;if(0<C.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'.concat(C.button.buildList(C.opts.tableEditButtons),"</div>")},a=C.popups.create("table.edit",t);return C.events.$on(C.$wp,"scroll.table-edit",function(){C.popups.isVisible("table.edit")&&u()}),a}return!1}function h(){if(0<J().length){var e=Z();C.selection.setBefore(e.get(0))||C.selection.setAfter(e.get(0)),C.selection.restore(),C.popups.hide("table.edit"),e.remove(),C.toolbar.enable()}}function g(e){var t=Z();if(0<t.length){if(0<C.$el.find("th.fr-selected-cell").length&&"above"==e)return;var a,n,r,i=_(),s=O(i);if(null==s)return;n="above"==e?s.min_i:s.max_i;var o="<tr>";for(a=0;a<i[n].length;a++){if("below"==e&&n<i.length-1&&i[n][a]==i[n+1][a]||"above"==e&&0<n&&i[n][a]==i[n-1][a]){if(0===a||0<a&&i[n][a]!=i[n][a-1]){var l=L(i[n][a]);l.attr("rowspan",parseInt(l.attr("rowspan"),10)+1)}}else o+='<td style="'+L(i[n][a]).attr("style")+'" ><br></td>'}o+="</tr>",r=0<C.$el.find("th.fr-selected-cell").length&&"below"==e?L(t.find("tbody").not(t.find("> table tbody"))):L(t.find("tr").not(t.find("> table tr")).get(n)),"below"==e?"TBODY"==r.attr("tagName")?r.prepend(o):r[0].parentNode&&r[0].insertAdjacentHTML("afterend",o):"above"==e&&(r.before(o),C.popups.isVisible("table.edit")&&u())}}function m(e,t,a){var n,r,i,s,o,l=0,c=_(a);if(e<(t=Math.min(t,c[0].length-1)))for(r=e;r<=t;r++)if(!(e<r&&c[0][r]==c[0][r-1])&&1<(s=Math.min(parseInt(c[0][r].getAttribute("colspan"),10)||1,t-e+1))&&c[0][r]==c[0][r+1])for(l=s-1,n=1;n<c.length;n++)if(c[n][r]!=c[n-1][r]){for(i=r;i<r+s;i++)if(1<(o=parseInt(c[n][i].getAttribute("colspan"),10)||1)&&c[n][i]==c[n][i+1])i+=l=Math.min(l,o-1);else if(!(l=Math.max(0,l-1)))break;if(!l)break}l&&E(c,l,"colspan",0,c.length-1,e,t)}function v(e,t,a){var n,r,i,s,o,l=0,c=_(a);if(e<(t=Math.min(t,c.length-1)))for(n=e;n<=t;n++)if(!(e<n&&c[n][0]==c[n-1][0])&&1<(s=Math.min(parseInt(c[n][0].getAttribute("rowspan"),10)||1,t-e+1))&&c[n][0]==c[n+1][0])for(l=s-1,r=1;r<c[0].length;r++)if(c[n][r]!=c[n][r-1]){for(i=n;i<n+s;i++)if(1<(o=parseInt(c[i][r].getAttribute("rowspan"),10)||1)&&c[i][r]==c[i+1][r])i+=l=Math.min(l,o-1);else if(!(l=Math.max(0,l-1)))break;if(!l)break}l&&E(c,l,"rowspan",e,t,0,c[0].length-1)}function E(e,t,a,n,r,i,s){var o,l,c;for(o=n;o<=r;o++)for(l=i;l<=s;l++)n<o&&e[o][l]==e[o-1][l]||i<l&&e[o][l]==e[o][l-1]||1<(c=parseInt(e[o][l].getAttribute(a),10)||1)&&(1<c-t?e[o][l].setAttribute(a,c-t):e[o][l].removeAttribute(a))}function b(e,t,a,n,r){v(e,t,r),m(a,n,r)}function t(e){var t=C.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",C.helpers.HEXtoRGB(e)):t.css("background-color",""),u()}function _(e){var c=[];return null==(e=e||null)&&0<J().length&&(e=Z()),e&&e.findVisible("tr").not(e.find("> table tr")).each(function(o,e){var t=L(e),l=0;t.find("> th, > td").each(function(e,t){for(var a=L(t),n=parseInt(a.attr("colspan"),10)||1,r=parseInt(a.attr("rowspan"),10)||1,i=o;i<o+r;i++)for(var s=l;s<l+n;s++)c[i]||(c[i]=[]),c[i][s]?l++:c[i][s]=t;l+=n})}),c}function w(e,t){for(var a=0;a<t.length;a++)for(var n=0;n<t[a].length;n++)if(t[a][n]==e)return{row:a,col:n}}function y(e,t,a){for(var n=e+1,r=t+1;n<a.length;){if(a[n][t]!=a[e][t]){n--;break}n++}for(n==a.length&&n--;r<a[e].length;){if(a[e][r]!=a[e][t]){r--;break}r++}return r==a[e].length&&r--,{row:n,col:r}}function A(){C.el.querySelector(".fr-cell-fixed")&&C.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),C.el.querySelector(".fr-cell-handler")&&C.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function T(){var e=C.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=L(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),A()}function I(){C.events.disableBlur(),C.selection.clear(),C.$el.addClass("fr-no-selection"),C.$el.blur(),C.events.enableBlur()}function O(e){var t=C.$el.find(".fr-selected-cell");if(0<t.length){var a,n=e.length,r=0,i=e[0].length,s=0;for(a=0;a<t.length;a++){var o=w(t[a],e),l=y(o.row,o.col,e);n=Math.min(o.row,n),r=Math.max(l.row,r),i=Math.min(o.col,i),s=Math.max(l.col,s)}return{min_i:n,max_i:r,min_j:i,max_j:s}}return null}function x(e){var t=O(e);if(null!=t){var a=L(e[t.min_i][t.min_j]),n=L(e[t.min_i][t.max_j]),r=L(e[t.max_i][t.min_j]);return{left:a.length&&a.offset().left,right:n.length&&n.offset().left+n.outerWidth(),top:a.length&&a.offset().top,bottom:r.length&&r.offset().top+r.outerHeight()}}}function F(e,t){if(L(e).is(t))T(),L(e).addClass("fr-selected-cell");else{I(),C.edit.off();var a=_(),n=w(e,a),r=w(t,a),i=function u(e,t,a,n,r){var i,s,o,l,c=e,d=t,f=a,p=n;for(i=c;i<=d;i++)(1<(parseInt(L(r[i][f]).attr("rowspan"),10)||1)||1<(parseInt(L(r[i][f]).attr("colspan"),10)||1))&&(l=y((o=w(r[i][f],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p)),(1<(parseInt(L(r[i][p]).attr("rowspan"),10)||1)||1<(parseInt(L(r[i][p]).attr("colspan"),10)||1))&&(l=y((o=w(r[i][p],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p));for(s=f;s<=p;s++)(1<(parseInt(L(r[c][s]).attr("rowspan"),10)||1)||1<(parseInt(L(r[c][s]).attr("colspan"),10)||1))&&(l=y((o=w(r[c][s],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p)),(1<(parseInt(L(r[d][s]).attr("rowspan"),10)||1)||1<(parseInt(L(r[d][s]).attr("colspan"),10)||1))&&(l=y((o=w(r[d][s],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p));return c==e&&d==t&&f==a&&p==n?{min_i:e,max_i:t,min_j:a,max_j:n}:u(c,d,f,p,r)}(Math.min(n.row,r.row),Math.max(n.row,r.row),Math.min(n.col,r.col),Math.max(n.col,r.col),a);T(),e.classList.add("fr-cell-fixed"),t.classList.add("fr-cell-handler");for(var s=i.min_i;s<=i.max_i;s++)for(var o=i.min_j;o<=i.max_j;o++)L(a[s][o]).addClass("fr-selected-cell")}}function k(e){var t=null,a=L(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<a.closest("td",a.closest("tr")[0]).length?t=a.closest("td",a.closest("tr")[0]).get(0):0<a.closest("th",a.closest("thead")[0]).length&&(t=a.closest("th",a.closest("thead")[0]).get(0)),-1===C.$el.html.toString().search(t)?null:t}function N(){T(),C.popups.hide("table.edit")}function e(e){var t=k(e);if("false"==L(t).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(0<J().length&&!t&&N(),!C.edit.isDisabled()||C.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&C.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&C.helpers.isMac()&&e.ctrlKey)&&t&&N();else if(i=!0,t){0<J().length&&!e.shiftKey&&N(),e.stopPropagation(),C.events.trigger("image.hideResizer"),C.events.trigger("video.hideResizer"),r=!0;var a=t.tagName.toLowerCase();e.shiftKey&&0<C.$el.find(a+".fr-selected-cell").length?L(C.$el.find(a+".fr-selected-cell").closest("table")).is(L(t).closest("table"))?F(n,t):I():((C.keys.ctrlKey(e)||e.shiftKey)&&(1<J().length||0===L(t).find(C.selection.element()).length&&!L(t).is(C.selection.element()))&&I(),n=t,0<C.opts.tableEditButtons.length&&F(n,n))}}function a(e){if(C.popups.areVisible())return!0;if(r||C.$tb.is(e.target)||C.$tb.is(L(e.target).closest(".fr-toolbar"))||(0<J().length&&C.toolbar.enable(),T()),!(1!=e.which||1==e.which&&C.helpers.isMac()&&e.ctrlKey)){if(i=!1,r)r=!1,k(e)||1!=J().length?0<J().length&&(C.selection.isCollapsed()?u():(T(),C.edit.on())):T();if(S){S=!1,R.removeClass("fr-moving"),C.$el.removeClass("fr-no-selection"),C.edit.on();var t=parseFloat(R.css("left"))+C.opts.tableResizerOffset+C.$wp.offset().left;C.opts.iframe&&(t-=C.$iframe.offset().left),R.data("release-position",t),R.removeData("max-left"),R.removeData("max-right"),function A(){var e=R.data("origin"),t=R.data("release-position");if(e!==t){var a=R.data("first"),n=R.data("second"),r=R.data("table"),i=r.outerWidth();if(C.undo.canDo()||C.undo.saveStep(),null!=a&&null!=n){var s,o,l,c=_(r),d=[],f=[],p=[],u=[];for(s=0;s<c.length;s++)o=L(c[s][a]),l=L(c[s][n]),d[s]=o.outerWidth(),p[s]=l.outerWidth(),f[s]=d[s]/i*100,u[s]=p[s]/i*100;for(s=0;s<c.length;s++)if(o=L(c[s][a]),l=L(c[s][n]),c[s][a]!=c[s][n]){var h=(f[s]*(d[s]+t-e)/d[s]).toFixed(4);o.css("width",h+"%"),l.css("width",(f[s]+u[s]-h).toFixed(4)+"%")}}else{var g,m=r.parent(),v=i/m.width()*100,E=(parseInt(r.css("margin-left"),10)||0)/m.width()*100,b=(parseInt(r.css("margin-right"),10)||0)/m.width()*100;"rtl"==C.opts.direction&&0===n||"rtl"!=C.opts.direction&&0!==n?(g=(i+t-e)/i*v,r.css("margin-right","calc(100% - "+Math.round(g).toFixed(4)+"% - "+Math.round(E).toFixed(4)+"%)")):("rtl"==C.opts.direction&&0!==n||"rtl"!=C.opts.direction&&0===n)&&(g=(i-t+e)/i*v,r.css("margin-left","calc(100% - "+Math.round(g).toFixed(4)+"% - "+Math.round(b).toFixed(4)+"%)")),r.css("width",Math.round(g).toFixed(4)+"%")}C.selection.restore(),C.undo.saveStep(),C.events.trigger("table.resized",[r.get(0)])}R.removeData("origin"),R.removeData("release-position"),R.removeData("first"),R.removeData("second"),R.removeData("table")}(),U()}}}function D(e){if(!0===r&&0<C.opts.tableEditButtons.length){if(L(e.currentTarget).closest("table").is(Z())){if("TD"==e.currentTarget.tagName&&0===C.$el.find("th.fr-selected-cell").length)return void F(n,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===C.$el.find("td.fr-selected-cell").length)return void F(n,e.currentTarget)}I()}}function M(e,t,a,n){for(var r,i=t;i!=C.el&&"TD"!=i.tagName&&"TH"!=i.tagName&&("up"==n?r=i.previousElementSibling:"down"==n&&(r=i.nextElementSibling),!r);)i=i.parentNode;"TD"==i.tagName||"TH"==i.tagName?function s(e,t){for(var a=e;a&&"TABLE"!=a.tagName&&a.parentNode!=C.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName){var n=_(L(a));"up"==t?B(w(e,n),a,n):"down"==t&&P(w(e,n),a,n)}}(i,n):r&&("up"==n&&C.selection.setAtEnd(r),"down"==n&&C.selection.setAtStart(r))}function B(e,t,a){0<e.row?C.selection.setAtEnd(a[e.row-1][e.col]):M(0,t,0,"up")}function P(e,t,a){var n=parseInt(a[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<a.length-n?C.selection.setAtStart(a[e.row+n][e.col]):M(0,t,0,"down")}function U(){R&&(R.find("div").css("opacity",0),R.css("top",0),R.css("left",0),R.css("height",0),R.find("div").css("height",0),R.hide())}function W(){c&&c.removeClass("fr-visible").css("left","-9999px")}function K(e,t){var a=L(t),n=a.closest("table"),r=n.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)R&&a.get(0)!=R.get(0)&&a.parent().get(0)!=R.get(0)&&C.core.sameInstance(R)&&U();else{if(a=L(t),0===C.$el.find(a).length)return!1;var i=a.offset().left-1,s=i+a.outerWidth();if(Math.abs(e.pageX-i)<=C.opts.tableResizerOffset||Math.abs(s-e.pageX)<=C.opts.tableResizerOffset){var o,l,c,d,f,p=_(n),u=w(t,p),h=y(u.row,u.col,p),g=n.offset().top,m=n.outerHeight()-1;"rtl"!=C.opts.direction?e.pageX-i<=C.opts.tableResizerOffset?(c=i,0<u.col?(d=i-V(u.col-1,p)+C.opts.tableResizingLimit,f=i+V(u.col,p)-C.opts.tableResizingLimit,o=u.col-1,l=u.col):(o=null,l=0,d=n.offset().left-1-parseInt(n.css("margin-left"),10),f=n.offset().left-1+n.width()-p[0].length*C.opts.tableResizingLimit)):s-e.pageX<=C.opts.tableResizerOffset&&(c=s,h.col<p[h.row].length&&p[h.row][h.col+1]?(d=s-V(h.col,p)+C.opts.tableResizingLimit,f=s+V(h.col+1,p)-C.opts.tableResizingLimit,o=h.col,l=h.col+1):(o=h.col,l=null,d=n.offset().left-1+p[0].length*C.opts.tableResizingLimit,f=r.offset().left-1+r.width()+parseFloat(r.css("padding-left")))):s-e.pageX<=C.opts.tableResizerOffset?(c=s,0<u.col?(d=s-V(u.col,p)+C.opts.tableResizingLimit,f=s+V(u.col-1,p)-C.opts.tableResizingLimit,o=u.col,l=u.col-1):(o=null,l=0,d=n.offset().left+p[0].length*C.opts.tableResizingLimit,f=r.offset().left-1+r.width()+parseFloat(r.css("padding-left")))):e.pageX-i<=C.opts.tableResizerOffset&&(c=i,h.col<p[h.row].length&&p[h.row][h.col+1]?(d=i-V(h.col+1,p)+C.opts.tableResizingLimit,f=i+V(h.col,p)-C.opts.tableResizingLimit,o=h.col+1,l=h.col):(o=h.col,l=null,d=r.offset().left+parseFloat(r.css("padding-left")),f=n.offset().left-1+n.width()-p[0].length*C.opts.tableResizingLimit)),R||function T(){C.shared.$table_resizer||(C.shared.$table_resizer=L(document.createElement("div")).attr("class","fr-table-resizer").html("<div></div>")),R=C.shared.$table_resizer,C.events.$on(R,"mousedown",function(e){return!C.core.sameInstance(R)||(0<J().length&&N(),1==e.which?(C.selection.save(),S=!0,R.addClass("fr-moving"),I(),C.edit.off(),R.find("div").css("opacity",1),!1):void 0)}),C.events.$on(R,"mousemove",function(e){if(!C.core.sameInstance(R))return!0;S&&(C.opts.iframe&&(e.pageX-=C.$iframe.offset().left),j(e))}),C.events.on("shared.destroy",function(){R.html("").removeData().remove(),R=null},!0),C.events.on("destroy",function(){C.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),L("body").first().append(R.hide())},!0)}(),R.data("table",n),R.data("first",o),R.data("second",l),R.data("instance",C),C.$wp.append(R);var v=c-C.win.pageXOffset-C.opts.tableResizerOffset-C.$wp.offset().left,E=g-C.$wp.offset().top+C.$wp.scrollTop();if(C.opts.iframe){var b=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top")),A=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-left"));v+=C.$iframe.offset().left+A,E+=C.$iframe.offset().top+b,d+=C.$iframe.offset().left,f+=C.$iframe.offset().left}R.data("max-left",d),R.data("max-right",f),R.data("origin",c-C.win.pageXOffset),R.css("top",E),R.css("left",v),R.css("height",m),R.find("div").css("height",m),R.css("padding-left",C.opts.tableResizerOffset),R.css("padding-right",C.opts.tableResizerOffset),R.show()}else C.core.sameInstance(R)&&U()}}function H(e,t){if(C.$box.find(".fr-line-breaker").isVisible())return!1;c||X(),C.$box.append(c),c.data("instance",C);var a,n=L(t).find("tr").first(),r=e.pageX,i=0,s=0;if(C.opts.iframe){var o=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top")),l=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-left"));i+=C.$iframe.offset().left-C.helpers.scrollLeft()+l,s+=C.$iframe.offset().top-C.helpers.scrollTop()+o}n.find("th, td").each(function(){var e=L(this);return e.offset().left<=r&&r<e.offset().left+e.outerWidth()/2?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top-a-5),c.css("left",i+e.offset().left-C.$box.offset().left-a/2),c.data("selected-cell",e),c.data("position","before"),c.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=r&&r<e.offset().left+e.outerWidth()?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top-a-5),c.css("left",i+e.offset().left-C.$box.offset().left+e.outerWidth()-a/2),c.data("selected-cell",e),c.data("position","after"),c.addClass("fr-visible"),!1):void 0})}function $(e,t){if(C.$box.find(".fr-line-breaker").isVisible())return!1;c||X(),C.$box.append(c),c.data("instance",C);var a,n=L(t),r=e.pageY,i=0,s=0;if(C.opts.iframe){var o=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top")),l=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-left"));i+=C.$iframe.offset().left-C.helpers.scrollLeft()+l,s+=C.$iframe.offset().top-C.helpers.scrollTop()+o}n.find("tr").each(function(){var e=L(this);return e.offset().top<=r&&r<e.offset().top+e.outerHeight()/2?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top-a/2),c.css("left",i+e.offset().left-C.$box.offset().left-a-5),c.data("selected-cell",e.find("td").first()),c.data("position","above"),c.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=r&&r<e.offset().top+e.outerHeight()?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top+e.outerHeight()-a/2),c.css("left",i+e.offset().left-C.$box.offset().left-a-5),c.data("selected-cell",e.find("td").first()),c.data("position","below"),c.addClass("fr-visible"),!1):void 0})}function G(e){s=null;var t=C.doc.elementFromPoint(e.pageX-C.win.pageXOffset,e.pageY-C.win.pageYOffset);C.opts.tableResizer&&(!C.popups.areVisible()||C.popups.areVisible()&&C.popups.isVisible("table.edit"))&&K(e,t),!C.opts.tableInsertHelper||C.popups.areVisible()||C.$tb.hasClass("fr-inline")&&C.$tb.isVisible()||function i(e,t){if(0===J().length){var a,n,r;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||C.node.isElement(t)))for(a=1;a<=C.opts.tableInsertHelperOffset;a++){if(n=C.doc.elementFromPoint(e.pageX-C.win.pageXOffset,e.pageY-C.win.pageYOffset+a),L(n).hasClass("fr-tooltip"))return!0;if(n&&("TH"==n.tagName||"TD"==n.tagName||"TABLE"==n.tagName)&&(L(n).parents(".fr-wrapper").length||C.opts.iframe)&&"false"!=L(n).closest("table").attr("contenteditable"))return H(e,L(n).closest("table")),!0;if(r=C.doc.elementFromPoint(e.pageX-C.win.pageXOffset+a,e.pageY-C.win.pageYOffset),L(r).hasClass("fr-tooltip"))return!0;if(r&&("TH"==r.tagName||"TD"==r.tagName||"TABLE"==r.tagName)&&(L(r).parents(".fr-wrapper").length||C.opts.iframe)&&"false"!=L(r).closest("table").attr("contenteditable"))return $(e,L(r).closest("table")),!0}C.core.sameInstance(c)&&W()}}(e,t)}function Y(){if(S){var e=R.data("table").offset().top-C.win.pageYOffset;if(C.opts.iframe){var t=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top"));e+=C.$iframe.offset().top-C.helpers.scrollTop()+t}R.css("top",e)}}function V(e,t){var a,n=L(t[0][e]).outerWidth();for(a=1;a<t.length;a++)n=Math.min(n,L(t[a][e]).outerWidth());return n}function z(e,t,a){var n,r=0;for(n=e;n<=t;n++)r+=V(n,a);return r}function j(e){if(1<J().length&&i&&I(),!1===i&&!1===r&&!1===S)s&&clearTimeout(s),C.edit.isDisabled()&&!C.popups.isVisible("table.edit")||(s=setTimeout(G,30,e));else if(S){var t=e.pageX-C.win.pageXOffset;C.opts.iframe&&(t+=C.$iframe.offset().left);var a=R.data("max-left"),n=R.data("max-right");a<=t&&t<=n?R.css("left",t-C.opts.tableResizerOffset-C.$wp.offset().left):t<a&&parseFloat(R.css("left"),10)>a-C.opts.tableResizerOffset?R.css("left",a-C.opts.tableResizerOffset-C.$wp.offset().left):n<t&&parseFloat(R.css("left"),10)<n-C.opts.tableResizerOffset&&R.css("left",n-C.opts.tableResizerOffset-C.$wp.offset().left)}else i&&W()}function q(e){C.node.isEmpty(e.get(0))?e.prepend(Be.MARKERS):e.prepend(Be.START_MARKER).append(Be.END_MARKER)}function X(){C.shared.$ti_helper||(C.shared.$ti_helper=L(document.createElement("div")).attr("class","fr-insert-helper").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'+C.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>'),C.events.bindClick(C.shared.$ti_helper,"a",function(){var e=c.data("selected-cell"),t=c.data("position"),a=c.data("instance")||C;"before"==t?(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()):"after"==t?(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()):"above"==t?(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()):"below"==t&&(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()),W()}),C.events.on("shared.destroy",function(){C.shared.$ti_helper.html("").removeData().remove(),C.shared.$ti_helper=null},!0),C.events.$on(C.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),C.events.$on(L(C.o_win),"scroll",function(){W()},!0),C.events.$on(C.$wp,"scroll",function(){W()},!0)),c=C.shared.$ti_helper,C.events.on("destroy",function(){c=null}),C.tooltip.bind(C.$box,".fr-insert-helper > a.fr-floating-btn")}function Q(){n=null,clearTimeout(s)}function J(){return C.el.querySelectorAll(".fr-selected-cell")}function Z(){var e=J();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=C.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?L(t):L([])}return L([])}return{_init:function ee(){if(!C.$wp)return!1;if(!C.helpers.isMobile()){S=r=i=!1,C.events.$on(C.$el,"mousedown",e),C.popups.onShow("image.edit",function(){T(),r=i=!1}),C.popups.onShow("link.edit",function(){T(),r=i=!1}),C.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&T()}),C.events.$on(C.$el,"mouseover","th, td",D),C.events.$on(C.$win,"mouseup",a),C.opts.iframe&&C.events.$on(L(C.o_win),"mouseup",a),C.events.$on(C.$win,"mousemove",j),C.events.$on(L(C.o_win),"scroll",Y),C.events.on("contentChanged",function(){0<J().length&&(u(),C.$el.find("img").on("load.selected-cells",function(){L(this).off("load.selected-cells"),0<J().length&&u()}))}),C.events.$on(L(C.o_win),"resize",function(){T()}),C.events.on("toolbar.esc",function(){if(0<J().length)return C.events.disableBlur(),C.events.focus(),!1},!0),C.events.$on(L(C.o_win),"keydown",function(){i&&r&&(r=i=!1,C.$el.removeClass("fr-no-selection"),C.edit.on(),C.selection.setAtEnd(C.$el.find(".fr-selected-cell").last().get(0)),C.selection.restore(),T())}),C.events.$on(C.$el,"keydown",function(e){e.shiftKey?!1===function s(e){var t=J();if(null!=t&&0<t.length){var a,n=_(),r=e.which,i=w(1==t.length?a=t[0]:(a=C.el.querySelector(".fr-cell-fixed"),C.el.querySelector(".fr-cell-handler")),n);if(Be.KEYCODE.ARROW_RIGHT==r){if(i.col<n[0].length-1)return F(a,n[i.row][i.col+1]),!1}else if(Be.KEYCODE.ARROW_DOWN==r){if(i.row<n.length-1)return F(a,n[i.row+1][i.col]),!1}else if(Be.KEYCODE.ARROW_LEFT==r){if(0<i.col)return F(a,n[i.row][i.col-1]),!1}else if(Be.KEYCODE.ARROW_UP==r&&0<i.row)return F(a,n[i.row-1][i.col]),!1}}(e)&&setTimeout(function(){u()},0):function o(e){var t=e.which,a=C.selection.blocks();if(a.length&&("TD"==(a=a[0]).tagName||"TH"==a.tagName)){for(var n=a;n&&"TABLE"!=n.tagName&&n.parentNode!=C.el;)n=n.parentNode;if(n&&"TABLE"==n.tagName&&(Be.KEYCODE.ARROW_LEFT==t||Be.KEYCODE.ARROW_UP==t||Be.KEYCODE.ARROW_RIGHT==t||Be.KEYCODE.ARROW_DOWN==t)&&(0<J().length&&N(),C.browser.webkit&&(Be.KEYCODE.ARROW_UP==t||Be.KEYCODE.ARROW_DOWN==t))){var r=C.selection.ranges(0).startContainer;if(r.nodeType==Node.TEXT_NODE&&(Be.KEYCODE.ARROW_UP==t&&(r.previousSibling&&"BR"!==r.previousSibling.tagName||r.previousSibling&&"BR"===r.previousSibling.tagName&&r.previousSibling.previousSibling)||Be.KEYCODE.ARROW_DOWN==t&&(r.nextSibling&&"BR"!==r.nextSibling.tagName||r.nextSibling&&"BR"===r.nextSibling.tagName&&r.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var i=_(L(n)),s=w(a,i);return Be.KEYCODE.ARROW_UP==t?B(s,n,i):Be.KEYCODE.ARROW_DOWN==t&&P(s,n,i),C.selection.restore(),!1}}}(e)}),C.events.on("keydown",function(e){if(!1===function n(e){if(e.which==Be.KEYCODE.TAB){var t;if(0<J().length)t=C.$el.find(".fr-selected-cell").last();else{var a=C.selection.element();"TD"==a.tagName||"TH"==a.tagName?t=L(a):a!=C.el&&(0<L(a).parentsUntil(C.$el,"td").length?t=L(a).parents("td").first():0<L(a).parentsUntil(C.$el,"th").length&&(t=L(a).parents("th").first()))}if(t)return e.preventDefault(),!!(0===C.selection.get().focusOffset&&0<L(C.selection.element()).parentsUntil(C.$el,"ol, ul").length&&(0<L(C.selection.element()).closest("li").prev().length||L(C.selection.element()).is("li")&&0<L(C.selection.element()).prev().length))||(N(),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"),g("below"),T(),q(t.closest("tr").next().find("td").first())),C.selection.restore(),!1)}}(e))return!1;var t=J();if(0<t.length){if(0<t.length&&C.keys.ctrlKey(e)&&e.which==Be.KEYCODE.A)return T(),C.popups.isVisible("table.edit")&&C.popups.hide("table.edit"),t=[],!0;if(e.which==Be.KEYCODE.ESC&&C.popups.isVisible("table.edit"))return T(),C.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==Be.KEYCODE.BACKSPACE||e.which==Be.KEYCODE.DELETE)){C.undo.saveStep();for(var a=0;a<t.length;a++)L(t[a]).html("<br>"),a==t.length-1&&L(t[a]).prepend(Be.MARKERS);return C.selection.restore(),C.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=Be.KEYCODE.F10&&!C.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function r(e){if(e.altKey&&e.which==Be.KEYCODE.SPACE){var t,a=C.selection.element();if("TD"==a.tagName||"TH"==a.tagName?t=a:0<L(a).closest("td").length?t=L(a).closest("td").get(0):0<L(a).closest("th").length&&(t=L(a).closest("th").get(0)),t)return e.preventDefault(),F(t,t),u(),!1}}(e))return!1},!0);var t=[];C.events.on("html.beforeGet",function(){t=J();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),C.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=[]}),d(!0),p(!0)}C.events.on("destroy",Q)},insert:function te(e,t){var a,n,r="<table "+(C.opts.tableDefaultWidth?'style="width: '+C.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',i=100/t;for(a=0;a<e;a++){for(r+="<tr>",n=0;n<t;n++)r+="<td"+(C.opts.tableDefaultWidth?' style="width: '+i.toFixed(4)+'%;"':"")+">",0===a&&0===n&&(r+=Be.MARKERS),r+="<br></td>";r+="</tr>"}r+="</tbody></table>",C.html.insert(r),C.selection.restore();var s=C.$el.find(".fr-inserted-table");s.removeClass("fr-inserted-table"),C.events.trigger("table.inserted",[s.get(0)])},remove:h,insertRow:g,deleteRow:function ae(){var e=Z();if(0<e.length){var t,a,n,r=_(),i=O(r);if(null==i)return;if(0===i.min_i&&i.max_i==r.length-1)h();else{for(t=i.max_i;t>=i.min_i;t--){for(n=L(e.find("tr").not(e.find("> table tr")).get(t)),a=0;a<r[t].length;a++)if(0===a||r[t][a]!=r[t][a-1]){var s=L(r[t][a]);if(1<parseInt(s.attr("rowspan"),10)){var o=parseInt(s.attr("rowspan"),10)-1;1==o?s.removeAttr("rowspan"):s.attr("rowspan",o)}if(t<r.length-1&&r[t][a]==r[t+1][a]&&(0===t||r[t][a]!=r[t-1][a])){for(var l=r[t][a],c=a;0<c&&r[t][c]==r[t][c-1];)c--;0===c?L(e.find("tr").not(e.find("> table tr")).get(t+1)).prepend(l):L(r[t+1][c-1])[0].parentNode&&L(r[t+1][c-1])[0].insertAdjacentElement("afterend",l)}}var d=n.parent();n.remove(),0===d.find("tr").length&&d.remove(),r=_(e)}b(0,r.length-1,0,r[0].length-1,e),0<i.min_i?C.selection.setAtEnd(r[i.min_i-1][0]):C.selection.setAtEnd(r[0][0]),C.selection.restore(),C.popups.hide("table.edit")}}},insertColumn:function ne(l){var e=Z();if(0<e.length){var c,d=_(),t=O(d);c="before"==l?t.min_j:t.max_j;var a,f=100/d[0].length,p=100/(d[0].length+1);e.find("th, td").each(function(){(a=L(this)).data("old-width",a.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("> table tr")).each(function(e){for(var t,a=L(this),n=0,r=0;n-1<c;){if(!(t=a.find("> th, > td").get(r))){t=null;break}t==d[e][n]?(n+=parseInt(L(t).attr("colspan"),10)||1,r++):(n+=parseInt(L(d[e][n]).attr("colspan"),10)||1,"after"==l&&(t=0===r?-1:a.find("> th, > td").get(r-1)))}var i,s=L(t);if("after"==l&&c<n-1||"before"==l&&0<c&&d[e][c]==d[e][c-1]){if(0===e||0<e&&d[e][c]!=d[e-1][c]){var o=parseInt(s.attr("colspan"),10)+1;s.attr("colspan",o),s.css("width",(s.data("old-width")*p/f+p).toFixed(4)+"%"),s.removeData("old-width")}}else i=0<a.find("th").length?'<th style="width: '+p.toFixed(4)+'%;"><br></th>':'<td style="width: '+p.toFixed(4)+'%;"><br></td>',-1==t?a.prepend(i):null==t?a.append(i):"before"==l?s.before(i):"after"==l&&s[0].parentNode&&s[0].insertAdjacentHTML("afterend",i)}),e.find("th, td").each(function(){(a=L(this)).data("old-width")&&(a.css("width",(a.data("old-width")*p/f).toFixed(4)+"%"),a.removeData("old-width"))}),C.popups.isVisible("table.edit")&&u()}},deleteColumn:function re(){var e=Z();if(0<e.length){var t,a,n,r=_(),i=O(r);if(null==i)return;if(0===i.min_j&&i.max_j==r[0].length-1)h();else{var s=0;for(t=0;t<r.length;t++)for(a=0;a<r[0].length;a++)(n=L(r[t][a])).hasClass("fr-selected-cell")||(n.data("old-width",n.outerWidth()/e.outerWidth()*100),(a<i.min_j||a>i.max_j)&&(s+=n.outerWidth()/e.outerWidth()*100));for(s/=r.length,a=i.max_j;a>=i.min_j;a--)for(t=0;t<r.length;t++)if(0===t||r[t][a]!=r[t-1][a])if(n=L(r[t][a]),1<(parseInt(n.attr("colspan"),10)||1)){var o=parseInt(n.attr("colspan"),10)-1;1==o?n.removeAttr("colspan"):n.attr("colspan",o),n.css("width",(100*(n.data("old-width")-V(a,r))/s).toFixed(4)+"%"),n.removeData("old-width")}else{var l=L(n.parent().get(0));n.remove(),0===l.find("> th, > td").length&&(0===l.prev().length||0===l.next().length||l.prev().find("> th[rowspan], > td[rowspan]").length<l.prev().find("> th, > td").length)&&l.remove()}b(0,r.length-1,0,r[0].length-1,e),0<i.min_j?C.selection.setAtEnd(r[i.min_i][i.min_j-1]):C.selection.setAtEnd(r[i.min_i][0]),C.selection.restore(),C.popups.hide("table.edit"),e.find("th, td").each(function(){(n=L(this)).data("old-width")&&(n.css("width",(100*n.data("old-width")/s).toFixed(4)+"%"),n.removeData("old-width"))})}}},mergeCells:function ie(){if(1<J().length&&(0===C.$el.find("th.fr-selected-cell").length||0===C.$el.find("td.fr-selected-cell").length)){A();var e,t,a=O(_());if(null==a)return;var n=C.$el.find(".fr-selected-cell"),r=L(n[0]),i=r.parent().find(".fr-selected-cell"),s=r.closest("table"),o=r.html(),l=0;for(e=0;e<i.length;e++)l+=L(i[e]).outerWidth();for(r.css("width",Math.min(100,l/s.outerWidth()*100).toFixed(4)+"%"),a.min_j<a.max_j&&r.attr("colspan",a.max_j-a.min_j+1),a.min_i<a.max_i&&r.attr("rowspan",a.max_i-a.min_i+1),e=1;e<n.length;e++)"<br>"!=(t=L(n[e])).html()&&""!==t.html()&&(o+="<br>"+t.html()),t.remove();r.html(o),C.selection.setAtEnd(r.get(0)),C.selection.restore(),C.toolbar.enable(),v(a.min_i,a.max_i,s);var c=s.find("tr:empty");for(e=c.length-1;0<=e;e--)L(c[e]).remove();m(a.min_j,a.max_j,s),u()}},splitCellVertically:function se(){if(1==J().length){var e=C.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,a=e.parent().outerWidth(),n=e.outerWidth(),r=e.clone().html("<br>"),i=_(),s=w(e.get(0),i);if(1<t){var o=Math.ceil(t/2);n=z(s.col,s.col+o-1,i)/a*100;var l=z(s.col+o,s.col+t-1,i)/a*100;1<o?e.attr("colspan",o):e.removeAttr("colspan"),1<t-o?r.attr("colspan",t-o):r.removeAttr("colspan"),e.css("width",n.toFixed(4)+"%"),r.css("width",l.toFixed(4)+"%")}else{var c;for(c=0;c<i.length;c++)if(0===c||i[c][s.col]!=i[c-1][s.col]){var d=L(i[c][s.col]);if(!d.is(e)){var f=(parseInt(d.attr("colspan"),10)||1)+1;d.attr("colspan",f)}}n=n/a*100/2,e.css("width",n.toFixed(4)+"%"),r.css("width",n.toFixed(4)+"%")}e[0].parentNode&&e[0].insertAdjacentElement("afterend",r[0]),T(),C.popups.hide("table.edit")}},splitCellHorizontally:function oe(){if(1==J().length){var e=C.$el.find(".fr-selected-cell"),t=e.parent(),a=e.closest("table"),n=parseInt(e.attr("rowspan"),10),r=_(),i=w(e.get(0),r),s=e.clone().html("<br>");if(1<n){var o=Math.ceil(n/2);1<o?e.attr("rowspan",o):e.removeAttr("rowspan"),1<n-o?s.attr("rowspan",n-o):s.removeAttr("rowspan");for(var l=i.row+o,c=0===i.col?i.col:i.col-1;0<=c&&(r[l][c]==r[l][c-1]||0<l&&r[l][c]==r[l-1][c]);)c--;-1==c?L(a.find("tr").not(a.find("> table tr")).get(l)).prepend(s):L(r[l][c])[0].parentNode&&L(r[l][c])[0].insertAdjacentElement("afterend",s[0])}else{var d,f=L(document.createElement("tr")).append(s);for(d=0;d<r[0].length;d++)if(0===d||r[i.row][d]!=r[i.row][d-1]){var p=L(r[i.row][d]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t[0].parentNode&&t[0].insertAdjacentElement("afterend",f[0])}T(),C.popups.hide("table.edit")}},addHeader:function le(){var e=Z();if(0<e.length&&0===e.find("th").length){var t,a="<thead><tr>",n=0;for(e.find("tr").first().find("> td").each(function(){var e=L(this);n+=parseInt(e.attr("colspan"),10)||1}),t=0;t<n;t++)a+="<th><br></th>";a+="</tr></thead>",e.prepend(a),u()}},removeHeader:function ce(){var e=Z(),t=e.find("thead");if(0<t.length)if(0===e.find("tbody tr").length)h();else if(t.remove(),0<J().length)u();else{C.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(C.selection.setAtEnd(a),C.selection.restore())}},setBackground:t,showInsertPopup:function de(){var e=C.$tb.find('.fr-command[data-cmd="insertTable"]'),t=C.popups.get("table.insert");if(t||(t=d()),!t.hasClass("fr-active")){C.popups.refresh("table.insert"),C.popups.setContainer("table.insert",C.$tb);var a=C.button.getPosition(e),n=a.left,r=a.top;C.popups.show("table.insert",n,r,e.outerHeight())}},showEditPopup:u,showColorsPopup:o,back:function fe(){0<J().length?u():(C.popups.hide("table.insert"),C.toolbar.showInline())},verticalAlign:function pe(e){C.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function ue(e){C.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function he(e,t,a,n){if(0<t.length){if(!a){var r=Object.keys(n);r.splice(r.indexOf(e),1),t.removeClass(r.join(" "))}t.toggleClass(e)}},selectedTable:Z,selectedCells:J,customColor:function ge(){var e=C.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:F}},Be.DefineIcon("insertTable",{NAME:"table",SVG_KEY:"insertTable"}),Be.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"}),Be.RegisterCommand("tableInsert",{callback:function(e,t,a){this.table.insert(t,a),this.popups.hide("table.insert")}}),Be.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading",SVG_KEY:"tableHeader"}),Be.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))}}),Be.DefineIcon("tableRows",{NAME:"bars",SVG_KEY:"row"}),Be.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=Be.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()}}),Be.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90",SVG_KEY:"columns"}),Be.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=Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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()}}),Be.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square",SVG_KEY:"cellOptions"}),Be.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=Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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))}}),Be.DefineIcon("tableRemove",{NAME:"trash",SVG_KEY:"removeTable"}),Be.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),Be.DefineIcon("tableStyle",{NAME:"paint-brush",SVG_KEY:"tableStyle"}),Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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.$,n=this.$el.find(".fr-selected-cell").closest("table");n&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=n.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Be.DefineIcon("tableCellBackground",{NAME:"tint",SVG_KEY:"cellBackground"}),Be.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),Be.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),Be.DefineIcon("tableBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.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"))}}),Be.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"verticalAlignMiddle"}),Be.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=Be.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="'+a.toLowerCase()+'" title="'+this.language.translate(t[a])+'">'+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)}}),Be.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),Be.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.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=Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("align-"+a)+'<span class="fr-sr-only">'+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-"+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)}}),Be.DefineIcon("tableCellStyle",{NAME:"magic",SVG_KEY:"cellStyle"}),Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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.$,n=this.$el.find(".fr-selected-cell").first();n&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=n.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Be.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),Be.DefineIcon("tableColorRemove",{NAME:"eraser",SVG_KEY:"remove"}),Be.URLRegEx="(^| |\\u00A0)("+Be.LinkRegEx+"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$",Be.PLUGINS.url=function(i){var s=i.$,o=null;function t(e,t,a){for(var n="";a.length&&"."==a[a.length-1];)n+=".",a=a.substring(0,a.length-1);var r=a;if(i.opts.linkConvertEmailAddress)i.helpers.isEmail(r)&&!/^mailto:.*/i.test(r)&&(r="mailto:"+r);else if(i.helpers.isEmail(r))return t+a;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(r)||(r="//"+r),(t||"")+"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(o?' rel="'+o+'"':"")+' data-fr-linked="true" href="'+r+'">'+a.replace(/&amp;/g,"&").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</a>"+n}function l(){return new RegExp(Be.URLRegEx,"gi")}function c(e){return i.opts.linkAlwaysNoFollow&&(o="nofollow"),i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(o?o+=" noopener":o="noopener"),i.opts.linkNoReferrer&&(o?o+=" noreferrer":o="noreferrer")),e.replace(l(),t)}function d(e){var t=e.split(" ");return t[t.length-1]}function a(){var e=i.selection.ranges(0),t=e.startContainer;if(!t||t.nodeType!==Node.TEXT_NODE||e.startOffset!==(t.textContent||"").length)return!1;if(function r(e){return!!e&&("A"===e.tagName||!(!e.parentNode||e.parentNode==i.el)&&r(e.parentNode))}(t))return!1;if(l().test(d(t.textContent))){s(t).before(c(t.textContent));var a=s(t.parentNode).find("a[data-fr-linked]");a.removeAttr("data-fr-linked"),t.parentNode.removeChild(t),i.events.trigger("url.linked",[a.get(0)])}else if(t.textContent.split(" ").length<=2&&t.previousSibling&&"A"===t.previousSibling.tagName){var n=t.previousSibling.innerText+t.textContent;l().test(d(n))&&(s(t.previousSibling).replaceWith(c(n)),t.parentNode.removeChild(t))}}return{_init:function e(){i.events.on("keypress",function(e){!i.selection.isCollapsed()||"."!=e.key&&")"!=e.key&&"("!=e.key||a()},!0),i.events.on("keydown",function(e){var t=e.which;!i.selection.isCollapsed()||t!=Be.KEYCODE.ENTER&&t!=Be.KEYCODE.SPACE||a()},!0),i.events.on("paste.beforeCleanup",function(e){if(i.helpers.isURL(e)){var t=null;return i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(t?t+=" noopener":t="noopener"),i.opts.linkNoReferrer&&(t?t+=" noreferrer":t="noreferrer")),"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(t?' rel="'+t+'"':"")+' href="'+e+'" >'+e+"</a>"}})}}},Object.assign(Be.POPUP_TEMPLATES,{"video.insert":"[_BUTTONS_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_LAYER_][_PROGRESS_BAR_]","video.edit":"[_BUTTONS_]","video.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(Be.DEFAULTS,{videoAllowedTypes:["mp4","webm","ogg"],videoAllowedProviders:[".*"],videoDefaultAlign:"center",videoDefaultDisplay:"block",videoDefaultWidth:600,videoEditButtons:["videoReplace","videoRemove","videoDisplay","videoAlign","videoSize"],videoInsertButtons:["videoBack","|","videoByURL","videoEmbed","videoUpload"],videoMaxSize:52428800,videoMove:!0,videoResize:!0,videoResponsive:!1,videoSizeButtons:["videoBack","|"],videoSplitHTML:!1,videoTextNear:!0,videoUpload:!0,videoUploadMethod:"POST",videoUploadParam:"file",videoUploadParams:{},videoUploadToS3:!1,videoUploadURL:null}),Be.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be)|(youtube.com))\/((v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))?\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?([0-9a-zA-Z_\-]+)(.+)?/g,url_text:"https://www.youtube.com/embed/$1?$2",html:'<iframe width="640" height="360" src="{url}&wmode=opaque" frameborder="0" allowfullscreen></iframe>',provider:"youtube"},{test_regex:/^.*(?:vimeo.com)\/(?:channels(\/\w+\/)?|groups\/*\/videos\/\u200b\d+\/|video\/|)(\d+)(?:$|\/|\?)/,url_regex:/(?:https?:\/\/)?(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?(\/[a-zA-Z0-9_\-]+)?/i,url_text:"https://player.vimeo.com/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vimeo"},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"https://www.dailymotion.com/embed/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"dailymotion"},{test_regex:/^.+(screen.yahoo.com)\/[^_&]+/,url_regex:"",url_text:"",html:'<iframe width="640" height="360" src="{url}?format=embed" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"yahoo"},{test_regex:/^.+(rutube.ru)\/[^_&]+/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru)\/(?:video)?\/?(.+)/g,url_text:"https://rutube.ru/play/embed/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"rutube"},{test_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/,url_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/g,url_text:"https://play.vidyard.com/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vidyard"}],Be.VIDEO_EMBED_REGEX=/^\W*((<iframe(.|\n)*>(\s|\n)*<\/iframe>)|(<embed(.|\n)*>))\W*$/i,Be.PLUGINS.video=function(u){var o,d,f,p,n,a,h=u.$,l="https://i.froala.com/upload",g=2,m=3,v=4,c=5,E=6,r={};function b(){var e=u.popups.get("video.insert");e.find(".fr-video-by-url-layer input").val("").trigger("change");var t=e.find(".fr-video-embed-layer textarea");t.val("").trigger("change"),(t=e.find(".fr-video-upload-layer input")).val("").trigger("change")}function i(){var e=u.popups.get("video.edit");if(e||(e=function r(){var e="";if(0<u.opts.videoEditButtons.length){u.opts.videoResponsive&&(-1<u.opts.videoEditButtons.indexOf("videoSize")&&u.opts.videoEditButtons.splice(u.opts.videoEditButtons.indexOf("videoSize"),1),-1<u.opts.videoEditButtons.indexOf("videoDisplay")&&u.opts.videoEditButtons.splice(u.opts.videoEditButtons.indexOf("videoDisplay"),1),-1<u.opts.videoEditButtons.indexOf("videoAlign")&&u.opts.videoEditButtons.splice(u.opts.videoEditButtons.indexOf("videoAlign"),1));var t={buttons:e+='<div class="fr-buttons"> \n '.concat(u.button.buildList(u.opts.videoEditButtons)," \n </div>")},a=u.popups.create("video.edit",t);return u.events.$on(u.$wp,"scroll.video-edit",function(){p&&u.popups.isVisible("video.edit")&&(u.events.disableBlur(),w(p))}),a}return!1}()),e){u.popups.setContainer("video.edit",u.$sc),u.popups.refresh("video.edit");var t=p.find("iframe, embed, video"),a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();u.popups.show("video.edit",a,n,t.outerHeight(),!0)}}function s(e){if(e)return u.popups.onRefresh("video.insert",b),u.popups.onHide("video.insert",X),!0;var t="";u.opts.videoUpload||-1===u.opts.videoInsertButtons.indexOf("videoUpload")||u.opts.videoInsertButtons.splice(u.opts.videoInsertButtons.indexOf("videoUpload"),1);var a=u.button.buildList(u.opts.videoInsertButtons);""!==a&&(t='<div class="fr-buttons">'+a+"</div>");var n,r="",i=u.opts.videoInsertButtons.indexOf("videoUpload"),s=u.opts.videoInsertButtons.indexOf("videoByURL"),o=u.opts.videoInsertButtons.indexOf("videoEmbed");0<=s&&(n=" fr-active",(i<s&&0<=i||o<s&&0<=o)&&(n=""),r='<div class="fr-video-by-url-layer fr-layer'+n+'" id="fr-video-by-url-layer-'+u.id+'"><div class="fr-input-line"><input id="fr-video-by-url-layer-text-'+u.id+'" type="text" placeholder="'+u.language.translate("Paste in a video URL")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertByURL" tabIndex="2" role="button">'+u.language.translate("Insert")+"</button></div></div>");var l="";0<=o&&(n=" fr-active",(i<o&&0<=i||s<o&&0<=s)&&(n=""),l='<div class="fr-video-embed-layer fr-layer'+n+'" id="fr-video-embed-layer-'+u.id+'"><div class="fr-input-line"><textarea id="fr-video-embed-layer-text'+u.id+'" type="text" placeholder="'+u.language.translate("Embedded Code")+'" tabIndex="1" aria-required="true" rows="5"></textarea></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertEmbed" tabIndex="2" role="button">'+u.language.translate("Insert")+"</button></div></div>");var c="";0<=i&&(n=" fr-active",(o<i&&0<=o||s<i&&0<=s)&&(n=""),c='<div class="fr-video-upload-layer fr-layer'+n+'" id="fr-video-upload-layer-'+u.id+'"><strong>'+u.language.translate("Drop video")+"</strong><br>("+u.language.translate("or click")+')<div class="fr-form"><input type="file" accept="video/'+u.opts.videoAllowedTypes.join(", video/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-video-upload-layer-'+u.id+'" role="button"></div></div>');var d={buttons:t,by_url_layer:r,embed_layer:l,upload_layer:c,progress_bar:'<div class="fr-video-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="videoDismissError" tabIndex="2" role="button">OK</button></div></div>'},f=u.popups.create("video.insert",d);return function p(n){u.events.$on(n,"dragover dragenter",".fr-video-upload-layer",function(){return h(this).addClass("fr-drop"),!1},!0),u.events.$on(n,"dragleave dragend",".fr-video-upload-layer",function(){return h(this).removeClass("fr-drop"),!1},!0),u.events.$on(n,"drop",".fr-video-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),h(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=n.data("instance")||u;a.events.disableBlur(),a.video.upload(t.files),a.events.enableBlur()}},!0),u.helpers.isIOS()&&u.events.$on(n,"touchstart",'.fr-video-upload-layer input[type="file"]',function(){h(this).trigger("click")},!0);u.events.$on(n,"change",'.fr-video-upload-layer input[type="file"]',function(){if(this.files){var e=n.data("instance")||u;e.events.disableBlur(),n.find("input:focus").blur(),e.events.enableBlur(),e.video.upload(this.files)}h(this).val("")},!0)}(f),f}function A(e){u.events.focus(!0),u.selection.restore();var t=!1;p&&(q(),t=!0),u.html.insert('<span contenteditable="false" draggable="true" class="fr-jiv fr-video fr-deletable">'+e+"</span>",!1,u.opts.videoSplitHTML),u.popups.hide("video.insert");var a=u.$el.find(".fr-jiv");a.removeClass("fr-jiv"),a.toggleClass("fr-rv",u.opts.videoResponsive),Q(a,u.opts.videoDefaultDisplay,u.opts.videoDefaultAlign),a.toggleClass("fr-draggable",u.opts.videoMove),u.events.trigger(t?"video.replaced":"video.inserted",[a])}function T(){var e=h(this);u.popups.hide("video.insert"),e.removeClass("fr-uploading"),e.parent().next().is("br")&&e.parent().next().remove(),w(e.parent()),u.events.trigger("video.loaded",[e.parent()])}function C(o,e,c,d,f){u.edit.off(),L("Loading video"),e&&(o=u.helpers.sanitizeURL(o));var p=function p(){var e,t;if(d){u.undo.canDo()||d.find("video").hasClass("fr-uploading")||u.undo.saveStep();var a=d.find("video").data("fr-old-src"),n=d.data("fr-replaced");d.data("fr-replaced",!1),u.$wp?((e=d.clone(!0)).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),a&&d.find("video").attr("src",a),d.replaceWith(e)):e=d;for(var r=e.find("video").get(0).attributes,i=0;i<r.length;i++){var s=r[i];0===s.nodeName.indexOf("data-")&&e.find("video").removeAttr(s.nodeName)}if(void 0!==c)for(t in c)c.hasOwnProperty(t)&&"link"!=t&&e.find("video").attr("data-"+t,c[t]);e.find("video").on("canplay",T),e.find("video").attr("src",o),u.edit.on(),B(),u.undo.saveStep(),u.$el.blur(),u.events.trigger(n?"video.replaced":"video.inserted",[e,f])}else e=function l(e,t,a){var n,r="";if(t&&void 0!==t)for(n in t)t.hasOwnProperty(n)&&"link"!=n&&(r+=" data-"+n+'="'+t[n]+'"');var i=u.opts.videoDefaultWidth;i&&"auto"!=i&&(i+="px");var s=h(document.createElement("span")).attr("contenteditable","false").attr("draggable","true").attr("class","fr-video fr-dv"+u.opts.videoDefaultDisplay[0]+("center"!=u.opts.videoDefaultAlign?" fr-fv"+u.opts.videoDefaultAlign[0]:"")).html('<video src="'+e+'" '+r+(i?' style="width: '+i+';" ':"")+" controls>"+u.language.translate("Your browser does not support HTML5 video.")+"</video>");s.toggleClass("fr-draggable",u.opts.videoMove),u.edit.on(),u.events.focus(!0),u.selection.restore(),u.undo.saveStep(),u.opts.videoSplitHTML?u.markers.split():u.markers.insert();u.html.wrap();var o=u.$el.find(".fr-marker");u.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent());o.replaceWith(s),u.selection.clear(),s.find("video").get(0).readyState>s.find("video").get(0).HAVE_FUTURE_DATA||u.helpers.isIOS()?a.call(s.find("video").get(0)):s.find("video").on("canplaythrough load",a);return s}(o,c,T),B(),u.undo.saveStep(),u.events.trigger("video.inserted",[e,f])};R("Loading video"),p()}function R(e){var t=u.popups.get("video.insert");if(t||(t=s()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),p){var a=p.find("video");u.popups.setContainer("video.insert",u.$sc);var n=a.offset().left,r=a.offset().top+a.height();u.popups.show("video.insert",n,r,a.outerHeight())}void 0===e&&L(u.language.translate("Uploading"),0)}function S(e){var t=u.popups.get("video.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||u.$el.find("video.fr-error").length)){if(u.events.focus(),u.$el.find("video.fr-error").length&&(u.$el.find("video.fr-error").parent().remove(),u.undo.saveStep(),u.undo.run(),u.undo.dropRedo()),!u.$wp&&p){var a=p;U(!0),u.selection.setAfter(a.find("video").get(0)),u.selection.restore()}u.popups.hide("video.insert")}}function L(e,t){var a=u.popups.get("video.insert");if(a){var n=a.find(".fr-video-progress-bar-layer");n.find("h3").text(e+(t?" "+t+"%":"")),n.removeClass("fr-error"),t?(n.find("div").removeClass("fr-indeterminate"),n.find("div > span").css("width",t+"%")):n.find("div").addClass("fr-indeterminate")}}function _(e){R();var t=u.popups.get("video.insert").find(".fr-video-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),u.events.disableBlur(),a.focus()}function w(e){t.call(e.get(0))}function y(e){L("Loading video");var t=this.status,a=this.response,n=this.responseXML,r=this.responseText;try{if(u.opts.videoUploadToS3)if(201==t){var i=function o(e){try{var t=h(e).find("Location").text(),a=h(e).find("Key").text();return!1===u.events.trigger("video.uploadedToS3",[t,a,e],!0)?(u.edit.on(),!1):t}catch(n){return G(v,e),!1}}(n);i&&C(i,!1,[],e,a||n)}else G(v,a||n);else if(200<=t&&t<300){var s=function l(e){try{if(!1===u.events.trigger("video.uploaded",[e],!0))return u.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(G(g,e),!1)}catch(a){return G(v,e),!1}}(r);s&&C(s.link,!1,s,e,a||r)}else G(m,a||r)}catch(c){G(v,a||r)}}function I(){G(v,this.response||this.responseText||this.responseXML)}function O(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;L(u.language.translate("Uploading"),t)}}function x(){u.edit.on(),S(!0)}function F(e){if(!u.core.sameInstance(f))return!0;e.preventDefault(),e.stopPropagation();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),a=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!a)return!1;if("mousedown"==e.type){var n=u.$oel.get(0).ownerDocument,r=n.defaultView||n.parentWindow,i=!1;try{i=r.location!=r.parent.location&&!(r.$&&r.$.FE)}catch(s){}i&&r.frameElement&&(t+=u.helpers.getPX(h(r.frameElement).offset().left)+r.frameElement.clientLeft,a=e.clientY+u.helpers.getPX(h(r.frameElement).offset().top)+r.frameElement.clientTop)}u.undo.canDo()||u.undo.saveStep(),(d=h(this)).data("start-x",t),d.data("start-y",a),o.show(),u.popups.hideAll(),K()}function k(e){if(!u.core.sameInstance(f))return!0;if(d){e.preventDefault();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),a=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!a)return!1;var n=d.data("start-x"),r=d.data("start-y");d.data("start-x",t),d.data("start-y",a);var i=t-n,s=a-r,o=p.find("iframe, embed, video"),l=o.width(),c=o.height();(d.hasClass("fr-hnw")||d.hasClass("fr-hsw"))&&(i=0-i),(d.hasClass("fr-hnw")||d.hasClass("fr-hne"))&&(s=0-s),o.css("width",l+i),o.css("height",c+s),o.removeAttr("width"),o.removeAttr("height"),P()}}function N(e){if(!u.core.sameInstance(f))return!0;d&&p&&(e&&e.stopPropagation(),d=null,o.hide(),P(),i(),u.undo.saveStep())}function D(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function M(e,t,a,n){return e.pageX=t,e.pageY=t,F.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,n)),e.pageY=e.pageY+a*Math.floor(Math.pow(1.1,n)),k.call(this,e),N.call(this,e),++n}function B(){var e,t=Array.prototype.slice.call(u.el.querySelectorAll("video, .fr-video > *")),a=[];for(e=0;e<t.length;e++)a.push(t[e].getAttribute("src")),h(t[e]).toggleClass("fr-draggable",u.opts.videoMove),""===t[e].getAttribute("class")&&t[e].removeAttribute("class"),""===t[e].getAttribute("style")&&t[e].removeAttribute("style");if(n)for(e=0;e<n.length;e++)a.indexOf(n[e].getAttribute("src"))<0&&u.events.trigger("video.removed",[h(n[e])]);n=t}function P(){f||function s(){var e;if(u.shared.$video_resizer?(f=u.shared.$video_resizer,o=u.shared.$vid_overlay,u.events.on("destroy",function(){h("body").first().append(f.removeClass("fr-active"))},!0)):(u.shared.$video_resizer=h(document.createElement("div")).attr("class","fr-video-resizer"),f=u.shared.$video_resizer,u.events.$on(f,"mousedown",function(e){e.stopPropagation()},!0),u.opts.videoResize&&(f.append(D("nw")+D("ne")+D("sw")+D("se")),u.shared.$vid_overlay=h(document.createElement("div")).attr("class","fr-video-overlay"),o=u.shared.$vid_overlay,e=f.get(0).ownerDocument,h(e).find("body").first().append(o))),u.events.on("shared.destroy",function(){f.html("").removeData().remove(),f=null,u.opts.videoResize&&(o.remove(),o=null)},!0),u.helpers.isMobile()||u.events.$on(h(u.o_win),"resize.video",function(){U(!0)}),u.opts.videoResize){e=f.get(0).ownerDocument,u.events.$on(f,u._mousedown,".fr-handler",F),u.events.$on(h(e),u._mousemove,k),u.events.$on(h(e.defaultView||e.parentWindow),u._mouseup,N),u.events.$on(o,"mouseleave",N);var n=1,r=null,i=0;u.events.on("keydown",function(e){if(p){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-i)&&(n=1),(a==Be.KEYCODE.EQUALS||u.browser.mozilla&&a==Be.KEYCODE.FF_EQUALS)&&t&&!e.altKey?n=M.call(this,e,1,1,n):(a==Be.KEYCODE.HYPHEN||u.browser.mozilla&&a==Be.KEYCODE.FF_HYPHEN)&&t&&!e.altKey&&(n=M.call(this,e,2,-1,n)),r=a,i=e.timeStamp}}),u.events.on("keyup",function(){n=1})}}(),(u.$wp||u.$sc).append(f),f.data("instance",u);var e=p.find("iframe, embed, video"),t=0,a=0;u.opts.iframe&&(a=u.helpers.getPX(u.$wp.find(".fr-iframe").css("padding-top")),t=u.helpers.getPX(u.$wp.find(".fr-iframe").css("padding-left"))),f.css("top",(u.opts.iframe?e.offset().top+a-1:e.offset().top-u.$wp.offset().top-1)+u.$wp.scrollTop()).css("left",(u.opts.iframe?e.offset().left+t-1:e.offset().left-u.$wp.offset().left-1)+u.$wp.scrollLeft()).css("width",e.get(0).getBoundingClientRect().width).css("height",e.get(0).getBoundingClientRect().height).addClass("fr-active")}function t(e){if(e&&"touchend"==e.type&&a)return!0;if(e&&u.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;if(u.edit.isDisabled())return!1;for(var t=0;t<Be.INSTANCES.length;t++)Be.INSTANCES[t]!=u&&Be.INSTANCES[t].events.trigger("video.hideResizer");u.toolbar.disable(),u.helpers.isMobile()&&(u.events.disableBlur(),u.$el.blur(),u.events.enableBlur()),u.$el.find(".fr-video.fr-active").removeClass("fr-active"),(p=h(this)).addClass("fr-active"),u.opts.iframe&&u.size.syncIframe(),Z(),P(),i(),u.selection.clear(),u.button.bulkRefresh(),u.events.trigger("image.hideResizer")}function U(e){p&&(function t(){return u.shared.vid_exit_flag}()||!0===e)&&(f.removeClass("fr-active"),u.toolbar.enable(),p.removeClass("fr-active"),p=null,K())}function W(){u.shared.vid_exit_flag=!0}function K(){u.shared.vid_exit_flag=!1}function H(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("video")){if(!u.opts.videoUpload)return e.preventDefault(),e.stopPropagation(),!1;u.markers.remove(),u.markers.insertAtPoint(e.originalEvent),u.$el.find(".fr-marker").replaceWith(Be.MARKERS),u.popups.hideAll();var n=u.popups.get("video.insert");return n||(n=s()),u.popups.setContainer("video.insert",u.$sc),u.popups.show("video.insert",e.originalEvent.pageX,e.originalEvent.pageY),R(),0<=u.opts.videoAllowedTypes.indexOf(a.type.replace(/video\//g,""))?$(t.files):G(E),e.preventDefault(),e.stopPropagation(),!1}}}function $(e){if(void 0!==e&&0<e.length){if(!1===u.events.trigger("video.beforeUpload",[e]))return!1;var t,a=e[0];if((null===u.opts.videoUploadURL||u.opts.videoUploadURL==l)&&!u.opts.videoUploadToS3)return function o(n){p&&p.find("iframe")&&p.find("iframe").length&&q();var r=new FileReader;r.onload=function(){r.result;for(var e=atob(r.result.split(",")[1]),t=[],a=0;a<e.length;a++)t.push(e.charCodeAt(a));C(window.URL.createObjectURL(new Blob([new Uint8Array(t)],{type:n.type})),!1,null,p)},R(),r.readAsDataURL(n)}(a),!1;if(a.size>u.opts.videoMaxSize)return G(c),!1;if(u.opts.videoAllowedTypes.indexOf(a.type.replace(/video\//g,""))<0)return G(E),!1;if(u.drag_support.formdata&&(t=u.drag_support.formdata?new FormData:null),t){var n;if(!1!==u.opts.videoUploadToS3)for(n in t.append("key",u.opts.videoUploadToS3.keyStart+(new Date).getTime()+"-"+(a.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",a.type),u.opts.videoUploadToS3.params)u.opts.videoUploadToS3.params.hasOwnProperty(n)&&t.append(n,u.opts.videoUploadToS3.params[n]);for(n in u.opts.videoUploadParams)u.opts.videoUploadParams.hasOwnProperty(n)&&t.append(n,u.opts.videoUploadParams[n]);t.append(u.opts.videoUploadParam,a);var r=u.opts.videoUploadURL;u.opts.videoUploadToS3&&(r=u.opts.videoUploadToS3.uploadURL?u.opts.videoUploadToS3.uploadURL:"https://"+u.opts.videoUploadToS3.region+".amazonaws.com/"+u.opts.videoUploadToS3.bucket);var i=u.core.getXHR(r,u.opts.videoUploadMethod);i.onload=function(){y.call(i,p)},i.onerror=I,i.upload.onprogress=O,i.onabort=x,R(),u.events.disableBlur(),u.edit.off(),u.events.enableBlur();var s=u.popups.get("video.insert");s&&h(s.off("abortUpload")).on("abortUpload",function(){4!=i.readyState&&i.abort()}),i.send(t)}}}function G(e,t){u.edit.on(),p&&p.find("video").addClass("fr-error"),_(u.language.translate("Something went wrong. Please try again.")),u.events.trigger("video.error",[{code:e,message:r[e]},t])}function Y(){if(p){var e=u.popups.get("video.size"),t=p.find("iframe, embed, video");e.find('input[name="width"]').val(t.get(0).style.width||t.attr("width")).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height||t.attr("height")).trigger("change")}}function V(e){if(e)return u.popups.onRefresh("video.size",Y),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+u.button.buildList(u.opts.videoSizeButtons)+"</div>",size_layer:'<div class="fr-video-size-layer fr-layer fr-active" id="fr-video-size-layer-'+u.id+'"><div class="fr-video-group"><div class="fr-input-line"><input id="fr-video-size-layer-width-'+u.id+'" type="text" name="width" placeholder="'+u.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-video-size-layer-height-'+u.id+'" type="text" name="height" placeholder="'+u.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoSetSize" tabIndex="2" role="button">'+u.language.translate("Update")+"</button></div></div>"},a=u.popups.create("video.size",t);return u.events.$on(u.$wp,"scroll",function(){p&&u.popups.isVisible("video.size")&&(u.events.disableBlur(),w(p))}),a}function z(e){if(void 0===e&&(e=p),e){if(e.hasClass("fr-fvl"))return"left";if(e.hasClass("fr-fvr"))return"right";if(e.hasClass("fr-dvb")||e.hasClass("fr-dvi"))return"center";if("block"==e.css("display")){if("left"==e.css("text-algin"))return"left";if("right"==e.css("text-align"))return"right"}else{if("left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function j(e){void 0===e&&(e=p);var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function q(){if(p&&!1!==u.events.trigger("video.beforeRemove",[p])){var e=p;u.popups.hideAll(),U(!0),u.selection.setBefore(e.get(0))||u.selection.setAfter(e.get(0)),e.remove(),u.selection.restore(),u.html.fillEmptyBlocks()}}function X(){S()}function Q(e,t,a){!u.opts.htmlUntouched&&u.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv"+a[0]+" fr-dv"+t[0])):"inline"==t?(e.css({display:"inline-block"}),"center"==a?e.css({"float":"none"}):"left"==a?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==a?e.css({textAlign:"left"}):"right"==a?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}function J(){var e=u.$el.find("video").filter(function(){return 0===h(this).parents("span.fr-video").length});if(0!=e.length){e.wrap(h(document.createElement("span")).attr("class","fr-video fr-deletable").attr("contenteditable","false")),u.$el.find("embed, iframe").filter(function(){if(u.browser.safari&&this.getAttribute("src")&&this.setAttribute("src",this.src),0<h(this).parents("span.fr-video").length)return!1;for(var e=h(this).attr("src"),t=0;t<Be.VIDEO_PROVIDERS.length;t++){var a=Be.VIDEO_PROVIDERS[t];if(a.test_regex.test(e)&&new RegExp(u.opts.videoAllowedProviders.join("|")).test(a.provider))return!0}return!1}).map(function(){return 0===h(this).parents("object").length?this:h(this).parents("object").get(0)}).wrap(h(document.createElement("span")).attr("class","fr-video").attr("contenteditable","false"));for(var t,a,n,r,i=u.$el.find("span.fr-video, video"),s=0;s<i.length;s++){var o=h(i[s]);!u.opts.htmlUntouched&&u.opts.useClasses?((r=o).hasClass("fr-dvi")||r.hasClass("fr-dvb")||(r.addClass("fr-fv"+z(r)[0]),r.addClass("fr-dv"+j(r)[0])),u.opts.videoTextNear||o.removeClass("fr-dvi").addClass("fr-dvb")):u.opts.htmlUntouched||u.opts.useClasses||(void 0,a=(t=o).hasClass("fr-dvb")?"block":t.hasClass("fr-dvi")?"inline":null,n=t.hasClass("fr-fvl")?"left":t.hasClass("fr-fvr")?"right":z(t),Q(t,a,n),t.removeClass("fr-dvb fr-dvi fr-fvr fr-fvl"))}i.toggleClass("fr-draggable",u.opts.videoMove)}}function Z(){if(p){u.selection.clear();var e=u.doc.createRange();e.selectNode(p.get(0)),u.selection.get().addRange(e)}}return r[1]="Video cannot be loaded from the passed link.",r[g]="No link in upload response.",r[m]="Error during file upload.",r[v]="Parsing response failed.",r[c]="File is too large.",r[E]="Video file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",u.shared.vid_exit_flag=!1,{_init:function ee(){u.opts.videoResponsive&&(u.opts.videoResize=!1),function e(){u.events.on("drop",H,!0),u.events.on("mousedown window.mousedown",W),u.events.on("window.touchmove",K),u.events.on("mouseup window.mouseup",U),u.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&U()}),u.events.on("video.hideResizer commands.undo commands.redo element.dropped",function(){U(!0)})}(),u.helpers.isMobile()&&(u.events.$on(u.$el,"touchstart","span.fr-video",function(){a=!1}),u.events.$on(u.$el,"touchmove",function(){a=!0})),u.events.on("html.set",J),J(),u.events.$on(u.$el,"mousedown","span.fr-video",function(e){e.stopPropagation(),(u.browser.msie||u.browser.edge)&&(e.target.dragDrop(),t.call(this,e))}),u.events.$on(u.$el,"click touchend","span.fr-video",function(e){if("false"==h(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t.call(this,e)}),u.events.on("keydown",function(e){var t=e.which;return!p||t!=Be.KEYCODE.BACKSPACE&&t!=Be.KEYCODE.DELETE?p&&t==Be.KEYCODE.ESC?(U(!0),e.preventDefault(),!1):p&&t!=Be.KEYCODE.F10&&!u.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),q(),u.undo.saveStep(),!1)},!0),u.events.on("toolbar.esc",function(){if(p)return u.events.disableBlur(),u.events.focus(),!1},!0),u.events.on("toolbar.focusEditor",function(){if(p)return!1},!0),u.events.on("keydown",function(){u.$el.find("span.fr-video:empty").remove()}),u.$wp&&(B(),u.events.on("contentChanged",B)),s(!0),V(!0)},showInsertPopup:function te(){var e=u.$tb.find('.fr-command[data-cmd="insertVideo"]'),t=u.popups.get("video.insert");if(t||(t=s()),S(),!t.hasClass("fr-active"))if(u.popups.refresh("video.insert"),u.popups.setContainer("video.insert",u.$tb),e.isVisible()){var a=u.button.getPosition(e),n=a.left,r=a.top;u.popups.show("video.insert",n,r,e.outerHeight())}else u.position.forSelection(t),u.popups.show("video.insert")},showLayer:function ae(e){var t,a,n=u.popups.get("video.insert");if(!p&&!u.opts.toolbarInline){var r=u.$tb.find('.fr-command[data-cmd="insertVideo"]');t=r.offset().left,a=r.offset().top+(u.opts.toolbarBottom?10:r.outerHeight()-10)}u.opts.toolbarInline&&(a=n.offset().top-u.helpers.getPX(n.css("margin-top")),n.hasClass("fr-above")&&(a+=n.outerHeight())),n.find(".fr-layer").removeClass("fr-active"),n.find(".fr-"+e+"-layer").addClass("fr-active"),u.popups.show("video.insert",t,a,0),u.accessibility.focusPopup(n)},refreshByURLButton:function ne(e){var t=u.popups.get("video.insert");t&&t.find(".fr-video-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshEmbedButton:function re(e){var t=u.popups.get("video.insert");t&&t.find(".fr-video-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshUploadButton:function ie(e){var t=u.popups.get("video.insert");t&&t.find(".fr-video-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:$,insertByURL:function se(e){void 0===e&&(e=(u.popups.get("video.insert").find('.fr-video-by-url-layer input[type="text"]').val()||"").trim());var t=null;if(/^http/.test(e)||(e="https://"+e),u.helpers.isURL(e))for(var a=0;a<Be.VIDEO_PROVIDERS.length;a++){var n=Be.VIDEO_PROVIDERS[a];if(n.test_regex.test(e)&&new RegExp(u.opts.videoAllowedProviders.join("|")).test(n.provider)){t=e.replace(n.url_regex,n.url_text),t=n.html.replace(/\{url\}/,t);break}}t?A(t):(_(u.language.translate("Something went wrong. Please try again.")),u.events.trigger("video.linkError",[e]))},insertEmbed:function oe(e){void 0===e&&(e=u.popups.get("video.insert").find(".fr-video-embed-layer textarea").val()||""),0!==e.length&&Be.VIDEO_EMBED_REGEX.test(e)?A(e):(_(u.language.translate("Something went wrong. Please try again.")),u.events.trigger("video.codeError",[e]))},insert:A,align:function le(e){p.removeClass("fr-fvr fr-fvl"),!u.opts.htmlUntouched&&u.opts.useClasses?"left"==e?p.addClass("fr-fvl"):"right"==e&&p.addClass("fr-fvr"):Q(p,j(),e),Z(),P(),i(),u.selection.clear()},refreshAlign:function ce(e){if(!p)return!1;e.find(">*").first().replaceWith(u.icon.create("video-align-"+z()))},refreshAlignOnShow:function de(e,t){p&&t.find('.fr-command[data-param1="'+z()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function fe(e){p.removeClass("fr-dvi fr-dvb"),!u.opts.htmlUntouched&&u.opts.useClasses?"inline"==e?p.addClass("fr-dvi"):"block"==e&&p.addClass("fr-dvb"):Q(p,e,z()),Z(),P(),i(),u.selection.clear()},refreshDisplayOnShow:function pe(e,t){p&&t.find('.fr-command[data-param1="'+j()+'"]').addClass("fr-active").attr("aria-selected",!0)},remove:q,hideProgressBar:S,showSizePopup:function ue(){var e=u.popups.get("video.size");e||(e=V()),S(),u.popups.refresh("video.size"),u.popups.setContainer("video.size",u.$sc);var t=p.find("iframe, embed, video"),a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.height();u.popups.show("video.size",a,n,t.height(),!0)},replace:function he(){var e=u.popups.get("video.insert");e||(e=s()),u.popups.isVisible("video.insert")||(S(),u.popups.refresh("video.insert"),u.popups.setContainer("video.insert",u.$sc));var t=p.offset().left+p.outerWidth()/2,a=p.offset().top+p.height();u.popups.show("video.insert",t,a,p.outerHeight(),!0)},back:function e(){p?(u.events.disableBlur(),p[0].click()):(u.events.disableBlur(),u.selection.restore(),u.events.enableBlur(),u.popups.hide("video.insert"),u.toolbar.showInline())},setSize:function ge(e,t){if(p){var a=u.popups.get("video.size"),n=p.find("iframe, embed, video");n.css("width",e||a.find('input[name="width"]').val()),n.css("height",t||a.find('input[name="height"]').val()),n.get(0).style.width&&n.removeAttr("width"),n.get(0).style.height&&n.removeAttr("height"),a.find("input:focus").blur(),setTimeout(function(){p.trigger("click")},u.helpers.isAndroid()?50:0)}},get:function me(){return p},showProgressBar:R}},Be.RegisterCommand("insertVideo",{title:"Insert Video",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("video.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("video.insert")):this.video.showInsertPopup()},plugin:"video"}),Be.DefineIcon("insertVideo",{NAME:"video-camera",FA5NAME:"camera",SVG_KEY:"insertVideo"}),Be.DefineIcon("videoByURL",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterCommand("videoByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-by-url")},refresh:function(e){this.video.refreshByURLButton(e)}}),Be.DefineIcon("videoEmbed",{NAME:"code",SVG_KEY:"codeView"}),Be.RegisterCommand("videoEmbed",{title:"Embedded Code",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-embed")},refresh:function(e){this.video.refreshEmbedButton(e)}}),Be.DefineIcon("videoUpload",{NAME:"upload",SVG_KEY:"upload"}),Be.RegisterCommand("videoUpload",{title:"Upload Video",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-upload")},refresh:function(e){this.video.refreshUploadButton(e)}}),Be.RegisterCommand("videoInsertByURL",{undo:!0,focus:!0,callback:function(){this.video.insertByURL()}}),Be.RegisterCommand("videoInsertEmbed",{undo:!0,focus:!0,callback:function(){this.video.insertEmbed()}}),Be.DefineIcon("videoDisplay",{NAME:"star",SVG_KEY:"star"}),Be.RegisterCommand("videoDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.video.display(t)},refresh:function(e){this.opts.videoTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.video.refreshDisplayOnShow(e,t)}}),Be.DefineIcon("video-align",{NAME:"align-left",SVG_KEY:"align Left"}),Be.DefineIcon("video-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("video-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("video-align-center",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.DefineIcon("videoAlign",{NAME:"align-center",SVG_KEY:"alignCenter"}),Be.RegisterCommand("videoAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Be.COMMANDS.videoAlign.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="videoAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("video-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.video.align(t)},refresh:function(e){this.video.refreshAlign(e)},refreshOnShow:function(e,t){this.video.refreshAlignOnShow(e,t)}}),Be.DefineIcon("videoReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),Be.RegisterCommand("videoReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.video.replace()}}),Be.DefineIcon("videoRemove",{NAME:"trash",SVG_KEY:"remove"}),Be.RegisterCommand("videoRemove",{title:"Remove",callback:function(){this.video.remove()}}),Be.DefineIcon("videoSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),Be.RegisterCommand("videoSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.video.showSizePopup()}}),Be.DefineIcon("videoBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("videoBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.video.back()},refresh:function(e){this.video.get()||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"))}}),Be.RegisterCommand("videoDismissError",{title:"OK",undo:!1,callback:function(){this.video.hideProgressBar(!0)}}),Be.RegisterCommand("videoSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.video.setSize()}}),Object.assign(Be.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent","border","border-.*","line-height","list-style-type"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),Be.PLUGINS.wordPaste=function(T){var s,r,u=T.$,o="word_paste",h={};function t(e){var t=T.opts.wordAllowedStyleProps;e||(T.opts.wordAllowedStyleProps=[]),0===r.indexOf("<colgroup>")&&(r="<table>"+r+"</table>"),r=function p(e,t){0<=e.indexOf("<html")&&(e=e.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));!function d(e){for(var t=e.split("v:shape"),a=1;a<t.length;a++){var n=t[a],r=n.split(' id="')[1];if(r&&1<r.length){r=r.split('"')[0];var i=n.split(' o:spid="')[1];i&&1<i.length&&(i=i.split('"')[0],h[r]=i)}}}(e);var a=(new DOMParser).parseFromString(e,"text/html"),n=a.head,r=a.body,s=function f(e){var t={},a=e.getElementsByTagName("style");if(a.length){var n=a[0],r=n.innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(r)for(var i=0;i<r.length;i++){var s=r[i],o=s.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),l=s.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");o=o.replace(/^[\s]|[\s]$/gm,""),l=l.replace(/^[\s]|[\s]$/gm,""),o=o.replace(/\n|\r|\n\r/g,""),l=l.replace(/\n|\r|\n\r/g,"");for(var c=o.split(", "),d=0;d<c.length;d++)t[c[d]]=l}}return t}(n);g(r,function(e){if(e.nodeType===Node.TEXT_NODE&&/\n|\u00a0|\r/.test(e.data)){if(!/\S| /.test(e.data)&&!/[\u00a0]+/.test(e.data))return e.data===Be.UNICODE_NBSP?(e.data="\u200b",!0):1===e.data.length&&10===e.data.charCodeAt(0)?(e.data=" ",!0):(C(e),!1);e.data=e.data.replace(/\n|\r/gi," ")}return!0}),g(r,function(e){return e.nodeType!==Node.ELEMENT_NODE||"V:IMAGEDATA"!==e.tagName&&"IMG"!==e.tagName||function c(e,t){if(!t)return;var a;if("IMG"===e.tagName){var n=e.getAttribute("src");if(!n||-1===n.indexOf("file://"))return;if(0===n.indexOf("file://")&&T.helpers.isURL(e.getAttribute("alt")))return void e.setAttribute("src",e.getAttribute("alt"));(a=h[e.getAttribute("v:shapes")])||(a=e.getAttribute("v:shapes"),e.parentNode&&e.parentNode.parentNode&&0<=e.parentNode.parentNode.innerHTML.indexOf("msEquation")&&(a=null))}else a=e.parentNode.getAttribute("o:spid");if(e.removeAttribute("height"),!a)return;!function o(e){m={},v(e,"i","\\shppict"),v(e,"s","\\shp{")}(t);var r=m[a.substring(7)];if(r){var i=function l(e){for(var t=e.match(/[0-9a-f]{2}/gi),a=[],n=0;n<t.length;n++)a.push(String.fromCharCode(parseInt(t[n],16)));var r=a.join("");return btoa(r)}(r.image_hex),s="data:"+r.image_type+";base64,"+i;"IMG"===e.tagName?(e.src=s,e.setAttribute("data-fr-image-pasted",!0)):u(e.parentNode).before('<img data-fr-image-pasted="true" src="'+s+'" style="'+e.parentNode.getAttribute("style")+'">').remove()}}(e,t),!0});for(var i=r.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),o=i.length-1;0<=o;o--)i[o].previousElementSibling&&"LI"===i[o].previousElementSibling.tagName&&i[o].previousElementSibling.appendChild(i[o]);g(r,function(e){if(e.nodeType===Node.TEXT_NODE)return e.data=e.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(e.nodeType===Node.ELEMENT_NODE){if(R(e)){var t=e.parentNode,a=e.previousSibling,n=function b(e,t,a){var n=/[0-9a-zA-Z]./gi;var r=!1;var i;var s;var o;var l=e.querySelector('span[style="mso-list:Ignore"]');var c;var d;var f;var p;l&&(r=r||n.test(l.textContent));if(1==r){var u=l.textContent.trim().split(".")[0];"a"==u?p="lower-alpha;":"A"==u?p="upper-alpha;":"1"==u?p="decimal;":"i"==u?p="lower-roman;":"I"==u?p="upper-roman;":"o"==u&&(p="circle;"),p="list-style-type: "+p,f="ol"}else f="ul";var h=p?"<"+f+' style = "'+p+'">':"<"+f+">";for(;e;){if(!R(e)){if(e.outerHTML&&0<e.outerHTML.indexOf("mso-bookmark")&&0==(e.textContent||"").length){e=e.nextElementSibling;continue}break}var g=e.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1");if((a=a||g)<g)d=b(e,t,g),h+=d.el.outerHTML,e=d.currentNode;else{if(g<a)break;e.firstElementChild&&e.firstElementChild.firstElementChild&&e.firstElementChild.firstElementChild.firstChild&&(n.lastIndex=0,i=n.test(e.firstElementChild.firstElementChild.firstChild.data||e.firstElementChild.firstElementChild.firstChild.firstChild&&e.firstElementChild.firstElementChild.firstChild.firstChild.data||"")),o&&o.firstElementChild&&o.firstElementChild.firstElementChild&&o.firstElementChild.firstElementChild.firstChild&&(n.lastIndex=0,s=n.test(o.firstElementChild.firstElementChild.firstChild.data||o.firstElementChild.firstElementChild.firstChild.firstChild&&o.firstElementChild.firstElementChild.firstChild.firstChild.data||"")),s===undefined||s===i?(c=A(e,t),h+="<li>"+c+"</li>"):(d=b(e,t,g),h+=d.el.outerHTML,e=d.currentNode);var m=e&&e.nextElementSibling;m&&(o=m.previousElementSibling),e&&e.parentNode&&e.parentNode.removeChild(e),e=m}}h+="</"+f+">";var v=document.createElement("div");v.innerHTML=h;var E=v.firstElementChild;return{el:E,currentNode:e}}(e,s).el,r=null;return(r=a?a.nextSibling:t.firstChild)?t.insertBefore(n,r):t.appendChild(n),!1}return"FONT"===e.tagName&&s["."+e.getAttribute("class")]&&(e=S(e,"span")),E(e,s)}if(e.nodeType!==Node.COMMENT_NODE)return!0;if(-1<e.data.indexOf("[if !supportLineBreakNewLine]"))for(var i=e.nextSibling;i;)(i=e.nextSibling)&&C(i),i.data&&-1<i.data.indexOf("[endif]")&&(i=null);return C(e),!1}),g(r,function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e.tagName;if(!e.innerHTML&&-1===["BR","IMG"].indexOf(t)){for(var a=e.parentNode;a&&(C(e),!(e=a).innerHTML);)a=e.parentNode;return!1}!function f(e){var t=e.getAttribute("style");if(!t)return;(t=_(t))&&";"!==t.slice(-1)&&(t+=";");var a=t.match(/(^|\S+?):.+?;{1,1}/gi);if(!a)return;for(var n={},r=0;r<a.length;r++){var i=a[r],s=i.split(":");2===s.length&&("text-align"===s[0]&&"SPAN"===e.tagName||(n[s[0]]=s[1]))}var o="";for(var l in n)if(n.hasOwnProperty(l)){if("font-size"===l&&"pt;"===n[l].slice(-3)){var c=null;try{c=parseFloat(n[l].slice(0,-3),10)}catch(d){c=null}c&&(c=Math.round(1.33*c),n[l]=c+"px;")}o+=l+":"+n[l]}o&&e.setAttribute("style",o)}(e)}return!0}),g(r,function(e){if(e&&"A"===e.nodeName&&""===e.href){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}return!0});var l=r.outerHTML,c=T.opts.htmlAllowedStyleProps;return T.opts.htmlAllowedStyleProps=T.opts.wordAllowedStyleProps,l=T.clean.html(l,T.opts.wordDeniedTags,T.opts.wordDeniedAttrs,!1),T.opts.htmlAllowedStyleProps=c,l}(r=r.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var a="",n=0;n++<t.length;)a+="&nbsp;";return a}),T.paste.getRtfClipboard());var a=T.doc.createElement("DIV");a.innerHTML=r,T.html.cleanBlankSpaces(a),r=a.innerHTML,r=(r=T.paste.cleanEmptyTagsAndDivs(r)).replace(/\u200b/g,""),function n(){T.modals.hide(o)}(),T.paste.clean(r,!0,!0),T.opts.wordAllowedStyleProps=t}function C(e){e.parentNode&&e.parentNode.removeChild(e)}function g(e,t){if(t(e))for(var a=e.firstChild;a;){var n=a,r=a.previousSibling;a=a.nextSibling,g(n,t),n.previousSibling||n.nextSibling||n.parentNode||!a||r===a.previousSibling||!a.parentNode?n.previousSibling||n.nextSibling||n.parentNode||!a||a.previousSibling||a.nextSibling||a.parentNode||(r?a=r.nextSibling?r.nextSibling.nextSibling:null:e.firstChild&&(a=e.firstChild.nextSibling)):a=r?r.nextSibling:e.firstChild}}function R(e){if(!e.getAttribute("style")||!/mso-list:[\s]*l/gi.test(e.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!e.querySelector('[style="mso-list:Ignore"]'))return!!(e.outerHTML&&0<=e.outerHTML.indexOf("\x3c!--[if !supportLists]--\x3e"))}catch(t){return!1}return!0}function A(e,n){var t=e.cloneNode(!0);if(-1!==["H1","H2","H3","H4","H5","H6"].indexOf(e.tagName)){var a=document.createElement(e.tagName.toLowerCase());a.setAttribute("style",e.getAttribute("style")),a.innerHTML=t.innerHTML,t.innerHTML=a.outerHTML}g(t,function(e){if(e.nodeType==Node.COMMENT_NODE&&(T.browser.msie||T.browser.safari||T.browser.edge))try{if("[if !supportLists]"===e.data){for(e=e.nextSibling;e&&e.nodeType!==Node.COMMENT_NODE;){var t=e.nextSibling;e.parentNode.removeChild(e),e=t}e&&e.nodeType==Node.COMMENT_NODE&&e.parentNode.removeChild(e)}}catch(a){}return e.nodeType===Node.ELEMENT_NODE&&("mso-list:Ignore"===e.getAttribute("style")&&e.parentNode.removeChild(e),e.setAttribute("style",function r(e){var a="",n=e.getAttribute("style");n&&["line-height","font-family","font-size","color","background"].forEach(function(e){var t=n.match(new RegExp(e+":.*;"));t&&(a+=t[0]+";")});return a}(e)),E(e,n)),!0});var r=t.innerHTML;return r=r.replace(/<!--[\s\S]*?-->/gi,"")}function S(e,t){for(var a=document.createElement(t),n=0;n<e.attributes.length;n++){var r=e.attributes[n].name;a.setAttribute(r,e.getAttribute(r))}return a.innerHTML=e.innerHTML,e.parentNode.replaceChild(a,e),a}function L(e){var t=e.getAttribute("align");t&&(e.style["text-align"]=t,e.removeAttribute("align"))}function _(e){return e.replace(/\n|\r|\n\r|&quot;/g,"")}function w(e,t,a){if(t){var n=e.getAttribute("style");n&&";"!==n.slice(-1)&&(n+=";"),t&&";"!==t.slice(-1)&&(t+=";"),t=t.replace(/\n/gi,"");var r=null;r=a?(n||"")+t:t+(n||""),e.setAttribute("style",r)}}var m=null;function v(e,t,a){for(var n=e.split(a),r=1;r<n.length;r++){var i=n[r];if(1<(i=i.split("shplid")).length){i=i[1];for(var s="",o=0;o<i.length&&"\\"!==i[o]&&"{"!==i[o]&&" "!==i[o]&&"\r"!==i[o]&&"\n"!==i[o];)s+=i[o],o++;var l=i.split("bliptag");if(l&&l.length<2)continue;var c=null;if(-1!==l[0].indexOf("pngblip")?c="image/png":-1!==l[0].indexOf("jpegblip")&&(c="image/jpeg"),!c)continue;var d=l[1].split("}");if(d&&d.length<2)continue;var f=void 0;if(2<d.length&&-1!==d[0].indexOf("blipuid"))f=d[1].split(" ");else{if((f=d[0].split(" "))&&f.length<2)continue;f.shift()}var p=f.join("");m[t+s]={image_hex:p,image_type:c}}}}function E(e,t){var a=e.tagName,n=a.toLowerCase();e.firstElementChild&&("I"===e.firstElementChild.tagName?S(e.firstElementChild,"em"):"B"===e.firstElementChild.tagName&&S(e.firstElementChild,"strong"));if(-1!==["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(a))return C(e),!1;for(var r=["META","LINK","XML","ST1:","O:","W:","FONT"],i=0;i<r.length;i++)if(-1!==a.indexOf(r[i]))return e.innerHTML&&(e.outerHTML=e.innerHTML),C(e),!1;if("TD"!==a){var s=e.getAttribute("class")||"MsoNormal";if(t&&s){for(var o=(s=_(s)).split(" "),l=0;l<o.length;l++){var c=[],d="."+o[l];c.push(d),d=n+d,c.push(d);for(var f=0;f<c.length;f++)t[c[f]]&&w(e,t[c[f]])}e.removeAttribute("class")}t&&t[n]&&w(e,t[n])}if(-1!==["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(a)){var p=e.getAttribute("class");if(p&&(t&&t[a.toLowerCase()+"."+p]&&w(e,t[a.toLowerCase()+"."+p]),-1!==p.toLowerCase().indexOf("mso"))){var u=_(p);(u=u.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?e.setAttribute("class",u):e.removeAttribute("class")}var h=e.getAttribute("style");if(h){var g=h.match(/text-align:.+?[; "]{1,1}/gi);g&&g[g.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}L(e)}if("TR"===a&&function A(e,t){T.node.clearAttributes(e);for(var a=e.firstElementChild,n=0,r=!1,i=null;a;){a.firstElementChild&&-1!==a.firstElementChild.tagName.indexOf("W:")&&(a.innerHTML=a.firstElementChild.innerHTML),(i=a.getAttribute("width"))||r||(r=!0),n+=parseInt(i,10),(!a.firstChild||a.firstChild&&a.firstChild.data===Be.UNICODE_NBSP)&&(a.firstChild&&C(a.firstChild),a.innerHTML="<br>");for(var s=a.firstElementChild,o=1===a.children.length;s;)"P"!==s.tagName||R(s)||o&&L(s),s=s.nextElementSibling;if(t){var l=a.getAttribute("class");if(l){var c=(l=_(l)).match(/xl[0-9]+/gi);if(c){var d="."+c[0];t[d]&&w(a,t[d])}}t.td&&w(a,t.td)}var f=a.getAttribute("style");f&&(f=_(f))&&";"!==f.slice(-1)&&(f+=";");var p=a.getAttribute("valign");if(!p&&f){var u=f.match(/vertical-align:.+?[; "]{1,1}/gi);u&&(p=u[u.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var h=null;if(f){var g=f.match(/text-align:.+?[; "]{1,1}/gi);g&&(h=g[g.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===h&&(h=null)}var m=null;if(f){var v=f.match(/background:.+?[; "]{1,1}/gi);v&&(m=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var E=a.getAttribute("colspan"),b=a.getAttribute("rowspan");E&&a.setAttribute("colspan",E),b&&a.setAttribute("rowspan",b),p&&(a.style["vertical-align"]=p),h&&(a.style["text-align"]=h),m&&(a.style["background-color"]=m),i&&a.setAttribute("width",i),a=a.nextElementSibling}for(a=e.firstElementChild;a;)i=a.getAttribute("width"),r?a.removeAttribute("width"):a.setAttribute("width",100*parseInt(i,10)/n+"%"),a=a.nextElementSibling}(e,t),"A"!==a||e.attributes.getNamedItem("href")||e.attributes.getNamedItem("name")||!e.innerHTML||(e.outerHTML=e.innerHTML),"A"==a&&e.getAttribute("href")&&e.querySelector("img"))for(var m=e.querySelectorAll("span"),v=0;v<m.length;v++)m[v].innerText||(m[v].outerHTML=m[v].innerHTML);if("TD"!==a&&"TH"!==a||e.innerHTML||(e.innerHTML="<br>"),"TABLE"===a&&(e.style.width=e.style.width),e.getAttribute("lang")&&e.removeAttribute("lang"),e.getAttribute("style")&&-1!==e.getAttribute("style").toLowerCase().indexOf("mso")){var E=_(e.getAttribute("style"));(E=E.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",E):e.removeAttribute("style")}return!0}return{_init:function e(){T.events.on("paste.wordPaste",function(e){return r=e,T.opts.wordPasteModal?function i(){if(!s){var e='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+T.language.translate("Word Paste Detected")+"</h4>",t=function r(){var e='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">';return e+='<p style="text-align: left;">'+T.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",e+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+T.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+T.language.translate("Keep")+"</button></div>",e+="</div>"}(),a=T.modals.create(o,e,t),n=a.$body;s=a.$modal,a.$modal.addClass("fr-middle"),T.events.bindClick(n,"button.fr-remove-word",function(){var e=s.data("instance")||T;e.wordPaste.clean()}),T.events.bindClick(n,"button.fr-keep-word",function(){var e=s.data("instance")||T;e.wordPaste.clean(!0)}),T.events.$on(u(T.o_win),"resize",function(){T.modals.resize(o)})}T.modals.show(o),T.modals.resize(o)}():t(T.opts.wordPasteKeepFormatting),!1})},clean:t}}});
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(Be){"use strict";function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if((Be=Be&&Be.hasOwnProperty("default")?Be["default"]:Be).PLUGINS.align=function(r){var i=r.$;return{apply:function s(e){var t=r.selection.element();if(i(t).parents(".fr-img-caption").length)i(t).css("text-align",e);else{r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();for(var a=r.selection.blocks(),n=0;n<a.length;n++)i(a[n]).css("text-align",e).removeClass("fr-temp-div"),""===i(a[n]).attr("class")&&i(a[n]).removeAttr("class"),""===i(a[n]).attr("style")&&i(a[n]).removeAttr("style");r.selection.save(),r.html.unwrap(),r.selection.restore()}},refresh:function n(e){var t=r.selection.blocks();if(t.length){var a=r.helpers.getAlignment(i(t[0]));e.find("> *").first().replaceWith(r.icon.create("align-"+a))}},refreshOnShow:function o(e,t){var a=r.selection.blocks();if(a.length){var n=r.helpers.getAlignment(i(a[0]));t.find('a.fr-command[data-param1="'+n+'"]').addClass("fr-active").attr("aria-selected",!0)}},refreshForToolbar:function l(e){var t=r.selection.blocks();if(t.length){var a=r.helpers.getAlignment(i(t[0]));"align"+(a=a.charAt(0).toUpperCase()+a.slice(1))===e.attr("data-cmd")&&e.addClass("fr-active")}}}},Be.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),Be.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.RegisterCommand("align",{type:"dropdown",title:"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=Be.COMMANDS.align.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="align" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,t){this.align.refreshOnShow(e,t)},plugin:"align"}),Be.RegisterCommand("alignLeft",{type:"button",icon:"align-left",title:"Align Left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Be.RegisterCommand("alignRight",{type:"button",icon:"align-right",title:"Align Right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Be.RegisterCommand("alignCenter",{type:"button",icon:"align-center",title:"Align Center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Be.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",title:"Align Justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Object.assign(Be.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),Be.PLUGINS.charCounter=function(a){var n,t=a.$;function r(){return(a.el.textContent||"").replace(/\u200B/g,"").length}function e(e){if(a.opts.charCounterMax<0)return!0;if(r()<a.opts.charCounterMax)return!0;var t=e.which;return!(!a.keys.ctrlKey(e)&&a.keys.isCharacter(t)||t===Be.KEYCODE.IME)||(e.preventDefault(),e.stopPropagation(),a.events.trigger("charCounter.exceeded"),!1)}function i(e){return a.opts.charCounterMax<0?e:t("<div>").html(e).text().length+r()<=a.opts.charCounterMax?e:(a.events.trigger("charCounter.exceeded"),"")}function s(){if(a.opts.charCounterCount){var e=r()+(0<a.opts.charCounterMax?"/"+a.opts.charCounterMax:"");n.text("".concat(a.language.translate("Characters")," : ").concat(e)),a.opts.toolbarBottom&&n.css("margin-bottom",a.$tb.outerHeight(!0));var t=a.$wp.get(0).offsetWidth-a.$wp.get(0).clientWidth;0<=t&&("rtl"==a.opts.direction?n.css("margin-left",t):n.css("margin-right",t))}}return{_init:function o(){return!!a.$wp&&!!a.opts.charCounterCount&&((n=t(document.createElement("span")).attr("class","fr-counter")).css("bottom",a.$wp.css("border-bottom-width")),a.$second_tb&&a.$second_tb.append(n),a.events.on("keydown",e,!0),a.events.on("paste.afterCleanup",i),a.events.on("keyup contentChanged input",function(){a.events.trigger("charCounter.update")}),a.events.on("charCounter.update",s),a.events.trigger("charCounter.update"),void a.events.on("destroy",function(){t(a.o_win).off("resize.char"+a.id),n.removeData().remove(),n=null}))},count:r}},Be.PLUGINS.codeBeautifier=function(){var e,t,a,n,j={};function I(n,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},a={"@media":!0,"@supports":!0,"@document":!0};e=e||{},n=(n=n||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,i=e.indent_char||" ",s=e.selector_separator_newline===undefined||e.selector_separator_newline,o=e.end_with_newline!==undefined&&e.end_with_newline,l=e.newline_between_rules===undefined||e.newline_between_rules,c=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(i="\t",r=1),c=c.replace(/\\r/,"\r").replace(/\\n/,"\n");var d,f=/^\s+$/,p=-1,u=0;function h(){return(d=n.charAt(++p))||""}function g(e){var t,a=p;return e&&v(),t=n.charAt(p+1)||"",p=a-1,h(),t}function m(e){for(var t=p;h();)if("\\"===d)h();else{if(-1!==e.indexOf(d))break;if("\n"===d)break}return n.substring(t,p+1)}function v(){for(var e="";f.test(g());)h(),e+=d;return e}function E(){var e="";for(d&&f.test(d)&&(e=d);f.test(h());)e+=d;return e}function b(e){var t=p;for(e="/"===g(),h();h();){if(!e&&"*"===d&&"/"===g()){h();break}if(e&&"\n"===d)return n.substring(t,p)}return n.substring(t,p)+d}function A(e){return n.substring(p-e.length,p).toLowerCase()===e}function T(){for(var e=0,t=p+1;t<n.length;t++){var a=n.charAt(t);if("{"===a)return!0;if("("===a)e+=1;else if(")"===a){if(0===e)return!1;e-=1}else if(" "===a||"}"===a)return!1}return!1}var C=n.match(/^[\t ]*/)[0],R=new Array(r+1).join(i),S=0,L=0;for(var _,w,y,I={"{":function(e){I.singleSpace(),O.push(e),I.newLine()},"}":function(e){I.newLine(),O.push(e),I.newLine()},_lastCharWhitespace:function(){return f.test(O[O.length-1])},newLine:function(e){O.length&&(e||"\n"===O[O.length-1]||I.trim(),O.push("\n"),C&&O.push(C))},singleSpace:function(){O.length&&!I._lastCharWhitespace()&&O.push(" ")},preserveSingleSpace:function(){_&&I.singleSpace()},trim:function(){for(;I._lastCharWhitespace();)O.pop()}},O=[],x=!1,F=!1,k=!1,N="",D="";;){var M=E();_=""!==M;var B=-1!==M.indexOf("\n");if(D=N,!(N=d))break;if("/"===d&&"*"===g()){var P=0===S;(B||P)&&I.newLine(),O.push(b()),I.newLine(),P&&I.newLine(!0)}else if("/"===d&&"/"===g())B||"{"===D||I.trim(),I.singleSpace(),O.push(b()),I.newLine();else if("@"===d){I.preserveSingleSpace(),O.push(d);var U=(void 0,w=p,y=m(": , {}()[]/='\""),p=w-1,h(),y);U.match(/[ :]$/)&&(h(),U=m(": ").replace(/\s$/,""),O.push(U),I.singleSpace()),(U=U.replace(/\s$/,""))in t&&(L+=1,U in a&&(k=!0))}else"#"===d&&"{"===g()?(I.preserveSingleSpace(),O.push(m("}"))):"{"===d?"}"===g(!0)?(v(),h(),I.singleSpace(),O.push("{}"),I.newLine(),l&&0===S&&I.newLine(!0)):(S++,C+=R,I["{"](d),x=k?(k=!1,L<S):L<=S):"}"===d?(S--,C=C.slice(0,-r),I["}"](d),F=x=!1,L&&L--,l&&0===S&&I.newLine(!0)):":"===d?(v(),!x&&!k||A("&")||T()?":"===g()?(h(),O.push("::")):O.push(":"):(F=!0,O.push(":"),I.singleSpace())):'"'===d||"'"===d?(I.preserveSingleSpace(),O.push(m(d))):" "===d?(F=!1,O.push(d),I.newLine()):"("===d?A("url")?(O.push(d),v(),h()&&(")"!==d&&'"'!==d&&"'"!==d?O.push(m(")")):p--)):(u++,I.preserveSingleSpace(),O.push(d),v()):")"===d?(O.push(d),u--):","===d?(O.push(d),v(),s&&!F&&u<1?I.newLine():I.singleSpace()):("]"===d||("["===d?I.preserveSingleSpace():"="===d?(v(),d="="):I.preserveSingleSpace()),O.push(d))}var W="";return C&&(W+=C),W+=O.join("").replace(/[\r\n\t ]+$/,""),o&&(W+="\n"),"\n"!=c&&(W=W.replace(/[\n]/g,c)),W}function q(e,t){for(var a=0;a<t.length;a+=1)if(t[a]===e)return!0;return!1}function X(e){return e.replace(/^\s+|\s+$/g,"")}function O(e,t){return new r(e,t).beautify()}e=j,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",a=new RegExp("["+t+"]"),n=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&a.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e))))};var Q={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(n,e){var c,r,i,d,s,o,l,f,p,t,a,u,h,g=[],m="";function v(e,t){var a=0;return e&&(a=e.indentation_level,!c.just_added_newline()&&e.line_indent_level>a&&(a=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:a,line_indent_level:e?e.line_indent_level:a,start_line_index:c.get_line_number(),ternary_depth:0}}for(u={TK_START_EXPR:function N(){O();var e=Q.Expression;if("["===d.text){if("TK_WORD"===s||")"===f.last_text)return"TK_RESERVED"===s&&q(f.last_text,i.line_starters)&&(c.space_before_token=!0),L(e),R(),S(),void(h.space_in_paren&&(c.space_before_token=!0));e=Q.ArrayLiteral,_(f.mode)&&("["!==f.last_text&&(","!==f.last_text||"]"!==o&&"}"!==o)||h.keep_array_indentation||T())}else"TK_RESERVED"===s&&"for"===f.last_text?e=Q.ForInitializer:"TK_RESERVED"===s&&q(f.last_text,["if","while"])&&(e=Q.Conditional);" "===f.last_text||"TK_START_BLOCK"===s?T():"TK_END_EXPR"===s||"TK_START_EXPR"===s||"TK_END_BLOCK"===s||"."===f.last_text?A(d.wanted_newline):"TK_RESERVED"===s&&"("===d.text||"TK_WORD"===s||"TK_OPERATOR"===s?"TK_RESERVED"===s&&("function"===f.last_word||"typeof"===f.last_word)||"*"===f.last_text&&"function"===o?h.space_after_anon_function&&(c.space_before_token=!0):"TK_RESERVED"!==s||!q(f.last_text,i.line_starters)&&"catch"!==f.last_text||h.space_before_conditional&&(c.space_before_token=!0):c.space_before_token=!0;"("===d.text&&"TK_RESERVED"===s&&"await"===f.last_word&&(c.space_before_token=!0);"("===d.text&&("TK_EQUALS"!==s&&"TK_OPERATOR"!==s||I()||A());L(e),R(),h.space_in_paren&&(c.space_before_token=!0);S()},TK_END_EXPR:function D(){for(;f.mode===Q.Statement;)y();f.multiline_frame&&A("]"===d.text&&_(f.mode)&&!h.keep_array_indentation);h.space_in_paren&&("TK_START_EXPR"!==s||h.space_in_empty_paren?c.space_before_token=!0:(c.trim(),c.space_before_token=!1));"]"===d.text&&h.keep_array_indentation?(R(),y()):(y(),R());c.remove_redundant_indentation(p),f.do_while&&p.mode===Q.Conditional&&(p.mode=Q.Expression,f.do_block=!1,f.do_while=!1)},TK_START_BLOCK:function M(){var e=F(1),t=F(2);t&&(":"===t.text&&q(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||q(e.text,["get","set"])&&q(t.type,["TK_WORD","TK_RESERVED"]))?q(o,["class","interface"])?L(Q.BlockStatement):L(Q.ObjectLiteral):L(Q.BlockStatement);var a=!e.comments_before.length&&"}"===e.text&&"function"===f.last_word&&"TK_END_EXPR"===s;"expand"===h.brace_style||"none"===h.brace_style&&d.wanted_newline?"TK_OPERATOR"!==s&&(a||"TK_EQUALS"===s||"TK_RESERVED"===s&&x(f.last_text)&&"else"!==f.last_text)?c.space_before_token=!0:T(!1,!0):"TK_OPERATOR"!==s&&"TK_START_EXPR"!==s?"TK_START_BLOCK"===s?T():c.space_before_token=!0:_(p.mode)&&","===f.last_text&&("}"===o?c.space_before_token=!0:T());R(),S()},TK_END_BLOCK:function B(){for(;f.mode===Q.Statement;)y();var e="TK_START_BLOCK"===s;"expand"===h.brace_style?e||T():e||(_(f.mode)&&h.keep_array_indentation?(h.keep_array_indentation=!1,T(),h.keep_array_indentation=!0):T());y(),R()},TK_WORD:k,TK_RESERVED:k,TK_SEMICOLON:function P(){O()&&(c.space_before_token=!1);for(;f.mode===Q.Statement&&!f.if_block&&!f.do_block;)y();R()},TK_STRING:function U(){O()?c.space_before_token=!0:"TK_RESERVED"===s||"TK_WORD"===s?c.space_before_token=!0:"TK_COMMA"===s||"TK_START_EXPR"===s||"TK_EQUALS"===s||"TK_OPERATOR"===s?I()||A():T();R()},TK_EQUALS:function W(){O();f.declaration_statement&&(f.declaration_assignment=!0);c.space_before_token=!0,R(),c.space_before_token=!0},TK_OPERATOR:function K(){O();if("TK_RESERVED"===s&&x(f.last_text))return c.space_before_token=!0,void R();if("*"===d.text&&"TK_DOT"===s)return void R();if(":"===d.text&&f.in_case)return f.case_body=!0,S(),R(),T(),void(f.in_case=!1);if("::"===d.text)return void R();"TK_OPERATOR"===s&&A();var e=!0,t=!0;q(d.text,["--","++","!","~"])||q(d.text,["-","+"])&&(q(s,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||q(f.last_text,i.line_starters)||","===f.last_text)?(t=e=!1,!d.wanted_newline||"--"!==d.text&&"++"!==d.text||T(!1,!0)," "===f.last_text&&w(f.mode)&&(e=!0),"TK_RESERVED"===s?e=!0:"TK_END_EXPR"===s?e=!("]"===f.last_text&&("--"===d.text||"++"===d.text)):"TK_OPERATOR"===s&&(e=q(d.text,["--","-","++","+"])&&q(f.last_text,["--","-","++","+"]),q(d.text,["+","-"])&&q(f.last_text,["--","++"])&&(t=!0)),f.mode!==Q.BlockStatement&&f.mode!==Q.Statement||"{"!==f.last_text&&" "!==f.last_text||T()):":"===d.text?0===f.ternary_depth?e=!1:f.ternary_depth-=1:"?"===d.text?f.ternary_depth+=1:"*"===d.text&&"TK_RESERVED"===s&&"function"===f.last_text&&(t=e=!1);c.space_before_token=c.space_before_token||e,R(),c.space_before_token=t},TK_COMMA:function H(){if(f.declaration_statement)return w(f.parent.mode)&&(f.declaration_assignment=!1),R(),void(f.declaration_assignment?T(f.declaration_assignment=!1,!0):(c.space_before_token=!0,h.comma_first&&A()));R(),f.mode===Q.ObjectLiteral||f.mode===Q.Statement&&f.parent.mode===Q.ObjectLiteral?(f.mode===Q.Statement&&y(),T()):(c.space_before_token=!0,h.comma_first&&A())},TK_BLOCK_COMMENT:function $(){if(c.raw)return c.add_raw_token(d),void(d.directives&&"end"===d.directives.preserve&&(h.test_output_raw||(c.raw=!1)));if(d.directives)return T(!1,!0),R(),"start"===d.directives.preserve&&(c.raw=!0),void T(!1,!0);if(!j.newline.test(d.text)&&!d.wanted_newline)return c.space_before_token=!0,R(),void(c.space_before_token=!0);var e,t=function s(e){var t;e=e.replace(/\x0d/g,"");var a=[];t=e.indexOf("\n");for(;-1!==t;)a.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&a.push(e);return a}(d.text),a=!1,n=!1,r=d.whitespace_before,i=r.length;T(!1,!0),1<t.length&&(!function o(e,t){for(var a=0;a<e.length;a++){var n=X(e[a]);if(n.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function l(e,t){for(var a,n=0,r=e.length;n<r;n++)if((a=e[n])&&0!==a.indexOf(t))return!1;return!0}(t.slice(1),r)&&(n=!0):a=!0);for(R(t[0]),e=1;e<t.length;e++)T(!1,!0),a?R(" "+t[e].replace(/^\s+/g,"")):n&&t[e].length>i?R(t[e].substring(i)):c.add_token(t[e]);T(!1,!0)},TK_COMMENT:function G(){d.wanted_newline?T(!1,!0):c.trim(!0);c.space_before_token=!0,R(),T(!1,!0)},TK_DOT:function Y(){O();"TK_RESERVED"===s&&x(f.last_text)?c.space_before_token=!0:A(")"===f.last_text&&h.break_chained_methods);R()},TK_UNKNOWN:function V(){R(),"\n"===d.text[d.text.length-1]&&T()},TK_EOF:function z(){for(;f.mode===Q.Statement;)y()}},h={},(e=e||{}).braces_on_own_line!==undefined&&(h.brace_style=e.braces_on_own_line?"expand":"collapse"),h.brace_style=e.brace_style?e.brace_style:h.brace_style?h.brace_style:"collapse","expand-strict"===h.brace_style&&(h.brace_style="expand"),h.indent_size=e.indent_size?parseInt(e.indent_size,10):4,h.indent_char=e.indent_char?e.indent_char:" ",h.eol=e.eol?e.eol:"\n",h.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,h.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,h.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),h.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,h.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,h.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,h.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,h.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,h.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,h.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,h.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),h.e4x=e.e4x!==undefined&&e.e4x,h.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,h.comma_first=e.comma_first!==undefined&&e.comma_first,h.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,h.jslint_happy&&(h.space_after_anon_function=!0),e.indent_with_tabs&&(h.indent_char="\t",h.indent_size=1),h.eol=h.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),l="";0<h.indent_size;)l+=h.indent_char,h.indent_size-=1;var E=0;if(n&&n.length){for(;" "===n.charAt(E)||"\t"===n.charAt(E);)m+=n.charAt(E),E+=1;n=n.substring(E)}function b(e){var t=e.newlines;if(h.keep_array_indentation&&_(f.mode))for(var a=0;a<t;a+=1)T(0<a);else if(h.max_preserve_newlines&&t>h.max_preserve_newlines&&(t=h.max_preserve_newlines),h.preserve_newlines&&1<e.newlines){T();for(var n=1;n<t;n+=1)T(!0)}u[(d=e).type]()}function A(e){if(e=e!==undefined&&e,!c.just_added_newline())if(h.preserve_newlines&&d.wanted_newline||e)T(!1,!0);else if(h.wrap_line_length){c.current_line.get_character_count()+d.text.length+(c.space_before_token?1:0)>=h.wrap_line_length&&T(!1,!0)}}function T(e,t){if(!t&&" "!==f.last_text&&","!==f.last_text&&"="!==f.last_text&&"TK_OPERATOR"!==s)for(;f.mode===Q.Statement&&!f.if_block&&!f.do_block;)y();c.add_new_line(e)&&(f.multiline_frame=!0)}function C(){c.just_added_newline()&&(h.keep_array_indentation&&_(f.mode)&&d.wanted_newline?(c.current_line.push(d.whitespace_before),c.space_before_token=!1):c.set_indent(f.indentation_level)&&(f.line_indent_level=f.indentation_level))}function R(e){c.raw?c.add_raw_token(d):(h.comma_first&&"TK_COMMA"===s&&c.just_added_newline()&&","===c.previous_line.last()&&(c.previous_line.pop(),C(),c.add_token(","),c.space_before_token=!0),e=e||d.text,C(),c.add_token(e))}function S(){f.indentation_level+=1}function L(e){p=f?(t.push(f),f):v(null,e),f=v(p,e)}function _(e){return e===Q.ArrayLiteral}function w(e){return q(e,[Q.Expression,Q.ForInitializer,Q.Conditional])}function y(){0<t.length&&(p=f,f=t.pop(),p.mode===Q.Statement&&c.remove_redundant_indentation(p))}function I(){return f.parent.mode===Q.ObjectLiteral&&f.mode===Q.Statement&&(":"===f.last_text&&0===f.ternary_depth||"TK_RESERVED"===s&&q(f.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===s&&q(f.last_text,["const","let","const"])&&"TK_WORD"===d.type||"TK_RESERVED"===s&&"do"===f.last_text||"TK_RESERVED"===s&&"return"===f.last_text&&!d.wanted_newline||"TK_RESERVED"===s&&"else"===f.last_text&&("TK_RESERVED"!==d.type||"if"!==d.text)||"TK_END_EXPR"===s&&(p.mode===Q.ForInitializer||p.mode===Q.Conditional)||"TK_WORD"===s&&f.mode===Q.BlockStatement&&!f.in_case&&"--"!==d.text&&"++"!==d.text&&"function"!==o&&"TK_WORD"!==d.type&&"TK_RESERVED"!==d.type||f.mode===Q.ObjectLiteral&&(":"===f.last_text&&0===f.ternary_depth||"TK_RESERVED"===s&&q(f.last_text,["get","set"])))&&(L(Q.Statement),S(),"TK_RESERVED"===s&&q(f.last_text,["const","let","const"])&&"TK_WORD"===d.type&&(f.declaration_statement=!0),I()||A("TK_RESERVED"===d.type&&q(d.text,["do","for","if","while"])),!0)}function x(e){return q(e,["case","return","do","if","throw","else"])}function F(e){var t=r+(e||0);return t<0||t>=g.length?null:g[t]}function k(){("TK_RESERVED"===d.type&&f.mode!==Q.ObjectLiteral&&q(d.text,["set","get"])&&(d.type="TK_WORD"),"TK_RESERVED"===d.type&&f.mode===Q.ObjectLiteral)&&(":"===F(1).text&&(d.type="TK_WORD"));if(O()||!d.wanted_newline||w(f.mode)||"TK_OPERATOR"===s&&"--"!==f.last_text&&"++"!==f.last_text||"TK_EQUALS"===s||!h.preserve_newlines&&"TK_RESERVED"===s&&q(f.last_text,["const","let","const","set","get"])||T(),f.do_block&&!f.do_while){if("TK_RESERVED"===d.type&&"while"===d.text)return c.space_before_token=!0,R(),c.space_before_token=!0,void(f.do_while=!0);T(),f.do_block=!1}if(f.if_block)if(f.else_block||"TK_RESERVED"!==d.type||"else"!==d.text){for(;f.mode===Q.Statement;)y();f.if_block=!1,f.else_block=!1}else f.else_block=!0;if("TK_RESERVED"===d.type&&("case"===d.text||"default"===d.text&&f.in_case_statement))return T(),(f.case_body||h.jslint_happy)&&(!function e(){0<f.indentation_level&&(!f.parent||f.indentation_level>f.parent.indentation_level)&&(f.indentation_level-=1)}(),f.case_body=!1),R(),f.in_case=!0,void(f.in_case_statement=!0);if("TK_RESERVED"===d.type&&"function"===d.text&&((q(f.last_text,["}"," "])||c.just_added_newline()&&!q(f.last_text,["[","{",":","=",","]))&&(c.just_added_blankline()||d.comments_before.length||(T(),T(!0))),"TK_RESERVED"===s||"TK_WORD"===s?"TK_RESERVED"===s&&q(f.last_text,["get","set","new","return","export","async"])?c.space_before_token=!0:"TK_RESERVED"===s&&"default"===f.last_text&&"export"===o?c.space_before_token=!0:T():"TK_OPERATOR"===s||"="===f.last_text?c.space_before_token=!0:(f.multiline_frame||!w(f.mode)&&!_(f.mode))&&T()),"TK_COMMA"!==s&&"TK_START_EXPR"!==s&&"TK_EQUALS"!==s&&"TK_OPERATOR"!==s||I()||A(),"TK_RESERVED"===d.type&&q(d.text,["function","get","set"]))return R(),void(f.last_word=d.text);(a="NONE","TK_END_BLOCK"===s?"TK_RESERVED"===d.type&&q(d.text,["else","catch","finally"])?"expand"===h.brace_style||"end-expand"===h.brace_style||"none"===h.brace_style&&d.wanted_newline?a="NEWLINE":(a="SPACE",c.space_before_token=!0):a="NEWLINE":"TK_SEMICOLON"===s&&f.mode===Q.BlockStatement?a="NEWLINE":"TK_SEMICOLON"===s&&w(f.mode)?a="SPACE":"TK_STRING"===s?a="NEWLINE":"TK_RESERVED"===s||"TK_WORD"===s||"*"===f.last_text&&"function"===o?a="SPACE":"TK_START_BLOCK"===s?a="NEWLINE":"TK_END_EXPR"===s&&(c.space_before_token=!0,a="NEWLINE"),"TK_RESERVED"===d.type&&q(d.text,i.line_starters)&&")"!==f.last_text&&(a="else"===f.last_text||"export"===f.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===d.type&&q(d.text,["else","catch","finally"]))?"TK_END_BLOCK"!==s||"expand"===h.brace_style||"end-expand"===h.brace_style||"none"===h.brace_style&&d.wanted_newline?T():(c.trim(!0),"}"!==c.current_line.last()&&T(),c.space_before_token=!0):"NEWLINE"===a?"TK_RESERVED"===s&&x(f.last_text)?c.space_before_token=!0:"TK_END_EXPR"!==s?"TK_START_EXPR"===s&&"TK_RESERVED"===d.type&&q(d.text,["const","let","const"])||":"===f.last_text||("TK_RESERVED"===d.type&&"if"===d.text&&"else"===f.last_text?c.space_before_token=!0:T()):"TK_RESERVED"===d.type&&q(d.text,i.line_starters)&&")"!==f.last_text&&T():f.multiline_frame&&_(f.mode)&&","===f.last_text&&"}"===o?T():"SPACE"===a&&(c.space_before_token=!0);R(),f.last_word=d.text,"TK_RESERVED"===d.type&&"do"===d.text&&(f.do_block=!0),"TK_RESERVED"===d.type&&"if"===d.text&&(f.if_block=!0)}s="TK_START_BLOCK",o="",(c=new J(l,m)).raw=h.test_output_raw,t=[],L(Q.BlockStatement),this.beautify=function(){var e,t;for(i=new ee(n,h,l),g=i.tokenize(),r=0;e=F();){for(var a=0;a<e.comments_before.length;a++)b(e.comments_before[a]);b(e),o=f.last_text,s=e.type,f.last_text=e.text,r+=1}return t=c.get_code(),h.end_with_newline&&(t+="\n"),"\n"!=h.eol&&(t=t.replace(/[\n]/g,h.eol)),t}}function i(t){var a=0,n=-1,r=[],i=!0;this.set_indent=function(e){a=t.baseIndentLength+e*t.indent_length,n=e},this.get_character_count=function(){return a},this.is_empty=function(){return i},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),a+=e.length,i=!1},this.pop=function(){var e=null;return i||(e=r.pop(),a-=e.length,i=0===r.length),e},this.remove_indent=function(){0<n&&(n-=1,a-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),a-=1;i=0===r.length},this.toString=function(){var e="";return this._empty||(0<=n&&(e=t.indent_cache[n]),e+=r.join("")),e}}function J(t,a){a=a||"",this.indent_cache=[a],this.baseIndentLength=a.length,this.indent_length=t.length,this.raw=!1;var n=[];this.baseIndentString=a,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new i(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return n.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<n.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==Q.ForInitializer&&e.mode!==Q.Conditional)for(var t=e.start_line_index,a=n.length;t<a;)n[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,a);e&&1<n.length&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=1<n.length?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===n.length||n[n.length-2].is_empty())}}var Z=function Z(e,t,a,n,r,i){this.type=e,this.text=t,this.comments_before=[],this.newlines=a||0,this.wanted_newline=0<a,this.whitespace_before=n||"",this.parent=null,this.directives=null};function ee(y,I,e){var O="\n\r\t ".split(""),x=/[0-9]/,F=/[01234567]/,k=/[0123456789abcdefABCDEF]/,N="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var D,M,B,P,U,W,K=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),H=/([\s\S]*?)((?:\*\/)|$)/g,$=/([^\n\r\u2028\u2029]*)/g,G=/\/\* beautify( \w+[:]\w+)+ \*\//g,Y=/ (\w+)[:](\w+)/g,V=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,z=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function s(){var e,t,a=[];if(D=0,M="",W<=U)return["","TK_EOF"];t=P.length?P[P.length-1]:new Z("TK_START_BLOCK","{");var n=y.charAt(U);for(U+=1;q(n,O);){if(j.newline.test(n)?"\n"===n&&"\r"===y.charAt(U-2)||(D+=1,a=[]):a.push(n),W<=U)return["","TK_EOF"];n=y.charAt(U),U+=1}if(a.length&&(M=a.join("")),x.test(n)){var r=!0,i=!0,s=x;for("0"===n&&U<W&&/[Xxo]/.test(y.charAt(U))?(i=r=!1,n+=y.charAt(U),U+=1,s=/[o]/.test(y.charAt(U))?F:k):(n="",U-=1);U<W&&s.test(y.charAt(U));)n+=y.charAt(U),U+=1,r&&U<W&&"."===y.charAt(U)&&(n+=y.charAt(U),U+=1,r=!1),i&&U<W&&/[Ee]/.test(y.charAt(U))&&(n+=y.charAt(U),(U+=1)<W&&/[+-]/.test(y.charAt(U))&&(n+=y.charAt(U),U+=1),r=i=!1);return[n,"TK_WORD"]}if(j.isIdentifierStart(y.charCodeAt(U-1))){if(U<W)for(;j.isIdentifierChar(y.charCodeAt(U))&&(n+=y.charAt(U),(U+=1)!==W););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&q(t.text,["set","get"])||!q(n,K)?[n,"TK_WORD"]:"in"===n?[n,"TK_OPERATOR"]:[n,"TK_RESERVED"]}if("("===n||"["===n)return[n,"TK_START_EXPR"];if(")"===n||"]"===n)return[n,"TK_END_EXPR"];if("{"===n)return[n,"TK_START_BLOCK"];if("}"===n)return[n,"TK_END_BLOCK"];if(" "===n)return[n,"TK_SEMICOLON"];if("/"===n){var o="";if("*"===y.charAt(U)){U+=1,H.lastIndex=U;var l=H.exec(y);o="/*"+l[0],U+=l[0].length;var c=function _(e){if(!e.match(G))return null;var t={};Y.lastIndex=0;for(var a=Y.exec(e);a;)t[a[1]]=a[2],a=Y.exec(e);return t}(o);return c&&"start"===c.ignore&&(V.lastIndex=U,o+=(l=V.exec(y))[0],U+=l[0].length),[o=o.replace(j.lineBreak,"\n"),"TK_BLOCK_COMMENT",c]}if("/"===y.charAt(U)){U+=1,$.lastIndex=U;var d=$.exec(y);return o="//"+d[0],U+=d[0].length,[o,"TK_COMMENT"]}}if("`"===n||"'"===n||'"'===n||("/"===n||I.e4x&&"<"===n&&y.slice(U-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&q(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&q(t.parent.text,["if","while","for"])||q(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var f=n,p=!1,u=!1;if(e=n,"/"===f)for(var h=!1;U<W&&(p||h||y.charAt(U)!==f)&&!j.newline.test(y.charAt(U));)e+=y.charAt(U),p?p=!1:(p="\\"===y.charAt(U),"["===y.charAt(U)?h=!0:"]"===y.charAt(U)&&(h=!1)),U+=1;else if(I.e4x&&"<"===f){var g=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,m=y.slice(U-1),v=g.exec(m);if(v&&0===v.index){for(var E=v[2],b=0;v;){var A=!!v[1],T=v[2],C=!!v[v.length-1]||"![CDATA["===T.slice(0,8);if(T!==E||C||(A?--b:++b),b<=0)break;v=g.exec(m)}var R=v?v.index+v[0].length:m.length;return m=m.slice(0,R),U+=R-1,[m=m.replace(j.lineBreak,"\n"),"TK_STRING"]}}else for(;U<W&&(p||y.charAt(U)!==f&&("`"===f||!j.newline.test(y.charAt(U))));)(p||"`"===f)&&j.newline.test(y.charAt(U))?("\r"===y.charAt(U)&&"\n"===y.charAt(U+1)&&(U+=1),e+="\n"):e+=y.charAt(U),p=p?("x"!==y.charAt(U)&&"u"!==y.charAt(U)||(u=!0),!1):"\\"===y.charAt(U),U+=1;if(u&&I.unescape_strings&&(e=function w(e){var t,a=!1,n="",r=0,i="",s=0;for(;a||r<e.length;)if(t=e.charAt(r),r++,a){if(a=!1,"x"===t)i=e.substr(r,2),r+=2;else{if("u"!==t){n+="\\"+t;continue}i=e.substr(r,4),r+=4}if(!i.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(s=parseInt(i,16))&&s<32){n+="x"===t?"\\x"+i:"\\u"+i;continue}if(34===s||39===s||92===s)n+="\\"+String.fromCharCode(s);else{if("x"===t&&126<s&&s<=255)return e;n+=String.fromCharCode(s)}}else"\\"===t?a=!0:n+=t;return n}(e)),U<W&&y.charAt(U)===f&&(e+=f,U+=1,"/"===f))for(;U<W&&j.isIdentifierStart(y.charCodeAt(U));)e+=y.charAt(U),U+=1;return[e,"TK_STRING"]}if("#"===n){if(0===P.length&&"!"===y.charAt(U)){for(e=n;U<W&&"\n"!==n;)e+=n=y.charAt(U),U+=1;return[X(e)+"\n","TK_UNKNOWN"]}var S="#";if(U<W&&x.test(y.charAt(U))){for(;S+=n=y.charAt(U),(U+=1)<W&&"#"!==n&&"="!==n;);return"#"===n||("["===y.charAt(U)&&"]"===y.charAt(U+1)?(S+="[]",U+=2):"{"===y.charAt(U)&&"}"===y.charAt(U+1)&&(S+="{}",U+=2)),[S,"TK_WORD"]}}if("<"===n&&("?"===y.charAt(U)||"%"===y.charAt(U))){z.lastIndex=U-1;var L=z.exec(y);if(L)return n=L[0],U+=n.length-1,[n=n.replace(j.lineBreak,"\n"),"TK_STRING"]}if("<"===n&&"\x3c!--"===y.substring(U-1,U+3)){for(U+=3,n="\x3c!--";!j.newline.test(y.charAt(U))&&U<W;)n+=y.charAt(U),U++;return B=!0,[n,"TK_COMMENT"]}if("-"===n&&B&&"--\x3e"===y.substring(U-1,U+2))return B=!1,U+=2,["--\x3e","TK_COMMENT"];if("."===n)return[n,"TK_DOT"];if(q(n,N)){for(;U<W&&q(n+y.charAt(U),N)&&(n+=y.charAt(U),!(W<=(U+=1))););return","===n?[n,"TK_COMMA"]:"="===n?[n,"TK_EQUALS"]:[n,"TK_OPERATOR"]}return[n,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,a;W=y.length,U=0,B=!1,P=[];for(var n=null,r=[],i=[];!t||"TK_EOF"!==t.type;){for(a=s(),e=new Z(a[1],a[0],D,M);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=a[2]),i.push(e),a=s(),e=new Z(a[1],a[0],D,M);i.length&&(e.comments_before=i,i=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(n),n=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&n&&("]"===e.text&&"["===n.text||")"===e.text&&"("===n.text||"}"===e.text&&"{"===n.text)&&(e.parent=n.parent,n=r.pop()),P.push(e),t=e}return P}}return{run:function x(e,t){function s(e){return e.replace(/\s+$/g,"")}var a,n,r,m,i,o,v,l,c,E,b,A,d,f;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),n=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),m=t.indent_char===undefined?" ":t.indent_char,o=t.brace_style===undefined?"collapse":t.brace_style,i=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),v=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],l=t.preserve_newlines===undefined||t.preserve_newlines,c=l?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,E=t.indent_handlebars!==undefined&&t.indent_handlebars,b=t.wrap_attributes===undefined?"auto":t.wrap_attributes,A=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,d=t.end_with_newline!==undefined&&t.end_with_newline,f=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(m="\t",r=1),(a=new function y(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=n,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:f,in_array:function(e,t){for(var a=0;a<t.length;a++)if(e===t[a])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)l&&"\n"===e&&this.newlines<=c&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(E){var a=this.input.substr(this.pos,3);if("{{#"===a||"{{/"===a)break;if("{{!"===a)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",a=new RegExp("</"+e+"\\s*>","igm");a.lastIndex=this.pos;var n=a.exec(this.input),r=n?n.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1===this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,a,n="",r=[],i="",s=!1,o=!0,l=this.pos,c=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=l,this.line_char_count=c),r.length?r.join(""):["","TK_EOF"];if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace))s=!0;else{if("'"!==n&&'"'!==n||(n+=this.get_unformatted(n),s=!0),"="===n&&(s=!1),r.length&&"="!=r[r.length-1]&&">"!=n&&s){if(this.space_or_wrap(r),s=!1,!o&&"force"===b&&"/"!=n){this.print_newline(!0,r),this.print_indentation(r);for(var d=0;d<A;d++)r.push(m)}for(var f=0;f<r.length;f++)if(" "===r[f]){o=!1;break}}if(E&&"<"===a&&n+this.input.charAt(this.pos)==="{{"&&(n+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(n=" "+n),s=!0),"<"!==n||a||(t=this.pos-1,a="<"),E&&!a&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===n||"/"===n||"!"===n?this.pos-3:this.pos-2,a="{"),this.line_char_count++,r.push(n),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(E&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(E&&"{"===a&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=n);var p,u,h=r.join("");p=-1!=h.indexOf(" ")?h.indexOf(" "):"{"===h[0]?h.indexOf("}"):h.indexOf(">"),u="<"!==h[0]&&E?"#"===h[2]?3:2:1;var g=h.substring(u,p).toLowerCase();return"/"===h.charAt(h.length-2)||this.Utils.in_array(g,this.Utils.single_token)?e||(this.tag_type="SINGLE"):E&&"{"===h[0]&&"else"===g?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(g,v)?(i=this.get_unformatted("</"+g+">",h),r.push(i),this.pos,this.tag_type="SINGLE"):"script"===g&&(-1===h.search("type")||-1<h.search("type")&&-1<h.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(g),this.tag_type="SCRIPT"):"style"===g&&(-1===h.search("type")||-1<h.search("type")&&-1<h.search("text/css"))?e||(this.record_tag(g),this.tag_type="STYLE"):"!"===g.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===g.charAt(0)?(this.retrieve_tag(g.substring(1)),this.tag_type="END"):(this.record_tag(g),"html"!=g.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(g,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=l,this.line_char_count=c),r.join("")},this.get_comment=function(e){var t="",a=">",n=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!==a[a.length-1]||-1==t.indexOf(a));)!n&&t.length<10&&(0===t.indexOf("<![if")?(a="<![endif]>",n=!0):0===t.indexOf("<![cdata[")?(a="]]>",n=!0):0===t.indexOf("<![")?(a="]>",n=!0):0===t.indexOf("\x3c!--")?(a="--\x3e",n=!0):0===t.indexOf("{{!")?(a="}}",n=!0):0===t.indexOf("<?")?(a="?>",n=!0):0===t.indexOf("<%")&&(a="%>",n=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var a="",n="",r=0,i=!0;do{if(this.pos>=this.input.length)return n;if(a=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(a,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===a||"\r"===a){n+="\n",this.line_char_count=0;continue}}n+=a,this.line_char_count++,i=!0,E&&"{"===a&&n.length&&"{"===n[n.length-2]&&(r=(n+=this.get_unformatted("}}")).length)}while(-1===n.toLowerCase().indexOf(e,r));return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var a=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(a&&!this.Utils.in_array(a,t))},this.printer=function(e,t,a,n,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=a,this.brace_style=r,this.indent_level=0,this.wrap_line_length=n;for(var i=this.line_char_count=0;i<this.indent_size;i++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=s(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=function t(e){return e.replace(/^\s+/g,"")}(e)),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=s(e)),e&&""!==e&&(1<e.length&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,m,r,i,o);;){var p=a.get_token();if(a.token_text=p[0],a.token_type=p[1],"TK_EOF"===a.token_type)break;switch(a.token_type){case"TK_TAG_START":a.print_newline(!1,a.output),a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===a.last_token&&""===a.last_text){var u=a.token_text.match(/\w+/)[0],h=null;a.output.length&&(h=a.output[a.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/)),(null===h||h[1]!=u&&!a.Utils.in_array(h[1],v))&&a.print_newline(!1,a.output)}a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var g=a.token_text.match(/^\s*<([a-z-]+)/i);g&&a.Utils.in_array(g[1],v)||a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":a.print_token(a.token_text),a.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==a.token_text){a.print_newline(!1,a.output);var T=a.token_text,C=void 0,R=1;"TK_SCRIPT"===a.token_type?C=O:"TK_STYLE"===a.token_type&&(C=I),"keep"===t.indent_scripts?R=0:"separate"===t.indent_scripts&&(R=-a.indent_level);var S=a.get_full_indent(R);if(C)T=C(T.replace(/^\s*/,S),t);else{var L=T.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(a.indent_string).length-1,_=a.get_full_indent(R-L);T=T.replace(/^\s*/,S).replace(/\r\n|\r|\n/g,"\n"+_).replace(/\s+$/,"")}T&&(a.print_token_raw(T),a.print_newline(!0,a.output))}a.current_mode="TAG";break;default:""!==a.token_text&&a.print_token(a.token_text)}a.last_token=a.token_type,a.last_text=a.token_text}var w=a.output.join("").replace(/[\r\n\t ]+$/,"");return d&&(w+="\n"),w}}},Object.assign(Be.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),Be.PLUGINS.codeView=function(c){var d,f,p=c.$;function u(){return c.$box.hasClass("fr-code-view")}function h(){return f?f.getValue():d.val()}function g(){u()&&(f&&f.setSize(null,c.opts.height?c.opts.height:"auto"),c.opts.heightMin||c.opts.height?(c.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",c.opts.heightMin||c.opts.height),d.css("height",c.opts.height)):c.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var m,v=!1;function E(){u()&&c.events.trigger("blur")}function b(){u()&&v&&c.events.trigger("focus")}function n(e){d||(!function l(){d=p('<textarea class="fr-code" tabIndex="-1">'),c.$wp.append(d),d.attr("dir",c.opts.direction),c.$box.hasClass("fr-basic")||(m=p('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(c.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),c.$box.append(m),c.events.bindClick(c.$box,"a.html-switch",function(){c.events.trigger("commands.before",["html"]),A(!1),c.events.trigger("commands.after",["html"])}));var e=function e(){return!u()};c.events.on("buttons.refresh",e),c.events.on("copy",e,!0),c.events.on("cut",e,!0),c.events.on("paste",e,!0),c.events.on("destroy",T,!0),c.events.on("html.set",function(){u()&&A(!0)}),c.events.on("codeView.update",g),c.events.on("codeView.toggle",function(){c.$box.hasClass("fr-code-view")&&A()}),c.events.on("form.submit",function(){u()&&(c.html.set(h()),c.events.trigger("contentChanged",[],!0))},!0)}(),!f&&c.opts.codeMirror?((f=c.opts.codeMirror.fromTextArea(d.get(0),c.opts.codeMirrorOptions)).on("blur",E),f.on("focus",b)):(c.events.$on(d,"keydown keyup change input",function(){c.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")}),c.events.$on(d,"blur",E),c.events.$on(d,"focus",b))),c.undo.saveStep(),c.html.cleanEmptyTags(),c.html.cleanWhiteTags(!0),c.core.hasFocus()&&(c.core.isEmpty()||(c.selection.save(),c.$el.find('.fr-marker[data-type="true"]').first().replaceWith('<span class="fr-tmp fr-sm">F</span>'),c.$el.find('.fr-marker[data-type="false"]').last().replaceWith('<span class="fr-tmp fr-em">F</span>')));var t=c.html.get(!1,!0);c.$el.find("span.fr-tmp").remove(),c.$box.toggleClass("fr-code-view",!0);var a,n,r=!1;if(c.core.hasFocus()&&(r=!0,c.events.disableBlur(),c.$el.blur()),t=(t=t.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),c.codeBeautifier&&!t.includes("fr-embedly")&&(t=c.codeBeautifier.run(t,c.opts.codeBeautifierOptions)),f){a=t.indexOf("FROALA-SM"),(n=t.indexOf("FROALA-EM"))<a?a=n:n-=9;var i=(t=t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,a).length-t.substring(0,a).replace(/\n/g,"").length,s=t.substring(0,n).length-t.substring(0,n).replace(/\n/g,"").length;a=t.substring(0,a).length-t.substring(0,t.substring(0,a).lastIndexOf("\n")+1).length,n=t.substring(0,n).length-t.substring(0,t.substring(0,n).lastIndexOf("\n")+1).length,f.setSize(null,c.opts.height?c.opts.height:"auto"),c.opts.heightMin&&c.$box.find(".CodeMirror-scroll").css("min-height",c.opts.heightMin),f.setValue(t),v=!r,f.focus(),v=!0,f.setSelection({line:i,ch:a},{line:s,ch:n}),f.refresh(),f.clearHistory()}else{a=t.indexOf("FROALA-SM"),n=t.indexOf("FROALA-EM")-9,c.opts.heightMin&&d.css("min-height",c.opts.heightMin),c.opts.height&&d.css("height",c.opts.height),c.opts.heightMax&&d.css("max-height",c.opts.height||c.opts.heightMax),d.val(t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var o=p(c.o_doc).scrollTop();v=!r,d.focus(),v=!0,d.get(0).setSelectionRange(a,n),p(c.o_doc).scrollTop(o)}c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).filter(function(){return c.opts.codeViewKeepActiveButtons.indexOf(p(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!c.helpers.isMobile()&&c.opts.toolbarInline&&c.toolbar.hide()}function A(e){void 0===e&&(e=!u());var t=c.$tb.find('.fr-command[data-cmd="html"]');e?(c.popups.hideAll(),n(t)):(c.$box.toggleClass("fr-code-view",!1),function a(e){var t=h();c.html.set(t),c.$el.blur(),c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1),c.selection.setAtStart(c.el),c.selection.restore(),c.placeholder.refresh(),c.undo.saveStep()}(t))}function T(){u()&&A(!1),f&&f.toTextArea(),d.val("").removeData().remove(),d=null,m&&(m.remove(),m=null)}return{_init:function e(){if(c.events.on("focus",function(){c.opts.toolbarContainer&&function t(){var e=c.$tb.find('.fr-command[data-cmd="html"]');u()?(c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).filter(function(){return c.opts.codeViewKeepActiveButtons.indexOf(p(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!1),e.addClass("fr-active").attr("aria-pressed",!1)):(c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1))}()}),!c.$wp)return!1},toggle:A,isActive:u,get:h}},Be.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),Be.DefineIcon("html",{NAME:"code",SVG_KEY:"codeView"}),Object.assign(Be.POPUP_TEMPLATES,{"textColor.picker":"[_BUTTONS_][_TEXT_COLORS_][_CUSTOM_COLOR_]","backgroundColor.picker":"[_BUTTONS_][_BACKGROUND_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(Be.DEFAULTS,{colorsText:["#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"],colorsBackground:["#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"],colorsStep:7,colorsHEXInput:!0,colorsButtons:["colorsBack","|","-"]}),Be.PLUGINS.colors=function(m){var v=m.$,o='<div class="fr-color-hex-layer fr-active fr-layer" id="fr-color-hex-layer- \n '.concat(m.id,'"><div class="fr-input-line"><input maxlength="7" id="[ID]"\n type="text" placeholder="').concat(m.language.translate("HEX Color"),'" \n tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button \n type="button" class="fr-command fr-submit" data-cmd="[COMMAND]" tabIndex="2" role="button">\n ').concat(m.language.translate("OK"),"</button></div></div>");function l(e){for(var t="text"===e?m.opts.colorsText:m.opts.colorsBackground,a='<div class="fr-color-set fr-'.concat(e,'-color fr-selected-set">'),n=0;n<t.length;n++)0!==n&&n%m.opts.colorsStep==0&&(a+="<br>"),"REMOVE"!==t[n]?a+='<span class="fr-command fr-select-color" style="background:'.concat(t[n],';" \n tabIndex="-1" aria-selected="false" role="button" data-cmd="apply').concat(e,'Color" \n data-param1="').concat(t[n],'"><span class="fr-sr-only"> ').concat(m.language.translate("Color")).concat(t[n]," \n &nbsp;&nbsp;&nbsp;</span></span>"):a+='<span class="fr-command fr-select-color" data-cmd="apply'.concat(e,'Color"\n tabIndex="-1" role="button" data-param1="REMOVE" \n title="').concat(m.language.translate("Clear Formatting"),'">').concat(m.icon.create("remove"),' \n <span class="fr-sr-only"> ').concat(m.language.translate("Clear Formatting")," </span></span>");return a+"</div>"}function c(e){var t,a=m.popups.get("".concat(e,"Color.picker")),n=v(m.selection.element());t="background"===e?"background-color":"color";var r=a.find(".fr-".concat(e,"-color .fr-select-color"));for(r.find(".fr-selected-color").remove(),r.removeClass("fr-active-item"),r.not('[data-param1="REMOVE"]').attr("aria-selected",!1);n.get(0)!==m.el;){if("transparent"!==n.css(t)&&"rgba(0, 0, 0, 0)"!==n.css(t)){var i=a.find(".fr-".concat(e,'-color .fr-select-color[data-param1="').concat(m.helpers.RGBToHex(n.css(t)),'"]'));i.append('<span class="fr-selected-color" aria-hidden="true">\uf00c</span>'),i.addClass("fr-active-item").attr("aria-selected",!0);break}n=n.parent()}!function s(e){var t=m.popups.get("".concat(e,"Color.picker")),a=t.find(".fr-".concat(e,"-color .fr-active-item")).attr("data-param1"),n=t.find(".fr-color-hex-layer input");a||(a="");n.length&&v(n.val(a).input).trigger("change")}(e)}function n(e){"REMOVE"!==e?m.format.applyStyle("background-color",m.helpers.HEXtoRGB(e)):m.format.removeStyle("background-color"),m.popups.hide("backgroundColor.picker")}function r(e){"REMOVE"!==e?m.format.applyStyle("color",m.helpers.HEXtoRGB(e)):m.format.removeStyle("color"),m.popups.hide("textColor.picker")}return{showColorsPopup:function d(e){var t=m.$tb.find('.fr-command[data-cmd="'.concat(e,'"]')),a=m.popups.get("".concat(e,".picker"));if(a||(a=function s(e){var t="";m.opts.toolbarInline&&0<m.opts.colorsButtons.length&&(t+='<div class="fr-buttons fr-colors-buttons fr-tabs">\n '.concat(m.button.buildList(m.opts.colorsButtons),"\n </div>"));var a,n="";a="textColor"===e?(m.opts.colorsHEXInput&&(n=o.replace(/\[ID\]/g,"fr-color-hex-layer-text-".concat(m.id)).replace(/\[COMMAND\]/g,"customTextColor")),{buttons:t,text_colors:l("text"),custom_color:n}):(m.opts.colorsHEXInput&&(n=o.replace(/\[ID\]/g,"fr-color-hex-layer-background-".concat(m.id)).replace(/\[COMMAND\]/g,"customBackgroundColor")),{buttons:t,background_colors:l("background"),custom_color:n});var r=m.popups.create("".concat(e,".picker"),a);return function i(h,g){m.events.on("popup.tab",function(e){var t=v(e.currentTarget);if(!m.popups.isVisible(g)||!t.is("span"))return!0;var a=e.which,n=!0;if(Be.KEYCODE.TAB===a){var r=h.find(".fr-buttons");n=!m.accessibility.focusToolbar(r,!!e.shiftKey)}else if(Be.KEYCODE.ARROW_UP===a||Be.KEYCODE.ARROW_DOWN===a||Be.KEYCODE.ARROW_LEFT===a||Be.KEYCODE.ARROW_RIGHT===a){if(t.is("span.fr-select-color")){var i=t.parent().find("span.fr-select-color"),s=i.index(t),o=m.opts.colorsStep,l=Math.floor(i.length/o),c=s%o,d=Math.floor(s/o),f=d*o+c,p=l*o;Be.KEYCODE.ARROW_UP===a?f=((f-o)%p+p)%p:Be.KEYCODE.ARROW_DOWN===a?f=(f+o)%p:Be.KEYCODE.ARROW_LEFT===a?f=((f-1)%p+p)%p:Be.KEYCODE.ARROW_RIGHT===a&&(f=(f+1)%p);var u=v(i.get(f));m.events.disableBlur(),u.focus(),n=!1}}else Be.KEYCODE.ENTER===a&&(m.button.exec(t),n=!1);return!1===n&&(e.preventDefault(),e.stopPropagation()),n},!0)}(r,"".concat(e,".picker")),r}(e)),!a.hasClass("fr-active"))if(m.popups.setContainer("".concat(e,".picker"),m.$tb),c("textColor"===e?"text":"background"),t.isVisible()){var n=m.button.getPosition(t),r=n.left,i=n.top;m.popups.show("".concat(e,".picker"),r,i,t.outerHeight())}else m.position.forSelection(a),m.popups.show("".concat(e,".picker"))},background:n,customColor:function i(e){var t=m.popups.get("".concat(e,"Color.picker")).find(".fr-color-hex-layer input");if(t.length){var a=t.val();"background"===e?n(a):r(a)}},text:r,back:function e(){m.popups.hide("textColor.picker"),m.popups.hide("backgroundColor.picker"),m.toolbar.showInline()}}},Be.DefineIcon("textColor",{NAME:"tint",SVG_KEY:"textColor"}),Be.RegisterCommand("textColor",{title:"Text Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("textColor.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("textColor.picker")):this.colors.showColorsPopup("textColor")}}),Be.RegisterCommand("applytextColor",{undo:!0,callback:function(e,t){this.colors.text(t)}}),Be.RegisterCommand("customTextColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("text")}}),Be.DefineIcon("backgroundColor",{NAME:"paint-brush",SVG_KEY:"backgroundColor"}),Be.RegisterCommand("backgroundColor",{title:"Background Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("backgroundColor.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("backgroundColor.picker")):this.colors.showColorsPopup("backgroundColor")}}),Be.RegisterCommand("applybackgroundColor",{undo:!0,callback:function(e,t){this.colors.background(t)}}),Be.RegisterCommand("customBackgroundColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("background")}}),Be.DefineIcon("colorsBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("colorsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.colors.back()}}),Be.DefineIcon("remove",{NAME:"eraser",SVG_KEY:"remove"}),Object.assign(Be.DEFAULTS,{dragInline:!0}),Be.PLUGINS.draggable=function(d){var f,p=d.$;function e(e){return!(!e.originalEvent||!e.originalEvent.target||e.originalEvent.target.nodeType!==Node.TEXT_NODE)||(e.target&&"A"===e.target.tagName&&1===e.target.childNodes.length&&"IMG"===e.target.childNodes[0].tagName&&(e.target=e.target.childNodes[0]),p(e.target).hasClass("fr-draggable")?(d.undo.canDo()||d.undo.saveStep(),d.opts.dragInline?d.$el.attr("contenteditable",!0):d.$el.attr("contenteditable",!1),d.opts.toolbarInline&&d.toolbar.hide(),p(e.target).addClass("fr-dragging"),d.browser.msie||d.browser.edge||d.selection.clear(),void e.originalEvent.dataTransfer.setData("text","Froala")):(e.preventDefault(),!1))}function u(e){return!(e&&("HTML"===e.tagName||"BODY"===e.tagName||d.node.isElement(e)))}function h(e,t,a){if(d.opts.iframe){var n=d.helpers.getPX(d.$wp.find(".fr-iframe").css("padding-top")),r=d.helpers.getPX(d.$wp.find(".fr-iframe").css("padding-left"));e+=d.$iframe.offset().top+n,t+=d.$iframe.offset().left+r}f.offset().top!==e&&f.css("top",e),f.offset().left!==t&&f.css("left",t),f.width()!==a&&f.css("width",a)}function t(e){e.originalEvent.dataTransfer.dropEffect="move",d.opts.dragInline?(!function a(){for(var e=null,t=0;t<Be.INSTANCES.length;t++)if((e=Be.INSTANCES[t].$el.find(".fr-dragging")).length)return e.get(0)}()||d.browser.msie||d.browser.edge)&&e.preventDefault():(e.preventDefault(),function c(e){var t=d.doc.elementFromPoint(e.originalEvent.pageX-d.win.pageXOffset,e.originalEvent.pageY-d.win.pageYOffset);if(!u(t)){for(var a=0,n=t;!u(n)&&n===t&&0<e.originalEvent.pageY-d.win.pageYOffset-a;)a++,n=d.doc.elementFromPoint(e.originalEvent.pageX-d.win.pageXOffset,e.originalEvent.pageY-d.win.pageYOffset-a);(!u(n)||f&&0===d.$el.find(n).length&&n!==f.get(0))&&(n=null);for(var r=0,i=t;!u(i)&&i===t&&e.originalEvent.pageY-d.win.pageYOffset+r<p(d.doc).height();)r++,i=d.doc.elementFromPoint(e.originalEvent.pageX-d.win.pageXOffset,e.originalEvent.pageY-d.win.pageYOffset+r);(!u(i)||f&&0===d.$el.find(i).length&&i!==f.get(0))&&(i=null),t=null===i&&n?n:i&&null===n?i:i&&n?a<r?n:i:null}if(p(t).hasClass("fr-drag-helper"))return!1;if(t&&!d.node.isBlock(t)&&(t=d.node.blockParent(t)),t&&0<=["TD","TH","TR","THEAD","TBODY"].indexOf(t.tagName)&&(t=p(t).parents("table").get(0)),t&&0<=["LI"].indexOf(t.tagName)&&(t=p(t).parents("UL, OL").get(0)),t&&!p(t).hasClass("fr-drag-helper")){var s;f||(Be.$draggable_helper||(Be.$draggable_helper=p(document.createElement("div")).attr("class","fr-drag-helper")),f=Be.$draggable_helper,d.events.on("shared.destroy",function(){f.html("").removeData().remove(),f=null},!0)),s=e.originalEvent.pageY<p(t).offset().top+p(t).outerHeight()/2;var o=p(t),l=0;s||0!==o.next().length?(s||(o=o.next()),"before"===f.data("fr-position")&&o.is(f.data("fr-tag"))||(0<o.prev().length&&(l=parseFloat(o.prev().css("margin-bottom"))||0),l=Math.max(l,parseFloat(o.css("margin-top"))||0),h(o.offset().top-l/2-d.$box.offset().top,o.offset().left-d.win.pageXOffset-d.$box.offset().left,o.width()),f.data("fr-position","before"))):"after"===f.data("fr-position")&&o.is(f.data("fr-tag"))||(l=parseFloat(o.css("margin-bottom"))||0,h(o.offset().top+p(t).height()+l/2-d.$box.offset().top,o.offset().left-d.win.pageXOffset-d.$box.offset().left,o.width()),f.data("fr-position","after")),f.data("fr-tag",o),f.addClass("fr-visible"),d.$box.append(f)}else f&&0<d.$box.find(f).length&&f.removeClass("fr-visible")}(e))}function a(e){e.originalEvent.dataTransfer.dropEffect="move",d.opts.dragInline||e.preventDefault()}function n(e){d.$el.attr("contenteditable",!0);var t=d.$el.find(".fr-dragging");f&&f.hasClass("fr-visible")&&d.$box.find(f).length?r(e):t.length&&(e.preventDefault(),e.stopPropagation()),f&&d.$box.find(f).length&&f.removeClass("fr-visible"),t.removeClass("fr-dragging")}function r(e){var t,a;d.$el.attr("contenteditable",!0);for(var n=0;n<Be.INSTANCES.length;n++)if((t=Be.INSTANCES[n].$el.find(".fr-dragging")).length){a=Be.INSTANCES[n];break}if(t.length){if(e.preventDefault(),e.stopPropagation(),f&&f.hasClass("fr-visible")&&d.$box.find(f).length)f.data("fr-tag")[f.data("fr-position")]('<span class="fr-marker"></span>'),f.removeClass("fr-visible");else if(!1===d.markers.insertAtPoint(e.originalEvent))return!1;if(t.removeClass("fr-dragging"),!1===(t=d.events.chainTrigger("element.beforeDrop",t)))return!1;var r=t;if(t.parent().is("A")&&1===t.parent().get(0).childNodes.length&&(r=t.parent()),d.core.isEmpty())d.events.focus();else d.$el.find(".fr-marker").replaceWith(Be.MARKERS),d.selection.restore();if(a===d||d.undo.canDo()||d.undo.saveStep(),d.core.isEmpty())d.$el.html(r);else{var i=d.markers.insert();0===r.find(i).length?p(i).replaceWith(r):0===t.find(i).length&&p(i).replaceWith(t),t.after(Be.MARKERS),d.selection.restore()}return d.popups.hideAll(),d.selection.save(),d.$el.find(d.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").not(d.opts.htmlAllowedEmptyTags.join(",")).remove(),d.html.wrap(),d.html.fillEmptyBlocks(),d.selection.restore(),d.undo.saveStep(),d.opts.iframe&&d.size.syncIframe(),a!==d&&(a.popups.hideAll(),a.$el.find(a.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),a.html.wrap(),a.html.fillEmptyBlocks(),a.undo.saveStep(),a.events.trigger("element.dropped"),a.opts.iframe&&a.size.syncIframe()),d.events.trigger("element.dropped",[r]),!1}f&&f.removeClass("fr-visible"),d.undo.canDo()||d.undo.saveStep(),setTimeout(function(){d.undo.saveStep()},0)}function i(e){if(e&&"DIV"===e.tagName&&d.node.hasClass(e,"fr-drag-helper"))e.parentNode.removeChild(e);else if(e&&e.nodeType===Node.ELEMENT_NODE)for(var t=e.querySelectorAll("div.fr-drag-helper"),a=0;a<t.length;a++)t[a].parentNode.removeChild(t[a])}return{_init:function s(){d.opts.enter===Be.ENTER_BR&&(d.opts.dragInline=!0),d.events.on("dragstart",e,!0),d.events.on("dragover",t,!0),d.events.on("dragenter",a,!0),d.events.on("document.dragend",n,!0),d.events.on("document.drop",n,!0),d.events.on("drop",r,!0),d.events.on("html.processGet",i)}}},Object.assign(Be.DEFAULTS,{editInPopup:!1}),Be.MODULES.editInPopup=function(n){function e(){n.events.$on(n.$el,n._mouseup,function(){setTimeout(function(){!function a(){var e,t=n.popups.get("text.edit");e="INPUT"===n.el.tagName?n.$el.attr("placeholder"):n.$el.text(),t.find("input").val(e).trigger("change"),n.popups.setContainer("text.edit",n.$sc),n.popups.show("text.edit",n.$el.offset().left+n.$el.outerWidth()/2,n.$el.offset().top+n.$el.outerHeight(),n.$el.outerHeight())}()},10)})}return{_init:function a(){n.opts.editInPopup&&(function t(){var e={edit:'<div id="fr-text-edit-'.concat(n.id,'" class="fr-layer fr-text-edit-layer"><div class="fr-input-line"><input type="text" placeholder="').concat(n.language.translate("Text"),'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="updateText" tabIndex="2">').concat(n.language.translate("Update"),"</button></div></div>")};n.popups.create("text.edit",e)}(),e())},update:function t(){var e=n.popups.get("text.edit").find("input").val();0===e.length&&(e=n.opts.placeholderText),"INPUT"===n.el.tagName?n.$el.attr("placeholder",e):n.$el.text(e),n.events.trigger("contentChanged"),n.popups.hide("text.edit")}}},Be.RegisterCommand("updateText",{focus:!1,undo:!1,callback:function(){this.editInPopup.update()}}),Object.assign(Be.POPUP_TEMPLATES,{emoticons:"[_BUTTONS_][_CUSTOM_LAYER_]"}),Object.assign(Be.DEFAULTS,{emoticonsSet:[{id:"people",name:"Smileys & People",code:"1f600",emoticons:[{code:"1f600",desc:"Grinning face"},{code:"1f601",desc:"Grinning Face with Smiling Eyes"},{code:"1f602",desc:"Face with Tears of Joy"},{code:"1f603",desc:"Smiling Face with Open Mouth"},{code:"1f604",desc:"Smiling Face with Open Mouth and Smiling Eyes"},{code:"1f605",desc:"Smiling Face with Open Mouth and Cold Sweat"},{code:"1f606",desc:"Smiling Face with Open Mouth and Tightly-Closed Eyes"},{code:"1f609",desc:"Winking Face"},{code:"1f60a",desc:"Smiling Face with Smiling Eyes"},{code:"1f608",desc:"Face Savouring Delicious Food"},{code:"1f60e",desc:"Smiling Face with Sunglasses"},{code:"1f60d",desc:"Smiling Face with Heart-Shaped Eyes"},{code:"1f618",desc:"Face Throwing a Kiss"},{code:"1f617",desc:"Kissing Face"},{code:"1f619",desc:"Kissing Face with Smiling Eyes"},{code:"1f61a",desc:"Kissing Face with Closed Eyes"},{code:"263a",desc:"White Smiling Face"},{code:"1f642",desc:"Slightly Smiling Face"},{code:"1f610",desc:"Neutral Face"},{code:"1f611",desc:"Expressionless Face"},{code:"1f636",desc:"Face Without Mouth"},{code:"1f60f",desc:"Smirking Face"},{code:"1f623",desc:"Persevering Face"},{code:"1f625",desc:"Disappointed but Relieved Face"},{code:"1f62e",desc:"Face with Open Mouth"},{code:"1f62f",desc:"Hushed Face"},{code:"1f62a",desc:"Sleepy Face"},{code:"1f62b",desc:"Tired Face"},{code:"1f634",desc:"Sleeping Face"},{code:"1f60c",desc:"Relieved Face"},{code:"1f61b",desc:"Face with Stuck-out Tongue"},{code:"1f61c",desc:"Face with Stuck-out Tongue and Winking Eye"},{code:"1f61d",desc:"Face with Stuck-out Tongue and Tightly-Closed Eyes"},{code:"1f612",desc:"Unamused Face"},{code:"1f613",desc:"Face with Cold Sweat"},{code:"1f613",desc:"Face with Cold Sweat"},{code:"1f614",desc:"Pensive Face"},{code:"1f615",desc:"Confused Face"},{code:"1f632",desc:"Astonished Face"},{code:"1f616",desc:"Confounded Face"},{code:"1f61e",desc:"Disappointed Face"},{code:"1f61f",desc:"Worried Face"},{code:"1f624",desc:"Face with Look of Triumph"},{code:"1f622",desc:"Crying Face"},{code:"1f62d",desc:"Loudly Crying Face"},{code:"1f626",desc:"Frowning Face with Open Mouth"},{code:"1f627",desc:"Anguished Face"},{code:"1f628",desc:"Fearful Face"},{code:"1f629",desc:"Weary Face"},{code:"1f62c",desc:"Grimacing Face"},{code:"1f630",desc:"Face with Open Mouth and Cold Sweat"},{code:"1f631",desc:"Face Screaming in Fear"},{code:"1f633",desc:"Flushed Face"},{code:"1f635",desc:"Dizzy Face"},{code:"1f621",desc:"Pouting Face"},{code:"1f620",desc:"Angry Face"},{code:"1f637",desc:"Face with Medical Mask"},{code:"1f607",desc:"Smiling Face with Halo"},{code:"1f608",desc:"Smiling Face with Horns"},{code:"1f47f",desc:"Imp"},{code:"1f479",desc:"Japanese Ogre"},{code:"1f47a",desc:"Japanese Goblin"},{code:"1f480",desc:"Skull"},{code:"1f47b",desc:"Ghost"},{code:"1f47d",desc:"Extraterrestrial Alien"},{code:"1f47e",desc:"Alien Monster"},{code:"1f4a9",desc:"Pile of Poo"},{code:"1f63a",desc:"Smiling Cat Face with Open Mouth"},{code:"1f638",desc:"Grinning Cat Face with Smiling Eyes"},{code:"1f639",desc:"Cat Face with Tears of Joy"},{code:"1f63b",desc:"Smiling Cat Face with Heart-Shaped Eyes"},{code:"1f63c",desc:"Cat Face with Wry Smile"},{code:"1f63d",desc:"Kissing Cat Face with Closed Eyes"},{code:"1f640",desc:"Weary Cat Face"},{code:"1f63f",desc:"Crying Cat Face"},{code:"1f63e",desc:"Pouting Cat Face"},{code:"1f648",desc:"See-No-Evil Monkey"},{code:"1f649",desc:"Hear-No-Evil Monkey"},{code:"1f64a",desc:"Speak-No-Evil Monkey"},{code:"1f476",desc:"Baby"},{code:"1f466",desc:"Boy"},{code:"1f467",desc:"Girl"},{code:"1f468",desc:"Man"},{code:"1f469",desc:"Woman"},{code:"1f474",desc:"Older Man"},{code:"1f475",desc:"Older Woman"},{code:"1f46e",desc:"Police Officer"},{code:"1f482",desc:" Guardsman"},{code:"1f477",desc:" Construction Worker"},{code:"1f478",desc:"Princess"},{code:"1f473",desc:"Man with Turban"},{code:"1f472",desc:"Man with Gua Pi Mao"},{code:"1f471",desc:"Person with Blond Hair"},{code:"1f470",desc:"Bride with Veil"},{code:"1f47c",desc:"Baby Angel"},{code:"1f385",desc:"Father Christmas"},{code:"1f64e",desc:"Person with Pouting Face"},{code:"1f645",desc:"Face with No Good Gesture"},{code:"1f646",desc:"Face with Ok Gesture"},{code:"1f481",desc:"Information Desk Person"},{code:"1f64b",desc:"Happy Person Raising One Hand"},{code:"1f647",desc:"Person Bowing Deeply"},{code:"1f486",desc:"Face Massage"},{code:"1f487",desc:"Haircut"},{code:"1f6b6",desc:"Pedestrian"},{code:"1f3c3",desc:"Runner"},{code:"1f483",desc:"Dancer"},{code:"1f46f",desc:"Woman with Bunny Ears"},{code:"1f6c0",desc:"Bath"},{code:"1f464",desc:"Bust in Silhouette"},{code:"1f465",desc:"Busts in Silhouette"},{code:"1f3c7",desc:"Horse Racing"},{code:"1f3c2",desc:" Snowboarder"},{code:"1f3c4",desc:" Surfer"},{code:"1f6a3",desc:" Rowboat"},{code:"1f3ca",desc:" Swimmer"},{code:"1f6b4",desc:" Bicyclist"},{code:"1f6b5",desc:"Mountain Bicyclist"},{code:"1f46b",desc:" Man and Woman Holding Hands"},{code:"1f46c",desc:"Two Men Holding Hands"},{code:"1f46d",desc:"Two Women Holding Hands"},{code:"1f48f",desc:"Kiss"},{code:"1f468-2764-1f48b-1f468",uCode:"\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68",desc:"Man Kiss Man"},{code:"1f469-2764-1f48b-1f469",uCode:"\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69",desc:"Woman Kiss Woman"},{code:"1f491",desc:"Couple with Heart"},{code:"1f468-2764-1f468",uCode:"\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68",desc:"Man Heart Man"},{code:"1f469-2764-1f469",uCode:"\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69",desc:"Woman Heart Woman"},{code:"1f46a",desc:"Family"},{code:"1f468",desc:"Man Woman Boy"},{code:"1f468-1f469-1f467",desc:"Man Woman Girl"},{code:"1f468-1f469-1f467-1f466",desc:"Man Woman Girl Boy"},{code:"1f468-1f469-1f466-1f466",desc:"Man Woman Boy Boy"},{code:"1f468-1f469-1f467-1f467",desc:"Man Woman Girl Girl"},{code:"1f468-1f468-1f466",desc:"Man Man Boy"},{code:"1f468-1f468-1f467",desc:"Man Man Girl"},{code:"1f468-1f468-1f467-1f466",desc:"Man Man Girl Boy"},{code:"1f468-1f468-1f466-1f466",desc:"Man Man Boy Boy"},{code:"1f469-1f469-1f466",desc:"Woman Woman Boy"},{code:"1f469-1f469-1f467",desc:"Woman Woman Girl"},{code:"1f469-1f469-1f467-1f466",desc:"Woman Woman Girl Boy"},{code:"1f469-1f469-1f467-1f467",desc:"Woman Woman Girl Girl"},{code:"1f4aa",desc:"Flexed Biceps"},{code:"1f448",desc:"White Left Pointing Backhand Index"},{code:"1f449",desc:"White Right Pointing Backhand Index"},{code:"1f446",desc:"White Up Pointing Backhand Index"},{code:"1f447",desc:"White Down Pointing Backhand Index"},{code:"270c",desc:"Victory Hand"},{code:"270b",desc:"Raised Hand"},{code:"1f44c",desc:"Ok Hand Sign"},{code:"1f44d",desc:"Thumbs Up Sign"},{code:"1f44e",desc:"Thumbs Down Sign"},{code:"270a",desc:"Raised Fist"},{code:"1f44a",desc:"Fisted Hand Sign"},{code:"1f44b",desc:"Waving Hand Sign"},{code:"1f44f",desc:"Clapping Hands Sign"},{code:"1f450",desc:"Open Hands Sign"},{code:"1f64c",desc:"Person Raising Both Hands in Celebration"},{code:"1f64f",desc:"Person with Folded Hands"},{code:"1f485",desc:"Nail Polish"},{code:"1f442",desc:"Ear"},{code:"1f443",desc:"Nose"},{code:"1f463",desc:"Footprints"},{code:"1f440",desc:"Eyes"},{code:"1f445",desc:"Tongue"},{code:"1f444",desc:"Mouth"},{code:"1f48b",desc:"Kiss Mark"},{code:"1f498",desc:"Heart with Arrow"},{code:"2764",desc:"Heavy Black Heart"},{code:"1f493",desc:"Heavy Black Heart"},{code:"1f494",desc:"Broken Heart"},{code:"1f495",desc:"Two Hearts"},{code:"1f496",desc:"Sparkling Hearts"},{code:"1f497",desc:"Growing Hearts"},{code:"1f499",desc:"Blue Heart"},{code:"1f49a",desc:"Green Heart"},{code:"1f49b",desc:"Yellow Heart"},{code:"1f49c",desc:"Purple Heart"},{code:"1f49d",desc:"Heart with Ribbon"},{code:"1f49e",desc:"Revolving Hearts"},{code:"1f49f",desc:"Heart Decoration"},{code:"1f48c",desc:"Love Letter"},{code:"1f4a4",desc:"Sleeping Symbol"},{code:"1f4a2",desc:"Anger Symbol"},{code:"1f4a3",desc:"Bomb"},{code:"1f4a5",desc:"Collision Symbol"},{code:"1f4a6",desc:"Splashing Sweat Symbol"},{code:"1f4a8",desc:"Dash Symbol"},{code:"1f4ab",desc:"Dizzy Symbol"},{code:"1f4ab",desc:"Dizzy Symbol"},{code:"1f4ac",desc:"Speech Balloon"},{code:"1f4ad",desc:"Thought Balloon"},{code:"1f453",desc:"Eyeglasses"},{code:"1f454",desc:"Necktie"},{code:"1f455",desc:"T-Shirt"},{code:"1f456",desc:"Jeans"},{code:"1f457",desc:"Dress"},{code:"1f458",desc:"Kimono"},{code:"1f459",desc:"Bikini"},{code:"1f45a",desc:"Womans Clothes"},{code:"1f45b",desc:"Purse"},{code:"1f45c",desc:"Handbag"},{code:"1f45d",desc:"Pouch"},{code:"1f392",desc:"School Satchel"},{code:"1f45e",desc:"Mans Shoe"},{code:"1f45f",desc:"Athletic Shoe"},{code:"1f460",desc:"High-Heeled Shoe"},{code:"1f461",desc:"Womans Sandal"},{code:"1f462",desc:"Womans Boots"},{code:"1f451",desc:"Crown"},{code:"1f452",desc:"Womans Hat"},{code:"1f462",desc:"Top Hat"},{code:"1f393",desc:"Graduation Cap"},{code:"1f484",desc:"Lipstick"},{code:"1f48d",desc:"Ring"},{code:"1f48e",desc:"Gem Stone"}]},{id:"nature",name:"Animals & Nature",code:"1F435",emoticons:[{code:"1F435",desc:"Monkey Face"},{code:"1F412",desc:"Monkey"},{code:"1F436",desc:"Dog Face"},{code:"1F415",desc:"Dog"},{code:"1F429",desc:"Poodle"},{code:"1F43A",desc:"Wolf Face"},{code:"1F431",desc:"Cat Face"},{code:"1F408",desc:"Cat"},{code:"1F42F",desc:"Tiger Face"},{code:"1F405",desc:"Tiger"},{code:"1F406",desc:"Leopard"},{code:"1F434",desc:"Horse Face"},{code:"1F40E",desc:"Horse"},{code:"1F42E",desc:"Cow Face"},{code:"1F402",desc:"Ox"},{code:"1F403",desc:"Water Buffalo"},{code:"1F404",desc:"Cow"},{code:"1F437",desc:"Pig Face"},{code:"1F416",desc:"Pig"},{code:"1F417",desc:"Boar"},{code:"1F43D",desc:"Pig Nose"},{code:"1F40F",desc:"Ram"},{code:"1F411",desc:"Sheep"},{code:"1F410",desc:"Goat"},{code:"1F42A",desc:"Dromedary Camel"},{code:"1F42B",desc:"Bactrian Camel"},{code:"1F418",desc:"Elephant"},{code:"1F42D",desc:"Mouse Face"},{code:"1F401",desc:"Mouse"},{code:"1F400",desc:"Rat"},{code:"1F439",desc:"Hamster Face"},{code:"1F430",desc:"Rabbit Face"},{code:"1F407",desc:"Rabbit"},{code:"1F43B",desc:"Bear Face"},{code:"1F428",desc:"Koala"},{code:"1F43C",desc:"Panda Face"},{code:"1F43E",desc:"Paw Prints"},{code:"1F414",desc:"Chicken"},{code:"1F413",desc:"Rooster"},{code:"1F423",desc:"Hatching Chick"},{code:"1F424",desc:"Baby Chick"},{code:"1F425",desc:"Front-Facing Baby Chick"},{code:"1F426",desc:"Bird"},{code:"1F427",desc:"Penguin"},{code:"1F438",desc:"Frog Face"},{code:"1F40A",desc:"Crocodile"},{code:"1F422",desc:"Turtle"},{code:"1F40D",desc:"Snake"},{code:"1F432",desc:"Dragon Face"},{code:"1F409",desc:"Dragon"},{code:"1F433",desc:"Spouting Whale"},{code:"1F40B",desc:"Whale"},{code:"1F42C",desc:"Dolphin"},{code:"1F41F",desc:"Fish"},{code:"1F420",desc:"Tropical Fish"},{code:"1F421",desc:"Blowfish"},{code:"1F419",desc:"Octopus"},{code:"1F41A",desc:"Spiral Shell"},{code:"1F40C",desc:"Snail"},{code:"1F41B",desc:"Bug"},{code:"1F41C",desc:"Ant"},{code:"1F41D",desc:"Honeybee"},{code:"1F41E",desc:"Lady Beetle"},{code:"1F490",desc:"Bouquet"},{code:"1F338",desc:"Cherry Blossom"},{code:"1F4AE",desc:"White Flower"},{code:"1F339",desc:"Rose"},{code:"1F33A",desc:"Hibiscus"},{code:"1F33B",desc:"Sunflower"},{code:"1F33C",desc:"Blossom"},{code:"1F337",desc:"Tulip"},{code:"1F331",desc:"Seedling"},{code:"1F332",desc:"Evergreen Tree"},{code:"1F333",desc:"Deciduous Tree"},{code:"1F334",desc:"Palm Tree"},{code:"1F335",desc:"Cactus"},{code:"1F33E",desc:"Ear of Rice"},{code:"1F33F",desc:"Herb"},{code:"2618",desc:"Four Leaf Clover"},{code:"1F341",desc:"Maple Leaf"},{code:"1F342",desc:"Fallen Leaf"},{code:"1F343",desc:"Leaf Fluttering in Wind"}]},{id:"foods",name:"Food & Drink",code:"1F347",emoticons:[{code:"1F347",desc:"Grapes"},{code:"1F348",desc:"Melon"},{code:"1F349",desc:"Watermelon"},{code:"1F34A",desc:"Tangerine"},{code:"1F34B",desc:"Lemon"},{code:"1F34C",desc:"Banana"},{code:"1F34D",desc:"Pineapple"},{code:"1F34E",desc:"Red Apple"},{code:"1F34F",desc:"Green Apple"},{code:"1F350",desc:"Pear"},{code:"1F351",desc:"Peach"},{code:"1F352",desc:"Cherries"},{code:"1F353",desc:"Strawberry"},{code:"1F345",desc:"Tomato"},{code:"1F346",desc:"Aubergine"},{code:"1F33D",desc:"Ear of Maize"},{code:"1F344",desc:"Mushroom"},{code:"1F330",desc:"Chestnut"},{code:"1F35E",desc:"Bread"},{code:"1F356",desc:"Meat on Bone"},{code:"1F357",desc:"Poultry Leg"},{code:"1F354",desc:"Hamburger"},{code:"1F35F",desc:"French Fries"},{code:"1F355",desc:"Slice of Pizza"},{code:"1F373",desc:"Cooking"},{code:"1F372",desc:"Pot of Food"},{code:"1F371",desc:"Bento Box"},{code:"1F358",desc:"Rice Cracker"},{code:"1F359",desc:"Rice Ball"},{code:"1F35A",desc:"Cooked Rice"},{code:"1F35B",desc:"Curry and Rice"},{code:"1F35C",desc:"Steaming Bowl"},{code:"1F35D",desc:"Spaghetti"},{code:"1F360",desc:"Roasted Sweet Potato"},{code:"1F362",desc:"Oden"},{code:"1F363",desc:"Sushi"},{code:"1F364",desc:"Fried Shrimp"},{code:"1F365",desc:"Fish Cake with Swirl Design"},{code:"1F361",desc:"Dango"},{code:"1F366",desc:"Soft Ice Cream"},{code:"1F367",desc:"Shaved Ice"},{code:"1F368",desc:"Ice Cream"},{code:"1F369",desc:"Doughnut"},{code:"1F36A",desc:"Cookie"},{code:"1F382",desc:"Birthday Cake"},{code:"1F370",desc:"Shortcake"},{code:"1F36B",desc:"Chocolate Bar"},{code:"1F36C",desc:"Candy"},{code:"1F36D",desc:"Lollipop"},{code:"1F36E",desc:"Custard"},{code:"1F36F",desc:"Honey Pot"},{code:"1F37C",desc:"Baby Bottle"},{code:"2615",desc:"Hot Beverage"},{code:"1F375",desc:"Teacup Without Handle"},{code:"1F376",desc:"Sake Bottle and Cup"},{code:"1F377",desc:"Wine Glass"},{code:"1F378",desc:"Cocktail Glass"},{code:"1F379",desc:"Tropical Drink"},{code:"1F37A",desc:"Beer Mug"},{code:"1F37B",desc:"Clinking Beer Mugs"},{code:"1F374",desc:"Fork and Knife"},{code:"1F52A",desc:"Hocho"}]},{id:"activity",name:"Activities",code:"1f383",emoticons:[{code:"1f383",desc:" Jack-O-Lantern"},{code:"1f384",desc:"Christmas Tree"},{code:"1f386",desc:" Fireworks"},{code:"1f387",desc:"Firework Sparkler"},{code:"2728",desc:" Sparkles"},{code:"1f388",desc:"Balloon"},{code:"1f389",desc:"Party Popper"},{code:"1f38a",desc:"Confetti Ball"},{code:"1f38b",desc:"Tanabata Tree"},{code:"1f38d",desc:"Pine Decoration"},{code:"1f38e",desc:"Japanese Dolls"},{code:"1f38f",desc:"Carp Streamer"},{code:"1f390",desc:"Wind Chime"},{code:"1f391",desc:"Moon Viewing Ceremony"},{code:"1f380",desc:"Ribbon"},{code:"1f381",desc:"Wrapped Present"},{code:"1f3ab",desc:"Ticket"},{code:"1f3c6",desc:"Trophy"},{code:"1f388",desc:"Balloon"},{code:"26bd",desc:"Soccer Ball"},{code:"26be",desc:"Baseball"},{code:"1f3c0",desc:"Basketball and Hoop"},{code:"1f3c8",desc:"American Football"},{code:"1f3c9",desc:"Rugby Football"},{code:"1f3be",desc:"Tennis Racquet and Ball"},{code:"1f3b1",desc:"Billiards"},{code:"1f3b3",desc:"Bowling"},{code:"1f3af",desc:"Direct Hit"},{code:"26f3",desc:"Flag in Hole"},{code:"1f3a3",desc:"Fishing Pole and Fish"},{code:"1f3bd",desc:"Running Shirt with Sash"},{code:"1f3bf",desc:"Ski and Ski Boot"},{code:"1f3ae",desc:"Video Game"},{code:"1f3b2",desc:"Game Die"},{code:"2660",desc:"Black Spade Suit"},{code:"2665",desc:"Black Heart SuiT"},{code:"2666",desc:"Black Diamond Suit"},{code:"2663",desc:"Black Club Suit"},{code:"1f0cf",desc:"Playing Card Black Joker"},{code:"1f004",desc:"Mahjong Tile Red Dragon"},{code:"1f3b4",desc:"Flower Playing Cards"}]},{id:"places",name:"Travel & Places",code:"1f30d",emoticons:[{code:"1f30d",desc:"Earth Globe Europe-Africa"},{code:"1f30e",desc:"Earth Globe Americas"},{code:"1f30f",desc:"Earth Globe Asia-Australia"},{code:"1f310",desc:"Globe with Meridians"},{code:"1f5fe",desc:"Silhouette of Japan"},{code:"1f30b",desc:"Volcano"},{code:"1f5fb",desc:"Mount Fuji"},{code:"1f3e0",desc:"House Building"},{code:"1f3e1",desc:"House with Garden"},{code:"1f3e2",desc:"Office Building"},{code:"1f3e3",desc:"Japanese Post Office"},{code:"1f3e4",desc:"European Post Office"},{code:"1f3e5",desc:"Hospital"},{code:"1f3e6",desc:"Bank"},{code:"1f3e8",desc:"Hotel"},{code:"1f3e9",desc:"Love Hotel"},{code:"1f3ea",desc:"Convenience Store"},{code:"1f3eb",desc:"School"},{code:"1f3ec",desc:"Department Store"},{code:"1f3ed",desc:"Factory"},{code:"1f3ef",desc:"Japanese Castle"},{code:"1f3f0",desc:"European Castle"},{code:"1f492",desc:"Wedding"},{code:"1f5fc",desc:"Tokyo Tower"},{code:"1f5fd",desc:"Statue of Liberty"},{code:"26ea",desc:"Church"},{code:"26f2",desc:"Fountain"},{code:"26fa",desc:"Tent"},{code:"1f301",desc:"Foggy"},{code:"1f303",desc:"Night with Stars"},{code:"1f304",desc:"Sunrise over Mountains"},{code:"1f305",desc:"Sunrise"},{code:"1f306",desc:"Cityscape at Dusk"},{code:"1f307",desc:"Sunset over Buildings"},{code:"1f309",desc:"Bridge at Night"},{code:"2668",desc:"Hot Springs"},{code:"1f30c",desc:"Milky Way"},{code:"1f3a0",desc:"Carousel Horse"},{code:"1f3a1",desc:"Ferris Wheel"},{code:"1f3a2",desc:"Roller Coaster"},{code:"1f488",desc:"Barber Pole"},{code:"1f3aa",desc:"Circus Tent"},{code:"1f3ad",desc:"Performing Arts"},{code:"1f3a8",desc:"Artist Palette"},{code:"1f3b0",desc:"Slot Machine"},{code:"1f682",desc:"Steam Locomotive"},{code:"1f683",desc:"Railway Car"},{code:"1f684",desc:"High-Speed Train"},{code:"1f685",desc:"High-Speed Train with Bullet Nose"},{code:"1f686",desc:"Train"},{code:"1f687",desc:"Metro"},{code:"1f688",desc:"Light Rail"},{code:"1f689",desc:"Station"},{code:"1f68a",desc:"Tram"},{code:"1f69d",desc:"Monorail"},{code:"1f69e",desc:"Mountain Railway"},{code:"1f68b",desc:"Tram Car"},{code:"1f68c",desc:"Bus"},{code:"1f68d",desc:"Oncoming Bus"},{code:"1f68e",desc:"Trolleybus"},{code:"1f690",desc:"Minibus"},{code:"1f691",desc:"Ambulance"},{code:"1f692",desc:"Fire Engine"},{code:"1f693",desc:"Police Car"},{code:"1f694",desc:"Oncoming Police Car"},{code:"1f695",desc:"Taxi"},{code:"1f695",desc:"Oncoming Taxi"},{code:"1f697",desc:"Automobile"},{code:"1f698",desc:"Oncoming Automobile"},{code:"1f699",desc:"Recreational Vehicle"},{code:"1f69a",desc:"Delivery Truck"},{code:"1f69b",desc:"Articulated Lorry"},{code:"1f69c",desc:"Tractor"},{code:"1f6b2",desc:"Bicycle"},{code:"1f68f",desc:"Bus Stop"},{code:"26fd",desc:"Fuel Pump"},{code:"1f6a8",desc:"Police Cars Revolving Light"},{code:"1f6a5",desc:"Horizontal Traffic Light"},{code:"1f6a6",desc:"Vertical Traffic Light"},{code:"1f6a7",desc:"Construction Sign"},{code:"2693",desc:"Anchor"},{code:"26f5",desc:"Sailboat"},{code:"1f6a4",desc:"Speedboat"},{code:"1f6a2",desc:"Ship"},{code:"2708",desc:"Airplane"},{code:"1f4ba",desc:"Seat"},{code:"1f681",desc:"Helicopter"},{code:"1f69f",desc:"Suspension Railway"},{code:"1f6a0",desc:"Mountain Cableway"},{code:"1f6a1",desc:"Aerial Tramway"},{code:"1f680",desc:"Rocket"},{code:"1f6aa",desc:"Door"},{code:"1f6bd",desc:"Toilet"},{code:"1f6bf",desc:"Shower"},{code:"1f6c1",desc:"Bathtub"},{code:"231b",desc:"Hourglass"},{code:"23f3",desc:"Hourglass with Flowing Sand"},{code:"231a",desc:"Watch"},{code:"23f0",desc:"Alarm Clock"},{code:"1f55b",desc:"Clock Face Twelve Oclock"},{code:"1f567",desc:"Clock Face Twelve-Thirty"},{code:"1f550",desc:"Clock Face One Oclock"},{code:"1f55c",desc:"Clock Face One-thirty"},{code:"1f551",desc:"Clock Face Two Oclock"},{code:"1f55d",desc:"Clock Face Two-thirty"},{code:"1f552",desc:"Clock Face Three Oclock"},{code:"1f55e",desc:"Clock Face Three-thirty"},{code:"1f553",desc:"Clock Face Four Oclock"},{code:"1f55f",desc:"Clock Face Four-thirty"},{code:"1f554",desc:"Clock Face Five Oclock"},{code:"1f560",desc:"Clock Face Five-thirty"},{code:"1f555",desc:"Clock Face Six Oclock"},{code:"1f561",desc:"Clock Face Six-thirty"},{code:"1f556",desc:"Clock Face Seven Oclock"},{code:"1f562",desc:"Clock Face Seven-thirty"},{code:"1f557",desc:"Clock Face Eight Oclock"},{code:"1f563",desc:"Clock Face Eight-thirty"},{code:"1f558",desc:"Clock Face Nine Oclock"},{code:"1f564",desc:"Clock Face Nine-thirty"},{code:"1f559",desc:"Clock Face Ten Oclock"},{code:"1f565",desc:"Clock Face Ten-thirty"},{code:"1f55a",desc:"Clock Face Eleven Oclock"},{code:"1f566",desc:"Clock Face Eleven-thirty"},{code:"1f311",desc:"New Moon Symbol"},{code:"1f312",desc:"Waxing Crescent Moon Symbol"},{code:"1f313",desc:"First Quarter Moon Symbol"},{code:"1f314",desc:"Waxing Gibbous Moon Symbol"},{code:"1f315",desc:"Full Moon Symbol"},{code:"1f316",desc:"Waning Gibbous Moon Symbol"},{code:"1f317",desc:"Last Quarter Moon Symbol"},{code:"1f318",desc:"Waning Crescent Moon Symbol"},{code:"1f319",desc:"Crescent Moon"},{code:"1f31a",desc:"New Moon with Face"},{code:"1f31b",desc:"First Quarter Moon with Face"},{code:"1f31c",desc:"Last Quarter Moon with Face"},{code:"2600",desc:"Black Sun with Rays"},{code:"1f31d",desc:"Full Moon with Face"},{code:"1f31e",desc:"Sun with Face"},{code:"2b50",desc:"White Medium Star"},{code:"1f31f",desc:"Glowing Star"},{code:"1f320",desc:"Shooting Star"},{code:"2601",desc:"Cloud"},{code:"26c5",desc:"Sun Behind Cloud"},{code:"1f300",desc:"Cyclone"},{code:"1f308",desc:"Rainbow"},{code:"1f302",desc:"Closed Umbrella"},{code:"2614",desc:"Umbrella with Rain Drops"},{code:"26a1",desc:"High Voltage Sign"},{code:"2744",desc:"Snowflake"},{code:"2603",desc:"Snowman Without Snow"},{code:"1f525",desc:"Fire"},{code:"1f4a7",desc:"Droplet"},{code:"1F30A",desc:"Water Wave"}]},{id:"objects",name:"Objects",code:"1F507",emoticons:[{code:"1F507",desc:"Speaker with Cancellation Stroke"},{code:"1F508",desc:"Speaker"},{code:"1F509",desc:"Speaker with One Sound Wave"},{code:"1F50A",desc:"Speaker with Three Sound Wave"},{code:"1F4E2",desc:"Public Address Loudspeaker"},{code:"1F4E3",desc:"Cheering Megaphone"},{code:"1F4EF",desc:"Postal Horn"},{code:"1F514",desc:"Bell"},{code:"1F515",desc:"Bell with Cancellation Stroke"},{code:"1F3BC",desc:"Musical Score"},{code:"1F3B5",desc:"Musical Note"},{code:"1F3B6",desc:"Multiple Musical Notes"},{code:"1F3A4",desc:"Microphone"},{code:"1F3A7",desc:"Headphone"},{code:"1F4FB",desc:"Radio"},{code:"1F3B7",desc:"Saxophone"},{code:"1F3B8",desc:"Guitar"},{code:"1F3B9",desc:"Musical Keyboard"},{code:"1F3BA",desc:"Trumpet"},{code:"1F3BB",desc:"Violin"},{code:"1F4F1",desc:"Mobile Phone"},{code:"1F4F2",desc:"Mobile Phone with Rightwards Arrow at Left"},{code:"260E",desc:"Black Telephone"},{code:"1F4DE",desc:"Telephone Receiver"},{code:"1F4DF",desc:"Pager"},{code:"1F4E0",desc:"Fax Machine"},{code:"1F50B",desc:"Battery"},{code:"1F50C",desc:"Electric Plug"},{code:"1F4BB",desc:"Personal Computer"},{code:"1F4BD",desc:"Minidisc"},{code:"1F4BE",desc:"Floppy Disk"},{code:"1F4BF",desc:"Optical Disk"},{code:"1F4C0",desc:"Dvd"},{code:"1F3A5",desc:"Movie Camera"},{code:"1F3AC",desc:"Clapper Board"},{code:"1F4FA",desc:"Television"},{code:"1F4F7",desc:"Camera"},{code:"1F4F9",desc:"Video Camera"},{code:"1F4FC",desc:"Videocassette"},{code:"1F50D",desc:"Left-Pointing Magnifying Glass"},{code:"1F50E",desc:"Right-Pointing Magnifying Glass"},{code:"1F52C",desc:"Microscope"},{code:"1F52D",desc:"Telelscope"},{code:"1F4E1",desc:"Satellite Antenna"},{code:"1F4A1",desc:"Electric Light Bulb"},{code:"1F526",desc:"Electric Torch"},{code:"1F3EE",desc:"Izakaya Lantern"},{code:"1F4D4",desc:"Notebook with Decorative Cover"},{code:"1F4D5",desc:"Closed Book"},{code:"1F4D6",desc:"Open Book"},{code:"1F4D7",desc:"Green Book"},{code:"1F4D8",desc:"Blue Book"},{code:"1F4D9",desc:"Orange Book"},{code:"1F4DA",desc:"Books"},{code:"1F4D3",desc:"Notebook"},{code:"1F4D2",desc:"Ledger"},{code:"1F4C3",desc:"Curl"},{code:"1F4DC",desc:"Scroll"},{code:"1F4C4",desc:"Page Facing Up"},{code:"1F4F0",desc:"Newspaper"},{code:"1F4D1",desc:"Bookmark Tabs"},{code:"1F516",desc:"Bookmark"},{code:"1F4B0",desc:"Money Bag"},{code:"1F4B4",desc:"Banknote with Yen Sign"},{code:"1F4B5",desc:"Banknote with Dollar Sign"},{code:"1F4B6",desc:"Banknote with Euro Sign"},{code:"1F4B7",desc:"Banknote with Pound Sign"},{code:"1F4B8",desc:"Money with Wings"},{code:"1F4B3",desc:"Credit Card"},{code:"1F4B9",desc:"Chart with Upwards Trend and Yen Sign"},{code:"1F4B1",desc:"Currency Exchange"},{code:"1F4B2",desc:"Heavy Dollar Sign"},{code:"2709",desc:"Envelope"},{code:"1F4E7",desc:"E-Mail Symbol"},{code:"1F4E8",desc:"Incoming Envelope"},{code:"1F4E9",desc:"Envelope with Downwards Arrow Above"},{code:"1F4E4",desc:"Outbox Tray"},{code:"1F4E5",desc:"Inbox Tray"},{code:"1F4E6",desc:"Package"},{code:"1F4BE",desc:"Closed Mailbox with Raised Flag"},{code:"1F4EA",desc:"Closed Mailbox with Lowered Flag"},{code:"1F4EC",desc:"Open Mailbox with Raised Flag"},{code:"1F4ED",desc:"Open Mailbox with Lowered Flag"},{code:"1F5F3",desc:"Postbox"},{code:"270F",desc:"Pencil"},{code:"2712",desc:"Black Nib"},{code:"1F4DD",desc:"Memo"},{code:"1F4BC",desc:"Briefcase"},{code:"1F4C1",desc:"File Folder"},{code:"1F4C2",desc:"Open File Folder"},{code:"1F4C5",desc:"Calender"},{code:"1F4C6",desc:"Tear-off Calender"},{code:"1F4C7",desc:"Card Index"},{code:"1F4C8",desc:"Chart with Upwards Trend"},{code:"1F4C9",desc:"Chart with Downwards Trend"},{code:"1F4CA",desc:"Bar Chart"},{code:"1F4CB",desc:"Clipboard"},{code:"1F4CC",desc:"Pushpin"},{code:"1F4CD",desc:"Round Pushpin"},{code:"1F4CE",desc:"Paperclip"},{code:"1F4CF",desc:"Straight Ruler"},{code:"1F4D0",desc:"Triangular Ruler"},{code:"2702",desc:"Black Scissors"},{code:"1F512",desc:"Lock"},{code:"1F513",desc:"Open Lock"},{code:"1F50F",desc:"Lock with Ink Pen"},{code:"1F510",desc:"Closed Lock with Key"},{code:"1F511",desc:"Key"},{code:"1F528",desc:"Hammer"},{code:"1F52B",desc:"Pistol"},{code:"1F527",desc:"Wrench"},{code:"1F529",desc:"Nut and Bolt"},{code:"1F517",desc:"Link Symbol"},{code:"1F489",desc:"Syringe"},{code:"1F48A",desc:"Pill"},{code:"1F6AC",desc:"Smoking Symbol"},{code:"1F5FF",desc:"Moyai"},{code:"1F52E",desc:"Crystal Ball"}]},{id:"symbols",name:"Symbols",code:"1F3E7",emoticons:[{code:"1F3E7",desc:"Automated Teller Machine"},{code:"1F6AE",desc:"Put Litter in Its Place Symbol"},{code:"1F6B0",desc:"Potable Water Symbol"},{code:"267F",desc:"Wheelchair Symbol"},{code:"1F6B9",desc:"Mens Symbol"},{code:"1F6BA",desc:"Womens Symbol"},{code:"1F6BB",desc:"Restroom"},{code:"1F6BC",desc:"Baby Symbol"},{code:"1F6BE",desc:"Water Closet"},{code:"1F6C2",desc:"Passport Control"},{code:"1F6C3",desc:"Customs"},{code:"1F6C4",desc:"Baggage Claim"},{code:"1F6C5",desc:"Left Luggage"},{code:"26A0",desc:"Warning Sign"},{code:"1F6B8",desc:"Children Crossing"},{code:"26D4",desc:"No Entry"},{code:"1F6AB",desc:"No Entry Sign"},{code:"1F6B3",desc:"No Bicycles"},{code:"1F6AD",desc:"No Smoking Symbol"},{code:"1F6AF",desc:"Do Not Litter Symbol"},{code:"1F6B1",desc:"Non-Potable Water Symbol"},{code:"1F6B7",desc:"No Pedestrians"},{code:"1F4F5",desc:"No Mobile Phones"},{code:"1F51E",desc:"No One Under Eighteen Symbol"},{code:"2B06",desc:"Upwards Black Arrow"},{code:"2197",desc:"North East Arrow"},{code:"27A1",desc:"Black Rightwards Arrow"},{code:"2198",desc:"South East Arrow"},{code:"2B07",desc:"Downwards Black Arrow"},{code:"2199",desc:"South West Arrow"},{code:"2B05",desc:"Leftwards Black Arrow"},{code:"2196",desc:"North West Arrow"},{code:"2195",desc:"Up Down Arrow"},{code:"2194",desc:"Left Right Arrow"},{code:"21A9",desc:"Leftwards Arrow with Hook"},{code:"21AA",desc:"Rightwards Arrow with Hook"},{code:"2934",desc:"Arrow Pointing Rightwards Then Curving Upwards"},{code:"2935",desc:"Arrow Pointing Rightwards Then Curving Downwards"},{code:"1F503",desc:"Clockwise Downwards and Upwards Open Circle Arrows"},{code:"1F504",desc:"Anticlockwise Downwards and Upwards Open Circle Arrows"},{code:"1F519",desc:"Back with Leftwards Arrow Above"},{code:"1F51A",desc:"End with Leftwards Arrow Above"},{code:"1F51B",desc:"On with Exclamation Mark with Left Right Arrow Above"},{code:"1F51C",desc:"Soon with Rightwards Arrow Above"},{code:"1F51D",desc:"Top with Upwards Arrow Above"},{code:"1F52F",desc:"Six Pointed Star with Middle Dot"},{code:"2648",desc:"Aries"},{code:"2649",desc:"Taurus"},{code:"264A",desc:"Gemini"},{code:"264B",desc:"Cancer"},{code:"264C",desc:"Leo"},{code:"264D",desc:"Virgo"},{code:"264E",desc:"Libra"},{code:"264F",desc:"Scorpius"},{code:"2650",desc:"Sagittarius"},{code:"2651",desc:"Capricorn"},{code:"2652",desc:"Aquarius"},{code:"2653",desc:"Pisces"},{code:"26CE",desc:"Ophiuchus"},{code:"1F500",desc:"Twisted Rightwards Arrows"},{code:"1F501",desc:"Clockwise Rightwards and Leftwards Open Circle Arrows"},{code:"1F502",desc:"Clockwise Rightwards and Leftwards Open Circle Arrows with Circled One Overlay"},{code:"25B6",desc:"Black Right-Pointing Triangle"},{code:"23E9",desc:"Black Right-Pointing Double Triangle"},{code:"25C0",desc:"Black Left-Pointing Triangle"},{code:"23EA",desc:"Black Left-Pointing Double Triangle"},{code:"1F53C",desc:"Up-Pointing Small Red Triangle"},{code:"23EB",desc:"Black Up-Pointing Double Triangle"},{code:"1F53D",desc:"Down-Pointing Small Red Triangle"},{code:"23EC",desc:"Black Down-Pointing Double Triangle"},{code:"1F3A6",desc:"Cinema"},{code:"1F505",desc:"Low Brightness Symbol"},{code:"1F506",desc:"High Brightness Symbol"},{code:"1F4F6",desc:"Antenna with Bars"},{code:"1F4F3",desc:"Vibration Mode"},{code:"1F4F4",desc:"Mobile Phone off"},{code:"267B",desc:"Black Universal Recycling Symbol"},{code:"1F531",desc:"Trident Emblem"},{code:"1F4DB",desc:"Name Badge"},{code:"1F530",desc:"Japanese Symbol for Beginner"},{code:"2B55",desc:"Heavy Large Circle"},{code:"2705",desc:"White Heavy Check Mark"},{code:"2611",desc:"Ballot Box with Check"},{code:"2714",desc:"Heavy Check Mark"},{code:"2716",desc:"Heavy Multiplication X"},{code:"274C",desc:"Cross Mark"},{code:"274E",desc:"Negative Squared Cross Mark"},{code:"2795",desc:"Heavy Plus Sign"},{code:"2796",desc:"Heavy Minus Sign"},{code:"2797",desc:"Heavy Division Sign"},{code:"27B0",desc:"Curly Loop"},{code:"27BF",desc:"Double Curly Loop"},{code:"303D",desc:"Part Alternation Mark"},{code:"2733",desc:"Eight Spoked Asterisk"},{code:"2734",desc:"Eight Pointed Black Star"},{code:"2747",desc:"Sparkle"},{code:"203C",desc:"Double Exclamation Mark"},{code:"2049",desc:"Exclamation Question Mark"},{code:"2753",desc:"Black Question Mark Ornament"},{code:"2754",desc:"White Question Mark Ornament"},{code:"2755",desc:"White Exclamation Mark Ornament"},{code:"2757",desc:"Heavy Exclamation Mark Symbol"},{code:"3030",desc:"Wavy Dash"},{code:"2122",desc:"Trade Mark Sign"},{code:"1F51F",desc:"Keycap Ten"},{code:"1F4AF",desc:"Hundred Points Symbol"},{code:"1F520",desc:"Input Symbol for Latin Capital Letters"},{code:"1F521",desc:"Input Symbol for Latin Small Letters"},{code:"1F522",desc:"Input Symbol for Numbers"},{code:"1F523",desc:"Input Symbol for Symbols"},{code:"1F524",desc:"Input Symbol for Latin Letters"},{code:"1F170",desc:"Negative Squared Latin Capital Letter a"},{code:"1F18E",desc:"Negative Squared Ab"},{code:"1F171",desc:"Negative Squared Latin Capital Letter B"},{code:"1F191",desc:"Squared Cl"},{code:"1F192",desc:"Squared Cool"},{code:"1F193",desc:"Squared Free"},{code:"2139",desc:"Information Source"},{code:"1F194",desc:"Squared Id"},{code:"24C2",desc:"Circled Latin Capital Letter M"},{code:"1F195",desc:"Squared New"},{code:"1F196",desc:"Squared Ng"},{code:"1F17E",desc:"Negative Squared Latin Capital Letter O"},{code:"1F197",desc:"Squared Ok"},{code:"1F17F",desc:"Negative Squared Latin Capital Letter P"},{code:"1F198",desc:"Squared Sos"},{code:"1F199",desc:"Squared Up with Exclamation Mark"},{code:"1F19A",desc:"Squared Vs"},{code:"1F201",desc:"Squared Katakana Koko"},{code:"1F202",desc:"Squared Katakana Sa"},{code:"1F237",desc:"Squared Cjk Unified Ideograph-6708"},{code:"1F236",desc:"Squared Cjk Unified Ideograph-6709"},{code:"1F22F",desc:"Squared Cjk Unified Ideograph-6307"},{code:"1F250",desc:"Circled Ideograph Advantage"},{code:"1F239",desc:"Squared Cjk Unified Ideograph-5272"},{code:"1F21A",desc:"Squared Cjk Unified Ideograph-7121"},{code:"1F232",desc:"Squared Cjk Unified Ideograph-7981"},{code:"1F251",desc:"Circled Ideograph Accept"},{code:"1F238",desc:"Squared Cjk Unified Ideograph-7533"},{code:"1F234",desc:"Squared Cjk Unified Ideograph-5408"},{code:"1F233",desc:"Squared Cjk Unified Ideograph-7a7a"},{code:"3297",desc:"Circled Ideograph Congratulation"},{code:"3299",desc:"Circled Ideograph Secret"},{code:"1F23A",desc:"Squared Cjk Unified Ideograph-55b6"},{code:"1F235",desc:"Squared Cjk Unified Ideograph-6e80"},{code:"25AA",desc:"Black Small Square"},{code:"25AB",desc:"White Small Square"},{code:"25FB",desc:"White Medium Square"},{code:"25FC",desc:"Black Medium Square"},{code:"25FD",desc:"White Medium Small Square"},{code:"25FE",desc:"Black Medium Small Square"},{code:"2B1B",desc:"Black Large Square"},{code:"2B1C",desc:"White Large Square"},{code:"1F536",desc:"Large Orange Diamond"},{code:"1F537",desc:"Large Blue Diamond"},{code:"1F538",desc:"Small Orange Diamond"},{code:"1F539",desc:"Small Blue Diamond"},{code:"1F53A",desc:"Up-Pointing Red Triangle"},{code:"1F53B",desc:"Down-Pointing Red Triangle"},{code:"1F4A0",desc:"Diamond Shape with a Dot Inside"},{code:"1F518",desc:"Radio Button"},{code:"1F532",desc:"Black Square Button"},{code:"1F533",desc:"White Square Button"},{code:"26AA",desc:"Medium White Circle"},{code:"26AB",desc:"Medium Black Circle"},{code:"1F534",desc:"Large Red Circle"},{code:"1F535",desc:"Large Blue Circle"}]},{id:"flags",name:"Flags",code:"1F3C1",emoticons:[{code:"1f3c1",desc:"Chequered Flag"},{code:"1f1e8-1f1f3",desc:"China Flag"},{code:"1f38c",desc:"Crossed Flags"},{code:"1f1e9-1f1ea",desc:"Germany Flag"},{code:"1f1ea-1f1f8",desc:"Spain Flag"},{code:"1f1e6-1f1e8",desc:"Ascension Island Flag"},{code:"1f1e6-1f1e9",desc:"Andorra Flag"},{code:"1f1e6-1f1ea",desc:"United Arab Emirates Flag"},{code:"1f1e6-1f1eb",desc:"Afghanistan Flag"},{code:"1f1e6-1f1ec",desc:"Antigua & Barbuda Flag"},{code:"1f1e6-1f1ee",desc:"Anguilla Flag"},{code:"1f1e6-1f1f1",desc:"Albania Flag"},{code:"1f1e6-1f1f2",desc:"Armenia Flag"},{code:"1f1e6-1f1f4",desc:"Angola Flag"},{code:"1f1e6-1f1f6",desc:"Antarctica Flag"},{code:"1f1e6-1f1f7",desc:"Argentina Flag"},{code:"1f1e6-1f1f8",desc:"American Samoa Flag"},{code:"1f1e6-1f1f9",desc:"Austria Flag"},{code:"1f1e6-1f1fa",desc:"Australia Flag"},{code:"1f1e6-1f1fc",desc:"Aruba Flag"},{code:"1f1e6-1f1fd",desc:"\xc5land Islands Flag"},{code:"1f1e6-1f1ff",desc:"Azerbaijan Flag"},{code:"1f1e7-1f1e7",desc:"Barbados Flag"},{code:"1f1e7-1f1e9",desc:"Bangladesh Flag"},{code:"1f1e7-1f1ea",desc:"Belgium Flag"},{code:"1f1e7-1f1eb",desc:"Burkina Faso Flag"},{code:"1f1e7-1f1ec",desc:"Bulgaria Flag"},{code:"1f1e7-1f1ed",desc:"Bahrain Flag"},{code:"1f1e7-1f1ee",desc:"Burundi Flag"},{code:"1f1e7-1f1ef",desc:"Benin Flag"},{code:"1f1e7-1f1f1",desc:"St. Barth\xe9lemy Flag"},{code:"1f1e7-1f1f2",desc:"Bermuda Flag"},{code:"1f1e7-1f1f4",desc:"Bolivia Flag"},{code:"1f1e7-1f1f6",desc:"Caribbean Netherlands Flag"},{code:"1f1e7-1f1f7",desc:"Brazil Flag"},{code:"1f1e7-1f1f8",desc:"Bahamas Flag"},{code:"1f1e7-1f1f9",desc:"Bhutan Flag"},{code:"1f1e7-1f1fb",desc:"Bouvet Island Flag"},{code:"1f1e7-1f1fc",desc:"Botswana Flag"},{code:"1f1e7-1f1fe",desc:"Belarus Flag"},{code:"1f1e7-1f1ff",desc:"Belize Flag"},{code:"1f1e8-1f1e6",desc:"Canada Flag"},{code:"1f1e8-1f1e8",desc:"Cocos (keeling) Islands Flag"},{code:"1f1e8-1f1e9",desc:"Congo - Kinshasa Flag"},{code:"1f1e8-1f1eb",desc:"Central African Republic Flag"},{code:"1f1e8-1f1ec",desc:"Congo - Brazzaville Flag"},{code:"1f1e8-1f1ed",desc:"Switzerland Flag"},{code:"1f1e8-1f1ee",desc:"C\xf4te D\u2019ivoire Flag"},{code:"1f1e8-1f1f0",desc:"Cook Islands Flag"},{code:"1f1e8-1f1f1",desc:"Chile Flag"},{code:"1f1e8-1f1f2",desc:"Cameroon Flag"},{code:"1f1e8-1f1f4",desc:"Colombia Flag"},{code:"1f1e8-1f1f7",desc:"Costa Rica Flag"},{code:"1f1e8-1f1fa",desc:"Cuba Flag"},{code:"1f1e8-1f1fb",desc:"Cape Verde Flag"},{code:"1f1e8-1f1fc",desc:"Cura\xe7ao Flag"},{code:"1f1e8-1f1fd",desc:"Christmas Island Flag"},{code:"1f1e8-1f1fe",desc:"Cyprus Flag"},{code:"1f1e8-1f1ff",desc:'Czechia Flag"'},{code:"1f1e9-1f1ec",desc:"Diego Garcia Flag"},{code:"1f1e9-1f1ef",desc:"Djibouti Flag"},{code:"1f1e9-1f1f0",desc:"Denmark Flag"},{code:"1f1e9-1f1f2",desc:"Dominica Flag"},{code:"1f1e9-1f1f4",desc:"Dominican Republic Flag"},{code:"1f1e9-1f1ff",desc:"Algeria Flag"},{code:"1f1ea-1f1e6",desc:"Ceuta & Melilla Flag"},{code:"1f1ea-1f1e8",desc:"Ecuador Flag"},{code:"1f1ea-1f1ea",desc:"Estonia Flag"},{code:"1f1ea-1f1ec",desc:"Egypt Flag"},{code:"1f1ea-1f1ed",desc:"Western Sahara Flag"},{code:"1f1ea-1f1f7",desc:"Eritrea Flag"},{code:"1f1ea-1f1f9",desc:"Ethiopia Flag"},{code:"1f1ea-1f1fa",desc:"European Union Flag"},{code:"1f1eb-1f1ee",desc:"Finland Flag"},{code:"1f1eb-1f1ef",desc:"Fiji Flag"},{code:"1f1eb-1f1f0",desc:"Falkland Islands Flag"},{code:"1f1eb-1f1f2",desc:"Micronesia Flag"},{code:"1f1eb-1f1f4",desc:"Faroe Islands Flag"},{code:"1f1ec-1f1e6",desc:"Gabon Flag"},{code:"1f1ec-1f1e9",desc:"Grenada Flag"},{code:"1f1ec-1f1ea",desc:"Georgia Flag"},{code:"1f1ec-1f1eb",desc:"French Guiana Flag"},{code:"1f1ec-1f1ec",desc:"Guernsey Flag"},{code:"1f1ec-1f1ed",desc:"Ghana Flag"},{code:"1f1ec-1f1ee",desc:"Gibraltar Flag"},{code:"1f1ec-1f1f1",desc:"Greenland Flag"},{code:"1f1ec-1f1f2",desc:"Gambia Flag"},{code:"1f1ec-1f1f3",desc:"Guinea Flag"},{code:"1f1ec-1f1f5",desc:"Guadeloupe Flag"},{code:"1f1ec-1f1f6",desc:"Equatorial Guinea Flag"},{code:"1f1ec-1f1f7",desc:"Greece Flag"},{code:"1f1ec-1f1f8",desc:"South Georgia & South Sandwich Islands Flag"},{code:"1f1ec-1f1f9",desc:"Guatemala Flag"},{code:"1f1ec-1f1fa",desc:"Guam Flag"},{code:"1f1ec-1f1fc",desc:"Guinea-Bissau Flag"},{code:"1f1ec-1f1fe",desc:"Guyana Flag"},{code:"1f1ed-1f1f0",desc:"Hong Kong Sar China Flag"},{code:"1f1ed-1f1f2",desc:"Heard & Mcdonald Islands Flag"},{code:"1f1ed-1f1f3",desc:"Honduras Flag"},{code:"1f1ed-1f1f7",desc:"Croatia Flag"},{code:"1f1ed-1f1f9",desc:"Haiti Flag"},{code:"1f1ed-1f1fa",desc:"Hungary Flag"},{code:"1f1ee-1f1e8",desc:"Canary Islands Flag"},{code:"1f1ee-1f1e9",desc:"Indonesia Flag"},{code:"1f1ee-1f1ea",desc:"Ireland Flag"},{code:"1f1ee-1f1f1",desc:"Israel Flag"},{code:"1f1ee-1f1f2",desc:"Isle of Man Flag"},{code:"1f1ee-1f1f3",desc:"India Flag"},{code:"1f1ee-1f1f4",desc:"British Indian Ocean Territory Flag"},{code:"1f1ee-1f1f6",desc:"Iraq Flag"},{code:"1f1ee-1f1f7",desc:"Iran Flag"},{code:"1f1ee-1f1f8",desc:"Iceland Flag"},{code:"1f1ef-1f1ea",desc:"Jersey Flag"},{code:"1f1ef-1f1f2",desc:"Jamaica Flag"},{code:"1f1ef-1f1f4",desc:"Jordan Flag"},{code:"1f1f0-1f1ea",desc:"Kenya Flag"},{code:"1f1f0-1f1ec",desc:"Kyrgyzstan Flag"},{code:"1f1f0-1f1ed",desc:"Cambodia Flag"},{code:"1f1f0-1f1ee",desc:"Kiribati Flag"},{code:"1f1f0-1f1f2",desc:"Comoros Flag"},{code:"1f1f0-1f1f3",desc:"St. Kitts & Nevis Flag"},{code:"1f1f0-1f1f5",desc:"North Korea Flag"},{code:"1f1f0-1f1fc",desc:"Kuwait Flag"},{code:"1f1f0-1f1fe",desc:"Cayman Islands Flag"},{code:"1f1f0-1f1ff",desc:"Kazakhstan Flag"},{code:"1f1f1-1f1e6",desc:"Laos Flag"},{code:"1f1f1-1f1e7",desc:"Lebanon Flag"},{code:"1f1f1-1f1e8",desc:"St. Lucia Flag"},{code:"1f1f1-1f1ee",desc:"Liechtenstein Flag"},{code:"1f1f1-1f1f0",desc:"Sri Lanka Flag"},{code:"1f1f1-1f1f7",desc:"Liberia Flag"},{code:"1f1f1-1f1f8",desc:"Lesotho Flag"},{code:"1f1f1-1f1f9",desc:"Lithuania Flag"},{code:"1f1f1-1f1fa",desc:"Luxembourg Flag"},{code:"1f1f1-1f1fb",desc:"Latvia Flag"},{code:"1f1f1-1f1fe",desc:"Libya Flag"},{code:"1f1f2-1f1e6",desc:"Morocco Flag"},{code:"1f1f2-1f1e8",desc:"Monaco Flag"},{code:"1f1f2-1f1e9",desc:"Moldova Flag"},{code:"1f1f2-1f1ea",desc:"Montenegro Flag"},{code:"1f1f2-1f1eb",desc:"St. Martin Flag"},{code:"1f1f2-1f1ec",desc:"Madagascar Flag"},{code:"1f1f2-1f1ed",desc:"Marshall Islands Flag"},{code:"1f1f2-1f1f0",desc:"Macedonia Flag"},{code:"1f1f2-1f1f1",desc:"Mali Flag"},{code:"1f1f2-1f1f2",desc:"Myanmar (burma) Flag"},{code:"1f1f2-1f1f3",desc:"Mongolia Flag"},{code:"1f1f2-1f1f4",desc:"Macau Sar China Flag"},{code:"1f1f2-1f1f5",desc:"Northern Mariana Islands Flag"},{code:"1f1f2-1f1f6",desc:"Martinique Flag"},{code:"1f1f2-1f1f7",desc:"Mauritania Flag"},{code:"1f1f2-1f1f8",desc:"Montserrat Flag"},{code:"1f1f2-1f1f9",desc:"Malta Flag"},{code:"1f1f2-1f1fa",desc:"Mauritius Flag"},{code:"1f1f2-1f1fb",desc:"Maldives Flag"},{code:"1f1f2-1f1fc",desc:"Malawi Flag"},{code:"1f1f2-1f1fd",desc:"Mexico Flag"},{code:"1f1f2-1f1fe",desc:"Malaysia Flag"},{code:"1f1f2-1f1ff",desc:"Mozambique Flag"},{code:"1f1f3-1f1e6",desc:"Namibia Flag"},{code:"1f1f3-1f1e8",desc:"New Caledonia Flag"},{code:"1f1f3-1f1ea",desc:"Niger Flag"},{code:"1f1f3-1f1eb",desc:"Norfolk Island Flag"},{code:"1f1f3-1f1ec",desc:"Nigeria Flag"},{code:"1f1f3-1f1ee",desc:"Nicaragua Flag"},{code:"1f1f3-1f1f1",desc:"Netherlands Flag"},{code:"1f1f3-1f1f4",desc:"Norway Flag"},{code:"1f1f3-1f1f5",desc:"Nepal Flag"},{code:"1f1f3-1f1f7",desc:"Nauru Flag"},{code:"1f1f3-1f1fa",desc:"Niue Flag"},{code:"1f1f3-1f1ff",desc:"New Zealand Flag"},{code:"1f1f4-1f1f2",desc:"Oman Flag"},{code:"1f1f8-1f1ff",desc:"Swaziland Flag"},{code:"1f1f5-1f1e6",desc:"Panama Flag"},{code:"1f1f5-1f1ea",desc:"Peru Flag"},{code:"1f1f5-1f1eb",desc:"French Polynesia Flag"},{code:"1f1f5-1f1ec",desc:"Papua New Guinea Flag"},{code:"1f1f5-1f1ed",desc:"Philippines Flag"},{code:"1f1f5-1f1f0",desc:"Pakistan Flag"},{code:"1f1f5-1f1f1",desc:"Poland Flag"},{code:"1f1f5-1f1f2",desc:"St. Pierre & Miquelon Flag"},{code:"1f1f5-1f1f3",desc:"Pitcairn Islands Flag"},{code:"1f1f5-1f1f7",desc:"Puerto Rico Flag"},{code:"1f1f5-1f1f8",desc:"Palestinian Territories Flag"},{code:"1f1f5-1f1f9",desc:"Portugal Flag"},{code:"1f1f5-1f1fc",desc:"Palau Flag"},{code:"1f1f5-1f1fe",desc:"Paraguay Flag"},{code:"1f1f6-1f1e6",desc:"Qatar Flag"},{code:"1f1f7-1f1ea",desc:"R\xe9union Flag"},{code:"1f1f7-1f1f4",desc:"Romania Flag"},{code:"1f1f7-1f1f8",desc:"Serbia Flag"},{code:"1f1f7-1f1fc",desc:"Rwanda Flag"},{code:"1f1f8-1f1e6",desc:"Saudi Arabia Flag"},{code:"1f1f8-1f1e7",desc:"Solomon Islands Flag"},{code:"1f1f8-1f1e8",desc:"Seychelles Flag"},{code:"1f1f8-1f1e9",desc:"Sudan Flag"},{code:"1f1f8-1f1ea",desc:"Sweden Flag"},{code:"1f1f8-1f1ec",desc:"Singapore Flag"},{code:"1f1f8-1f1ee",desc:"Slovenia Flag"},{code:"1f1f8-1f1ed",desc:"St. Helena Flag"},{code:"1f1f8-1f1ef",desc:"Svalbard & Jan Mayen Flag"},{code:"1f1f8-1f1f1",desc:"Sierra Leone Flag"},{code:"1f1f8-1f1f2",desc:"San Marino Flag"},{code:"1f1f8-1f1f3",desc:"Senegal Flag"},{code:"1f1f8-1f1f4",desc:"Somalia Flag"},{code:"1f1f8-1f1f7",desc:"Suriname Flag"},{code:"1f1f8-1f1f8",desc:"South Sudan Flag"},{code:"1f1f8-1f1f9",desc:"S\xe3o Tom\xe9 & Pr\xedncipe Flag"},{code:"1f1f8-1f1fb",desc:"El Salvador Flag"},{code:"1f1f8-1f1fd",desc:"Sint Maarten Flag"},{code:"1f1f8-1f1fe",desc:"Syria Flag"},{code:"1f1f9-1f1e6",desc:"Tristan Da Cunha Flag"},{code:"1f1f9-1f1e8",desc:"Turks & Caicos Islands Flag"},{code:"1f1f9-1f1eb",desc:"French Southern Territories Flag"},{code:"1f1f9-1f1ec",desc:"Togo Flag"},{code:"1f1f9-1f1ed",desc:"Thailand Flag"},{code:"1f1f9-1f1ef",desc:"Tajikistan Flag"},{code:"1f1f9-1f1f0",desc:"Tokelau Flag"},{code:"1f1f9-1f1f1",desc:"Timor-Leste Flag"},{code:"1f1f9-1f1f2",desc:"Turkmenistan Flag"},{code:"1f1f9-1f1f3",desc:"Tunisia Flag"},{code:"1f1f9-1f1f4",desc:"Tonga Flag"},{code:"1f1f9-1f1f7",desc:"Turkey Flag"},{code:"1f1f9-1f1f9",desc:"Trinidad & Tobago Flag"},{code:"1f1f9-1f1fb",desc:"Tuvalu Flag"},{code:"1f1f9-1f1fc",desc:"Taiwan Flag"},{code:"1f1f9-1f1ff",desc:"Tanzania Flag"},{code:"1f1fa-1f1e6",desc:"Ukraine City Flag"},{code:"1f1fa-1f1ec",desc:"Uganda Flag"},{code:"1f1fa-1f1f2",desc:"U.s. Outlying Islands Flag"},{code:"1f1fa-1f1fe",desc:"Uruguay Flag"},{code:"1f1fa-1f1ff",desc:"Uzbekistan Flag"},{code:"1f1fb-1f1e6",desc:"Vatican City Flag"},{code:"1f1fb-1f1e8",desc:"St. Vincent & Grenadines Flag"},{code:"1f1fb-1f1ea",desc:"Venezuela Flag"},{code:"1f1fb-1f1ec",desc:"British Virgin Islands Flag"},{code:"1f1fb-1f1ee",desc:"U.s. Virgin Islands Flag"},{code:"1f1fb-1f1f3",desc:"Vietnam Flag"},{code:"1f1fc-1f1f8",desc:"Samoa Flag"},{code:"1f1fb-1f1fa",desc:"Vanuatu Flag"},{code:"1f1fc-1f1eb",desc:'"Wallis & Futuna Flag'},{code:"1f1fd-1f1f0",desc:"Kosovo Flag"},{code:"1f1fe-1f1ea",desc:"Yemen Flag"},{code:"1f1fe-1f1f9",desc:"Mayotte Flag"},{code:"1f1ff-1f1e6",desc:"South Africa Flag"},{code:"1f1ff-1f1f2",desc:"Zambia Flag"},{code:"1f1ff-1f1fc",desc:"Zimbabwe Flag"},{code:"1f1eb-1f1f7",desc:"France Flag"},{code:"1f1ec-1f1e7",desc:"United Kingdom Flag"},{code:"1f1ee-1f1f9",desc:"Italy Flag"},{code:"1f1ef-1f1f5",desc:"Japan Flag"},{code:"1f1f0-1f1f7",desc:"South Korea Flag"},{code:"1f1f7-1f1fa",desc:"Russia Flag"},{code:"1F6A9",desc:"Triangular Flag on Post"},{code:"1f1fa-1f1f8",desc:"United States Flag"}]}],emoticonsButtons:["emoticonsBack","|"],emoticonsUseImage:!0}),Be.PLUGINS.emoticons=function(m){var v=m.$,r=m.opts.emoticonsSet,i=r&&r[0],s="";function o(){if(!m.selection.isCollapsed())return!1;var e=m.selection.element(),t=m.selection.endElement();if(e&&m.node.hasClass(e,"fr-emoticon"))return e;if(t&&m.node.hasClass(t,"fr-emoticon"))return t;var a=m.selection.ranges(0),n=a.startContainer;if(n.nodeType==Node.ELEMENT_NODE&&0<n.childNodes.length&&0<a.startOffset){var r=n.childNodes[a.startOffset-1];if(m.node.hasClass(r,"fr-emoticon"))return r}return!1}function l(){return"".concat(function n(e,t){return'<div class="fr-buttons fr-tabs fr-tabs-scroll">\n '.concat(function a(e,n){var r="";return e.forEach(function(e){var t={image:e.code.toLowerCase()},a={elementClass:e.id===n.id?"fr-active fr-active-tab":"",emoticonsUnicodeClass:m.opts.emoticonsUseImage?"":"fr-tabs-unicode",title:m.language.translate(e.name),dataCmd:"setEmoticonCategory",dataParam1:e.id,image:m.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'.concat(t.image,'.svg"/>'):"&#x".concat(t.image,";")};r+='<button class="fr-command fr-btn '.concat(a.elementClass," ").concat(a.emoticonsUnicodeClass,'" \n title="').concat(a.title,'" data-cmd="').concat(a.dataCmd,'" data-param1="').concat(a.dataParam1,'">\n ').concat(a.image," </button>")}),r}(e,t),"\n </div>")}(r,i),"\n ").concat(function a(e){return'\n <div class="fr-icon-container fr-emoticon-container">\n '.concat(function t(e){var r="";return e.emoticons.forEach(function(e){var t=e.code.split("-").reduce(function(e,t){return e?e+"&zwj;&#x"+t.toLowerCase()+";":"&#x"+t.toLowerCase()+";"},""),a={image:e.code.toLowerCase(),compiledCode:e.uCode?e.uCode:t},n={dataParam1:e.code.toLowerCase(),dataParam2:a.compiledCode,title:m.language.translate(e.desc),image:m.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'.concat(a.image,'.svg"/>'):"".concat(a.compiledCode),desc:m.language.translate(e.desc)};r+='<span class="fr-command fr-emoticon fr-icon" role="button" \n data-cmd="insertEmoticon" data-param1="'.concat(n.dataParam1,'" \n data-param2="').concat(n.dataParam2,'" title="').concat(n.title,'" >\n ').concat(n.image,'<span class="fr-sr-only">').concat(n.desc,"&nbsp;&nbsp;&nbsp;</span></span>")}),r}(e),"\n </div>\n ")}(i),"\n ").concat(function e(){return m.opts.emoticonsUseImage?'<p style="font-size: 12px; text-align: center; padding: 0 5px;">Emoji free by <a class="fr-link" tabIndex="-1" href="http://emojione.com/" target="_blank" rel="nofollow noopener noreferrer" role="link" aria-label="Open Emoji One website.">Emoji One</a></p>':""}())}return{_init:function e(){var a=function a(){for(var e=m.el.querySelectorAll(".fr-emoticon:not(.fr-deletable)"),t=0;t<e.length;t++)e[t].className+=" fr-deletable"};a(),m.events.on("html.set",a),m.events.on("keydown",function(e){if(m.keys.isCharacter(e.which)&&m.selection.inEditor()){var t=m.selection.ranges(0),a=o();m.node.hasClass(a,"fr-emoticon-img")&&a&&(0===t.startOffset&&m.selection.element()===a?v(a).before(Be.MARKERS+Be.INVISIBLE_SPACE):v(a).after(Be.INVISIBLE_SPACE+Be.MARKERS),m.selection.restore())}}),m.events.on("keyup",function(e){for(var t=m.el.querySelectorAll(".fr-emoticon"),a=0;a<t.length;a++)"undefined"!=typeof t[a].textContent&&0===t[a].textContent.replace(/\u200B/gi,"").length&&v(t[a]).remove();if(!(e.which>=Be.KEYCODE.ARROW_LEFT&&e.which<=Be.KEYCODE.ARROW_DOWN)){var n=o();m.node.hasClass(n,"fr-emoticon-img")&&(v(n).append(Be.MARKERS),m.selection.restore())}})},insert:function c(e,t){var a=o(),n=m.selection.ranges(0);a?(0===n.startOffset&&m.selection.element()===a?v(a).before(Be.MARKERS+Be.INVISIBLE_SPACE):0<n.startOffset&&m.selection.element()===a&&n.commonAncestorContainer.parentNode.classList.contains("fr-emoticon")&&v(a).after(Be.INVISIBLE_SPACE+Be.MARKERS),m.selection.restore(),m.html.insert('<span class="fr-emoticon fr-deletable'.concat(t?" fr-emoticon-img":"",'"').concat(t?' style="background: url('.concat(t,');"'):"",">").concat(t?"&nbsp;":e,"</span>&nbsp;").concat(Be.MARKERS),!0)):m.html.insert('<span class="fr-emoticon fr-deletable'.concat(t?" fr-emoticon-img":"",'"').concat(t?' style="background: url('.concat(t,');"'):"",">").concat(t?"&nbsp;":e,"</span>&nbsp;"),!0)},setEmoticonCategory:function a(t){i=r.filter(function(e){return e.id===t})[0],function e(){m.popups.get("emoticons").html(s+l())}()},showEmoticonsPopup:function d(){var e=m.popups.get("emoticons");if(e||(e=function i(){m.opts.toolbarInline&&0<m.opts.emoticonsButtons.length&&(s='<div class="fr-buttons fr-emoticons-buttons fr-tabs">'.concat(m.button.buildList(m.opts.emoticonsButtons),"</div>"));var e={buttons:s,custom_layer:l()},t=m.popups.create("emoticons",e);return function a(g){m.events.on("popup.tab",function(e){var t=v(e.currentTarget);if(!m.popups.isVisible("emoticons")||!t.is("span, a"))return!0;var a,n,r,i=e.which;if(Be.KEYCODE.TAB==i){if(t.is("span.fr-emoticon")&&e.shiftKey||t.is("a")&&!e.shiftKey){var s=g.find(".fr-buttons");a=!m.accessibility.focusToolbar(s,!!e.shiftKey)}if(!1!==a){var o=g.find("span.fr-emoticon:focus").first().concat(g.findVisible(" div.fr-tabs").first().concat(g.find("a")));t.is("span.fr-emoticon")&&(o=o.not("span.fr-emoticon:not(:focus)")),n=o.index(t),n=e.shiftKey?((n-1)%o.length+o.length)%o.length:(n+1)%o.length,r=o.get(n),m.events.disableBlur(),r.focus(),a=!1}}else if(Be.KEYCODE.ARROW_UP==i||Be.KEYCODE.ARROW_DOWN==i||Be.KEYCODE.ARROW_LEFT==i||Be.KEYCODE.ARROW_RIGHT==i){if(t.is("span.fr-emoticon")){var l=t.parent().find("span.fr-emoticon");n=l.index(t);var c=m.opts.emoticonsStep,d=Math.floor(l.length/c),f=n%c,p=Math.floor(n/c),u=p*c+f,h=d*c;Be.KEYCODE.ARROW_UP==i?u=((u-c)%h+h)%h:Be.KEYCODE.ARROW_DOWN==i?u=(u+c)%h:Be.KEYCODE.ARROW_LEFT==i?u=((u-1)%h+h)%h:Be.KEYCODE.ARROW_RIGHT==i&&(u=(u+1)%h),r=v(l.get(u)),m.events.disableBlur(),r.focus(),a=!1}}else Be.KEYCODE.ENTER==i&&(t.is("a")?t[0].click():m.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(t),t}()),!e.hasClass("fr-active")){m.popups.refresh("emoticons"),m.popups.setContainer("emoticons",m.$tb);var t=m.$tb.find('.fr-command[data-cmd="emoticons"]'),a=m.button.getPosition(t),n=a.left,r=a.top;m.popups.show("emoticons",n,r,t.outerHeight())}},back:function t(){m.popups.hide("emoticons"),m.toolbar.showInline()}}},Be.DefineIcon("emoticons",{NAME:"smile-o",FA5NAME:"smile",SVG_KEY:"smile"}),Be.RegisterCommand("emoticons",{title:"Emoticons",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("emoticons")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("emoticons")):this.emoticons.showEmoticonsPopup()},plugin:"emoticons"}),Be.RegisterCommand("insertEmoticon",{callback:function(e,t,a){this.emoticons.insert(a,this.opts.emoticonsUseImage?"https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/".concat(t,".svg"):null),this.popups.hide("emoticons")}}),Be.RegisterCommand("setEmoticonCategory",{undo:!1,focus:!1,callback:function(e,t){this.emoticons.setEmoticonCategory(t)}}),Be.DefineIcon("emoticonsBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("emoticonsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.emoticons.back()}}),Object.assign(Be.DEFAULTS,{entities:"&quot;&#39;&iexcl;&cent;&pound;&curren;&yen;&brvbar;&sect;&uml;&copy;&ordf;&laquo;&not;&shy;&reg;&macr;&deg;&plusmn;&sup2;&sup3;&acute;&micro;&para;&middot;&cedil;&sup1;&ordm;&raquo;&frac14;&frac12;&frac34;&iquest;&Agrave;&Aacute;&Acirc;&Atilde;&Auml;&Aring;&AElig;&Ccedil;&Egrave;&Eacute;&Ecirc;&Euml;&Igrave;&Iacute;&Icirc;&Iuml;&ETH;&Ntilde;&Ograve;&Oacute;&Ocirc;&Otilde;&Ouml;&times;&Oslash;&Ugrave;&Uacute;&Ucirc;&Uuml;&Yacute;&THORN;&szlig;&agrave;&aacute;&acirc;&atilde;&auml;&aring;&aelig;&ccedil;&egrave;&eacute;&ecirc;&euml;&igrave;&iacute;&icirc;&iuml;&eth;&ntilde;&ograve;&oacute;&ocirc;&otilde;&ouml;&divide;&oslash;&ugrave;&uacute;&ucirc;&uuml;&yacute;&thorn;&yuml;&OElig;&oelig;&Scaron;&scaron;&Yuml;&fnof;&circ;&tilde;&Alpha;&Beta;&Gamma;&Delta;&Epsilon;&Zeta;&Eta;&Theta;&Iota;&Kappa;&Lambda;&Mu;&Nu;&Xi;&Omicron;&Pi;&Rho;&Sigma;&Tau;&Upsilon;&Phi;&Chi;&Psi;&Omega;&alpha;&beta;&gamma;&delta;&epsilon;&zeta;&eta;&theta;&iota;&kappa;&lambda;&mu;&nu;&xi;&omicron;&pi;&rho;&sigmaf;&sigma;&tau;&upsilon;&phi;&chi;&psi;&omega;&thetasym;&upsih;&piv;&ensp;&emsp;&thinsp;&zwnj;&zwj;&lrm;&rlm;&ndash;&mdash;&lsquo;&rsquo;&sbquo;&ldquo;&rdquo;&bdquo;&dagger;&Dagger;&bull;&hellip;&permil;&prime;&Prime;&lsaquo;&rsaquo;&oline;&frasl;&euro;&image;&weierp;&real;&trade;&alefsym;&larr;&uarr;&rarr;&darr;&harr;&crarr;&lArr;&uArr;&rArr;&dArr;&hArr;&forall;&part;&exist;&empty;&nabla;&isin;&notin;&ni;&prod;&sum;&minus;&lowast;&radic;&prop;&infin;&ang;&and;&or;&cap;&cup;&int;&there4;&sim;&cong;&asymp;&ne;&equiv;&le;&ge;&sub;&sup;&nsub;&sube;&supe;&oplus;&otimes;&perp;&sdot;&lceil;&rceil;&lfloor;&rfloor;&lang;&rang;&loz;&spades;&clubs;&hearts;&diams;"}),Be.PLUGINS.entities=function(r){var i,s,o=r.$;function n(e){var t=e.textContent;if(t.match(i)){for(var a="",n=0;n<t.length;n++)s[t[n]]?a+=s[t[n]]:a+=t[n];e.textContent=a}}function l(e){if(e&&0<=["STYLE","SCRIPT","svg","IFRAME"].indexOf(e.tagName))return!0;for(var t=r.node.contents(e),a=0;a<t.length;a++)t[a].nodeType===Node.TEXT_NODE?n(t[a]):l(t[a]);return e.nodeType===Node.TEXT_NODE&&n(e),!1}function c(e){return 0===e.length?"":r.clean.exec(e,l).replace(/\&amp;/g,"&")}return{_init:function d(){r.opts.htmlSimpleAmpersand||(r.opts.entities=r.opts.entities+"&amp;");var e=o(document.createElement("div")).html(r.opts.entities).text(),t=r.opts.entities.split(";");s={},i="";for(var a=0;a<e.length;a++){var n=e.charAt(a);s[n]=t[a]+";",i+="\\"+n+(a<e.length-1?"|":"")}i=new RegExp("("+i+")","g"),r.events.on("html.get",c,!0)}}},Object.assign(Be.POPUP_TEMPLATES,{"file.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_PROGRESS_BAR_]"}),Object.assign(Be.DEFAULTS,{fileUpload:!0,fileUploadURL:null,fileUploadParam:"file",fileUploadParams:{},fileUploadToS3:!1,fileUploadMethod:"POST",fileMaxSize:10485760,fileAllowedTypes:["*"],fileInsertButtons:["fileBack","|"],fileUseSelectedText:!1}),Be.PLUGINS.file=function(d){var n,f=d.$,l="https://i.froala.com/upload",p=2,u=3,h=4,c=5,g=6,a={};function m(){var e=d.popups.get("file.insert");e||(e=R()),e.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),e.find(".fr-file-progress-bar-layer").addClass("fr-active"),e.find(".fr-buttons").hide(),r(d.language.translate("Uploading"),0)}function i(e){var t=d.popups.get("file.insert");t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-file-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e&&(d.events.focus(),d.popups.hide("file.insert")))}function r(e,t){var a=d.popups.get("file.insert");if(a){var n=a.find(".fr-file-progress-bar-layer");n.find("h3").text(e+(t?" "+t+"%":"")),n.removeClass("fr-error"),t?(n.find("div").removeClass("fr-indeterminate"),n.find("div > span").css("width",t+"%")):n.find("div").addClass("fr-indeterminate")}}function v(e,t,a){d.edit.on(),d.events.focus(!0),d.selection.restore(),d.opts.fileUseSelectedText&&d.selection.text().length&&(t=d.selection.text()),d.html.insert('<a href="'+e+'" target="_blank" id="fr-inserted-file" class="fr-file">'+t+"</a>");var n=d.$el.find("#fr-inserted-file");n.removeAttr("id"),d.popups.hide("file.insert"),d.undo.saveStep(),L(),d.events.trigger("file.inserted",[n,a])}function E(e){var t=this.status,a=this.response,n=this.responseXML,r=this.responseText;try{if(d.opts.fileUploadToS3)if(201===t){var i=function o(e){try{var t=f(e).find("Location").text(),a=f(e).find("Key").text();return!1===d.events.trigger("file.uploadedToS3",[t,a,e],!0)?(d.edit.on(),!1):t}catch(n){return T(h,e),!1}}(n);i&&v(i,e,a||n)}else T(h,a||n);else if(200<=t&&t<300){var s=function l(e){try{if(!1===d.events.trigger("file.uploaded",[e],!0))return d.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(T(p,e),!1)}catch(a){return T(h,e),!1}}(r);s&&v(s.link,e,a||r)}else T(u,a||r)}catch(c){T(h,a||r)}}function b(){T(h,this.response||this.responseText||this.responseXML)}function A(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;r(d.language.translate("Uploading"),t)}}function T(e,t){d.edit.on(),function n(e){m();var t=d.popups.get("file.insert").find(".fr-file-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),d.events.disableBlur(),a.focus()}(d.language.translate("Something went wrong. Please try again.")),d.events.trigger("file.error",[{code:e,message:a[e]},t])}function C(){d.edit.on(),i(!0)}function s(e){if(void 0!==e&&0<e.length){if(!1===d.events.trigger("file.beforeUpload",[e]))return!1;var t,a=e[0];if((null===d.opts.fileUploadURL||d.opts.fileUploadURL===l)&&!d.opts.fileUploadToS3)return function o(r){var i=new FileReader;i.onload=function(){for(var e=i.result,t=atob(i.result.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:r.type})),d.file.insert(e,r.name,null)},m(),i.readAsDataURL(r)}(a),!1;if(a.size>d.opts.fileMaxSize)return T(c),!1;if(d.opts.fileAllowedTypes.indexOf("*")<0&&d.opts.fileAllowedTypes.indexOf(a.type.replace(/file\//g,""))<0)return T(g),!1;if(d.drag_support.formdata&&(t=d.drag_support.formdata?new FormData:null),t){var n;if(!1!==d.opts.fileUploadToS3)for(n in t.append("key",d.opts.fileUploadToS3.keyStart+(new Date).getTime()+"-"+(a.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",a.type),d.opts.fileUploadToS3.params)d.opts.fileUploadToS3.params.hasOwnProperty(n)&&t.append(n,d.opts.fileUploadToS3.params[n]);for(n in d.opts.fileUploadParams)d.opts.fileUploadParams.hasOwnProperty(n)&&t.append(n,d.opts.fileUploadParams[n]);t.append(d.opts.fileUploadParam,a);var r=d.opts.fileUploadURL;d.opts.fileUploadToS3&&(r=d.opts.fileUploadToS3.uploadURL?d.opts.fileUploadToS3.uploadURL:"https://"+d.opts.fileUploadToS3.region+".amazonaws.com/"+d.opts.fileUploadToS3.bucket);var i=d.core.getXHR(r,d.opts.fileUploadMethod);i.onload=function(){E.call(i,a.name)},i.onerror=b,i.upload.onprogress=A,i.onabort=C,m();var s=d.popups.get("file.insert");s&&(s.off("abortUpload"),s.on("abortUpload",function(){4!==i.readyState&&i.abort()})),i.send(t)}}}function o(){i()}function R(e){if(e)return d.popups.onHide("file.insert",o),!0;var t;d.opts.fileUpload||d.opts.fileInsertButtons.splice(d.opts.fileInsertButtons.indexOf("fileUpload"),1),t='<div class="fr-buttons fr-tabs">'+d.button.buildList(d.opts.fileInsertButtons)+"</div>";var a="";d.opts.fileUpload&&(a='<div class="fr-file-upload-layer fr-layer fr-active" id="fr-file-upload-layer-'+d.id+'"><strong>'+d.language.translate("Drop file")+"</strong><br>("+d.language.translate("or click")+')<div class="fr-form"><input type="file" name="'+d.opts.fileUploadParam+'" accept="'+(0<=d.opts.fileAllowedTypes.indexOf("*")?"/":"")+d.opts.fileAllowedTypes.join(", ").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-file-upload-layer-'+d.id+'" role="button"></div></div>');var n={buttons:t,upload_layer:a,progress_bar:'<div class="fr-file-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="fileDismissError" tabIndex="2" role="button">OK</button></div></div>'},r=d.popups.create("file.insert",n);return function i(a){d.events.$on(a,"dragover dragenter",".fr-file-upload-layer",function(){return f(this).addClass("fr-drop"),!1},!0),d.events.$on(a,"dragleave dragend",".fr-file-upload-layer",function(){return f(this).removeClass("fr-drop"),!1},!0),d.events.$on(a,"drop",".fr-file-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),f(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;t&&t.files&&(a.data("instance")||d).file.upload(t.files)},!0),d.helpers.isIOS()&&d.events.$on(a,"touchstart",'.fr-file-upload-layer input[type="file"]',function(){f(this).trigger("click")}),d.events.$on(a,"change",'.fr-file-upload-layer input[type="file"]',function(){if(this.files){var e=a.data("instance")||d;e.events.disableBlur(),a.find("input:focus").blur(),e.events.enableBlur(),e.file.upload(this.files)}f(this).val("")},!0)}(r),r}function t(e){d.node.hasClass(e,"fr-file")}function S(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&"undefined"!=typeof a.type){if(a.type.indexOf("image")<0){if(!d.opts.fileUpload)return e.preventDefault(),e.stopPropagation(),!1;d.markers.remove(),d.markers.insertAtPoint(e.originalEvent),d.$el.find(".fr-marker").replaceWith(Be.MARKERS),d.popups.hideAll();var n=d.popups.get("file.insert");return n||(n=R()),d.popups.setContainer("file.insert",d.$sc),d.popups.show("file.insert",e.originalEvent.pageX,e.originalEvent.pageY),m(),s(t.files),e.preventDefault(),e.stopPropagation(),!1}}else a.type.indexOf("image")<0&&(e.preventDefault(),e.stopPropagation())}}function L(){var e,t=Array.prototype.slice.call(d.el.querySelectorAll("a.fr-file")),a=[];for(e=0;e<t.length;e++)a.push(t[e].getAttribute("href"));if(n)for(e=0;e<n.length;e++)a.indexOf(n[e].getAttribute("href"))<0&&d.events.trigger("file.unlink",[n[e]]);n=t}return a[1]="File cannot be loaded from the passed link.",a[p]="No link in upload response.",a[u]="Error during file upload.",a[h]="Parsing response failed.",a[c]="File is too large.",a[g]="File file type is invalid.",a[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",{_init:function _(){!function e(){d.events.on("drop",S),d.events.$on(d.$win,"keydown",function(e){var t=e.which,a=d.popups.get("file.insert");a&&t===Be.KEYCODE.ESC&&a.trigger("abortUpload")}),d.events.on("destroy",function(){var e=d.popups.get("file.insert");e&&e.trigger("abortUpload")})}(),d.events.on("link.beforeRemove",t),d.$wp&&(L(),d.events.on("contentChanged",L)),R(!0)},showInsertPopup:function w(){var e=d.$tb.find('.fr-command[data-cmd="insertFile"]'),t=d.popups.get("file.insert");if(t||(t=R()),i(),!t.hasClass("fr-active"))if(d.popups.refresh("file.insert"),d.popups.setContainer("file.insert",d.$tb),e.isVisible){var a=d.button.getPosition(e),n=a.left,r=a.top;d.popups.show("file.insert",n,r,e.outerHeight())}else d.position.forSelection(t),d.popups.show("file.insert")},upload:s,insert:v,back:function e(){d.events.disableBlur(),d.selection.restore(),d.events.enableBlur(),d.popups.hide("file.insert"),d.toolbar.showInline()},hideProgressBar:i}},Be.DefineIcon("insertFile",{NAME:"file-o",FA5NAME:"file",SVG_KEY:"insertFile"}),Be.RegisterCommand("insertFile",{title:"Upload File",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("file.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("file.insert")):this.file.showInsertPopup()},plugin:"file"}),Be.DefineIcon("fileBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("fileBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.file.back()},refresh:function(e){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"))}}),Be.RegisterCommand("fileDismissError",{title:"OK",callback:function(){this.file.hideProgressBar(!0)}}),Object.assign(Be.DEFAULTS,{fontFamily:{"Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","Times New Roman,Times,serif,-webkit-standard":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},fontFamilySelection:!1,fontFamilyDefaultSelection:"Font Family"}),Be.PLUGINS.fontFamily=function(r){var i=r.$;function s(e){var t=e.replace(/(sans-serif|serif|monospace|cursive|fantasy)/gi,"").replace(/"|'| /g,"").split(",");return i(this).grep(t,function(e){return 0<e.length})}function o(e,t){for(var a=0;a<e.length;a++)for(var n=0;n<t.length;n++)if(e[a].toLowerCase()===t[n].toLowerCase())return[a,n];return null}function a(){var e=s(i(r.selection.element()).css("font-family")),t=[];for(var a in r.opts.fontFamily)if(r.opts.fontFamily.hasOwnProperty(a)){var n=o(e,s(a));n&&t.push([a,n])}return 0===t.length?null:(t.sort(function(e,t){var a=e[1][0]-t[1][0];return 0===a?e[1][1]-t[1][1]:a}),t[0][0])}return{apply:function t(e){r.format.applyStyle("font-family",e)},refreshOnShow:function n(e,t){t.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),t.find('.fr-command[data-param1="'+a()+'"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function l(e){if(r.opts.fontFamilySelection){var t=i(r.selection.element()).css("font-family").replace(/(sans-serif|serif|monospace|cursive|fantasy)/gi,"").replace(/"|'|/g,"").split(",");e.find("> span").text(r.opts.fontFamily[a()]||t[0]||r.language.translate(r.opts.fontFamilyDefaultSelection))}}}},Be.RegisterCommand("fontFamily",{type:"dropdown",displaySelection:function(e){return e.opts.fontFamilySelection},defaultSelection:function(e){return e.opts.fontFamilyDefaultSelection},displaySelectionWidth:120,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.fontFamily;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="fontFamily" data-param1="'+a+'" style="font-family: '+a+'" title="'+t[a]+'">'+t[a]+"</a></li>");return e+="</ul>"},title:"Font Family",callback:function(e,t){this.fontFamily.apply(t)},refresh:function(e){this.fontFamily.refresh(e)},refreshOnShow:function(e,t){this.fontFamily.refreshOnShow(e,t)},plugin:"fontFamily"}),Be.DefineIcon("fontFamily",{NAME:"font",SVG_KEY:"fontFamily"}),Object.assign(Be.DEFAULTS,{fontSize:["8","9","10","11","12","14","18","24","30","36","48","60","72","96"],fontSizeSelection:!1,fontSizeDefaultSelection:"12",fontSizeUnit:"px"}),Be.PLUGINS.fontSize=function(n){var r=n.$;return{apply:function t(e){n.format.applyStyle("font-size",e)},refreshOnShow:function i(e,t){var a=r(n.selection.element()).css("font-size");"pt"===n.opts.fontSizeUnit&&(a=Math.round(72*parseFloat(a,10)/96)+"pt"),t.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),t.find('.fr-command[data-param1="'+a+'"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function a(e){if(n.opts.fontSizeSelection){var t=n.helpers.getPX(r(n.selection.element()).css("font-size"));"pt"===n.opts.fontSizeUnit&&(t=Math.round(72*parseFloat(t,10)/96)+"pt"),e.find("> span").text(t)}}}},Be.RegisterCommand("fontSize",{type:"dropdown",title:"Font Size",displaySelection:function(e){return e.opts.fontSizeSelection},displaySelectionWidth:30,defaultSelection:function(e){return e.opts.fontSizeDefaultSelection},html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.fontSize,a=0;a<t.length;a++){var n=t[a];e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="fontSize" data-param1="'+n+this.opts.fontSizeUnit+'" title="'+n+'">'+n+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.fontSize.apply(t)},refresh:function(e){this.fontSize.refresh(e)},refreshOnShow:function(e,t){this.fontSize.refreshOnShow(e,t)},plugin:"fontSize"}),Be.DefineIcon("fontSize",{NAME:"text-height",SVG_KEY:"fontSize"}),Object.assign(Be.POPUP_TEMPLATES,{"forms.edit":"[_BUTTONS_]","forms.update":"[_BUTTONS_][_TEXT_LAYER_]"}),Object.assign(Be.DEFAULTS,{formEditButtons:["inputStyle","inputEdit"],formStyles:{"fr-rounded":"Rounded","fr-large":"Large"},formMultipleStyles:!0,formUpdateButtons:["inputBack","|"]}),Be.PLUGINS.forms=function(s){var o,l=s.$;function t(e){e.preventDefault(),s.selection.clear(),l(this).data("mousedown",!0)}function a(e){l(this).data("mousedown")&&(e.stopPropagation(),l(this).removeData("mousedown"),d(o=this)),e.preventDefault()}function n(){s.$el.find("input, textarea, button").removeData("mousedown")}function r(){l(this).removeData("mousedown")}function c(){return o||null}function d(e){var t=s.popups.get("forms.edit");t||(t=function i(){var e="";0<s.opts.formEditButtons.length&&(e='<div class="fr-buttons">'.concat(s.button.buildList(s.opts.formEditButtons),"</div>"));var t={buttons:e},a=s.popups.create("forms.edit",t);return s.$wp&&s.events.$on(s.$wp,"scroll.link-edit",function(){c()&&s.popups.isVisible("forms.edit")&&d(c())}),a}());var a=l(o=e);s.popups.refresh("forms.edit"),s.popups.setContainer("forms.edit",s.$sc);var n=a.offset().left+a.outerWidth()/2,r=a.offset().top+a.outerHeight();s.popups.show("forms.edit",n,r,a.outerHeight())}function i(){var e=s.popups.get("forms.update"),t=c();if(t){var a=l(t);a.is("button")?e.find('input[type="text"][name="text"]').val(a.text()):e.find('input[type="text"][name="text"]').val(a.attr("placeholder"))}e.find('input[type="text"][name="text"]').trigger("change")}function f(){o=null}function p(e){if(e)return s.popups.onRefresh("forms.update",i),s.popups.onHide("forms.update",f),!0;var t="";1<=s.opts.formUpdateButtons.length&&(t='<div class="fr-buttons">'.concat(s.button.buildList(s.opts.formUpdateButtons),"</div>"));var a=0,n={buttons:t,text_layer:'<div class="fr-forms-text-layer fr-layer fr-active"> \n <div class="fr-input-line"><input name="text" type="text" placeholder="Text" tabIndex=" '.concat(++a,' "></div>\n <div class="fr-action-buttons"><button class="fr-command fr-submit" data-cmd="updateInput" href="#" tabIndex="').concat(2,'" type="button">').concat(s.language.translate("Update"),"</button></div></div>")};return s.popups.create("forms.update",n)}return{_init:function u(){!function e(){s.events.$on(s.$el,s._mousedown,"input, textarea, button",t),s.events.$on(s.$el,s._mouseup,"input, textarea, button",a),s.events.$on(s.$el,"touchmove","input, textarea, button",r),s.events.$on(s.$el,s._mouseup,n),s.events.$on(s.$win,s._mouseup,n),p(!0)}(),s.events.$on(s.$el,"submit","form",function(e){return e.preventDefault(),!1})},updateInput:function h(){var e=s.popups.get("forms.update"),t=c();if(t){var a=l(t),n=e.find('input[type="text"][name="text"]').val()||"";n.length&&(a.is("button")?a.text(n):a.attr("placeholder",n)),s.popups.hide("forms.update"),d(t)}},getInput:c,applyStyle:function g(e,t,a){void 0===t&&(t=s.opts.formStyles),void 0===a&&(a=s.opts.formMultipleStyles);var n=c();if(!n)return!1;if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),l(n).removeClass(r.join(" "))}l(n).toggleClass(e)},showUpdatePopup:function m(){var e=c();if(e){var t=l(e),a=s.popups.get("forms.update");a||(a=p()),s.popups.isVisible("forms.update")||s.popups.refresh("forms.update"),s.popups.setContainer("forms.update",s.$sc);var n=t.offset().left+t.outerWidth()/2,r=t.offset().top+t.outerHeight();s.popups.show("forms.update",n,r,t.outerHeight())}},showEditPopup:d,back:function v(){s.events.disableBlur(),s.selection.restore(),s.events.enableBlur();var e=c();e&&s.$wp&&("BUTTON"===e.tagName&&s.selection.restore(),d(e))}}},Be.RegisterCommand("updateInput",{undo:!1,focus:!1,title:"Update",callback:function(){this.forms.updateInput()}}),Be.DefineIcon("inputStyle",{NAME:"magic",SVG_KEY:"inlineStyle"}),Be.RegisterCommand("inputStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list">',t=this.opts.formStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li><a class="fr-command" tabIndex="-1" data-cmd="inputStyle" data-param1="'.concat(a,'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){var a=this.forms.getInput();a&&(this.forms.applyStyle(t),this.forms.showEditPopup(a))},refreshOnShow:function(e,t){var a=this.$,n=this.forms.getInput();if(n){var r=a(n);t.find(".fr-command").each(function(){var e=a(this).data("param1");a(this).toggleClass("fr-active",r.hasClass(e))})}}}),Be.DefineIcon("inputEdit",{NAME:"edit"}),Be.RegisterCommand("inputEdit",{title:"Edit Button",undo:!1,refreshAfterCallback:!1,callback:function(){this.forms.showUpdatePopup()}}),Be.DefineIcon("inputBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("inputBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.forms.back()}}),Be.RegisterCommand("updateInput",{undo:!1,focus:!1,title:"Update",callback:function(){this.forms.updateInput()}}),Be.PLUGINS.fullscreen=function(r){var t,a,n,i,s=r.$;function o(){return r.$box.hasClass("fr-fullscreen")}function l(){if(r.helpers.isIOS()&&r.core.hasFocus())return r.$el.blur(),setTimeout(d,250),!1;t=r.helpers.scrollTop(),r.$box.toggleClass("fr-fullscreen"),s("body").first().toggleClass("fr-fullscreen"),r.helpers.isMobile()&&(r.$tb.data("parent",r.$tb.parent()),r.$box.prepend(r.$tb),r.$tb.data("sticky-dummy")&&r.$tb.after(r.$tb.data("sticky-dummy"))),a=r.opts.height,n=r.opts.heightMax,i=r.opts.zIndex,r.opts.height=r.o_win.innerHeight-(r.opts.toolbarInline?0:r.$tb.outerHeight()+(r.$second_tb?r.$second_tb.outerHeight():0)),r.opts.zIndex=2147483641,r.opts.heightMax=null,r.size.refresh(),r.opts.toolbarInline&&r.toolbar.showInline();for(var e=r.$box.parent();!e.first().is("body");)e.addClass("fr-fullscreen-wrapper"),e=e.parent();r.opts.toolbarContainer&&r.$box.prepend(r.$tb),r.events.trigger("charCounter.update"),r.events.trigger("codeView.update"),r.$win.trigger("scroll")}function c(){if(r.helpers.isIOS()&&r.core.hasFocus())return r.$el.blur(),setTimeout(d,250),!1;r.$box.toggleClass("fr-fullscreen"),s("body").first().toggleClass("fr-fullscreen"),r.$tb.data("parent")&&r.$tb.data("parent").prepend(r.$tb),r.$tb.data("sticky-dummy")&&r.$tb.after(r.$tb.data("sticky-dummy")),r.opts.height=a,r.opts.heightMax=n,r.opts.zIndex=i,r.size.refresh(),s(r.o_win).scrollTop(t),r.opts.toolbarInline&&r.toolbar.showInline(),r.events.trigger("charCounter.update"),r.opts.toolbarSticky&&r.opts.toolbarStickyOffset&&(r.opts.toolbarBottom?r.$tb.css("bottom",r.opts.toolbarStickyOffset).data("bottom",r.opts.toolbarStickyOffset):r.$tb.css("top",r.opts.toolbarStickyOffset).data("top",r.opts.toolbarStickyOffset));for(var e=r.$box.parent();!e.first().is("body");)e.removeClass("fr-fullscreen-wrapper"),e=e.parent();r.opts.toolbarContainer&&s(r.opts.toolbarContainer).append(r.$tb),s(r.o_win).trigger("scroll"),r.events.trigger("codeView.update")}function d(){o()?c():l(),f(r.$tb.find('.fr-command[data-cmd="fullscreen"]'));var e=r.$tb.find('.fr-command[data-cmd="moreText"]'),t=r.$tb.find('.fr-command[data-cmd="moreParagraph"]'),a=r.$tb.find('.fr-command[data-cmd="moreRich"]'),n=r.$tb.find('.fr-command[data-cmd="moreMisc"]');e.length&&r.refresh.moreText(e),t.length&&r.refresh.moreParagraph(t),a.length&&r.refresh.moreRich(a),n.length&&r.refresh.moreMisc(n)}function f(e){var t=o();e.toggleClass("fr-active",t).attr("aria-pressed",t),e.find("> *").not(".fr-sr-only").replaceWith(t?r.icon.create("fullscreenCompress"):r.icon.create("fullscreen"))}return{_init:function e(){if(!r.$wp)return!1;r.events.$on(s(r.o_win),"resize",function(){o()&&(c(),l())}),r.events.on("toolbar.hide",function(){if(o()&&r.helpers.isMobile())return!1}),r.events.on("position.refresh",function(){if(r.helpers.isIOS())return!o()}),r.events.on("destroy",function(){o()&&c()},!0)},toggle:d,refresh:f,isActive:o}},Be.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,toggle:!0,callback:function(){this.fullscreen.toggle()},refresh:function(e){this.fullscreen.refresh(e)},plugin:"fullscreen"}),Be.DefineIcon("fullscreen",{NAME:"expand",SVG_KEY:"fullscreen"}),Be.DefineIcon("fullscreenCompress",{NAME:"compress",SVG_KEY:"exitFullscreen"}),Object.assign(Be.DEFAULTS,{helpSets:[{title:"Inline Editor",commands:[{val:"OSkeyE",desc:"Show the editor"}]},{title:"Common actions",commands:[{val:"OSkeyC",desc:"Copy"},{val:"OSkeyX",desc:"Cut"},{val:"OSkeyV",desc:"Paste"},{val:"OSkeyZ",desc:"Undo"},{val:"OSkeyShift+Z",desc:"Redo"},{val:"OSkeyK",desc:"Insert Link"},{val:"OSkeyP",desc:"Insert Image"}]},{title:"Basic Formatting",commands:[{val:"OSkeyA",desc:"Select All"},{val:"OSkeyB",desc:"Bold"},{val:"OSkeyI",desc:"Italic"},{val:"OSkeyU",desc:"Underline"},{val:"OSkeyS",desc:"Strikethrough"},{val:"OSkey]",desc:"Increase Indent"},{val:"OSkey[",desc:"Decrease Indent"}]},{title:"Quote",commands:[{val:"OSkey'",desc:"Increase quote level"},{val:"OSkeyShift+'",desc:"Decrease quote level"}]},{title:"Image / Video",commands:[{val:"OSkey+",desc:"Resize larger"},{val:"OSkey-",desc:"Resize smaller"}]},{title:"Table",commands:[{val:"Alt+Space",desc:"Select table cell"},{val:"Shift+Left/Right arrow",desc:"Extend selection one cell"},{val:"Shift+Up/Down arrow",desc:"Extend selection one row"}]},{title:"Navigation",commands:[{val:"OSkey/",desc:"Shortcuts"},{val:"Alt+F10",desc:"Focus popup / toolbar"},{val:"Esc",desc:"Return focus to previous position"}]}]}),Be.PLUGINS.help=function(o){var n,r=o.$,i="help";return{_init:function e(){},show:function l(){if(!n){var e="<h4>"+o.language.translate("Shortcuts")+"</h4>",t=function s(){for(var e='<div class="fr-help-modal">',t=0;t<o.opts.helpSets.length;t++){var a=o.opts.helpSets[t],n="<table>";n+="<thead><tr><th>"+o.language.translate(a.title)+"</th></tr></thead>",n+="<tbody>";for(var r=0;r<a.commands.length;r++){var i=a.commands[r];n+="<tr>",n+="<td>"+o.language.translate(i.desc)+"</td>",n+="<td>"+i.val.replace("OSkey",o.helpers.isMac()?"&#8984;":"Ctrl+")+"</td>",n+="</tr>"}e+=n+="</tbody></table>"}return e+="</div>"}(),a=o.modals.create(i,e,t);n=a.$modal,o.events.$on(r(o.o_win),"resize",function(){o.modals.resize(i)})}o.modals.show(i),o.modals.resize(i)},hide:function t(){o.modals.hide(i)}}},Be.DefineIcon("help",{NAME:"question",SVG_KEY:"help"}),Be.RegisterShortcut(Be.KEYCODE.SLASH,"help",null,"/"),Be.RegisterCommand("help",{title:"Help",icon:"help",undo:!1,focus:!1,modal:!0,callback:function(){this.help.show()},plugin:"help",showOnMobile:!1}),Object.assign(Be.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(Be.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","webp"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),Be.PLUGINS.image=function(f){var p,l,c,d,o,a,u=f.$,s="https://i.froala.com/upload",t=!1,n=1,h=2,g=3,m=4,v=5,E=6,r={};function b(){var e=f.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),p&&e.val(p.attr("src")),e.trigger("change")}function i(){var e=f.popups.get("image.edit");if(e||(e=x()),e){var t=Ae();Te()&&(t=t.find(".fr-img-wrap")),f.popups.setContainer("image.edit",f.$sc),f.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();p.hasClass("fr-uploading")?F():f.popups.show("image.edit",a,n,t.outerHeight(),!0)}}function A(){k()}function T(e){0<e.parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first());var t=e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,a=e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":ge(e);he(e,t,a),e.removeClass("fr-dib fr-dii fr-fir fr-fil")}function C(){for(var e,t="IMG"==f.el.tagName?[f.el]:f.el.querySelectorAll("img"),a=0;a<t.length;a++){var n=u(t[a]);!f.opts.htmlUntouched&&f.opts.useClasses?((f.opts.imageDefaultAlign||f.opts.imageDefaultDisplay)&&(0<(e=n).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first()),e.hasClass("fr-dii")||e.hasClass("fr-dib")||(e.addClass("fr-fi"+ge(e)[0]),e.addClass("fr-di"+me(e)[0]),e.css("margin",""),e.css("float",""),e.css("display",""),e.css("z-index",""),e.css("position",""),e.css("overflow",""),e.css("vertical-align",""))),f.opts.imageTextNear||(0<n.parents(".fr-img-caption").length?n.parents(".fr-img-caption").first().removeClass("fr-dii").addClass("fr-dib"):n.removeClass("fr-dii").addClass("fr-dib"))):f.opts.htmlUntouched||f.opts.useClasses||(f.opts.imageDefaultAlign||f.opts.imageDefaultDisplay)&&T(n),f.opts.iframe&&n.on("load",f.size.syncIframe)}}function R(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(f.el.querySelectorAll("img")),n=[];for(t=0;t<a.length;t++)if(n.push(a[t].getAttribute("src")),u(a[t]).toggleClass("fr-draggable",f.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&f.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;f.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var i=a[t].nextSibling;i&&!f.browser.mozilla&&i.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)n.indexOf(o[t].getAttribute("src"))<0&&f.events.trigger("image.removed",[u(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&f.events.trigger("image.loaded",[u(a[t])])}o=a}function S(){if(l||function s(){var e;f.shared.$image_resizer?(l=f.shared.$image_resizer,d=f.shared.$img_overlay,f.events.on("destroy",function(){u("body").first().append(l.removeClass("fr-active"))},!0)):(f.shared.$image_resizer=u(document.createElement("div")).attr("class","fr-image-resizer"),l=f.shared.$image_resizer,f.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),f.opts.imageResize&&(l.append(L("nw")+L("ne")+L("sw")+L("se")),f.shared.$img_overlay=u(document.createElement("div")).attr("class","fr-image-overlay"),d=f.shared.$img_overlay,e=l.get(0).ownerDocument,u(e).find("body").first().append(d)));f.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,f.opts.imageResize&&(d.remove(),d=null)},!0),f.helpers.isMobile()||f.events.$on(u(f.o_win),"resize",function(){p&&!p.hasClass("fr-uploading")?de(!0):p&&(S(),ve(),F(!1))});if(f.opts.imageResize){e=l.get(0).ownerDocument,f.events.$on(l,f._mousedown,".fr-handler",w),f.events.$on(u(e),f._mousemove,y),f.events.$on(u(e.defaultView||e.parentWindow),f._mouseup,I),f.events.$on(d,"mouseleave",I);var n=1,r=null,i=0;f.events.on("keydown",function(e){if(p){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-i)&&(n=1),(a==Be.KEYCODE.EQUALS||f.browser.mozilla&&a==Be.KEYCODE.FF_EQUALS)&&t&&!e.altKey?n=ee.call(this,e,1,1,n):(a==Be.KEYCODE.HYPHEN||f.browser.mozilla&&a==Be.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?n=ee.call(this,e,2,-1,n):f.keys.ctrlKey(e)||a!=Be.KEYCODE.ENTER||(p.before("<br>"),M(p)),r=a,i=e.timeStamp}},!0),f.events.on("keyup",function(){n=1})}}(),!p)return!1;var e=f.$wp||f.$sc;e.append(l),l.data("instance",f);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=f.helpers.getPX(e.css("border-left-width")),t-=f.helpers.getPX(e.css("border-top-width")),f.$el.is("img")&&f.$sc.is("body")&&(a=t=0);var n=Ae();Te()&&(n=n.find(".fr-img-wrap"));var r=0,i=0;f.opts.iframe&&(r=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-top")),i=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-left"))),l.css("top",(f.opts.iframe?n.offset().top+r:n.offset().top+t)-1).css("left",(f.opts.iframe?n.offset().left+i:n.offset().left+a)-1).css("width",n.get(0).getBoundingClientRect().width).css("height",n.get(0).getBoundingClientRect().height).addClass("fr-active")}function L(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function _(e){Te()?p.parents(".fr-img-caption").css("width",e):p.css("width",e)}function w(e){if(!f.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),f.$el.find("img.fr-error").left)return!1;f.undo.canDo()||f.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=f.$oel.get(0).ownerDocument,n=a.defaultView||a.parentWindow,r=!1;try{r=n.location!=n.parent.location&&!(n.$&&n.$.FE)}catch(o){}r&&n.frameElement&&(t+=f.helpers.getPX(u(n.frameElement).offset().left)+n.frameElement.clientLeft)}(c=u(this)).data("start-x",t),c.data("start-width",p.width()),c.data("start-height",p.height());var i=p.width();if(f.opts.imageResizeWithPercent){var s=p.parentsUntil(f.$el,f.html.blockTagsQuery()).get(0)||f.el;i=(i/u(s).outerWidth()*100).toFixed(2)+"%"}_(i),d.show(),f.popups.hideAll(),ue()}function y(e){if(!f.core.sameInstance(l))return!0;var t;if(c&&p){if(e.preventDefault(),f.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var n=a-c.data("start-x"),r=c.data("start-width");if((c.hasClass("fr-hnw")||c.hasClass("fr-hsw"))&&(n=0-n),f.opts.imageResizeWithPercent){var i=p.parentsUntil(f.$el,f.html.blockTagsQuery()).get(0)||f.el;r=((r+n)/u(i).outerWidth()*100).toFixed(2),f.opts.imageRoundPercent&&(r=Math.round(r)),_(r+"%"),(t=Te()?(f.helpers.getPX(p.parents(".fr-img-caption").css("width"))/u(i).outerWidth()*100).toFixed(2):(f.helpers.getPX(p.css("width"))/u(i).outerWidth()*100).toFixed(2))===r||f.opts.imageRoundPercent||_(t+"%"),p.css("height","").removeAttr("height")}else r+n>=f.opts.imageMinWidth&&(_(r+n),t=Te()?f.helpers.getPX(p.parents(".fr-img-caption").css("width")):f.helpers.getPX(p.css("width"))),t!==r+n&&_(t),((p.attr("style")||"").match(/(^height:)|(; *height:)/)||p.attr("height"))&&(p.css("height",c.data("start-height")*p.width()/c.data("start-width")),p.removeAttr("height"));S(),f.events.trigger("image.resize",[be()])}}function I(e){if(!f.core.sameInstance(l))return!0;if(c&&p){if(e&&e.stopPropagation(),f.$el.find("img.fr-error").left)return!1;c=null,d.hide(),S(),i(),f.undo.saveStep(),f.events.trigger("image.resizeEnd",[be()])}}function O(e,t,a){f.edit.on(),p&&p.addClass("fr-error"),r[e]?D(r[e]):D(f.language.translate("Something went wrong. Please try again.")),!p&&a&&te(a),f.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function x(e){if(e)return f.$wp&&f.events.$on(f.$wp,"scroll.image-edit",function(){p&&f.popups.isVisible("image.edit")&&(f.events.disableBlur(),i())}),!0;var t="";if(0<f.opts.imageEditButtons.length){var a={buttons:t+='<div class="fr-buttons"> \n '.concat(f.button.buildList(f.opts.imageEditButtons),"\n </div>")};return f.popups.create("image.edit",a)}return!1}function F(e){var t=f.popups.get("image.insert");if(t||(t=z()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),p){var a=Ae();f.popups.setContainer("image.insert",f.$sc);var n=a.offset().left,r=a.offset().top+a.height();f.popups.show("image.insert",n,r,a.outerHeight())}void 0===e&&N(f.language.translate("Uploading"),0)}function k(e){var t=f.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||f.$el.find("img.fr-error").length)){if(f.events.focus(),f.$el.find("img.fr-error").length&&(f.$el.find("img.fr-error").remove(),f.undo.saveStep(),f.undo.run(),f.undo.dropRedo()),!f.$wp&&p){var a=p;de(!0),f.selection.setAfter(a.get(0)),f.selection.restore()}f.popups.hide("image.insert")}}function N(e,t){var a=f.popups.get("image.insert");if(a){var n=a.find(".fr-image-progress-bar-layer");n.find("h3").text(e+(t?" "+t+"%":"")),n.removeClass("fr-error"),t?(n.find("div").removeClass("fr-indeterminate"),n.find("div > span").css("width",t+"%")):n.find("div").addClass("fr-indeterminate")}}function D(e){F();var t=f.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),f.events.disableBlur(),a.focus()}function M(e){ce.call(e.get(0))}function B(){var e=u(this);f.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),M(e),f.events.trigger("image.loaded",[e])}function P(s,e,o,l,c){f.edit.off(),N(f.language.translate("Loading image")),e&&(s=f.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){f.undo.canDo()||l.hasClass("fr-uploading")||f.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),f.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var n=e.get(0).attributes,r=0;r<n.length;r++){var i=n[r];0===i.nodeName.indexOf("data-")&&e.removeAttr(i.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",B),e.attr("src",s),f.edit.on(),R(!1),f.undo.saveStep(),f.events.disableBlur(),f.$el.blur(),f.events.trigger(a?"image.replaced":"image.inserted",[e,c])}else e=H(s,o,B),R(!1),f.undo.saveStep(),f.events.disableBlur(),f.$el.blur(),f.events.trigger("image.inserted",[e,c])},t.onerror=function(){O(n)},F(f.language.translate("Loading image")),t.src=s}function U(e){N(f.language.translate("Loading image"));var t=this.status,a=this.response,n=this.responseXML,r=this.responseText;try{if(f.opts.imageUploadToS3)if(201==t){var i=function o(e){try{var t=u(e).find("Location").text(),a=u(e).find("Key").text();return!1===f.events.trigger("image.uploadedToS3",[t,a,e],!0)?(f.edit.on(),!1):t}catch(n){return O(m,e),!1}}(n);i&&P(i,!1,[],e,a||n)}else O(m,a||n,e);else if(200<=t&&t<300){var s=function l(e){try{if(!1===f.events.trigger("image.uploaded",[e],!0))return f.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(O(h,e),!1)}catch(a){return O(m,e),!1}}(r);s&&P(s.link,!1,s,e,a||r)}else O(g,a||r,e)}catch(c){O(m,a||r,e)}}function W(){O(m,this.response||this.responseText||this.responseXML)}function K(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;N(f.language.translate("Uploading"),t)}}function H(e,t,a){var n,r=u(document.createElement("img")).attr("src",e);if(t&&void 0!==t)for(n in t)t.hasOwnProperty(n)&&"link"!=n&&(" data-"+n+'="'+t[n]+'"',r.attr("data-str"+n,t[n]));var i=f.opts.imageDefaultWidth;i&&"auto"!=i&&(i=f.opts.imageResizeWithPercent?"100%":i+"px"),r.attr("style",i?"width: "+i+";":""),he(r,f.opts.imageDefaultDisplay,f.opts.imageDefaultAlign),r.on("load",a),r.on("error",a),f.edit.on(),f.events.focus(!0),f.selection.restore(),f.undo.saveStep(),f.opts.imageSplitHTML?f.markers.split():f.markers.insert(),f.html.wrap();var s=f.$el.find(".fr-marker");return s.length?(s.parent().is("hr")&&s.parent().after(s),f.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(r)):f.$el.append(r),f.selection.clear(),r}function $(){f.edit.on(),k(!0)}function G(e,t){if(void 0!==e&&0<e.length){if(!1===f.events.trigger("image.beforeUpload",[e,t]))return!1;var a,n=e[0];if((null===f.opts.imageUploadURL||f.opts.imageUploadURL==s)&&!f.opts.imageUploadToS3)return function o(r,i){var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:r.type})),f.image.insert(e,!1,null,i)}},F(),s.readAsDataURL(r)}(n,t||p),!1;if(n.name||(n.name=(new Date).getTime()+"."+(n.type||"image/jpeg").replace(/image\//g,"")),n.size>f.opts.imageMaxSize)return O(v),!1;if(f.opts.imageAllowedTypes.indexOf(n.type.replace(/image\//g,""))<0)return O(E),!1;if(f.drag_support.formdata&&(a=f.drag_support.formdata?new FormData:null),a){var r;if(!1!==f.opts.imageUploadToS3)for(r in a.append("key",f.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(n.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",n.type),f.opts.imageUploadToS3.params)f.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,f.opts.imageUploadToS3.params[r]);for(r in f.opts.imageUploadParams)f.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,f.opts.imageUploadParams[r]);a.append(f.opts.imageUploadParam,n,n.name);var i=f.opts.imageUploadURL;f.opts.imageUploadToS3&&(i=f.opts.imageUploadToS3.uploadURL?f.opts.imageUploadToS3.uploadURL:"https://"+f.opts.imageUploadToS3.region+".amazonaws.com/"+f.opts.imageUploadToS3.bucket),function l(t,a,e,r){function i(){var e=u(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),f.placeholder.refresh(),M(e),S(),F(),f.edit.off(),t.onload=function(){U.call(t,e)},t.onerror=W,t.upload.onprogress=K,t.onabort=$,u(e.off("abortUpload")).on("abortUpload",function(){4!=t.readyState&&(t.abort(),r?(r.attr("src",r.data("fr-old-src")),r.removeClass("fr-uploading")):e.remove(),de(!0))}),t.send(a)}var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.get(0).addEventListener("load",i),r.on("error",function(){i(),u(this).off("error")}),f.edit.on(),f.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):H(e,null,i)},s.readAsDataURL(e)}(f.core.getXHR(i,f.opts.imageUploadMethod),a,n,t||p)}}}function Y(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function V(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=f.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!f.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;f.markers.remove(),f.markers.insertAtPoint(e.originalEvent),f.$el.find(".fr-marker").replaceWith(Be.MARKERS),0===f.$el.find(".fr-marker").length&&f.selection.setAtEnd(f.el),f.popups.hideAll();var n=f.popups.get("image.insert");n||(n=z()),f.popups.setContainer("image.insert",f.$sc);var r=e.originalEvent.pageX,i=e.originalEvent.pageY;if(f.opts.iframe){var s=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-top")),o=f.helpers.getPX(f.$wp.find(".fr-iframe").css("padding-left"));i+=f.$iframe.offset().top+s,r+=f.$iframe.offset().left+o}return f.popups.show("image.insert",r,i),F(),0<=f.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(de(!0),G(t.files)):O(E),e.preventDefault(),e.stopPropagation(),!1}}}function z(e){if(e)return f.popups.onRefresh("image.insert",b),f.popups.onHide("image.insert",A),!0;var t,a,n="";f.opts.imageUpload||-1===f.opts.imageInsertButtons.indexOf("imageUpload")||f.opts.imageInsertButtons.splice(f.opts.imageInsertButtons.indexOf("imageUpload"),1);var r=f.button.buildList(f.opts.imageInsertButtons);""!==r&&(n='<div class="fr-buttons fr-tabs">'+r+"</div>");var i=f.opts.imageInsertButtons.indexOf("imageUpload"),s=f.opts.imageInsertButtons.indexOf("imageByURL"),o="";0<=i&&(t=" fr-active",0<=s&&s<i&&(t=""),o='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+f.id+'"><strong>'+f.language.translate("Drop image")+"</strong><br>("+f.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+f.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+f.id+'" role="button"></div></div>');var l="";0<=s&&(t=" fr-active",0<=i&&i<s&&(t=""),l='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+f.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+f.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+f.language.translate("Insert")+"</button></div></div>");var c={buttons:n,upload_layer:o,by_url_layer:l,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'};return 1<=f.opts.imageInsertButtons.length&&(a=f.popups.create("image.insert",c)),f.$wp&&f.events.$on(f.$wp,"scroll",function(){p&&f.popups.isVisible("image.insert")&&ve()}),function d(n){f.events.$on(n,"dragover dragenter",".fr-image-upload-layer",function(){return u(this).addClass("fr-drop"),!1},!0),f.events.$on(n,"dragleave dragend",".fr-image-upload-layer",function(){return u(this).removeClass("fr-drop"),!1},!0),f.events.$on(n,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),u(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=n.data("instance")||f;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),f.helpers.isIOS()&&f.events.$on(n,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){u(this).trigger("click")},!0),f.events.$on(n,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=n.data("instance")||f;e.events.disableBlur(),n.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,p)}u(this).val("")},!0)}(a),a}function j(){p&&f.popups.get("image.alt").find("input").val(p.attr("alt")||"").trigger("change")}function q(){var e=f.popups.get("image.alt");e||(e=X()),k(),f.popups.refresh("image.alt"),f.popups.setContainer("image.alt",f.$sc);var t=Ae();Te()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();f.popups.show("image.alt",a,n,t.outerHeight(),!0)}function X(e){if(e)return f.popups.onRefresh("image.alt",j),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+f.button.buildList(f.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+f.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+f.id+'" type="text" placeholder="'+f.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+f.language.translate("Update")+"</button></div></div>"},a=f.popups.create("image.alt",t);return f.$wp&&f.events.$on(f.$wp,"scroll.image-alt",function(){p&&f.popups.isVisible("image.alt")&&q()}),a}function Q(){var e=f.popups.get("image.size");if(p)if(Te()){var t=p.parent();t.get(0).style.width||(t=p.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(p.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(p.get(0).style.height).trigger("change")}function J(){var e=f.popups.get("image.size");e||(e=Z()),k(),f.popups.refresh("image.size"),f.popups.setContainer("image.size",f.$sc);var t=Ae();Te()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();f.popups.show("image.size",a,n,t.outerHeight(),!0)}function Z(e){if(e)return f.popups.onRefresh("image.size",Q),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+f.button.buildList(f.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+f.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+f.id+'" type="text" name="width" placeholder="'+f.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+f.id+'" type="text" name="height" placeholder="'+f.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+f.language.translate("Update")+"</button></div></div>"},a=f.popups.create("image.size",t);return f.$wp&&f.events.$on(f.$wp,"scroll.image-size",function(){p&&f.popups.isVisible("image.size")&&J()}),a}function ee(e,t,a,n){return e.pageX=t,w.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,n)),y.call(this,e),I.call(this,e),++n}function te(e){(e=e||Ae())&&!1!==f.events.trigger("image.beforeRemove",[e])&&(f.popups.hideAll(),Ee(),de(!0),f.undo.canDo()||f.undo.saveStep(),e.get(0)==f.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(f.selection.setBefore(e.get(0).parentNode)||f.selection.setAfter(e.get(0).parentNode)||e.parent().after(Be.MARKERS),u(e.get(0).parentNode).remove()):(f.selection.setBefore(e.get(0))||f.selection.setAfter(e.get(0))||e.after(Be.MARKERS),e.remove()),f.html.fillEmptyBlocks(),f.selection.restore()),f.undo.saveStep())}function ae(e){var t=e.which;if(p&&(t==Be.KEYCODE.BACKSPACE||t==Be.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),te(),!1;if(p&&t==Be.KEYCODE.ESC){var a=p;return de(!0),f.selection.setAfter(a.get(0)),f.selection.restore(),e.preventDefault(),!1}if(!p||t!=Be.KEYCODE.ARROW_LEFT&&t!=Be.KEYCODE.ARROW_RIGHT)return p&&t===Be.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),de(!0),!1):p&&t!=Be.KEYCODE.F10&&!f.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0;var n=p.get(0);return de(!0),t==Be.KEYCODE.ARROW_LEFT?f.selection.setBefore(n):f.selection.setAfter(n),f.selection.restore(),e.preventDefault(),!1}function ne(e){if(e&&"IMG"==e.tagName){if(f.node.hasClass(e,"fr-uploading")||f.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):f.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&f.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var n=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<n.length;r++)ne(n[r])}function re(e){if(!1===f.events.trigger("image.beforePasteUpload",[e]))return!1;p=u(e),S(),i(),ve(),F(),p.on("load",function(){S(),u(f.popups.get("image.insert").get(0)).find("div.fr-active.fr-error").length<1&&F(),u(this).off("load")});for(var t=u(e).attr("src").split(","),a=atob(t[1]),n=[],r=0;r<a.length;r++)n.push(a.charCodeAt(r));G([new Blob([new Uint8Array(n)],{type:t[0].replace(/data\:/g,"").replace(/;base64/g,"")})],p)}function ie(){f.opts.imagePaste?f.$el.find("img[data-fr-image-pasted]").each(function(e,n){if(f.opts.imagePasteProcess){var t=f.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=f.opts.imageResizeWithPercent?"%":"px"),u(n).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),he(u(n),f.opts.imageDefaultDisplay,f.opts.imageDefaultAlign)}if(0===n.src.indexOf("data:"))re(n);else if(0===n.src.indexOf("blob:")||0===n.src.indexOf("http")&&f.opts.imageUploadRemoteUrls&&f.opts.imageCORSProxy){var a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var e,t=f.o_doc.createElement("CANVAS"),a=t.getContext("2d");t.height=this.naturalHeight,t.width=this.naturalWidth,a.drawImage(this,0,0),setTimeout(function(){re(n)},0),e=2e3<this.naturalWidth||1500<this.naturalHeight?"jpeg":"png",n.src=t.toDataURL("image/"+e)},a.src=(0===n.src.indexOf("blob:")?"":f.opts.imageCORSProxy+"/")+n.src}else 0!==n.src.indexOf("http")||0===n.src.indexOf("https://mail.google.com/mail")?(f.selection.save(),u(n).remove(),f.selection.restore()):u(n).removeAttr("data-fr-image-pasted")}):f.$el.find("img[data-fr-image-pasted]").remove()}function se(e){var t=e.target.result,a=f.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=f.opts.imageResizeWithPercent?"%":"px"),f.undo.saveStep(),f.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var n=f.$el.find('img[data-fr-image-pasted="true"]');n&&he(n,f.opts.imageDefaultDisplay,f.opts.imageDefaultAlign),f.events.trigger("paste.after")}function oe(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.types&&-1!=[].indexOf.call(e.clipboardData.types,"text/rtf")||e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return function n(e){var t=new FileReader;t.onload=se,t.readAsDataURL(e)}(t),!1}}function le(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ce(e){if("false"==u(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&f.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<Be.INSTANCES.length;t++)Be.INSTANCES[t]!=f&&Be.INSTANCES[t].events.trigger("image.hideResizer");f.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),f.helpers.isMobile()&&(f.events.disableBlur(),f.$el.blur(),f.events.enableBlur()),f.opts.iframe&&f.size.syncIframe(),p=u(this),Ee(),S(),i(),f.browser.msie?(f.popups.areVisible()&&f.events.disableBlur(),f.win.getSelection&&(f.win.getSelection().removeAllRanges(),f.win.getSelection().addRange(f.doc.createRange()))):f.selection.clear(),f.helpers.isIOS()&&(f.events.disableBlur(),f.$el.blur()),f.button.bulkRefresh(),f.events.trigger("video.hideResizer")}function de(e){p&&(function t(){return fe}()||!0===e)&&(f.toolbar.enable(),l.removeClass("fr-active"),f.popups.hide("image.edit"),p=null,ue(),c=null,d&&d.hide())}r[n]="Image cannot be loaded from the passed link.",r[h]="No link in upload response.",r[g]="Error during file upload.",r[m]="Parsing response failed.",r[v]="File is too large.",r[E]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var fe=!(r[8]="Image file is corrupted.");function pe(){fe=!0}function ue(){fe=!1}function he(e,t,a){!f.opts.htmlUntouched&&f.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:f.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*f.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+f.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+f.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:f.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function ge(e){if(void 0===e&&(e=Ae()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function me(e){void 0===e&&(e=Ae());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ve(){var e=f.popups.get("image.insert");e||(e=z()),f.popups.isVisible("image.insert")||(k(),f.popups.refresh("image.insert"),f.popups.setContainer("image.insert",f.$sc));var t=Ae();Te()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();f.popups.show("image.insert",a,n,t.outerHeight(!0),!0)}function Ee(){if(p){f.events.disableBlur(),f.selection.clear();var e=f.doc.createRange();e.selectNode(p.get(0)),f.browser.msie&&e.collapse(!0),f.selection.get().addRange(e),f.events.enableBlur()}}function be(){return p}function Ae(){return Te()?p.parents(".fr-img-caption").first():p}function Te(){return!!p&&0<p.parents(".fr-img-caption").length}return{_init:function Ce(){var n;(function e(){f.events.$on(f.$el,f._mousedown,"IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==u(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;f.helpers.isMobile()||f.selection.clear(),t=!0,f.popups.areVisible()&&f.events.disableBlur(),f.browser.msie&&(f.events.disableBlur(),f.$el.attr("contenteditable",!1)),f.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),f.events.$on(f.$el,f._mousedown,".fr-img-caption .fr-inner",function(e){f.core.hasFocus()||f.events.focus(),e.stopPropagation()}),f.events.$on(f.$el,"paste",".fr-img-caption .fr-inner",function(e){f.toolbar.hide(),e.stopPropagation()}),f.events.$on(f.$el,f._mouseup,"IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==u(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),f.browser.msie&&(f.$el.attr("contenteditable",!0),f.events.enableBlur()))}),f.events.on("keyup",function(e){if(e.shiftKey&&""===f.selection.text().replace(/\n/g,"")&&f.keys.isArrow(e.which)){var t=f.selection.element(),a=f.selection.endElement();t&&"IMG"==t.tagName?M(u(t)):a&&"IMG"==a.tagName&&M(u(a))}},!0),f.events.on("drop",V),f.events.on("element.beforeDrop",Y),f.events.on("mousedown window.mousedown",pe),f.events.on("window.touchmove",ue),f.events.on("mouseup window.mouseup",function(){if(p)return de(),!1;ue()}),f.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&de()}),f.events.on("image.resizeEnd",function(){f.opts.iframe&&f.size.syncIframe()}),f.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){de(!(t=!1))}),f.events.on("modals.hide",function(){p&&(Ee(),f.selection.clear())}),f.events.on("image.resizeEnd",function(){f.win.getSelection&&M(p)}),f.opts.imageAddNewLine&&f.events.on("image.inserted",function(e){var t=e.get(0);for(t.nextSibling&&"BR"===t.nextSibling.tagName&&(t=t.nextSibling);t&&!f.node.isElement(t);)t=f.node.isLastSibling(t)?t.parentNode:null;f.node.isElement(t)&&(f.opts.enter===Be.ENTER_BR?e.after("<br>"):u(f.node.blockParent(e.get(0))).after("<"+f.html.defaultTag()+"><br></"+f.html.defaultTag()+">"))})})(),"IMG"==f.el.tagName&&f.$el.addClass("fr-view"),f.events.$on(f.$el,f.helpers.isMobile()&&!f.helpers.isWindowsPhone()?"touchend":"click","IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',ce),f.helpers.isMobile()&&(f.events.$on(f.$el,"touchstart","IMG"==f.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),f.events.$on(f.$el,"touchmove",function(){a=!0})),f.$wp?(f.events.on("window.keydown keydown",ae,!0),f.events.on("keyup",function(e){if(p&&e.which==Be.KEYCODE.ENTER)return!1},!0),f.events.$on(f.$el,"keydown",function(){var e=f.selection.element();(e.nodeType===Node.TEXT_NODE||"BR"==e.tagName&&f.node.isLastSibling(e))&&(e=e.parentNode),f.node.hasClass(e,"fr-inner")||(f.node.hasClass(e,"fr-img-caption")||(e=u(e).parents(".fr-img-caption").get(0)),f.node.hasClass(e,"fr-img-caption")&&(u(e).after(Be.INVISIBLE_SPACE+Be.MARKERS),f.selection.restore()))})):f.events.$on(f.$win,"keydown",ae),f.events.on("toolbar.esc",function(){if(p){if(f.$wp)f.events.disableBlur(),f.events.focus();else{var e=p;de(!0),f.selection.setAfter(e.get(0)),f.selection.restore()}return!1}},!0),f.events.on("toolbar.focusEditor",function(){if(p)return!1},!0),f.events.on("window.cut window.copy",function(e){if(p&&f.popups.isVisible("image.edit")&&!f.popups.get("image.edit").find(":focus").length){var t=Ae();Te()?(t.before(Be.START_MARKER),t.after(Be.END_MARKER),f.selection.restore(),f.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(Ee(),f.paste.saveCopiedText(p.get(0).outerHTML,p.attr("alt"))),"copy"==e.type?setTimeout(function(){M(p)}):(de(!0),f.undo.saveStep(),setTimeout(function(){f.undo.saveStep()},0))}},!0),f.browser.msie&&f.events.on("keydown",function(e){if(!f.selection.isCollapsed()||!p)return!0;var t=e.which;t==Be.KEYCODE.C&&f.keys.ctrlKey(e)?f.events.trigger("window.copy"):t==Be.KEYCODE.X&&f.keys.ctrlKey(e)&&f.events.trigger("window.cut")}),f.events.$on(u(f.o_win),"keydown",function(e){var t=e.which;if(p&&t==Be.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),f.events.$on(f.$win,"keydown",function(e){var t=e.which;p&&p.hasClass("fr-uploading")&&t==Be.KEYCODE.ESC&&p.trigger("abortUpload")}),f.events.on("destroy",function(){p&&p.hasClass("fr-uploading")&&p.trigger("abortUpload")}),f.events.on("paste.before",oe),f.events.on("paste.beforeCleanup",le),f.events.on("paste.after",ie),f.events.on("html.set",C),f.events.on("html.inserted",C),C(),f.events.on("destroy",function(){o=[]}),f.events.on("html.processGet",ne),f.opts.imageOutputSize&&f.events.on("html.beforeGet",function(){n=f.el.querySelectorAll("img");for(var e=0;e<n.length;e++){var t=n[e].style.width||u(n[e]).width(),a=n[e].style.height||u(n[e]).height();t&&n[e].setAttribute("width",(""+t).replace(/px/,"")),a&&n[e].setAttribute("height",(""+a).replace(/px/,""))}}),f.opts.iframe&&f.events.on("image.loaded",f.size.syncIframe),f.$wp&&(R(),f.events.on("contentChanged",R)),f.events.$on(u(f.o_win),"orientationchange.image",function(){setTimeout(function(){p&&M(p)},100)}),x(!0),z(!0),Z(!0),X(!0),f.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return te(e),!1})},showInsertPopup:function Re(){var e=f.$tb.find('.fr-command[data-cmd="insertImage"]'),t=f.popups.get("image.insert");if(t||(t=z()),k(),!t.hasClass("fr-active"))if(f.popups.refresh("image.insert"),f.popups.setContainer("image.insert",f.$tb),e.isVisible()){var a=f.button.getPosition(e),n=a.left,r=a.top;f.popups.show("image.insert",n,r,e.outerHeight())}else f.position.forSelection(t),f.popups.show("image.insert")},showLayer:function Se(e){var t,a,n=f.popups.get("image.insert");if(p||f.opts.toolbarInline){if(p){var r=Ae();Te()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left}}else{var i=f.$tb.find('.fr-command[data-cmd="insertImage"]');t=i.offset().left,a=i.offset().top+(f.opts.toolbarBottom?10:i.outerHeight()-10)}!p&&f.opts.toolbarInline&&(a=n.offset().top-f.helpers.getPX(n.css("margin-top")),n.hasClass("fr-above")&&(a+=n.outerHeight())),n.find(".fr-layer").removeClass("fr-active"),n.find(".fr-"+e+"-layer").addClass("fr-active"),f.popups.show("image.insert",t,a,p?p.outerHeight():0),f.accessibility.focusPopup(n)},refreshUploadButton:function Le(e){var t=f.popups.get("image.insert");t&&t.find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function _e(e){var t=f.popups.get("image.insert");t&&t.find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:G,insertByURL:function we(){var e=f.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){F(),N(f.language.translate("Loading image"));var t=e.val().trim();if(f.opts.imageUploadRemoteUrls&&f.opts.imageCORSProxy&&f.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?G([new Blob([this.response],{type:this.response.type||"image/png"})],p):O(n)},a.onerror=function(){P(t,!0,[],p)},a.open("GET",f.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else P(t,!0,[],p);e.val(""),e.blur()}},align:function ye(e){var t=Ae();t.removeClass("fr-fir fr-fil"),!f.opts.htmlUntouched&&f.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):he(t,me(),e),Ee(),S(),i(),f.selection.clear()},refreshAlign:function Ie(e){p&&e.find("> *").first().replaceWith(f.icon.create("image-align-"+ge()))},refreshAlignOnShow:function Oe(e,t){p&&t.find('.fr-command[data-param1="'+ge()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function xe(e){var t=Ae();t.removeClass("fr-dii fr-dib"),!f.opts.htmlUntouched&&f.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):he(t,e,ge()),Ee(),S(),i(),f.selection.clear()},refreshDisplayOnShow:function Fe(e,t){p&&t.find('.fr-command[data-param1="'+me()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ve,back:function e(){p?(f.events.disableBlur(),u(".fr-popup input:focus").blur(),M(p)):(f.events.disableBlur(),f.selection.restore(),f.events.enableBlur(),f.popups.hide("image.insert"),f.toolbar.showInline())},get:be,getEl:Ae,insert:P,showProgressBar:F,remove:te,hideProgressBar:k,applyStyle:function ke(e,t,a){if(void 0===t&&(t=f.opts.imageStyles),void 0===a&&(a=f.opts.imageMultipleStyles),!p)return!1;var n=Ae();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),n.removeClass(r.join(" "))}"object"==Pe(t[e])?(n.removeAttr("style"),n.css(t[e].style)):n.toggleClass(e),M(p)},showAltPopup:q,showSizePopup:J,setAlt:function Ne(e){if(p){var t=f.popups.get("image.alt");p.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),M(p)}},setSize:function De(e,t){if(p){var a=f.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var n=/^[\d]+((px)|%)*$/g;p.removeAttr("width").removeAttr("height"),e.match(n)?p.css("width",e):p.css("width",""),t.match(n)?p.css("height",t):p.css("height",""),Te()&&(p.parents(".fr-img-caption").removeAttr("width").removeAttr("height"),e.match(n)?p.parents(".fr-img-caption").css("width",e):p.parents(".fr-img-caption").css("width",""),t.match(n)?p.parents(".fr-img-caption").css("height",t):p.parents(".fr-img-caption").css("height","")),a&&a.find("input:focus").blur(),M(p)}},toggleCaption:function Me(){var e;if(p&&!Te()){var t,a;(e=p).parent().is("a")&&(e=p.parent()),e.attr("style")&&(a=-1<(t=e.attr("style").split(":")).indexOf("width")?t[t.indexOf("width")+1].replace(";",""):"");var n=f.opts.imageResizeWithPercent?(-1<a.indexOf("px")?null:a)||"100%":p.width()+"px";e.wrap("<span "+(f.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+p.attr("class")+'" style="'+(f.opts.useClasses?"":e.attr("style"))+'" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),p.after('<span class="fr-inner"'+(f.browser.mozilla?"":' contenteditable="true"')+">"+Be.START_MARKER+f.language.translate("Image Caption")+Be.END_MARKER+"</span>"),p.removeAttr("class").removeAttr("style").removeAttr("width"),p.parents(".fr-img-caption").css("width",n),de(!0),f.selection.restore()}else e=Ae(),p.insertAfter(e),p.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),M(p)},hasCaption:Te,exitEdit:de,edit:M}},Be.DefineIcon("insertImage",{NAME:"image",SVG_KEY:"insertImage"}),Be.RegisterShortcut(Be.KEYCODE.P,"insertImage",null,"P"),Be.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),Be.DefineIcon("imageUpload",{NAME:"upload",SVG_KEY:"upload"}),Be.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),Be.DefineIcon("imageByURL",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),Be.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),Be.DefineIcon("imageDisplay",{NAME:"star",SVG_KEY:"imageDisplay"}),Be.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),Be.DefineIcon("image-align",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("image-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("image-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("image-align-center",{NAME:"align-justify",SVG_KEY:"alignCenter"}),Be.DefineIcon("imageAlign",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Be.COMMANDS.imageAlign.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="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),Be.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),Be.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),Be.DefineIcon("imageRemove",{NAME:"trash",SVG_KEY:"remove"}),Be.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),Be.DefineIcon("imageBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.$;this.image.get()||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"))}}),Be.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),Be.DefineIcon("imageStyle",{NAME:"magic",SVG_KEY:"imageClass"}),Be.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var n=t[a];"object"==Pe(n)&&(n=n.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(n)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.$,n=this.image.getEl();n&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=n.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Be.DefineIcon("imageAlt",{NAME:"info",SVG_KEY:"imageAltText"}),Be.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),Be.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),Be.DefineIcon("imageSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),Be.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),Be.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),Be.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt",SVG_KEY:"imageCaption"}),Be.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}}),Object.assign(Be.DEFAULTS,{imageManagerLoadURL:"https://i.froala.com/load-files",imageManagerLoadMethod:"get",imageManagerLoadParams:{},imageManagerPreloader:null,imageManagerDeleteURL:"",imageManagerDeleteMethod:"post",imageManagerDeleteParams:{},imageManagerPageSize:12,imageManagerScrollOffset:20,imageManagerToggleTags:!0}),Be.PLUGINS.imageManager=function(o){var l,c,i,s,d,f,p,u,h,g,m,v=o.$,E="image_manager",e=10,b=11,A=12,T=13,C=14,R=15,a=21,n=22,r={};function S(){var e=v(window).outerWidth();return e<768?2:e<1200?3:4}function L(){d.empty();for(var e=0;e<m;e++)d.append('<div class="fr-list-column"></div>')}function _(){if(h<p.length&&(d.outerHeight()<=i.outerHeight()+o.opts.imageManagerScrollOffset||i.scrollTop()+o.opts.imageManagerScrollOffset>d.outerHeight()-i.outerHeight())){u++;for(var e=o.opts.imageManagerPageSize*(u-1);e<Math.min(p.length,o.opts.imageManagerPageSize*u);e++)t(p[e])}}function t(r){var i=new Image,s=v(document.createElement("div")).attr("class","fr-image-container fr-empty fr-image-"+g++).attr("data-loading",o.language.translate("Loading")+"..").attr("data-deleting",o.language.translate("Deleting")+"..");O(!1),i.onload=function(){s.height(Math.floor(s.width()/i.width*i.height));var a=v(document.createElement("img"));if(r.thumb)a.attr("src",r.thumb);else{if(N(C,r),!r.url)return N(R,r),!1;a.attr("src",r.url)}if(r.url&&a.attr("data-url",r.url),r.tag)if(c.find(".fr-modal-more.fr-not-available").removeClass("fr-not-available"),c.find(".fr-modal-tags").show(),0<=r.tag.indexOf(",")){for(var e=r.tag.split(","),t=0;t<e.length;t++)e[t]=e[t].trim(),0===f.find('a[title="'+e[t]+'"]').length&&f.append('<a role="button" title="'+e[t]+'">'+e[t]+"</a>");a.attr("data-tag",e.join())}else 0===f.find('a[title="'+r.tag.trim()+'"]').length&&f.append('<a role="button" title="'+r.tag.trim()+'">'+r.tag.trim()+"</a>"),a.attr("data-tag",r.tag.trim());for(var n in r.name&&a.attr("alt",r.name),r)r.hasOwnProperty(n)&&"thumb"!==n&&"url"!==n&&"tag"!==n&&a.attr("data-"+n,r[n]);s.append(a).append(v(o.icon.create("imageManagerDelete")).addClass("fr-delete-img").attr("title",o.language.translate("Delete"))).append(v(o.icon.create("imageManagerInsert")).addClass("fr-insert-img").attr("title",o.language.translate("Insert"))),f.find(".fr-selected-tag").each(function(e,t){P(a,t.text)||s.hide()}),a.on("load",function(){s.removeClass("fr-empty"),s.height("auto"),h++,I(y(parseInt(a.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1)),O(!1),h%o.opts.imageManagerPageSize==0&&_()}),o.events.trigger("imageManager.imageLoaded",[a])},i.onerror=function(){h++,s.remove(),I(y(parseInt(s.attr("class").match(/fr-image-(\d+)/)[1],10)+1)),N(e,r),h%o.opts.imageManagerPageSize==0&&_()},i.src=r.thumb||r.url,w().append(s)}function w(){var n,r;return d.find(".fr-list-column").each(function(e,t){var a=v(t);0===e?(r=a.outerHeight(),n=a):a.outerHeight()<r&&(r=a.outerHeight(),n=a)}),n}function y(e){e===undefined&&(e=0);for(var t=[],a=g-1;e<=a;a--){var n=d.find(".fr-image-"+a);n.length&&(t.push(n),v(document.createElement("div")).attr("id","fr-image-hidden-container").append(n),d.find(".fr-image-"+a).remove())}return t}function I(e){for(var t=e.length-1;0<=t;t--)w().append(e[t])}function O(e){if(e===undefined&&(e=!0),!l.isVisible())return!0;var t=S();if(t!==m){m=t;var a=y();L(),I(a)}o.modals.resize(E),e&&_()}function x(e){var t={},a=e.data();for(var n in a)a.hasOwnProperty(n)&&"url"!==n&&"tag"!==n&&(t[n]=a[n]);return t}function F(e){var t=v(e.currentTarget).siblings("img"),a=l.data("instance")||o,n=l.data("current-image");if(o.modals.hide(E),a.image.showProgressBar(),n)n.data("fr-old-src",n.attr("src")),n.trigger("click");else{a.events.focus(!0),a.selection.restore();var r=a.position.getBoundingRect(),i=r.left+r.width/2+v(o.doc).scrollLeft(),s=r.top+r.height+v(o.doc).scrollTop();a.popups.setContainer("image.insert",o.$sc),a.popups.show("image.insert",i,s)}a.image.insert(t.data("url"),!1,x(t),n)}function k(e){var i=v(e.currentTarget).siblings("img"),t=o.language.translate("Are you sure? Image will be deleted.");confirm(t)&&(o.opts.imageManagerDeleteURL?!1!==o.events.trigger("imageManager.beforeDeleteImage",[i])&&(i.parent().addClass("fr-image-deleting"),v(this).ajax({method:o.opts.imageManagerDeleteMethod,url:o.opts.imageManagerDeleteURL,data:Object.assign(Object.assign({src:i.attr("src")},x(i)),o.opts.imageManagerDeleteParams),crossDomain:o.opts.requestWithCORS,withCredentials:o.opts.requestWithCredentials,headers:o.opts.requestHeaders,done:function(e,t,a){o.events.trigger("imageManager.imageDeleted",[e]);var n=y(parseInt(i.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);i.parent().remove(),I(n),function r(){l.find("#fr-modal-tags > a").each(function(){0===l.find('#fr-image-list [data-tag*="'+v(this).text()+'"]').length&&v(this).removeClass("fr-selected-tag").hide()}),M()}(),O(!0)},fail:function(e){N(a,e.response||e.responseText)}})):N(n))}function N(e,t){10<=e&&e<20?s.hide():20<=e&&e<30&&v(".fr-image-deleting").removeClass("fr-image-deleting"),o.events.trigger("imageManager.error",[{code:e,message:r[e]},t])}function D(){var e=c.find(".fr-modal-head-line").outerHeight(),t=f.outerHeight();c.toggleClass("fr-show-tags"),c.hasClass("fr-show-tags")?(c.css("height",e+t),i.css("marginTop",e+t),f.find("a").css("opacity",1)):(c.css("height",e),i.css("marginTop",e),f.find("a").css("opacity",0))}function M(){var e=f.find(".fr-selected-tag");0<e.length?(d.find("img").parents().show(),e.each(function(e,n){d.find("img").each(function(e,t){var a=v(t);P(a,n.text)||a.parent().hide()})})):d.find("img").parents().show(),I(y()),_()}function B(e){e.preventDefault();var t=v(e.currentTarget);t.toggleClass("fr-selected-tag"),o.opts.imageManagerToggleTags&&t.siblings("a").removeClass("fr-selected-tag"),M()}function P(e,t){for(var a=(e.attr("data-tag")||"").split(","),n=0;n<a.length;n++)if(a[n]===t)return!0;return!1}return r[e]="Image cannot be loaded from the passed link.",r[b]="Error during load images request.",r[A]="Missing imageManagerLoadURL option.",r[T]="Parsing load response failed.",r[C]="Missing image thumb.",r[R]="Missing image URL.",r[a]="Error during delete image request.",r[n]="Missing imageManagerDeleteURL option.",{require:["image"],_init:function U(){if(!o.$wp&&"IMG"!==o.el.tagName)return!1},show:function W(){if(!l){var e,t='<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'.concat(o.sid,'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="').concat(Be.SVG.tags,'"/></svg></button><h4 data-text="true">').concat(o.language.translate("Manage Images"),'</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');e=o.opts.imageManagerPreloader?'<img class="fr-preloader" id="fr-preloader" alt="'+o.language.translate("Loading")+'.." src="'+o.opts.imageManagerPreloader+'" style="display: none;">':'<span class="fr-preloader" id="fr-preloader" style="display: none;">'+o.language.translate("Loading")+"</span>",e+='<div class="fr-image-list" id="fr-image-list"></div>';var a=o.modals.create(E,t,e);l=a.$modal,c=a.$head,i=a.$body}l.data("current-image",o.image.get()),o.modals.show(E),s||function n(){s=l.find("#fr-preloader"),d=l.find("#fr-image-list"),f=l.find("#fr-modal-tags"),m=S(),L(),c.css("height",c.find(".fr-modal-head-line").outerHeight()),o.events.$on(v(o.o_win),"resize",function(){O(!!p)}),o.events.bindClick(d,".fr-insert-img",F),o.events.bindClick(d,".fr-delete-img",k),o.helpers.isMobile()&&(o.events.bindClick(d,"div.fr-image-container",function(e){l.find(".fr-mobile-selected").removeClass("fr-mobile-selected"),v(e.currentTarget).addClass("fr-mobile-selected")}),l.on(o._mousedown,function(){l.find(".fr-mobile-selected").removeClass("fr-mobile-selected")})),l.on(o._mousedown+" "+o._mouseup,function(e){e.stopPropagation()}),l.on(o._mousedown,"*",function(){o.events.disableBlur()}),i.on("scroll",_),o.events.bindClick(l,"button#fr-modal-more-"+o.sid,D),o.events.bindClick(f,"a",B)}(),function r(){s.show(),d.find(".fr-list-column").empty(),o.opts.imageManagerLoadURL?v(this).ajax({url:o.opts.imageManagerLoadURL,method:o.opts.imageManagerLoadMethod,data:o.opts.imageManagerLoadParams,dataType:"json",crossDomain:o.opts.requestWithCORS,withCredentials:o.opts.requestWithCredentials,headers:o.opts.requestHeaders,done:function(e,t,a){o.events.trigger("imageManager.imagesLoaded",[e]),function n(e,t){try{d.find(".fr-list-column").empty(),g=h=u=0,p=e,_()}catch(a){N(T,t)}}(e,a.response),s.hide()},fail:function(e){N(b,e.response||e.responseText)}}):N(A)}()},hide:function K(){o.modals.hide(E)}}},!Be.PLUGINS.image)throw new Error("Image manager plugin requires image plugin.");Be.DEFAULTS.imageInsertButtons.push("imageManager"),Be.RegisterCommand("imageManager",{title:"Browse",undo:!1,focus:!1,modal:!0,callback:function(){this.imageManager.show()},plugin:"imageManager"}),Be.DefineIcon("imageManager",{NAME:"folder",SVG_KEY:"imageManager"}),Be.DefineIcon("imageManagerInsert",{NAME:"plus",SVG_KEY:"add"}),Be.DefineIcon("imageManagerDelete",{NAME:"trash",SVG_KEY:"remove"}),Object.assign(Be.DEFAULTS,{inlineClasses:{"fr-class-code":"Code","fr-class-highlighted":"Highlighted","fr-class-transparency":"Transparent"}}),Be.PLUGINS.inlineClass=function(a){var n=a.$;return{apply:function t(e){a.format.toggle("span",{"class":e})},refreshOnShow:function r(e,t){t.find(".fr-command").each(function(){var e=n(this).data("param1"),t=a.format.is("span",{"class":e});n(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}},Be.RegisterCommand("inlineClass",{type:"dropdown",title:"Inline Class",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.inlineClasses;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineClass" data-param1="'+a+'" title="'+t[a]+'">'+t[a]+"</a></li>");return e+="</ul>"},callback:function(e,t){this.inlineClass.apply(t)},refreshOnShow:function(e,t){this.inlineClass.refreshOnShow(e,t)},plugin:"inlineClass"}),Be.DefineIcon("inlineClass",{NAME:"tag",SVG_KEY:"inlineClass"}),Object.assign(Be.DEFAULTS,{inlineStyles:{"Big Red":"font-size: 20px; color: red;","Small Blue":"font-size: 14px; color: blue;"}}),Be.PLUGINS.inlineStyle=function(r){return{apply:function i(e){if(""!==r.selection.text())for(var t=e.split(";"),a=0;a<t.length;a++){var n=t[a].split(":");t[a].length&&2==n.length&&r.format.applyStyle(n[0].trim(),n[1].trim())}else r.html.insert('<span style="'+e+'">'+Be.INVISIBLE_SPACE+Be.MARKERS+"</span>")}}},Be.RegisterCommand("inlineStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.inlineStyles;for(var a in t){if(t.hasOwnProperty(a))e+='<li role="presentation"><span style="'+(t[a]+(-1===t[a].indexOf("display:block;")?" display:block;":""))+'" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineStyle" data-param1="'+t[a]+'" title="'+this.language.translate(a)+'">'+this.language.translate(a)+"</a></span></li>"}return e+="</ul>"},title:"Inline Style",callback:function(e,t){this.inlineStyle.apply(t)},plugin:"inlineStyle"}),Be.DefineIcon("inlineStyle",{NAME:"paint-brush",SVG_KEY:"inlineStyle"}),Object.assign(Be.DEFAULTS,{lineBreakerTags:["table","hr","form","dl","span.fr-video",".fr-embedly","img"],lineBreakerOffset:15,lineBreakerHorizontalOffset:10}),Be.PLUGINS.lineBreaker=function(h){var g,t,r,m=h.$;function l(e,t){var a,n,r,i,s,o,l,c;if(null==e)s=(i=t.parent()).offset().top,a=(l=t.offset().top)-Math.min((l-s)/2,h.opts.lineBreakerOffset),r=i.outerWidth(),n=i.offset().left;else if(null==t)(o=(i=e.parent()).offset().top+i.outerHeight())<(c=e.offset().top+e.outerHeight())&&(o=(i=m(i).parent()).offset().top+i.outerHeight()),a=c+Math.min(Math.abs(o-c)/2,h.opts.lineBreakerOffset),r=i.outerWidth(),n=i.offset().left;else{i=e.parent();var d=e.offset().top+e.height(),f=t.offset().top;if(f<d)return!1;a=(d+f)/2,r=i.outerWidth(),n=i.offset().left}if(h.opts.iframe){var p=h.helpers.getPX(h.$wp.find(".fr-iframe").css("padding-top")),u=h.helpers.getPX(h.$wp.find(".fr-iframe").css("padding-left"));n+=h.$iframe.offset().left-h.helpers.scrollLeft()+u,a+=h.$iframe.offset().top-h.helpers.scrollTop()+p}h.$box.append(g),g.css("top",a-h.win.pageYOffset),g.css("left",n-h.win.pageXOffset),g.css("width",r),g.data("tag1",e),g.data("tag2",t),g.addClass("fr-visible").data("instance",h)}function c(e){if(e){var t=m(e);if(0===h.$el.find(t).length)return null;if(e.nodeType!=Node.TEXT_NODE&&t.is(h.opts.lineBreakerTags.join(",")))return t;if(0<t.parents(h.opts.lineBreakerTags.join(",")).length)return e=t.parents(h.opts.lineBreakerTags.join(",")).get(0),0!==h.$el.find(m(e)).length&&m(e).is(h.opts.lineBreakerTags.join(","))?m(e):null}return null}function i(e,t){var a=h.doc.elementFromPoint(e,t);return a&&!m(a).closest(".fr-line-breaker").length&&!h.node.isElement(a)&&a!=h.$wp.get(0)&&function n(e){if("undefined"!=typeof e.inFroalaWrapper)return e.inFroalaWrapper;for(var t=e;e.parentNode&&e.parentNode!==h.$wp.get(0);)e=e.parentNode;return t.inFroalaWrapper=e.parentNode==h.$wp.get(0),t.inFroalaWrapper}(a)?a:null}function s(e,t,a){for(var n=a,r=null;n<=h.opts.lineBreakerOffset&&!r;)(r=i(e,t-n))||(r=i(e,t+n)),n+=a;return r}function d(e,t,a){for(var n=null,r=100;!n&&e>h.$box.offset().left&&e<h.$box.offset().left+h.$box.outerWidth()&&0<r;)(n=i(e,t))||(n=s(e,t,5)),"left"==a?e-=h.opts.lineBreakerHorizontalOffset:e+=h.opts.lineBreakerHorizontalOffset,r-=h.opts.lineBreakerHorizontalOffset;return n}function a(e){var t=r=null,a=null,n=h.doc.elementFromPoint(e.pageX-h.win.pageXOffset,e.pageY-h.win.pageYOffset);(t=n&&("HTML"==n.tagName||"BODY"==n.tagName||h.node.isElement(n)||0<=(n.getAttribute("class")||"").indexOf("fr-line-breaker"))?((a=s(e.pageX-h.win.pageXOffset,e.pageY-h.win.pageYOffset,1))||(a=d(e.pageX-h.win.pageXOffset-h.opts.lineBreakerHorizontalOffset,e.pageY-h.win.pageYOffset,"left")),a||(a=d(e.pageX-h.win.pageXOffset+h.opts.lineBreakerHorizontalOffset,e.pageY-h.win.pageYOffset,"right")),c(a)):c(n))?function o(e,t){var a,n,r=e.offset().top,i=e.offset().top+e.outerHeight();if(Math.abs(i-t)<=h.opts.lineBreakerOffset||Math.abs(t-r)<=h.opts.lineBreakerOffset)if(Math.abs(i-t)<Math.abs(t-r)){for(var s=(n=e.get(0)).nextSibling;s&&s.nodeType==Node.TEXT_NODE&&0===s.textContent.length;)s=s.nextSibling;if(!s)return l(e,null),!0;if(a=c(s))return l(e,a),!0}else{if(!(n=e.get(0)).previousSibling)return l(null,e),!0;if(a=c(n.previousSibling))return l(a,e),!0}g.removeClass("fr-visible").removeData("instance")}(t,e.pageY):h.core.sameInstance(g)&&g.removeClass("fr-visible").removeData("instance")}function n(e){return!(g.hasClass("fr-visible")&&!h.core.sameInstance(g))&&(h.popups.areVisible()||h.el.querySelector(".fr-selected-cell")?(g.removeClass("fr-visible"),!0):void(!1!==t||h.edit.isDisabled()||(r&&clearTimeout(r),r=setTimeout(a,30,e))))}function o(){r&&clearTimeout(r),g&&g.hasClass("fr-visible")&&g.removeClass("fr-visible").removeData("instance")}function f(){t=!0,o()}function p(){t=!1}function u(e){e.preventDefault();var t=g.data("instance")||h;g.removeClass("fr-visible").removeData("instance");var a=g.data("tag1"),n=g.data("tag2"),r=h.html.defaultTag();null==a?r&&"TD"!=n.parent().get(0).tagName&&0===n.parents(r).length?n.before("<"+r+">"+Be.MARKERS+"<br></"+r+">"):n.before(Be.MARKERS+"<br>"):r&&"TD"!=a.parent().get(0).tagName&&0===a.parents(r).length?a.after("<"+r+">"+Be.MARKERS+"<br></"+r+">"):a.after(Be.MARKERS+"<br>"),t.selection.restore(),h.toolbar.enable()}return{_init:function v(){if(!h.$wp)return!1;!function e(){h.shared.$line_breaker||(h.shared.$line_breaker=m(document.createElement("div")).attr("class","fr-line-breaker").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'+h.language.translate("Break")+'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="17" y="7" width="2" height="8"/><rect x="10" y="13" width="7" height="2"/><path d="M10.000,10.000 L10.000,18.013 L5.000,14.031 L10.000,10.000 Z"/></svg></a>')),g=h.shared.$line_breaker,h.events.on("shared.destroy",function(){g.html("").removeData().remove(),g=null},!0),h.events.on("destroy",function(){g.removeData("instance").removeClass("fr-visible"),m("body").first().append(g),clearTimeout(r)},!0),h.events.$on(g,"mousemove",function(e){e.stopPropagation()},!0),h.events.bindClick(g,"a",u)}(),t=!1,h.events.$on(h.$win,"mousemove",n),h.events.$on(m(h.win),"scroll",o),h.events.on("popups.show.table.edit",o),h.events.on("commands.after",o),h.events.$on(m(h.win),"mousedown",f),h.events.$on(m(h.win),"mouseup",p)}}},Object.assign(Be.DEFAULTS,{lineHeights:{Default:"",Single:"1",1.15:"1.15",1.5:"1.5",Double:"2"}}),Be.PLUGINS.lineHeight=function(r){var i=r.$;return{_init:function e(){},apply:function n(e){r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();var t=r.selection.blocks();t.length&&i(t[0]).parent().is("td")&&r.format.applyStyle("line-height",e.toString()),r.selection.save();for(var a=0;a<t.length;a++)i(t[a]).css("line-height",e),""===i(t[a]).attr("style")&&i(t[a]).removeAttr("style");r.html.unwrap(),r.selection.restore()},refreshOnShow:function s(e,t){var a=r.selection.blocks();if(a.length){var n=i(a[0]);t.find(".fr-command").each(function(){var e=i(this).data("param1"),t=0<=(n.attr("style")||"").indexOf("line-height: "+e+";");i(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}}},Be.RegisterCommand("lineHeight",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.lineHeights;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command '+a+'" tabIndex="-1" role="option" data-cmd="lineHeight" data-param1="'+t[a]+'" title="'+this.language.translate(a)+'">'+this.language.translate(a)+"</a></li>");return e+="</ul>"},title:"Line Height",callback:function(e,t){this.lineHeight.apply(t)},refreshOnShow:function(e,t){this.lineHeight.refreshOnShow(e,t)},plugin:"lineHeight"}),Be.DefineIcon("lineHeight",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"lineHeight"}),Object.assign(Be.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),Object.assign(Be.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkNoOpener:!0,linkNoReferrer:!0,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),Be.PLUGINS.link=function(p){var u=p.$;function h(){var e=p.image?p.image.get():null;if(e||!p.$wp)return"A"==p.el.tagName?p.el:e&&e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?e.get(0).parentNode:void 0;var t=p.selection.ranges(0).commonAncestorContainer;try{t&&(t.contains&&t.contains(p.el)||!p.el.contains(t)||p.el==t)&&(t=null)}catch(r){t=null}if(t&&"A"===t.tagName)return t;var a=p.selection.element(),n=p.selection.endElement();"A"==a.tagName||p.node.isElement(a)||(a=u(a).parentsUntil(p.$el,"a").first().get(0)),"A"==n.tagName||p.node.isElement(n)||(n=u(n).parentsUntil(p.$el,"a").first().get(0));try{n&&(n.contains&&n.contains(p.el)||!p.el.contains(n)||p.el==n)&&(n=null)}catch(r){n=null}try{a&&(a.contains&&a.contains(p.el)||!p.el.contains(a)||p.el==a)&&(a=null)}catch(r){a=null}return n&&n==a&&"A"==n.tagName?(p.browser.msie||p.helpers.isMobile())&&(p.selection.info(a).atEnd||p.selection.info(a).atStart)?null:a:null}function g(){var e,t,a,n,r=p.image?p.image.get():null,i=[];if(r)"A"==r.get(0).parentNode.tagName&&i.push(r.get(0).parentNode);else if(p.win.getSelection){var s=p.win.getSelection();if(s.getRangeAt&&s.rangeCount){n=p.doc.createRange();for(var o=0;o<s.rangeCount;++o)if((t=(e=s.getRangeAt(o)).commonAncestorContainer)&&1!=t.nodeType&&(t=t.parentNode),t&&"a"==t.nodeName.toLowerCase())i.push(t);else{a=t.getElementsByTagName("a");for(var l=0;l<a.length;++l)n.selectNodeContents(a[l]),n.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<n.compareBoundaryPoints(e.START_TO_END,e)&&i.push(a[l])}}}else if(p.doc.selection&&"Control"!=p.doc.selection.type)if("a"==(t=(e=p.doc.selection.createRange()).parentElement()).nodeName.toLowerCase())i.push(t);else{a=t.getElementsByTagName("a"),n=p.doc.body.createTextRange();for(var c=0;c<a.length;++c)n.moveToElementText(a[c]),-1<n.compareEndPoints("StartToEnd",e)&&n.compareEndPoints("EndToStart",e)<1&&i.push(a[c])}return i}function m(r){if(p.core.hasFocus()){if(i(),r&&"keyup"===r.type&&(r.altKey||r.which==Be.KEYCODE.ALT))return!0;setTimeout(function(){if(!r||r&&(1==r.which||"mouseup"!=r.type)){var e=h(),t=p.image?p.image.get():null;if(e&&!t){if(p.image){var a=p.node.contents(e);if(1==a.length&&"IMG"==a[0].tagName){var n=p.selection.ranges(0);return 0===n.startOffset&&0===n.endOffset?u(e).before(Be.MARKERS):u(e).after(Be.MARKERS),p.selection.restore(),!1}}r&&r.stopPropagation(),s(e)}}},p.helpers.isIOS()?100:0)}}function s(e){var t=p.popups.get("link.edit");t||(t=function i(){var e="";1<=p.opts.linkEditButtons.length&&("A"==p.el.tagName&&0<=p.opts.linkEditButtons.indexOf("linkRemove")&&p.opts.linkEditButtons.splice(p.opts.linkEditButtons.indexOf("linkRemove"),1),e='<div class="fr-buttons">'.concat(p.button.buildList(p.opts.linkEditButtons),"</div>"));var t={buttons:e},a=p.popups.create("link.edit",t);p.$wp&&p.events.$on(p.$wp,"scroll.link-edit",function(){h()&&p.popups.isVisible("link.edit")&&s(h())});return a}());var a=u(e);p.popups.isVisible("link.edit")||p.popups.refresh("link.edit"),p.popups.setContainer("link.edit",p.$sc);var n=a.offset().left+a.outerWidth()/2,r=a.offset().top+a.outerHeight();p.popups.show("link.edit",n,r,a.outerHeight(),!0)}function i(){p.popups.hide("link.edit")}function l(){var e=p.popups.get("link.insert"),t=h();if(t){var a,n,r=u(t),i=e.find('input.fr-link-attr[type="text"]'),s=e.find('input.fr-link-attr[type="checkbox"]');for(a=0;a<i.length;a++)(n=u(i[a])).val(r.attr(n.attr("name")||""));for(s.attr("checked",!1),a=0;a<s.length;a++)n=u(s[a]),r.attr(n.attr("name"))==n.data("checked")&&n.attr("checked",!0);e.find('input.fr-link-attr[type="text"][name="text"]').val(r.text())}else e.find('input.fr-link-attr[type="text"]').val(""),e.find('input.fr-link-attr[type="checkbox"]').attr("checked",!1),e.find('input.fr-link-attr[type="text"][name="text"]').val(p.selection.text());e.find("input.fr-link-attr").trigger("change"),(p.image?p.image.get():null)?e.find('.fr-link-attr[name="text"]').parent().hide():e.find('.fr-link-attr[name="text"]').parent().show()}function o(e){if(e)return p.popups.onRefresh("link.insert",l),!0;var t="";1<=p.opts.linkInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'+p.button.buildList(p.opts.linkInsertButtons)+"</div>");var a="",n=0;for(var r in a='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'+p.id+'">',a+='<div class="fr-input-line"><input id="fr-link-insert-layer-url-'+p.id+'" name="href" type="text" class="fr-link-attr" placeholder="'+p.language.translate("URL")+'" tabIndex="'+ ++n+'"></div>',p.opts.linkText&&(a+='<div class="fr-input-line"><input id="fr-link-insert-layer-text-'+p.id+'" name="text" type="text" class="fr-link-attr" placeholder="'+p.language.translate("Text")+'" tabIndex="'+ ++n+'"></div>'),p.opts.linkAttributes)if(p.opts.linkAttributes.hasOwnProperty(r)){var i=p.opts.linkAttributes[r];a+='<div class="fr-input-line"><input name="'+r+'" type="text" class="fr-link-attr" placeholder="'+p.language.translate(i)+'" tabIndex="'+ ++n+'"></div>'}p.opts.linkAlwaysBlank||(a+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'.concat(p.id,'" tabIndex="').concat(++n,'"><span>').concat('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg>','</span></span><label id="fr-label-target-').concat(p.id,'">').concat(p.language.translate("Open in new tab"),"</label></div>"));var s={buttons:t,input_layer:a+='<div class="fr-action-buttons"><button class="fr-command fr-submit" role="button" data-cmd="linkInsert" href="#" tabIndex="'+ ++n+'" type="button">'+p.language.translate("Insert")+"</button></div></div>"},o=p.popups.create("link.insert",s);return p.$wp&&p.events.$on(p.$wp,"scroll.link-insert",function(){(p.image?p.image.get():null)&&p.popups.isVisible("link.insert")&&f(),p.popups.isVisible("link.insert")&&d()}),o}function c(e,t,a){if(void 0===a&&(a={}),!1===p.events.trigger("link.beforeInsert",[e,t,a]))return!1;var n=p.image?p.image.get():null;n||"A"==p.el.tagName?"A"==p.el.tagName&&p.$el.focus():(p.selection.restore(),p.popups.hide("link.insert"));var r=e;p.opts.linkConvertEmailAddress&&p.helpers.isEmail(e)&&!/^mailto:.*/i.test(e)&&(e="mailto:"+e);if(""===p.opts.linkAutoPrefix||new RegExp("^("+Be.LinkProtocols.join("|")+"):.","i").test(e)||/^data:image.*/i.test(e)||/^(https?:|ftps?:|file:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||["/","{","[","#","(","."].indexOf((e||"")[0])<0&&(e=p.opts.linkAutoPrefix+p.helpers.sanitizeURL(e)),e=p.helpers.sanitizeURL(e),p.opts.linkAlwaysBlank&&(a.target="_blank"),p.opts.linkAlwaysNoFollow&&(a.rel="nofollow"),p.helpers.isEmail(r)&&(a.target=null,a.rel=null),"_blank"==a.target?(p.opts.linkNoOpener&&(a.rel?a.rel+=" noopener":a.rel="noopener"),p.opts.linkNoReferrer&&(a.rel?a.rel+=" noreferrer":a.rel="noreferrer")):null==a.target&&(a.rel?a.rel=a.rel.replace(/noopener/,"").replace(/noreferrer/,""):a.rel=null),t=t||"",e===p.opts.linkAutoPrefix)return p.popups.get("link.insert").find('input[name="href"]').addClass("fr-error"),p.events.trigger("link.bad",[r]),!1;var i,s=h();if(s){if((i=u(s)).attr("href",e),0<t.length&&i.text()!=t&&!n){for(var o=i.get(0);1===o.childNodes.length&&o.childNodes[0].nodeType==Node.ELEMENT_NODE;)o=o.childNodes[0];u(o).text(t)}n||i.prepend(Be.START_MARKER).append(Be.END_MARKER),i.attr(a),n||p.selection.restore()}else{n?(n.wrap('<a href="'+e+'"></a>'),p.image.hasCaption()&&n.parent().append(n.parents(".fr-img-caption").find(".fr-inner"))):(p.format.remove("a"),p.selection.isCollapsed()?(t=0===t.length?r:t,p.html.insert('<a href="'+e+'">'+Be.START_MARKER+t.replace(/&/g,"&amp;").replace(/</,"&lt;",">","&gt;")+Be.END_MARKER+"</a>"),p.selection.restore()):0<t.length&&t!=p.selection.text().replace(/\n/g,"")?(p.selection.remove(),p.html.insert('<a href="'+e+'">'+Be.START_MARKER+t.replace(/&/g,"&amp;")+Be.END_MARKER+"</a>"),p.selection.restore()):(!function f(){if(!p.selection.isCollapsed()){p.selection.save();for(var e=p.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();e.length;){var t=u(e.pop());t.removeClass("fr-unprocessed");var a=p.node.deepestParent(t.get(0));if(a){for(var n=t.get(0),r="",i="";n=n.parentNode,p.node.isBlock(n)||(r+=p.node.closeTagString(n),i=p.node.openTagString(n)+i),n!=a;);var s=p.node.openTagString(t.get(0))+t.html()+p.node.closeTagString(t.get(0));t.replaceWith('<span id="fr-break"></span>');var o=a.outerHTML;o=(o=o.replace(/<span id="fr-break"><\/span>/g,r+s+i)).replace(i+r,""),a.outerHTML=o}e=p.$el.find(".fr-marker.fr-unprocessed").toArray()}p.html.cleanEmptyTags(),p.selection.restore()}}(),p.format.apply("a",{href:e})));for(var l=g(),c=0;c<l.length;c++)(i=u(l[c])).attr(a),i.removeAttr("_moz_dirty");1==l.length&&p.$wp&&!n&&(u(l[0]).prepend(Be.START_MARKER).append(Be.END_MARKER),p.selection.restore())}if(n){var d=p.popups.get("link.insert");d&&d.find("input:focus").blur(),p.image.edit(n)}else m()}function d(){i();var e=h();if(e){var t=p.popups.get("link.insert");t||(t=o()),p.popups.isVisible("link.insert")||(p.popups.refresh("link.insert"),p.selection.save(),p.helpers.isMobile()&&(p.events.disableBlur(),p.$el.blur(),p.events.enableBlur())),p.popups.setContainer("link.insert",p.$sc);var a=(p.image?p.image.get():null)||u(e),n=a.offset().left+a.outerWidth()/2,r=a.offset().top+a.outerHeight();p.popups.show("link.insert",n,r,a.outerHeight(),!0)}}function f(){var e=p.image?p.image.getEl():null;if(e){var t=p.popups.get("link.insert");p.image.hasCaption()&&(e=e.find(".fr-img-wrap")),t||(t=o()),l(),p.popups.setContainer("link.insert",p.$sc);var a=e.offset().left+e.outerWidth()/2,n=e.offset().top+e.outerHeight();p.popups.show("link.insert",a,n,e.outerHeight(),!0)}}return{_init:function e(){p.events.on("keyup",function(e){e.which!=Be.KEYCODE.ESC&&m(e)}),p.events.on("window.mouseup",m),p.events.$on(p.$el,"click","a",function(e){p.edit.isDisabled()&&e.preventDefault()}),p.helpers.isMobile()&&p.events.$on(p.$doc,"selectionchange",m),o(!0),"A"==p.el.tagName&&p.$el.addClass("fr-view"),p.events.on("toolbar.esc",function(){if(p.popups.isVisible("link.edit"))return p.events.disableBlur(),p.events.focus(),!1},!0)},remove:function a(){var e=h(),t=p.image?p.image.get():null;if(!1===p.events.trigger("link.beforeRemove",[e]))return!1;t&&e?(t.unwrap(),p.image.edit(t)):e&&(p.selection.save(),u(e).replaceWith(u(e).html()),p.selection.restore(),i())},showInsertPopup:function v(){var e=p.$tb.find('.fr-command[data-cmd="insertLink"]'),t=p.popups.get("link.insert");if(t||(t=o()),!t.hasClass("fr-active"))if(p.popups.refresh("link.insert"),p.popups.setContainer("link.insert",p.$tb||p.$sc),e.isVisible()){var a=p.button.getPosition(e),n=a.left,r=a.top;p.popups.show("link.insert",n,r,e.outerHeight())}else p.position.forSelection(t),p.popups.show("link.insert")},usePredefined:function E(e){var t,a,n=p.opts.linkList[e],r=p.popups.get("link.insert"),i=r.find('input.fr-link-attr[type="text"]'),s=r.find('input.fr-link-attr[type="checkbox"]');for(n.rel&&(r.rel=n.rel),a=0;a<i.length;a++)n[(t=u(i[a])).attr("name")]?(t.val(n[t.attr("name")]),t.toggleClass("fr-not-empty",!0)):"text"!=t.attr("name")&&t.val("");for(a=0;a<s.length;a++)(t=u(s[a])).attr("checked",t.data("checked")==n[t.attr("name")]);p.accessibility.focusPopup(r)},insertCallback:function b(){var e,t,a=p.popups.get("link.insert"),n=a.find('input.fr-link-attr[type="text"]'),r=a.find('input.fr-link-attr[type="checkbox"]'),i=(n.filter('[name="href"]').val()||"").trim(),s=n.filter('[name="text"]').val(),o={};for(t=0;t<n.length;t++)e=u(n[t]),["href","text"].indexOf(e.attr("name"))<0&&(o[e.attr("name")]=e.val());for(t=0;t<r.length;t++)(e=u(r[t])).is(":checked")?o[e.attr("name")]=e.data("checked"):o[e.attr("name")]=e.data("unchecked")||null;a.rel&&(o.rel=a.rel);var l=p.helpers.scrollTop();c(i,s,o),u(p.o_win).scrollTop(l)},insert:c,update:d,get:h,allSelected:g,back:function t(){p.image&&p.image.get()?p.image.back():(p.events.disableBlur(),p.selection.restore(),p.events.enableBlur(),h()&&p.$wp?(p.selection.restore(),i(),m()):"A"==p.el.tagName?(p.$el.focus(),m()):(p.popups.hide("link.insert"),p.toolbar.showInline()))},imageLink:f,applyStyle:function A(e,t,a){void 0===a&&(a=p.opts.linkMultipleStyles),void 0===t&&(t=p.opts.linkStyles);var n=h();if(!n)return!1;if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),u(n).removeClass(r.join(" "))}u(n).toggleClass(e),m()}}},Be.DefineIcon("insertLink",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterShortcut(Be.KEYCODE.K,"insertLink",null,"K"),Be.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),Be.DefineIcon("linkOpen",{NAME:"external-link",FA5NAME:"external-link-alt",SVG_KEY:"openLink"}),Be.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},callback:function(){var e=this.link.get();e&&(-1!==e.href.indexOf("mailto:")?this.o_win.open(e.href).close():this.o_win.open(e.href,"_blank","noopener"),this.popups.hide("link.edit"))},plugin:"link"}),Be.DefineIcon("linkEdit",{NAME:"edit",SVG_KEY:"editLink"}),Be.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,popup:!0,callback:function(){this.link.update()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),Be.DefineIcon("linkRemove",{NAME:"unlink",SVG_KEY:"unlink"}),Be.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),Be.DefineIcon("linkBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(e){var t=this.link.get()&&this.doc.hasFocus();(this.image?this.image.get():null)||t||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"))},plugin:"link"}),Be.DefineIcon("linkList",{NAME:"search",SVG_KEY:"search"}),Be.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkList,a=0;a<t.length;a++)e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkList" data-param1="'+a+'">'+(t[a].displayText||t[a].text)+"</a></li>";return e+="</ul>"},callback:function(e,t){this.link.usePredefined(t)},plugin:"link"}),Be.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(e){this.link.get()?e.text(this.language.translate("Update")):e.text(this.language.translate("Insert"))},plugin:"link"}),Be.DefineIcon("imageLink",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,popup:!0,callback:function(){this.link.imageLink()},refresh:function(e){var t;this.link.get()?((t=e.prev()).hasClass("fr-separator")&&t.removeClass("fr-hidden"),e.addClass("fr-hidden")):((t=e.prev()).hasClass("fr-separator")&&t.addClass("fr-hidden"),e.removeClass("fr-hidden"))},plugin:"link"}),Be.DefineIcon("linkStyle",{NAME:"magic",SVG_KEY:"linkStyles"}),Be.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkStyle" data-param1="'+a+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},callback:function(e,t){this.link.applyStyle(t)},refreshOnShow:function(e,t){var a=this.$,n=this.link.get();if(n){var r=a(n);t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=r.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),Object.assign(Be.DEFAULTS,{listAdvancedTypes:!0}),Be.PLUGINS.lists=function(f){var p=f.$;function u(e){return'<span class="fr-open-'+e.toLowerCase()+'"></span>'}function h(e){return'<span class="fr-close-'+e.toLowerCase()+'"></span>'}function i(e,t){!function c(e,t){for(var a=[],n=0;n<e.length;n++){var r=e[n].parentNode;"LI"==e[n].tagName&&r.tagName!=t&&a.indexOf(r)<0&&a.push(r)}for(var i=a.length-1;0<=i;i--){var s=p(a[i]);s.replaceWith("<"+t.toLowerCase()+" "+f.node.attributes(s.get(0))+">"+s.html()+"</"+t.toLowerCase()+">")}}(e,t);var a,n=f.html.defaultTag(),r=null;e.length&&(a="rtl"==f.opts.direction||"rtl"==p(e[0]).css("direction")?"margin-right":"margin-left");for(var i=0;i<e.length;i++)if("TD"!=e[i].tagName&&"TH"!=e[i].tagName&&"LI"!=e[i].tagName){var s=f.helpers.getPX(p(e[i]).css(a))||0;(e[i].style.marginLeft=null)===r&&(r=s);var o=0<r?"<"+t+' style="'+a+": "+r+'px ">':"<"+t+">",l="</"+t+">";for(s-=r;0<s/f.opts.indentMargin;)o+="<"+t+">",l+=l,s-=f.opts.indentMargin;n&&e[i].tagName.toLowerCase()==n?p(e[i]).replaceWith(o+"<li"+f.node.attributes(e[i])+">"+p(e[i]).html()+"</li>"+l):p(e[i]).wrap(o+"<li></li>"+l)}f.clean.lists()}function s(e){var t,a;for(t=e.length-1;0<=t;t--)for(a=t-1;0<=a;a--)if(p(e[a]).find(e[t]).length||e[a]==e[t]){e.splice(t,1);break}var n=[];for(t=0;t<e.length;t++){var r=p(e[t]),i=e[t].parentNode,s=r.attr("class");if(r.before(h(i.tagName)),"LI"==i.parentNode.tagName)r.before(h("LI")),r.after(u("LI"));else{var o="";s&&(o+=' class="'+s+'"');var l="rtl"==f.opts.direction||"rtl"==r.css("direction")?"margin-right":"margin-left";f.helpers.getPX(p(i).css(l))&&0<=(p(i).attr("style")||"").indexOf(l+":")&&(o+=' style="'+l+":"+f.helpers.getPX(p(i).css(l))+'px;"'),f.html.defaultTag()&&0===r.find(f.html.blockTagsQuery()).length&&r.wrapInner(f.html.defaultTag()+o),f.node.isEmpty(r.get(0),!0)||0!==r.find(f.html.blockTagsQuery()).length||r.append("<br>"),r.append(u("LI")),r.prepend(h("LI"))}r.after(u(i.tagName)),"LI"==i.parentNode.tagName&&(i=i.parentNode.parentNode),n.indexOf(i)<0&&n.push(i)}for(t=0;t<n.length;t++){var c=p(n[t]),d=c.html();d=(d=d.replace(/<span class="fr-close-([a-z]*)"><\/span>/g,"</$1>")).replace(/<span class="fr-open-([a-z]*)"><\/span>/g,"<$1>"),c.replaceWith(f.node.openTagString(c.get(0))+d+f.node.closeTagString(c.get(0)))}f.$el.find("li:empty").remove(),f.$el.find("ul:empty, ol:empty").remove(),f.clean.lists(),f.html.wrap()}function o(e){f.selection.save();for(var t=0;t<e.length;t++){var a=e[t].previousSibling;if(a){var n=p(e[t]).find("> ul, > ol").last().get(0);if(n){var r=p(document.createElement("li"));p(n).prepend(r);for(var i=f.node.contents(e[t])[0];i&&!f.node.isList(i);){var s=i.nextSibling;r.append(i),i=s}p(a).append(p(n)),p(e[t]).remove()}else{var o=p(a).find("> ul, > ol").last().get(0);if(o)p(o).append(p(e[t]));else{var l=p("<"+e[t].parentNode.tagName+">");p(a).append(l),l.append(p(e[t]))}}}}f.clean.lists(),f.selection.restore()}function l(e){f.selection.save(),s(e),f.selection.restore()}function e(e){if("indent"==e||"outdent"==e){var t=!1,a=f.selection.blocks(),n=[],r=a[0].previousSibling||a[0].parentElement;if("outdent"==e){if("LI"==r.tagName||"LI"!=r.parentNode.tagName)return}else if(!a[0].previousSibling||"LI"!=a[0].previousSibling.tagName)return;for(var i=0;i<a.length;i++)"LI"==a[i].tagName?(t=!0,n.push(a[i])):"LI"==a[i].parentNode.tagName&&(t=!0,n.push(a[i].parentNode));t&&("indent"==e?o(n):l(n))}}return{_init:function t(){f.events.on("commands.after",e),f.events.on("keydown",function(e){if(e.which==Be.KEYCODE.TAB){for(var t=f.selection.blocks(),a=[],n=0;n<t.length;n++)"LI"==t[n].tagName?a.push(t[n]):"LI"==t[n].parentNode.tagName&&a.push(t[n].parentNode);if(1<a.length||a.length&&(f.selection.info(a[0]).atStart||f.node.isEmpty(a[0])))return e.preventDefault(),e.stopPropagation(),e.shiftKey?l(a):o(a),!1}},!0)},format:function c(e,t){var a,n;for(f.selection.save(),f.html.wrap(!0,!0,!0,!0),f.selection.restore(),n=f.selection.blocks(),a=0;a<n.length;a++)"LI"!=n[a].tagName&&"LI"==n[a].parentNode.tagName&&(n[a]=n[a].parentNode);if(f.selection.save(),function r(e,t){for(var a=!0,n=0;n<e.length;n++){if("LI"!=e[n].tagName)return!1;e[n].parentNode.tagName!=t&&(a=!1)}return a}(n,e)?t||s(n):i(n,e),f.html.unwrap(),f.selection.restore(),t=t||"default"){for(n=f.selection.blocks(),a=0;a<n.length;a++)"LI"!=n[a].tagName&&"LI"==n[a].parentNode.tagName&&(n[a]=n[a].parentNode);for(a=0;a<n.length;a++)"LI"==n[a].tagName&&(p(n[a].parentNode).css("list-style-type","default"===t?"":t),0===(p(n[a].parentNode).attr("style")||"").length&&p(n[a].parentNode).removeAttr("style"))}},refresh:function r(e,t){var a=p(f.selection.element());if(a.get(0)!=f.el){var n=a.get(0);(n="LI"!=n.tagName&&n.firstElementChild&&"LI"!=n.firstElementChild.tagName?a.parents("li").get(0):"LI"==n.tagName||n.firstElementChild?n.firstElementChild&&"LI"==n.firstElementChild.tagName?a.get(0).firstChild:a.get(0):a.parents("li").get(0))&&n.parentNode.tagName==t&&f.el.contains(n.parentNode)&&e.addClass("fr-active")}}}},Be.DefineIcon("formatOLSimple",{NAME:"list-ol",SVG_KEY:"orderedList"}),Be.RegisterCommand("formatOLSimple",{title:"Ordered List",type:"button",options:{"default":"Default",circle:"Circle",disc:"Disc",square:"Square"},refresh:function(e){this.lists.refresh(e,"OL")},callback:function(e,t){this.lists.format("OL",t)},plugin:"lists"}),Be.RegisterCommand("formatUL",{title:"Unordered List",type:"button",hasOptions:function(){return this.opts.listAdvancedTypes},options:{"default":"Default",circle:"Circle",disc:"Disc",square:"Square"},refresh:function(e){this.lists.refresh(e,"UL")},callback:function(e,t){this.lists.format("UL",t)},plugin:"lists"}),Be.RegisterCommand("formatOL",{title:"Ordered List",hasOptions:function(){return this.opts.listAdvancedTypes},options:{"default":"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},refresh:function(e){this.lists.refresh(e,"OL")},callback:function(e,t){this.lists.format("OL",t)},plugin:"lists"}),Be.DefineIcon("formatUL",{NAME:"list-ul",SVG_KEY:"unorderedList"}),Be.DefineIcon("formatOL",{NAME:"list-ol",SVG_KEY:"orderedList"}),Object.assign(Be.DEFAULTS,{paragraphFormat:{N:"Normal",H1:"Heading 1",H2:"Heading 2",H3:"Heading 3",H4:"Heading 4",PRE:"Code"},paragraphFormatSelection:!1,paragraphDefaultSelection:"Paragraph Format"}),Be.PLUGINS.paragraphFormat=function(p){var u=p.$;function h(e,t){var a=p.html.defaultTag();if(t&&t.toLowerCase()!=a)if(0<e.find("ul, ol").length){var n=u("<"+t+">");e.prepend(n);for(var r=p.node.contents(e.get(0))[0];r&&["UL","OL"].indexOf(r.tagName)<0;){var i=r.nextSibling;n.append(r),r=i}}else e.html("<"+t+">"+e.html()+"</"+t+">")}return{apply:function g(e){"N"==e&&(e=p.html.defaultTag()),p.selection.save(),p.html.wrap(!0,!0,!p.opts.paragraphFormat.BLOCKQUOTE,!0,!0),p.selection.restore();var t,a,n,r,i,s,o,l,c=p.selection.blocks();p.selection.save(),p.$el.find("pre").attr("skip",!0);for(var d=0;d<c.length;d++)if(c[d].tagName!=e&&!p.node.isList(c[d])){var f=u(c[d]);"LI"==c[d].tagName?h(f,e):"LI"==c[d].parentNode.tagName&&c[d]?(s=f,o=e,l=p.html.defaultTag(),o&&o.toLowerCase()!=l||(o='div class="fr-temp-div"'),s.replaceWith(u("<"+o+">").html(s.html()))):0<=["TD","TH"].indexOf(c[d].parentNode.tagName)?(n=f,r=e,i=p.html.defaultTag(),r||(r='div class="fr-temp-div"'+(p.node.isEmpty(n.get(0),!0)?' data-empty="true"':"")),r.toLowerCase()==i?(p.node.isEmpty(n.get(0),!0)||n.append("<br/>"),n.replaceWith(n.html())):n.replaceWith(u("<"+r+">").html(n.html()))):(t=f,(a=e)||(a='div class="fr-temp-div"'+(p.node.isEmpty(t.get(0),!0)?' data-empty="true"':"")),t.replaceWith(u("<"+a+" "+p.node.attributes(t.get(0))+">").html(t.html()).removeAttr("data-empty")))}p.$el.find('pre:not([skip="true"]) + pre:not([skip="true"])').each(function(){u(this).prev().append("<br>"+u(this).html()),u(this).remove()}),p.$el.find("pre").removeAttr("skip"),p.html.unwrap(),p.selection.restore()},refreshOnShow:function s(e,t){var a=p.selection.blocks();if(a.length){var n=a[0],r="N",i=p.html.defaultTag();n.tagName.toLowerCase()!=i&&n!=p.el&&(r=n.tagName),t.find('.fr-command[data-param1="'+r+'"]').addClass("fr-active").attr("aria-selected",!0)}else t.find('.fr-command[data-param1="N"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function i(e){if(p.opts.paragraphFormatSelection){var t=p.selection.blocks();if(t.length){var a=t[0],n="N",r=p.html.defaultTag();a.tagName.toLowerCase()!=r&&a!=p.el&&(n=a.tagName),0<=["LI","TD","TH"].indexOf(n)&&(n="N"),e.find(">span").text(p.language.translate(p.opts.paragraphFormat[n]))}else e.find(">span").text(p.language.translate(p.opts.paragraphFormat.N))}}}},Be.RegisterCommand("paragraphFormat",{type:"dropdown",displaySelection:function(e){return e.opts.paragraphFormatSelection},defaultSelection:function(e){return e.language.translate(e.opts.paragraphDefaultSelection)},displaySelectionWidth:80,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.paragraphFormat;for(var a in t)if(t.hasOwnProperty(a)){var n=this.shortcuts.get("paragraphFormat."+a);n=n?'<span class="fr-shortcut">'+n+"</span>":"",e+='<li role="presentation"><'+("N"==a?this.html.defaultTag()||"DIV":a)+' style="padding: 0 !important; margin: 0 !important;" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="paragraphFormat" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></"+("N"==a?this.html.defaultTag()||"DIV":a)+"></li>"}return e+="</ul>"},title:"Paragraph Format",callback:function(e,t){this.paragraphFormat.apply(t)},refresh:function(e){this.paragraphFormat.refresh(e)},refreshOnShow:function(e,t){this.paragraphFormat.refreshOnShow(e,t)},plugin:"paragraphFormat"}),Be.DefineIcon("paragraphFormat",{NAME:"paragraph",SVG_KEY:"paragraphFormat"}),Object.assign(Be.DEFAULTS,{paragraphStyles:{"fr-text-gray":"Gray","fr-text-bordered":"Bordered","fr-text-spaced":"Spaced","fr-text-uppercase":"Uppercase"},paragraphMultipleStyles:!0}),Be.PLUGINS.paragraphStyle=function(o){var l=o.$;return{_init:function e(){},apply:function c(e,t,a){void 0===t&&(t=o.opts.paragraphStyles),void 0===a&&(a=o.opts.paragraphMultipleStyles);var n="";a||((n=Object.keys(t)).splice(n.indexOf(e),1),n=n.join(" ")),o.selection.save(),o.html.wrap(!0,!0,!0,!0),o.selection.restore();var r=o.selection.blocks();o.selection.save();for(var i=l(r[0]).hasClass(e),s=0;s<r.length;s++)l(r[s]).removeClass(n).toggleClass(e,!i),l(r[s]).hasClass("fr-temp-div")&&l(r[s]).removeClass("fr-temp-div"),""===l(r[s]).attr("class")&&l(r[s]).removeAttr("class");o.html.unwrap(),o.selection.restore()},refreshOnShow:function r(e,t){var a=o.selection.blocks();if(a.length){var n=l(a[0]);t.find(".fr-command").each(function(){var e=l(this).data("param1"),t=n.hasClass(e);l(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}}},Be.RegisterCommand("paragraphStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.paragraphStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command '+a+'" tabIndex="-1" role="option" data-cmd="paragraphStyle" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},title:"Paragraph Style",callback:function(e,t){this.paragraphStyle.apply(t)},refreshOnShow:function(e,t){this.paragraphStyle.refreshOnShow(e,t)},plugin:"paragraphStyle"}),Be.DefineIcon("paragraphStyle",{NAME:"magic",SVG_KEY:"paragraphStyle"}),Object.assign(Be.DEFAULTS,{html2pdf:window.html2pdf}),Be.PLUGINS.print=function(l){return{run:function e(){!function o(e){var t=l.$el.html(),a=null;l.shared.print_iframe?a=l.shared.print_iframe:((a=document.createElement("iframe")).name="fr-print",a.style.position="fixed",a.style.top="0",a.style.left="-9999px",a.style.height="100%",a.style.width="0",a.style.overflow="hidden",a.style["z-index"]="2147483647",a.style.tabIndex="-1",l.events.on("shared.destroy",function(){a.remove()}),l.shared.print_iframe=a);try{document.body.removeChild(a)}catch(s){}document.body.appendChild(a);var n=function n(){e(),a.removeEventListener("load",n)};a.addEventListener("load",n);var r=a.contentWindow;r.document.open(),r.document.write("<!DOCTYPE html><html "+(l.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),r.document.write(e.outerHTML)});var i=document.querySelectorAll("link[rel=stylesheet]");Array.prototype.forEach.call(i,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",r.document.write(t.outerHTML)}),r.document.write('</head><body style="height:auto;text-align: '+("rtl"==l.opts.direction?"right":"left")+"; direction: "+l.opts.direction+"; "+(l.opts.documentReady?" padding: 2cm; width: 17cm; margin: 0;":"")+'"><div class="fr-view">'),r.document.write(t),r.document.write("</div></body></html>"),r.document.close()}(function(){setTimeout(function(){l.events.disableBlur(),window.frames["fr-print"].focus(),window.frames["fr-print"].print(),l.$win.get(0).focus(),l.events.disableBlur(),l.events.focus()},0)})},toPDF:function t(){l.opts.html2pdf&&(l.$el.css("text-align","left"),l.opts.html2pdf().set({margin:[10,20],html2canvas:{useCORS:!0}}).from(l.el).save(),setTimeout(function(){l.$el.css("text-align","")},100))}}},Be.DefineIcon("print",{NAME:"print",SVG_KEY:"print"}),Be.RegisterCommand("print",{title:"Print",undo:!1,focus:!1,plugin:"print",callback:function(){this.print.run()}}),Be.DefineIcon("getPDF",{NAME:"file-pdf-o",FA5NAME:"file-pdf",SVG_KEY:"pdfExport"}),Be.RegisterCommand("getPDF",{title:"Download PDF",type:"button",focus:!1,undo:!1,callback:function(){this.print.toPDF()}}),Object.assign(Be.DEFAULTS,{quickInsertButtons:["image","video","embedly","table","ul","ol","hr"],quickInsertTags:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote"],quickInsertEnabled:!0}),Be.QUICK_INSERT_BUTTONS={},Be.DefineIcon("quickInsert",{SVG_KEY:"add",template:"svg"}),Be.RegisterQuickInsertButton=function(e,t){Be.QUICK_INSERT_BUTTONS[e]=Object.assign({undo:!0},t)},Be.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"+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()}}),Be.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)}}),Be.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)}}),Be.RegisterQuickInsertButton("table",{icon:"insertTable",requiredPlugin:"table",title:"Insert Table",callback:function(){this.table.insert(2,2)}}),Be.RegisterQuickInsertButton("ol",{icon:"formatOL",requiredPlugin:"lists",title:"Ordered List",callback:function(){this.lists.format("OL")}}),Be.RegisterQuickInsertButton("ul",{icon:"formatUL",requiredPlugin:"lists",title:"Unordered List",callback:function(){this.lists.format("UL")}}),Be.RegisterQuickInsertButton("hr",{icon:"insertHR",title:"Insert Horizontal Line",callback:function(){this.commands.insertHR()}}),Be.PLUGINS.quickInsert=function(s){var o,l,c=s.$;function a(e){var t,a,n;(t=e.offset().top-s.$box.offset().top,a=(s.$iframe&&s.$iframe.offset().left||0)+e.offset().left<o.outerWidth()?e.offset().left+o.outerWidth():0-o.outerWidth(),s.opts.enter!=Be.ENTER_BR)?n=(o.outerHeight()-e.outerHeight())/2:(c(document.createElement("span")).html(Be.INVISIBLE_SPACE).insertAfter(e),n=(o.outerHeight()-e.next().outerHeight())/2,e.next().remove());if(s.opts.iframe){var r=s.helpers.getPX(s.$wp.find(".fr-iframe").css("padding-top"));t+=s.$iframe.offset().top+r}o.hasClass("fr-on")&&0<=t&&l.css("top",t-n),0<=t&&t-Math.abs(n)<=s.$box.outerHeight()-e.outerHeight()?(o.hasClass("fr-hidden")&&(o.hasClass("fr-on")&&d(),o.removeClass("fr-hidden")),o.css("top",t-n)):o.hasClass("fr-visible")&&(o.addClass("fr-hidden"),f()),o.css("left",a)}function r(e){o||function t(){s.shared.$quick_insert||(s.shared.$quick_insert=c(document.createElement("div")).attr("class","fr-quick-insert").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'+s.language.translate("Quick Insert")+'">'+s.icon.create("quickInsert")+"</a>"));o=s.shared.$quick_insert,s.tooltip.bind(s.$box,".fr-quick-insert > a.fr-floating-btn"),s.events.on("destroy",function(){c("body").first().append(o.removeClass("fr-on")),l&&(f(),c("body").first().append(l.css("left",-9999).css("top",-9999)))},!0),s.events.on("shared.destroy",function(){o.html("").removeData().remove(),o=null,l&&(l.html("").removeData().remove(),l=null)},!0),s.events.on("commands.before",i),s.events.on("commands.after",function(){s.popups.areVisible()||n()}),s.events.bindClick(s.$box,".fr-quick-insert > a",d),s.events.bindClick(s.$box,".fr-qi-helper > a.fr-btn",function(e){var t=c(e.currentTarget).data("cmd");if(!1===s.events.trigger("quickInsert.commands.before",[t]))return!1;Be.QUICK_INSERT_BUTTONS[t].callback.apply(s,[e.currentTarget]),Be.QUICK_INSERT_BUTTONS[t].undo&&s.undo.saveStep(),s.events.trigger("quickInsert.commands.after",[t]),s.quickInsert.hide()}),s.events.$on(s.$wp,"scroll",p),s.events.$on(s.$tb,"transitionend",".fr-more-toolbar",p)}(),o.hasClass("fr-on")&&f(),s.$box.append(o),a(e),o.data("tag",e),o.addClass("fr-visible")}function n(){if(s.core.hasFocus()){var e=s.selection.element();if(s.opts.enter==Be.ENTER_BR||s.node.isBlock(e)||(e=s.node.blockParent(e)),s.opts.enter==Be.ENTER_BR&&!s.node.isBlock(e)){var t=s.node.deepestParent(e);t&&(e=t)}var a=function a(){return s.opts.enter!=Be.ENTER_BR&&s.node.isEmpty(e)&&0<=s.opts.quickInsertTags.indexOf(e.tagName.toLowerCase())},n=function n(){return s.opts.enter==Be.ENTER_BR&&("BR"==e.tagName&&(!e.previousSibling||"BR"==e.previousSibling.tagName||s.node.isBlock(e.previousSibling))||s.node.isEmpty(e)&&(!e.previousSibling||"BR"==e.previousSibling.tagName||s.node.isBlock(e.previousSibling))&&(!e.nextSibling||"BR"==e.nextSibling.tagName||s.node.isBlock(e.nextSibling)))};e&&(a()||n())?o&&o.data("tag").is(c(e))&&o.hasClass("fr-on")?f():s.selection.isCollapsed()&&r(c(e)):i()}}function i(){o&&(o.hasClass("fr-on")&&f(),o.removeClass("fr-visible fr-on"),o.css("left",-9999).css("top",-9999))}function d(e){if(e&&e.preventDefault(),o.hasClass("fr-on")&&!o.hasClass("fr-hidden"))f();else{if(!s.shared.$qi_helper){for(var t=s.opts.quickInsertButtons,a='<div class="fr-qi-helper">',n=0,r=0;r<t.length;r++){var i=Be.QUICK_INSERT_BUTTONS[t[r]];i&&(!i.requiredPlugin||Be.PLUGINS[i.requiredPlugin]&&0<=s.opts.pluginsEnabled.indexOf(i.requiredPlugin))&&(a+='<a class="fr-btn fr-floating-btn" role="button" title="'+s.language.translate(i.title)+'" tabIndex="-1" data-cmd="'+t[r]+'" style="transition-delay: '+.025*n+++'s;">'+s.icon.create(i.icon)+"</a>")}a+="</div>",s.shared.$qi_helper=c(a),s.tooltip.bind(s.shared.$qi_helper,"a.fr-btn"),s.events.$on(s.shared.$qi_helper,"mousedown",function(e){e.preventDefault()},!0)}l=s.shared.$qi_helper,s.$box.append(l),setTimeout(function(){l.css("top",parseFloat(o.css("top"))),l.css("left",parseFloat(o.css("left"))+o.outerWidth()),l.find("a").addClass("fr-size-1"),o.addClass("fr-on")},10)}}function f(){var a=s.$box.find(".fr-qi-helper");a.length&&function(){for(var t=a.find("a"),e=0;e<t.length;e++)!function(e){setTimeout(function(){a.children().eq(t.length-1-e).removeClass("fr-size-1")},25*e)}(e);setTimeout(function(){a.css("left",-9999),o&&!o.hasClass("fr-hidden")&&o.removeClass("fr-on")},25*e)}()}function p(){o.hasClass("fr-visible")&&a(o.data("tag"))}return{_init:function e(){if(!s.$wp||!s.opts.quickInsertEnabled)return!1;s.popups.onShow("image.edit",i),s.events.on("mouseup",n),s.helpers.isMobile()&&s.events.$on(c(s.o_doc),"selectionchange",n),s.events.on("blur",i),s.events.on("keyup",n),s.events.on("keydown",function(){setTimeout(function(){n()},0)})},hide:i}},Be.PLUGINS.quote=function(r){var i=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(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)t[e]=s(t[e]);r.selection.save();var a=i(document.createElement("blockquote"));for(a.insertBefore(t[0]),e=0;e<t.length;e++)a.append(t[e]);r.html.unwrap(),r.selection.restore()}():"decrease"==e&&function a(){var e,t=r.selection.blocks();for(e=0;e<t.length;e++)"BLOCKQUOTE"!=t[e].tagName&&(t[e]=i(t[e]).parentsUntil(r.$el,"BLOCKQUOTE").get(0));for(r.selection.save(),e=0;e<t.length;e++)t[e]&&i(t[e]).replaceWith(t[e].innerHTML);r.html.unwrap(),r.selection.restore()}()}}},Be.RegisterShortcut(Be.KEYCODE.SINGLE_QUOTE,"quote","increase","'"),Be.RegisterShortcut(Be.KEYCODE.SINGLE_QUOTE,"quote","decrease","'",!0),Be.RegisterCommand("quote",{title:"Quote",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t={increase:"Increase",decrease:"Decrease"};for(var a in t)if(t.hasOwnProperty(a)){var n=this.shortcuts.get("quote."+a);e+='<li role="presentation"><a class="fr-command fr-active '+a+'" tabIndex="-1" role="option" data-cmd="quote" data-param1="'+a+'" title="'+t[a]+'">'+this.language.translate(t[a])+(n?'<span class="fr-shortcut">'+n+"</span>":"")+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.quote.apply(t)},plugin:"quote"}),Be.DefineIcon("quote",{NAME:"quote-left",SVG_KEY:"blockquote"}),Object.assign(Be.DEFAULTS,{saveInterval:1e4,saveURL:null,saveParams:{},saveParam:"body",saveMethod:"POST"}),Be.PLUGINS.save=function(o){var l=o.$,e=null,c=null,t=!1,d=1,f=2,a={};function p(e,t){o.events.trigger("save.error",[{code:e,message:a[e]},t])}function n(e){void 0===e&&(e=o.html.get());var n=e,t=o.events.trigger("save.before",[e]);if(!1===t)return!1;if("string"==typeof t&&(e=t),o.opts.saveURL){var a={};for(var r in o.opts.saveParams)if(o.opts.saveParams.hasOwnProperty(r)){var i=o.opts.saveParams[r];a[r]="function"==typeof i?i.call(this):i}var s={};s[o.opts.saveParam]=e,l(this).ajax({method:o.opts.saveMethod,url:o.opts.saveURL,data:Object.assign(s,a),crossDomain:o.opts.requestWithCORS,withCredentials:o.opts.requestWithCredentials,headers:o.opts.requestHeaders,done:function(e,t,a){c=n,o.events.trigger("save.after",[e])},fail:function(e){p(f,e.response||e.responseText)}})}else p(d)}function r(){clearTimeout(e),e=setTimeout(function(){var e=o.html.get();(c!=e||t)&&(t=!1,n(c=e))},o.opts.saveInterval)}return a[d]="Missing saveURL option.",a[f]="Something went wrong during save.",{_init:function i(){o.opts.saveInterval&&(c=o.html.get(),o.events.on("contentChanged",r),o.events.on("keydown destroy",function(){clearTimeout(e)}))},save:n,reset:function s(){r(),t=!1},force:function u(){t=!0}}},Be.DefineIcon("save",{NAME:"floppy-o",FA5NAME:"save"}),Be.RegisterCommand("save",{title:"Save",undo:!1,focus:!1,refreshAfterCallback:!1,callback:function(){this.save.save()},plugin:"save"}),Object.assign(Be.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(Be.POPUP_TEMPLATES,{specialCharacters:"[_BUTTONS_][_CUSTOM_LAYER_]"}),Be.PLUGINS.specialCharacters=function(g){var m=g.$,a=g.opts.specialCharactersSets[0],r=g.opts.specialCharactersSets,s="";function o(){return'\n <div class="fr-buttons fr-tabs fr-tabs-scroll">\n '.concat(function t(e,a){var n="";return e.forEach(function(e){var t={elementClass:e.title===a.title?"fr-active fr-active-tab":"",title:e.title,dataParam1:e.title,desc:e["char"]};n+='<button class="fr-command fr-btn fr-special-character-category '.concat(t.elementClass,'" title="').concat(t.title,'" data-cmd="setSpecialCharacterCategory" data-param1="').concat(t.dataParam1,'"><span>').concat(t.desc,"</span></button>")}),n}(r,a),'\n </div>\n <div class="fr-icon-container fr-sc-container">\n ').concat(function n(e){var a="";return e.list.forEach(function(e){var t={dataParam1:e["char"],title:e.desc,splCharValue:e["char"]};a+='<span class="fr-command fr-special-character fr-icon" role="button" \n data-cmd="insertSpecialCharacter" data-param1="'.concat(t.dataParam1,'" \n title="').concat(t.title,'">').concat(t.splCharValue,"</span>")}),a}(a),"\n </div>")}return{setSpecialCharacterCategory:function n(t){a=r.filter(function(e){return e.title===t})[0],function e(){g.popups.get("specialCharacters").html(s+o())}()},showSpecialCharsPopup:function l(){var e=g.popups.get("specialCharacters");if(e||(e=function i(){g.opts.toolbarInline&&0<g.opts.specialCharButtons.length&&(s='<div class="fr-buttons fr-tabs">'.concat(g.button.buildList(g.opts.specialCharButtons),"</div>"));var e={buttons:s,custom_layer:o()},t=g.popups.create("specialCharacters",e);return function a(h){g.events.on("popup.tab",function(e){var t=m(e.currentTarget);if(!g.popups.isVisible("specialCharacters")||!t.is("span, a"))return!0;var a,n,r,i=e.which;if(Be.KEYCODE.TAB==i){if(t.is("span.fr-icon")&&e.shiftKey||t.is("a")&&!e.shiftKey){var s=h.find(".fr-buttons");a=!g.accessibility.focusToolbar(s,!!e.shiftKey)}if(!1!==a){var o=h.find("span.fr-icon:focus").first().concat(h.findVisible(" span.fr-icon").first().concat(h.find("a")));t.is("span.fr-icon")&&(o=o.not("span.fr-icon:not(:focus)")),n=o.index(t),n=e.shiftKey?((n-1)%o.length+o.length)%o.length:(n+1)%o.length,r=o.get(n),g.events.disableBlur(),r.focus(),a=!1}}else if(Be.KEYCODE.ARROW_UP==i||Be.KEYCODE.ARROW_DOWN==i||Be.KEYCODE.ARROW_LEFT==i||Be.KEYCODE.ARROW_RIGHT==i){if(t.is("span.fr-icon")){var l=t.parent().find("span.fr-icon");n=l.index(t);var c=Math.floor(l.length/11),d=n%11,f=Math.floor(n/11),p=11*f+d,u=11*c;Be.KEYCODE.ARROW_UP==i?p=((p-11)%u+u)%u:Be.KEYCODE.ARROW_DOWN==i?p=(p+11)%u:Be.KEYCODE.ARROW_LEFT==i?p=((p-1)%u+u)%u:Be.KEYCODE.ARROW_RIGHT==i&&(p=(p+1)%u),r=m(l.get(p)),g.events.disableBlur(),r.focus(),a=!1}}else Be.KEYCODE.ENTER==i&&(t.is("a")?t[0].click():g.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(t),t}()),!e.hasClass("fr-active")){g.popups.refresh("specialCharacters"),g.popups.setContainer("specialCharacters",g.$tb);var t=g.$tb.find('.fr-command[data-cmd="specialCharacters"]'),a=g.button.getPosition(t),n=a.left,r=a.top;g.popups.show("specialCharacters",n,r,outerHeight)}},back:function e(){g.popups.hide("specialCharacters"),g.toolbar.showInline()}}},Be.DefineIcon("specialCharacters",{NAME:"dollar-sign",SVG_KEY:"symbols"}),Be.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()}}),Be.RegisterCommand("insertSpecialCharacter",{callback:function(e,t){this.undo.saveStep(),this.html.insert(t),this.undo.saveStep(),this.popups.hide("specialCharacters")}}),Be.RegisterCommand("setSpecialCharacterCategory",{undo:!1,focus:!1,callback:function(e,t){this.specialCharacters.setSpecialCharacterCategory(t)}}),Be.DefineIcon("specialCharBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("specialCharBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.specialCharacters.back()}}),Object.assign(Be.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(Be.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}),Be.PLUGINS.table=function(C){var R,c,r,i,n,s,S,L=C.$;function u(){var e=_();if(e){var t=C.popups.get("table.edit");if(t||(t=p()),t){C.popups.setContainer("table.edit",C.$sc);var a=x(e),n=a.left+(a.right-a.left)/2,r=a.bottom;C.popups.show("table.edit",n,r,a.bottom-a.top,!0),C.edit.isDisabled()&&(1<J().length&&C.toolbar.disable(),C.$el.removeClass("fr-no-selection"),C.edit.on(),C.button.bulkRefresh(),C.selection.setAtEnd(C.$el.find(".fr-selected-cell").last().get(0)),C.selection.restore())}}}function o(){var e=_();if(e){var t=C.popups.get("table.colors");t||(t=function s(){var e="";0<C.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-tabs">'+C.button.buildList(C.opts.tableColorsButtons)+"</div>");var t="";C.opts.colorsHEXInput&&(t='<div class="fr-color-hex-layer fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'+C.id+'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-'+C.id+'" type="text" placeholder="'+C.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">'+C.language.translate("OK")+"</button></div></div>");var a={buttons:e,colors:function r(){for(var e='<div class="fr-color-set fr-table-colors">',t=0;t<C.opts.tableColors.length;t++)0!==t&&t%C.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=C.opts.tableColors[t]?e+='<span class="fr-command" style="background: '+C.opts.tableColors[t]+';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="'+C.opts.tableColors[t]+'"><span class="fr-sr-only">'+C.language.translate("Color")+" "+C.opts.tableColors[t]+"&nbsp;&nbsp;&nbsp;</span></span>":e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'+C.language.translate("Clear Formatting")+'">'+C.icon.create("tableColorRemove")+'<span class="fr-sr-only">'+C.language.translate("Clear Formatting")+"</span></span>";return e+="</div>"}(),custom_color:t},n=C.popups.create("table.colors",a);return C.events.$on(C.$wp,"scroll.table-colors",function(){C.popups.isVisible("table.colors")&&o()}),function i(h){C.events.on("popup.tab",function(e){var t=L(e.currentTarget);if(!C.popups.isVisible("table.colors")||!t.is("span"))return!0;var a=e.which,n=!0;if(Be.KEYCODE.TAB==a){var r=h.find(".fr-buttons");n=!C.accessibility.focusToolbar(r,!!e.shiftKey)}else if(Be.KEYCODE.ARROW_UP==a||Be.KEYCODE.ARROW_DOWN==a||Be.KEYCODE.ARROW_LEFT==a||Be.KEYCODE.ARROW_RIGHT==a){var i=t.parent().find("span.fr-command"),s=i.index(t),o=C.opts.colorsStep,l=Math.floor(i.length/o),c=s%o,d=Math.floor(s/o),f=d*o+c,p=l*o;Be.KEYCODE.ARROW_UP==a?f=((f-o)%p+p)%p:Be.KEYCODE.ARROW_DOWN==a?f=(f+o)%p:Be.KEYCODE.ARROW_LEFT==a?f=((f-1)%p+p)%p:Be.KEYCODE.ARROW_RIGHT==a&&(f=(f+1)%p);var u=L(i.get(f));C.events.disableBlur(),u.focus(),n=!1}else Be.KEYCODE.ENTER==a&&(C.button.exec(t),n=!1);return!1===n&&(e.preventDefault(),e.stopPropagation()),n},!0)}(n),n}()),C.popups.setContainer("table.colors",C.$sc);var a=x(e),n=(a.left+a.right)/2,r=a.bottom;!function i(){var e=C.popups.get("table.colors"),t=C.$el.find(".fr-selected-cell").first(),a=C.helpers.RGBToHex(t.css("background-color")),n=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="'+a+'"]').addClass("fr-selected-color fr-active-item"),n.val(a).trigger("change")}(),C.popups.show("table.colors",n,r,a.bottom-a.top,!0)}}function l(){0===J().length&&C.toolbar.enable()}function d(e){if(e)return C.popups.onHide("table.insert",function(){C.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<C.opts.tableInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'+C.button.buildList(C.opts.tableInsertButtons)+"</div>");var a={buttons:t,rows_columns:function i(){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<=C.opts.tableInsertMaxSize;t++){for(var a=1;a<=C.opts.tableInsertMaxSize;a++){var n="inline-block";2<t&&!C.helpers.isMobile()&&(n="none");var r="fr-table-cell ";1==t&&1==a&&(r+=" hover"),e+='<span class="fr-command '+r+'" tabIndex="-1" data-cmd="tableInsert" data-row="'+t+'" data-col="'+a+'" data-param1="'+t+'" data-param2="'+a+'" style="display: '+n+';" role="button"><span></span><span class="fr-sr-only">'+t+" &times; "+a+"&nbsp;&nbsp;&nbsp;</span></span>"}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},n=C.popups.create("table.insert",a);return C.events.$on(n,"mouseover",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){f(L(e.currentTarget))},!0),function r(e){C.events.$on(e,"focus","[tabIndex]",function(e){var t=L(e.currentTarget);f(t)}),C.events.on("popup.tab",function(e){var t=L(e.currentTarget);if(!C.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var a,n=e.which;if(Be.KEYCODE.ARROW_UP==n||Be.KEYCODE.ARROW_DOWN==n||Be.KEYCODE.ARROW_LEFT==n||Be.KEYCODE.ARROW_RIGHT==n){if(t.is("span.fr-table-cell")){var r=t.parent().find("span.fr-table-cell"),i=r.index(t),s=C.opts.tableInsertMaxSize,o=i%s,l=Math.floor(i/s);Be.KEYCODE.ARROW_UP==n?l=Math.max(0,l-1):Be.KEYCODE.ARROW_DOWN==n?l=Math.min(C.opts.tableInsertMaxSize-1,l+1):Be.KEYCODE.ARROW_LEFT==n?o=Math.max(0,o-1):Be.KEYCODE.ARROW_RIGHT==n&&(o=Math.min(C.opts.tableInsertMaxSize-1,o+1));var c=l*s+o,d=L(r.get(c));f(d),C.events.disableBlur(),d.focus(),a=!1}}else Be.KEYCODE.ENTER==n&&(C.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(n),n}function f(e){var t=e.data("row");null!==t&&(t=parseInt(t));var a=e.data("col");null!==a&&(a=parseInt(a));var n=e.parent();n.siblings(".fr-table-size-info").html(t+" &times; "+a),n.find("> span").removeClass("hover fr-active-item");for(var r=1;r<=C.opts.tableInsertMaxSize;r++)for(var i=0;i<=C.opts.tableInsertMaxSize;i++){var s=n.find('> span[data-row="'+r+'"][data-col="'+i+'"]');r<=t&&i<=a?s.addClass("hover"):r<=t+1||r<=2&&!C.helpers.isMobile()?s.css("display","inline-block"):2<r&&!C.helpers.isMobile()&&s.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return C.popups.onHide("table.edit",l),!0;if(0<C.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'.concat(C.button.buildList(C.opts.tableEditButtons),"</div>")},a=C.popups.create("table.edit",t);return C.events.$on(C.$wp,"scroll.table-edit",function(){C.popups.isVisible("table.edit")&&u()}),a}return!1}function h(){if(0<J().length){var e=Z();C.selection.setBefore(e.get(0))||C.selection.setAfter(e.get(0)),C.selection.restore(),C.popups.hide("table.edit"),e.remove(),C.toolbar.enable()}}function g(e){var t=Z();if(0<t.length){if(0<C.$el.find("th.fr-selected-cell").length&&"above"==e)return;var a,n,r,i=_(),s=O(i);if(null==s)return;n="above"==e?s.min_i:s.max_i;var o="<tr>";for(a=0;a<i[n].length;a++){if("below"==e&&n<i.length-1&&i[n][a]==i[n+1][a]||"above"==e&&0<n&&i[n][a]==i[n-1][a]){if(0===a||0<a&&i[n][a]!=i[n][a-1]){var l=L(i[n][a]);l.attr("rowspan",parseInt(l.attr("rowspan"),10)+1)}}else o+='<td style="'+L(i[n][a]).attr("style")+'" ><br></td>'}o+="</tr>",r=0<C.$el.find("th.fr-selected-cell").length&&"below"==e?L(t.find("tbody").not(t.find("> table tbody"))):L(t.find("tr").not(t.find("> table tr")).get(n)),"below"==e?"TBODY"==r.attr("tagName")?r.prepend(o):r[0].parentNode&&r[0].insertAdjacentHTML("afterend",o):"above"==e&&(r.before(o),C.popups.isVisible("table.edit")&&u())}}function m(e,t,a){var n,r,i,s,o,l=0,c=_(a);if(e<(t=Math.min(t,c[0].length-1)))for(r=e;r<=t;r++)if(!(e<r&&c[0][r]==c[0][r-1])&&1<(s=Math.min(parseInt(c[0][r].getAttribute("colspan"),10)||1,t-e+1))&&c[0][r]==c[0][r+1])for(l=s-1,n=1;n<c.length;n++)if(c[n][r]!=c[n-1][r]){for(i=r;i<r+s;i++)if(1<(o=parseInt(c[n][i].getAttribute("colspan"),10)||1)&&c[n][i]==c[n][i+1])i+=l=Math.min(l,o-1);else if(!(l=Math.max(0,l-1)))break;if(!l)break}l&&E(c,l,"colspan",0,c.length-1,e,t)}function v(e,t,a){var n,r,i,s,o,l=0,c=_(a);if(e<(t=Math.min(t,c.length-1)))for(n=e;n<=t;n++)if(!(e<n&&c[n][0]==c[n-1][0])&&1<(s=Math.min(parseInt(c[n][0].getAttribute("rowspan"),10)||1,t-e+1))&&c[n][0]==c[n+1][0])for(l=s-1,r=1;r<c[0].length;r++)if(c[n][r]!=c[n][r-1]){for(i=n;i<n+s;i++)if(1<(o=parseInt(c[i][r].getAttribute("rowspan"),10)||1)&&c[i][r]==c[i+1][r])i+=l=Math.min(l,o-1);else if(!(l=Math.max(0,l-1)))break;if(!l)break}l&&E(c,l,"rowspan",e,t,0,c[0].length-1)}function E(e,t,a,n,r,i,s){var o,l,c;for(o=n;o<=r;o++)for(l=i;l<=s;l++)n<o&&e[o][l]==e[o-1][l]||i<l&&e[o][l]==e[o][l-1]||1<(c=parseInt(e[o][l].getAttribute(a),10)||1)&&(1<c-t?e[o][l].setAttribute(a,c-t):e[o][l].removeAttribute(a))}function b(e,t,a,n,r){v(e,t,r),m(a,n,r)}function t(e){var t=C.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",C.helpers.HEXtoRGB(e)):t.css("background-color",""),u()}function _(e){var c=[];return null==(e=e||null)&&0<J().length&&(e=Z()),e&&e.findVisible("tr").not(e.find("> table tr")).each(function(o,e){var t=L(e),l=0;t.find("> th, > td").each(function(e,t){for(var a=L(t),n=parseInt(a.attr("colspan"),10)||1,r=parseInt(a.attr("rowspan"),10)||1,i=o;i<o+r;i++)for(var s=l;s<l+n;s++)c[i]||(c[i]=[]),c[i][s]?l++:c[i][s]=t;l+=n})}),c}function w(e,t){for(var a=0;a<t.length;a++)for(var n=0;n<t[a].length;n++)if(t[a][n]==e)return{row:a,col:n}}function y(e,t,a){for(var n=e+1,r=t+1;n<a.length;){if(a[n][t]!=a[e][t]){n--;break}n++}for(n==a.length&&n--;r<a[e].length;){if(a[e][r]!=a[e][t]){r--;break}r++}return r==a[e].length&&r--,{row:n,col:r}}function A(){C.el.querySelector(".fr-cell-fixed")&&C.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),C.el.querySelector(".fr-cell-handler")&&C.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function T(){var e=C.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=L(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),A()}function I(){C.events.disableBlur(),C.selection.clear(),C.$el.addClass("fr-no-selection"),C.$el.blur(),C.events.enableBlur()}function O(e){var t=C.$el.find(".fr-selected-cell");if(0<t.length){var a,n=e.length,r=0,i=e[0].length,s=0;for(a=0;a<t.length;a++){var o=w(t[a],e),l=y(o.row,o.col,e);n=Math.min(o.row,n),r=Math.max(l.row,r),i=Math.min(o.col,i),s=Math.max(l.col,s)}return{min_i:n,max_i:r,min_j:i,max_j:s}}return null}function x(e){var t=O(e);if(null!=t){var a=L(e[t.min_i][t.min_j]),n=L(e[t.min_i][t.max_j]),r=L(e[t.max_i][t.min_j]);return{left:a.length&&a.offset().left,right:n.length&&n.offset().left+n.outerWidth(),top:a.length&&a.offset().top,bottom:r.length&&r.offset().top+r.outerHeight()}}}function F(e,t){if(L(e).is(t))T(),L(e).addClass("fr-selected-cell");else{I(),C.edit.off();var a=_(),n=w(e,a),r=w(t,a),i=function u(e,t,a,n,r){var i,s,o,l,c=e,d=t,f=a,p=n;for(i=c;i<=d;i++)(1<(parseInt(L(r[i][f]).attr("rowspan"),10)||1)||1<(parseInt(L(r[i][f]).attr("colspan"),10)||1))&&(l=y((o=w(r[i][f],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p)),(1<(parseInt(L(r[i][p]).attr("rowspan"),10)||1)||1<(parseInt(L(r[i][p]).attr("colspan"),10)||1))&&(l=y((o=w(r[i][p],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p));for(s=f;s<=p;s++)(1<(parseInt(L(r[c][s]).attr("rowspan"),10)||1)||1<(parseInt(L(r[c][s]).attr("colspan"),10)||1))&&(l=y((o=w(r[c][s],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p)),(1<(parseInt(L(r[d][s]).attr("rowspan"),10)||1)||1<(parseInt(L(r[d][s]).attr("colspan"),10)||1))&&(l=y((o=w(r[d][s],r)).row,o.col,r),c=Math.min(o.row,c),d=Math.max(l.row,d),f=Math.min(o.col,f),p=Math.max(l.col,p));return c==e&&d==t&&f==a&&p==n?{min_i:e,max_i:t,min_j:a,max_j:n}:u(c,d,f,p,r)}(Math.min(n.row,r.row),Math.max(n.row,r.row),Math.min(n.col,r.col),Math.max(n.col,r.col),a);T(),e.classList.add("fr-cell-fixed"),t.classList.add("fr-cell-handler");for(var s=i.min_i;s<=i.max_i;s++)for(var o=i.min_j;o<=i.max_j;o++)L(a[s][o]).addClass("fr-selected-cell")}}function k(e){var t=null,a=L(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<a.closest("td",a.closest("tr")[0]).length?t=a.closest("td",a.closest("tr")[0]).get(0):0<a.closest("th",a.closest("thead")[0]).length&&(t=a.closest("th",a.closest("thead")[0]).get(0)),-1===C.$el.html.toString().search(t)?null:t}function N(){T(),C.popups.hide("table.edit")}function e(e){var t=k(e);if("false"==L(t).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(0<J().length&&!t&&N(),!C.edit.isDisabled()||C.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&C.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&C.helpers.isMac()&&e.ctrlKey)&&t&&N();else if(i=!0,t){0<J().length&&!e.shiftKey&&N(),e.stopPropagation(),C.events.trigger("image.hideResizer"),C.events.trigger("video.hideResizer"),r=!0;var a=t.tagName.toLowerCase();e.shiftKey&&0<C.$el.find(a+".fr-selected-cell").length?L(C.$el.find(a+".fr-selected-cell").closest("table")).is(L(t).closest("table"))?F(n,t):I():((C.keys.ctrlKey(e)||e.shiftKey)&&(1<J().length||0===L(t).find(C.selection.element()).length&&!L(t).is(C.selection.element()))&&I(),n=t,0<C.opts.tableEditButtons.length&&F(n,n))}}function a(e){if(C.popups.areVisible())return!0;if(r||C.$tb.is(e.target)||C.$tb.is(L(e.target).closest(".fr-toolbar"))||(0<J().length&&C.toolbar.enable(),T()),!(1!=e.which||1==e.which&&C.helpers.isMac()&&e.ctrlKey)){if(i=!1,r)r=!1,k(e)||1!=J().length?0<J().length&&(C.selection.isCollapsed()?u():(T(),C.edit.on())):T();if(S){S=!1,R.removeClass("fr-moving"),C.$el.removeClass("fr-no-selection"),C.edit.on();var t=parseFloat(R.css("left"))+C.opts.tableResizerOffset+C.$wp.offset().left;C.opts.iframe&&(t-=C.$iframe.offset().left),R.data("release-position",t),R.removeData("max-left"),R.removeData("max-right"),function A(){var e=R.data("origin"),t=R.data("release-position");if(e!==t){var a=R.data("first"),n=R.data("second"),r=R.data("table"),i=r.outerWidth();if(C.undo.canDo()||C.undo.saveStep(),null!=a&&null!=n){var s,o,l,c=_(r),d=[],f=[],p=[],u=[];for(s=0;s<c.length;s++)o=L(c[s][a]),l=L(c[s][n]),d[s]=o.outerWidth(),p[s]=l.outerWidth(),f[s]=d[s]/i*100,u[s]=p[s]/i*100;for(s=0;s<c.length;s++)if(o=L(c[s][a]),l=L(c[s][n]),c[s][a]!=c[s][n]){var h=(f[s]*(d[s]+t-e)/d[s]).toFixed(4);o.css("width",h+"%"),l.css("width",(f[s]+u[s]-h).toFixed(4)+"%")}}else{var g,m=r.parent(),v=i/m.width()*100,E=(parseInt(r.css("margin-left"),10)||0)/m.width()*100,b=(parseInt(r.css("margin-right"),10)||0)/m.width()*100;"rtl"==C.opts.direction&&0===n||"rtl"!=C.opts.direction&&0!==n?(g=(i+t-e)/i*v,r.css("margin-right","calc(100% - "+Math.round(g).toFixed(4)+"% - "+Math.round(E).toFixed(4)+"%)")):("rtl"==C.opts.direction&&0!==n||"rtl"!=C.opts.direction&&0===n)&&(g=(i-t+e)/i*v,r.css("margin-left","calc(100% - "+Math.round(g).toFixed(4)+"% - "+Math.round(b).toFixed(4)+"%)")),r.css("width",Math.round(g).toFixed(4)+"%")}C.selection.restore(),C.undo.saveStep(),C.events.trigger("table.resized",[r.get(0)])}R.removeData("origin"),R.removeData("release-position"),R.removeData("first"),R.removeData("second"),R.removeData("table")}(),U()}}}function D(e){if(!0===r&&0<C.opts.tableEditButtons.length){if(L(e.currentTarget).closest("table").is(Z())){if("TD"==e.currentTarget.tagName&&0===C.$el.find("th.fr-selected-cell").length)return void F(n,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===C.$el.find("td.fr-selected-cell").length)return void F(n,e.currentTarget)}I()}}function M(e,t,a,n){for(var r,i=t;i!=C.el&&"TD"!=i.tagName&&"TH"!=i.tagName&&("up"==n?r=i.previousElementSibling:"down"==n&&(r=i.nextElementSibling),!r);)i=i.parentNode;"TD"==i.tagName||"TH"==i.tagName?function s(e,t){for(var a=e;a&&"TABLE"!=a.tagName&&a.parentNode!=C.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName){var n=_(L(a));"up"==t?B(w(e,n),a,n):"down"==t&&P(w(e,n),a,n)}}(i,n):r&&("up"==n&&C.selection.setAtEnd(r),"down"==n&&C.selection.setAtStart(r))}function B(e,t,a){0<e.row?C.selection.setAtEnd(a[e.row-1][e.col]):M(0,t,0,"up")}function P(e,t,a){var n=parseInt(a[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<a.length-n?C.selection.setAtStart(a[e.row+n][e.col]):M(0,t,0,"down")}function U(){R&&(R.find("div").css("opacity",0),R.css("top",0),R.css("left",0),R.css("height",0),R.find("div").css("height",0),R.hide())}function W(){c&&c.removeClass("fr-visible").css("left","-9999px")}function K(e,t){var a=L(t),n=a.closest("table"),r=n.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)R&&a.get(0)!=R.get(0)&&a.parent().get(0)!=R.get(0)&&C.core.sameInstance(R)&&U();else{if(a=L(t),0===C.$el.find(a).length)return!1;var i=a.offset().left-1,s=i+a.outerWidth();if(Math.abs(e.pageX-i)<=C.opts.tableResizerOffset||Math.abs(s-e.pageX)<=C.opts.tableResizerOffset){var o,l,c,d,f,p=_(n),u=w(t,p),h=y(u.row,u.col,p),g=n.offset().top,m=n.outerHeight()-1;"rtl"!=C.opts.direction?e.pageX-i<=C.opts.tableResizerOffset?(c=i,0<u.col?(d=i-V(u.col-1,p)+C.opts.tableResizingLimit,f=i+V(u.col,p)-C.opts.tableResizingLimit,o=u.col-1,l=u.col):(o=null,l=0,d=n.offset().left-1-parseInt(n.css("margin-left"),10),f=n.offset().left-1+n.width()-p[0].length*C.opts.tableResizingLimit)):s-e.pageX<=C.opts.tableResizerOffset&&(c=s,h.col<p[h.row].length&&p[h.row][h.col+1]?(d=s-V(h.col,p)+C.opts.tableResizingLimit,f=s+V(h.col+1,p)-C.opts.tableResizingLimit,o=h.col,l=h.col+1):(o=h.col,l=null,d=n.offset().left-1+p[0].length*C.opts.tableResizingLimit,f=r.offset().left-1+r.width()+parseFloat(r.css("padding-left")))):s-e.pageX<=C.opts.tableResizerOffset?(c=s,0<u.col?(d=s-V(u.col,p)+C.opts.tableResizingLimit,f=s+V(u.col-1,p)-C.opts.tableResizingLimit,o=u.col,l=u.col-1):(o=null,l=0,d=n.offset().left+p[0].length*C.opts.tableResizingLimit,f=r.offset().left-1+r.width()+parseFloat(r.css("padding-left")))):e.pageX-i<=C.opts.tableResizerOffset&&(c=i,h.col<p[h.row].length&&p[h.row][h.col+1]?(d=i-V(h.col+1,p)+C.opts.tableResizingLimit,f=i+V(h.col,p)-C.opts.tableResizingLimit,o=h.col+1,l=h.col):(o=h.col,l=null,d=r.offset().left+parseFloat(r.css("padding-left")),f=n.offset().left-1+n.width()-p[0].length*C.opts.tableResizingLimit)),R||function T(){C.shared.$table_resizer||(C.shared.$table_resizer=L(document.createElement("div")).attr("class","fr-table-resizer").html("<div></div>")),R=C.shared.$table_resizer,C.events.$on(R,"mousedown",function(e){return!C.core.sameInstance(R)||(0<J().length&&N(),1==e.which?(C.selection.save(),S=!0,R.addClass("fr-moving"),I(),C.edit.off(),R.find("div").css("opacity",1),!1):void 0)}),C.events.$on(R,"mousemove",function(e){if(!C.core.sameInstance(R))return!0;S&&(C.opts.iframe&&(e.pageX-=C.$iframe.offset().left),j(e))}),C.events.on("shared.destroy",function(){R.html("").removeData().remove(),R=null},!0),C.events.on("destroy",function(){C.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),L("body").first().append(R.hide())},!0)}(),R.data("table",n),R.data("first",o),R.data("second",l),R.data("instance",C),C.$wp.append(R);var v=c-C.win.pageXOffset-C.opts.tableResizerOffset-C.$wp.offset().left,E=g-C.$wp.offset().top+C.$wp.scrollTop();if(C.opts.iframe){var b=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top")),A=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-left"));v+=C.$iframe.offset().left+A,E+=C.$iframe.offset().top+b,d+=C.$iframe.offset().left,f+=C.$iframe.offset().left}R.data("max-left",d),R.data("max-right",f),R.data("origin",c-C.win.pageXOffset),R.css("top",E),R.css("left",v),R.css("height",m),R.find("div").css("height",m),R.css("padding-left",C.opts.tableResizerOffset),R.css("padding-right",C.opts.tableResizerOffset),R.show()}else C.core.sameInstance(R)&&U()}}function H(e,t){if(C.$box.find(".fr-line-breaker").isVisible())return!1;c||X(),C.$box.append(c),c.data("instance",C);var a,n=L(t).find("tr").first(),r=e.pageX,i=0,s=0;if(C.opts.iframe){var o=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top")),l=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-left"));i+=C.$iframe.offset().left-C.helpers.scrollLeft()+l,s+=C.$iframe.offset().top-C.helpers.scrollTop()+o}n.find("th, td").each(function(){var e=L(this);return e.offset().left<=r&&r<e.offset().left+e.outerWidth()/2?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top-a-5),c.css("left",i+e.offset().left-C.$box.offset().left-a/2),c.data("selected-cell",e),c.data("position","before"),c.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=r&&r<e.offset().left+e.outerWidth()?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top-a-5),c.css("left",i+e.offset().left-C.$box.offset().left+e.outerWidth()-a/2),c.data("selected-cell",e),c.data("position","after"),c.addClass("fr-visible"),!1):void 0})}function $(e,t){if(C.$box.find(".fr-line-breaker").isVisible())return!1;c||X(),C.$box.append(c),c.data("instance",C);var a,n=L(t),r=e.pageY,i=0,s=0;if(C.opts.iframe){var o=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top")),l=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-left"));i+=C.$iframe.offset().left-C.helpers.scrollLeft()+l,s+=C.$iframe.offset().top-C.helpers.scrollTop()+o}n.find("tr").each(function(){var e=L(this);return e.offset().top<=r&&r<e.offset().top+e.outerHeight()/2?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top-a/2),c.css("left",i+e.offset().left-C.$box.offset().left-a-5),c.data("selected-cell",e.find("td").first()),c.data("position","above"),c.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=r&&r<e.offset().top+e.outerHeight()?(a=parseInt(c.find("a").css("width"),10),c.css("top",s+e.offset().top-C.$box.offset().top+e.outerHeight()-a/2),c.css("left",i+e.offset().left-C.$box.offset().left-a-5),c.data("selected-cell",e.find("td").first()),c.data("position","below"),c.addClass("fr-visible"),!1):void 0})}function G(e){s=null;var t=C.doc.elementFromPoint(e.pageX-C.win.pageXOffset,e.pageY-C.win.pageYOffset);C.opts.tableResizer&&(!C.popups.areVisible()||C.popups.areVisible()&&C.popups.isVisible("table.edit"))&&K(e,t),!C.opts.tableInsertHelper||C.popups.areVisible()||C.$tb.hasClass("fr-inline")&&C.$tb.isVisible()||function i(e,t){if(0===J().length){var a,n,r;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||C.node.isElement(t)))for(a=1;a<=C.opts.tableInsertHelperOffset;a++){if(n=C.doc.elementFromPoint(e.pageX-C.win.pageXOffset,e.pageY-C.win.pageYOffset+a),L(n).hasClass("fr-tooltip"))return!0;if(n&&("TH"==n.tagName||"TD"==n.tagName||"TABLE"==n.tagName)&&(L(n).parents(".fr-wrapper").length||C.opts.iframe)&&"false"!=L(n).closest("table").attr("contenteditable"))return H(e,L(n).closest("table")),!0;if(r=C.doc.elementFromPoint(e.pageX-C.win.pageXOffset+a,e.pageY-C.win.pageYOffset),L(r).hasClass("fr-tooltip"))return!0;if(r&&("TH"==r.tagName||"TD"==r.tagName||"TABLE"==r.tagName)&&(L(r).parents(".fr-wrapper").length||C.opts.iframe)&&"false"!=L(r).closest("table").attr("contenteditable"))return $(e,L(r).closest("table")),!0}C.core.sameInstance(c)&&W()}}(e,t)}function Y(){if(S){var e=R.data("table").offset().top-C.win.pageYOffset;if(C.opts.iframe){var t=C.helpers.getPX(C.$wp.find(".fr-iframe").css("padding-top"));e+=C.$iframe.offset().top-C.helpers.scrollTop()+t}R.css("top",e)}}function V(e,t){var a,n=L(t[0][e]).outerWidth();for(a=1;a<t.length;a++)n=Math.min(n,L(t[a][e]).outerWidth());return n}function z(e,t,a){var n,r=0;for(n=e;n<=t;n++)r+=V(n,a);return r}function j(e){if(1<J().length&&i&&I(),!1===i&&!1===r&&!1===S)s&&clearTimeout(s),C.edit.isDisabled()&&!C.popups.isVisible("table.edit")||(s=setTimeout(G,30,e));else if(S){var t=e.pageX-C.win.pageXOffset;C.opts.iframe&&(t+=C.$iframe.offset().left);var a=R.data("max-left"),n=R.data("max-right");a<=t&&t<=n?R.css("left",t-C.opts.tableResizerOffset-C.$wp.offset().left):t<a&&parseFloat(R.css("left"),10)>a-C.opts.tableResizerOffset?R.css("left",a-C.opts.tableResizerOffset-C.$wp.offset().left):n<t&&parseFloat(R.css("left"),10)<n-C.opts.tableResizerOffset&&R.css("left",n-C.opts.tableResizerOffset-C.$wp.offset().left)}else i&&W()}function q(e){C.node.isEmpty(e.get(0))?e.prepend(Be.MARKERS):e.prepend(Be.START_MARKER).append(Be.END_MARKER)}function X(){C.shared.$ti_helper||(C.shared.$ti_helper=L(document.createElement("div")).attr("class","fr-insert-helper").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'+C.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>'),C.events.bindClick(C.shared.$ti_helper,"a",function(){var e=c.data("selected-cell"),t=c.data("position"),a=c.data("instance")||C;"before"==t?(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()):"after"==t?(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()):"above"==t?(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()):"below"==t&&(C.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),C.undo.saveStep()),W()}),C.events.on("shared.destroy",function(){C.shared.$ti_helper.html("").removeData().remove(),C.shared.$ti_helper=null},!0),C.events.$on(C.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),C.events.$on(L(C.o_win),"scroll",function(){W()},!0),C.events.$on(C.$wp,"scroll",function(){W()},!0)),c=C.shared.$ti_helper,C.events.on("destroy",function(){c=null}),C.tooltip.bind(C.$box,".fr-insert-helper > a.fr-floating-btn")}function Q(){n=null,clearTimeout(s)}function J(){return C.el.querySelectorAll(".fr-selected-cell")}function Z(){var e=J();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=C.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?L(t):L([])}return L([])}return{_init:function ee(){if(!C.$wp)return!1;if(!C.helpers.isMobile()){S=r=i=!1,C.events.$on(C.$el,"mousedown",e),C.popups.onShow("image.edit",function(){T(),r=i=!1}),C.popups.onShow("link.edit",function(){T(),r=i=!1}),C.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&T()}),C.events.$on(C.$el,"mouseover","th, td",D),C.events.$on(C.$win,"mouseup",a),C.opts.iframe&&C.events.$on(L(C.o_win),"mouseup",a),C.events.$on(C.$win,"mousemove",j),C.events.$on(L(C.o_win),"scroll",Y),C.events.on("contentChanged",function(){0<J().length&&(u(),C.$el.find("img").on("load.selected-cells",function(){L(this).off("load.selected-cells"),0<J().length&&u()}))}),C.events.$on(L(C.o_win),"resize",function(){T()}),C.events.on("toolbar.esc",function(){if(0<J().length)return C.events.disableBlur(),C.events.focus(),!1},!0),C.events.$on(L(C.o_win),"keydown",function(){i&&r&&(r=i=!1,C.$el.removeClass("fr-no-selection"),C.edit.on(),C.selection.setAtEnd(C.$el.find(".fr-selected-cell").last().get(0)),C.selection.restore(),T())}),C.events.$on(C.$el,"keydown",function(e){e.shiftKey?!1===function s(e){var t=J();if(null!=t&&0<t.length){var a,n=_(),r=e.which,i=w(1==t.length?a=t[0]:(a=C.el.querySelector(".fr-cell-fixed"),C.el.querySelector(".fr-cell-handler")),n);if(Be.KEYCODE.ARROW_RIGHT==r){if(i.col<n[0].length-1)return F(a,n[i.row][i.col+1]),!1}else if(Be.KEYCODE.ARROW_DOWN==r){if(i.row<n.length-1)return F(a,n[i.row+1][i.col]),!1}else if(Be.KEYCODE.ARROW_LEFT==r){if(0<i.col)return F(a,n[i.row][i.col-1]),!1}else if(Be.KEYCODE.ARROW_UP==r&&0<i.row)return F(a,n[i.row-1][i.col]),!1}}(e)&&setTimeout(function(){u()},0):function o(e){var t=e.which,a=C.selection.blocks();if(a.length&&("TD"==(a=a[0]).tagName||"TH"==a.tagName)){for(var n=a;n&&"TABLE"!=n.tagName&&n.parentNode!=C.el;)n=n.parentNode;if(n&&"TABLE"==n.tagName&&(Be.KEYCODE.ARROW_LEFT==t||Be.KEYCODE.ARROW_UP==t||Be.KEYCODE.ARROW_RIGHT==t||Be.KEYCODE.ARROW_DOWN==t)&&(0<J().length&&N(),C.browser.webkit&&(Be.KEYCODE.ARROW_UP==t||Be.KEYCODE.ARROW_DOWN==t))){var r=C.selection.ranges(0).startContainer;if(r.nodeType==Node.TEXT_NODE&&(Be.KEYCODE.ARROW_UP==t&&(r.previousSibling&&"BR"!==r.previousSibling.tagName||r.previousSibling&&"BR"===r.previousSibling.tagName&&r.previousSibling.previousSibling)||Be.KEYCODE.ARROW_DOWN==t&&(r.nextSibling&&"BR"!==r.nextSibling.tagName||r.nextSibling&&"BR"===r.nextSibling.tagName&&r.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var i=_(L(n)),s=w(a,i);return Be.KEYCODE.ARROW_UP==t?B(s,n,i):Be.KEYCODE.ARROW_DOWN==t&&P(s,n,i),C.selection.restore(),!1}}}(e)}),C.events.on("keydown",function(e){if(!1===function n(e){if(e.which==Be.KEYCODE.TAB){var t;if(0<J().length)t=C.$el.find(".fr-selected-cell").last();else{var a=C.selection.element();"TD"==a.tagName||"TH"==a.tagName?t=L(a):a!=C.el&&(0<L(a).parentsUntil(C.$el,"td").length?t=L(a).parents("td").first():0<L(a).parentsUntil(C.$el,"th").length&&(t=L(a).parents("th").first()))}if(t)return e.preventDefault(),!!(0===C.selection.get().focusOffset&&0<L(C.selection.element()).parentsUntil(C.$el,"ol, ul").length&&(0<L(C.selection.element()).closest("li").prev().length||L(C.selection.element()).is("li")&&0<L(C.selection.element()).prev().length))||(N(),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"),g("below"),T(),q(t.closest("tr").next().find("td").first())),C.selection.restore(),!1)}}(e))return!1;var t=J();if(0<t.length){if(0<t.length&&C.keys.ctrlKey(e)&&e.which==Be.KEYCODE.A)return T(),C.popups.isVisible("table.edit")&&C.popups.hide("table.edit"),t=[],!0;if(e.which==Be.KEYCODE.ESC&&C.popups.isVisible("table.edit"))return T(),C.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==Be.KEYCODE.BACKSPACE||e.which==Be.KEYCODE.DELETE)){C.undo.saveStep();for(var a=0;a<t.length;a++)L(t[a]).html("<br>"),a==t.length-1&&L(t[a]).prepend(Be.MARKERS);return C.selection.restore(),C.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=Be.KEYCODE.F10&&!C.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function r(e){if(e.altKey&&e.which==Be.KEYCODE.SPACE){var t,a=C.selection.element();if("TD"==a.tagName||"TH"==a.tagName?t=a:0<L(a).closest("td").length?t=L(a).closest("td").get(0):0<L(a).closest("th").length&&(t=L(a).closest("th").get(0)),t)return e.preventDefault(),F(t,t),u(),!1}}(e))return!1},!0);var t=[];C.events.on("html.beforeGet",function(){t=J();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),C.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=[]}),d(!0),p(!0)}C.events.on("destroy",Q)},insert:function te(e,t){var a,n,r="<table "+(C.opts.tableDefaultWidth?'style="width: '+C.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',i=100/t;for(a=0;a<e;a++){for(r+="<tr>",n=0;n<t;n++)r+="<td"+(C.opts.tableDefaultWidth?' style="width: '+i.toFixed(4)+'%;"':"")+">",0===a&&0===n&&(r+=Be.MARKERS),r+="<br></td>";r+="</tr>"}r+="</tbody></table>",C.html.insert(r),C.selection.restore();var s=C.$el.find(".fr-inserted-table");s.removeClass("fr-inserted-table"),C.events.trigger("table.inserted",[s.get(0)])},remove:h,insertRow:g,deleteRow:function ae(){var e=Z();if(0<e.length){var t,a,n,r=_(),i=O(r);if(null==i)return;if(0===i.min_i&&i.max_i==r.length-1)h();else{for(t=i.max_i;t>=i.min_i;t--){for(n=L(e.find("tr").not(e.find("> table tr")).get(t)),a=0;a<r[t].length;a++)if(0===a||r[t][a]!=r[t][a-1]){var s=L(r[t][a]);if(1<parseInt(s.attr("rowspan"),10)){var o=parseInt(s.attr("rowspan"),10)-1;1==o?s.removeAttr("rowspan"):s.attr("rowspan",o)}if(t<r.length-1&&r[t][a]==r[t+1][a]&&(0===t||r[t][a]!=r[t-1][a])){for(var l=r[t][a],c=a;0<c&&r[t][c]==r[t][c-1];)c--;0===c?L(e.find("tr").not(e.find("> table tr")).get(t+1)).prepend(l):L(r[t+1][c-1])[0].parentNode&&L(r[t+1][c-1])[0].insertAdjacentElement("afterend",l)}}var d=n.parent();n.remove(),0===d.find("tr").length&&d.remove(),r=_(e)}b(0,r.length-1,0,r[0].length-1,e),0<i.min_i?C.selection.setAtEnd(r[i.min_i-1][0]):C.selection.setAtEnd(r[0][0]),C.selection.restore(),C.popups.hide("table.edit")}}},insertColumn:function ne(l){var e=Z();if(0<e.length){var c,d=_(),t=O(d);c="before"==l?t.min_j:t.max_j;var a,f=100/d[0].length,p=100/(d[0].length+1);e.find("th, td").each(function(){(a=L(this)).data("old-width",a.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("> table tr")).each(function(e){for(var t,a=L(this),n=0,r=0;n-1<c;){if(!(t=a.find("> th, > td").get(r))){t=null;break}t==d[e][n]?(n+=parseInt(L(t).attr("colspan"),10)||1,r++):(n+=parseInt(L(d[e][n]).attr("colspan"),10)||1,"after"==l&&(t=0===r?-1:a.find("> th, > td").get(r-1)))}var i,s=L(t);if("after"==l&&c<n-1||"before"==l&&0<c&&d[e][c]==d[e][c-1]){if(0===e||0<e&&d[e][c]!=d[e-1][c]){var o=parseInt(s.attr("colspan"),10)+1;s.attr("colspan",o),s.css("width",(s.data("old-width")*p/f+p).toFixed(4)+"%"),s.removeData("old-width")}}else i=0<a.find("th").length?'<th style="width: '+p.toFixed(4)+'%;"><br></th>':'<td style="width: '+p.toFixed(4)+'%;"><br></td>',-1==t?a.prepend(i):null==t?a.append(i):"before"==l?s.before(i):"after"==l&&s[0].parentNode&&s[0].insertAdjacentHTML("afterend",i)}),e.find("th, td").each(function(){(a=L(this)).data("old-width")&&(a.css("width",(a.data("old-width")*p/f).toFixed(4)+"%"),a.removeData("old-width"))}),C.popups.isVisible("table.edit")&&u()}},deleteColumn:function re(){var e=Z();if(0<e.length){var t,a,n,r=_(),i=O(r);if(null==i)return;if(0===i.min_j&&i.max_j==r[0].length-1)h();else{var s=0;for(t=0;t<r.length;t++)for(a=0;a<r[0].length;a++)(n=L(r[t][a])).hasClass("fr-selected-cell")||(n.data("old-width",n.outerWidth()/e.outerWidth()*100),(a<i.min_j||a>i.max_j)&&(s+=n.outerWidth()/e.outerWidth()*100));for(s/=r.length,a=i.max_j;a>=i.min_j;a--)for(t=0;t<r.length;t++)if(0===t||r[t][a]!=r[t-1][a])if(n=L(r[t][a]),1<(parseInt(n.attr("colspan"),10)||1)){var o=parseInt(n.attr("colspan"),10)-1;1==o?n.removeAttr("colspan"):n.attr("colspan",o),n.css("width",(100*(n.data("old-width")-V(a,r))/s).toFixed(4)+"%"),n.removeData("old-width")}else{var l=L(n.parent().get(0));n.remove(),0===l.find("> th, > td").length&&(0===l.prev().length||0===l.next().length||l.prev().find("> th[rowspan], > td[rowspan]").length<l.prev().find("> th, > td").length)&&l.remove()}b(0,r.length-1,0,r[0].length-1,e),0<i.min_j?C.selection.setAtEnd(r[i.min_i][i.min_j-1]):C.selection.setAtEnd(r[i.min_i][0]),C.selection.restore(),C.popups.hide("table.edit"),e.find("th, td").each(function(){(n=L(this)).data("old-width")&&(n.css("width",(100*n.data("old-width")/s).toFixed(4)+"%"),n.removeData("old-width"))})}}},mergeCells:function ie(){if(1<J().length&&(0===C.$el.find("th.fr-selected-cell").length||0===C.$el.find("td.fr-selected-cell").length)){A();var e,t,a=O(_());if(null==a)return;var n=C.$el.find(".fr-selected-cell"),r=L(n[0]),i=r.parent().find(".fr-selected-cell"),s=r.closest("table"),o=r.html(),l=0;for(e=0;e<i.length;e++)l+=L(i[e]).outerWidth();for(r.css("width",Math.min(100,l/s.outerWidth()*100).toFixed(4)+"%"),a.min_j<a.max_j&&r.attr("colspan",a.max_j-a.min_j+1),a.min_i<a.max_i&&r.attr("rowspan",a.max_i-a.min_i+1),e=1;e<n.length;e++)"<br>"!=(t=L(n[e])).html()&&""!==t.html()&&(o+="<br>"+t.html()),t.remove();r.html(o),C.selection.setAtEnd(r.get(0)),C.selection.restore(),C.toolbar.enable(),v(a.min_i,a.max_i,s);var c=s.find("tr:empty");for(e=c.length-1;0<=e;e--)L(c[e]).remove();m(a.min_j,a.max_j,s),u()}},splitCellVertically:function se(){if(1==J().length){var e=C.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,a=e.parent().outerWidth(),n=e.outerWidth(),r=e.clone().html("<br>"),i=_(),s=w(e.get(0),i);if(1<t){var o=Math.ceil(t/2);n=z(s.col,s.col+o-1,i)/a*100;var l=z(s.col+o,s.col+t-1,i)/a*100;1<o?e.attr("colspan",o):e.removeAttr("colspan"),1<t-o?r.attr("colspan",t-o):r.removeAttr("colspan"),e.css("width",n.toFixed(4)+"%"),r.css("width",l.toFixed(4)+"%")}else{var c;for(c=0;c<i.length;c++)if(0===c||i[c][s.col]!=i[c-1][s.col]){var d=L(i[c][s.col]);if(!d.is(e)){var f=(parseInt(d.attr("colspan"),10)||1)+1;d.attr("colspan",f)}}n=n/a*100/2,e.css("width",n.toFixed(4)+"%"),r.css("width",n.toFixed(4)+"%")}e[0].parentNode&&e[0].insertAdjacentElement("afterend",r[0]),T(),C.popups.hide("table.edit")}},splitCellHorizontally:function oe(){if(1==J().length){var e=C.$el.find(".fr-selected-cell"),t=e.parent(),a=e.closest("table"),n=parseInt(e.attr("rowspan"),10),r=_(),i=w(e.get(0),r),s=e.clone().html("<br>");if(1<n){var o=Math.ceil(n/2);1<o?e.attr("rowspan",o):e.removeAttr("rowspan"),1<n-o?s.attr("rowspan",n-o):s.removeAttr("rowspan");for(var l=i.row+o,c=0===i.col?i.col:i.col-1;0<=c&&(r[l][c]==r[l][c-1]||0<l&&r[l][c]==r[l-1][c]);)c--;-1==c?L(a.find("tr").not(a.find("> table tr")).get(l)).prepend(s):L(r[l][c])[0].parentNode&&L(r[l][c])[0].insertAdjacentElement("afterend",s[0])}else{var d,f=L(document.createElement("tr")).append(s);for(d=0;d<r[0].length;d++)if(0===d||r[i.row][d]!=r[i.row][d-1]){var p=L(r[i.row][d]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t[0].parentNode&&t[0].insertAdjacentElement("afterend",f[0])}T(),C.popups.hide("table.edit")}},addHeader:function le(){var e=Z();if(0<e.length&&0===e.find("th").length){var t,a="<thead><tr>",n=0;for(e.find("tr").first().find("> td").each(function(){var e=L(this);n+=parseInt(e.attr("colspan"),10)||1}),t=0;t<n;t++)a+="<th><br></th>";a+="</tr></thead>",e.prepend(a),u()}},removeHeader:function ce(){var e=Z(),t=e.find("thead");if(0<t.length)if(0===e.find("tbody tr").length)h();else if(t.remove(),0<J().length)u();else{C.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(C.selection.setAtEnd(a),C.selection.restore())}},setBackground:t,showInsertPopup:function de(){var e=C.$tb.find('.fr-command[data-cmd="insertTable"]'),t=C.popups.get("table.insert");if(t||(t=d()),!t.hasClass("fr-active")){C.popups.refresh("table.insert"),C.popups.setContainer("table.insert",C.$tb);var a=C.button.getPosition(e),n=a.left,r=a.top;C.popups.show("table.insert",n,r,e.outerHeight())}},showEditPopup:u,showColorsPopup:o,back:function fe(){0<J().length?u():(C.popups.hide("table.insert"),C.toolbar.showInline())},verticalAlign:function pe(e){C.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function ue(e){C.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function he(e,t,a,n){if(0<t.length){if(!a){var r=Object.keys(n);r.splice(r.indexOf(e),1),t.removeClass(r.join(" "))}t.toggleClass(e)}},selectedTable:Z,selectedCells:J,customColor:function ge(){var e=C.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:F}},Be.DefineIcon("insertTable",{NAME:"table",SVG_KEY:"insertTable"}),Be.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"}),Be.RegisterCommand("tableInsert",{callback:function(e,t,a){this.table.insert(t,a),this.popups.hide("table.insert")}}),Be.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading",SVG_KEY:"tableHeader"}),Be.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))}}),Be.DefineIcon("tableRows",{NAME:"bars",SVG_KEY:"row"}),Be.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=Be.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()}}),Be.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90",SVG_KEY:"columns"}),Be.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=Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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()}}),Be.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square",SVG_KEY:"cellOptions"}),Be.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=Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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))}}),Be.DefineIcon("tableRemove",{NAME:"trash",SVG_KEY:"removeTable"}),Be.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),Be.DefineIcon("tableStyle",{NAME:"paint-brush",SVG_KEY:"tableStyle"}),Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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.$,n=this.$el.find(".fr-selected-cell").closest("table");n&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=n.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Be.DefineIcon("tableCellBackground",{NAME:"tint",SVG_KEY:"cellBackground"}),Be.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),Be.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),Be.DefineIcon("tableBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.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"))}}),Be.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"verticalAlignMiddle"}),Be.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=Be.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="'+a.toLowerCase()+'" title="'+this.language.translate(t[a])+'">'+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)}}),Be.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),Be.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.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=Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("align-"+a)+'<span class="fr-sr-only">'+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-"+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)}}),Be.DefineIcon("tableCellStyle",{NAME:"magic",SVG_KEY:"cellStyle"}),Be.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="'+a+'" title="'+this.language.translate(t[a])+'">'+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.$,n=this.$el.find(".fr-selected-cell").first();n&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=n.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),Be.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),Be.DefineIcon("tableColorRemove",{NAME:"eraser",SVG_KEY:"remove"}),Be.URLRegEx="(^| |\\u00A0)("+Be.LinkRegEx+"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$",Be.PLUGINS.url=function(i){var s=i.$,o=null;function t(e,t,a){for(var n="";a.length&&"."==a[a.length-1];)n+=".",a=a.substring(0,a.length-1);var r=a;if(i.opts.linkConvertEmailAddress)i.helpers.isEmail(r)&&!/^mailto:.*/i.test(r)&&(r="mailto:"+r);else if(i.helpers.isEmail(r))return t+a;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(r)||(r="//"+r),(t||"")+"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(o?' rel="'+o+'"':"")+' data-fr-linked="true" href="'+r+'">'+a.replace(/&amp;/g,"&").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</a>"+n}function l(){return new RegExp(Be.URLRegEx,"gi")}function c(e){return i.opts.linkAlwaysNoFollow&&(o="nofollow"),i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(o?o+=" noopener":o="noopener"),i.opts.linkNoReferrer&&(o?o+=" noreferrer":o="noreferrer")),e.replace(l(),t)}function d(e){var t=e.split(" ");return t[t.length-1]}function a(){var e=i.selection.ranges(0),t=e.startContainer;if(!t||t.nodeType!==Node.TEXT_NODE||e.startOffset!==(t.textContent||"").length)return!1;if(function r(e){return!!e&&("A"===e.tagName||!(!e.parentNode||e.parentNode==i.el)&&r(e.parentNode))}(t))return!1;if(l().test(d(t.textContent))){s(t).before(c(t.textContent));var a=s(t.parentNode).find("a[data-fr-linked]");a.removeAttr("data-fr-linked"),t.parentNode.removeChild(t),i.events.trigger("url.linked",[a.get(0)])}else if(t.textContent.split(" ").length<=2&&t.previousSibling&&"A"===t.previousSibling.tagName){var n=t.previousSibling.innerText+t.textContent;l().test(d(n))&&(s(t.previousSibling).replaceWith(c(n)),t.parentNode.removeChild(t))}}return{_init:function e(){i.events.on("keypress",function(e){!i.selection.isCollapsed()||"."!=e.key&&")"!=e.key&&"("!=e.key||a()},!0),i.events.on("keydown",function(e){var t=e.which;!i.selection.isCollapsed()||t!=Be.KEYCODE.ENTER&&t!=Be.KEYCODE.SPACE||a()},!0),i.events.on("paste.beforeCleanup",function(e){if(i.helpers.isURL(e)){var t=null;return i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(t?t+=" noopener":t="noopener"),i.opts.linkNoReferrer&&(t?t+=" noreferrer":t="noreferrer")),"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(t?' rel="'+t+'"':"")+' href="'+e+'" >'+e+"</a>"}})}}},Object.assign(Be.POPUP_TEMPLATES,{"video.insert":"[_BUTTONS_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_LAYER_][_PROGRESS_BAR_]","video.edit":"[_BUTTONS_]","video.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(Be.DEFAULTS,{videoAllowedTypes:["mp4","webm","ogg"],videoAllowedProviders:[".*"],videoDefaultAlign:"center",videoDefaultDisplay:"block",videoDefaultWidth:600,videoEditButtons:["videoReplace","videoRemove","videoDisplay","videoAlign","videoSize"],videoInsertButtons:["videoBack","|","videoByURL","videoEmbed","videoUpload"],videoMaxSize:52428800,videoMove:!0,videoResize:!0,videoResponsive:!1,videoSizeButtons:["videoBack","|"],videoSplitHTML:!1,videoTextNear:!0,videoUpload:!0,videoUploadMethod:"POST",videoUploadParam:"file",videoUploadParams:{},videoUploadToS3:!1,videoUploadURL:null}),Be.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be)|(youtube.com))\/((v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))?\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?([0-9a-zA-Z_\-]+)(.+)?/g,url_text:"https://www.youtube.com/embed/$1?$2",html:'<iframe width="640" height="360" src="{url}&wmode=opaque" frameborder="0" allowfullscreen></iframe>',provider:"youtube"},{test_regex:/^.*(?:vimeo.com)\/(?:channels(\/\w+\/)?|groups\/*\/videos\/\u200b\d+\/|video\/|)(\d+)(?:$|\/|\?)/,url_regex:/(?:https?:\/\/)?(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?(\/[a-zA-Z0-9_\-]+)?/i,url_text:"https://player.vimeo.com/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vimeo"},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"https://www.dailymotion.com/embed/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"dailymotion"},{test_regex:/^.+(screen.yahoo.com)\/[^_&]+/,url_regex:"",url_text:"",html:'<iframe width="640" height="360" src="{url}?format=embed" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"yahoo"},{test_regex:/^.+(rutube.ru)\/[^_&]+/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru)\/(?:video)?\/?(.+)/g,url_text:"https://rutube.ru/play/embed/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"rutube"},{test_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/,url_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/g,url_text:"https://play.vidyard.com/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vidyard"}],Be.VIDEO_EMBED_REGEX=/^\W*((<iframe(.|\n)*>(\s|\n)*<\/iframe>)|(<embed(.|\n)*>))\W*$/i,Be.PLUGINS.video=function(u){var o,d,f,p,n,a,h=u.$,l="https://i.froala.com/upload",g=2,m=3,v=4,c=5,E=6,r={};function b(){var e=u.popups.get("video.insert");e.find(".fr-video-by-url-layer input").val("").trigger("change");var t=e.find(".fr-video-embed-layer textarea");t.val("").trigger("change"),(t=e.find(".fr-video-upload-layer input")).val("").trigger("change")}function i(){var e=u.popups.get("video.edit");if(e||(e=function r(){var e="";if(0<u.opts.videoEditButtons.length){u.opts.videoResponsive&&(-1<u.opts.videoEditButtons.indexOf("videoSize")&&u.opts.videoEditButtons.splice(u.opts.videoEditButtons.indexOf("videoSize"),1),-1<u.opts.videoEditButtons.indexOf("videoDisplay")&&u.opts.videoEditButtons.splice(u.opts.videoEditButtons.indexOf("videoDisplay"),1),-1<u.opts.videoEditButtons.indexOf("videoAlign")&&u.opts.videoEditButtons.splice(u.opts.videoEditButtons.indexOf("videoAlign"),1));var t={buttons:e+='<div class="fr-buttons"> \n '.concat(u.button.buildList(u.opts.videoEditButtons)," \n </div>")},a=u.popups.create("video.edit",t);return u.events.$on(u.$wp,"scroll.video-edit",function(){p&&u.popups.isVisible("video.edit")&&(u.events.disableBlur(),w(p))}),a}return!1}()),e){u.popups.setContainer("video.edit",u.$sc),u.popups.refresh("video.edit");var t=p.find("iframe, embed, video"),a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();u.popups.show("video.edit",a,n,t.outerHeight(),!0)}}function s(e){if(e)return u.popups.onRefresh("video.insert",b),u.popups.onHide("video.insert",X),!0;var t="";u.opts.videoUpload||-1===u.opts.videoInsertButtons.indexOf("videoUpload")||u.opts.videoInsertButtons.splice(u.opts.videoInsertButtons.indexOf("videoUpload"),1);var a=u.button.buildList(u.opts.videoInsertButtons);""!==a&&(t='<div class="fr-buttons">'+a+"</div>");var n,r="",i=u.opts.videoInsertButtons.indexOf("videoUpload"),s=u.opts.videoInsertButtons.indexOf("videoByURL"),o=u.opts.videoInsertButtons.indexOf("videoEmbed");0<=s&&(n=" fr-active",(i<s&&0<=i||o<s&&0<=o)&&(n=""),r='<div class="fr-video-by-url-layer fr-layer'+n+'" id="fr-video-by-url-layer-'+u.id+'"><div class="fr-input-line"><input id="fr-video-by-url-layer-text-'+u.id+'" type="text" placeholder="'+u.language.translate("Paste in a video URL")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertByURL" tabIndex="2" role="button">'+u.language.translate("Insert")+"</button></div></div>");var l="";0<=o&&(n=" fr-active",(i<o&&0<=i||s<o&&0<=s)&&(n=""),l='<div class="fr-video-embed-layer fr-layer'+n+'" id="fr-video-embed-layer-'+u.id+'"><div class="fr-input-line"><textarea id="fr-video-embed-layer-text'+u.id+'" type="text" placeholder="'+u.language.translate("Embedded Code")+'" tabIndex="1" aria-required="true" rows="5"></textarea></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertEmbed" tabIndex="2" role="button">'+u.language.translate("Insert")+"</button></div></div>");var c="";0<=i&&(n=" fr-active",(o<i&&0<=o||s<i&&0<=s)&&(n=""),c='<div class="fr-video-upload-layer fr-layer'+n+'" id="fr-video-upload-layer-'+u.id+'"><strong>'+u.language.translate("Drop video")+"</strong><br>("+u.language.translate("or click")+')<div class="fr-form"><input type="file" accept="video/'+u.opts.videoAllowedTypes.join(", video/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-video-upload-layer-'+u.id+'" role="button"></div></div>');var d={buttons:t,by_url_layer:r,embed_layer:l,upload_layer:c,progress_bar:'<div class="fr-video-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="videoDismissError" tabIndex="2" role="button">OK</button></div></div>'},f=u.popups.create("video.insert",d);return function p(n){u.events.$on(n,"dragover dragenter",".fr-video-upload-layer",function(){return h(this).addClass("fr-drop"),!1},!0),u.events.$on(n,"dragleave dragend",".fr-video-upload-layer",function(){return h(this).removeClass("fr-drop"),!1},!0),u.events.$on(n,"drop",".fr-video-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),h(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=n.data("instance")||u;a.events.disableBlur(),a.video.upload(t.files),a.events.enableBlur()}},!0),u.helpers.isIOS()&&u.events.$on(n,"touchstart",'.fr-video-upload-layer input[type="file"]',function(){h(this).trigger("click")},!0);u.events.$on(n,"change",'.fr-video-upload-layer input[type="file"]',function(){if(this.files){var e=n.data("instance")||u;e.events.disableBlur(),n.find("input:focus").blur(),e.events.enableBlur(),e.video.upload(this.files)}h(this).val("")},!0)}(f),f}function A(e){u.events.focus(!0),u.selection.restore();var t=!1;p&&(q(),t=!0),u.html.insert('<span contenteditable="false" draggable="true" class="fr-jiv fr-video fr-deletable">'+e+"</span>",!1,u.opts.videoSplitHTML),u.popups.hide("video.insert");var a=u.$el.find(".fr-jiv");a.removeClass("fr-jiv"),a.toggleClass("fr-rv",u.opts.videoResponsive),Q(a,u.opts.videoDefaultDisplay,u.opts.videoDefaultAlign),a.toggleClass("fr-draggable",u.opts.videoMove),u.events.trigger(t?"video.replaced":"video.inserted",[a])}function T(){var e=h(this);u.popups.hide("video.insert"),e.removeClass("fr-uploading"),e.parent().next().is("br")&&e.parent().next().remove(),w(e.parent()),u.events.trigger("video.loaded",[e.parent()])}function C(o,e,c,d,f){u.edit.off(),L("Loading video"),e&&(o=u.helpers.sanitizeURL(o));var p=function p(){var e,t;if(d){u.undo.canDo()||d.find("video").hasClass("fr-uploading")||u.undo.saveStep();var a=d.find("video").data("fr-old-src"),n=d.data("fr-replaced");d.data("fr-replaced",!1),u.$wp?((e=d.clone(!0)).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),a&&d.find("video").attr("src",a),d.replaceWith(e)):e=d;for(var r=e.find("video").get(0).attributes,i=0;i<r.length;i++){var s=r[i];0===s.nodeName.indexOf("data-")&&e.find("video").removeAttr(s.nodeName)}if(void 0!==c)for(t in c)c.hasOwnProperty(t)&&"link"!=t&&e.find("video").attr("data-"+t,c[t]);e.find("video").on("canplay",T),e.find("video").attr("src",o),u.edit.on(),B(),u.undo.saveStep(),u.$el.blur(),u.events.trigger(n?"video.replaced":"video.inserted",[e,f])}else e=function l(e,t,a){var n,r="";if(t&&void 0!==t)for(n in t)t.hasOwnProperty(n)&&"link"!=n&&(r+=" data-"+n+'="'+t[n]+'"');var i=u.opts.videoDefaultWidth;i&&"auto"!=i&&(i+="px");var s=h(document.createElement("span")).attr("contenteditable","false").attr("draggable","true").attr("class","fr-video fr-dv"+u.opts.videoDefaultDisplay[0]+("center"!=u.opts.videoDefaultAlign?" fr-fv"+u.opts.videoDefaultAlign[0]:"")).html('<video src="'+e+'" '+r+(i?' style="width: '+i+';" ':"")+" controls>"+u.language.translate("Your browser does not support HTML5 video.")+"</video>");s.toggleClass("fr-draggable",u.opts.videoMove),u.edit.on(),u.events.focus(!0),u.selection.restore(),u.undo.saveStep(),u.opts.videoSplitHTML?u.markers.split():u.markers.insert();u.html.wrap();var o=u.$el.find(".fr-marker");u.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent());o.replaceWith(s),u.selection.clear(),s.find("video").get(0).readyState>s.find("video").get(0).HAVE_FUTURE_DATA||u.helpers.isIOS()?a.call(s.find("video").get(0)):s.find("video").on("canplaythrough load",a);return s}(o,c,T),B(),u.undo.saveStep(),u.events.trigger("video.inserted",[e,f])};R("Loading video"),p()}function R(e){var t=u.popups.get("video.insert");if(t||(t=s()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),p){var a=p.find("video");u.popups.setContainer("video.insert",u.$sc);var n=a.offset().left,r=a.offset().top+a.height();u.popups.show("video.insert",n,r,a.outerHeight())}void 0===e&&L(u.language.translate("Uploading"),0)}function S(e){var t=u.popups.get("video.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||u.$el.find("video.fr-error").length)){if(u.events.focus(),u.$el.find("video.fr-error").length&&(u.$el.find("video.fr-error").parent().remove(),u.undo.saveStep(),u.undo.run(),u.undo.dropRedo()),!u.$wp&&p){var a=p;U(!0),u.selection.setAfter(a.find("video").get(0)),u.selection.restore()}u.popups.hide("video.insert")}}function L(e,t){var a=u.popups.get("video.insert");if(a){var n=a.find(".fr-video-progress-bar-layer");n.find("h3").text(e+(t?" "+t+"%":"")),n.removeClass("fr-error"),t?(n.find("div").removeClass("fr-indeterminate"),n.find("div > span").css("width",t+"%")):n.find("div").addClass("fr-indeterminate")}}function _(e){R();var t=u.popups.get("video.insert").find(".fr-video-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),u.events.disableBlur(),a.focus()}function w(e){t.call(e.get(0))}function y(e){L("Loading video");var t=this.status,a=this.response,n=this.responseXML,r=this.responseText;try{if(u.opts.videoUploadToS3)if(201==t){var i=function o(e){try{var t=h(e).find("Location").text(),a=h(e).find("Key").text();return!1===u.events.trigger("video.uploadedToS3",[t,a,e],!0)?(u.edit.on(),!1):t}catch(n){return G(v,e),!1}}(n);i&&C(i,!1,[],e,a||n)}else G(v,a||n);else if(200<=t&&t<300){var s=function l(e){try{if(!1===u.events.trigger("video.uploaded",[e],!0))return u.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(G(g,e),!1)}catch(a){return G(v,e),!1}}(r);s&&C(s.link,!1,s,e,a||r)}else G(m,a||r)}catch(c){G(v,a||r)}}function I(){G(v,this.response||this.responseText||this.responseXML)}function O(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;L(u.language.translate("Uploading"),t)}}function x(){u.edit.on(),S(!0)}function F(e){if(!u.core.sameInstance(f))return!0;e.preventDefault(),e.stopPropagation();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),a=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!a)return!1;if("mousedown"==e.type){var n=u.$oel.get(0).ownerDocument,r=n.defaultView||n.parentWindow,i=!1;try{i=r.location!=r.parent.location&&!(r.$&&r.$.FE)}catch(s){}i&&r.frameElement&&(t+=u.helpers.getPX(h(r.frameElement).offset().left)+r.frameElement.clientLeft,a=e.clientY+u.helpers.getPX(h(r.frameElement).offset().top)+r.frameElement.clientTop)}u.undo.canDo()||u.undo.saveStep(),(d=h(this)).data("start-x",t),d.data("start-y",a),o.show(),u.popups.hideAll(),K()}function k(e){if(!u.core.sameInstance(f))return!0;if(d){e.preventDefault();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),a=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!a)return!1;var n=d.data("start-x"),r=d.data("start-y");d.data("start-x",t),d.data("start-y",a);var i=t-n,s=a-r,o=p.find("iframe, embed, video"),l=o.width(),c=o.height();(d.hasClass("fr-hnw")||d.hasClass("fr-hsw"))&&(i=0-i),(d.hasClass("fr-hnw")||d.hasClass("fr-hne"))&&(s=0-s),o.css("width",l+i),o.css("height",c+s),o.removeAttr("width"),o.removeAttr("height"),P()}}function N(e){if(!u.core.sameInstance(f))return!0;d&&p&&(e&&e.stopPropagation(),d=null,o.hide(),P(),i(),u.undo.saveStep())}function D(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function M(e,t,a,n){return e.pageX=t,e.pageY=t,F.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,n)),e.pageY=e.pageY+a*Math.floor(Math.pow(1.1,n)),k.call(this,e),N.call(this,e),++n}function B(){var e,t=Array.prototype.slice.call(u.el.querySelectorAll("video, .fr-video > *")),a=[];for(e=0;e<t.length;e++)a.push(t[e].getAttribute("src")),h(t[e]).toggleClass("fr-draggable",u.opts.videoMove),""===t[e].getAttribute("class")&&t[e].removeAttribute("class"),""===t[e].getAttribute("style")&&t[e].removeAttribute("style");if(n)for(e=0;e<n.length;e++)a.indexOf(n[e].getAttribute("src"))<0&&u.events.trigger("video.removed",[h(n[e])]);n=t}function P(){f||function s(){var e;if(u.shared.$video_resizer?(f=u.shared.$video_resizer,o=u.shared.$vid_overlay,u.events.on("destroy",function(){h("body").first().append(f.removeClass("fr-active"))},!0)):(u.shared.$video_resizer=h(document.createElement("div")).attr("class","fr-video-resizer"),f=u.shared.$video_resizer,u.events.$on(f,"mousedown",function(e){e.stopPropagation()},!0),u.opts.videoResize&&(f.append(D("nw")+D("ne")+D("sw")+D("se")),u.shared.$vid_overlay=h(document.createElement("div")).attr("class","fr-video-overlay"),o=u.shared.$vid_overlay,e=f.get(0).ownerDocument,h(e).find("body").first().append(o))),u.events.on("shared.destroy",function(){f.html("").removeData().remove(),f=null,u.opts.videoResize&&(o.remove(),o=null)},!0),u.helpers.isMobile()||u.events.$on(h(u.o_win),"resize.video",function(){U(!0)}),u.opts.videoResize){e=f.get(0).ownerDocument,u.events.$on(f,u._mousedown,".fr-handler",F),u.events.$on(h(e),u._mousemove,k),u.events.$on(h(e.defaultView||e.parentWindow),u._mouseup,N),u.events.$on(o,"mouseleave",N);var n=1,r=null,i=0;u.events.on("keydown",function(e){if(p){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-i)&&(n=1),(a==Be.KEYCODE.EQUALS||u.browser.mozilla&&a==Be.KEYCODE.FF_EQUALS)&&t&&!e.altKey?n=M.call(this,e,1,1,n):(a==Be.KEYCODE.HYPHEN||u.browser.mozilla&&a==Be.KEYCODE.FF_HYPHEN)&&t&&!e.altKey&&(n=M.call(this,e,2,-1,n)),r=a,i=e.timeStamp}}),u.events.on("keyup",function(){n=1})}}(),(u.$wp||u.$sc).append(f),f.data("instance",u);var e=p.find("iframe, embed, video"),t=0,a=0;u.opts.iframe&&(a=u.helpers.getPX(u.$wp.find(".fr-iframe").css("padding-top")),t=u.helpers.getPX(u.$wp.find(".fr-iframe").css("padding-left"))),f.css("top",(u.opts.iframe?e.offset().top+a-1:e.offset().top-u.$wp.offset().top-1)+u.$wp.scrollTop()).css("left",(u.opts.iframe?e.offset().left+t-1:e.offset().left-u.$wp.offset().left-1)+u.$wp.scrollLeft()).css("width",e.get(0).getBoundingClientRect().width).css("height",e.get(0).getBoundingClientRect().height).addClass("fr-active")}function t(e){if(e&&"touchend"==e.type&&a)return!0;if(e&&u.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;if(u.edit.isDisabled())return!1;for(var t=0;t<Be.INSTANCES.length;t++)Be.INSTANCES[t]!=u&&Be.INSTANCES[t].events.trigger("video.hideResizer");u.toolbar.disable(),u.helpers.isMobile()&&(u.events.disableBlur(),u.$el.blur(),u.events.enableBlur()),u.$el.find(".fr-video.fr-active").removeClass("fr-active"),(p=h(this)).addClass("fr-active"),u.opts.iframe&&u.size.syncIframe(),Z(),P(),i(),u.selection.clear(),u.button.bulkRefresh(),u.events.trigger("image.hideResizer")}function U(e){p&&(function t(){return u.shared.vid_exit_flag}()||!0===e)&&(f.removeClass("fr-active"),u.toolbar.enable(),p.removeClass("fr-active"),p=null,K())}function W(){u.shared.vid_exit_flag=!0}function K(){u.shared.vid_exit_flag=!1}function H(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("video")){if(!u.opts.videoUpload)return e.preventDefault(),e.stopPropagation(),!1;u.markers.remove(),u.markers.insertAtPoint(e.originalEvent),u.$el.find(".fr-marker").replaceWith(Be.MARKERS),u.popups.hideAll();var n=u.popups.get("video.insert");return n||(n=s()),u.popups.setContainer("video.insert",u.$sc),u.popups.show("video.insert",e.originalEvent.pageX,e.originalEvent.pageY),R(),0<=u.opts.videoAllowedTypes.indexOf(a.type.replace(/video\//g,""))?$(t.files):G(E),e.preventDefault(),e.stopPropagation(),!1}}}function $(e){if(void 0!==e&&0<e.length){if(!1===u.events.trigger("video.beforeUpload",[e]))return!1;var t,a=e[0];if((null===u.opts.videoUploadURL||u.opts.videoUploadURL==l)&&!u.opts.videoUploadToS3)return function o(n){p&&p.find("iframe")&&p.find("iframe").length&&q();var r=new FileReader;r.onload=function(){r.result;for(var e=atob(r.result.split(",")[1]),t=[],a=0;a<e.length;a++)t.push(e.charCodeAt(a));C(window.URL.createObjectURL(new Blob([new Uint8Array(t)],{type:n.type})),!1,null,p)},R(),r.readAsDataURL(n)}(a),!1;if(a.size>u.opts.videoMaxSize)return G(c),!1;if(u.opts.videoAllowedTypes.indexOf(a.type.replace(/video\//g,""))<0)return G(E),!1;if(u.drag_support.formdata&&(t=u.drag_support.formdata?new FormData:null),t){var n;if(!1!==u.opts.videoUploadToS3)for(n in t.append("key",u.opts.videoUploadToS3.keyStart+(new Date).getTime()+"-"+(a.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",a.type),u.opts.videoUploadToS3.params)u.opts.videoUploadToS3.params.hasOwnProperty(n)&&t.append(n,u.opts.videoUploadToS3.params[n]);for(n in u.opts.videoUploadParams)u.opts.videoUploadParams.hasOwnProperty(n)&&t.append(n,u.opts.videoUploadParams[n]);t.append(u.opts.videoUploadParam,a);var r=u.opts.videoUploadURL;u.opts.videoUploadToS3&&(r=u.opts.videoUploadToS3.uploadURL?u.opts.videoUploadToS3.uploadURL:"https://"+u.opts.videoUploadToS3.region+".amazonaws.com/"+u.opts.videoUploadToS3.bucket);var i=u.core.getXHR(r,u.opts.videoUploadMethod);i.onload=function(){y.call(i,p)},i.onerror=I,i.upload.onprogress=O,i.onabort=x,R(),u.events.disableBlur(),u.edit.off(),u.events.enableBlur();var s=u.popups.get("video.insert");s&&h(s.off("abortUpload")).on("abortUpload",function(){4!=i.readyState&&i.abort()}),i.send(t)}}}function G(e,t){u.edit.on(),p&&p.find("video").addClass("fr-error"),_(u.language.translate("Something went wrong. Please try again.")),u.events.trigger("video.error",[{code:e,message:r[e]},t])}function Y(){if(p){var e=u.popups.get("video.size"),t=p.find("iframe, embed, video");e.find('input[name="width"]').val(t.get(0).style.width||t.attr("width")).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height||t.attr("height")).trigger("change")}}function V(e){if(e)return u.popups.onRefresh("video.size",Y),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+u.button.buildList(u.opts.videoSizeButtons)+"</div>",size_layer:'<div class="fr-video-size-layer fr-layer fr-active" id="fr-video-size-layer-'+u.id+'"><div class="fr-video-group"><div class="fr-input-line"><input id="fr-video-size-layer-width-'+u.id+'" type="text" name="width" placeholder="'+u.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-video-size-layer-height-'+u.id+'" type="text" name="height" placeholder="'+u.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoSetSize" tabIndex="2" role="button">'+u.language.translate("Update")+"</button></div></div>"},a=u.popups.create("video.size",t);return u.events.$on(u.$wp,"scroll",function(){p&&u.popups.isVisible("video.size")&&(u.events.disableBlur(),w(p))}),a}function z(e){if(void 0===e&&(e=p),e){if(e.hasClass("fr-fvl"))return"left";if(e.hasClass("fr-fvr"))return"right";if(e.hasClass("fr-dvb")||e.hasClass("fr-dvi"))return"center";if("block"==e.css("display")){if("left"==e.css("text-algin"))return"left";if("right"==e.css("text-align"))return"right"}else{if("left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function j(e){void 0===e&&(e=p);var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function q(){if(p&&!1!==u.events.trigger("video.beforeRemove",[p])){var e=p;u.popups.hideAll(),U(!0),u.selection.setBefore(e.get(0))||u.selection.setAfter(e.get(0)),e.remove(),u.selection.restore(),u.html.fillEmptyBlocks()}}function X(){S()}function Q(e,t,a){!u.opts.htmlUntouched&&u.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv"+a[0]+" fr-dv"+t[0])):"inline"==t?(e.css({display:"inline-block"}),"center"==a?e.css({"float":"none"}):"left"==a?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==a?e.css({textAlign:"left"}):"right"==a?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}function J(){var e=u.$el.find("video").filter(function(){return 0===h(this).parents("span.fr-video").length});if(0!=e.length){e.wrap(h(document.createElement("span")).attr("class","fr-video fr-deletable").attr("contenteditable","false")),u.$el.find("embed, iframe").filter(function(){if(u.browser.safari&&this.getAttribute("src")&&this.setAttribute("src",this.src),0<h(this).parents("span.fr-video").length)return!1;for(var e=h(this).attr("src"),t=0;t<Be.VIDEO_PROVIDERS.length;t++){var a=Be.VIDEO_PROVIDERS[t];if(a.test_regex.test(e)&&new RegExp(u.opts.videoAllowedProviders.join("|")).test(a.provider))return!0}return!1}).map(function(){return 0===h(this).parents("object").length?this:h(this).parents("object").get(0)}).wrap(h(document.createElement("span")).attr("class","fr-video").attr("contenteditable","false"));for(var t,a,n,r,i=u.$el.find("span.fr-video, video"),s=0;s<i.length;s++){var o=h(i[s]);!u.opts.htmlUntouched&&u.opts.useClasses?((r=o).hasClass("fr-dvi")||r.hasClass("fr-dvb")||(r.addClass("fr-fv"+z(r)[0]),r.addClass("fr-dv"+j(r)[0])),u.opts.videoTextNear||o.removeClass("fr-dvi").addClass("fr-dvb")):u.opts.htmlUntouched||u.opts.useClasses||(void 0,a=(t=o).hasClass("fr-dvb")?"block":t.hasClass("fr-dvi")?"inline":null,n=t.hasClass("fr-fvl")?"left":t.hasClass("fr-fvr")?"right":z(t),Q(t,a,n),t.removeClass("fr-dvb fr-dvi fr-fvr fr-fvl"))}i.toggleClass("fr-draggable",u.opts.videoMove)}}function Z(){if(p){u.selection.clear();var e=u.doc.createRange();e.selectNode(p.get(0)),u.selection.get().addRange(e)}}return r[1]="Video cannot be loaded from the passed link.",r[g]="No link in upload response.",r[m]="Error during file upload.",r[v]="Parsing response failed.",r[c]="File is too large.",r[E]="Video file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",u.shared.vid_exit_flag=!1,{_init:function ee(){u.opts.videoResponsive&&(u.opts.videoResize=!1),function e(){u.events.on("drop",H,!0),u.events.on("mousedown window.mousedown",W),u.events.on("window.touchmove",K),u.events.on("mouseup window.mouseup",U),u.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&U()}),u.events.on("video.hideResizer commands.undo commands.redo element.dropped",function(){U(!0)})}(),u.helpers.isMobile()&&(u.events.$on(u.$el,"touchstart","span.fr-video",function(){a=!1}),u.events.$on(u.$el,"touchmove",function(){a=!0})),u.events.on("html.set",J),J(),u.events.$on(u.$el,"mousedown","span.fr-video",function(e){e.stopPropagation(),(u.browser.msie||u.browser.edge)&&(e.target.dragDrop(),t.call(this,e))}),u.events.$on(u.$el,"click touchend","span.fr-video",function(e){if("false"==h(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t.call(this,e)}),u.events.on("keydown",function(e){var t=e.which;return!p||t!=Be.KEYCODE.BACKSPACE&&t!=Be.KEYCODE.DELETE?p&&t==Be.KEYCODE.ESC?(U(!0),e.preventDefault(),!1):p&&t!=Be.KEYCODE.F10&&!u.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),q(),u.undo.saveStep(),!1)},!0),u.events.on("toolbar.esc",function(){if(p)return u.events.disableBlur(),u.events.focus(),!1},!0),u.events.on("toolbar.focusEditor",function(){if(p)return!1},!0),u.events.on("keydown",function(){u.$el.find("span.fr-video:empty").remove()}),u.$wp&&(B(),u.events.on("contentChanged",B)),s(!0),V(!0)},showInsertPopup:function te(){var e=u.$tb.find('.fr-command[data-cmd="insertVideo"]'),t=u.popups.get("video.insert");if(t||(t=s()),S(),!t.hasClass("fr-active"))if(u.popups.refresh("video.insert"),u.popups.setContainer("video.insert",u.$tb),e.isVisible()){var a=u.button.getPosition(e),n=a.left,r=a.top;u.popups.show("video.insert",n,r,e.outerHeight())}else u.position.forSelection(t),u.popups.show("video.insert")},showLayer:function ae(e){var t,a,n=u.popups.get("video.insert");if(!p&&!u.opts.toolbarInline){var r=u.$tb.find('.fr-command[data-cmd="insertVideo"]');t=r.offset().left,a=r.offset().top+(u.opts.toolbarBottom?10:r.outerHeight()-10)}u.opts.toolbarInline&&(a=n.offset().top-u.helpers.getPX(n.css("margin-top")),n.hasClass("fr-above")&&(a+=n.outerHeight())),n.find(".fr-layer").removeClass("fr-active"),n.find(".fr-"+e+"-layer").addClass("fr-active"),u.popups.show("video.insert",t,a,0),u.accessibility.focusPopup(n)},refreshByURLButton:function ne(e){var t=u.popups.get("video.insert");t&&t.find(".fr-video-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshEmbedButton:function re(e){var t=u.popups.get("video.insert");t&&t.find(".fr-video-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshUploadButton:function ie(e){var t=u.popups.get("video.insert");t&&t.find(".fr-video-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:$,insertByURL:function se(e){void 0===e&&(e=(u.popups.get("video.insert").find('.fr-video-by-url-layer input[type="text"]').val()||"").trim());var t=null;if(/^http/.test(e)||(e="https://"+e),u.helpers.isURL(e))for(var a=0;a<Be.VIDEO_PROVIDERS.length;a++){var n=Be.VIDEO_PROVIDERS[a];if(n.test_regex.test(e)&&new RegExp(u.opts.videoAllowedProviders.join("|")).test(n.provider)){t=e.replace(n.url_regex,n.url_text),t=n.html.replace(/\{url\}/,t);break}}t?A(t):(_(u.language.translate("Something went wrong. Please try again.")),u.events.trigger("video.linkError",[e]))},insertEmbed:function oe(e){void 0===e&&(e=u.popups.get("video.insert").find(".fr-video-embed-layer textarea").val()||""),0!==e.length&&Be.VIDEO_EMBED_REGEX.test(e)?A(e):(_(u.language.translate("Something went wrong. Please try again.")),u.events.trigger("video.codeError",[e]))},insert:A,align:function le(e){p.removeClass("fr-fvr fr-fvl"),!u.opts.htmlUntouched&&u.opts.useClasses?"left"==e?p.addClass("fr-fvl"):"right"==e&&p.addClass("fr-fvr"):Q(p,j(),e),Z(),P(),i(),u.selection.clear()},refreshAlign:function ce(e){if(!p)return!1;e.find(">*").first().replaceWith(u.icon.create("video-align-"+z()))},refreshAlignOnShow:function de(e,t){p&&t.find('.fr-command[data-param1="'+z()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function fe(e){p.removeClass("fr-dvi fr-dvb"),!u.opts.htmlUntouched&&u.opts.useClasses?"inline"==e?p.addClass("fr-dvi"):"block"==e&&p.addClass("fr-dvb"):Q(p,e,z()),Z(),P(),i(),u.selection.clear()},refreshDisplayOnShow:function pe(e,t){p&&t.find('.fr-command[data-param1="'+j()+'"]').addClass("fr-active").attr("aria-selected",!0)},remove:q,hideProgressBar:S,showSizePopup:function ue(){var e=u.popups.get("video.size");e||(e=V()),S(),u.popups.refresh("video.size"),u.popups.setContainer("video.size",u.$sc);var t=p.find("iframe, embed, video"),a=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.height();u.popups.show("video.size",a,n,t.height(),!0)},replace:function he(){var e=u.popups.get("video.insert");e||(e=s()),u.popups.isVisible("video.insert")||(S(),u.popups.refresh("video.insert"),u.popups.setContainer("video.insert",u.$sc));var t=p.offset().left+p.outerWidth()/2,a=p.offset().top+p.height();u.popups.show("video.insert",t,a,p.outerHeight(),!0)},back:function e(){p?(u.events.disableBlur(),p[0].click()):(u.events.disableBlur(),u.selection.restore(),u.events.enableBlur(),u.popups.hide("video.insert"),u.toolbar.showInline())},setSize:function ge(e,t){if(p){var a=u.popups.get("video.size"),n=p.find("iframe, embed, video");n.css("width",e||a.find('input[name="width"]').val()),n.css("height",t||a.find('input[name="height"]').val()),n.get(0).style.width&&n.removeAttr("width"),n.get(0).style.height&&n.removeAttr("height"),a.find("input:focus").blur(),setTimeout(function(){p.trigger("click")},u.helpers.isAndroid()?50:0)}},get:function me(){return p},showProgressBar:R}},Be.RegisterCommand("insertVideo",{title:"Insert Video",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("video.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("video.insert")):this.video.showInsertPopup()},plugin:"video"}),Be.DefineIcon("insertVideo",{NAME:"video-camera",FA5NAME:"camera",SVG_KEY:"insertVideo"}),Be.DefineIcon("videoByURL",{NAME:"link",SVG_KEY:"insertLink"}),Be.RegisterCommand("videoByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-by-url")},refresh:function(e){this.video.refreshByURLButton(e)}}),Be.DefineIcon("videoEmbed",{NAME:"code",SVG_KEY:"codeView"}),Be.RegisterCommand("videoEmbed",{title:"Embedded Code",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-embed")},refresh:function(e){this.video.refreshEmbedButton(e)}}),Be.DefineIcon("videoUpload",{NAME:"upload",SVG_KEY:"upload"}),Be.RegisterCommand("videoUpload",{title:"Upload Video",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-upload")},refresh:function(e){this.video.refreshUploadButton(e)}}),Be.RegisterCommand("videoInsertByURL",{undo:!0,focus:!0,callback:function(){this.video.insertByURL()}}),Be.RegisterCommand("videoInsertEmbed",{undo:!0,focus:!0,callback:function(){this.video.insertEmbed()}}),Be.DefineIcon("videoDisplay",{NAME:"star",SVG_KEY:"star"}),Be.RegisterCommand("videoDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.video.display(t)},refresh:function(e){this.opts.videoTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.video.refreshDisplayOnShow(e,t)}}),Be.DefineIcon("video-align",{NAME:"align-left",SVG_KEY:"align Left"}),Be.DefineIcon("video-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),Be.DefineIcon("video-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),Be.DefineIcon("video-align-center",{NAME:"align-justify",SVG_KEY:"alignJustify"}),Be.DefineIcon("videoAlign",{NAME:"align-center",SVG_KEY:"alignCenter"}),Be.RegisterCommand("videoAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Be.COMMANDS.videoAlign.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="videoAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("video-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.video.align(t)},refresh:function(e){this.video.refreshAlign(e)},refreshOnShow:function(e,t){this.video.refreshAlignOnShow(e,t)}}),Be.DefineIcon("videoReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),Be.RegisterCommand("videoReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.video.replace()}}),Be.DefineIcon("videoRemove",{NAME:"trash",SVG_KEY:"remove"}),Be.RegisterCommand("videoRemove",{title:"Remove",callback:function(){this.video.remove()}}),Be.DefineIcon("videoSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),Be.RegisterCommand("videoSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.video.showSizePopup()}}),Be.DefineIcon("videoBack",{NAME:"arrow-left",SVG_KEY:"back"}),Be.RegisterCommand("videoBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.video.back()},refresh:function(e){this.video.get()||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"))}}),Be.RegisterCommand("videoDismissError",{title:"OK",undo:!1,callback:function(){this.video.hideProgressBar(!0)}}),Be.RegisterCommand("videoSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.video.setSize()}}),Object.assign(Be.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent","border","border-.*","line-height","list-style-type"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),Be.PLUGINS.wordPaste=function(T){var s,r,u=T.$,o="word_paste",h={};function t(e){var t=T.opts.wordAllowedStyleProps;e||(T.opts.wordAllowedStyleProps=[]),0===r.indexOf("<colgroup>")&&(r="<table>"+r+"</table>"),r=function p(e,t){0<=e.indexOf("<html")&&(e=e.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));!function d(e){for(var t=e.split("v:shape"),a=1;a<t.length;a++){var n=t[a],r=n.split(' id="')[1];if(r&&1<r.length){r=r.split('"')[0];var i=n.split(' o:spid="')[1];i&&1<i.length&&(i=i.split('"')[0],h[r]=i)}}}(e);var a=(new DOMParser).parseFromString(e,"text/html"),n=a.head,r=a.body,s=function f(e){var t={},a=e.getElementsByTagName("style");if(a.length){var n=a[0],r=n.innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(r)for(var i=0;i<r.length;i++){var s=r[i],o=s.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),l=s.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");o=o.replace(/^[\s]|[\s]$/gm,""),l=l.replace(/^[\s]|[\s]$/gm,""),o=o.replace(/\n|\r|\n\r/g,""),l=l.replace(/\n|\r|\n\r/g,"");for(var c=o.split(", "),d=0;d<c.length;d++)t[c[d]]=l}}return t}(n);g(r,function(e){if(e.nodeType===Node.TEXT_NODE&&/\n|\u00a0|\r/.test(e.data)){if(!/\S| /.test(e.data)&&!/[\u00a0]+/.test(e.data))return e.data===Be.UNICODE_NBSP?(e.data="\u200b",!0):1===e.data.length&&10===e.data.charCodeAt(0)?(e.data=" ",!0):(C(e),!1);e.data=e.data.replace(/\n|\r/gi," ")}return!0}),g(r,function(e){return e.nodeType!==Node.ELEMENT_NODE||"V:IMAGEDATA"!==e.tagName&&"IMG"!==e.tagName||function c(e,t){if(!t)return;var a;if("IMG"===e.tagName){var n=e.getAttribute("src");if(!n||-1===n.indexOf("file://"))return;if(0===n.indexOf("file://")&&T.helpers.isURL(e.getAttribute("alt")))return void e.setAttribute("src",e.getAttribute("alt"));(a=h[e.getAttribute("v:shapes")])||(a=e.getAttribute("v:shapes"),e.parentNode&&e.parentNode.parentNode&&0<=e.parentNode.parentNode.innerHTML.indexOf("msEquation")&&(a=null))}else a=e.parentNode.getAttribute("o:spid");if(e.removeAttribute("height"),!a)return;!function o(e){m={},v(e,"i","\\shppict"),v(e,"s","\\shp{")}(t);var r=m[a.substring(7)];if(r){var i=function l(e){for(var t=e.match(/[0-9a-f]{2}/gi),a=[],n=0;n<t.length;n++)a.push(String.fromCharCode(parseInt(t[n],16)));var r=a.join("");return btoa(r)}(r.image_hex),s="data:"+r.image_type+";base64,"+i;"IMG"===e.tagName?(e.src=s,e.setAttribute("data-fr-image-pasted",!0)):u(e.parentNode).before('<img data-fr-image-pasted="true" src="'+s+'" style="'+e.parentNode.getAttribute("style")+'">').remove()}}(e,t),!0});for(var i=r.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),o=i.length-1;0<=o;o--)i[o].previousElementSibling&&"LI"===i[o].previousElementSibling.tagName&&i[o].previousElementSibling.appendChild(i[o]);g(r,function(e){if(e.nodeType===Node.TEXT_NODE)return e.data=e.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(e.nodeType===Node.ELEMENT_NODE){if(R(e)){var t=e.parentNode,a=e.previousSibling,n=function b(e,t,a){var n=/[0-9a-zA-Z]./gi;var r=!1;var i;var s;var o;var l=e.querySelector('span[style="mso-list:Ignore"]');var c;var d;var f;var p;l&&(r=r||n.test(l.textContent));if(1==r){var u=l.textContent.trim().split(".")[0];"a"==u?p="lower-alpha;":"A"==u?p="upper-alpha;":"1"==u?p="decimal;":"i"==u?p="lower-roman;":"I"==u?p="upper-roman;":"o"==u&&(p="circle;"),p="list-style-type: "+p,f="ol"}else f="ul";var h=p?"<"+f+' style = "'+p+'">':"<"+f+">";for(;e;){if(!R(e)){if(e.outerHTML&&0<e.outerHTML.indexOf("mso-bookmark")&&0==(e.textContent||"").length){e=e.nextElementSibling;continue}break}var g=e.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1");if((a=a||g)<g)d=b(e,t,g),h+=d.el.outerHTML,e=d.currentNode;else{if(g<a)break;e.firstElementChild&&e.firstElementChild.firstElementChild&&e.firstElementChild.firstElementChild.firstChild&&(n.lastIndex=0,i=n.test(e.firstElementChild.firstElementChild.firstChild.data||e.firstElementChild.firstElementChild.firstChild.firstChild&&e.firstElementChild.firstElementChild.firstChild.firstChild.data||"")),o&&o.firstElementChild&&o.firstElementChild.firstElementChild&&o.firstElementChild.firstElementChild.firstChild&&(n.lastIndex=0,s=n.test(o.firstElementChild.firstElementChild.firstChild.data||o.firstElementChild.firstElementChild.firstChild.firstChild&&o.firstElementChild.firstElementChild.firstChild.firstChild.data||"")),s===undefined||s===i?(c=A(e,t),h+="<li>"+c+"</li>"):(d=b(e,t,g),h+=d.el.outerHTML,e=d.currentNode);var m=e&&e.nextElementSibling;m&&(o=m.previousElementSibling),e&&e.parentNode&&e.parentNode.removeChild(e),e=m}}h+="</"+f+">";var v=document.createElement("div");v.innerHTML=h;var E=v.firstElementChild;return{el:E,currentNode:e}}(e,s).el,r=null;return(r=a?a.nextSibling:t.firstChild)?t.insertBefore(n,r):t.appendChild(n),!1}return"FONT"===e.tagName&&s["."+e.getAttribute("class")]&&(e=S(e,"span")),E(e,s)}if(e.nodeType!==Node.COMMENT_NODE)return!0;if(-1<e.data.indexOf("[if !supportLineBreakNewLine]"))for(var i=e.nextSibling;i;)(i=e.nextSibling)&&C(i),i.data&&-1<i.data.indexOf("[endif]")&&(i=null);return C(e),!1}),g(r,function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e.tagName;if(!e.innerHTML&&-1===["BR","IMG"].indexOf(t)){for(var a=e.parentNode;a&&(C(e),!(e=a).innerHTML);)a=e.parentNode;return!1}!function f(e){var t=e.getAttribute("style");if(!t)return;(t=_(t))&&";"!==t.slice(-1)&&(t+=";");var a=t.match(/(^|\S+?):.+?;{1,1}/gi);if(!a)return;for(var n={},r=0;r<a.length;r++){var i=a[r],s=i.split(":");2===s.length&&("text-align"===s[0]&&"SPAN"===e.tagName||(n[s[0]]=s[1]))}var o="";for(var l in n)if(n.hasOwnProperty(l)){if("font-size"===l&&"pt;"===n[l].slice(-3)){var c=null;try{c=parseFloat(n[l].slice(0,-3),10)}catch(d){c=null}c&&(c=Math.round(1.33*c),n[l]=c+"px;")}o+=l+":"+n[l]}o&&e.setAttribute("style",o)}(e)}return!0}),g(r,function(e){if(e&&"A"===e.nodeName&&""===e.href){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}return!0});var l=r.outerHTML,c=T.opts.htmlAllowedStyleProps;return T.opts.htmlAllowedStyleProps=T.opts.wordAllowedStyleProps,l=T.clean.html(l,T.opts.wordDeniedTags,T.opts.wordDeniedAttrs,!1),T.opts.htmlAllowedStyleProps=c,l}(r=r.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var a="",n=0;n++<t.length;)a+="&nbsp;";return a}),T.paste.getRtfClipboard());var a=T.doc.createElement("DIV");a.innerHTML=r,T.html.cleanBlankSpaces(a),r=a.innerHTML,r=(r=T.paste.cleanEmptyTagsAndDivs(r)).replace(/\u200b/g,""),function n(){T.modals.hide(o)}(),T.paste.clean(r,!0,!0),T.opts.wordAllowedStyleProps=t}function C(e){e.parentNode&&e.parentNode.removeChild(e)}function g(e,t){if(t(e))for(var a=e.firstChild;a;){var n=a,r=a.previousSibling;a=a.nextSibling,g(n,t),n.previousSibling||n.nextSibling||n.parentNode||!a||r===a.previousSibling||!a.parentNode?n.previousSibling||n.nextSibling||n.parentNode||!a||a.previousSibling||a.nextSibling||a.parentNode||(r?a=r.nextSibling?r.nextSibling.nextSibling:null:e.firstChild&&(a=e.firstChild.nextSibling)):a=r?r.nextSibling:e.firstChild}}function R(e){if(!e.getAttribute("style")||!/mso-list:[\s]*l/gi.test(e.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!e.querySelector('[style="mso-list:Ignore"]'))return!!(e.outerHTML&&0<=e.outerHTML.indexOf("\x3c!--[if !supportLists]--\x3e"))}catch(t){return!1}return!0}function A(e,n){var t=e.cloneNode(!0);if(-1!==["H1","H2","H3","H4","H5","H6"].indexOf(e.tagName)){var a=document.createElement(e.tagName.toLowerCase());a.setAttribute("style",e.getAttribute("style")),a.innerHTML=t.innerHTML,t.innerHTML=a.outerHTML}g(t,function(e){if(e.nodeType==Node.COMMENT_NODE&&(T.browser.msie||T.browser.safari||T.browser.edge))try{if("[if !supportLists]"===e.data){for(e=e.nextSibling;e&&e.nodeType!==Node.COMMENT_NODE;){var t=e.nextSibling;e.parentNode.removeChild(e),e=t}e&&e.nodeType==Node.COMMENT_NODE&&e.parentNode.removeChild(e)}}catch(a){}return e.nodeType===Node.ELEMENT_NODE&&("mso-list:Ignore"===e.getAttribute("style")&&e.parentNode.removeChild(e),e.setAttribute("style",function r(e){var a="",n=e.getAttribute("style");n&&["line-height","font-family","font-size","color","background"].forEach(function(e){var t=n.match(new RegExp(e+":.*;"));t&&(a+=t[0]+";")});return a}(e)),E(e,n)),!0});var r=t.innerHTML;return r=r.replace(/<!--[\s\S]*?-->/gi,"")}function S(e,t){for(var a=document.createElement(t),n=0;n<e.attributes.length;n++){var r=e.attributes[n].name;a.setAttribute(r,e.getAttribute(r))}return a.innerHTML=e.innerHTML,e.parentNode.replaceChild(a,e),a}function L(e){var t=e.getAttribute("align");t&&(e.style["text-align"]=t,e.removeAttribute("align"))}function _(e){return e.replace(/\n|\r|\n\r|&quot;/g,"")}function w(e,t,a){if(t){var n=e.getAttribute("style");n&&";"!==n.slice(-1)&&(n+=";"),t&&";"!==t.slice(-1)&&(t+=";"),t=t.replace(/\n/gi,"");var r=null;r=a?(n||"")+t:t+(n||""),e.setAttribute("style",r)}}var m=null;function v(e,t,a){for(var n=e.split(a),r=1;r<n.length;r++){var i=n[r];if(1<(i=i.split("shplid")).length){i=i[1];for(var s="",o=0;o<i.length&&"\\"!==i[o]&&"{"!==i[o]&&" "!==i[o]&&"\r"!==i[o]&&"\n"!==i[o];)s+=i[o],o++;var l=i.split("bliptag");if(l&&l.length<2)continue;var c=null;if(-1!==l[0].indexOf("pngblip")?c="image/png":-1!==l[0].indexOf("jpegblip")&&(c="image/jpeg"),!c)continue;var d=l[1].split("}");if(d&&d.length<2)continue;var f=void 0;if(2<d.length&&-1!==d[0].indexOf("blipuid"))f=d[1].split(" ");else{if((f=d[0].split(" "))&&f.length<2)continue;f.shift()}var p=f.join("");m[t+s]={image_hex:p,image_type:c}}}}function E(e,t){var a=e.tagName,n=a.toLowerCase();e.firstElementChild&&("I"===e.firstElementChild.tagName?S(e.firstElementChild,"em"):"B"===e.firstElementChild.tagName&&S(e.firstElementChild,"strong"));if(-1!==["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(a))return C(e),!1;for(var r=["META","LINK","XML","ST1:","O:","W:","FONT"],i=0;i<r.length;i++)if(-1!==a.indexOf(r[i]))return e.innerHTML&&(e.outerHTML=e.innerHTML),C(e),!1;if("TD"!==a){var s=e.getAttribute("class")||"MsoNormal";if(t&&s){for(var o=(s=_(s)).split(" "),l=0;l<o.length;l++){var c=[],d="."+o[l];c.push(d),d=n+d,c.push(d);for(var f=0;f<c.length;f++)t[c[f]]&&w(e,t[c[f]])}e.removeAttribute("class")}t&&t[n]&&w(e,t[n])}if(-1!==["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(a)){var p=e.getAttribute("class");if(p&&(t&&t[a.toLowerCase()+"."+p]&&w(e,t[a.toLowerCase()+"."+p]),-1!==p.toLowerCase().indexOf("mso"))){var u=_(p);(u=u.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?e.setAttribute("class",u):e.removeAttribute("class")}var h=e.getAttribute("style");if(h){var g=h.match(/text-align:.+?[; "]{1,1}/gi);g&&g[g.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}L(e)}if("TR"===a&&function A(e,t){T.node.clearAttributes(e);for(var a=e.firstElementChild,n=0,r=!1,i=null;a;){a.firstElementChild&&-1!==a.firstElementChild.tagName.indexOf("W:")&&(a.innerHTML=a.firstElementChild.innerHTML),(i=a.getAttribute("width"))||r||(r=!0),n+=parseInt(i,10),(!a.firstChild||a.firstChild&&a.firstChild.data===Be.UNICODE_NBSP)&&(a.firstChild&&C(a.firstChild),a.innerHTML="<br>");for(var s=a.firstElementChild,o=1===a.children.length;s;)"P"!==s.tagName||R(s)||o&&L(s),s=s.nextElementSibling;if(t){var l=a.getAttribute("class");if(l){var c=(l=_(l)).match(/xl[0-9]+/gi);if(c){var d="."+c[0];t[d]&&w(a,t[d])}}t.td&&w(a,t.td)}var f=a.getAttribute("style");f&&(f=_(f))&&";"!==f.slice(-1)&&(f+=";");var p=a.getAttribute("valign");if(!p&&f){var u=f.match(/vertical-align:.+?[; "]{1,1}/gi);u&&(p=u[u.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var h=null;if(f){var g=f.match(/text-align:.+?[; "]{1,1}/gi);g&&(h=g[g.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===h&&(h=null)}var m=null;if(f){var v=f.match(/background:.+?[; "]{1,1}/gi);v&&(m=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var E=a.getAttribute("colspan"),b=a.getAttribute("rowspan");E&&a.setAttribute("colspan",E),b&&a.setAttribute("rowspan",b),p&&(a.style["vertical-align"]=p),h&&(a.style["text-align"]=h),m&&(a.style["background-color"]=m),i&&a.setAttribute("width",i),a=a.nextElementSibling}for(a=e.firstElementChild;a;)i=a.getAttribute("width"),r?a.removeAttribute("width"):a.setAttribute("width",100*parseInt(i,10)/n+"%"),a=a.nextElementSibling}(e,t),"A"!==a||e.attributes.getNamedItem("href")||e.attributes.getNamedItem("name")||!e.innerHTML||(e.outerHTML=e.innerHTML),"A"==a&&e.getAttribute("href")&&e.querySelector("img"))for(var m=e.querySelectorAll("span"),v=0;v<m.length;v++)m[v].innerText||(m[v].outerHTML=m[v].innerHTML);if("TD"!==a&&"TH"!==a||e.innerHTML||(e.innerHTML="<br>"),"TABLE"===a&&(e.style.width=e.style.width),e.getAttribute("lang")&&e.removeAttribute("lang"),e.getAttribute("style")&&-1!==e.getAttribute("style").toLowerCase().indexOf("mso")){var E=_(e.getAttribute("style"));(E=E.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",E):e.removeAttribute("style")}return!0}return{_init:function e(){T.events.on("paste.wordPaste",function(e){return r=e,T.opts.wordPasteModal?function i(){if(!s){var e='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+T.language.translate("Word Paste Detected")+"</h4>",t=function r(){var e='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">';return e+='<p style="text-align: left;">'+T.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",e+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+T.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+T.language.translate("Keep")+"</button></div>",e+="</div>"}(),a=T.modals.create(o,e,t),n=a.$body;s=a.$modal,a.$modal.addClass("fr-middle"),T.events.bindClick(n,"button.fr-remove-word",function(){var e=s.data("instance")||T;e.wordPaste.clean()}),T.events.bindClick(n,"button.fr-keep-word",function(){var e=s.data("instance")||T;e.wordPaste.clean(!0)}),T.events.$on(u(T.o_win),"resize",function(){T.modals.resize(o)})}T.modals.show(o),T.modals.resize(o)}():t(T.opts.wordPasteKeepFormatting),!1})},clean:t}}});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 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.codeBeautifier=function(){var e,t,n,i,Q={};function y(i,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},n={"@media":!0,"@supports":!0,"@document":!0};e=e||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,s=e.indent_char||" ",_=e.selector_separator_newline===undefined||e.selector_separator_newline,a=e.end_with_newline!==undefined&&e.end_with_newline,o=e.newline_between_rules===undefined||e.newline_between_rules,l=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(s="\t",r=1),l=l.replace(/\\r/,"\r").replace(/\\n/,"\n");var h,c=/^\s+$/,u=-1,p=0;function d(){return(h=i.charAt(++u))||""}function f(e){var t,n=u;return e&&E(),t=i.charAt(u+1)||"",u=n-1,d(),t}function T(e){for(var t=u;d();)if("\\"===h)d();else{if(-1!==e.indexOf(h))break;if("\n"===h)break}return i.substring(t,u+1)}function E(){for(var e="";c.test(f());)d(),e+=h;return e}function g(){var e="";for(h&&c.test(h)&&(e=h);c.test(d());)e+=h;return e}function x(e){var t=u;for(e="/"===f(),d();d();){if(!e&&"*"===h&&"/"===f()){d();break}if(e&&"\n"===h)return i.substring(t,u)}return i.substring(t,u)+h}function w(e){return i.substring(u-e.length,u).toLowerCase()===e}function K(){for(var e=0,t=u+1;t<i.length;t++){var n=i.charAt(t);if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(" "===n||"}"===n)return!1}return!1}var R=i.match(/^[\t ]*/)[0],m=new Array(r+1).join(s),b=0,v=0;for(var S,A,k={"{":function(e){k.singleSpace(),y.push(e),k.newLine()},"}":function(e){k.newLine(),y.push(e),k.newLine()},_lastCharWhitespace:function(){return c.test(y[y.length-1])},newLine:function(e){y.length&&(e||"\n"===y[y.length-1]||k.trim(),y.push("\n"),R&&y.push(R))},singleSpace:function(){y.length&&!k._lastCharWhitespace()&&y.push(" ")},preserveSingleSpace:function(){isAfterSpace&&k.singleSpace()},trim:function(){for(;k._lastCharWhitespace();)y.pop()}},y=[],O=!1,N=!1,D=!1,C="",L="";;){var I=-1!==g().indexOf("\n");if(L=C,!(C=h))break;if("/"===h&&"*"===f()){var V=0===b;(I||V)&&k.newLine(),y.push(x()),k.newLine(),V&&k.newLine(!0)}else if("/"===h&&"/"===f())I||"{"===L||k.trim(),k.singleSpace(),y.push(x()),k.newLine();else if("@"===h){k.preserveSingleSpace(),y.push(h);var P=(void 0,S=u,A=T(": , {}()[]/='\""),u=S-1,d(),A);P.match(/[ :]$/)&&(d(),P=T(": ").replace(/\s$/,""),y.push(P),k.singleSpace()),(P=P.replace(/\s$/,""))in t&&(v+=1,P in n&&(D=!0))}else"#"===h&&"{"===f()?(k.preserveSingleSpace(),y.push(T("}"))):"{"===h?"}"===f(!0)?(E(),d(),k.singleSpace(),y.push("{}"),k.newLine(),o&&0===b&&k.newLine(!0)):(b++,R+=m,k["{"](h),O=D?(D=!1,v<b):v<=b):"}"===h?(b--,R=R.slice(0,-r),k["}"](h),N=O=!1,v&&v--,o&&0===b&&k.newLine(!0)):":"===h?(E(),!O&&!D||w("&")||K()?":"===f()?(d(),y.push("::")):y.push(":"):(N=!0,y.push(":"),k.singleSpace())):'"'===h||"'"===h?(k.preserveSingleSpace(),y.push(T(h))):" "===h?(N=!1,y.push(h),k.newLine()):"("===h?w("url")?(y.push(h),E(),d()&&(")"!==h&&'"'!==h&&"'"!==h?y.push(T(")")):u--)):(p++,k.preserveSingleSpace(),y.push(h),E()):")"===h?(y.push(h),p--):","===h?(y.push(h),E(),_&&!N&&p<1?k.newLine():k.singleSpace()):("]"===h||("["===h?k.preserveSingleSpace():"="===h?(E(),h="="):k.preserveSingleSpace()),y.push(h))}var B="";return R&&(B+=R),B+=y.join("").replace(/[\r\n\t ]+$/,""),a&&(B+="\n"),"\n"!=l&&(B=B.replace(/[\n]/g,l)),B}function Y(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function H(e){return e.replace(/^\s+|\s+$/g,"")}function O(e,t){return new r(e,t).beautify()}e=Q,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("["+t+"]"),i=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e))))};var Z={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(i,e){var l,r,s,h,_,a,o,c,u,t,n,p,d,f=[],T="";function E(e,t){var n=0;return e&&(n=e.indentation_level,!l.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:l.get_line_number(),ternary_depth:0}}for(p={TK_START_EXPR:function L(){O();var e=Z.Expression;if("["===h.text){if("TK_WORD"===_||")"===c.last_text)return"TK_RESERVED"===_&&Y(c.last_text,s.line_starters)&&(l.space_before_token=!0),v(e),m(),b(),void(d.space_in_paren&&(l.space_before_token=!0));e=Z.ArrayLiteral,S(c.mode)&&("["!==c.last_text&&(","!==c.last_text||"]"!==a&&"}"!==a)||d.keep_array_indentation||K())}else"TK_RESERVED"===_&&"for"===c.last_text?e=Z.ForInitializer:"TK_RESERVED"===_&&Y(c.last_text,["if","while"])&&(e=Z.Conditional);" "===c.last_text||"TK_START_BLOCK"===_?K():"TK_END_EXPR"===_||"TK_START_EXPR"===_||"TK_END_BLOCK"===_||"."===c.last_text?w(h.wanted_newline):"TK_RESERVED"===_&&"("===h.text||"TK_WORD"===_||"TK_OPERATOR"===_?"TK_RESERVED"===_&&("function"===c.last_word||"typeof"===c.last_word)||"*"===c.last_text&&"function"===a?d.space_after_anon_function&&(l.space_before_token=!0):"TK_RESERVED"!==_||!Y(c.last_text,s.line_starters)&&"catch"!==c.last_text||d.space_before_conditional&&(l.space_before_token=!0):l.space_before_token=!0;"("===h.text&&"TK_RESERVED"===_&&"await"===c.last_word&&(l.space_before_token=!0);"("===h.text&&("TK_EQUALS"!==_&&"TK_OPERATOR"!==_||y()||w());v(e),m(),d.space_in_paren&&(l.space_before_token=!0);b()},TK_END_EXPR:function I(){for(;c.mode===Z.Statement;)k();c.multiline_frame&&w("]"===h.text&&S(c.mode)&&!d.keep_array_indentation);d.space_in_paren&&("TK_START_EXPR"!==_||d.space_in_empty_paren?l.space_before_token=!0:(l.trim(),l.space_before_token=!1));"]"===h.text&&d.keep_array_indentation?(m(),k()):(k(),m());l.remove_redundant_indentation(u),c.do_while&&u.mode===Z.Conditional&&(u.mode=Z.Expression,c.do_block=!1,c.do_while=!1)},TK_START_BLOCK:function V(){var e=D(1),t=D(2);t&&(":"===t.text&&Y(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||Y(e.text,["get","set"])&&Y(t.type,["TK_WORD","TK_RESERVED"]))?Y(a,["class","interface"])?v(Z.BlockStatement):v(Z.ObjectLiteral):v(Z.BlockStatement);var n=!e.comments_before.length&&"}"===e.text&&"function"===c.last_word&&"TK_END_EXPR"===_;"expand"===d.brace_style||"none"===d.brace_style&&h.wanted_newline?"TK_OPERATOR"!==_&&(n||"TK_EQUALS"===_||"TK_RESERVED"===_&&N(c.last_text)&&"else"!==c.last_text)?l.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==_&&"TK_START_EXPR"!==_?"TK_START_BLOCK"===_?K():l.space_before_token=!0:S(u.mode)&&","===c.last_text&&("}"===a?l.space_before_token=!0:K());m(),b()},TK_END_BLOCK:function P(){for(;c.mode===Z.Statement;)k();var e="TK_START_BLOCK"===_;"expand"===d.brace_style?e||K():e||(S(c.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K());k(),m()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function B(){O()&&(l.space_before_token=!1);for(;c.mode===Z.Statement&&!c.if_block&&!c.do_block;)k();m()},TK_STRING:function j(){O()?l.space_before_token=!0:"TK_RESERVED"===_||"TK_WORD"===_?l.space_before_token=!0:"TK_COMMA"===_||"TK_START_EXPR"===_||"TK_EQUALS"===_||"TK_OPERATOR"===_?y()||w():K();m()},TK_EQUALS:function M(){O();c.declaration_statement&&(c.declaration_assignment=!0);l.space_before_token=!0,m(),l.space_before_token=!0},TK_OPERATOR:function U(){O();if("TK_RESERVED"===_&&N(c.last_text))return l.space_before_token=!0,void m();if("*"===h.text&&"TK_DOT"===_)return void m();if(":"===h.text&&c.in_case)return c.case_body=!0,b(),m(),K(),void(c.in_case=!1);if("::"===h.text)return void m();"TK_OPERATOR"===_&&w();var e=!0,t=!0;Y(h.text,["--","++","!","~"])||Y(h.text,["-","+"])&&(Y(_,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||Y(c.last_text,s.line_starters)||","===c.last_text)?(t=e=!1,!h.wanted_newline||"--"!==h.text&&"++"!==h.text||K(!1,!0)," "===c.last_text&&A(c.mode)&&(e=!0),"TK_RESERVED"===_?e=!0:"TK_END_EXPR"===_?e=!("]"===c.last_text&&("--"===h.text||"++"===h.text)):"TK_OPERATOR"===_&&(e=Y(h.text,["--","-","++","+"])&&Y(c.last_text,["--","-","++","+"]),Y(h.text,["+","-"])&&Y(c.last_text,["--","++"])&&(t=!0)),c.mode!==Z.BlockStatement&&c.mode!==Z.Statement||"{"!==c.last_text&&" "!==c.last_text||K()):":"===h.text?0===c.ternary_depth?e=!1:c.ternary_depth-=1:"?"===h.text?c.ternary_depth+=1:"*"===h.text&&"TK_RESERVED"===_&&"function"===c.last_text&&(t=e=!1);l.space_before_token=l.space_before_token||e,m(),l.space_before_token=t},TK_COMMA:function W(){if(c.declaration_statement)return A(c.parent.mode)&&(c.declaration_assignment=!1),m(),void(c.declaration_assignment?K(c.declaration_assignment=!1,!0):(l.space_before_token=!0,d.comma_first&&w()));m(),c.mode===Z.ObjectLiteral||c.mode===Z.Statement&&c.parent.mode===Z.ObjectLiteral?(c.mode===Z.Statement&&k(),K()):(l.space_before_token=!0,d.comma_first&&w())},TK_BLOCK_COMMENT:function z(){if(l.raw)return l.add_raw_token(h),void(h.directives&&"end"===h.directives.preserve&&(d.test_output_raw||(l.raw=!1)));if(h.directives)return K(!1,!0),m(),"start"===h.directives.preserve&&(l.raw=!0),void K(!1,!0);if(!Q.newline.test(h.text)&&!h.wanted_newline)return l.space_before_token=!0,m(),void(l.space_before_token=!0);var e,t=function _(e){var t;e=e.replace(/\x0d/g,"");var n=[];t=e.indexOf("\n");for(;-1!==t;)n.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&n.push(e);return n}(h.text),n=!1,i=!1,r=h.whitespace_before,s=r.length;K(!1,!0),1<t.length&&(!function a(e,t){for(var n=0;n<e.length;n++){var i=H(e[n]);if(i.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function o(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(t.slice(1),r)&&(i=!0):n=!0);for(m(t[0]),e=1;e<t.length;e++)K(!1,!0),n?m(" "+t[e].replace(/^\s+/g,"")):i&&t[e].length>s?m(t[e].substring(s)):l.add_token(t[e]);K(!1,!0)},TK_COMMENT:function G(){h.wanted_newline?K(!1,!0):l.trim(!0);l.space_before_token=!0,m(),K(!1,!0)},TK_DOT:function X(){O();"TK_RESERVED"===_&&N(c.last_text)?l.space_before_token=!0:w(")"===c.last_text&&d.break_chained_methods);m()},TK_UNKNOWN:function F(){m(),"\n"===h.text[h.text.length-1]&&K()},TK_EOF:function $(){for(;c.mode===Z.Statement;)k()}},d={},(e=e||{}).braces_on_own_line!==undefined&&(d.brace_style=e.braces_on_own_line?"expand":"collapse"),d.brace_style=e.brace_style?e.brace_style:d.brace_style?d.brace_style:"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand"),d.indent_size=e.indent_size?parseInt(e.indent_size,10):4,d.indent_char=e.indent_char?e.indent_char:" ",d.eol=e.eol?e.eol:"\n",d.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,d.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,d.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),d.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,d.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,d.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,d.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,d.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,d.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,d.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,d.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),d.e4x=e.e4x!==undefined&&e.e4x,d.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,d.comma_first=e.comma_first!==undefined&&e.comma_first,d.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0),e.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1),d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),o="";0<d.indent_size;)o+=d.indent_char,d.indent_size-=1;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function x(e){var t=e.newlines;if(d.keep_array_indentation&&S(c.mode))for(var n=0;n<t;n+=1)K(0<n);else if(d.max_preserve_newlines&&t>d.max_preserve_newlines&&(t=d.max_preserve_newlines),d.preserve_newlines&&1<e.newlines){K();for(var i=1;i<t;i+=1)K(!0)}p[(h=e).type]()}function w(e){if(e=e!==undefined&&e,!l.just_added_newline())if(d.preserve_newlines&&h.wanted_newline||e)K(!1,!0);else if(d.wrap_line_length){l.current_line.get_character_count()+h.text.length+(l.space_before_token?1:0)>=d.wrap_line_length&&K(!1,!0)}}function K(e,t){if(!t&&" "!==c.last_text&&","!==c.last_text&&"="!==c.last_text&&"TK_OPERATOR"!==_)for(;c.mode===Z.Statement&&!c.if_block&&!c.do_block;)k();l.add_new_line(e)&&(c.multiline_frame=!0)}function R(){l.just_added_newline()&&(d.keep_array_indentation&&S(c.mode)&&h.wanted_newline?(l.current_line.push(h.whitespace_before),l.space_before_token=!1):l.set_indent(c.indentation_level)&&(c.line_indent_level=c.indentation_level))}function m(e){l.raw?l.add_raw_token(h):(d.comma_first&&"TK_COMMA"===_&&l.just_added_newline()&&","===l.previous_line.last()&&(l.previous_line.pop(),R(),l.add_token(","),l.space_before_token=!0),e=e||h.text,R(),l.add_token(e))}function b(){c.indentation_level+=1}function v(e){u=c?(t.push(c),c):E(null,e),c=E(u,e)}function S(e){return e===Z.ArrayLiteral}function A(e){return Y(e,[Z.Expression,Z.ForInitializer,Z.Conditional])}function k(){0<t.length&&(u=c,c=t.pop(),u.mode===Z.Statement&&l.remove_redundant_indentation(u))}function y(){return c.parent.mode===Z.ObjectLiteral&&c.mode===Z.Statement&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===_&&Y(c.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===_&&Y(c.last_text,["const","let","const"])&&"TK_WORD"===h.type||"TK_RESERVED"===_&&"do"===c.last_text||"TK_RESERVED"===_&&"return"===c.last_text&&!h.wanted_newline||"TK_RESERVED"===_&&"else"===c.last_text&&("TK_RESERVED"!==h.type||"if"!==h.text)||"TK_END_EXPR"===_&&(u.mode===Z.ForInitializer||u.mode===Z.Conditional)||"TK_WORD"===_&&c.mode===Z.BlockStatement&&!c.in_case&&"--"!==h.text&&"++"!==h.text&&"function"!==a&&"TK_WORD"!==h.type&&"TK_RESERVED"!==h.type||c.mode===Z.ObjectLiteral&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===_&&Y(c.last_text,["get","set"])))&&(v(Z.Statement),b(),"TK_RESERVED"===_&&Y(c.last_text,["const","let","const"])&&"TK_WORD"===h.type&&(c.declaration_statement=!0),y()||w("TK_RESERVED"===h.type&&Y(h.text,["do","for","if","while"])),!0)}function N(e){return Y(e,["case","return","do","if","throw","else"])}function D(e){var t=r+(e||0);return t<0||t>=f.length?null:f[t]}function C(){("TK_RESERVED"===h.type&&c.mode!==Z.ObjectLiteral&&Y(h.text,["set","get"])&&(h.type="TK_WORD"),"TK_RESERVED"===h.type&&c.mode===Z.ObjectLiteral)&&(":"===D(1).text&&(h.type="TK_WORD"));if(O()||!h.wanted_newline||A(c.mode)||"TK_OPERATOR"===_&&"--"!==c.last_text&&"++"!==c.last_text||"TK_EQUALS"===_||!d.preserve_newlines&&"TK_RESERVED"===_&&Y(c.last_text,["const","let","const","set","get"])||K(),c.do_block&&!c.do_while){if("TK_RESERVED"===h.type&&"while"===h.text)return l.space_before_token=!0,m(),l.space_before_token=!0,void(c.do_while=!0);K(),c.do_block=!1}if(c.if_block)if(c.else_block||"TK_RESERVED"!==h.type||"else"!==h.text){for(;c.mode===Z.Statement;)k();c.if_block=!1,c.else_block=!1}else c.else_block=!0;if("TK_RESERVED"===h.type&&("case"===h.text||"default"===h.text&&c.in_case_statement))return K(),(c.case_body||d.jslint_happy)&&(!function e(){0<c.indentation_level&&(!c.parent||c.indentation_level>c.parent.indentation_level)&&(c.indentation_level-=1)}(),c.case_body=!1),m(),c.in_case=!0,void(c.in_case_statement=!0);if("TK_RESERVED"===h.type&&"function"===h.text&&((Y(c.last_text,["}"," "])||l.just_added_newline()&&!Y(c.last_text,["[","{",":","=",","]))&&(l.just_added_blankline()||h.comments_before.length||(K(),K(!0))),"TK_RESERVED"===_||"TK_WORD"===_?"TK_RESERVED"===_&&Y(c.last_text,["get","set","new","return","export","async"])?l.space_before_token=!0:"TK_RESERVED"===_&&"default"===c.last_text&&"export"===a?l.space_before_token=!0:K():"TK_OPERATOR"===_||"="===c.last_text?l.space_before_token=!0:(c.multiline_frame||!A(c.mode)&&!S(c.mode))&&K()),"TK_COMMA"!==_&&"TK_START_EXPR"!==_&&"TK_EQUALS"!==_&&"TK_OPERATOR"!==_||y()||w(),"TK_RESERVED"===h.type&&Y(h.text,["function","get","set"]))return m(),void(c.last_word=h.text);(n="NONE","TK_END_BLOCK"===_?"TK_RESERVED"===h.type&&Y(h.text,["else","catch","finally"])?"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&h.wanted_newline?n="NEWLINE":(n="SPACE",l.space_before_token=!0):n="NEWLINE":"TK_SEMICOLON"===_&&c.mode===Z.BlockStatement?n="NEWLINE":"TK_SEMICOLON"===_&&A(c.mode)?n="SPACE":"TK_STRING"===_?n="NEWLINE":"TK_RESERVED"===_||"TK_WORD"===_||"*"===c.last_text&&"function"===a?n="SPACE":"TK_START_BLOCK"===_?n="NEWLINE":"TK_END_EXPR"===_&&(l.space_before_token=!0,n="NEWLINE"),"TK_RESERVED"===h.type&&Y(h.text,s.line_starters)&&")"!==c.last_text&&(n="else"===c.last_text||"export"===c.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===h.type&&Y(h.text,["else","catch","finally"]))?"TK_END_BLOCK"!==_||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&h.wanted_newline?K():(l.trim(!0),"}"!==l.current_line.last()&&K(),l.space_before_token=!0):"NEWLINE"===n?"TK_RESERVED"===_&&N(c.last_text)?l.space_before_token=!0:"TK_END_EXPR"!==_?"TK_START_EXPR"===_&&"TK_RESERVED"===h.type&&Y(h.text,["const","let","const"])||":"===c.last_text||("TK_RESERVED"===h.type&&"if"===h.text&&"else"===c.last_text?l.space_before_token=!0:K()):"TK_RESERVED"===h.type&&Y(h.text,s.line_starters)&&")"!==c.last_text&&K():c.multiline_frame&&S(c.mode)&&","===c.last_text&&"}"===a?K():"SPACE"===n&&(l.space_before_token=!0);m(),c.last_word=h.text,"TK_RESERVED"===h.type&&"do"===h.text&&(c.do_block=!0),"TK_RESERVED"===h.type&&"if"===h.text&&(c.if_block=!0)}_="TK_START_BLOCK",a="",(l=new q(o,T)).raw=d.test_output_raw,t=[],v(Z.BlockStatement),this.beautify=function(){var e,t;for(s=new ee(i,d,o),f=s.tokenize(),r=0;e=D();){for(var n=0;n<e.comments_before.length;n++)x(e.comments_before[n]);x(e),a=c.last_text,_=e.type,c.last_text=e.text,r+=1}return t=l.get_code(),d.end_with_newline&&(t+="\n"),"\n"!=d.eol&&(t=t.replace(/[\n]/g,d.eol)),t}}function s(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0<i&&(i-=1,n-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),n-=1;s=0===r.length},this.toString=function(){var e="";return this._empty||(0<=i&&(e=t.indent_cache[i]),e+=r.join("")),e}}function q(t,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=t.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return i.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<i.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==Z.ForInitializer&&e.mode!==Z.Conditional)for(var t=e.start_line_index,n=i.length;t<n;)i[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,n);e&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===i.length||i[i.length-2].is_empty())}}var J=function J(e,t,n,i,r,s){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};function ee(k,y,e){var O="\n\r\t ".split(""),N=/[0-9]/,D=/[01234567]/,C=/[0123456789abcdefABCDEF]/,L="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var I,V,P,B,j,M,U=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),W=/([\s\S]*?)((?:\*\/)|$)/g,z=/([^\n\r\u2028\u2029]*)/g,G=/\/\* beautify( \w+[:]\w+)+ \*\//g,X=/ (\w+)[:](\w+)/g,F=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,$=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function _(){var e,t,n=[];if(I=0,V="",M<=j)return["","TK_EOF"];t=B.length?B[B.length-1]:new J("TK_START_BLOCK","{");var i=k.charAt(j);for(j+=1;Y(i,O);){if(Q.newline.test(i)?"\n"===i&&"\r"===k.charAt(j-2)||(I+=1,n=[]):n.push(i),M<=j)return["","TK_EOF"];i=k.charAt(j),j+=1}if(n.length&&(V=n.join("")),N.test(i)){var r=!0,s=!0,_=N;for("0"===i&&j<M&&/[Xxo]/.test(k.charAt(j))?(s=r=!1,i+=k.charAt(j),j+=1,_=/[o]/.test(k.charAt(j))?D:C):(i="",j-=1);j<M&&_.test(k.charAt(j));)i+=k.charAt(j),j+=1,r&&j<M&&"."===k.charAt(j)&&(i+=k.charAt(j),j+=1,r=!1),s&&j<M&&/[Ee]/.test(k.charAt(j))&&(i+=k.charAt(j),(j+=1)<M&&/[+-]/.test(k.charAt(j))&&(i+=k.charAt(j),j+=1),r=s=!1);return[i,"TK_WORD"]}if(Q.isIdentifierStart(k.charCodeAt(j-1))){if(j<M)for(;Q.isIdentifierChar(k.charCodeAt(j))&&(i+=k.charAt(j),(j+=1)!==M););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&Y(t.text,["set","get"])||!Y(i,U)?[i,"TK_WORD"]:"in"===i?[i,"TK_OPERATOR"]:[i,"TK_RESERVED"]}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(" "===i)return[i,"TK_SEMICOLON"];if("/"===i){var a="";if("*"===k.charAt(j)){j+=1,W.lastIndex=j;var o=W.exec(k);a="/*"+o[0],j+=o[0].length;var l=function S(e){if(!e.match(G))return null;var t={};X.lastIndex=0;for(var n=X.exec(e);n;)t[n[1]]=n[2],n=X.exec(e);return t}(a);return l&&"start"===l.ignore&&(F.lastIndex=j,a+=(o=F.exec(k))[0],j+=o[0].length),[a=a.replace(Q.lineBreak,"\n"),"TK_BLOCK_COMMENT",l]}if("/"===k.charAt(j)){j+=1,z.lastIndex=j;var h=z.exec(k);return a="//"+h[0],j+=h[0].length,[a,"TK_COMMENT"]}}if("`"===i||"'"===i||'"'===i||("/"===i||y.e4x&&"<"===i&&k.slice(j-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&Y(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&Y(t.parent.text,["if","while","for"])||Y(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var c=i,u=!1,p=!1;if(e=i,"/"===c)for(var d=!1;j<M&&(u||d||k.charAt(j)!==c)&&!Q.newline.test(k.charAt(j));)e+=k.charAt(j),u?u=!1:(u="\\"===k.charAt(j),"["===k.charAt(j)?d=!0:"]"===k.charAt(j)&&(d=!1)),j+=1;else if(y.e4x&&"<"===c){var f=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,T=k.slice(j-1),E=f.exec(T);if(E&&0===E.index){for(var g=E[2],x=0;E;){var w=!!E[1],K=E[2],R=!!E[E.length-1]||"![CDATA["===K.slice(0,8);if(K!==g||R||(w?--x:++x),x<=0)break;E=f.exec(T)}var m=E?E.index+E[0].length:T.length;return T=T.slice(0,m),j+=m-1,[T=T.replace(Q.lineBreak,"\n"),"TK_STRING"]}}else for(;j<M&&(u||k.charAt(j)!==c&&("`"===c||!Q.newline.test(k.charAt(j))));)(u||"`"===c)&&Q.newline.test(k.charAt(j))?("\r"===k.charAt(j)&&"\n"===k.charAt(j+1)&&(j+=1),e+="\n"):e+=k.charAt(j),u=u?("x"!==k.charAt(j)&&"u"!==k.charAt(j)||(p=!0),!1):"\\"===k.charAt(j),j+=1;if(p&&y.unescape_strings&&(e=function A(e){var t,n=!1,i="",r=0,s="",_=0;for(;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,"x"===t)s=e.substr(r,2),r+=2;else{if("u"!==t){i+="\\"+t;continue}s=e.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(_=parseInt(s,16))&&_<32){i+="x"===t?"\\x"+s:"\\u"+s;continue}if(34===_||39===_||92===_)i+="\\"+String.fromCharCode(_);else{if("x"===t&&126<_&&_<=255)return e;i+=String.fromCharCode(_)}}else"\\"===t?n=!0:i+=t;return i}(e)),j<M&&k.charAt(j)===c&&(e+=c,j+=1,"/"===c))for(;j<M&&Q.isIdentifierStart(k.charCodeAt(j));)e+=k.charAt(j),j+=1;return[e,"TK_STRING"]}if("#"===i){if(0===B.length&&"!"===k.charAt(j)){for(e=i;j<M&&"\n"!==i;)e+=i=k.charAt(j),j+=1;return[H(e)+"\n","TK_UNKNOWN"]}var b="#";if(j<M&&N.test(k.charAt(j))){for(;b+=i=k.charAt(j),(j+=1)<M&&"#"!==i&&"="!==i;);return"#"===i||("["===k.charAt(j)&&"]"===k.charAt(j+1)?(b+="[]",j+=2):"{"===k.charAt(j)&&"}"===k.charAt(j+1)&&(b+="{}",j+=2)),[b,"TK_WORD"]}}if("<"===i&&("?"===k.charAt(j)||"%"===k.charAt(j))){$.lastIndex=j-1;var v=$.exec(k);if(v)return i=v[0],j+=i.length-1,[i=i.replace(Q.lineBreak,"\n"),"TK_STRING"]}if("<"===i&&"\x3c!--"===k.substring(j-1,j+3)){for(j+=3,i="\x3c!--";!Q.newline.test(k.charAt(j))&&j<M;)i+=k.charAt(j),j++;return P=!0,[i,"TK_COMMENT"]}if("-"===i&&P&&"--\x3e"===k.substring(j-1,j+2))return P=!1,j+=2,["--\x3e","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(Y(i,L)){for(;j<M&&Y(i+k.charAt(j),L)&&(i+=k.charAt(j),!(M<=(j+=1))););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,n;M=k.length,j=0,P=!1,B=[];for(var i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=_(),e=new J(n[1],n[0],I,V);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=_(),e=new J(n[1],n[0],I,V);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,i=r.pop()),B.push(e),t=e}return B}}return{run:function N(e,t){function _(e){return e.replace(/\s+$/g,"")}var n,i,r,T,s,a,E,o,l,g,x,w,h,c;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),i=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),T=t.indent_char===undefined?" ":t.indent_char,a=t.brace_style===undefined?"collapse":t.brace_style,s=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),E=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=t.preserve_newlines===undefined||t.preserve_newlines,l=o?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,g=t.indent_handlebars!==undefined&&t.indent_handlebars,x=t.wrap_attributes===undefined?"auto":t.wrap_attributes,w=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,h=t.end_with_newline!==undefined&&t.end_with_newline,c=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(T="\t",r=1),(n=new function k(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:c,in_array:function(e,t){for(var n=0;n<t.length;n++)if(e===t[n])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)o&&"\n"===e&&this.newlines<=l&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(g){var n=this.input.substr(this.pos,3);if("{{#"===n||"{{/"===n)break;if("{{!"===n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1===this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,n,i="",r=[],s="",_=!1,a=!0,o=this.pos,l=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=o,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))_=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),_=!0),"="===i&&(_=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&_){if(this.space_or_wrap(r),_=!1,!a&&"force"===x&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var h=0;h<w;h++)r.push(T)}for(var c=0;c<r.length;c++)if(" "===r[c]){a=!1;break}}if(g&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" "+i),_=!0),"<"!==i||n||(t=this.pos-1,n="<"),g&&!n&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===i||"/"===i||"!"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(g&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(g&&"{"===n&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=i);var u,p,d=r.join("");u=-1!=d.indexOf(" ")?d.indexOf(" "):"{"===d[0]?d.indexOf("}"):d.indexOf(">"),p="<"!==d[0]&&g?"#"===d[2]?3:2:1;var f=d.substring(p,u).toLowerCase();return"/"===d.charAt(d.length-2)||this.Utils.in_array(f,this.Utils.single_token)?e||(this.tag_type="SINGLE"):g&&"{"===d[0]&&"else"===f?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(f,E)?(s=this.get_unformatted("</"+f+">",d),r.push(s),this.pos,this.tag_type="SINGLE"):"script"===f&&(-1===d.search("type")||-1<d.search("type")&&-1<d.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(f),this.tag_type="SCRIPT"):"style"===f&&(-1===d.search("type")||-1<d.search("type")&&-1<d.search("text/css"))?e||(this.record_tag(f),this.tag_type="STYLE"):"!"===f.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===f.charAt(0)?(this.retrieve_tag(f.substring(1)),this.tag_type="END"):(this.record_tag(f),"html"!=f.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(f,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=o,this.line_char_count=l),r.join("")},this.get_comment=function(e){var t="",n=">",i=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!==n[n.length-1]||-1==t.indexOf(n));)!i&&t.length<10&&(0===t.indexOf("<![if")?(n="<![endif]>",i=!0):0===t.indexOf("<![cdata[")?(n="]]>",i=!0):0===t.indexOf("<![")?(n="]>",i=!0):0===t.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===t.indexOf("{{!")?(n="}}",i=!0):0===t.indexOf("<?")?(n="?>",i=!0):0===t.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,g&&"{"===n&&i.length&&"{"===i[i.length-2]&&(r=(i+=this.get_unformatted("}}")).length)}while(-1===i.toLowerCase().indexOf(e,r));return i},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=_(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=function t(e){return e.replace(/^\s+/g,"")}(e)),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=_(e)),e&&""!==e&&(1<e.length&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,T,r,s,a);;){var u=n.get_token();if(n.token_text=u[0],n.token_type=u[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===n.last_token&&""===n.last_text){var p=n.token_text.match(/\w+/)[0],d=null;n.output.length&&(d=n.output[n.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/)),(null===d||d[1]!=p&&!n.Utils.in_array(d[1],E))&&n.print_newline(!1,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z-]+)/i);f&&n.Utils.in_array(f[1],E)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.print_newline(!1,n.output);var K=n.token_text,R=void 0,m=1;"TK_SCRIPT"===n.token_type?R=O:"TK_STYLE"===n.token_type&&(R=y),"keep"===t.indent_scripts?m=0:"separate"===t.indent_scripts&&(m=-n.indent_level);var b=n.get_full_indent(m);if(R)K=R(K.replace(/^\s*/,b),t);else{var v=K.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,S=n.get_full_indent(m-v);K=K.replace(/^\s*/,b).replace(/\r\n|\r|\n/g,"\n"+S).replace(/\s+$/,"")}K&&(n.print_token_raw(K),n.print_newline(!0,n.output))}n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}var A=n.output.join("").replace(/[\r\n\t ]+$/,"");return h&&(A+="\n"),A}}}});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(e){"use strict";(e=e&&e.hasOwnProperty("default")?e["default"]:e).PLUGINS.codeBeautifier=function(){var e,t,n,i,Q={};function y(i,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},n={"@media":!0,"@supports":!0,"@document":!0};e=e||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,s=e.indent_char||" ",_=e.selector_separator_newline===undefined||e.selector_separator_newline,a=e.end_with_newline!==undefined&&e.end_with_newline,o=e.newline_between_rules===undefined||e.newline_between_rules,l=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(s="\t",r=1),l=l.replace(/\\r/,"\r").replace(/\\n/,"\n");var h,c=/^\s+$/,u=-1,p=0;function d(){return(h=i.charAt(++u))||""}function f(e){var t,n=u;return e&&E(),t=i.charAt(u+1)||"",u=n-1,d(),t}function T(e){for(var t=u;d();)if("\\"===h)d();else{if(-1!==e.indexOf(h))break;if("\n"===h)break}return i.substring(t,u+1)}function E(){for(var e="";c.test(f());)d(),e+=h;return e}function g(){var e="";for(h&&c.test(h)&&(e=h);c.test(d());)e+=h;return e}function x(e){var t=u;for(e="/"===f(),d();d();){if(!e&&"*"===h&&"/"===f()){d();break}if(e&&"\n"===h)return i.substring(t,u)}return i.substring(t,u)+h}function w(e){return i.substring(u-e.length,u).toLowerCase()===e}function K(){for(var e=0,t=u+1;t<i.length;t++){var n=i.charAt(t);if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(" "===n||"}"===n)return!1}return!1}var R=i.match(/^[\t ]*/)[0],m=new Array(r+1).join(s),b=0,v=0;for(var S,A,k,y={"{":function(e){y.singleSpace(),O.push(e),y.newLine()},"}":function(e){y.newLine(),O.push(e),y.newLine()},_lastCharWhitespace:function(){return c.test(O[O.length-1])},newLine:function(e){O.length&&(e||"\n"===O[O.length-1]||y.trim(),O.push("\n"),R&&O.push(R))},singleSpace:function(){O.length&&!y._lastCharWhitespace()&&O.push(" ")},preserveSingleSpace:function(){S&&y.singleSpace()},trim:function(){for(;y._lastCharWhitespace();)O.pop()}},O=[],N=!1,D=!1,C=!1,L="",I="";;){var V=g();S=""!==V;var P=-1!==V.indexOf("\n");if(I=L,!(L=h))break;if("/"===h&&"*"===f()){var B=0===b;(P||B)&&y.newLine(),O.push(x()),y.newLine(),B&&y.newLine(!0)}else if("/"===h&&"/"===f())P||"{"===I||y.trim(),y.singleSpace(),O.push(x()),y.newLine();else if("@"===h){y.preserveSingleSpace(),O.push(h);var j=(void 0,A=u,k=T(": , {}()[]/='\""),u=A-1,d(),k);j.match(/[ :]$/)&&(d(),j=T(": ").replace(/\s$/,""),O.push(j),y.singleSpace()),(j=j.replace(/\s$/,""))in t&&(v+=1,j in n&&(C=!0))}else"#"===h&&"{"===f()?(y.preserveSingleSpace(),O.push(T("}"))):"{"===h?"}"===f(!0)?(E(),d(),y.singleSpace(),O.push("{}"),y.newLine(),o&&0===b&&y.newLine(!0)):(b++,R+=m,y["{"](h),N=C?(C=!1,v<b):v<=b):"}"===h?(b--,R=R.slice(0,-r),y["}"](h),D=N=!1,v&&v--,o&&0===b&&y.newLine(!0)):":"===h?(E(),!N&&!C||w("&")||K()?":"===f()?(d(),O.push("::")):O.push(":"):(D=!0,O.push(":"),y.singleSpace())):'"'===h||"'"===h?(y.preserveSingleSpace(),O.push(T(h))):" "===h?(D=!1,O.push(h),y.newLine()):"("===h?w("url")?(O.push(h),E(),d()&&(")"!==h&&'"'!==h&&"'"!==h?O.push(T(")")):u--)):(p++,y.preserveSingleSpace(),O.push(h),E()):")"===h?(O.push(h),p--):","===h?(O.push(h),E(),_&&!D&&p<1?y.newLine():y.singleSpace()):("]"===h||("["===h?y.preserveSingleSpace():"="===h?(E(),h="="):y.preserveSingleSpace()),O.push(h))}var M="";return R&&(M+=R),M+=O.join("").replace(/[\r\n\t ]+$/,""),a&&(M+="\n"),"\n"!=l&&(M=M.replace(/[\n]/g,l)),M}function Y(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function H(e){return e.replace(/^\s+|\s+$/g,"")}function O(e,t){return new r(e,t).beautify()}e=Q,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("["+t+"]"),i=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e))))};var Z={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(i,e){var l,r,s,h,_,a,o,c,u,t,n,p,d,f=[],T="";function E(e,t){var n=0;return e&&(n=e.indentation_level,!l.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:l.get_line_number(),ternary_depth:0}}for(p={TK_START_EXPR:function L(){O();var e=Z.Expression;if("["===h.text){if("TK_WORD"===_||")"===c.last_text)return"TK_RESERVED"===_&&Y(c.last_text,s.line_starters)&&(l.space_before_token=!0),v(e),m(),b(),void(d.space_in_paren&&(l.space_before_token=!0));e=Z.ArrayLiteral,S(c.mode)&&("["!==c.last_text&&(","!==c.last_text||"]"!==a&&"}"!==a)||d.keep_array_indentation||K())}else"TK_RESERVED"===_&&"for"===c.last_text?e=Z.ForInitializer:"TK_RESERVED"===_&&Y(c.last_text,["if","while"])&&(e=Z.Conditional);" "===c.last_text||"TK_START_BLOCK"===_?K():"TK_END_EXPR"===_||"TK_START_EXPR"===_||"TK_END_BLOCK"===_||"."===c.last_text?w(h.wanted_newline):"TK_RESERVED"===_&&"("===h.text||"TK_WORD"===_||"TK_OPERATOR"===_?"TK_RESERVED"===_&&("function"===c.last_word||"typeof"===c.last_word)||"*"===c.last_text&&"function"===a?d.space_after_anon_function&&(l.space_before_token=!0):"TK_RESERVED"!==_||!Y(c.last_text,s.line_starters)&&"catch"!==c.last_text||d.space_before_conditional&&(l.space_before_token=!0):l.space_before_token=!0;"("===h.text&&"TK_RESERVED"===_&&"await"===c.last_word&&(l.space_before_token=!0);"("===h.text&&("TK_EQUALS"!==_&&"TK_OPERATOR"!==_||y()||w());v(e),m(),d.space_in_paren&&(l.space_before_token=!0);b()},TK_END_EXPR:function I(){for(;c.mode===Z.Statement;)k();c.multiline_frame&&w("]"===h.text&&S(c.mode)&&!d.keep_array_indentation);d.space_in_paren&&("TK_START_EXPR"!==_||d.space_in_empty_paren?l.space_before_token=!0:(l.trim(),l.space_before_token=!1));"]"===h.text&&d.keep_array_indentation?(m(),k()):(k(),m());l.remove_redundant_indentation(u),c.do_while&&u.mode===Z.Conditional&&(u.mode=Z.Expression,c.do_block=!1,c.do_while=!1)},TK_START_BLOCK:function V(){var e=D(1),t=D(2);t&&(":"===t.text&&Y(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||Y(e.text,["get","set"])&&Y(t.type,["TK_WORD","TK_RESERVED"]))?Y(a,["class","interface"])?v(Z.BlockStatement):v(Z.ObjectLiteral):v(Z.BlockStatement);var n=!e.comments_before.length&&"}"===e.text&&"function"===c.last_word&&"TK_END_EXPR"===_;"expand"===d.brace_style||"none"===d.brace_style&&h.wanted_newline?"TK_OPERATOR"!==_&&(n||"TK_EQUALS"===_||"TK_RESERVED"===_&&N(c.last_text)&&"else"!==c.last_text)?l.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==_&&"TK_START_EXPR"!==_?"TK_START_BLOCK"===_?K():l.space_before_token=!0:S(u.mode)&&","===c.last_text&&("}"===a?l.space_before_token=!0:K());m(),b()},TK_END_BLOCK:function P(){for(;c.mode===Z.Statement;)k();var e="TK_START_BLOCK"===_;"expand"===d.brace_style?e||K():e||(S(c.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K());k(),m()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function B(){O()&&(l.space_before_token=!1);for(;c.mode===Z.Statement&&!c.if_block&&!c.do_block;)k();m()},TK_STRING:function j(){O()?l.space_before_token=!0:"TK_RESERVED"===_||"TK_WORD"===_?l.space_before_token=!0:"TK_COMMA"===_||"TK_START_EXPR"===_||"TK_EQUALS"===_||"TK_OPERATOR"===_?y()||w():K();m()},TK_EQUALS:function M(){O();c.declaration_statement&&(c.declaration_assignment=!0);l.space_before_token=!0,m(),l.space_before_token=!0},TK_OPERATOR:function U(){O();if("TK_RESERVED"===_&&N(c.last_text))return l.space_before_token=!0,void m();if("*"===h.text&&"TK_DOT"===_)return void m();if(":"===h.text&&c.in_case)return c.case_body=!0,b(),m(),K(),void(c.in_case=!1);if("::"===h.text)return void m();"TK_OPERATOR"===_&&w();var e=!0,t=!0;Y(h.text,["--","++","!","~"])||Y(h.text,["-","+"])&&(Y(_,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||Y(c.last_text,s.line_starters)||","===c.last_text)?(t=e=!1,!h.wanted_newline||"--"!==h.text&&"++"!==h.text||K(!1,!0)," "===c.last_text&&A(c.mode)&&(e=!0),"TK_RESERVED"===_?e=!0:"TK_END_EXPR"===_?e=!("]"===c.last_text&&("--"===h.text||"++"===h.text)):"TK_OPERATOR"===_&&(e=Y(h.text,["--","-","++","+"])&&Y(c.last_text,["--","-","++","+"]),Y(h.text,["+","-"])&&Y(c.last_text,["--","++"])&&(t=!0)),c.mode!==Z.BlockStatement&&c.mode!==Z.Statement||"{"!==c.last_text&&" "!==c.last_text||K()):":"===h.text?0===c.ternary_depth?e=!1:c.ternary_depth-=1:"?"===h.text?c.ternary_depth+=1:"*"===h.text&&"TK_RESERVED"===_&&"function"===c.last_text&&(t=e=!1);l.space_before_token=l.space_before_token||e,m(),l.space_before_token=t},TK_COMMA:function W(){if(c.declaration_statement)return A(c.parent.mode)&&(c.declaration_assignment=!1),m(),void(c.declaration_assignment?K(c.declaration_assignment=!1,!0):(l.space_before_token=!0,d.comma_first&&w()));m(),c.mode===Z.ObjectLiteral||c.mode===Z.Statement&&c.parent.mode===Z.ObjectLiteral?(c.mode===Z.Statement&&k(),K()):(l.space_before_token=!0,d.comma_first&&w())},TK_BLOCK_COMMENT:function z(){if(l.raw)return l.add_raw_token(h),void(h.directives&&"end"===h.directives.preserve&&(d.test_output_raw||(l.raw=!1)));if(h.directives)return K(!1,!0),m(),"start"===h.directives.preserve&&(l.raw=!0),void K(!1,!0);if(!Q.newline.test(h.text)&&!h.wanted_newline)return l.space_before_token=!0,m(),void(l.space_before_token=!0);var e,t=function _(e){var t;e=e.replace(/\x0d/g,"");var n=[];t=e.indexOf("\n");for(;-1!==t;)n.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&n.push(e);return n}(h.text),n=!1,i=!1,r=h.whitespace_before,s=r.length;K(!1,!0),1<t.length&&(!function a(e,t){for(var n=0;n<e.length;n++){var i=H(e[n]);if(i.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function o(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(t.slice(1),r)&&(i=!0):n=!0);for(m(t[0]),e=1;e<t.length;e++)K(!1,!0),n?m(" "+t[e].replace(/^\s+/g,"")):i&&t[e].length>s?m(t[e].substring(s)):l.add_token(t[e]);K(!1,!0)},TK_COMMENT:function G(){h.wanted_newline?K(!1,!0):l.trim(!0);l.space_before_token=!0,m(),K(!1,!0)},TK_DOT:function X(){O();"TK_RESERVED"===_&&N(c.last_text)?l.space_before_token=!0:w(")"===c.last_text&&d.break_chained_methods);m()},TK_UNKNOWN:function F(){m(),"\n"===h.text[h.text.length-1]&&K()},TK_EOF:function $(){for(;c.mode===Z.Statement;)k()}},d={},(e=e||{}).braces_on_own_line!==undefined&&(d.brace_style=e.braces_on_own_line?"expand":"collapse"),d.brace_style=e.brace_style?e.brace_style:d.brace_style?d.brace_style:"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand"),d.indent_size=e.indent_size?parseInt(e.indent_size,10):4,d.indent_char=e.indent_char?e.indent_char:" ",d.eol=e.eol?e.eol:"\n",d.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,d.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,d.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),d.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,d.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,d.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,d.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,d.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,d.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,d.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,d.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),d.e4x=e.e4x!==undefined&&e.e4x,d.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,d.comma_first=e.comma_first!==undefined&&e.comma_first,d.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0),e.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1),d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),o="";0<d.indent_size;)o+=d.indent_char,d.indent_size-=1;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function x(e){var t=e.newlines;if(d.keep_array_indentation&&S(c.mode))for(var n=0;n<t;n+=1)K(0<n);else if(d.max_preserve_newlines&&t>d.max_preserve_newlines&&(t=d.max_preserve_newlines),d.preserve_newlines&&1<e.newlines){K();for(var i=1;i<t;i+=1)K(!0)}p[(h=e).type]()}function w(e){if(e=e!==undefined&&e,!l.just_added_newline())if(d.preserve_newlines&&h.wanted_newline||e)K(!1,!0);else if(d.wrap_line_length){l.current_line.get_character_count()+h.text.length+(l.space_before_token?1:0)>=d.wrap_line_length&&K(!1,!0)}}function K(e,t){if(!t&&" "!==c.last_text&&","!==c.last_text&&"="!==c.last_text&&"TK_OPERATOR"!==_)for(;c.mode===Z.Statement&&!c.if_block&&!c.do_block;)k();l.add_new_line(e)&&(c.multiline_frame=!0)}function R(){l.just_added_newline()&&(d.keep_array_indentation&&S(c.mode)&&h.wanted_newline?(l.current_line.push(h.whitespace_before),l.space_before_token=!1):l.set_indent(c.indentation_level)&&(c.line_indent_level=c.indentation_level))}function m(e){l.raw?l.add_raw_token(h):(d.comma_first&&"TK_COMMA"===_&&l.just_added_newline()&&","===l.previous_line.last()&&(l.previous_line.pop(),R(),l.add_token(","),l.space_before_token=!0),e=e||h.text,R(),l.add_token(e))}function b(){c.indentation_level+=1}function v(e){u=c?(t.push(c),c):E(null,e),c=E(u,e)}function S(e){return e===Z.ArrayLiteral}function A(e){return Y(e,[Z.Expression,Z.ForInitializer,Z.Conditional])}function k(){0<t.length&&(u=c,c=t.pop(),u.mode===Z.Statement&&l.remove_redundant_indentation(u))}function y(){return c.parent.mode===Z.ObjectLiteral&&c.mode===Z.Statement&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===_&&Y(c.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===_&&Y(c.last_text,["const","let","const"])&&"TK_WORD"===h.type||"TK_RESERVED"===_&&"do"===c.last_text||"TK_RESERVED"===_&&"return"===c.last_text&&!h.wanted_newline||"TK_RESERVED"===_&&"else"===c.last_text&&("TK_RESERVED"!==h.type||"if"!==h.text)||"TK_END_EXPR"===_&&(u.mode===Z.ForInitializer||u.mode===Z.Conditional)||"TK_WORD"===_&&c.mode===Z.BlockStatement&&!c.in_case&&"--"!==h.text&&"++"!==h.text&&"function"!==a&&"TK_WORD"!==h.type&&"TK_RESERVED"!==h.type||c.mode===Z.ObjectLiteral&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===_&&Y(c.last_text,["get","set"])))&&(v(Z.Statement),b(),"TK_RESERVED"===_&&Y(c.last_text,["const","let","const"])&&"TK_WORD"===h.type&&(c.declaration_statement=!0),y()||w("TK_RESERVED"===h.type&&Y(h.text,["do","for","if","while"])),!0)}function N(e){return Y(e,["case","return","do","if","throw","else"])}function D(e){var t=r+(e||0);return t<0||t>=f.length?null:f[t]}function C(){("TK_RESERVED"===h.type&&c.mode!==Z.ObjectLiteral&&Y(h.text,["set","get"])&&(h.type="TK_WORD"),"TK_RESERVED"===h.type&&c.mode===Z.ObjectLiteral)&&(":"===D(1).text&&(h.type="TK_WORD"));if(O()||!h.wanted_newline||A(c.mode)||"TK_OPERATOR"===_&&"--"!==c.last_text&&"++"!==c.last_text||"TK_EQUALS"===_||!d.preserve_newlines&&"TK_RESERVED"===_&&Y(c.last_text,["const","let","const","set","get"])||K(),c.do_block&&!c.do_while){if("TK_RESERVED"===h.type&&"while"===h.text)return l.space_before_token=!0,m(),l.space_before_token=!0,void(c.do_while=!0);K(),c.do_block=!1}if(c.if_block)if(c.else_block||"TK_RESERVED"!==h.type||"else"!==h.text){for(;c.mode===Z.Statement;)k();c.if_block=!1,c.else_block=!1}else c.else_block=!0;if("TK_RESERVED"===h.type&&("case"===h.text||"default"===h.text&&c.in_case_statement))return K(),(c.case_body||d.jslint_happy)&&(!function e(){0<c.indentation_level&&(!c.parent||c.indentation_level>c.parent.indentation_level)&&(c.indentation_level-=1)}(),c.case_body=!1),m(),c.in_case=!0,void(c.in_case_statement=!0);if("TK_RESERVED"===h.type&&"function"===h.text&&((Y(c.last_text,["}"," "])||l.just_added_newline()&&!Y(c.last_text,["[","{",":","=",","]))&&(l.just_added_blankline()||h.comments_before.length||(K(),K(!0))),"TK_RESERVED"===_||"TK_WORD"===_?"TK_RESERVED"===_&&Y(c.last_text,["get","set","new","return","export","async"])?l.space_before_token=!0:"TK_RESERVED"===_&&"default"===c.last_text&&"export"===a?l.space_before_token=!0:K():"TK_OPERATOR"===_||"="===c.last_text?l.space_before_token=!0:(c.multiline_frame||!A(c.mode)&&!S(c.mode))&&K()),"TK_COMMA"!==_&&"TK_START_EXPR"!==_&&"TK_EQUALS"!==_&&"TK_OPERATOR"!==_||y()||w(),"TK_RESERVED"===h.type&&Y(h.text,["function","get","set"]))return m(),void(c.last_word=h.text);(n="NONE","TK_END_BLOCK"===_?"TK_RESERVED"===h.type&&Y(h.text,["else","catch","finally"])?"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&h.wanted_newline?n="NEWLINE":(n="SPACE",l.space_before_token=!0):n="NEWLINE":"TK_SEMICOLON"===_&&c.mode===Z.BlockStatement?n="NEWLINE":"TK_SEMICOLON"===_&&A(c.mode)?n="SPACE":"TK_STRING"===_?n="NEWLINE":"TK_RESERVED"===_||"TK_WORD"===_||"*"===c.last_text&&"function"===a?n="SPACE":"TK_START_BLOCK"===_?n="NEWLINE":"TK_END_EXPR"===_&&(l.space_before_token=!0,n="NEWLINE"),"TK_RESERVED"===h.type&&Y(h.text,s.line_starters)&&")"!==c.last_text&&(n="else"===c.last_text||"export"===c.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===h.type&&Y(h.text,["else","catch","finally"]))?"TK_END_BLOCK"!==_||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&h.wanted_newline?K():(l.trim(!0),"}"!==l.current_line.last()&&K(),l.space_before_token=!0):"NEWLINE"===n?"TK_RESERVED"===_&&N(c.last_text)?l.space_before_token=!0:"TK_END_EXPR"!==_?"TK_START_EXPR"===_&&"TK_RESERVED"===h.type&&Y(h.text,["const","let","const"])||":"===c.last_text||("TK_RESERVED"===h.type&&"if"===h.text&&"else"===c.last_text?l.space_before_token=!0:K()):"TK_RESERVED"===h.type&&Y(h.text,s.line_starters)&&")"!==c.last_text&&K():c.multiline_frame&&S(c.mode)&&","===c.last_text&&"}"===a?K():"SPACE"===n&&(l.space_before_token=!0);m(),c.last_word=h.text,"TK_RESERVED"===h.type&&"do"===h.text&&(c.do_block=!0),"TK_RESERVED"===h.type&&"if"===h.text&&(c.if_block=!0)}_="TK_START_BLOCK",a="",(l=new q(o,T)).raw=d.test_output_raw,t=[],v(Z.BlockStatement),this.beautify=function(){var e,t;for(s=new ee(i,d,o),f=s.tokenize(),r=0;e=D();){for(var n=0;n<e.comments_before.length;n++)x(e.comments_before[n]);x(e),a=c.last_text,_=e.type,c.last_text=e.text,r+=1}return t=l.get_code(),d.end_with_newline&&(t+="\n"),"\n"!=d.eol&&(t=t.replace(/[\n]/g,d.eol)),t}}function s(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0<i&&(i-=1,n-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),n-=1;s=0===r.length},this.toString=function(){var e="";return this._empty||(0<=i&&(e=t.indent_cache[i]),e+=r.join("")),e}}function q(t,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=t.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return i.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<i.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==Z.ForInitializer&&e.mode!==Z.Conditional)for(var t=e.start_line_index,n=i.length;t<n;)i[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,n);e&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===i.length||i[i.length-2].is_empty())}}var J=function J(e,t,n,i,r,s){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};function ee(k,y,e){var O="\n\r\t ".split(""),N=/[0-9]/,D=/[01234567]/,C=/[0123456789abcdefABCDEF]/,L="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var I,V,P,B,j,M,U=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),W=/([\s\S]*?)((?:\*\/)|$)/g,z=/([^\n\r\u2028\u2029]*)/g,G=/\/\* beautify( \w+[:]\w+)+ \*\//g,X=/ (\w+)[:](\w+)/g,F=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,$=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function _(){var e,t,n=[];if(I=0,V="",M<=j)return["","TK_EOF"];t=B.length?B[B.length-1]:new J("TK_START_BLOCK","{");var i=k.charAt(j);for(j+=1;Y(i,O);){if(Q.newline.test(i)?"\n"===i&&"\r"===k.charAt(j-2)||(I+=1,n=[]):n.push(i),M<=j)return["","TK_EOF"];i=k.charAt(j),j+=1}if(n.length&&(V=n.join("")),N.test(i)){var r=!0,s=!0,_=N;for("0"===i&&j<M&&/[Xxo]/.test(k.charAt(j))?(s=r=!1,i+=k.charAt(j),j+=1,_=/[o]/.test(k.charAt(j))?D:C):(i="",j-=1);j<M&&_.test(k.charAt(j));)i+=k.charAt(j),j+=1,r&&j<M&&"."===k.charAt(j)&&(i+=k.charAt(j),j+=1,r=!1),s&&j<M&&/[Ee]/.test(k.charAt(j))&&(i+=k.charAt(j),(j+=1)<M&&/[+-]/.test(k.charAt(j))&&(i+=k.charAt(j),j+=1),r=s=!1);return[i,"TK_WORD"]}if(Q.isIdentifierStart(k.charCodeAt(j-1))){if(j<M)for(;Q.isIdentifierChar(k.charCodeAt(j))&&(i+=k.charAt(j),(j+=1)!==M););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&Y(t.text,["set","get"])||!Y(i,U)?[i,"TK_WORD"]:"in"===i?[i,"TK_OPERATOR"]:[i,"TK_RESERVED"]}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(" "===i)return[i,"TK_SEMICOLON"];if("/"===i){var a="";if("*"===k.charAt(j)){j+=1,W.lastIndex=j;var o=W.exec(k);a="/*"+o[0],j+=o[0].length;var l=function S(e){if(!e.match(G))return null;var t={};X.lastIndex=0;for(var n=X.exec(e);n;)t[n[1]]=n[2],n=X.exec(e);return t}(a);return l&&"start"===l.ignore&&(F.lastIndex=j,a+=(o=F.exec(k))[0],j+=o[0].length),[a=a.replace(Q.lineBreak,"\n"),"TK_BLOCK_COMMENT",l]}if("/"===k.charAt(j)){j+=1,z.lastIndex=j;var h=z.exec(k);return a="//"+h[0],j+=h[0].length,[a,"TK_COMMENT"]}}if("`"===i||"'"===i||'"'===i||("/"===i||y.e4x&&"<"===i&&k.slice(j-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&Y(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&Y(t.parent.text,["if","while","for"])||Y(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var c=i,u=!1,p=!1;if(e=i,"/"===c)for(var d=!1;j<M&&(u||d||k.charAt(j)!==c)&&!Q.newline.test(k.charAt(j));)e+=k.charAt(j),u?u=!1:(u="\\"===k.charAt(j),"["===k.charAt(j)?d=!0:"]"===k.charAt(j)&&(d=!1)),j+=1;else if(y.e4x&&"<"===c){var f=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,T=k.slice(j-1),E=f.exec(T);if(E&&0===E.index){for(var g=E[2],x=0;E;){var w=!!E[1],K=E[2],R=!!E[E.length-1]||"![CDATA["===K.slice(0,8);if(K!==g||R||(w?--x:++x),x<=0)break;E=f.exec(T)}var m=E?E.index+E[0].length:T.length;return T=T.slice(0,m),j+=m-1,[T=T.replace(Q.lineBreak,"\n"),"TK_STRING"]}}else for(;j<M&&(u||k.charAt(j)!==c&&("`"===c||!Q.newline.test(k.charAt(j))));)(u||"`"===c)&&Q.newline.test(k.charAt(j))?("\r"===k.charAt(j)&&"\n"===k.charAt(j+1)&&(j+=1),e+="\n"):e+=k.charAt(j),u=u?("x"!==k.charAt(j)&&"u"!==k.charAt(j)||(p=!0),!1):"\\"===k.charAt(j),j+=1;if(p&&y.unescape_strings&&(e=function A(e){var t,n=!1,i="",r=0,s="",_=0;for(;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,"x"===t)s=e.substr(r,2),r+=2;else{if("u"!==t){i+="\\"+t;continue}s=e.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(_=parseInt(s,16))&&_<32){i+="x"===t?"\\x"+s:"\\u"+s;continue}if(34===_||39===_||92===_)i+="\\"+String.fromCharCode(_);else{if("x"===t&&126<_&&_<=255)return e;i+=String.fromCharCode(_)}}else"\\"===t?n=!0:i+=t;return i}(e)),j<M&&k.charAt(j)===c&&(e+=c,j+=1,"/"===c))for(;j<M&&Q.isIdentifierStart(k.charCodeAt(j));)e+=k.charAt(j),j+=1;return[e,"TK_STRING"]}if("#"===i){if(0===B.length&&"!"===k.charAt(j)){for(e=i;j<M&&"\n"!==i;)e+=i=k.charAt(j),j+=1;return[H(e)+"\n","TK_UNKNOWN"]}var b="#";if(j<M&&N.test(k.charAt(j))){for(;b+=i=k.charAt(j),(j+=1)<M&&"#"!==i&&"="!==i;);return"#"===i||("["===k.charAt(j)&&"]"===k.charAt(j+1)?(b+="[]",j+=2):"{"===k.charAt(j)&&"}"===k.charAt(j+1)&&(b+="{}",j+=2)),[b,"TK_WORD"]}}if("<"===i&&("?"===k.charAt(j)||"%"===k.charAt(j))){$.lastIndex=j-1;var v=$.exec(k);if(v)return i=v[0],j+=i.length-1,[i=i.replace(Q.lineBreak,"\n"),"TK_STRING"]}if("<"===i&&"\x3c!--"===k.substring(j-1,j+3)){for(j+=3,i="\x3c!--";!Q.newline.test(k.charAt(j))&&j<M;)i+=k.charAt(j),j++;return P=!0,[i,"TK_COMMENT"]}if("-"===i&&P&&"--\x3e"===k.substring(j-1,j+2))return P=!1,j+=2,["--\x3e","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(Y(i,L)){for(;j<M&&Y(i+k.charAt(j),L)&&(i+=k.charAt(j),!(M<=(j+=1))););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,n;M=k.length,j=0,P=!1,B=[];for(var i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=_(),e=new J(n[1],n[0],I,V);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=_(),e=new J(n[1],n[0],I,V);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,i=r.pop()),B.push(e),t=e}return B}}return{run:function N(e,t){function _(e){return e.replace(/\s+$/g,"")}var n,i,r,T,s,a,E,o,l,g,x,w,h,c;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),i=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),T=t.indent_char===undefined?" ":t.indent_char,a=t.brace_style===undefined?"collapse":t.brace_style,s=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),E=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=t.preserve_newlines===undefined||t.preserve_newlines,l=o?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,g=t.indent_handlebars!==undefined&&t.indent_handlebars,x=t.wrap_attributes===undefined?"auto":t.wrap_attributes,w=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,h=t.end_with_newline!==undefined&&t.end_with_newline,c=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(T="\t",r=1),(n=new function k(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:c,in_array:function(e,t){for(var n=0;n<t.length;n++)if(e===t[n])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)o&&"\n"===e&&this.newlines<=l&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(g){var n=this.input.substr(this.pos,3);if("{{#"===n||"{{/"===n)break;if("{{!"===n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1===this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,n,i="",r=[],s="",_=!1,a=!0,o=this.pos,l=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=o,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))_=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),_=!0),"="===i&&(_=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&_){if(this.space_or_wrap(r),_=!1,!a&&"force"===x&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var h=0;h<w;h++)r.push(T)}for(var c=0;c<r.length;c++)if(" "===r[c]){a=!1;break}}if(g&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" "+i),_=!0),"<"!==i||n||(t=this.pos-1,n="<"),g&&!n&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===i||"/"===i||"!"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(g&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(g&&"{"===n&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=i);var u,p,d=r.join("");u=-1!=d.indexOf(" ")?d.indexOf(" "):"{"===d[0]?d.indexOf("}"):d.indexOf(">"),p="<"!==d[0]&&g?"#"===d[2]?3:2:1;var f=d.substring(p,u).toLowerCase();return"/"===d.charAt(d.length-2)||this.Utils.in_array(f,this.Utils.single_token)?e||(this.tag_type="SINGLE"):g&&"{"===d[0]&&"else"===f?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(f,E)?(s=this.get_unformatted("</"+f+">",d),r.push(s),this.pos,this.tag_type="SINGLE"):"script"===f&&(-1===d.search("type")||-1<d.search("type")&&-1<d.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(f),this.tag_type="SCRIPT"):"style"===f&&(-1===d.search("type")||-1<d.search("type")&&-1<d.search("text/css"))?e||(this.record_tag(f),this.tag_type="STYLE"):"!"===f.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===f.charAt(0)?(this.retrieve_tag(f.substring(1)),this.tag_type="END"):(this.record_tag(f),"html"!=f.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(f,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=o,this.line_char_count=l),r.join("")},this.get_comment=function(e){var t="",n=">",i=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!==n[n.length-1]||-1==t.indexOf(n));)!i&&t.length<10&&(0===t.indexOf("<![if")?(n="<![endif]>",i=!0):0===t.indexOf("<![cdata[")?(n="]]>",i=!0):0===t.indexOf("<![")?(n="]>",i=!0):0===t.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===t.indexOf("{{!")?(n="}}",i=!0):0===t.indexOf("<?")?(n="?>",i=!0):0===t.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,g&&"{"===n&&i.length&&"{"===i[i.length-2]&&(r=(i+=this.get_unformatted("}}")).length)}while(-1===i.toLowerCase().indexOf(e,r));return i},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=_(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=function t(e){return e.replace(/^\s+/g,"")}(e)),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=_(e)),e&&""!==e&&(1<e.length&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,T,r,s,a);;){var u=n.get_token();if(n.token_text=u[0],n.token_type=u[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===n.last_token&&""===n.last_text){var p=n.token_text.match(/\w+/)[0],d=null;n.output.length&&(d=n.output[n.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/)),(null===d||d[1]!=p&&!n.Utils.in_array(d[1],E))&&n.print_newline(!1,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z-]+)/i);f&&n.Utils.in_array(f[1],E)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.print_newline(!1,n.output);var K=n.token_text,R=void 0,m=1;"TK_SCRIPT"===n.token_type?R=O:"TK_STYLE"===n.token_type&&(R=y),"keep"===t.indent_scripts?m=0:"separate"===t.indent_scripts&&(m=-n.indent_level);var b=n.get_full_indent(m);if(R)K=R(K.replace(/^\s*/,b),t);else{var v=K.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,S=n.get_full_indent(m-v);K=K.replace(/^\s*/,b).replace(/\r\n|\r|\n/g,"\n"+S).replace(/\s+$/,"")}K&&(n.print_token_raw(K),n.print_newline(!0,n.output))}n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}var A=n.output.join("").replace(/[\r\n\t ]+$/,"");return h&&(A+="\n"),A}}}});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 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";function Le(e){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}_e=_e&&_e.hasOwnProperty("default")?_e["default"]:_e,Object.assign(_e.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(_e.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","webp"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),_e.PLUGINS.image=function(g){var d,l,f,p,o,a,c=g.$,s="https://i.froala.com/upload",t=!1,i=1,m=2,u=3,h=4,v=5,b=6,r={};function y(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),d&&e.val(d.attr("src")),e.trigger("change")}function n(){var e=g.popups.get("image.edit");if(e||(e=P()),e){var t=we();Ce()&&(t=t.find(".fr-img-wrap")),g.popups.setContainer("image.edit",g.$sc),g.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();d.hasClass("fr-uploading")?O():g.popups.show("image.edit",a,i,t.outerHeight(),!0)}}function w(){k()}function C(e){0<e.parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first());var t=e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,a=e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":ue(e);me(e,t,a),e.removeClass("fr-dib fr-dii fr-fir fr-fil")}function A(){for(var e,t="IMG"==g.el.tagName?[g.el]:g.el.querySelectorAll("img"),a=0;a<t.length;a++){var i=c(t[a]);!g.opts.htmlUntouched&&g.opts.useClasses?((g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&(0<(e=i).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first()),e.hasClass("fr-dii")||e.hasClass("fr-dib")||(e.addClass("fr-fi"+ue(e)[0]),e.addClass("fr-di"+he(e)[0]),e.css("margin",""),e.css("float",""),e.css("display",""),e.css("z-index",""),e.css("position",""),e.css("overflow",""),e.css("vertical-align",""))),g.opts.imageTextNear||(0<i.parents(".fr-img-caption").length?i.parents(".fr-img-caption").first().removeClass("fr-dii").addClass("fr-dib"):i.removeClass("fr-dii").addClass("fr-dib"))):g.opts.htmlUntouched||g.opts.useClasses||(g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&C(i),g.opts.iframe&&i.on("load",g.size.syncIframe)}}function E(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(g.el.querySelectorAll("img")),i=[];for(t=0;t<a.length;t++)if(i.push(a[t].getAttribute("src")),c(a[t]).toggleClass("fr-draggable",g.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&g.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;g.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var n=a[t].nextSibling;n&&!g.browser.mozilla&&n.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)i.indexOf(o[t].getAttribute("src"))<0&&g.events.trigger("image.removed",[c(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&g.events.trigger("image.loaded",[c(a[t])])}o=a}function S(){if(l||function s(){var e;g.shared.$image_resizer?(l=g.shared.$image_resizer,p=g.shared.$img_overlay,g.events.on("destroy",function(){c("body").first().append(l.removeClass("fr-active"))},!0)):(g.shared.$image_resizer=c(document.createElement("div")).attr("class","fr-image-resizer"),l=g.shared.$image_resizer,g.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),g.opts.imageResize&&(l.append(R("nw")+R("ne")+R("sw")+R("se")),g.shared.$img_overlay=c(document.createElement("div")).attr("class","fr-image-overlay"),p=g.shared.$img_overlay,e=l.get(0).ownerDocument,c(e).find("body").first().append(p)));g.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,g.opts.imageResize&&(p.remove(),p=null)},!0),g.helpers.isMobile()||g.events.$on(c(g.o_win),"resize",function(){d&&!d.hasClass("fr-uploading")?pe(!0):d&&(S(),ve(),O(!1))});if(g.opts.imageResize){e=l.get(0).ownerDocument,g.events.$on(l,g._mousedown,".fr-handler",x),g.events.$on(c(e),g._mousemove,$),g.events.$on(c(e.defaultView||e.parentWindow),g._mouseup,U),g.events.$on(p,"mouseleave",U);var i=1,r=null,n=0;g.events.on("keydown",function(e){if(d){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-n)&&(i=1),(a==_e.KEYCODE.EQUALS||g.browser.mozilla&&a==_e.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=ee.call(this,e,1,1,i):(a==_e.KEYCODE.HYPHEN||g.browser.mozilla&&a==_e.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?i=ee.call(this,e,2,-1,i):g.keys.ctrlKey(e)||a!=_e.KEYCODE.ENTER||(d.before("<br>"),T(d)),r=a,n=e.timeStamp}},!0),g.events.on("keyup",function(){i=1})}}(),!d)return!1;var e=g.$wp||g.$sc;e.append(l),l.data("instance",g);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=g.helpers.getPX(e.css("border-left-width")),t-=g.helpers.getPX(e.css("border-top-width")),g.$el.is("img")&&g.$sc.is("body")&&(a=t=0);var i=we();Ce()&&(i=i.find(".fr-img-wrap"));var r=0,n=0;g.opts.iframe&&(r=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-top")),n=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-left"))),l.css("top",(g.opts.iframe?i.offset().top+r:i.offset().top+t)-1).css("left",(g.opts.iframe?i.offset().left+n:i.offset().left+a)-1).css("width",i.get(0).getBoundingClientRect().width).css("height",i.get(0).getBoundingClientRect().height).addClass("fr-active")}function R(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function D(e){Ce()?d.parents(".fr-img-caption").css("width",e):d.css("width",e)}function x(e){if(!g.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;g.undo.canDo()||g.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=g.$oel.get(0).ownerDocument,i=a.defaultView||a.parentWindow,r=!1;try{r=i.location!=i.parent.location&&!(i.$&&i.$.FE)}catch(o){}r&&i.frameElement&&(t+=g.helpers.getPX(c(i.frameElement).offset().left)+i.frameElement.clientLeft)}(f=c(this)).data("start-x",t),f.data("start-width",d.width()),f.data("start-height",d.height());var n=d.width();if(g.opts.imageResizeWithPercent){var s=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;n=(n/c(s).outerWidth()*100).toFixed(2)+"%"}D(n),p.show(),g.popups.hideAll(),ce()}function $(e){if(!g.core.sameInstance(l))return!0;var t;if(f&&d){if(e.preventDefault(),g.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var i=a-f.data("start-x"),r=f.data("start-width");if((f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(i=0-i),g.opts.imageResizeWithPercent){var n=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;r=((r+i)/c(n).outerWidth()*100).toFixed(2),g.opts.imageRoundPercent&&(r=Math.round(r)),D(r+"%"),(t=Ce()?(g.helpers.getPX(d.parents(".fr-img-caption").css("width"))/c(n).outerWidth()*100).toFixed(2):(g.helpers.getPX(d.css("width"))/c(n).outerWidth()*100).toFixed(2))===r||g.opts.imageRoundPercent||D(t+"%"),d.css("height","").removeAttr("height")}else r+i>=g.opts.imageMinWidth&&(D(r+i),t=Ce()?g.helpers.getPX(d.parents(".fr-img-caption").css("width")):g.helpers.getPX(d.css("width"))),t!==r+i&&D(t),((d.attr("style")||"").match(/(^height:)|(; *height:)/)||d.attr("height"))&&(d.css("height",f.data("start-height")*d.width()/f.data("start-width")),d.removeAttr("height"));S(),g.events.trigger("image.resize",[ye()])}}function U(e){if(!g.core.sameInstance(l))return!0;if(f&&d){if(e&&e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;f=null,p.hide(),S(),n(),g.undo.saveStep(),g.events.trigger("image.resizeEnd",[ye()])}}function I(e,t,a){g.edit.on(),d&&d.addClass("fr-error"),r[e]?B(r[e]):B(g.language.translate("Something went wrong. Please try again.")),!d&&a&&te(a),g.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function P(e){if(e)return g.$wp&&g.events.$on(g.$wp,"scroll.image-edit",function(){d&&g.popups.isVisible("image.edit")&&(g.events.disableBlur(),n())}),!0;var t="";if(0<g.opts.imageEditButtons.length){var a={buttons:t+='<div class="fr-buttons"> \n '.concat(g.button.buildList(g.opts.imageEditButtons),"\n </div>")};return g.popups.create("image.edit",a)}return!1}function O(e){var t=g.popups.get("image.insert");if(t||(t=X()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),d){var a=we();g.popups.setContainer("image.insert",g.$sc);var i=a.offset().left,r=a.offset().top+a.height();g.popups.show("image.insert",i,r,a.outerHeight())}void 0===e&&N(g.language.translate("Uploading"),0)}function k(e){var t=g.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||g.$el.find("img.fr-error").length)){if(g.events.focus(),g.$el.find("img.fr-error").length&&(g.$el.find("img.fr-error").remove(),g.undo.saveStep(),g.undo.run(),g.undo.dropRedo()),!g.$wp&&d){var a=d;pe(!0),g.selection.setAfter(a.get(0)),g.selection.restore()}g.popups.hide("image.insert")}}function N(e,t){var a=g.popups.get("image.insert");if(a){var i=a.find(".fr-image-progress-bar-layer");i.find("h3").text(e+(t?" "+t+"%":"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width",t+"%")):i.find("div").addClass("fr-indeterminate")}}function B(e){O();var t=g.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),g.events.disableBlur(),a.focus()}function T(e){fe.call(e.get(0))}function _(){var e=c(this);g.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),T(e),g.events.trigger("image.loaded",[e])}function L(s,e,o,l,f){g.edit.off(),N(g.language.translate("Loading image")),e&&(s=g.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){g.undo.canDo()||l.hasClass("fr-uploading")||g.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),g.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var i=e.get(0).attributes,r=0;r<i.length;r++){var n=i[r];0===n.nodeName.indexOf("data-")&&e.removeAttr(n.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",_),e.attr("src",s),g.edit.on(),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger(a?"image.replaced":"image.inserted",[e,f])}else e=Y(s,o,_),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger("image.inserted",[e,f])},t.onerror=function(){I(i)},O(g.language.translate("Loading image")),t.src=s}function M(e){N(g.language.translate("Loading image"));var t=this.status,a=this.response,i=this.responseXML,r=this.responseText;try{if(g.opts.imageUploadToS3)if(201==t){var n=function o(e){try{var t=c(e).find("Location").text(),a=c(e).find("Key").text();return!1===g.events.trigger("image.uploadedToS3",[t,a,e],!0)?(g.edit.on(),!1):t}catch(i){return I(h,e),!1}}(i);n&&L(n,!1,[],e,a||i)}else I(h,a||i,e);else if(200<=t&&t<300){var s=function l(e){try{if(!1===g.events.trigger("image.uploaded",[e],!0))return g.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(I(m,e),!1)}catch(a){return I(h,e),!1}}(r);s&&L(s.link,!1,s,e,a||r)}else I(u,a||r,e)}catch(f){I(h,a||r,e)}}function z(){I(h,this.response||this.responseText||this.responseXML)}function K(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;N(g.language.translate("Uploading"),t)}}function Y(e,t,a){var i,r=c(document.createElement("img")).attr("src",e);if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(" data-"+i+'="'+t[i]+'"',r.attr("data-str"+i,t[i]));var n=g.opts.imageDefaultWidth;n&&"auto"!=n&&(n=g.opts.imageResizeWithPercent?"100%":n+"px"),r.attr("style",n?"width: "+n+";":""),me(r,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),r.on("load",a),r.on("error",a),g.edit.on(),g.events.focus(!0),g.selection.restore(),g.undo.saveStep(),g.opts.imageSplitHTML?g.markers.split():g.markers.insert(),g.html.wrap();var s=g.$el.find(".fr-marker");return s.length?(s.parent().is("hr")&&s.parent().after(s),g.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(r)):g.$el.append(r),g.selection.clear(),r}function W(){g.edit.on(),k(!0)}function G(e,t){if(void 0!==e&&0<e.length){if(!1===g.events.trigger("image.beforeUpload",[e,t]))return!1;var a,i=e[0];if((null===g.opts.imageUploadURL||g.opts.imageUploadURL==s)&&!g.opts.imageUploadToS3)return function o(r,n){var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:r.type})),g.image.insert(e,!1,null,n)}},O(),s.readAsDataURL(r)}(i,t||d),!1;if(i.name||(i.name=(new Date).getTime()+"."+(i.type||"image/jpeg").replace(/image\//g,"")),i.size>g.opts.imageMaxSize)return I(v),!1;if(g.opts.imageAllowedTypes.indexOf(i.type.replace(/image\//g,""))<0)return I(b),!1;if(g.drag_support.formdata&&(a=g.drag_support.formdata?new FormData:null),a){var r;if(!1!==g.opts.imageUploadToS3)for(r in a.append("key",g.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",i.type),g.opts.imageUploadToS3.params)g.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadToS3.params[r]);for(r in g.opts.imageUploadParams)g.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadParams[r]);a.append(g.opts.imageUploadParam,i,i.name);var n=g.opts.imageUploadURL;g.opts.imageUploadToS3&&(n=g.opts.imageUploadToS3.uploadURL?g.opts.imageUploadToS3.uploadURL:"https://"+g.opts.imageUploadToS3.region+".amazonaws.com/"+g.opts.imageUploadToS3.bucket),function l(t,a,e,r){function n(){var e=c(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),g.placeholder.refresh(),T(e),S(),O(),g.edit.off(),t.onload=function(){M.call(t,e)},t.onerror=z,t.upload.onprogress=K,t.onabort=W,c(e.off("abortUpload")).on("abortUpload",function(){4!=t.readyState&&(t.abort(),r?(r.attr("src",r.data("fr-old-src")),r.removeClass("fr-uploading")):e.remove(),pe(!0))}),t.send(a)}var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.on("load",n),r.on("error",function(){n(),c(this).off("error")}),g.edit.on(),g.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):Y(e,null,n)},s.readAsDataURL(e)}(g.core.getXHR(n,g.opts.imageUploadMethod),a,i,t||d)}}}function V(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function H(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!g.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;g.markers.remove(),g.markers.insertAtPoint(e.originalEvent),g.$el.find(".fr-marker").replaceWith(_e.MARKERS),0===g.$el.find(".fr-marker").length&&g.selection.setAtEnd(g.el),g.popups.hideAll();var i=g.popups.get("image.insert");i||(i=X()),g.popups.setContainer("image.insert",g.$sc);var r=e.originalEvent.pageX,n=e.originalEvent.pageY;if(g.opts.iframe){var s=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-top")),o=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-left"));n+=g.$iframe.offset().top+s,r+=g.$iframe.offset().left+o}return g.popups.show("image.insert",r,n),O(),0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(pe(!0),G(t.files)):I(b),e.preventDefault(),e.stopPropagation(),!1}}}function X(e){if(e)return g.popups.onRefresh("image.insert",y),g.popups.onHide("image.insert",w),!0;var t,a,i="";g.opts.imageUpload||-1===g.opts.imageInsertButtons.indexOf("imageUpload")||g.opts.imageInsertButtons.splice(g.opts.imageInsertButtons.indexOf("imageUpload"),1);var r=g.button.buildList(g.opts.imageInsertButtons);""!==r&&(i='<div class="fr-buttons fr-tabs">'+r+"</div>");var n=g.opts.imageInsertButtons.indexOf("imageUpload"),s=g.opts.imageInsertButtons.indexOf("imageByURL"),o="";0<=n&&(t=" fr-active",0<=s&&s<n&&(t=""),o='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+g.id+'"><strong>'+g.language.translate("Drop image")+"</strong><br>("+g.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+g.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+g.id+'" role="button"></div></div>');var l="";0<=s&&(t=" fr-active",0<=n&&n<s&&(t=""),l='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+g.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+g.language.translate("Insert")+"</button></div></div>");var f={buttons:i,upload_layer:o,by_url_layer:l,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'};return 1<=g.opts.imageInsertButtons.length&&(a=g.popups.create("image.insert",f)),g.$wp&&g.events.$on(g.$wp,"scroll",function(){d&&g.popups.isVisible("image.insert")&&ve()}),function p(i){g.events.$on(i,"dragover dragenter",".fr-image-upload-layer",function(){return c(this).addClass("fr-drop"),!1},!0),g.events.$on(i,"dragleave dragend",".fr-image-upload-layer",function(){return c(this).removeClass("fr-drop"),!1},!0),g.events.$on(i,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),c(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=i.data("instance")||g;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),g.helpers.isIOS()&&g.events.$on(i,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){c(this).trigger("click")},!0),g.events.$on(i,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=i.data("instance")||g;e.events.disableBlur(),i.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,d)}c(this).val("")},!0)}(a),a}function F(){d&&g.popups.get("image.alt").find("input").val(d.attr("alt")||"").trigger("change")}function j(){var e=g.popups.get("image.alt");e||(e=q()),k(),g.popups.refresh("image.alt"),g.popups.setContainer("image.alt",g.$sc);var t=we();Ce()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.alt",a,i,t.outerHeight(),!0)}function q(e){if(e)return g.popups.onRefresh("image.alt",F),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+g.button.buildList(g.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+g.id+'" type="text" placeholder="'+g.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.alt",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-alt",function(){d&&g.popups.isVisible("image.alt")&&j()}),a}function Q(){var e=g.popups.get("image.size");if(d)if(Ce()){var t=d.parent();t.get(0).style.width||(t=d.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(d.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(d.get(0).style.height).trigger("change")}function J(){var e=g.popups.get("image.size");e||(e=Z()),k(),g.popups.refresh("image.size"),g.popups.setContainer("image.size",g.$sc);var t=we();Ce()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.size",a,i,t.outerHeight(),!0)}function Z(e){if(e)return g.popups.onRefresh("image.size",Q),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+g.button.buildList(g.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+g.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+g.id+'" type="text" name="width" placeholder="'+g.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+g.id+'" type="text" name="height" placeholder="'+g.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.size",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-size",function(){d&&g.popups.isVisible("image.size")&&J()}),a}function ee(e,t,a,i){return e.pageX=t,x.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,i)),$.call(this,e),U.call(this,e),++i}function te(e){(e=e||we())&&!1!==g.events.trigger("image.beforeRemove",[e])&&(g.popups.hideAll(),be(),pe(!0),g.undo.canDo()||g.undo.saveStep(),e.get(0)==g.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(g.selection.setBefore(e.get(0).parentNode)||g.selection.setAfter(e.get(0).parentNode)||e.parent().after(_e.MARKERS),c(e.get(0).parentNode).remove()):(g.selection.setBefore(e.get(0))||g.selection.setAfter(e.get(0))||e.after(_e.MARKERS),e.remove()),g.html.fillEmptyBlocks(),g.selection.restore()),g.undo.saveStep())}function ae(e){var t=e.which;if(d&&(t==_e.KEYCODE.BACKSPACE||t==_e.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),te(),!1;if(d&&t==_e.KEYCODE.ESC){var a=d;return pe(!0),g.selection.setAfter(a.get(0)),g.selection.restore(),e.preventDefault(),!1}if(!d||t!=_e.KEYCODE.ARROW_LEFT&&t!=_e.KEYCODE.ARROW_RIGHT)return d&&t===_e.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),pe(!0),!1):d&&t!=_e.KEYCODE.F10&&!g.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0;var i=d.get(0);return pe(!0),t==_e.KEYCODE.ARROW_LEFT?g.selection.setBefore(i):g.selection.setAfter(i),g.selection.restore(),e.preventDefault(),!1}function ie(e){if(e&&"IMG"==e.tagName){if(g.node.hasClass(e,"fr-uploading")||g.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):g.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&g.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var i=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<i.length;r++)ie(i[r])}function re(e){if(!1===g.events.trigger("image.beforePasteUpload",[e]))return!1;d=c(e),S(),n(),ve(),O(),d.on("load",function(){S(),c(g.popups.get("image.insert").get(0)).find("div.fr-active.fr-error").length<1&&O(),c(this).off("load")});for(var t=c(e).attr("src").split(","),a=atob(t[1]),i=[],r=0;r<a.length;r++)i.push(a.charCodeAt(r));G([new Blob([new Uint8Array(i)],{type:t[0].replace(/data\:/g,"").replace(/;base64/g,"")})],d)}function ne(){g.opts.imagePaste?g.$el.find("img[data-fr-image-pasted]").each(function(e,i){if(g.opts.imagePasteProcess){var t=g.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=g.opts.imageResizeWithPercent?"%":"px"),c(i).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),me(c(i),g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign)}if(0===i.src.indexOf("data:"))re(i);else if(0===i.src.indexOf("blob:")||0===i.src.indexOf("http")&&g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy){var a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var e,t=g.o_doc.createElement("CANVAS"),a=t.getContext("2d");t.height=this.naturalHeight,t.width=this.naturalWidth,a.drawImage(this,0,0),setTimeout(function(){re(i)},0),e=2e3<this.naturalWidth||1500<this.naturalHeight?"jpeg":"png",i.src=t.toDataURL("image/"+e)},a.src=(0===i.src.indexOf("blob:")?"":g.opts.imageCORSProxy+"/")+i.src}else 0!==i.src.indexOf("http")||0===i.src.indexOf("https://mail.google.com/mail")?(g.selection.save(),c(i).remove(),g.selection.restore()):c(i).removeAttr("data-fr-image-pasted")}):g.$el.find("img[data-fr-image-pasted]").remove()}function se(e){var t=e.target.result,a=g.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=g.opts.imageResizeWithPercent?"%":"px"),g.undo.saveStep(),g.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var i=g.$el.find('img[data-fr-image-pasted="true"]');i&&me(i,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),g.events.trigger("paste.after")}function oe(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.types&&-1!=[].indexOf.call(e.clipboardData.types,"text/rtf")||e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return function i(e){var t=new FileReader;t.onload=se,t.readAsDataURL(e)}(t),!1}}function le(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function fe(e){if("false"==c(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&g.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<_e.INSTANCES.length;t++)_e.INSTANCES[t]!=g&&_e.INSTANCES[t].events.trigger("image.hideResizer");g.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),g.helpers.isMobile()&&(g.events.disableBlur(),g.$el.blur(),g.events.enableBlur()),g.opts.iframe&&g.size.syncIframe(),d=c(this),be(),S(),n(),g.browser.msie?(g.popups.areVisible()&&g.events.disableBlur(),g.win.getSelection&&(g.win.getSelection().removeAllRanges(),g.win.getSelection().addRange(g.doc.createRange()))):g.selection.clear(),g.helpers.isIOS()&&(g.events.disableBlur(),g.$el.blur()),g.button.bulkRefresh(),g.events.trigger("video.hideResizer")}function pe(e){d&&(function t(){return ge}()||!0===e)&&(g.toolbar.enable(),l.removeClass("fr-active"),g.popups.hide("image.edit"),d=null,ce(),f=null,p&&p.hide())}r[i]="Image cannot be loaded from the passed link.",r[m]="No link in upload response.",r[u]="Error during file upload.",r[h]="Parsing response failed.",r[v]="File is too large.",r[b]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var ge=!(r[8]="Image file is corrupted.");function de(){ge=!0}function ce(){ge=!1}function me(e,t,a){!g.opts.htmlUntouched&&g.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:g.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*g.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:g.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function ue(e){if(void 0===e&&(e=we()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function he(e){void 0===e&&(e=we());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ve(){var e=g.popups.get("image.insert");e||(e=X()),g.popups.isVisible("image.insert")||(k(),g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$sc));var t=we();Ce()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.insert",a,i,t.outerHeight(!0),!0)}function be(){if(d){g.events.disableBlur(),g.selection.clear();var e=g.doc.createRange();e.selectNode(d.get(0)),g.browser.msie&&e.collapse(!0),g.selection.get().addRange(e),g.events.enableBlur()}}function ye(){return d}function we(){return Ce()?d.parents(".fr-img-caption").first():d}function Ce(){return!!d&&0<d.parents(".fr-img-caption").length}return{_init:function Ae(){var i;(function e(){g.events.$on(g.$el,g._mousedown,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==c(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;g.helpers.isMobile()||g.selection.clear(),t=!0,g.popups.areVisible()&&g.events.disableBlur(),g.browser.msie&&(g.events.disableBlur(),g.$el.attr("contenteditable",!1)),g.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),g.events.$on(g.$el,g._mousedown,".fr-img-caption .fr-inner",function(e){g.core.hasFocus()||g.events.focus(),e.stopPropagation()}),g.events.$on(g.$el,"paste",".fr-img-caption .fr-inner",function(e){g.toolbar.hide(),e.stopPropagation()}),g.events.$on(g.$el,g._mouseup,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==c(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),g.browser.msie&&(g.$el.attr("contenteditable",!0),g.events.enableBlur()))}),g.events.on("keyup",function(e){if(e.shiftKey&&""===g.selection.text().replace(/\n/g,"")&&g.keys.isArrow(e.which)){var t=g.selection.element(),a=g.selection.endElement();t&&"IMG"==t.tagName?T(c(t)):a&&"IMG"==a.tagName&&T(c(a))}},!0),g.events.on("drop",H),g.events.on("element.beforeDrop",V),g.events.on("mousedown window.mousedown",de),g.events.on("window.touchmove",ce),g.events.on("mouseup window.mouseup",function(){if(d)return pe(),!1;ce()}),g.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&pe()}),g.events.on("image.resizeEnd",function(){g.opts.iframe&&g.size.syncIframe()}),g.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){pe(!(t=!1))}),g.events.on("modals.hide",function(){d&&(be(),g.selection.clear())}),g.events.on("image.resizeEnd",function(){g.win.getSelection&&T(d)}),g.opts.imageAddNewLine&&g.events.on("image.inserted",function(e){var t=e.get(0);for(t.nextSibling&&"BR"===t.nextSibling.tagName&&(t=t.nextSibling);t&&!g.node.isElement(t);)t=g.node.isLastSibling(t)?t.parentNode:null;g.node.isElement(t)&&(g.opts.enter===_e.ENTER_BR?e.after("<br>"):c(g.node.blockParent(e.get(0))).after("<"+g.html.defaultTag()+"><br></"+g.html.defaultTag()+">"))})})(),"IMG"==g.el.tagName&&g.$el.addClass("fr-view"),g.events.$on(g.$el,g.helpers.isMobile()&&!g.helpers.isWindowsPhone()?"touchend":"click","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',fe),g.helpers.isMobile()&&(g.events.$on(g.$el,"touchstart","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),g.events.$on(g.$el,"touchmove",function(){a=!0})),g.$wp?(g.events.on("window.keydown keydown",ae,!0),g.events.on("keyup",function(e){if(d&&e.which==_e.KEYCODE.ENTER)return!1},!0),g.events.$on(g.$el,"keydown",function(){var e=g.selection.element();(e.nodeType===Node.TEXT_NODE||"BR"==e.tagName&&g.node.isLastSibling(e))&&(e=e.parentNode),g.node.hasClass(e,"fr-inner")||(g.node.hasClass(e,"fr-img-caption")||(e=c(e).parents(".fr-img-caption").get(0)),g.node.hasClass(e,"fr-img-caption")&&(c(e).after(_e.INVISIBLE_SPACE+_e.MARKERS),g.selection.restore()))})):g.events.$on(g.$win,"keydown",ae),g.events.on("toolbar.esc",function(){if(d){if(g.$wp)g.events.disableBlur(),g.events.focus();else{var e=d;pe(!0),g.selection.setAfter(e.get(0)),g.selection.restore()}return!1}},!0),g.events.on("toolbar.focusEditor",function(){if(d)return!1},!0),g.events.on("window.cut window.copy",function(e){if(d&&g.popups.isVisible("image.edit")&&!g.popups.get("image.edit").find(":focus").length){var t=we();Ce()?(t.before(_e.START_MARKER),t.after(_e.END_MARKER),g.selection.restore(),g.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(be(),g.paste.saveCopiedText(d.get(0).outerHTML,d.attr("alt"))),"copy"==e.type?setTimeout(function(){T(d)}):(pe(!0),g.undo.saveStep(),setTimeout(function(){g.undo.saveStep()},0))}},!0),g.browser.msie&&g.events.on("keydown",function(e){if(!g.selection.isCollapsed()||!d)return!0;var t=e.which;t==_e.KEYCODE.C&&g.keys.ctrlKey(e)?g.events.trigger("window.copy"):t==_e.KEYCODE.X&&g.keys.ctrlKey(e)&&g.events.trigger("window.cut")}),g.events.$on(c(g.o_win),"keydown",function(e){var t=e.which;if(d&&t==_e.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),g.events.$on(g.$win,"keydown",function(e){var t=e.which;d&&d.hasClass("fr-uploading")&&t==_e.KEYCODE.ESC&&d.trigger("abortUpload")}),g.events.on("destroy",function(){d&&d.hasClass("fr-uploading")&&d.trigger("abortUpload")}),g.events.on("paste.before",oe),g.events.on("paste.beforeCleanup",le),g.events.on("paste.after",ne),g.events.on("html.set",A),g.events.on("html.inserted",A),A(),g.events.on("destroy",function(){o=[]}),g.events.on("html.processGet",ie),g.opts.imageOutputSize&&g.events.on("html.beforeGet",function(){i=g.el.querySelectorAll("img");for(var e=0;e<i.length;e++){var t=i[e].style.width||c(i[e]).width(),a=i[e].style.height||c(i[e]).height();t&&i[e].setAttribute("width",(""+t).replace(/px/,"")),a&&i[e].setAttribute("height",(""+a).replace(/px/,""))}}),g.opts.iframe&&g.events.on("image.loaded",g.size.syncIframe),g.$wp&&(E(),g.events.on("contentChanged",E)),g.events.$on(c(g.o_win),"orientationchange.image",function(){setTimeout(function(){d&&T(d)},100)}),P(!0),X(!0),Z(!0),q(!0),g.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return te(e),!1})},showInsertPopup:function Ee(){var e=g.$tb.find('.fr-command[data-cmd="insertImage"]'),t=g.popups.get("image.insert");if(t||(t=X()),k(),!t.hasClass("fr-active"))if(g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$tb),e.isVisible()){var a=g.button.getPosition(e),i=a.left,r=a.top;g.popups.show("image.insert",i,r,e.outerHeight())}else g.position.forSelection(t),g.popups.show("image.insert")},showLayer:function Se(e){var t,a,i=g.popups.get("image.insert");if(d||g.opts.toolbarInline){if(d){var r=we();Ce()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left}}else{var n=g.$tb.find('.fr-command[data-cmd="insertImage"]');t=n.offset().left,a=n.offset().top+(g.opts.toolbarBottom?10:n.outerHeight()-10)}!d&&g.opts.toolbarInline&&(a=i.offset().top-g.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(a+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-"+e+"-layer").addClass("fr-active"),g.popups.show("image.insert",t,a,d?d.outerHeight():0),g.accessibility.focusPopup(i)},refreshUploadButton:function Re(e){var t=g.popups.get("image.insert");t&&t.find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function De(e){var t=g.popups.get("image.insert");t&&t.find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:G,insertByURL:function xe(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){O(),N(g.language.translate("Loading image"));var t=e.val().trim();if(g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy&&g.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?G([new Blob([this.response],{type:this.response.type||"image/png"})],d):I(i)},a.onerror=function(){L(t,!0,[],d)},a.open("GET",g.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else L(t,!0,[],d);e.val(""),e.blur()}},align:function $e(e){var t=we();t.removeClass("fr-fir fr-fil"),!g.opts.htmlUntouched&&g.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):me(t,he(),e),be(),S(),n(),g.selection.clear()},refreshAlign:function Ue(e){d&&e.find("> *").first().replaceWith(g.icon.create("image-align-"+ue()))},refreshAlignOnShow:function Ie(e,t){d&&t.find('.fr-command[data-param1="'+ue()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function Pe(e){var t=we();t.removeClass("fr-dii fr-dib"),!g.opts.htmlUntouched&&g.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):me(t,e,ue()),be(),S(),n(),g.selection.clear()},refreshDisplayOnShow:function Oe(e,t){d&&t.find('.fr-command[data-param1="'+he()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ve,back:function e(){d?(g.events.disableBlur(),c(".fr-popup input:focus").blur(),T(d)):(g.events.disableBlur(),g.selection.restore(),g.events.enableBlur(),g.popups.hide("image.insert"),g.toolbar.showInline())},get:ye,getEl:we,insert:L,showProgressBar:O,remove:te,hideProgressBar:k,applyStyle:function ke(e,t,a){if(void 0===t&&(t=g.opts.imageStyles),void 0===a&&(a=g.opts.imageMultipleStyles),!d)return!1;var i=we();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),i.removeClass(r.join(" "))}"object"==Le(t[e])?(i.removeAttr("style"),i.css(t[e].style)):i.toggleClass(e),T(d)},showAltPopup:j,showSizePopup:J,setAlt:function Ne(e){if(d){var t=g.popups.get("image.alt");d.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),T(d)}},setSize:function Be(e,t){if(d){var a=g.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var i=/^[\d]+((px)|%)*$/g;d.removeAttr("width").removeAttr("height"),e.match(i)?d.css("width",e):d.css("width",""),t.match(i)?d.css("height",t):d.css("height",""),Ce()&&(d.parents(".fr-img-caption").removeAttr("width").removeAttr("height"),e.match(i)?d.parents(".fr-img-caption").css("width",e):d.parents(".fr-img-caption").css("width",""),t.match(i)?d.parents(".fr-img-caption").css("height",t):d.parents(".fr-img-caption").css("height","")),a&&a.find("input:focus").blur(),T(d)}},toggleCaption:function Te(){var e;if(d&&!Ce()){var t,a;(e=d).parent().is("a")&&(e=d.parent()),e.attr("style")&&(a=-1<(t=e.attr("style").split(":")).indexOf("width")?t[t.indexOf("width")+1].replace(";",""):"");var i=g.opts.imageResizeWithPercent?(-1<a.indexOf("px")?null:a)||"100%":d.width()+"px";e.wrap("<span "+(g.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+d.attr("class")+'" style="'+(g.opts.useClasses?"":e.attr("style"))+'" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),d.after('<span class="fr-inner"'+(g.browser.mozilla?"":' contenteditable="true"')+">"+_e.START_MARKER+g.language.translate("Image Caption")+_e.END_MARKER+"</span>"),d.removeAttr("class").removeAttr("style").removeAttr("width"),d.parents(".fr-img-caption").css("width",i),pe(!0),g.selection.restore()}else e=we(),d.insertAfter(e),d.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),T(d)},hasCaption:Ce,exitEdit:pe,edit:T}},_e.DefineIcon("insertImage",{NAME:"image",SVG_KEY:"insertImage"}),_e.RegisterShortcut(_e.KEYCODE.P,"insertImage",null,"P"),_e.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),_e.DefineIcon("imageUpload",{NAME:"upload",SVG_KEY:"upload"}),_e.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),_e.DefineIcon("imageByURL",{NAME:"link",SVG_KEY:"insertLink"}),_e.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),_e.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),_e.DefineIcon("imageDisplay",{NAME:"star",SVG_KEY:"imageDisplay"}),_e.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),_e.DefineIcon("image-align",{NAME:"align-left",SVG_KEY:"alignLeft"}),_e.DefineIcon("image-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),_e.DefineIcon("image-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),_e.DefineIcon("image-align-center",{NAME:"align-justify",SVG_KEY:"alignCenter"}),_e.DefineIcon("imageAlign",{NAME:"align-justify",SVG_KEY:"alignJustify"}),_e.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=_e.COMMANDS.imageAlign.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="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),_e.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),_e.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),_e.DefineIcon("imageRemove",{NAME:"trash",SVG_KEY:"remove"}),_e.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),_e.DefineIcon("imageBack",{NAME:"arrow-left",SVG_KEY:"back"}),_e.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.$;this.image.get()||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"))}}),_e.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),_e.DefineIcon("imageStyle",{NAME:"magic",SVG_KEY:"imageClass"}),_e.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];"object"==Le(i)&&(i=i.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(i)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.$,i=this.image.getEl();i&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=i.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),_e.DefineIcon("imageAlt",{NAME:"info",SVG_KEY:"imageAltText"}),_e.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),_e.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),_e.DefineIcon("imageSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),_e.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),_e.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),_e.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt",SVG_KEY:"imageCaption"}),_e.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}})});
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";function Le(e){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}_e=_e&&_e.hasOwnProperty("default")?_e["default"]:_e,Object.assign(_e.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(_e.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","webp"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),_e.PLUGINS.image=function(g){var d,l,f,p,o,a,c=g.$,s="https://i.froala.com/upload",t=!1,i=1,m=2,u=3,h=4,v=5,b=6,r={};function y(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),d&&e.val(d.attr("src")),e.trigger("change")}function n(){var e=g.popups.get("image.edit");if(e||(e=P()),e){var t=we();Ce()&&(t=t.find(".fr-img-wrap")),g.popups.setContainer("image.edit",g.$sc),g.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();d.hasClass("fr-uploading")?O():g.popups.show("image.edit",a,i,t.outerHeight(),!0)}}function w(){k()}function C(e){0<e.parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first());var t=e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,a=e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":ue(e);me(e,t,a),e.removeClass("fr-dib fr-dii fr-fir fr-fil")}function A(){for(var e,t="IMG"==g.el.tagName?[g.el]:g.el.querySelectorAll("img"),a=0;a<t.length;a++){var i=c(t[a]);!g.opts.htmlUntouched&&g.opts.useClasses?((g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&(0<(e=i).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption").first()),e.hasClass("fr-dii")||e.hasClass("fr-dib")||(e.addClass("fr-fi"+ue(e)[0]),e.addClass("fr-di"+he(e)[0]),e.css("margin",""),e.css("float",""),e.css("display",""),e.css("z-index",""),e.css("position",""),e.css("overflow",""),e.css("vertical-align",""))),g.opts.imageTextNear||(0<i.parents(".fr-img-caption").length?i.parents(".fr-img-caption").first().removeClass("fr-dii").addClass("fr-dib"):i.removeClass("fr-dii").addClass("fr-dib"))):g.opts.htmlUntouched||g.opts.useClasses||(g.opts.imageDefaultAlign||g.opts.imageDefaultDisplay)&&C(i),g.opts.iframe&&i.on("load",g.size.syncIframe)}}function E(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(g.el.querySelectorAll("img")),i=[];for(t=0;t<a.length;t++)if(i.push(a[t].getAttribute("src")),c(a[t]).toggleClass("fr-draggable",g.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&g.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;g.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var n=a[t].nextSibling;n&&!g.browser.mozilla&&n.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)i.indexOf(o[t].getAttribute("src"))<0&&g.events.trigger("image.removed",[c(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&g.events.trigger("image.loaded",[c(a[t])])}o=a}function S(){if(l||function s(){var e;g.shared.$image_resizer?(l=g.shared.$image_resizer,p=g.shared.$img_overlay,g.events.on("destroy",function(){c("body").first().append(l.removeClass("fr-active"))},!0)):(g.shared.$image_resizer=c(document.createElement("div")).attr("class","fr-image-resizer"),l=g.shared.$image_resizer,g.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),g.opts.imageResize&&(l.append(R("nw")+R("ne")+R("sw")+R("se")),g.shared.$img_overlay=c(document.createElement("div")).attr("class","fr-image-overlay"),p=g.shared.$img_overlay,e=l.get(0).ownerDocument,c(e).find("body").first().append(p)));g.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,g.opts.imageResize&&(p.remove(),p=null)},!0),g.helpers.isMobile()||g.events.$on(c(g.o_win),"resize",function(){d&&!d.hasClass("fr-uploading")?pe(!0):d&&(S(),ve(),O(!1))});if(g.opts.imageResize){e=l.get(0).ownerDocument,g.events.$on(l,g._mousedown,".fr-handler",x),g.events.$on(c(e),g._mousemove,$),g.events.$on(c(e.defaultView||e.parentWindow),g._mouseup,U),g.events.$on(p,"mouseleave",U);var i=1,r=null,n=0;g.events.on("keydown",function(e){if(d){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-n)&&(i=1),(a==_e.KEYCODE.EQUALS||g.browser.mozilla&&a==_e.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=ee.call(this,e,1,1,i):(a==_e.KEYCODE.HYPHEN||g.browser.mozilla&&a==_e.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?i=ee.call(this,e,2,-1,i):g.keys.ctrlKey(e)||a!=_e.KEYCODE.ENTER||(d.before("<br>"),T(d)),r=a,n=e.timeStamp}},!0),g.events.on("keyup",function(){i=1})}}(),!d)return!1;var e=g.$wp||g.$sc;e.append(l),l.data("instance",g);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=g.helpers.getPX(e.css("border-left-width")),t-=g.helpers.getPX(e.css("border-top-width")),g.$el.is("img")&&g.$sc.is("body")&&(a=t=0);var i=we();Ce()&&(i=i.find(".fr-img-wrap"));var r=0,n=0;g.opts.iframe&&(r=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-top")),n=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-left"))),l.css("top",(g.opts.iframe?i.offset().top+r:i.offset().top+t)-1).css("left",(g.opts.iframe?i.offset().left+n:i.offset().left+a)-1).css("width",i.get(0).getBoundingClientRect().width).css("height",i.get(0).getBoundingClientRect().height).addClass("fr-active")}function R(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function D(e){Ce()?d.parents(".fr-img-caption").css("width",e):d.css("width",e)}function x(e){if(!g.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;g.undo.canDo()||g.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=g.$oel.get(0).ownerDocument,i=a.defaultView||a.parentWindow,r=!1;try{r=i.location!=i.parent.location&&!(i.$&&i.$.FE)}catch(o){}r&&i.frameElement&&(t+=g.helpers.getPX(c(i.frameElement).offset().left)+i.frameElement.clientLeft)}(f=c(this)).data("start-x",t),f.data("start-width",d.width()),f.data("start-height",d.height());var n=d.width();if(g.opts.imageResizeWithPercent){var s=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;n=(n/c(s).outerWidth()*100).toFixed(2)+"%"}D(n),p.show(),g.popups.hideAll(),ce()}function $(e){if(!g.core.sameInstance(l))return!0;var t;if(f&&d){if(e.preventDefault(),g.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var i=a-f.data("start-x"),r=f.data("start-width");if((f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(i=0-i),g.opts.imageResizeWithPercent){var n=d.parentsUntil(g.$el,g.html.blockTagsQuery()).get(0)||g.el;r=((r+i)/c(n).outerWidth()*100).toFixed(2),g.opts.imageRoundPercent&&(r=Math.round(r)),D(r+"%"),(t=Ce()?(g.helpers.getPX(d.parents(".fr-img-caption").css("width"))/c(n).outerWidth()*100).toFixed(2):(g.helpers.getPX(d.css("width"))/c(n).outerWidth()*100).toFixed(2))===r||g.opts.imageRoundPercent||D(t+"%"),d.css("height","").removeAttr("height")}else r+i>=g.opts.imageMinWidth&&(D(r+i),t=Ce()?g.helpers.getPX(d.parents(".fr-img-caption").css("width")):g.helpers.getPX(d.css("width"))),t!==r+i&&D(t),((d.attr("style")||"").match(/(^height:)|(; *height:)/)||d.attr("height"))&&(d.css("height",f.data("start-height")*d.width()/f.data("start-width")),d.removeAttr("height"));S(),g.events.trigger("image.resize",[ye()])}}function U(e){if(!g.core.sameInstance(l))return!0;if(f&&d){if(e&&e.stopPropagation(),g.$el.find("img.fr-error").left)return!1;f=null,p.hide(),S(),n(),g.undo.saveStep(),g.events.trigger("image.resizeEnd",[ye()])}}function I(e,t,a){g.edit.on(),d&&d.addClass("fr-error"),r[e]?B(r[e]):B(g.language.translate("Something went wrong. Please try again.")),!d&&a&&te(a),g.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function P(e){if(e)return g.$wp&&g.events.$on(g.$wp,"scroll.image-edit",function(){d&&g.popups.isVisible("image.edit")&&(g.events.disableBlur(),n())}),!0;var t="";if(0<g.opts.imageEditButtons.length){var a={buttons:t+='<div class="fr-buttons"> \n '.concat(g.button.buildList(g.opts.imageEditButtons),"\n </div>")};return g.popups.create("image.edit",a)}return!1}function O(e){var t=g.popups.get("image.insert");if(t||(t=X()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),d){var a=we();g.popups.setContainer("image.insert",g.$sc);var i=a.offset().left,r=a.offset().top+a.height();g.popups.show("image.insert",i,r,a.outerHeight())}void 0===e&&N(g.language.translate("Uploading"),0)}function k(e){var t=g.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||g.$el.find("img.fr-error").length)){if(g.events.focus(),g.$el.find("img.fr-error").length&&(g.$el.find("img.fr-error").remove(),g.undo.saveStep(),g.undo.run(),g.undo.dropRedo()),!g.$wp&&d){var a=d;pe(!0),g.selection.setAfter(a.get(0)),g.selection.restore()}g.popups.hide("image.insert")}}function N(e,t){var a=g.popups.get("image.insert");if(a){var i=a.find(".fr-image-progress-bar-layer");i.find("h3").text(e+(t?" "+t+"%":"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width",t+"%")):i.find("div").addClass("fr-indeterminate")}}function B(e){O();var t=g.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),g.events.disableBlur(),a.focus()}function T(e){fe.call(e.get(0))}function _(){var e=c(this);g.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),T(e),g.events.trigger("image.loaded",[e])}function L(s,e,o,l,f){g.edit.off(),N(g.language.translate("Loading image")),e&&(s=g.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){g.undo.canDo()||l.hasClass("fr-uploading")||g.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),g.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var i=e.get(0).attributes,r=0;r<i.length;r++){var n=i[r];0===n.nodeName.indexOf("data-")&&e.removeAttr(n.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",_),e.attr("src",s),g.edit.on(),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger(a?"image.replaced":"image.inserted",[e,f])}else e=Y(s,o,_),E(!1),g.undo.saveStep(),g.events.disableBlur(),g.$el.blur(),g.events.trigger("image.inserted",[e,f])},t.onerror=function(){I(i)},O(g.language.translate("Loading image")),t.src=s}function M(e){N(g.language.translate("Loading image"));var t=this.status,a=this.response,i=this.responseXML,r=this.responseText;try{if(g.opts.imageUploadToS3)if(201==t){var n=function o(e){try{var t=c(e).find("Location").text(),a=c(e).find("Key").text();return!1===g.events.trigger("image.uploadedToS3",[t,a,e],!0)?(g.edit.on(),!1):t}catch(i){return I(h,e),!1}}(i);n&&L(n,!1,[],e,a||i)}else I(h,a||i,e);else if(200<=t&&t<300){var s=function l(e){try{if(!1===g.events.trigger("image.uploaded",[e],!0))return g.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(I(m,e),!1)}catch(a){return I(h,e),!1}}(r);s&&L(s.link,!1,s,e,a||r)}else I(u,a||r,e)}catch(f){I(h,a||r,e)}}function z(){I(h,this.response||this.responseText||this.responseXML)}function K(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;N(g.language.translate("Uploading"),t)}}function Y(e,t,a){var i,r=c(document.createElement("img")).attr("src",e);if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(" data-"+i+'="'+t[i]+'"',r.attr("data-str"+i,t[i]));var n=g.opts.imageDefaultWidth;n&&"auto"!=n&&(n=g.opts.imageResizeWithPercent?"100%":n+"px"),r.attr("style",n?"width: "+n+";":""),me(r,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),r.on("load",a),r.on("error",a),g.edit.on(),g.events.focus(!0),g.selection.restore(),g.undo.saveStep(),g.opts.imageSplitHTML?g.markers.split():g.markers.insert(),g.html.wrap();var s=g.$el.find(".fr-marker");return s.length?(s.parent().is("hr")&&s.parent().after(s),g.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(r)):g.$el.append(r),g.selection.clear(),r}function W(){g.edit.on(),k(!0)}function G(e,t){if(void 0!==e&&0<e.length){if(!1===g.events.trigger("image.beforeUpload",[e,t]))return!1;var a,i=e[0];if((null===g.opts.imageUploadURL||g.opts.imageUploadURL==s)&&!g.opts.imageUploadToS3)return function o(r,n){var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:r.type})),g.image.insert(e,!1,null,n)}},O(),s.readAsDataURL(r)}(i,t||d),!1;if(i.name||(i.name=(new Date).getTime()+"."+(i.type||"image/jpeg").replace(/image\//g,"")),i.size>g.opts.imageMaxSize)return I(v),!1;if(g.opts.imageAllowedTypes.indexOf(i.type.replace(/image\//g,""))<0)return I(b),!1;if(g.drag_support.formdata&&(a=g.drag_support.formdata?new FormData:null),a){var r;if(!1!==g.opts.imageUploadToS3)for(r in a.append("key",g.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",i.type),g.opts.imageUploadToS3.params)g.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadToS3.params[r]);for(r in g.opts.imageUploadParams)g.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,g.opts.imageUploadParams[r]);a.append(g.opts.imageUploadParam,i,i.name);var n=g.opts.imageUploadURL;g.opts.imageUploadToS3&&(n=g.opts.imageUploadToS3.uploadURL?g.opts.imageUploadToS3.uploadURL:"https://"+g.opts.imageUploadToS3.region+".amazonaws.com/"+g.opts.imageUploadToS3.bucket),function l(t,a,e,r){function n(){var e=c(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),g.placeholder.refresh(),T(e),S(),O(),g.edit.off(),t.onload=function(){M.call(t,e)},t.onerror=z,t.upload.onprogress=K,t.onabort=W,c(e.off("abortUpload")).on("abortUpload",function(){4!=t.readyState&&(t.abort(),r?(r.attr("src",r.data("fr-old-src")),r.removeClass("fr-uploading")):e.remove(),pe(!0))}),t.send(a)}var s=new FileReader;s.onload=function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.get(0).addEventListener("load",n),r.on("error",function(){n(),c(this).off("error")}),g.edit.on(),g.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):Y(e,null,n)},s.readAsDataURL(e)}(g.core.getXHR(n,g.opts.imageUploadMethod),a,i,t||d)}}}function V(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function H(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!g.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;g.markers.remove(),g.markers.insertAtPoint(e.originalEvent),g.$el.find(".fr-marker").replaceWith(_e.MARKERS),0===g.$el.find(".fr-marker").length&&g.selection.setAtEnd(g.el),g.popups.hideAll();var i=g.popups.get("image.insert");i||(i=X()),g.popups.setContainer("image.insert",g.$sc);var r=e.originalEvent.pageX,n=e.originalEvent.pageY;if(g.opts.iframe){var s=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-top")),o=g.helpers.getPX(g.$wp.find(".fr-iframe").css("padding-left"));n+=g.$iframe.offset().top+s,r+=g.$iframe.offset().left+o}return g.popups.show("image.insert",r,n),O(),0<=g.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(pe(!0),G(t.files)):I(b),e.preventDefault(),e.stopPropagation(),!1}}}function X(e){if(e)return g.popups.onRefresh("image.insert",y),g.popups.onHide("image.insert",w),!0;var t,a,i="";g.opts.imageUpload||-1===g.opts.imageInsertButtons.indexOf("imageUpload")||g.opts.imageInsertButtons.splice(g.opts.imageInsertButtons.indexOf("imageUpload"),1);var r=g.button.buildList(g.opts.imageInsertButtons);""!==r&&(i='<div class="fr-buttons fr-tabs">'+r+"</div>");var n=g.opts.imageInsertButtons.indexOf("imageUpload"),s=g.opts.imageInsertButtons.indexOf("imageByURL"),o="";0<=n&&(t=" fr-active",0<=s&&s<n&&(t=""),o='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+g.id+'"><strong>'+g.language.translate("Drop image")+"</strong><br>("+g.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+g.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+g.id+'" role="button"></div></div>');var l="";0<=s&&(t=" fr-active",0<=n&&n<s&&(t=""),l='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+g.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+g.language.translate("Insert")+"</button></div></div>");var f={buttons:i,upload_layer:o,by_url_layer:l,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'};return 1<=g.opts.imageInsertButtons.length&&(a=g.popups.create("image.insert",f)),g.$wp&&g.events.$on(g.$wp,"scroll",function(){d&&g.popups.isVisible("image.insert")&&ve()}),function p(i){g.events.$on(i,"dragover dragenter",".fr-image-upload-layer",function(){return c(this).addClass("fr-drop"),!1},!0),g.events.$on(i,"dragleave dragend",".fr-image-upload-layer",function(){return c(this).removeClass("fr-drop"),!1},!0),g.events.$on(i,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),c(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=i.data("instance")||g;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),g.helpers.isIOS()&&g.events.$on(i,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){c(this).trigger("click")},!0),g.events.$on(i,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=i.data("instance")||g;e.events.disableBlur(),i.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,d)}c(this).val("")},!0)}(a),a}function F(){d&&g.popups.get("image.alt").find("input").val(d.attr("alt")||"").trigger("change")}function j(){var e=g.popups.get("image.alt");e||(e=q()),k(),g.popups.refresh("image.alt"),g.popups.setContainer("image.alt",g.$sc);var t=we();Ce()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.alt",a,i,t.outerHeight(),!0)}function q(e){if(e)return g.popups.onRefresh("image.alt",F),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+g.button.buildList(g.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+g.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+g.id+'" type="text" placeholder="'+g.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.alt",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-alt",function(){d&&g.popups.isVisible("image.alt")&&j()}),a}function Q(){var e=g.popups.get("image.size");if(d)if(Ce()){var t=d.parent();t.get(0).style.width||(t=d.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(d.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(d.get(0).style.height).trigger("change")}function J(){var e=g.popups.get("image.size");e||(e=Z()),k(),g.popups.refresh("image.size"),g.popups.setContainer("image.size",g.$sc);var t=we();Ce()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.size",a,i,t.outerHeight(),!0)}function Z(e){if(e)return g.popups.onRefresh("image.size",Q),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'+g.button.buildList(g.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+g.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+g.id+'" type="text" name="width" placeholder="'+g.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+g.id+'" type="text" name="height" placeholder="'+g.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+g.language.translate("Update")+"</button></div></div>"},a=g.popups.create("image.size",t);return g.$wp&&g.events.$on(g.$wp,"scroll.image-size",function(){d&&g.popups.isVisible("image.size")&&J()}),a}function ee(e,t,a,i){return e.pageX=t,x.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,i)),$.call(this,e),U.call(this,e),++i}function te(e){(e=e||we())&&!1!==g.events.trigger("image.beforeRemove",[e])&&(g.popups.hideAll(),be(),pe(!0),g.undo.canDo()||g.undo.saveStep(),e.get(0)==g.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(g.selection.setBefore(e.get(0).parentNode)||g.selection.setAfter(e.get(0).parentNode)||e.parent().after(_e.MARKERS),c(e.get(0).parentNode).remove()):(g.selection.setBefore(e.get(0))||g.selection.setAfter(e.get(0))||e.after(_e.MARKERS),e.remove()),g.html.fillEmptyBlocks(),g.selection.restore()),g.undo.saveStep())}function ae(e){var t=e.which;if(d&&(t==_e.KEYCODE.BACKSPACE||t==_e.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),te(),!1;if(d&&t==_e.KEYCODE.ESC){var a=d;return pe(!0),g.selection.setAfter(a.get(0)),g.selection.restore(),e.preventDefault(),!1}if(!d||t!=_e.KEYCODE.ARROW_LEFT&&t!=_e.KEYCODE.ARROW_RIGHT)return d&&t===_e.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),pe(!0),!1):d&&t!=_e.KEYCODE.F10&&!g.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0;var i=d.get(0);return pe(!0),t==_e.KEYCODE.ARROW_LEFT?g.selection.setBefore(i):g.selection.setAfter(i),g.selection.restore(),e.preventDefault(),!1}function ie(e){if(e&&"IMG"==e.tagName){if(g.node.hasClass(e,"fr-uploading")||g.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):g.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&g.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var i=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<i.length;r++)ie(i[r])}function re(e){if(!1===g.events.trigger("image.beforePasteUpload",[e]))return!1;d=c(e),S(),n(),ve(),O(),d.on("load",function(){S(),c(g.popups.get("image.insert").get(0)).find("div.fr-active.fr-error").length<1&&O(),c(this).off("load")});for(var t=c(e).attr("src").split(","),a=atob(t[1]),i=[],r=0;r<a.length;r++)i.push(a.charCodeAt(r));G([new Blob([new Uint8Array(i)],{type:t[0].replace(/data\:/g,"").replace(/;base64/g,"")})],d)}function ne(){g.opts.imagePaste?g.$el.find("img[data-fr-image-pasted]").each(function(e,i){if(g.opts.imagePasteProcess){var t=g.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=g.opts.imageResizeWithPercent?"%":"px"),c(i).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),me(c(i),g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign)}if(0===i.src.indexOf("data:"))re(i);else if(0===i.src.indexOf("blob:")||0===i.src.indexOf("http")&&g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy){var a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var e,t=g.o_doc.createElement("CANVAS"),a=t.getContext("2d");t.height=this.naturalHeight,t.width=this.naturalWidth,a.drawImage(this,0,0),setTimeout(function(){re(i)},0),e=2e3<this.naturalWidth||1500<this.naturalHeight?"jpeg":"png",i.src=t.toDataURL("image/"+e)},a.src=(0===i.src.indexOf("blob:")?"":g.opts.imageCORSProxy+"/")+i.src}else 0!==i.src.indexOf("http")||0===i.src.indexOf("https://mail.google.com/mail")?(g.selection.save(),c(i).remove(),g.selection.restore()):c(i).removeAttr("data-fr-image-pasted")}):g.$el.find("img[data-fr-image-pasted]").remove()}function se(e){var t=e.target.result,a=g.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=g.opts.imageResizeWithPercent?"%":"px"),g.undo.saveStep(),g.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var i=g.$el.find('img[data-fr-image-pasted="true"]');i&&me(i,g.opts.imageDefaultDisplay,g.opts.imageDefaultAlign),g.events.trigger("paste.after")}function oe(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.types&&-1!=[].indexOf.call(e.clipboardData.types,"text/rtf")||e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return function i(e){var t=new FileReader;t.onload=se,t.readAsDataURL(e)}(t),!1}}function le(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function fe(e){if("false"==c(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&g.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<_e.INSTANCES.length;t++)_e.INSTANCES[t]!=g&&_e.INSTANCES[t].events.trigger("image.hideResizer");g.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),g.helpers.isMobile()&&(g.events.disableBlur(),g.$el.blur(),g.events.enableBlur()),g.opts.iframe&&g.size.syncIframe(),d=c(this),be(),S(),n(),g.browser.msie?(g.popups.areVisible()&&g.events.disableBlur(),g.win.getSelection&&(g.win.getSelection().removeAllRanges(),g.win.getSelection().addRange(g.doc.createRange()))):g.selection.clear(),g.helpers.isIOS()&&(g.events.disableBlur(),g.$el.blur()),g.button.bulkRefresh(),g.events.trigger("video.hideResizer")}function pe(e){d&&(function t(){return ge}()||!0===e)&&(g.toolbar.enable(),l.removeClass("fr-active"),g.popups.hide("image.edit"),d=null,ce(),f=null,p&&p.hide())}r[i]="Image cannot be loaded from the passed link.",r[m]="No link in upload response.",r[u]="Error during file upload.",r[h]="Parsing response failed.",r[v]="File is too large.",r[b]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var ge=!(r[8]="Image file is corrupted.");function de(){ge=!0}function ce(){ge=!1}function me(e,t,a){!g.opts.htmlUntouched&&g.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:g.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*g.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+g.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:g.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function ue(e){if(void 0===e&&(e=we()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function he(e){void 0===e&&(e=we());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ve(){var e=g.popups.get("image.insert");e||(e=X()),g.popups.isVisible("image.insert")||(k(),g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$sc));var t=we();Ce()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();g.popups.show("image.insert",a,i,t.outerHeight(!0),!0)}function be(){if(d){g.events.disableBlur(),g.selection.clear();var e=g.doc.createRange();e.selectNode(d.get(0)),g.browser.msie&&e.collapse(!0),g.selection.get().addRange(e),g.events.enableBlur()}}function ye(){return d}function we(){return Ce()?d.parents(".fr-img-caption").first():d}function Ce(){return!!d&&0<d.parents(".fr-img-caption").length}return{_init:function Ae(){var i;(function e(){g.events.$on(g.$el,g._mousedown,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==c(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;g.helpers.isMobile()||g.selection.clear(),t=!0,g.popups.areVisible()&&g.events.disableBlur(),g.browser.msie&&(g.events.disableBlur(),g.$el.attr("contenteditable",!1)),g.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),g.events.$on(g.$el,g._mousedown,".fr-img-caption .fr-inner",function(e){g.core.hasFocus()||g.events.focus(),e.stopPropagation()}),g.events.$on(g.$el,"paste",".fr-img-caption .fr-inner",function(e){g.toolbar.hide(),e.stopPropagation()}),g.events.$on(g.$el,g._mouseup,"IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==c(this).parents("contenteditable").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),g.browser.msie&&(g.$el.attr("contenteditable",!0),g.events.enableBlur()))}),g.events.on("keyup",function(e){if(e.shiftKey&&""===g.selection.text().replace(/\n/g,"")&&g.keys.isArrow(e.which)){var t=g.selection.element(),a=g.selection.endElement();t&&"IMG"==t.tagName?T(c(t)):a&&"IMG"==a.tagName&&T(c(a))}},!0),g.events.on("drop",H),g.events.on("element.beforeDrop",V),g.events.on("mousedown window.mousedown",de),g.events.on("window.touchmove",ce),g.events.on("mouseup window.mouseup",function(){if(d)return pe(),!1;ce()}),g.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&pe()}),g.events.on("image.resizeEnd",function(){g.opts.iframe&&g.size.syncIframe()}),g.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){pe(!(t=!1))}),g.events.on("modals.hide",function(){d&&(be(),g.selection.clear())}),g.events.on("image.resizeEnd",function(){g.win.getSelection&&T(d)}),g.opts.imageAddNewLine&&g.events.on("image.inserted",function(e){var t=e.get(0);for(t.nextSibling&&"BR"===t.nextSibling.tagName&&(t=t.nextSibling);t&&!g.node.isElement(t);)t=g.node.isLastSibling(t)?t.parentNode:null;g.node.isElement(t)&&(g.opts.enter===_e.ENTER_BR?e.after("<br>"):c(g.node.blockParent(e.get(0))).after("<"+g.html.defaultTag()+"><br></"+g.html.defaultTag()+">"))})})(),"IMG"==g.el.tagName&&g.$el.addClass("fr-view"),g.events.$on(g.$el,g.helpers.isMobile()&&!g.helpers.isWindowsPhone()?"touchend":"click","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',fe),g.helpers.isMobile()&&(g.events.$on(g.$el,"touchstart","IMG"==g.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),g.events.$on(g.$el,"touchmove",function(){a=!0})),g.$wp?(g.events.on("window.keydown keydown",ae,!0),g.events.on("keyup",function(e){if(d&&e.which==_e.KEYCODE.ENTER)return!1},!0),g.events.$on(g.$el,"keydown",function(){var e=g.selection.element();(e.nodeType===Node.TEXT_NODE||"BR"==e.tagName&&g.node.isLastSibling(e))&&(e=e.parentNode),g.node.hasClass(e,"fr-inner")||(g.node.hasClass(e,"fr-img-caption")||(e=c(e).parents(".fr-img-caption").get(0)),g.node.hasClass(e,"fr-img-caption")&&(c(e).after(_e.INVISIBLE_SPACE+_e.MARKERS),g.selection.restore()))})):g.events.$on(g.$win,"keydown",ae),g.events.on("toolbar.esc",function(){if(d){if(g.$wp)g.events.disableBlur(),g.events.focus();else{var e=d;pe(!0),g.selection.setAfter(e.get(0)),g.selection.restore()}return!1}},!0),g.events.on("toolbar.focusEditor",function(){if(d)return!1},!0),g.events.on("window.cut window.copy",function(e){if(d&&g.popups.isVisible("image.edit")&&!g.popups.get("image.edit").find(":focus").length){var t=we();Ce()?(t.before(_e.START_MARKER),t.after(_e.END_MARKER),g.selection.restore(),g.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(be(),g.paste.saveCopiedText(d.get(0).outerHTML,d.attr("alt"))),"copy"==e.type?setTimeout(function(){T(d)}):(pe(!0),g.undo.saveStep(),setTimeout(function(){g.undo.saveStep()},0))}},!0),g.browser.msie&&g.events.on("keydown",function(e){if(!g.selection.isCollapsed()||!d)return!0;var t=e.which;t==_e.KEYCODE.C&&g.keys.ctrlKey(e)?g.events.trigger("window.copy"):t==_e.KEYCODE.X&&g.keys.ctrlKey(e)&&g.events.trigger("window.cut")}),g.events.$on(c(g.o_win),"keydown",function(e){var t=e.which;if(d&&t==_e.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),g.events.$on(g.$win,"keydown",function(e){var t=e.which;d&&d.hasClass("fr-uploading")&&t==_e.KEYCODE.ESC&&d.trigger("abortUpload")}),g.events.on("destroy",function(){d&&d.hasClass("fr-uploading")&&d.trigger("abortUpload")}),g.events.on("paste.before",oe),g.events.on("paste.beforeCleanup",le),g.events.on("paste.after",ne),g.events.on("html.set",A),g.events.on("html.inserted",A),A(),g.events.on("destroy",function(){o=[]}),g.events.on("html.processGet",ie),g.opts.imageOutputSize&&g.events.on("html.beforeGet",function(){i=g.el.querySelectorAll("img");for(var e=0;e<i.length;e++){var t=i[e].style.width||c(i[e]).width(),a=i[e].style.height||c(i[e]).height();t&&i[e].setAttribute("width",(""+t).replace(/px/,"")),a&&i[e].setAttribute("height",(""+a).replace(/px/,""))}}),g.opts.iframe&&g.events.on("image.loaded",g.size.syncIframe),g.$wp&&(E(),g.events.on("contentChanged",E)),g.events.$on(c(g.o_win),"orientationchange.image",function(){setTimeout(function(){d&&T(d)},100)}),P(!0),X(!0),Z(!0),q(!0),g.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return te(e),!1})},showInsertPopup:function Ee(){var e=g.$tb.find('.fr-command[data-cmd="insertImage"]'),t=g.popups.get("image.insert");if(t||(t=X()),k(),!t.hasClass("fr-active"))if(g.popups.refresh("image.insert"),g.popups.setContainer("image.insert",g.$tb),e.isVisible()){var a=g.button.getPosition(e),i=a.left,r=a.top;g.popups.show("image.insert",i,r,e.outerHeight())}else g.position.forSelection(t),g.popups.show("image.insert")},showLayer:function Se(e){var t,a,i=g.popups.get("image.insert");if(d||g.opts.toolbarInline){if(d){var r=we();Ce()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left}}else{var n=g.$tb.find('.fr-command[data-cmd="insertImage"]');t=n.offset().left,a=n.offset().top+(g.opts.toolbarBottom?10:n.outerHeight()-10)}!d&&g.opts.toolbarInline&&(a=i.offset().top-g.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(a+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-"+e+"-layer").addClass("fr-active"),g.popups.show("image.insert",t,a,d?d.outerHeight():0),g.accessibility.focusPopup(i)},refreshUploadButton:function Re(e){var t=g.popups.get("image.insert");t&&t.find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function De(e){var t=g.popups.get("image.insert");t&&t.find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:G,insertByURL:function xe(){var e=g.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){O(),N(g.language.translate("Loading image"));var t=e.val().trim();if(g.opts.imageUploadRemoteUrls&&g.opts.imageCORSProxy&&g.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?G([new Blob([this.response],{type:this.response.type||"image/png"})],d):I(i)},a.onerror=function(){L(t,!0,[],d)},a.open("GET",g.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else L(t,!0,[],d);e.val(""),e.blur()}},align:function $e(e){var t=we();t.removeClass("fr-fir fr-fil"),!g.opts.htmlUntouched&&g.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):me(t,he(),e),be(),S(),n(),g.selection.clear()},refreshAlign:function Ue(e){d&&e.find("> *").first().replaceWith(g.icon.create("image-align-"+ue()))},refreshAlignOnShow:function Ie(e,t){d&&t.find('.fr-command[data-param1="'+ue()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function Pe(e){var t=we();t.removeClass("fr-dii fr-dib"),!g.opts.htmlUntouched&&g.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):me(t,e,ue()),be(),S(),n(),g.selection.clear()},refreshDisplayOnShow:function Oe(e,t){d&&t.find('.fr-command[data-param1="'+he()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ve,back:function e(){d?(g.events.disableBlur(),c(".fr-popup input:focus").blur(),T(d)):(g.events.disableBlur(),g.selection.restore(),g.events.enableBlur(),g.popups.hide("image.insert"),g.toolbar.showInline())},get:ye,getEl:we,insert:L,showProgressBar:O,remove:te,hideProgressBar:k,applyStyle:function ke(e,t,a){if(void 0===t&&(t=g.opts.imageStyles),void 0===a&&(a=g.opts.imageMultipleStyles),!d)return!1;var i=we();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),i.removeClass(r.join(" "))}"object"==Le(t[e])?(i.removeAttr("style"),i.css(t[e].style)):i.toggleClass(e),T(d)},showAltPopup:j,showSizePopup:J,setAlt:function Ne(e){if(d){var t=g.popups.get("image.alt");d.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),T(d)}},setSize:function Be(e,t){if(d){var a=g.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var i=/^[\d]+((px)|%)*$/g;d.removeAttr("width").removeAttr("height"),e.match(i)?d.css("width",e):d.css("width",""),t.match(i)?d.css("height",t):d.css("height",""),Ce()&&(d.parents(".fr-img-caption").removeAttr("width").removeAttr("height"),e.match(i)?d.parents(".fr-img-caption").css("width",e):d.parents(".fr-img-caption").css("width",""),t.match(i)?d.parents(".fr-img-caption").css("height",t):d.parents(".fr-img-caption").css("height","")),a&&a.find("input:focus").blur(),T(d)}},toggleCaption:function Te(){var e;if(d&&!Ce()){var t,a;(e=d).parent().is("a")&&(e=d.parent()),e.attr("style")&&(a=-1<(t=e.attr("style").split(":")).indexOf("width")?t[t.indexOf("width")+1].replace(";",""):"");var i=g.opts.imageResizeWithPercent?(-1<a.indexOf("px")?null:a)||"100%":d.width()+"px";e.wrap("<span "+(g.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+d.attr("class")+'" style="'+(g.opts.useClasses?"":e.attr("style"))+'" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),d.after('<span class="fr-inner"'+(g.browser.mozilla?"":' contenteditable="true"')+">"+_e.START_MARKER+g.language.translate("Image Caption")+_e.END_MARKER+"</span>"),d.removeAttr("class").removeAttr("style").removeAttr("width"),d.parents(".fr-img-caption").css("width",i),pe(!0),g.selection.restore()}else e=we(),d.insertAfter(e),d.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),T(d)},hasCaption:Ce,exitEdit:pe,edit:T}},_e.DefineIcon("insertImage",{NAME:"image",SVG_KEY:"insertImage"}),_e.RegisterShortcut(_e.KEYCODE.P,"insertImage",null,"P"),_e.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),_e.DefineIcon("imageUpload",{NAME:"upload",SVG_KEY:"upload"}),_e.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),_e.DefineIcon("imageByURL",{NAME:"link",SVG_KEY:"insertLink"}),_e.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),_e.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),_e.DefineIcon("imageDisplay",{NAME:"star",SVG_KEY:"imageDisplay"}),_e.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),_e.DefineIcon("image-align",{NAME:"align-left",SVG_KEY:"alignLeft"}),_e.DefineIcon("image-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),_e.DefineIcon("image-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),_e.DefineIcon("image-align-center",{NAME:"align-justify",SVG_KEY:"alignCenter"}),_e.DefineIcon("imageAlign",{NAME:"align-justify",SVG_KEY:"alignJustify"}),_e.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=_e.COMMANDS.imageAlign.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="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),_e.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),_e.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),_e.DefineIcon("imageRemove",{NAME:"trash",SVG_KEY:"remove"}),_e.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),_e.DefineIcon("imageBack",{NAME:"arrow-left",SVG_KEY:"back"}),_e.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.$;this.image.get()||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"))}}),_e.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),_e.DefineIcon("imageStyle",{NAME:"magic",SVG_KEY:"imageClass"}),_e.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];"object"==Le(i)&&(i=i.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(i)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.$,i=this.image.getEl();i&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=i.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),_e.DefineIcon("imageAlt",{NAME:"info",SVG_KEY:"imageAltText"}),_e.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),_e.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),_e.DefineIcon("imageSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),_e.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),_e.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),_e.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt",SVG_KEY:"imageCaption"}),_e.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v3.0.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v3.0.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2019 Froala Labs
5
5
  */