!function(l){l.ui.FloatPanel.zIndex=100100,l.PluginManager.add("wordpress",function(s){var i,t,P=l.DOM,c=l.each,d=s.editorManager.i18n.translate,a=window.jQuery,o=window.wp,r=o&&o.editor&&o.editor.autop&&s.getParam("wpautop",!0);function e(n){var e,o=0,t="hide"===n;!(e=s.theme.panel?s.theme.panel.find(".toolbar:not(.menubar)"):e)||e.length<2||"hide"===n&&!e[1].visible()||(!n&&e[1].visible()&&(n="hide"),c(e,function(e,t){0/g,function(e,t){return''})),-1!==e.content.indexOf("\x3c!--nextpage--\x3e")&&(n=d("Page break"),e.content=e.content.replace(//g,'')),e.load&&"raw"!==e.format&&r&&(e.content=o.editor.autop(e.content)),e.content=e.content.replace(/

(?: |\u00a0|\uFEFF|\s)+<\/p>/gi,"


"))}),s.on("PostProcess",function(e){e.get&&(e.content=e.content.replace(/]+>/g,function(e){var t,n="";return-1!==e.indexOf('data-wp-more="more"')?e="\x3c!--more"+(n=(t=e.match(/data-wp-more-text="([^"]+)"/))?t[1]:n)+"--\x3e":-1!==e.indexOf('data-wp-more="nextpage"')&&(e="\x3c!--nextpage--\x3e"),e}))}),s.on("ResolveName",function(e){var t;"IMG"===e.target.nodeName&&(t=s.dom.getAttrib(e.target,"data-wp-more"))&&(e.name=t)}),s.addCommand("WP_More",function(e){var t,n="wp-more-tag",o=s.dom,i=s.selection.getNode();n+=" mce-wp-"+(e=e||"more"),t=d("more"===e?"Read more...":"Next page"),e='',"BODY"===i.nodeName||"P"===i.nodeName&&"BODY"===i.parentNode.nodeName?s.insertContent(e):(i=o.getParent(i,function(e){return!(!e.parentNode||"BODY"!==e.parentNode.nodeName)},s.getBody()))&&("P"===i.nodeName?i.appendChild(o.create("p",null,e).firstChild):o.insertAfter(o.create("p",null,e),i),s.nodeChanged())}),s.addCommand("WP_Code",function(){s.formatter.toggle("code")}),s.addCommand("WP_Page",function(){s.execCommand("WP_More","nextpage")}),s.addCommand("WP_Help",function(){var e,t,n=l.Env.mac?d("Ctrl + Alt + letter:"):d("Shift + Alt + letter:"),o=l.Env.mac?d("Cmd + letter:"):d("Ctrl + letter:"),i=[],a=[];function r(e){var n="";return c(e,function(e,t){n+=e?""+t+""+d(e)+"":""}),n+""}c([{c:"Copy",x:"Cut"},{v:"Paste",a:"Select all"},{z:"Undo",y:"Redo"},{b:"Bold",i:"Italic"},{u:"Underline",k:"Insert/edit link"}],function(e){i.push(r(e))}),c([{1:"Heading 1",2:"Heading 2"},{3:"Heading 3",4:"Heading 4"},{5:"Heading 5",6:"Heading 6"},{l:"Align left",c:"Align center"},{r:"Align right",j:"Justify"},{d:"Strikethrough",q:"Blockquote"},{u:"Bullet list",o:"Numbered list"},{a:"Insert/edit link",s:"Remove link"},{m:"Insert/edit image",t:"Insert Read More tag"},{h:"Keyboard Shortcuts",x:"Code"},{p:"Insert Page Break tag",w:"Distraction-free writing mode"}],function(e){a.push(r(e))}),e=""+(e=[d("Letter"),d("Action"),d("Letter"),d("Action")]).join("")+"",t=(t='
')+"

"+d("Default shortcuts,")+" "+o+'

'+e+i.join("")+"

"+d("Additional shortcuts,")+" "+n+'

'+e+a.join("")+"
",t=(t=s.plugins.wptextpattern?(t=t+"

"+d("When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.")+"

"+r({"*":"Bullet list"})+r({"-":"Bullet list"})+r({"1.":"Numbered list"})+r({"1)":"Numbered list"})+"
")+"

"+d("The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.")+"

"+r({">":"Blockquote"})+r({"##":"Heading 2"})+r({"###":"Heading 3"})+r({"####":"Heading 4"})+r({"#####":"Heading 5"})+r({"######":"Heading 6"})+"
":t)+"

"+d("Focus shortcuts:")+"

"+r({"Alt + F8":"Inline toolbar (when an image, link or preview is selected)"})+r({"Alt + F9":"Editor menu (when enabled)"})+r({"Alt + F10":"Editor toolbar"})+r({"Alt + F11":"Elements path"})+"

"+d("To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.")+"

",t+="
",(t=s.windowManager.open({title:"Keyboard Shortcuts",items:{type:"container",classes:"wp-help",html:t},buttons:{text:"Close",onclick:"close"}})).$el&&(t.$el.find('div[role="application"]').attr("role","document"),(t=t.$el.find(".mce-wp-help"))[0]&&(t.attr("tabindex","0"),t[0].focus(),t.on("keydown",function(e){33<=e.keyCode&&e.keyCode<=40&&e.stopPropagation()})))}),s.addCommand("WP_Medialib",function(){o&&o.media&&o.media.editor&&o.media.editor.open(s.id)}),s.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){s.execCommand("WP_More","more")}}),s.addButton("wp_page",{tooltip:"Page break",onclick:function(){s.execCommand("WP_More","nextpage")}}),s.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),s.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),o&&o.media&&o.media.editor&&s.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"}),s.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){s.execCommand("WP_More","more")}}),s.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){s.execCommand("WP_More","nextpage")}}),s.on("BeforeExecCommand",function(e){!l.Env.webkit||"InsertUnorderedList"!==e.command&&"InsertOrderedList"!==e.command||(t=t||s.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}"),s.getDoc().head.appendChild(t))}),s.on("ExecCommand",function(e){l.Env.webkit&&t&&("InsertUnorderedList"===e.command||"InsertOrderedList"===e.command)&&s.dom.remove(t)}),s.on("init",function(){var e=l.Env,t=["mceContentBody"],n=s.getDoc(),o=s.dom;e.iOS&&o.addClass(n.documentElement,"ios"),"rtl"===s.getParam("directionality")&&(t.push("rtl"),o.setAttrib(n.documentElement,"dir","rtl")),e.ie?9===parseInt(e.ie,10)?t.push("ie9"):8===parseInt(e.ie,10)?t.push("ie8"):e.ie<8&&t.push("ie7"):e.webkit&&t.push("webkit"),t.push("wp-editor"),c(t,function(e){e&&o.addClass(n.body,e)}),s.on("BeforeSetContent",function(e){e.content&&(e.content=e.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi,"<$1$2>").replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi,""))}),a&&a(document).triggerHandler("tinymce-editor-init",[s]),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&o.bind(n,"dragstart dragend dragover drop",function(e){a&&a(document).trigger(new a.Event(e))}),s.getParam("wp_paste_filters",!0)&&(l.Env.webkit||s.on("PastePreProcess",function(e){e.content=e.content.replace(/(<[^>]+) style="[^"]*"([^>]*>)/gi,"$1$2"),e.content=e.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi,"$1 style=$2")}),s.on("PastePostProcess",function(e){c(o.select("p",e.node),function(e){o.isEmpty(e)&&o.remove(e)})}))}),s.on("SaveContent",function(e){s.inline||!s.isHidden()?(e.content=e.content.replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"),r&&(e.content=o.editor.removep(e.content))):e.content=e.element.value}),s.on("preInit",function(){s.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b,script[src|async|defer|type|charset|crossorigin|integrity]"),l.Env.iOS&&(s.settings.height=300),c({c:"JustifyCenter",r:"JustifyRight",l:"JustifyLeft",j:"JustifyFull",q:"mceBlockQuote",u:"InsertUnorderedList",o:"InsertOrderedList",s:"unlink",m:"WP_Medialib",z:"WP_Adv",t:"WP_More",d:"Strikethrough",h:"WP_Help",p:"WP_Page",x:"WP_Code"},function(e,t){s.shortcuts.add("access+"+t,"",e)}),s.addShortcut("meta+s","",function(){o&&o.autosave&&o.autosave.server.triggerSave()})}),s.on("preinit",function(){var n,f,t,w,b,v,r=l.ui.Factory,d=s.settings,e=s.getContainer(),y=document.getElementById("wpadminbar"),C=document.getElementById(s.id+"_ifr");function o(e){n&&(n.hide(),"hide"===e.type?n=!1:"resize"!==e.type&&"scroll"!==e.type||(clearTimeout(t),t=setTimeout(function(){n&&"function"==typeof n.show&&n.show()},250)))}e&&(w=l.$(".mce-toolbar-grp",e)[0],b=l.$(".mce-statusbar",e)[0]),"content"===s.id&&(v=document.getElementById("post-status-info")),s.shortcuts.add("alt+119","",function(){var e;n&&(e=n.find("toolbar")[0])&&e.focus(!0)}),s.on("nodechange",function(e){var t=s.selection.isCollapsed(),t={element:e.element,parents:e.parents,collapsed:t};s.fire("wptoolbar",t),f=t.selection||t.element,n&&n.hide(),t.toolbar?(n=t.toolbar).show():n=!1}),s.on("focus",function(){n&&n.show()}),P.bind(window,"resize scroll",o),s.dom.bind(s.getWin(),"resize scroll",o),s.on("remove",function(){P.unbind(window,"resize scroll",o),s.dom.unbind(s.getWin(),"resize scroll",o)}),s.on("blur hide",o),s.wp=s.wp||{},s.wp._createToolbar=function(e,t){var n,o,a=[];return c(e,function(i){var t;function e(){var e=s.selection;"bullist"===t&&e.selectorChanged("ul > li",function(e,t){for(var n,o=t.parents.length;o--&&"OL"!==(n=t.parents[o].nodeName)&&"UL"!=n;);i.active(e&&"UL"===n)}),"numlist"===t&&e.selectorChanged("ol > li",function(e,t){for(var n,o=t.parents.length;o--&&"OL"!==(n=t.parents[o].nodeName)&&"UL"!==n;);i.active(e&&"OL"===n)}),i.settings.stateSelector&&e.selectorChanged(i.settings.stateSelector,function(e){i.active(e)},!0),i.settings.disabledStateSelector&&e.selectorChanged(i.settings.disabledStateSelector,function(e){i.disabled(e)})}"|"===i?o=null:r.has(i)?(i={type:i},d.toolbar_items_size&&(i.size=d.toolbar_items_size),a.push(i),o=null):(o||(o={type:"buttongroup",items:[]},a.push(o)),s.buttons[i]&&(t=i,(i="function"==typeof(i=s.buttons[t])?i():i).type=i.type||"button",d.toolbar_items_size&&(i.size=d.toolbar_items_size),i=r.create(i),o.items.push(i),s.initialized?e():s.on("init",e)))}),(n=r.create({type:"panel",layout:"stack",classes:"toolbar-grp inline-toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:[{type:"toolbar",layout:"flow",items:a}]})).bottom=t,n.on("show",function(){this.reposition()}),n.on("keydown",function(e){27===e.keyCode&&(this.hide(),s.focus())}),s.on("remove",function(){n.remove()}),n.reposition=function(){if(!f)return this;var e,t=window.pageXOffset||document.documentElement.scrollLeft,n=window.pageYOffset||document.documentElement.scrollTop,o=window.innerWidth,i=window.innerHeight,a=C?C.getBoundingClientRect():{top:0,right:o,bottom:i,left:0,width:o,height:i},r=this.getEl(),d=r.offsetWidth,s=r.offsetHeight,c=f.getBoundingClientRect(),l=(c.left+c.right)/2,m=s+8+5,p=y?y.getBoundingClientRect().bottom:0,u=w?w.getBoundingClientRect().bottom:0,g=b?i-b.getBoundingClientRect().top:0,h=v?i-v.getBoundingClientRect().top:0,p=Math.max(0,p,u,a.top),u=Math.max(0,g,h,i-a.bottom),g=c.top+a.top-p,h=i-a.top-c.bottom-u,i=i-p-u,u="";return i<=g||i<=h?this.hide():(this.bottom?m<=h?(u=" mce-arrow-up",e=c.bottom+a.top+n):m<=g&&(u=" mce-arrow-down",e=c.top+a.top+n-s-8):m<=g?(u=" mce-arrow-down",e=c.top+a.top+n-s-8):m<=h&&i/2>c.bottom+a.top-p&&(u=" mce-arrow-up",e=c.bottom+a.top+n),void 0===e&&(e=n+p+5),l=l-d/2+a.left+t,c.left<0||c.right>a.width?l=a.left+t+(a.width-d)/2:o<=d?(u+=" mce-arrow-full",l=0):l<0&&c.left+d>o||oa.width+a.left+t&&(u+=" mce-arrow-right",l=c.right-d+a.left+t),r.className=r.className.replace(/ ?mce-arrow-[\w]+/g,"")+u,P.setStyles(r,{left:l,top:e}),this)},n.hide().renderTo(document.body),n}},!0),{_showButtons:n,_hideButtons:n,_setEmbed:n,_getEmbed:n}})}(window.tinymce);