/** * 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.9.2 (2021-09-08) */ !function(){"use strict";function P(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function w(e){return!(null==e)}function _(){}function o(e){return function(){return e}}function e(e){return e}function t(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=o(!(n="function")),s=o(!0),l={fold:function(e,t){return e()},isSome:i,isNone:s,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:e,orThunk:a,map:t,each:_,bind:t,exists:i,forall:s,filter:function(){return l},toArray:function(){return[]},toString:o("none()")};function a(e){return e()}function u(e,t){for(var n=0,r=e.length;n=t.length&&e.substr(n,n+t.length)===t}function C(e,t){return e.fire("PastePlainTextToggle",{state:t})}function T(e){return e.getParam("paste_data_images",!1)}function p(e){return e.getParam("paste_retain_style_properties")}function h(e){return e.getParam("validate")}function g(e){return e.getParam("paste_data_images",!1,"boolean")}function v(e){return ge.explode(e.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))}function y(e){return-1!==e.indexOf(he)}function b(e,t,n){return t?(r=!0===t?"p":t,a=n,o=e.split(/\n\n/),i=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(var o in t)n=o,be.call(t,n)&&r.push(o+'="'+xe.encodeAllRaw(t[o])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(r,a),s="",1===(l=ge.map(o,function(e){return e.split(/\n/).join("
")})).length?l[0]:ge.map(l,function(e){return i+e+s}).join("")):e.replace(/\r?\n/g,"
");var r,a,o,i,s,l}function x(t,e){return ge.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function D(e){return x(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/
/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,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return 0')}),0));var r,a,o,i,s}function E(e){return"\n"===e||"\r"===e}function M(e,t,n,r){var a,o,i,s,l=j(e,t,n);!1===l.cancelled&&(a=e,o=l.content,r||!1===a.getParam("smart_paste",!0)?R(a,o):(i=a,s=o,ge.each([I,F,R],function(e){return!0!==e(i,s,R)})))}function B(e,t,n){var r=n||y(t);M(e,t.replace(he,""),r,!1)}function L(e,t){var n,r,a,o,i,s,l=e.dom.encode(t).replace(/\r\n/g,"\n"),u=b((n=l,o=(r=e.getParam("paste_tab_spaces",4,"number"))<=0?"":new Array(r+1).join(" "),i=n.replace(/\t/g,o),s={pcIsSpace:!(a=function(e,t){return-1!==" \f\t\v".indexOf(t)||"\xa0"===t?e.pcIsSpace||""===e.str||e.str.length===i.length-1||(n=e.str.length+1)',!1)):B(t,'',!1)})}),!0}return!1}function U(e){return pe.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode}function V(o,e,t){var i,s,v,l,u,c,f;function d(e,t,n,r,a){var o;H(t,"text/html")?o=t["text/html"]:(o=v.getHtml(),a=a||y(o),v.isDefaultContent(o)&&(r=!0)),o=D(o),v.remove();var i,s,l,u,c,f,d,m,p=!1===a&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(o),g=A(o);((r=!o.length||p&&!g||r)||g)&&(o=H(t,"text/plain")&&p?t["text/plain"]:(i=o,s=Ce(),l=Pe({},s),u="",c=s.getShortEndedElements(),f=ge.makeMap("script noscript style textarea video audio iframe object"," "),d=s.getBlockElements(),m=function(e){var t=e.name,n=e;if("br"!==t){if("wbr"!==t)if(c[t]&&(u+=" "),f[t])u+=" ";else{if(3===e.type&&(u+=e.value),!e.shortEnded&&(e=e.firstChild))for(;m(e),e=e.next;);d[t]&&n.next&&(u+="\n","p"===t&&(u+="\n"))}}else u+="\n"},i=x(i,[//g]),m(l.parse(i)),u)),v.isDefaultContent(o)?n||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):r?L(e,o):B(e,o,a)}s=o,v=e,l=t,c=m(),f=m(),s.on("keyup",f.clear),s.on("keydown",function(e){function t(e){U(e)&&!e.isDefaultPrevented()&&v.remove()}if(U(e)&&!e.isDefaultPrevented()&&(!(u=e.shiftKey&&86===e.keyCode)||!fe.webkit||-1===navigator.userAgent.indexOf("Version/"))){if(e.stopImmediatePropagation(),c.set(e),f.set(!0),fe.ie&&u)return e.preventDefault(),void s.fire("paste",{ieFake:!0});v.remove(),v.create(),s.once("keyup",t),s.once("paste",function(){s.off("keyup",t)})}}),s.on("paste",function(e){var t=c.isSet()||f.isSet();t&&c.clear();var n,r=N(e.clipboardData||s.getDoc().dataTransfer),a="text"===l.get()||u,o=H(r,ye());u=!1,e.isDefaultPrevented()||(n=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&n&&n.items&&0===n.items.length)||!$(r)&&z(s,e,v.getLastRng()||s.selection.getRng())?v.remove():(t||e.preventDefault(),!fe.ie||t&&!e.ieFake||H(r,"text/html")||(v.create(),s.dom.bind(v.getEl(),"paste",function(e){e.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),r["text/html"]=v.getHtml()),H(r,"text/html")?(e.preventDefault(),o=o||y(r["text/html"]),d(s,r,t,a,o)):de.setEditorTimeout(s,function(){d(s,r,t,a,o)},0))}),o.parser.addNodeFilter("img",function(e,t,n){var r;if(!g(o)&&n.data&&!0===n.data.paste)for(var a=e.length;a--;)(i=e[a].attr("src"))&&(0!==i.indexOf("webkit-fake-url")&&(o.getParam("allow_html_data_urls",!1,"boolean")||0!==i.indexOf("data:"))||((r=e[a]).attr("data-mce-object")||i===fe.transparentSrc||r.remove()))})}function K(e){return fe.ie&&e.inline?document.body:e.getBody()}function X(e){var t=P(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,i,s,l,u=e.dom.add(K(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);(fe.ie||fe.gecko)&&r.setStyle(u,"left","rtl"===r.getStyle(a,"direction",!0)?65535:-65535),r.bind(u,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),i=u,s=n,K(l=o=e)!==l.getBody()&&o.dom.bind(i,"paste keyup",function(e){De(o,s)||o.fire("paste")}),u.focus(),e.selection.select(u,!0)}(e,t,n)},remove:function(){return function(e,t){if(ae(e)){for(var n,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 ae(e)},getHtml:function(){return function(n){function t(e,t){e.appendChild(t),n.dom.remove(t,!0)}var e=ge.grep(K(n).childNodes,function(e){return"mcepastebin"===e.id}),r=e.shift();ge.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:t.get,isDefault:function(){return De(e,n)},isDefaultContent:function(e){return e===n}}}function W(e,t,n,r){!function(e,t,n){if(!1===fe.iOS&&"function"==typeof(null==e?void 0:e.setData))try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(ye(),t),1}catch(e){return}}(e.clipboardData,t.html,t.text)?n(t.html,r):(e.preventDefault(),r())}function Y(s){return function(e,t){var n=he+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),de.setTimeout(function(){s.selection.setRng(o),r.parentNode.removeChild(r),t()},0)}}function Z(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}}function q(e){return!e.selection.isCollapsed()||(t=e).dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody());var t}function G(e,t){return ke.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())}function J(e,t){e.focus(),e.selection.setRng(t)}function Q(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function ee(e,t){if(!k(t))return t;var n=[];return ge.each(e.schema.getBlockElements(),function(e,t){n.push(t)}),t=x(t,[[new RegExp("(?:
 [\\s\\r\\n]+|
)*(<\\/?("+n.join("|")+")[^>]*>)(?:
 [\\s\\r\\n]+|
)*","g"),"$1"]]),x(t,[[/

/g,"

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

/g,"
"]])}function te(e,t,n,r){if(r||n)return t;var c,f,d,a=e.getParam("paste_webkit_styles");return!1===e.getParam("paste_remove_styles_if_webkit",!0)||"all"===a?t:(t=(c=a?a.split(/[, ]/):c)?(f=e.dom,d=e.selection.getNode(),t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=f.parseStyle(f.decode(n)),o={};if("none"===c)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 ne(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}function re(n,r){return function(t){function e(e){return t.setActive(e.state)}return t.setActive("text"===r.pasteFormat.get()),n.on("PastePlainTextToggle",e),function(){return n.off("PastePlainTextToggle",e)}}}function ae(e){return e.dom.get("mcepastebin")}var oe,ie=function(n){function e(){return a}function t(e){return e(n)}var r=o(n),a={fold:function(e,t){return t(n)},isSome:s,isNone:i,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return ie(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?a:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},se={some:ie,none:t,from:function(e){return null==e?l:ie(e)}},le=Array.prototype.slice,ue=typeof Array.from===n?Array.from:function(e){return le.call(e)},ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n