/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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   # ||
|| ###################################################################### ||
\*========================================================================*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,e){if(a==Array.prototype||a==Object.prototype)return a;a[c]=e.value;return a};
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var c=0;c<a.length;++c){var e=a[c];if(e&&e.Math==Math)return e}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,c){var e=$jscomp.propertyToPolyfillSymbol[c];if(null==e)return a[c];e=a[e];return void 0!==e?e:a[c]};$jscomp.polyfill=function(a,c,e,h){c&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,c,e,h):$jscomp.polyfillUnisolated(a,c,e,h))};
$jscomp.polyfillUnisolated=function(a,c,e,h){e=$jscomp.global;a=a.split(".");for(h=0;h<a.length-1;h++){var p=a[h];if(!(p in e))return;e=e[p]}a=a[a.length-1];h=e[a];c=c(h);c!=h&&null!=c&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:c})};
$jscomp.polyfillIsolated=function(a,c,e,h){var p=a.split(".");a=1===p.length;h=p[0];h=!a&&h in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var w=0;w<p.length-1;w++){var y=p[w];if(!(y in h))return;h=h[y]}p=p[p.length-1];e=$jscomp.IS_SYMBOL_NATIVE&&"es6"===e?h[p]:null;c=c(e);null!=c&&(a?$jscomp.defineProperty($jscomp.polyfills,p,{configurable:!0,writable:!0,value:c}):c!==e&&(void 0===$jscomp.propertyToPolyfillSymbol[p]&&(e=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[p]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(p):$jscomp.POLYFILL_PREFIX+e+"$"+p),$jscomp.defineProperty(h,$jscomp.propertyToPolyfillSymbol[p],{configurable:!0,writable:!0,value:c})))};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var c="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return c?c.call(a):$jscomp.arrayIterator(a)};
$jscomp.polyfill("Promise.allSettled",function(a){function c(h){return{status:"fulfilled",value:h}}function e(h){return{status:"rejected",reason:h}}return a?a:function(h){var p=this;h=Array.from(h,function(w){return p.resolve(w).then(c,e)});return p.all(h)}},"es_2020","es3");
vBulletin.precache("add_tags edit_tags error error_adding_search_tips_code_x error_adding_tags_code_x error_fetching_tags invalid_server_response_please_try_again invalid_x_tag_length loading none popular_tags_cloud tag_cloud unable_to_load_tag_editor unable_to_save_tags you_may_add_one_more_tag you_may_add_x_more_tags you_may_not_add_any_more_tags save post".split(" "),["tagforcelower","tagmaxlen","tagminlen"]);
(function(a,c,e,h,p){function w(f,g=!1){function m(b){b=a(this);var d=b.parent();!d.hasClass("added")&&F(b.text())&&(d.addClass("added"),n.is(":visible")&&n[0].focus());return!1}function k(b,d,q,G={}){let Q=b.data("node-id"),R=p.getContainingEditor(b),S=H(x.data("type")||"nodes"),I;I=d.suggested?Promise.resolve(d.suggested):R?T(R.getData()):X(Q);Promise.allSettled([I,S]).then(()=>{h.openModalDialog(q,{title:"add_tags",dialogClass:"tag-editor-dialog-container",onOpen:function(){t.clearElements();var U=
x.find(".tag-input").val();U?J(U.split(",").map(Y=>Y.trim())):B&&!n.attr("placeholder")&&n.attr("placeholder",B);q.find(".save-tag-btn").text(e.get(G.saveButtonPhrase||"save"));C();Z(Q);K(S,u,"popular");K(I,u,"suggested")},onAfterClose:()=>{x.data("autocomplete-instance").close()}})});b.data("tag-dialog",q);q.data("parent",b.closest("form, .search-controls-tags, .form_row"));q.off("vb-tag-dialog-save vb-tag-dialog-cancel")}var l=this,r=!1,v=!1,z=c.options.get("tagmaxlen")||25,aa=c.options.get("tagminlen")||
3,D=0,A=0,L=!1,n=a(f),u=n.closest(".tag-editor-container"),x=n.closest(".tag-editor-wrapper"),t=!1,B=n.attr("placeholder")?n.attr("placeholder"):"",M=B?B.length:10,F=function(b,d){if(!t)return!1;if("undefined"==typeof d||1>d)d=pageData.userid;let q=t.getMinLength();if(b.length<q)return h.error("error",["invalid_x_tag_length",q]),!1;1==c.options.get("tagforcelower")&&(b=b.toLowerCase());b.length>z&&(b=b.substr(0,z));d=t.addElement(b,d);n.val("");C();return d},J=function(b){b.map(d=>F(d))},O=function(){n.attr("size",
M);var b=JShtmlEncode(a.trim(n.val()));if(""==b)return!1;0<N()&&setTimeout(function(){F(b)},10)},N=function(){if(g||0==D&&0==A)return!0;var b=t.countElements(),d=a(t.getElements()).filter(function(q,G){return 0==pageData.userid||G.value==pageData.userid}).length;b=0<D?D-b:A-b;return Math.min(0==A?b:A-d,b)},C=function(){var b=u.find(".you-may-add-text"),d=N();if(!0===d)return!0;if(1<d)var q=["you_may_add_x_more_tags",d];else 1==d?q="you_may_add_one_more_tag":(q="you_may_not_add_any_more_tags",d=0);
b.toggleClass("warning",0==d).html(e.get(q));b=!!d;n.toggle(b);b&&n[0].focus();return d},Z=function(b){g?n[0].focus():E[b]?(D=E[b].maxTags,A=E[b].maxUserTags,L=E[b].canManageTags,C()):(E[b]={},c.AJAX({call:"/ajax/api/tags/getNodeTags",data:{nodeid:b},success:function(d){a.isArray(d.tags)&&(D=parseInt(d.maxtags,10),A=parseInt(d.maxusertags,10),L=d.canmanagetags,E[b]={maxTags:D,maxUserTags:A,canManageTags:L},C())},api_error:a.noop,error:a.noop}))};this.addTag=function(b,d){F(b,d)};this.addTags=function(b){J(b)};
this.setTags=function(b){t&&(t.clearElements(),J(b))};this.removeAllTags=function(){t.clearElements()};this.getTags=function(){return t?t.getLabels():!1};this.getTagEditor=function(){return n};this.getWrapper=function(){return x};this.setSuggested=function(b){this.suggested=b};this.openTagDialog=function(b,d={}){k(b,this,u,d);return u};x.data("initialized")?console.log("Tag Editor is already initialized."):(x.attr("data-initialized",!0),function(){if(0==n.length)return!1;n.attr("maxlength",z);t=new vBulletin_Autocomplete(n,
{apiClass:"Tags",containerClass:" entry-field h-clearfix",placeholderText:B,editorContext:{type:"tags",context:l},minLength:aa,beforeAdd:function(b,d){r=v?!0:!1;return 0==N()?!1:!0},afterAdd:function(b,d){C();n.attr("placeholder","");y(u.find(".tagcloudlink"),u)},afterDelete:function(b,d){r=v?!0:!1;C();n.attr("placeholder",function(){var q=t?t.getLabels():!1;return q&&0!=q.length?"":B});b=u.find(".js-popular-tags .tagcloudlink");0==b.length&&(b=u.find(".popular-tags-link"),b.length&&b.qtip&&(b=b.qtip("api").elements.tooltip.find(".tagcloudlink")));
y(u.find(".tagcloudlink"),u)}});n=t.getInputField();x.data("autocomplete-instance",t)}(),n.offon("keydown",function(b){var d=a(b.target).val().length;a(b.target).attr("size",d>M?d:M);if(13==b.which)return r=v?!0:!1,O(),b.preventDefault(),!1}),n.offon("blur",function(b){v=setTimeout(function(){r||O();v=r=!1},0)}),n.offon("click",function(b){a(b.target).hasClass("tag-input")||(a(".tag-input",a(this)).trigger("focus"),r=v?!0:!1);return!1}),n.each(function(){a(this).closest("form").on("submit",O)}),a(".js-popular-tag-text.inline-tag-cloud .popular-tags-link",
u).offon("click",function(){K(H("nodes"),u,"popular")}),vBulletin.qtip.apply(a(".js-popular-tag-text:not(.inline-tag-cloud) .popular-tags-link",u),"qtip-populartags",{content:{title:{text:e.get("tag_cloud"),button:!1},text:function(b,d){H("nodes").then(q=>{d.set("content.text",'<div class="tag-cloud js-popular-tags">{0}</div>'.format(q||e.get("no_tags_yet")));q=d.elements.tooltip;q.on("click",".js-popular-tags .tagcloudlink label",m);y(q.find(".tagcloudlink"),x)},q=>{d.set("content.text",q.message)});
return e.get("working_ellipsis")}},position:{at:"bottom center",my:"top center",viewport:a(window),effect:!1},show:{event:"click",solo:!0},hide:"unfocus"}),u.on("click",".tagcloudlink label",m))}function y(f,g){if(0<f.length){let m=(g.find(".tag-input").val()||"").split(",").map(k=>k.trim());f.each((k,l)=>{k=a(l);k.toggleClass("added",m.includes(k.data("tag")))})}}function K(f,g,m){let k=g.find(".js-"+m+"-tags");f.then(l=>{let r=g.find(".js-"+m+"-tags-text");!l&&r.is(".inline-tag-cloud")&&(l=e.get("no_tags_yet"));
k.html(l);l&&y(k.find(".tagcloudlink"),g);r.toggle(!!l)},l=>{k.html(l.message)})}async function H(f){return P("tags/fetchTagsForCloud",{type:f,taglevels:5,limit:20,tagsonly:!0})}async function X(f){return P("tags/getSuggestedTagsForNode",{nodeid:f})}async function T(f){return P("editor/getSuggestedTagsForEditorText",{text:f})}async function P(f,g){let m,k,l=(r="")=>{k='<span class="error">{0} {1}</span>'.format(e.get("error_fetching_tags"),r)};await c.AJAX({call:"/ajax/api/"+f,data:g,success:function(r){m=
r.tags.map(v=>'<span class="tagcloudlink" data-tag="{0}"><label class="b-link js-link" tabindex="0">{0}</label></span>'.format(v)).join(", ")},api_error:r=>l(e.get(r[0])),error:()=>l()});if(k)throw Error(k);return m}function ba(f,g){c.AJAX({call:"/ajax/api/tags/updateUserTags",data:{nodeid:f,taglist:g.split(",").filter(m=>m)},success:function(m){let k=a("#content-tags-"+f);k.find(".js-content-tag, .js-content-tag-none").remove();let l=m.tags;l&&0<l.length?a.each(l,function(r,v){var z=a("<span />").addClass("js-content-tag");
a("<a />").attr("href",v.searchurl).html(v.tagtext).appendTo(z);r<l.length-1&&z.append(document.createTextNode(", "));z.appendTo(k)}):a("<span />").addClass("js-content-tag-none").html(e.get("none")).appendTo(k)},error_phrase:"unable_to_save_tags",title_phrase:"edit_tags"})}function ca(f){let g=f.data("node-id");c.AJAX({call:"/ajax/render/tag_editor",data:{nodeid:g,dialogOnly:!0,editPost:!0,editorClass:"js-topic-tag-editor",isAjaxTemplateRenderWithData:!0},success:function(m){function k(){l.dialog("destroy").closest(".tag-editor-wrapper").remove()}
a("body").append(m.template);let l=(new w(".js-topic-tag-editor",!1)).openTagDialog(f);l.on("vb-tag-dialog-cancel",k);l.on("vb-tag-dialog-save",function(r,v){ba(g,v.tagList);k()})},error_phrase:"unable_to_load_tag_editor",title_phrase:"edit_tags"})}function V(f){if(0<a(f).length){let g=new w(f);f=g.getWrapper().find(".add-tag-link");f.data("tageditor",g);f.offon("click",m=>{m.stopPropagation();g.openTagDialog(a(m.currentTarget));return!1})}}let W=c.ensureObj("jsexec.tag_editor",{exec:0});W.exec++;
if(!(1<W.exec)){var E={};c.ensureObj("tagEditor");a(()=>{a(document).offon("click.tage",".tag-editor-container .cancel-tag-btn",function(){a(".tag-editor-container").dialog("close").trigger("vb-tag-dialog-cancel")});a(document).offon("click.tage",".tag-editor-container .save-tag-btn",function(){var f=a(this).closest(".tag-editor-container"),g=f.find(".tag-input").val(),m=g.replace(/,/g,", "),k=f.data("parent");k.find(".tag-list span").text(m);k.find(".tag-input").val(g);k.find(".tag-list").toggleClass("h-hide",
!g);f.dialog("close").trigger("vb-tag-dialog-save",{tagList:g})});a(document).offon("mousedown.tage",".tag-editor-container .autocomplete-container",function(){var f=this;setTimeout(function(){var g=a(".autocompleteHelper:visible",f);0<g.length&&g[0].focus()},10);return!1});V(".js-content-entry-tag-editor");a(document).offon("click.tage",".js-edit-tags",f=>ca(a(f.currentTarget)))});c.tagEditor=a.extend(c.tagEditor,{initEditTagsContent:V,instance:w,promptForTags:function(f){let g=f.find(".add-tag-link"),
m=g.data("tageditor"),k=p.getContainingEditor(g),l=()=>{f.data("tagsdone",!0);f.submit()};if(!m||!k)return!1;T(k.getData()).then(r=>{r?(m.setSuggested(r),m.openTagDialog(g,{saveButtonPhrase:"post"}).on("vb-tag-dialog-save",()=>{l()})):l()},()=>l);return!0}})}})(jQuery,vBulletin,vBulletin.phrase,vBulletin.dialogtools,vBulletin.ckeditor);
