window.wp=window.wp||{},function(a,b){function c(){function c(){!w&&window.tinymce&&(w=window.tinymce,x=w.$,x(document).on("click",function(a){var b,c,d=x(a.target);d.hasClass("wp-switch-editor")&&(b=d.attr("data-wp-editor-id"),c=d.hasClass("switch-tmce")?"tmce":"html",e(b,c))}))}function d(a){var b=x(".mce-toolbar-grp",a.getContainer())[0],c=b&&b.clientHeight;return c&&c>10&&c<200?parseInt(c,10):30}function e(a,b){a=a||"content",b=b||"toggle";var c,e,f,g=w.get(a),h=x("#wp-"+a+"-wrap"),i=x("#"+a),j=i[0];if("toggle"===b&&(b=g&&!g.isHidden()?"html":"tmce"),"tmce"===b||"tinymce"===b){if(g&&!g.isHidden())return!1;"undefined"!=typeof window.QTags&&window.QTags.closeAllTags(a),c=parseInt(j.style.height,10)||0;var k=!1;k=g?g.getParam("wp_keep_scroll_position"):window.tinyMCEPreInit.mceInit[a]&&window.tinyMCEPreInit.mceInit[a].wp_keep_scroll_position,k&&l(i),g?(g.show(),!w.Env.iOS&&c&&(e=d(g),c=c-e+14,c>50&&c<5e3&&g.theme.resizeTo(null,c)),g.getParam("wp_keep_scroll_position")&&m(g)):w.init(window.tinyMCEPreInit.mceInit[a]),h.removeClass("html-active").addClass("tmce-active"),i.attr("aria-hidden",!0),window.setUserSetting("editor","tinymce")}else if("html"===b){if(g&&g.isHidden())return!1;if(g){w.Env.iOS||(f=g.iframeElement,c=f?parseInt(f.style.height,10):0,c&&(e=d(g),c=c+e-14,c>50&&c<5e3&&(j.style.height=c+"px")));var n=null;g.getParam("wp_keep_scroll_position")&&(n=q(g)),g.hide(),n&&r(g,n)}else i.css({display:"",visibility:""});h.removeClass("tmce-active").addClass("html-active"),i.attr("aria-hidden",!1),window.setUserSetting("editor","html")}}function f(a,b){var c=a.lastIndexOf("<",b-1),d=a.lastIndexOf(">",b);if(c>d||">"===a.substr(b,1)){var e=a.substr(c),f=e.match(/<\s*(\/)?(\w+)/);if(!f)return null;var g=f[2],h=e.indexOf(">");return{ltPos:c,gtPos:c+h+1,tagType:g,isClosingTag:!!f[1]}}return null}function g(a,b){for(var c=i(a),d=0;d=e.startIndex&&b<=e.endIndex)return e}}function h(a){var b=a.match(/\[+([\w_-])+/g),c=[];if(b)for(var d=0;d)(https?:\\/\\/[^s"]+?)(<\\/p>s*|[\\n\\r][\\n\\r]|$)',"gi");e=j.exec(a);)c={shortcodeName:"url",showAsPlainText:!1,startIndex:e.index,endIndex:e.index+e[0].length,length:e[0].length,urlAtStartOfContent:""===e[1],urlAtEndOfContent:""===e[3]},g.push(c);return g}function j(a,b){return a("").css({display:"inline-block",width:0,overflow:"hidden","line-height":0}).html(b?b:"")}function k(a,b){var c=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],d=b.cursorStart,e=b.cursorEnd,h=f(a,d);h&&(d=c.indexOf(h.tagType)!==-1?h.ltPos:h.gtPos);var i=f(a,e);i&&(e=i.gtPos);var j=g(a,d);j&&!j.showAsPlainText&&(d=j.urlAtStartOfContent?j.endIndex:j.startIndex);var k=g(a,e);return k&&!k.showAsPlainText&&(e=k.urlAtEndOfContent?k.startIndex:k.endIndex),{cursorStart:d,cursorEnd:e}}function l(a){if(a&&a.length){var b=a[0],c=b.value,d=k(c,{cursorStart:b.selectionStart,cursorEnd:b.selectionEnd}),e=d.cursorStart,f=d.cursorEnd,g=e!==f?"range":"single",h=null,i=j(x,"").attr("data-mce-type","bookmark");if("range"===g){var l=b.value.slice(e,f),m=i.clone().addClass("mce_SELRES_end");h=[l,m[0].outerHTML].join("")}b.value=[b.value.slice(0,e),i.clone().addClass("mce_SELRES_start")[0].outerHTML,h,b.value.slice(f)].join("")}}function m(a){var b=a.$(".mce_SELRES_start").attr("data-mce-bogus",1),c=a.$(".mce_SELRES_end").attr("data-mce-bogus",1);if(b.length)if(a.focus(),c.length){var d=a.getDoc().createRange();d.setStartAfter(b[0]),d.setEndBefore(c[0]),a.selection.setRng(d)}else a.selection.select(b[0]);a.getParam("wp_keep_scroll_position")&&o(a,b),n(b),n(c),a.save()}function n(a){var b=a.parent();a.remove(),!b.is("p")||b.children().length||b.text()||b.remove()}function o(b,c){var e,f=b.$(c).offset().top,g=b.$(b.getContentAreaContainer()).offset().top,h=d(b),i=a("#wp-content-editor-tools"),j=0,k=0;i.length&&(j=i.height(),k=i.offset().top);var l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,m=g+f,n=l-(j+h);if(!(m(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

")}function q(a){var b=a.getWin(),c=b.getSelection();if(c&&!(c.rangeCount<1)){var d="SELRES_"+Math.random(),e=j(a.$,d),f=e.clone().addClass("mce_SELRES_start"),g=e.clone().addClass("mce_SELRES_end"),h=c.getRangeAt(0),i=h.startContainer,k=h.startOffset,l=h.cloneRange();a.$(i).parents(".mce-offscreen-selection").length>0?(i=a.$("[data-mce-selected]")[0],f.attr("data-mce-object-selection","true"),g.attr("data-mce-object-selection","true"),a.$(i).before(f[0]),a.$(i).after(g[0])):(l.collapse(!1),l.insertNode(g[0]),l.setStart(i,k),l.collapse(!0),l.insertNode(f[0]),h.setStartAfter(f[0]),h.setEndBefore(g[0]),c.removeAllRanges(),c.addRange(h)),a.on("GetContent",p);var m=s(a.getContent());a.off("GetContent",p),f.remove(),g.remove();var n=new RegExp(']*\\s*class="mce_SELRES_start"[^>]+>\\s*'+d+"[^<]*<\\/span>(\\s*)"),o=new RegExp('(\\s*)]*\\s*class="mce_SELRES_end"[^>]+>\\s*'+d+"[^<]*<\\/span>"),q=m.match(n),r=m.match(o);if(!q)return null;var t=q.index,u=q[0].length,v=null;if(r){q[0].indexOf("data-mce-object-selection")!==-1&&(u-=q[1].length);var w=r.index;r[0].indexOf("data-mce-object-selection")!==-1&&(w-=r[1].length),v=w-u}return{start:t,end:v}}}function r(a,b){if(b){var c=a.getElement(),d=b.start,e=b.end||b.start;c.focus&&setTimeout(function(){c.setSelectionRange(d,e),c.blur&&c.blur(),c.focus()},100)}}function s(a){var b="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",c=b+"|div|p",d=b+"|pre",e=!1,f=!1,g=[];return a?(a.indexOf("]*>[\s\S]*?<\/\1>/g,function(a){return g.push(a),""})),a.indexOf("]*>[\s\S]+?<\/pre>/g,function(a){return a=a.replace(/
(\r\n|\n)?/g,""),a=a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,""),a.replace(/\r?\n/g,"")})),a.indexOf("[caption")!==-1&&(f=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")})),a=a.replace(new RegExp("\\s*\\s*","g"),"\n"),a=a.replace(new RegExp("\\s*<((?:"+c+")(?: [^>]*)?)>","g"),"\n<$1>"),a=a.replace(/(

]+>.*?)<\/p>/g,"$1"),a=a.replace(/]*)?>\s*

/gi,"\n\n"),a=a.replace(/\s*

/gi,""),a=a.replace(/\s*<\/p>\s*/gi,"\n\n"),a=a.replace(/\n[\s\u00a0]+\n/g,"\n\n"),a=a.replace(/(\s*)
\s*/gi,function(a,b){return b&&b.indexOf("\n")!==-1?"\n\n":"\n"}),a=a.replace(/\s*

\s*/g,"
\n"),a=a.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n"),a=a.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption"),a=a.replace(new RegExp("\\s*<((?:"+d+")(?: [^>]*)?)\\s*>","g"),"\n<$1>"),a=a.replace(new RegExp("\\s*\\s*","g"),"\n"),a=a.replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>"),a.indexOf("/g,"\n")),a.indexOf("]*)?>\s*/g,"\n\n\n\n")),a.indexOf("/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<\/p#>/g,"

\n"),a=a.replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1"),a=a.replace(/^\s+/,""),a=a.replace(/[\s\u00a0]+$/,""),e&&(a=a.replace(//g,"\n")),f&&(a=a.replace(/]*)>/g,"")),g.length&&(a=a.replace(//g,function(){return g.shift()})),a):""}function t(a){var b=!1,c=!1,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary";return a=a.replace(/\r\n|\r/g,"\n"),a.indexOf("/g,function(a){return a.replace(/\n+/g,"")})),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\n\t ]+/g," ")}),a.indexOf("]*>[\s\S]*?<\/\1>/g,function(a){return a.replace(/\n/g,"")})),a.indexOf("]*>)/g,"$1"),a=a.replace(/<\/figcaption>\s*/g,"")),a.indexOf("[caption")!==-1&&(c=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a=a.replace(/]*)>/g,""),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\n\t ]+/," ")}),a.replace(/\s*\n\s*/g,"")})),a+="\n\n",a=a.replace(/
\s*
/gi,"\n\n"),a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n\n$1"),a=a.replace(new RegExp("()","gi"),"$1\n\n"),a=a.replace(/]*)?>/gi,"\n\n"),a=a.replace(/\s*"),a=a.replace(/\n\s*\n+/g,"\n\n"),a=a.replace(/([\s\S]+?)\n\n/g,"

$1

\n"),a=a.replace(/

\s*?<\/p>/gi,""),a=a.replace(new RegExp("

\\s*(]*)?>)\\s*

","gi"),"$1"),a=a.replace(/

(/gi,"$1"),a=a.replace(/

\s*]*)>/gi,"

"),a=a.replace(/<\/blockquote>\s*<\/p>/gi,"

"),a=a.replace(new RegExp("

\\s*(]*)?>)","gi"),"$1"),a=a.replace(new RegExp("(]*)?>)\\s*

","gi"),"$1"),a=a.replace(/(]*>)\s*\n/gi,"$1"),a=a.replace(/\s*\n/g,"
\n"),a=a.replace(new RegExp("(]*>)\\s*
","gi"),"$1"),a=a.replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1"),a=a.replace(/(?:

|
)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|
)*/gi,"[caption$1[/caption]"),a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(a,b,c){return c.match(/]*)?>/)?a:b+"

"+c+"

"}),b&&(a=a.replace(//g,"\n")),c&&(a=a.replace(/]*)>/g,"")),a}function u(b){var c={o:y,data:b,unfiltered:b};return a&&a("body").trigger("beforePreWpautop",[c]),c.data=s(c.data),a&&a("body").trigger("afterPreWpautop",[c]),c.data}function v(b){var c={o:y,data:b,unfiltered:b};return a&&a("body").trigger("beforeWpautop",[c]),c.data=t(c.data),a&&a("body").trigger("afterWpautop",[c]),c.data}var w,x,y={};return a(document).on("tinymce-editor-init.keep-scroll-position",function(a,b){b.$(".mce_SELRES_start").length&&m(b)}),a?a(document).ready(c):document.addEventListener?(document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1)):window.attachEvent&&(window.attachEvent("onload",c),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()})),b.editor.autop=v,b.editor.removep=u,y={go:e,wpautop:v,pre_wpautop:u,_wp_Autop:t,_wp_Nop:s}}b.editor=b.editor||{},window.switchEditors=new c,b.editor.initialize=function(c,d){var e,f;if(a&&c&&b.editor.getDefaultSettings){if(f=b.editor.getDefaultSettings(),d||(d={tinymce:!0}),d.tinymce&&d.quicktags){var g=a("#"+c),h=a("
").attr({"class":"wp-core-ui wp-editor-wrap tmce-active",id:"wp-"+c+"-wrap"}),i=a('
'),j=a("