1(this.webpackJsonpapp=this.webpackJsonpapp||[]).push([[118],{1709:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return S}));var n=a(1),o=a(1523),r=a(1549),i=a(1551),c=a(1384),s=a(1525),l=a(1528),d=a(1550),g=a(1018),p=a(26),u=a.n(p),b=a(0),k=a.n(b),m=a(36),f=a(11),y=a(2),A=a(4),M=a(1616);const h=k.a.lazy(()=>a.e(36).then(a.bind(null,1718))),L=k.a.lazy(()=>a.e(136).then(a.bind(null,1719))),D=k.a.lazy(()=>a.e(30).then(a.bind(null,1650))),v=k.a.lazy(()=>a.e(29).then(a.bind(null,1651))),w=k.a.lazy(()=>a.e(138).then(a.bind(null,1720))),j=k.a.lazy(()=>a.e(28).then(a.bind(null,1652))),z=k.a.lazy(()=>a.e(134).then(a.bind(null,1721))),R=k.a.lazy(()=>a.e(139).then(a.bind(null,1722))),C=k.a.lazy(()=>a.e(135).then(a.bind(null,1723)));function S(e){let{task:t}=e;const{currentUser:a}=Object(f.c)(),{filter:o}=Object(M.c)(),r=u()(a,"teamUser.role"),i=u()(t,"status"),[c,s]=k.a.useReducer(y.Hb,{active:!1,open:!1,action:null}),l=k.a.useCallback(e=>()=>{s({active:e})},[]),d=k.a.useCallback(e=>()=>{s(t=>({open:e,action:e?t.action:null}))},[]),g=k.a.useCallback(e=>()=>{s({action:e,open:!0})},[]),p=k.a.useMemo(()=>{const e={hasAssign:o.hasAssign};return E.map(T({status:i,role:r,onAction:g,props:e})).filter(Boolean)},[i,r,o.hasAssign,g]),b=k.a.useMemo(()=>{const e={task:t,ids:(null===t||void 0===t?void 0:t.id)?[t.id]:[],open:c.open,onClose:d(!1)};return p.reduce((t,a)=>a&&a.key&&a.comp?(t[a.key]={...a,props:{...e,...a.props||{}}},t):t,{})},[d,p,t,c.open]);let m=c.action?b[c.action]:null;const A=k.a.useMemo(()=>k.a.createElement(n.g,{children:"Actions",onClick:l(!0),disclosure:!0}),[l]);return k.a.createElement(k.a.Fragment,null,k.a.createElement(n.K,{activator:A,onClose:l(!1),active:c.active,preferredAlignment:"right"},k.a.createElement(n.a,{items:p})),m?k.a.createElement(m.comp,m.props):null)}const T=e=>{let{status:t,role:a,onAction:n,props:o}=e;return e=>{let r=!0,i=!0,c=!0;return Object(y.c)(e.status)||(r=e.status.includes(t)),Object(y.c)(e.role)||(i=e.role.includes(a)),e.condition&&"function"===typeof e.condition&&(c=e.condition(o)),!!(r&&i&&c)&&{...e,onAction:n(e.key)}}},E=[{content:"View detail",icon:o.a,key:"view",comp:h},{content:"Check artist files",icon:r.a,status:[m.f.NeedReview,m.f.Done,m.f.Cancel,m.f.Rejected],role:[A.gb.Admin,A.gb.MarketplaceManager,A.gb.StoreManager,A.gb.DesignLeader,A.gb.ArtistLeader,A.gb.IdeaLeader],key:"compareDesign",comp:R},{content:"Update task",icon:i.a,status:[m.f.Pending,m.f.Doing,m.f.NeedReview,m.f.Rejected,m.f.Expired],role:[A.gb.Admin,A.gb.MarketplaceManager,A.gb.StoreManager,A.gb.DesignLeader,A.gb.ArtistLeader,A.gb.IdeaLeader],key:"updateTask",comp:L},{content:"Update task",icon:i.a,status:[m.f.Denied],role:[A.gb.Admin,A.gb.MarketplaceManager,A.gb.StoreManager,A.gb.DesignLeader,A.gb.ArtistLeader,A.gb.IdeaLeader],key:"updateDeniedTask",props:{isDeniedTask:!0},comp:L},{content:"Update KPI",icon:c.a,role:[A.gb.Admin,A.gb.MarketplaceManager,A.gb.StoreManager,A.gb.DesignLeader,A.gb.ArtistLeader,A.gb.IdeaLeader],key:"updateKPI",comp:C},{content:"Start now",icon:s.a,status:[m.f.Pending],role:[A.gb.Artist],key:"startNow",comp:D},{content:"Deny now",icon:l.a,status:[m.f.Pending],role:[A.gb.Artist],key:"denyNow",comp:v},{content:"Upload File",icon:c.a,status:[m.f.Doing,m.f.Rejected],role:[A.gb.Artist],key:"uploadFile",comp:w},{content:"Accept Task",icon:d.a,status:[m.f.NeedReview],role:[A.gb.Admin,A.gb.MarketplaceManager,A.gb.StoreManager,A.gb.DesignLeader,A.gb.ArtistLeader],key:"acceptTask",comp:j},{content:"Reject Task",icon:g.a,status:[m.f.NeedReview],role:[A.gb.Admin,A.gb.MarketplaceManager,A.gb.StoreManager,A.gb.DesignLeader,A.gb.ArtistLeader],key:"rejectTask",comp:z}]}}]); 2//# sourceMappingURL=118.a128e13c.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.