/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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   # ||
|| ###################################################################### ||
\*========================================================================*/
(function(a){function m(){var k=function(){a("tbody.pricing").each(function(b){var d=a(this);a(":input",d).each(function(){var c=a(this),e=c.attr("name"),f=c.attr("id");"undefined"!==typeof f&&c.attr("id",f.replace(/\d+/,b));"undefined"!==typeof e&&c.attr("name",e.replace(/\d+/,b))});a("div",d).each(function(){var c=a(this).attr("id");"undefined"!==typeof c&&a(this).attr("id",c.replace(/\d+/,b))});a(".currency",d).data("index",b);a(".pricingindex",d).text(b+1)});1==a("tbody.pricing").length?a("a.delete_pricing").addClass("hide"):
a("a.delete_pricing").removeClass("hide")};a(document).on("click","a.new_pricing",function(){var b=a(this).closest("tbody"),d=b.clone();d.find(":input").val("");d.insertAfter(b);k();return!1});a(document).on("click","a.delete_pricing",function(){a(this).closest("tbody").remove();k();return!1});var h,g=function(b){h||(h=a("select.currency",b).eq(0).find("option"));var d=[];a("select.currency",b).each(function(){var c=a(this),e=c.val();a(this).empty();h.each(function(){c.append(a(this).clone())});c.val(e);
c.closest("div.pricerow").find("input.cost").attr("name","sub[time]["+c.data("index")+"][cost]["+e+"]");d.push(e)});a("select.currency",b).each(function(){var c=a(this).val();a("option",a(this)).each(function(){-1!=a.inArray(a(this).val(),d)&&a(this).val()!=c&&a(this).remove()})})},l=function(b){1==a(".pricerow",b).length?a("a.removeprice",b).addClass("hide"):a("a.removeprice",b).removeClass("hide")};a("tbody.pricing").each(function(){g(a(this))});a(document).on("change","select.currency",function(){a(this).closest("div.pricerow").find("input.cost").attr("name",
"sub[time]["+a(this).data("index")+"][cost]["+a(this).val()+"]");g(a(this).closest("td"))});a(document).on("click","a.addmoreprices",function(){var b=a(this).closest("td"),d=b.find("div.pricerow").last(),c=a("select.currency",d),e=c.val();d=d.clone();var f=a("select.currency",d);a("input",d).val("");a("option",c).each(function(){if(a(this).val()!=e)return f.val(a(this).val()),!1});d.insertBefore(a(this).closest("div"));g(b);l(b);1==a("option",c).length&&a(this).addClass("hide");return!1});a(document).on("click",
"a.removeprice",function(){var b=a(this).closest("td");a(this).closest("div.pricerow").remove();g(b);a("a.addmoreprices",b).removeClass("hide");l(b);return!1});a("a.new_pricing").last().trigger("click")}let n={edit:"admincp/subscriptions.php?do=apiedit&paymentapiid={id}",remove:"admincp/subscriptions.php?do=apirem&paymentapiid={id}"},p={edit:"admincp/subscriptions.php?do=edit&subscriptionid={id}",remove:"admincp/subscriptions.php?do=remove&subscriptionid={id}",view:"admincp/subscriptions.php?do=find&status=-1&subscriptionid={id}",
addu:"admincp/subscriptions.php?do=adjust&subscriptionid={id}"};a(()=>{vBAdmin.initJumpControl("papi",n);vBAdmin.initJumpControl("sub",p);m()})})(jQuery);
