wysiwyg-rails 4.2.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +2 -2
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +2 -2
  4. data/app/assets/javascripts/languages/ar.js +1 -1
  5. data/app/assets/javascripts/languages/bs.js +1 -1
  6. data/app/assets/javascripts/languages/cs.js +1 -1
  7. data/app/assets/javascripts/languages/da.js +1 -1
  8. data/app/assets/javascripts/languages/de.js +1 -1
  9. data/app/assets/javascripts/languages/el.js +1 -1
  10. data/app/assets/javascripts/languages/en_ca.js +1 -1
  11. data/app/assets/javascripts/languages/en_gb.js +1 -1
  12. data/app/assets/javascripts/languages/es.js +1 -1
  13. data/app/assets/javascripts/languages/et.js +1 -1
  14. data/app/assets/javascripts/languages/fa.js +1 -1
  15. data/app/assets/javascripts/languages/fi.js +1 -1
  16. data/app/assets/javascripts/languages/fr.js +1 -1
  17. data/app/assets/javascripts/languages/he.js +1 -1
  18. data/app/assets/javascripts/languages/hr.js +1 -1
  19. data/app/assets/javascripts/languages/hu.js +1 -1
  20. data/app/assets/javascripts/languages/id.js +1 -1
  21. data/app/assets/javascripts/languages/it.js +1 -1
  22. data/app/assets/javascripts/languages/ja.js +1 -1
  23. data/app/assets/javascripts/languages/ko.js +18 -24
  24. data/app/assets/javascripts/languages/ku.js +1 -1
  25. data/app/assets/javascripts/languages/me.js +1 -1
  26. data/app/assets/javascripts/languages/nb.js +1 -1
  27. data/app/assets/javascripts/languages/nl.js +1 -1
  28. data/app/assets/javascripts/languages/pl.js +1 -1
  29. data/app/assets/javascripts/languages/pt_br.js +1 -1
  30. data/app/assets/javascripts/languages/pt_pt.js +1 -1
  31. data/app/assets/javascripts/languages/ro.js +1 -1
  32. data/app/assets/javascripts/languages/ru.js +1 -1
  33. data/app/assets/javascripts/languages/sk.js +1 -1
  34. data/app/assets/javascripts/languages/sl.js +1 -1
  35. data/app/assets/javascripts/languages/sr.js +1 -1
  36. data/app/assets/javascripts/languages/sv.js +1 -1
  37. data/app/assets/javascripts/languages/th.js +1 -1
  38. data/app/assets/javascripts/languages/tr.js +1 -1
  39. data/app/assets/javascripts/languages/uk.js +1 -1
  40. data/app/assets/javascripts/languages/vi.js +1 -1
  41. data/app/assets/javascripts/languages/zh_cn.js +1 -1
  42. data/app/assets/javascripts/languages/zh_tw.js +1 -1
  43. data/app/assets/javascripts/plugins/align.min.js +1 -1
  44. data/app/assets/javascripts/plugins/char_counter.min.js +2 -2
  45. data/app/assets/javascripts/plugins/code_beautifier.min.js +1 -1
  46. data/app/assets/javascripts/plugins/code_view.min.js +1 -1
  47. data/app/assets/javascripts/plugins/colors.min.js +1 -1
  48. data/app/assets/javascripts/plugins/cryptojs.min.js +1 -1
  49. data/app/assets/javascripts/plugins/draggable.min.js +1 -1
  50. data/app/assets/javascripts/plugins/edit_in_popup.min.js +1 -1
  51. data/app/assets/javascripts/plugins/emoticons.min.js +2 -2
  52. data/app/assets/javascripts/plugins/entities.min.js +1 -1
  53. data/app/assets/javascripts/plugins/file.min.js +1 -1
  54. data/app/assets/javascripts/plugins/files_manager.min.js +2 -2
  55. data/app/assets/javascripts/plugins/filestack.min.js +7 -0
  56. data/app/assets/javascripts/plugins/font_family.min.js +1 -1
  57. data/app/assets/javascripts/plugins/font_size.min.js +1 -1
  58. data/app/assets/javascripts/plugins/forms.min.js +1 -1
  59. data/app/assets/javascripts/plugins/fullscreen.min.js +1 -1
  60. data/app/assets/javascripts/plugins/help.min.js +1 -1
  61. data/app/assets/javascripts/plugins/image.min.js +2 -2
  62. data/app/assets/javascripts/plugins/image_manager.min.js +1 -1
  63. data/app/assets/javascripts/plugins/inline_class.min.js +1 -1
  64. data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
  65. data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
  66. data/app/assets/javascripts/plugins/line_height.min.js +1 -1
  67. data/app/assets/javascripts/plugins/link.min.js +1 -1
  68. data/app/assets/javascripts/plugins/lists.min.js +1 -1
  69. data/app/assets/javascripts/plugins/markdown.min.js +1 -1
  70. data/app/assets/javascripts/plugins/paragraph_format.min.js +1 -1
  71. data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
  72. data/app/assets/javascripts/plugins/print.min.js +1 -1
  73. data/app/assets/javascripts/plugins/quick_insert.min.js +1 -1
  74. data/app/assets/javascripts/plugins/quote.min.js +1 -1
  75. data/app/assets/javascripts/plugins/save.min.js +1 -1
  76. data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
  77. data/app/assets/javascripts/plugins/table.min.js +2 -2
  78. data/app/assets/javascripts/plugins/track_changes.min.js +2 -2
  79. data/app/assets/javascripts/plugins/trim_video.min.js +1 -1
  80. data/app/assets/javascripts/plugins/url.min.js +1 -1
  81. data/app/assets/javascripts/plugins/video.min.js +2 -2
  82. data/app/assets/javascripts/plugins/word_counter.min.js +1 -1
  83. data/app/assets/javascripts/plugins/word_paste.min.js +2 -2
  84. data/app/assets/javascripts/plugins.pkgd.min.js +2 -2
  85. data/app/assets/javascripts/third_party/embedly.min.js +1 -1
  86. data/app/assets/javascripts/third_party/font_awesome.min.js +1 -1
  87. data/app/assets/javascripts/third_party/image_tui.min.js +1 -1
  88. data/app/assets/javascripts/third_party/showdown.min.js +1 -1
  89. data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
  90. data/app/assets/stylesheets/froala_editor.css +1 -1
  91. data/app/assets/stylesheets/froala_editor.min.css +1 -1
  92. data/app/assets/stylesheets/froala_editor.pkgd.css +37 -1
  93. data/app/assets/stylesheets/froala_editor.pkgd.min.css +2 -2
  94. data/app/assets/stylesheets/froala_style.css +1 -1
  95. data/app/assets/stylesheets/froala_style.min.css +1 -1
  96. data/app/assets/stylesheets/plugins/char_counter.css +1 -1
  97. data/app/assets/stylesheets/plugins/char_counter.min.css +1 -1
  98. data/app/assets/stylesheets/plugins/code_view.css +1 -1
  99. data/app/assets/stylesheets/plugins/code_view.min.css +1 -1
  100. data/app/assets/stylesheets/plugins/colors.css +1 -1
  101. data/app/assets/stylesheets/plugins/colors.min.css +1 -1
  102. data/app/assets/stylesheets/plugins/draggable.css +1 -1
  103. data/app/assets/stylesheets/plugins/draggable.min.css +1 -1
  104. data/app/assets/stylesheets/plugins/emoticons.css +1 -1
  105. data/app/assets/stylesheets/plugins/emoticons.min.css +1 -1
  106. data/app/assets/stylesheets/plugins/file.css +1 -1
  107. data/app/assets/stylesheets/plugins/file.min.css +1 -1
  108. data/app/assets/stylesheets/plugins/files_manager.css +1 -1
  109. data/app/assets/stylesheets/plugins/files_manager.min.css +1 -1
  110. data/app/assets/stylesheets/plugins/filestack.css +41 -0
  111. data/app/assets/stylesheets/plugins/filestack.min.css +7 -0
  112. data/app/assets/stylesheets/plugins/fullscreen.css +1 -1
  113. data/app/assets/stylesheets/plugins/fullscreen.min.css +1 -1
  114. data/app/assets/stylesheets/plugins/help.css +1 -1
  115. data/app/assets/stylesheets/plugins/help.min.css +1 -1
  116. data/app/assets/stylesheets/plugins/image.css +1 -1
  117. data/app/assets/stylesheets/plugins/image.min.css +1 -1
  118. data/app/assets/stylesheets/plugins/image_manager.css +1 -1
  119. data/app/assets/stylesheets/plugins/image_manager.min.css +1 -1
  120. data/app/assets/stylesheets/plugins/line_breaker.css +1 -1
  121. data/app/assets/stylesheets/plugins/line_breaker.min.css +1 -1
  122. data/app/assets/stylesheets/plugins/markdown.css +1 -1
  123. data/app/assets/stylesheets/plugins/markdown.min.css +1 -1
  124. data/app/assets/stylesheets/plugins/quick_insert.css +1 -1
  125. data/app/assets/stylesheets/plugins/quick_insert.min.css +1 -1
  126. data/app/assets/stylesheets/plugins/special_characters.css +1 -1
  127. data/app/assets/stylesheets/plugins/special_characters.min.css +1 -1
  128. data/app/assets/stylesheets/plugins/table.css +1 -1
  129. data/app/assets/stylesheets/plugins/table.min.css +1 -1
  130. data/app/assets/stylesheets/plugins/trim_video.css +1 -1
  131. data/app/assets/stylesheets/plugins/trim_video.min.css +1 -1
  132. data/app/assets/stylesheets/plugins/video.css +1 -1
  133. data/app/assets/stylesheets/plugins/video.min.css +1 -1
  134. data/app/assets/stylesheets/plugins.pkgd.css +37 -1
  135. data/app/assets/stylesheets/plugins.pkgd.min.css +2 -2
  136. data/app/assets/stylesheets/themes/dark.css +3 -1
  137. data/app/assets/stylesheets/themes/dark.min.css +2 -2
  138. data/app/assets/stylesheets/themes/gray.css +3 -1
  139. data/app/assets/stylesheets/themes/gray.min.css +2 -2
  140. data/app/assets/stylesheets/themes/royal.css +3 -1
  141. data/app/assets/stylesheets/themes/royal.min.css +2 -2
  142. data/app/assets/stylesheets/third_party/embedly.css +1 -1
  143. data/app/assets/stylesheets/third_party/embedly.min.css +1 -1
  144. data/app/assets/stylesheets/third_party/font_awesome.css +1 -1
  145. data/app/assets/stylesheets/third_party/font_awesome.min.css +1 -1
  146. data/app/assets/stylesheets/third_party/image_tui.css +1 -1
  147. data/app/assets/stylesheets/third_party/image_tui.min.css +1 -1
  148. data/app/assets/stylesheets/third_party/spell_checker.css +1 -1
  149. data/app/assets/stylesheets/third_party/spell_checker.min.css +1 -1
  150. data/lib/wysiwyg-rails/version.rb +1 -1
  151. metadata +5 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 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,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+=" ".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()}})});
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\?))?\/?((shorts\/)|(v=))?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/|shorts\/)?([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,f,p,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 f={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>'},p=w.popups.create("video.insert",f);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)}(p),p}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,f,p){w.edit.off(),b("Loading video"),e&&(s=w.helpers.sanitizeURL(s));var c=function c(){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,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(),O(),w.undo.saveStep(),w.$el.blur(),w.events.trigger(i?"video.replaced":"video.inserted",[e,f])}else e=I(s,d,m,p),O(),w.undo.saveStep(),w.events.trigger("video.inserted",[e,f])};R("Loading video"),c()}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 f(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(p){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 k(){w.edit.on(),d(!0)}function I(e,t,o,i){var a,r,n="";if(t&&void 0!==t)for(a in t)t.hasOwnProperty(a)&&"link"!=a&&(n+=" ".concat(a,'="').concat(t[a],'"'));var s=w.opts.videoDefaultWidth;s&&"auto"!=s&&(s="".concat(s,"px")),w.helpers.isMobile()&&w.browser.safari&&(n+=" autoplay playsinline"),(r="audio"==i?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('<audio src="'+e+'" '+n+" controls>"+w.language.translate("Your browser does not support HTML5 video.")+"</audio>"):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+'" '+n+(s?' style="width: '+s+';" ':"")+" controls>"+w.language.translate("Your browser does not support HTML5 video.")+"</video>")).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 d=w.$el.find(".fr-marker");return w.node.isLastSibling(d)&&d.parent().hasClass("fr-deletable")&&d.insertAfter(d.parent()),d.replaceWith(r),w.selection.clear(),"audio"!==i&&(r.find("video").get(0).readyState>r.find("video").get(0).HAVE_FUTURE_DATA||w.helpers.isIOS()?o.call(r.find("video").get(0)):r.find("video").on("canplaythrough load",o)),r}function T(e){if(!w.core.sameInstance(p))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(),(f=A(this)).data("start-x",t),f.data("start-y",o),s.show(),w.popups.hideAll(),Y()}function z(e){if(!w.core.sameInstance(p))return!0;if(f){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=f.data("start-x"),a=f.data("start-y");f.data("start-x",t),f.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();(f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(r=0-r),(f.hasClass("fr-hnw")||f.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(p))return!0;f&&E&&(e&&e.stopPropagation(),f=null,s.hide(),M(),r(),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(){p||function n(){var e;if(w.shared.$video_resizer?(p=w.shared.$video_resizer,s=w.shared.$vid_overlay,w.events.on("destroy",function(){A("body").first().append(p.removeClass("fr-active"))},!0)):(w.shared.$video_resizer=A(document.createElement("div")).attr("class","fr-video-resizer"),p=w.shared.$video_resizer,w.events.$on(p,"mousedown",function(e){e.stopPropagation()},!0),w.opts.videoResize&&(p.append($("nw")+$("ne")+$("sw")+$("se")),w.shared.$vid_overlay=A(document.createElement("div")).attr("class","fr-video-overlay"),s=w.shared.$vid_overlay,e=p.get(0).ownerDocument,A(e).find("body").first().append(s))),w.events.on("shared.destroy",function(){p.html("").removeData().remove(),p=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=p.get(0).ownerDocument,w.events.$on(p,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=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)),a=o,r=e.timeStamp}}),w.events.on("keyup",function(){i=1})}}(),(w.$wp||w.$sc).append(p),p.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"))),p.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)&&(p.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 f=w.opts.videoUploadToAzure.account,p=w.opts.videoUploadToAzure.container;if(w.opts.videoUploadToAzure.uploadURL){var c=w.opts.videoUploadToAzure.uploadURL.split("/");p=c.pop(),f=c.pop().split(".")[0]}var v="x-ms-blob-type:BlockBlob\nx-ms-date:".concat(l,"\nx-ms-version:2019-07-07"),u=encodeURI("/"+f+"/"+p+"/"+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 "+f+":"+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=k,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.events.on("filestack-init-video",function(){n()})}(),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()),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 f=d.html.indexOf("{url}")+5;d.html=[d.html.slice(0,f),l,d.html.slice(f)].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 fe(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 pe(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("")}},insertHtmlVideo:x}},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()}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 Froala Labs
5
5
  */
6
6
 
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],e):e(t.FroalaEditor)}(this,function(k){"use strict";function s(t){return function e(t){if(Array.isArray(t))return l(t)}(t)||function r(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function i(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(t,e)}(t)||function n(){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 l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}k=k&&k.hasOwnProperty("default")?k["default"]:k,Object.assign(k.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent","border","border-.*","line-height","list-style-type"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),k.PLUGINS.wordPaste=function(E){var a,n,T,I=E.$,o="word_paste",c={},S=!0,w=0;function e(t){var e=E.opts.wordAllowedStyleProps;t||(E.opts.wordAllowedStyleProps=[]),0===n.indexOf("<colgroup>")&&(n="<table>"+n+"</table>"),n=l(n=n.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(t,e){for(var r="",i=0;i++<e.length;)r+="&nbsp;";return r}),E.paste.getRtfClipboard());var r=E.doc.createElement("DIV");r.innerHTML=n,E.html.cleanBlankSpaces(r),n=r.innerHTML,n=(n=E.paste.cleanEmptyTagsAndDivs(n)).replace(/\u200b/g,""),function i(){E.modals.hide(o)}(),E.helpers.isMobile()&&E.events.focus(),E.paste.clean(n,!0,!0),E.opts.wordAllowedStyleProps=e}function L(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,e){if(e(t))for(var r=t.firstChild;r;){var i=r,n=r.previousSibling;r=r.nextSibling,m(i,e),i.previousSibling||i.nextSibling||i.parentNode||!r||n===r.previousSibling||!r.parentNode?i.previousSibling||i.nextSibling||i.parentNode||!r||r.previousSibling||r.nextSibling||r.parentNode||(n?r=n.nextSibling?n.nextSibling.nextSibling:null:t.firstChild&&(r=t.firstChild.nextSibling)):r=n?n.nextSibling:t.firstChild}}function P(t){return I(t).hasClass("ListContainerWrapper")&&0<I(t).find("ol").length}function D(t){return I(t).hasClass("ListContainerWrapper")&&0<I(t).find("ul").length}function _(t){if(P(t)||D(t))return!0;if(!t.getAttribute("style")||!/mso-list:[\s]*l/gi.test(t.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!t.querySelector('[style="mso-list:Ignore"]'))return!!(t.outerHTML&&0<=t.outerHTML.indexOf("\x3c!--[if !supportLists]--\x3e"))}catch(e){return!1}return!0}function $(t){return P(t)||D(t)?I(t).find("li").attr("data-aria-level"):t.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1")}function F(t,i){var e=t.cloneNode(!0);if(-1!==["H1","H2","H3","H4","H5","H6"].indexOf(t.tagName)){var r=document.createElement(t.tagName.toLowerCase());r.setAttribute("style",t.getAttribute("style")),r.innerHTML=e.innerHTML,e.innerHTML=r.outerHTML}m(e,function(t){if(t.nodeType==Node.COMMENT_NODE&&(E.browser.msie||E.browser.safari||E.browser.edge))try{if("[if !supportLists]"===t.data){for(t=t.nextSibling;t&&t.nodeType!==Node.COMMENT_NODE;){var e=t.nextSibling;t.parentNode.removeChild(t),t=e}t&&t.nodeType==Node.COMMENT_NODE&&t.parentNode.removeChild(t)}}catch(r){return!1}return t.nodeType===Node.ELEMENT_NODE&&("mso-list:\nIgnore"===t.getAttribute("style")&&t.setAttribute("style","mso-list:Ignore"),"mso-list:Ignore"===t.getAttribute("style")&&t.parentNode.removeChild(t),t.setAttribute("style",h(t)),N(t,i)),!0});var n=P(t)?I(t).find("li").get(0).innerHTML:e.innerHTML;if(P(t)||D(t)){n="";for(var l=I(t).find("li"),a=0;a<l.length;a++){var o=I(l.get(a).innerHTML);o.find("span").each(function(){"&nbsp;"===I(this).html()&&(0<I(this).prev().text().trim().length?I(this).remove():I(this).html("&ZeroWidthSpace;"))});var s=l[a].style.marginLeft;s?(s=parseFloat(parseFloat(s).toFixed(2))+s.match(/[a-zA-Z]+/g)[0],n+='<li style = "margin-left: '.concat(s,';">').concat(o.get(0).innerHTML,"</li>")):n+="<li >".concat(o.get(0).innerHTML,"</li>")}}else{var d,f=null===(d=I(t).find("p").get(0))||void 0===d?void 0:d.style.marginLeft;n=f?(f=parseFloat(parseFloat(f).toFixed(2))+f.match(/[a-zA-Z]+/g)[0],'<li style = "margin-left: '.concat(f,';">').concat(n,"</li>")):"<li>".concat(n,"</li>")}return n=n.replace(/<!--[\s\S]*?-->/gi,"")}function h(t){var e=1<arguments.length&&arguments[1]!==undefined?arguments[1]:null,r="",i=["line-height","font-family","font-size","color","background"].concat(s(e||[])),n=t.getAttribute("style");return n&&i.forEach(function(e){var t=n.split(";").find(function(t){return t.trim().includes(e+":")});t&&(t.includes("mso")&&(t=t.match(new RegExp(e+":.*(;|)"))[0]),t.trim().startsWith(e)&&(r+=t+";"))}),r}function y(t,e){for(var r=document.createElement(e),i=0;i<t.attributes.length;i++){var n=t.attributes[i].name;"FONT"===t.tagName&&(E.browser.msie&&["id","class","style"].indexOf(n)<0||!E.browser.msie&&CSS.supports(n,t.getAttribute(n)))?I(r).css(n,t.getAttribute(n)):r.setAttribute(n,t.getAttribute(n))}return r.innerHTML=t.innerHTML,t.parentNode.replaceChild(r,t),r}function x(t,e){E.node.clearAttributes(t);for(var r=t.firstElementChild,i=0,n=!1,l=null;r;){if(r.firstElementChild&&-1!==r.firstElementChild.tagName.indexOf("W:"))for(var a=0;a<r.children.length;a++)"<('[^']*'|\"[^\"]*\"|[^\"'>])*>"==r.children[a]&&(r.innerHTML+=r.children[a]);(l=r.getAttribute("width"))||(l=r.style.width),l||n||(n=!0),i+=parseInt(l,10),(!r.firstChild||r.firstChild&&r.firstChild.data===k.UNICODE_NBSP)&&(r.firstChild&&L(r.firstChild),r.innerHTML="<br>");for(var o=r.firstElementChild,s=1===r.children.length;o;)"P"!==o.tagName||_(o)||s&&M(o),o=o.nextElementSibling;if(e){var d=r.getAttribute("class");if(d){var f=(d=H(d)).match(/xl[0-9]+/gi);if(f){var u="."+f[0];e[u]&&O(r,e[u])}}e.td&&O(r,e.td)}var g=r.getAttribute("style");g&&(g=H(g))&&";"!==g.slice(-1)&&(g+=";");var p=r.getAttribute("valign");if(!p&&g){var c=g.match(/vertical-align:.+?[; "]{1,1}/gi);c&&(p=c[c.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var m=null;if(g){var h=g.match(/text-align:.+?[; "]{1,1}/gi);h&&(m=h[h.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===m&&(m=null)}var v=null;if(g){var b=g.match(/background:.+?[; "]{1,1}/gi);b&&(v=b[b.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var y=r.getAttribute("colspan"),x=r.getAttribute("rowspan");y&&r.setAttribute("colspan",y),x&&r.setAttribute("rowspan",x),p&&(r.style["vertical-align"]=p),m&&(r.style["text-align"]=m),v&&(r.style["background-color"]=v),l&&r.setAttribute("width",l),r=r.nextElementSibling}for(r=t.firstElementChild;r;)l=r.getAttribute("width"),n&&r.removeAttribute("width"),r=r.nextElementSibling;t.previousSibling?T!=i&&(S=!1):T=i,!t.nextElementSibling&&S&&function C(t){for(;t;){for(var e=t.firstElementChild,r=null,i=0;e;)r=e.getAttribute("width"),i+=parseInt(r,10),e=e.nextElementSibling;for(e=t.firstElementChild;e;)r=e.getAttribute("width"),e.setAttribute("width",100*parseInt(r,10)/i+"%"),e=e.nextElementSibling;t=t.previousElementSibling}}(t);var N=I(t).parentsUntil("table").parent().last();if(w<i&&(w=i),!t.nextElementSibling&&0<N.length){var A=I(N)[0].width;I(N)[0].style.width=A||w,S=!(w=0)}}function M(t){var e=t.getAttribute("align");e&&(t.style["text-align"]=e,t.removeAttribute("align"))}function H(t){return t.replace(/\n|\r|\n\r|&quot;/g,"")}function O(t,e,r){if(e){var i=t.getAttribute("style");i&&";"!==i.slice(-1)&&(i+=";"),e&&";"!==e.slice(-1)&&(e+=";"),e=e.replace(/\n/gi,"");var n=null;n=r?(i||"")+e:e+(i||""),t.setAttribute("style",n)}}var p=null;function v(t,e,r){for(var i=t.split(r),n=1;n<i.length;n++){var l=i[n];if(1<(l=l.split("shplid")).length){l=l[1];for(var a="",o=0;o<l.length&&"\\"!==l[o]&&"{"!==l[o]&&" "!==l[o]&&"\r"!==l[o]&&"\n"!==l[o];)a+=l[o],o++;var s=l.split("bliptag");if(s&&s.length<2)continue;var d=null;if(-1!==s[0].indexOf("pngblip")?d="image/png":-1!==s[0].indexOf("jpegblip")&&(d="image/jpeg"),!d)continue;var f=s[1].split("}");if(f&&f.length<2)continue;var u=void 0;if(2<f.length&&-1!==f[0].indexOf("blipuid"))u=f[1].split(" ");else{if((u=f[0].split(" "))&&u.length<2)continue;u.shift()}var g=u.join("");p[e+a]={image_hex:g,image_type:d}}}}function b(t,e){if(e){var r;if("IMG"===t.tagName){var i,n,l=t.getAttribute("src");if(!l||-1===l.indexOf("file://"))return;if(0===l.indexOf("file://")&&E.helpers.isURL(t.getAttribute("alt")))return void t.setAttribute("src",t.getAttribute("alt"));if(!(r=c[t.getAttribute("v:shapes")]))r=t.getAttribute("v:shapes"),null!=t&&t.parentNode&&null!=t&&null!==(i=t.parentNode)&&void 0!==i&&i.parentNode&&0<=(null==t||null===(n=t.parentNode)||void 0===n||null===(n=n.parentNode)||void 0===n||null===(n=n.innerHTML)||void 0===n?void 0:n.indexOf("msEquation"))&&(r=null)}else{var a;r=null==t||null===(a=t.parentNode)||void 0===a?void 0:a.getAttribute("o:spid")}if(t.removeAttribute("height"),r){!function u(t){p={},v(t,"i","\\shppict"),v(t,"s","\\shp{")}(e);var o=p[r.substring(7)];if(o){var s,d=function g(t){for(var e=t.match(/[0-9a-f]{2}/gi),r=[],i=0;i<e.length;i++)r.push(String.fromCharCode(parseInt(e[i],16)));var n=r.join("");return btoa(n)}(o.image_hex),f="data:"+o.image_type+";base64,"+d;if("IMG"===t.tagName)t.src=f,t.setAttribute("data-fr-image-pasted",!0);else I(null==t?void 0:t.parentNode).before('<img data-fr-image-pasted="true" src="'+f+'" style="'+(null==t||null===(s=t.parentNode)||void 0===s?void 0:s.getAttribute("style"))+'">').remove()}}}}function N(t,e){var r=t.tagName,i=r.toLowerCase();t.firstElementChild&&("I"===t.firstElementChild.tagName?y(t.firstElementChild,"em"):"B"===t.firstElementChild.tagName&&y(t.firstElementChild,"strong"));if(-1!==["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(r))return L(t),!1;for(var n=["META","LINK","XML","ST1:","O:","W:","FONT"],l=0;l<n.length;l++)if(-1!==r.indexOf(n[l]))return t.innerHTML&&(t.outerHTML=t.innerHTML),L(t),!1;if("TD"!==r){var a=t.getAttribute("class")||"MsoNormal";if(e&&a){for(var o=(a=H(a)).split(" "),s=0;s<o.length;s++){var d=[],f="."+o[s];d.push(f),f=i+f,d.push(f);for(var u=0;u<d.length;u++)e[d[u]]&&O(t,e[d[u]])}t.removeAttribute("class")}e&&e[i]&&O(t,e[i])}if(-1!==["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(r)){var g=t.getAttribute("class");if(g&&(e&&e[r.toLowerCase()+"."+g]&&O(t,e[r.toLowerCase()+"."+g]),-1!==g.toLowerCase().indexOf("mso"))){var p=H(g);(p=p.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?t.setAttribute("class",p):t.removeAttribute("class")}var c=t.getAttribute("style");if(c){var m=c.match(/text-align:.+?[; "]{1,1}/gi);m&&m[m.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}M(t)}if("TR"===r&&x(t,e),"A"!==r||t.attributes.getNamedItem("href")||t.attributes.getNamedItem("name")||!t.innerHTML||(t.outerHTML=t.innerHTML),"A"==r&&t.getAttribute("href")&&t.querySelector("img"))for(var h=t.querySelectorAll("span"),v=0;v<h.length;v++)h[v].innerText||(h[v].outerHTML=h[v].innerHTML);if("TD"!==r&&"TH"!==r||t.innerHTML||(t.innerHTML="<br>"),t.getAttribute("lang")&&t.removeAttribute("lang"),t.getAttribute("style")&&-1!==t.getAttribute("style").toLowerCase().indexOf("mso")){var b=H(t.getAttribute("style"));(b=b.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,"").replace("line-height:107%",""))?t.setAttribute("style",b):t.removeAttribute("style")}return!0}function l(t,e){0<=t.indexOf("<html")&&(t=t.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));var s=t.match(/(MSFontService|class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument|LibreOffice)/gi);!function u(t){for(var e=t.split("v:shape"),r=1;r<e.length;r++){var i=e[r],n=i.split(' id="')[1];if(n&&1<n.length){n=n.split('"')[0];var l=i.split(' o:spid="')[1];l&&1<l.length&&(l=l.split('"')[0],c[n]=l)}}}(t);var r=(new DOMParser).parseFromString(t,"text/html"),i=r.head,n=r.body,d=function g(t){var e={},r=t.getElementsByTagName("style");if(r.length){var i=r[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(i)for(var n=0;n<i.length;n++){var l=i[n],a=l.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),o=l.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");a=a.replace(/^[\s]|[\s]$/gm,""),o=o.replace(/^[\s]|[\s]$/gm,""),a=a.replace(/\n|\r|\n\r/g,""),o=o.replace(/\n|\r|\n\r/g,"");for(var s=a.split(", "),d=0;d<s.length;d++)e[s[d]]=o}}return e}(i);m(n,function(t){if(t.nodeType===Node.TEXT_NODE&&/\n|\u00a0|\r/.test(t.data)){if(!/\S| /.test(t.data)&&!/[\u00a0]+/.test(t.data))return t.data===k.UNICODE_NBSP?(t.data="\u200b",!0):1===t.data.length&&10===t.data.charCodeAt(0)?(t.data=" ",!0):(L(t),!1);t.data=t.data.replace(/\n|\r/gi," ")}return!0}),m(n,function(t){return t.nodeType!==Node.ELEMENT_NODE||"V:IMAGEDATA"!==t.tagName&&"IMG"!==t.tagName||b(t,e),!0});for(var l=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),a=l.length-1;0<=a;a--)l[a].previousElementSibling&&"LI"===l[a].previousElementSibling.tagName&&l[a].previousElementSibling.appendChild(l[a]);m(n,function(t){if(t.nodeType===Node.TEXT_NODE)return t.data=t.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(t.nodeType===Node.ELEMENT_NODE){if(_(t)){var e=t.parentNode,r=t.previousSibling,i=function O(t,e,r,i){var n,l,a,o,s,d,f,u=navigator.userAgent.toLowerCase();-1!=u.indexOf("safari")&&(u=-1<u.indexOf("chrome")?1:"safari"),t.innerHTML.includes("mso-list:\nIgnore")&&(t.innerHTML=t.innerHTML.replace(/mso-list:\nIgnore/gi,"mso-list:Ignore"));var g,p,c,m,h=/[0-9a-zA-Z]./gi,v="",b=P(t),y=null===(n=I(t).find("ol"))||void 0===n||null===(n=n.attr("style"))||void 0===n||null===(n=n.split(";"))||void 0===n?void 0:n.find(function(t){return t.trim().startsWith("list-style-type")});y==undefined&&D(t)&&(y=null===(p=I(t).find("ul"))||void 0===p||null===(p=p.attr("style"))||void 0===p||null===(p=p.split(";"))||void 0===p?void 0:p.find(function(t){return t.trim().startsWith("list-style-type")}));if(b)d="ol",f=y?"list-style-type: "+y.replace("list-style-type:","").trim()+";":"";else if(D(t))d="ul",f=y?"list-style-type: "+y.replace("list-style-type:","").trim()+";":"";else{var x=t.querySelector('span[style="mso-list:Ignore"]');null==x&&"safari"==u&&(x=t.querySelector('span[lang="PT-BR"]'));var N=!1;x&&(N=N||h.test(x.textContent)),null!==x&&(g=x.textContent.trim().split(".")[0]),d=1==N?(g=(g=x.textContent.trim().split(".")[0]).replace(/\(([^)]+)\)/g,"$1"),isNaN(parseInt(g))?"i"==g?f="lower-roman;":"I"==g?f="upper-roman;":"o"==g?f="circle;":g.match(/^v$/)||(g.match(/^[a-z]$/)||g.match(/^[a-z]\)$/)?f="lower-alpha;":(g.match(/^[A-Z]$/)||g.match(/^[A-Z]\)$/))&&(f="upper-alpha;")):f="decimal;",f="list-style-type: "+f,"ol"):(null!=x&&(g=x.textContent.trim().split(".")[0]),"\xa7"==g?f="square;":"\xb7"==g&&(f="disc;"),f="list-style-type: "+f,"ul"),x==undefined||x.textContent==undefined||isNaN(parseInt(x.textContent.trim().split(".")[1],10))||(v=' class="decimal_type" ')}var A=1,C="",E=($(t),t.style.marginLeft),T="";E.includes("in")?(T="in",E=parseFloat(E)-.5):E.includes("pt")&&(T="px",E=parseFloat(E)-10),E&&(m=" margin-left: "+E+T+";"),A="list-style-type: upper-alpha;"==f?b?parseInt(I(t).find("ol").attr("start")):g.charCodeAt(0)-64:"list-style-type: lower-alpha;"==f?b?parseInt(I(t).find("ol").attr("start")):g.charCodeAt(0)-96:b?parseInt(I(t).find("ol").attr("start")):parseInt(g),C+=f||"",C+=m||"",c="<"+d,c+=v||"",c+="ol"!=d||1==A||isNaN(A)?"":' start = "'+A+'"',c+=C?' style = "'+C+'"':"",c+=">";for(var S=!1;t;){if(!_(t)){if(t.outerHTML&&0<t.outerHTML.indexOf("mso-bookmark")&&0==(t.textContent||"").length){t=t.nextElementSibling;continue}break}var w=$(t);if((r=r||w)<w)c+=(s=O(t,e,w,t.style.marginLeft)).el.outerHTML,t=s.currentNode;else{if(w<r)break;t.firstElementChild&&t.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.firstChild&&(h.lastIndex=0),a&&a.firstElementChild&&a.firstElementChild.firstElementChild&&a.firstElementChild.firstElementChild.firstChild&&(h.lastIndex=0,l=h.test(a.firstElementChild.firstElementChild.firstChild.data||a.firstElementChild.firstElementChild.firstChild.firstChild&&a.firstElementChild.firstElementChild.firstChild.firstChild.data||""));var L=!1;(!i&&!t.style.marginLeft||i&&t.style.marginLeft&&i===t.style.marginLeft)&&(L=!0),i=t.style.marginLeft,L||l===undefined?(o=F(t,e),t.nextSibling&&t.nextSibling.innerText!=undefined&&t.nextSibling.innerText!=undefined&&!c.includes('class="decimal_type"')&&(isNaN(parseInt(t.nextSibling.innerText.trim().split(".")[1],10))||(c=c.substring(3,0)+' class="decimal_type"'+c.substring(3,c.length))),c+=o):(1==w&&(c+="</"+d+">",S=!0,a=null),c+=(s=O(t,e,w,t.style.marginLeft)).el.outerHTML,t=s.currentNode);var M=t&&t.nextElementSibling;if(M&&(a=M.previousElementSibling),t&&!_(t)){if(t.outerHTML&&0<t.outerHTML.indexOf("mso-bookmark")&&0==(t.textContent||"").length){t=t.nextElementSibling;continue}break}t&&t.parentNode&&t.parentNode.removeChild(t),t=M}}S||(c+="</"+d+">");var H=document.createElement("div");return H.innerHTML=c,{el:H,currentNode:t}}(t,d).el,n=null;return(n=r?r.nextSibling:e.firstChild)?e.insertBefore(i,n):e.appendChild(i),!1}return"FONT"===t.tagName&&(s&&"LibreOffice"===s[0]||d["."+t.getAttribute("class")])?t=y(t,"span"):s&&"\x3c!--StartFragment--\x3e"===s[0]&&"UL"===t.tagName&&(I(t).find("li span").each(function(){"&nbsp;"===I(this).html()&&(0<I(this).prev().text().trim().length?I(this).remove():I(this).html("&ZeroWidthSpace;"))}),I(t).is("ul")&&t.setAttribute("style",h(t,["margin","margin-left","list-style-type"])),I(t).find("ul").each(function(){this.setAttribute("style",h(this,["margin","margin-left","list-style-type"]))})),function o(e){Array.from(e.attributes).map(function(t){return t.name}).filter(function(t){return t.toLowerCase().startsWith("data-")||t.toLowerCase().startsWith("xml:")}).forEach(function(t){I(e).removeAttr(t)})}(t),N(t,d)}if(t.nodeType!==Node.COMMENT_NODE)return!0;if(-1<t.data.indexOf("[if !supportLineBreakNewLine]"))for(var l=t.nextSibling;l;)(l=t.nextSibling)&&L(l),l.data&&-1<l.data.indexOf("[endif]")&&(l=null);if(-1<t.data.indexOf("[if supportFields]")&&-1<t.data.indexOf("FORMCHECKBOX")){var a=document.createElement("input");a.type="checkbox",t.parentNode.insertBefore(a,t.nextSibling)}return L(t),!1}),n.innerHTML=function p(t){var e=I(document.createElement("div")).attr("id","top-level");e.html(t);for(var r=e[0].querySelectorAll("ol, ul"),i=0;i<r.length;i++)if(I(r[i]).parentsUntil("#top-level","ol, ul").length){r[i].style.removeProperty("margin-left");for(var n=r[i].children,l=0;l<n.length;l++)"LI"==n[l].tagName&&n[l].style.removeProperty("margin-left")}return e[0].innerHTML}(n.innerHTML),m(n,function(t){if(t.nodeType===Node.ELEMENT_NODE){var e=t.tagName;if(!t.innerHTML&&-1===["BR","IMG","INPUT"].indexOf(e)){for(var r=t.parentNode;r&&(L(t),!(t=r).innerHTML)&&"TD"!==t.parentNode.tagName;)r=t.parentNode;return!1}!function u(t){var e=t.getAttribute("style");if(e){(e=H(e))&&";"!==e.slice(-1)&&(e+=";");var r=e.match(/(^|\S+?):.+?;{1,1}/gi);if(r){for(var i={},n=0;n<r.length;n++){var l=r[n].split(":");2===l.length&&("text-align"===l[0]&&"SPAN"===t.tagName||(i[l[0]]=l[1]))}var a="";for(var o in i)if(i.hasOwnProperty(o)){if("font-size"===o&&"pt;"===i[o].slice(-3)){var s=null;try{s=parseFloat(i[o].slice(0,-3),10)}catch(f){s=null}if(s){var d=E.opts.fontSizeUnit;"px"===d?(s=Math.round(1.33*s),i[o]=s+"px;"):"pt"===d&&(s=Math.round(s),i[o]=s+"pt;")}}a+=o+":"+i[o]}a&&t.setAttribute("style",a)}}}(t)}return!0}),m(n,function(t){if(t&&"A"===t.nodeName&&""===t.href){for(var e=document.createDocumentFragment();t.firstChild;)e.appendChild(t.firstChild);t.parentNode.replaceChild(e,t)}return!0}),m(n,function(t){return t&&"P"===t.tagName&&"DIV"===t.parentNode.tagName&&1==t.parentNode.children.length&&I(t).unwrap(),!0});var o=n.outerHTML,f=E.opts.htmlAllowedStyleProps;return E.opts.htmlAllowedStyleProps=E.opts.wordAllowedStyleProps,o=E.clean.html(o,E.opts.wordDeniedTags,E.opts.wordDeniedAttrs,!1),E.opts.htmlAllowedStyleProps=f,o}return{_init:function t(){E.events.on("paste.wordPaste",function(t){return n=t,E.opts.wordPasteModal?function l(){if(!a){var t='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+E.language.translate("Word Paste Detected")+"</h4>",e=function n(){var t='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">';return t+='<p style="text-align: left;">'+E.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",t+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+E.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+E.language.translate("Keep")+"</button></div>",t+="</div>"}(),r=E.modals.create(o,t,e),i=r.$body;a=r.$modal,r.$modal.addClass("fr-middle"),E.events.$on(i,"click","button.fr-remove-word",function(){var t=a.data("instance")||E;t.wordPaste.clean()},!0),E.events.$on(i,"click","button.fr-keep-word",function(){var t=a.data("instance")||E;t.wordPaste.clean(!0)},!0),E.events.$on(I(E.o_win),"resize",function(){E.modals.resize(o)})}E.modals.show(o),E.modals.resize(o)}():e(E.opts.wordPasteKeepFormatting),!1})},clean:e,_wordClean:l}}});
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],e):e(t.FroalaEditor)}(this,function(k){"use strict";function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function o(t){return function e(t){if(Array.isArray(t))return l(t)}(t)||function r(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function i(t,e){if(t){if("string"==typeof t)return l(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}(t)||function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}k=k&&k.hasOwnProperty("default")?k["default"]:k,Object.assign(k.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent","border","border-.*","line-height","list-style-type"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),k.PLUGINS.wordPaste=function(E){var a,n,T,I=E.$,s="word_paste",p={},S=!0,L=0;function e(t){var e=E.opts.wordAllowedStyleProps;t||(E.opts.wordAllowedStyleProps=[]),0===n.indexOf("<colgroup>")&&(n="<table>"+n+"</table>"),n=l(n=n.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(t,e){for(var r="",i=0;i++<e.length;)r+="&nbsp;";return r}),E.paste.getRtfClipboard());var r=E.doc.createElement("DIV");r.innerHTML=n,E.html.cleanBlankSpaces(r),n=r.innerHTML,n=(n=E.paste.cleanEmptyTagsAndDivs(n)).replace(/\u200b/g,""),function i(){E.modals.hide(s)}(),E.helpers.isMobile()&&E.events.focus(),E.paste.clean(n,!0,!0),E.opts.wordAllowedStyleProps=e}function w(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,e){if(e(t))for(var r=t.firstChild;r;){var i=r,n=r.previousSibling;r=r.nextSibling,m(i,e),i.previousSibling||i.nextSibling||i.parentNode||!r||n===r.previousSibling||!r.parentNode?i.previousSibling||i.nextSibling||i.parentNode||!r||r.previousSibling||r.nextSibling||r.parentNode||(n?r=n.nextSibling?n.nextSibling.nextSibling:null:t.firstChild&&(r=t.firstChild.nextSibling)):r=n?n.nextSibling:t.firstChild}}function P(t){return I(t).hasClass("ListContainerWrapper")&&0<I(t).find("ol").length}function D(t){return I(t).hasClass("ListContainerWrapper")&&0<I(t).find("ul").length}function _(t){if(P(t)||D(t))return!0;if(!t.getAttribute("style")||!/mso-list:[\s]*l/gi.test(t.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!t.querySelector('[style="mso-list:Ignore"]'))return!!(t.outerHTML&&0<=t.outerHTML.indexOf("\x3c!--[if !supportLists]--\x3e"))}catch(e){return!1}return!0}function $(t){return P(t)||D(t)?I(t).find("li").attr("data-aria-level"):t.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1")}function F(t,i){var e=t.cloneNode(!0);if(-1!==["H1","H2","H3","H4","H5","H6"].indexOf(t.tagName)){var r=document.createElement(t.tagName.toLowerCase());r.setAttribute("style",t.getAttribute("style")),r.innerHTML=e.innerHTML,e.innerHTML=r.outerHTML}m(e,function(t){if(t.nodeType==Node.COMMENT_NODE&&(E.browser.msie||E.browser.safari||E.browser.edge))try{if("[if !supportLists]"===t.data){for(t=t.nextSibling;t&&t.nodeType!==Node.COMMENT_NODE;){var e=t.nextSibling;t.parentNode.removeChild(t),t=e}t&&t.nodeType==Node.COMMENT_NODE&&t.parentNode.removeChild(t)}}catch(r){return!1}return t.nodeType===Node.ELEMENT_NODE&&("mso-list:\nIgnore"===t.getAttribute("style")&&t.setAttribute("style","mso-list:Ignore"),"mso-list:Ignore"===t.getAttribute("style")&&t.parentNode.removeChild(t),t.setAttribute("style",h(t)),b(t,i)),!0});var n=P(t)?I(t).find("li").get(0).innerHTML:e.innerHTML;if(P(t)||D(t)){n="";for(var l=I(t).find("li"),a=0;a<l.length;a++){var s=I(l.get(a).innerHTML);s.find("span").each(function(){"&nbsp;"===I(this).html()&&(0<I(this).prev().text().trim().length?I(this).remove():I(this).html("&ZeroWidthSpace;"))});var o=l[a].style.marginLeft;o?(o=parseFloat(parseFloat(o).toFixed(2))+o.match(/[a-zA-Z]+/g)[0],n+='<li style = "margin-left: '.concat(o,';">').concat(s.get(0).innerHTML,"</li>")):n+="<li >".concat(s.get(0).innerHTML,"</li>")}}else{var d,f=null===(d=I(t).find("p").get(0))||void 0===d?void 0:d.style.marginLeft;n=f?(f=parseFloat(parseFloat(f).toFixed(2))+f.match(/[a-zA-Z]+/g)[0],'<li style = "margin-left: '.concat(f,';">').concat(n,"</li>")):"<li>".concat(n,"</li>")}return n=n.replace(/<!--[\s\S]*?-->/gi,"")}function h(t){var e=1<arguments.length&&arguments[1]!==undefined?arguments[1]:null,r="",i=["line-height","font-family","font-size","color","background"].concat(o(e||[])),n=t.getAttribute("style");return n&&i.forEach(function(e){var t=n.split(";").find(function(t){return t.trim().includes(e+":")});t&&(t.includes("mso")&&(t=t.match(new RegExp(e+":.*(;|)"))[0]),t.trim().startsWith(e)&&(r+=t+";"))}),r}function y(t,e){for(var r=document.createElement(e),i=0;i<t.attributes.length;i++){var n=t.attributes[i].name;"FONT"===t.tagName&&(E.browser.msie&&["id","class","style"].indexOf(n)<0||!E.browser.msie&&CSS.supports(n,t.getAttribute(n)))?I(r).css(n,t.getAttribute(n)):r.setAttribute(n,t.getAttribute(n))}return r.innerHTML=t.innerHTML,t.parentNode.replaceChild(r,t),r}function N(t,e){E.node.clearAttributes(t);for(var r=t.firstElementChild,i=0,n=!1,l=null;r;){if(r.firstElementChild&&-1!==r.firstElementChild.tagName.indexOf("W:"))for(var a=0;a<r.children.length;a++)"<('[^']*'|\"[^\"]*\"|[^\"'>])*>"==r.children[a]&&(r.innerHTML+=r.children[a]);(l=r.getAttribute("width"))||(l=r.style.width),l||n||(n=!0),i+=parseInt(l,10),(!r.firstChild||r.firstChild&&r.firstChild.data===k.UNICODE_NBSP)&&(r.firstChild&&w(r.firstChild),r.innerHTML="<br>");for(var s=r.firstElementChild,o=1===r.children.length;s;)"P"!==s.tagName||_(s)||o&&M(s),s=s.nextElementSibling;if(e){var d=r.getAttribute("class");if(d){var f=(d=H(d)).match(/xl[0-9]+/gi);if(f){var u="."+f[0];e[u]&&O(r,e[u])}}e.td&&O(r,e.td)}var g=r.getAttribute("style");g&&(g=H(g))&&";"!==g.slice(-1)&&(g+=";");var c=r.getAttribute("valign");if(!c&&g){var p=g.match(/vertical-align:.+?[; "]{1,1}/gi);p&&(c=p[p.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var m=null;if(g){var h=g.match(/text-align:.+?[; "]{1,1}/gi);h&&(m=h[h.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===m&&(m=null)}var v=null;if(g){var b=g.match(/background:.+?[; "]{1,1}/gi);b&&(v=b[b.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var y=r.getAttribute("colspan"),N=r.getAttribute("rowspan");y&&r.setAttribute("colspan",y),N&&r.setAttribute("rowspan",N),c&&(r.style["vertical-align"]=c),m&&(r.style["text-align"]=m),v&&(r.style["background-color"]=v),l&&r.setAttribute("width",l),r=r.nextElementSibling}for(r=t.firstElementChild;r;)l=r.getAttribute("width"),n&&r.removeAttribute("width"),r=r.nextElementSibling;t.previousSibling?T!=i&&(S=!1):T=i,!t.nextElementSibling&&S&&function C(t){for(;t;){for(var e=t.firstElementChild,r=null,i=0;e;)r=e.getAttribute("width"),i+=parseInt(r,10),e=e.nextElementSibling;for(e=t.firstElementChild;e;)r=e.getAttribute("width"),e.setAttribute("width",100*parseInt(r,10)/i+"%"),e=e.nextElementSibling;t=t.previousElementSibling}}(t);var x=I(t).parentsUntil("table").parent().last();if(L<i&&(L=i),!t.nextElementSibling&&0<x.length){var A=I(x)[0].width;I(x)[0].style.width=A||L,S=!(L=0)}}function M(t){var e=t.getAttribute("align");e&&(t.style["text-align"]=e,t.removeAttribute("align"))}function H(t){return t.replace(/\n|\r|\n\r|&quot;/g,"")}function O(t,e,r){if(e){var i=t.getAttribute("style");i&&";"!==i.slice(-1)&&(i+=";"),e&&";"!==e.slice(-1)&&(e+=";"),e=e.replace(/\n/gi,"");var n=null;n=r?(i||"")+e:e+(i||""),t.setAttribute("style",n)}}var c=null;function d(t,e,r){for(var i=t.split(r),n=1;n<i.length;n++){var l=i[n];if(1<(l=l.split("shplid")).length){l=l[1];for(var a="",s=0;s<l.length&&"\\"!==l[s]&&"{"!==l[s]&&" "!==l[s]&&"\r"!==l[s]&&"\n"!==l[s];)a+=l[s],s++;var o=l.split("bliptag");if(o&&o.length<2)continue;var d=null;if(-1!==o[0].indexOf("pngblip")?d="image/png":-1!==o[0].indexOf("jpegblip")&&(d="image/jpeg"),!d)continue;var f=o[1].split("}");if(f&&f.length<2)continue;var u=void 0;if(2<f.length&&-1!==f[0].indexOf("blipuid"))u=f[1].split(" ");else{if((u=f[0].split(" "))&&u.length<2)continue;u.shift()}var g=u.join("");c[e+a]={image_hex:g,image_type:d}}}}function v(t,e){if(e){var r;if("IMG"===t.tagName){var i=t.getAttribute("src");if(!i||-1===i.indexOf("file://"))return;if(0===i.indexOf("file://")&&E.helpers.isURL(t.getAttribute("alt")))return void t.setAttribute("src",t.getAttribute("alt"));(r=p[t.getAttribute("v:shapes")])||(r=t.getAttribute("v:shapes"),t.parentNode&&t.parentNode.parentNode&&0<=t.parentNode.parentNode.innerHTML.indexOf("msEquation")&&(r=null))}else r=t.parentNode.getAttribute("o:spid");if(t.removeAttribute("height"),r){!function s(t){c={},d(t,"i","\\shppict"),d(t,"s","\\shp{")}(e);var n=c[r.substring(7)];if(n){var l=function o(t){for(var e=t.match(/[0-9a-f]{2}/gi),r=[],i=0;i<e.length;i++)r.push(String.fromCharCode(parseInt(e[i],16)));var n=r.join("");return btoa(n)}(n.image_hex),a="data:"+n.image_type+";base64,"+l;"IMG"===t.tagName?(t.src=a,t.setAttribute("data-fr-image-pasted",!0)):I(t).parent().before('<img data-fr-image-pasted="true" src="'.concat(a,'" style="').concat(t.parentNode.getAttribute("style"),'">')).remove()}}}}function b(t,e){var r=t.tagName,i=r.toLowerCase();t.firstElementChild&&("I"===t.firstElementChild.tagName?y(t.firstElementChild,"em"):"B"===t.firstElementChild.tagName&&y(t.firstElementChild,"strong"));if(-1!==["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(r))return w(t),!1;for(var n=["META","LINK","XML","ST1:","O:","W:","FONT"],l=0;l<n.length;l++)if(-1!==r.indexOf(n[l]))return t.innerHTML&&(t.outerHTML=t.innerHTML),w(t),!1;if("TD"!==r){var a=t.getAttribute("class")||"MsoNormal";if(e&&a){for(var s=(a=H(a)).split(" "),o=0;o<s.length;o++){var d=[],f="."+s[o];d.push(f),f=i+f,d.push(f);for(var u=0;u<d.length;u++)e[d[u]]&&O(t,e[d[u]])}t.removeAttribute("class")}e&&e[i]&&O(t,e[i])}if(-1!==["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(r)){var g=t.getAttribute("class");if(g&&(e&&e[r.toLowerCase()+"."+g]&&O(t,e[r.toLowerCase()+"."+g]),-1!==g.toLowerCase().indexOf("mso"))){var c=H(g);(c=c.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?t.setAttribute("class",c):t.removeAttribute("class")}var p=t.getAttribute("style");if(p){var m=p.match(/text-align:.+?[; "]{1,1}/gi);m&&m[m.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}M(t)}if("TR"===r&&N(t,e),"A"!==r||t.attributes.getNamedItem("href")||t.attributes.getNamedItem("name")||!t.innerHTML||(t.outerHTML=t.innerHTML),"A"==r&&t.getAttribute("href")&&t.querySelector("img"))for(var h=t.querySelectorAll("span"),v=0;v<h.length;v++)h[v].innerText||(h[v].outerHTML=h[v].innerHTML);if("TD"!==r&&"TH"!==r||t.innerHTML||(t.innerHTML="<br>"),t.getAttribute("lang")&&t.removeAttribute("lang"),t.getAttribute("style")&&-1!==t.getAttribute("style").toLowerCase().indexOf("mso")){var b=H(t.getAttribute("style"));(b=b.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,"").replace("line-height:107%",""))?t.setAttribute("style",b):t.removeAttribute("style")}return!0}function l(t,e){0<=t.indexOf("<html")&&(t=t.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));var o=t.match(/(MSFontService|class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument|LibreOffice)/gi);!function u(t){for(var e=t.split("v:shape"),r=1;r<e.length;r++){var i=e[r],n=i.split(' id="')[1];if(n&&1<n.length){n=n.split('"')[0];var l=i.split(' o:spid="')[1];l&&1<l.length&&(l=l.split('"')[0],p[n]=l)}}}(t);var r=(new DOMParser).parseFromString(t,"text/html"),i=r.head,n=r.body,d=function g(t){var e={},r=t.getElementsByTagName("style");if(r.length){var i=r[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(i)for(var n=0;n<i.length;n++){var l=i[n],a=l.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),s=l.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");a=a.replace(/^[\s]|[\s]$/gm,""),s=s.replace(/^[\s]|[\s]$/gm,""),a=a.replace(/\n|\r|\n\r/g,""),s=s.replace(/\n|\r|\n\r/g,"");for(var o=a.split(", "),d=0;d<o.length;d++)e[o[d]]=s}}return e}(i);m(n,function(t){if(t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("style")){var e=t.getAttribute("style");e=function r(t){return t.replace(/mso-(bidi|fareast|fareast-theme)-font-family/g,"font-family")}(e),t.setAttribute("style",e)}return!0}),m(n,function(t){if(t.nodeType===Node.TEXT_NODE&&/\n|\u00a0|\r/.test(t.data)){if(!/\S| /.test(t.data)&&!/[\u00a0]+/.test(t.data))return t.data===k.UNICODE_NBSP?(t.data="\u200b",!0):1===t.data.length&&10===t.data.charCodeAt(0)?(t.data=" ",!0):(w(t),!1);t.data=t.data.replace(/\n|\r/gi," ")}return!0}),m(n,function(t){return t.nodeType!==Node.ELEMENT_NODE||"V:IMAGEDATA"!==t.tagName&&"IMG"!==t.tagName||v(t,e),!0});for(var l=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),a=l.length-1;0<=a;a--)l[a].previousElementSibling&&"LI"===l[a].previousElementSibling.tagName&&l[a].previousElementSibling.appendChild(l[a]);m(n,function(t){if(t.nodeType===Node.TEXT_NODE)return t.data=t.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(t.nodeType===Node.ELEMENT_NODE){if(_(t)){var e=t.parentNode,r=t.previousSibling,i=function O(t,e,r,i){var n,l,a,s,o,d,f,u=navigator.userAgent.toLowerCase();-1!=u.indexOf("safari")&&(u=-1<u.indexOf("chrome")?1:"safari"),t.innerHTML.includes("mso-list:\nIgnore")&&(t.innerHTML=t.innerHTML.replace(/mso-list:\nIgnore/gi,"mso-list:Ignore"));var g,c,p,m,h=/[0-9a-zA-Z]./gi,v="",b=P(t),y=null===(n=I(t).find("ol"))||void 0===n||null===(n=n.attr("style"))||void 0===n||null===(n=n.split(";"))||void 0===n?void 0:n.find(function(t){return t.trim().startsWith("list-style-type")});y==undefined&&D(t)&&(y=null===(c=I(t).find("ul"))||void 0===c||null===(c=c.attr("style"))||void 0===c||null===(c=c.split(";"))||void 0===c?void 0:c.find(function(t){return t.trim().startsWith("list-style-type")}));if(b)d="ol",f=y?"list-style-type: "+y.replace("list-style-type:","").trim()+";":"";else if(D(t))d="ul",f=y?"list-style-type: "+y.replace("list-style-type:","").trim()+";":"";else{var N=t.querySelector('span[style="mso-list:Ignore"]');null==N&&"safari"==u&&(N=t.querySelector('span[lang="PT-BR"]'));var x=!1;N&&(x=x||h.test(N.textContent)),null!==N&&(g=N.textContent.trim().split(".")[0]),d=1==x?(g=(g=N.textContent.trim().split(".")[0]).replace(/\(([^)]+)\)/g,"$1"),isNaN(parseInt(g))?"i"==g?f="lower-roman;":"I"==g?f="upper-roman;":"o"==g?f="circle;":g.match(/^v$/)||(g.match(/^[a-z]$/)||g.match(/^[a-z]\)$/)?f="lower-alpha;":(g.match(/^[A-Z]$/)||g.match(/^[A-Z]\)$/))&&(f="upper-alpha;")):f="decimal;",f="list-style-type: "+f,"ol"):(null!=N&&(g=N.textContent.trim().split(".")[0]),"\xa7"==g?f="square;":"\xb7"==g&&(f="disc;"),f="list-style-type: "+f,"ul"),N==undefined||N.textContent==undefined||isNaN(parseInt(N.textContent.trim().split(".")[1],10))||(v=' class="decimal_type" ')}var A=1,C="",E=($(t),t.style.marginLeft),T="";E.includes("in")?(T="in",E=parseFloat(E)-.5):E.includes("pt")&&(T="px",E=parseFloat(E)-10),E&&(m=" margin-left: "+E+T+";"),A="list-style-type: upper-alpha;"==f?b?parseInt(I(t).find("ol").attr("start")):g.charCodeAt(0)-64:"list-style-type: lower-alpha;"==f?b?parseInt(I(t).find("ol").attr("start")):g.charCodeAt(0)-96:b?parseInt(I(t).find("ol").attr("start")):parseInt(g),C+=f||"",C+=m||"",p="<"+d,p+=v||"",p+="ol"!=d||1==A||isNaN(A)?"":' start = "'+A+'"',p+=C?' style = "'+C+'"':"",p+=">";for(var S=!1;t;){if(!_(t)){if(t.outerHTML&&0<t.outerHTML.indexOf("mso-bookmark")&&0==(t.textContent||"").length){t=t.nextElementSibling;continue}break}var L=$(t);if((r=r||L)<L)p+=(o=O(t,e,L,t.style.marginLeft)).el.outerHTML,t=o.currentNode;else{if(L<r)break;t.firstElementChild&&t.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.firstChild&&(h.lastIndex=0),a&&a.firstElementChild&&a.firstElementChild.firstElementChild&&a.firstElementChild.firstElementChild.firstChild&&(h.lastIndex=0,l=h.test(a.firstElementChild.firstElementChild.firstChild.data||a.firstElementChild.firstElementChild.firstChild.firstChild&&a.firstElementChild.firstElementChild.firstChild.firstChild.data||""));var w=!1;(!i&&!t.style.marginLeft||i&&t.style.marginLeft&&i===t.style.marginLeft)&&(w=!0),i=t.style.marginLeft,w||l===undefined?(s=F(t,e),t.nextSibling&&t.nextSibling.innerText!=undefined&&t.nextSibling.innerText!=undefined&&!p.includes('class="decimal_type"')&&(isNaN(parseInt(t.nextSibling.innerText.trim().split(".")[1],10))||(p=p.substring(3,0)+' class="decimal_type"'+p.substring(3,p.length))),p+=s):(1==L&&(p+="</"+d+">",S=!0,a=null),p+=(o=O(t,e,L,t.style.marginLeft)).el.outerHTML,t=o.currentNode);var M=t&&t.nextElementSibling;if(M&&(a=M.previousElementSibling),t&&!_(t)){if(t.outerHTML&&0<t.outerHTML.indexOf("mso-bookmark")&&0==(t.textContent||"").length){t=t.nextElementSibling;continue}break}t&&t.parentNode&&t.parentNode.removeChild(t),t=M}}S||(p+="</"+d+">");var H=document.createElement("div");return H.innerHTML=p,{el:H,currentNode:t}}(t,d).el,n=null;return(n=r?r.nextSibling:e.firstChild)?e.insertBefore(i,n):e.appendChild(i),!1}return"FONT"===t.tagName&&(o&&"LibreOffice"===o[0]||d["."+t.getAttribute("class")])?t=y(t,"span"):o&&"\x3c!--StartFragment--\x3e"===o[0]&&"UL"===t.tagName&&(I(t).find("li span").each(function(){"&nbsp;"===I(this).html()&&(0<I(this).prev().text().trim().length?I(this).remove():I(this).html("&ZeroWidthSpace;"))}),I(t).is("ul")&&t.setAttribute("style",h(t,["margin","margin-left","list-style-type"])),I(t).find("ul").each(function(){this.setAttribute("style",h(this,["margin","margin-left","list-style-type"]))})),"img"!==t.tagName.toLowerCase()&&function s(e){Array.from(e.attributes).map(function(t){return t.name}).filter(function(t){return t.toLowerCase().startsWith("data-")||t.toLowerCase().startsWith("xml:")}).forEach(function(t){I(e).removeAttr(t)})}(t),b(t,d)}if(t.nodeType!==Node.COMMENT_NODE)return!0;if(-1<t.data.indexOf("[if !supportLineBreakNewLine]"))for(var l=t.nextSibling;l;)(l=t.nextSibling)&&w(l),l.data&&-1<l.data.indexOf("[endif]")&&(l=null);if(-1<t.data.indexOf("[if supportFields]")&&-1<t.data.indexOf("FORMCHECKBOX")){var a=document.createElement("input");a.type="checkbox",t.parentNode.insertBefore(a,t.nextSibling)}return w(t),!1}),n.innerHTML=function c(t){var e=I(document.createElement("div")).attr("id","top-level");e.html(t);for(var r=e[0].querySelectorAll("ol, ul"),i=0;i<r.length;i++)if(I(r[i]).parentsUntil("#top-level","ol, ul").length){r[i].style.removeProperty("margin-left");for(var n=r[i].children,l=0;l<n.length;l++)"LI"==n[l].tagName&&n[l].style.removeProperty("margin-left")}return e[0].innerHTML}(n.innerHTML),m(n,function(t){if(t.nodeType===Node.ELEMENT_NODE){var e=t.tagName;if(!t.innerHTML&&-1===["BR","IMG","INPUT"].indexOf(e)){for(var r=t.parentNode;r&&(w(t),!(t=r).innerHTML)&&"TD"!==t.parentNode.tagName;)r=t.parentNode;return!1}!function u(t){var e=t.getAttribute("style");if(e){(e=H(e))&&";"!==e.slice(-1)&&(e+=";");var r=e.match(/(^|\S+?):.+?;{1,1}/gi);if(r){for(var i={},n=0;n<r.length;n++){var l=r[n].split(":");2===l.length&&("text-align"===l[0]&&"SPAN"===t.tagName||(i[l[0]]=l[1]))}var a="";for(var s in i)if(i.hasOwnProperty(s)){if("font-size"===s&&"pt;"===i[s].slice(-3)){var o=null;try{o=parseFloat(i[s].slice(0,-3),10)}catch(f){o=null}if(o){var d=E.opts.fontSizeUnit;"px"===d?(o=Math.round(1.33*o),i[s]=o+"px;"):"pt"===d&&(o=Math.round(o),i[s]=o+"pt;")}}a+=s+":"+i[s]}a&&t.setAttribute("style",a)}}}(t)}return!0}),m(n,function(t){if(t&&"A"===t.nodeName&&""===t.href){for(var e=document.createDocumentFragment();t.firstChild;)e.appendChild(t.firstChild);t.parentNode.replaceChild(e,t)}return!0}),m(n,function(t){return t&&"P"===t.tagName&&"DIV"===t.parentNode.tagName&&1==t.parentNode.children.length&&I(t).unwrap(),!0});var s=n.outerHTML,f=E.opts.htmlAllowedStyleProps;return E.opts.htmlAllowedStyleProps=E.opts.wordAllowedStyleProps,s=E.clean.html(s,E.opts.wordDeniedTags,E.opts.wordDeniedAttrs,!1),E.opts.htmlAllowedStyleProps=f,s}return{_init:function t(){E.events.on("paste.wordPaste",function(t){return n=t,E.opts.wordPasteModal?function l(){if(!a){var t='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+E.language.translate("Word Paste Detected")+"</h4>",e=function n(){var t='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">';return t+='<p style="text-align: left;">'+E.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",t+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+E.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+E.language.translate("Keep")+"</button></div>",t+="</div>"}(),r=E.modals.create(s,t,e),i=r.$body;a=r.$modal,r.$modal.addClass("fr-middle"),E.events.$on(i,"click","button.fr-remove-word",function(){var t=a.data("instance")||E;t.wordPaste.clean()},!0),E.events.$on(i,"click","button.fr-keep-word",function(){var t=a.data("instance")||E;t.wordPaste.clean(!0)},!0),E.events.$on(I(E.o_win),"resize",function(){E.modals.resize(s)})}E.modals.show(s),E.modals.resize(s)}():e(E.opts.wordPasteKeepFormatting),!1})},clean:e,_wordClean:l}}});