(this.webpackJsonp=this.webpackJsonp||[]).push([[110],{cfYI:function(e,t,n){},oeDK:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,u=!1,r=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{!a&&o.return&&o.return()}finally{if(u)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=n("q1tI"),l=i(r),o=n("eO8H");n("cfYI");var s=i(n("CnBM")),c=i(n("HUFq"));function i(e){return e&&e.__esModule?e:{default:e}}var f=(0,s.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(4),n.e(81)]).then(n.t.bind(null,"Fu44",7))},loading:c.default}),d=(0,s.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(109)]).then(n.t.bind(null,"zzrF",7))},loading:c.default}),m=(0,s.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(4),n.e(82)]).then(n.t.bind(null,"6P6j",7))},loading:c.default});t.default=function(e){var t=e.match.params.username,n=e.history.location.pathname,s=e.user,c=(0,r.useState)("notify"),i=u(c,2),p=i[0],E=i[1],v=(0,r.useState)(0),y=u(v,2),h=y[0],b=y[1],_=(0,r.useState)(0),N=u(_,2),g=N[0],j=N[1],S=(0,r.useState)(0),w=u(S,2),k=w[0],O=w[1],P=(0,r.useState)(!0),I=u(P,2),M=I[0],F=I[1],L=e.current_user;function R(){M&&(h&&e.deleteUndoEvent(h),F(!1))}function U(t,n){var a=n;"apply"===t?O(k-n):"undo"===t?j(k-n):(b(0),a=h),(a||0===a)&&e.deleteUndoEvent(a)}return(0,r.useEffect)((function(){t&&L&&L.login!==t&&e.history.push("/users/"+t)}),[L,t]),(0,r.useEffect)((function(){s&&(j(s.undo_transfer_projects),O(s.undo_join_projects),b(s.undo_messages))}),[s]),(0,r.useEffect)((function(){n&&t&&(n==="/users/"+t+"/notice"&&(E("notify"),R(s.undo_messages)),n==="/users/"+t+"/notice/undo"&&E("undo"),n==="/users/"+t+"/notice/apply"&&E("apply"))}),[n,s]),l.default.createElement("div",null,l.default.createElement("ul",{className:"noticeMenu"},l.default.createElement("li",{className:"notify"===p?"active":""},l.default.createElement(o.Link,{to:"/users/"+t+"/notice",onClick:R},l.default.createElement("span",null,"通知"),h?l.default.createElement("span",{className:"unNum"},h):"")),l.default.createElement("li",{className:"undo"===p?"active":""},l.default.createElement(o.Link,{to:"/users/"+t+"/notice/undo"},l.default.createElement("span",null,"接收仓库"),g?l.default.createElement("span",{className:"unNum"},g):"")),l.default.createElement("li",{className:"apply"===p?"active":""},l.default.createElement(o.Link,{to:"/users/"+t+"/notice/apply"},l.default.createElement("span",null,"成员申请"),k?l.default.createElement("span",{className:"unNum"},k):""))),l.default.createElement(o.Switch,null,l.default.createElement(o.Route,{path:"/users/:username/notice/apply",render:function(t){return l.default.createElement(f,a({},e,t,{deleteEvent:U}))}}),l.default.createElement(o.Route,{path:"/users/:username/notice/undo",render:function(t){return l.default.createElement(m,a({},e,t,{deleteEvent:U}))}}),l.default.createElement(o.Route,{path:"/users/:username/notice",render:function(t){return l.default.createElement(d,a({},e,t,{deleteEvent:U}))}})))}}}]);