!function(e){"function"==typeof define&&define.amd?define("accountDetails",e):e()}(function(){"use strict";jQuery(function(e){e('form.sign-in-form .form-group input[type="password"]').parent().wrap('<span class="toggle-password"></span>'),e(".toggle-password").append('<span class="show-toggle-password"></span>'),e(".show-toggle-password").on("click",function(){e(this).toggleClass("display-password"),e(this).hasClass("display-password")?e(this).siblings(".form-group").find('input[type="password"]').prop("type","text"):e(this).siblings(".form-group").find('input[type="text"]').prop("type","password")})}),window.onGoogleLibraryLoad=function(){jQuery(".cts-google-signin").each(function(e,o){function s(e){if("error"===e.status&&e.message)return a.removeClass("cts-processing-login"),alert(e.message);window.location.reload()}function n(e,o,s){console.log("Failed",e,o,s),a.removeClass("cts-processing-login")}var t=jQuery(o),a=t.parents(".cts-connected-account"),c=jQuery("meta[name='google-signin-client_id']").attr("content"),i="".concat(CASE27.mylisting_ajax_url,"&action=cts_login_endpoint&security=").concat(CASE27.ajax_nonce);"disconnect"===t.data("process")?t.on("click",function(e){e.preventDefault(),a.addClass("cts-processing-login"),jQuery.ajax({url:i,type:"POST",dataType:"json",success:s,error:n,data:{network:"google",process:"disconnect"}})}):(google.accounts.id.initialize({client_id:c,callback:function(e){a.addClass("cts-processing-login"),jQuery.ajax({url:i,type:"POST",dataType:"json",success:s,error:n,data:{network:"google",token:e.credential,process:"connect"}})}}),google.accounts.id.renderButton(o,{theme:"outline",size:"large"}),google.accounts.id.prompt())})},jQuery(".cts-facebook-signin").click(function(e){e.preventDefault();function o(e){if("error"===e.status&&e.message)return n.removeClass("cts-processing-login"),alert(e.message);window.location.reload()}function s(e,o,s){console.log("Failed",e,o,s),n.removeClass("cts-processing-login")}var e=jQuery(e.target),n=e.parents(".cts-connected-account"),t="".concat(CASE27.mylisting_ajax_url,"&action=cts_login_endpoint&security=").concat(CASE27.ajax_nonce);"disconnect"===e.data("process")?(n.addClass("cts-processing-login"),jQuery.ajax({url:t,type:"POST",dataType:"json",success:o,error:s,data:{network:"facebook",process:"disconnect"}})):FB.login(function(e){e.authResponse&&(n.addClass("cts-processing-login"),jQuery.ajax({url:t,type:"POST",dataType:"json",success:o,error:s,data:{network:"facebook",token:e.authResponse.accessToken,process:"connect"}}))},{scope:"public_profile,email"})}),jQuery(document).ready(function(o){var e,s;e=o('input[name="cts-user-picture-settings"]'),s=o("#change-avatar-fieldset"),e.length&&("default"!==o('input[name="cts-user-picture-settings"]:checked').val()&&s.hide(),e.on("change",function(){"default"===o(this).val()?s.show():s.hide()})),o("#change-avatar-fieldset").on("click",".file-upload-field .remove-uploaded-file",function(e){e.preventDefault(),o(this).parents(".uploaded-file").remove()})})});
