text: !function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},r=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},a=n,i=r,o=function(e){var t=r(e);return t.length>0?t[0]:n(e)},u="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),c="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),s=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},d=function(e,t,n){return n=n||new Date,(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",s(n.getMonth()+1,2))).replace("%d",s(n.getDate(),2))).replace("%H",""+s(n.getHours(),2))).replace("%M",""+s(n.getMinutes(),2))).replace("%S",""+s(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[n.getMonth()]))).replace("%b",""+e.translate(l[n.getMonth()]))).replace("%A",""+e.translate(c[n.getDay()]))).replace("%a",""+e.translate(u[n.getDay()]))).replace("%%","%")},p=function(e,t){if(function(e){return e.getParam("insertdatetime_element",!1)}(e)){var n,r=d(e,t);n=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=n,c=r,l=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(l,o),i.dom.remove(o),i.selection.select(l,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+n+'">'+r+"</time>")}else e.insertContent(d(e,t));var i,o,u,c,l},f=d,g=tinymce.util.Tools.resolve("tinymce.util.Tools");t.add("insertdatetime",(function(t){var n=e(null);(function(e){e.addCommand("mceInsertDate",(function(){p(e,function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))}(e))})),e.addCommand("mceInsertTime",(function(){p(e,a(e))}))})(t),function(e,t){var n,r,a,u=(r=t,a=i(n=e),g.map(a,(function(e){return{text:f(n,e),onclick:function(){r.set(e),p(n,e)}}})));e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:u,onclick:function(){var n=t.get();p(e,n||o(e))}}),e.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:u,context:"insert"})}(t,n)}))}();