1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3880],{74974:function(t,e,n){"use strict";var o=n(71600);e.Z=void 0;var i=o(n(68671)),a=n(52322),r=(0,i.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1z"}),"DeleteRounded");e.Z=r},16025:function(t,e,n){"use strict";var o=n(6620),i=n(52322);e.Z=(0,o.Z)((0,i.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z"}),"EditOutlined")},68019:function(t,e,n){"use strict";var o=n(6620),i=n(52322);e.Z=(0,o.Z)((0,i.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined")},6493:function(t,e,n){"use strict";var o=n(6620),i=n(52322);e.Z=(0,o.Z)((0,i.jsx)("path",{d:"M12 5.99 19.53 19H4.47L12 5.99M2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zm0 5h2v2h-2z"}),"WarningAmberRounded")},49550:function(t,e,n){"use strict";n.d(e,{Z:function(){return b}});var o=n(31461),i=n(7896),a=n(2784),r=n(7342),s=n(85954),d=n(65992),l=n(43853),c=n(83249),u=n(72841),x=n(15672);function p(t){return(0,x.Z)("MuiLoadingButton",t)}let h=(0,n(69222).Z)("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]);var g=n(52322);let j=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],Z=t=>{let{loading:e,loadingPosition:n,classes:o}=t,a=function(t,e,n){let o={};return Object.keys(t).forEach(i=>{o[i]=t[i].reduce((t,o)=>(o&&(t.push(e(o)),n&&n[o]&&t.push(n[o])),t),[]).join(" ")}),o}({root:["root",e&&"loading"],startIcon:[e&&`startIconLoading${(0,r.Z)(n)}`],endIcon:[e&&`endIconLoading${(0,r.Z)(n)}`],loadingIndicator:["loadingIndicator",e&&`loadingIndicator${(0,r.Z)(n)}`]},p,o);return(0,i.Z)({},o,a)},m=t=>"ownerState"!==t&&"theme"!==t&&"sx"!==t&&"as"!==t&&"classes"!==t,v=(0,d.ZP)(c.Z,{shouldForwardProp:t=>m(t)||"classes"===t,name:"MuiLoadingButton",slot:"Root",overridesResolver:(t,e)=>[e.root,e.startIconLoadingStart&&{[`& .${h.startIconLoadingStart}`]:e.startIconLoadingStart},e.endIconLoadingEnd&&{[`& .${h.endIconLoadingEnd}`]:e.endIconLoadingEnd}]})(({ownerState:t,theme:e})=>(0,i.Z)({[`& .${h.startIconLoadingStart}, & .${h.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},"center"===t.loadingPosition&&{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${h.loading}`]:{color:"transparent"}},"start"===t.loadingPosition&&t.fullWidth&&{[`& .${h.startIconLoadingStart}, & .${h.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0,marginRight:-8}},"end"===t.loadingPosition&&t.fullWidth&&{[`& .${h.startIconLoadingStart}, & .${h.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0,marginLeft:-8}})),f=(0,d.ZP)("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>{let{ownerState:n}=t;return[e.loadingIndicator,e[`loadingIndicator${(0,r.Z)(n.loadingPosition)}`]]}})(({theme:t,ownerState:e})=>(0,i.Z)({position:"absolute",visibility:"visible",display:"flex"},"start"===e.loadingPosition&&("outlined"===e.variant||"contained"===e.variant)&&{left:"small"===e.size?10:14},"start"===e.loadingPosition&&"text"===e.variant&&{left:6},"center"===e.loadingPosition&&{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled},"end"===e.loadingPosition&&("outlined"===e.variant||"contained"===e.variant)&&{right:"small"===e.size?10:14},"end"===e.loadingPosition&&"text"===e.variant&&{right:6},"start"===e.loadingPosition&&e.fullWidth&&{position:"relative",left:-10},"end"===e.loadingPosition&&e.fullWidth&&{position:"relative",right:-10}));var b=a.forwardRef(function(t,e){let n=(0,l.Z)({props:t,name:"MuiLoadingButton"}),{children:a,disabled:r=!1,id:d,loading:c=!1,loadingIndicator:x,loadingPosition:p="center",variant:h="text"}=n,m=(0,o.Z)(n,j),b=(0,s.Z)(d),y=null!=x?x:(0,g.jsx)(u.Z,{"aria-labelledby":b,color:"inherit",size:16}),C=(0,i.Z)({},n,{disabled:r,loading:c,loadingIndicator:y,loadingPosition:p,variant:h}),P=Z(C),w=c?(0,g.jsx)(f,{className:P.loadingIndicator,ownerState:C,children:y}):null;return(0,g.jsxs)(v,(0,i.Z)({disabled:r||c,id:b,ref:e},m,{variant:h,classes:P,ownerState:C,children:["end"===C.loadingPosition?a:w,"end"===C.loadingPosition?w:a]}))})},11511:function(t,e,n){"use strict";n.d(e,{Z:function(){return Z}});
1var o=n(7896),i=n(31461),a=n(2784),r=n(6277),s=n(69075),d=n(43853),l=n(65992),c=n(69222),u=n(15672);function x(t){return(0,u.Z)("MuiTableContainer",t)}(0,c.Z)("MuiTableContainer",["root"]);var p=n(52322);let h=["className","component"],g=t=>{let{classes:e}=t;return(0,s.Z)({root:["root"]},x,e)},j=(0,l.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"});var Z=a.forwardRef(function(t,e){let n=(0,d.Z)({props:t,name:"MuiTableContainer"}),{className:a,component:s="div"}=n,l=(0,i.Z)(n,h),c=(0,o.Z)({},n,{component:s}),u=g(c);return(0,p.jsx)(j,(0,o.Z)({ref:e,as:s,className:(0,r.Z)(u.root,a),ownerState:c},l))})},97054:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/programmes/project-tags",function(){return n(68752)}])},39712:function(t,e,n){"use strict";var o=n(52322),i=n(2784),a=n(43749),r=n(31563),s=n(45596),d=n(35469),l=n(85801),c=n(71483),u=n(42305);e.Z=t=>{let{history:e=[],control:n,disabled:x,onEnter:p,onSelectOption:h,clearKeyword:g,label:j,filterOptions:Z,formControlProps:m,sxWidth:v="100vw",fullWidth:f}=t,{isSmDown:b}=(0,u.k)(),y=b?v:"577px",C=(0,i.useMemo)(()=>0===e.length?[]:[{label:"Recent searches",value:"NOT_SELECTABLE",selectable:!1,sx:{fontWeight:"bold"}},...e.map(t=>({label:t,value:t}))],[e]),P=(0,i.useCallback)(()=>C,[C]);return(0,o.jsx)(c.mu,{fullWidth:f,control:n,id:"keyword",name:"keyword",label:j,optionNotFoundText:"Data not found.",options:C,filterOptions:Z||P,disabled:x,clearOnBlur:!1,onEnter:p,onSelectOption:h,"data-testid":"search-input",slotProps:{popper:{sx:{width:y,"> div":{width:y}}}},formControlProps:m,renderInput:t=>(0,o.jsx)(s.Z,{...t,ref:t.InputProps.ref,label:t.inputProps.value?"":j,InputProps:{startAdornment:(0,o.jsx)(d.Z,{position:"start",children:(0,o.jsx)(r.Z,{})}),endAdornment:(0,o.jsx)(d.Z,{position:"end",sx:{mr:2,display:t.inputProps.value?"visible":"none"},children:(0,o.jsx)(l.Z,{"aria-label":"clear search field",edge:"end",onClick:()=>{let e=t.inputProps.ref.current;e&&(e.value=""),g()},children:(0,o.jsx)(a.Z,{})})})},InputLabelProps:{shrink:!1},sx:{overflowX:"hidden","& .MuiInputBase-root":{backgroundColor:"white",width:y},"& .MuiInputLabel-root":{marginLeft:8,color:"grey.400",zIndex:1},"& label.Mui-focused":{display:"none"},zIndex:0}})})}},68752:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return D}});var o=n(52322),i=n(2784),a=(0,n(6620).Z)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 11h-3v3c0 .55-.45 1-1 1s-1-.45-1-1v-3H8c-.55 0-1-.45-1-1s.45-1 1-1h3V8c0-.55.45-1 1-1s1 .45 1 1v3h3c.55 0 1 .45 1 1s-.45 1-1 1z"}),"AddCircleRounded"),r=n(16025),s=n(68019),d=n(6493),l=n(74974),c=n(49550),u=n(33927),x=n(72742),p=n(17377),h=n(62197),g=n(11511),j=n(25485),Z=n(24254),m=n(86973),v=n(88206),f=n(97515),b=n(36284),y=n(83249),C=n(85801),P=n(69089),w=n(45596),I=n(35936),L=n(6060),S=n(107),E=n(67550),k=n(5971),M=n(81128),T=n(93626),z=n(63514),A=n(5632),R=n(63955),N=n(33787),W=n(89955),$=n(39712),_=n(90736),O=n(42285),B=n(40699),D=()=>{var t,e,n,D,F,H,V,X;let G=(0,A.useRouter)(),{isExecutive:U,isAuthDataLoaded:J}=(0,O.Eu)(),[K,Y]=(0,i.useState)(0),[q,Q]=(0,i.useState)(10),[tt,te]=(0,i.useState)(""),[tn,to]=(0,i.useState)("name"),[ti,ta]=(0,i.useState)("asc"),{control:tr,setValue:ts}=(0,R.cI)({defaultValues:{keyword:""}}),[td,tl]=(0,i.useState)(!1),[tc,tu]=(0,i.useState)(null),[tx,tp]=(0,i.useState)(null),[th,tg]=(0,i.useState)(!1),[tj,tZ]=(0,i.useState)(""),tm={width:"100%",maxWidth:532,borderRadius:"12px",px:"16px"};(0,i.useEffect)(()=>{J&&!U&&G.replace(_.$w.HOME)},[J,U,G]);let tv=t=>{ta(tn===t&&"asc"===ti?"desc":"asc"),to(t),Y(0)},tf=(0,B.ii)({page:K+1,resultsPerPage:q,search:tt||void 0,sortBy:tn,sortOrder:ti},J&&U),{mutateAsync:tb,isLoading:ty}=(0,B.lJ)(),{mutateAsync:tC,isLoading:tP}=(0,B.jf)(),{mutateAsync:tw,isLoading:tI}=(0,B.nS)(),tL=null!==(n=null===(t=tf.data)||void 0===t?void 0:t.projectTags)&&void 0!==n?n:[],tS=null!==(D=null===(e=tf.data)||void 0===e?void 0:e.totalResults)&&void 0!==D?D:0,tE=(0,i.useMemo)(()=>tx?"Delete project tag":tc?"Edit project tag":"Add new project tag",[tx,tc]);if(!J||!U)return null;let tk=()=>{tl(!1),tu(null),tp(null),tg(!1),tZ("")},tM=async()=>{try{tc?tg(!0):(await tb({name:tj.trim()}),(0,z.C)({message:"Successfully added project tag!",type:"success"}),tk())}catch(t){(0,T.z)(t)}},tT=async()=>
1{if(tc)try{await tC({id:tc.id,name:tj.trim()}),(0,z.C)({message:"Successfully updated project tag!",type:"success"}),tk()}catch(t){(0,T.z)(t)}},tz=async()=>{if(tx)try{await tw(tx.id),(0,z.C)({message:"Successfully deleted project tag!",type:"success"}),tk()}catch(t){(0,T.z)(t)}};return(0,o.jsx)(W.LN,{title:"Project Tag Management",children:(0,o.jsxs)(N.Yb,{pb:10,children:[(0,o.jsx)(u.Z,{direction:"row",justifyContent:"flex-end",mb:4,children:(0,o.jsx)(c.Z,{startIcon:(0,o.jsx)(a,{}),loading:!1,onClick:()=>{tZ(""),tl(!0)},children:"Add new project tag"})}),(0,o.jsx)(u.Z,{mb:4,alignItems:"center",children:(0,o.jsx)(u.Z,{sx:{width:"100%",maxWidth:{xs:"100%",sm:577}},children:(0,o.jsx)($.Z,{label:"Enter to search by project tag",control:tr,clearKeyword:()=>{ts("keyword",""),te(""),Y(0)},onEnter:t=>{Y(0),te(t)}})})}),(0,o.jsx)(x.Z,{component:"div",count:tS,page:K,rowsPerPage:q,onPageChange:(t,e)=>Y(e),onRowsPerPageChange:t=>{Q(parseInt(t.target.value,10)),Y(0)},sx:{mb:1}}),0!==tL.length||tf.isLoading?(0,o.jsx)(p.Z,{sx:{boxShadow:"none",borderRadius:3},children:(0,o.jsx)(g.Z,{children:(0,o.jsxs)(j.Z,{children:[(0,o.jsx)(Z.Z,{children:(0,o.jsxs)(m.Z,{children:[(0,o.jsx)(v.Z,{sortDirection:"name"===tn&&ti,children:(0,o.jsx)(f.Z,{active:"name"===tn,direction:"name"===tn?ti:"asc",onClick:()=>tv("name"),children:"Project Tag"})}),(0,o.jsx)(v.Z,{sortDirection:"taggedProjectsCount"===tn&&ti,children:(0,o.jsx)(f.Z,{active:"taggedProjectsCount"===tn,direction:"taggedProjectsCount"===tn?ti:"asc",onClick:()=>tv("taggedProjectsCount"),children:"Tagged Projects"})}),(0,o.jsx)(v.Z,{sortDirection:"createdAt"===tn&&ti,children:(0,o.jsx)(f.Z,{active:"createdAt"===tn,direction:"createdAt"===tn?ti:"asc",onClick:()=>tv("createdAt"),children:"Created on"})}),(0,o.jsx)(v.Z,{})]})}),(0,o.jsx)(b.Z,{children:tL.map(t=>(0,o.jsxs)(m.Z,{children:[(0,o.jsx)(v.Z,{children:t.name}),(0,o.jsx)(v.Z,{children:t.taggedProjectsCount}),(0,o.jsx)(v.Z,{children:(0,M.up)(t.createdAt)}),(0,o.jsx)(v.Z,{align:"right",children:(0,o.jsxs)(u.Z,{direction:"row",justifyContent:"flex-end",gap:1,children:[(0,o.jsx)(y.Z,{variant:"outlined",size:"small",startIcon:(0,o.jsx)(r.Z,{}),sx:{borderRadius:8,textTransform:"none",color:"navy.main",borderColor:"navy.main","&:hover":{borderColor:"navy.main",backgroundColor:"white",color:"navy.main"}},onClick:()=>{tZ(t.name),tu(t)},children:"Edit"}),(0,o.jsx)(C.Z,{size:"small",onClick:()=>tp(t),children:(0,o.jsx)(l.Z,{})})]})})]},t.id))})]})})}):(0,o.jsx)(p.Z,{sx:{p:8,textAlign:"center",boxShadow:"none"},children:(0,o.jsx)(h.Z,{children:"There are no project tags listed currently. Click on Add new project tag to add a new tag."})}),(0,o.jsx)(P.Z,{open:td||!!tc,onClose:tk,fullWidth:!0,maxWidth:"sm",children:(0,o.jsxs)(u.Z,{p:4,gap:4,children:[(0,o.jsx)(h.Z,{variant:"subtitle1",children:tE}),(0,o.jsx)(w.Z,{label:"Project tag",value:tj,inputProps:{maxLength:40},onChange:t=>tZ(t.target.value)}),(0,o.jsxs)(u.Z,{direction:"row",justifyContent:"flex-end",gap:2,children:[(0,o.jsx)(y.Z,{variant:"outlined",onClick:tk,children:"Cancel"}),(0,o.jsx)(y.Z,{variant:"contained",disabled:!tj.trim()||ty||tP,onClick:tM,children:tc?"Edit":"Save"})]})]})}),(0,o.jsxs)(P.Z,{open:th,onClose:()=>tg(!1),fullWidth:!0,maxWidth:!1,PaperProps:{sx:tm},children:[(0,o.jsx)(I.Z,{sx:{px:0,py:"16px"},children:(0,o.jsx)(h.Z,{variant:"subtitle1",children:"Confirm Project Tag edits"})}),(0,o.jsxs)(L.Z,{sx:{px:0,py:"8px"},children:[(0,o.jsxs)(S.Z,{severity:"info",icon:(0,o.jsx)(s.Z,{}),sx:{alignItems:"flex-start",mb:4,px:"16px",py:"6px",borderRadius:"4px","& .MuiAlert-message":{width:"100%"}},children:[(0,o.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"rgba(0, 0, 0, 0.6)"},mb:.5,children:["Total tagged projects: ",null!==(F=null==tc?void 0:tc.taggedProjectsCount)&&void 0!==F?F:0]}),(0,o.jsx)(h.Z,{variant:"body2",color:"text.secondary",mb:.5,children:"Upon confirmation:"}),(0,o.jsx)(E.Z,{component:"ul",sx:{mb:0,pl:3,listStyleType:"disc",listStylePosition:"outside"},children:(0,o.jsx)(E.Z,{component:"li",sx:{display:"list-item"},children:(0,o.jsx)(h.Z,{component:"span",variant:"body2",color:"text.secondary",children:"Changes made would be published instantly, made visible to all users, and updated across all projects tied to this project tag."})})})]}),(0,o.jsx)(h.Z,{variant:"body1",children:"Are you sure you want to confirm edits?"})]}),(0,o.jsxs)(k.Z,{sx:{px:0,py:"8px"},children:[(0,o.jsx)(y.Z,{color:"secondary",onClick:()=>tg(!1),children:"CANCEL"}),(0,o.jsx)(y.Z,{color:"primary",onClick:tT,disabled:tP,children:tP?"CONFIRMING...":"CONFIRM"})]})]}),(0,o.jsxs)(P.Z,{open:!!tx,onClose:tk,fullWidth:!0,maxWidth:!1,PaperProps:{sx:tm},children:[(0,o.jsx)(I.Z,{sx:{px:0,py:"16px"},children:(0,o.jsxs)(h.Z,{variant:"subtitle1",children:["Delete ",null!==(H=null==tx?void 0:tx.name)&&void 0!==H?H:"Project Tag"]})}),(0,o.jsxs)(L.Z,{sx:{px:0,py:"8px"},children:[(0,o.jsxs)(S.Z,{severity:"warning",icon:(0,o.jsx)(d.Z,{}),sx:{alignItems:"flex-start",mb:4,px:"16px",py:"6px",borderRadius:"4px","& .MuiAlert-message":{width:"100%"}},children:[(0,o.jsxs)(h.Z,{variant:"subtitle1",sx:{color:"#5F2B01"},mb:.5,children:["Total tagged projects: ",null!==(V=null==tx?void 0:tx.taggedProjectsCount)&&void 0!==V?V:0]}),(0,o.jsx)(h.Z,{variant:"body2",color:"#5F2B01",mb:.5,children:"Upon deletion:"}),(0,o.jsxs)(E.Z,{component:"ul",sx:{mb:0,paddingLeft:"25px",color:"#5F2B01",listStyleType:"disc",listStylePosition:"outside"}
1,children:[(0,o.jsx)(E.Z,{component:"li",sx:{display:"list-item"},children:(0,o.jsx)(h.Z,{component:"span",variant:"body2",children:"The project tag will be permanently deleted from 'Project Tag Management' and removed from the Project Tagging selection dropdown."})}),(0,o.jsx)(E.Z,{component:"li",sx:{display:"list-item"},children:(0,o.jsx)(h.Z,{component:"span",variant:"body2",children:"Project Tag will be unlinked from previously tagged projects."})}),(0,o.jsx)(E.Z,{component:"li",sx:{display:"list-item"},children:(0,o.jsx)(h.Z,{component:"span",variant:"body2",children:"This process cannot be undone."})})]})]}),(0,o.jsxs)(h.Z,{variant:"subtitle2",sx:{fontWeight:"400"},children:["Are you sure you want to delete ",null!==(X=null==tx?void 0:tx.name)&&void 0!==X?X:"this project tag","?"]})]}),(0,o.jsxs)(k.Z,{sx:{px:0,py:"8px"},children:[(0,o.jsx)(y.Z,{color:"secondary",onClick:tk,children:"CANCEL"}),(0,o.jsx)(y.Z,{color:"primary",onClick:tz,disabled:tI,children:tI?"DELETING...":"DELETE"})]})]})]})})}}},function(t){t.O(0,[2812,5417,9782,9525,2742,942,1075,2813,9175,9199,7994,6790,799,8194,9955,1483,2888,9774,179],function(){return t(t.s=97054)}),_N_E=t.O()}]);
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.