wysiwyg-rails 4.0.8 → 4.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +3 -3
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +3 -3
  4. data/app/assets/javascripts/languages/ar.js +2 -2
  5. data/app/assets/javascripts/languages/bs.js +2 -2
  6. data/app/assets/javascripts/languages/cs.js +2 -2
  7. data/app/assets/javascripts/languages/da.js +2 -2
  8. data/app/assets/javascripts/languages/de.js +2 -2
  9. data/app/assets/javascripts/languages/el.js +2 -2
  10. data/app/assets/javascripts/languages/en_ca.js +2 -2
  11. data/app/assets/javascripts/languages/en_gb.js +2 -2
  12. data/app/assets/javascripts/languages/es.js +2 -2
  13. data/app/assets/javascripts/languages/et.js +2 -2
  14. data/app/assets/javascripts/languages/fa.js +2 -2
  15. data/app/assets/javascripts/languages/fi.js +2 -2
  16. data/app/assets/javascripts/languages/fr.js +2 -2
  17. data/app/assets/javascripts/languages/he.js +2 -2
  18. data/app/assets/javascripts/languages/hr.js +2 -2
  19. data/app/assets/javascripts/languages/hu.js +2 -2
  20. data/app/assets/javascripts/languages/id.js +2 -2
  21. data/app/assets/javascripts/languages/it.js +2 -2
  22. data/app/assets/javascripts/languages/ja.js +2 -2
  23. data/app/assets/javascripts/languages/ko.js +2 -2
  24. data/app/assets/javascripts/languages/ku.js +2 -2
  25. data/app/assets/javascripts/languages/me.js +2 -2
  26. data/app/assets/javascripts/languages/nb.js +2 -2
  27. data/app/assets/javascripts/languages/nl.js +2 -2
  28. data/app/assets/javascripts/languages/pl.js +2 -2
  29. data/app/assets/javascripts/languages/pt_br.js +2 -2
  30. data/app/assets/javascripts/languages/pt_pt.js +2 -2
  31. data/app/assets/javascripts/languages/ro.js +2 -2
  32. data/app/assets/javascripts/languages/ru.js +2 -2
  33. data/app/assets/javascripts/languages/sk.js +2 -2
  34. data/app/assets/javascripts/languages/sl.js +2 -2
  35. data/app/assets/javascripts/languages/sr.js +2 -2
  36. data/app/assets/javascripts/languages/sv.js +2 -2
  37. data/app/assets/javascripts/languages/th.js +2 -2
  38. data/app/assets/javascripts/languages/tr.js +2 -2
  39. data/app/assets/javascripts/languages/uk.js +2 -2
  40. data/app/assets/javascripts/languages/vi.js +2 -2
  41. data/app/assets/javascripts/languages/zh_cn.js +2 -2
  42. data/app/assets/javascripts/languages/zh_tw.js +2 -2
  43. data/app/assets/javascripts/plugins/align.min.js +2 -2
  44. data/app/assets/javascripts/plugins/char_counter.min.js +2 -2
  45. data/app/assets/javascripts/plugins/code_beautifier.min.js +2 -2
  46. data/app/assets/javascripts/plugins/code_view.min.js +2 -2
  47. data/app/assets/javascripts/plugins/colors.min.js +2 -2
  48. data/app/assets/javascripts/plugins/cryptojs.min.js +2 -2
  49. data/app/assets/javascripts/plugins/draggable.min.js +2 -2
  50. data/app/assets/javascripts/plugins/edit_in_popup.min.js +2 -2
  51. data/app/assets/javascripts/plugins/emoticons.min.js +2 -2
  52. data/app/assets/javascripts/plugins/entities.min.js +2 -2
  53. data/app/assets/javascripts/plugins/file.min.js +2 -2
  54. data/app/assets/javascripts/plugins/files_manager.min.js +3 -3
  55. data/app/assets/javascripts/plugins/font_family.min.js +2 -2
  56. data/app/assets/javascripts/plugins/font_size.min.js +2 -2
  57. data/app/assets/javascripts/plugins/forms.min.js +2 -2
  58. data/app/assets/javascripts/plugins/fullscreen.min.js +2 -2
  59. data/app/assets/javascripts/plugins/help.min.js +2 -2
  60. data/app/assets/javascripts/plugins/image.min.js +3 -3
  61. data/app/assets/javascripts/plugins/image_manager.min.js +2 -2
  62. data/app/assets/javascripts/plugins/inline_class.min.js +2 -2
  63. data/app/assets/javascripts/plugins/inline_style.min.js +2 -2
  64. data/app/assets/javascripts/plugins/line_breaker.min.js +2 -2
  65. data/app/assets/javascripts/plugins/line_height.min.js +3 -3
  66. data/app/assets/javascripts/plugins/link.min.js +3 -3
  67. data/app/assets/javascripts/plugins/lists.min.js +2 -2
  68. data/app/assets/javascripts/plugins/markdown.min.js +3 -3
  69. data/app/assets/javascripts/plugins/paragraph_format.min.js +2 -2
  70. data/app/assets/javascripts/plugins/paragraph_style.min.js +2 -2
  71. data/app/assets/javascripts/plugins/print.min.js +2 -2
  72. data/app/assets/javascripts/plugins/quick_insert.min.js +2 -2
  73. data/app/assets/javascripts/plugins/quote.min.js +3 -3
  74. data/app/assets/javascripts/plugins/save.min.js +2 -2
  75. data/app/assets/javascripts/plugins/special_characters.min.js +2 -2
  76. data/app/assets/javascripts/plugins/table.min.js +3 -3
  77. data/app/assets/javascripts/plugins/track_changes.min.js +3 -3
  78. data/app/assets/javascripts/plugins/trim_video.min.js +2 -2
  79. data/app/assets/javascripts/plugins/url.min.js +2 -2
  80. data/app/assets/javascripts/plugins/video.min.js +3 -3
  81. data/app/assets/javascripts/plugins/word_paste.min.js +3 -3
  82. data/app/assets/javascripts/plugins.pkgd.min.js +3 -3
  83. data/app/assets/javascripts/third_party/embedly.min.js +2 -2
  84. data/app/assets/javascripts/third_party/font_awesome.min.js +2 -2
  85. data/app/assets/javascripts/third_party/image_tui.min.js +2 -2
  86. data/app/assets/javascripts/third_party/showdown.min.js +3 -3
  87. data/app/assets/javascripts/third_party/spell_checker.min.js +2 -2
  88. data/app/assets/stylesheets/froala_editor.css +10 -6
  89. data/app/assets/stylesheets/froala_editor.min.css +3 -3
  90. data/app/assets/stylesheets/froala_editor.pkgd.css +12 -13
  91. data/app/assets/stylesheets/froala_editor.pkgd.min.css +3 -3
  92. data/app/assets/stylesheets/froala_style.css +4 -2
  93. data/app/assets/stylesheets/froala_style.min.css +3 -3
  94. data/app/assets/stylesheets/plugins/char_counter.css +2 -2
  95. data/app/assets/stylesheets/plugins/char_counter.min.css +2 -2
  96. data/app/assets/stylesheets/plugins/code_view.css +2 -2
  97. data/app/assets/stylesheets/plugins/code_view.min.css +2 -2
  98. data/app/assets/stylesheets/plugins/colors.css +2 -2
  99. data/app/assets/stylesheets/plugins/colors.min.css +2 -2
  100. data/app/assets/stylesheets/plugins/draggable.css +2 -2
  101. data/app/assets/stylesheets/plugins/draggable.min.css +2 -2
  102. data/app/assets/stylesheets/plugins/emoticons.css +2 -2
  103. data/app/assets/stylesheets/plugins/emoticons.min.css +2 -2
  104. data/app/assets/stylesheets/plugins/file.css +2 -2
  105. data/app/assets/stylesheets/plugins/file.min.css +2 -2
  106. data/app/assets/stylesheets/plugins/files_manager.css +2 -2
  107. data/app/assets/stylesheets/plugins/files_manager.min.css +2 -2
  108. data/app/assets/stylesheets/plugins/fullscreen.css +2 -2
  109. data/app/assets/stylesheets/plugins/fullscreen.min.css +2 -2
  110. data/app/assets/stylesheets/plugins/help.css +2 -2
  111. data/app/assets/stylesheets/plugins/help.min.css +2 -2
  112. data/app/assets/stylesheets/plugins/image.css +2 -2
  113. data/app/assets/stylesheets/plugins/image.min.css +2 -2
  114. data/app/assets/stylesheets/plugins/image_manager.css +2 -2
  115. data/app/assets/stylesheets/plugins/image_manager.min.css +2 -2
  116. data/app/assets/stylesheets/plugins/line_breaker.css +2 -2
  117. data/app/assets/stylesheets/plugins/line_breaker.min.css +2 -2
  118. data/app/assets/stylesheets/plugins/markdown.css +2 -2
  119. data/app/assets/stylesheets/plugins/markdown.min.css +2 -2
  120. data/app/assets/stylesheets/plugins/quick_insert.css +2 -2
  121. data/app/assets/stylesheets/plugins/quick_insert.min.css +2 -2
  122. data/app/assets/stylesheets/plugins/special_characters.css +2 -2
  123. data/app/assets/stylesheets/plugins/special_characters.min.css +2 -2
  124. data/app/assets/stylesheets/plugins/table.css +2 -9
  125. data/app/assets/stylesheets/plugins/table.min.css +3 -3
  126. data/app/assets/stylesheets/plugins/trim_video.css +2 -2
  127. data/app/assets/stylesheets/plugins/trim_video.min.css +2 -2
  128. data/app/assets/stylesheets/plugins/video.css +2 -2
  129. data/app/assets/stylesheets/plugins/video.min.css +2 -2
  130. data/app/assets/stylesheets/plugins.pkgd.css +2 -9
  131. data/app/assets/stylesheets/plugins.pkgd.min.css +3 -3
  132. data/app/assets/stylesheets/themes/dark.css +4 -14
  133. data/app/assets/stylesheets/themes/dark.min.css +3 -3
  134. data/app/assets/stylesheets/themes/gray.css +4 -14
  135. data/app/assets/stylesheets/themes/gray.min.css +3 -3
  136. data/app/assets/stylesheets/themes/royal.css +4 -14
  137. data/app/assets/stylesheets/themes/royal.min.css +3 -3
  138. data/app/assets/stylesheets/third_party/embedly.css +2 -2
  139. data/app/assets/stylesheets/third_party/embedly.min.css +2 -2
  140. data/app/assets/stylesheets/third_party/font_awesome.css +2 -2
  141. data/app/assets/stylesheets/third_party/font_awesome.min.css +2 -2
  142. data/app/assets/stylesheets/third_party/image_tui.css +2 -2
  143. data/app/assets/stylesheets/third_party/image_tui.min.css +2 -2
  144. data/app/assets/stylesheets/third_party/spell_checker.css +2 -2
  145. data/app/assets/stylesheets/third_party/spell_checker.min.css +2 -2
  146. data/lib/wysiwyg-rails/version.rb +1 -1
  147. metadata +2 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.11 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2021 Froala Labs
4
+ * Copyright 2014-2022 Froala Labs
5
5
  */
6
6
 
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(U){"use strict";function j(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(e,t)}(e)||function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}U=U&&U.hasOwnProperty("default")?U["default"]:U,Object.assign(U.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),U.PLUGINS.track_changes=function(M){var _=M.$;_.fn.isAfter=function(e){var t=_(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=_(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=_(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var l,i,s=[],I="",w="",L="",T="",d=[],o=[],g=null,P=[],h=!1;function c(){return s.pop()}function f(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(M.opts.trackChangesEnabled){M.selection.restore(),e&&e.composing&&(M.selection.save(),M.selection.ranges()[0].collapse(!1));var r=M.selection.ranges(0).startContainer,i=_(r).parentsUntil(M.$el,"[data-tracking=true]");if(_(r).data("tracking")&&t){M.markers.insert();var s=M.$el.find(".fr-marker");return s[0].previousSibling&&"IMG"===s[0].previousSibling.tagName||M.selection.clear(),void _(s).remove()}if(!i.length||"TD"==r.tagName||a){if(M.selection.isCollapsed()){M.markers.insert();var l=M.$el.find(".fr-marker");if(e&&e.composing&&(l=_(l[1])),!l.length)return;var o="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),c=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!l[0].previousSibling||l[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!l[0].previousSibling.lastChild||l[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==l[0].previousSibling.lastChild.tagName){for(;_(l[0].previousSibling).data("tracking");)l.insertBefore(l.prev());_(l[0].previousSibling).find("[data-tracking=true]").length&&l.insertBefore(_(l[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(_(r).data("tracking")){if(!r.nextSibling)return void(l[0].nextSibling&&"IMG"===l[0].nextSibling.tagName&&l[0].nextSibling.remove());l.insertBefore(r.nextSibling),R(l)}else R(l);var d=l[0]&&l[0].previousSibling?l[0].previousSibling.nodeValue:"",g=d&&d.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(l[0].nextSibling&&"SPAN"!==l[0].nextSibling.tagName&&null===l[0].nextSibling.nodeValue&&l[0].nextSibling.firstChild&&l[0].nextSibling.firstChild.before(l[0]),g=(d=l[0].nextSibling?l[0].nextSibling.nodeValue:" ")&&d.slice(1)),n&&l[0].nextSibling&&"isPasted"===l[0].nextSibling.id?g=(d=l[0].nextSibling?l[0].nextSibling.textContent:" ")&&d.slice(1):t&&l[0].previousSibling&&"isPasted"===l[0].previousSibling.id&&(g=(d=l[0].previousSibling?l[0].previousSibling.textContent:" ")&&d.slice(0,-(e.selectionLength?e.selectionLength:1)));var h,f=_('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,"></span>")),p=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?p.addClass("fr-track-hide-mobile"):p.addClass("fr-track-hide"));var u=!1,k=!1;if(t)try{var m=l[0]&&l[0].previousSibling;if(l[0]&&l[0].previousElementSibling&&"I"===l[0].previousElementSibling.tagName&&!d&&(h=l[0].previousElementSibling),m&&3===m.nodeType&&"SPAN"!==m.parentNode.tagName&&m.previousSibling&&"SPAN"===m.previousSibling.tagName&&" "===m.nodeValue?h=m.previousSibling:m&&"SPAN"===m.parentNode.tagName&&0<_(m.parentNode).find(".fr-emoticon").length?(h=m.parentNode,u=!0):m&&("SPAN"===m.tagName&&"isPasted"!==m.id||"HR"===m.tagName)?h=m:_(l).parent().prev().is("hr")?(h=_(l).parent().prev().get(0),u=k=!0):m&&"IMG"===m.tagName&&(h=m,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),M.helpers.isMobile()&&l[0]&&!h&&!d&&!g)return;u?(_(l[0].parentNode).after(f),k?_(l).parent().remove():_(l).remove()):l[0]?e.composing?_(l).after(f):_(l).before(f):_(T).before(f)}catch(e){T&&_(T).before(f)}else if(n){var v=l[0].nextSibling;l[0].nextElementSibling&&"I"===l[0].nextElementSibling.tagName&&!l[0].nextSibling.nodeValue?h=l[0].nextElementSibling:v&&3===v.nodeType&&"SPAN"!==v.parentNode.tagName&&v.nextSibling&&"SPAN"===v.nextSibling.tagName&&" "===v.nodeValue?h=v.nextSibling:v&&"SPAN"===v.parentNode.tagName&&0<_(v.parentNode).find(".fr-emoticon").length?(h=v.parentNode,u=!0):v&&"SPAN"===v.tagName&&l[0].nextSibling&&"isPasted"!==l[0].nextSibling.id?h=v:v&&"IMG"===v.tagName&&(h=v,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),u?(_(l[0].parentNode).before(f),_(l).remove()):_(l).after(f)}if(e.composing?P.push({span:f,"delete":p}):(M.helpers.isIOS()&&P.push({"delete":p}),_(f).prepend(p)),!h&&(h=d&&d.replace(g,""),M.helpers.isMobile()&&I&&!e.composing)){var b=M.selection.get().focusNode,C=M.selection.get().focusOffset,S=1;w&&b&&w.isSameNode(b)&&(S=L-C),h=I.replace(/\u00a0/g," ").replace(d.replace(/\u00a0/g," "),"").slice(0,S)}if(h&&(u?(_(p).append(_(_(h).get(0).outerHTML)),M.markers.insert()):_(p).append(h)),h&&0==h.length)return;M.browser.msie&&t&&(_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),t&&(g||""===g)&&l[0].previousSibling?l[0].previousSibling.nodeValue=g:n&&(_(f).append("".concat(U.MARKERS)),l[0].nextSibling.nodeValue=g)}else{var N=U.INVISIBLE_SPACE;if(e&&M.helpers.isMobile()&&((N=l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue.slice(-1):U.INVISIBLE_SPACE)&&l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue=l[0].previousSibling.nodeValue.slice(0,-1):!l[0]||l[0].previousSibling||l[0].nextSibling||N!==U.INVISIBLE_SPACE||(N=M.selection.get().focusNode.nodeValue.slice(L,M.selection.get().focusOffset),M.selection.get().focusNode.nodeValue=M.selection.get().focusNode.nodeValue.slice(M.selection.get().focusOffset))),a){if(l.parent().parent().is("li"))return;var E=_("<p></p>");return void(0<l.closest("p").length&&(l.closest("p").after(E),E.append(l),M.markers.remove(),setTimeout(function(){E.prev().text()!==String.fromCharCode(8203)&&""!==E.prev().text()||E.prev().remove(),M.selection.setAfter(E[0])},1)))}l[0].previousSibling&&"BR"===l[0].previousSibling.tagName&&l[0].previousSibling.remove(),l.replaceWith('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,">").concat(N+U.MARKERS,"</span>"))}M.selection.restore(),M.track_changes.pushChange(o)}else{M.selection.save();var y=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),x=M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0);if(_(y).parent().hasClass("fr-emoticon")&&_(y).parent().before(y),_(y).isAfter(_(x))){var A=y;y=x,x=A}$(y,x,e&&e.deletion),M.selection.restore()}M.helpers.isMobile()&&I&&M.markers.remove()}}}function R(e){if(_(e[0].nextSibling).data("tracking")){for(;_(e[0].nextSibling).data("tracking")&&(!(0<_(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<_(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||_(e[0].previousSibling).data("tracking"));)_(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function $(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!_(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&$(_(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?$(e.firstChild.nextSibling,t,a):$(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;_(e).remove(),$(n,t)}var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(_(e).before(s),M.track_changes.pushChange(r);o&&_(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!_(o).hasClass("fr-marker")&&!_(o).is("[data-track-id]")&&0===_(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&_(o).data("tracking-img","true"),M.node.isBlock(o)&&"HR"!==e.tagName)return $(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,$(o.firstChild,t,a);break}c||(o=o.nextSibling,_(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||$(o,t,a),a?P.push({span:s,"delete":l}):(M.helpers.isIOS()&&P.push({"delete":l}),_(s).prepend(l)),M.browser.msie?_(s).prepend("".concat(U.INVISIBLE_SPACE+U.MARKERS)):_(s).prepend("".concat(U.INVISIBLE_SPACE)),_(s).append("".concat(U.INVISIBLE_SPACE+U.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!M.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(M.node.isBlock(p)?"HR"===p.tagName?$(p.nextSibling,t,a):(M.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&_(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),$(p.firstChild,t,a)):$(p,t,a))}}}}}function p(e){if(M.opts.trackChangesEnabled){M.selection.restore();var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");if(_(t).data("tracking"))return;if(!a.length&&!M.selection.isCollapsed()&&"quote"!=e){M.selection.save(),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0));var n=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)_(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;_(i).after(n)}M.selection.restore()}}}function u(e,t,a){if(e&&!("<br>"===_(e).html()&&_(e).parent().is("td")||(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&u(_(e).parent().next()[0],t,a),_(e).is("br")&&_(e).parent().length&&_(e).parent().is("td")&&0===_(e).parent().text().length))){for(a||(a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),M.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?u(e.firstChild.nextSibling,t,a):u(e.firstChild,t,a),!1;var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(_(e).before(r);s&&_(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!_(s).hasClass("fr-marker")&&0===_(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(M.node.isBlock(s)&&"HR"!==e.tagName)return u(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,u(s.firstChild,t,a);break}l||(s=s.nextSibling,_(i).append(o.cloneNode(!0)),_(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||u(s,t,a),_(s).hasClass("fr-marker")&&_(r).append(s),_(r).prepend(i),_(r).prepend("".concat(U.INVISIBLE_SPACE)),_(r).append("".concat(U.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!M.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(M.node.isBlock(h)?"HR"===h.tagName?u(h.nextSibling,t,a):u(h.firstChild,t,a):u(h,t,a))}}}}function k(e,t,a){var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function m(){if(M.events.trigger("image.hideResizer"),M.events.trigger("video.hideResizer"),M.html.cleanEmptyTags(!0),M.helpers.isMobile())for(var e=M.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=_(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){M.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=c();if(e){var t,a=M.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=_(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=_(a).data("tracking-deleted")?_(a):_(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):(M.selection.save(),0<_(s).find("IFRAME").length?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,M.selection.restore())}}t&&t.remove()}m()}function a(){var e=c();if(e){var t=M.$el.find("[data-track-id=".concat(e,"]"));if(t.length){M.selection.save();for(var a=t.length-1;0<=a;a--){var n=_(t).data("tracking-deleted")?_(t):_(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<_(t).find("IFRAME").length)_(t).removeData("tracking"),_(t).removeData("track-id"),_(t).removeClass("fr-highlight-change"),_(t).removeClass("fr-tracking-deleted"),_(t).removeData("tracking-deleted"),_(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(_(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}M.selection.restore()}}m()}return M.events.on("keydown",function(e){var t,a;if(!M.opts.trackChangesEnabled)return!0;if(l=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,M.helpers.isAndroid()){var n,r,i=M.selection.get();I=null==i?void 0:null===(n=i.focusNode)||void 0===n?void 0:n.nodeValue,w=null==i?void 0:i.focusNode,T=null===(r=w)||void 0===r?void 0:r.nextSibling,L=null==i?void 0:i.focusOffset}else if(function s(e){return(!M.keys.ctrlKey(e)||e.which!==U.KEYCODE.Z&&e.which!==U.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!M.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(M.keys.ctrlKey(e)&&"a"===e.key||M.keys.ctrlKey(e)&&"s"===e.key)return;f(e)}else p()},!0),M.events.on("keyup",function(e){if(!M.opts.trackChangesEnabled)return!0;var t,a;if(M.helpers.isMobile())if(i=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,h){for(var n=0;n<P.length;n++)M.opts.showChangesEnabled&&_(P[n].span).empty(),_(P[n].span).prepend(P[n]["delete"]);h=!(P=[])}else if(M.helpers.isIOS()){for(var r=0;r<P.length;r++)i&&1===i.length&&l&&1==l.length?(_(P[r]["delete"]).attr("contenteditable","true"),_(P[r]["delete"]).addClass("fr-ios-mobile-disable-select")):_(P[r]["delete"]).attr("contenteditable","false");P=[]}else{if(46===e.keyCode)return!0;f(e)}},!0),M.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!M.opts.trackChangesEnabled)return!0;if(M.helpers.isAndroid()){var n=M.selection.get(),r=M.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=_(i).parentsUntil(M.$el,"[data-tracking=true]"),o=_(s).parentsUntil(M.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return h=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||M.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c,d;if(h=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(d=c.item(0))&&void 0!==d&&d.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,f(e)}}},!0),M.events.on("paste.before",function(e){M.opts.trackChangesEnabled&&M.helpers.isMobile()&&f(e)},!0),M.events.on("paste.after",function(e){if(M.opts.trackChangesEnabled){M.markers.insert();for(var t=M.$el.find(".fr-marker"),a=t.parent().data("tracking")?t.parent():t.parent().find("[data-tracking=true]"),n=a.children().eq(0).is("ul"),r=t.next();r.is("br");)(r=r.next()).prev().remove(),r.next().is("br")&&r.next().remove();if(r.is("ul")){var i=r.find("li");i.find("[data-tracking=true]").addClass("fr-highlight-change");var s=i[0].innerHTML;if(i.html(""),i.insertAfter(t.closest("li")),0==r.parent().find("[data-tracking=true]").length)return void i.append(s);if(r.remove(),a.data("tracking")){var l=a[0].innerHTML;0<l.trim().length&&a.parent().append(l),i.append(a),a.html(s)}else if(!n)return a.insertBefore(a.closest("ul")),void a.next().remove();M.markers.remove(),i.next().length&&i.next().is("li")&&""==i.next().text().trim()&&i.next().remove();var o=i.prev().children().eq(0);o.is("br")&&o.remove()}}},!0),M.events.on("image.inserted",function(e){M.helpers.isMobile()&&M.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),M.events.on("image.removed",function(e){if(M.helpers.isMobile()&&M.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");M.markers.insert();var n=M.$el.find(".fr-marker"),r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),_(t).data("tracking")||a.length?(_(n).replaceWith(l),_(l).append(e),M.markers.remove()):(_(n).replaceWith(s),_(s).prepend(l),_(l).append(e),M.markers.remove(),M.track_changes.pushChange(r))}}),M.events.on("commands.before",function(t){if(!M.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)p(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){M.selection.save();for(var a=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;_(s).append(l),_(i).append(s),_(a.parentNode).after(_("<p></p>")),_(a.parentNode.nextSibling).append(i),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),_(a.parentNode.nextSibling).after(_("<p></p>")),_(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),M.track_changes.pushChange(r),M.selection.restore()}}else{if(U.COMMANDS[t]&&(U.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===U.COMMANDS[t].type||U.COMMANDS[t].more_btn||U.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t)return void(M.opts.trackChangesEnabled&&function(){g=M.selection.blocks();for(var a=[],n=0,e=0;e<g.length;e++){n=e<n?n:e;var t=_(g[e]);if(t.is("li"))t.siblings("li").each(function(e,t){_(t).find("li").length&&(a.push({index:n,item:t}),n+=1)});d[e]=_("<span>".concat(t.get(0).innerHTML,"</span>"))}for(var r=0,i=a;r<i.length;r++){var s=i[r],l=s.index,o=s.item,c=_(_(o).get(0).outerHTML);c.find("ul").remove(),c.find("ol").remove(),d=[].concat(j(d.slice(0,l+1)),[_("<span>".concat(c.get(0).innerHTML,"</span>"))],j(d.slice(l+1))),g=[].concat(j(g.slice(0,l+1)),[o],j(g.slice(l+1)))}}());f()}},!0),M.events.on("commands.after",function(e){if(!M.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=M.$el.find("[data-tracking=true]");s.splice(0,s.length);for(var t=0;t<e.length;t++){var a=_(e.get(t)).data("track-id");s[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&M.opts.trackChangesEnabled){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length);for(var a in g){var n=_(g[a]);d[a]&&(k(n,d[a],t),d[a]=null,o[a]=null)}M.track_changes.pushChange(t),d=[],g=null}},!0),M.events.on("quickInsert.commands.before",function(e){M.opts.trackChangesEnabled&&f(e)}),{toggleTracking:function n(){M.opts.trackChangesEnabled&&-1<M.html.get(!0,!0).indexOf("data-tracking")||M.opts.trackChangesEnabled&&0<M.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(M.commands.moreTrackChanges(),M.opts.trackChangesEnabled=!M.opts.trackChangesEnabled,M.opts.trackChangesEnabled||(M.opts.showChangesEnabled=!1))},pushChange:function r(e){s.push(e)},insertChangeAt:function v(e,t){s=[].concat(j(s.slice(0,e)),[t],j(s.slice(e)))},popChange:c,getPendingChanges:function b(){return s},showChanges:function C(){if(M.opts.showChangesEnabled=!M.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(_(e.get(a)).removeClass("fr-track-hide"),_(e.get(a)).removeClass("fr-track-hide-mobile")):M.helpers.isMobile()?_(e.get(a)).addClass("fr-track-hide-mobile"):_(e.get(a)).addClass("fr-track-hide")}(M.$el.find(".fr-tracking-deleted"),M.opts.showChangesEnabled),M.opts.showChangesEnabled)for(var e=M.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)_(e.get(t)).addClass("fr-highlight-change");else for(var a=M.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)_(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function S(){for(;0!=M.track_changes.getPendingChanges().length;)t();s=[],e(),M.$el.find("li").each(function(){!_(this).children()[0]||"OL"!==_(this).children()[0].tagName&&"UL"!==_(this).children()[0].tagName||e()})},rejectAllChanges:function N(){for(;0!=M.track_changes.getPendingChanges().length;)a();s=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function E(e){var t=M.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!s.length),e.toggleClass("fr-active",s.length).attr("aria-pressed",s.length),0<!t.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var a=M.$tb.find('.fr-command[data-cmd="markdown"]');a&&M.opts.trackChangesEnabled?a.addClass("fr-disabled"):a&&!_(".fr-active.fr-popup").length&&a.removeClass("fr-disabled");var n=M.$tb.find('.fr-command[data-cmd="showChanges"]');n&&M.opts.trackChangesEnabled&&n.removeClass("fr-disabled")},replaceSpecialItem:function y(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),$(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=_(this),n=a[0].innerText;_(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),M.track_changes.pushChange(r)}},addQuote:function O(e){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(t)},removeQuote:function V(e,t){if(!(0<t)){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(a)}},wrapInTracking:function D(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),M.track_changes.pushChange(a),r},wrapInDelete:function B(e){var t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||(M.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function H(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),M.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function K(e){var t=M.$el.find(".fr-highlight-change");_(t)[0].style.display="block",_(t)[0].innerHTML=e},pasteInEdior:function G(e){var t=M.$el.find(".fr-marker");_(t)[0].outerHTML=e,M.markers.remove()}}},U.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),U.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),U.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),U.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),U.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),U.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),U.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),U.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),U.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.track_changes.refresh(e)}}),U.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.track_changes.refresh(e)}}),U.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.track_changes.refresh(e)}}),U.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.track_changes.refresh(e)}})});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(U){"use strict";function j(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(e,t)}(e)||function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}U=U&&U.hasOwnProperty("default")?U["default"]:U,Object.assign(U.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),U.PLUGINS.track_changes=function(M){var _=M.$;_.fn.isAfter=function(e){var t=_(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=_(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=_(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var l,i,s=[],I="",w="",L="",T="",d=[],o=[],g=null,P=[],h=!1;function c(){return s.pop()}function f(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(M.opts.trackChangesEnabled){M.selection.restore(),e&&e.composing&&(M.selection.save(),M.selection.ranges()[0].collapse(!1));var r=M.selection.ranges(0).startContainer,i=_(r).parentsUntil(M.$el,"[data-tracking=true]");if(_(r).data("tracking")&&t){M.markers.insert();var s=M.$el.find(".fr-marker");return s[0].previousSibling&&"IMG"===s[0].previousSibling.tagName||M.selection.clear(),void _(s).remove()}if(!i.length||"TD"==r.tagName||a){if(M.selection.isCollapsed()){M.markers.insert();var l=M.$el.find(".fr-marker");if(e&&e.composing&&(l=_(l[1])),!l.length)return;var o="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),c=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!l[0].previousSibling||l[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!l[0].previousSibling.lastChild||l[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==l[0].previousSibling.lastChild.tagName){for(;_(l[0].previousSibling).data("tracking");)l.insertBefore(l.prev());_(l[0].previousSibling).find("[data-tracking=true]").length&&l.insertBefore(_(l[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(_(r).data("tracking")){if(!r.nextSibling)return void(l[0].nextSibling&&"IMG"===l[0].nextSibling.tagName&&l[0].nextSibling.remove());l.insertBefore(r.nextSibling),R(l)}else R(l);var d=l[0]&&l[0].previousSibling?l[0].previousSibling.nodeValue:"",g=d&&d.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(l[0].nextSibling&&"SPAN"!==l[0].nextSibling.tagName&&null===l[0].nextSibling.nodeValue&&l[0].nextSibling.firstChild&&l[0].nextSibling.firstChild.before(l[0]),g=(d=l[0].nextSibling?l[0].nextSibling.nodeValue:" ")&&d.slice(1)),n&&l[0].nextSibling&&"isPasted"===l[0].nextSibling.id?g=(d=l[0].nextSibling?l[0].nextSibling.textContent:" ")&&d.slice(1):t&&l[0].previousSibling&&"isPasted"===l[0].previousSibling.id&&(g=(d=l[0].previousSibling?l[0].previousSibling.textContent:" ")&&d.slice(0,-(e.selectionLength?e.selectionLength:1)));var h,f=_('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,"></span>")),p=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?p.addClass("fr-track-hide-mobile"):p.addClass("fr-track-hide"));var u=!1,k=!1;if(t)try{var m=l[0]&&l[0].previousSibling;if(l[0]&&l[0].previousElementSibling&&"I"===l[0].previousElementSibling.tagName&&!d&&(h=l[0].previousElementSibling),m&&3===m.nodeType&&"SPAN"!==m.parentNode.tagName&&m.previousSibling&&"SPAN"===m.previousSibling.tagName&&" "===m.nodeValue?h=m.previousSibling:m&&"SPAN"===m.parentNode.tagName&&0<_(m.parentNode).find(".fr-emoticon").length?(h=m.parentNode,u=!0):m&&("SPAN"===m.tagName&&"isPasted"!==m.id||"HR"===m.tagName)?h=m:_(l).parent().prev().is("hr")?(h=_(l).parent().prev().get(0),u=k=!0):m&&"IMG"===m.tagName&&(h=m,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),M.helpers.isMobile()&&l[0]&&!h&&!d&&!g)return;u?(_(l[0].parentNode).after(f),k?_(l).parent().remove():_(l).remove()):l[0]?e.composing?_(l).after(f):_(l).before(f):_(T).before(f)}catch(e){T&&_(T).before(f)}else if(n){var b=l[0].nextSibling;l[0].nextElementSibling&&"I"===l[0].nextElementSibling.tagName&&!l[0].nextSibling.nodeValue?h=l[0].nextElementSibling:b&&3===b.nodeType&&"SPAN"!==b.parentNode.tagName&&b.nextSibling&&"SPAN"===b.nextSibling.tagName&&" "===b.nodeValue?h=b.nextSibling:b&&"SPAN"===b.parentNode.tagName&&0<_(b.parentNode).find(".fr-emoticon").length?(h=b.parentNode,u=!0):b&&"SPAN"===b.tagName&&l[0].nextSibling&&"isPasted"!==l[0].nextSibling.id?h=b:b&&"IMG"===b.tagName&&(h=b,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),u?(_(l[0].parentNode).before(f),_(l).remove()):_(l).after(f)}if(e.composing?P.push({span:f,"delete":p}):(M.helpers.isIOS()&&P.push({"delete":p}),_(f).prepend(p)),!h&&(h=d&&d.replace(g,""),M.helpers.isMobile()&&I&&!e.composing)){var v=M.selection.get().focusNode,C=M.selection.get().focusOffset,S=1;w&&v&&w.isSameNode(v)&&(S=L-C),h=I.replace(/\u00a0/g," ").replace(d.replace(/\u00a0/g," "),"").slice(0,S)}if(h&&(u?(_(p).append(_(_(h).get(0).outerHTML)),M.markers.insert()):_(p).append(h)),h&&0==h.length)return;M.browser.msie&&t&&(_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),t&&(g||""===g)&&l[0].previousSibling?l[0].previousSibling.nodeValue=g:n&&(_(f).append("".concat(U.MARKERS)),l[0].nextSibling.nodeValue=g)}else{var N=U.INVISIBLE_SPACE;if(e&&M.helpers.isMobile()&&((N=l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue.slice(-1):U.INVISIBLE_SPACE)&&l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue=l[0].previousSibling.nodeValue.slice(0,-1):!l[0]||l[0].previousSibling||l[0].nextSibling||N!==U.INVISIBLE_SPACE||(N=M.selection.get().focusNode.nodeValue.slice(L,M.selection.get().focusOffset),M.selection.get().focusNode.nodeValue=M.selection.get().focusNode.nodeValue.slice(M.selection.get().focusOffset))),a){if(l.parent().parent().is("li"))return;var E=_("<p></p>");return void(0<l.closest("p").length&&(l.closest("p").after(E),E.append(l),M.markers.remove(),setTimeout(function(){E.prev().text()!==String.fromCharCode(8203)&&""!==E.prev().text()||E.prev().remove(),M.selection.setAfter(E[0])},1)))}l[0].previousSibling&&"BR"===l[0].previousSibling.tagName&&l[0].previousSibling.remove(),l.replaceWith('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,">").concat(N+U.MARKERS,"</span>"))}M.selection.restore(),M.track_changes.pushChange(o)}else{M.selection.save();var y=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),x=M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0);if(_(y).parent().hasClass("fr-emoticon")&&_(y).parent().before(y),_(y).isAfter(_(x))){var A=y;y=x,x=A}$(y,x,e&&e.deletion),M.selection.restore()}M.helpers.isMobile()&&I&&M.markers.remove()}}}function R(e){if(_(e[0].nextSibling).data("tracking")){for(;_(e[0].nextSibling).data("tracking")&&(!(0<_(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<_(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||_(e[0].previousSibling).data("tracking"));)_(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function $(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!_(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&$(_(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?$(e.firstChild.nextSibling,t,a):$(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;_(e).remove(),$(n,t)}var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(_(e).before(s),M.track_changes.pushChange(r);o&&_(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!_(o).hasClass("fr-marker")&&!_(o).is("[data-track-id]")&&0===_(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&_(o).data("tracking-img","true"),M.node.isBlock(o)&&"HR"!==e.tagName)return $(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,$(o.firstChild,t,a);break}c||(o=o.nextSibling,_(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||$(o,t,a),a?P.push({span:s,"delete":l}):(M.helpers.isIOS()&&P.push({"delete":l}),_(s).prepend(l)),M.browser.msie?_(s).prepend("".concat(U.INVISIBLE_SPACE+U.MARKERS)):_(s).prepend("".concat(U.INVISIBLE_SPACE)),_(s).append("".concat(U.INVISIBLE_SPACE+U.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!M.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(M.node.isBlock(p)?"HR"===p.tagName?$(p.nextSibling,t,a):(M.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&_(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),$(p.firstChild,t,a)):$(p,t,a))}}}}}function p(e){if(M.opts.trackChangesEnabled){M.selection.restore();var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");if(_(t).data("tracking"))return;if(!a.length&&!M.selection.isCollapsed()&&"quote"!=e){M.selection.save(),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0));var n=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)_(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;_(i).after(n)}M.selection.restore()}}}function u(e,t,a){if(e&&!("<br>"===_(e).html()&&_(e).parent().is("td")||(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&u(_(e).parent().next()[0],t,a),_(e).is("br")&&_(e).parent().length&&_(e).parent().is("td")&&0===_(e).parent().text().length))){for(a||(a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),M.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?u(e.firstChild.nextSibling,t,a):u(e.firstChild,t,a),!1;var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(_(e).before(r);s&&_(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!_(s).hasClass("fr-marker")&&0===_(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(M.node.isBlock(s)&&"HR"!==e.tagName)return u(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,u(s.firstChild,t,a);break}l||(s=s.nextSibling,_(i).append(o.cloneNode(!0)),_(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||u(s,t,a),_(s).hasClass("fr-marker")&&_(r).append(s),_(r).prepend(i),_(r).prepend("".concat(U.INVISIBLE_SPACE)),_(r).append("".concat(U.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!M.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(M.node.isBlock(h)?"HR"===h.tagName?u(h.nextSibling,t,a):u(h.firstChild,t,a):u(h,t,a))}}}}function k(e,t,a){var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function m(){if(M.events.trigger("image.hideResizer"),M.events.trigger("video.hideResizer"),M.html.cleanEmptyTags(!0),M.helpers.isMobile())for(var e=M.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=_(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){M.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=c();if(e){var t,a=M.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=_(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=_(a).data("tracking-deleted")?_(a):_(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):(M.selection.save(),0<_(s).find("IFRAME").length?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,M.selection.restore())}}t&&t.remove()}m()}function a(){var e=c();if(e){var t=M.$el.find("[data-track-id=".concat(e,"]"));if(t.length){M.selection.save();for(var a=t.length-1;0<=a;a--){var n=_(t).data("tracking-deleted")?_(t):_(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<_(t).find("IFRAME").length)_(t).removeData("tracking"),_(t).removeData("track-id"),_(t).removeClass("fr-highlight-change"),_(t).removeClass("fr-tracking-deleted"),_(t).removeData("tracking-deleted"),_(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(_(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}M.selection.restore()}}m()}return M.events.on("keydown",function(e){var t,a;if(!M.opts.trackChangesEnabled)return!0;if(l=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,M.helpers.isAndroid()){var n,r,i=M.selection.get();I=null==i?void 0:null===(n=i.focusNode)||void 0===n?void 0:n.nodeValue,w=null==i?void 0:i.focusNode,T=null===(r=w)||void 0===r?void 0:r.nextSibling,L=null==i?void 0:i.focusOffset}else if(function s(e){return(!M.keys.ctrlKey(e)||e.which!==U.KEYCODE.Z&&e.which!==U.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!M.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(M.keys.ctrlKey(e)&&"a"===e.key||M.keys.ctrlKey(e)&&"s"===e.key)return;f(e)}else p()},!0),M.events.on("keyup",function(e){if(!M.opts.trackChangesEnabled)return!0;var t,a;if(M.helpers.isMobile())if(i=null===(t=M.selection.get())||void 0===t?void 0:null===(a=t.focusNode)||void 0===a?void 0:a.nodeValue,h){for(var n=0;n<P.length;n++)M.opts.showChangesEnabled&&_(P[n].span).empty(),_(P[n].span).prepend(P[n]["delete"]);h=!(P=[])}else if(M.helpers.isIOS()){for(var r=0;r<P.length;r++)i&&1===i.length&&l&&1==l.length?(_(P[r]["delete"]).attr("contenteditable","true"),_(P[r]["delete"]).addClass("fr-ios-mobile-disable-select")):_(P[r]["delete"]).attr("contenteditable","false");P=[]}else{if(46===e.keyCode)return!0;f(e)}},!0),M.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!M.opts.trackChangesEnabled)return!0;if(M.helpers.isAndroid()){var n=M.selection.get(),r=M.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=_(i).parentsUntil(M.$el,"[data-tracking=true]"),o=_(s).parentsUntil(M.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return h=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||M.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c,d;if(h=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(d=c.item(0))&&void 0!==d&&d.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,f(e)}}},!0),M.events.on("paste.before",function(e){M.opts.trackChangesEnabled&&M.helpers.isMobile()&&f(e)},!0),M.events.on("paste.after",function(e){if(M.opts.trackChangesEnabled){M.markers.insert();for(var t=M.$el.find(".fr-marker"),a=t.parent().data("tracking")?t.parent():t.parent().find("[data-tracking=true]"),n=a.children().eq(0).is("ul"),r=t.next();r.is("br");)(r=r.next()).prev().remove(),r.next().is("br")&&r.next().remove();if(r.is("ul")){var i=r.find("li");i.find("[data-tracking=true]").addClass("fr-highlight-change");var s=i[0].innerHTML;if(i.html(""),i.insertAfter(t.closest("li")),0==r.parent().find("[data-tracking=true]").length)return void i.append(s);if(r.remove(),a.data("tracking")){var l=a[0].innerHTML;0<l.trim().length&&a.parent().append(l),i.append(a),a.html(s)}else if(!n)return a.insertBefore(a.closest("ul")),void a.next().remove();M.markers.remove(),i.next().length&&i.next().is("li")&&""==i.next().text().trim()&&i.next().remove();var o=i.prev().children().eq(0);o.is("br")&&o.remove()}}},!0),M.events.on("image.inserted",function(e){M.helpers.isMobile()&&M.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),M.events.on("image.removed",function(e){if(M.helpers.isMobile()&&M.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");M.markers.insert();var n=M.$el.find(".fr-marker"),r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),_(t).data("tracking")||a.length?(_(n).replaceWith(l),_(l).append(e),M.markers.remove()):(_(n).replaceWith(s),_(s).prepend(l),_(l).append(e),M.markers.remove(),M.track_changes.pushChange(r))}}),M.events.on("commands.before",function(t){if(!M.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)p(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){M.selection.save();for(var a=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;_(s).append(l),_(i).append(s),_(a.parentNode).after(_("<p></p>")),_(a.parentNode.nextSibling).append(i),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),_(a.parentNode.nextSibling).after(_("<p></p>")),_(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),M.track_changes.pushChange(r),M.selection.restore()}}else{if(U.COMMANDS[t]&&(U.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===U.COMMANDS[t].type||U.COMMANDS[t].more_btn||U.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t)return void(M.opts.trackChangesEnabled&&function(){g=M.selection.blocks();for(var a=[],n=0,e=0;e<g.length;e++){n=e<n?n:e;var t=_(g[e]);if(t.is("li"))t.siblings("li").each(function(e,t){_(t).find("li").length&&(a.push({index:n,item:t}),n+=1)});d[e]=_("<span>".concat(t.get(0).innerHTML,"</span>"))}for(var r=0,i=a;r<i.length;r++){var s=i[r],l=s.index,o=s.item,c=_(_(o).get(0).outerHTML);c.find("ul").remove(),c.find("ol").remove(),d=[].concat(j(d.slice(0,l+1)),[_("<span>".concat(c.get(0).innerHTML,"</span>"))],j(d.slice(l+1))),g=[].concat(j(g.slice(0,l+1)),[o],j(g.slice(l+1)))}}());f()}},!0),M.events.on("commands.after",function(e){if(!M.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=M.$el.find("[data-tracking=true]");s.splice(0,s.length);for(var t=0;t<e.length;t++){var a=_(e.get(t)).data("track-id");s[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&M.opts.trackChangesEnabled){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length);for(var a in g){var n=_(g[a]);d[a]&&(k(n,d[a],t),d[a]=null,o[a]=null)}M.track_changes.pushChange(t),d=[],g=null}},!0),M.events.on("quickInsert.commands.before",function(e){M.opts.trackChangesEnabled&&f(e)}),{toggleTracking:function n(){M.opts.trackChangesEnabled&&-1<M.html.get(!0,!0).indexOf("data-tracking")||M.opts.trackChangesEnabled&&0<M.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(M.commands.moreTrackChanges(),M.opts.trackChangesEnabled=!M.opts.trackChangesEnabled,M.opts.trackChangesEnabled||(M.opts.showChangesEnabled=!1))},pushChange:function r(e){s.push(e)},insertChangeAt:function b(e,t){s=[].concat(j(s.slice(0,e)),[t],j(s.slice(e)))},popChange:c,getPendingChanges:function v(){return s},showChanges:function C(){if(M.opts.showChangesEnabled=!M.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(_(e.get(a)).removeClass("fr-track-hide"),_(e.get(a)).removeClass("fr-track-hide-mobile")):M.helpers.isMobile()?_(e.get(a)).addClass("fr-track-hide-mobile"):_(e.get(a)).addClass("fr-track-hide")}(M.$el.find(".fr-tracking-deleted"),M.opts.showChangesEnabled),M.opts.showChangesEnabled)for(var e=M.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)_(e.get(t)).addClass("fr-highlight-change");else for(var a=M.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)_(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function S(){for(;0!=M.track_changes.getPendingChanges().length;)t();s=[],e(),M.$el.find("li").each(function(){!_(this).children()[0]||"OL"!==_(this).children()[0].tagName&&"UL"!==_(this).children()[0].tagName||e()})},rejectAllChanges:function N(){for(;0!=M.track_changes.getPendingChanges().length;)a();s=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function E(e){var t=M.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!s.length),e.toggleClass("fr-active",s.length).attr("aria-pressed",s.length),0<!t.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var a=M.$tb.find('.fr-command[data-cmd="markdown"]');a&&M.opts.trackChangesEnabled?a.addClass("fr-disabled"):a&&!_(".fr-active.fr-popup").length&&a.removeClass("fr-disabled");var n=M.$tb.find('.fr-command[data-cmd="showChanges"]');n&&M.opts.trackChangesEnabled&&n.removeClass("fr-disabled")},replaceSpecialItem:function y(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),u(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),$(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=_(this),n=a[0].innerText;_(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),M.track_changes.pushChange(r)}},addQuote:function O(e){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(t)},removeQuote:function V(e,t){if(!(0<t)){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(a)}},wrapInTracking:function D(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),M.track_changes.pushChange(a),r},wrapInDelete:function B(e){var t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||(M.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function H(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),M.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function K(e){var t=M.$el.find(".fr-highlight-change");_(t)[0].style.display="block",_(t)[0].innerHTML=e},pasteInEdior:function G(e){var t=M.$el.find(".fr-marker");_(t)[0].outerHTML=e,M.markers.remove()}}},U.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),U.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),U.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),U.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),U.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),U.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),U.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),U.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),U.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.11 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2021 Froala Labs
4
+ * Copyright 2014-2022 Froala Labs
5
5
  */
6
6
 
7
7
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(e){"use strict";(e=e&&e.hasOwnProperty("default")?e["default"]:e).PLUGINS.trimVideoPlugin=function(c){var o,d,s,l,u,m,f,v,r;function p(e){e.preventDefault(),null!=l&&l.abort(),l=null;var t=document.getElementById("videoTrimContainer");t.parentNode.removeChild(t),c.filesManager.setChildWindowState(!1)}function g(e){var t=parseInt(e,10),n=Math.floor(t/3600)?String(Math.floor(t/3600)):"00",a=Math.floor(t/60)%60?String(Math.floor(t/60)%60):"00",i=t%60?String(t%60):"00";return i=i.length<2?"0"+i:i,a=a.length<2?"0"+a:a,(n=n.length<2?"0"+n:n)+":"+a+":"+i}function y(e){e.preventDefault();var t=g(document.getElementById("startTime").value),n=g(document.getElementById("endTime").value);o.constructor===Blob&&(o=new File([o],o.name,{type:o.type||"",lastModified:o.lastModified}));var a=new FormData;a.append("startTime",t),a.append("endTime",n),a.append("file",o);var i=new XMLHttpRequest;document.getElementById("trim-file-loader").classList.add("fr-file-loader"),document.getElementsByClassName("fr-trim-button")[0].style.display="none",i.onload=function(){if(200==this.status){var e=new Blob([this.response],{type:this.response.type||""});e.name=o.name,e.lastModified=o.lastModified,e.lastModifiedDate=o.lastModifiedDate,r.set(d,e),c.filesManager.upload(e,[],null,d),document.getElementById("trim-file-loader").classList.remove("fr-file-loader"),document.getElementsByClassName("fr-trim-button")[0].style.display="block";var t=document.getElementById("videoTrimContainer");t.parentNode.removeChild(t),c.filesManager.setChildWindowState(!1)}},i.open("POST","http://localhost:3000/convert",!0),i.responseType="blob",(l=i).send(a)}return{_init:function e(){},trimVideo:function i(e,t,n){o=e,d=t,r=n,function a(){var e=URL.createObjectURL(o),t=c.o_doc.body,n=c.o_doc.createElement("div");n.setAttribute("id","videoTrimContainer"),n.style.cssText="position: fixed; top: 0;left: 0;padding: 0;overflow-y:auto;width: 100%;height: 100%;background: rgba(0,0,0,0.4);z-index: 9998;display:block",t.appendChild(n);var r=document.createElement("div");r.setAttribute("id","fr-form-container"),r.innerHTML='\n <h3 class="fr-trim-video-name"> '.concat(o.name.replace(/\.[^.]*$/,""),"</h3>\n <div style='display:block;text-align: center; margin-left:50%;' id='trim-file-loader'></div>\n <video id='fr-video-edit' controls>\n <source src=").concat(e," >\n Your browser does not support the video tag.\n </video> \n "),document.getElementById("videoTrimContainer").appendChild(r),document.getElementById("fr-video-edit").addEventListener("loadedmetadata",function(){s=document.getElementById("fr-video-edit").duration,r.innerHTML+=' \n \n <form>\n <center>\n <section class="fr-range-slider ">\n <div id="startTimeValue" class=" fr-range-value-start"> </div>\n <input type="range" class="fr-slider" value=\'0\' min="0" max='.concat(s,' id=\'startTime\' >\n <div id="endTimeValue" class="fr-range-value-end" ></div>\n <input type="range"class="fr-slider" value=').concat(s," min='0' max=").concat(s," id='endTime'>\n <div id=\"selectedRange\"style=\" pointer-events: none; position: absolute;left: 0;top: 12px;width: 100%;\n outline: none;\n height: 6px;\n border-radius: 10px;\"></div>\n </section>\n </center>\n <div class=\"fr-video-trim-buttons\" >\n <button id='convert' class='fr-trim-button'>").concat(c.language.translate("Trim"),"</button> \n <button id='cancel' class='fr-trim-button' onsubmit='cancel()'>").concat(c.language.translate("Cancel"),"</button>\n </div>\n </form>\n ");var t=document.getElementById("startTime"),e=document.getElementById("startTimeValue"),n=function n(){u=Number(100*(t.value-t.min)/(t.max-t.min)),m=10-.2*u,f=Number(100*(a.value-a.min)/(a.max-a.min)),v=10-.2*f,e.innerHTML="<span>".concat(g(t.value),"</span>"),e.style.left="calc(".concat(u,"% + (").concat(m,"px))"),selectedRange.style.left=e.style.left,selectedRange.style.width="calc((".concat(f,"% + (").concat(v,"px)) - (").concat(u,"% + (").concat(m,"px)))"),selectedRange.style.backgroundColor="#03A9F4"};document.addEventListener("DOMContentLoaded",n);var a=document.getElementById("endTime"),i=document.getElementById("endTimeValue"),o=function o(){u=Number(100*(t.value-t.min)/(t.max-t.min)),m=10-.2*u,f=Number(100*(a.value-a.min)/(a.max-a.min)),v=10-.2*f,i.innerHTML="<span>".concat(g(a.value),"</span>"),i.style.left="calc(".concat(f,"% + (").concat(v,"px))");var e=document.getElementById("selectedRange");e.style.left="calc(".concat(u,"% + (").concat(m,"px))"),e.style.width="calc((".concat(f,"% + (").concat(v,"px)) - (").concat(u,"% + (").concat(m,"px)))"),e.style.backgroundColor="#03A9F4"};document.addEventListener("DOMContentLoaded",o),document.getElementById("convert").addEventListener("click",y),document.getElementById("cancel").addEventListener("click",p);var d=document.getElementById("startTime"),l=document.getElementById("endTime");d.oninput=function(e){if(Number(d.value)>=Number(l.value))return e.preventDefault(),d.value=String(Number(l.value)-1),!1;n()},l.oninput=function(e){if(Number(l.value)<=Number(d.value))return e.preventDefault(),l.value=String(Number(d.value)+1),!1;o()}})}()}}}});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.11 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2021 Froala Labs
4
+ * Copyright 2014-2022 Froala Labs
5
5
  */
6
6
 
7
7
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(r){"use strict";(r=r&&r.hasOwnProperty("default")?r["default"]:r).URLRegEx="(^| |\\u00A0)(".concat(r.LinkRegEx,"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$"),r.PLUGINS.url=function(i){var l=i.$,a=null;function t(e,t,n){for(var r="";n.length&&"."==n[n.length-1];)r+=".",n=n.substring(0,n.length-1);var o=n;if(i.opts.linkConvertEmailAddress)i.helpers.isEmail(o)&&!/^mailto:.*/i.test(o)&&(o="mailto:".concat(o));else if(i.helpers.isEmail(o))return t+n;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(o)||(o="//".concat(o)),(t||"")+"<a".concat(i.opts.linkAlwaysBlank?' target="_blank"':"").concat(a?' rel="'.concat(a,'"'):"",' data-fr-linked="true" href="').concat(o,'">').concat(n.replace(/&amp;/g,"&").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"</a>").concat(r)}var s=function s(){return new RegExp(r.URLRegEx,"gi")};function p(e){return i.opts.linkAlwaysNoFollow&&(a="nofollow"),i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(a?a+=" noopener":a="noopener"),i.opts.linkNoReferrer&&(a?a+=" noreferrer":a="noreferrer")),e.replace(s(),t)}function c(e){var t=e.split(" ");return t[t.length-1]}function n(){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 a(e){return!!e&&("A"===e.tagName||!(!e.parentNode||e.parentNode==i.el)&&a(e.parentNode))}(t))return!1;if(s().test(c(t.textContent))){l(t).before(p(t.textContent));var n=l(t.parentNode).find("a[data-fr-linked]");n.removeAttr("data-fr-linked"),t.parentNode.removeChild(t),i.events.trigger("url.linked",[n.get(0)])}else if(t.textContent.split(" ").length<=2&&t.previousSibling&&"A"===t.previousSibling.tagName){var r=t.previousSibling.innerText+t.textContent;if(s().test(c(r))){var o=(new DOMParser).parseFromString(p(r),"text/html").body.childNodes;t.parentNode.replaceChild(o[0],t.previousSibling),o.length&&l(t).before(o[0]),t.parentNode.removeChild(t)}}}return{_init:function e(){i.events.on("keypress",function(e){!i.selection.isCollapsed()||")"!=e.key&&"("!=e.key||n()},!0),i.events.on("keydown",function(e){var t=e.which;!i.selection.isCollapsed()||t!=r.KEYCODE.ENTER&&t!=r.KEYCODE.SPACE||n()},!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".concat(i.opts.linkAlwaysBlank?' target="_blank"':"").concat(t?' rel="'.concat(t,'"'):"",' href="').concat(e,'" >').concat(e,"</a>")}})}}}});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.0.8 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.0.11 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2021 Froala Labs
4
+ * Copyright 2014-2022 Froala Labs
5
5
  */
6
6
 
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(we){"use strict";we=we&&we.hasOwnProperty("default")?we["default"]:we,Object.assign(we.POPUP_TEMPLATES,{"video.insert":"[_BUTTONS_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_LAYER_][_PROGRESS_BAR_]","video.edit":"[_BUTTONS_]","video.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(we.DEFAULTS,{videoAllowedTypes:["mp4","webm","ogg","mp3","mpeg","url"],videoAllowedProviders:[".*"],videoDefaultAlign:"center",videoDefaultDisplay:"block",videoDefaultWidth:600,videoEditButtons:["videoReplace","videoRemove","videoDisplay","videoAlign","videoSize","autoplay"],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,videoUploadToAzure:!1,videoUploadURL:null}),we.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&rel=0" 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"}],we.VIDEO_EMBED_REGEX=/^\W*((<iframe(.|\n)*>(\s|\n)*<\/iframe>)|(<embed(.|\n)*>))\W*$/i,we.PLUGINS.video=function(w){var s,p,f,E,i,o,A=w.$,C="https://i.froala.com/upload",c=2,v=3,u=4,S=5,U=6,r={};function g(){var e=w.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 a(){var e=w.popups.get("video.edit");if(e||(e=function n(){var e="";if(0<w.opts.videoEditButtons.length){w.opts.videoResponsive&&(-1<w.opts.videoEditButtons.indexOf("videoSize")&&w.opts.videoEditButtons.splice(w.opts.videoEditButtons.indexOf("videoSize"),1),-1<w.opts.videoEditButtons.indexOf("videoDisplay")&&w.opts.videoEditButtons.splice(w.opts.videoEditButtons.indexOf("videoDisplay"),1),-1<w.opts.videoEditButtons.indexOf("videoAlign")&&w.opts.videoEditButtons.splice(w.opts.videoEditButtons.indexOf("videoAlign"),1));var t={buttons:e+='<div class="fr-buttons"> \n '.concat(w.button.buildList(w.opts.videoEditButtons)," \n </div>")},o=w.popups.create("video.edit",t);return w.events.$on(w.$wp,"scroll.video-edit",function(){E&&w.popups.isVisible("video.edit")&&(w.events.disableBlur(),y(E))}),o}return!1}()),e){w.popups.setContainer("video.edit",w.$sc),w.popups.refresh("video.edit");var t=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),o=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight(),r=t.get(0).src?t.get(0).src:t.get(0).currentSrc,a=!(!(r=(r=r.split("."))[r.length-1]).includes("pdf")&&!r.includes("txt"));t.hasClass("fr-file")||a||E.find("audio").get(0)?(document.getElementById("autoplay-".concat(w.id))&&(document.getElementById("autoplay-".concat(w.id)).style.display="none"),document.getElementById("videoReplace-".concat(w.id))&&(document.getElementById("videoReplace-".concat(w.id)).style.display="none")):(document.getElementById("autoplay-".concat(w.id))&&(document.getElementById("autoplay-".concat(w.id)).style.display=""),document.getElementById("videoReplace-".concat(w.id))&&(document.getElementById("videoReplace-".concat(w.id)).style.display="")),w.popups.show("video.edit",o,i,t.outerHeight(),!0)}}function n(e){if(e)return w.popups.onRefresh("video.insert",g),w.popups.onHide("video.insert",J),!0;var t="";w.opts.videoUpload||-1===w.opts.videoInsertButtons.indexOf("videoUpload")||w.opts.videoInsertButtons.splice(w.opts.videoInsertButtons.indexOf("videoUpload"),1);var o=w.button.buildList(w.opts.videoInsertButtons);""!==o&&(t='<div class="fr-buttons">'+o+"</div>");var i,r="",a=w.opts.videoInsertButtons.indexOf("videoUpload"),n=w.opts.videoInsertButtons.indexOf("videoByURL"),s=w.opts.videoInsertButtons.indexOf("videoEmbed");if(0<=n){i=" fr-active",(a<n&&0<=a||s<n&&0<=s)&&(i="");r='<div class="fr-video-by-url-layer fr-layer'.concat(i,'" id="fr-video-by-url-layer-').concat(w.id,'"><div class="fr-input-line"><input id="fr-video-by-url-layer-text-').concat(w.id,'" type="text" placeholder="').concat(w.language.translate("Paste in a video URL"),'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><span style=\'float:left\'><div class="fr-checkbox-line fr-autoplay-margin"><span class="fr-checkbox"> <input id=\'videoPluginAutoplay\' data-checked="_blank" type="checkbox"> <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(w.id,'">Autoplay</label></div> </span><button type="button" class="fr-command fr-submit" data-cmd="videoInsertByURL" tabIndex="2" role="button">').concat(w.language.translate("Insert"),"</button></div></div>")}var d="";0<=s&&(i=" fr-active",(a<s&&0<=a||n<s&&0<=n)&&(i=""),d='<div class="fr-video-embed-layer fr-layer'.concat(i,'" id="fr-video-embed-layer-').concat(w.id,'"><div class="fr-input-line"><textarea id="fr-video-embed-layer-text').concat(w.id,'" type="text" placeholder="').concat(w.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">').concat(w.language.translate("Insert"),"</button></div></div>"));var l="";0<=a&&(i=" fr-active",(s<a&&0<=s||n<a&&0<=n)&&(i=""),l='<div class="fr-video-upload-layer fr-layer'.concat(i,'" id="fr-video-upload-layer-').concat(w.id,'"><strong>').concat(w.language.translate("Drop video"),"</strong><br>(").concat(w.language.translate("or click"),')<div class="fr-form"><input type="file" accept="video/').concat(w.opts.videoAllowedTypes.join(", video/").toLowerCase(),'" tabIndex="-1" aria-labelledby="fr-video-upload-layer-').concat(w.id,'" role="button"></div></div>'));var p={buttons:t,by_url_layer:r,embed_layer:d,upload_layer:l,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=w.popups.create("video.insert",p);return function c(i){w.events.$on(i,"dragover dragenter",".fr-video-upload-layer",function(){return A(this).addClass("fr-drop"),!1},!0),w.events.$on(i,"dragleave dragend",".fr-video-upload-layer",function(){return A(this).removeClass("fr-drop"),!1},!0),w.events.$on(i,"drop",".fr-video-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),A(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var o=i.data("instance")||w;o.events.disableBlur(),o.video.upload(t.files),o.events.enableBlur()}},!0),w.helpers.isIOS()&&w.events.$on(i,"touchstart",'.fr-video-upload-layer input[type="file"]',function(){A(this).trigger("click")},!0);w.events.$on(i,"change",'.fr-video-upload-layer input[type="file"]',function(){if(this.files){var e=i.data("instance")||w;e.events.disableBlur(),i.find("input:focus").blur(),e.events.enableBlur(),e.video.upload(this.files)}A(this).val("")},!0)}(f),f}function d(e){w.events.focus(!0),w.selection.restore();var t=!1;if(E&&(q(),t=!0),w.opts.trackChangesEnabled){w.edit.on(),w.events.focus(!0),w.selection.restore(),w.undo.saveStep(),w.markers.insert(),w.html.wrap();var o=w.$el.find(".fr-marker");w.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith('<span contenteditable="false" draggable="true" class="fr-jiv fr-video fr-deletable">'.concat(e,"</span>")),w.selection.clear()}else w.html.insert('<span contenteditable="false" draggable="true" class="fr-jiv fr-video fr-deletable">'.concat(e,"</span>"),!1,w.opts.videoSplitHTML);w.popups.hide("video.insert");var i=w.$el.find(".fr-jiv");i.removeClass("fr-jiv"),i.toggleClass("fr-rv",w.opts.videoResponsive),Z(i,w.opts.videoDefaultDisplay,w.opts.videoDefaultAlign),i.toggleClass("fr-draggable",w.opts.videoMove),w.events.trigger(t?"video.replaced":"video.inserted",[i])}function h(){var e=A(this);w.popups.hide("video.insert"),e.removeClass("fr-uploading"),e.parent().next().is("br")&&e.parent().next().remove(),y(e.parent()),w.events.trigger("video.loaded",[e.parent()])}function R(s,e,d,l,p){w.edit.off(),m("Loading video"),e&&(s=w.helpers.sanitizeURL(s));var f=function f(){var e,t;if(l){w.undo.canDo()||l.find("video").hasClass("fr-uploading")||w.undo.saveStep();var o=l.find("video").data("fr-old-src"),i=l.data("fr-replaced");if(l.data("fr-replaced",!1),0<l.find("iframe").length)l.remove(),e=I(s,d,h);else{w.$wp?((e=l.clone(!0)).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),o&&l.find("video").attr("src",o),l.replaceWith(e)):e=l;for(var r=e.find("video").get(0).attributes,a=0;a<r.length;a++){var n=r[a];0===n.nodeName.indexOf("data-")&&e.find("video").removeAttr(n.nodeName)}if(void 0!==d)for(t in d)d.hasOwnProperty(t)&&"link"!=t&&e.find("video").attr("data-".concat(t),d[t]);e.find("video").on("canplay",h),e.find("video").attr("src",s)}w.edit.on(),O(),w.undo.saveStep(),w.$el.blur(),w.events.trigger(i?"video.replaced":"video.inserted",[e,p])}else e=I(s,d,h),O(),w.undo.saveStep(),w.events.trigger("video.inserted",[e,p])};x("Loading video"),f()}function x(e){var t=w.popups.get("video.insert");if(t||(t=n()),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(),E){var o=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video"));w.popups.setContainer("video.insert",w.$sc);var i=o.offset().left,r=o.offset().top+o.height();w.popups.show("video.insert",i,r,o.outerHeight())}void 0===e&&m(w.language.translate("Uploading"),0)}function l(e){var t=w.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||w.$el.find("video.fr-error").length)){if(w.events.focus(),w.$el.find("video.fr-error").length&&(w.$el.find("video.fr-error").parent().remove(),w.undo.saveStep(),w.undo.run(),w.undo.dropRedo()),!w.$wp&&E){var o=E;V(!0),w.selection.setAfter(o.find("video").get(0)),w.selection.restore()}w.popups.hide("video.insert")}}function m(e,t){var o=w.popups.get("video.insert");if(o){var i=o.find(".fr-video-progress-bar-layer");i.find("h3").text(e+(t?" ".concat(t,"%"):"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width","".concat(t,"%"))):i.find("div").addClass("fr-indeterminate")}}function b(e){x();var t=w.popups.get("video.insert").find(".fr-video-progress-bar-layer");t.addClass("fr-error");var o=t.find("h3");o.text(e),w.events.disableBlur(),o.focus()}function y(e){t.call(e.get(0))}function _(e,t,o){m("Loading video");var i=this.status,r=this.response,a=this.responseXML,n=this.responseText;try{if(w.opts.videoUploadToS3||w.opts.videoUploadToAzure)if(201==i){var s;if(w.opts.videoUploadToAzure){if(!1===w.events.trigger("video.uploadedToAzure",[this.responseURL,o,r],!0))return w.edit.on(),!1;s=t}else s=function l(e){try{var t=A(e).find("Location").text(),o=A(e).find("Key").text();return!1===w.events.trigger("video.uploadedToS3",[t,o,e],!0)?(w.edit.on(),!1):t}catch(i){return F(u,e),!1}}(a);s&&R(s,!1,[],e,r||a)}else F(u,r||a);else if(200<=i&&i<300){var d=function p(e){try{if(!1===w.events.trigger("video.uploaded",[e],!0))return w.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(F(c,e),!1)}catch(o){return F(u,e),!1}}(n);d&&R(d.link,!1,d,e,r||n)}else F(v,r||n)}catch(f){F(u,r||n)}}function B(){F(u,this.response||this.responseText||this.responseXML)}function D(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;m(w.language.translate("Uploading"),t)}}function k(){w.edit.on(),l(!0)}function I(e,t,o){var i,r="";if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(r+=" data-".concat(i,'="').concat(t[i],'"'));var a=w.opts.videoDefaultWidth;a&&"auto"!=a&&(a="".concat(a,"px")),w.helpers.isMobile()&&w.browser.safari&&(r+=" autoplay playsinline");var n=A(document.createElement("span")).attr("contenteditable","false").attr("draggable","true").attr("class","fr-video fr-dv"+w.opts.videoDefaultDisplay[0]+("center"!=w.opts.videoDefaultAlign?" fr-fv"+w.opts.videoDefaultAlign[0]:"")).html('<video src="'+e+'" '+r+(a?' style="width: '+a+';" ':"")+" controls>"+w.language.translate("Your browser does not support HTML5 video.")+"</video>");n.toggleClass("fr-draggable",w.opts.videoMove),w.edit.on(),w.events.focus(!0),w.selection.restore(),w.undo.saveStep(),w.opts.videoSplitHTML?w.markers.split():w.markers.insert(),w.html.wrap();var s=w.$el.find(".fr-marker");return w.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(n),w.selection.clear(),n.find("video").get(0).readyState>n.find("video").get(0).HAVE_FUTURE_DATA||w.helpers.isIOS()?o.call(n.find("video").get(0)):n.find("video").on("canplaythrough load",o),n}function T(e){if(!w.core.sameInstance(f))return!0;e.preventDefault(),e.stopPropagation();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),o=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!o)return!1;if("mousedown"==e.type){var i=w.$oel.get(0).ownerDocument,r=i.defaultView||i.parentWindow,a=!1;try{a=r.location!=r.parent.location&&!(r.$&&r.$.FE)}catch(n){}a&&r.frameElement&&(t+=w.helpers.getPX(A(r.frameElement).offset().left)+r.frameElement.clientLeft,o=e.clientY+w.helpers.getPX(A(r.frameElement).offset().top)+r.frameElement.clientTop)}w.undo.canDo()||w.undo.saveStep(),(p=A(this)).data("start-x",t),p.data("start-y",o),s.show(),w.popups.hideAll(),Y()}function z(e){if(!w.core.sameInstance(f))return!0;if(p){e.preventDefault();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),o=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!o)return!1;var i=p.data("start-x"),r=p.data("start-y");p.data("start-x",t),p.data("start-y",o);var a=t-i,n=o-r,s=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),d=s.width(),l=s.height();(p.hasClass("fr-hnw")||p.hasClass("fr-hsw"))&&(a=0-a),(p.hasClass("fr-hnw")||p.hasClass("fr-hne"))&&(n=0-n),s.css("width",d+a),s.css("height",l+n),s.removeAttr("width"),s.removeAttr("height"),M()}}function P(e){if(!w.core.sameInstance(f))return!0;p&&E&&(e&&e.stopPropagation(),p=null,s.hide(),M(),a(),w.undo.saveStep())}function $(e){return'<div class="fr-handler fr-h'.concat(e,'"></div>')}function L(e,t,o,i){return e.pageX=t,e.pageY=t,T.call(this,e),e.pageX=e.pageX+o*Math.floor(Math.pow(1.1,i)),e.pageY=e.pageY+o*Math.floor(Math.pow(1.1,i)),z.call(this,e),P.call(this,e),++i}function O(){var e,t=Array.prototype.slice.call(w.el.querySelectorAll("video, .fr-video > *")),o=[];for(e=0;e<t.length;e++)o.push(t[e].getAttribute("src")),A(t[e]).toggleClass("fr-draggable",w.opts.videoMove),""===t[e].getAttribute("class")&&t[e].removeAttribute("class"),""===t[e].getAttribute("style")&&t[e].removeAttribute("style");if(i)for(e=0;e<i.length;e++)o.indexOf(i[e].getAttribute("src"))<0&&w.events.trigger("video.removed",[A(i[e])]);i=t}function M(){f||function n(){var e;if(w.shared.$video_resizer?(f=w.shared.$video_resizer,s=w.shared.$vid_overlay,w.events.on("destroy",function(){A("body").first().append(f.removeClass("fr-active"))},!0)):(w.shared.$video_resizer=A(document.createElement("div")).attr("class","fr-video-resizer"),f=w.shared.$video_resizer,w.events.$on(f,"mousedown",function(e){e.stopPropagation()},!0),w.opts.videoResize&&(f.append($("nw")+$("ne")+$("sw")+$("se")),w.shared.$vid_overlay=A(document.createElement("div")).attr("class","fr-video-overlay"),s=w.shared.$vid_overlay,e=f.get(0).ownerDocument,A(e).find("body").first().append(s))),w.events.on("shared.destroy",function(){f.html("").removeData().remove(),f=null,w.opts.videoResize&&(s.remove(),s=null)},!0),w.helpers.isMobile()||w.events.$on(A(w.o_win),"resize.video",function(){V(!0)}),w.opts.videoResize){e=f.get(0).ownerDocument,w.events.$on(f,w._mousedown,".fr-handler",T),w.events.$on(A(e),w._mousemove,z),w.events.$on(A(e.defaultView||e.parentWindow),w._mouseup,P),w.events.$on(s,"mouseleave",P);var i=1,r=null,a=0;w.events.on("keydown",function(e){if(E){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,o=e.which;(o!==r||200<e.timeStamp-a)&&(i=1),(o==we.KEYCODE.EQUALS||w.browser.mozilla&&o==we.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=L.call(this,e,1,1,i):(o==we.KEYCODE.HYPHEN||w.browser.mozilla&&o==we.KEYCODE.FF_HYPHEN)&&t&&!e.altKey&&(i=L.call(this,e,2,-1,i)),r=o,a=e.timeStamp}}),w.events.on("keyup",function(){i=1})}}(),(w.$wp||w.$sc).append(f),f.data("instance",w);var e=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),t=0,o=0;w.opts.iframe&&(o=w.helpers.getPX(w.$wp.find(".fr-iframe").css("padding-top")),t=w.helpers.getPX(w.$wp.find(".fr-iframe").css("padding-left"))),f.css("top",(w.opts.iframe?e.offset().top+o-1:e.offset().top-w.$wp.offset().top-1)+w.$wp.scrollTop()).css("left",(w.opts.iframe?e.offset().left+t-1:e.offset().left-w.$wp.offset().left-1)+w.$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&&o)return!0;if(e&&w.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;if(w.edit.isDisabled())return!1;for(var t=0;t<we.INSTANCES.length;t++)we.INSTANCES[t]!=w&&we.INSTANCES[t].events.trigger("video.hideResizer");w.toolbar.disable(),w.helpers.isMobile()&&(w.events.disableBlur(),w.$el.blur(),w.events.enableBlur()),w.$el.find(".fr-video.fr-active").removeClass("fr-active"),(E=A(this)).addClass("fr-active"),w.opts.iframe&&w.size.syncIframe(),te(),M(),a(),w.selection.clear(),w.button.bulkRefresh(),w.events.trigger("image.hideResizer")}function V(e){E&&(function t(){return w.shared.vid_exit_flag}()||!0===e)&&(f.removeClass("fr-active"),w.toolbar.enable(),E.removeClass("fr-active"),E=null,Y())}function N(){w.shared.vid_exit_flag=!0}function Y(){w.shared.vid_exit_flag=!1}function H(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var o=t.files[0];if(o&&o.type&&-1!==o.type.indexOf("video")){if(!w.opts.videoUpload)return e.preventDefault(),e.stopPropagation(),!1;w.markers.remove(),w.markers.insertAtPoint(e.originalEvent),w.$el.find(".fr-marker").replaceWith(we.MARKERS),w.popups.hideAll();var i=w.popups.get("video.insert");return i||(i=n()),w.popups.setContainer("video.insert",w.$sc),w.popups.show("video.insert",e.originalEvent.pageX,e.originalEvent.pageY),x(),0<=w.opts.videoAllowedTypes.indexOf(o.type.replace(/video\//g,""))?K(t.files):F(U),e.preventDefault(),e.stopPropagation(),!1}}}function K(e){if(void 0!==e&&0<e.length){if(!1===w.events.trigger("video.beforeUpload",[e]))return!1;var t,o=e[0];if(!(null!==w.opts.videoUploadURL&&w.opts.videoUploadURL!=C||w.opts.videoUploadToS3||w.opts.videoUploadToAzure))return function y(i){E&&E.find("iframe")&&E.find("iframe").length&&q();var r=new FileReader;r.onload=function(){r.result;for(var e=atob(r.result.split(",")[1]),t=[],o=0;o<e.length;o++)t.push(e.charCodeAt(o));R(window.URL.createObjectURL(new Blob([new Uint8Array(t)],{type:i.type})),!1,null,E)},x(),r.readAsDataURL(i)}(o),!1;if(o.size>w.opts.videoMaxSize)return F(S),!1;if(w.opts.videoAllowedTypes.indexOf(o.type.replace(/video\//g,""))<0)return F(U),!1;if(w.drag_support.formdata&&(t=w.drag_support.formdata?new FormData:null),t){var i;if(!1!==w.opts.videoUploadToS3)for(i in t.append("key",w.opts.videoUploadToS3.keyStart+(new Date).getTime()+"-"+(o.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",o.type),w.opts.videoUploadToS3.params)w.opts.videoUploadToS3.params.hasOwnProperty(i)&&t.append(i,w.opts.videoUploadToS3.params[i]);for(i in w.opts.videoUploadParams)w.opts.videoUploadParams.hasOwnProperty(i)&&t.append(i,w.opts.videoUploadParams[i]);t.append(w.opts.videoUploadParam,o);var r,a,n=w.opts.videoUploadURL;w.opts.videoUploadToS3&&(n=w.opts.videoUploadToS3.uploadURL?w.opts.videoUploadToS3.uploadURL:"https://".concat(w.opts.videoUploadToS3.region,".amazonaws.com/").concat(w.opts.videoUploadToS3.bucket));var s=w.opts.videoUploadMethod;w.opts.videoUploadToAzure&&(n=w.opts.videoUploadToAzure.uploadURL?"".concat(w.opts.videoUploadToAzure.uploadURL,"/").concat(o.name):encodeURI("https://".concat(w.opts.videoUploadToAzure.account,".blob.core.windows.net/").concat(w.opts.videoUploadToAzure.container,"/").concat(o.name)),r=n,w.opts.videoUploadToAzure.SASToken&&(n+=w.opts.videoUploadToAzure.SASToken),s="PUT");var d=w.core.getXHR(n,s);if(w.opts.videoUploadToAzure){var l=(new Date).toUTCString();if(!w.opts.videoUploadToAzure.SASToken&&w.opts.videoUploadToAzure.accessKey){var p=w.opts.videoUploadToAzure.account,f=w.opts.videoUploadToAzure.container;if(w.opts.videoUploadToAzure.uploadURL){var c=w.opts.videoUploadToAzure.uploadURL.split("/");f=c.pop(),p=c.pop().split(".")[0]}var v="x-ms-blob-type:BlockBlob\nx-ms-date:".concat(l,"\nx-ms-version:2019-07-07"),u=encodeURI("/"+p+"/"+f+"/"+o.name),g=s+"\n\n\n"+o.size+"\n\n"+o.type+"\n\n\n\n\n\n\n"+v+"\n"+u,h=w.cryptoJSPlugin.cryptoJS.HmacSHA256(g,w.cryptoJSPlugin.cryptoJS.enc.Base64.parse(w.opts.videoUploadToAzure.accessKey)).toString(w.cryptoJSPlugin.cryptoJS.enc.Base64),m="SharedKey "+p+":"+h;a=h,d.setRequestHeader("Authorization",m)}for(i in d.setRequestHeader("x-ms-version","2019-07-07"),d.setRequestHeader("x-ms-date",l),d.setRequestHeader("Content-Type",o.type),d.setRequestHeader("x-ms-blob-type","BlockBlob"),w.opts.videoUploadParams)w.opts.videoUploadParams.hasOwnProperty(i)&&d.setRequestHeader(i,w.opts.videoUploadParams[i]);for(i in w.opts.videoUploadToAzure.params)w.opts.videoUploadToAzure.params.hasOwnProperty(i)&&d.setRequestHeader(i,w.opts.videoUploadToAzure.params[i])}d.onload=function(){_.call(d,E,r,a)},d.onerror=B,d.upload.onprogress=D,d.onabort=k,x(),w.events.disableBlur(),w.edit.off(),w.events.enableBlur();var b=w.popups.get("video.insert");b&&A(b.off("abortUpload")).on("abortUpload",function(){4!=d.readyState&&d.abort()}),d.send(w.opts.videoUploadToAzure?o:t)}}}function F(e,t){w.edit.on(),E&&E.find("video").addClass("fr-error"),b(w.language.translate("Something went wrong. Please try again.")),w.events.trigger("video.error",[{code:e,message:r[e]},t])}function X(){if(E){var e=w.popups.get("video.size"),t=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"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 G(e){if(e)return w.popups.onRefresh("video.size",X),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'.concat(w.button.buildList(w.opts.videoSizeButtons),"</div>"),size_layer:'<div class="fr-video-size-layer fr-layer fr-active" id="fr-video-size-layer-'.concat(w.id,'"><div class="fr-video-group"><div class="fr-input-line"><input id="fr-video-size-layer-width-').concat(w.id,'" type="text" name="width" placeholder="').concat(w.language.translate("Width"),'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-video-size-layer-height-').concat(w.id,'" type="text" name="height" placeholder="').concat(w.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">').concat(w.language.translate("Update"),"</button></div></div>")},o=w.popups.create("video.size",t);return w.events.$on(w.$wp,"scroll",function(){E&&w.popups.isVisible("video.size")&&(w.events.disableBlur(),y(E))}),o}function j(e){if(void 0===e&&(e=E),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 W(e){void 0===e&&(e=E);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(E&&!1!==w.events.trigger("video.beforeRemove",[E])){var e=E;if(w.popups.hideAll(),V(!0),w.opts.trackChangesEnabled&&(!e[0].parentNode||"SPAN"!==e[0].parentNode.tagName||!e[0].parentNode.hasAttribute("data-tracking")))return void w.track_changes.removeSpecialItem(e);w.selection.setBefore(e.get(0))||w.selection.setAfter(e.get(0)),e.remove(),w.selection.restore(),w.html.fillEmptyBlocks()}}function J(){l()}function Z(e,t,o){!w.opts.htmlUntouched&&w.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv".concat(o[0]," fr-dv").concat(t[0]))):"inline"==t?(e.css({display:"inline-block"}),"center"==o?e.css({"float":"none"}):"left"==o?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==o?e.css({textAlign:"left"}):"right"==o?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}function Q(){var e=w.$el.find("video").filter(function(){return 0===A(this).parents("span.fr-video").length});if(0!=e.length){e.wrap(A(document.createElement("span")).attr("class","fr-video fr-deletable").attr("contenteditable","false")),w.$el.find("embed, iframe").filter(function(){if(w.browser.safari&&this.getAttribute("src")&&this.setAttribute("src",this.src),0<A(this).parents("span.fr-video").length)return!1;for(var e=A(this).attr("src"),t=0;t<we.VIDEO_PROVIDERS.length;t++){var o=we.VIDEO_PROVIDERS[t];if(o.test_regex.test(e)&&new RegExp(w.opts.videoAllowedProviders.join("|")).test(o.provider))return!0}return!1}).map(function(){return 0===A(this).parents("object").length?this:A(this).parents("object").get(0)}).wrap(A(document.createElement("span")).attr("class","fr-video").attr("contenteditable","false"));for(var t,o,i,r,a=w.$el.find("span.fr-video, video"),n=0;n<a.length;n++){var s=A(a[n]);!w.opts.htmlUntouched&&w.opts.useClasses?((r=s).hasClass("fr-dvi")||r.hasClass("fr-dvb")||(r.addClass("fr-fv".concat(j(r)[0])),r.addClass("fr-dv".concat(W(r)[0]))),w.opts.videoTextNear||s.removeClass("fr-dvi").addClass("fr-dvb")):w.opts.htmlUntouched||w.opts.useClasses||(void 0,o=(t=s).hasClass("fr-dvb")?"block":t.hasClass("fr-dvi")?"inline":null,i=t.hasClass("fr-fvl")?"left":t.hasClass("fr-fvr")?"right":j(t),Z(t,o,i),t.removeClass("fr-dvb fr-dvi fr-fvr fr-fvl"))}a.toggleClass("fr-draggable",w.opts.videoMove)}}function ee(e){document.getElementById("autoplay-".concat(w.id)).style.cssText="background:".concat(e)}function te(){if(E){w.selection.clear();var e=w.doc.createRange();e.selectNode(E.get(0)),w.selection.get().addRange(e)}}return r[1]="Video cannot be loaded from the passed link.",r[c]="No link in upload response.",r[v]="Error during file upload.",r[u]="Parsing response failed.",r[S]="File is too large.",r[U]="Video file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",w.shared.vid_exit_flag=!1,{_init:function oe(){w.opts.videoResponsive&&(w.opts.videoResize=!1),function e(){w.events.on("drop",H,!0),w.events.on("mousedown window.mousedown",N),w.events.on("window.touchmove",Y),w.events.on("mouseup window.mouseup",V),w.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&V()}),w.events.on("video.hideResizer commands.undo commands.redo element.dropped",function(){V(!0)})}(),w.helpers.isMobile()&&(w.events.$on(w.$el,"touchstart","span.fr-video",function(){o=!1}),w.events.$on(w.$el,"touchmove",function(){o=!0})),w.events.on("html.set",Q),Q(),w.events.$on(w.$el,"mousedown","span.fr-video",function(e){e.stopPropagation(),(w.browser.msie||w.browser.edge)&&(e.target.innerText||(e.target.dragDrop(),t.call(this,e)))}),w.events.$on(w.$el,"click touchend","span.fr-video",function(e){if(e.target.innerText.length||"false"==A(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t.call(this,e)}),w.events.on("keydown",function(e){var t=e.which;return!E||t!=we.KEYCODE.BACKSPACE&&t!=we.KEYCODE.DELETE?E&&t==we.KEYCODE.ESC?(V(!0),e.preventDefault(),!1):E&&t!=we.KEYCODE.F10&&!w.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),q(),w.undo.saveStep(),!1)},!0),w.events.on("toolbar.esc",function(){if(E)return w.events.disableBlur(),w.events.focus(),!1},!0),w.events.on("toolbar.focusEditor",function(){if(E)return!1},!0),w.events.on("keydown",function(){w.$el.find("span.fr-video:empty").remove()}),w.$wp&&(O(),w.events.on("contentChanged",O)),n(!0),G(!0)},showInsertPopup:function ie(){var e=w.$tb.find('.fr-command[data-cmd="insertVideo"]'),t=w.popups.get("video.insert");if(t||(t=n()),l(),!t.hasClass("fr-active"))if(w.popups.refresh("video.insert"),w.popups.setContainer("video.insert",w.$tb),e.isVisible()){var o=w.button.getPosition(e),i=o.left,r=o.top;w.popups.show("video.insert",i,r,e.outerHeight())}else w.position.forSelection(t),w.popups.show("video.insert")},showLayer:function re(e){var t,o,i=w.popups.get("video.insert");if(!E&&!w.opts.toolbarInline){var r=w.$tb.find('.fr-command[data-cmd="insertVideo"]');t=r.offset().left,o=r.offset().top+(w.opts.toolbarBottom?10:r.outerHeight()-10)}w.opts.toolbarInline&&(o=i.offset().top-w.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(o+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-".concat(e,"-layer")).addClass("fr-active"),w.popups.show("video.insert",t,o,0),w.accessibility.focusPopup(i)},refreshByURLButton:function ae(e){var t=w.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 ne(e){var t=w.popups.get("video.insert");t&&t.find(".fr-video-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshUploadButton:function se(e){var t=w.popups.get("video.insert");t&&t.find(".fr-video-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:K,insertByURL:function de(e){var t=!!document.getElementById("videoPluginAutoplay")&&document.getElementById("videoPluginAutoplay").checked;void 0===e&&(e=(w.popups.get("video.insert").find('.fr-video-by-url-layer input[type="text"]').val()||"").trim());var o=null;if(/^http/.test(e)||(e="https://".concat(e)),w.helpers.isURL(e))for(var i=0;i<we.VIDEO_PROVIDERS.length;i++){var r=we.VIDEO_PROVIDERS[i],a="autoplay=1&mute=1";if(r.html.includes("autoplay=1")&&document.getElementById("videoPluginAutoplay").checked)r.html=r.html,document.getElementById("videoPluginAutoplay").checked=!1;else if(t){var n=r.html.indexOf("{url}")+5;r.html=[r.html.slice(0,n),a,r.html.slice(n)].join(""),t=!1,document.getElementById("videoPluginAutoplay").checked=!1}else(r=we.VIDEO_PROVIDERS[i]).html=r.html.replace(a,"");if(r.test_regex.test(e)&&new RegExp(w.opts.videoAllowedProviders.join("|")).test(r.provider)){o=e.replace(r.url_regex,r.url_text),o=r.html.replace(/\{url\}/,o);break}}o?d(o):(b(w.language.translate("Something went wrong. Please try again.")),w.events.trigger("video.linkError",[e]))},insertEmbed:function le(e){void 0===e&&(e=w.popups.get("video.insert").find(".fr-video-embed-layer textarea").val()||""),0!==e.length&&we.VIDEO_EMBED_REGEX.test(e)?d(e):(b(w.language.translate("Something went wrong. Please try again.")),w.events.trigger("video.codeError",[e]))},insert:d,align:function pe(e){E.removeClass("fr-fvr fr-fvl"),!w.opts.htmlUntouched&&w.opts.useClasses?"left"==e?E.addClass("fr-fvl"):"right"==e&&E.addClass("fr-fvr"):Z(E,W(),e),te(),M(),a(),w.selection.clear()},refreshAlign:function fe(e){if(!E)return!1;e.find(">*").first().replaceWith(w.icon.create("video-align-".concat(j())))},refreshAlignOnShow:function ce(e,t){E&&t.find('.fr-command[data-param1="'.concat(j(),'"]')).addClass("fr-active").attr("aria-selected",!0)},display:function ve(e){E.removeClass("fr-dvi fr-dvb"),!w.opts.htmlUntouched&&w.opts.useClasses?"inline"==e?E.addClass("fr-dvi"):"block"==e&&E.addClass("fr-dvb"):Z(E,e,j()),te(),M(),a(),w.selection.clear()},refreshDisplayOnShow:function ue(e,t){E&&t.find('.fr-command[data-param1="'.concat(W(),'"]')).addClass("fr-active").attr("aria-selected",!0)},remove:q,hideProgressBar:l,showSizePopup:function ge(){var e=w.popups.get("video.size");e||(e=G()),l(),w.popups.refresh("video.size"),w.popups.setContainer("video.size",w.$sc);var t=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),o=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.height();w.popups.show("video.size",o,i,t.height(),!0)},replace:function he(){var e=w.popups.get("video.insert");e||(e=n()),w.popups.isVisible("video.insert")||(l(),w.popups.refresh("video.insert"),w.popups.setContainer("video.insert",w.$sc));var t=E.offset().left+E.outerWidth()/2,o=E.offset().top+E.height();w.popups.show("video.insert",t,o,E.outerHeight(),!0)},back:function e(){E?(w.events.disableBlur(),E[0].click()):(w.events.disableBlur(),w.selection.restore(),w.events.enableBlur(),w.popups.hide("video.insert"),w.toolbar.showInline())},setSize:function me(e,t){if(E){var o=w.popups.get("video.size"),i=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video"));i.css("width",e||o.find('input[name="width"]').val()),i.css("height",t||o.find('input[name="height"]').val()),i.get(0).style.width&&i.removeAttr("width"),i.get(0).style.height&&i.removeAttr("height"),o.find("input:focus").blur(),setTimeout(function(){E.trigger("click")},w.helpers.isAndroid()?50:0)}},get:function be(){return E},showProgressBar:x,_editVideo:y,setAutoplay:function ye(){var e;if(E.find("iframe, embed, audio").get(0))(e=E.find("iframe, embed, audio")).get(0).src.includes("autoplay=1")?(ee("#FFFFFF"),e.get(0).src=e.get(0).src.replace("&autoplay=1","")):(ee("#D6D6D6"),e.get(0).src=e.get(0).src+"&autoplay=1");else if((e=E.find("iframe, embed, video")).get(0).outerHTML.includes("autoplay"))ee("#FFFFFF"),e.get(0).outerHTML=e.get(0).outerHTML.replace("autoplay","");else{ee("#D6D6D6");var t=e.get(0).outerHTML.indexOf("class")-1;e.get(0).outerHTML=[e.get(0).outerHTML.slice(0,t),"autoplay",e.get(0).outerHTML.slice(t)].join("")}}}},we.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"}),we.DefineIcon("insertVideo",{NAME:"video-camera",FA5NAME:"camera",SVG_KEY:"insertVideo"}),we.DefineIcon("videoByURL",{NAME:"link",SVG_KEY:"insertLink"}),we.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)}}),we.DefineIcon("videoEmbed",{NAME:"code",SVG_KEY:"codeView"}),we.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)}}),we.DefineIcon("videoUpload",{NAME:"upload",SVG_KEY:"upload"}),we.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)}}),we.RegisterCommand("videoInsertByURL",{undo:!0,focus:!0,callback:function(){this.video.insertByURL()}}),we.RegisterCommand("videoInsertEmbed",{undo:!0,focus:!0,callback:function(){this.video.insertEmbed()}}),we.DefineIcon("videoDisplay",{NAME:"star",SVG_KEY:"star"}),we.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)}}),we.DefineIcon("video-align",{NAME:"align-left",SVG_KEY:"align Left"}),we.DefineIcon("video-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),we.DefineIcon("video-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),we.DefineIcon("video-align-center",{NAME:"align-justify",SVG_KEY:"alignJustify"}),we.DefineIcon("videoAlign",{NAME:"align-center",SVG_KEY:"alignCenter"}),we.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=we.COMMANDS.videoAlign.options;for(var o in t)t.hasOwnProperty(o)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="videoAlign" data-param1="'.concat(o,'" title="').concat(this.language.translate(t[o]),'">').concat(this.icon.create("video-align-".concat(o)),'<span class="fr-sr-only">').concat(this.language.translate(t[o]),"</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)}}),we.DefineIcon("videoReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),we.RegisterCommand("videoReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.video.replace()}}),we.DefineIcon("videoRemove",{NAME:"trash",SVG_KEY:"remove"}),we.RegisterCommand("videoRemove",{title:"Remove",callback:function(){this.video.remove()}}),we.DefineIcon("autoplay",{NAME:"autoplay",SVG_KEY:"autoplay"}),we.RegisterCommand("autoplay",{undo:!1,focus:!1,popup:!0,title:"Autoplay",callback:function(){this.video.setAutoplay()}}),we.DefineIcon("videoSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),we.RegisterCommand("videoSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.video.showSizePopup()}}),we.DefineIcon("videoBack",{NAME:"arrow-left",SVG_KEY:"back"}),we.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"))}}),we.RegisterCommand("videoDismissError",{title:"OK",undo:!1,callback:function(){this.video.hideProgressBar(!0)}}),we.RegisterCommand("videoSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.video.setSize()}})});
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(we){"use strict";we=we&&we.hasOwnProperty("default")?we["default"]:we,Object.assign(we.POPUP_TEMPLATES,{"video.insert":"[_BUTTONS_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_LAYER_][_PROGRESS_BAR_]","video.edit":"[_BUTTONS_]","video.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(we.DEFAULTS,{videoAllowedTypes:["mp4","webm","ogg","mp3","mpeg","url"],videoAllowedProviders:[".*"],videoDefaultAlign:"center",videoDefaultDisplay:"block",videoDefaultWidth:600,videoEditButtons:["videoReplace","videoRemove","videoDisplay","videoAlign","videoSize","autoplay"],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,videoUploadToAzure:!1,videoUploadURL:null}),we.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&rel=0" 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"}],we.VIDEO_EMBED_REGEX=/^\W*((<iframe(.|\n)*>(\s|\n)*<\/iframe>)|(<embed(.|\n)*>))\W*$/i,we.PLUGINS.video=function(w){var s,p,f,E,i,o,A=w.$,C="https://i.froala.com/upload",c=2,v=3,u=4,S=5,U=6,a={};function g(){var e=w.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 r(){var e=w.popups.get("video.edit");if(e||(e=function n(){var e="";if(0<w.opts.videoEditButtons.length){w.opts.videoResponsive&&(-1<w.opts.videoEditButtons.indexOf("videoSize")&&w.opts.videoEditButtons.splice(w.opts.videoEditButtons.indexOf("videoSize"),1),-1<w.opts.videoEditButtons.indexOf("videoDisplay")&&w.opts.videoEditButtons.splice(w.opts.videoEditButtons.indexOf("videoDisplay"),1),-1<w.opts.videoEditButtons.indexOf("videoAlign")&&w.opts.videoEditButtons.splice(w.opts.videoEditButtons.indexOf("videoAlign"),1));var t={buttons:e+='<div class="fr-buttons"> \n '.concat(w.button.buildList(w.opts.videoEditButtons)," \n </div>")},o=w.popups.create("video.edit",t);return w.events.$on(w.$wp,"scroll.video-edit",function(){E&&w.popups.isVisible("video.edit")&&(w.events.disableBlur(),l(E))}),o}return!1}()),e){w.popups.setContainer("video.edit",w.$sc),w.popups.refresh("video.edit");var t=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),o=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight(),a=t.get(0).src?t.get(0).src:t.get(0).currentSrc,r=!(!(a=(a=a.split("."))[a.length-1]).includes("pdf")&&!a.includes("txt"));t.hasClass("fr-file")||r||E.find("audio").get(0)?(document.getElementById("autoplay-".concat(w.id))&&(document.getElementById("autoplay-".concat(w.id)).style.display="none"),document.getElementById("videoReplace-".concat(w.id))&&(document.getElementById("videoReplace-".concat(w.id)).style.display="none")):(document.getElementById("autoplay-".concat(w.id))&&(document.getElementById("autoplay-".concat(w.id)).style.display=""),document.getElementById("videoReplace-".concat(w.id))&&(document.getElementById("videoReplace-".concat(w.id)).style.display="")),w.popups.show("video.edit",o,i,t.outerHeight(),!0)}}function n(e){if(e)return w.popups.onRefresh("video.insert",g),w.popups.onHide("video.insert",J),!0;var t="";w.opts.videoUpload||-1===w.opts.videoInsertButtons.indexOf("videoUpload")||w.opts.videoInsertButtons.splice(w.opts.videoInsertButtons.indexOf("videoUpload"),1);var o=w.button.buildList(w.opts.videoInsertButtons);""!==o&&(t='<div class="fr-buttons">'+o+"</div>");var i,a="",r=w.opts.videoInsertButtons.indexOf("videoUpload"),n=w.opts.videoInsertButtons.indexOf("videoByURL"),s=w.opts.videoInsertButtons.indexOf("videoEmbed");if(0<=n){i=" fr-active",(r<n&&0<=r||s<n&&0<=s)&&(i="");a='<div class="fr-video-by-url-layer fr-layer'.concat(i,'" id="fr-video-by-url-layer-').concat(w.id,'"><div class="fr-input-line"><input id="fr-video-by-url-layer-text-').concat(w.id,'" type="text" placeholder="').concat(w.language.translate("Paste in a video URL"),'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><span style=\'float:left\'><div class="fr-checkbox-line fr-autoplay-margin"><span class="fr-checkbox"> <input id=\'videoPluginAutoplay\' data-checked="_blank" type="checkbox"> <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(w.id,'">Autoplay</label></div> </span><button type="button" class="fr-command fr-submit" data-cmd="videoInsertByURL" tabIndex="2" role="button">').concat(w.language.translate("Insert"),"</button></div></div>")}var d="";0<=s&&(i=" fr-active",(r<s&&0<=r||n<s&&0<=n)&&(i=""),d='<div class="fr-video-embed-layer fr-layer'.concat(i,'" id="fr-video-embed-layer-').concat(w.id,'"><div class="fr-input-line"><textarea id="fr-video-embed-layer-text').concat(w.id,'" type="text" placeholder="').concat(w.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">').concat(w.language.translate("Insert"),"</button></div></div>"));var l="";0<=r&&(i=" fr-active",(s<r&&0<=s||n<r&&0<=n)&&(i=""),l='<div class="fr-video-upload-layer fr-layer'.concat(i,'" id="fr-video-upload-layer-').concat(w.id,'"><strong>').concat(w.language.translate("Drop video"),"</strong><br>(").concat(w.language.translate("or click"),')<div class="fr-form"><input type="file" accept="video/').concat(w.opts.videoAllowedTypes.join(", video/").toLowerCase(),'" tabIndex="-1" aria-labelledby="fr-video-upload-layer-').concat(w.id,'" role="button"></div></div>'));var p={buttons:t,by_url_layer:a,embed_layer:d,upload_layer:l,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=w.popups.create("video.insert",p);return function c(i){w.events.$on(i,"dragover dragenter",".fr-video-upload-layer",function(){return A(this).addClass("fr-drop"),!1},!0),w.events.$on(i,"dragleave dragend",".fr-video-upload-layer",function(){return A(this).removeClass("fr-drop"),!1},!0),w.events.$on(i,"drop",".fr-video-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),A(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var o=i.data("instance")||w;o.events.disableBlur(),o.video.upload(t.files),o.events.enableBlur()}},!0),w.helpers.isIOS()&&w.events.$on(i,"touchstart",'.fr-video-upload-layer input[type="file"]',function(){A(this).trigger("click")},!0);w.events.$on(i,"change",'.fr-video-upload-layer input[type="file"]',function(){if(this.files){var e=i.data("instance")||w;e.events.disableBlur(),i.find("input:focus").blur(),e.events.enableBlur(),e.video.upload(this.files)}A(this).val("")},!0)}(f),f}function h(e){w.events.focus(!0),w.selection.restore();var t=!1;if(E&&(q(),t=!0),w.opts.trackChangesEnabled){w.edit.on(),w.events.focus(!0),w.selection.restore(),w.undo.saveStep(),w.markers.insert(),w.html.wrap();var o=w.$el.find(".fr-marker");w.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith('<span contenteditable="false" draggable="true" class="fr-jiv fr-video fr-deletable">'.concat(e,"</span>")),w.selection.clear()}else w.html.insert('<span contenteditable="false" draggable="true" class="fr-jiv fr-video fr-deletable">'.concat(e,"</span>"),!1,w.opts.videoSplitHTML);w.popups.hide("video.insert");var i=w.$el.find(".fr-jiv");i.removeClass("fr-jiv"),i.toggleClass("fr-rv",w.opts.videoResponsive),Z(i,w.opts.videoDefaultDisplay,w.opts.videoDefaultAlign),i.toggleClass("fr-draggable",w.opts.videoMove),w.events.trigger(t?"video.replaced":"video.inserted",[i])}function m(){var e=A(this);w.popups.hide("video.insert"),e.removeClass("fr-uploading"),e.parent().next().is("br")&&e.parent().next().remove(),l(e.parent()),w.events.trigger("video.loaded",[e.parent()])}function x(s,e,d,l,p){w.edit.off(),b("Loading video"),e&&(s=w.helpers.sanitizeURL(s));var f=function f(){var e,t;if(l){w.undo.canDo()||l.find("video").hasClass("fr-uploading")||w.undo.saveStep();var o=l.find("video").data("fr-old-src"),i=l.data("fr-replaced");if(l.data("fr-replaced",!1),0<l.find("iframe").length)l.remove(),e=k(s,d,m);else{w.$wp?((e=l.clone(!0)).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),o&&l.find("video").attr("src",o),l.replaceWith(e)):e=l;for(var a=e.find("video").get(0).attributes,r=0;r<a.length;r++){var n=a[r];0===n.nodeName.indexOf("data-")&&e.find("video").removeAttr(n.nodeName)}if(void 0!==d)for(t in d)d.hasOwnProperty(t)&&"link"!=t&&e.find("video").attr("data-".concat(t),d[t]);e.find("video").on("canplay",m),e.find("video").attr("src",s)}w.edit.on(),L(),w.undo.saveStep(),w.$el.blur(),w.events.trigger(i?"video.replaced":"video.inserted",[e,p])}else e=k(s,d,m),L(),w.undo.saveStep(),w.events.trigger("video.inserted",[e,p])};R("Loading video"),f()}function R(e){var t=w.popups.get("video.insert");if(t||(t=n()),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(),E){var o=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video"));w.popups.setContainer("video.insert",w.$sc);var i=o.offset().left,a=o.offset().top+o.height();w.popups.show("video.insert",i,a,o.outerHeight())}void 0===e&&b(w.language.translate("Uploading"),0)}function d(e){var t=w.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||w.$el.find("video.fr-error").length)){if(w.events.focus(),w.$el.find("video.fr-error").length&&(w.$el.find("video.fr-error").parent().remove(),w.undo.saveStep(),w.undo.run(),w.undo.dropRedo()),!w.$wp&&E){var o=E;V(!0),w.selection.setAfter(o.find("video").get(0)),w.selection.restore()}w.popups.hide("video.insert")}}function b(e,t){var o=w.popups.get("video.insert");if(o){var i=o.find(".fr-video-progress-bar-layer");i.find("h3").text(e+(t?" ".concat(t,"%"):"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width","".concat(t,"%"))):i.find("div").addClass("fr-indeterminate")}}function y(e){R();var t=w.popups.get("video.insert").find(".fr-video-progress-bar-layer");t.addClass("fr-error");var o=t.find("h3");o.text(e),w.events.disableBlur(),o.focus()}function l(e){t.call(e.get(0))}function _(e,t,o){b("Loading video");var i=this.status,a=this.response,r=this.responseXML,n=this.responseText;try{if(w.opts.videoUploadToS3||w.opts.videoUploadToAzure)if(201==i){var s;if(w.opts.videoUploadToAzure){if(!1===w.events.trigger("video.uploadedToAzure",[this.responseURL,o,a],!0))return w.edit.on(),!1;s=t}else s=function l(e){try{var t=A(e).find("Location").text(),o=A(e).find("Key").text();return!1===w.events.trigger("video.uploadedToS3",[t,o,e],!0)?(w.edit.on(),!1):t}catch(i){return F(u,e),!1}}(r);s&&x(s,!1,[],e,a||r)}else F(u,a||r);else if(200<=i&&i<300){var d=function p(e){try{if(!1===w.events.trigger("video.uploaded",[e],!0))return w.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(F(c,e),!1)}catch(o){return F(u,e),!1}}(n);d&&x(d.link,!1,d,e,a||n)}else F(v,a||n)}catch(f){F(u,a||n)}}function B(){F(u,this.response||this.responseText||this.responseXML)}function D(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;b(w.language.translate("Uploading"),t)}}function I(){w.edit.on(),d(!0)}function k(e,t,o){var i,a="";if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(a+=" data-".concat(i,'="').concat(t[i],'"'));var r=w.opts.videoDefaultWidth;r&&"auto"!=r&&(r="".concat(r,"px")),w.helpers.isMobile()&&w.browser.safari&&(a+=" autoplay playsinline");var n=A(document.createElement("span")).attr("contenteditable","false").attr("draggable","true").attr("class","fr-video fr-dv"+w.opts.videoDefaultDisplay[0]+("center"!=w.opts.videoDefaultAlign?" fr-fv"+w.opts.videoDefaultAlign[0]:"")).html('<video src="'+e+'" '+a+(r?' style="width: '+r+';" ':"")+" controls>"+w.language.translate("Your browser does not support HTML5 video.")+"</video>");n.toggleClass("fr-draggable",w.opts.videoMove),w.edit.on(),w.events.focus(!0),w.selection.restore(),w.undo.saveStep(),w.opts.videoSplitHTML?w.markers.split():(w.cursor.enter(),w.markers.insert()),w.html.wrap();var s=w.$el.find(".fr-marker");return w.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(n),w.selection.clear(),n.find("video").get(0).readyState>n.find("video").get(0).HAVE_FUTURE_DATA||w.helpers.isIOS()?o.call(n.find("video").get(0)):n.find("video").on("canplaythrough load",o),n}function T(e){if(!w.core.sameInstance(f))return!0;e.preventDefault(),e.stopPropagation();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),o=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!o)return!1;if("mousedown"==e.type){var i=w.$oel.get(0).ownerDocument,a=i.defaultView||i.parentWindow,r=!1;try{r=a.location!=a.parent.location&&!(a.$&&a.$.FE)}catch(n){}r&&a.frameElement&&(t+=w.helpers.getPX(A(a.frameElement).offset().left)+a.frameElement.clientLeft,o=e.clientY+w.helpers.getPX(A(a.frameElement).offset().top)+a.frameElement.clientTop)}w.undo.canDo()||w.undo.saveStep(),(p=A(this)).data("start-x",t),p.data("start-y",o),s.show(),w.popups.hideAll(),Y()}function z(e){if(!w.core.sameInstance(f))return!0;if(p){e.preventDefault();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),o=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!o)return!1;var i=p.data("start-x"),a=p.data("start-y");p.data("start-x",t),p.data("start-y",o);var r=t-i,n=o-a,s=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),d=s.width(),l=s.height();(p.hasClass("fr-hnw")||p.hasClass("fr-hsw"))&&(r=0-r),(p.hasClass("fr-hnw")||p.hasClass("fr-hne"))&&(n=0-n),s.css("width",d+r),s.css("height",l+n),s.removeAttr("width"),s.removeAttr("height"),M()}}function P(e){if(!w.core.sameInstance(f))return!0;p&&E&&(e&&e.stopPropagation(),p=null,s.hide(),M(),r(),w.undo.saveStep())}function $(e){return'<div class="fr-handler fr-h'.concat(e,'"></div>')}function O(e,t,o,i){return e.pageX=t,e.pageY=t,T.call(this,e),e.pageX=e.pageX+o*Math.floor(Math.pow(1.1,i)),e.pageY=e.pageY+o*Math.floor(Math.pow(1.1,i)),z.call(this,e),P.call(this,e),++i}function L(){var e,t=Array.prototype.slice.call(w.el.querySelectorAll("video, .fr-video > *")),o=[];for(e=0;e<t.length;e++)o.push(t[e].getAttribute("src")),A(t[e]).toggleClass("fr-draggable",w.opts.videoMove),""===t[e].getAttribute("class")&&t[e].removeAttribute("class"),""===t[e].getAttribute("style")&&t[e].removeAttribute("style");if(i)for(e=0;e<i.length;e++)o.indexOf(i[e].getAttribute("src"))<0&&w.events.trigger("video.removed",[A(i[e])]);i=t}function M(){f||function n(){var e;if(w.shared.$video_resizer?(f=w.shared.$video_resizer,s=w.shared.$vid_overlay,w.events.on("destroy",function(){A("body").first().append(f.removeClass("fr-active"))},!0)):(w.shared.$video_resizer=A(document.createElement("div")).attr("class","fr-video-resizer"),f=w.shared.$video_resizer,w.events.$on(f,"mousedown",function(e){e.stopPropagation()},!0),w.opts.videoResize&&(f.append($("nw")+$("ne")+$("sw")+$("se")),w.shared.$vid_overlay=A(document.createElement("div")).attr("class","fr-video-overlay"),s=w.shared.$vid_overlay,e=f.get(0).ownerDocument,A(e).find("body").first().append(s))),w.events.on("shared.destroy",function(){f.html("").removeData().remove(),f=null,w.opts.videoResize&&(s.remove(),s=null)},!0),w.helpers.isMobile()||w.events.$on(A(w.o_win),"resize.video",function(){V(!0)}),w.opts.videoResize){e=f.get(0).ownerDocument,w.events.$on(f,w._mousedown,".fr-handler",T),w.events.$on(A(e),w._mousemove,z),w.events.$on(A(e.defaultView||e.parentWindow),w._mouseup,P),w.events.$on(s,"mouseleave",P);var i=1,a=null,r=0;w.events.on("keydown",function(e){if(E){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,o=e.which;(o!==a||200<e.timeStamp-r)&&(i=1),(o==we.KEYCODE.EQUALS||w.browser.mozilla&&o==we.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=O.call(this,e,1,1,i):(o==we.KEYCODE.HYPHEN||w.browser.mozilla&&o==we.KEYCODE.FF_HYPHEN)&&t&&!e.altKey&&(i=O.call(this,e,2,-1,i)),a=o,r=e.timeStamp}}),w.events.on("keyup",function(){i=1})}}(),(w.$wp||w.$sc).append(f),f.data("instance",w);var e=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),t=0,o=0;w.opts.iframe&&(o=w.helpers.getPX(w.$wp.find(".fr-iframe").css("padding-top")),t=w.helpers.getPX(w.$wp.find(".fr-iframe").css("padding-left"))),f.css("top",(w.opts.iframe?e.offset().top+o-1:e.offset().top-w.$wp.offset().top-1)+w.$wp.scrollTop()).css("left",(w.opts.iframe?e.offset().left+t-1:e.offset().left-w.$wp.offset().left-1)+w.$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&&o)return!0;if(e&&w.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;if(w.edit.isDisabled())return!1;for(var t=0;t<we.INSTANCES.length;t++)we.INSTANCES[t]!=w&&we.INSTANCES[t].events.trigger("video.hideResizer");w.toolbar.disable(),w.helpers.isMobile()&&(w.events.disableBlur(),w.$el.blur(),w.events.enableBlur()),w.$el.find(".fr-video.fr-active").removeClass("fr-active"),(E=A(this)).addClass("fr-active"),w.opts.iframe&&w.size.syncIframe(),te(),M(),r(),w.selection.clear(),w.button.bulkRefresh(),w.events.trigger("image.hideResizer")}function V(e){E&&(function t(){return w.shared.vid_exit_flag}()||!0===e)&&(f.removeClass("fr-active"),w.toolbar.enable(),E.removeClass("fr-active"),E=null,Y())}function N(){w.shared.vid_exit_flag=!0}function Y(){w.shared.vid_exit_flag=!1}function H(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var o=t.files[0];if(o&&o.type&&-1!==o.type.indexOf("video")){if(!w.opts.videoUpload)return e.preventDefault(),e.stopPropagation(),!1;w.markers.remove(),w.markers.insertAtPoint(e.originalEvent),w.$el.find(".fr-marker").replaceWith(we.MARKERS),w.popups.hideAll();var i=w.popups.get("video.insert");return i||(i=n()),w.popups.setContainer("video.insert",w.$sc),w.popups.show("video.insert",e.originalEvent.pageX,e.originalEvent.pageY),R(),0<=w.opts.videoAllowedTypes.indexOf(o.type.replace(/video\//g,""))?K(t.files):F(U),e.preventDefault(),e.stopPropagation(),!1}}}function K(e){if(void 0!==e&&0<e.length){if(!1===w.events.trigger("video.beforeUpload",[e]))return!1;var t,o=e[0];if(!(null!==w.opts.videoUploadURL&&w.opts.videoUploadURL!=C||w.opts.videoUploadToS3||w.opts.videoUploadToAzure))return function y(i){E&&E.find("iframe")&&E.find("iframe").length&&q();var a=new FileReader;a.onload=function(){a.result;for(var e=atob(a.result.split(",")[1]),t=[],o=0;o<e.length;o++)t.push(e.charCodeAt(o));x(window.URL.createObjectURL(new Blob([new Uint8Array(t)],{type:i.type})),!1,null,E)},R(),a.readAsDataURL(i)}(o),!1;if(o.size>w.opts.videoMaxSize)return F(S),!1;if(w.opts.videoAllowedTypes.indexOf(o.type.replace(/video\//g,""))<0)return F(U),!1;if(w.drag_support.formdata&&(t=w.drag_support.formdata?new FormData:null),t){var i;if(!1!==w.opts.videoUploadToS3)for(i in t.append("key",w.opts.videoUploadToS3.keyStart+(new Date).getTime()+"-"+(o.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",o.type),w.opts.videoUploadToS3.params)w.opts.videoUploadToS3.params.hasOwnProperty(i)&&t.append(i,w.opts.videoUploadToS3.params[i]);for(i in w.opts.videoUploadParams)w.opts.videoUploadParams.hasOwnProperty(i)&&t.append(i,w.opts.videoUploadParams[i]);t.append(w.opts.videoUploadParam,o);var a,r,n=w.opts.videoUploadURL;w.opts.videoUploadToS3&&(n=w.opts.videoUploadToS3.uploadURL?w.opts.videoUploadToS3.uploadURL:"https://".concat(w.opts.videoUploadToS3.region,".amazonaws.com/").concat(w.opts.videoUploadToS3.bucket));var s=w.opts.videoUploadMethod;w.opts.videoUploadToAzure&&(n=w.opts.videoUploadToAzure.uploadURL?"".concat(w.opts.videoUploadToAzure.uploadURL,"/").concat(o.name):encodeURI("https://".concat(w.opts.videoUploadToAzure.account,".blob.core.windows.net/").concat(w.opts.videoUploadToAzure.container,"/").concat(o.name)),a=n,w.opts.videoUploadToAzure.SASToken&&(n+=w.opts.videoUploadToAzure.SASToken),s="PUT");var d=w.core.getXHR(n,s);if(w.opts.videoUploadToAzure){var l=(new Date).toUTCString();if(!w.opts.videoUploadToAzure.SASToken&&w.opts.videoUploadToAzure.accessKey){var p=w.opts.videoUploadToAzure.account,f=w.opts.videoUploadToAzure.container;if(w.opts.videoUploadToAzure.uploadURL){var c=w.opts.videoUploadToAzure.uploadURL.split("/");f=c.pop(),p=c.pop().split(".")[0]}var v="x-ms-blob-type:BlockBlob\nx-ms-date:".concat(l,"\nx-ms-version:2019-07-07"),u=encodeURI("/"+p+"/"+f+"/"+o.name),g=s+"\n\n\n"+o.size+"\n\n"+o.type+"\n\n\n\n\n\n\n"+v+"\n"+u,h=w.cryptoJSPlugin.cryptoJS.HmacSHA256(g,w.cryptoJSPlugin.cryptoJS.enc.Base64.parse(w.opts.videoUploadToAzure.accessKey)).toString(w.cryptoJSPlugin.cryptoJS.enc.Base64),m="SharedKey "+p+":"+h;r=h,d.setRequestHeader("Authorization",m)}for(i in d.setRequestHeader("x-ms-version","2019-07-07"),d.setRequestHeader("x-ms-date",l),d.setRequestHeader("Content-Type",o.type),d.setRequestHeader("x-ms-blob-type","BlockBlob"),w.opts.videoUploadParams)w.opts.videoUploadParams.hasOwnProperty(i)&&d.setRequestHeader(i,w.opts.videoUploadParams[i]);for(i in w.opts.videoUploadToAzure.params)w.opts.videoUploadToAzure.params.hasOwnProperty(i)&&d.setRequestHeader(i,w.opts.videoUploadToAzure.params[i])}d.onload=function(){_.call(d,E,a,r)},d.onerror=B,d.upload.onprogress=D,d.onabort=I,R(),w.events.disableBlur(),w.edit.off(),w.events.enableBlur();var b=w.popups.get("video.insert");b&&A(b.off("abortUpload")).on("abortUpload",function(){4!=d.readyState&&d.abort()}),d.send(w.opts.videoUploadToAzure?o:t)}}}function F(e,t){w.edit.on(),E&&E.find("video").addClass("fr-error"),y(w.language.translate("Something went wrong. Please try again.")),w.events.trigger("video.error",[{code:e,message:a[e]},t])}function X(){if(E){var e=w.popups.get("video.size"),t=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"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 G(e){if(e)return w.popups.onRefresh("video.size",X),!0;var t={buttons:'<div class="fr-buttons fr-tabs">'.concat(w.button.buildList(w.opts.videoSizeButtons),"</div>"),size_layer:'<div class="fr-video-size-layer fr-layer fr-active" id="fr-video-size-layer-'.concat(w.id,'"><div class="fr-video-group"><div class="fr-input-line"><input id="fr-video-size-layer-width-').concat(w.id,'" type="text" name="width" placeholder="').concat(w.language.translate("Width"),'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-video-size-layer-height-').concat(w.id,'" type="text" name="height" placeholder="').concat(w.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">').concat(w.language.translate("Update"),"</button></div></div>")},o=w.popups.create("video.size",t);return w.events.$on(w.$wp,"scroll",function(){E&&w.popups.isVisible("video.size")&&(w.events.disableBlur(),l(E))}),o}function j(e){if(void 0===e&&(e=E),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 W(e){void 0===e&&(e=E);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(E&&!1!==w.events.trigger("video.beforeRemove",[E])){var e=E;if(w.popups.hideAll(),V(!0),w.opts.trackChangesEnabled&&(!e[0].parentNode||"SPAN"!==e[0].parentNode.tagName||!e[0].parentNode.hasAttribute("data-tracking")))return void w.track_changes.removeSpecialItem(e);w.selection.setBefore(e.get(0))||w.selection.setAfter(e.get(0)),e.remove(),w.selection.restore(),w.html.fillEmptyBlocks()}}function J(){d()}function Z(e,t,o){!w.opts.htmlUntouched&&w.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv".concat(o[0]," fr-dv").concat(t[0]))):"inline"==t?(e.css({display:"inline-block"}),"center"==o?e.css({"float":"none"}):"left"==o?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==o?e.css({textAlign:"left"}):"right"==o?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}function Q(){var e=w.$el.find("video").filter(function(){return 0===A(this).parents("span.fr-video").length});if(0!=e.length){e.wrap(A(document.createElement("span")).attr("class","fr-video fr-deletable").attr("contenteditable","false")),w.$el.find("embed, iframe").filter(function(){if(w.browser.safari&&this.getAttribute("src")&&this.setAttribute("src",this.src),0<A(this).parents("span.fr-video").length)return!1;for(var e=A(this).attr("src"),t=0;t<we.VIDEO_PROVIDERS.length;t++){var o=we.VIDEO_PROVIDERS[t];if(o.test_regex.test(e)&&new RegExp(w.opts.videoAllowedProviders.join("|")).test(o.provider))return!0}return!1}).map(function(){return 0===A(this).parents("object").length?this:A(this).parents("object").get(0)}).wrap(A(document.createElement("span")).attr("class","fr-video").attr("contenteditable","false"));for(var t,o,i,a,r=w.$el.find("span.fr-video, video"),n=0;n<r.length;n++){var s=A(r[n]);!w.opts.htmlUntouched&&w.opts.useClasses?((a=s).hasClass("fr-dvi")||a.hasClass("fr-dvb")||(a.addClass("fr-fv".concat(j(a)[0])),a.addClass("fr-dv".concat(W(a)[0]))),w.opts.videoTextNear||s.removeClass("fr-dvi").addClass("fr-dvb")):w.opts.htmlUntouched||w.opts.useClasses||(void 0,o=(t=s).hasClass("fr-dvb")?"block":t.hasClass("fr-dvi")?"inline":null,i=t.hasClass("fr-fvl")?"left":t.hasClass("fr-fvr")?"right":j(t),Z(t,o,i),t.removeClass("fr-dvb fr-dvi fr-fvr fr-fvl"))}r.toggleClass("fr-draggable",w.opts.videoMove)}}function ee(e){document.getElementById("autoplay-".concat(w.id)).style.cssText="background:".concat(e)}function te(){if(E){w.selection.clear();var e=w.doc.createRange();e.selectNode(E.get(0)),w.selection.get().addRange(e)}}return a[1]="Video cannot be loaded from the passed link.",a[c]="No link in upload response.",a[v]="Error during file upload.",a[u]="Parsing response failed.",a[S]="File is too large.",a[U]="Video file type is invalid.",a[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",w.shared.vid_exit_flag=!1,{_init:function oe(){w.opts.videoResponsive&&(w.opts.videoResize=!1),function e(){w.events.on("drop",H,!0),w.events.on("mousedown window.mousedown",N),w.events.on("window.touchmove",Y),w.events.on("mouseup window.mouseup",V),w.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&V()}),w.events.on("video.hideResizer commands.undo commands.redo element.dropped",function(){V(!0)})}(),w.helpers.isMobile()&&(w.events.$on(w.$el,"touchstart","span.fr-video",function(){o=!1}),w.events.$on(w.$el,"touchmove",function(){o=!0})),w.events.on("html.set",Q),Q(),w.events.$on(w.$el,"mousedown","span.fr-video",function(e){e.stopPropagation(),(w.browser.msie||w.browser.edge)&&(e.target.innerText||(e.target.dragDrop(),t.call(this,e)))}),w.events.$on(w.$el,"click touchend","span.fr-video",function(e){if(e.target.innerText.length||"false"==A(this).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;t.call(this,e)}),w.events.on("keydown",function(e){var t=e.which;return!E||t!=we.KEYCODE.BACKSPACE&&t!=we.KEYCODE.DELETE?E&&t==we.KEYCODE.ESC?(V(!0),e.preventDefault(),!1):E&&t!=we.KEYCODE.F10&&!w.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),q(),w.undo.saveStep(),!1)},!0),w.events.on("toolbar.esc",function(){if(E)return w.events.disableBlur(),w.events.focus(),!1},!0),w.events.on("toolbar.focusEditor",function(){if(E)return!1},!0),w.events.on("keydown",function(){w.$el.find("span.fr-video:empty").remove()}),w.$wp&&(L(),w.events.on("contentChanged",L)),n(!0),G(!0)},showInsertPopup:function ie(){var e=w.$tb.find('.fr-command[data-cmd="insertVideo"]'),t=w.popups.get("video.insert");if(t||(t=n()),d(),!t.hasClass("fr-active"))if(w.popups.refresh("video.insert"),w.popups.setContainer("video.insert",w.$tb),e.isVisible()){var o=w.button.getPosition(e),i=o.left,a=o.top;w.popups.show("video.insert",i,a,e.outerHeight())}else w.position.forSelection(t),w.popups.show("video.insert")},showLayer:function ae(e){var t,o,i=w.popups.get("video.insert");if(!E&&!w.opts.toolbarInline){var a=w.$tb.find('.fr-command[data-cmd="insertVideo"]');t=a.offset().left,o=a.offset().top+(w.opts.toolbarBottom?10:a.outerHeight()-10)}w.opts.toolbarInline&&(o=i.offset().top-w.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(o+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-".concat(e,"-layer")).addClass("fr-active"),w.popups.show("video.insert",t,o,0),w.accessibility.focusPopup(i)},refreshByURLButton:function re(e){var t=w.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 ne(e){var t=w.popups.get("video.insert");t&&t.find(".fr-video-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshUploadButton:function se(e){var t=w.popups.get("video.insert");t&&t.find(".fr-video-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:K,insertByURL:function de(e){var t=!!document.getElementById("videoPluginAutoplay")&&document.getElementById("videoPluginAutoplay").checked;if(void 0===e){var o=(e=(w.popups.get("video.insert").find('.fr-video-by-url-layer input[type="text"]').val()||"").trim()).match(/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/?(showcase\/)*([0-9))([a-z]*\/)*([0-9]{6,11})[?]?.*/);if(o&&7==o.length){var i=o[6],a=e.substring(0,e.lastIndexOf("/")),r=e.substring(e.lastIndexOf("/")+1,e.length);e=r.includes("?h=")||r.includes("?v=")||i===r?("".concat(a,"/").concat(r)||"").trim():("".concat(a,"?h=").concat(r)||"").trim()}}var n=null;if(/^http/.test(e)||(e="https://".concat(e)),w.helpers.isURL(e))for(var s=0;s<we.VIDEO_PROVIDERS.length;s++){var d=we.VIDEO_PROVIDERS[s],l="autoplay=1&mute=1";if(d.html.includes("autoplay=1")&&document.getElementById("videoPluginAutoplay").checked)d.html=d.html,document.getElementById("videoPluginAutoplay").checked=!1;else if(t){var p=d.html.indexOf("{url}")+5;d.html=[d.html.slice(0,p),l,d.html.slice(p)].join(""),t=!1,document.getElementById("videoPluginAutoplay").checked=!1}else(d=we.VIDEO_PROVIDERS[s]).html=d.html.replace(l,"");if(d.test_regex.test(e)&&new RegExp(w.opts.videoAllowedProviders.join("|")).test(d.provider)){n=e.replace(d.url_regex,d.url_text),n=d.html.replace(/\{url\}/,n);break}}n?h(n):(y(w.language.translate("Something went wrong. Please try again.")),w.events.trigger("video.linkError",[e]))},insertEmbed:function le(e){void 0===e&&(e=w.popups.get("video.insert").find(".fr-video-embed-layer textarea").val()||""),0!==e.length&&we.VIDEO_EMBED_REGEX.test(e)?h(e):(y(w.language.translate("Something went wrong. Please try again.")),w.events.trigger("video.codeError",[e]))},insert:h,align:function pe(e){E.removeClass("fr-fvr fr-fvl"),!w.opts.htmlUntouched&&w.opts.useClasses?"left"==e?E.addClass("fr-fvl"):"right"==e&&E.addClass("fr-fvr"):Z(E,W(),e),te(),M(),r(),w.selection.clear()},refreshAlign:function fe(e){if(!E)return!1;e.find(">*").first().replaceWith(w.icon.create("video-align-".concat(j())))},refreshAlignOnShow:function ce(e,t){E&&t.find('.fr-command[data-param1="'.concat(j(),'"]')).addClass("fr-active").attr("aria-selected",!0)},display:function ve(e){E.removeClass("fr-dvi fr-dvb"),!w.opts.htmlUntouched&&w.opts.useClasses?"inline"==e?E.addClass("fr-dvi"):"block"==e&&E.addClass("fr-dvb"):Z(E,e,j()),te(),M(),r(),w.selection.clear()},refreshDisplayOnShow:function ue(e,t){E&&t.find('.fr-command[data-param1="'.concat(W(),'"]')).addClass("fr-active").attr("aria-selected",!0)},remove:q,hideProgressBar:d,showSizePopup:function ge(){var e=w.popups.get("video.size");e||(e=G()),d(),w.popups.refresh("video.size"),w.popups.setContainer("video.size",w.$sc);var t=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video")),o=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.height();w.popups.show("video.size",o,i,t.height(),!0)},replace:function he(){var e=w.popups.get("video.insert");e||(e=n()),w.popups.isVisible("video.insert")||(d(),w.popups.refresh("video.insert"),w.popups.setContainer("video.insert",w.$sc));var t=E.offset().left+E.outerWidth()/2,o=E.offset().top+E.height();w.popups.show("video.insert",t,o,E.outerHeight(),!0)},back:function e(){E?(w.events.disableBlur(),E[0].click()):(w.events.disableBlur(),w.selection.restore(),w.events.enableBlur(),w.popups.hide("video.insert"),w.toolbar.showInline())},setSize:function me(e,t){if(E){var o=w.popups.get("video.size"),i=E.find("iframe, embed, ".concat(E.find("iframe, embed, audio").get(0)?"audio":"video"));i.css("width",e||o.find('input[name="width"]').val()),i.css("height",t||o.find('input[name="height"]').val()),i.get(0).style.width&&i.removeAttr("width"),i.get(0).style.height&&i.removeAttr("height"),o.find("input:focus").blur(),setTimeout(function(){E.trigger("click")},w.helpers.isAndroid()?50:0)}},get:function be(){return E},showProgressBar:R,_editVideo:l,setAutoplay:function ye(){var e;if(E.find("iframe, embed, audio").get(0))(e=E.find("iframe, embed, audio")).get(0).src.includes("autoplay=1")?(ee("#FFFFFF"),e.get(0).src=e.get(0).src.replace("&autoplay=1","")):(ee("#D6D6D6"),e.get(0).src=e.get(0).src+"&autoplay=1");else if((e=E.find("iframe, embed, video")).get(0).outerHTML.includes("autoplay"))ee("#FFFFFF"),e.get(0).outerHTML=e.get(0).outerHTML.replace("autoplay","");else{ee("#D6D6D6");var t=e.get(0).outerHTML.indexOf("class")-1;e.get(0).outerHTML=[e.get(0).outerHTML.slice(0,t),"autoplay",e.get(0).outerHTML.slice(t)].join("")}}}},we.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"}),we.DefineIcon("insertVideo",{NAME:"video-camera",FA5NAME:"camera",SVG_KEY:"insertVideo"}),we.DefineIcon("videoByURL",{NAME:"link",SVG_KEY:"insertLink"}),we.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)}}),we.DefineIcon("videoEmbed",{NAME:"code",SVG_KEY:"codeView"}),we.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)}}),we.DefineIcon("videoUpload",{NAME:"upload",SVG_KEY:"upload"}),we.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)}}),we.RegisterCommand("videoInsertByURL",{undo:!0,focus:!0,callback:function(){this.video.insertByURL()}}),we.RegisterCommand("videoInsertEmbed",{undo:!0,focus:!0,callback:function(){this.video.insertEmbed()}}),we.DefineIcon("videoDisplay",{NAME:"star",SVG_KEY:"star"}),we.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)}}),we.DefineIcon("video-align",{NAME:"align-left",SVG_KEY:"align Left"}),we.DefineIcon("video-align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),we.DefineIcon("video-align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),we.DefineIcon("video-align-center",{NAME:"align-justify",SVG_KEY:"alignJustify"}),we.DefineIcon("videoAlign",{NAME:"align-center",SVG_KEY:"alignCenter"}),we.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=we.COMMANDS.videoAlign.options;for(var o in t)t.hasOwnProperty(o)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="videoAlign" data-param1="'.concat(o,'" title="').concat(this.language.translate(t[o]),'">').concat(this.icon.create("video-align-".concat(o)),'<span class="fr-sr-only">').concat(this.language.translate(t[o]),"</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)}}),we.DefineIcon("videoReplace",{NAME:"exchange",FA5NAME:"exchange-alt",SVG_KEY:"replaceImage"}),we.RegisterCommand("videoReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.video.replace()}}),we.DefineIcon("videoRemove",{NAME:"trash",SVG_KEY:"remove"}),we.RegisterCommand("videoRemove",{title:"Remove",callback:function(){this.video.remove()}}),we.DefineIcon("autoplay",{NAME:"autoplay",SVG_KEY:"autoplay"}),we.RegisterCommand("autoplay",{undo:!1,focus:!1,popup:!0,title:"Autoplay",callback:function(){this.video.setAutoplay()}}),we.DefineIcon("videoSize",{NAME:"arrows-alt",SVG_KEY:"imageSize"}),we.RegisterCommand("videoSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.video.showSizePopup()}}),we.DefineIcon("videoBack",{NAME:"arrow-left",SVG_KEY:"back"}),we.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().hasClass("fr-separator")&&e.next().removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next().hasClass("fr-separator")&&e.next().addClass("fr-hidden"))}}),we.RegisterCommand("videoDismissError",{title:"OK",undo:!1,callback:function(){this.video.hideProgressBar(!0)}}),we.RegisterCommand("videoSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.video.setSize()}})});