/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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(["error","showing_x_to_y_of_z_users","x_members_y_guests_online"],[]);
(function(a){if(!vBulletin.pageHasSelectors([".wollist-widget",".profileTabs"]))return!1;a(function(){function r(){a(".js-wol-username").each(function(){var c=a(this),b=c.parent().find(".js-wol-userinfo-tooltip");vBulletin.isRtl();b.length&&vBulletin.qtip.apply(c,"qtip-topicpreview",{content:b})})}function t(){a(document).off("click",".js-pagenav .js-pagenav-button").on("click",".js-pagenav .js-pagenav-button",function(c){var b=a(this);c=b.closest(".wollist-widget").data("widget-instance-id");b=b.data("page");
var d=a(".pagenav-form");v.updatePageNavigation(d,b);k(c);return!1})}function k(c,b){var d=a('div.wollist-widget[data-widget-instance-id="'+c+'"]'),m=a('.pagenav-controls :input[name="page"]',d).val(),e=a(".widget-content",d),n=e.data("perpage");c=e.data("thispageonly");var w=e.data("pagekey"),f=e.data("who"),l=e.data("resolve");e=e.data("pagerouteid");f={who:f,pagenumber:m,perpage:n,resolveIp:l,pageRouteId:e};"object"==typeof b?(f.sortfield=b.sortby,f.sortorder=b.sortorder):(l=a(".js-wol-sort-by").filter(function(){return a(this).find(".js-sort-arrow").is(".fa-caret-up, .fa-caret-down")}),
f.sortfield=l.data("sortby"),f.sortorder=l.data("sortorder"));"1"==c&&(f.pagekey=w);a("body").css("cursor","wait");vBulletin.AJAX({call:"/ajax/api/wol/refreshUsers",data:f,complete:function(g,p){console.log("wol-refreshUsers complete.");a("body").css("cursor","auto")},success:function(g,p,h){p=(m-1)*n+1;h=m*n;h=h>g.userCounts.total?g.userCounts.total:h;var u=a(".js-wol-sort-by");"undefined"!=typeof b&&(u.find(".js-sort-arrow").removeClass("fa-caret-up fa-caret-down"),u.each(function(){var q=a(this);
q.data("sortby")==b.sortby?q.find(".js-sort-arrow").addClass("asc"==b.sortorder?"fa-caret-up":"fa-caret-down"):q.data("sortorder","desc")}));a(".widget-content .js-table-content",d).empty().html(g.template);a(".widget-content .user-counters",d).html(vBulletin.phrase.get("showing_x_to_y_of_z_users",p,h,g.userCounts.total));a(".widget-content .user-counts",d).html(vBulletin.phrase.get("x_members_y_guests_online",g.userCounts.members,g.userCounts.guests));r();t()},title_phrase:"online_users",error_phrase:"error_fetching_online_users"})}
var v=new vBulletin.pagination({context:a(".wollist-widget"),onPageChanged:function(c,b){c=a(this).closest(".wollist-widget").data("widget-instance-id");k(c)}});a(".wollist-widget").each(function(){var c=a(this).attr("data-widget-instance-id"),b=parseInt(a(".widget-content",a(this)).attr("data-refresh"));0<b&&window.setInterval(function(){k(c)},1E3*b)});a(document).off("click",".js-wol-sort-by").on("click",".js-wol-sort-by",function(c){c=a(this);var b=c.closest(".wollist-widget").attr("data-widget-instance-id"),
d=c.data("sortorder");d={sortby:c.data("sortby"),sortorder:"desc"==d?"asc":"desc"};c.data("sortorder",d.sortorder);k(b,d)});a(document).off("click",".resolveIpLink").on("click",".resolveIpLink",function(c){c.preventDefault();var b=a(this);vBulletin.AJAX({call:"/ajax/call/bbcode/resolveIp",data:{ip:b.text()},success:function(d){b.replaceWith(d)},complete:function(){a("body").css("cursor","default")}})});r();t()})})(jQuery);
