tinymce.ThemeManager.add("modern",function(e){function t(t,n){var r,i=[];if(t)return p(t.split(/[ ,]/),function(t){function o(){function n(e){return function(n,r){for(var i,o=r.parents.length;o--&&(i=r.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(n&&i==e)}}var r=e.selection;"bullist"==a&&r.selectorChanged("ul > li",n("UL")),"numlist"==a&&r.selectorChanged("ol > li",n("OL")),t.settings.stateSelector&&r.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&r.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var a;"|"==t?r=null:h.has(t)?(t={type:t,size:n},i.push(t),r=null):(r||(r={type:"buttongroup",items:[]},i.push(r)),e.buttons[t]&&(a=t,t=e.buttons[a],"function"==typeof t&&(t=t()),t.type=t.type||"button",t.size=n,t=h.create(t),r.items.push(t),e.initialized?o():e.on("init",o)))}),{type:"toolbar",layout:"flow",items:i}}function n(e){function n(n){if(n)return r.push(t(n,e)),!0}var r=[];if(tinymce.isArray(f.toolbar)){if(0===f.toolbar.length)return;tinymce.each(f.toolbar,function(e,t){f["toolbar"+(t+1)]=e}),delete f.toolbar}for(var i=1;i<10&&n(f["toolbar"+i]);i++);if(r.length||f.toolbar===!1||n(f.toolbar||b),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}}function r(){function t(t){var n;return"|"==t?{text:"|"}:n=e.menuItems[t]}function n(n){var r,i,o,a,s;if(s=tinymce.makeMap((f.removed_menuitems||"").split(/[ ,]/)),f.menu?(i=f.menu[n],a=!0):i=y[n],i){r={text:i.title},o=[],p((i.items||"").split(/[ ,]/),function(e){var n=t(e);n&&!s[e]&&o.push(t(e))}),a||p(e.menuItems,function(e){e.context==n&&("before"==e.separator&&o.push({text:"|"}),e.prependToContext?o.unshift(e):o.push(e),"after"==e.separator&&o.push({text:"|"}))});for(var l=0;l=0;r--)for(i=a.length-1;i>=0;i--)if(a[i].predicate(o[r]))return{toolbar:a[i],element:o[r]};return null}var b;e.on("click keyup setContent",function(t){("setcontent"!=t.type||t.selection)&&tinymce.util.Delay.setEditorTimeout(e,function(){var t;t=y(e.selection.getNode()),t?(v(),m(t)):v()})}),e.on("blur hide",v),e.on("ObjectResizeStart",function(){var t=y(e.selection.getNode());t&&t.toolbar.panel&&t.toolbar.panel.hide()}),e.on("nodeChange ResizeEditor ResizeWindow",u),e.on("remove",function(){tinymce.each(n(),function(e){e.panel&&e.panel.remove()}),e.contextToolbars={}}),e.shortcuts.add("ctrl+shift+e > ctrl+shift+p","",function(){var t=y(e.selection.getNode());t&&t.toolbar.panel&&t.toolbar.panel.items()[0].focus()})}function l(e){return function(){e.initialized?e.fire("SkinLoaded"):e.on("init",function(){e.fire("SkinLoaded")})}}function c(t){function o(){if(p&&p.moveRel&&p.visible()&&!p._fixed){var t=e.selection.getScrollContainer(),n=e.getBody(),r=0,i=0;if(t){var o=m.getPos(n),a=m.getPos(t);r=Math.max(0,a.x-o.x),i=Math.max(0,a.y-o.y)}p.fixed(!1).moveRel(n,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(r,i)}}function a(){p&&(p.show(),o(),m.addClass(e.getBody(),"mce-edit-focus"))}function c(){p&&(p.hide(),v.hideAll(),m.removeClass(e.getBody(),"mce-edit-focus"))}function u(){return p?void(p.visible()||a()):(p=d.panel=h.create({type:g?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!g,border:1,items:[f.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:r()},n(f.toolbar_items_size)]}),e.fire("BeforeRenderUI"),p.renderTo(g||document.body).reflow(),i(p),a(),s(),e.on("nodeChange",o),e.on("activate",a),e.on("deactivate",c),void e.nodeChanged())}var p,g;return f.fixed_toolbar_container&&(g=m.select(f.fixed_toolbar_container)[0]),f.content_editable=!0,e.on("focus",function(){t.skinUiCss?tinymce.DOM.styleSheetLoader.load(t.skinUiCss,u,u):u()}),e.on("blur hide",c),e.on("remove",function(){p&&(p.remove(),p=null)}),t.skinUiCss&&tinymce.DOM.styleSheetLoader.load(t.skinUiCss,l(e)),{}}function u(t){function a(){return function(e){"readonly"==e.mode?c.find("*").disabled(!0):c.find("*").disabled(!1)}}var c,u,p;return t.skinUiCss&&tinymce.DOM.styleSheetLoader.load(t.skinUiCss,l(e)),c=d.panel=h.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[f.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:r()},n(f.toolbar_items_size),{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),f.resize!==!1&&(u={type:"resizehandle",direction:f.resize,onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;p={width:t.clientWidth,height:t.clientHeight}},onResize:function(e){"both"==f.resize?o(p.width+e.deltaX,p.height+e.deltaY):o(null,p.height+e.deltaY)}}),f.statusbar!==!1&&c.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:e},u]}),e.fire("BeforeRenderUI"),e.on("SwitchMode",a()),c.renderBefore(t.targetNode).reflow(),f.readonly&&e.setMode("readonly"),f.width&&tinymce.DOM.setStyle(c.getEl(),"width",f.width),e.on("remove",function(){c.remove(),c=null}),i(c),s(),{iframeContainer:c.find("#iframe")[0].getEl(),editorContainer:c.getEl()}}var d=this,f=e.settings,h=tinymce.ui.Factory,p=tinymce.each,m=tinymce.DOM,g=tinymce.geom.Rect,v=tinymce.ui.FloatPanel,y={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},b="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";d.renderUI=function(t){var n=f.skin!==!1&&(f.skin||"lightgray");if(n){var r=f.skin_url;r=r?e.documentBaseURI.toAbsolute(r):tinymce.baseURL+"/skins/"+n,tinymce.Env.documentMode<=7?t.skinUiCss=r+"/skin.ie7.min.css":t.skinUiCss=r+"/skin.min.css",e.contentCSS.push(r+"/content"+(e.inline?".inline":"")+".min.css")}return e.on("ProgressState",function(e){d.throbber=d.throbber||new tinymce.ui.Throbber(d.panel.getEl("body")),e.state?d.throbber.show(e.time):d.throbber.hide()}),f.inline?c(t):u(t)},d.resizeTo=o,d.resizeBy=a});