/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
// ***************************
// js.compressed/subscribe.js
// ***************************
vBulletin.precache(["follow","following","following_pending","social_group_count_members_x","unsubscribe_overlay_error"],[]);
(function(){function h(a,b){a=$(".js-replace-member-count-"+a);a.length&&a.each(function(){var c=$(this),d=c.data("replace-phrase-varname"),k=parseInt(c.data("member-count"),10)+b;c.text(vBulletin.phrase.get(d,k));c.data("member-count",k)})}function l(a){a=$(this);if(a.hasClass("isSubscribed")&&!a.hasClass("is-owner")){let b=a.outerWidth();a.css("width",b+"px");e(a,"following_remove","b-button--unfollow")}}function m(a){a=$(this);a.hasClass("b-button--unfollow")&&f(a,"following","","b-button--unfollow");
a.css("width","")}vBulletin.subscribe={};var g=function(a,b){a.children(".js-button__text-primary").text(vBulletin.phrase.get(b))},f=function(a,b,c,d){g(a,b);a.addClass((c||"")+" b-button--special").removeClass((d||"")+" b-button--secondary")},e=function(a,b,c,d){g(a,b);a.addClass((c||"")+" b-button--secondary").removeClass((d||"")+" b-button--special")},n=function(a,b,c){vBulletin.AJAX({call:b,data:c,success:function(d){!isNaN(d)&&1<=d?1==d?f(a,"following","isSubscribed"):f(a,"following_pending",
"is-pending"):vBulletin.error("follow","follow_error")},title_phrase:"follow",error_phrase:"follow_error"})},p=function(a){var b=$(a),c=parseInt(b.attr("data-node-id"),10);a=parseInt(b.attr("data-owner-id"),10);vBulletin.AJAX({call:"/ajax/api/node/requestChannel",data:{channelid:c,recipient:a,requestType:"sg_member"},success:function(d){!0===d?(f(b,"joined","has-joined"),h(c,1),(b.hasClass("join-to-post-btn")||b.hasClass("js-refresh"))&&window.location.reload()):isNaN(d)||f(b,"following_pending",
"is-pending")},title_phrase:"join",error_phrase:"join_error"})},q=function(a){var b=$(a),c=parseInt($(a).attr("data-node-id"),10);vBulletin.AJAX({call:"/ajax/api/blog/leaveChannel",data:{channelId:c},success:function(d){!0===d?(b.hasClass("js-button--follow")?(g(b,"follow"),b.addClass("b-button--special").removeClass("isSubscribed b-button--unfollow")):(g(b,"join"),b.removeClass("has-joined b-button--special leave-btn")),h(c,-1),b.is(".js-no-refresh")||location.reload()):vBulletin.error("leave","invalid_server_response_please_try_again")},
title_phrase:"leave",error_phrase:"invalid_server_response_please_try_again"})},r=function(a){var b=$(a);a=$(a).attr("data-node-id");vBulletin.AJAX({call:"/ajax/api/follow/delete",data:{follow_item:a,type:"follow_contents"},success:function(c){1==c?e(b,"follow","","isSubscribed b-button--unfollow"):vBulletin.error("follow","unfollow_error")},title_phrase:"follow",error_phrase:"unfollow_error"})};vBulletin.subscribe.updateSubscribeButton=function(a){if("undefined"!=typeof a){var b=$(".js-button--follow").filter(function(){return $(this).data("node-id")==
pageData.nodeid&&pageData.nodeid!=pageData.channelid});switch(a){case 0:e(b,"follow","","isSubscribed b-button--unfollow");break;case 1:e(b,"following","isSubscribed");break;case 2:e(b,"following_pending","is-pending")}}};$(".js-button--follow").on("click",function(a){a=$(this);if(a.hasClass("isSubscribed"))a.hasClass("b-button--unfollow")&&(a.hasClass("is-blog-channel")?q(this):r(this));else if(a=$(this),!a.hasClass("isSubscribed")&&!a.hasClass("is-pending")){var b=parseInt(a.attr("data-node-id"),
10),c={};a.hasClass("is-topic")?(c.follow_item=b,c.type="follow_contents",n(a,"/ajax/api/follow/add",c)):(c={},c.channelid=b,c.recipient=parseInt(a.attr("data-owner-id"),10),a.hasClass("is-blog-channel")?c.requestType="member":a.hasClass("is-sg-channel")?c.requestType="sg_subscriber":c.requestType="subscriber",n(a,"/ajax/api/node/requestChannel",c))}});$(".js-button--follow").on("mouseover",l);$(".js-button--follow, .js-subscription__follow").on("mouseout",m);$(".subscriptionsContainer").on("mouseover",
".js-subscription__follow",l);$(".subscriptionsContainer").on("mouseout",".js-subscription__follow",m);$(".join-to-post-btn").on("click",function(a){$(this).hasClass("has-joined")||$(this).hasClass("is-pending")||p(this)});$(document).on("click",".join-btn",function(a){$(this).hasClass("has-joined")||$(this).hasClass("is-pending")?$(this).hasClass("leave-btn")&&!$(this).hasClass("is-owner")&&q(this):p(this)});$(document).on("mouseover",".join-btn",function(a){a=$(this);a.hasClass("has-joined")&&!a.hasClass("is-owner")&&
e(a,"leave","leave-btn")});$(document).on("mouseout",".join-btn",function(a){a=$(this);a.hasClass("leave-btn")&&!a.hasClass("is-owner")&&f(a,"joined","","leave-btn")})})();
;

// ***************************
// js.compressed/profile.js
// ***************************
vBulletin.precache("error error_trying_to_change_user_status error_x follow following following_pending following_remove invalid_server_response_please_try_again profile_guser edit_avatar invalid_data no_permission upload_invalid_url unable_to_upload_profile_photo profile_media album album_saved please_enter_message_x_chars please_enter_title_x_chars unable_to_contact_server_please_try_again".split(" "),[]);var albumPhotoCount=0;
(function(a,k,m,p,v){function q(){var d=a(this).closest(".section-content").find(".js-user-status-text"),g=a.trim(d.val()),c=a(".js-profile-about-container").data("user-id");vBulletin.AJAX({call:"/ajax/api/user/updateStatus",data:{userid:c,status:g},title_phrase:"profile_guser",error_phrase:"error_trying_to_change_user_status",success:function(e){d.val(e);e&&(e='"'+e+'"');a("#userStatus").text(e)},allowEmptyResponse:!0})}function x(d){let g=!!d.avatarpath;d=new URL(g?d.avatarpath:d[0],pageData.baseurl_core+
"/");g&&"data:"!=d.protocol&&d.searchParams.set("random",Math.random());a("#profilePicImg, .avatar-"+pageData.userid).attr("src",d);a("#profilePicImgCrop").attr("src","");a("#btnProfilePhotoClose").trigger("click")}function L(){let d=a("#editProfilePhotoDlg");vBulletin.AJAX({call:"/profile/resetAvatar",success:g=>{x(g);a(".js-edit-profile-hide-on-reset").addClass("h-hide-imp")},complete:()=>{d.find(".js-upload-progress").addClass("h-hide-imp");d.find("input,button").prop("disabled",!1);d.find(".js-upload-button").removeClass("h-disabled")}})}
function M(){a(".defaultAvatarSet").removeClass("defaultAvatarSelected");a("#defaultAvatars").html("");var d=a("#editProfilePhotoDlg").dialog({width:734,title:vBulletin.phrase.get("edit_avatar"),autoOpen:!1,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,dialogClass:"dialog-container edit-profile-photo-dialog-container dialog-box",close:function(){modifyIasForTouch("disable")}}).dialog("open");d.on("vbulletin:dialogresize",function(c){resizeAvatarEditDialog()});a(".profile-img-option-container .browse-option").off("click").on("click",
function(c){a(".avatarHolder .defaultAvatarSet.defaultAvatarSelected").removeClass("defaultAvatarSelected")});a(".profile-img-option-container .url-option").off("click").on("click",function(c){var e=a(this);a(".avatarHolder .defaultAvatarSet.defaultAvatarSelected").removeClass("defaultAvatarSelected");setTimeout(function(){e.closest(".profile-img-option-container").find(".profilePhotoUrl").trigger("focus.photourl")},10)});a(".js-edit-profile").data("avatarmaxsize");var g=!1;a("#profilePhotoFile").off("click").on("click",
function(){a(this).closest(".profile-img-option-container").find(".browse-option").trigger("click")}).fileupload({url:vBulletin.getAjaxBaseurl()+"/profile/upload-profilepicture",dropZone:a(".frmprofilePhoto"),dataType:"json",add:function(c,e){c=a("#profilePicImgCrop");if(e.crop)e.crop.resized_width=c.width(),e.crop.resized_height=c.height(),g.formData=e.crop,g.formData.securitytoken=pageData.securitytoken,g.submit(),closeUploader();else{g=e;let w=e.files[0].fileName||e.files[0].name;a(".profile-img-option-container .fileText").val(w);
a("#btnProfilePhotoContinue").trigger("click");initIAS();c.attr("src",URL.createObjectURL(e.files[0]))}},done:function(c,e){c=e.result||{errors:[["invalid_server_response_please_try_again"]]};if(c.errors)return m.showApiError(c.errors,c,{title:"edit_avatar"}),!1;if(c.imageUrl)return a("#profilePhotoUrl").val(c.imageUrl).data("filedataid",c.filedataid).trigger("focus"),a("#btnProfilePhotoContinue").trigger("click"),!1;x(c)},fail:function(c,e){c="error";if(e&&0<e.files.length)switch(e.files[0].error){case "acceptFileTypes":c=
"warning"}vBulletin.alert("upload","error",c,function(){d.find(".fileText").val("");d.find(".browse-option").focus()})},always:function(c,e){d.find(".js-upload-progress").addClass("h-hide");d.find("input,button").prop("disabled",!1);d.find(".js-upload-button").removeClass("h-disabled");return!1}});a("#profilePhotoUrl").off("focus").on("focus",function(){a(this).closest(".profile-img-option-container").find(".url-option").trigger("click")})}function N(){if(""==a("#profilePicImgCrop").attr("src"))return closeUploader(),
vBulletin.error("edit_avatar","please_select_a_image_to_crop"),a("#btnProfilePhotoSave").addClass("h-hide-imp"),a("#btnProfilePhotoContinue").removeClass("h-hide-imp"),a("div#cropFrame").addClass("h-hide"),a("div#uploadFrame").removeClass("h-hide"),!1;var d={crop:{}},g=a(".js-edit-profile"),c=g.data("avatarmaxwidth");g=g.data("avatarmaxheight");d.crop.x1=a("#x1").val()||0;d.crop.x2=a("#x2").val()||c;d.crop.y1=a("#y1").val()||0;d.crop.y2=a("#y2").val()||g;d.crop.width=a("#width").val()||c;d.crop.height=
a("#height").val()||g;d.crop.resized_width=a("#profilePicImgCrop").width();d.crop.resized_height=a("#profilePicImgCrop").height();d.securitytoken=pageData.securitytoken;c=a("[name=profile-img-option]:checked").val();"1"==c?(d.files=a("#profilePhotoFile"),d.url=pageData.baseurl+"/profile/upload-profilepicture",a("#profilePhotoFile").fileupload("add",d)):"2"==c&&(d.profilePhotoUrl=a("#profilePhotoUrl").val(),d.filedataid=a("#profilePhotoUrl").data("filedataid"),vBulletin.AJAX({call:"/profile/upload-profilepicture",
data:d,success:e=>{x(e)}}));F()}function F(){a("#x1, #x2, #y1, #y2").val("")}function O(){a(".js-profile-ban-user").offon("click",d=>{let g=a(d.currentTarget).data("userid");p.openTemplateConfirmDialog(m,{title:"ban_user_gcphome",yesPhrase:"ban_user_gcphome",noPhrase:"cancel",onClickYes:c=>{c=c.find(".js-dialog-form");c=k.getFormData(c);c.userid=g;m.ajax({call:"/ajax/api/user/banUser",data:c,success:function(e){p.alert("success",e.response)}})}},{template:"inlinemod_banuser",data:{userid:g}})})}function G(d){a(".js-ipuser",
d).offon("click",g=>{g=a(g.currentTarget).data();p.openTemplateAlertDialog(m,{title:["users_matching_ip_x",g.ipaddress],maxHeight:300},{template:"profile_ipaddress_users",data:{userid:g.userid,ipaddress:g.ipaddress}})})}if(!vBulletin.pageHasSelectors([".profile-sidebar-widget"]))return!1;a(()=>{var d=vBulletin.tabtools,g=a(".profile-widget"),c=a("#profileTabs");if(0<c.length){var e=c.find(".ui-tabs-nav > li");0==e.length&&(e=c.find(".profile-tabs-nav > li"));var w=e.filter(".ui-tabs-active");0==w.length&&
(w=e.filter(".b-comp-menu-dropdown__content-item--current"));0==w.length&&(w=function(f,b){var n=[];f.find(".ui-tabs-nav > li > a, .widget-tabs-panel").each(function(t,r){t=a(this).data("url-path");-1==a.inArray(t,n)&&n.push(t)});f=new RegExp("\\/("+n.join("|")+")/?$");var h=location.pathname.match(f);if(h){var u=!1;b.each(function(){var t=a(this);if(t.find("a").data("url-path")==h[1])return u=t,!1});if(u)return u}return a()}(c,e));var D=w.index(),z,A,B={},H="1"==e.parent().data("allow-history"),
C=new vBulletin.history.instance(H);-1==D&&(D=0,w=e.first());var I=w.find("> a").attr("href");function l(f,b,n,h){if(C.isEnabled()){var u=C.getState();(h||!u||a.isEmptyObject(u.data))&&C.setDefaultState({from:f,tab:b,page:"undefined"==typeof n?void 0:n},document.title,location.href)}}var J=function(f,b){b.setOption("context",f);"undefined"!=typeof b.lastFilters&&0<a(".conversation-empty:not(.h-hide)",f).length&&delete b.lastFilters},K=function(f,b,n,h,u){var t=a(".conversation-list",f);return d.newTab(f,
null,!1,!1,b,t,h,u,n)};function y(f){const b=a(".js-profile-responsive-button-container");let n=!1,h=!1;"#activities-tab"!=f&&("#subscribed-tab"==f?n=!0:"#about-tab"!=f&&"#media-tab"==f&&(h=!0));b.toggleClass("media",h);b.toggleClass("subscribed",n)}d.initTabs(c,C,e,H,D,I,[z,A],!1,function(f,b,n){var h=a(n);b="#"+h.attr("id");f=I==b;b in B||(B[b]=d.tabAllowHistory(h));y(b);if("#activities-tab"==b)z?J(h,z):(n=function(){vBulletin.upload&&vBulletin.upload.initializePhotoUpload(h)},z=K(h,f,B[b],n,n).filter),
z.applyFilters(!1,!0);else if("#subscribed-tab"==b)A?J(h,A):A=K(h,f,B[b],null,null).filter,A.applyFilters(!1,!0);else if("#about-tab"==b)if(f)l("tabs","about");else{var u=a(".js-profile-about-container",n);0==a(".section",u).length&&m.render({call:"/profile/fetchAbout",data:{userid:u.data("user-id")},success:function(r){u.html(r.template)}})}else if("#media-tab"==b){let r=a(".js-profile-media-container",n);f?l("media_filter","media",v.getCurrentPage(r),!0):0==a(".item-album",r).length?m.render({call:"/profile/fetchMedia",
data:{userid:r.data("user-id"),perpage:r.data("perpage"),allowHistory:1,includeJs:"undefined"==typeof vBulletin.contentEntryBox?1:0},success:function(E){r.html(E.template);r.trigger("vb-instrument");h.data("media-statechange-set",!0);"function"==typeof vBulletin.Responsive.ChannelContent.cloneAndMoveToolbarButtons&&vBulletin.Responsive.ChannelContent.cloneAndMoveToolbarButtons()}}):h.data("media-statechange-set")||(l("media_filter","media",pageNum,!0),h.data("media-statechange-set",!0))}else if("#infractions-tab"==
b){b=Number(a(".pagenav-form .js-pagenum",n).val())||1;let r=vBulletin.infraction;f?(a(".pagenav-form",n).length&&!h.data("pagination-instance")&&(new vBulletin.pagination({context:h,tabParamAsQueryString:!1,allowHistory:1==h.find(".conversation-toolbar-wrapper").data("allow-history"),onPageChanged:function(E,P){r.loadUserInfractions({container:h,userid:h.data("userid"),pageNumber:E,replaceState:!0})}}),h.data("pagination-instance",!0)),l("infraction_filter","infractions",b,!0),r.setHistoryStateChange(),
h.data("infraction-statechange-set",!0)):0==a(".infraction-list",n).length?(l("infraction_filter","infractions",b,!0),r.loadUserInfractions({container:h,userid:h.data("userid"),pageNumber:b,callback:function(){r.setHistoryStateChange();h.data("infraction-statechange-set",!0)}})):h.data("infraction-statechange-set")||(l("infraction_filter","infractions",b,!0),r.setHistoryStateChange(),h.data("infraction-statechange-set",!0))}else if("#ipaddress-tab"==b)if(f)l("tabs","ipaddress");else{var t=a(".js-profile-ipaddress-container",
n);0==t.children().length&&m.render({template:"profile_ipaddress",data:{userid:t.closest(".tabs").data("userid")},success:function(r){t.html(r.template).trigger("vb-instrument")}})}});a(".customize-theme").off("click").on("click",function(f){var b=a(".profile_custom_edit");if(b.is(":hidden")){var n=function(){b.removeClass("h-hide");vBulletin.animateScrollTop(b.offset().top,{duration:"slow"})};0<a(".profileNavTabs",b).length?n():vBulletin.AJAX({call:"/ajax/render/profile_custom_edit",userid:b.data("page-userid"),
success:function(h){b.html(h);b.prependTo("#content");window.setTimeout(function(){var u=b.find(".tab:hidden").css("display","block"),t=b.find(".h-hide").removeClass("h-hide");b.find("select").selectBox();t.addClass("h-hide");u.css("display","none")},0);n()},error_phrase:"unable_to_contact_server_please_try_again"})}else vBulletin.animateScrollTop(b.offset().top,{duration:"slow"})})}else a(".customize-theme").addClass("h-hide-imp");a(".profileDetailTabs").tabs().trigger("vb-tabinit");a(".toggle_customizations").off("click").on("click",
function(l){l="show"==a(this).attr("data-action")?1:0;vBulletin.AJAX({call:"/profile/toggle-profile-customizations",data:{showusercss:l},complete:function(){a("body").css("cursor","auto")},success:function(y){window.location.reload()}})});0<c.length&&(a(document).off("click",".profileTabs .action_button").on("click",".profileTabs .action_button",function(){if(!a(this).hasClass("subscribepending_button")){var l=a(this),y=parseInt(l.attr("data-userid")),f="";l.hasClass("subscribe_button")?f="add":l.hasClass("unsubscribe_button")&&
(f="delete");"number"==typeof y&&f&&vBulletin.AJAX({call:"/profile/follow-button",data:{"do":f,follower:y,type:"follow_members"},success:function(b){if(1==b||2==b){if("add"==f){var n=1==b?"subscribed":"subscribepending";b=1==b?"following":"following_pending";l.removeClass("subscribe_button").addClass(n+"_button b-button").find(".js-button__text-primary").text(vBulletin.phrase.get(b))}else"delete"==f&&l.removeClass("subscribed_button unsubscribe_button b-button b-button--special").addClass("subscribe_button b-button b-button--secondary").find(".js-button__text-primary").text(vBulletin.phrase.get("follow"));
location.reload()}},title_phrase:"profile_guser"})}}),a(document).off("mouseover",".profileTabs .action_button.subscribed_button").on("mouseover",".profileTabs .action_button.subscribed_button",function(l){a(this).html(vBulletin.phrase.get("following_remove")).addClass("b-button").toggleClass("subscribed_button unsubscribe_button b-button--special b-button--secondary")}),a(document).off("mouseout",".profileTabs .action_button.unsubscribe_button").on("mouseout",".profileTabs .action_button.unsubscribe_button",
function(l){a(this).html(vBulletin.phrase.get("following")).addClass("b-button").toggleClass("subscribed_button unsubscribe_button b-button--special b-button--secondary")}),a(document).offon("click",".js-update-status-btn",q),vBulletin.conversation.bindEditFormEventHandlers("all"),vBulletin.conversation.initPollEvents(g),vBulletin.conversation.initContentEvents(g),g.off("click",".js-comment-entry__post").on("click",".js-comment-entry__post",function(l){vBulletin.conversation.postComment.apply(this,
[l,function(){location.reload()}])}));g=a(".js-bookmarks-wrapper");c=g.find(".conversation-toolbar-wrapper");if(g.length&&(e=a(".js-bookmarks-container"),vBulletin.truncatePostContent(e),a(".pagenav-form",c).length&&!c.data("pagination-instance"))){const l=g.data("perpage");vBulletin.pagination({context:c,allowHistory:c.data("allowHistory"),onPageChanged(y){m.render({template:"widget_subscription__bookmarks_tab",data:{currentPage:y,perPage:l},success:f=>{let b=a(".js-bookmarks-container");f=a(f.template);
b.replaceWith(f);vBulletin.truncatePostContent(f)}});console.log({pageNumber:y,perpage:l})}});c.data("pagination-instance",!0)}a("body").is(".view-mode")&&(a(".js-edit-profile").off("click").on("click",M),a("#btnProfilePhotoSave").off("click").on("click",N));a("#btnProfilePhotoContinue").off("click").on("click",function(){var l=a("[name=profile-img-option]:checked").val();switch(parseInt(l)){case 2:l=a("#profilePhotoUrl").val();if(!l){vBulletin.error("edit_avatar","upload_invalid_url");break}initIAS();
a("#profilePicImgCrop").attr("src",l);case 1:a("div#cropFrame").removeClass("h-hide");a("#btnProfilePhotoSave").removeClass("h-hide-imp");a("#btnProfilePhotoContinue").addClass("h-hide-imp");a("div#uploadFrame").addClass("h-hide");a("#btnProfilePhotoClose").focus();break;case 4:L()}});a("#btnProfilePhotoClose").off("click").on("click",function(){closeUploader();F();a("div#uploadFrame").removeClass("h-hide");a("div#cropFrame").addClass("h-hide");a("#btnProfilePhotoSave").addClass("h-hide-imp");a("#btnProfilePhotoContinue").removeClass("h-hide-imp");
a("#editProfilePhotoDlg").dialog("close").find("form").trigger("reset")});a(document).off("click",".gallery-upload-form .files a:not([target^=_blank])").on("click",".gallery-upload-form .files a:not([target^=_blank])",function(l){l.preventDefault();a('<iframe style="display:none;"></iframe>').prop("src",this.href).appendTo("body")})});a(()=>{O();G(a(document));a(document).on("vb-instrument",d=>{G(a(d.target))})})})(jQuery,vBulletin,vBulletin.ajaxtools,vBulletin.dialogtools,vBulletin.media);
var ias=null;
initIAS=function(){var a=!1,k=$("#profilePicImgCrop"),m=$(".js-edit-profile"),p=m.data("avatarmaxwidth"),v=m.data("avatarmaxheight");k.off("load").on("load",function(){if(!a){k[0].style.setProperty("max-width","none","important");k[0].style.setProperty("max-height","none","important");var q=k.width(),x=k.height();k[0].style.setProperty("max-width","");k[0].style.setProperty("max-height","");q>p||x>v?(a=!0,q=k.width(),x=k.height(),q=Math.min(p,v,q,x),ias=k.imgAreaSelect({aspectRatio:"1:1",handles:!0,
zIndex:1012,enable:!0,show:!0,x1:0,y1:0,x2:q,y2:q,onSelectChange:setDimensions,resizeMargin:"ontouchstart"in document?30:15,instance:!0,keys:!0,persistent:!0}),modifyIasForTouch("enable"),resizeAvatarEditDialog()):$("#btnProfilePhotoSave").trigger("click")}})};
function resizeAvatarEditDialog(){var a=$("#editProfilePhotoDlg");a.dialog("option","position",{my:"center",at:"center",of:window,collision:"flipfit"});var k=$(".profile-photo-wrapper",a);k.height("auto");var m=$(window).height(),p=a.closest(".edit-profile-photo-dialog-container").height(),v=k.height();a=$("#profilePicImgCrop");var q=a.imgAreaSelect({instance:!0});p>m&&(k.height(v-(p-m)),m=$(".js-edit-profile"),k=m.data("avatarmaxwidth"),m=m.data("avatarmaxheight"),p=a.width(),v=a.height(),k=Math.min(k,
m,p,v),a.imgAreaSelect({x1:0,y1:0,x2:k,y2:k}));q.update()}
function modifyIasForTouch(a){function k(m){var p=m.originalEvent.touches;if(!(1<p.length)){var v={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",touchcancel:"mouseout"};if("undefined"!=typeof v[m.type]){var q=p[0];p={bubbles:!0,cancelable:!1,view:window,detail:1,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,buttons:0,relatedTarget:null};try{p.screenX=q.screenX,p.screenY=q.screenY,p.clientX=q.clientX,p.clientY=q.clientY}catch(x){}"touchstart"==
m.type&&(p.buttons=0,q=new MouseEvent("mousemove",p),m.target.dispatchEvent(q));p.buttons=1;v=new MouseEvent(v[m.type],p);m.target.dispatchEvent(v);if(m.target.className.match(/imgareaselect-/))return m.preventDefault(),!1}}}"ontouchstart"in document&&("enable"==a?($(document).off(".iastouch").on("touchstart.iastouch touchmove.iastouch touchend.iastouch touchcancel.iastouch",k),$("#editProfilePhotoDlg").css("-webkit-touch-callout","none"),$("body, html").addClass("h-prevent-scroll-v")):($(document).off(".iastouch"),
$("#editProfilePhotoDlg").css("-webkit-touch-callout","default"),$("body, html").removeClass("h-prevent-scroll-v")))}setDimensions=function(a,k){$("#x1").val(k.x1);$("#y1").val(k.y1);$("#x2").val(k.x2);$("#y2").val(k.y2);$("#width").val(k.width);$("#height").val(k.height)};closeUploader=function(){modifyIasForTouch("disable");$("#profilePicImgCrop").imgAreaSelect({remove:!0});null!=ias&&(ias=null);$("#profilePhotoFile").removeData(["fileupload","blueimp.fileupload.form"])};
;

// ***************************
// js.compressed/jquery/jquery.imgareaselect.min.js
// ***************************
/*
 imgAreaSelect jQuery plugin
 version 0.9.10

 Copyright (c) 2008-2013 Michal Wojciechowski (odyniec.net)

 Dual licensed under the MIT (MIT-LICENSE.txt)
 and GPL (GPL-LICENSE.txt) licenses.

 http://odyniec.net/projects/imgareaselect/

*/
(function(b){function C(){return b("<div/>")}var D=Math.abs,n=Math.max,p=Math.min,e=Math.round;b.imgAreaSelect=function(A,c){function P(a){return a+B.left-w.left}function Q(a){return a+B.top-w.top}function K(a){return a-B.left+w.left}function L(a){return a-B.top+w.top}function G(a){var c=a||V;a=a||W;return{x1:e(d.x1*c),y1:e(d.y1*a),x2:e(d.x2*c),y2:e(d.y2*a),width:e(d.x2*c)-e(d.x1*c),height:e(d.y2*a)-e(d.y1*a)}}function ka(a,c,b,g,f){var h=f||V;f=f||W;d={x1:e(a/h||0),y1:e(c/f||0),x2:e(b/
h||0),y2:e(g/f||0)};d.width=d.x2-d.x1;d.height=d.y2-d.y1}function M(){ba&&x.width()&&(B={left:e(x.offset().left),top:e(x.offset().top)},y=x.innerWidth(),v=x.innerHeight(),B.top+=x.outerHeight()-v>>1,B.left+=x.outerWidth()-y>>1,X=e(c.minWidth/V)||0,Y=e(c.minHeight/W)||0,la=e(p(c.maxWidth/V||16777216,y)),ma=e(p(c.maxHeight/W||16777216,v)),"1.3.2"!=b().jquery||"fixed"!=ca||na.getBoundingClientRect||(B.top+=n(document.body.scrollTop,na.scrollTop),B.left+=n(document.body.scrollLeft,na.scrollLeft)),w=/absolute|relative/.test(R.css("position"))?
{left:e(R.offset().left)-R.scrollLeft(),top:e(R.offset().top)-R.scrollTop()}:"fixed"==ca?{left:b(document).scrollLeft(),top:b(document).scrollTop()}:{left:0,top:0},q=P(0),r=Q(0),(d.x2>y||d.y2>v)&&da())}function ea(a){if(fa){l.css({left:P(d.x1),top:Q(d.y1)}).add(S).width(H=d.width).height(N=d.height);S.add(u).add(t).css({left:0,top:0});u.width(n(H-u.outerWidth()+u.innerWidth(),0)).height(n(N-u.outerHeight()+u.innerHeight(),0));b(m[0]).css({left:q,top:r,width:d.x1,height:v});b(m[1]).css({left:q+d.x1,
top:r,width:H,height:d.y1});b(m[2]).css({left:q+d.x2,top:r,width:y-d.x2,height:v});b(m[3]).css({left:q+d.x1,top:r+d.y2,width:H,height:v-d.y2});H-=t.outerWidth();N-=t.outerHeight();switch(t.length){case 8:b(t[4]).css({left:H>>1}),b(t[5]).css({left:H,top:N>>1}),b(t[6]).css({left:H>>1,top:N}),b(t[7]).css({top:N>>1});case 4:t.slice(1,3).css({left:H}),t.slice(2,4).css({top:N})}if(!1!==a&&(b.imgAreaSelect.onKeyPress!=wa&&b(document).off(b.imgAreaSelect.keyPress,b.imgAreaSelect.onKeyPress),c.keys))b(document)[b.imgAreaSelect.keyPress](b.imgAreaSelect.onKeyPress=
wa);T&&2==u.outerWidth()-u.innerWidth()&&(u.css("margin",0),setTimeout(function(){u.css("margin","auto")},0))}}function oa(a){M();ea(a);g=P(d.x1);f=Q(d.y1);h=P(d.x2);k=Q(d.y2)}function pa(a,b){c.fadeSpeed?a.fadeOut(c.fadeSpeed,b):a.hide()}function O(a){var b=K(a.pageX-w.left)-d.x1;a=L(a.pageY-w.top)-d.y1;qa||(M(),qa=!0,l.one("mouseout",function(){qa=!1}));z="";c.resizable&&(a<=c.resizeMargin?z="n":a>=d.height-c.resizeMargin&&(z="s"),b<=c.resizeMargin?z+="w":b>=d.width-c.resizeMargin&&(z+="e"));l.css("cursor",
z?z+"-resize":c.movable?"move":"");ha&&ha.toggle()}function xa(a){b("body").css("cursor","");(c.autoHide||0==d.width*d.height)&&pa(l.add(m),function(){b(this).hide()});b(document).off("mousemove",ra);l.mousemove(O);c.onSelectEnd(A,G())}function ya(a){if(1!=a.which)return!1;M();z?(b("body").css("cursor",z+"-resize"),g=P(d[/w/.test(z)?"x2":"x1"]),f=Q(d[/n/.test(z)?"y2":"y1"]),b(document).mousemove(ra).one("mouseup",xa),l.off("mousemove",O)):c.movable?(sa=q+d.x1-(a.pageX-w.left),ta=r+d.y1-(a.pageY-w.top),
l.off("mousemove",O),b(document).mousemove(za).one("mouseup",function(){c.onSelectEnd(A,G());b(document).off("mousemove",za);l.mousemove(O)})):x.mousedown(a);return!1}function Z(a){I&&(a?(h=n(q,p(q+y,g+D(k-f)*I*(h>g||-1))),k=e(n(r,p(r+v,f+D(h-g)/I*(k>f||-1)))),h=e(h)):(k=n(r,p(r+v,f+D(h-g)/I*(k>f||-1))),h=e(n(q,p(q+y,g+D(k-f)*I*(h>g||-1)))),k=e(k)))}function da(){g=p(g,q+y);f=p(f,r+v);D(h-g)<X&&(h=g-X*(h<g||-1),h<q?g=q+X:h>q+y&&(g=q+y-X));D(k-f)<Y&&(k=f-Y*(k<f||-1),k<r?f=r+Y:k>r+v&&(f=r+v-Y));h=n(q,
p(h,q+y));k=n(r,p(k,r+v));Z(D(h-g)<D(k-f)*I);D(h-g)>la&&(h=g-la*(h<g||-1),Z());D(k-f)>ma&&(k=f-ma*(k<f||-1),Z(!0));d={x1:K(p(g,h)),x2:K(n(g,h)),y1:L(p(f,k)),y2:L(n(f,k)),width:D(h-g),height:D(k-f)};ea();c.onSelectChange(A,G())}function ra(a){h=/w|e|^$/.test(z)||I?a.pageX-w.left:P(d.x2);k=/n|s|^$/.test(z)||I?a.pageY-w.top:Q(d.y2);da();return!1}function aa(a,e){h=(g=a)+d.width;k=(f=e)+d.height;b.extend(d,{x1:K(g),y1:L(f),x2:K(h),y2:L(k)});ea();c.onSelectChange(A,G())}function za(a){g=n(q,p(sa+(a.pageX-
w.left),q+y-d.width));f=n(r,p(ta+(a.pageY-w.top),r+v-d.height));aa(g,f);a.preventDefault();return!1}function ua(){b(document).off("mousemove",ua);M();h=g;k=f;da();z="";m.is(":visible")||l.add(m).hide().fadeIn(c.fadeSpeed||0);fa=!0;b(document).off("mouseup",ia).mousemove(ra).one("mouseup",xa);l.off("mousemove",O);c.onSelectStart(A,G())}function ia(){b(document).off("mousemove",ua).off("mouseup",ia);pa(l.add(m));ka(K(g),L(f),K(g),L(f));this instanceof b.imgAreaSelect||(c.onSelectChange(A,G()),c.onSelectEnd(A,
G()))}function Aa(a){if(1!=a.which||m.is(":animated"))return!1;M();sa=g=a.pageX-w.left;ta=f=a.pageY-w.top;b(document).mousemove(ua).mouseup(ia);return!1}function Ba(){oa(!1)}function Ca(){ba=!0;va(c=b.extend({classPrefix:"imgareaselect",movable:!0,parent:"body",resizable:!0,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},c));l.add(m).css({visibility:""});c.show&&(fa=!0,M(),ea(),l.add(m).hide().fadeIn(c.fadeSpeed||0));setTimeout(function(){c.onInit(A,
G())},0)}function ja(a,b){for(var d in b)void 0!==c[d]&&a.css(b[d],c[d])}function va(a){a.parent&&(R=b(a.parent)).append(l.add(m));b.extend(c,a);M();if(null!=a.handles){t.remove();t=b([]);for(U=a.handles?"corners"==a.handles?4:8:0;U--;)t=t.add(C());t.addClass(c.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:J+1||1});0<=!parseInt(t.css("width"))&&t.width(5).height(5);(F=c.borderWidth)&&t.css({borderWidth:F,borderStyle:"solid"});ja(t,{borderColor1:"border-color",borderColor2:"background-color",
borderOpacity:"opacity"})}V=c.imageWidth/y||1;W=c.imageHeight/v||1;null!=a.x1&&(ka(a.x1,a.y1,a.x2,a.y2),a.show=!a.hide);a.keys&&(c.keys=b.extend({shift:1,ctrl:"resize"},a.keys));m.addClass(c.classPrefix+"-outer");S.addClass(c.classPrefix+"-selection");for(U=0;4>U++;)b(u[U-1]).addClass(c.classPrefix+"-border"+U);ja(S,{selectionColor:"background-color",selectionOpacity:"opacity"});ja(u,{borderOpacity:"opacity",borderWidth:"border-width"});ja(m,{outerColor:"background-color",outerOpacity:"opacity"});
(F=c.borderColor1)&&b(u[0]).css({borderStyle:"solid",borderColor:F});(F=c.borderColor2)&&b(u[1]).css({borderStyle:"dashed",borderColor:F});l.append(S.add(u).add(ha)).append(t);T&&((F=(m.css("filter")||"").match(/opacity=(\d+)/))&&m.css("opacity",F[1]/100),(F=(u.css("filter")||"").match(/opacity=(\d+)/))&&u.css("opacity",F[1]/100));a.hide?pa(l.add(m)):a.show&&ba&&(fa=!0,l.add(m).fadeIn(c.fadeSpeed||0),oa());I=(Da=(c.aspectRatio||"").split(/:/))[0]/Da[1];x.add(m).off("mousedown",Aa);if(c.disable||!1===
c.enable)l.off("mousemove",O).off("mousedown",ya),b(window).off("resize",Ba);else{if(c.enable||!1===c.disable)(c.resizable||c.movable)&&l.mousemove(O).mousedown(ya),b(window).resize(Ba);c.persistent||x.add(m).mousedown(Aa)}c.enable=c.disable=void 0}var x=b(A),ba,l=C(),S=C(),u=C().add(C()).add(C()).add(C()),m=C().add(C()).add(C()).add(C()),t=b([]),ha,q,r,B={left:0,top:0},y,v,R,w={left:0,top:0},J=0,ca="absolute",sa,ta,V,W,z,X,Y,la,ma,I,fa,g,f,h,k,d={x1:0,y1:0,x2:0,y2:0,width:0,height:0},na=document.documentElement,
E=navigator.userAgent,Da,U,F,H,N,qa,wa=function(a){var b=c.keys,d=a.keyCode;var e=isNaN(b.alt)||!a.altKey&&!a.originalEvent.altKey?!isNaN(b.ctrl)&&a.ctrlKey?b.ctrl:!isNaN(b.shift)&&a.shiftKey?b.shift:isNaN(b.arrows)?10:b.arrows:b.alt;if("resize"==b.arrows||"resize"==b.shift&&a.shiftKey||"resize"==b.ctrl&&a.ctrlKey||"resize"==b.alt&&(a.altKey||a.originalEvent.altKey)){switch(d){case 37:e=-e;case 39:a=n(g,h);g=p(g,h);h=n(a+e,g);Z();break;case 38:e=-e;case 40:a=n(f,k);f=p(f,k);k=n(a+e,f);Z(!0);break;
default:return}da()}else switch(g=p(g,h),f=p(f,k),d){case 37:aa(n(g-e,q),f);break;case 38:aa(g,n(f-e,r));break;case 39:aa(g+p(e,y-K(h)),f);break;case 40:aa(g,f+p(e,v-L(k)));break;default:return}return!1};this.remove=function(){va({disable:!0});l.add(m).remove()};this.getOptions=function(){return c};this.setOptions=va;this.getSelection=G;this.setSelection=ka;this.cancelSelection=ia;this.update=oa;var T=(/msie ([\w.]+)/i.exec(E)||[])[1],Ea=/opera/i.test(E),Fa=/webkit/i.test(E)&&!/chrome/i.test(E);for(E=
x;E.length;)J=n(J,isNaN(E.css("z-index"))?J:E.css("z-index")),"fixed"==E.css("position")&&(ca="fixed"),E=E.parent(":not(body)");J=c.zIndex||J;T&&x.attr("unselectable","on");b.imgAreaSelect.keyPress=T||Fa?"keydown":"keypress";Ea&&(ha=C().css({width:"100%",height:"100%",position:"absolute",zIndex:J+2||2}));l.add(m).css({visibility:"hidden",position:ca,overflow:"hidden",zIndex:J||"0"});l.css({zIndex:J+2||2});S.add(u).css({position:"absolute",fontSize:0});A.complete||"complete"==A.readyState||!x.is("img")?
Ca():x.one("load",Ca);!ba&&T&&7<=T&&(A.src=A.src)};b.fn.imgAreaSelect=function(e){e=e||{};this.each(function(){b(this).data("imgAreaSelect")?e.remove?(b(this).data("imgAreaSelect").remove(),b(this).removeData("imgAreaSelect")):b(this).data("imgAreaSelect").setOptions(e):e.remove||(void 0===e.enable&&void 0===e.disable&&(e.enable=!0),b(this).data("imgAreaSelect",new b.imgAreaSelect(this,e)))});return e.instance?b(this).data("imgAreaSelect"):this}})(jQuery);
;

