!function(){"use strict";function e(e,t){return P.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function t(e){var t,n;return n=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),P.each(n,function(n){if(n.test(e))return t=!0,!1}),t}function n(e){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(e)}function r(e,t,n,r){var i,o={},a=e.dom.parseStyle(r);return P.each(a,function(a,s){switch(s){case"mso-list":(i=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(i[1],10)),/Ignore/i.test(a)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":s="text-align";break;case"vert-align":s="vertical-align";break;case"font-color":case"mso-foreground":s="color";break;case"mso-background":case"mso-highlight":s="background";break;case"font-weight":case"font-style":return void("normal"!==a&&(o[s]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void n.remove()}0!==s.indexOf("mso-comment")?0!==s.indexOf("mso-")&&("all"===m.getRetainStyleProps(e)||t&&t[s])&&(o[s]=a):n.remove()}),/(bold)/i.test(o["font-weight"])&&(delete o["font-weight"],n.wrap(new k("b",1))),/(italic)/i.test(o["font-style"])&&(delete o["font-style"],n.wrap(new k("i",1))),(o=e.dom.serializeStyle(o,n.name))||null}function i(e,t){e.on("PastePreProcess",function(n){n.content=t(e,n.content,n.internal,n.wordContent)})}function o(e,t){if(!F.isWordContent(t))return t;var n=[];P.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:
[\\s\\r\\n]+|
)*(<\\/?("+n.join("|")+")[^>]*>)(?:
[\\s\\r\\n]+|
)*","g");return t=M.filter(t,[[r,"$1"]]),t=M.filter(t,[[/
/g,"
"],[/
/g," "],[/
/g,"
"]])}function a(e,t,n,r){if(r||n)return t;var i=m.getWebkitStyles(e);if(!1===m.shouldRemoveWebKitStyles(e)||"all"===i)return t;if(i&&(i=i.split(/[, ]/)),i){var o=e.dom,a=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var s=o.parseStyle(o.decode(n),"span"),l={};if("none"===i)return t+r;for(var u=0;u]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function s(e,t){e.$("a",t).find("font,u").each(function(t,n){e.dom.remove(n,!0)})}var l=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return l(n())}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!u.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},f=function(e,t){return{clipboard:e,quirks:t}},d={firePastePreProcess:function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},firePastePostProcess:function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},firePastePlainTextToggle:function(e,t){return e.fire("PastePlainTextToggle",{state:t})},firePaste:function(e,t){return e.fire("paste",{ieFake:t})}},m={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("paste_retain_style_properties")},getWordValidElements:function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},p=function(e,t,n){"text"===t.pasteFormat?(t.pasteFormat="html",d.firePastePlainTextToggle(e,!1)):(t.pasteFormat="text",d.firePastePlainTextToggle(e,!0),function(e,t){return!1===t.get()&&m.shouldPlainTextInform(e)}(e,n)&&(function(e,t){e.notificationManager.open({text:e.translate(t),type:"info"})}(e,"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),n.set(!0))),e.focus()},g=function(e,t,n){e.addCommand("mceTogglePlainTextPaste",function(){p(e,t,n)}),e.addCommand("mceInsertClipboardContent",function(e,n){n.content&&t.pasteHtml(n.content,n.internal),n.text&&t.pasteText(n.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),P=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=tinymce.util.Tools.resolve("tinymce.util.VK"),x="\x3c!-- x-tinymce/html --\x3e",b={mark:function(e){return x+e},unmark:function(e){return e.replace(x,"")},isMarked:function(e){return-1!==e.indexOf(x)},internalHtmlMime:function(){return"x-tinymce/html"}},w=tinymce.util.Tools.resolve("tinymce.html.Entities"),T=function(e){return e.replace(/\r?\n/g,"
")},C=function(e,t,n){var r=e.split(/\n\n/),i=function(e,t){var n,r=[],i="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+w.encodeAllRaw(t[n])+'"');r.length&&(i+=" "+r.join(" "))}return i+">"}(t,n),o=""+t+">",a=P.map(r,function(e){return e.split(/\n/).join("
")});return 1===a.length?a[0]:P.map(a,function(e){return i+e+o}).join("")},_={isPlainText:function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},convert:function(e,t,n){return t?C(e,t,n):T(e)},toBRs:T,toBlockElements:C},D=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),R=tinymce.util.Tools.resolve("tinymce.html.Schema"),E=tinymce.util.Tools.resolve("tinymce.html.Serializer"),M={filter:e,innerText:function(t){function n(e){var t=e.name,r=e;if("br"!==t)if(a[t]&&(o+=" "),s[t])o+=" ";else{if(3===e.type&&(o+=e.value),!e.shortEnded&&(e=e.firstChild))do{n(e)}while(e=e.next);l[t]&&r.next&&(o+="\n","p"===t&&(o+="\n"))}else o+="\n"}var r=R(),i=D({},r),o="",a=r.getShortEndedElements(),s=P.makeMap("script noscript style textarea video audio iframe object"," "),l=r.getBlockElements();return t=e(t,[//g]),n(i.parse(t)),o},trimHtml:function(t){return t=e(t,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/
/g,/
$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}},S=function(e,i){var o,a;(o=m.getRetainStyleProps(e))&&(a=P.makeMap(o.split(/[, ]/))),i=M.filter(i,[/
/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 t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var s=m.getWordValidElements(e),l=R({valid_elements:s,valid_children:"-li[p]"});P.each(l.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var u=D({},l);u.addAttributeFilter("style",function(t){for(var n,i=t.length;i--;)(n=t[i]).attr("style",r(e,a,n,n.attr("style"))),"span"===n.name&&n.parent&&!n.attributes.length&&n.unwrap()}),u.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),u.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),u.addNodeFilter("a",function(e){for(var t,n,r,i=e.length;i--;)if(t=e[i],n=t.attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var c=u.parse(i);return m.shouldConvertWordFakeLists(e)&&function(e){function r(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)do{t+=r(e)}while(e=e.next);return t}function i(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!i(e,t))return!1}while(e=e.next);return!0}function o(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)do{o(e)}while(e=e.next)}function a(e,t,n){var r=e._listLevel||u;r!==u&&(r1&&s.attr("start",""+n),e.wrap(s)),e.name="li",r>u&&l&&l.lastChild.append(s),u=r,o(e),i(e,/^\u00a0+/),i(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(e,/^\u00a0+/)}for(var s,l,u=1,c=[],f=e.firstChild;void 0!==f&&null!==f;)if(c.push(f),null!==(f=f.walk()))for(;void 0!==f&&f.parent!==e;)f=f.walk();for(var d=0;d')}),!0}(e,t,n)},$=function(e,t){return e.insertContent(t,{merge:m.shouldMergeFormats(e),paste:!0}),!0},W={isImageUrl:H,isAbsoluteUrl:O,insertContent:function(e,t){!1===m.isSmartPasteEnabled(e)?$(e,t):function(e,t){P.each([N,L,$],function(n){return!0!==n(e,t,$)})}(e,t)}},j=function(e){function t(t,n){var r=n||b.isMarked(t),i=B.process(e,b.unmark(t),r);!1===i.cancelled&&W.insertContent(e,i.content)}function n(n){n=e.dom.encode(n).replace(/\r\n/g,"\n"),t(n=_.convert(n,e.settings.forced_root_block,e.settings.forced_root_block_attrs),!1)}function r(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&n.length>0&&-1===n.indexOf(x)&&(t["text/plain"]=n)}if(e.types)for(var r=0;r',!1)}else t('
',!1)}function a(t,n){function r(e){var r,i,a,s=!1;if(e)for(r=0;r0}function l(e){return y.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode}function u(){function o(r,i,o,a){var l,u;s(r,"text/html")?l=r["text/html"]:(l=g.getHtml(),a=a||b.isMarked(l),g.isDefaultContent(l)&&(o=!0)),l=M.trimHtml(l),g.remove(),u=!1===a&&_.isPlainText(l),l.length&&!u||(o=!0),o&&(l=s(r,"text/plain")&&u?r["text/plain"]:M.innerText(l)),g.isDefaultContent(l)?i||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?n(l):t(l,a)}e.on("keydown",function(t){function n(e){l(e)&&!e.isDefaultPrevented()&&g.remove()}if(l(t)&&!t.isDefaultPrevented()){if((c=t.shiftKey&&86===t.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),p=(new Date).getTime(),v.ie&&c)return t.preventDefault(),void d.firePaste(e,!0);g.remove(),g.create(),e.once("keyup",n),e.once("paste",function(){e.off("keyup",n)})}});e.on("paste",function(t){var n=(new Date).getTime(),l=function(t){var n=r(t.clipboardData||e.getDoc().dataTransfer);return M.isMsEdge()?P.extend(n,{"text/html":""}):n}(t),u=(new Date).getTime()-n,d=(new Date).getTime()-p-u<1e3,m="text"===f.pasteFormat||c,y=s(l,b.internalHtmlMime());c=!1,t.isDefaultPrevented()||function(e){var t=e.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&t&&t.items&&0===t.items.length}(t)?g.remove():i(l)||!a(t,g.getLastRng()||e.selection.getRng())?(d||t.preventDefault(),!v.ie||d&&!t.ieFake||s(l,"text/html")||(g.create(),e.dom.bind(g.getEl(),"paste",function(e){e.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),l["text/html"]=g.getHtml()),s(l,"text/html")?(t.preventDefault(),y||(y=b.isMarked(l["text/html"])),o(l,d,m,y)):h.setEditorTimeout(e,function(){o(l,d,m,y)},0)):g.remove()})}var c,f=this,p=0,g=function(e){var t,n=function(){return e.dom.get("mcepastebin")},r=function(e){return"%MCEPASTEBIN%"===e};return{create:function(){var n,r,i=e.dom,o=e.getBody(),a=e.dom.getViewPort(e.getWin()).y,s=20;if(t=e.selection.getRng(),e.inline&&(r=e.selection.getScrollContainer())&&r.scrollTop>0&&(a=r.scrollTop),t.getClientRects){var l=function(e){var n,r,o,a=e.startContainer;if((n=e.getClientRects()).length)return n[0];if(e.collapsed&&1===a.nodeType){for(o=a.childNodes[t.startOffset];o&&3===o.nodeType&&!o.data.length;)o=o.nextSibling;if(o)return"BR"===o.tagName&&(r=i.doc.createTextNode("\ufeff"),o.parentNode.insertBefore(r,o),(e=i.createRng()).setStartBefore(r),e.setEndAfter(r),n=e.getClientRects(),i.remove(r)),n.length?n[0]:void 0}}(t);if(l)s=a+(l.top-i.getPos(o).y);else{s=a;var u=t.startContainer;u&&(3===u.nodeType&&u.parentNode!==o&&(u=u.parentNode),1===u.nodeType&&(s=i.getPos(u,r||o).y))}}n=e.dom.add(e.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+s+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"},"%MCEPASTEBIN%"),(v.ie||v.gecko)&&i.setStyle(n,"left","rtl"===i.getStyle(o,"direction",!0)?65535:-65535),i.bind(n,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),n.focus(),e.selection.select(n,!0)},remove:function(){if(n()){for(var r=void 0;r=e.dom.get("mcepastebin");)e.dom.remove(r),e.dom.unbind(r);t&&e.selection.setRng(t)}t=null},getEl:n,getHtml:function(){var t,n,r,i,o,a=function(t,n){t.appendChild(n),e.dom.remove(n,!0)};for(n=P.grep(e.getBody().childNodes,function(e){return"mcepastebin"===e.id}),t=n.shift(),P.each(n,function(e){a(t,e)}),r=(i=e.dom.select("div[id=mcepastebin]",t)).length-1;r>=0;r--)o=e.dom.create("div"),t.insertBefore(o,i[r]),a(o,i[r]);return t?t.innerHTML:""},getLastRng:function(){return t},isDefault:function(){var e=n();return function(e){return e&&"mcepastebin"===e.id}(e)&&r(e.innerHTML)},isDefaultContent:r}}(e),x="data:text/mce-internal,",w=M.createIdGenerator("mceclip");f.pasteFormat=m.isPasteAsTextEnabled(e)?"text":"html",f.pasteHtml=t,f.pasteText=n,f.pasteImageData=a,f.getDataTransferItems=r,f.hasHtmlOrText=i,f.hasContentType=s,e.on("preInit",function(){u();var t;e.parser.addNodeFilter("img",function(n,r,i){function o(e){e.attr("data-mce-object")||t===v.transparentSrc||e.remove()}function a(e){return 0===e.indexOf("webkit-fake-url")}function s(e){return 0===e.indexOf("data:")}if(!e.settings.paste_data_images&&function(e){return e.data&&!0===e.data.paste}(i))for(var l=n.length;l--;)(t=n[l].attributes.map.src)&&(a(t)?o(n[l]):!e.settings.allow_html_data_urls&&s(t)&&o(n[l]))})})},U=function(){},V=function(e,t,n){if(!function(e){return!1===v.iOS&&e!==undefined&&"function"==typeof e.setData&&!0!==M.isMsEdge()}(e))return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(b.internalHtmlMime(),t),!0}catch(r){return!1}},z=function(e,t,n,r){V(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},K=function(e){return function(t,n){var r=b.mark(t),i=e.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=e.dom.create("div",{contenteditable:"true"},r);e.dom.setStyles(i,{position:"fixed",left:"-3000px",width:"1000px",overflow:"hidden"}),i.appendChild(o),e.dom.add(e.getBody(),i);var a=e.selection.getRng();o.focus();var s=e.dom.createRng();s.selectNodeContents(o),e.selection.setRng(s),setTimeout(function(){i.parentNode.removeChild(i),e.selection.setRng(a),n()},0)}},G=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},X=function(e){e.on("cut",function(e){return function(t){!1===e.selection.isCollapsed()&&z(t,G(e),K(e),function(){setTimeout(function(){e.execCommand("Delete")},0)})}}(e)),e.on("copy",function(e){return function(t){!1===e.selection.isCollapsed()&&z(t,G(e),K(e),U)}}(e))},q=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Y=function(e,t){return q.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},Z=function(e,t){e.focus(),e.selection.setRng(t)},J=function(e,t,n){m.shouldBlockDrop(e)&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),m.shouldPasteDataImages(e)||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.on("drop",function(r){var i,o;if(o=Y(e,r),!r.isDefaultPrevented()&&!n.get()){i=t.getDataTransferItems(r.dataTransfer);var a=t.hasContentType(i,b.internalHtmlMime());if((t.hasHtmlOrText(i)&&!function(e){var t=e["text/plain"];return!!t&&0===t.indexOf("file://")}(i)||!t.pasteImageData(r,o))&&o&&m.shouldFilterDrop(e)){var s=i["mce-internal"]||i["text/html"]||i["text/plain"];s&&(r.preventDefault(),h.setEditorTimeout(e,function(){e.undoManager.transact(function(){i["mce-internal"]&&e.execCommand("Delete"),Z(e,o),s=M.trimHtml(s),i["text/html"]?t.pasteHtml(s,a):t.pasteText(s)})}))}}}),e.on("dragstart",function(e){n.set(!0)}),e.on("dragover dragend",function(t){m.shouldPasteDataImages(e)&&!1===n.get()&&(t.preventDefault(),Z(e,Y(e,t))),"dragend"===t.type&&n.set(!1)})},Q=function(e){var t=e.plugins.paste,n=m.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=m.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})},ee=function(e){v.webkit&&i(e,a),v.ie&&(i(e,o),function(e,t){e.on("PastePostProcess",function(n){t(e,n.node)})}(e,s))},te=function(e){return function(){return e}},ne=function(e){for(var t=new Array(arguments.length-1),n=1;n