text: (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{15:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={SUCCESS:"ALERT_SUCCESS",ERROR:"ALERT_ERROR",CLEAR:"ALERT_CLEAR"}},16:function(e,t,a){"use strict";a.d(t,"a",function(){return c});var n=a(13),c=Object(n.a)()},31:function(e,t,a){"use strict";a.d(t,"a",function(){return c});var n=a(15),c={success:function(e){return{type:n.a.SUCCESS,message:e}},error:function(e){return{type:n.a.ERROR,message:e}},clear:function(){return{type:n.a.CLEAR}}}},33:function(e,t,a){"use strict";var n=a(9),c=a(0),o={readNotifications:function(e){var t={method:"POST",headers:{"Content-Type":"application/json",Authorization:JSON.parse(localStorage.getItem("user")).token},body:JSON.stringify({notificationIds:e})};return fetch("/api/notification/readNotifications/",t).then(E).then(function(e){return e})},fetchNotifications:function(e){var t={method:"POST",headers:{"Content-Type":"application/json",Authorization:JSON.parse(localStorage.getItem("user")).token},body:JSON.stringify(Object(c.a)({},e))};return fetch("/api/notification/getNotifications/",t).then(E).then(function(e){return e.data})}};function E(e){return e.text().then(function(t){var a=t&&JSON.parse(t);if(!e.ok){401===e.status&&(localStorage.removeItem("user"),window.location.reload(!0));var n=a&&a.message||e.statusText;return Promise.reject(n)}return a})}a.d(t,"a",function(){return s});var s={toggleNotificationPopup:function(){return function(e){e({type:n.a.TOGGLE_NOTIFICATION_POPUP})}},closeNotificationPopup:function(){return function(e){e({type:n.a.CLOSE_NOTIFICATION_POPUP})}},addNotification:function(e){return function(t){t({type:n.a.ADD_NOTIFICATION,data:e})}},fetchNotifications:function(e,t){return function(c){o.fetchNotifications(e).then(function(o){if(e.initialFetch){var E=o[0],s=E.notifications,S=E.total;c(a(s,S[0],e.initialFetch));var i=s.filter(function(e){return!e.read}).map(function(e){return e._id}).concat(t),O=i.filter(function(e,t){return i.indexOf(e)===t}).filter(function(e){return void 0!==e});r(O),void 0!==O[0]&&c({type:n.a.READ_NOTIFICATIOS,readCount:O.length})}else{c(a(o));var _=o.filter(function(e){return!e.read}).map(function(e){return e._id}).concat(t),u=_.filter(function(e,t){return _.indexOf(e)===t}).filter(function(e){return void 0!==e});r(u),void 0!==u[0]&&c({type:n.a.READ_NOTIFICATIOS,readCount:u.length})}},function(e){console.log(e)})};function a(e,t,a){return{type:n.a.FETCH_NOTIFICATIONS_SUCCESS,notifications:e,total:t,initialFetch:a}}}};function r(e){o.readNotifications(e).then(function(){},function(e){console.log(e)})}},36:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={CONNECT:"CONNECT"}},4:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={REGISTER_REQUEST:"USERS_REGISTER_REQUEST",REGISTER_SUCCESS:"USERS_REGISTER_SUCCESS",REGISTER_FAILURE:"USERS_REGISTER_FAILURE",LOGIN_REQUEST:"USERS_LOGIN_REQUEST",LOGIN_SUCCESS:"USERS_LOGIN_SUCCESS",LOGIN_FAILURE:"USERS_LOGIN_FAILURE",LOGOUT:"USERS_LOGOUT",GETUSER_REQUEST:"USER_GETUSER_REQUEST",GETUSER_SUCCESS:"USER_GETUSER_SUCCESS",GETUSER_FAILURE:"USER_GETUSER_FAILURE",DELETE_REQUEST:"USERS_DELETE_REQUEST",DELETE_SUCCESS:"USERS_DELETE_SUCCESS",DELETE_FAILURE:"USERS_DELETE_FAILURE",USER_UPDATE_REQUEST:"USER_UPDATE_REQUEST",USER_UPDATE_SUCCESS:"USER_UPDATE_SUCCESS",USER_UPDATE_FAILURE:"USER_UPDATE_FAILURE",USER_UPDATE_PROFILEPICTURE_SUCCESS:"USER_UPDATE_PROFILEPICTURE_SUCCESS",USER_LIKE_COMMENT:"USER_LIKE_COMMENT",USER_DISLIKE_COMMENT:"USER_DISLIKE_COMMENT",USER_DISLIKE_POST:"USER_DISLIKE_POST",USER_LIKE_POST:"USER_LIKE_POST",USER_LIKE_COMMENT_REPLY:"USER_LIKE_COMMENT_REPLY",USER_DISLIKE_COMMENT_REPLY:"USER_DISLIKE_COMMENT_REPLY",GET_USERPROFILE_DATA_REQUEST:"GET_USERPROFILE_DATA_REQUEST",GET_USERPROFILE_DATA:"GET_USERPROFILE_DATA",GET_USERPROFILE_DATA_FAILURE:"GET_USERPROFILE_DATA_FAILURE",GET_USER_PROFILE_FOLLOWINGS:"GET_USER_PROFILE_FOLLOWINGS",GET_USER_PROFILE_FOLLOWERS:"GET_USER_PROFILE_FOLLOWERS",GET_USER_FOLLOWINGS:"GET_USER_FOLLOWINGS",GET_USER_FOLLOWERS:"GET_USER_FOLLOWERS",FOLLOW_USER:"FOLLOW_USER",UNFOLLOW_USER:"UNFOLLOW_USER",GET_POSTS:"GET_POSTS",GET_USER_PROFILE_POSTS:"GET_USER_PROFILE_POSTS",PASSWORD_RESET_REQUEST:"PASSWORD_RESET_REQUEST",PASSWORD_RESET_RESPONSE:"PASSWORD_RESET_RESPONSE",GET_NEW_USERS_SUCCESS:"GET_NEW_USERS_SUCCESS",GET_NEW_USERS_REQUEST:"GET_NEW_USERS_REQUEST",NEW_USER:"NEW_USER"}},43:function(e,t,a){e.exports=a(54)},48:function(e,t,a){},5:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={POSTS_REQUEST:"POSTS_REQUEST",POSTS_SUCCESS:"POSTS_SUCCESS",POSTS_FAILURE:"POSTS_FAILURE",HASHTAG_POSTS_SUCCESS:"HASHTAG_POSTS_SUCCESS",LOCATION_POSTS_SUCCESS:"LOCATION_POSTS_SUCCESS",HASHTAG_POSTS_REQUEST:"HASHTAG_POSTS_REQUEST",LOCATION_POSTS_REQUEST:"LOCATION_POSTS_REQUEST",ADD_POST_REQUEST:"ADD_POST_REQUEST",ADD_POST_SUCCESS:"ADD_POST_SUCCESS",ADD_POST_FAILURE:"ADD_POST_FAILURE",POST_DELETE_REQUEST:"POSTS_DELETE_REQUEST",POST_DELETE_SUCCESS:"POSTS_DELETE_SUCCESS",POST_DELETE_FAILURE:"POSTS_DELETE_FAILURE",LIKE_POST:"LIKE_POST",DISLIKE_POST:"DISLIKE_POST",GET_POST_LIKES:"GET_POST_LIKES",INIT_COMMENT:"INIT_COMMENT",NEW_POST:"NEW_POST",GET_POST:"GET_POST",IMAGE_CROP_SELECT:"IMAGE_CROP_SELECT",IMAGE_SELECT:"IMAGE_SELECT",MAP_LOCATION_SELECT:"MAP_LOCATION_SELECT",CANVAS_HAS_VALUE:"CANVAS_HAS_VALUE"}},53:function(e,t,a){},54:function(e,t,a){"use strict";a.r(t);var n=a(1),c=a.n(n),o=a(32),E=a.n(o),s=(a(48),a(24)),r=a(25),S=a(27),i=a(26),O=a(28),_=a(39),u=a(59),T=a(58),m=a(18),l=a(16),d=a(31),I=a(33),R=a(40),C=a(57),b=function(e){var t=e.component,a=Object(R.a)(e,["component"]);return c.a.createElement(T.a,Object.assign({},a,{render:function(e){return localStorage.getItem("user")?c.a.createElement(t,e):c.a.createElement(C.a,{to:{pathname:"/login",state:{from:e.location}}})}}))},U=(a(53),Object(n.lazy)(function(){return a.e(21).then(a.bind(null,805))})),j=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(20)]).then(a.bind(null,806))}),L=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(11)]).then(a.bind(null,822))}),p=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(16)]).then(a.bind(null,807))}),A=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(17)]).then(a.bind(null,808))}),N=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(9)]).then(a.bind(null,823))}),f=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(10)]).then(a.bind(null,809))}),g=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(13)]).then(a.bind(null,815))}),P=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(3),a.e(12)]).then(a.bind(null,813))}),M=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(4),a.e(18)]).then(a.bind(null,814))}),h=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(4),a.e(19)]).then(a.bind(null,820))}),G=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(7),a.e(15)]).then(a.bind(null,819))}),D=Object(n.lazy)(function(){return Promise.all([a.e(0),a.e(1),a.e(2),a.e(4),a.e(8)]).then(a.bind(null,816))}),F=function(e){function t(){var e,a;Object(s.a)(this,t);for(var n=arguments.length,c=new Array(n),o=0;o<n;o++)c[o]=arguments[o];return(a=Object(S.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(c)))).handleNotificationPopupClose=function(){var e=a.props,t=e.dispatch;e.isOpen&&t(I.a.closeNotificationPopup())},a}return Object(O.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){var e=this.props.dispatch;window.addEventListener("scroll",this.handleNotificationPopupClose),l.a.listen(function(t,a){e(d.a.clear())})}},{key:"render",value:function(){var e=this.props.authentication;return c.a.createElement("div",{onClick:this.handleNotificationPopupClose},c.a.createElement(_.a,{history:l.a},c.a.createElement(n.Suspense,{fallback:c.a.createElement("div",null,"Loading...")},c.a.createElement(n.Fragment,null,e.loggedIn?c.a.createElement(D,null):null,c.a.createElement(u.a,null,c.a.createElement(b,{exact:!0,path:"/",component:L}),c.a.createElement(T.a,{exact:!0,path:"/login",render:function(){return c.a.createElement(p,null)}}),c.a.createElement(T.a,{exact:!0,path:"/register",render:function(){return c.a.createElement(A,null)}}),c.a.createElement(b,{exact:!0,path:"/profile",component:N}),c.a.createElement(b,{exact:!0,path:"/posts/upload",component:g}),c.a.createElement(b,{exact:!0,path:"/messages/chat",component:G}),c.a.createElement(T.a,{path:"/hashtags/:hashtag",render:function(e){return localStorage.getItem("user")||(l.a.push("/login"),window.location.reload()),c.a.createElement(M,Object.assign({key:e.match.params.hashtag},e))}}),c.a.createElement(T.a,{path:"/p/:postId",render:function(e){return localStorage.getItem("user")||(l.a.push("/login"),window.location.reload()),c.a.createElement(P,Object.assign({key:e.match.params.postId},e))}}),c.a.createElement(T.a,{path:"/location/:coordinates",render:function(e){return localStorage.getItem("user")||(l.a.push("/login"),window.location.reload()),c.a.createElement(h,Object.assign({key:e.match.params.coordinates},e))}}),c.a.createElement(T.a,{exact:!0,path:"/:username",render:function(e){return localStorage.getItem("user")||(l.a.push("/login"),window.location.reload()),c.a.createElement(f,Object.assign({key:e.match.params.username},e))}}),c.a.createElement(T.a,{exact:!0,path:"/auth/reset/password/:jwt",render:function(e){return c.a.createElement(j,e)}}),c.a.createElement(T.a,{render:function(){return c.a.createElement(U,null)}}))))))}}]),t}(c.a.Component),v=Object(m.b)(function(e){return{authentication:e.authentication,isOpen:e.notification.isOpen}})(F);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var y=a(14),w=a(38),k=a(0),Q=a(4),W=JSON.parse(localStorage.getItem("user")),H=W?{loggedIn:!0,user:W}:{};var K=a(3),Y=a(5),B=a(8),x=a(9),V=a(7);var z=a(15);var J={posts:[],postsByHashtag:[],postsByLocation:[],totalPosts:0,totalPostsByHashtag:0,totalPostsByLocation:0,coordinates:null,hashtag:null,postLikes:[],post:{fetching:!0},fetching:!1,deleting:!1,posting:!1};var q=a(6);var X={loadingUser:!0,data:{profilePicture:"person.png",firstName:"",lastName:"",username:"",email:"",bio:"",followings:0,followers:0,postsCount:0,follwingUsers:[],followerUsers:[],posts:[]}};var $=a(36);var Z={imgSrc:null,imgSrcExt:null,cropImgSrc:null,canvasHasValue:!1,divs:[],step:0,uploading:!1,location:{coordinates:[],locationName:""}};var ee={users:[],fetching:!0,fetchingNewUsers:!1,usersCount:0};var te=Object(y.c)({post:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Y.a.POSTS_REQUEST:return Object(k.a)({},e,{fetching:!0});case Y.a.LOCATION_POSTS_REQUEST:return t.initialFetch?Object(k.a)({},e,{postsByLocation:[],totalPostsByLocation:0,coordinates:null}):Object(k.a)({},e);case Y.a.HASHTAG_POSTS_REQUEST:return t.initialFetch?Object(k.a)({},e,{postsByHashtag:[],totalPostsByHashtag:0,hashtag:null}):Object(k.a)({},e);case Y.a.POSTS_SUCCESS:return t.initialFetch?Object(k.a)({},e,{posts:t.posts,totalPosts:t.total.count,fetching:!1}):Object(k.a)({},e,{posts:[].concat(Object(K.a)(e.posts),Object(K.a)(t.posts)),fetching:!1});case Y.a.HASHTAG_POSTS_SUCCESS:return t.initialFetch?Object(k.a)({},e,{postsByHashtag:t.posts,hashtag:t.hashtag,totalPostsByHashtag:t.total.count,fetching:!1}):Object(k.a)({},e,{postsByHashtag:[].concat(Object(K.a)(e.postsByHashtag),Object(K.a)(t.posts)),fetching:!1});case Y.a.LOCATION_POSTS_SUCCESS:return t.initialFetch?Object(k.a)({},e,{postsByLocation:t.posts,coordinates:t.coordinates,totalPostsByLocation:t.total.count,fetching:!1}):Object(k.a)({},e,{postsByLocation:[].concat(Object(K.a)(e.postsByLocation),Object(K.a)(t.posts)),fetching:!1});case Y.a.GET_POST_LIKES:return Object(k.a)({},e,{postLikes:[].concat(Object(K.a)(e.postLikes),Object(K.a)(t.postLikes))});case"CLEAR_POSTS":return Object(k.a)({},e,J);case"CLEAR_POST_LIKES":return Object(k.a)({},e,{postLikes:[]});case Y.a.POST_DELETE_REQUEST:return Object(k.a)({},e,{deleting:!0});case Y.a.POST_DELETE_SUCCESS:return Object(k.a)({},e,{deleting:!1,post:{fetching:!0}});case B.a.ADD_COMMENT_SUCCESS:return Object(k.a)({},e,{posts:e.posts.map(function(e){return e._id===t.comment.post?Object(k.a)({},e,{comments:e.comments+1}):e}),post:Object(k.a)({},e.post,{comments:e.post.comments+1})});case Y.a.LIKE_POST:return Object(k.a)({},e,{posts:e.posts.map(function(e){return e._id===t.post.postId?Object(k.a)({},e,{likes:e.likes+1}):e}),post:Object(k.a)({},e.post,{likes:e.post.likes+1})});case Y.a.DISLIKE_POST:return Object(k.a)({},e,{posts:e.posts.map(function(e){return e._id===t.post.postId?Object(k.a)({},e,{likes:e.likes-1}):e}),post:Object(k.a)({},e.post,{likes:e.post.likes-1})});case Y.a.GET_POST:return Object(k.a)({},e,{post:Object(k.a)({},t.post[0],{fetching:!1})});default:return e}},authentication:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:H,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Q.a.LOGIN_REQUEST:return{loggingIn:!0};case Q.a.LOGIN_SUCCESS:return Object(k.a)({},e,{loggedIn:!0,user:t.user});case Q.a.LOGIN_FAILURE:case Q.a.LOGOUT:return{};default:return e}},registration:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch((arguments.length>1?arguments[1]:void 0).type){case Q.a.REGISTER_REQUEST:return{registering:!0};case Q.a.REGISTER_SUCCESS:case Q.a.REGISTER_FAILURE:return{};default:return e}},user:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loadingUser:!0,updaingUser:!1,deleting:!1,hasError:!1,data:{_id:"",username:"",firstName:"",lastName:"",email:"",profilePicture:"person.png",bio:"",followers:0,followings:0,postsCount:0,allNotifications:0,notificationsCount:0,messagesCount:0,followingIds:[],posts:[],follwingUsers:[],followerUsers:[],notifications:[],postLikes:[],commentLikes:[],commentReplyLikes:[]}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Q.a.GETUSER_REQUEST:return Object(k.a)({},e,{loadingUser:!0});case Q.a.USER_UPDATE_REQUEST:return Object(k.a)({},e,{updaingUser:!0});case Q.a.USER_UPDATE_SUCCESS:var a=t.user,n=a.firstName,c=a.lastName,o=a.username,E=a.email,s=a.bio;return Object(k.a)({},e,{updaingUser:!1,hasError:!1,data:Object(k.a)({},e.data,{firstName:n,lastName:c,username:o,email:E,bio:s})});case Q.a.USER_UPDATE_FAILURE:return Object(k.a)({},e,{updaingUser:!1,hasError:t.error});case Q.a.GETUSER_SUCCESS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,t.user),loadingUser:!1});case Q.a.USER_UPDATE_PROFILEPICTURE_SUCCESS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{profilePicture:t.user.profilePicture}),loadingUser:!1});case Q.a.USER_LIKE_COMMENT:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{commentLikes:[].concat(Object(K.a)(e.data.commentLikes),[t.comment.commentId])})});case Q.a.USER_DISLIKE_COMMENT:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{commentLikes:e.data.commentLikes.filter(function(e){return e!==t.comment.commentId})})});case Q.a.USER_LIKE_COMMENT_REPLY:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{commentReplyLikes:[].concat(Object(K.a)(e.data.commentReplyLikes),[t.comment.commentId])})});case Q.a.USER_DISLIKE_COMMENT_REPLY:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{commentReplyLikes:e.data.commentReplyLikes.filter(function(e){return e!==t.comment.commentId})})});case B.a.ADD_COMMENT_SUCCESS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:e.data.posts.map(function(e){return e._id===t.comment.post?Object(k.a)({},e,{comments:e.comments+1}):e})})});case Y.a.LIKE_POST:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{postLikes:[].concat(Object(K.a)(e.data.postLikes),[t.post.postId]),posts:e.data.posts.map(function(e){return e._id===t.post.postId?Object(k.a)({},e,{likes:e.likes+1}):Object(k.a)({},e)})})});case Y.a.DISLIKE_POST:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{postLikes:e.data.postLikes.filter(function(e){return e!==t.post.postId}),posts:e.data.posts.map(function(e){return e._id===t.post.postId?Object(k.a)({},e,{likes:e.likes-1}):Object(k.a)({},e)})})});case Q.a.FOLLOW_USER:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{followingIds:[].concat(Object(K.a)(e.data.followingIds),[t.user.userId])})});case Q.a.UNFOLLOW_USER:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{followingIds:e.data.followingIds.filter(function(e){return e!==t.user.userId})})});case Q.a.GET_POSTS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:[].concat(Object(K.a)(e.data.posts),Object(K.a)(t.posts))})});case Y.a.ADD_POST_REQUEST:return Object(k.a)({},e,{posting:!0});case Y.a.ADD_POST_SUCCESS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:[t.post].concat(Object(K.a)(e.data.posts)),postsCount:e.data.postsCount+1}),posting:!1});case x.a.READ_NOTIFICATIOS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{notificationsCount:e.data.notificationsCount-t.readCount})});case Y.a.POST_DELETE_REQUEST:return Object(k.a)({},e,{deleting:!0});case Y.a.POST_DELETE_SUCCESS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:e.data.posts.filter(function(e){return e._id!==t.result.id}),postsCount:e.data.postsCount-1}),deleting:!1});case x.a.ADD_NOTIFICATION:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{notificationsCount:e.data.notificationsCount+1})});case Y.a.GET_POST:return Object(k.a)({},e,{openedPost:Object(k.a)({},e.openedPost,{loadingPost:!1,data:t.post[0]})});case Q.a.GET_USER_FOLLOWERS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{followerUsers:t.users})});case Q.a.GET_USER_FOLLOWINGS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{follwingUsers:t.users})});case V.a.INC_MESSAGE_COUNT:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{messagesCount:e.data.messagesCount+1})});case V.a.READ_MESSAGES:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{messagesCount:e.data.messagesCount-t.messageIds.length})});default:return e}},newUsers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Q.a.GET_NEW_USERS_SUCCESS:return t.data.initialFetch?Object(k.a)({},e,{users:[].concat(Object(K.a)(t.data.users),Object(K.a)(e.users)),usersCount:t.data.usersCount,fetching:!1}):Object(k.a)({},e,{users:[].concat(Object(K.a)(e.users),Object(K.a)(t.data.users)),fetchingNewUsers:!1});case Q.a.GET_NEW_USERS_REQUEST:return Object(k.a)({},e,{fetchingNewUsers:!0});case Q.a.NEW_USER:return Object(k.a)({},e,{users:[t.user].concat(Object(K.a)(e.users)),usersCount:e.usersCount+1});default:return e}},passwordReset:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{requesting:!1};switch((arguments.length>1?arguments[1]:void 0).type){case Q.a.PASSWORD_RESET_REQUEST:return Object(k.a)({},e,{requesting:!0});case Q.a.PASSWORD_RESET_RESPONSE:return Object(k.a)({},e,{requesting:!1});default:return e}},alert:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case z.a.SUCCESS:return{type:"success",message:t.message};case z.a.ERROR:return{type:"error",message:t.message};case z.a.CLEAR:return{};default:return e}},comments:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{commentLikes:[]},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case B.a.FETCH_COMMENTS_REQUEST:return Object(k.a)({},e,Object(q.a)({},t.postId,Object(k.a)({},e[t.postId],{fetching:!0})));case B.a.FETCH_COMMENTS_SUCCESS:return Object(k.a)({},e,Object(q.a)({},t.comment.postId,Object(k.a)({},e[t.comment.postId],{fetching:!1,comments:[].concat(Object(K.a)(e[t.comment.postId].comments),Object(K.a)(t.comment.comments))})));case Y.a.INIT_COMMENT:return e[[t.postId]]?Object(k.a)({},e):Object(k.a)({},e,Object(q.a)({},t.postId,{fetching:!1,comments:[]}));case B.a.INCREASE_REPLIES_NUMBER:return Object(k.a)({},e,Object(q.a)({},t.postId,Object(k.a)({},e[t.postId],{comments:e[t.postId].comments.map(function(e){return e._id===t.commentId?Object(k.a)({},e,{replies:e.replies+1}):e})})));case B.a.ADD_COMMENT_SUCCESS:return Object(k.a)({},e,Object(q.a)({},t.comment.post,Object(k.a)({},e[t.comment.post],{fetching:!1,comments:[t.comment].concat(Object(K.a)(e[t.comment.post].comments))})));case B.a.LIKE_COMMENT:return Object(k.a)({},e,Object(q.a)({},t.comment.postId,Object(k.a)({},e[t.comment.postId],{comments:e[t.comment.postId].comments.map(function(e){return e._id===t.comment.commentId?Object(k.a)({},e,{likes:e.likes+1}):e})})));case B.a.DISLIKE_COMMENT:return Object(k.a)({},e,Object(q.a)({},t.comment.postId,Object(k.a)({},e[t.comment.postId],{comments:e[t.comment.postId].comments.map(function(e){return e._id===t.comment.commentId?Object(k.a)({},e,{likes:e.likes-1}):e})})));case B.a.GET_COMMENT_LIKES:return Object(k.a)({},e,{commentLikes:[].concat(Object(K.a)(e.commentLikes),Object(K.a)(t.commentLikes))});case"CLEAR_COMMENT_LIKES":return Object(k.a)({},e,{commentLikes:[]});default:return e}},replies:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{commentLikes:[]},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case B.a.FETCH_COMMENT_REPLIES_REQUEST:return Object(k.a)({},e,Object(q.a)({},t.commentId,Object(k.a)({},e[t.commentId],{fetching:!0})));case B.a.FETCH_COMMENT_REPLIES_SUCCESS:return Object(k.a)({},e,Object(q.a)({},t.comment.commentId,Object(k.a)({},e[t.comment.commentId],{fetching:!1,comments:[].concat(Object(K.a)(e[t.comment.commentId].comments),Object(K.a)(t.comment.comments))})));case B.a.INIT_REPLY_COMMENT:return e[t.commentId]?Object(k.a)({},e):Object(k.a)({},e,Object(q.a)({},t.commentId,{fetching:!1,comments:[]}));case B.a.ADD_REPLY_COMMENT_SUCCESS:return Object(k.a)({},e,Object(q.a)({},t.comment.commentAt,Object(k.a)({},e[t.comment.commentAt],{fetching:!1,comments:[t.comment].concat(Object(K.a)(e[t.comment.commentAt].comments))})));case B.a.LIKE_COMMENT_REPLY:return Object(k.a)({},e,Object(q.a)({},t.comment.parentId,Object(k.a)({},e[t.comment.parentId],{comments:e[t.comment.parentId].comments.map(function(e){return e._id===t.comment.commentId?Object(k.a)({},e,{likes:e.likes+1}):e})})));case B.a.DISLIKE_COMMENT_REPLY:return Object(k.a)({},e,Object(q.a)({},t.comment.parentId,Object(k.a)({},e[t.comment.parentId],{comments:e[t.comment.parentId].comments.map(function(e){return e._id===t.comment.commentId?Object(k.a)({},e,{likes:e.likes-1}):e})})));case B.a.GET_COMMENT_REPLY_LIKES:return Object(k.a)({},e,{commentLikes:[].concat(Object(K.a)(e.commentLikes),Object(K.a)(t.commentLikes))});case"CLEAR_COMMENT_REPLY_LIKES":return Object(k.a)({},e,{commentLikes:[]});default:return e}},userProfile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Q.a.GET_USERPROFILE_DATA_REQUEST:return Object(k.a)({},e,X);case Q.a.GET_USERPROFILE_DATA:return Object(k.a)({},e,{loadingUser:!1,data:Object(k.a)({},e.data,t.user.user)});case Q.a.GET_USERPROFILE_DATA_FAILURE:return Object(k.a)({},e,{loadingUser:!1});case Q.a.GET_USER_PROFILE_FOLLOWINGS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{follwingUsers:t.users})});case Q.a.GET_USER_PROFILE_POSTS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:[].concat(Object(K.a)(e.data.posts),Object(K.a)(t.posts))})});case Q.a.GET_USER_PROFILE_FOLLOWERS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{followerUsers:t.users})});case Y.a.LIKE_POST:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:e.data.posts.map(function(e){return e._id===t.post.postId?Object(k.a)({},e,{likes:e.likes+1}):Object(k.a)({},e)})})});case Y.a.DISLIKE_POST:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:e.data.posts.map(function(e){return e._id===t.post.postId?Object(k.a)({},e,{likes:e.likes-1}):Object(k.a)({},e)})})});case Q.a.FOLLOW_USER:return t.user.userId===e.data._id?Object(k.a)({},e,{data:Object(k.a)({},e.data,{followers:e.data.followers+1})}):Object(k.a)({},e);case B.a.ADD_COMMENT_SUCCESS:return Object(k.a)({},e,{data:Object(k.a)({},e.data,{posts:e.data.posts.map(function(e){return e._id===t.comment.post?Object(k.a)({},e,{comments:e.comments+1}):e})})});case Q.a.UNFOLLOW_USER:return t.user.userId===e.data._id?Object(k.a)({},e,{data:Object(k.a)({},e.data,{followers:e.data.followers-1})}):Object(k.a)({},e);default:return e}},notification:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isOpen:!1,notifications:[],allNotificationsCount:0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case x.a.FETCH_NOTIFICATIONS_SUCCESS:return t.initialFetch?Object(k.a)({},e,{notifications:t.notifications,allNotificationsCount:t.total.count}):Object(k.a)({},e,{notifications:[].concat(Object(K.a)(e.notifications),Object(K.a)(t.notifications))});case x.a.CLOSE_NOTIFICATION_POPUP:return Object(k.a)({},e,{isOpen:!1});case x.a.TOGGLE_NOTIFICATION_POPUP:return Object(k.a)({},e,{isOpen:!e.isOpen});case x.a.ADD_NOTIFICATION:return Object(k.a)({},e,{notifications:[t.data.notification].concat(Object(K.a)(e.notifications)),allNotificationsCount:e.allNotificationsCount+1});case x.a.READ_NOTIFICATIOS:return Object(k.a)({},e,{notifications:e.notifications.map(function(e){return Object(k.a)({},e,{read:!0})})});case Q.a.GETUSER_SUCCESS:return Object(k.a)({},e,{allNotificationsCount:t.user.allNotifications});default:return e}},socket:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case $.a.CONNECT:return Object(k.a)({},e,{socket:t.socket});default:return e}},postUpload:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RESET_IMAGE":return Object(k.a)({},e,Z);case"PREVIOUS_PAGE":return e.step>0?Object(k.a)({},e,{step:e.step-1,divs:[]}):Object(k.a)({},e);case"NEXT_PAGE":return e.step<1?Object(k.a)({},e,{step:e.step+1}):Object(k.a)({},e);case"ADD_IMAGE_TAG":return Object(k.a)({},e,{divs:[].concat(Object(K.a)(e.divs),[t.div])});case"DELETE_IMAGE_TAG":return Object(k.a)({},e,{divs:e.divs.filter(function(e){return e.id!==t.id})});case Y.a.ADD_POST_REQUEST:return Object(k.a)({},e,{uploading:!0});case Y.a.CANVAS_HAS_VALUE:return Object(k.a)({},e,{canvasHasValue:t.hasValue});case Y.a.IMAGE_SELECT:return Object(k.a)({},e,{imgSrc:t.imgSrc,imgSrcExt:t.imgSrcExt});case Y.a.IMAGE_CROP_SELECT:return Object(k.a)({},e,{cropImgSrc:t.imgSrc});case Y.a.MAP_LOCATION_SELECT:var a=t.location,n=a.text,c=a.geometry;return Object(k.a)({},e,{location:Object(k.a)({},e.location,{coordinates:c.coordinates,locationName:n})});case Y.a.ADD_POST_SUCCESS:return Object(k.a)({},e,Z,{step:0,uploading:!1});case Y.a.ADD_POST_FAILURE:return Object(k.a)({},e,{uploading:!1});default:return e}},chat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{rooms:[],currentRoom:null,roomsFetching:!1,roomId:null,callingModal:!1,answeringModal:{isOpen:!1},searchedRooms:null},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case V.a.TYPING:return e[t.roomId]?Object(k.a)({},e,Object(q.a)({},t.roomId,Object(k.a)({},e[t.roomId],{isTyping:!0}))):Object(k.a)({},e);case V.a.STOPPED_TYPING:return e[t.roomId]?Object(k.a)({},e,Object(q.a)({},t.roomId,Object(k.a)({},e[t.roomId],{isTyping:!1}))):Object(k.a)({},e);case V.a.CHANGE_ROOM:return Object(k.a)({},e,{currentRoom:t.room,roomId:t.room._id});case V.a.INIT_MESSAGE_ARRAY:return e[t.roomId]?Object(k.a)({},e):Object(k.a)({},e,Object(q.a)({},t.roomId,{messages:[],initialMessagesFetchig:!1,messageFetching:!1,isTyping:!1}));case V.a.GET_ROOMS_REQUEST:return Object(k.a)({},e,{roomsFetching:!0});case V.a.GET_ROOMS_SUCCESS:return Object(k.a)({},e,{rooms:t.rooms,roomsFetching:!1});case V.a.ADD_NEW_ROOM:return Object(k.a)({},e,{rooms:[t.room].concat(Object(K.a)(e.rooms))});case V.a.GET_MESSAGES_INITIAL_REQUEST:return Object(k.a)({},e,Object(q.a)({},t.roomId,Object(k.a)({},e[t.roomId],{initialMessagesFetchig:!0})));case V.a.GET_MESSAGES_REQUEST:return Object(k.a)({},e,Object(q.a)({},t.roomId,Object(k.a)({},e[t.roomId],{messageFetching:!0})));case V.a.GET_MESSAGES_SUCCESS:return Object(k.a)({},e,Object(q.a)({},t.data.roomId,Object(k.a)({},e[t.data.roomId],{messages:[].concat(Object(K.a)(t.data.messages),Object(K.a)(e[t.data.roomId].messages)),messageFetching:!1,initialMessagesFetchig:!1})));case V.a.SEND_MESSAGE_REQUEST:var a,n=e.currentRoom;return n&&e.currentRoom._id===t.message.roomId&&(n=Object(k.a)({},e.currentRoom,{messages:e.currentRoom.messages+1})),e[t.message.roomId]?Object(k.a)({},e,(a={},Object(q.a)(a,t.message.roomId,Object(k.a)({},e[t.message.roomId],{messages:[].concat(Object(K.a)(e[t.message.roomId].messages),[t.message])})),Object(q.a)(a,"rooms",e.rooms.map(function(e){return e._id===t.message.roomId?Object(k.a)({},e,{messages:e.messages+1}):e})),Object(q.a)(a,"currentRoom",n),a)):Object(k.a)({},e);case V.a.SEND_MESSAGE_SUCCESS:if(e[t.message.roomId]){var c,o=e.rooms.findIndex(function(e){return e._id===t.message.roomId}),E=e.rooms[o];return Object(k.a)({},e,(c={},Object(q.a)(c,t.message.roomId,Object(k.a)({},e[t.message.roomId],{messages:e[t.message.roomId].messages.map(function(e){return e.uuid===t.message.uuid?t.message:e})})),Object(q.a)(c,"rooms",[Object(k.a)({},E,{lastMessage:[t.message]})].concat(Object(K.a)(e.rooms.filter(function(e){return e._id!==t.message.roomId})))),c))}return Object(k.a)({},e);case V.a.NEW_MESSAGE:if(e[t.message.roomId]){var s,r=e.rooms.findIndex(function(e){return e._id===t.message.roomId}),S=e.rooms[r],i=e.currentRoom;return i&&e.currentRoom._id===t.message.roomId&&(i=Object(k.a)({},e.currentRoom,{messages:e.currentRoom.messages+1})),Object(k.a)({},e,(s={},Object(q.a)(s,t.message.roomId,Object(k.a)({},e[t.message.roomId],{messages:[].concat(Object(K.a)(e[t.message.roomId].messages),[t.message])})),Object(q.a)(s,"currentRoom",i),Object(q.a)(s,"rooms",[Object(k.a)({},S,{messages:S.messages+1,lastMessage:[t.message]})].concat(Object(K.a)(e.rooms.filter(function(e){return e._id!==t.message.roomId})))),s))}return Object(k.a)({},e);case V.a.READ_MESSAGES:return Object(k.a)({},e,Object(q.a)({},t.roomId,Object(k.a)({},e[t.roomId],{messages:e[t.roomId].messages.map(function(e){return t.messageIds.includes(e._id)?Object(k.a)({},e,{read:!0}):Object(k.a)({},e)})})));case V.a.CHANGE_ACTIVITY_STATUS:return Object(k.a)({},e,{rooms:e.rooms.map(function(e){return e.members[0]._id===t.user.user?(e.members[0].activityStatus=t.user.activityStatus,Object(k.a)({},e)):e.members[1]._id===t.user.user?(e.members[1].activityStatus=t.user.activityStatus,Object(k.a)({},e)):Object(k.a)({},e)})});case V.a.RECEIVE_READ_MESSAGES:return e[t.data.roomId]?Object(k.a)({},e,Object(q.a)({},t.data.roomId,Object(k.a)({},e[t.data.roomId],{messages:e[t.data.roomId].messages.map(function(e){return t.data.messageIds.includes(e._id)?Object(k.a)({},e,{read:!0}):Object(k.a)({},e)})}))):Object(k.a)({},e);case V.a.OPEN_CALLING_MODAL:return Object(k.a)({},e,{callingModal:!0});case V.a.CLOSE_CALLING_MODAL:return Object(k.a)({},e,{callingModal:!1});case V.a.OPEN_ANSWERING_MODAL:return Object(k.a)({},e,{answeringModal:Object(k.a)({},e.answeringModal,{isOpen:!0,webRtc:Object(k.a)({},e.webRtc,t.data.webRtc),caller:Object(k.a)({},e.caller,t.data.caller),room:Object(k.a)({},e.room,t.data.room)})});case V.a.CLOSE_ANSWERING_MODAL:return Object(k.a)({},e,{answeringModal:Object(k.a)({},e.answeringModal,{isOpen:!1,webRtc:{},caller:{},room:{}})});case V.a.SEARCH_USERS:return Object(k.a)({},e,{searchedRooms:t.rooms});default:return e}}}),ae=function(e,t){return t.type===Q.a.LOGOUT&&(e=void 0),te(e,t)},ne=[w.a],ce=Object(y.e)(ae,{},Object(y.d)(y.a.apply(void 0,ne))),oe=a(56);E.a.render(c.a.createElement(m.a,{store:ce},c.a.createElement(oe.a,null,c.a.createElement(v,null))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})},7:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={CHANGE_ROOM:"CHANGE_ROOM",INIT_MESSAGE_ARRAY:"INIT_MESSAGE_ARRAY",NEW_MESSAGE:"NEW_MESSAGE",READ_MESSAGES:"READ_MESSAGES",RECEIVE_READ_MESSAGES:"RECEIVE_READ_MESSAGES",CHANGE_ACTIVITY_STATUS:"CHANGE_ACTIVITY_STATUS",ADD_NEW_ROOM:"ADD_NEW_ROOM",INC_MESSAGE_COUNT:"INC_MESSAGE_COUNT",SEARCH_USERS:"SEARCH_USERS",OPEN_CALLING_MODAL:"OPEN_CALLING_MODAL",CLOSE_CALLING_MODAL:"CLOSE_CALLING_MODAL",NEW_ANSWER:"NEW_ANSWER",OPEN_ANSWERING_MODAL:"OPEN_ANSWERING_MODAL",CLOSE_ANSWERING_MODAL:"CLOSE_ANSWERING_MODAL",TYPING:"TYPING",STOPPED_TYPING:"STOPPED_TYPING",GET_ROOMS_REQUEST:"GET_ROOMS_REQUEST",GET_ROOMS_SUCCESS:"GET_ROOMS_SUCCESS",GET_MESSAGES_INITIAL_REQUEST:"GET_MESSAGES_INITIAL_REQUEST",GET_MESSAGES_REQUEST:"GET_MESSAGES_REQUEST",GET_MESSAGES_SUCCESS:"GET_MESSAGES_SUCCESS",SEND_MESSAGE_REQUEST:"SEND_MESSAGE_REQUEST",SEND_MESSAGE_SUCCESS:"SEND_MESSAGE_SUCCESS",NEW_IMAGE_MESSAGE_REQUEST:"NEW_IMAGE_MESSAGE_REQUEST",NEW_IMAGE_MESSAGE_SUCCESS:"NEW_IMAGE_MESSAGE_SUCCESS"}},8:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={POSTS_REQUEST:"POSTS_REQUEST",POSTS_SUCCESS:"POSTS_SUCCESS",POSTS_FAILURE:"POSTS_FAILURE",FETCH_COMMENTS_REQUEST:"FETCH_COMMENTS_REQUEST",FETCH_COMMENTS_SUCCESS:"FETCH_COMMENTS_SUCCESS",FETCH_COMMENTS_FAILURE:"FETCH_COMMENTS_FAILURE",POST_DELETE_REQUEST:"POSTS_DELETE_REQUEST",POST_DELETE_SUCCESS:"POSTS_DELETE_SUCCESS",POST_DELETE_FAILURE:"POSTS_DELETE_FAILURE",INIT_REPLY_COMMENT:"INIT_REPLY_COMMENT",ADD_REPLY_COMMENT_SUCCESS:"ADD_REPLY_COMMENT_SUCCESS",ADD_REPLY_COMMENT_FAILURE:"ADD_REPLY_COMMENT_FAILURE",FETCH_COMMENT_REPLIES_REQUEST:"FETCH_COMMENT_REPLIES_REQUEST",FETCH_COMMENT_REPLIES_SUCCESS:"FETCH_COMMENT_REPLIES_SUCCESS",FETCH_COMMENT_REPLIES_FAILURE:"FETCH_COMMENT_REPLIES_FAILURE",INCREASE_REPLIES_NUMBER:"INCREASE_REPLIES_NUMBER",ADD_COMMENT_REQUEST:"ADD_COMMENT_REQUEST",ADD_COMMENT_SUCCESS:"ADD_COMMENT_SUCCESS",ADD_COMMENT_FAILURE:"ADD_COMMENT_FAILURE",DISLIKE_COMMENT:"DISLIKE_COMMENT",LIKE_COMMENT:"LIKE_COMMENT",LIKE_COMMENT_REPLY:"LIKE_COMMENT_REPLY",DISLIKE_COMMENT_REPLY:"DISLIKE_COMMENT_REPLY",NEW_POST:"NEW_POST",GET_COMMENT_LIKES:"GET_COMMENT_LIKES",GET_COMMENT_REPLY_LIKES:"GET_COMMENT_REPLY_LIKES"}},9:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var n={TOGGLE_NOTIFICATION_POPUP:"TOGGLE_NOTIFICATION_POPUP",CLOSE_NOTIFICATION_POPUP:"CLOSE_NOTIFICATION_POPUP",ADD_NOTIFICATION:"ADD_NOTIFICATION",READ_NOTIFICATIOS:"READ_NOTIFICATIOS",FETCH_NOTIFICATIONS_REQUEST:"FETCH_NOTIFICATIONS_REQUEST",FETCH_NOTIFICATIONS_SUCCESS:"FETCH_NOTIFICATIONS_SUCCESS"}}},[[43,6,14]]]);