!function(J,w){function C(d,b){for(var f,c=[],a=0;a]+>/g,"")),(t.settings.paste_remove_styles||t.settings.paste_remove_styles_if_webkit!==!1&&c.webkit)&&(f=f.replace(/ style=\"[^\"]+\"/g,"")),h.isDefaultPrevented()||t.insertContent(f)}function R(h){h=t.dom.encode(h).replace(/\r\n/g,"\n");var f=t.dom.getParent(t.selection.getStart(),t.dom.isBlock);h=f&&/^(PRE|DIV)$/.test(f.nodeName)||!t.settings.forced_root_block?P(h,[[/\n/g,"
"]]):P(h,[[/\n\n/g,"
"],[/^(.*<\/p>)(
)$/,"
$1"],[/\n/g,"
"]]);var i=t.fire("PastePreProcess",{content:h});i.isDefaultPrevented()||t.insertContent(i.content)}function y(){var h=t.dom.getViewPort().y,f=t.dom.add(t.getBody(),"div",{contentEditable:!1,"data-mce-bogus":"1",style:"position: absolute; top: "+h+"px; left: 0; width: 1px; height: 1px; overflow: hidden"},'
X
');return t.dom.bind(f,"beforedeactivate focusin focusout",function(i){i.stopPropagation()}),f}function e(f){t.dom.unbind(f),t.dom.remove(f)}var n=this,v;t.on("keydown",function(f){d.metaKeyPressed(f)&&f.shiftKey&&86==f.keyCode&&(v=g())}),b()?t.on("paste",function(h){function f(o,l){for(var m=0;m100){var o,l=y();s.preventDefault(),h.bind(l,"paste",function(m){m.stopPropagation(),o=!0});var p=t.selection.getRng(),i=h.doc.body.createTextRange();if(i.moveToElementText(l.firstChild),i.execCommand("Paste"),e(l),!o){return t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0}t.selection.setRng(p),r()?R(S(l.firstChild)):O(l.firstChild.innerHTML)}})}):(t.on("init",function(){t.dom.bind(t.getBody(),"paste",function(f){f.preventDefault(),t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")})}),t.on("keydown",function(h){if(Q(h)&&!h.isDefaultPrevented()){var f=y(),i=t.selection.getRng();t.selection.select(f,!0),t.dom.bind(f,"paste",function(l){l.stopPropagation(),setTimeout(function(){e(f),t.lastRng=i,t.selection.setRng(i);var m=f.firstChild;m.lastChild&&"BR"==m.lastChild.nodeName&&m.removeChild(m.lastChild),r()?R(S(m)):O(m.innerHTML)},0)})}})),t.settings.paste_data_images||t.on("drop",function(h){var f=h.dataTransfer;f&&f.files&&f.files.length>0&&h.preventDefault()})),t.paste_block_drop&&t.on("dragend dragover draggesture dragdrop drop drag",function(f){f.preventDefault(),f.stopPropagation()}),this.paste=O,this.pasteText=R}}),z(I,[K,A,D,G,H],function(d,b,f,c,a){return function(g){var e=d.each;g.on("PastePreProcess",function(Q){function o(h){e(h,function(l){P=l.constructor==RegExp?P.replace(l,""):P.replace(l[0],l[1])})}function O(S){function X(ac,aa,Z,ab){var u=ac._listLevel||m;u!=m&&(m>u?p&&(p=p.parent.parent):(h=p,p=null)),p&&p.name==Z?p.append(ac):(h=h||p,p=new a(Z,1),ab>1&&p.attr("start",""+ab),ac.wrap(p)),ac.name="li",aa.value="";var ad=aa.next;ad&&3==ad.type&&(ad.value=ad.value.replace(/^\u00a0+/,"")),u>m&&h.lastChild.append(p),m=u}for(var p,h,m=1,V=S.getAll("p"),Y=0;Y/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(l,h){return h.length>0?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\xa0"):""}]]);var n=new f({valid_elements:"@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[!href]"}),r=new b({},n);r.addAttributeFilter("style",function(l){for(var h=l.length,m;h--;){m=l[h],m.attr("style",y(m,m.attr("style"))),"span"!=m.name||m.attributes.length||m.unwrap()}});var t=r.parse(P);O(t),Q.content=new c({},n).serialize(t)}})}}),z(k,[L,K],function(b,a){return function(h){function f(i){h.on("PastePreProcess",function(l){l.content=i(l.content)})}function d(i,l){return a.each(l,function(m){i=m.constructor==RegExp?i.replace(m,""):i.replace(m[0],m[1])}),i}function g(i){return i=d(i,[/^[\s\S]*|[\s\S]*$/g,[/\u00a0<\/span>/g,"\xa0"],/
$/])}function c(l){if(!e){var i=[];a.each(h.schema.getBlockElements(),function(n,m){i.push(m)}),e=new RegExp("(?:
[\\s\\r\\n]+|
)*(<\\/?("+i.join("|")+")[^>]*>)(?:
[\\s\\r\\n]+|
)*","g")}return l=d(l,[[e,"$1"]]),l=d(l,[[/
/g,"
"],[/
/g," "],[/
/g,"
"]])}var e;b.webkit&&f(g),b.ie&&f(c)}}),z(j,[M,E,I,k],function(d,b,f,c){var a;d.add("paste",function(h){var i=this,g;i.clipboard=g=new b(h),i.quirks=new c(h),i.wordFilter=new f(h),h.settings.paste_as_text&&(i.clipboard.pasteFormat="text"),h.addCommand("mceInsertClipboardContent",function(m,l){l.content&&i.clipboard.paste(l.content),l.text&&i.clipboard.pasteText(l.text)}),h.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:g.pasteFormat,onclick:function(){"text"==g.pasteFormat?(this.active(!1),g.pasteFormat="html"):(g.pasteFormat="text",this.active(!0),a||(h.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),a=!0))}})})}),N([E,I,k,j])}(this);