/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 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   # ||
|| ###################################################################### ||
\*========================================================================*/
vBulletin.precache(["invalid_request","invalid_search_syntax","invalid_server_response_please_try_again","unknown_error"],[]);vBulletin.ensureObj("conversation");
vBulletin.conversation=$.extend(vBulletin.conversation,function(a){let G=window.hasOwnProperty("WeakRef"),H=[];vBulletin.conversation.displaySelectedFilterText=function(p,t,A){var e=a(p);if(1!=e.data("bypass-filter-display")){A=A||e.closest(".conversation-toolbar-wrapper");var x=a(".filtered-by",A).removeClass("h-hide").find(".filter-text-wrapper").show(),u=a(".filter-text[data-filter-name={0}]".format(p.name),x);if("radio"==p.type){t=e.next("span").html();var v=a('<div class="filter-text" data-filter-name="{0}" data-filter-value="{1}"><span title="{2}">{3}</span><span class="js-remove-filter b-icon b-icon__x-circle"></span></div>'.format(p.name,
vBulletin.htmlEntities(p.value),e.closest(".filter-options").prev(".filter-header").html()+" - "+t,("filter_new_topics"==p.name||"filter_depth"==p.name||-1!=p.value.indexOf("_all")&&"time_all"!=p.value?(e.closest("li").find(".filter-header").html()||"")+" - ":"")+t))}else"text"==p.type&&(t="&quot;"+JShtmlEncode(t)+"&quot;",v=a('<div class="filter-text" data-filter-name="{0}" data-filter-value="{1}"><span title="{2}">{3}</span><span class="js-remove-filter b-icon b-icon__x-circle"></span></div>'.format(p.name,
vBulletin.htmlEntities(p.value),e.data("filter-name")+": "+t,t)).data("filter-type","text"),(e=e.attr("class").match(/js-.*/))&&v.data("filter-js-selector","."+e[0]));if(0<u.length)u.replaceWith(v);else{var w=[],b=!1;a(".toolbar-filter-overlay > ul > li",A).each(function(){w.push(a("input:first",this).attr("name"))});a(".filter-text",x).each(function(){var q=a(this);if(a.inArray(p.name,w)<a.inArray(q.attr("data-filter-name"),w))return q.before(v),b=!0,!1});b||x.append(v);1<a(".filter-text",x).length&&
x.next(".clear-all").removeClass("h-hide")}}};return{filter:function(p){function t(c,d=null,g="slow",f=null){var h=c.closest(".conversation-toolbar-wrapper");let k="conversation_filter"+(h.hasClass("bottom")?"bottom":"top"),m=a(".toolbar-filter-overlay",h);var n=a(".filter-wrapper",c),r=n.is(".selected");if(null==d)d=!r;else if(d==r)return;let C=()=>{b.closeOverlayOnScroll&&a(window).offon("scroll."+k,function(){t(c,!1,0,"scroll")})},B=l=>{l=Math.max(Math.min(l,100),0);m.css("clip-path",`polygon(0 0, 100% 0, 100% ${l}%, 0% ${l}%)`)};
n.toggleClass("selected",d);n.attr("aria-expanded",d);a(".js-expanded-indicator",c).toggleClass("fa-caret-down fa-caret-up");B(d?0:100);m.show();r=m.offsetParent();r=r.offset().left+r.outerWidth();n=n.offset().left+n.outerWidth();n=r-n;h=h.find(".conversation-toolbar").outerHeight();m.css("max-height",`calc(100vh - ${h}px)`);m.css("--js-filter-menu-right",`${n}px`);a({step:0}).animate({step:100},{step:(l,y)=>{"step"==y.prop&&B(d?l:100-l)},complete:(()=>{if(d){a("body").offon("click."+k,z=>{z=a(z.target);
0<z.closest(".toolbar-filter-overlay").length||0<z.closest(".toolbar-filter").length||(a("body").off("click."+k),a(window).off("scroll."+k),t(c,!1,"slow"))});var l=!0;if("scroll"!=f){l=a(".filtered-by",b.context);if(0==l.length||l.is(":hidden"))l=c;var y={};(l=vBulletin.isScrolledIntoView(l,y))||a("html,body").animate({scrollTop:"+="+Math.abs(y.bottom)},"fast",function(){setTimeout(function(){C()},50)})}l&&C()}else a("body").off("click."+k),a(window).off("scroll."+k)})(),duration:g})}function A(c,
d){vBulletin.conversation.displaySelectedFilterText(c,d,b.context)}let e=this,x=null,u=0,v=!1,w=!1,b={context:document,autoCheck:!1,checkInterval:15E3,scrollToTop:null,customFilter:null,onContentLoad:null,closeOverlayOnScroll:!1,pagination:null,allowHistory:!1,tabParamAsQueryString:!0,hash:"",beforeApplyFilters:null,afterResetFilters:null};p&&"object"==typeof p&&a.extend(b,p);var q=new vBulletin.history.instance(b.allowHistory);this.closeFilterMenu=()=>{a(".toolbar-filter",b.context).each((c,d)=>
{t(a(d),!1,"fast")})};(function(){a(".toolbar-filter-overlay input[type=radio]",b.context).off("change.conversation_filter").on("change.conversation_filter",function(c,d,g){c=a(this);var f=a(this.form);if(!q.isEnabled()&&b.allowHistory)return c=vBulletin.makePaginatedUrl(location.href,1),location.href=vBulletin.makeFilterUrl(c,this.name,this.value,b.context,b.hash),!0;v=!0;b.customFilter=null;c.data("bypass-filter-display")||A(this);c=c.closest(".conversation-toolbar-wrapper");1<a(".conversation-toolbar-wrapper",
b.context).length&&$toolbarWrappers.filter("."+(c.hasClass("top")?"bottom":"top")).find("input[name={0}][value={1}]".format(this.name,this.value)).prop("checked",!0);"conversations_on"==this.value?(w=b.autoCheck=!0,u=1):(clearTimeout(u),w="filter_show"==this.name);a(".new-conversations-strip",b.context).hide();e.updatePageNumber(g||1);g=a('.filtered-by .filter-text[data-filter-name="q"]',b.context);if(g.length){var h=e.getSelectedFilters(f);h.q=g.data("filter-value");e.setOption("customFilter",h);
e.forceApplyFilters()}else e.applyFilters(!1);q.isEnabled()&&!d&&(h=e.getSelectedFilters(f),f=this.name,g=this.value,d=a(".filtered-by",c),h={from:"filter",page:1,tab:b.tabParamAsQueryString?"#"+c.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(c.closest(".ui-tabs"),!1),filters:h,filtervalue:g,filtername:f},d.data("reset")?(c=location.pathname.replace(/\/page[0-9]+/,""),b.tabParamAsQueryString&&(f=vBulletin.parseQueryString(location.search),f.tab?c+="?tab="+f.tab:f.view&&(c+=
"?view="+f.view))):(c=vBulletin.makePaginatedUrl(location.href,1),c=vBulletin.makeFilterUrl(c,f,g,b.context)),q.pushState(h,document.title,c),d.data("reset",null))});a(".new-conversations-strip",b.context).off("click.conversation_filter").on("click.conversation_filter",function(){a(this).hide();w=!0;e.updatePageNumber(1);e.applyFilters(!1,!0)});a(".toolbar-filter",b.context).offon("click.conversation_filter",(c,d="slow",g=null)=>{t(a(c.currentTarget),null,d,g)});a(".filtered-by",b.context).offon("click.conversation_filter",
".js-remove-filter",function(){var c=a(this),d=c.closest(".filtered-by"),g=c.closest(".filter-text"),f=g.data("filter-name");a();d.data("clicked",!0);if(!q.isEnabled()&&b.allowHistory)return"text"==g.data("filter-type")&&g.data("filter-js-selector")?(d=vBulletin.makePaginatedUrl(location.href,1),location.href=vBulletin.makeFilterUrl(d,"q","",b.context,b.hash,!0)):(d=vBulletin.makePaginatedUrl(location.href,1),location.href=vBulletin.makeFilterUrl(d,f,g.data("filter-value"),b.context,b.hash,!0)),!1;
var h=a(".toolbar-filter-overlay .filter-options input[name={0}]".format(f),b.context).prop("checked",!1).filter(".js-default-checked");e.updatePageNumber(1);if("text"==g.data("filter-type")&&g.data("filter-js-selector")){a(g.data("filter-js-selector")).val("");var k=e.getSelectedFilters(a("form.toolbar-filter-overlay",b.context));delete k[f];e.setOption("customFilter",k)}g.remove();g=d.find(".filter-text").length;0==g?(d.addClass("h-hide"),d.data("reset",!0)):1==g&&d.find(".clear-all").addClass("h-hide");
1==h.length?(h.data("bypass-filter-display",!0),h.trigger("click.conversation_filter"),h.data("bypass-filter-display",null)):(k&&(d=vBulletin.makePaginatedUrl(location.href,1),d=vBulletin.makeFilterUrl(d,"q","",b.context),q.pushState({from:"filter",page:1,tab:b.tabParamAsQueryString?"#"+c.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(c.closest(".ui-tabs"),!1),filters:k},document.title,d)),e.forceApplyFilters(),k&&e.setOption("customFilter",null))});a(".filtered-by",b.context).offon("click.conversation_filter",
".clear-all",function(c){var d=a(this).closest(".conversation-toolbar-wrapper");a(this).data("clicked",!0);e.setOption("customFilter",null);e.resetFilters(!1,!1,d);c.preventDefault()});a(".conversation-toolbar .filter-wrapper",b.context).data("object-instance",e);a(".js-conversation-showmore-button",b.context).off("click").on("click",function(){var c=parseInt(a('form.toolbar-filter-overlay input[name="pagenum"]',b.context).val());w=!1;e.updatePageNumber(c+1);e.applyFilters(!1,!0,!0)});a(".conversation-toolbar .toolbar-search-form",
b.context).off("submit.filtersearch").on("submit.filtersearch",function(){var c=a(this.elements.q),d=a.trim(c.val()),g=a(this).closest(".conversation-toolbar-wrapper");c.val(d);if(!q.isEnabled()&&b.allowHistory){var f=vBulletin.makePaginatedUrl(location.href,1);location.href=vBulletin.makeFilterUrl(f,"q",d,g);return!1}c=b.tabParamAsQueryString?"#"+a(this).closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(a(this).closest(".ui-tabs"),!1);if(d){var h=e.getSelectedFilters(g.find(".toolbar-filter-overlay"));
f={};f.q=d;a.extend(h,f);e.setOption("customFilter",h);e.forceApplyFilters();e.displayCustomFilterText(this.elements.q);q.isEnabled()&&(f=vBulletin.makePaginatedUrl(location.href,1),f=vBulletin.makeFilterUrl(f,"q",d,g),q.pushState({from:"filter",page:1,tab:c,filters:h},document.title,f))}else f=g.find('.filter-text[data-filter-name="{0}"]'.format("q")),f.length&&(h=e.getSelectedFilters(g.find(".toolbar-filter-overlay")),e.setOption("customFilter",h),a(".x",f).trigger("click"),q.isEnabled()&&(f=vBulletin.makePaginatedUrl(location.href,
1),f=vBulletin.makeFilterUrl(f,"q",d,g),q.pushState({from:"filter",page:1,tab:c,filters:h},document.title,f)));return!1})})();this.isFilterSelected=function(c){return a('.toolbar-filter-overlay input[value="'+c+'"]',b.context).is(":checked")};this.getSelectedFilters=function(c){return vBulletin.getSelectedFilters(c,!1)};this.resetFilterForms=function(c){if(!c||c instanceof a&&!c.length)c=b.context;a(".toolbar-filter-overlay .js-default-checked",c).prop("checked",!0);a(".toolbar-search-form .js-filter-search",
c).val("")};a(".toolbar-filter-overlay, .toolbar-search-form",b.context).trigger("reset");if(q.isEnabled()){p=q.getState();if(!p||a.isEmptyObject(p.data)){a(b.context).hasClass("ui-tabs-panel")?a(b.context).attr("id"):a(".conversation-toolbar-wrapper",b.context).closest(".ui-tabs-panel").attr("id");var E={from:"filter",page:Number(a(".pagenav-form .defaultpage",b.context).val())||1,tab:vBulletin.getSelectedTabHashOrPath(a(b.context).closest(".ui-tabs"),b.tabParamAsQueryString),filters:e.getSelectedFilters(a("form.toolbar-filter-overlay",
b.context))};q.setDefaultState(E,document.title,location.href)}q.setStateChange(function(c,d,g){var f=q.getState();if("filter"==f.data.from||"pagination"==d||"tabs"==d){q.log(f.data,f.title,f.url);var h;f.data.tab&&(h=b.tabParamAsQueryString?a(f.data.tab):a('.ui-tabs .ui-tabs-panel[data-url-path="'+f.data.tab+'"]'));c=h&&h.length&&h||b.context;if("pagination"==d){if(g){d=a(".filtered-by",c);var k=a(".toolbar-filter-overlay .filter-options-list",c),m=!1;a(".filter-text",d).filter('[data-filter-name!="q"]').remove();
a(".clear-all",d).addClass("h-hide");k.find(".js-default-checked").prop("checked",!0);a.each(g,function(n,r){n=a('input[name="{0}"][value="{1}"]'.format(n,r),k);n.length&&(n.prop("checked",!0).trigger("change",[!0,f.data.page]),m=!0)});m||(k.first().data("bypass-filter-display",!0).trigger("change",[!0,f.data.page]).data("bypass-filter-display",null),d.addClass("h-hide"))}}else g=a(c).closest(".ui-tabs"),d=b.tabParamAsQueryString?g.find('.ui-tabs-nav > li > a[href*="{0}"]'.format(f.data.tab)):g.find('.ui-tabs-nav > li > a[data-url-path="'+
f.data.tab+'"]'),d.parent().hasClass("ui-tabs-active")?(g=e.getSelectedFilters(a(".toolbar-filter-overlay",c)),d=a(".conversation-toolbar .filter-wrapper",c).data("object-instance")||e,vBulletin.areJsonObjectsEqual(g,f.data.filters)||(d.setOption("context",c),d.updatePageNumber(f.data.page),d.applyHistoryFilters(f.data))):(c=d.parent().index(),vBulletin.selectTabByIndex.call(g,c))}},"filter")}this.displayCustomFilterText=function(c,d){A(c,d||a(c).val())};this.isHistoryEnabled=function(){return q.isEnabled()};
this.resetFilters=function(c,d,g){if(!g||g instanceof a&&!g.length)g=b.context;var f=a(".filtered-by",g).addClass("h-hide"),h=location.pathname.replace(/\/page[0-9]+/,"");if(b.tabParamAsQueryString){var k=vBulletin.parseQueryString(location.search);k.tab?h+="?tab="+k.tab:k.view&&(h+="?view="+k.view)}a(".clear-all",f).addClass("h-hide");a(".filter-text",f).remove();e.resetFilterForms(g);if(!c)if(q.isEnabled()){f.data("reset",!0);e.updatePageNumber(1);k=e.getSelectedFilters(a("form.toolbar-filter-overlay",
g));if(d){var m=a(".toolbar-search-form .js-filter-search",g).val("");delete k[m.attr("name")];e.setOption("customFilter",k)}e.forceApplyFilters();E={from:"filter",page:1,tab:b.tabParamAsQueryString?"#"+f.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(f.closest(".ui-tabs"),!1),filters:k};q.pushState(E,document.title,h)}else b.allowHistory&&(location.href=h);"function"==typeof b.afterResetFilters&&b.afterResetFilters.apply(this,arguments);return e};this.applyHistoryFilters=
function(c){if(c&&c.filters&&!a.isEmptyObject(c.filters)){var d=b.tabParamAsQueryString?a(c.tab):a('.ui-tabs .ui-tabs-panel[data-url-path="'+c.tab+'"]'),g=a(".toolbar-filter-overlay",d);"undefined"!=typeof e.lastFilters&&delete e.lastFilters;e.resetFilters(!0,!1,d);a.each(c.filters,function(m,n){m=a('[name="'+m+'"]',g);"hidden"==m.attr("type")?m.val(n):"radio"==m.attr("type")&&n!=c.filtervalue&&m.filter('[value="'+n+'"]').prop("checked",!0)});var f=vBulletin.parseQueryString(location.href),h=!0,k=
function(){a(".toolbar-search-form .js-filter-search",d).val("")};a.isEmptyObject(f)?k():a.each(f,function(m,n){var r=a('.filter-options-list input[name="{0}"][value="{1}"]'.format(m,n),g);r.length?c.filtername==m&&c.filtervalue==n?(h=!1,r.prop("checked",!0).trigger("change",[!0])):A(r.get(0)):(r=a('.toolbar-search-form .js-toolbar-search-inner input[name="{0}"]'.format(m),d),r.length&&n?(A(r.get(0),n),r.val(n)):k())});h&&(e.setOption("customFilter",c.filters),e.forceApplyFilters(),e.setOption("customFilter",
null))}return e};this.forceApplyFilters=function(){"undefined"!=typeof e.lastFilters&&delete e.lastFilters;w=!0;e.applyFilters(!1,!0);return e};this.applyFilters=function(c,d,g,f){if("function"==typeof b.beforeApplyFilters&&!1===b.beforeApplyFilters.apply(this,arguments))return e;var h=a(".toolbar-filter-overlay",b.context);d&&clearTimeout(u);var k={filters:b.customFilter?b.customFilter:e.getSelectedFilters(h),isAjaxTemplateRender:!0,isAjaxTemplateRenderWithData:!0};if(a.isEmptyObject(k.filters))return e;
c&&(k.filters.checkSince=x,k.filters.pagenum=1);f?w=!0:h.find('input[name="result-id"]').val(0).length&&(k.filters["result-id"]=0);if("undefined"!=typeof this.lastFilters&&vBulletin.areJsonObjectsEqual(this.lastFilters.filters,k.filters)&&!c)return e;this.lastFilters=k;var m=a(".conversation-empty",b.context),n=a(".conversation-toolbar-wrapper",b.context);n.addClass("h-disabled");m.addClass("h-invisible");c&&window.vBulletin.loadingIndicator.suppressNextAjaxIndicator();var r=vBulletin.normalizeAjaxUrl(h.attr("action"))||
vBulletin.getAjaxBaseurl()+"/activity/get",C=h.closest(".conversation-toolbar-wrapper").find('form.pagenav-form input[name="article_display_columns"]');1==C.length&&(k.article_display_columns=C.val());var B=a(".conversation-list",b.context);vBulletin.AJAX({url:r,data:k,api_error:function(l){B.addClass("h-hide");m.removeClass("h-hide h-invisible");return!0},success:function(l){m.addClass("h-hide");if(c)!v&&0<l.total&&!a("body").hasClass("edit-mode")&&(a(".new-conversations-strip span",b.context).html(l.total),
a(".new-conversations-strip",b.context).fadeIn("slow")),0==a(".conversation-list li.list-item",b.context).length&&m.removeClass("h-hide");else{var y=a(".js-conversation-showmore",b.context);a(".new-conversations-strip",b.context).hide();if((0<l.total_with_sticky||0<l.total)&&l.template){l.resultId&&(a('input[name="result-id"]',h).val(l.resultId).length&&this.lastFilters&&(this.lastFilters.filters["result-id"]=l.resultId),b.pagination&&b.pagination.updateResultId(l.resultId));g?B.append(l.template):
(m.addClass("h-hide"),B.html(l.template).removeClass("h-hide"));l.fixFlexGrid&&vBulletin.initFlexGridFixLastRowAll();var z=k.filters,D=parseInt(z.maxpages);z=parseInt(z.pagenum);var F=l.pageinfo;D=D&&z>=D||F&&(z>=parseInt(F.totalpages)||!1===F.showseemore);y.toggleClass("h-hide",D)}else g||(m.removeClass("h-hide"),B.addClass("h-hide").empty());0==l.total_with_sticky&&y.addClass("h-hide");w&&b.scrollToTop&&(y=b.scrollToTop instanceof a?b.scrollToTop:a(b.scrollToTop),0<y.length&&a("body,html").animate({scrollTop:y.offset().top},
"slow"));x=l.lastDate;"function"==typeof b.onContentLoad&&b.onContentLoad.apply(B.get(0),[l]);l.pageinfo&&(e.updatePageNumber(l.pageinfo.pagenumber||1),b.pagination&&"function"==typeof b.pagination.updatePageInfo&&(b.pagination.setOption("context",b.context),b.pagination.updatePageInfo(l.pageinfo,!0)));a(document).trigger("vb-postpagination",{ajaxResult:l});vBulletin.inlinemod&&"function"==typeof vBulletin.inlinemod.init&&0<a(".moderationmenu_container",b.context).length&&vBulletin.inlinemod.init(b.context);
a(document).trigger("vb-filterposts",{parentOfInsertedHtml:B})}v&&(v=!1)},error_phrase:"unable_to_contact_server_please_try_again",complete:function(){n.removeClass("h-disabled");m.removeClass("h-invisible");!v&&b.autoCheck&&u&&(u=setTimeout(e.checkNewConversations,b.checkInterval))}});return e};this.updatePageNumber=function(c){c=Number(c);0<c&&a('form.toolbar-filter-overlay input[name="pagenum"]',b.context).val(c);return e};this.checkNewConversations=function(){a("body").hasClass("edit-mode")||
(console.log("Checking for new activity since "+x),e.applyFilters(!0));return e};this.toggleNewConversations=function(c){c?(b.autoCheck=!0,u=setTimeout(e.checkNewConversations,b.checkInterval)):(b.autoCheck=!1,clearTimeout(u));return e};this.hideFilterOverlay=function(){a(".conversation-toolbar-wrapper .toolbar-filter-overlay",b.context).filter(":visible").each(function(){a(this).prev(".conversation-toolbar").find(".toolbar-filter").triggerHandler("click.conversation_filter",[0])});return e};this.getOption=
function(c){return b[c]};this.setOption=function(c,d){b[c]=d;return e};b.autoCheck&&(x=pageData.current_server_datetime,u=setTimeout(e.checkNewConversations,b.checkInterval));H.push(G?new WeakRef(this):this)},closeFilterMenus:function(){for(const p of H){const t=G?p.deref():p;t&&t.closeFilterMenu()}}}}(jQuery));
