!function(){"use strict";vare=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){returnfunction(){returne}},n=(t(!1),t(!0),function(e){for(vart=newArray(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];returnfunction(){for(varn=newArray(arguments.length),a=0;a<n.length;a++)n[a]=arguments[a];varr=t.concat(n);returne.apply(null,r)}}),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=function(e){returne.getParam("template_cdate_classes","cdate")},o=function(e){returne.getParam("template_mdate_classes","mdate")},i=function(e){returne.getParam("template_selected_content_classes","selcontent")},s=function(e){returne.getParam("template_preview_replace_values")},u=function(e){returne.getParam("template_replace_values")},p=function(e){returne.templates},m=function(e){returne.getParam("template_cdate_format",e.getLang("template.cdate_format"))},d=function(e){returne.getParam("template_mdate_format",e.getLang("template.mdate_format"))},f=function(e){returne.getParam("template_popup_width",600)},g=function(e){returnMath.min(l.DOM.getViewPort().h,e.getParam("template_popup_height",500))},h=function(e,t){if((e=""+e).length<t)for(varn=0;n<t-e.length;n++)e="0"+e;returne},y=function(e,t,n){vara="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),c="January February March April May June July August September October November December".split(" ");returnn=n||newDate,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",h(n.getMonth()+1,2))).replace("%d",h(n.getDate(),2))).replace("%H",""+h(n.getHours(),2))).replace("%M",""+h(n.getMinutes(),2))).replace("%S",""+h(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(c[n.getMonth()]))).replace("%b",""+e.translate(l[n.getMonth()]))).replace("%A",""+e.translate(r[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")},v=function(e,t,n){returna.each(n,function(e,n){"function"==typeofe&&(e=e(n)),t=t.replace(newRegExp("\\{\\$"+n+"\\}","g"),e)}),t},M=function(e,t){varn=e.dom,r=u(e);a.each(n.select("*",t),function(e){a.each(r,function(t,a){n.hasClass(e,a)&&"function"==typeofr[a]&&r[a](e)})})},_=function(e,t){returnnewRegExp("\\b"+t+"\\b","g").test(e.className)},b=function(e,t){returnfunction(){varn=p(e);"function"!=typeofn?"string"==typeofn?r.send({url:n,success:function(e){t(JSON.parse(e))}}):t(n):n(t)}},T=v,x=M,P=function(e,t,n){varr,l,s=e.dom,p=e.selection.getContent();n=v(0,n,u(e)),r=s.create("div",null,n),(l=s.select(".mceTmpl",r))&&l.length>0&&(r=s.create("div",null)).appendChild(l[0].cloneNode(!0)),a.each(s.select("*",r),function(t){_(t,c(e).replace(/\s+/g,"|"))&&(t.innerHTML=y(e,m(e))),_(t,o(e).replace(/\s+/g,"|"))&&(t.innerHTML=y(e,d(e))),_(t,i(e).replace(/\s+/g,"|"))&&(t.innerHTML=p)}),M(e,r),e.execCommand("mceInsertContent",!1,r.innerHTML),e.addVisual()},S=function(e){e.addCommand("mceInsertTemplate",n(P,e))},w=function(e){e.on("PreProcess",function(t){varn=e.dom,r=d(e);a.each(n.select("div",t.node),function(t){n.hasClass(t,"mceTmpl")&&(a.each(n.select("*",t),function(t){n.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=y(e,r))}),x(e,t))})})},D=function(e,t,n){if(-1===n.indexOf("<html>")){varr="";a.each(e.contentCSS,function(t){r+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});varl=e.settings.body_class||"";-1!==l.indexOf("=")&&(l=(l=e.getParam("body_class","","hash"))[e.id]||""),n="<!DOCTYPE html><html><head>"+r+'</head><body class="'+l+'">'+n+"</body></html>"}n=T(e,n,s(e));varc=t.find("iframe")[0].getEl().contentWindow.document;c.open(),c.write(n),c.close()},H=function(e,t