text: (this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{113:function(e,t,a){},114:function(e,t,a){},115:function(e,t,a){},117:function(e,t,a){},118:function(e,t,a){},119:function(e,t,a){},120:function(e,t,a){},121:function(e,t,a){},122:function(e,t,a){},123:function(e,t,a){},126:function(e,t,a){},127:function(e,t,a){},133:function(e,t,a){},134:function(e,t,a){},136:function(e,t,a){},137:function(e,t,a){},138:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),c=a(23),l=a.n(c),o=a(4),s=a(21),i=(a(85),a(24)),m=a(25),u=a(30),d=a(26),p=a(31),E=(a(86),a(87),function(e){return r.a.createElement("button",{className:"toggle-button",onClick:e.click},r.a.createElement("div",{className:"toggle-button_line"}),r.a.createElement("div",{className:"toggle-button_line"}),r.a.createElement("div",{className:"toggle-button_line"}))}),v=a(6),f=a(3),b=a.n(f),g=a(8),h=a.n(g),N=function(e){e?h.a.defaults.headers.common["x-auth-token"]=e:delete h.a.defaults.headers.common["x-auth-token"]},w=a(58),y=a.n(w),S=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3500;return function(n){var r=y.a.v4();n({type:"SHOW_ALERT",payload:{message:e,bgColor:t,id:r}}),setTimeout((function(){return n({type:"REMOVE_ALERT",payload:r})}),a)}},O=function(e){return function(t){var a;return b.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,b.a.awrap(h.a.get("/api/users/movies/".concat(e)));case 3:a=n.sent,t({type:"GET_WATCHED_MOVIES",payload:a.data}),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.log(n.t0);case 10:case"end":return n.stop()}}),null,null,[[0,7]])}},x=function(){return function(e){var t;return b.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return localStorage.token&&N(localStorage.token),a.prev=1,a.next=4,b.a.awrap(h.a.get("/api/auth"));case 4:t=a.sent,e({type:"USER_LOADED",payload:t.data}),e(O(t.data._id)),a.next=12;break;case 9:a.prev=9,a.t0=a.catch(1),e({type:"AUTH_ERROR"});case 12:case"end":return a.stop()}}),null,null,[[1,9]])}},k=function(){return function(e){e({type:"LOGOUT"}),e((function(e){return b.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:e({type:"CLEAR_WATCHED"});case 1:case"end":return t.stop()}}))})),localStorage.removeItem("token")}},j=Object(v.b)((function(e){return{auth:e.auth}}),{logout:k})((function(e){var t=e.auth,a=t.loading,n=t.isAuthenticated,c=t.user,l=e.drawerClickHandler,s=e.logout,i=!a&&null!==c&&c.username,m=r.a.createElement("ul",null,r.a.createElement("li",null,r.a.createElement(o.b,{to:"/profile/".concat(i)},"Profile")),r.a.createElement("li",null,r.a.createElement("a",{href:"#!",onClick:s},"Logout"))),u=r.a.createElement("ul",null,r.a.createElement("li",null,r.a.createElement(o.b,{to:"/login"},"Log in")),r.a.createElement("div",{className:"navbar_seperator"},"|"),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/register"},"Sign up")));return r.a.createElement("header",{className:"navbar"},r.a.createElement("nav",{className:"navbar_navigation"},r.a.createElement("div",{className:"navbar_toggle-button"},r.a.createElement(E,{click:l})),r.a.createElement("div",{className:"navbar_logo"},r.a.createElement(o.b,{to:"/"},"MyMovies")),r.a.createElement("div",{className:"navbar_navigation-items"},r.a.createElement("div",{className:"navbar_primary-links"},r.a.createElement("ul",null,r.a.createElement("li",null,r.a.createElement(o.b,{to:"/movies/browse/trending"},"Trending")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/movies/browse/popular"},"Popular")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/search"},"Search"))))),r.a.createElement("div",{className:"spacer"}),r.a.createElement("div",{className:"navbar_navigation-items"},!a&&(n?m:u))))})),R=(a(113),Object(v.b)((function(e){return{auth:e.auth}}),{logout:k})((function(e){var t=e.show,a=e.auth,n=a.loading,c=a.isAuthenticated,l=a.user,s=e.logout,i=["side-drawer"];t&&(i="side-drawer open");var m=!n&&null!==l&&l.username,u=r.a.createElement("div",{style:{marginBottom:"10%"}},r.a.createElement("li",null,r.a.createElement(o.b,{to:"/profile/".concat(m)},"Profile")),r.a.createElement("li",null,r.a.createElement("a",{href:"#!",onClick:s},"Logout"))),d=r.a.createElement("div",{style:{marginBottom:"10%"}},r.a.createElement("li",null,r.a.createElement(o.b,{to:"/login"},"Log in")),r.a.createElement("div",{className:"navbar_seperator"},"|"),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/register"},"Sign up")));return r.a.createElement("nav",{className:i},r.a.createElement("ul",null,!n&&(c?u:d),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/"},"Home")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/movies/browse/trending"},"Trending")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/movies/browse/popular"},"Popular")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/search"},"Search"))))}))),_=(a(114),function(e){return r.a.createElement("div",{className:"backdrop",onClick:e.click})}),C=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return(a=Object(u.a)(this,(e=Object(d.a)(t)).call.apply(e,[this].concat(r)))).state={SideDrawerOpen:!1},a.drawerToggleClickHandler=function(){a.setState((function(e){return{SideDrawerOpen:!e.SideDrawerOpen}}))},a.backdropClickHandler=function(){a.setState({SideDrawerOpen:!1})},a}return Object(p.a)(t,e),Object(m.a)(t,[{key:"render",value:function(){var e;return this.state.SideDrawerOpen&&(e=r.a.createElement(_,{click:this.backdropClickHandler})),r.a.createElement("div",null,r.a.createElement(j,{drawerClickHandler:this.drawerToggleClickHandler}),r.a.createElement(R,{show:this.state.SideDrawerOpen}),e)}}]),t}(r.a.Component),A=(a(115),function(e){function t(){return Object(i.a)(this,t),Object(u.a)(this,Object(d.a)(t).apply(this,arguments))}return Object(p.a)(t,e),Object(m.a)(t,[{key:"render",value:function(){return r.a.createElement("footer",{className:"footer mt-5"},r.a.createElement("div",{className:"footer-middle"},r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-md-3 col-sm-6"},r.a.createElement("h4",null,"Movies"),r.a.createElement("ul",{className:"list-unstyled"},r.a.createElement("li",null,r.a.createElement(o.b,{to:"/movies/browse/trending"},"Trending")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/movies/browse/popular"},"Popular")))),r.a.createElement("div",{className:"col-md-3 col-sm-6"},r.a.createElement("h4",null,"Profile"),r.a.createElement("ul",{className:"list-unstyled"},r.a.createElement("li",null,r.a.createElement(o.b,{to:"/"},"Search users or movies")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/login"},"Log in")),r.a.createElement("li",null,r.a.createElement(o.b,{to:"/register"},"Register"))))),r.a.createElement("div",{className:"footer-bottom"},r.a.createElement("p",{className:"text-xs-center"},"\xa9 2020 MyMovies - All Rights Reserved")))))}}]),t}(r.a.Component)),T=(a(116),a(117),function(e){var t=e.link,a=e.image,n=e.title,c=e.text,l=Object(s.g)();return r.a.createElement("div",{style:{cursor:"pointer"},onClick:function(){l.push(t)},className:"card mb-3 grow-wide"},r.a.createElement("img",{className:"card-img-top",src:a,alt:n}),r.a.createElement("div",{className:"card-body"},r.a.createElement("h5",{className:"card-title"},n),r.a.createElement("p",{className:"card-text"},c)))}),I=a(60),M=a.n(I),W=a(61),P=a.n(W),V=(a(118),function(e){function t(){return Object(i.a)(this,t),Object(u.a)(this,Object(d.a)(t).apply(this,arguments))}return Object(p.a)(t,e),Object(m.a)(t,[{key:"render",value:function(){return r.a.createElement("div",{className:"container faq-container"},r.a.createElement("div",{className:"faq-container__title text-center mb-5"},r.a.createElement("h2",null,"Frequently Asked Questions")),r.a.createElement("div",{className:"faq-container__main-text mt-3"},r.a.createElement("div",null,r.a.createElement("h3",null,"How does the Taste App work?"),r.a.createElement("p",null,"Ever met someone with a frighteningly similar taste? We discovered that this is often the best person to suggest something you might like. Your recommendations on Taste come from the collective souls of people who are extremely similar to you.")),r.a.createElement("div",null,r.a.createElement("h3",null,"How is it different from other review platforms?"),r.a.createElement("p",null,"Most review platforms are generic (two people see the same ratings and reviews). Taste is the leading movie and TV app that personalizes ratings and reviews based on your taste. Unlike Rotten Tomatoes, IMDB, Metacritic, and Fandango, Taste is gender-neutral and has no commercial bias.")),r.a.createElement("div",null,r.a.createElement("h3",null,"What algorithm do you use? And what exactly does the Match% mean?"),r.a.createElement("p",null,"Taste uses several collaborative filtering algorithms\u2014it\u2019s a lot like asking the top 1% of the world most similar to you to suggest what to watch. The Match% you see for each movie and show measures how much (and how much more compared to the average Joe) you would enjoyed a movie. It also factors in recency, serendipity, and rarity to help you discover the not-so-obvious recommendations.")),r.a.createElement("div",null,r.a.createElement("h3",null,"Where can I get the app?"),r.a.createElement("p",null,"The Taste App is available in the iTunes App Store, Google Play Store, or you can login directly using a web browser."))))}}]),t}(r.a.Component)),U=Object(s.h)((function(){return r.a.createElement(n.Fragment,null,r.a.createElement("div",{className:"main-banner_container text-center mb-5"},r.a.createElement("h1",null,"MyMovies")),r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-lg-6 col-12"},r.a.createElement(T,{link:"/movies/browse/trending",image:M.a,title:"Trending Movies",text:"The daily trending movies on TMDb"})),r.a.createElement("div",{className:"col-lg-6 col-12"},r.a.createElement(T,{link:"/movies/browse/popular",image:P.a,title:"Popular Movies",text:"List of the current popular movies on TMDb"}))),r.a.createElement(V,null))})),H=a(20),D=a(62),L=a(63),F=a(38),Y=a(7),z={loading:!0,movies:[],error:"",movie:null,reviews:[],isFetching:!1,users:[]},G={token:localStorage.getItem("token"),isAuthenticated:null,loading:!0,user:null,errors:[]},B=[],X={loading:!0,profile:{},errors:[],watched:[]},Z={loading:!0,watched:[],errors:[]},q=Object(H.combineReducers)({movies:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z,t=arguments.length>1?arguments[1]:void 0,a=t.type,n=t.payload,r=t.el_id;switch(a){case"SUCCESS_SEARCH_MOVIES":case"SUCCESS_MOVIES_TRENDING":return Object(Y.a)({},e,{movies:n,loading:!1,isFetching:!1});case"REQUEST_SEARCH_USERS":case"REQUEST_SEARCH_MOVIES":case"REQUEST_MOVIES_TRENDING":return Object(Y.a)({},e,{isFetching:!0});case"ERROR_SEARCH_USERS":case"ERROR_SEARCH_MOVIES":case"ERROR_MOVIES_TRENDING":return{isFetching:!1,error:n};case"SUCCESS_SEARCH_USERS":return Object(Y.a)({},e,{users:n,loading:!1,isFetching:!1});case"GET_MOVIE_DATA":return Object(Y.a)({},e,{movie:n,loading:!1,isFetching:!1});case"CLEAR_STATE":return Object(Y.a)({},e,{loading:!0,movies:[],movie:null});case"ADD_REVIEW":return Object(Y.a)({},e,{loading:!1,reviews:[n].concat(Object(F.a)(e.reviews))});case"GET_REVIEWS":return Object(Y.a)({},e,{loading:!1,reviews:n});case"LIKE_REVIEW":return Object(Y.a)({},e,{reviews:e.reviews.map((function(e){return e._id===r?Object(Y.a)({},e,{likes:n}):e}))});default:return e}},auth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G,t=arguments.length>1?arguments[1]:void 0,a=t.type,n=t.payload;switch(a){case"USER_LOADED":return Object(Y.a)({},e,{isAuthenticated:!0,loading:!1,user:n});case"LOGIN_SUCCESS":case"REGISTER_SUCCESS":return localStorage.setItem("token",n.token),Object(Y.a)({},e,{},n,{isAuthenticated:!0,loading:!1});case"LOGIN_FAIL":case"REGISTER_FAIL":return localStorage.removeItem("token"),Object(Y.a)({},e,{token:null,isAuthenticated:!1,loading:!1,errors:n});case"LOGOUT":case"AUTH_ERROR":return Object(Y.a)({},e,{token:null,isAuthenticated:!1,loading:!1,user:null,errors:[]});default:return e}},alert:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0,a=t.type,n=t.payload;switch(a){case"SHOW_ALERT":return[].concat(Object(F.a)(e),[n]);case"REMOVE_ALERT":return e.filter((function(e){return e.id!==n}));default:return e}},profiles:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X,t=arguments.length>1?arguments[1]:void 0,a=t.type,n=t.payload;switch(a){case"GET_PROFILE":return Object(Y.a)({},e,{profile:n,loading:!1});case"GET_PROFILE_WATCHED_MOVIES":return Object(Y.a)({},e,{watched:n});default:return e}},watched:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z,t=arguments.length>1?arguments[1]:void 0,a=t.type,n=t.payload;switch(a){case"GET_WATCHED_MOVIES":return Object(Y.a)({},e,{loading:!1,watched:n});case"ADD_WATCHED_MOVIE":return Object(Y.a)({},e,{loading:!1});case"CLEAR_WATCHED":return{loading:!1,watched:[],errors:[]};default:return e}}}),K=[L.a],Q=Object(H.createStore)(q,{},Object(D.composeWithDevTools)(H.applyMiddleware.apply(void 0,K))),J=function(e,t){return{type:t,payload:e}},$=function(e,t){return{type:t,payload:e}},ee=function(){return function(e){return b.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:e({type:"CLEAR_STATE"});case 1:case"end":return t.stop()}}))}},te="https://image.tmdb.org/t/p/",ae=(a(119),a(34)),ne=a.n(ae),re="",ce=function(e){var t=e.id,a=e.title,n=e.poster_path;return re=null!=n?te+"w500"+n:ne.a,r.a.createElement(o.b,{style:{color:"black",textDecoration:"none"},to:"/movies/"+t},r.a.createElement("div",{className:"poster-wrapper text-center"},r.a.createElement("img",{alt:a,width:"150px",src:re}),r.a.createElement("p",null,a)))},le=(a(120),function(e){var t=e.page,a=e.total_pages,n=e.callBackPageNumber;return r.a.createElement("div",{className:"d-inline-flex"},r.a.createElement("ul",{className:"pagination pagination-lg"},r.a.createElement("li",{className:"page-item "+(1===t&&"disabled")},r.a.createElement("button",{onClick:function(){var e;1!==(e=t)&&n(e-1)},className:"page-link","aria-label":"Previous"},r.a.createElement("span",{"aria-hidden":"true"},"\xab"),r.a.createElement("span",{className:"sr-only"},"Previous"))),r.a.createElement("li",{className:"page-item"},r.a.createElement("button",{className:"page-link"},t)),r.a.createElement("li",{className:"page-item "+(t+1>a&&"disabled")},r.a.createElement("button",{onClick:function(){var e;(e=t)+1<=a&&n(e+1)},className:"page-link","aria-label":"Next"},r.a.createElement("span",{"aria-hidden":"true"},"\xbb"),r.a.createElement("span",{className:"sr-only"},"Next")))))}),oe=a(64),se=a.n(oe);var ie=function(e){var t=e.width;return r.a.createElement(n.Fragment,null,r.a.createElement("img",{width:t,src:se.a,alt:"loading..."}))},me=Object(v.b)((function(e){return{movies:e.movies}}),{getTrendingMovies:function(e){return function(t){return b.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t({type:"REQUEST_SEARCH_MOVIES"}),a.next=3,b.a.awrap(h.a.get("/api/movies/trending/movies?page=".concat(e)).then((function(e){t(J(e.data,"SUCCESS_MOVIES_TRENDING"))})).catch((function(e){t($(e.message,"ERROR_MOVIES_TRENDING"))})));case 3:case"end":return a.stop()}}))}},clearState:ee})((function(e){var t=e.getTrendingMovies,a=e.movies,c=a.movies,l=a.isFetching,o=e.clearState;Object(n.useEffect)((function(){return t(1),function(){o()}}),[t,o]);return r.a.createElement("section",{className:"browse-container"},r.a.createElement("div",{className:"browse_summary-container text-center"},r.a.createElement("h1",null,"Trending Movies")),r.a.createElement("div",{className:"browse_movies-container mt-5"},l||0===c.length?r.a.createElement("div",{className:"text-center"},r.a.createElement(ie,{width:"300px"})):r.a.createElement("div",{className:"browse_movies-container_inner"},r.a.createElement("div",{className:"row justify-content-start"},c.results.map((function(e){return r.a.createElement("div",{key:e.id,className:"col-4 col-md-3 col-lg-2dot4"},r.a.createElement(ce,{title:e.title,id:e.id,poster_path:e.poster_path}))}))),r.a.createElement("div",{className:"pagination-outer text-center"},r.a.createElement(le,{callBackPageNumber:function(e){window.scrollTo(0,0),t(e)},page:c.page,total_pages:c.total_pages})))))})),ue=a(10),de=(a(121),a(122),function(e){var t=e.backdrop_path,a=e.setShowVideo,n=e.showVideo,c=e.YoutubeVideoKey,l=r.a.createElement("iframe",{title:"video",width:"100%",height:"100%",src:"https://www.youtube.com/embed/".concat(c),frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),o=r.a.createElement("div",{className:"player-overlay",style:{backgroundSize:"cover",backgroundImage:"url(".concat("https://image.tmdb.org/t/p/w1280").concat(t,")")}},r.a.createElement("div",{className:"overlay d-flex flex-row justify-content-center align-items-center"},r.a.createElement("div",{onClick:function(){return a(!0)},className:"play"})));return r.a.createElement("div",{className:"video-outer"},n?l:o)}),pe=(a(123),function(e){var t=e.credits,a=t.cast,n=t.crew,c=e.release,l=e.runtime,o={Director:"",main_cast:""};return n.forEach((function(e){o[e.job]+=e.name})),o.main_cast=a.slice(0,15).map((function(e){return e.name})).join(", "),r.a.createElement("div",null,r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-12"},r.a.createElement("b",null,"Director: "),o.Director),r.a.createElement("div",{className:"col-12"},r.a.createElement("b",null,"Runtime: "),"".concat(l,"min")),r.a.createElement("div",{className:"col-12"},r.a.createElement("b",null,"Release Date: "),c),r.a.createElement("div",{className:"col-12"},r.a.createElement("b",null,"Main Cast: "),o.main_cast)))}),Ee=a(65),ve=a.n(Ee),fe=function(e){var t=e.release_date,a=e.genres,n=e.overview;return r.a.createElement("div",null,r.a.createElement("h5",null,r.a.createElement(ve.a,{format:"YYYY"},t)," |"," ",a.map((function(e){return e.name})).join(", ")),r.a.createElement("p",null,n))},be=function(e){var t=e.vote_average,a=e.vote_count;return r.a.createElement("div",null,r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-12"},r.a.createElement("b",null,"IMDB Score: "),t," (",a,")")))},ge=(a(126),"none"),he=Object(v.b)(null,{postWatchedMovie:function(e,t,a,n,r,c){return function(l){var o,s;return b.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,o={headers:{"Content-Type":"application/json"}},s=JSON.stringify({user_id:e,movie_id:t,rate:a,title:n,poster_path:r,genres:c}),i.next=5,b.a.awrap(h.a.post("/api/users/movies",s,o));case 5:l({type:"ADD_WATCHED_MOVIE"}),l(O(e)),l(S("Successfully added movie to watched list!","success")),i.next=14;break;case 10:i.prev=10,i.t0=i.catch(0),l(S("There was an error adding movie to the list!","danger")),console.log(i.t0);case 14:case"end":return i.stop()}}),null,null,[[0,10]])}}})((function(e){var t=e.poster,a=e.defaultShow,c=e.setShowModal,l=e.user_id,o=e.movie_id,s=e.postWatchedMovie,i=e.title,m=e.poster_path,u=e.genres;ge=a?"block":"none";var d=function(e){s(l,o,e,i,m,u);try{c(!1)}catch(t){console.log(t)}};return r.a.createElement(n.Fragment,null,r.a.createElement("div",{className:"rate-movie_container"},r.a.createElement("div",{style:{display:"".concat(ge)},className:"modal-container"},r.a.createElement("button",{onClick:function(){c(!a)},type:"button",className:"close","aria-label":"Close"},r.a.createElement("span",{style:{fontSize:"2em"},className:"text-white","aria-hidden":"true"},"\xd7")),r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"card-container card-container_extra"},r.a.createElement("div",{style:{backgroundImage:"url(".concat(te+"w500"+t,")")},className:"card m-auto card-custom"}),r.a.createElement("div",{className:"modal-buttons_container"},r.a.createElement("div",{className:"row no-gutters"},r.a.createElement("div",{className:"col-lg-3 col-md-3 col-6"},r.a.createElement("button",{onClick:function(){d(1)},className:"btn btn-secondary btn-square btn-block"},"Bad")),r.a.createElement("div",{className:"col-lg-3 col-md-3 col-6"},r.a.createElement("button",{onClick:function(){d(2)},className:"btn btn-warning btn-square btn-block"},"Average")),r.a.createElement("div",{className:"col-lg-3 col-md-3 col-6"},r.a.createElement("button",{onClick:function(){d(4)},className:"btn btn-primary btn-square btn-block"},"Good")),r.a.createElement("div",{className:"col-lg-3 col-md-3 col-6"},r.a.createElement("button",{onClick:function(){d(5)},className:"btn btn-success btn-square btn-block"},"Perfect")))))))))})),Ne=a(28),we=a.n(Ne),ye=a(66),Se=a.n(ye),Oe=function(e){var t=e.username,a=e.rate,n=e.avatar,c=e.likes,l=e.comment,o=e.handleLikeSubmit,s=e.id;return r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-12 review-avatar"},r.a.createElement("img",{className:"rounded-circle  mr-2",width:"35px",alt:"avatar",src:n}),r.a.createElement("div",{className:"d-inline-block align-bottom"},r.a.createElement("div",null,t),r.a.createElement("div",null,a))),r.a.createElement("div",{className:"col-12 p-3 review-comment"},r.a.createElement("p",null,l)),r.a.createElement("div",{className:"col-12 d-flex"},r.a.createElement("div",null,r.a.createElement("div",{className:"media"},r.a.createElement("span",{className:"media-left mr-2"},r.a.createElement("img",{onClick:function(){return o(s)},src:Se.a,alt:"like",width:"15px",style:{cursor:"pointer"}})),r.a.createElement("div",{className:"media-body"},r.a.createElement("p",{style:{fontSize:"15px"}},c.length))))))},xe=function(e){var t=e.setComment,a=e.comment,n=e.handleSubmitReview;return r.a.createElement("div",{className:"mb-2 border-bottom"},r.a.createElement("textarea",{onChange:function(e){return t(e.target.value)},className:"form-control w-100",name:"comment",id:"commentPanel",rows:"4",value:a}),r.a.createElement("div",{className:"text-right"},r.a.createElement("button",{onClick:function(){return n()},className:"mb-2 mt-2 btn btn-success btn-sm"},"Submit")))},ke=Object(v.b)((function(e){return{movie:e.movies,user:e.auth.user,watched:e.watched}}),{getMovie:function(e,t){return function(a){var n;return b.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,b.a.awrap(h.a.get("/api/movies/movie/".concat(e).concat(t)));case 3:n=r.sent,a({type:"GET_MOVIE_DATA",payload:n.data}),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.log(r.t0);case 10:case"end":return r.stop()}}),null,null,[[0,7]])}},postReview:function(e,t,a){return function(n){var r,c,l;return b.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,r={headers:{"Content-Type":"application/json"}},5,c=JSON.stringify({username:t,movie_id:a,rate:5,comment:e}),o.next=6,b.a.awrap(h.a.post("/api/users/movies/".concat(a,"/review"),c,r));case 6:l=o.sent,n({type:"ADD_REVIEW",payload:l.data}),n(S("Successfully added review!","success")),o.next=15;break;case 11:o.prev=11,o.t0=o.catch(0),n(S("There was an error adding review!","danger")),console.log(o.t0);case 15:case"end":return o.stop()}}),null,null,[[0,11]])}},getReviews:function(e){return function(t){var a;return b.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,b.a.awrap(h.a.get("/api/users/movies/".concat(e,"/review")));case 3:a=n.sent,t({type:"GET_REVIEWS",payload:a.data}),n.next=11;break;case 7:n.prev=7,n.t0=n.catch(0),t(S("Error while getting the reviews :/!","danger")),console.log(n.t0);case 11:case"end":return n.stop()}}),null,null,[[0,7]])}},likeUnlikeReview:function(e,t){return function(a){var n,r,c;return b.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,n={headers:{"Content-Type":"application/json"}},r=JSON.stringify({user_id:t}),l.next=5,b.a.awrap(h.a.put("/api/users/movies/review/likes/".concat(e),r,n));case 5:c=l.sent,a({type:"LIKE_REVIEW",payload:c.data.likes,el_id:e}),l.next=13;break;case 9:l.prev=9,l.t0=l.catch(0),a(S("Error while updating likes :/","danger")),console.log(l.t0);case 13:case"end":return l.stop()}}),null,null,[[0,9]])}},clearState:ee})((function(e){var t=e.getMovie,a=e.movie,c=a.loading,l=a.movie,o=a.reviews,s=e.match,i=e.user,m=e.watched,u=e.postReview,d=e.getReviews,p=e.likeUnlikeReview,E=e.clearState;Object(n.useEffect)((function(){return t(s.params.id,"?append_to_response=videos,credits"),d(s.params.id),function(){E()}}),[t,d,s.params.id,E]);var v=function(e){p(e,i._id)},f=Object(n.useState)(!1),b=Object(ue.a)(f,2),g=b[0],h=b[1],N=Object(n.useState)(""),w=Object(ue.a)(N,2),y=w[0],S=w[1],O=Object(n.useState)(!1),x=Object(ue.a)(O,2),k=x[0],j=x[1],R=Object(n.useState)(!1),_=Object(ue.a)(R,2),C=_[0],A=_[1];return r.a.createElement(n.Fragment,null,c||null===l?r.a.createElement("div",{className:"text-center"},r.a.createElement(ie,{width:"300px"})):r.a.createElement("div",null,r.a.createElement("section",{className:"video-container",style:k?{height:"500px"}:{height:"350px"}},r.a.createElement(de,{backdrop_path:l.backdrop_path,showVideo:k,setShowVideo:j,YoutubeVideoKey:0===l.videos.results.length?null:l.videos.results[0].key})),r.a.createElement("div",{className:"card card-body card-custom-vid rounded-bottom mb-4"},r.a.createElement("div",{className:"row m-1"},r.a.createElement("div",{className:"col-8 name_tag-inner"},l.title),r.a.createElement("div",{className:"col-4 text-right"},null!==i&&r.a.createElement("span",null,m.watched.find((function(e){return e.movie_id===l.id}))?r.a.createElement("div",null,"Watched and rated"):r.a.createElement("button",{onClick:function(){A(!C)},className:"btn btn-primary"},"Seen"))))),r.a.createElement("div",{className:"movie-info_container"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"movie-info_left col-lg-4 col-md-5 col-12"},r.a.createElement("div",null,r.a.createElement("img",{alt:l.title,width:"100%",src:null===l.poster_path?ne.a:te+"w500"+l.poster_path}))),r.a.createElement("div",{className:"movie-info_right mt-lg-0 mt-md-0 mt-3 col-lg-8 col-md-7 col-12"},r.a.createElement("div",{className:"card card-body mb-3"},r.a.createElement(fe,{overview:l.overview,genres:l.genres,release_date:l.release_date})),r.a.createElement("div",{className:"card card-body mb-3"},r.a.createElement(pe,{release:l.release_date,runtime:l.runtime,credits:l.credits,overview:l.overview})),r.a.createElement("div",{className:"card card-body"},r.a.createElement(be,{vote_average:l.vote_average,vote_count:l.vote_count})),r.a.createElement("div",{className:"card mt-3"},r.a.createElement("div",{className:"card-header"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-6"},"Reviews"),r.a.createElement("div",{className:"col-6 text-right"},null!==i&&r.a.createElement("button",{onClick:function(){return h(!g)},className:"btn btn-small btn-primary"},"Write review")))),r.a.createElement("div",{className:"card-body"},r.a.createElement("div",{className:"row"},g?r.a.createElement("div",{className:"col-12"},r.a.createElement(xe,{setComment:S,comment:y,handleSubmitReview:function(){""!==y&&(u(y,i.username,l.id),S(""),h(!1))}})):"",0!==o.length?o.map((function(e,t){return r.a.createElement("div",{key:t,className:"col-12 mb-1 "+(t===o.length-1?"":"border-bottom")},r.a.createElement(Oe,{username:e.username,rate:e.rate,avatar:we.a,comment:e.comment,likes:e.likes,handleLikeSubmit:v,id:e._id}))})):r.a.createElement("div",{className:"col-12"},"No reviews"))))))),null!==i&&r.a.createElement("div",null,r.a.createElement(he,{setShowModal:A,defaultShow:C,poster:null===l.paster_path?ne.a:l.poster_path,user_id:i._id,movie_id:l.id,title:l.title,poster_path:l.poster_path,genres:l.genres}))))})),je=(a(127),a(67)),Re=a(68),_e=a(140),Ce=function(e){var t=e.search,a=e.loading,n=e.dropdownState,c=e.setDropdownState,l=e.ddOptions,o=0;return r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-lg-10 col-7"},r.a.createElement("div",{className:"form-group has-search"},r.a.createElement("span",{className:"form-control-feedback"},a?r.a.createElement(ie,{width:"35px"}):r.a.createElement(je.a,{className:"form-conrtrol-feddback",icon:Re.a})),r.a.createElement("input",{onKeyPress:function(e){return"Enter"===e.key&&void(""!==(a=e.target.value)&&(clearTimeout(o),t(a,n)));var a},onChange:function(e){var a;""!==(a=e.target.value)&&(o&&clearTimeout(o),o=setTimeout((function(){t(a,n)}),1300))},type:"text",className:"form-control",placeholder:"Search"}))),r.a.createElement("div",{className:"col-lg-2 col-5"},r.a.createElement(_e.a,null,r.a.createElement(_e.a.Toggle,{variant:"secondary",id:"dropdown-basic"},"Search By ",n),r.a.createElement(_e.a.Menu,null,l.map((function(e,t){return r.a.createElement(_e.a.Item,{key:t,onClick:function(){return c(e)}},e)}))))))},Ae=function(e){var t=e.name,a=e.date,n=Object(s.g)();return r.a.createElement("div",{onClick:function(){n.push("/profile/".concat(t))},className:"card card-body user-search_card"},r.a.createElement("img",{alt:"user-profile-avatar",src:we.a,width:"80px"}),r.a.createElement("p",{className:"ml-3"},r.a.createElement("b",null,"Username:")," ",t),r.a.createElement("p",{className:"ml-3"},r.a.createElement("b",null,"Date joined:")," ",a.slice(0,10)))},Te=(a(133),""),Ie=["Movies","Users"],Me=Object(v.b)((function(e){return{movies:e.movies}}),{searchMovie:function(e,t){return function(a){var n;return b.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return a({type:"REQUEST_SEARCH_MOVIES"}),n="?searchQuery=".concat(e,"&page=").concat(t),r.next=4,b.a.awrap(h.a.get("/api/movies/search".concat(n)).then((function(e){a(J(e.data,"SUCCESS_SEARCH_MOVIES"))})).catch((function(e){a($(e.message,"ERROR_SEARCH_MOVIES"))})));case 4:case"end":return r.stop()}}))}},searchUsers:function(e){return function(t){return b.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t({type:"REQUEST_SEARCH_MOVIES"}),a.next=3,b.a.awrap(h.a.get("/api/users/search/users/".concat(e)).then((function(e){t(J(e.data,"SUCCESS_SEARCH_USERS"))})).catch((function(e){t($(e.message,"ERROR_SEARCH_USERS"))})));case 3:case"end":return a.stop()}}))}},clearState:ee})((function(e){var t=e.searchMovie,a=e.searchUsers,c=e.clearState,l=e.movies,o=l.isFetching,s=l.loading,i=l.movies,m=i.page,u=i.total_pages,d=i.results,p=l.users;Object(n.useEffect)((function(){return function(){c()}}),[c]);var E=Object(n.useState)(Ie[0]),v=Object(ue.a)(E,2),f=v[0],b=v[1];return r.a.createElement(n.Fragment,null,r.a.createElement(Ce,{search:function(e,n){"Movies"===n?(Te=e,t(e,1)):a(e)},loading:o,dropdownState:f,setDropdownState:b,ddOptions:Ie}),r.a.createElement("div",{className:"search-movie_container"},f===Ie[0]?s||void 0===d?r.a.createElement(n.Fragment,null):0===d.length?r.a.createElement("div",null,"No results found"):r.a.createElement("div",{className:"search-movie_container-inner"},r.a.createElement("div",{className:"row justify-content-start"},d.map((function(e){return r.a.createElement("div",{key:e.id,className:"col-4 col-md-3 col-lg-2dot4"},r.a.createElement(ce,{id:e.id,title:e.title,poster_path:e.poster_path}))}))),r.a.createElement("div",{className:"pagination-outer text-center"},r.a.createElement(le,{callBackPageNumber:function(e){t(Te,e)},page:m,total_pages:u,getTrendingMovies:t}))):p&&r.a.createElement("div",{className:"search-movie_container-inner"},p.map((function(e,t){return r.a.createElement("div",{key:t,className:"col-12 pl-0 pr-0 mb-3"},r.a.createElement(Ae,{name:e.username,date:e.date}))})))))})),We=a(27),Pe=Object(v.b)((function(e){return{isAuthenticated:e.auth.isAuthenticated,errors:e.auth.errors}}),{login:function(e,t){return function(a){var n,r,c,l;return b.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return n={headers:{"Content-Type":"application/json"}},r=JSON.stringify({email:e,password:t}),o.prev=2,o.next=5,b.a.awrap(h.a.post("/api/auth",r,n));case 5:c=o.sent,a({type:"LOGIN_SUCCESS",payload:c.data}),a(x()),a(S("Successfully logged in!","success")),o.next=15;break;case 11:o.prev=11,o.t0=o.catch(2),l=o.t0.response.data.errors,a({type:"LOGIN_FAIL",payload:l});case 15:case"end":return o.stop()}}),null,null,[[2,11]])}}})((function(e){var t=e.isAuthenticated,a=e.login,c=e.errors,l=Object(n.useState)({email:"",password:""}),o=Object(ue.a)(l,2),i=o[0],m=o[1],u=i.email,d=i.password,p=function(e){return m(Object(Y.a)({},i,Object(We.a)({},e.target.name,e.target.value)))};return t?r.a.createElement(s.a,{to:"/"}):r.a.createElement("div",{className:"card p-0 col-lg-6 col-md-10 col m-auto"},r.a.createElement("div",{className:"card-header"},"Log in"),r.a.createElement("ul",{className:"list-group list-group-flush"},!1===t&&null!==c&&c.map((function(e,t){return r.a.createElement("li",{key:t,className:"list-group-item bg-danger"},e.msg)}))),r.a.createElement("div",{className:"card-body"},r.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault(),a(u,d)}(e)}},r.a.createElement("div",{className:"form-group"},r.a.createElement("label",null,"Email Address"),r.a.createElement("input",{type:"email",name:"email",id:"email",className:"form-control",placeholder:"Email Adress",value:u,onChange:function(e){return p(e)}}),r.a.createElement("div",{className:"invalid-feedback"},"Please enter valid email")),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",null,"Password"),r.a.createElement("input",{type:"password",name:"password",id:"password",className:"form-control",placeholder:"Password",autoComplete:"off",value:d,onChange:function(e){return p(e)}}),r.a.createElement("div",{className:"invalid-feedback"},"Please enter password")),r.a.createElement("div",{className:"button-container text-center"},r.a.createElement("button",{type:"submit",className:"btn btn-block btn-success"},"Log in")))))})),Ve=a(79),Ue=Object(v.b)((function(e){return{auth:e.auth}}))((function(e){var t=e.component,a=e.auth,n=a.isAuthenticated,c=a.loading,l=Object(Ve.a)(e,["component","auth"]);return r.a.createElement(s.b,Object.assign({},l,{render:function(e){return n||c?r.a.createElement(t,e):r.a.createElement(s.a,{to:"/login"})}}))})),He=Object(v.b)((function(e){return{isAuthenticated:e.auth.isAuthenticated,errors:e.auth.errors}}),{register:function(e,t,a){return function(n){var r,c,l,o;return b.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return r={headers:{"Content-Type":"application/json"}},c=JSON.stringify({email:e,username:t,password:a}),s.prev=2,s.next=5,b.a.awrap(h.a.post("/api/users",c,r));case 5:l=s.sent,n({type:"REGISTER_SUCCESS",payload:l.data}),n(x()),s.next=14;break;case 10:s.prev=10,s.t0=s.catch(2),o=s.t0.response.data.errors,n({type:"REGISTER_FAIL",payload:o});case 14:case"end":return s.stop()}}),null,null,[[2,10]])}}})((function(e){var t=e.isAuthenticated,a=e.register,c=e.errors,l=Object(n.useState)({email:"",username:"",password:"",password2:""}),o=Object(ue.a)(l,2),i=o[0],m=o[1],u=Object(n.useState)(!0),d=Object(ue.a)(u,2),p=d[0],E=d[1],v=i.email,f=i.username,b=i.password,g=i.password2,h=function(e){return m(Object(Y.a)({},i,Object(We.a)({},e.target.name,e.target.value)))};return t?r.a.createElement(s.a,{to:"/"}):r.a.createElement("div",{className:"card p-0 col-lg-6 col-md-10 col m-auto"},r.a.createElement("div",{className:"card-header"},"Register"),r.a.createElement("ul",{className:"list-group list-group-flush"},!1===t&&c.map((function(e,t){return r.a.createElement("li",{key:t,className:"list-group-item bg-danger"},e.msg)})),!p&&r.a.createElement("li",{className:"list-group-item bg-danger"},"Passwords do not match")),r.a.createElement("div",{className:"card-body"},r.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault(),b===g?a(v,f,b):E(!1)}(e)}},r.a.createElement("div",{className:"form-group"},r.a.createElement("label",null,"Email Address"),r.a.createElement("input",{type:"email",name:"email",id:"email",className:"form-control",placeholder:"Email Adress",value:v,onChange:function(e){return h(e)},required:!0}),r.a.createElement("div",{className:"invalid-feedback"},"Please enter valid email")),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",null,"Username"),r.a.createElement("input",{type:"text",name:"username",id:"username",className:"form-control",placeholder:"Username",value:f,onChange:function(e){return h(e)},required:!0}),r.a.createElement("div",{className:"invalid-feedback"},"Please enter valid Username")),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",null,"Password"),r.a.createElement("input",{type:"password",name:"password",id:"password",className:"form-control",placeholder:"Password",autoComplete:"off",minLength:"6",value:b,onChange:function(e){return h(e)},required:!0}),r.a.createElement("div",{className:"invalid-feedback"},"Please enter password")),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",null,"Repeat password"),r.a.createElement("input",{type:"password",name:"password2",id:"password2",className:"form-control",placeholder:"Repeat password",autoComplete:"off",minLength:"6",value:g,onChange:function(e){return h(e)}}),r.a.createElement("div",{className:"invalid-feedback"},"Please enter password")),r.a.createElement("div",{className:"button-container text-center"},r.a.createElement("button",{type:"submit",className:"btn btn-block btn-success"},"Register")))))})),De=Object(v.b)((function(e){return{alerts:e.alert}}))((function(e){var t=e.alerts;return null!==t&&t.length>0&&t.map((function(e){return r.a.createElement("div",{key:e.id,style:{boxShadow:"0 2px 4px 1px grey"},className:"conatainer-fluid p-2 text-center bg-".concat(e.bgColor,"  text-light")},e.message)}))})),Le=function(e){return function(t){var a;return b.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,b.a.awrap(h.a.get("/api/users/movies/".concat(e)));case 3:a=n.sent,t({type:"GET_PROFILE_WATCHED_MOVIES",payload:a.data}),n.next=9;break;case 7:n.prev=7,n.t0=n.catch(0);case 9:case"end":return n.stop()}}),null,null,[[0,7]])}},Fe=function(e){var t=e.avatar,a=e.email,c=e.username,l=e.likesText;return r.a.createElement(n.Fragment,null,r.a.createElement("div",{className:"profile-avatar mt-auto"},r.a.createElement("img",{width:"100",src:t,alt:"profile-avatar"})),r.a.createElement("div",{className:"profile-info-text_container ml-3"},r.a.createElement("div",{className:"profile-email"},r.a.createElement("p",{className:"m-0"},a)),r.a.createElement("div",{className:"profile-username"},r.a.createElement("p",null,"Username: ",c)),r.a.createElement("div",{className:"profile-bonus"},r.a.createElement("p",{className:"m-0"},l))))},Ye=(a(134),a(44)),ze=a.n(Ye),Ge=function(e){var t=e.watched,a=[{name:"bad",count:0},{name:"average",count:0},{name:"good",count:0},{name:"perfect",count:0}],c=[{name:"Action",count:0},{name:"Adventure",count:0},{name:"Animation",count:0},{name:"Comedy",count:0},{name:"Crime",count:0},{name:"Documentary",count:0},{name:"Drama",count:0},{name:"Family",count:0},{name:"Fantasy",count:0},{name:"History",count:0},{name:"Horror",count:0},{name:"Music",count:0},{name:"Mystery",count:0},{name:"Romance",count:0},{name:"Science Fiction",count:0},{name:"TV Movie",count:0},{name:"Thriller",count:0},{name:"War",count:0},{name:"Western",count:0}];Object(n.useEffect)((function(){!function(e,t){e.forEach((function(e){1===e.rate?t[0].count++:2===e.rate?t[1].count++:4===e.rate?t[2].count++:5===e.rate&&t[3].count++}))}(t,a),function(e,t){e.forEach((function(e){e.genres.forEach((function(e){t.forEach((function(t){t.name===e.name&&t.count++}))}))}))}(t,c);var e=[];c.forEach((function(t){e.push(t.count)}));var n=a.map((function(e){return e.count}));p({options:{xaxis:{tickAmount:e.lenght}},series:[{data:e}]}),i({options:{yaxis:{tickAmount:n.lenght}},series:[{data:n}]})}),[t]);var l=Object(n.useState)({options:{chart:{type:"bar"},xaxis:{categories:["Bad","Average","Good","Perfect"]},yaxis:{labels:{formatter:function(e){return e}},forceNiceScale:!0}},series:[{name:"Movies rate",data:[]}]}),o=Object(ue.a)(l,2),s=o[0],i=o[1],m=Object(n.useState)({options:{chart:{type:"bar"},plotOptions:{bar:{horizontal:!0}},dataLabels:{enabled:!1},xaxis:{categories:["Action","Adventure","Animation","Comedy","Crime","Documentary","Drama","Family","Fantasy","History","Horror","Music","Mystery","Romance","Science Fiction","TV Movie","Thriller","War","Western"],forceNiceScale:!0}},series:[{name:"Genres",data:[]}]}),u=Object(ue.a)(m,2),d=u[0],p=u[1];return r.a.createElement(n.Fragment,null,r.a.createElement("div",{className:"stats-container"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-lg-6 col-12"},r.a.createElement(ze.a,{options:s.options,series:s.series,type:"bar",width:"100%"})),r.a.createElement("div",{className:"col-lg-6 col-12"},r.a.createElement(ze.a,{options:d.options,series:d.series,type:"bar",width:"100%"})))))},Be=function(e){var t=e.watched;return r.a.createElement(n.Fragment,null,r.a.createElement("div",{className:"watched-container"},r.a.createElement("div",{className:"row justify-content-start"},0!==t.length?t.map((function(e,t){return r.a.createElement("div",{key:t,className:"col-lg-2dot4 col-4"},r.a.createElement(ce,{id:e.movie_id,title:e.title,poster_path:e.poster_path}))})):r.a.createElement("p",{className:"text-center w-100"},"No movies watched :/"))))},Xe=Object(v.b)((function(e){return{profile:e.profiles,watched:e.watched.watched}}),{getUserProfile:function(e){return function(t){var a;return b.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,b.a.awrap(h.a.get("/api/users/".concat(e)));case 3:a=n.sent,t({type:"GET_PROFILE",payload:a.data}),t(Le(a.data._id)),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),console.log(n.t0);case 11:case"end":return n.stop()}}),null,null,[[0,8]])}}})((function(e){var t=e.getUserProfile,a=e.match,c=e.profile,l=c.loading,o=c.profile,s=c.watched;Object(n.useEffect)((function(){t(a.params.username)}),[t,a.params.username]);var i=Object(n.useState)("stats"),m=Object(ue.a)(i,2),u=m[0],d=m[1],p=Object(n.useState)(!0),E=Object(ue.a)(p,2),v=E[0],f=E[1],b=function(e,t){u!==e&&d(e),f(!t)};return r.a.createElement(n.Fragment,null,l||null!==o?r.a.createElement(n.Fragment,null,r.a.createElement("div",{className:"card"},r.a.createElement("div",{className:"card-body",style:{backgroundImage:"linear-gradient(to top, #848484, #e1e1e1)"}},r.a.createElement("div",{className:"avatar-info_options text-right",style:{marginBottom:"10em"}}),r.a.createElement("div",{className:"avatar-info_container d-inline-flex"},l?r.a.createElement("div",null,"Loading"):r.a.createElement(Fe,{avatar:we.a,email:o.email,username:o.username,likesText:"".concat(s.length," movies watched")}))),r.a.createElement("div",{className:"profile-buttons_container text-center"},r.a.createElement("div",{className:"row h-100"},r.a.createElement("div",{onClick:function(){return b("stats",v)},className:"col-6 pr-0 profile-button border-right ".concat(v?"active":"inactive")},r.a.createElement("p",{className:"p-0"},"Stats")),r.a.createElement("div",{onClick:function(){return b("watched",v)},className:"col-6 pl-0 profile-button ".concat(v?"inactive":"active")},r.a.createElement("p",{className:"p-0"},"Watched"))))),r.a.createElement("div",{className:"profile-halfPage_container mt-3"},r.a.createElement("div",{className:"card"},r.a.createElement("div",{className:"card-body"},"stats"===u?r.a.createElement(Ge,{watched:s}):"","watched"===u?r.a.createElement(Be,{watched:s}):"")))):r.a.createElement("div",null,"No user Found!"))})),Ze=(a(136),Object(v.b)((function(e){return{movies:e.movies}}),{getPopularMovies:function(e){return function(t){return b.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t({type:"REQUEST_SEARCH_MOVIES"}),a.next=3,b.a.awrap(h.a.get("/api/movies/popular/movies?page=".concat(e)).then((function(e){t(J(e.data,"SUCCESS_MOVIES_TRENDING"))})).catch((function(e){t($(e.message,"ERROR_MOVIES_TRENDING"))})));case 3:case"end":return a.stop()}}))}},clearState:ee})((function(e){var t=e.getPopularMovies,a=e.movies,c=a.movies,l=a.isFetching,o=e.clearState;Object(n.useEffect)((function(){return t(1),function(){o()}}),[t,o]);return r.a.createElement("section",{className:"browse-container"},r.a.createElement("div",{className:"browse_summary-container text-center"},r.a.createElement("h1",null,"Popular Movies")),r.a.createElement("div",{className:"browse_movies-container mt-5"},l||0===c.length?r.a.createElement("div",{className:"text-center"},r.a.createElement(ie,{width:"300px"})):r.a.createElement("div",{className:"browse_movies-container_inner"},r.a.createElement("div",{className:"row justify-content-start"},c.results.map((function(e){return r.a.createElement("div",{key:e.id,className:"col-4 col-md-3 col-lg-2dot4"},r.a.createElement(ce,{title:e.title,id:e.id,poster_path:e.poster_path}))}))),r.a.createElement("div",{className:"pagination-outer text-center"},r.a.createElement(le,{callBackPageNumber:function(e){window.scrollTo(0,0),t(e)},page:c.page,total_pages:c.total_pages})))))}))),qe=(a(137),function(e){return r.a.createElement("div",{className:"notFound-container"},r.a.createElement("div",{className:"fof"},r.a.createElement("h1",null,"404 Page not found")))});localStorage.token&&N(localStorage.token);var Ke=function(){return Object(n.useEffect)((function(){Q.dispatch(x())}),[]),r.a.createElement(v.a,{store:Q},r.a.createElement(o.a,null,r.a.createElement(n.Fragment,null,r.a.createElement(C,null),r.a.createElement(De,null),r.a.createElement("section",{className:"container mt-3"},r.a.createElement(s.d,null,r.a.createElement(s.b,{exact:!0,path:"/",component:U}),r.a.createElement(s.b,{exact:!0,path:"/movies/browse/trending",component:me}),r.a.createElement(s.b,{exact:!0,path:"/movies/:id",component:ke}),r.a.createElement(s.b,{exact:!0,path:"/search",component:Me}),r.a.createElement(s.b,{exact:!0,path:"/login",component:Pe}),r.a.createElement(s.b,{exact:!0,path:"/register",component:He}),r.a.createElement(s.b,{exact:!0,path:"/movies/browse/popular",component:Ze}),r.a.createElement(Ue,{exact:!0,path:"/profile/:username",component:Xe}),r.a.createElement(s.b,{component:qe}))),r.a.createElement(A,null))))};l.a.render(r.a.createElement(Ke,null),document.getElementById("root"))},28:function(e,t,a){e.exports=a.p+"static/media/profile-avatar.008b36e6.png"},34:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALcAAAETCAMAAABD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6i2/q6WlpaWlpaWlpaWlpaWlpaWl9Q/qP+A70LrMQEECAAAAAElFTkSuQmCC"},60:function(e,t,a){e.exports=a.p+"static/media/trending-image.0fd4753c.jpg"},61:function(e,t,a){e.exports=a.p+"static/media/popular-image.010ee118.jpg"},64:function(e,t,a){e.exports=a.p+"static/media/spinner.08efcad4.gif"},66:function(e,t,a){e.exports=a.p+"static/media/like.37304e62.png"},80:function(e,t,a){e.exports=a(138)},85:function(e,t,a){},86:function(e,t,a){},87:function(e,t,a){}},[[80,1,2]]]);
  //# sourceMappingURL=main.1679ac41.chunk.js.map