!function(){"use strict";vare=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){returnfunction(){returne}};varn,r,a,o,u,c=t(!1),i=t(!0),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){returne.getParam("template_cdate_classes","cdate")},s=function(e){returne.getParam("template_mdate_classes","mdate")},f=function(e){returne.getParam("template_selected_content_classes","selcontent")},d=function(e){returne.getParam("template_preview_replace_values")},g=function(e){returne.getParam("template_replace_values")},y=function(e){returne.templates},v=function(e){returne.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},h=function(e){returne.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},b=function(e,t){if((e=""+e).length<t)for(varn=0;n<t-e.length;n++)e="0"+e;returne},O=function(e,t,n){varr="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="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",b(n.getMonth()+1,2))).replace("%d",b(n.getDate(),2))).replace("%H",""+b(n.getHours(),2))).replace("%M",""+b(n.getMinutes(),2))).replace("%S",""+b(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},T=function(n,e){returnp.each(e,function(e,t){"function"==typeofe&&(e=e(t)),n=n.replace(newRegExp("\\{\\$"+t+"\\}","g"),e)}),n},M=function(e,t){varr=e.dom,a=g(e);p.each(r.select("*",t),function(n){p.each(a,function(e,t){r.hasClass(n,t)&&"function"==typeofa[t]&&a[t](n)})})},S=function(e,t){returnnewRegExp("\\b"+t+"\\b","g").test(e.className)},_=function(t,n){returnfunction(){vare=y(t);"function"!=typeofe?"string"==typeofe?m.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},x=T,P=M,A=function(t,e,n){varr,a,o=t.dom,u=t.selection.getContent();n=T(n,g(t)),r=o.create("div",null,n),(a=o.select(".mceTmpl",r))&&0<a.length&&(r=o.create("div",null)).appendChild(a[0].cloneNode(!0)),p.each(o.select("*",r),function(e){S(e,l(t).replace(/\s+/g,"|"))&&(e.innerHTML=O(t,v(t))),S(e,s(t).replace(/\s+/g,"|"))&&(e.innerHTML=O(t,h(t))),S(e,f(t).replace(/\s+/g,"|"))&&(e.innerHTML=u)}),M(t,r),t.execCommand("mceInsertContent",!1,r.innerHTML),t.addVisual()},w=function(e){e.addCommand("mceInsertTemplate",functiont(r){for(vara=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];returnfunction(){for(vare=[],t=0;t<arguments.length;t++)e[t]=arguments[t];varn=a.concat(e);returnr.apply(null,n)}}(A,e))},D=function(r){r.on("PreProcess",function(e){vart=r.dom,n=h(r);p.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(p.each(t.select("*",e),function(e){t.hasClass(e,r.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=O(r,n))}),P(r,e))})})},C=c,N=i,H=function(){returnk},k=(o={fold:function(e,t){returne()},is:C,isSome:C,isNone:N,getOr:a=function(e){returne},getOrThunk:r=function(e){returne()},getOrDie:function(e){thrownewError(e||"error: getOrDie called on none.")},getOrNull:function(){returnnull},getOrUndefined:function(){returnundefined},or:a,orThunk:r,map:H,ap:H,each:function(){},bind:H,flatten:H,exists:C,forall:N,filter:H,equals:n=function(e){returne.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(o),o),I=function(n){vare=function(){returnn},t=function(){returna},r=function(e){returne(n)},a={fold:function(e,t){returnt(n)},is:function(e){returnn===e},isSome:N,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,getOrN