/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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(["translate"],[]);vBulletin.ensureObj("sitebuilder");
$.extend(vBulletin.sitebuilder,function(d,H,I,F){function v(a,b,c,f,h){let g=d('<select name="data[{0}]" />'.format(a.name)),e={};f&&d.each(f,function(k,l){e[l]=d('<optgroup label="{0}" />'.format(p(l)))});a.data&&d.each(a.data,function(k,l){k=g;f&&(k=e[h(l)]);d("<option />").attr("value",l[b]).prop("selected",a.defaultvalue==l[b]).html(l[c]).appendTo(k)});d.each(e,function(k,l){l.length&&l.appendTo(g)});return g}function x(a){var b=d(".js-sb-module-config--filter_nodes--template");if(!b.length)return"";
a.hasOwnProperty("defaultvalue")||(a.defaultvalue={include:["all"]});b=b.clone().removeClass("js-sb-module-config--filter_nodes--template h-hide");a=a.defaultvalue;let c=a.hasOwnProperty("exclude")?"exclude":"include",f=a.hasOwnProperty("include_children")?a.include_children:!0,h=b.find("input[name='data[module_filter_nodes][include_children]']"),g=b.find("input.js-module_filter_nodes__key[value='include']"),e=b.find("input.js-module_filter_nodes__key[value='exclude']"),k=b.find("select.js-module_filter_nodes-values"),
l=b.find("input[name='data[module_filter_nodes][selection_type]']"),y=b.find("*[data-disable-on='exclude']"),z=b.find("*[data-disable-on='include']"),B=function(t,q){var n=k.data("selectBox-control")||{};t.each(function(){var r=d(this);r.attr("disabled","disabled");r.is("option")&&0<n.length&&n.find("li:has(> a[rel='"+r.val()+"'])").removeClass("selectBox-selected").addClass("selectBox-disabled")});q.each(function(){var r=d(this);r.removeAttr("disabled");if(r.is("option")&&0<n.length){var A="";r.is(":selected")&&
(A="selectBox-selected");n.find("li:has(> a[rel='"+r.val()+"'])").removeClass("selectBox-disabled").addClass(A)}})},C=b.find("*[data-hide-on='exclude']"),D=b.find("*[data-hide-on='include']");l.on("change vb-init",function(t){t=d(this);var q=t.val(),n=k.data("selectBox-control")||{};t.is(":checked")&&("all"==q||"current"==q?(k.attr("disabled","disabled"),0<n.length&&n.addClass("selectBox-disabled")):(k.removeAttr("disabled"),0<n.length&&n.removeClass("selectBox-disabled")))});b.find("input.js-module_filter_nodes__key").on("change",
function(t){"exclude"==this.value?(B(y,z),C.hide(),D.show()):(B(z,y),D.hide(),C.show())});"exclude"==c?(g.prop("checked",!1),e.prop("checked",!0),e.change()):(e.prop("checked",!1),g.prop("checked",!0),g.change());if(!a.hasOwnProperty(c))a.key=[];else if("string"==typeof a[c]||"number"==typeof a[c])a[c]=[a[c]];d.each(a[c],function(t,q){if("all"===q)return l.filter("[value='all']").prop("checked",!0),!1;if("current"===q)return l.filter("[value='current']").prop("checked",!0),!1;l.filter("[value='custom']").prop("checked",
!0);k.find("option[value='"+q+"']").prop("selected",!0)});l.trigger("vb-init");h.prop("checked",f);return b}function E(a){return d("<div />").addClass("config-required-mark h-left").append(a?"*":"&nbsp;")}function w(a,b,c=!1){"undefined"==typeof b&&(b="config-label h-left");b=d("<div />").addClass(b).addClass(a.name).html(a.label);G&&b.prop("title",a.name);a.description&&d("<div />").addClass("config-description").html(a.description).appendTo(b);if(a.isrequired||!c)a=E(1==a.isRequired),b=b.add(a);
return b}function m(a,b){const c=d("<div />").addClass("h-clearfix config-row");0==a.isEditable&&b&&(b.find("input").prop("readonly",!0),b.is("input")||b.prop("disabled",!0));if(a.ishiddeninput&&b)return b.attr("hidden",!0),b;const f=w(a);return c.append([f,d("<div></div>").addClass("config-value h-left").addClass(a.name).append(b)])}const p=F.get,G=1==d("#debug-information").length,u={TranslatableText(a){if(!("translations"in a))return this.Text(a);let b=this.Text(a);const c=d("<fieldset />").addClass("config-fieldset js-collapse-group h-hide-imp").attr("data-name",
a.name);for(const [,e]of Object.entries(a.translations)){var f=e.languageid,h=e.langtitle,g=e.value;g=d("<div />").addClass("config-value h-left").addClass(a.name).append(d(`<input type="text" name="data[${a.name}][${f}]" id="data[${a.name}][${f}]" />`).addClass("textbox config-textbox").val(g));h=d("<div />").addClass("config-label h-left").html(h);0==a.isEditable&&g.prop("readonly",!0);a.ishiddeninput&&g.attr("hidden",!0);0==f?b=g:a.ishiddeninput?c.append(g):(f=E(0),f=d("<div />").addClass("h-clearfix config-row").append(h,
f,g),c.append(f))}console.assert(b&&b.length,"Default input not found for translatable text field.");a.ishiddeninput||(c.length&&(null!=a.description||(a.description=""),a.description+=p("module_translatable_default_note"),a.description+=`<br/><a href="#" class="${"js-toggle-translations"}" data-name="${a.name}">`+p("translations")+"</a>"),b=w(a).add(b));b=d("<div />").addClass("h-clearfix config-row").append(b);c.length&&(b=b.add(c));return b},Text(a){let b;const c=d('<input type="text" name="data[{0}]" id="data[{0}]" />'.format(a.name)).addClass("textbox config-textbox").val(null!=
(b=a.defaultvalue)?b:"");return m(a,c)},LongText(a){let b;const c=d('<textarea name="data[{0}]" id="data[{0}]" rows="3" />'.format(a.name)).addClass("textbox config-textbox").val(null!=(b=a.defaultvalue)?b:"");return m(a,c)},YesNo(a){var b={option_1:d('<input type="radio" value="1" name="data[{0}]" id="data[{0}_1]" />'.format(a.name)),label_1:d("<label />").attr({"for":"data["+a.name+"_1]"}).text(p("yes")),option_0:d('<input type="radio" value="0" name="data[{0}]" id="data[{0}_0]" />'.format(a.name)),
label_0:d("<label />").attr({"for":"data["+a.name+"_0]"}).text(p("no"))};const c=b["option_"+a.defaultvalue];c&&c.prop("checked",!0);b=d("<div />").append(b.option_1,b.label_1,b.option_0,b.label_0);return m(a,b)},Checkboxes(a){const b=d("<div />");d.each(a.data,function(c,f){var h="";a.defaultvalue&&"undefined"!=typeof a.defaultvalue[c]&&1==a.defaultvalue[c]&&(h=' checked="checked"');c=d('<div><label><input type="checkbox" name="data[{0}][{1}]"{2} value="1" class="js-checkbox-always-send" /> {3}</label></div>'.format(a.name,
c,h,f));b.append(c)});return m(a,b)},Select(a){const b=d('<select name="data[{0}]" />'.format(a.name));if(""!=a.data)for(var c in a.data)d("<option />").attr("value",c).prop("selected",a.defaultvalue==c).text(a.data[c]).appendTo(b);return m(a,b)},ChannelSelect(a){const b=v(a,"nodeid","text",["special_options","channels"],function(c){return 1>c.nodeid?"special_options":"channels"});return m(a,b)},ContentTypeSelect(a){d.each(a.data,function(c,f){f.text=p(f.phrase)});const b=v(a,"value","text",["special_options",
"content_types"],function(c){return c.special?"special_options":"content_types"});return m(a,b)},ProfileFieldSelect(a){const b=v(a,"field","title");return m(a,b)},Slider(a){var b,c=b=0;let f=1,h=.1,g="";a.defaultvalue&&(b=a.defaultvalue);if(a.data&&"object"==typeof a.data){let e=a.data;e.hasOwnProperty("min")&&(c=parseFloat(e.min));e.hasOwnProperty("max")&&(f=parseFloat(e.max));e.hasOwnProperty("interval")&&(h=parseFloat(e.interval));e.hasOwnProperty("leftlabel")&&e.leftlabel&&(g+='<span class="h-left">'+
e.leftlabel+"</span>");e.hasOwnProperty("rightlabel")&&e.rightlabel&&(g+='<span class="h-right">'+e.rightlabel+"</span>");""!=g&&(g='<div class="config-slider-label">'+g+'<div class="h-clear"></div></div>')}c='data-min="{0}" data-max="{1}" data-interval="{2}"'.format(c,f,h);b=g+'<div class="js-module-config-slider config-slider" '+c+" >"+'\t<input type="hidden" name="data[{0}]" value="{1}" />'.format(a.name,b)+"</div>";b=d(b);return m(a,b)},ChannelIncludeExclude(a){const b=x(a);return m(a,b)},Custom(a){return m(a,
a.customValue)}};return{renderModuleConfig:function(a){if(u.hasOwnProperty(a.type))return u[a.type](a);console.log("Unknown config type",a.type,a)},attachTranslatableToggleEvent:function(a){a.offon("click.vbmodules",".js-toggle-translations",b=>{var c=d(b.currentTarget).data("name");c=a.find(`.${"js-collapse-group"}[data-name="${c}"]`);b.preventDefault();c.length&&c.toggleClass("h-hide-imp")})},detachTranslatableToggleEvent:function(a){a.off("click.vbmodules")},generateConfigInputs__Module_Filter_Nodes:x,
generateTranslatableForSearchModuleConfig:function(a){if(!("translations"in a))return u.Text(a);let b=u.Text(a),c=[],f=d("<div />").addClass("h-hide");for(const [,k]of Object.entries(a.translations)){var h=k.languageid,g=k.langtitle,e=k.value;e=d("<div />").addClass("field_column").addClass(a.name).append(d(`<input type="text" name="data[${a.name}][${h}]" id="data[${a.name}][${h}]" />`).addClass("textbox").val(e));g=d("<label />").addClass("label_column").html(g);0==a.isEditable&&e.prop("readonly",
!0);a.ishiddeninput&&e.attr("hidden",!0);0==h?b=e:a.ishiddeninput?f.append(e):(h=d("<div />").addClass("js-collapse-group").addClass("h-hide-imp").attr("data-name",a.name).addClass("form_row").append(g,e),c.push(h))}console.assert(b&&b.length,"Default input not found for translatable text field.");a.ishiddeninput||(c.length&&(null!=a.description||(a.description=""),a.description+=p("module_translatable_default_note"),a.description+=`<br/><a href="#" class="${"js-toggle-translations"}" data-name="${a.name}">`+
p("translations")+"</a>"),b=w(a,"label_column",!0).add(b));b=d("<div />").addClass("form_row").append(b);b=b.add(f);c.forEach(k=>{b=b.add(k)});return b}}}(jQuery,vBulletin,vBulletin.dialogtools,vBulletin.phrase));
