/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.5.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2019 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["more_options"]);window.vBulletin.CompMenuHorizontal=window.vBulletin.CompMenuHorizontal||{};window.vBulletin.jsexec=window.vBulletin.jsexec||{};window.vBulletin.jsexec.css_b_comp_menu_horizontal=window.vBulletin.jsexec.css_b_comp_menu_horizontal||{exec:0,init:0};window.vBulletin.jsexec.css_b_comp_menu_horizontal.exec++;(function(F){var N=[];function A(U,S,T){function W(X,Y){if(X.is("."+Y)){X.removeClass(Y);var Z=X.data("removed-classes")||[];if(F.inArray(Y,Z)==-1){Z.push(Y)}X.data("removed-classes",Z)}}function V(X,Z){if(!X.is("."+Z)){X.addClass(Z);var Y=X.data("added-classes")||[];if(F.inArray(Z,Y)==-1){Y.push(Z)}X.data("added-classes",Y)}}U.each(function(){var X=F(this);F.each(S,function(Y,Z){W(X,Z)});F.each(T,function(Y,Z){V(X,Z)})})}function L(S){S.each(function(){var T=F(this),V=T.data("added-classes")||[],U=T.data("removed-classes")||[];if(V.length){T.removeClass(V.join(" "))}if(U.length){T.addClass(U.join(" "))}})}function G(S){N.push(S)}function C(S,T,U){F.each(N,function(V,W){W(S,T,U)})}function J(U,V,W){if(!U.is(".js-comp-menu-dropdown__content--main-menu")){return }if(W=="dropdown"){var T=U.find(".current").addClass("b-comp-menu-dropdown__content-item--current");V.addClass("b-comp-menu-dropdown--main-menu").find(".js-comp-menu-dropdown__trigger").addClass("b-comp-menu-dropdown__trigger--icon-trigger").html('<span class="b-icon b-icon__hamburger b-comp-menu-dropdown__trigger-icon"></span>');U.find("li").first().addClass("b-comp-menu-dropdown__content-item--divider");var S='<li class="js-search-item b-comp-menu-dropdown__content-item--no-hover js-comp-menu-dropdown__content-maintain-menu"><form action="'+F("#searchForm").attr("action")+'"><input type="text" autocomplete="off" class="b-form-input__input search-term" placeholder="'+vBulletin.phrase.get("search")+'..." name="q"><button title="'+vBulletin.phrase.get("search")+'" class="search-btn" type="submit"><span class="b-icon b-icon__search b-icon--show-on-xsmall"></span></button></form></li><li class="js-search-item"><a href="'+pageData.baseurl+'/search">'+vBulletin.phrase.get("advanced_search")+"</a></li>";F(S).prependTo(U);F(".js-channel-subtabbar-list li").addClass("js-subtabbar-item b-comp-menu-dropdown__content-item--indent1").insertAfter(T);F(".js-channel-subtabbar").addClass("h-hide")}else{U.find("li").removeClass("b-comp-menu-dropdown__content-item--divider b-comp-menu-dropdown__content-item--current b-comp-menu-dropdown__content-item--indent1");U.find(".js-search-item").remove();U.find(".js-subtabbar-item").appendTo(F(".js-channel-subtabbar-list"));F(".js-channel-subtabbar").removeClass("h-hide")}}function D(S,T,U){if(!S.is(".js-footer-nav-list")){return }if(U=="dropdown"){A(S,["h-right"],[]);A(T,[],["js-select-on-xsmall"]);var V=F("<li></li>").append(T).appendTo(".js-footer-chooser-list");S.data("vb-remove-li",V)}else{S.insertAfter(".js-footer-chooser-list");S.data("vb-remove-li").remove()}}function I(T,V,W){if(W=="dropdown"){var X=T.find(".js-comp-menu--exclude-from-dropdown");if(X.length>0){var S=F("<ul />").addClass(T.get(0).className).removeClass("js-comp-menu-horizontal js-comp-menu--dropdown-on-xsmall js-comp-menu--dropdown-on-small b-comp-menu-dropdown--inactive").insertAfter(V);T.data("vb-exclude-item-container",S);X.each(function(Y,Z){var a=F(this);F("<li />").addClass("js-excluded-item-marker h-hide-imp").data("vb-excluded-item",a).insertAfter(a)});X.appendTo(S)}}else{var S=T.data("vb-exclude-item-container"),U=T.find(".js-excluded-item-marker");if(S&&S.length&&S.length>0&&U.length>0){U.each(function(Y,a){var Z=F(this);Z.data("vb-excluded-item").insertAfter(Z)});U.remove();T.data("vb-exclude-item-container",false);S.remove()}}}function B(S,b,a){if(!S.is(".js-module-tab-menu")){return }var X=S.closest(".widget-tabs-nav, .js-widget-tabs-nav"),V=X.find(".module-title, .js-module-title"),T=S.find("li"),U=T.filter(".ui-state-active"),c=S.find("a");X.addClass("js-widget-tabs-nav");V.addClass("js-module-title");function Y(f){var d=F(this),g=d.closest("li");T.removeClass("b-comp-menu-dropdown__content-item--current ui-tabs-active ui-state-active ui-state-hover ui-state-default");g.addClass("b-comp-menu-dropdown__content-item--current")}if(a=="dropdown"){if(S.is(".js-profile-tabs-nav")||S.is(".js-subscribe-tabs-nav")){var Z=F("<div />").addClass("js-profile-menu-wrapper widget-tabs-nav").insertAfter(S).append(b).append(S)}A(S,["ui-tabs-nav","ui-helper-reset","ui-helper-clearfix","ui-widget-header","ui-corner-all"],[]);A(b,[],["js-select-when-dropdown"]);A(X,["widget-tabs-nav"],["widget-tabs-nav-background"]);A(V,["module-title"],[]);A(T,["ui-helper-reset","ui-helper-clearfix","ui-widget-header","ui-corner-all","ui-corner-bottom","ui-corner-top","ui-corner-right","ui-corner-left","ui-corner-br","ui-corner-bl","ui-corner-tr","ui-corner-tl"],[]);A(c,["ui-tabs-anchor","h-block"],[]);if(U.length){U.addClass("b-comp-menu-dropdown__content-item--current")}else{setTimeout(function(){var f=T.filter(".ui-state-active");f.addClass("b-comp-menu-dropdown__content-item--current");var d=S.next(".vb-select-el"),e=0;if(d&&d.length){T.each(function(h,i){e=h;if(F(i).is(".ui-state-active")){return false}});var g=d.is(".selectBox");if(g){d.selectBox("destroy")}d.find(".js-noop-label").remove();d.get(0).selectedIndex=e;if(g){d.selectBox()}}},0)}T.removeClass("ui-state-default ui-tabs-active ui-state-active ui-state-hover");c.off("click.vbmoduletabs").on("click.vbmoduletabs",Y);b.data("add-classes-to-select-el","h-margin-vert-m h-margin-horiz-xl")}else{T.filter(function(){return(F(this).attr("aria-selected")=="true")}).removeClass("b-comp-menu-dropdown__content-item--current").addClass("ui-tabs-active ui-state-active");c.off("click.vbmoduletabs");L(X);L(V);var W=S.parent();if(W.is(".js-profile-menu-wrapper")){S.insertAfter(W);b.insertAfter(W);W.remove()}}}function Q(T,X,Z){if(!T.is(".js-tabbed-pane__tabs")){return }var S=T.find("li"),Y=S.filter(".b-tabbed-pane__tab--selected"),U=T.find("a");if(Z=="dropdown"){var V=F("<div />").addClass("js-tabbed-pane__tabs-wrapper b-tabbed-pane_tabs b-tabbed-pane__tabs--standard").insertAfter(T).append(X).append(T);A(T.parent(),[],["js-comp-menu-dropdown__content"]);A(X,[],["js-select-when-dropdown"]);A(S,[],["b-comp-menu-dropdown__content-item"]);Y.addClass("b-comp-menu-dropdown__content-item--current");X.data("add-classes-to-select-el","h-margin-horiz-xl h-margin-vert-m")}else{S.removeClass("b-comp-menu-dropdown__content-item--current");var W=T.parent();if(W.is(".js-tabbed-pane__tabs-wrapper")){T.insertAfter(W);X.insertAfter(W);W.remove()}}}function E(T,V,X){if(!T.is(".js-groupblog-admin-menu")){return }var U=T.closest(".js-blog-admin-left"),S=T.find("li"),W=S.filter(".sgAdminActive, .blogAdminActive");if(X=="dropdown"){A(V,[],["js-select-on-xsmall"]);W.addClass("b-comp-menu-dropdown__content-item--current")}else{}}function R(U,V,W){if(!U.is(".js-sharing-menu")){return }var T=U.find("li");if(W=="dropdown"){var S=U.prevAll(".userinfo");if(S.length==1){V.appendTo(S);U.data("vb-moved-to-userinfo","1")}A(U,["b-sharing-menu--horizontal"],[]);A(V,[],["h-align-bottom"]);A(T,[],["b-comp-menu-dropdown__content-item--no-hover","js-comp-menu-dropdown__content-maintain-menu"])}else{if(U.data("vb-moved-to-userinfo")=="1"){var S=V.parent(".userinfo");U.insertAfter(S).data("vb-moved-to-userinfo","0")}L(T)}}function P(S,W){if(W=="dropdown"){var a=S.data("dropdown-icon-classes")||"",f=a?" b-comp-menu-dropdown__trigger--icon-trigger":"",X=(S.data("dropdown-trigger-classes")||"")+f,e=S.data("dropdown-trigger-phrase")||"more_options",Y=S.data("dropdown-menu-classes")||"",Z=F('<div class="b-comp-menu-dropdown js-comp-menu-dropdown '+Y+'"> <div class="b-comp-menu-dropdown__trigger js-comp-menu-dropdown__trigger js-button '+X+'" tabindex="0"> <span class="'+a+' b-comp-menu-dropdown__trigger-icon"> '+vBulletin.phrase.get(e)+" </span>  </div> </div>");Z.insertAfter(S);C(S,Z,W);var T=S.find("li"),c=S.find("a");var V=["h-right","h-left"];F.each(V,function(g,h){if(S.is("."+h)){Z.addClass(h)}});var d=S.data("dropdown-content-classes"),b=["b-comp-menu-dropdown__content","js-comp-menu-dropdown__content"];if(d){d=d.split(" ")}else{d=[]}F.each(d,function(g,h){b.push(h)});A(S,["h-margin-top-s","h-right","b-comp-menu-horizontal","channel-tabbar-list","h-hide-on-small","nav-list"],b);A(T,["h-margin-top-xs","b-post-control","b-post-control--responsive"],["b-comp-menu-dropdown__content-item"]);A(c,["h-left"],["h-block"]);S.appendTo(Z);vBulletin.CompMenuDropdown.init()}else{vBulletin.CompMenuDropdown.updateMenuAsSelectElement();var T=S.find("li"),c=S.find("a");L(S);L(T);L(c);var Z=S.closest(".js-comp-menu-dropdown");vBulletin.CompMenuDropdown.setMenuColumnCount(Z,S,1);S.removeClass("b-comp-menu-dropdown__content--left b-comp-menu-dropdown__content--right");S.insertAfter(Z);C(S,Z,W);var U=S.next(".vb-select-el");if(U&&U.length){U.selectBox("destroy").remove()}Z.remove()}}function K(T,S){M()}function H(T){var S=[T,T.parent()],V=false;F.each(S,function(W,X){if(X.is(".js-shrink-event-parent")){var Y=vBulletin.Responsive.Debounce.checkElementShrinkRequirement(X);if(Y=="need_shrink"){V=true;return false}}});if(T.is(".js-comp-menu-dropdown__content--main-menu")&&!V){var U=vBulletin.Responsive.Debounce.checkElementShrinkRequirement(F(".js-channel-subtabbar-list"));if(U=="need_shrink"){V=true}}return V}function M(){var T=F(".js-comp-menu-horizontal");if(T.length){var V=F("body"),U=V.is(".l-small"),S=V.is(".l-xsmall");T.each(function(W){var a=F(this),Z=a.find("li").not(".b-post-control--disabled").length,c=true,b=false;if(a.data("is-dropdown-menu")){var Y=a.closest(".js-comp-menu-dropdown");if(Y.is(".b-comp-menu-dropdown--open")){c=false}}if(c){if(a.data("is-dropdown-menu")){P(a,"horizontal");a.data("is-dropdown-menu","")}b=H(a)}var X=((U&&a.is(".js-comp-menu--dropdown-on-small"))||(S&&a.is(".js-comp-menu--dropdown-on-xsmall"))||b);if(X&&Z>0){if(!a.data("is-dropdown-menu")){P(a,"dropdown");a.data("is-dropdown-menu","1")}}else{if(a.data("is-dropdown-menu")){P(a,"horizontal");a.data("is-dropdown-menu","")}}})}}function O(){G(J);G(D);G(I);G(B);G(Q);G(E);G(R);M();if(window.vBulletin.jsexec.css_b_comp_menu_horizontal.init<1){vBulletin.Responsive.Debounce.registerCallback(M);F(document).on("vb-loadnewposts",K);F(document).on("vb-filterposts",K)}window.vBulletin.jsexec.css_b_comp_menu_horizontal.init++}vBulletin.CompMenuHorizontal.registerMenuChangeFilter=G;vBulletin.CompMenuHorizontal.checkHorizontalMenuState=M;F(O)})(jQuery);