/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.6.2 (2020-12-08) */ !function(){"use strict";var e,t,n,r,d=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},a=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e){return function(){return e}},i=o(!1),s=o(!0),u=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:i,isSome:i,isNone:s,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:n,orThunk:t,map:u,each:function(){},bind:u,exists:i,forall:s,filter:u,equals:e,equals_:e,toArray:function(){return[]},toString:o("none()")}),c=function(n){var e=o(n),t=function(){return a},r=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:i,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return c(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(i,function(e){return t(n,e)})}};return a},f={some:c,none:u,from:function(e){return null===e||e===undefined?l:c(e)}},P=function(e){return!(null===(t=e)||t===undefined);var t},m=(r="function",function(e){return typeof e===r}),p=Array.prototype.slice,g=function(e,t){for(var n=0,r=e.length;n=t.length&&e.substr(n,n+t.length)===t},w=tinymce.util.Tools.resolve("tinymce.Env"),_=tinymce.util.Tools.resolve("tinymce.util.Delay"),T=tinymce.util.Tools.resolve("tinymce.util.Promise"),C=tinymce.util.Tools.resolve("tinymce.util.VK"),D=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},k=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){return e.getParam("paste_data_images",!1)},O=function(e){return e.getParam("paste_retain_style_properties")},j=function(e){return e.getParam("validate")},R=function(e){return e.getParam("paste_data_images",!1,"boolean")},A=function(e){return k.explode(e.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},I="x-tinymce/html",F="\x3c!-- "+I+" --\x3e",E=function(e){return-1!==e.indexOf(F)},M=tinymce.util.Tools.resolve("tinymce.html.Entities"),N=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+M.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),o="",i=k.map(r,function(e){return e.split(/\n/).join("
")});return 1===i.length?i[0]:k.map(i,function(e){return a+e+o}).join("")},B=tinymce.util.Tools.resolve("tinymce.html.DomParser"),H=tinymce.util.Tools.resolve("tinymce.html.Serializer"),L="\xa0",$=tinymce.util.Tools.resolve("tinymce.html.Node"),z=tinymce.util.Tools.resolve("tinymce.html.Schema");function U(t,e){return k.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function q(e){var t=z(),n=B({},t),r="",a=t.getShortEndedElements(),o=k.makeMap("script noscript style textarea video audio iframe object"," "),i=t.getBlockElements();return e=U(e,[//g]),function s(e){var t=e.name,n=e;if("br"!==t){if("wbr"!==t)if(a[t]&&(r+=" "),o[t])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))for(;s(e),e=e.next;);i[t]&&n.next&&(r+="\n","p"===t&&(r+="\n"))}}else r+="\n"}(n.parse(e)),r}function V(e){return e=U(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?L:" "}],/
/g,/
$/i])}function K(e){return//gi,/]+id="?docs-internal-[^>]*>/gi,//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,L],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return 0')}),!0);var r,a,o},oe=function(e,t,n){var r,a;n||!1===e.getParam("smart_paste",!0)?ee(e,t):(r=e,a=t,k.each([re,ae,ee],function(e){return!0!==e(r,a,ee)}))},ie=function(e){return"\n"===e||"\r"===e},se=function(e,t){var n,r,a,o,i=(n=" ",(r=e.getParam("paste_tab_spaces",4,"number"))<=0?"":new Array(r+1).join(n)),s=t.replace(/\t/g,i);return(o={pcIsSpace:!(a=function(e,t){return-1!==" \f\t\x0B".indexOf(t)||t===L?e.pcIsSpace||""===e.str||e.str.length===s.length-1||(n=s,(r=e.str.length+1)"));ue(e,s,!1,!0)},fe=function(e){var t,n={};if(e&&(!e.getData||(t=e.getData("Text"))&&0',!1)):le(e,'',!1)},ve=function(e){return T.all(v(e,function(r){return new T(function(e){var t=P(r.getAsFile)?r.getAsFile():r,n=new window.FileReader;n.onload=function(){e({blob:t,uri:n.result})},n.readAsDataURL(t)})}))},he=function(e){var t=A(e);return function(r){return e=r.type,x(e,"image/",0)&&g(t,function(e){return t=e,n={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(k.hasOwn(n,t)?"image/"+n[t]:"image/"+t)===r.type;var t,n});var e}},ye=function(t,e,n){var r,a,o,i,s="paste"===e.type?e.clipboardData:e.dataTransfer;if(R(t)&&s){var u=(r=t,o=(a=s).items?v(y(a.items),function(e){return e.getAsFile()}):[],i=a.files?y(a.files):[],function(e,t){for(var n=[],r=0,a=e.length;r)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(o),s=ne(e,o);o.length&&(!i||s)||(r=!0),(r||s)&&(o=de(t,"text/plain")&&i?t["text/plain"]:q(o)),u.isDefaultContent(o)?n||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):r?ce(e,o):le(e,o,a)}s.on("keyup",d.clear),s.on("keydown",function(e){var t,n=function(e){be(e)&&!e.isDefaultPrevented()&&u.remove()};if(be(e)&&!e.isDefaultPrevented()){if((c=e.shiftKey&&86===e.keyCode)&&w.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),f.set(e),d.set(!0),w.ie&&c)return e.preventDefault(),t=!0,void s.fire("paste",{ieFake:t});u.remove(),u.create(),s.once("keyup",n),s.once("paste",function(){s.off("keyup",n)})}});s.on("paste",function(e){var t=f.isSet()||d.isSet();t&&f.clear();var n,r,a=(n=s,fe(e.clipboardData||n.getDoc().dataTransfer)),o="text"===l.get()||c,i=de(a,I);c=!1,!(e.isDefaultPrevented()||(r=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length))&&(me(a)||!ye(s,e,u.getLastRng()||s.selection.getRng()))?(t||e.preventDefault(),!w.ie||t&&!e.ieFake||de(a,"text/html")||(u.create(),s.dom.bind(u.getEl(),"paste",function(e){e.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),a["text/html"]=u.getHtml()),de(a,"text/html")?(e.preventDefault(),i=i||E(a["text/html"]),m(s,a,t,o,i)):_.setEditorTimeout(s,function(){m(s,a,t,o,i)},0)):u.remove()})},Pe=function(i,e,t){var s;xe(i,e,t),i.parser.addNodeFilter("img",function(e,t,n){var r,a=function(e){e.attr("data-mce-object")||s===w.transparentSrc||e.remove()};if(!R(i)&&((r=n).data&&!0===r.data.paste))for(var o=e.length;o--;)(s=e[o].attr("src"))&&(0!==s.indexOf("webkit-fake-url")&&(i.getParam("allow_html_data_urls",!1,"boolean")||0!==s.indexOf("data:"))||a(e[o]))})},we=function(e){return w.ie&&e.inline?document.body:e.getBody()},_e=function(t,e,n){var r;we(r=t)!==r.getBody()&&t.dom.bind(e,"paste keyup",function(e){De(t,n)||t.fire("paste")})},Te=function(e){return e.dom.get("mcepastebin")},Ce=function(e,t){return t===e},De=function(e,t){var n,r=Te(e);return(n=r)&&"mcepastebin"===n.id&&Ce(t,r.innerHTML)},ke=function(e){var t=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(e,t,n){var r=e.dom,a=e.getBody();t.set(e.selection.getRng());var o=e.dom.add(we(e),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(w.ie||w.gecko)&&r.setStyle(o,"left","rtl"===r.getStyle(a,"direction",!0)?65535:-65535),r.bind(o,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),_e(e,o,n),o.focus(),e.selection.select(o,!0)}(e,t,n)},remove:function(){return function(e,t){if(Te(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(e,t)},getEl:function(){return Te(e)},getHtml:function(){return function(n){var t=function(e,t){e.appendChild(t),n.dom.remove(t,!0)},e=k.grep(we(n).childNodes,function(e){return"mcepastebin"===e.id}),r=e.shift();k.each(e,function(e){t(r,e)});for(var a=n.dom.select("div[id=mcepastebin]",r),o=a.length-1;0<=o;o--){var i=n.dom.create("div");r.insertBefore(i,a[o]),t(i,a[o])}return r?r.innerHTML:""}(e)},getLastRng:function(){return t.get()},isDefault:function(){return De(e,n)},isDefaultContent:function(e){return e===n}}},Se=function(n,r){n.addCommand("mceTogglePlainTextPaste",function(){var e,t;e=n,"text"===(t=r).pasteFormat.get()?(t.pasteFormat.set("html"),D(e,!1)):(t.pasteFormat.set("text"),D(e,!0)),e.focus()}),n.addCommand("mceInsertClipboardContent",function(e,t){t.content&&r.pasteHtml(t.content,t.internal),t.text&&r.pasteText(t.text)})},Oe=function(e,t,n){if(r=e,!1!==w.iOS||"function"!=typeof(null==r?void 0:r.setData))return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(I,t),!0}catch(a){return!1}var r},je=function(e,t,n,r){Oe(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},Re=function(s){return function(e,t){var n=F+e,r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var o=s.selection.getRng();a.focus();var i=s.dom.createRng();i.selectNodeContents(a),s.selection.setRng(i),_.setTimeout(function(){s.selection.setRng(o),r.parentNode.removeChild(r),t()},0)}},Ae=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},Ie=function(e){return!e.selection.isCollapsed()||!!(t=e).dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody());var t},Fe=function(e){var t,n;e.on("cut",(t=e,function(e){Ie(t)&&je(e,Ae(t),Re(t),function(){var e;w.browser.isChrome()||w.browser.isFirefox()?(e=t.selection.getRng(),_.setEditorTimeout(t,function(){t.selection.setRng(e),t.execCommand("Delete")},0)):t.execCommand("Delete")})})),e.on("copy",(n=e,function(e){Ie(n)&&je(e,Ae(n),Re(n),function(){})}))},Ee=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Me=function(e,t){return Ee.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},Ne=function(e,t){e.focus(),e.selection.setRng(t)},Be=function(i,s,u){i.getParam("paste_block_drop",!1)&&i.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),S(i)||i.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0 [\\s\\r\\n]+|
)*(<\\/?("+n.join("|")+")[^>]*>)(?:
 [\\s\\r\\n]+|
)*","g"),"$1"]]),t=U(t,[[/

/g,"

"],[/
/g," "],[/

/g,"
"]])}function $e(e,t,n,r){if(r||n)return t;var l,c,f,a=e.getParam("paste_webkit_styles");return!1===e.getParam("paste_remove_styles_if_webkit",!0)||"all"===a?t:(a&&(l=a.split(/[, ]/)),t=(t=l?(c=e.dom,f=e.selection.getNode(),t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=c.parseStyle(c.decode(n)),o={};if("none"===l)return t+r;for(var i=0;i]+) style="([^"]*)"([^>]*>)/gi,"$1$3")).replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r}))}function ze(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var Ue=function(n,r){return function(t){t.setActive("text"===r.pasteFormat.get());var e=function(e){return t.setActive(e.state)};return n.on("PastePlainTextToggle",e),function(){return n.off("PastePlainTextToggle",e)}}};a.add("paste",function(e){if(!1==(!!e.hasPlugin("powerpaste",!0)&&("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0))){var t=d(!1),n=d(e.getParam("paste_as_text",!1)?"text":"html"),r=(c=n,f=ke(l=e),l.on("PreInit",function(){return Pe(l,f,c)}),{pasteFormat:c,pasteHtml:function(e,t){return le(l,e,t)},pasteText:function(e){return ce(l,e)},pasteImageData:function(e,t){return ye(l,e,t)},getDataTransferItems:fe,hasHtmlOrText:me,hasContentType:de});i=e,w.webkit&&He(i,$e),w.ie&&(He(i,Le),u=ze,(s=i).on("PastePostProcess",function(e){u(s,e.node)}));return o=r,(a=e).ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return a.execCommand("mceTogglePlainTextPaste")},onSetup:Ue(a,o)}),a.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return a.execCommand("mceTogglePlainTextPaste")},onSetup:Ue(a,o)}),Se(e,r),function(e){var t=e.plugins.paste,n=e.getParam("paste_preprocess");n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=e.getParam("paste_postprocess");r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})}(e),Fe(e),Be(e,r,t),{clipboard:r,quirks:void 0}}var a,o,i,s,u,l,c,f})}();