!function(a,b){"use strict";functionc(a,b){for(varc,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}functiond(a,d,e){if("string"!=typeofa)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}functione(b){for(varc=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}returnc}functionf(c){vard,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(varj=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(fing)i[f]=g[f];for(d=0;d<c.length;d++)deletei[c[d]];a.privateModules=i}}varg={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){functiond(b,c){returna.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}functione(e){functionf(a){varb=a.name,c=a;if("br"===b)returnvoid(i+="\n");if(j[b]&&(i+=""),k[b])returnvoid(i+="");if(3==a.type&&(i+=a.value),!a.shortEnded&&(a=a.firstChild))dof(a);while(a=a.next);l[b]&&c.next&&(i+="\n","p"==b&&(i+="\n"))}varg=newc,h=newb({},g),i="",j=g.getShortEndedElements(),k=a.makeMap("script noscript style textarea video audio iframe object",""),l=g.getBlockElements();returne=d(e,[/<!\[[^\]]+\]>/g]),f(h.parse(e)),i}functionf(a){functionb(a,b,c){returnb||c?"\xa0":""}returna=d(a,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/(?)<span class="Apple-converted-space">\u00a0<\/span>(?)/g,b],/<br>$/i])}return{filter:d,innerText:e,trimHtml:f}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(a,b,c,d){returnfunction(e){functionf(a){varb,c=e.dom;if(b=e.fire("BeforePastePreProcess",{content:a}),b=e.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(e.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){vard=c.add(e.getBody(),"div",{style:"display:none"},a);b=e.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(a,{merge:e.settings.paste_merge_formats!==!1,data:{paste:!0}})}}functiong(a){a=e.dom.encode(a).replace(/\r\n/g,"\n");varb,c=e.dom.getParent(e.selection.getStart(),e.dom.isBlock),g=e.settings.forced_root_block;g&&(b=e.dom.createHTML(g,e.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!g?a=d.filter(a,[[/\n/g,"<br>"]]):(a=d.filter(a,[[/\n\n/g,"</p>"+b],[/^(.*<\/p>)(<p>)$/,b+"$1"],[/\n/g,"<br />"]]),-1!=a.indexOf("<p>")&&(a=b+a)),f(a)}functionh(){functionb(a){varb,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)returnb[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[t.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void0}}varc,d=e.dom,f=e.getBody(),g=e.dom.getViewPort(e.getWin()),h=g.y,i=20;if(t=e.selection.getRng(),e.inline&&(c=e.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),t.getClientRects){varj=b(t);if(j)i=h+(j.top-d.getPos(f).y);else{i=h;vark=t.startContainer;k&&(3==k.nodeType&&k.parentNode!=f&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||f).y))}}s=d.add(e.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},y),(a.ie||a.gecko)&&d.setStyle(s,"left","rtl"==d.getStyle(f,"direction",!0)?65535:-65535),d.bind(s,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),s.focus(),e.selection.select(s,!0)}functioni(){if(s){for(vara;a=e.dom.get("mcepastebin");)e.dom.remove(a),e.dom.unbind(a);t&&e.selection.setRng(t)}s=t=null}functionj(){vara,b,c,d,f="";for(a=e.dom.select("div[id=mcepastebin]"),b=0;b<a.length;b++)c=a[b],c.firstChild&&"mcepastebin"==c.firstChild.id&&(c=c.firstChild),d=c.innerHTML,f!=y&&(f+=d);returnf}functionk(a){varb={};if(a){if(a.getData){varc=a.getData("Text");c&&c.length>0&&-1==c.indexOf(z)&&(b["text/plain"]=c)}if(a.types)for(vard=0;d<a.types.length;d++){vare=a.types[d];b[e]=a.getData(e)}}returnb}functionl(a){returnk(a.clipboardData||e.getDoc().dataTransfer)}functionm(a,b){functionc(c){functiond(a){b&&(e.selection.setRng(b),b=null),f('<img src="'+a.result+'">')}varg,h,i,j=!1;if(c)for(g=0;g<c.length;g++)h=c[g],/^image\/(jpeg|png|gif|bmp)$/.test(h.type)&&(i=newFileReader,i.onload=d.bind(null,i),i.readAsDataURL(h.getAsFile?h.getAsFile():h),a.preventDefault(),j=!0);returnj}vard=a.clipboardData||a.dataTransfer;returne.settings.paste_data_images&&d?c(d.items)||c(d.files):void0}functionn(a){varb=a.clipboardData;return-1!=navigator.userAgent.indexOf("Android")&&b&&b.items&&0===b.items.length}functiono(a){returnb.getCaretRangeFromPoint(a.clientX,a.clientY,e.getDoc())}functionp(a,b){returnbina&&a[b].length>0}functionq(a){returnc.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}functionr(){e.on("keydown",function(b){functionc(a){q(a)&&!a.isDefaultPrevented()&&i()}if(q(b)&&!b.isDefaultPrevented()){if(u=b.shiftKey&&86==b.keyCode,u&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),w=(newDate).getTime(),a.ie&&u)returnb.preventDefault(),voide.fire("paste",{ieFake:!0});i(),h(),e.once("keyup",c),e.once("paste",function(){e.off("keyup",c)})}}),e.on("paste",function(b){varc=(newDate).getTime(),k=l(b),o=(newDate).getTime()-c,q=(newDate).getTime()-w-o<1e3,r="text"==v.pasteFormat||u;returnu=!1,b.isDefaultPrevented()||n(b)?voidi():m(b)?voidi():(q||b.preventDefault(),!a.ie||q&&!b.ieFake||(h(),e.dom.bind(s,"paste",function(a){a.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),k["text/html"]=j()),voidsetTimeout(function(){vara;returnp(k,"text/html")?a=k["text/html"]:(a=j(),a==y&&(r=!0)),a=d.trimHtml(a),s&&s.firstChild&&"mcepastebin"===s.firstChild.id&&(r=!0),i(),a.length||(r=!0),r&&(a=p(k,"text/plain")&&-1==a.indexOf("</p>")?k["text/plain"]:d.innerText(a)),a==y?void(q||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(r?g(a):f(a))},0))}),e.on("dragstart dragend",function(a){x="dragstart"==a.type}),e.on("drop",function(a){varb=o(a);if(!a.isDefaultPrevented()&&!x&&!m(a,b)&&b&&e.settings.paste_filter_drop!==!1){varc=k(a.dataTransfer),h=c["mce-internal"]||c["text/html"]||c["text/plain"];h&&(a.preventDefault(),e.undoManager.transact(function(){c["mce-internal"]&&e.execCommand("Delete"),e.selection.setRng(b),h=d.trimHtml(h),c["text/html"]?f(h):g(h)}))}}),e.on("dragover dragend",function(a){e.settings.paste_data_images&&a.preventDefault()})}vars,t,u,v=this,w=0,x=!1,y="%MCEPASTEBIN%",z="data:text/mce-internal,";v.pasteHtml=f,v.pasteText=g,e.on("preInit",function(){r(),e.parser.addNodeFilter("img",function(b,c,d){functionf(a){returna.data&&a.data.paste===!0}functiong(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}functionh(a){return0===a.indexOf("webkit-fake-url")}functioni(a){return0===a.indexOf("data:")}if(!e.settings.paste_data_images&&f(d))for(varj=b.length;j--;){vark=b[j].attributes.map.src;k&&(h(k)?g(b[j]):!e.settings.allow_html_data_urls&&i(k)&&g(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){functiong(a){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(a)||/class="OutlineElement/.test(a)||/id="?docs\-internal\-guid\-/.test(a)}functionh(b){varc,d;returnd=[/^[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]/],b=b.replace(/^[\u00a0 ]+/,""),a.each(d,function(a){returna.test(b)?(c=!0,!1):void0}),c}functioni(a){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(a)}functionj(j){vark=j.settings;j.on("BeforePastePreProcess",function(l){functionm(a){functionb(a){varc="";if(3===a.type)returna.value;if(a=a.firstChild)doc+=b(a);while(a=a.next);returnc}functionc(a,b){if(3===a.type&&b.test(a.value))returna.value=a.value.replace(b,""),!1;if(a=a.firstChild)doif(!c(a,b))return!1;while(a=a.next);return!0}functiond(a){if(a._listIgnore)returnvoida.remove();if(a=a.firstChild)dod(a);while(a=a.next)}functionf(a,b,f){varh=a._listLevel||k;h!=k&&(k>h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=newe(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(varg,j,k=1,l=[],m=a.firstChild;"undefined"!=typeofm&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeofm&&m.parent!==a;)m=m.walk();for(varn=0;n<l.length;n++)if(a=l[n],"p"==a.name&&a.firstChild){varo=b(a);if(i(o)){f(a,"ul");continue}if(h(o)){varp=/([0-9]+)\./.exec(o),q=1;p&&(q=parseInt(p[1],10)),f(a,"ol",q);continue}if(a._listLevel){f(a,"ul",1);continue}g=null}elsej=g,g=null}functionn(b,c){vard,f={},g=j.dom.parseStyle(c);returna.each(g,function(a,e){switch(e){case"mso-list":d=/\w+ \w+([0-9]+)/i.exec(c),d&&(b._listLevel=parseInt(d[1],10)),/Ignore/i.test(a)&&b.firstChild&&(b._listIgnore=!0,b.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":returnvoid("normal"!=a&&(f[e]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))returnvoidb.remove()}return0===e.indexOf("mso-comment")?voidb.remove():void(0!==e.indexOf("mso-")&&("all"==o||p&&p[e])&&(f[e]=a))}),/(bold)/i.test(f["font-weight"])&&(deletef["font-weight"],b.wrap(newe("b",1))),/(italic)/i.test(f["font-style"])&&(deletef["font-style"],b.wrap(newe("i",1))),f=j.dom.serializeStyle(f,b.name),f?f:null}varo,p,q=l.content;if(q=q.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/<br class="?Apple-interchange-newline"?>/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(a,b){returnb.length>0?b.replace(/./,"").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);varr=k.paste_word_valid_elements;r||(r="-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");vars=newc({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});vart=newb({},s);t.addAttributeFilter("style",function(a){for(varb,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(varb,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(varb=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(varb,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();elseif(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}elseb.unwrap()});varu=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=newd({},s).serialize(u)}})}returnj.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){returnfunction(e){functionf(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}functiong(a){if(!c.isWordContent(a))returna;varf=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});varg=newRegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+f.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");returna=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/<br><br>/g,"<BR><BR>"],[/<br>/g,""],[/<BR><BR>/g,"<br>"]])}functionh(a){if(c.isWordContent(a))returna;varb=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)returna;if(b&&(b=b.split(/[, ]/)),b){vard=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){varh=d.parseStyle(e,"span"),i={};if("none"===b)returnc+g;for(varj=0;j<b.length;j++){vark=h[b[j]],l=d.getStyle(f,b[j],!0);/color/.test(b[j])&&(k=d.toHex(k),l=d.toHex(l)),l!=k&&(i[b[j]]=k)}returni=d.serializeStyle(i,"span"),i?c+' style="'+i+'"'+g:c+g})}elsea=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");returna=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){returnb+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){vare;a.add("paste",function(a){functionf(){"text"==g.pasteFormat?(this.active(!1),g.pasteFormat="html"):(g.pasteFormat="text",this.active(!0),e||(a.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),e=!0))}varg,h=this,i=a.settings;h.clipboard=g=newb(a),h.quirks=newd(a),h.wordFilter=newc(a),a.settings.paste_as_text&&(h.clipboard.pasteFormat="text"),i.paste_preprocess&&a.on("PastePreProcess",function(a){i.paste_preprocess.call(h,h,a)}),i.paste_postprocess&&a.on("PastePostProcess",function(a){i.paste_postprocess.call(h,h,a)}),a.addCommand("mceInsertClipboardContent",function(a,b){b.content&&h.clipboard.pasteHtml(b.content),b.text&&h.clipboard.pasteText(b.text)}),a.paste_block_drop&&a.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),a.settings.paste_data_images||a.on("drop",function(a){varb=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),a.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:f,active:"text"==h.clipboard.pasteFormat}),a.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:g.pasteFormat,onclick:f})})}),f(["tinymce/pasteplugin/Utils"])}(this);
\ No newline at end of file
!function(a,b){"use strict";functionc(a,b){for(varc,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}functiond(a,d,e){if("string"!=typeofa)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}functione(b){for(varc=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}returnc}functionf(c){vard,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(varj=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(fing)i[f]=g[f];for(d=0;d<c.length;d++)deletei[c[d]];a.privateModules=i}}varg={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){functiond(b,c){returna.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}functione(e){functionf(a){varb=a.name,c=a;if("br"===b)returnvoid(i+="\n");if(j[b]&&(i+=""),k[b])returnvoid(i+="");if(3==a.type&&(i+=a.value),!a.shortEnded&&(a=a.firstChild))dof(a);while(a=a.next);l[b]&&c.next&&(i+="\n","p"==b&&(i+="\n"))}varg=newc,h=newb({},g),i="",j=g.getShortEndedElements(),k=a.makeMap("script noscript style textarea video audio iframe object",""),l=g.getBlockElements();returne=d(e,[/<!\[[^\]]+\]>/g]),f(h.parse(e)),i}functionf(a){functionb(a,b,c){returnb||c?"\xa0":""}returna=d(a,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/(?)<span class="Apple-converted-space">\u00a0<\/span>(?)/g,b],/<br>$/i])}return{filter:d,innerText:e,trimHtml:f}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(a,b,c,d){returnfunction(e){functionf(a){varb,c=e.dom;if(b=e.fire("BeforePastePreProcess",{content:a}),b=e.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(e.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){vard=c.add(e.getBody(),"div",{style:"display:none"},a);b=e.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(a,{merge:e.settings.paste_merge_formats!==!1,data:{paste:!0}})}}functiong(a){a=e.dom.encode(a).replace(/\r\n/g,"\n");varb,c=e.dom.getParent(e.selection.getStart(),e.dom.isBlock),g=e.settings.forced_root_block;g&&(b=e.dom.createHTML(g,e.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!g?a=d.filter(a,[[/\n/g,"<br>"]]):(a=d.filter(a,[[/\n\n/g,"</p>"+b],[/^(.*<\/p>)(<p>)$/,b+"$1"],[/\n/g,"<br />"]]),-1!=a.indexOf("<p>")&&(a=b+a)),f(a)}functionh(){functionb(a){varb,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)returnb[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[v.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void0}}varc,d=e.dom,f=e.getBody(),g=e.dom.getViewPort(e.getWin()),h=g.y,i=20;if(v=e.selection.getRng(),e.inline&&(c=e.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),v.getClientRects){varj=b(v);if(j)i=h+(j.top-d.getPos(f).y);else{i=h;vark=v.startContainer;k&&(3==k.nodeType&&k.parentNode!=f&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||f).y))}}u=d.add(e.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},A),(a.ie||a.gecko)&&d.setStyle(u,"left","rtl"==d.getStyle(f,"direction",!0)?65535:-65535),d.bind(u,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),u.focus(),e.selection.select(u,!0)}functioni(){if(u){for(vara;a=e.dom.get("mcepastebin");)e.dom.remove(a),e.dom.unbind(a);v&&e.selection.setRng(v)}u=v=null}functionj(){vara,b,c,d,f="";for(a=e.dom.select("div[id=mcepastebin]"),b=0;b<a.length;b++)c=a[b],c.firstChild&&"mcepastebin"==c.firstChild.id&&(c=c.firstChild),d=c.innerHTML,f!=A&&(f+=d);returnf}functionk(a){varb,c,d,e;for(d=[25942,29554,28521,14958],b=0;b<d.length;b++)if(a.charCodeAt(b)!=d[b])returna;for(c="",b=0;b<a.length;b++)e=a.charCodeAt(b),c+=String.fromCharCode(255&e),c+=String.fromCharCode((65280&e)>>8);returndecodeURIComponent(escape(c))}functionl(a){varb,c,d;returnc="<!--StartFragment-->",b=a.indexOf(c),-1!==b&&(a=a.substr(b+c.length)),d="<!--EndFragment-->",b=a.indexOf(d),-1!==b&&(a=a.substr(0,b)),a}functionm(a){varb={};if(a){if(a.getData){varc=a.getData("Text");c&&c.length>0&&-1==c.indexOf(B)&&(b["text/plain"]=c)}if(a.types)for(vard=0;d<a.types.length;d++){vare=a.types[d],f=a.getData(e);"text/html"==e&&(f=l(k(f))),b[e]=f}}returnb}functionn(a){returnm(a.clipboardData||e.getDoc().dataTransfer)}functiono(a,b){functionc(c){functiond(a){b&&(e.selection.setRng(b),b=null),f('<img src="'+a.result+'">')}varg,h,i,j=!1;if(c)for(g=0;g<c.length;g++)h=c[g],/^image\/(jpeg|png|gif|bmp)$/.test(h.type)&&(i=newFileReader,i.onload=d.bind(null,i),i.readAsDataURL(h.getAsFile?h.getAsFile():h),a.preventDefault(),j=!0);returnj}vard=a.clipboardData||a.dataTransfer;returne.settings.paste_data_images&&d?c(d.items)||c(d.files):void0}functionp(a){varb=a.clipboardData;return-1!=navigator.userAgent.indexOf("Android")&&b&&b.items&&0===b.items.length}functionq(a){returnb.getCaretRangeFromPoint(a.clientX,a.clientY,e.getDoc())}functionr(a,b){returnbina&&a[b].length>0}functions(a){returnc.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}functiont(){e.on("keydown",function(b){functionc(a){s(a)&&!a.isDefaultPrevented()&&i()}if(s(b)&&!b.isDefaultPrevented()){if(w=b.shiftKey&&86==b.keyCode,w&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),y=(newDate).getTime(),a.ie&&w)returnb.preventDefault(),voide.fire("paste",{ieFake:!0});i(),h(),e.once("keyup",c),e.once("paste",function(){e.off("keyup",c)})}}),e.on("paste",function(b){varc=(newDate).getTime(),k=n(b),l=(newDate).getTime()-c,m=(newDate).getTime()-y-l<1e3,q="text"==x.pasteFormat||w;returnw=!1,b.isDefaultPrevented()||p(b)?voidi():o(b)?voidi():(m||b.preventDefault(),!a.ie||m&&!b.ieFake||(h(),e.dom.bind(u,"paste",function(a){a.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),k["text/html"]=j()),voidsetTimeout(function(){vara;returnr(k,"text/html")?a=k["text/html"]:(a=j(),a==A&&(q=!0)),a=d.trimHtml(a),u&&u.firstChild&&"mcepastebin"===u.firstChild.id&&(q=!0),i(),a.length||(q=!0),q&&(a=r(k,"text/plain")&&-1==a.indexOf("</p>")?k["text/plain"]:d.innerText(a)),a==A?void(m||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(q?g(a):f(a))},0))}),e.on("dragstart dragend",function(a){z="dragstart"==a.type}),e.on("drop",function(a){varb=q(a);if(!a.isDefaultPrevented()&&!z&&!o(a,b)&&b&&e.settings.paste_filter_drop!==!1){varc=m(a.dataTransfer),h=c["mce-internal"]||c["text/html"]||c["text/plain"];h&&(a.preventDefault(),e.undoManager.transact(function(){c["mce-internal"]&&e.execCommand("Delete"),e.selection.setRng(b),h=d.trimHtml(h),c["text/html"]?f(h):g(h)}))}}),e.on("dragover dragend",function(a){e.settings.paste_data_images&&a.preventDefault()})}varu,v,w,x=this,y=0,z=!1,A="%MCEPASTEBIN%",B="data:text/mce-internal,";x.pasteHtml=f,x.pasteText=g,e.on("preInit",function(){t(),e.parser.addNodeFilter("img",function(b,c,d){functionf(a){returna.data&&a.data.paste===!0}functiong(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}functionh(a){return0===a.indexOf("webkit-fake-url")}functioni(a){return0===a.indexOf("data:")}if(!e.settings.paste_data_images&&f(d))for(varj=b.length;j--;){vark=b[j].attributes.map.src;k&&(h(k)?g(b[j]):!e.settings.allow_html_data_urls&&i(k)&&g(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){functiong(a){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(a)||/class="OutlineElement/.test(a)||/id="?docs\-internal\-guid\-/.test(a)}functionh(b){varc,d;returnd=[/^[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]/],b=b.replace(/^[\u00a0 ]+/,""),a.each(d,function(a){returna.test(b)?(c=!0,!1):void0}),c}functioni(a){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(a)}functionj(j){vark=j.settings;j.on("BeforePastePreProcess",function(l){functionm(a){functionb(a){varc="";if(3===a.type)returna.value;if(a=a.firstChild)doc+=b(a);while(a=a.next);returnc}functionc(a,b){if(3===a.type&&b.test(a.value))returna.value=a.value.replace(b,""),!1;if(a=a.firstChild)doif(!c(a,b))return!1;while(a=a.next);return!0}functiond(a){if(a._listIgnore)returnvoida.remove();if(a=a.firstChild)dod(a);while(a=a.next)}functionf(a,b,f){varh=a._listLevel||k;h!=k&&(k>h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=newe(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(varg,j,k=1,l=[],m=a.firstChild;"undefined"!=typeofm&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeofm&&m.parent!==a;)m=m.walk();for(varn=0;n<l.length;n++)if(a=l[n],"p"==a.name&&a.firstChild){varo=b(a);if(i(o)){f(a,"ul");continue}if(h(o)){varp=/([0-9]+)\./.exec(o),q=1;p&&(q=parseInt(p[1],10)),f(a,"ol",q);continue}if(a._listLevel){f(a,"ul",1);continue}g=null}elsej=g,g=null}functionn(b,c){vard,f={},g=j.dom.parseStyle(c);returna.each(g,function(a,e){switch(e){case"mso-list":d=/\w+ \w+([0-9]+)/i.exec(c),d&&(b._listLevel=parseInt(d[1],10)),/Ignore/i.test(a)&&b.firstChild&&(b._listIgnore=!0,b.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":returnvoid("normal"!=a&&(f[e]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))returnvoidb.remove()}return0===e.indexOf("mso-comment")?voidb.remove():void(0!==e.indexOf("mso-")&&("all"==o||p&&p[e])&&(f[e]=a))}),/(bold)/i.test(f["font-weight"])&&(deletef["font-weight"],b.wrap(newe("b",1))),/(italic)/i.test(f["font-style"])&&(deletef["font-style"],b.wrap(newe("i",1))),f=j.dom.serializeStyle(f,b.name),f?f:null}varo,p,q=l.content;if(q=q.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/<br class="?Apple-interchange-newline"?>/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(a,b){returnb.length>0?b.replace(/./,"").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);varr=k.paste_word_valid_elements;r||(r="-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");vars=newc({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});vart=newb({},s);t.addAttributeFilter("style",function(a){for(varb,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(varb,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(varb=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(varb,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();elseif(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}elseb.unwrap()});varu=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=newd({validate:k.validate},s).serialize(u)}})}returnj.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){returnfunction(e){functionf(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}functiong(a){if(!c.isWordContent(a))returna;varf=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});varg=newRegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+f.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");returna=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/<br><br>/g,"<BR><BR>"],[/<br>/g,""],[/<BR><BR>/g,"<br>"]])}functionh(a){if(c.isWordContent(a))returna;varb=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)returna;if(b&&(b=b.split(/[, ]/)),b){vard=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){varh=d.parseStyle(e,"span"),i={};if("none"===b)returnc+g;for(varj=0;j<b.length;j++){vark=h[b[j]],l=d.getStyle(f,b[j],!0);/color/.test(b[j])&&(k=d.toHex(k),l=d.toHex(l)),l!=k&&(i[b[j]]=k)}returni=d.serializeStyle(i,"span"),i?c+' style="'+i+'"'+g:c+g})}elsea=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");returna=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){returnb+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){vare;a.add("paste",function(a){functionf(){"text"==g.pasteFormat?(this.active(!1),g.pasteFormat="html"):(g.pasteFormat="text",this.active(!0),e||(a.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),e=!0))}varg,h=this,i=a.settings;h.clipboard=g=newb(a),h.quirks=newd(a),h.wordFilter=newc(a),a.settings.paste_as_text&&(h.clipboard.pasteFormat="text"),i.paste_preprocess&&a.on("PastePreProcess",function(a){i.paste_preprocess.call(h,h,a)}),i.paste_postprocess&&a.on("PastePostProcess",function(a){i.paste_postprocess.call(h,h,a)}),a.addCommand("mceInsertClipboardContent",function(a,b){b.content&&h.clipboard.pasteHtml(b.content),b.text&&h.clipboard.pasteText(b.text)}),a.paste_block_drop&&a.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),a.settings.paste_data_images||a.on("drop",function(a){varb=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),a.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:f,active:"text"==h.clipboard.pasteFormat}),a.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:g.pasteFormat,onclick:f})})}),f(["tinymce/pasteplugin/Utils"])}(this);
!function(a,b){"use strict";functionc(a,b){for(varc,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}functiond(a,d,e){if("string"!=typeofa)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}functione(b){for(varc=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}returnc}functionf(c){vard,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(varj=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(fing)i[f]=g[f];for(d=0;d<c.length;d++)deletei[c[d]];a.privateModules=i}}varg={};d("tinymce/spellcheckerplugin/DomTextMatcher",[],function(){returnfunction(a,b){functionc(a,b){if(!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";return{start:a.index,end:a.index+a[0].length,text:a[0],data:b}}functiond(a){varb;if(3===a.nodeType)returna.data;if(x[a.nodeName]&&!w[a.nodeName])return"";if(b="",(w[a.nodeName]||y[a.nodeName])&&(b+="\n"),a=a.firstChild)dob+=d(a);while(a=a.nextSibling);returnb}functione(a,b,c){vard,e,f,g,h,i=[],j=0,k=a,l=0;b=b.slice(0),b.sort(function(a,b){returna.start-b.start}),h=b.shift();a:for(;;){if((w[k.nodeName]||y[k.nodeName])&&j++,3===k.nodeType&&(!e&&k.length+j>=h.end?(e=k,g=h.end-j):d&&i.push(k),!d&&k.length+j>h.start&&(d=k,f=h.start-j),j+=k.length),d&&e){if(k=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:i,match:h.text,matchIndex:l}),j-=e.length-g,d=null,e=null,i=[],h=b.shift(),l++,!h)break}else{if((!x[k.nodeName]||w[k.nodeName])&&k.firstChild){k=k.firstChild;continue}if(k.nextSibling){k=k.nextSibling;continue}}for(;;){if(k.nextSibling){k=k.nextSibling;break}if(k.parentNode===a)breaka;k=k.parentNode}}}functionf(a){functionb(b,c){vard=z[c];d.stencil||(d.stencil=a(d));vare=d.stencil.cloneNode(!1);returne.setAttribute("data-mce-index",c),b&&e.appendChild(A.doc.createTextNode(b)),e}returnfunction(a){varc,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex,i=A.doc;if(f===g){varj=f;e=j.parentNode,a.startNodeIndex>0&&(c=i.createTextNode(j.data.substring(0,a.startNodeIndex)),e.insertBefore(c,j));vark=b(a.match,h);returne.insertBefore(k,j),a.endNodeIndex<j.length&&(d=i.createTextNode(j.data.substring(a.endNodeIndex)),e.insertBefore(d,j)),j.parentNode.removeChild(j),k}c=i.createTextNode(f.data.substring(0,a.startNodeIndex)),d=i.createTextNode(g.data.substring(a.endNodeIndex));for(varl=b(f.data.substring(a.startNodeIndex),h),m=[],n=0,o=a.innerNodes.length;o>n;++n){varp=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}varr=b(g.data.substring(0,a.endNodeIndex),h);returne=f.parentNode,e.insertBefore(c,f),e.insertBefore(l,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}functiong(a){varb=a.parentNode;b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}functionh(b){varc=a.getElementsByTagName("*"),d=[];b="number"==typeofb?""+b:null;for(vare=0;e<c.length;e++){varf=c[e],g=f.getAttribute("data-mce-index");null!==g&&g.length&&(g===b||null===b)&&d.push(f)}returnd}functioni(a){for(varb=z.length;b--;)if(z[b]===a)returnb;return-1}functionj(a){varb=[];returnk(function(c,d){a(c,d)&&b.push(c)}),z=b,this}functionk(a){for(varb=0,c=z.length;c>b&&a(z[b],b)!==!1;b++);returnthis}functionl(b){returnz.length&&e(a,z,f(b)),this}functionm(a,b){if(v&&a.global)for(;u=a.exec(v);)z.push(c(u,b));returnthis}functionn(a){varb,c=h(a?i(a):null);for(b=c.length;b--;)g(c[b]);returnthis}functiono(a){returnz[a.getAttribute("data-mce-index")]}functionp(a){returnh(i(a))[0]}functionq(a,b,c){returnz.push({start:a,end:a+b,text:v.substr(a,b),data:c}),this}functionr(a){varc=h(i(a)),d=b.dom.createRng();returnd.setStartBefore(c[0]),d.setEndAfter(c[c.length-1]),d}functions(a,c){vard=r(a);returnd.deleteContents(),c.length>0&&d.insertNode(b.dom.doc.createTextNode(c)),d}functiont(){returnz.splice(0,z.length),n(),this}varu,v,w,x,y,z=[],A=b.dom;returnw=b.schema.getBlockElements(),x=b.schema.getWhiteSpaceElements(),y=b.schema.getShortEndedElements(),v=d(a),{text:v,matches:z,each:k,filter:j,reset:t,matchFromElement:o,elementFromMatch:p,find:m,add:q,wrap:l,unwrap:n,replace:s,rangeFromMatch:r,indexOf:i}}}),d("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/XHR","tinymce/util/URI","tinymce/util/JSON"],function(a,b,c,d,e,f,g,h){b.add("spellchecker",function(b,i){functionj(){returnE.textMatcher||(E.textMatcher=newa(b.getBody(),b)),E.textMatcher}functionk(a,b){vard=[];returnc.each(b,function(a){d.push({selectable:!0,text:a.name,data:a.value})}),d}functionl(a){for(varbina)return!1;return!0}functionm(a,f){varg=[],h=A[a];c.each(h,function(a){g.push({text:a,onclick:function(){b.insertContent(b.dom.encode(a)),b.dom.remove(f),r()}})}),g.push({text:"-"}),D&&g.push({text:"Add to Dictionary",onclick:function(){s(a,f)}}),g.push.apply(g,[{text:"Ignore",onclick:function(){t(a,f)}},{text:"Ignore all",onclick:function(){t(a,f,!0)}}]),C=newd({items:g,context:"contextmenu",onautohide:function(a){-1!=a.target.className.indexOf("spellchecker")&&a.preventDefault()},onhide:function(){C.remove(),C=null}}),C.renderTo(document.body);vari=e.DOM.getPos(b.getContentAreaContainer()),j=b.dom.getPos(f[0]),k=b.dom.getRoot();"BODY"==k.nodeName?(j.x-=k.ownerDocument.documentElement.scrollLeft||k.scrollLeft,j.y-=k.ownerDocument.documentElement.scrollTop||k.scrollTop):(j.x-=k.scrollLeft,j.y-=k.scrollTop),i.x+=j.x,i.y+=j.y,C.moveTo(i.x,i.y+f[0].offsetHeight)}functionn(){returnb.getParam("spellchecker_wordchar_pattern")||newRegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g")}functiono(a,b,d,e){varj={method:a},k="";"spellcheck"==a&&(j.text=b,j.lang=F.spellchecker_language),"addToDictionary"==a&&(j.word=b),c.each(j,function(a,b){k&&(k+="&"),k+=b+"="+encodeURIComponent(a)}),f.send({url:newg(i).toAbsolute(F.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:k,success:function(a){a=h.parse(a),a?a.error?e(a.error):d(a):e("Sever response wasn't proper JSON.")},error:function(a,b){e("Spellchecker request error: "+b.status)}})}functionp(a,b,c,d){vare=F.spellchecker_callback||o;e.call(E,a,b,c,d)}functionq(){functiona(a){b.windowManager.alert(a),b.setProgressState(!1),u()}u(),B||(b.setProgressState(!0),p("spellcheck",j().text,y,a),b.focus())}functionr(){b.dom.select("span.mce-spellchecker-word").length||u()}functions(a,c){b.setProgressState(!0),p("addToDictionary",a,function(){b.setProgressState(!1),b.dom.remove(c,!0),r()},function(a){b.windowManager.alert(a),b.setProgressState(!1)})}functiont(a,d,e){b.selection.collapse(),e?c.each(b.dom.select("span.mce-spellchecker-word"),function(c){c.getAttribute("data-mce-word")==a&&b.dom.remove(c,!0)}):b.dom.remove(d,!0),r()}functionu(){j().reset(),E.textMatcher=null,B&&(B=!1,b.fire("SpellcheckEnd"))}functionv(a){varb=a.getAttribute("data-mce-index");return"number"==typeofb?""+b:b}functionw(a){vard,e=[];if(d=c.toArray(b.getBody().getElementsByTagName("span")),d.length)for(