(this.webpackJsonp=this.webpackJsonp||[]).push([[152],{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},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,r=!1,u=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){r=!0,u=e}finally{try{!a&&o.return&&o.return()}finally{if(r)throw u}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=n("cDcd"),l=f(u),o=n("eO8H");n("cfYI");var c=f(n("CnBM")),i=f(n("HUFq"));function f(e){return e&&e.__esModule?e:{default:e}}var s=(0,c.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(6),n.e(132)]).then(n.t.bind(null,"Fu44",7))},loading:i.default}),d=(0,c.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(6),n.e(133)]).then(n.t.bind(null,"6P6j",7))},loading:i.default});t.default=function(e){var t=e.match.params.username,n=e.history.location.pathname,c=e.user,i=(0,u.useState)("undo"),f=r(i,2),m=f[0],p=f[1],E=(0,u.useState)(0),v=r(E,2),h=v[0],y=v[1],b=(0,u.useState)(0),_=r(b,2),g=_[0],j=_[1],S=(0,u.useState)(0),w=r(S,2),N=w[0],O=w[1],P=(0,u.useState)(!0),k=r(P,2),M=(k[0],k[1],e.current_user);function I(t,n){var a=n;"apply"===t?O(N-n):"undo"===t?j(g-n):(y(0),a=h),(a||0===a)&&e.deleteUndoEvent(a)}return(0,u.useEffect)((function(){if(c){var e=c.username,t=c.login;document.title=("undo"===m?"接收仓库":"成员申请")+"-"+e+"/"+t}}),[c,m]),(0,u.useEffect)((function(){t&&M&&M.login!==t&&e.history.push("/"+t)}),[M,t]),(0,u.useEffect)((function(){c&&(j(c.undo_transfer_projects),O(c.undo_join_projects),y(c.undo_messages))}),[c]),(0,u.useEffect)((function(){n&&t&&(n==="/"+t+"/notice"&&p("undo"),n==="/"+t+"/notice/apply"&&p("apply"))}),[n,c]),l.default.createElement("div",null,l.default.createElement("ul",{className:"noticeMenu"},l.default.createElement("li",{className:"undo"===m?"active":""},l.default.createElement(o.Link,{to:"/"+t+"/notice"},l.default.createElement("span",null,"接收仓库"),g?l.default.createElement("span",{className:"unNum"},g):"")),l.default.createElement("li",{className:"apply"===m?"active":""},l.default.createElement(o.Link,{to:"/"+t+"/notice/apply"},l.default.createElement("span",null,"成员申请"),N?l.default.createElement("span",{className:"unNum"},N):""))),l.default.createElement(o.Switch,null,l.default.createElement(o.Route,{path:"/:username/notice/apply",render:function(t){return l.default.createElement(s,a({},e,t,{deleteEvent:I}))}}),l.default.createElement(o.Route,{path:"/:username/notice",render:function(t){return l.default.createElement(d,a({},e,t,{deleteEvent:I}))}})))}}}]);