// source --> https://sitioplr.com/wp-content/plugins/mayosis-core/library/user-profile//assets/js/edd-user-profiles.min.js?ver=1 
jQuery(document).ready(function(e){function a(e,a){var t,r,d=decodeURIComponent(e),i=d.split("&");for(r=0;r<i.length;r++)if(t=i[r].split("="),t[0]===a)return void 0===t[1]?!0:t[1]}function t(e,a){var t={};for(var r in e)t[r]=e[r];for(var r in a)t[r]=a[r];return t}function r(d,i){if(void 0!==d){var s=e("#"+d);s.html(edd_user_profiles.spinner);var n={action:"edd_user_profiles_load_tab_content",tab:d,user:edd_user_profiles.queried_user};void 0!==i&&(n=t(n,i)),e.ajax({url:edd_scripts.ajaxurl,data:n,success:function(t){s.html(t),0!=s.find("#edd_download_pagination").length&&s.find("#edd_download_pagination a").click(function(t){t.preventDefault(),r(d,{paged:a(e(this).attr("href"),"paged")})}),0!=s.find(".edd-wish-list").length&&s.find(".edd-wish-list a").click(function(a){a.preventDefault(),r(d,{view:e(this).attr("href")})})}})}}e("#edd_avatar_button").click(function(a){e("#edd_avatar_file").click()}),e("#edd_avatar_file").change(function(a){var t=a.target.files;if(1==t.length){var r=new FormData;r.append("action","edd_user_profiles_upload_avatar"),r.append("edd_avatar",t[0]),e.ajax({url:edd_scripts.ajaxurl,data:r,type:"post",dataType:"json",cache:!1,processData:!1,contentType:!1,success:function(a){void 0!==a.url&&(e("#edd_avatar").val(a.url),e("#edd_avatar_preview").attr("src",a.url).parent().removeClass("edd-user-profiles-hide"),e("#edd_avatar_button").parent().addClass("edd-user-profiles-hide"))}})}}),e("#edd_avatar_remove_button").click(function(a){a.preventDefault(),e("#edd_avatar").val(""),e("#edd_avatar_preview").attr("src","").parent().addClass("edd-user-profiles-hide"),e("#edd_avatar_button").parent().removeClass("edd-user-profiles-hide")}),r(e(".edd-user-profiles-tab.active").attr("id")),e(".edd-user-profiles-nav-tab").click(function(a){a.preventDefault(),e(this).hasClass("active")||(e("#edd-user-profiles-nav-tabs .active").removeClass("active"),e(this).addClass("active"),e("#edd-user-profiles-tabs .active").removeClass("active"),e(e(this).attr("href")).addClass("active"),0==e(e(this).attr("href")).html().trim().length&&r(e(this).attr("href").replace("#","")))}),e('.edd-user-profiles-nav-tab[href="#wish-lists"]').click(function(a){a.preventDefault(),0==e(e(this).attr("href")).find(".edd-wish-list").length&&r(e(this).attr("href").replace("#",""))})});