/*
 * XenForo core.min.js
 * Copyright 2010-2018 XenForo Ltd.
 * Released under the XenForo License Agreement: https://xenforo.com/license-agreement
 */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,k,h){d instanceof String&&(d=String(d));for(var a=d.length,b=0;b<a;b++){var c=d[b];if(k.call(h,c,b,d))return{i:b,v:c}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,k,h){d!=Array.prototype&&d!=Object.prototype&&(d[k]=h.value)};
$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(d,k,h,a){if(k){h=$jscomp.global;d=d.split(".");for(a=0;a<d.length-1;a++){var b=d[a];b in h||(h[b]={});h=h[b]}d=d[d.length-1];a=h[d];k=k(a);k!=a&&null!=k&&$jscomp.defineProperty(h,d,{configurable:!0,writable:!0,value:k})}};
$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,h){return $jscomp.findInternal(this,d,h).v}},"es6","es3");$jscomp.polyfill("Array.prototype.fill",function(d){return d?d:function(d,h,a){var b=this.length||0;0>h&&(h=Math.max(0,b+h));if(null==a||a>b)a=b;a=Number(a);0>a&&(a=Math.max(0,b+a));for(h=Number(h||0);h<a;h++)this[h]=d;return this}},"es6","es3");var XF=window.XF||{};void 0===window.jQuery&&(jQuery=$={});
!function(d,k,h){XF.activate?console.error("XF core has been double loaded"):(XF.browser||(XF.browser={browser:"",version:0,os:"",osVersion:null}),function(){var a=function(){var a=h.createElement("fake"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},c;for(c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}();d.support.transition=a;d.support.transition&&(d.event.special.xfTransitionEnd={bindType:a.end,
delegateType:a.end,handle:function(a){if(d(a.target).is(this))return a.handleObj.handler.apply(this,arguments)}});var b=d("html").attr("dir");a="normal";if(b&&"RTL"==b.toUpperCase()){b=d('<div style="width: 80px; height: 40px; font-size: 30px; overflow: scroll; white-space: nowrap; word-wrap: normal; position: absolute; top: -1000px; visibility: hidden; pointer-events: none">MMMMMMMMMM</div>');var c=b[0];b.appendTo("body");0<c.scrollLeft?a="inverted":(c.scrollLeft=-1,-1==c.scrollLeft&&(a="negative"));
b.remove()}d.support.scrollLeftType=a}(),d.fn.extend({onWithin:function(a,b,c){var e=this;d(h).on(a,function(a){d(a.target).has(e).length&&(c&&d(h).off(a),b(a))});return this},oneWithin:function(a,b){return this.onWithin(a,b,!0)},onPassive:function(a,b,c){if("object"==typeof a){for(var e in a)this.onPassive(e,a[e]);return this}return"string"!=typeof a||"function"!=typeof b||"undefined"!=typeof c?(console.warn("$.onPassive failure for %s.on%s, check parameters",this.get(0),a),this):-1!==a.indexOf(".")?
(console.warn("$.onPassive does not support namespaced events %s.on%s",this.get(0),a),!1):Modernizr.passiveeventlisteners?(this.get(0).addEventListener(a,b,{passive:!0}),this):this.on(a,b)},offPassive:function(a,b){this.get(0).removeEventListener(a,b);return this},xfFadeDown:function(a,b){this.filter(":hidden").hide().css("opacity",0);a=a||XF.config.speed.normal;this.find(".is-sticky").addClass("was-sticky").removeClass("is-sticky");this.animate({opacity:1,height:"show",marginTop:"show",marginBottom:"show",
paddingTop:"show",paddingBottom:"show"},{duration:a,easing:"swing",complete:function(){d(this).find(".was-sticky").addClass("is-sticky").removeClass("was-sticky");b&&b();XF.layoutChange()}});return this},xfFadeUp:function(a,b){a=a||XF.config.speed.normal;this.find(".is-sticky").addClass("was-sticky").removeClass("is-sticky");this.animate({opacity:0,height:"hide",marginTop:"hide",marginBottom:"hide",paddingTop:"hide",paddingBottom:"hide"},{duration:a,easing:"swing",complete:function(){d(this).find(".was-sticky").addClass("is-sticky").removeClass("was-sticky");
b&&b();XF.layoutChange()}});return this},xfUniqueId:function(){var a=this.attr("id");a||(a="js-XFUniqueId"+XF.counter,XF.counter++,this.attr("id",a));return a},findExtended:function(a){var b;if("string"===typeof a&&(b=a.match(/^<([^|]+)(\|([\s\S]+))?$/))){a=d.trim(b[1]);var c,e,f={up:"parent",next:"next",prev:"prev"},g=this;do if(c=a.match(/^:(up|next|prev)(\((\d+)\))?/)){c[2]||(c[3]=1);var l=f[c[1]];for(e=0;e<c[3];e++)(g=g[l]())||(g=d());a=d.trim(a.substr(c[0].length))}while(c);a.length&&(g=g.closest(a));
g.length||(g=d());a=b[2]?d.trim(b[3]):"";return a.length?g.find(a):g}return this._find(a)},dimensions:function(a,b){var c=this.offset();c={top:c.top,left:c.left};b=b?!0:!1;c.width=a?this.outerWidth(b):this.width();c.height=a?this.outerHeight(b):this.height();c.right=c.left+c.width;c.bottom=c.top+c.height;return c},viewport:function(a,b){a={width:a?this.outerWidth(b):this.width(),height:a?this.outerHeight(b):this.height(),left:this.scrollLeft(),top:this.scrollTop(),right:0,bottom:0,docWidth:d(h).width(),
docHeight:d(h).height()};a.bottom=a.top+a.height;a.right=a.left+a.width;return a},hasFixableParent:function(){var a=!1;this.parents().each(function(){var b=d(this);switch(b.css("position")){case "fixed":case "sticky":case "-webkit-sticky":return a=b,!1}if(b.data("sticky_kit"))return a=b,!1});return a},hasFixedParent:function(){var a=!1;this.parents().each(function(){var b=d(this);switch(b.css("position")){case "fixed":return a=b,!1;case "sticky":case "-webkit-sticky":var c=b.dimensions(!0),e=d(k).viewport(),
f=b.css("top"),g=b.css("bottom");if("auto"!==f&&(f=c.top-e.top-parseInt(f,10),.5>=f&&-.5<=f)||"auto"!==g&&(f=c.bottom-e.bottom-parseInt(g,10),.5>=f&&-.5<=f))return a=b,!1}});return a},onTransitionEnd:function(a,b){var c=!1,e=this;this.one("xfTransitionEnd",function(){if(!c)return c=!0,b.apply(this,arguments)});setTimeout(function(){c||e.trigger("xfTransitionEnd")},a+10);return this},autofocus:function(){var a=d(this);XF.isIOS()?a.is(":focus")||(a.addClass("is-focused"),a.on("blur",function(){a.removeClass("is-focused")})):
a.focus();return this},normalizedScrollLeft:function(a){var b=d.support.scrollLeftType;if("undefined"!==typeof a){for(var c=0;c<this.length;c++){var e=this[c],f=a;switch(b){case "negative":f=0<f?-f:0;break;case "inverted":f=e.scrollWidth-e.offsetWidth-f}e.scrollLeft=f}return this}a=this[0];if(!a)return 0;c=a.scrollLeft;switch(b){case "negative":return 0>c?-c:0;case "inverted":return b=a.scrollWidth-c-a.offsetWidth,.5>b?0:b;default:return c}}}),function(){function a(a){if(!d.support.transition)return 0;
var b=a[0];if(!(b&&b instanceof k.Element))return 0;a=a.css("transition-duration");b=0;a&&a.match(/^(\+|-|)([0-9]*\.[0-9]+|[0-9]+)(ms|s)/i)&&(b=("-"==RegExp.$1?-1:1)*parseFloat(RegExp.$2)*("ms"==RegExp.$3.toLowerCase()?1:1E3));return b}function b(a,b,c){var e=[];d.isFunction(b)&&(b=b.call(a[0],0,a[0].className));b=d.trim(b).split(/\s+/);a=" "+a[0].className+" ";for(var f,g=0;g<b.length;g++)((f=0<=a.indexOf(" "+b[g]+" "))&&!c||!f&&c)&&e.push(b[g]);return e.join(" ")}function c(c,g,l,p,m){m=m?0:a(c);
var f=g?"addClass":"removeClass",h=g?"removeClass":"addClass";g=b(c,l,g?!0:!1);var r=c[0],k=function(){p&&setTimeout(function(){p.call(r,d.Event("xfTransitionEnd"))},0)};if(g.length)if(0>=m)c[f](g),k();else{c.hasClass("is-transitioning")&&c.trigger("xfTransitionEnd");c.addClass("is-transitioning");if(c.css("transition-property").match(/(^|\s|,)-xf-(width|height)($|\s|,)/)){k=RegExp.$2;var u=e[k],x=c.css(u),z=x[k],n="transition."+k,v=c.data(n),B=r.style,w=B.transition||B["-webkit-transition"]||B["-moz-transition"]||
B["-o-transition"]||"",y;if(void 0===v)for(v={},y=0;y<u.length;y++)v[u[y]]=B[u[y]]||"";if(0==c[k]())for(y in z="0",x)x.hasOwnProperty(y)&&(x[y]="0");c.data(n,v).css("transition","none")[f](g);u=c.css(u);v=u[k];if(0==c[k]())for(y in v="0",u)u.hasOwnProperty(y)&&(u[y]="0");c[h](g);if(z!=v){var C=p;c.css(x);r.offsetWidth;c.css("transition",w).css(u);p=function(){c.css(c.data(n)).removeData(n);C&&C.apply(this,arguments)}}else c.css("transition",w)}c.onTransitionEnd(m,function(){c.removeClass("is-transitioning");
p&&p.apply(this,arguments)});c[f](l)}else k()}var e={height:"height padding-top padding-bottom margin-top margin-bottom border-top-width border-bottom-width".split(" "),width:"width padding-left padding-right margin-left margin-right border-right-width border-left-width".split(" ")};d.fn.addClassTransitioned=function(a,b,e){for(var f=this.length,g=0;g<f;g++)c(d(this[g]),!0,a,b,e);return this};d.fn.removeClassTransitioned=function(a,b,e){for(var f=this.length,g=0;g<f;g++)c(d(this[g]),!1,a,b,e);return this};
d.fn.toggleClassTransitioned=function(a,b,e,p){"boolean"!==typeof b&&"undefined"===typeof e&&(e=b,b=null);for(var f="boolean"===typeof b,g=this.length,l=0;l<g;l++){var h=d(this[l]);var k=f?b:h.hasClass(a)?!1:!0;c(h,k,a,e,p)}return this}}(),d.extend(XF,{config:{userId:null,ignored:[],csrf:null,time:{now:0,today:0,todayDow:0},cookie:{path:"/",domain:"",prefix:"xf_"},url:{fullBase:"/",basePath:"/",css:"",keepAlive:""},css:{},js:{},jsState:{},speed:{xxfast:50,xfast:100,fast:200,normal:400,slow:600},job:{manualUrl:""},
borderSizeFeature:"3px",enableRtnProtect:!0,enableFormSubmitSticky:!0,visitorCounts:{conversations_unread:0,alerts_unread:0,title_count:!1,icon_indicator:!1},uploadMaxFilesize:null},debug:{disableAjaxSubmit:!1},counter:1,pageDisplayTime:null,phrases:{},getApp:function(){return d("html").data("app")||null},getKeyboardInputs:function(){return"input:not([type=radio], [type=checkbox], [type=submit], [type=reset]), textarea"},onPageLoad:function(){d(h).trigger("xf:page-load-start");XF.NavDeviceWatcher.initialize();
XF.ActionIndicator.initialize();XF.DynamicDate.initialize();XF.KeepAlive.initialize();XF.LinkWatcher.initLinkProxy();XF.LinkWatcher.initExternalWatcher();XF.NoticeWatcher.initialize();XF.BbBlockExpand.watch();XF.ScrollButtons.initialize();XF.KeyboardShortcuts.initialize();XF.FormInputValidation.initialize();XF.IgnoreWatcher.initializeHash();XF.Click.watch();XF.config.jsState=XF.applyJsState({},XF.config.jsState);XF.activate(h);d(h).on("ajax:complete",function(a,b,c){(a=b.responseJSON)&&a.visitor&&
XF.updateVisitorCounts(a.visitor,!0)});d(h).on("ajax:before-success",function(a,b,c,e){(b=e.responseJSON)&&b&&b.job&&(a=b.job,a.manual&&XF.JobRunner.runManual(a.manual),a.auto&&setTimeout(XF.JobRunner.runAuto,0))});d(h).on("keyup","a:not([href])",function(a){13==a.which&&d(a.currentTarget).click()});d("html[data-run-jobs]").length&&setTimeout(XF.JobRunner.runAuto,100);XF.updateVisitorCounts(XF.config.visitorCounts,!0);XF.CrossTab.on("visitorCounts",function(a){XF.updateVisitorCounts(a,!1)});XF.pageLoadScrollFix();
setTimeout(function(){d("[data-load-auto-click]").first().click()},100);d(h).trigger("xf:page-load-complete")},addExtraPhrases:function(a){d(a).find("script.js-extraPhrases").each(function(){var a=d(this);try{var c=d.parseJSON(a.html())||{};d.extend(XF.phrases,c)}catch(e){console.error(e)}a.remove()})},phrase:function(a,b,c){var e=XF.phrases[a];b&&(e=XF.stringTranslate(e,b));return e||c||a},_isRtl:null,isRtl:function(){if(null===XF._isRtl){var a=d("html").attr("dir");XF._isRtl=a&&"RTL"==a.toUpperCase()}return XF._isRtl},
rtlFlipKeyword:function(a){if(!XF.isRtl())return a;switch(a.toLowerCase()){case "left":return"right";case "right":return"left";default:return a}},isMac:function(){return-1!=navigator.userAgent.indexOf("Mac OS")},isIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!k.MSStream},isIE:function(){var a=navigator.userAgent;return 0<a.indexOf("MSIE ")||0<a.indexOf("Trident/")},log:function(){console.log&&console.log.apply&&console.log.apply(console,arguments)},findRelativeIf:function(a,
b){if(!a)throw Error("No selector provided");var c;if(c=a.match(/^(<|>|\|)/)){if("<"==c[1])return b.findExtended(a);"|"==c[1]&&(a=a.substr(1));return b.find(a)}return d(a)},isElementVisible:function(a){a=a[0].getBoundingClientRect();return 0<=a.top&&0<=a.left&&a.bottom<=d(k).height()&&a.right<=d(k).width()},layoutChange:function(){XF._layoutChangeTriggered||(XF._layoutChangeTriggered=!0,setTimeout(function(){XF._layoutChangeTriggered=!1;d(h.body).trigger("sticky_kit:recalc").trigger("xf:layout")},
0))},_layoutChangeTriggered:!1,updateAvatars:function(a,b,c){d(".avatar").each(function(){var e=d(this),f=e.find("img, span").first(),g="avatar-u"+a+"-",l=e.hasClass("avatar--updateLink")?e.find(".avatar-update"):null;if((c||!f.hasClass(".js-croppedAvatar"))&&f.is('[class^="'+g+'"]')){if(f.hasClass(g+"s"))f=d(b.s);else if(f.hasClass(g+"m"))f=d(b.m);else if(f.hasClass(g+"l"))f=d(b.l);else if(f.hasClass(g+"o"))f=d(b.o);else return;e.html(f.html());f.hasClass("avatar--default")?(e.addClass("avatar--default"),
f.hasClass("avatar--default--dynamic")?e.addClass("avatar--default--dynamic"):f.hasClass("avatar--default--text")?e.addClass("avatar--default--text"):f.hasClass("avatar--default--image")&&e.addClass("avatar--default--image")):e.removeClass("avatar--default avatar--default--dynamic avatar--default--text avatar--default--image");e.attr("style",f.attr("style"));l&&e.append(l)}})},updateVisitorCounts:function(a,b){a&&"public"==XF.getApp()&&(XF.badgeCounterUpdate(d(".js-badge--conversations"),a.conversations_unread),
XF.badgeCounterUpdate(d(".js-badge--alerts"),a.alerts_unread),XF.config.visitorCounts.title_count&&XF.pageTitleCounterUpdate(a.total_unread),XF.config.visitorCounts.icon_indicator&&XF.faviconUpdate(a.total_unread),b&&XF.CrossTab.trigger("visitorCounts",a))},badgeCounterUpdate:function(a,b){a.length&&(a.attr("data-badge",b),"0"!=String(b)?a.addClass("badgeContainer--highlighted"):a.removeClass("badgeContainer--highlighted"))},pageTitleCache:"",pageTitleCounterUpdate:function(a){var b=h.title;""===
XF.pageTitleCache&&(XF.pageTitleCache=b);b!==XF.pageTitleCache&&"("===b.charAt(0)&&(b=XF.pageTitleCache);a=(0<a?"("+a+") ":"")+b;a!=h.title&&(h.title=a)},favIconAlertShown:!1,faviconUpdate:function(a){var b=0<a;if(b!=XF.favIconAlertShown){var c=d('link[rel~="icon"]');c.length&&Modernizr.canvas&&(XF.favIconAlertShown=b,c.each(function(b,c){var e=d(c);b=e.attr("href");c=e.data("original-href");0<a?(c||e.data("original-href",b),d("<img />").on("load",function(){e.attr("href",XF.faviconDraw(this))}).attr("src",
b)):c&&e.attr("href",c).removeData("original-href")}))}},faviconDraw:function(a){var b=a.naturalWidth,c=a.naturalHeight;c=d("<canvas />").attr({width:b,height:c});var e=c[0].getContext("2d"),f=b/(32/6),g=2*Math.PI;e.drawImage(a,0,0);e.beginPath();e.arc(f,f,f,0,g,!1);e.fillStyle="#E03030";e.fill();e.lineWidth=b/16;e.strokeStyle="#eaeaea";e.stroke();e.closePath();return c[0].toDataURL("image/png")},unparseBbCode:function(a){var b=d(h.createElement("div"));b.html(a);b.find(".js-noSelectToQuote").each(function(){d(this).remove()});
d.each(["B","I","U"],function(a,e){b.find(e).each(function(){d(this).replaceWith("["+e+"]"+d(this).html()+"[/"+e+"]")})});b.find(".bbCodeBlock--quote").each(function(){var a=d(this),b=a.find(".bbCodeBlock-expandContent");b.length?a.replaceWith("<div>[QUOTE]"+b.html()+"[/QUOTE]</div>"):b.find(".bbCodeBlock-expand").remove()});b.find(".bbCodeBlock--code").each(function(){var a=d(this);if(!a.find(".bbCodeCode"))return!0;var b=a.find(".bbCodeCode code");if(!b.length)return!0;var f=b.attr("class").match(/language-(\S+)/)[1];
b.removeAttr("class");a.replaceWith(b.first().attr("data-language",f||"none"))});b.find('div[style*="text-align"]').each(function(){var a=d(this).css("text-align").toUpperCase();d(this).replaceWith("["+a+"]"+d(this).html()+"[/"+a+"]")});b.find(".bbCodeSpoiler").each(function(){var a="";var b=d(this).find(".bbCodeSpoiler-button");if(b.length){var f=d(this).find(".bbCodeSpoiler-content").html();b=b.find(".bbCodeSpoiler-button-title");b.length&&(a='="'+b.text()+'"');d(this).replaceWith("[SPOILER"+a+
"]"+f+"[/SPOILER]")}});return b.html()},hideOverlays:function(){d.each(XF.Overlay.cache,function(a,b){b.hide()})},hideTooltips:function(){d.each(XF.TooltipTrigger.cache,function(a,b){b.hide()})},loadedScripts:{},loadScript:function(a,b){if(XF.loadedScripts.hasOwnProperty(a))return!1;XF.loadedScripts[a]=!0;return d.ajax({url:a,dataType:"script",cache:!0,global:!1,success:b})},loadScripts:function(a,b){function c(){p--;0===p&&b&&b()}function e(){for(var a;m[0]&&"loaded"==m[0].readyState;)a=m.shift(),
a.onreadystatechange=null,a.onerror=null,l.appendChild(a),c()}var f=h.scripts[0],g="async"in f;f=f.readyState;var l=h.head,p=0,m=[],k;for(k in a)if(a.hasOwnProperty(k)){var q=a[k];XF.loadedScripts[q]||(XF.loadedScripts[q]=!0,p++,g?function(a){var b=d("<script>").prop({src:a,async:!1});b.on("load error",function(a){b.off("load error");c()});l.appendChild(b[0])}(q):f?function(a){var b=h.createElement("script");m.push(b);b.onreadystatechange=e;b.onerror=function(){b.onreadystatechange=null;b.onerror=
null;c()};b.src=a}(q):d.ajax({url:q,dataType:"script",cache:!0,global:!1}).always(c))}!p&&b&&b()},ajax:function(a,b,c,e,f){"function"==typeof c&&void 0===e&&(e=c,c={});c=c||{};var g=!0,l=!0,p=!0;f&&(f.skipDefault&&(l=g=!1,delete f.skipDefault),f.skipDefaultSuccessError&&(l=!1,delete f.skipDefaultSuccessError),f.skipDefaultSuccess&&(g=!1,delete f.skipDefaultSuccess),f.skipError&&(p=!1,delete f.skipError));var m=function(a,b,c){d(h).trigger("ajax:before-success",[a,b,c]);l&&XF.defaultAjaxSuccessError(a,
b,c)||g&&XF.defaultAjaxSuccess(a,b,c)||e&&e(a,b,c)},t=function(a,b,c){if(a.readyState)try{var e=d.parseJSON(a.responseText);m(e,"",a)}catch(z){XF.defaultAjaxError(a,b,c)}};c=XF.dataPush(c,"_xfRequestUri",k.location.pathname+k.location.search);c=XF.dataPush(c,"_xfWithData",1);XF.config.csrf&&(c=XF.dataPush(c,"_xfToken",XF.config.csrf));var q=k.FormData&&c instanceof FormData;a=d.extend(!0,{cache:!0,data:c||{},dataType:"json",beforeSend:function(a,b){d(h).trigger("ajax:send",[a,b])},error:p?t:null,
success:m,complete:function(a,b){d(h).trigger("ajax:complete",[a,b])},timeout:3E4,type:a,url:b,processData:q?!1:!0},f);q&&(a.contentType=!1);switch(a.dataType){case "html":case "json":case "xml":a.data=XF.dataPush(a.data,"_xfResponseType",a.dataType)}"json"!=a.dataType&&(g=!1);return d.ajax(a)},dataPush:function(a,b,c){a&&"string"!=typeof a?void 0!==a[0]?a.push({name:b,value:c}):k.FormData&&a instanceof FormData?a.append(b,c):a[b]=c:(a=String(a),a+="&"+encodeURIComponent(b)+"="+encodeURIComponent(c));
return a},defaultAjaxSuccessError:function(a,b,c){return"object"!=typeof a?(XF.alert("Response was not JSON."),!0):a.errorHtml?(XF.setupHtmlInsert(a.errorHtml,function(a,b){b=b.h1||b.title||XF.phrase("oops_we_ran_into_some_problems");XF.overlayMessage(b,a)}),!0):a.errors?(XF.alert(a.errors),!0):a.exception?(XF.alert(a.exception),!0):!1},defaultAjaxSuccess:function(a,b,c){a&&"ok"==a.status&&a.message&&XF.flashMessage(a.message,3E3);return!1},defaultAjaxError:function(a,b,c){switch(b){case "abort":return;
case "timeout":XF.alert(XF.phrase("server_did_not_respond_in_time_try_again"));return;case "notmodified":case "error":if(!a||!a.responseText)return}console.error("PHP: "+a.responseText);XF.alert(XF.phrase("oops_we_ran_into_some_problems_more_details_console"))},activate:function(a){XF.addExtraPhrases(a);XF.IgnoreWatcher.refresh(a);XF.Element.initialize(a);XF.DynamicDate.refresh(a);XF.BbBlockExpand.checkSizing(a);XF.KeyboardShortcuts.initializeElements(a);XF.FormInputValidation.initializeElements(a);
var b=a instanceof d?a.get(0):a;k.FB&&setTimeout(function(){FB.XFBML.parse(b)},0);d(h).trigger("xf:reinit",[a])},getDefaultFormData:function(a,b,c,e){var f;b&&b.length&&b.attr("name")&&(f=b.attr("name"));c&&"multipart/form-data"===a.attr("enctype")&&console.error("JSON serialized forms do not support the file upload-style enctype.");if(k.FormData&&!c){var g=new FormData(a[0]);f&&g.append(f,b.attr("value"));a.find('input[type="file"]').each(function(){var a=d(this);if(0===a.prop("files").length)try{g.delete(a.attr("name"))}catch(r){}})}else{if(c){a=
a.is("form")?d(a[0].elements):a;var l,p=[],h=[];if(e){"string"===typeof e&&(e=e.split(","));var t=[];d.each(e,function(a,b){"number"===typeof a?t.push(XF.regexQuote(d.trim(b))):t.push(XF.regexQuote(d.trim(a)))});t.length&&(l=new RegExp("^("+t.join("|")+")(\\[|$)"))}a.each(function(a,b){(a=b.name)&&"_xf"!==a.substring(0,3)?!l||l.test(a)?p.push(b):h.push(b):h.push(b)});g=d(h).serializeArray();e=d(p).serializeJSON();g.unshift({name:c,value:JSON.stringify(e)})}else g=a.serializeArray();f&&g.push({name:f,
value:b.attr("value")})}return g},scriptMatchRegex:/<script([^>]*)>([\s\S]*?)<\/script>/ig,setupHtmlInsert:function(a,b,c){if("string"===typeof a||a instanceof d)a={content:a};if("object"==typeof a&&a.content){var e=arguments;XF.Loader.load(a.js,a.css,function(){var c,g=a.jsInline||[],l=a.content,p="string"==typeof l,h=e[2]?!0:!1;if(a.cssInline)for(c=0;c<a.cssInline.length;c++)d("<style>"+a.cssInline[c]+"</style>").appendTo("head");if(p){var t;l=d.trim(l);if(!h)for(;c=XF.scriptMatchRegex.exec(l);){var q=
!1;if(t=c[1].match(/(^|\s)type=("|'|)([^"' ;]+)/))switch(t[3].toLowerCase()){case "text/javascript":case "text/ecmascript":case "application/javascript":case "application/ecmascript":q=!0}else q=!0;q&&(g.push(c[2]),l=l.replace(c[0],""))}l=l.replace(/<noscript>([\s\S]*?)<\/noscript>/ig,"")}var r=d(p?d.parseHTML(l,null,h):l);2<=k.devicePixelRatio&&XF.isIOS()&&r.find("img[srcset]").each(function(){d(this).prop("src",this.getAttribute("srcset").replace(/\s+2x$/i,""))});r.find("noscript").empty().remove();
if(b instanceof d){var A=b;b=function(a){A.html(a)}}if("function"!==typeof b)console.error("onReady was not a function");else{var u=!1;l=function(b){if(!u){u=!0;b||XF.activate(r);for(b=0;b<g.length;b++)d.globalEval(g[b]);a.jsState&&(XF.config.jsState=XF.applyJsState(XF.config.jsState,a.jsState))}};!1!==b(r,a,l)&&l()}})}else console.error("Was not provided an object or HTML content")},alert:function(a,b,c,e){var f=a;"object"==typeof a&&(f="<ul>",d.each(a,function(a,b){f+="<li>"+b+"</li>"}),f+="</ul>",
f='<div class="blockMessage">'+f+"</div>");b||(b="error");if(!c)switch(b){case "error":c=XF.phrase("oops_we_ran_into_some_problems");break;default:c=""}return XF.overlayMessage(c,f)},getOverlayHtml:function(a){var b={dismissible:!0,title:null};d.isPlainObject(a)&&(b=d.extend({},b,a),a.html&&(a=a.html));if("string"==typeof a)a=d(d.parseHTML(a));else if(!(a instanceof d))throw Error("Can only create an overlay with html provided as a string or jQuery object");if(!a.is(".overlay")){var c=b.title;if(!c){var e=
a.find(".overlay-title");e.length&&(c=e.contents(),e.remove())}c||(c=XF.htmlspecialchars(d("title").text()));e=a.find(".overlay-content");e.length&&(a=e);e=d('<div class="overlay" tabindex="-1"><div class="overlay-title"></div><div class="overlay-content"></div></div>');var f=e.find(".overlay-title");f.html(c);b.dismissible&&f.prepend('<a class="overlay-titleCloser js-overlayClose" role="button" tabindex="0" aria-label="'+XF.phrase("close")+'"></a>');e.find(".overlay-content").html(a);a=e}a.appendTo("body");
return a},overlayMessage:function(a,b){if("string"==typeof b)b=d(d.parseHTML(b));else if(!(b instanceof d))throw Error("Can only create an overlay with html provided as a string or jQuery object");b.is(".block, .blockMessage")||b.find(".block, .blockMessage").length||(b=d('<div class="blockMessage" />').html(b));b=XF.getOverlayHtml({title:a,html:b});return XF.showOverlay(b,{role:"alertdialog"})},flashMessage:function(a,b,c){var e=d('<div class="flashMessage"><div class="flashMessage-content"></div></div>');
e.find(".flashMessage-content").html(a);e.appendTo("body").addClassTransitioned("is-active");setTimeout(function(){e.removeClassTransitioned("is-active",function(){e.remove();c&&c()})},Math.max(500,b))},htmlspecialchars:function(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},regexQuote:function(a){return(a+"").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}=!<>\|:])/g,"\\$1")},stringTranslate:function(a,b){a=a.toString();for(var c in b)if(b.hasOwnProperty(c)){var e=
new RegExp(XF.regexQuote(c,"g"));a=a.replace(e,b[c])}return a},stringHashCode:function(a){var b=0,c;if(0===a.length)return b;var e=0;for(c=a.length;e<c;e++){var d=a.charCodeAt(e);b=(b<<5)-b+d;b|=0}return b},canonicalizeUrl:function(a){if(a.match(/^[a-z]+:/i))return a;if(0==a.indexOf("/")){var b;return(b=XF.config.url.fullBase.match(/^([a-z]+:(\/\/)?[^\/]+)\//i))?b[1]+a:a}return XF.config.url.fullBase+a},isRedirecting:!1,redirect:function(a){XF.isRedirecting=!0;if(XF.JobRunner.isManualJobRunning())return d(h).one("job:manual-complete",
function(){XF.redirect(a)}),!1;a=XF.canonicalizeUrl(a);var b=k.location;if(a==b.href)b.reload(!0);else{k.location=a;var c=a.split("#"),e=b.href.split("#");c[1]&&c[0]==e[0]&&b.reload(!0)}return!0},getAutoCompleteUrl:function(){return"admin"==XF.getApp()?XF.canonicalizeUrl("admin.php?users/find"):XF.canonicalizeUrl("index.php?members/find")},applyDataOptions:function(a,b,c){var e={},f;for(f in a)if(a.hasOwnProperty(f)&&(e[f]=a[f],b.hasOwnProperty(f))){var g=b[f];var l=typeof g;var p=!0;switch(typeof e[f]){case "string":"string"!=
l&&(g=String(g));break;case "number":"number"!=l&&(g=Number(g),isNaN(g)&&(p=!1));break;case "boolean":if("boolean"!=l)switch(g){case "true":case "yes":case "on":case "1":g=!0;break;default:g=!1}}p&&(e[f]=g)}d.isPlainObject(c)&&(e=d.extend(e,c));return e},watchInputChangeDelayed:function(a,b,c){var e=d(a),f=e.val(),g;c=c||200;e.onPassive({keyup:function(){clearTimeout(g);g=setTimeout(function(){var a=e.val();a!=f&&(f=a,b())},c)},paste:function(){setTimeout(function(){e.trigger("keyup")},0)}})},insertIntoEditor:function(a,
b,c,e){return XF.modifyEditorContent(a,function(a){a.insertContent(b)},function(a){XF.insertIntoTextBox(a,c)},e)},replaceEditorContent:function(a,b,c,e){return XF.modifyEditorContent(a,function(a){a.replaceContent(b);b&&b.length||!XF.EditorHelpers||XF.EditorHelpers.toggleSmilieBox(a.ed,!1)},function(a){XF.replaceIntoTextBox(a,c)},e)},clearEditorContent:function(a,b){b=XF.replaceEditorContent(a,"","",b);a.trigger("draft:sync");return b},modifyEditorContent:function(a,b,c,e){a=XF.getEditorInContainer(a,
e);return a?XF.Editor&&a instanceof XF.Editor?(a.isBbCodeView()?(b=a.ed.bbCode.getTextArea(),c(b),b.trigger("autosize")):b(a),!0):a instanceof d&&a.is("textarea")?(c(a),a.trigger("autosize"),!0):!1:!1},getEditorInContainer:function(a,b){if(a.is(".js-editor")){if(b&&a.is(b))return null;b=a}else{a=a.find(".js-editor");b&&(a=a.not(b));if(!a.length)return null;b=a.first()}return(a=XF.Element.getHandler(b,"editor"))?a:b.is("textarea")?b:null},focusEditor:function(a,b){a=XF.getEditorInContainer(a,b);return a?
XF.Editor&&a instanceof XF.Editor?(a.scrollToCursor(),!0):a instanceof d&&a.is("textarea")?(a.autofocus(),!0):!1:!1},insertIntoTextBox:function(a,b){var c=a[0],e=c.scrollTop,d=c.selectionStart,g=c.selectionEnd,l=a.val(),p=l.substring(0,d);g=l.substring(g,l.length);a.val(p+b+g).trigger("autosize");c.selectionStart=c.selectionEnd=d+b.length;c.scrollTop=e;a.autofocus()},replaceIntoTextBox:function(a,b){a.val(b).trigger("autosize")},getFixedOffsetParent:function(a){do{if("fixed"==a.css("position"))return a;
a=a.parent()}while(a[0]&&1===a[0].nodeType);return d(h.documentElement)},getFixedOffset:function(a){var b=a.offset(),c=XF.getFixedOffsetParent(a);if(a.is("html"))return b;a=c.offset();return{top:b.top-a.top,left:b.left-a.left}},autoFocusWithin:function(a,b,c){var e=a.find(b||"[autofocus]");e.length||(!e.length&&XF.NavDeviceWatcher.isKeyboardNav()&&(e=a.find("a, button, :input, [tabindex]").filter(":visible").not(":disabled")),e.length||(b=a.is("form:not([data-no-auto-focus])")?a:a.find("form:not([data-no-auto-focus])").first(),
b.length&&(e=b.find(":input, button").filter(":visible").not(":disabled"))),!e.length&&c&&c.length&&(e=c),e.length||(a.attr("tabindex","-1"),e=a));a=[];c=e[0].parentNode;do a.push({el:c,left:c.scrollLeft,top:c.scrollTop});while(c=c.parentNode);e.on("focus",function(){d(k).on("resize",function(){setTimeout(function(){XF.isElementVisible(e)||(e.get(0).scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),d(k).off("resize"))},50)})});e.first().autofocus();for(b=0;b<a.length;b++)c=a[b].el,
c.scrollLeft!=a[b].left&&(c.scrollLeft=a[b].left),c.scrollTop!=a[b].top&&(c.scrollTop=a[b].top)},bottomFix:function(a){var b=d(".js-bottomFixTarget").first();b?b.append(a):d(a).css({position:"fixed",bottom:0}).appendTo("body")},addFixedMessage:function(a,b){var c=d(d.parseHTML('<div class="fixedMessageBar"><div class="fixedMessageBar-inner"><div class="fixedMessageBar-message"></div><a class="fixedMessageBar-close" data-close="true" role="button" tabindex="0" aria-label="'+XF.phrase("close")+'"></a></div></div>'));
c.find(".fixedMessageBar-message").html(a);b&&(b.class&&(c.addClass(b.class),delete b.class),c.attr(b));c.on("click","[data-close]",function(){c.removeClassTransitioned("is-active",function(){c.remove()})});XF.bottomFix(c);c.addClassTransitioned("is-active")},_measureScrollBar:null,measureScrollBar:function(a,b){b="height"==b||"h"==b?"h":"w";if(a||null===XF._measureScrollBar){var c=d('<div class="scrollMeasure" />');c.appendTo(a||"body");var e=c[0];e={w:e.offsetWidth-e.clientWidth,h:e.offsetHeight-
e.clientHeight};c.remove();a||(XF._measureScrollBar=e);return e[b]}return XF._measureScrollBar[b]},windowHeight:function(){return XF.browser.ios||XF.browser.android?k.innerHeight:d(k).height()},pageLoadScrollFix:function(){if(k.location.hash){var a=!1,b=function(){if(!a){var b=k.location.hash.replace(/[^a-zA-Z0-9_-]/g,"");b=b?d("#"+b):d();b.length&&b.get(0).scrollIntoView(!0)}};"complete"==h.readyState?setTimeout(b,0):(setTimeout(function(){d(k).one("scroll",function(b){a=!0})},100),d(k).one("load",
b))}},applyJsState:function(a,b){a=a||{};if(!b)return a;for(var c in b)b.hasOwnProperty(c)&&!a[c]&&XF.jsStates.hasOwnProperty(c)&&XF.jsStates[c]()&&(a[c]=!0);return a},jsStates:{fbSdk:function(){d(h.body).append(d('<div id="fb-root" />'));k.fbAsyncInit=function(){FB.init({version:"v2.7",xfbml:!0})};XF.loadScript("https://connect.facebook.net/"+XF.getLocale()+"/sdk.js");return!0},twitter:function(){k.twttr=function(){var a=k.twttr||{};XF.loadScript("https://platform.twitter.com/widgets.js")&&(a._e=
[],a.ready=function(b){a._e.push(b)});return a}();return!0},flickr:function(){XF.loadScript("https://embedr.flickr.com/assets/client-code.js");return!0},instagram:function(){XF.loadScript("https://platform.instagram.com/"+XF.getLocale()+"/embeds.js",function(){d(h).on("xf:reinit",function(a,b){k.instgrm&&instgrm.Embeds.process(b instanceof d?b.get(0):b)})})},reddit:function(){XF.loadScript("https://embed.redditmedia.com/widgets/platform.js");return!0},reddit_comment:function(){XF.loadScript("https://www.redditstatic.com/comment-embed.js",
function(){d(h).on("xf:reinit",function(a,b){k.rembeddit&&rembeddit.init()})});return!0},imgur:function(){k.imgurEmbed||(k.imgurEmbed={tasks:d("blockquote.imgur-embed-pub").length});XF.loadScript("//s.imgur.com/min/embed-controller.js",function(){d(h).on("xf:reinit",function(a,b){imgurEmbed.tasks+=d("blockquote.imgur-embed-pub").length;for(a=0;a<imgurEmbed.tasks;a++)imgurEmbed.createIframe(),imgurEmbed.tasks--})});return!0},pinterest:function(){XF.loadScript("//assets.pinterest.com/js/pinit.js",function(){d(h).on("xf:reinit",
function(a,b){PinUtils.build(b instanceof d?b.get(0):b)})});return!0}},getLocale:function(){var a=d("html").attr("lang").replace("-","_");a||(a="en_US");return a},isEventTouchTriggered:function(a){return a?(a=a.originalEvent)&&a.sourceCapabilities?a.sourceCapabilities.firesTouchEvents:Modernizr.touchevents:Modernizr.touchevents},getElEffectiveZIndex:function(a){var b=parseInt(a.css("z-index"),10)||0;a.parents().each(function(a,e){a=parseInt(d(e).css("z-index"),10);a>b&&(b=a)});return b},setRelativeZIndex:function(a,
b,c,e){e||(e=6);var f=XF.getElEffectiveZIndex(b);e&&e>f&&(f=e);if(null===c||"undefined"===typeof c)c=0;f||c?a.each(function(){var a=d(this);"undefined"==typeof a.data("base-z-index")&&a.data("base-z-index",parseInt(a.css("z-index"),10)||0);a.css("z-index",a.data("base-z-index")+c+f)}):a.css("z-index","")},adjustHtmlForRte:function(a){a=a.replace(/<img[^>]+>/ig,function(a){if(a.match(/class="([^"]* )?smilie( |")/)){var b;if(b=a.match(/alt="([^"]+)"/))return b[1]}return a});a=a.replace(/([\w\W]|^)<a\s[^>]*data-user-id="\d+"\s+data-username="([^"]+)"[^>]*>([\w\W]+?)<\/a>/gi,
function(a,c,e,d){return c+("@"==c?"":"@")+d.replace(/^@/,"")});return a=a.replace(/(<img\s[^>]*)src="[^"]*"(\s[^>]*)data-url="([^"]+)"/gi,function(a,c,e,d){return c+'src="'+d+'"'+e})},requestAnimationTimeout:function(a,b){function c(){Date.now()-d>=b?a():g.id=e(c)}b||(b=0);var e=k.requestAnimationFrame||function(a){return k.setTimeout(a,1E3/60)},d=Date.now(),g={};g.id=e(c);g.cancel=function(){(k.cancelAnimationFrame||k.clearTimeout)(this.id)};return g},proxy:function(a,b){if("string"===typeof b){var c=
a[b];b=a;a=c}if("function"===typeof a){var e=[].slice.call(arguments,2);return function(){return a.apply(b,e.concat([].slice.call(arguments)))}}}}),"function"!=typeof Object.create&&(Object.create=function(){var a=function(){};return function(b){a.prototype=b;b=new a;a.prototype=null;return b}}()),XF.create=function(a){var b=function(){this.__construct.apply(this,arguments)};b.prototype=Object.create(a);b.prototype.__construct||(b.prototype.__construct=function(){});return b.prototype.constructor=
b},XF.extend=function(a,b){var c=function(){this.__construct.apply(this,arguments)},e;c.prototype=Object.create(a.prototype);c.prototype.__construct||(c.prototype.__construct=function(){});c.prototype.constructor=c;if("object"==typeof b){if("object"==typeof b.__backup){a=b.__backup;for(e in a)if(a.hasOwnProperty(e)){if(c.prototype[a[e]])throw Error("Method "+a[e]+" already exists on object. Aliases must be unique.");c.prototype[a[e]]=c.prototype[e]}delete b.__backup}for(e in b)b.hasOwnProperty(e)&&
(c.prototype[e]=b[e])}return c},XF.classToConstructor=function(a){var b=k,c=a.split("."),e;for(e=0;e<c.length;e++)b=b[c[e]];return"function"!=typeof b?(console.error("%s is not a function.",a),!1):b},XF.Cookie={get:function(a){return(a=(new RegExp("(^| )"+XF.config.cookie.prefix+a+"=([^;]+)(;|$)")).exec(h.cookie))?decodeURIComponent(a[2]):null},set:function(a,b,c){var e=XF.config.cookie;h.cookie=e.prefix+a+"="+encodeURIComponent(b)+(void 0===c?"":";expires="+c.toUTCString())+(e.path?";path="+e.path:
"")+(e.domain?";domain="+e.domain:"")+(e.secure?";secure":"")},getJson:function(a){a=this.get(a);if(!a)return{};try{return d.parseJSON(a)||{}}catch(b){return{}}},setJson:function(a,b,c){this.set(a,JSON.stringify(b),c)},remove:function(a){var b=XF.config.cookie;h.cookie=b.prefix+a+"="+(b.path?"; path="+b.path:"")+(b.domain?"; domain="+b.domain:"")+(b.secure?"; secure":"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}},XF.LocalStorage={getKeyName:function(a){return XF.config.cookie.prefix+a},get:function(a){var b=
null;try{b=k.localStorage.getItem(this.getKeyName(a))}catch(e){}if(null===b){var c=this.getFallbackValue();c&&c.hasOwnProperty(a)&&(b=c[a])}return b},getJson:function(a){a=this.get(a);if(!a)return{};try{return d.parseJSON(a)||{}}catch(b){return{}}},set:function(a,b,c){try{k.localStorage.setItem(this.getKeyName(a),b)}catch(e){c&&(c=this.getFallbackValue(),c[a]=b,this.updateFallbackValue(c))}},setJson:function(a,b,c){this.set(a,JSON.stringify(b),c)},remove:function(a){try{k.localStorage.removeItem(this.getKeyName(a))}catch(c){}var b=
this.getFallbackValue();b&&b.hasOwnProperty(a)&&(delete b[a],this.updateFallbackValue(b))},getFallbackValue:function(){var a=XF.Cookie.get("ls");if(a)try{a=d.parseJSON(a)}catch(b){a={}}return a||{}},updateFallbackValue:function(a){d.isEmptyObject(a)?XF.Cookie.remove("ls"):XF.Cookie.set("ls",JSON.stringify(a))}},XF.CrossTab=function(){function a(a){var c=XF.LocalStorage.getKeyName("__crossTab");if(a.key===c){try{var f=d.parseJSON(a.newValue)}catch(p){return}if(f&&f.event&&(a=f.event,f=f.data||null,
c=b[a])){e=a;for(a=0;a<c.length;a++)c[a](f);e=null}}}var b={},c=!1,e;return{on:function(e,d){b[e]||(b[e]=[]);b[e].push(d);c||(c=!0,k.addEventListener("storage",a))},trigger:function(a,b,c){!c&&e&&e==a||XF.LocalStorage.setJson("__crossTab",{event:a,data:b,_:new Date+Math.random()})}}}(),XF.Breakpoint=function(){function a(a){for(var b=0;b<f.length&&a!=f[b];b++)if(e==f[b])return!0;return!1}function b(a){for(var b=!1,c=0;c<f.length;c++)if(a==f[c])b=!0;else if(e==f[c])return b;return!1}function c(){var a=
k.getComputedStyle(d("html")[0],":after").getPropertyValue("content").replace(/"/g,"");if(e){if(a!=e){var b=e;e=a;d(h).trigger("breakpoint:change",[b,a])}}else e=a;return e}var e=null,f=["narrow","medium","wide","full"];c();d(k).onPassive("resize",c);return{current:function(){return e},refresh:c,isNarrowerThan:a,isAtOrNarrowerThan:function(b){return e==b||a(b)},isWiderThan:b,isAtOrWiderThan:function(a){return e==a||b(a)}}}(),XF.JobRunner=function(){var a=!1,b,c=null,e=function(){d.ajax({url:XF.canonicalizeUrl("job.php"),
type:"post",cache:!1,dataType:"json",global:!1}).always(function(a){a&&a.more&&setTimeout(e,100)})},f=function(){c&&c.hide();a=!1;d(h).trigger("job:manual-complete");b&&b.abort();b=null},g=function(){if(c)return c;var a=XF.getOverlayHtml({title:XF.phrase("processing..."),dismissible:!1,html:'<div class="blockMessage"><span id="xfManualJobStatus">'+XF.phrase("processing...")+"</span></div>"});return c=new XF.Overlay(a,{backdropClose:!1,keyboard:!1})};return{isManualJobRunning:function(){return a},
runAuto:e,runManual:function(c){var e=XF.config.job.manualUrl;if(e){if(null===c)l=null;else{var l=l||[];"integer"===typeof c?l.push(c):Array.isArray(c)&&l.push.apply(l,c)}if(!a){a=!0;g().show();var h=function(a){b=XF.ajax("post",e,a?{only_id:a}:null,function(b){b.jobRunner?(d("#xfManualJobStatus").text(b.jobRunner.status||XF.phrase("processing...")),setTimeout(function(){h(a)},0)):k()},{skipDefault:!0}).fail(f)},k=function(){Array.isArray(l)&&0==l.length?f():h(l?l.shift():null)};k()}}},stopManual:f,
getManualOverlay:g}}(),XF.Loader=function(){var a=XF.config.css,b=XF.config.js,c=function(c,f,g){c=c||[];f=f||[];var e=[],h=[],k;for(k=0;k<c.length;k++)b.hasOwnProperty(c[k])||e.push(c[k]);for(k=0;k<f.length;k++)a.hasOwnProperty(f[k])||h.push(f[k]);var t=(e.length?1:0)+(h.length?1:0),q=function(){t--;0==t&&g&&g()};t?(e.length&&XF.loadScripts(e,function(){d.each(e,function(a,c){b[c]=!0});q()}),h.length&&((c=XF.config.url.css)?(c=c.replace("__SENTINEL__",h.join(",")),d.ajax({type:"GET",url:c,cache:!0,
global:!1,dataType:"text",success:function(a){var b=XF.config.url.basePath;b&&(a=a.replace(/(url\(("|')?)([^"')]+)(("|')?\))/gi,function(a,c,e,d,f,g){d.match(/^([a-z]+:|\/)/i)||(d=b+d);return c+d+f}));d("<style>"+a+"</style>").appendTo("head")}}).always(function(){d.each(h,function(b,c){a[c]=!0});q()})):(console.error("No CSS URL so cannot dynamically load CSS"),q()))):g&&g()};return{load:c,loadCss:function(a,b){c([],a,b)},loadJs:function(a,b){c(a,[],b)}}}(),XF.ClassMapper=XF.create({_map:{},_toExtend:{},
add:function(a,b){this._map[a]=b},extend:function(a,b){var c=this.getObjectFromIdentifier(a);c?(c=XF.extend(c,b),this._map[a]=c):(this._toExtend[a]||(this._toExtend[a]=[]),this._toExtend[a].push(b))},getObjectFromIdentifier:function(a){var b=this._map[a],c=this._toExtend[a];if(!b)return null;if("string"==typeof b){b=XF.classToConstructor(b);if(c){for(var e=0;e<c.length;e++)b=XF.extend(b,c[e]);delete this._toExtend[a]}this._map[a]=b}return b}}),XF.ActionIndicator=function(){var a=0,b,c=function(){a++;
1==a&&(b||(b=d('<span class="globalAction"><span class="globalAction-bar" /><span class="globalAction-block"><i></i><i></i><i></i></span></span>').appendTo("body")),b.addClassTransitioned("is-active"))},e=function(){a--;0<a||(a=0,b.removeClassTransitioned("is-active"))};return{initialize:function(){d(h).on({ajaxStart:c,"xf:action-start":c,ajaxStop:e,"xf:action-stop":e})},show:c,hide:e}}(),XF.DynamicDate=function(){var a,b,c,e,f,g,l,p=!1,m,t=function(){m=setInterval(function(){q(h)},2E4)},q=function(h){p||
this.initialize();h=d(h).find("time[data-time]");var k=h.length,t=Math.floor((new Date).getTime()/1E3)-a;if(b+t>c+86400){var m=Math.floor((b+t-c)/86400);c+=86400*m;e=(e+m)%7;f=c-86400;g=c+86400;l=c-518400}for(var q=0;q<k;q++){m=h[q];var n=d(m);var v=parseInt(m.getAttribute("data-time"),10);var r=b-v+t;var w=m.xfDynType;-2>r?(r=v-(b+t),60>r?"futureMoment"!=w&&(n.text(XF.phrase("in_a_moment")),m.xfDynType="futureMoment"):120>r?"futureMinute"!=w&&(n.text(XF.phrase("in_a_minute")),m.xfDynType="futureMinute"):
3600>r?(v=Math.floor(r/60),w!=="futureMinutes"+v&&(n.text(XF.phrase("in_x_minutes",{"{minutes}":v})),m.xfDynType="futureMinutes"+v)):v<g?"latertoday"!=w&&(n.text(XF.phrase("later_today_at_x",{"{time}":n.attr("data-time-string")})),m.xfDynType="latertoday"):v<g+86400?"tomorrow"!=w&&(n.text(XF.phrase("tomorrow_at_x",{"{time}":n.attr("data-time-string")})),m.xfDynType="tomorrow"):(604800>r||(n.attr("data-full-date")?n.text(XF.phrase("date_x_at_time_y",{"{date}":n.attr("data-date-string"),"{time}":n.attr("data-time-string")})):
n.text(n.attr("data-date-string"))),m.xfDynType="future")):60>=r?"moment"!==w&&(n.text(XF.phrase("a_moment_ago")),m.xfDynType="moment"):120>=r?"minute"!==w&&(n.text(XF.phrase("one_minute_ago")),m.xfDynType="minute"):3600>r?(v=Math.floor(r/60),w!=="minutes"+v&&(n.text(XF.phrase("x_minutes_ago",{"{minutes}":v})),m.xfDynType="minutes"+v)):v>=c?"today"!==w&&(n.text(XF.phrase("today_at_x",{"{time}":n.attr("data-time-string")})),m.xfDynType="today"):v>=f?"yesterday"!==w&&(n.text(XF.phrase("yesterday_at_x",
{"{time}":n.attr("data-time-string")})),m.xfDynType="yesterday"):v>=l?"week"!==w&&(w=e-Math.ceil((c-v)/86400),0>w&&(w+=7),n.text(XF.phrase("day_x_at_time_y",{"{day}":XF.phrase("day"+w),"{time}":n.attr("data-time-string")})),m.xfDynType="week"):"old"!==w&&(n.attr("data-full-date")?n.text(XF.phrase("date_x_at_time_y",{"{date}":n.attr("data-date-string"),"{time}":n.attr("data-time-string")})):n.text(n.attr("data-date-string")),m.xfDynType="old")}};return{initialize:function(){if(!p){p=!0;var r=XF.config.time,
A=d("#_xfClientLoadTime"),u=A.val();if(u&&u.length){var x=u.split(",");2==x.length&&parseInt(x[1],10)==r.now&&(a=parseInt(x[0],10),A.val(u))}a||(k.performance&&k.performance.timing&&0!==k.performance.timing.requestStart?(u=k.performance.timing,a=Math.floor((u.requestStart+u.responseStart)/2E3)):a=Math.floor((new Date).getTime()/1E3)-1,A.val(a+","+r.now));b=r.now;c=r.today;e=r.todayDow;f=c-86400;g=c+86400;l=c-518400;void 0!==h.hidden?(h.hidden||t(),d(h).on("visibilitychange",function(){h.hidden?clearInterval(m):
(t(),q(h))})):t()}},refresh:q}}(),XF.KeepAlive=function(){var a,b,c=!1,e,f=function(){var a=3E3+(Math.floor(241*Math.random())+-120);120>a&&(a=120);e&&clearInterval(e);e=setInterval(h,1E3*a)},g=0,l,h=function(){c&&(!1===k.navigator.onLine&&(g++,5>=g&&(l=setTimeout(h,30))),g=0,clearTimeout(l),d.ajax({url:XF.canonicalizeUrl(a),data:{_xfResponseType:"json",_xfToken:XF.config.csrf},type:"post",cache:!1,dataType:"json",global:!1}).done(function(a){"ok"==a.status&&(m(a),XF.CrossTab.trigger(b,a))}))},m=
function(a){a.csrf&&(XF.config.csrf=a.csrf,d("input[name=_xfToken]").val(a.csrf));if("undefined"!==typeof a.user_id){var b=d(".js-activeUserChangeMessage");a.user_id==XF.config.userId||b.length||XF.addFixedMessage(XF.phrase("active_user_changed_reload_page"),{"class":"js-activeUserChangeMessage"});a.user_id==XF.config.userId&&b.length&&b.remove()}f()};return{initialize:function(){if(!c&&XF.config.url.keepAlive&&XF.config.url.keepAlive.length){c=!0;a=XF.config.url.keepAlive;b="keepAlive"+XF.stringHashCode(a);
f();XF.CrossTab.on(b,m);if(k.performance&&k.performance.navigation){var e=k.performance.navigation.type;0!=e&&1!=e||XF.CrossTab.trigger(b,{csrf:XF.config.csrf,time:XF.config.time.now,user_id:XF.config.userId})}XF.Cookie.get("csrf")||h()}},refresh:h}}(),XF.LinkWatcher=function(){var a=function(a){var b=d(this),c=b.data("proxy-href"),g=b.data("proxy-handler-last");!c||g&&g==a.timeStamp||(b.data("proxy-handler-last",a.timeStamp),d.ajax({url:XF.canonicalizeUrl(c),data:{_xfResponseType:"json",referrer:k.location.href.replace(/#.*$/,
"")},type:"post",cache:!1,dataType:"json",global:!1}))},b=function(a){if(XF.config.enableRtnProtect&&!a.isDefaultPrevented()){var b=d(this),c=b.attr("href"),g=b.data("blank-handler-last");if(c&&(!c.match(/^[a-z]:/i)||c.match(/^https?:/i))){if(b.is("[rel~=noopener]")){var l=XF.browser;if(l.chrome&&49<=l.version||l.mozilla&&52<=l.version||l.safari&&11<=l.version)return}if(!(b.closest("[contenteditable=true]").length||(c=XF.canonicalizeUrl(c),(new RegExp("^[a-z]+://"+location.host+"(/|$|:)","i")).test(c)||
g&&g==a.timeStamp||(b.data("blank-handler-last",a.timeStamp),l=navigator.userAgent,b=-1!==l.indexOf("MSIE"),g=-1!==l.indexOf("Safari")&&-1==l.indexOf("Chrome"),l=-1!==l.indexOf("Gecko/"),a.shiftKey&&l||g&&(a.shiftKey||a.altKey)||b)))){if(g)b=d('<iframe style="display: none" />').appendTo(h.body),g=b[0].contentDocument||b[0].contentWindow.document,g.__href=c,c=d("<script />",g),c[0].text="window.opener=null;window.parent=null;window.top=null;window.frameElement=null;window.open(document.__href).opener = null;",
g.body.appendChild(c[0]),b.remove();else{c=k.open(c);try{c.opener=null}catch(p){}}a.preventDefault()}}}};return{initLinkProxy:function(){var b="a[data-proxy-href]:not(.link--internal)";d(h).on("click",b,a).on("focusin",b,function(b){b=d(this);b.data("proxy-handler")||b.data("proxy-handler",!0).click(a)})},initExternalWatcher:function(){d(h).on("click","a[target=_blank]",b).on("focusin","a[target=_blank]",function(a){a=d(this);a.data("blank-handler")||a.data("blank-handler",!0).click(b)})}}}(),XF._IgnoredWatcher=
XF.create({options:{container:"body",ignored:".is-ignored",link:".js-showIgnored"},$container:null,authors:[],shown:!1,__construct:function(a){this.options=d.extend(!0,{},this.options,a||{});this.$container=a=d(this.options.container);this.updateState();a.on("click",this.options.link,XF.proxy(this,"show"))},refresh:function(a){this.$container.find(a).length&&(this.shown?this.show():this.updateState())},updateState:function(){if(!this.shown){var a=this.getIgnored(),b=[];if(a.length)if(a.each(function(){var a=
d(this).data("author");a&&-1===d.inArray(a,b)&&b.push(a)}),b.length){var c={names:b.join(", ")};this.getLinks().each(function(){var a=d(this),b=a.attr("title");b&&a.attr("title",Mustache.render(b,c)).removeClass("is-hidden")})}else this.getLinks().each(function(){d(this).removeAttr("title").removeClass("is-hidden")})}},getIgnored:function(){return this.$container.find(this.options.ignored)},getLinks:function(){return this.$container.find(this.options.link)},show:function(){this.shown=!0;this.getIgnored().removeClass("is-ignored");
this.getLinks().addClass("is-hidden")},initializeHash:function(){if(k.location.hash){var a=k.location.hash.replace(/[^\w_#-]/g,"");if("#"!==a){a=d(a);var b=this.options.ignored;(b=a.is(b)?a:a.closest(b))&&b.length&&(b.removeClass("is-ignored"),a.get(0).scrollIntoView(!0))}}}}),XF.IgnoreWatcher=new XF._IgnoredWatcher,XF.Overlay=XF.create({options:{backdropClose:!0,escapeClose:!0,focusShow:!0,className:""},$container:null,$overlay:null,shown:!1,__construct:function(a,b){this.options=d.extend(!0,{},
this.options,b||{});this.$overlay=a instanceof d?a:d(d.parseHTML(a));this.$overlay.attr("role",this.options.role||"dialog").attr("aria-hidden","true");this.$container=d('<div class="overlay-container" />').html(this.$overlay);this.$container.data("overlay",this).xfUniqueId();var c=this;if(this.options.escapeClose)this.$container.on("keydown.overlay",function(a){27===a.which&&c.hide()});this.options.backdropClose&&(this.$container.on("mousedown",function(a){c.$container.data("block-close",!1);d(a.target).is(c.$container)||
c.$container.data("block-close",!0)}),this.$container.on("click",function(a){d(a.target).is(c.$container)&&(c.$container.data("block-close")||c.hide());c.$container.data("block-close",!1)}));this.options.className&&this.$container.addClass(this.options.className);this.$container.on("click",".js-overlayClose",XF.proxy(this,"hide"));this.$container.appendTo("body");XF.activate(this.$container);XF.Overlay.cache[this.$container.attr("id")]=this;this.$overlay.on("overlay:hide",XF.proxy(this,"hide"));this.$overlay.on("overlay:show",
XF.proxy(this,"show"))},show:function(){if(!this.shown){var a=this,b=this.$overlay;this.shown=!0;b.attr("aria-hidden","false");this.$container.appendTo("body").addClassTransitioned("is-active",function(){if(a.options.focusShow){var c=b.find(".js-overlayClose");XF.autoFocusWithin(b.find(".overlay-content"),null,c)}a.$container.trigger("overlay:shown");XF.layoutChange()});a.$container.trigger("overlay:showing");XF.Modal.open();XF.layoutChange()}},hide:function(){if(this.shown){this.shown=!1;this.$overlay.attr("aria-hidden",
"true");var a=this;this.$container.removeClassTransitioned("is-active",function(){a.$container.trigger("overlay:hidden");XF.Modal.close();XF.layoutChange()});a.$container.trigger("overlay:hiding");XF.layoutChange()}},recalculate:function(){this.shown&&XF.Modal.updateScrollbarPadding()},toggle:function(){this.shown?this.hide():this.show()},destroy:function(){var a=this.$container.attr("id"),b=XF.Overlay.cache;this.$container.remove();b.hasOwnProperty(a)&&delete b[a]},on:function(){this.$container.on.apply(this.$container,
arguments)},getContainer:function(){return this.$container},getOverlay:function(){return this.$overlay}}),XF.Overlay.cache={},XF.Modal=function(){var a=0,b=d("body").first(),c=d("html"),e=function(){var a="right",e=b.hasClass("is-modalOpen")?XF.measureScrollBar()+"px":"";XF.isRtl()&&(XF.browser.chrome||XF.browser.mozilla||(a="left"));c.css("margin-"+a,e)};return{getOpenCount:function(){return a},open:function(){a++;1==a&&(b.addClass("is-modalOpen"),e())},close:function(){0<a&&(a--,0==a&&(b.removeClass("is-modalOpen"),
e()))},updateScrollbarPadding:e}}(),XF.showOverlay=function(a,b){a=new XF.Overlay(a,b);a.show();return a},XF.loadOverlay=function(a,b,c){d.isFunction(b)&&(b={init:b});b=d.extend({cache:!1,beforeShow:null,afterShow:null,onRedirect:null,init:null,show:!0},b||{});var e=function(a){if(b.beforeShow){var c=d.Event();b.beforeShow(a,c);if(c.isDefaultPrevented())return}b.show&&a.show();b.afterShow&&(c=d.Event(),b.afterShow(a,c),c.isDefaultPrevented())};if(b.cache&&XF.loadOverlay.cache[a])e(XF.loadOverlay.cache[a]);
else{var f=function(d){if(d.redirect)if(b.onRedirect)b.onRedirect(d,f);else XF.ajax("get",d.redirect,function(a){f(a)});d.html&&XF.setupHtmlInsert(d.html,function(d,g,f){var l=new XF.Overlay(XF.getOverlayHtml({html:d,title:g.title||g.h1}),c);b.init&&b.init(l);if(!b.cache)l.on("overlay:hidden",function(){l.destroy()});f();b.cache&&(XF.loadOverlay.cache[a]=l);e(l)})};return XF.ajax("get",a,function(a){f(a)})}},XF.loadOverlay.cache={},XF.NavDeviceWatcher=function(){function a(a){a!=b&&(d("html").toggleClass("has-pointer-nav",
!a),b=a)}var b=!0;return{initialize:function(){d(h).onPassive({mousedown:function(){a(!1)},keydown:function(b){switch(b.which){case 9:case 13:a(!0)}}})},toggle:a,isKeyboardNav:function(){return b}}}(),XF.ScrollButtons=function(){function a(a){if(!t){a=k.pageYOffset||h.documentElement.scrollTop;var c=A;A=a;if(a>c)"down"!=u&&(u="down",x=c);else if(a<c)"up"!=u&&(u="up",x=c);else return;if(q){if("up"!==u||100>A){z&&(z.cancel(),z=null);return}if(30>x-a)return}z||(z=XF.requestAnimationTimeout(function(){z=
null;b();e()},200))}}function b(){r||(n.addClassTransitioned("is-active"),r=!0)}function c(){r&&(n.removeClassTransitioned("is-active"),r=!1)}function e(){f();m=setTimeout(function(){c()},3E3)}function f(){clearTimeout(m)}function g(){f();b()}function l(){f()}function p(){t=!0;setTimeout(function(){t=!1},500);c()}var m=null,t=!1,q=!1,r=!1,A=k.pageYOffset||h.documentElement.scrollTop,u=null,x=null,z,n=null;return{initialize:function(){if(n&&n.length)return!1;n=d(".js-scrollButtons");if(!n.length)return!1;
"up"===n.data("trigger-type")&&(q=!0);n.on({"mouseenter focus":g,"mouseleave blur":l,click:p});d(k).onPassive("scroll",a);return!0},show:b,hide:c,startHideTimer:e,clearHideTimer:f}}(),XF.KeyboardShortcuts=function(){function a(c){c=d(c);1<c.length?c.each(function(){a(this)}):(c.is("[data-xf-key]")&&b(c[0]),c.find("[data-xf-key]").each(function(){b(this)}))}function b(a){var b=String(d(a).data("xf-key")),c=b.substr(b.lastIndexOf("+")+1),e="#"===c[0]?c.substr(1):c.toUpperCase().charCodeAt(0),g=b.toUpperCase().split("+");
var h=-1!==g.indexOf("CTRL");var k=-1!==g.indexOf("ALT");g=-1!==g.indexOf("META");(h=0+h?1:0+k?2:0+g?4:0)?XF.Keyboard.isStandardKey(e)?(f[e]=f[e]||{},f[e][h]=a):console.warn("It is not possible to specify a keyboard shortcut using this key combination (%s)",b):f[c]=a}function c(a){switch(a.which){case 27:XF.MenuWatcher.closeAll();XF.hideTooltips();return;case 16:case 17:case 18:case 91:return}if(XF.Keyboard.isShortcutAllowed(h.activeElement)&&(!f.hasOwnProperty(a.key)||0!=(0+a.ctrlKey?1:0+a.altKey?
2:0+a.metaKey?4:0)||!e(f[a.key]))&&f.hasOwnProperty(a.which)){var b=0+a.ctrlKey?1:0+a.altKey?2:0+a.metaKey?4:0;f[a.which].hasOwnProperty(b)&&e(f[a.which][b])}}function e(a){a=d(a).filter(":visible");return a.length?(XF.NavDeviceWatcher.toggle(!0),a.is(XF.getKeyboardInputs())?a.autofocus():a.is("a[href]")?a.get(0).click():a.click(),!0):!1}var f={};return{initialize:function(){d(h.body).onPassive("keyup",c)},initializeElements:a}}(),XF.Keyboard={isShortcutAllowed:function(a){switch(a.tagName){case "TEXTAREA":case "SELECT":return!1;
case "INPUT":switch(a.type){case "checkbox":case "radio":case "submit":case "reset":return!0;default:return!1}case "BODY":return!0;default:return"true"===a.contentEditable?!1:!0}},isStandardKey:function(a){return 48<=a&&90>=a}},XF.FormInputValidation=function(){function a(b){b=d(b);1<b.length?b.each(function(){a(this)}):b.is("form")&&c(b)}function b(){f.length&&f.each(function(){c(d(this))})}function c(a){a.find(":input").on("invalid",{form:a},e)}function e(a){var b=d(this);a=a.data.form;var c=a.find(":invalid").first();
b[0]!==c[0]||XF.isElementVisible(b)||(a=a.closest(".overlay-container.is-active"),a.length?a.scrollTop(b.offset().top-a.offset().top+a.scrollTop()-100):(b[0].scrollIntoView(),k.scrollBy(0,-100)))}var f={};return{initialize:function(){f=d("form").not("[novalidate]");b()},initializeElements:a}}(),XF.NoticeWatcher=function(){return{initialize:function(){d(h).on("xf:notice-change xf:layout",XF.proxy(this,"checkNotices"));this.checkNotices()},checkNotices:function(){var a=0;d(h).find(".js-bottomFixTarget .js-notice").each(function(){var b=
d(this);b.is(":visible")&&(a+=b.height())});d(h).find("footer.p-footer").css("margin-bottom",a)}}}(),XF.BbBlockExpand=function(){function a(a){d(a).find(".bbCodeBlock--expandable:not(.is-expanded)").each(function(){var a=d(this),b=a.find(".bbCodeBlock-expandContent")[0];if(b){var f,g=0,l=function(){var c=b.scrollHeight,e=b.offsetHeight;0==c||0==e?1E3<g||(f&&(clearTimeout(f),g+=200),f=setTimeout(l,g)):c>e+1?a.addClass("is-expandable"):a.removeClass("is-expandable")};l();if(!a.data("expand-check-triggered")&&
(a.data("expand-check-triggered",!0),a.find("img").one("load",l),k.MutationObserver)){var h,m=!0,t=function(){m=!1;l();setTimeout(function(){m=!0},100)};var q=new MutationObserver(function(b){a.hasClass("is-expanded")?q.disconnect():m&&(h&&clearTimeout(h),h=setTimeout(t,200))});q.observe(this,{attributes:!0,childList:!0,subtree:!0})}}})}return{watch:function(){d(h).on("click",".bbCodeBlock-expandLink",function(a){d(a.target).closest(".bbCodeBlock--expandable").addClassTransitioned("is-expanded",XF.layoutChange)});
d(k).onPassive("resize",function(){a(h)});d(h).on("embed:loaded",function(){a(h)})},checkSizing:a}}(),XF.Click=function(){var a=new XF.ClassMapper,b=function(b,c){b=d(b);var e=b.data("xf-click").split(" ")||[],f=b.data("xf-click-handlers")||{},h;for(h=0;h<e.length;h++){var k=e[h];if(k.length){if(!f[k]){var t=a.getObjectFromIdentifier(k);if(!t){console.error("Could not find handler for "+k);continue}var q=b.data("xf-"+k)||{};f[k]=new t(b,q)}if(c&&!1===f[k]._click(c))break}}b.data("xf-click-handlers",
f);return f},c=XF.create({initialized:!1,eventNameSpace:null,$target:null,options:{},__construct:function(a,b){this.$target=a;this.options=XF.applyDataOptions(this.options,a.data(),b);if(!this.eventNameSpace)throw Error("Please provide an eventNameSpace for your extended click handler class");this._init()},_init:function(){var a=new d.Event("xf-click:before-init."+this.eventNameSpace),b=!1;this.$target.trigger(a,[this]);a.isDefaultPrevented()||(b=this.init(),this.$target.trigger("xf-click:after-init."+
this.eventNameSpace,[this,b]));this.initialized=!0;return b},_click:function(a){var b=new d.Event("xf-click:before-click."+this.eventNameSpace);this.$target.trigger(b,[this]);b.isDefaultPrevented()||(b=this.click(a),this.$target.trigger("xf-click:after-click."+this.eventNameSpace,[this,b,a]));return null},init:function(){console.error("This is the abstract init method for XF.Click, which should be overridden.")},click:function(a){console.error("This is the abstract click method for XF.Click, which should be overridden.")}});
return{watch:function(){d(h).on("click","[data-xf-click]",function(a){var c=a.currentTarget;if(c&&c.getAttribute){var e=d(c);e.is("a")&&!e.data("click-allow-modifier")&&(a.ctrlKey||a.shiftKey||a.altKey||a.metaKey||1<a.which)||e.closest("[contenteditable=true]").length||b(c,a)}})},initElement:b,getElementHandler:function(a,b){var c=a.data("xf-click-handlers");c||(c=XF.Click.initElement(a[0]));return c&&c[b]?c[b]:null},register:function(b,c){a.add(b,c)},extend:function(b,c){a.extend(b,c)},newHandler:function(a){return XF.extend(c,
a)},AbstractHandler:c}}(),XF.Element=function(){var a=[],b=new XF.ClassMapper,c=function(c,d,e){var f=c.data("xf-element-handlers")||{};if(f[d])return f[d];var g=b.getObjectFromIdentifier(d);if(!g)return null;e=new g(c,e||{});f[d]=e;c.data("xf-element-handlers",f);c="XF.Element.Handler."+d;a[c]=a[c]||[];a[c].push(e);e.init();return e},e=function(a){a instanceof d&&(a=a[0]);if(a&&a.getAttribute){var b=a.getAttribute("data-xf-init");if(b){b=b.split(" ");var e=b.length;a=d(a);for(var f,g=0;g<e;g++)(f=
b[g])&&c(a,f,a.data("xf-"+f))}}},f=function(a){a=d(a);1<a.length?a.each(function(){f(this)}):(a.is("[data-xf-init]")&&e(a[0]),a.find("[data-xf-init]").each(function(){e(this)}))},g=XF.create({$target:null,options:{},__construct:function(a,b){this.$target=a;this.options=XF.applyDataOptions(this.options,a.data(),b)},init:function(){console.error("This is the abstract init method for XF.Element, which should be overridden.")},getOption:function(a){return this.options[a]}});return{register:function(a,
c){b.add(a,c)},extend:function(a,c){b.extend(a,c)},initialize:f,initializeElement:e,applyHandler:c,getHandler:function(a,b){var c=a.data("xf-element-handlers");void 0===c&&(e(a),c=a.data("xf-element-handlers"));return c&&c[b]?c[b]:null},getHandlers:function(b){b="XF.Element.Handler."+b;return"undefined"!=typeof a[b]?a[b]:!1},newHandler:function(a){return XF.extend(g,a)},AbstractHandler:g}}(),XF.AutoCompleteResults=XF.create({selectedResult:0,$results:!1,$scrollWatchers:null,resultsVisible:!1,resizeBound:!1,
options:{},__construct:function(a){this.options=d.extend({onInsert:null,clickAttacher:null},a)},isVisible:function(){return this.resultsVisible},hideResults:function(){this.resultsVisible=!1;this.$results&&this.$results.hide();this.stopScrollWatching()},stopScrollWatching:function(){this.$scrollWatchers&&(this.$scrollWatchers.off("scroll.autocomplete"),this.$scrollWatchers=null)},showResults:function(a,b,c,e){var f;if(b){this.resultsVisible=!1;this.$results?this.$results.hide().empty():(this.$results=
d("<ul />").css({position:"absolute",display:"none"}).addClass("autoCompleteList").attr("role","listbox").appendTo(h.body),XF.setRelativeZIndex(this.$results,c,1));a=new RegExp("("+XF.regexQuote(a)+")","i");for(f in b)if(b.hasOwnProperty(f)){var g=b[f];var l=d("<li />").css("cursor","pointer").attr("unselectable","on").attr("role","option").mouseenter(XF.proxy(this,"resultMouseEnter"));this.options.clickAttacher?this.options.clickAttacher(l,XF.proxy(this,"resultClick")):l.click(XF.proxy(this,"resultClick"));
"string"==typeof g?l.html(XF.htmlspecialchars(g).replace(a,"<strong>$1</strong>")).data("autocomplete",g):(l.html(XF.htmlspecialchars(g.text).replace(a,"<strong>$1</strong>")).data("autocomplete",g.text),"undefined"!==typeof g.icon?l.prepend(d('<img class="autoCompleteList-icon" />').attr("src",g.icon)):"undefined"!==typeof g.iconHtml&&l.prepend(d('<span class="autoCompleteList-icon" />').html(g.iconHtml)));l.appendTo(this.$results)}if(this.$results.children().length){this.selectResult(0,!0);if(!this.resizeBound)d(k).onPassive("resize",
XF.proxy(this,"hideResults"));this.$results.css({top:"",left:"",right:"",bottom:""});var p=this.$results,m=function(a){d.isFunction(a)&&(a=a(p,c));if(!a){var b=c.offset();a={top:b.top+c.outerHeight(),left:b.left};XF.isRtl()&&(a.right=d("html").width()-b.left-c.outerWidth(),a.left="auto")}return a};this.stopScrollWatching();(b=c.parents().filter(function(){switch(d(this).css("overflow-x")){case "scroll":case "auto":return!0;default:return!1}}))&&b.length&&(b.on("scroll.autocomplete",function(){p.css(m(e))}),
this.$scrollWatchers=b);this.$results.css(m(e)).show();this.resultsVisible=!0}}else this.hideResults()},resultClick:function(a){a.stopPropagation();this.insertResult(d(a.currentTarget).data("autocomplete"));this.hideResults()},resultMouseEnter:function(a){this.selectResult(d(a.currentTarget).index(),!0)},selectResult:function(a,b){if(this.$results){var c=this.selectedResult=b?a:this.selectedResult+a;a=this.$results.children();a.each(function(a){a==c?d(this).addClass("is-selected"):d(this).removeClass("is-selected")});
if(0>c||c>=a.length)this.selectedResult=-1}},insertSelectedResult:function(){var a,b=!1;if(!this.resultsVisible)return!1;0<=this.selectedResult&&(a=this.$results.children().get(this.selectedResult))&&(this.insertResult(d(a).data("autocomplete")),b=!0);this.hideResults();return b},insertResult:function(a){if(this.options.onInsert)this.options.onInsert(a)}}),XF.pageDisplayTime=Date.now(),d(XF.onPageLoad),d(k).on("pageshow",function(){if(!XF.pageDisplayTime||Date.now()>XF.pageDisplayTime)XF.pageDisplayTime=
Date.now()}))}(window.jQuery,window,document);

/*
 * XenForo action.min.js
 * Copyright 2010-2018 XenForo Ltd.
 * Released under the XenForo License Agreement: https://xenforo.com/license-agreement
 */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,d,f){c instanceof String&&(c=String(c));for(var h=c.length,a=0;a<h;a++){var b=c[a];if(d.call(f,b,a,c))return{i:a,v:b}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,d,f){c!=Array.prototype&&c!=Object.prototype&&(c[d]=f.value)};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,d,f,h){if(d){f=$jscomp.global;c=c.split(".");for(h=0;h<c.length-1;h++){var a=c[h];a in f||(f[a]={});f=f[a]}c=c[c.length-1];h=f[c];d=d(h);d!=h&&null!=d&&$jscomp.defineProperty(f,c,{configurable:!0,writable:!0,value:d})}};
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,f){return $jscomp.findInternal(this,c,f).v}},"es6","es3");
!function(c,d,f,h){XF.AttributionClick=XF.Click.newHandler({eventNameSpace:"XFAttributionClick",options:{contentSelector:null},init:function(){},click:function(a){var b=this.options.contentSelector,g=c(b);if(g.length){try{var e=g.offset().top;"pushState"in d.history&&d.history.pushState({},"",d.location.toString().replace(/#.*$/,"")+b);c("html, body").animate({scrollTop:e},XF.config.speed.normal,function(){d.history.pushState||(d.location.hash=b)})}catch(k){d.location.hash=b}a.preventDefault()}}});
XF.LikeClick=XF.Click.newHandler({eventNameSpace:"XFLikeClick",options:{likeList:null},processing:!1,init:function(){},click:function(a){a.preventDefault();if(!this.processing){this.processing=!0;a=this.$target.attr("href");var b=this;XF.ajax("POST",a,{},XF.proxy(this,"handleAjax"),{skipDefaultSuccess:!0}).always(function(){setTimeout(function(){b.processing=!1},250)})}},handleAjax:function(a){var b=this.$target;a.addClass&&b.addClass(a.addClass);a.removeClass&&b.removeClass(a.removeClass);if(a.text){var g=
b.find(".label");g.length||(g=b);g.text(a.text)}var e=this.options.likeList?XF.findRelativeIf(this.options.likeList,b):c([]);"undefined"!==typeof a.html&&e.length&&(a.html.content?XF.setupHtmlInsert(a.html,function(a,b){e.html(a).addClassTransitioned("is-active")}):e.removeClassTransitioned("is-active",function(){e.empty()}))}});XF.PreviewClick=XF.Click.newHandler({eventNameSpace:"XFPreviewClick",options:{previewUrl:""},$form:null,href:null,loading:!1,init:function(){this.$form=this.$target.closest("form");
var a=this.$form.data("preview-url")||this.options.previewUrl||this.$target.attr("href");if(a)if(this.href=a,this.getCurrentContainer())this.$form.on("preview:hide",XF.proxy(this,"onPreviewHide"));else console.error("Preview form must have a .js-previewContainer element");else console.error("Preview button must have a href")},click:function(a){if(this.href&&(a.preventDefault(),!this.loading)){this.loading=!0;(a=XF.Element.getHandler(this.$form,"draft"))&&a.triggerSave();var b=this;a=XF.getDefaultFormData(this.$form);
XF.ajax("post",this.href,a,XF.proxy(this,"onLoad")).always(function(){b.loading=!1})}},onLoad:function(a){if(a.html){var b=this.getCurrentContainer();a.html.content?XF.setupHtmlInsert(a.html,function(a,c,d){b.removeClassTransitioned("is-active",function(){b.replaceWith(a);d();a.addClassTransitioned("is-active")})}):b.xfFadeUp(XF.config.speed.fast)}},onPreviewHide:function(a){this.getCurrentContainer().removeClassTransitioned("is-active")},getCurrentContainer:function(){return this.$form.find(".js-previewContainer").first()}});
XF.handleSwitchResponse=function(a,b,g){if(b.switchKey){var e=a.data("sk-"+b.switchKey);if(e){for(var d,f;d=e.match(/(\s*,)?\s*(addClass|removeClass):([^,]+)(,|$)/);)if(e=e.substring(d[0].length),f=c.trim(d[3]),f.length)switch(d[2]){case "addClass":a.addClass(f);break;case "removeClass":a.removeClass(f)}e=c.trim(e);e.length&&!b.text&&(b.text=e)}}b.addClass&&a.addClass(b.addClass);b.removeClass&&a.removeClass(b.removeClass);b.text&&(e=a.find(a.data("label")),e.length||(e=a),e.text(b.text));if(b.message){var h=
g&&b.redirect;XF.flashMessage(b.message,h?1E3:3E3,function(){h&&XF.redirect(b.redirect)})}};XF.ScrollToClick=XF.Click.newHandler({eventNameSpace:"XFScrollToClick",options:{target:null,silent:!1,hash:null,speed:300},$scroll:null,init:function(){var a,b=this.options.hash,g=this.$target.attr("href");this.options.target&&(a=XF.findRelativeIf(this.options.target,this.$target));if(!a||!a.length)if(g&&g.length&&"#"==g.charAt(0))a=c(g);else if(this.options.silent)return;if(a&&a.length)if(this.$scroll=a,!0===
b||"true"===b)a=a.attr("id"),this.options.hash=a&&a.length?a:null;else{if(!1===b||"false"===b)this.options.hash=null}else console.error("No scroll target could be found")},click:function(a){if(this.$scroll){a.preventDefault();var b=this.options.hash;c("html, body").animate({scrollTop:this.$scroll.offset().top},this.options.speed,null,function(){b&&(d.location.hash=b)})}}});XF.SwitchClick=XF.Click.newHandler({eventNameSpace:"XFSwitchClick",options:{redirect:!1,label:".js-label"},processing:!1,init:function(){this.$target.data("label",
this.options.label)},click:function(a){a.preventDefault();if(!this.processing){this.processing=!0;a=this.$target.attr("href");var b=this;XF.ajax("POST",a,{},XF.proxy(this,"handleAjax"),{skipDefaultSuccess:!0}).always(function(){setTimeout(function(){b.processing=!1},250)})}},handleAjax:function(a){var b=this.$target,g=c.Event("switchclick:complete");b.trigger(g,a,this);g.isDefaultPrevented()||XF.handleSwitchResponse(b,a,this.options.redirect)}});XF.SwitchOverlayClick=XF.Click.newHandler({eventNameSpace:"XFSwitchOverlayClick",
options:{redirect:!1},overlay:null,init:function(){},click:function(a){a.preventDefault();this.overlay?this.overlay.show():(a=this.$target.attr("href"),XF.loadOverlay(a,{cache:!1,init:XF.proxy(this,"setupOverlay")}))},setupOverlay:function(a){this.overlay=a;a.getOverlay().find("form").on("ajax-submit:response",XF.proxy(this,"handleOverlaySubmit"));var b=this;a.on("overlay:hidden",function(){b.overlay=null});return a},handleOverlaySubmit:function(a,b){"ok"==b.status&&(a.preventDefault(),(a=this.overlay)&&
a.hide(),XF.handleSwitchResponse(this.$target,b,this.options.redirect))}});XF.Draft=XF.Element.newHandler({options:{draftAutosave:60,draftName:"message",draftUrl:null,saveButton:".js-saveDraft",deleteButton:".js-deleteDraft",actionIndicator:".draftStatus"},lastActionContent:null,autoSaveRunning:!1,init:function(){if(this.options.draftUrl){var a=this;this.$target.on(this.options.saveButton,"click",function(b){b.preventDefault();a.triggerSave()});this.$target.on(this.options.deleteButton,"click",function(b){b.preventDefault();
a.triggerDelete()});var b=XF.proxy(this,"syncState");this.syncState();setTimeout(b,500);this.$target.on("draft:sync",b);setInterval(XF.proxy(this,"triggerSave"),1E3*this.options.draftAutosave)}else console.error("No draft URL specified.")},triggerSave:function(){if(!XF.isRedirecting){var a=c.Event("draft:beforesave");this.$target.trigger(a);a.isDefaultPrevented()||this._executeDraftAction(this.getSaveData())}},triggerDelete:function(){this.lastActionContent=this.getSaveData();this._sendDraftAction("delete=1")},
_executeDraftAction:function(a){if(a!=this.lastActionContent){if(this.autoSaveRunning)return!1;this.lastActionContent=a;this._sendDraftAction(a)}},_sendDraftAction:function(a){this.autoSaveRunning=!0;var b=this;return XF.ajax("post",this.options.draftUrl,a,XF.proxy(this,"completeAction"),{skipDefault:!0,skipError:!0,global:!1}).always(function(){b.autoSaveRunning=!1})},completeAction:function(a){var b=c.Event("draft:complete");this.$target.trigger(b,a);if(!b.isDefaultPrevented()){var g=this.$target.find(this.options.actionIndicator);
g.removeClass("is-active").text(a.complete).addClass("is-active");setTimeout(function(){g.removeClass("is-active")},2E3)}},syncState:function(){this.lastActionContent=this.getSaveData()},getSaveData:function(){var a=this.$target;a.trigger("draft:beforesync");return a.serialize().replace(/(^|&)_xfToken=[^&]+(?=&|$)/g,"").replace(/^&+/,"")}});XF.FocusTrigger=XF.Element.newHandler({options:{display:null,activeClass:"is-active"},init:function(){if(this.$target.attr("autofocus"))this.trigger();else this.$target.one("focusin",
XF.proxy(this,"trigger"))},trigger:function(){var a=this.options.display;a&&(a=XF.findRelativeIf(a,this.$target),a.length&&a.addClassTransitioned(this.options.activeClass))}});XF.PollBlock=XF.Element.newHandler({options:{},init:function(){this.$target.on("ajax-submit:response",XF.proxy(this,"afterSubmit"))},afterSubmit:function(a,b){if(!b.errors&&!b.exception){a.preventDefault();b.redirect&&XF.redirect(b.redirect);var c=this;XF.setupHtmlInsert(b.html,function(a,b){a.hide();a.insertAfter(c.$target);
c.$target.xfFadeUp(null,function(){c.$target.remove();a.xfFadeDown()})})}}});XF.Preview=XF.Element.newHandler({options:{previewUrl:null,previewButton:"button.js-previewButton"},previewing:null,init:function(){var a=this.$target,b=XF.findRelativeIf(this.options.previewButton,a);if(this.options.previewUrl)if(b.length)b.on({click:XF.proxy(this,"preview")});else console.warn("Preview form has no preview button: %o",a);else console.warn("Preview form has no data-preview-url: %o",a)},preview:function(a){a.preventDefault();
if(this.previewing)return!1;this.previewing=!0;(a=XF.Element.getHandler(this.$target,"draft"))&&a.triggerSave();var b=this;XF.ajax("post",this.options.previewUrl,this.$target.serializeArray(),function(a){a.html&&XF.setupHtmlInsert(a.html,function(a,b,c){XF.overlayMessage(b.title,a)})}).always(function(){b.previewing=!1})}});XF.ShareButtons=XF.Element.newHandler({options:{buttons:".shareButtons-button",iconic:".shareButtons--iconic"},pageTitle:null,pageDesc:null,pageUrl:null,clipboard:null,init:function(){var a=
this.options.buttons,b=this.options.iconic;this.$target.on("focus mouseenter",a,XF.proxy(this,"focus")).on("click",a,XF.proxy(this,"click"));"string"==typeof b&&(b=this.$target.is(b));this.$target.find(a).each(function(){var a=c(this);b&&XF.Element.applyHandler(a,"element-tooltip",{element:"> span"});a.data("clipboard")&&Clipboard.isSupported()&&a.removeClass("is-hidden")})},setupPageData:function(){this.pageTitle=c('meta[property="og:title"]').attr("content");this.pageTitle||(this.pageTitle=c("title").text());
this.pageUrl=c('meta[property="og:url"]').attr("content");this.pageUrl||(this.pageUrl=d.location.href);if(this.pageDesc=c('meta[property="og:description"]').attr("content"))this.pageDesc=c("meta[name=description]").attr("content")||""},focus:function(a){var b=c(a.currentTarget);if(!b.attr("href")){this.pageUrl||this.setupPageData();var d=b.data("href");if(d)d=d.replace("{url}",encodeURIComponent(this.pageUrl)).replace("{title}",encodeURIComponent(this.pageTitle)),b.attr("href",d);else if(!b.data("clipboard"))console.error("No data-href on share button %o",
a.currentTarget);else if(!this.clipboard){var e=this;this.clipboard=new Clipboard(b[0],{text:function(a){return c(a).data("clipboard").replace("{url}",e.pageUrl).replace("{title}",e.pageTitle)}});this.clipboard.on("success",function(){XF.flashMessage(XF.phrase("link_copied_to_clipboard"),3E3)})}}},click:function(a){var b=c(a.currentTarget).attr("href");!b||a.altKey||a.ctrlKey||a.metaKey||a.shiftKey||!b.match(/^https?:/i)||(a.preventDefault(),d.open(b,"share","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=400,left="+
(screen.width-600)/2+",top="+(screen.height-400)/2))}});XF.ShareInput=XF.Element.newHandler({options:{button:".js-shareButton",input:".js-shareInput"},init:function(){var a=this.$target.find(this.options.button),b=this.$target.find(this.options.input);Clipboard.isSupported()&&a.removeClass("is-hidden");(new Clipboard(a[0],{target:function(a){return b[0]}})).on("success",XF.proxy(this,"success"));b.on("click",XF.proxy(this,"click"))},success:function(){XF.flashMessage(XF.phrase("text_copied_to_clipboard"),
3E3)},click:function(a){c(a.target).select()}});XF.Click.register("attribution","XF.AttributionClick");XF.Click.register("like","XF.LikeClick");XF.Click.register("preview-click","XF.PreviewClick");XF.Click.register("scroll-to","XF.ScrollToClick");XF.Click.register("switch","XF.SwitchClick");XF.Click.register("switch-overlay","XF.SwitchOverlayClick");XF.Element.register("draft","XF.Draft");XF.Element.register("focus-trigger","XF.FocusTrigger");XF.Element.register("poll-block","XF.PollBlock");XF.Element.register("preview",
"XF.Preview");XF.Element.register("share-buttons","XF.ShareButtons");XF.Element.register("share-input","XF.ShareInput")}(jQuery,window,document);

/*
 * XenForo form.min.js
 * Copyright 2010-2018 XenForo Ltd.
 * Released under the XenForo License Agreement: https://xenforo.com/license-agreement
 */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,f,h){c instanceof String&&(c=String(c));for(var a=c.length,b=0;b<a;b++){var e=c[b];if(f.call(h,e,b,c))return{i:b,v:e}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,f,h){c!=Array.prototype&&c!=Object.prototype&&(c[f]=h.value)};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,f,h,a){if(f){h=$jscomp.global;c=c.split(".");for(a=0;a<c.length-1;a++){var b=c[a];b in h||(h[b]={});h=h[b]}c=c[c.length-1];a=h[c];f=f(a);f!=a&&null!=f&&$jscomp.defineProperty(h,c,{configurable:!0,writable:!0,value:f})}};
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,h){return $jscomp.findInternal(this,c,h).v}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var c=0;return function(f){return $jscomp.SYMBOL_PREFIX+(f||"")+c++}}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.iterator;c||(c=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[c]&&$jscomp.defineProperty(Array.prototype,c,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.asyncIterator;c||(c=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.arrayIterator=function(c){var f=0;return $jscomp.iteratorPrototype(function(){return f<c.length?{done:!1,value:c[f++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(c){$jscomp.initSymbolIterator();c={next:c};c[$jscomp.global.Symbol.iterator]=function(){return this};return c};$jscomp.iteratorFromArray=function(c,f){$jscomp.initSymbolIterator();c instanceof String&&(c+="");var h=0,a={next:function(){if(h<c.length){var b=h++;return{value:f(b,c[b]),done:!1}}a.next=function(){return{done:!0,value:void 0}};return a.next()}};a[Symbol.iterator]=function(){return a};return a};
$jscomp.polyfill("Array.prototype.values",function(c){return c?c:function(){return $jscomp.iteratorFromArray(this,function(c,h){return h})}},"es8","es3");
!function(c,f,h){XF.SubmitClick=XF.Click.newHandler({eventNameSpace:"XFSubmitClick",options:{target:null,container:null,timeout:500,uncheckedValue:"0",disable:null},$input:null,$form:null,init:function(){var a=this.$target;if(a.is("label")&&(a=a.find("input:radio, input:checkbox"),!a.length))return;this.$input=a;a=a.closest("form");this.$form=a.length?a:null},click:function(a){var b=this.$input,c=this.$form,d=this.options.target,k=this.options.container;if(b)if(d){var g=this.options.uncheckedValue;
setTimeout(function(){var a={};k?a=b.closest(k).find("input, select, textarea").serializeArray():a[b.attr("name")]=b.prop("checked")?b.attr("value"):g;XF.ajax("POST",d,a)},0)}else c?((a=c.data("submit-click-timer"))&&clearTimeout(a),c.one("ajax-submit:complete",function(a,c,e){if(c.errors)b.prop("checked",b.prop("checked")?"":"checked");else if("checkbox"==b.attr("type")&&null!==b.closest("tr.dataList-row"))b.closest("tr.dataList-row")[b.prop("checked")?"removeClass":"addClass"]("dataList-row--disabled")}),
a=setTimeout(function(){c.submit()},this.options.timeout),c.data("submit-click-timer",a)):console.error("No target or form to submit on click")}});XF.AjaxSubmit=XF.Element.newHandler({options:{redirect:!0,skipOverlayRedirect:!1,forceFlashMessage:!1,resetComplete:!1,hideOverlay:!0,disableSubmit:".button, :submit, :reset, [data-disable-submit]",jsonName:null,jsonOptIn:null,replace:null},submitPending:!1,$submitButton:null,init:function(){var a=this.$target;a.is("form")?(a.on({submit:XF.proxy(this,"submit"),
keyup:XF.proxy(this,"cmdEnterKey"),"draft:beforesave":XF.proxy(this,"draftCheck")}),a.on("click","input[type=submit], button:not([type]), button[type=submit]",XF.proxy(this,"submitButtonClicked"))):console.error("%o is not a form",a[0])},submit:function(a){var b=this.$submitButton,e=this.$target;if("multipart/form-data"==e.attr("enctype")){if(this.options.jsonName){a.preventDefault();console.error("JSON serialized forms do not support the file upload-style enctype.");XF.alert(XF.phrase("oops_we_ran_into_some_problems_more_details_console"));
return}if(!f.FormData)return}if(!(this.$submitButton&&this.$submitButton.data("prevent-ajax")||XF.debug.disableAjaxSubmit))if(this.submitPending)a&&a.preventDefault();else{var d=c.Event("ajax-submit:before"),k={form:e,handler:this,method:e.attr("method")||"get",action:e.attr("action"),submitButton:b,preventSubmit:!1,successCallback:XF.proxy(this,"submitResponse"),ajaxOptions:{skipDefault:!0}};e.trigger(d,k);if(k.preventSubmit)return!1;if(d.isDefaultPrevented())return!0;a&&a.preventDefault();var g=
this;setTimeout(function(){g.submitPending=!0;var a=XF.getDefaultFormData(e,b,g.options.jsonName,g.options.jsonOptIn);g.disableButtons();XF.ajax(k.method,k.action,a,k.successCallback,k.ajaxOptions).always(function(){g.$submitButton=null;setTimeout(function(){g.submitPending=!1;g.enableButtons()},300);d=c.Event("ajax-submit:always");e.trigger(d,e,g)})},0)}},disableButtons:function(){var a=this.options.disableSubmit;a&&this.$target.find(a).prop("disabled",!0)},enableButtons:function(){var a=this.options.disableSubmit;
a&&this.$target.find(a).prop("disabled",!1)},submitResponse:function(a,b,e){if("object"!=typeof a)XF.alert("Response was not JSON.");else{b=this.$target;e=this.$submitButton;var d=c.Event("ajax-submit:response");b.trigger(d,a,this);if(!d.isDefaultPrevented()){d=c.Event("ajax-submit:error");var k=!1,g=a.redirect&&this.options.redirect,f=b.closest(".overlay");f.length&&this.options.hideOverlay||(f=null);g&&this.options.skipOverlayRedirect&&f&&(g=!1);e&&e.attr("data-ajax-redirect")&&(g=e.data("ajax-redirect"));
if(a.errorHtml)b.trigger(d,a,this),d.isDefaultPrevented()||XF.setupHtmlInsert(a.errorHtml,function(a,b){b=b.h1||b.title||XF.phrase("oops_we_ran_into_some_problems");XF.overlayMessage(b,a)}),k=!0;else if(a.errors)b.trigger(d,a,this),d.isDefaultPrevented()||XF.alert(a.errors),k=!0;else if(a.exception)XF.alert(a.exception);else if("ok"==a.status&&a.message)g?this.options.forceFlashMessage?XF.flashMessage(a.message,1E3,function(){XF.redirect(a.redirect)}):XF.redirect(a.redirect):XF.flashMessage(a.message,
3E3),f&&f.trigger("overlay:hide");else if(a.html){var h=this;XF.setupHtmlInsert(a.html,function(a,b,c){if(h.options.replace&&h.doSubmitReplace(a,c))return!1;f&&f.trigger("overlay:hide");a=XF.getOverlayHtml({html:a,title:b.h1||b.title});XF.showOverlay(a)})}else"ok"==a.status&&(g&&XF.redirect(a.redirect),f&&f.trigger("overlay:hide"));a.errors&&d.isDefaultPrevented();d=c.Event("ajax-submit:complete");b.trigger(d,a,this);d.isDefaultPrevented()||this.options.resetComplete&&!k&&b[0].reset()}}},doSubmitReplace:function(a,
b){var e=this.options.replace;if(!e)return!1;var d=e.split(" with ");e=c.trim(d[0]);d=d[1]?c.trim(d[1]):e;if("self"==e||this.$target.is(e))var k=this.$target;else k=this.$target.find(e).first(),k.length||(k=c(e).first());if(!k.length)return console.error("Could not find old selector '"+e+"'"),!1;var g=a.is(d)?a:a.find(d).first();if(!g.length)return console.error("Could not find new selector '"+d+"'"),!1;g.hide().insertAfter(k);k.xfFadeUp(null,function(){k.remove();g.length&&(XF.activate(g),b(!1));
g.xfFadeDown(null,XF.layoutChange)});return!0},submitButtonClicked:function(a){this.$submitButton=c(a.currentTarget)},draftCheck:function(a){this.submitPending&&a.preventDefault()}});XF.AutoComplete=XF.Element.newHandler({loadTimer:null,loadVal:"",results:null,options:{single:!1,multiple:",",acurl:"",minLength:2,queryKey:"q",extraFields:"",extraParams:{},jsonContainer:"results",autosubmit:!1},init:function(){var a=this.$target;this.options.autosubmit&&(this.options.single=!0);this.options.acurl||
(this.options.acurl=XF.getAutoCompleteUrl());this.results=new XF.AutoCompleteResults({onInsert:XF.proxy(this,"addValue")});a.attr("autocomplete","off").on({keydown:XF.proxy(this,"keydown"),keyup:XF.proxy(this,"keyup"),"blur click":XF.proxy(this,"blur"),paste:function(){setTimeout(function(){a.trigger("keydown")},0)}});a.closest("form").submit(XF.proxy(this,"hideResults"))},keydown:function(a){if(this.results.isVisible()){var b=this.results,c=function(){a.preventDefault();return!1};switch(a.which){case 40:return b.selectResult(1),
c();case 38:return b.selectResult(-1),c();case 27:return this.hide(),c();case 13:return b.insertSelectedResult(),c()}}},keyup:function(a){if(this.results.isVisible())switch(a.which){case 40:case 38:case 13:return}this.hideResults();this.loadTimer&&clearTimeout(this.loadTimer);this.loadTimer=setTimeout(XF.proxy(this,"load"),200)},blur:function(a){clearTimeout(this.loadTimer);setTimeout(XF.proxy(this,"hideResults"),250);this.xhr&&(this.xhr.abort(),this.xhr=!1)},load:function(){var a=this.loadVal,b=
this.options.extraParams;this.loadTimer&&clearTimeout(this.loadTimer);this.loadVal=this.getPartialValue();""==this.loadVal?this.hideResults():this.loadVal==a||this.loadVal.length<this.options.minLength||(b[this.options.queryKey]=this.loadVal,""!=this.options.extraFields&&c(this.options.extraFields).each(function(){b[this.name]=c(this).val()}),this.xhr&&this.xhr.abort(),this.xhr=XF.ajax("get",this.options.acurl,b,XF.proxy(this,"showResults"),{global:!1,error:!1}))},hideResults:function(){this.results.hideResults()},
showResults:function(a){this.xhr&&(this.xhr=!1);this.options.jsonContainer&&a&&(a=a[this.options.jsonContainer]);this.results.showResults(this.getPartialValue(),a,this.$target)},addValue:function(a){if(this.options.single)this.$target.val(a);else{var b=this.getFullValues();""!=a&&(b.length&&(a=" "+a),b.push(a+this.options.multiple+" "));this.$target.val(b.join(this.options.multiple))}this.$target.trigger("auto-complete:insert",{inserted:a,current:this.$target.val()});this.options.autosubmit?this.$target.closest("form").submit():
this.$target.autofocus()},getFullValues:function(){var a=this.$target.val();if(""==a)return[];if(this.options.single)return[a];var b=a.lastIndexOf(this.options.multiple);if(-1==b)return[];a=a.substr(0,b);return a.split(this.options.multiple)},getPartialValue:function(){var a=this.$target.val();if(this.options.single)return c.trim(a);var b=a.lastIndexOf(this.options.multiple);return-1==b?c.trim(a):c.trim(a.substr(b+this.options.multiple.length))}});XF.UserMentioner=XF.Element.newHandler({options:{},
$input:null,visible:!1,idleWait:200,idleTimer:null,pendingMention:"",results:null,init:function(){this.$input=this.$target;var a=this;this.results=new XF.AutoCompleteResults({onInsert:function(b){a.insertMention(b)}});this.$input.on("keydown",XF.proxy(this,"keydown"));this.$input.on("keyup",XF.proxy(this,"keyup"));this.$input.on("blur click",XF.proxy(this,"blur"));c(h).on("scroll",XF.proxy(this,"blur"))},keydown:function(a){if(this.visible)switch(a.which){case 40:return this.results.selectResult(1),
a.preventDefault(),!1;case 38:return this.results.selectResult(-1),a.preventDefault(),!1;case 27:return this.hide(),a.preventDefault(),!1;case 13:if(this.visible)return a.preventDefault(),this.results.insertSelectedResult(),!1}},keyup:function(a){if(this.visible)switch(a.which){case 40:case 38:case 13:return}this.hide();this.idleTimer&&clearTimeout(this.idleTimer);this.idleTimer=setTimeout(XF.proxy(this,"lookForMention"),this.idleWait)},blur:function(){this.visible&&setTimeout(XF.proxy(this,"hide"),
250)},lookForMention:function(){var a=this.getCurrentMentionInfo();a?this.foundMention(a.name):this.hide()},getCurrentMentionInfo:function(){var a=this.$input;a.autofocus();var b=a.getSelection();if(!b||1>=b.end)return!1;a=a.val().substring(0,b.end);var c=a.lastIndexOf("@");if(-1==c)return null;if(0==c||a.substr(c-1,1).match(/(\s|[\](,]|--)/)){var d=a.substr(c+1);if(!d.match(/\s/)||10>=d.length)return{text:a,start:c,name:d.replace(new RegExp(String.fromCharCode(160),"g")," "),range:b}}return null},
foundMention:function(a){this.pendingMention!=a&&(this.pendingMention=a,2<=a.length&&"["!=a.substr(0,1)&&this.getPendingMentionOptions())},getPendingMentionOptions:function(){XF.ajax("GET",XF.getAutoCompleteUrl(),{q:this.pendingMention},XF.proxy(this,"handlePendingMentionOptions"),{global:!1,error:!1})},handlePendingMentionOptions:function(a){var b=this.getCurrentMentionInfo();a.q&&b&&a.q==b.name&&(a.results?this.show(a.q,a.results):this.hide())},insertMention:function(a){this.hide();var b=this.$input;
b.autofocus();var c=this.getCurrentMentionInfo();if(c){var d=c.range;-1!=c.start+1&&(b.setSelection(c.start,d.end),b.replaceSelectedText("@"+a+" ","collapseToEnd"))}},show:function(a,b){this.getCurrentMentionInfo()&&(this.visible=!0,this.results.showResults(a,b,this.$input))},hide:function(){this.visible&&(this.visible=!1,this.results.hideResults())}});XF.AutoSubmit=XF.Element.newHandler({options:{hide:!0,progress:!0},init:function(){this.$target.submit();this.options.hide&&this.$target.find(":submit").hide();
this.options.progress&&c(h).trigger("xf:action-start")}});XF.ChangedFieldNotifier=XF.Element.newHandler({options:{hide:!0,progress:!0},init:function(){this.$target.find("input, select, textarea").each(function(){var a=c(this);a.data("orig-val",a.val());a.change(function(){a.toggleClass("is-changed",a.val()!=a.data("orig-val"))})})}});XF.CheckAll=XF.Element.newHandler({options:{container:"< form",match:"input:checkbox"},$container:null,updating:!1,init:function(){this.$container=XF.findRelativeIf(this.options.container,
this.$target);var a=this;this.$container.on("click",this.options.match,function(b){a.updating||c(b.target).is(a.$target)||a.updateState()});this.updateState();this.$target.click(XF.proxy(this,"click"))},click:function(a){this.updating=!0;this.getCheckBoxes().prop("checked",a.target.checked).triggerHandler("click");this.updating=!1},updateState:function(){var a=this.getCheckBoxes(),b=0<a.length;a.each(function(){if(!c(this).prop("checked"))return b=!1});this.$target.prop("checked",b)},getCheckBoxes:function(){return this.$container.find(this.options.match).not(this.$target)}});
XF.DateInput=XF.Element.newHandler({options:{weekStart:0,minDate:null,maxDate:null,disableWeekends:!1,yearRange:null,showWeekNumber:!1,showDaysInNextAndPreviousMonths:!0},init:function(){var a=this.options.minDate,b=this.options.maxDate;if(a){var c=Date.parse(a.replace(/-/g,"/"));a=new Date(c)}b&&(c=Date.parse(b.replace(/-/g,"/")),b=new Date(c));var d=this,k=this.$target;c=k.val();a={onSelect:function(){var a=this._d,b=String(a.getDate()),c=String(a.getMonth()+1);a=String(a.getFullYear());d.$target.val(a+
"-"+(10>c?"0"+c:c)+"-"+(10>b?"0"+b:b))},onOpen:function(){k.prop("readonly")&&this.hide()},showTime:!1,firstDay:this.options.weekStart,minDate:a,maxDate:b,disableWeekends:this.options.disableWeekends,yearRange:this.options.yearRange,showWeekNumber:this.options.showWeekNumber,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,i18n:{previousMonth:"",nextMonth:"",weekdays:[0,1,2,3,4,5,6].map(function(a){return XF.phrase("day"+a)}),weekdaysShort:[0,1,2,3,4,5,6].map(function(a){return XF.phrase("dayShort"+
a)}),months:[0,1,2,3,4,5,6,7,8,9,10,11].map(function(a){return XF.phrase("month"+a)})},isRTL:XF.isRtl()};c&&(b=c.match(/^(\d{4})-(\d\d?)-(\d\d?)$/))&&(a.defaultDate=new Date(parseInt(b[1],10),parseInt(b[2],10)-1,parseInt(b[3])),a.setDefaultDate=!0);this.$target.pikaday(a);this.$target.val(c)}});XF.DescLoader=XF.Element.newHandler({options:{descUrl:null},$container:null,changeTimer:null,xhr:null,init:function(){if(this.options.descUrl){var a=this.$target.parent().find(".js-descTarget");a.length?(this.$container=
a,this.$target.on("change",XF.proxy(this,"change"))):console.error("Target element must have a .js-descTarget sibling")}else console.error("Element must have a data-desc-url value")},change:function(){this.changeTimer&&clearTimeout(this.changeTimer);this.xhr&&(this.xhr.abort(),this.xhr=null);this.changeTimer=setTimeout(XF.proxy(this,"onTimer"),200)},onTimer:function(){var a=this.$target.val();a?this.xhr=XF.ajax("post",this.options.descUrl,{id:a},XF.proxy(this,"onLoad")):this.$container.xfFadeUp(XF.config.speed.fast)},
onLoad:function(a){var b=this.$container;a.description?b.xfFadeUp(XF.config.speed.fast,function(){b.html(a.description);b.xfFadeDown(XF.config.speed.normal)}):b.xfFadeUp(XF.config.speed.fast);this.xhr=null}});XF.Disabler=XF.Element.newHandler({options:{container:"< li | ul, ol, dl",controls:"input, select, textarea, button, .js-attachmentUpload",hide:!1,optional:!1,invert:!1,autofocus:!0},$container:null,init:function(){this.$container=XF.findRelativeIf(this.options.container,this.$target);this.$container.length||
this.options.optional||console.error("Could not find the disabler control container");var a=this.$target,b=a.closest("form");if(b.length)b.on("reset",XF.proxy(this,"formReset"));if(a.is(":radio")){var e=b,d=a.attr("name");b.length||(e=c(h.body));e.on("click",'input:radio[name="'+d+'"]',XF.proxy(this,"click"))}else if(a.is("option")){var k=this;a.closest("select").on("change",function(a){a=c(this);var b=XF.Element.getHandler(a.find("option:selected").first(),"disabler");!a.find("option:selected").first().is(k.$target)&&
b&&b.getOption("container")===k.options.container||k.recalculate(!1)})}else a.click(XF.proxy(this,"click"));a.on("control:enabled control:disabled",XF.proxy(this,"recalculateAfter"));this.$container.one("editor:init",XF.proxy(this,"recalculateAfter"));this.recalculate(!0)},click:function(a,b){this.recalculateAfter(!1,b&&b.triggered)},formReset:function(a){this.recalculateAfter(!1,!0)},recalculateAfter:function(a,b){var c=this;setTimeout(function(){c.recalculate(a,b)},0)},recalculate:function(a,b){var e=
this.$container,d=this.$target,k=e.find(this.options.controls).not(d),g=a?0:XF.config.speed.fast,f=this,h=function(){!b&&f.options.autofocus&&e.find("input:not([type=hidden], [type=file]), textarea, select, button").not(d).first().autofocus()};d.is(":enabled")&&(d.is(":checked")&&!this.options.invert||this.options.invert&&!d.is(":checked"))?(e.prop("disabled",!1).removeClass("is-disabled"),k.prop("disabled",!1).removeClass("is-disabled").each(function(a,b){a=c(b);a.is("select.is-readonly")&&a.prop("disabled",
!0)}).trigger("control:enabled"),this.options.hide?(a?e.show():e.slideDown(g,function(){XF.layoutChange();h()}),XF.layoutChange()):a||h()):(this.options.hide&&(a?e.hide():e.slideUp(g,XF.layoutChange),XF.layoutChange()),e.prop("disabled",!0).addClass("is-disabled"),k.prop("disabled",!0).addClass("is-disabled").trigger("control:disabled").each(function(a,b){a=c(b);b=a.data("disabled");null!==b&&"undefined"!=typeof b&&a.val(b)}))}});XF.FieldAdder=XF.Element.newHandler({options:{incrementFormat:null,
remaining:-1},$clone:null,created:!1,init:function(){this.$target.find("input:not(:checkbox), select, textarea").each(function(){var a=c(this);a.val(a.data("default-value")||"")});var a=this;this.$target.on("keypress change paste",function(b){c(b.target).prop("readonly")||(a.$clone=a.$target.clone(),a.$target.off(b),a.create())})},create:function(){if(!this.created&&(this.created=!0,0!=this.options.remaining)){var a=this.options.incrementFormat;if(this.options.incrementFormat){var b=new RegExp("^"+
XF.regexQuote(a).replace("\\{counter\\}","(\\d+)"));this.$clone.find("input, select, textarea").each(function(){var e=c(this),d=e.attr("name");d=d.replace(b,function(b,c){return a.replace("{counter}",parseInt(c,10)+1)});e.attr("name",d)})}0<this.options.remaining&&this.$clone.attr("data-remaining",this.options.remaining-1);this.$clone.insertAfter(this.$target);XF.activate(this.$clone);XF.layoutChange()}}});XF.FormSubmitRow=XF.Element.newHandler({options:{container:".block-container",fixedChild:".formSubmitRow-main",
stickyClass:"is-sticky",topOffset:100,minWindowHeight:281},$container:null,$fixedParent:null,$fixEl:null,fixElHeight:0,winHeight:0,containerTop:0,containerBorderLeftWidth:0,topOffset:0,elBottom:0,state:"normal",windowTooSmall:!1,init:function(){if(XF.config.enableFormSubmitSticky){var a=this.$target,b=a.closest(this.options.container);b.length?(this.$container=b,this.topOffset=this.options.topOffset,this.$fixEl=a.find(this.options.fixedChild),c(f).on("scroll",XF.proxy(this,"onScroll")).on("resize",
XF.proxy(this,"recalcAndUpdate")),b=XF.getFixedOffsetParent(a),b.is("html")||(this.$fixedParent=b,b.on("scroll",XF.proxy(this,"onScroll"))),c(h.body).on("xf:layout",XF.proxy(this,"recalcAndUpdate")),a.height()||setTimeout(XF.proxy(this,"recalcAndUpdate"),250),this.recalcAndUpdate()):console.error("Cannot float submit row, no container")}},recalc:function(){var a=this.$target;this.winHeight=c(f).height();this.elBottom=this.getTargetTop()+a.height();this.fixElHeight=this.$fixEl.height();this.containerTop=
XF.getFixedOffset(this.$container).top;this.containerBorderLeftWidth=parseInt(this.$container.css("border-left-width"),10)},recalcAndUpdate:function(){this.state="normal";this.resetTarget();this.recalc();this.update()},getTargetTop:function(){var a=this.$target.offset().top;return this.$fixedParent?a-this.$fixedParent.offset().top:a},getScrollTop:function(){return this.$fixedParent?this.$fixedParent.scrollTop():c(f).scrollTop()},update:function(){var a=XF.browser.ios||XF.browser.android?f.innerHeight:
this.winHeight;if(a<this.options.minWindowHeight)"normal"!=this.state&&(this.resetTarget(),this.state="normal");else if(a=this.getScrollTop()+a,a>=this.elBottom)"normal"!=this.state&&(this.resetTarget(),this.state="normal");else{var b=this.containerTop+this.topOffset+this.fixElHeight;a<=b?b>=this.elBottom||"absolute"==this.state||(a=this.$container.offset(),"stuck"==this.state?(b=this.$fixEl.parent(),"static"==b.css("position")&&(b=b.offsetParent())):b=this.$fixEl.offsetParent(),b=b.offset(),this.$fixEl.css({position:"absolute",
top:a.top-b.top+this.topOffset,right:"auto",bottom:"auto",left:a.left-b.left+this.containerBorderLeftWidth,width:this.$container.width()}),this.setTargetSticky(!0),this.state="absolute"):"stuck"!=this.state&&(a=this.$container.offset(),this.$fixEl.css({position:"",top:"",right:"",bottom:"",left:a.left+this.containerBorderLeftWidth,width:this.$container.width()}),this.setTargetSticky(!0),this.state="stuck")}},resetTarget:function(){this.$fixEl.css({position:"",top:"",right:"",bottom:"",left:"",width:""});
this.setTargetSticky(!1)},setTargetSticky:function(a){this.$target.toggleClass("is-sticky",a).css("height",this.$fixEl.height())},onScroll:function(){this.update()}});XF.GuestUsername=XF.Element.newHandler({init:function(){var a=this.$target;a.val(XF.LocalStorage.get("guestUsername"));a.on("keyup",XF.proxy(this,"change"))},change:function(){var a=this.$target;a.val().length?XF.LocalStorage.set("guestUsername",a.val(),!0):XF.LocalStorage.remove("guestUsername")}});XF.MinLength=XF.Element.newHandler({options:{minLength:0,
allowEmpty:!1,disableSubmit:!0,toggleTarget:null},met:null,$form:null,$toggleTarget:null,init:function(){var a=this;this.$form=this.$target.closest("form");this.$toggleTarget=this.options.toggleTarget?XF.findRelativeIf(this.options.toggleTarget,this.$target):c([]);this.$target.on("change keypress keydown paste",function(){setTimeout(XF.proxy(a,"checkLimits"),0)});this.checkLimits()},checkLimits:function(){var a=c.trim(this.$target.val()).length,b=this.options;a=a>=b.minLength||0==a&&b.allowEmpty;
a!==this.met&&((this.met=a)?(b.disableSubmit&&this.$form.find(":submit").prop("disabled",!1).removeClass("is-disabled"),this.$toggleTarget.hide()):(b.disableSubmit&&this.$form.find(":submit").prop("disabled",!0).addClass("is-disabled"),this.$toggleTarget.show()))}});XF.TextAreaHandler=XF.Element.newHandler({options:{autoSize:!0,keySubmit:!0,singleLine:!1},initialized:!1,init:function(){this.options.autoSize&&(this.$target[0].scrollHeight?this.setupAutoSize():(this.$target.one("focus control:enabled control:disabled",
XF.proxy(this,"setupDelayed")),this.$target.onWithin("toggle:shown overlay:shown tab:shown quick-edit:shown",XF.proxy(this,"setupDelayed"))),this.$target.on("autosize",XF.proxy(this,"update")));if(this.options.keySubmit||this.options.singleLine)this.$target.on("keydown",XF.proxy(this,"keySubmit"))},setupAutoSize:function(){this.initialized||(this.initialized=!0,autosize(this.$target),this.$target.on("autosize:resized",function(){XF.layoutChange()}))},setupDelayed:function(){if(this.initialized)this.update();
else{var a=this,b=function(){a.setupAutoSize();XF.layoutChange()};this.$target[0].scrollHeight?b():setTimeout(b,100)}},update:function(){this.initialized?autosize.update(this.$target[0]):this.setupDelayed()},keySubmit:function(a){if(13==a.which&&(this.options.singleLine||this.options.keySubmit&&(XF.isMac()?a.metaKey:a.ctrlKey)))return a.preventDefault(),this.$target.closest("form").submit(),!1}});XF.PermissionMatrix=XF.Element.newHandler({options:{inputSelector:'input[type="radio"]',parentSelector:"dl.formRow",
classPrefix:"formRow--permissionType-",permissionType:"user"},values:["allow","unset","deny","content_allow","reset"],currentClass:null,init:function(){this.$parentRow=this.$target.closest(this.options.parentSelector);this.$target.find(this.options.inputSelector).on("click",XF.proxy(this,"update"));this.update()},update:function(){this.currentClass&&this.$parentRow.removeClass(this.currentClass);var a=this.$target.find(this.options.inputSelector+":checked").val();-1<c.inArray(a,this.values)&&(this.currentClass=
this.options.classPrefix+this.options.permissionType+"-"+a,this.$parentRow.addClass(this.currentClass))}});XF.MultiCheck=XF.Click.newHandler({eventNameSpace:"XFMultiCheck",options:{target:null,values:"allow,unset,deny"},$target:null,values:null,currentValue:null,init:function(){this.$target=c(this.options.target);this.values=this.options.values.split(",");var a=this.$target.filter(":checked").first().val();this.currentValue=0<c.inArray(a,this.values)?this.values[-1]:this.values[0]},click:function(a){var b=
this.values[c.inArray(this.currentValue,this.values)+1];void 0===b&&(b=this.values[0]);this.$target.each(function(){c(this).val()==b&&c(this).prop("checked",!0).trigger("click")});this.currentValue=b}});XF.NumberBox=XF.Element.newHandler({options:{textInput:".js-numberBoxTextInput",buttonSmaller:!1},$textInput:null,holdTimeout:null,holdInterval:null,init:function(){var a=this.$target,b=a.find(this.options.textInput);if(b.length){a.addClass("inputGroup--joined");var e=c("<button />").attr("type","button").attr("tabindex",
"-1").addClass("inputGroup-text").addClass("inputNumber-button").on("focus",XF.proxy(this,"buttonFocus")).on("click",XF.proxy(this,"buttonClick")).on("mousedown touchstart",XF.proxy(this,"buttonMouseDown")).on("mouseleave mouseup touchend",XF.proxy(this,"buttonMouseUp")).on("touchend",function(a){a.preventDefault();c(this).click()});a=e.clone(!0).data("dir","up").addClass("inputNumber-button--up").insertAfter(b);e=e.clone(!0).data("dir","down").addClass("inputNumber-button--down").insertAfter(a);
b.prop("disabled")&&(a.addClass("is-disabled").prop("disabled",!0),e.addClass("is-disabled").prop("disabled",!0));this.options.buttonSmaller&&(a.addClass("inputNumber-button--smaller"),e.addClass("inputNumber-button--smaller"));this.$textInput=b;if(!this.supportsStepFunctions())b.on("keydown",XF.proxy(this,"stepFallback"))}else console.error("Cannot initialize, no text input.")},buttonFocus:function(a){return!1},buttonClick:function(a){this.step(c(a.target).data("dir"))},step:function(a){var b=this.$textInput,
c="step"+a.charAt(0).toUpperCase()+a.slice(1);b.prop("readonly")||(this.supportsStepFunctions()?(b[0][c](),b.trigger("change")):this.stepFallback(a))},stepFallback:function(a){if(!this.$textInput.prop("readonly")){if("object"===typeof a&&a.keyCode){var b=a;switch(b.keyCode){case 38:a="up";b.preventDefault();break;case 40:a="down";b.preventDefault();break;default:return}}b=this.$textInput;var c=b.val(),d="down"===a?-1:1;a=b.attr("min")||null;var f=b.attr("max")||null,g=b.attr("step")||1,h="any"==g;
h&&(g=1);g=parseFloat(g);d=parseFloat(c)+g*d;if(Math.round(d)!==d){var l=0;c=c.split(".");h?l=c[1]?c[1].length:0:Math.floor(g)!==g&&(l=g.toString().split(".")[1].length||0);d=d.toFixed(l)}null!==a&&d<a&&(d=a);null!==f&&d>f&&(d=f);isNaN(d)&&(d=0);b.val(d);b.trigger("change")}},buttonMouseDown:function(a){this.buttonMouseUp(a);this.holdTimeout=setTimeout(XF.proxy(function(){this.holdInterval=setInterval(XF.proxy(function(){this.step(c(a.target).data("dir"))},this),75)},this),500)},buttonMouseUp:function(a){clearTimeout(this.holdTimeout);
clearInterval(this.holdInterval)},supportsStepFunctions:function(){var a=this.$textInput.clone();if(!a.prop("disabled")&&!a.prop("readonly")){if("function"===typeof a[0].stepUp)try{a[0].stepUp()}catch(b){return!1}else return!1;return!0}}});XF.CheckboxSelectDisabler=XF.Element.newHandler({options:{select:null},$select:null,$checkboxes:null,init:function(){(this.$select=XF.findRelativeIf(this.options.select,this.$target))&&this.$select.length?(this.$checkboxes=this.$target.find(":checkbox").on("click",
XF.proxy(this,"update")),this.update()):console.warn("No select element found using %s",this.options.select)},update:function(){var a=this.$select;this.$checkboxes.each(function(){var b=a.find("option[value="+this.value+"]").prop("disabled",!this.checked);!this.checked&&b.is(":selected")&&a.find("option:enabled").first().prop("selected",!0)})}});XF.focusNext=function(a){!a instanceof c&&(a=c(a));var b=c("a, button, :input, [tabindex]");a=b.index(a)+1;b.eq(a>=b.length?0:a).focus()};XF.Click.register("submit",
"XF.SubmitClick");XF.Click.register("multi-check","XF.MultiCheck");XF.Element.register("ajax-submit","XF.AjaxSubmit");XF.Element.register("auto-complete","XF.AutoComplete");XF.Element.register("user-mentioner","XF.UserMentioner");XF.Element.register("auto-submit","XF.AutoSubmit");XF.Element.register("changed-field-notifier","XF.ChangedFieldNotifier");XF.Element.register("check-all","XF.CheckAll");XF.Element.register("date-input","XF.DateInput");XF.Element.register("desc-loader","XF.DescLoader");XF.Element.register("disabler",
"XF.Disabler");XF.Element.register("field-adder","XF.FieldAdder");XF.Element.register("form-submit-row","XF.FormSubmitRow");XF.Element.register("guest-username","XF.GuestUsername");XF.Element.register("min-length","XF.MinLength");XF.Element.register("textarea-handler","XF.TextAreaHandler");XF.Element.register("permission-matrix","XF.PermissionMatrix");XF.Element.register("number-box","XF.NumberBox");XF.Element.register("checkbox-select-disabler","XF.CheckboxSelectDisabler")}(jQuery,window,document);

/*
 * XenForo structure.min.js
 * Copyright 2010-2018 XenForo Ltd.
 * Released under the XenForo License Agreement: https://xenforo.com/license-agreement
 */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,f,l){d instanceof String&&(d=String(d));for(var a=d.length,b=0;b<a;b++){var c=d[b];if(f.call(l,c,b,d))return{i:b,v:c}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,f,l){d!=Array.prototype&&d!=Object.prototype&&(d[f]=l.value)};
$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(d,f,l,a){if(f){l=$jscomp.global;d=d.split(".");for(a=0;a<d.length-1;a++){var b=d[a];b in l||(l[b]={});l=l[b]}d=d[d.length-1];a=l[d];f=f(a);f!=a&&null!=f&&$jscomp.defineProperty(l,d,{configurable:!0,writable:!0,value:f})}};
$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,l){return $jscomp.findInternal(this,d,l).v}},"es6","es3");
!function(d,f,l){XF._baseInserterOptions={after:null,append:null,before:null,prepend:null,replace:null,removeOldSelector:!0,animateReplace:!0,scrollTarget:null,href:null};XF.InserterClick=XF.Click.newHandler({eventNameSpace:"XFInserterClick",options:d.extend(!0,{},XF._baseInserterOptions),inserter:null,init:function(){this.inserter=new XF.Inserter(this.$target,this.options)},click:function(a){this.inserter.onEvent(a)}});XF.InserterFocus=XF.Element.newHandler({options:d.extend(!0,{},XF._baseInserterOptions),
inserter:null,init:function(){this.inserter=new XF.Inserter(this.$target,this.options);this.$target.one("focus",XF.proxy(this.inserter,"onEvent"))}});XF.Inserter=XF.create({options:d.extend(!0,{},XF._baseInserterOptions),$target:null,href:null,loading:!1,__construct:function(a,b){this.$target=a;this.options=d.extend(!0,{},this.options,b);(a=this.options.href||this.$target.data("inserter-href")||this.$target.attr("href"))?this.href=a:console.error("Target must have href")},onEvent:function(a){a.preventDefault();
if(!this.loading){this.loading=!0;a=d(this.options.replace);a.length&&a.addClassTransitioned("is-active");var b=this;XF.ajax("get",this.href,{},XF.proxy(this,"onLoad")).always(function(){b.loading=!1})}},onLoad:function(a){if(a.html){var b=this,c=this.options,e=c.scrollTarget,d;e&&(d=XF.findRelativeIf(e,this.$target));XF.setupHtmlInsert(a.html,function(a,d,e){b._applyChange(a,c.after,XF.proxy(b,"_applyAfter"));b._applyChange(a,c.append,XF.proxy(b,"_applyAppend"));b._applyChange(a,c.before,XF.proxy(b,
"_applyBefore"));b._applyChange(a,c.prepend,XF.proxy(b,"_applyPrepend"));b._applyChange(a,c.replace,XF.proxy(b,"_applyReplace"));e(!0);return!1});XF.layoutChange();d&&d.length&&d[0].scrollIntoView(!0)}},_applyChange:function(a,b,c){if(b&&b.length){b=b.split(",");for(var e,k,g,h=0;h<b.length;h++)e=b[h].split(" with "),k=d.trim(e[0]),g=e[1]?d.trim(e[1]):k,k.length&&g.length&&(e=d(k).first(),g=a.is(g)?a:a.find(g).first(),c(k,e,g))}},_applyAfter:function(a,b,c){b.length&&c.length&&(c.insertAfter(b),XF.activate(c),
this._removeOldSelector(a,b))},_applyAppend:function(a,b,c){b.length&&c.length&&(a=c.children(),a.appendTo(b),XF.activate(a))},_applyBefore:function(a,b,c){b.length&&c.length&&(c.insertBefore(b),XF.activate(c),this._removeOldSelector(a,b))},_applyPrepend:function(a,b,c){b.length&&c.length&&(a=c.children(),a.prependTo(b),XF.activate(a))},_applyReplace:function(a,b,c){b.length&&(a=this.options.animateReplace,XF.isIOS()&&(a=!1),c.length&&(a&&c.hide(),c.insertAfter(b)),a?b.xfFadeUp(null,function(){b.remove();
c.length&&XF.activate(c);c.xfFadeDown(null,XF.layoutChange)}):(b.remove(),c.length&&XF.activate(c)))},_removeOldSelector:function(a,b){if(this.options.removeOldSelector){var c;(c=a.match(/^\.([a-z0-9_-]+)/i))&&b.removeClass(c[1])}}});XF.MenuClick=XF.Click.newHandler({eventNameSpace:"XFMenuClick",options:{menu:null,targetOpenClass:"is-menuOpen",openClass:"is-active",completeClass:"is-complete",zIndexRef:null,menuPosRef:null,arrowPosRef:null,directionThreshold:.6},$menu:null,$menuPosRef:null,menuRef:null,
$arrowPosRef:null,arrowRef:null,pauseRepositioning:!1,scrollFunction:null,isPotentiallyFixed:!1,menuIsUp:!1,menuWidth:0,menuHeight:0,init:function(){this.options.menu&&(this.$menu=XF.findRelativeIf(this.options.menu,this.$target));this.$menu&&this.$menu.length||(this.$menu=this.$target.nextAll("[data-menu]").first());if(this.$menu.length){this.$arrowPosRef=this.$menuPosRef=this.$target;this.options.menuPosRef&&(this.$menuPosRef=XF.findRelativeIf(this.options.menuPosRef,this.$target),this.$arrowPosRef=
this.$target,this.options.arrowPosRef&&(this.$arrowPosRef=XF.findRelativeIf(this.options.arrowPosRef,this.$target),this.$menuPosRef.has(this.$arrowPosRef).length||(this.$arrowPosRef=this.$target)));this.$target.attr("aria-controls",this.$menu.xfUniqueId());this.$menu.find(".menu-arrow").length||this.$menu.prepend('<span class="menu-arrow" />');var a=this;this.$menu.data("menu-trigger",this).on("click","[data-menu-closer]",function(){a.close()}).on({"menu:open":function(){a.open(Modernizr.touchevents)},
"menu:close":function(){a.close()},"menu:reposition":function(){a.isOpen()&&a.reposition()},keydown:XF.proxy(this,"keyboardEvent")});if(XF.isIOS()&&this.$target.hasFixableParent()){var b,c;this.$menu.on({touchstart:function(e){clearTimeout(b);clearTimeout(c);a.enableIOSInputFix(d(e.currentTarget));c=setTimeout(function(){a.resetIOSInputFix()},500)},focus:function(e){clearTimeout(b);clearTimeout(c);a.enableIOSInputFixFocus(d(e.currentTarget))},blur:function(c){clearTimeout(b);b=setTimeout(function(){a.isOpen()&&
a.resetIOSInputFix()},200)}},XF.getKeyboardInputs())}var e=this.$menu.closest(".tooltip");if(e.length)e.on("tooltip:hidden",XF.proxy(this,"close"));if(e=this.$menu.data("menu-builder"))if(XF.MenuBuilder[e])XF.MenuBuilder[e](this.$menu,this.$target,this);else console.error("No menu builder "+e+" found")}else console.error("No menu found for %o",this.$target[0])},click:function(a){if(!(a.ctrlKey||a.shiftKey||a.altKey)||!this.$target.attr("href")){var b=XF.isEventTouchTriggered(a),c=!0;!b&&this.isOpen()&&
(c=!1);c&&a.preventDefault();this.toggle(b,XF.NavDeviceWatcher.isKeyboardNav())}},isOpen:function(){return this.$target.hasClass(this.options.targetOpenClass)},toggle:function(a){this.isOpen()?this.close():this.open(a)},open:function(a){var b=this.$menu,c=this.$target,e=this.$menuPosRef,k=0;if(!this.isOpen()&&!b.hasClass("is-disabled")){this.pauseRepositioning=!1;b.appendTo("body");this.updateMenuDimensions();this.updatePositionReferences();var g=this;this.$target.hasFixableParent()&&(this.scrollFunction=
function(){c.is(":hidden")?g.close():g.repositionFixed(!0)},b.addClass("menu--potentialFixed"),d(f).onPassive("scroll",this.scrollFunction));if(this.options.zIndexRef){var h=XF.findRelativeIf(this.options.zIndexRef,c);h.length&&(k=XF.getElEffectiveZIndex(h))}XF.setRelativeZIndex(b,c,0,k);XF.MenuWatcher.onOpen(b,a);this.reposition();c.attr("aria-expanded","true").addClassTransitioned(this.options.targetOpenClass);b.attr("aria-hidden","false").addClassTransitioned(this.options.openClass,XF.proxy(function(){b.addClassTransitioned(this.options.completeClass)},
this));e.addClassTransitioned(this.options.targetOpenClass);this.$target.trigger("menu:opened",[b]);b.trigger("menu:opened");if(!XF.isIOS()||!this.isPotentiallyFixed)b.on("menu:complete",function(){XF.autoFocusWithin(b,"[autofocus], [data-menu-autofocus]")});if(b.data("href")){if(!b.data("menu-loading")){b.data("menu-loading",!0);var m=b.data("nocache")?!1:!0;XF.ajax("get",b.data("href"),{},function(a){m&&b.data("href",!1);a.html&&XF.setupHtmlInsert(a.html,function(a,c,e){(c=b.data("load-target"))?
b.find(c).first().empty().html(a):b.html(a);g.$target.trigger("menu:loaded",[a,b]);g.updateMenuDimensions();e();setTimeout(XF.proxy(g,"reposition"),0);g.$target.trigger("menu:complete",[b]);b.trigger("menu:complete")})},{cache:m}).always(function(){b.data("menu-loading",!1)})}}else this.$target.trigger("menu:complete",[b]),b.trigger("menu:complete")}},reposition:function(a,b){if(!this.pauseRepositioning||a)if(!this.$menu.data("ios-scroll-timeout")||a){this.updatePositionReferences();this.$menu.css({visibility:"hidden",
display:"block",position:"",top:"",bottom:"",left:"",right:""});a=d(f).viewport();var c={};c=this.getHorizontalPosition(a,c);c=this.getVerticalPosition(a,c,b);c.display="";c.visibility="";this.$menu.css(c)}},repositionFixed:function(a){if(!this.pauseRepositioning){var b=this.$menu;if(a&&XF.isIOS()){a=b.data("ios-scroll-timeout");var c=this;clearTimeout(a);a=setTimeout(function(){b.removeData("ios-scroll-timeout");c.reposition()},300);b.data("ios-scroll-timeout",a)}else{this.updatePositionReferences();
var e=this.$target.data("menu-h");a=b.data("menu-reset-timer");if(e&&this.menuRef.left==e[0]&&this.menuRef.width==e[1]){e=d(f).viewport();var k=this.$target.hasFixedParent()?"fixed":"absolute",g={top:parseInt(b.css("top"),10)};this.menuIsUp=this.$menu.hasClass("menu--up");a&&clearTimeout(a);"fixed"==k&&k!=b.css("position")?(g={"transition-property":"none"},g=this.getVerticalFixedPosition(e,g)):"absolute"==k&&(g={"transition-property":"none"},g=this.getVerticalAbsolutePosition(e,g));b.css(g).toggleClass("menu--up",
this.menuIsUp);a=setTimeout(function(){b.css("transition-property","")},250);b.data("menu-reset-timer",a)}else this.reposition()}}},getHorizontalPosition:function(a,b){var c=!1,e=0;this.menuWidth>a.width?e=this.menuRef.left-a.left:this.menuRef.left+this.menuRef.width/2>a.width*this.options.directionThreshold&&(e=0-this.menuWidth+this.menuRef.width,c=!0);e=Math.min(e,a.right-this.menuWidth-this.menuRef.left-5);e=Math.max(e,a.left-this.menuRef.left+5);b.left=this.menuRef.left+e;this.$target.data("menu-h",
[this.menuRef.left,this.menuRef.width,e]);this.$menu.toggleClass("menu--left",!c).toggleClass("menu--right",c);this.$menu.find(".menu-arrow").css({top:"",left:this.arrowRef.left-this.menuRef.left+this.arrowRef.width/2-e});return b},getVerticalPosition:function(a,b,c){this.menuIsUp=!1;b=!c&&this.$target.hasFixedParent()?this.getVerticalFixedPosition(a,b):this.getVerticalAbsolutePosition(a,b);this.$menu.toggleClass("menu--up",this.menuIsUp);return b},getVerticalFixedPosition:function(a,b){b.top=Math.max(0,
Math.round(this.menuRef.bottom)-a.top)-this.getTopShift();b.position="fixed";b.top+this.menuHeight+a.top>a.bottom&&this.menuRef.top-this.menuHeight>a.top?(b.top="",b.bottom=a.bottom-this.menuRef.top+5,this.menuIsUp=!0):this.menuIsUp=!1;return b},getVerticalAbsolutePosition:function(a,b){b.top=this.menuRef.bottom-this.getTopShift();b.position="";b.top+this.menuHeight>a.bottom&&this.menuRef.top-this.menuHeight>a.top?(b.top="",b.bottom=a.height-this.menuRef.top+5,this.menuIsUp=!0):this.menuIsUp=!1;return b},
getTopShift:function(){return this.$menu.hasClass("menu--structural")?parseInt(XF.config.borderSizeFeature,10):0},updateMenuDimensions:function(){this.menuWidth=this.$menu.outerWidth(!0);this.menuHeight=this.$menu.outerHeight(!0);return{menuWidth:this.menuWidth,menuHeight:this.menuHeight}},updatePositionReferences:function(){this.menuRef=this.$menuPosRef.dimensions(!0);this.arrowRef=this.$arrowPosRef==this.$menuPosRef?this.menuRef:this.$arrowPosRef.dimensions(!0);return{menuRef:this.menuRef,arrowRef:this.arrowRef}},
close:function(){if(this.isOpen()){var a=this.$menu;this.$target.attr("aria-expanded","false").removeClassTransitioned(this.options.targetOpenClass);a.attr("aria-hidden","true").removeClass(this.options.completeClass).removeClassTransitioned(this.options.openClass);this.$menuPosRef.removeClassTransitioned(this.options.targetOpenClass);d(f).offPassive("scroll",this.scrollFunction);XF.MenuWatcher.onClose(a);this.$target.trigger("menu:closed",[a]);a.trigger("menu:closed");this.resetIOSInputFix()}},enableIOSInputFix:function(a){XF.isIOS()&&
(this.reposition(!1,!0),this.pauseRepositioning=!0)},enableIOSInputFixFocus:function(a){if(this.$target.hasFixedParent()){var b=f.scrollY,c=this.$menu,e=d("body");"relative"!=e.css("position")&&(this.pauseRepositioning=!0,c.css({position:"absolute",top:b,"transition-property":"none"}),setTimeout(function(){c.css("transition-property","")},200),d("html").css("overflow","hidden"),e.css({position:"relative",top:-b,"margin-bottom":-b}),a[0].scrollIntoView(),f.scrollBy(0,-100))}},resetIOSInputFix:function(){if(XF.isIOS()){var a=
d("body");if("relative"==a.css("position")){var b=(-1*parseInt(a.css("top"),10)||0)+f.scrollY;a.css({position:"",top:"","margin-bottom":""});d("html").css("overflow","");f.scrollTo(0,b)}this.pauseRepositioning=!1;this.isOpen()&&this.reposition()}},keyboardEvent:function(a){if(("ArrowUp"==a.key||"ArrowDown"==a.key)&&XF.Keyboard.isShortcutAllowed(l.activeElement)&&d(l.activeElement).closest(".menu").get(0)==this.$menu.get(0)){var b=d(l.activeElement),c=b.closest(".menu").find("a");b=c.index(b)+("ArrowUp"==
a.key?-1:1);0>b?b=c.length-1:b>=c.length&&(b=0);d(c.get(b)).focus();a.preventDefault();return!1}}});XF.MenuWatcher=function(){var a=d([]),b=null,c=!1,e=function(a){g(a.target)},k=function(b){a.trigger("menu:reposition")},g=function(b){if(!c){c=!0;var e=d(b);a.each(function(){var a=d(this).data("menu-trigger"),b=a?a.$target:null;e.closest(this).length||b&&e.closest(b).length||a&&a.close()});c=!1}};return{onOpen:function(c,g){b||(b=d('<div class="menuOutsideClicker" />').on("click",e).insertBefore(c));
a.length||(d(l).on("click",e),d(f).onPassive("resize",k),g&&b.addClass("is-active"));a=a.add(c)},onClose:function(c){a=a.not(c);a.length||(d(l).off("click",e),d(f).offPassive("resize",k),b&&b.removeClass("is-active"));g(c)},closeAll:function(){c=!0;a.trigger("menu:close");c=!1},closeUnrelated:g}}();XF.MenuBuilder={actionBar:function(a,b,c){var e=a.find(".js-menuBuilderTarget");b.closest(".actionBar-set").find(".actionBar-action--menuItem").each(function(){var a=d(this).clone();a.removeClass().addClass("menu-linkRow");
e.append(a)});XF.activate(e)},dataList:function(a,b,c){var e=a.find(".js-menuBuilderTarget");b.closest(".dataList-row").find(".dataList-cell--responsiveMenuItem").each(function(){d(this).clone().children().each(function(){var a=d(this);a.is("a")?a.removeClass().addClass("menu-linkRow"):a.wrap('<div class="menu-row"></div>');e.append(a)})});XF.activate(e)}};XF.MenuProxy=XF.Click.newHandler({eventNameSpace:"XFMenuProxy",options:{trigger:null},$trigger:null,init:function(){this.$trigger=XF.findRelativeIf(this.options.trigger,
this.$target);if(!this.$trigger||!this.$trigger.length)throw Error("Specified menu trigger not found");},click:function(a){setTimeout(XF.proxy(function(){this.$trigger.trigger("click",[a])},this),0)}});XF.OffCanvasClick=XF.Click.newHandler({eventNameSpace:"XFOffCanvasClick",options:{menu:null,openClass:"is-active"},$menu:null,init:function(){this.options.menu&&(this.$menu=XF.findRelativeIf(this.options.menu,this.$target));this.$menu&&this.$menu.length||(this.$menu=this.$target.nextAll("[data-menu]").first());
if(this.$menu.length){this.$menu.on("click","[data-menu-close]",XF.proxy(this,"closeTrigger")).on("off-canvas:close",XF.proxy(this,"closeTrigger")).on("off-canvas:open",XF.proxy(this,"openTrigger"));var a=this.$menu.data("ocm-builder");if(a)if(XF.OffCanvasBuilder[a])XF.OffCanvasBuilder[a](this.$menu,this);else console.error("No off canvas builder "+a+" found")}else console.error("No menu found for %o",this.$target[0])},click:function(a){a.preventDefault();this.toggle()},isOpen:function(){return this.$menu.hasClass(this.options.openClass)},
toggle:function(){this.isOpen()?this.close():this.open()},openTrigger:function(a){a.preventDefault();this.open()},open:function(){if(!this.isOpen()){var a=this.$menu;this.addOcmClasses(a);a.attr("aria-hidden","false").trigger("off-canvas:opening");a.addClassTransitioned(this.options.openClass,function(){a.trigger("off-canvas:opened")});XF.Modal.open()}},addOcmClasses:function(a){var b=a.attr("data-ocm-class");b&&a.addClass(b);a.find("[data-ocm-class]").each(function(){var a=d(this);a.addClass(a.attr("data-ocm-class"))})},
removeOcmClasses:function(a){var b=a.attr("data-ocm-class");b&&a.removeClass(b);a.find("[data-ocm-class]").each(function(){var a=d(this);a.removeClass(a.attr("data-ocm-class"))})},closeTrigger:function(a,b){a.preventDefault();this.close(b&&b.instant)},close:function(a){if(this.isOpen()){var b=this.$menu,c=this;b.attr("aria-hidden","true").trigger("off-canvas:closing");b.removeClassTransitioned(this.options.openClass,function(){b.trigger("off-canvas:closed");c.removeOcmClasses(b)},a);XF.Modal.close()}}});
XF.OffCanvasBuilder={navigation:function(a,b){a.appendTo("body");var c=d('<ul class="offCanvasMenu-list" />');d(".js-offCanvasNavSource .p-navEl").each(function(){var a=d(this),b=a.hasClass("is-selected"),g=a.find(".p-navEl-link"),h=a.find("[data-menu]");a.data("has-children")&&!h.length&&(a=a.find('[data-xf-click~="menu"]').first().data("xf-click-handlers"))&&a.menu&&(h=a.menu.$menu);if(g.length){a=d('<div class="offCanvasMenu-linkHolder" />');var f=g.clone();g=d("<li />");f.removeClass("p-navEl-link p-navEl-link--menuTrigger p-navEl-link--splitMenu").addClass("offCanvasMenu-link");
a.html(f);b&&(g.addClass("is-selected"),a.addClass("is-selected"));g.html(a);if(h.length){f=d('<a class="offCanvasMenu-link offCanvasMenu-link--splitToggle" data-xf-click="toggle" data-target="< :up :next" role="button" tabindex="0" />');b&&f.addClass("is-active");a.append(f);var n=d('<ul class="offCanvasMenu-subList" />');b&&n.addClass("is-active");h.find(".menu-linkRow").each(function(){var a=d(this),b=d("<li />");b.html(a.clone().removeClass("menu-linkRow").addClass("offCanvasMenu-link"));n.append(b)});
g.append(n)}c.append(g)}});a=a.find(".js-offCanvasNavTarget").append(c);XF.activate(a)},sideNav:function(a,b){var c=a.find(".offCanvasMenu-content"),e=b.$target;c.find("[data-menu-close]").length||(b=c.find(".block-header:first"),b.length||(b=d('<div class="offCanvasMenu-header offCanvasMenu-header--separated offCanvasMenu-shown" />'),b.html(e.html()),c.prepend(b)),b.append('<a class="offCanvasMenu-closer" data-menu-close="true" role="button" tabindex="0" />'));d(f).onPassive("resize",function(){e.is(":visible")||
a.trigger("off-canvas:close")})}};XF.OverlayClick=XF.Click.newHandler({eventNameSpace:"XFOverlayClick",options:{cache:!0,overlayConfig:{},forceFlashMessage:!1,followRedirects:!1},overlay:null,loadUrl:null,loading:!1,visible:!1,init:function(){var a=this.getOverlayHtml();if(a)this.setupOverlay(new XF.Overlay(a,this.options.overlayConfig));else{a=this.getLoadUrl();if(!a)throw Error("Could not find an overlay for target");this.loadUrl=a}},click:function(a){a.preventDefault();this.toggle()},toggle:function(){this.overlay?
this.overlay.toggle():this.show()},show:function(){if(this.overlay)this.overlay.show();else if(!this.loading){this.loading=!0;var a=this,b={cache:this.options.cache,beforeShow:function(b){a.overlay=b},init:XF.proxy(this,"setupOverlay")};this.options.followRedirects&&(b.onRedirect=function(b,d){a.options.forceFlashMessage?XF.flashMessage(b.message,1E3,function(){XF.redirect(b.redirect)}):XF.redirect(b.redirect)});(b=XF.loadOverlay(this.loadUrl,b,this.options.overlayConfig))?b.always(function(){setTimeout(function(){a.loading=
!1},300)}):this.loading=!1}},hide:function(){this.overlay&&this.overlay.hide()},getOverlayHtml:function(){var a=this.$target,b=a.data("target");if(b){var c=a.find(b).eq(0);c.length||(c=d(b).eq(0))}c&&c.length||(a=a.attr("href"))&&"#"==a.substr(0,1)&&(c=d(a).eq(0));c&&c.length&&!c.is(".overlay")&&(c=XF.getOverlayHtml(c));return c&&c.length?c:null},getLoadUrl:function(){var a=this.$target;return a.data("href")||a.attr("href")||null},setupOverlay:function(a){this.overlay=a;var b=this;a.on({"overlay:shown":function(){b.visible=
!0},"overlay:hidden":function(){b.visible=!1}});if(!this.options.cache&&this.loadUrl)a.on("overlay:hidden",function(){b.overlay=null});return this.overlay}});XF.OverlayClick.overlayCache={};XF.ToggleClick=XF.Click.newHandler({eventNameSpace:"XFToggleClick",options:{target:null,container:null,hide:null,activeClass:"is-active",activateParent:null,scrollTo:null},$toggleTarget:null,$toggleParent:null,toggleUrl:null,ajaxLoaded:!1,loading:!1,init:function(){this.$toggleTarget=XF.getToggleTarget(this.options.target,
this.$target);if(!this.$toggleTarget)return!1;this.options.activateParent&&(this.$toggleParent=this.$target.parent());this.toggleUrl=this.getToggleUrl()},click:function(a){a.preventDefault();this.$toggleTarget&&this.toggle()},isVisible:function(){return this.$toggleTarget.hasClass(this.options.activeClass)},isTransitioning:function(){return this.$toggleTarget.hasClass("is-transitioning")},toggle:function(){this.isVisible()?this.hide():this.show();this.$target.blur()},load:function(){var a=this.toggleUrl,
b=this;a&&!this.loading&&(this.loading=!0,XF.ajax("get",a,function(a){a.html&&XF.setupHtmlInsert(a.html,function(a,c,d){if(c=b.$toggleTarget.data("load-selector"))c=a.find(c).first(),c.length&&(a=c);b.ajaxLoaded=!0;b.$toggleTarget.append(a);XF.activate(a);d(!0);b.show();return!1})}).always(function(){b.ajaxLoaded=!0;b.loading=!1}))},hide:function(a){if(this.isVisible()&&!this.isTransitioning()){var b=this.options.activeClass;this.$toggleParent&&this.$toggleParent.removeClassTransitioned(b,XF.proxy(this,
"inactiveTransitionComplete"),a);this.$toggleTarget&&this.$toggleTarget.removeClassTransitioned(b,XF.proxy(this,"inactiveTransitionComplete"),a);this.$target.removeClassTransitioned(b,XF.proxy(this,"inactiveTransitionComplete"),a)}},show:function(a){if(!this.isVisible()&&!this.isTransitioning()&&!this.getOtherToggles().filter(".is-transitioning").length)if(this.toggleUrl&&!this.ajaxLoaded)this.load();else{this.closeOthers();var b=this.options.activeClass;this.$toggleParent&&this.$toggleParent.addClassTransitioned(b,
this.activeTransitionComplete,a);this.$toggleTarget&&this.$toggleTarget.addClassTransitioned(b,this.activeTransitionComplete,a);this.$target.addClassTransitioned(b,this.activeTransitionComplete,a);this.hideSpecified();this.scrollTo();XF.autoFocusWithin(this.$toggleTarget,"[autofocus], [data-toggle-autofocus]")}},activeTransitionComplete:function(a){d(this).trigger("toggle:shown");XF.layoutChange()},inactiveTransitionComplete:function(a){d(this).trigger("toggle:hidden");XF.layoutChange()},closeOthers:function(){this.getOtherToggles().each(function(){var a=
d(this).data("xf-click-handlers");a||(a=XF.Click.initElement(this));a&&a.toggle&&a.toggle.hide(!0)})},hideSpecified:function(){var a=d(this.options.hide);a&&a.length&&a.hide()},scrollTo:function(){if(this.options.scrollTo){var a=this.$toggleTarget,b=a.offset().top;a=a.height();var c=d(f).height();b=a<c?b-(c/2-a/2):b;d("html, body").animate({scrollTop:b},XF.config.speed.fast)}},getToggleUrl:function(){var a=this.$toggleTarget,b;return a&&(b=a.data("href"))?"trigger-href"==b?this.$target.attr("href"):
b:null},getContainer:function(){if(this.options.container){var a=this.$target.closest(this.options.container);if(a.length)return a;console.error("Container parent not found: "+this.options.container)}return null},getOtherToggles:function(){var a=this.getContainer();return a&&a.length?a.find("[data-xf-click~=toggle]").not(this.$target[0]):d([])}});XF.getToggleTarget=function(a,b){a=a?XF.findRelativeIf(a,b):b.next();if(!a.length)throw Error("No toggle target for %o",b);return a};XF.ToggleStorage=XF.Element.newHandler({options:{storageType:"local",
storageContainer:"toggle",storageKey:null,target:null,container:null,hide:null,activeClass:"is-active",activateParent:null},targetId:null,init:function(){var a=this.options.storageContainer;if(!a)throw Error("Storage container not specified for ToggleStorage handler");var b=this.options.storageKey;if(!b)throw Error("Storage key not specified for ToggleStorage handler");XF.ToggleStorageData.setStorageType(this.options.storageType);b=XF.ToggleStorageData.get(a,b);if(null!==b){var c=XF.getToggleTarget(this.options.target,
this.$target);if(c.length){var d=this.options.activeClass;this.$target.toggleClass(d,b);c.toggleClass(d,b)}}XF.ToggleStorageData.prune(a);this.$target.on("xf-click:after-click.XFToggleClick",XF.proxy(this,"updateStorage"))},updateStorage:function(){var a=this.options;XF.ToggleStorageData.set(a.storageContainer,a.storageKey,this.$target.hasClass(a.activeClass))}});XF.ToggleStorageData=function(){function a(){switch(g){case "local":return XF.LocalStorage;case "cookie":return XF.Cookie}}function b(b,
g){var h=e[b],f=function(){clearTimeout(h);e[b]=null;if(c[b]){var f=a(),g=c[b];d.isEmptyObject(g)?f.remove(b):f.setJson(b,g)}};g?f():h||(e[b]=setTimeout(f,100))}var c={},e={},f={},g="local";return{setStorageType:function(a){switch(a){case "local":case "cookie":g=a;break;default:throw Error("Storage type not supported");}},get:function(d,e,f){f||(f={});var g=f.allowExpired||!0;f=f.touch||!0;var h=a();c[d]||(c[d]=h.getJson(d));h=c[d];if(!h.hasOwnProperty(e))return null;h=h[e];var k=Math.floor(Date.now()/
1E3);if(!g&&h[0]+h[1]<k)return delete c[d][e],b(d),null;f&&(h[0]=k,c[d][e]=h,b(d));return h[2]},set:function(a,d,e,f){c[a]||(c[a]={});f||(f=14400);var g=Math.floor(Date.now()/1E3);c[a][d]=[g,f,e];b(a)},remove:function(a,d){c[a]||(c[a]={});delete c[a][d];b(a)},prune:function(d,e){var g=f[d],k=function(){clearTimeout(g);f[d]=null;var e=a();c[d]||(c[d]=e.getJson(d));e=c[d];var k=Math.floor(Date.now()/1E3),h=!1,l;for(l in e)if(e.hasOwnProperty(l)){var n=e[l];n[0]+n[1]<k&&(delete e[l],h=!0)}h&&(c[d]=e,
b(d))};e?k():g||(f[d]=setTimeout(k,100))}}}();XF.HScroller=XF.Element.newHandler({options:{scrollerClass:"hScroller-scroll",actionClass:"hScroller-action",autoScroll:".tabs-tab.is-active"},$scrollTarget:null,$goStart:null,$goEnd:null,init:function(){var a=this.$target.find("."+this.options.scrollerClass).first();if(a.length){this.$scrollTarget=a;var b,c,e=this;a.on("mousedown.horizontalScroller",function(a){a.button||(b=a.clientX,c=!1,a.preventDefault(),XF.isEventTouchTriggered(a)&&(a=d(l.activeElement),
a.is(":input")&&a.blur()),d(f).on("mouseup.horizontalScroller",function(a){d(f).off(".horizontalScroller");c&&a.preventDefault()}).on("mousemove.horizontalScroller",function(a){var d=b-a.clientX;0!=d&&(e.move(d)&&(c=!0),b=a.clientX)}))}).on("click.horizontalScroller",function(a){c&&(a.preventDefault(),a.stopImmediatePropagation(),c=!1)}).on("scroll.horizontalScroller",XF.proxy(this,"updateScroll")).on("tab:click.horizontalScroller",function(a){c&&a.preventDefault()});var k=XF.measureScrollBar(null,
"height");a.addClass("is-calculated");0!=k&&a.css("margin-bottom",parseInt(a.css("margin-bottom"),10)-k+"px");k=this.options.actionClass;this.$goStart=d('<i class="'+k+" "+k+'--start" aria-hidden="true" />').click(function(){e.step(-1)}).insertAfter(a);this.$goEnd=d('<i class="'+k+" "+k+'--end" aria-hidden="true" />').click(function(){e.step(1)}).insertAfter(a);this.updateScroll();d(l.body).on("xf:layout",XF.proxy(this,"updateScroll"));var g;d(f).on("resize",function(){g&&clearTimeout(g);g=setTimeout(XF.proxy(e,
"updateScroll"),100)});var h=a.find(this.options.autoScroll).first();if(h.length){k=this.$target.width();var m=h.position();h=h.outerWidth();m=m.left;h=m+h;XF.isRtl()?80>m&&a.normalizedScrollLeft(-h+k-50):h>k&&(h+80>k?a.normalizedScrollLeft(m-50):a.normalizedScrollLeft(m-80))}}else console.error("no scroll target")},move:function(a){var b=this.$scrollTarget,c=b.normalizedScrollLeft();XF.isRtl()&&(a*=-1);b.normalizedScrollLeft(c+a);return b.normalizedScrollLeft()!==c},step:function(a){var b=Math.max(125,
Math.floor(.25*this.$scrollTarget.width())),c="+=";switch(d.support.scrollLeftType){case "inverted":case "negative":c="-="}this.$scrollTarget.animate({scrollLeft:c+a*b},150)},updateScroll:function(){var a=this.$scrollTarget[0],b=this.$scrollTarget.normalizedScrollLeft();a=a.offsetWidth+b+1<a.scrollWidth;this.$goStart[0<b?"addClass":"removeClass"]("is-active");this.$goEnd[a?"addClass":"removeClass"]("is-active")}});XF.ResponsiveDataList=XF.Element.newHandler({options:{headerRow:".dataList-row--header",
headerCells:"th, td",rows:".dataList-row:not(.dataList-row--subSection, .dataList-row--header)",rowCells:"td",triggerWidth:"narrow"},$headerRow:null,headerText:[],$rows:null,isResponsive:!1,init:function(){var a=this.$target.find(this.options.headerRow).first(),b=[];a.find(this.options.headerCells).each(function(){var a=d(this),e=a.text();a=parseInt(a.attr("colspan"),10);b.push(d.trim(e));if(1<a)for(e=1;e<a;e++)b.push("")});this.$headerRow=a;this.headerText=b;this.$rows=this.$target.find(this.options.rows);
this.process();d(l).on("breakpoint:change",XF.proxy(this,"process"))},process:function(){var a=XF.Breakpoint.isAtOrNarrowerThan(this.options.triggerWidth);a&&this.isResponsive||!a&&!this.isResponsive||(a?this.apply():this.remove())},apply:function(){var a=this;this.$rows.each(function(){a.processRow(d(this),!0)});this.$target.addClass("dataList--responsive");this.$headerRow.addClass("dataList-row--headerResponsive");this.isResponsive=!0},remove:function(){var a=this;this.$rows.each(function(){a.processRow(d(this),
!1)});this.$target.removeClass("dataList--responsive");this.$headerRow.removeClass("dataList-row--headerResponsive");this.isResponsive=!1},processRow:function(a,b){var c=0,e=this.headerText;a.find(this.options.rowCells).each(function(){var a=d(this);if(b){var f=e[c];f&&f.length&&!a.data("hide-label")?a.attr("data-cell-label",f):a.removeAttr("data-cell-label")}else a.removeAttr("data-cell-label");c++})}});XF.Sticky=XF.Element.newHandler({options:{parent:null,inner_scrolling:!0,sticky_class:"is-sticky",
offset_top:null,spacer:null,bottoming:null,recalc_every:null},init:function(){"false"==this.options.spacer&&(this.options.spacer=!1);this.$target.stick_in_parent(this.options)}});XF.StickyHeader=XF.Element.newHandler({options:{stickyClass:"is-sticky",stickyBrokenClass:"is-sticky-broken",stickyDisabledClass:"is-sticky-disabled",minWindowHeight:251},active:null,supportsSticky:!1,stickyBroken:!1,windowTooSmall:!1,init:function(){var a=this.$target.css("position");a="sticky"==a||"-webkit-sticky"==a;var b=
!1;if(a){var c=f.navigator.userAgent.match(/Chrome\/(\d+)/);c&&60>parseInt(c[1],10)&&(b=!0,a=!1)}this.supportsSticky=a;this.stickyBroken=b;this.update();d(f).on("resize.sticky-header",XF.proxy(this,"update"))},update:function(){(this.windowTooSmall=d(f).height()<this.options.minWindowHeight)?!1!==this.active&&this._disable():this.active||this._enable()},_enable:function(){this.active=!0;var a=this.$target,b=this.options.stickyClass,c=this.options.stickyBrokenClass;a.removeClass(this.options.stickyDisabledClass);
if(this.supportsSticky){var e=!1,k=parseInt(a.css("top"),10),g=XF.isIOS(),h,l=function(c){var d=Math.floor(a[0].getBoundingClientRect().top);d<k||d==k&&0<f.scrollY?e||(a.addClass(b),e=!0):e&&(g&&c?(clearTimeout(h),h=setTimeout(function(){l(!1)},200)):(a.removeClass(b),e=!1))};d(f).on("scroll.sticky-header",function(){l(!0)});l(!1)}else this.stickyBroken&&setTimeout(function(){a.addClass(c)},0),a.stick_in_parent({sticky_class:b})},_disable:function(){this.active=!1;var a=this.$target,b=this.options.stickyClass,
c=this.options.stickyBrokenClass,e=this.options.stickyDisabledClass;this.supportsSticky?d(f).off("scroll.sticky-header"):a.trigger("sticky_kit:detach").removeData("sticky_kit");a.removeClass(b).removeClass(c).addClass(e)}});XF.Tabs=XF.Element.newHandler({options:{tabs:".tabs-tab",panes:null,activeClass:"is-active",state:null},initial:0,$tabs:null,$panes:null,$activeTab:null,$activePane:null,init:function(){var a=this.$target;var b=this.$tabs=a.find(this.options.tabs);a=this.options.panes?XF.findRelativeIf(this.options.panes,
a):a.next();a.is("ol, ul")&&(a=a.find("> li"));this.$panes=a;if(b.length!=a.length)console.error("Tabs and panes contain different totals: %d tabs, %d panes",b.length,a.length),console.error("Tabs: %o, Panes: %o",b,a);else{for(a=0;a<b.length;a++)if(b.eq(a).hasClass(this.options.activeClass)){this.initial=a;break}b.on("click",XF.proxy(this,"tabClick"));d(f).on("hashchange",XF.proxy(this,"onHashChange"));d(f).on("popstate",XF.proxy(this,"onPopState"));this.reactToHash()}},getSelectorFromHash:function(){var a=
"";if(1<f.location.hash.length){var b=f.location.hash.replace(/[^a-zA-Z0-9_-]/g,"");b&&b.length&&(a="#"+b)}return a},reactToHash:function(){var a=this.getSelectorFromHash();a?this.activateTarget(a):this.activateTab(this.initial)},onHashChange:function(a){this.reactToHash()},onPopState:function(a){(a=a.originalEvent.state)&&a.id?this.activateTarget("#"+a.id,!1):a&&a.offset?this.activateTab(a.offset):this.activateTab(this.initial)},activateTarget:function(a){var b=this.$tabs,c=!1,e=!1;if(a){try{var f=
d(a);c=f&&0<f.length}catch(g){c=!1}if(c)for(c=0;c<b.length;c++)b.eq(c).is(a)&&(this.activateTab(c),e=!0)}e||this.activateTab(this.initial)},activateTab:function(a){var b=this.$tabs.eq(a),c=this.$panes.eq(a),d=this.options.activeClass;b.length&&c.length?(this.$tabs.filter("."+d).removeClass(d).attr("aria-selected","false").trigger("tab:hidden"),this.$panes.filter("."+d).removeClass(d).attr("aria-expanded","false").trigger("tab:hidden"),b.addClass(d).attr("aria-selected","true").trigger("tab:shown"),
c.addClass(d).attr("aria-expanded","true").trigger("tab:shown"),XF.layoutChange(),c.data("href")&&!c.data("tab-loading")&&(c.data("tab-loading",!0),XF.ajax("get",c.data("href"),{},function(a){c.data("href",!1);if(a.html){var b=c.data("load-target");b?XF.setupHtmlInsert(a.html,c.find(b)):XF.setupHtmlInsert(a.html,c)}}).always(function(){c.data("tab-loading",!1)}))):console.error("Selected invalid tab "+a)},tabClick:function(a){var b=a.currentTarget,c=this.$tabs.index(b);if(-1==c)console.error("Did not find clicked element (%o) in tabs",
b);else{b=this.$tabs.eq(c);var e=d.Event("tab:click");b.trigger(e,this);if(!e.isDefaultPrevented()){a.preventDefault();if(Modernizr.history&&this.options.state)switch(a=f.location.href.split("#")[0],b.attr("id")?(a=a+"#"+b.attr("id"),b={id:b.attr("id")}):b={offset:c},this.options.state){case "replace":f.history.replaceState(b,"",a);break;case "push":f.history.pushState(b,"",a)}this.activateTab(c)}}}});XF.PageJump=XF.Element.newHandler({options:{pageUrl:null,pageInput:"| .js-pageJumpPage",pageSubmit:"| .js-pageJumpGo",
sentinel:"%page%"},$input:null,init:function(){var a=this;this.options.pageUrl?(this.$input=XF.findRelativeIf(this.options.pageInput,this.$target),this.$input.length?(this.$input.on("keyup",function(b){13==b.which&&(b.preventDefault(),a.go())}),XF.findRelativeIf(this.options.pageSubmit,this.$target).on("click",function(b){b.preventDefault();a.go()}),this.$target.closest(".menu").on("menu:opened",function(){a.shown()})):console.error("No input provided to page jump")):console.error("No page-url provided to page jump")},
shown:function(){this.$input.select()},go:function(){var a=parseInt(this.$input.val(),10);1>a&&(a=1);var b=this.options.pageUrl,c=this.options.sentinel,d=b.replace(c,a);d==b&&(d=b.replace(encodeURIComponent(c),a));XF.redirect(d)}});XF.QuickSearch=XF.Element.newHandler({options:{select:"| .js-quickSearch-constraint"},$select:null,init:function(){this.$select=XF.findRelativeIf(this.options.select,this.$target);this.$select.on("change",XF.proxy(this,"updateSelectWidth"));this.updateSelectWidth()},updateSelectWidth:function(){if(this.$select.length){var a=
d("<span />").addClass(this.$select.attr("class")).addClass("input--select"),b=this.$select.find("option:selected");b.length||(b=this.$select.find("option:first"));a.text(b.text());a.css("display","inline");b=d("<div />");b.css({position:"absolute",top:-200,visibility:"hidden"});b.css(XF.isRtl()?"right":"left",-9999);a.appendTo(b);b.appendTo("body");this.$select.css({width:a.outerWidth()+8,"flex-grow":0,"flex-shrink":0});b.remove()}}});XF.TouchProxy=XF.Element.newHandler({options:{allowed:":input, :checkbox, a, label, [data-tp-clickable], [data-tp-primary]"},
active:!0,timer:null,$proxy:null,init:function(){var a=this;if("InputDeviceCapabilities"in f||"sourceCapabilities"in UIEvent.prototype)this.$target.click(function(b){var c=b.originalEvent;c&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents&&a.handleTapEvent(b)});else if(Modernizr.touchevents){var b=!1;this.$target.on("touchstart",function(){b=!1}).on("touchmove",function(){b=!0}).on("touchend",function(c){b||a.handleTapEvent(c)})}},isClickable:function(a){a=d(a).closest(this.options.allowed);
return!(!a.length||!this.$target.find(a).length)},handleTapEvent:function(a){this.getProxy().length&&this.active&&!this.isClickable(a.target)&&(a.preventDefault(),this.trigger())},getProxy:function(){if(!this.$proxy){var a=this.$target.find("[data-tp-primary]").first();a.length||(a=this.$target.find("a[href]").first());this.$proxy=a}return this.$proxy},trigger:function(a){a=this.getProxy();if(a.length){this.timer&&clearTimeout(this.timer);this.active=!1;a[0].click?a[0].click():a.click();var b=this;
this.timer=setTimeout(function(){b.active=!0},500)}}});XF.Click.register("inserter","XF.InserterClick");XF.Click.register("menu","XF.MenuClick");XF.Click.register("menu-proxy","XF.MenuProxy");XF.Click.register("off-canvas","XF.OffCanvasClick");XF.Click.register("overlay","XF.OverlayClick");XF.Click.register("toggle","XF.ToggleClick");XF.Element.register("focus-inserter","XF.InserterFocus");XF.Element.register("h-scroller","XF.HScroller");XF.Element.register("page-jump","XF.PageJump");XF.Element.register("quick-search",
"XF.QuickSearch");XF.Element.register("responsive-data-list","XF.ResponsiveDataList");XF.Element.register("sticky","XF.Sticky");XF.Element.register("sticky-header","XF.StickyHeader");XF.Element.register("tabs","XF.Tabs");XF.Element.register("toggle-storage","XF.ToggleStorage");XF.Element.register("touch-proxy","XF.TouchProxy");d(l).on("xf:page-load-complete",function(){var a=f.location.hash.replace(/[^a-zA-Z0-9_-]/g,"");a&&(a=a?d("#"+a):d(),a.length&&(a=a.closest("[data-toggle-wrapper]"),a.length&&
(a=a.find('[data-xf-click~="toggle"]').first(),a.length&&(a=XF.Click.getElementHandler(a,"toggle"))&&a.show(!0))))})}(jQuery,window,document);

/*
 * XenForo tooltip.min.js
 * Copyright 2010-2018 XenForo Ltd.
 * Released under the XenForo License Agreement: https://xenforo.com/license-agreement
 */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,l,e){d instanceof String&&(d=String(d));for(var a=d.length,b=0;b<a;b++){var c=d[b];if(l.call(e,c,b,d))return{i:b,v:c}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,l,e){d!=Array.prototype&&d!=Object.prototype&&(d[l]=e.value)};
$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(d,l,e,a){if(l){e=$jscomp.global;d=d.split(".");for(a=0;a<d.length-1;a++){var b=d[a];b in e||(e[b]={});e=e[b]}d=d[d.length-1];a=e[d];l=l(a);l!=a&&null!=l&&$jscomp.defineProperty(e,d,{configurable:!0,writable:!0,value:l})}};
$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,e){return $jscomp.findInternal(this,d,e).v}},"es6","es3");
!function(d,l,e){XF.TooltipElement=XF.create({options:{baseClass:"tooltip",extraClass:"tooltip--basic",html:!1,inViewport:!0,loadRequired:!1,loadParams:null,placement:"top"},content:null,$tooltip:null,shown:!1,shownFully:!1,placement:null,positioner:null,loadRequired:!1,loading:!1,contentApplied:!1,setupCallbacks:null,__construct:function(a,b,c){this.setupCallbacks=[];this.options=d.extend(!0,{},this.options,b);this.content=a;this.loadRequired=this.options.loadRequired;c&&this.setPositioner(c)},setPositioner:function(a){this.positioner=
a},addSetupCallback:function(a){this.$tooltip?a(this.$tooltip):this.setupCallbacks.push(a)},show:function(){if(!this.shown)if(this.shown=!0,this.loadRequired)this.loadContent();else{var a=this.getTooltip(),b=this;this.reposition();d(l).on("resize.tooltip-"+a.xfUniqueId(),XF.proxy(this,"reposition"));a.trigger("tooltip:shown").stop().css({visibility:"",display:"none"}).fadeIn("fast",function(){b.shownFully=!0})}},hide:function(){if(this.shown){this.shownFully=this.shown=!1;var a=this.$tooltip;a&&(a.stop().fadeOut("fast").trigger("tooltip:hidden"),
d(l).off("resize.tooltip-"+a.xfUniqueId()))}},toggle:function(){this.shown?this.hide():this.show()},destroy:function(){this.$tooltip&&this.$tooltip.remove()},isShown:function(){return this.shown},isShownFully:function(){return this.shown&&this.shownFully},requiresLoad:function(){return this.loadRequired},getPlacement:function(){return XF.rtlFlipKeyword(this.options.placement)},reposition:function(){var a=this.positioner;if(!a)console.error("No tooltip positioner");else if(!this.loadRequired){var b=
this.options.inViewport;if(a instanceof d){var c=a.dimensions(!0);a.closest(".overlay").length&&(b=!0)}else"undefined"!==typeof a[0]&&"undefined"!==typeof a[1]?c={top:a[1],right:a[0],bottom:a[1],left:a[0]}:"undefined"!==typeof a.right&&"undefined"!==typeof a.bottom?c=a:console.error("Positioner is not in correct format",a);c.width=c.right-c.left;c.height=c.bottom-c.top;a=this.getTooltip();var h=this.getPlacement(),m=this.options.baseClass,k=h;if(b){var n=d(l);b=n.height();var f=n.width();var e=n.scrollTop();
n=n.scrollLeft();var g;(g=XF.Element.getHandlers("sticky-header"))&&g[0].$target.hasClass(g[0].options.stickyClass)&&(e+=g[0].$target.outerHeight());f={top:e,left:n,right:n+f,bottom:e+b,width:f,height:b}}else f=d("body").dimensions();this.placement&&a.removeClass(m+"--"+this.placement);a.addClass(m+"--"+h).css({visibility:"hidden",display:"block",top:"",bottom:"",left:"",right:"","padding-left":"","padding-right":"","padding-top":"","padding-bottom":""});g=a.outerWidth();b=a.outerHeight();"top"==
h&&c.top-b<f.top?h="bottom":"bottom"==h&&c.bottom+b>f.bottom?c.top-b>=f.top&&(h="top"):"left"==h&&c.left-g<f.left?h=c.right+g>f.right?c.top-b<f.top?"bottom":"top":"right":"right"==h&&c.right+g>f.right&&(h=c.left-g<f.left?c.top-b<f.top?"bottom":"top":"left");h!=k&&a.removeClass(m+"--"+k).addClass(m+"--"+h);k={top:"",right:"",bottom:"",left:""};switch(h){case "top":k.bottom=d(l).height()-c.top;k.left=c.left+c.width/2-g/2;break;case "bottom":k.top=c.bottom;k.left=c.left+c.width/2-g/2;break;case "left":k.top=
c.top+c.height/2-b/2;k.right=d(l).width()-c.left;break;default:k.top=c.top+c.height/2-b/2,k.left=c.right}a.css(k);e=a.dimensions(!0);b=c=0;m=a.find("."+m+"-arrow");if("left"==h||"right"==h)e.top<f.top?c=f.top-e.top:e.bottom>f.bottom&&(c=f.bottom-e.bottom),m.css({left:"",top:50-100*c/e.top+"%"});else{e.left<f.left?b=f.left-e.left:e.left+g>f.right&&(b=f.right-(e.left+g));f=parseInt(g/100*(50-100*b/g),0);var p=f+parseInt(m.css("margin-left")),q=p+m.outerWidth();e=parseInt(a.css("padding-left"),10);n=
parseInt(a.css("padding-right"),10);p<e?(g=e-p,a.css({"padding-left":Math.max(0,e-g),"padding-right":n+g})):q>g-n&&(g=q-(g-n),a.css({"padding-left":n+g,"padding-right":Math.max(0,n-g)}));m.css({top:"",left:f})}b?a.css("left",k.left+b):c&&a.css("top",k.top+c);this.placement=h;this.shown&&!this.loadRequired&&a.css("visibility","")}},attach:function(){this.getTooltip()},getTooltip:function(){if(!this.$tooltip){var a=this.getTemplate();a.appendTo("body");this.$tooltip=a;this.loadRequired||this.applyTooltipContent()}return this.$tooltip},
applyTooltipContent:function(){if(this.contentApplied||this.loadRequired)return!1;var a=this.getTooltip(),b=a.find("."+this.options.baseClass+"-content"),c=this.content;d.isFunction(c)&&(c=c());this.options.html?(b.html(c),b.find("img").on("load",XF.proxy(this,"reposition"))):b.text(c);b=this.setupCallbacks;for(c=0;c<b.length;c++)b[c](a);XF.activate(a);return this.contentApplied=!0},loadContent:function(){if(this.loadRequired&&!this.loading){var a=this.content,b=this,c=function(a){b.content=a;b.loadRequired=
!1;b.loading=!1;b.applyTooltipContent();b.shown&&(b.shown=!1,b.show())};d.isFunction(a)?(this.loading=!0,a(c,this.options.loadParams)):c("")}},getTemplate:function(){var a=this.options.baseClass;return d(d.parseHTML('<div class="'+a+(this.options.extraClass?" "+this.options.extraClass:"")+'" role="tooltip"><div class="'+a+'-arrow"></div><div class="'+a+'-content"></div></div>'))}});XF.TooltipTrigger=XF.create({options:{delayIn:200,delayInLoading:800,delayOut:200,trigger:"hover focus",maintain:!1,
clickHide:null,onShow:null,onHide:null},$target:null,tooltip:null,delayTimeout:null,delayTimeoutType:null,stopFocusBefore:null,clickTriggered:!1,$covers:null,__construct:function(a,b,c){this.options=d.extend(!0,{},this.options,c);this.$target=a;this.tooltip=b;b.setPositioner(a);b.addSetupCallback(XF.proxy(this,"onTooltipSetup"));a.xfUniqueId();XF.TooltipTrigger.cache[a.attr("id")]=this},init:function(){var a=this.$target,b=!1,c=!1,d=this;null===this.options.clickHide&&(this.options.clickHide=a.is("a"));
for(var e=this.options.trigger.split(" "),k=0;k<e.length;k++)switch(e[k]){case "hover":a.on({"mouseenter.tooltip":XF.proxy(this,"mouseEnter"),"mouseleave.tooltip":XF.proxy(this,"leave")});break;case "focus":a.on({"focusin.tooltip":XF.proxy(this,"focusEnter"),"focusout.tooltip":XF.proxy(this,"leave")});break;case "click":b=!0;a.on("click.tooltip",XF.proxy(this,"click"));a.on("auxclick.tooltip contextmenu.tooltip",function(){d.cancelShow();d.stopFocusBefore=Date.now()+2E3});break;case "touchclick":c=
!0,a.on("click.tooltip",function(a){XF.isEventTouchTriggered(a)&&d.click(a)})}b&&c&&console.error("Cannot have touchclick and click triggers");if(!b&&this.options.clickHide)a.on("click.tooltip auxclick.tooltip contextmenu.tooltip",function(a){c&&XF.isEventTouchTriggered(a)||(d.hide(),d.stopFocusBefore=Date.now()+2E3)});a.on({"tooltip:show":XF.proxy(this,"show"),"tooltip:hide":XF.proxy(this,"hide"),"tooltip:reposition":XF.proxy(this,"reposition")})},reposition:function(){this.tooltip.reposition()},
click:function(a){0<a.button||a.ctrlKey||a.shiftKey||a.metaKey||a.altKey?this.cancelShow():this.tooltip.isShown()?this.tooltip.isShownFully()?this.hide():(a.preventDefault(),this.clickShow(a)):(a.preventDefault(),this.clickShow(a))},clickShow:function(a){this.clickTriggered=!0;var b=this;setTimeout(function(){var c=b.addCovers();if(XF.isEventTouchTriggered(a))c.addClass("is-active");else d(e).on("click.tooltip-"+b.$target.xfUniqueId(),XF.proxy(b,"docClick"))},0);this.show()},addCovers:function(){this.$covers&&
this.$covers.remove();var a=this.$target.dimensions(),b=[];b.push({top:0,height:a.top,left:0,right:0});b.push({top:a.top,height:a.height,left:0,width:a.left});b.push({top:a.top,height:a.height,left:a.right,right:0});b.push({top:a.bottom,height:d("html").height()-a.bottom,left:0,right:0});a=d();for(var c,e=0;e<b.length;e++)c=d('<div class="tooltipCover" />').css(b[e]),a=a.add(c);a.on("click",XF.proxy(this,"hide"));this.tooltip.getTooltip().before(a);this.$covers=a;XF.setRelativeZIndex(a,this.$target);
return a},docClick:function(a){var b=this.$covers;var c=a.pageX;var h=a.pageY,m=d(l);b&&(0==a.screenX&&0==a.screenY&&(a=d(a.target).dimensions(),c=a.left,h=a.top),b.addClass("is-active"),c=d(e.elementFromPoint(c-m.scrollLeft(),h-m.scrollTop())),b.removeClass("is-active"),c.is(b)&&this.hide())},mouseEnter:function(a){XF.isEventTouchTriggered(a)||this.enter()},focusEnter:function(a){100>Date.now()-XF.pageDisplayTime||XF.isEventTouchTriggered(a)||(!this.stopFocusBefore||Date.now()>=this.stopFocusBefore)&&
this.enter()},enter:function(){if(!this.isShown()||!this.clickTriggered){this.clickTriggered=!1;var a=this.tooltip.requiresLoad()?this.options.delayInLoading:this.options.delayIn;if(a){if("enter"!==this.delayTimeoutType&&this.resetDelayTimer(),!this.delayTimeoutType&&!this.isShown()){this.delayTimeoutType="enter";var b=this;this.delayTimeout=setTimeout(function(){b.delayTimeoutType=null;b.show()},a)}}else this.show()}},leave:function(){if(!this.clickTriggered){var a=this.options.delayOut;if(a){if("leave"!==
this.delayTimeoutType&&this.resetDelayTimer(),!this.delayTimeoutType&&this.isShown()){this.delayTimeoutType="leave";var b=this;this.delayTimeout=setTimeout(function(){b.delayTimeoutType=null;b.hide()},a)}}else this.hide()}},show:function(){var a=this;d(l).off("focus.tooltip-"+this.$target.xfUniqueId()).on("focus.tooltip-"+this.$target.xfUniqueId(),function(b){a.stopFocusBefore=Date.now()+250});XF.setRelativeZIndex(this.tooltip.getTooltip(),this.$target);if(this.options.onShow){var b=this.options.onShow;
b(this,this.tooltip)}this.tooltip.show()},cancelShow:function(){"enter"===this.delayTimeoutType?this.resetDelayTimer():this.tooltip.isShownFully()||this.hide()},hide:function(){this.tooltip.hide();this.resetDelayTimer();this.clickTriggered=!1;this.$covers&&(this.$covers.remove(),this.$covers=null);d(e).off("click.tooltip-"+this.$target.xfUniqueId());if(this.options.onHide){var a=this.options.onHide;a(this,this.tooltip)}},toggle:function(){this.isShown()?this.hide():this.show()},isShown:function(){return this.tooltip.isShown()},
wasClickTriggered:function(){return this.clickTriggered},resetDelayTimer:function(){this.delayTimeoutType&&(clearTimeout(this.delayTimeout),this.delayTimeoutType=null)},addMaintainElement:function(a){if(!a.data("tooltip-maintain")){for(var b=this.options.trigger.split(" "),c=0;c<b.length;c++)switch(b[c]){case "hover":a.on("mouseenter.tooltip",XF.proxy(this,"enter"));a.on("mouseleave.tooltip",XF.proxy(this,"leave"));break;case "focus":a.on("focusin.tooltip",XF.proxy(this,"enter")),a.on("focusout.tooltip",
XF.proxy(this,"leave"))}a.data("tooltip-maintain",!0)}},removeMaintainElement:function(a){a.off(".tooltip");a.data("tooltip-maintain",!1)},onTooltipSetup:function(a){if(this.options.maintain){this.addMaintainElement(a);var b=this;a.on("menu:opened",function(a,d){b.addMaintainElement(d)});a.on("menu:closed",function(a,d){b.removeMaintainElement(d)})}}});XF.TooltipTrigger.cache={};XF.TooltipOptions={base:{baseClass:"tooltip",extraClass:"tooltip--basic",html:!1,inViewport:!0,placement:"top",clickHide:null,
delayIn:200,delayOut:200,maintain:!1,trigger:"hover focus"},tooltip:["baseClass","extraClass","html","placement"],trigger:["clickHide","delayIn","delayOut","maintain","trigger"],extract:function(a,b){for(var c={},d=0;d<a.length;d++)c[a[d]]=b[a[d]];return c},extractTooltip:function(a){return this.extract(this.tooltip,a)},extractTrigger:function(a){return this.extract(this.trigger,a)}};XF.Tooltip=XF.Element.newHandler({options:d.extend(!0,{},XF.TooltipOptions.base,{content:null}),trigger:null,tooltip:null,
init:function(){var a=this.getContent(),b=XF.TooltipOptions.extractTooltip(this.options),c=XF.TooltipOptions.extractTrigger(this.options);this.tooltip=new XF.TooltipElement(a,b);this.trigger=new XF.TooltipTrigger(this.$target,this.tooltip,c);this.trigger.init()},getContent:function(){if(this.options.content)return this.options.content;var a=this.$target,b=a.attr("data-original-title")||a.attr("title")||"";a.attr("data-original-title",b).removeAttr("title");return b}});XF.ElementTooltip=XF.extend(XF.Tooltip,
{__backup:{getContent:"_getContent",init:"_init"},options:d.extend({},XF.Tooltip.prototype.options,{element:null,showError:!0,noTouch:!0,shortcut:null}),$element:null,init:function(){this.options.shortcut&&this.setupShortcut(this.options.shortcut);if(!this.options.noTouch||!Modernizr.touchevents){var a=this.options.element,b=this.options.showError;if(a){var c=XF.findRelativeIf(a,this.$target);c.length?(this.$element=c,this.$target.removeAttr("title"),this.options.html=!0,this._init()):b&&console.error("Element tooltip could not find "+
a)}else b&&console.error("No element specified for the element tooltip")}},setupShortcut:function(a){"node-description"==a&&(this.options.element||(this.options.element="< .js-nodeMain | .js-nodeDescTooltip"),this.options.showError=!1,this.options.maintain=!0,this.options.placement="right",this.options.extraClass="tooltip--basic tooltip--description")},getContent:function(){return this.$element.clone().contents()}});XF.PreviewTooltip=XF.Element.newHandler({options:{delay:600,previewUrl:null},trigger:null,
tooltip:null,init:function(){this.options.previewUrl?(this.tooltip=new XF.TooltipElement(XF.proxy(this,"getContent"),{extraClass:"tooltip--preview",html:!0,loadRequired:!0}),this.trigger=new XF.TooltipTrigger(this.$target,this.tooltip,{maintain:!0,delayInLoading:this.options.delay,delayIn:this.options.delay}),this.trigger.init()):console.error("No preview URL")},getContent:function(a){var b=this;XF.ajax("get",this.options.previewUrl,{},function(c){b.loaded(c,a)},{skipDefault:!0,skipError:!0,global:!1})},
loaded:function(a,b){a.html&&XF.setupHtmlInsert(a.html,function(a,d,e){b(a)})}});XF.MemberTooltipCache={};XF.MemberTooltip=XF.Element.newHandler({options:{delay:600},trigger:null,tooltip:null,userId:null,init:function(){this.userId=this.$target.data("user-id");this.tooltip=new XF.TooltipElement(XF.proxy(this,"getContent"),{extraClass:"tooltip--member",html:!0,loadRequired:!0});this.trigger=new XF.TooltipTrigger(this.$target,this.tooltip,{maintain:!0,delayInLoading:this.options.delay,delayIn:this.options.delay,
trigger:"hover focus click",onShow:XF.proxy(this,"onShow"),onHide:XF.proxy(this,"onHide")});this.trigger.init()},getContent:function(a){var b=XF.MemberTooltipCache[this.userId];if(b)b=d(d.parseHTML(b)),a(b);else{var c=this;b={skipDefault:!0,skipError:!0,global:!1};this.trigger.wasClickTriggered()&&(b.global=!0);XF.ajax("get",this.$target.attr("href"),{tooltip:!0},function(b){c.loaded(b,a)},b)}},loaded:function(a,b){if(a.html){var c=this.userId;XF.setupHtmlInsert(a.html,function(d,e,k){XF.MemberTooltipCache[c]=
a.html.content;b(d)})}},onShow:function(){var a=XF.MemberTooltip.activeTooltip;a&&a!==this&&a.hide();XF.MemberTooltip.activeTooltip=this},onHide:function(){XF.MemberTooltip.activeTooltip===this&&(XF.MemberTooltip.activeTooltip=null)},show:function(){this.trigger.show()},hide:function(){this.trigger.hide()}});XF.MemberTooltip.activeTooltip=null;XF.Element.register("element-tooltip","XF.ElementTooltip");XF.Element.register("member-tooltip","XF.MemberTooltip");XF.Element.register("preview-tooltip","XF.PreviewTooltip");
XF.Element.register("tooltip","XF.Tooltip")}(jQuery,window,document);