(window.webpackJsonp=window.webpackJsonp||[]).push([["1c78"],{XPYF:function(e,n,o){"use strict";o.r(n);o("la2R"),o("B1Un");var t=o("m/V4");angular.module("footyroom").requires.push("fr.profile"),angular.module("fr.profile",[t.a]).controller("ProfileSettingsController",["$scope","$http",function(e,n){function o(e){var o=null;"connected"===e.status&&(o=e.authResponse.accessToken,n.post("/profile/settings/fbconnect",{token:o}).then(t))}function t(n){"success"===n.data?window.location="/profile/settings":e.fbLoginError=n.data}e.submitForm=function(n){e.userForm.$invalid&&n.preventDefault()},e.$watch("userForm",function(){e.userForm.verifyPassword.$validators.verify=function(n,o){return o==e.userForm.newPassword.$viewValue}}),e.fbConnect=function(){e.fbLoginError=null,FB.login(o,{scope:"public_profile, email"})},e.fbDisconnect=function(){e.fbLoginError=null,n.post("/profile/settings/fbdisconnect").then(t)}}]).controller("ProfileCtrl",function(){}).controller("FriendsPaginationCtrl",["$scope","$rootScope","$http",function(e,n,o){function t(e,o){"OK"===e.data&&(o?n.$broadcast("loadFriends"):r())}function r(n){o({method:"GET",url:"/profile/"+e.username+"/friends.json",params:{type:e.type,page:e.currentPage,perPage:e.itemsPerPage}}).then(function(n){e.totalItems=parseInt(n.data.total),e.friends=n.data.data})}e.currentPage=1,e.itemsPerPage=20,e.$on("loadFriends",function(){r()}),e.init=function(n){e.type=n,r()},e.pageChanged=function(){r()},e.removeFriend=function(e){o.post("/profile/friends/unfriend",{userId:e}).then(t)},e.ignoreFriend=function(e){o.post("/profile/friends/delete-request",{fromUserId:e}).then(t)},e.acceptFriend=function(e){o.post("/profile/friends/accept-request",{fromUserId:e}).then(function(e){t(e,!0)})}}]),$(document).ready(function(){$("#changePhoto_label").click(function(){$("#inputChangePhoto").click()}),$("#filter_all").click(function(){$("#all_friends").show(),$("#pending_friends").hide()}),$("#filter_pending").click(function(){$("#all_friends").hide(),$("#pending_friends").show()}),$("#inputChangePhoto").change(function(){$("#changePhotoForm").submit()}),$.profile={userID:$("#profile_userID").val()},$("#add_as_friend").click(function(){var e=this;$.post("/profile/friends/request",{userId:$.profile.userID},function(n){1==n.success?($("#profile_connect_text").removeClass("displayno"),$(e).hide()):alert("Error in communication")},"json")})})},xeH2:function(e,n){e.exports=jQuery}},[["XPYF","d41d","970b","c5ee","1090","249e","91fe","14aa","9ba4"]]]);