1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8465],{"75IZ"(e,t,r){r.r(t),r.d(t,{default:()=>se});var o=r("nKUr"),n=r("jp5h"),s=r("V4z/"),a=r("q1tI"),i=r("SOjZ"),l=r("XDrO"),c=r("Gqia"),d=r("5I82"),p=r("qAqx"),u=r("fOgp"),x=r("yXLF"),h=r("gwor"),m=r("6dIc"),j=r("vH+6"),v=r("OGDC"),g=r("umvS"),b=r("b7jQ"),A=r("GVSF"),f=r("akmu"),y=r("TFnf"),w=r("4d1r"),k=r("xIXX"),I=r("GhOb"),N=r("zyID"),C=r("tB7o"),S=r("l7Ke"),$=r("nzaU");const D={complete:"Quoted","in-progress":"In Progress",review:"Submitted","not-started":"Draft",attention:"Needs Revision",cancelled:"Cancelled",unknown:"Unknown"},W={complete:"success","in-progress":"info",review:"info","not-started":"default",attention:"warning",cancelled:"error",unknown:"default"};function P(e){if(!e)return"No Status";const t=(0,$.SP)(e);return D[t]||e}function F(e){if(!e)return"default";const t=(0,$.SP)(e);return W[t]||"default"}const z={complete:"Proposals that have been quoted and are ready to present","in-progress":"Proposals actively being worked on",review:"Proposals in review.","not-started":"Proposals created but not yet finished by the Playcraft Team.",attention:"Proposals flagged internally needing extra attention.",cancelled:"Proposals that have been cancelled by the consultant.",unknown:"Proposals with an unrecognized status"};function T(e){if(!e)return"This site has no proposals yet";const t=(0,$.SP)(e);return z[t]}var U=r("zuse"),B=r("s1qt"),M=r("MGIy"),L=r("EfzM"),O=r("Ifci"),R=r("A+QN"),q=r("H9le"),G=r("8lqF"),H=r("T4Ez"),E=r("Y5n4"),Q=r("UnQg"),K=r("zDQl");function X({open:e,onClose:t,groupId:r}){const n=(0,Q.A)(),s=(0,E.A)(n.breakpoints.down("sm")),{addWorkspace:i,selectedGroup:p}=(0,U.A)(),[m,j]=(0,a.useState)(""),[v,f]=(0,a.useState)([]),[k,I]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),[S,$]=(0,a.useState)(null);(0,a.useEffect)((()=>{if(!e||m.trim().length<2)return void f([]);const t=setTimeout((async()=>{I(!0);try{const e=await K.Ay.get("/api/workspaces/search-projects",{params:{query:m.trim()}});f(e.data.payload||[])}catch(e){f([])}finally{I(!1)}}),300);return()=>clearTimeout(t)}),[e,m]),(0,a.useEffect)((()=>{e&&(j(""),f([]),$(null))}),[e]);const D=(0,a.useCallback)((async e=>{C(!0),$(null);try{await i(r,e),t()}catch(e){$(e.message||"Failed to add workspace")}finally{C(!1)}}),[i,r,t]),W=new Set((null==p?void 0:p.members.map((e=>Number(e.workspaceId))))||[]);return(0,o.jsxs)(g.A,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,fullScreen:s,children:[(0,o.jsx)(b.A,{children:"Add Workspace to Customer Profile"}),(0,o.jsxs)(A.A,{children:[S&&(0,o.jsx)(h.A,{severity:"error",sx:{mb:2},children:S}),(0,o.jsx)(M.A,{autoFocus:!0,fullWidth:!0,placeholder:"Search workspaces by name...",value:m,onChange:e=>j(e.target.value),InputProps:{startAdornment:(0,o.jsx)(L.A,{position:"start",children:(0,o.jsx)(w.WL,{icon:"eva:search-fill",sx:{color:"text.disabled"}})})},sx:{mt:1},disabled:N}),k&&(0,o.jsx)(u.A,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,o.jsx)(x.A,{size:24})}),!k&&v.length>0&&(0,o.jsx)(q.A,{sx:{mt:1},children:v.map(((e,t)=>{const r=[e.customerFirstName,e.customerLastName].filter(Boolean).join(" "),n=e.dateCreated?new Date(e.dateCreated).toLocaleDateString():null,s=W.has(Number(e.id));return(0,o.jsxs)("div",{children:[t>0&&(0,o.jsx)(R.A,{component:"li"}),(0,o.jsx)(G.A,{onClick:()=>D(Number(e.id)),disabled:N||s,sx:{alignItems:"flex-start",py:1.5,...s&&{opacity:.5}},children:(0,o.jsx)(H.A,{primary:(0,o.jsxs)(l.A,{direction:"row",spacing:1,alignItems:"center",children:[(0,o.jsx)(c.A,{variant:"subtitle2",children:e.projectName}),e.projectType&&(0,o.jsx)(O.A,{label:e.projectType,size:"small",variant:"outlined"}),s&&(0,o.jsx)(O.A,{label:"In Customer Profile",size:"small",color:"default"})]}),secondary:(0,o.jsxs)(l.A,{component:"span",spacing:.25,sx:{mt:.5},children:[(r||e.customerOrganization)&&(0,o.jsx)(c.A,{variant:"caption",component:"span",display:"block",children:[r,e.customerOrganization].filter(Boolean).join(" - ")}),n&&(0,o.jsxs)(c.A,{variant:"caption",component:"span",display:"block",color:"text.disabled",children:["Created ",n]})]}),secondaryTypographyProps:{component:"div"}})})]},e.id)}))}),!k&&m.trim().length>=2&&0===v.length&&(0,o.jsx)(c.A,{variant:"body2",color:"text.secondary",sx:{mt:2,textAlign:"center"},children:"No workspaces found matching your search."}),m.trim().length<2&&(0,o.jsx)(c.A,{variant:"body2",color:"text.secondary",sx:{mt:2,textAlign:"center"},children:"Type at least 2 characters to search."})]}),(0,o.jsx)(y.A,{children:(0,o.jsx)(d.A,{onClick:t,disabled:N,children:"Close"})})]})}function _(e){return e>=1e6?`$${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:e>=1e3?`$${Math.round(e/1e3)}
1K`:`$${e.toLocaleString()}`}function J(e){const t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return t<1?"today":1===t?"1 day ago":t<7?`${t} days ago`:t<14?"1 week ago":t<30?`${Math.floor(t/7)} weeks ago`:t<60?"1 month ago":`${Math.floor(t/30)} months ago`}function V(e){if(!e)return"text.disabled";const t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return t<7?"text.secondary":t<28?"warning.main":"error.main"}function Y(e){return"default"===e?"grey":e}function Z({stats:e,members:t}){const r=(0,Q.A)(),n=function(e){const t=new Date;return t.setDate(t.getDate()-14),e.filter((e=>!!e.workspaceDateUpdated&&new Date(e.workspaceDateUpdated)<t))}(t),s=t.filter((t=>!e.perMemberStats[t.workspaceId])).length,a=(i=e.proposalStatusBreakdown,Object.entries(i).reduce(((e,[t,r])=>"not-started"===(0,$.SP)(t)?e+r:e),0));var i;const d=function(e){const t={},r={};for(const[o,n]of Object.entries(e)){const e=(0,$.SP)(o);t[e]=(t[e]||0)+n,r[e]||(r[e]=[]),r[e].push(o)}return["complete","in-progress","review","not-started","attention","unknown"].filter((e=>(t[e]||0)>0)).map((e=>{const o=r[e]||[],n=`${z[e]} (${o.join(", ")})`;return{status:e,label:D[e],count:t[e],color:W[e],tooltip:n}}))}(e.proposalStatusBreakdown),x=d.reduce(((e,t)=>e+t.count),0),h=t.length>0?Math.round(e.combinedBudget/t.length):0,m=e.combinedBudget>0?Math.round(e.quotedBudget/e.combinedBudget*100):0,v=Object.keys(e.perMemberStats).length;return(0,o.jsxs)(u.A,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"repeat(2, 1fr)",md:"repeat(4, 1fr)"},mb:4},children:[(0,o.jsxs)(p.A,{sx:{p:2},"data-testid":"stats-card-opportunity",children:[(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",sx:{mb:1,display:"block"},children:"Total Opportunity"}),(0,o.jsx)(c.A,{variant:"h5",children:_(e.combinedBudget)}),(0,o.jsxs)(c.A,{variant:"caption",color:"text.secondary",children:["Avg ",_(h)," per site"]}),(0,o.jsx)(u.A,{sx:{mt:1.5,mb:.5},children:(0,o.jsx)(u.A,{sx:{height:6,borderRadius:1,bgcolor:"action.selected",overflow:"hidden"},children:(0,o.jsx)(u.A,{"data-testid":"quoted-progress-bar",sx:{height:"100%",borderRadius:1,bgcolor:"success.main",width:`${m}%`,transition:"width 0.3s ease"}})})}),(0,o.jsxs)(c.A,{variant:"caption",color:"success.main",children:[_(e.quotedBudget)," quoted"]})]}),(0,o.jsxs)(p.A,{sx:{p:2},"data-testid":"stats-card-pipeline",children:[(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",sx:{mb:1,display:"block"},children:"Site Health"}),x>0?(0,o.jsx)(u.A,{"data-testid":"pipeline-bar",sx:{display:"flex",height:8,borderRadius:1,overflow:"hidden",mb:1.5},children:d.map((e=>{var t;const n=e.count/x*100,s=Y(e.color),a="grey"===s?r.palette.text.disabled:(null===(t=r.palette[s])||void 0===t?void 0:t.main)||r.palette.text.disabled;return(0,o.jsx)(u.A,{sx:{width:`${n}%`,bgcolor:a,minWidth:4}},e.status)}))}):(0,o.jsx)(u.A,{"data-testid":"pipeline-bar",sx:{height:8,borderRadius:1,bgcolor:"action.selected",mb:1.5}}),(0,o.jsxs)(l.A,{spacing:.25,children:[d.map((e=>{var t;const n=Y(e.color),s="grey"===n?r.palette.text.disabled:(null===(t=r.palette[n])||void 0===t?void 0:t.main)||r.palette.text.disabled;return(0,o.jsx)(j.A,{title:e.tooltip,arrow:!0,placement:"left",children:(0,o.jsxs)(l.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,o.jsx)(u.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:s,flexShrink:0}}),(0,o.jsx)(c.A,{variant:"caption",sx:{flex:1},children:e.label}),(0,o.jsx)(c.A,{variant:"caption",fontWeight:"bold",children:e.count})]})},e.status)})),0===d.length&&(0,o.jsx)(c.A,{variant:"caption",color:"text.disabled",children:"No proposals yet"})]})]}),(0,o.jsxs)(p.A,{sx:{p:2},"data-testid":"stats-card-proposals",children:[(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",sx:{mb:1,display:"block"},children:"Proposals"}),(0,o.jsx)(c.A,{variant:"h5",children:e.proposalCount}),(0,o.jsxs)(c.A,{variant:"caption",color:"text.secondary",children:["across ",v," active sites"]}),e.graphicsRequestCount>0&&(0,o.jsxs)(c.A,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:[e.graphicsRequestCount," posters"]}),(0,o.jsxs)(l.A,{direction:"row",spacing:1,sx:{mt:1.5},children:[s>0&&(0,o.jsxs)(u.A,{"data-testid":"subcard-no-proposals",sx:{flex:1,bgcolor:"action.hover",borderRadius:1,py:1,px:1.5,textAlign:"center"},children:[(0,o.jsx)(c.A,{variant:"subtitle2",color:"warning.main",children:s}),(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",sx:{dis
1play:"block",lineHeight:1.2},children:"no proposals"})]}),a>0&&(0,o.jsxs)(u.A,{"data-testid":"subcard-unsubmitted",sx:{flex:1,bgcolor:"action.hover",borderRadius:1,py:1,px:1.5,textAlign:"center"},children:[(0,o.jsx)(c.A,{variant:"subtitle2",color:"text.secondary",children:a}),(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",sx:{display:"block",lineHeight:1.2},children:"unsubmitted"})]})]})]}),(0,o.jsxs)(p.A,{sx:{p:2},"data-testid":"stats-card-attention",children:[(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",sx:{mb:1,display:"block"},children:"Needs Attention"}),n.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.A,{variant:"h5",color:"warning.main",children:n.length}),(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",sx:{mb:.5,display:"block"},children:"stalled sites (2+ weeks inactive)"}),(0,o.jsxs)(l.A,{spacing:.25,sx:{mt:.5},children:[n.slice(0,3).map((e=>(0,o.jsxs)(c.A,{variant:"caption",noWrap:!0,children:[e.projectName||`Workspace #${e.workspaceId}`,e.workspaceDateUpdated&&(0,o.jsxs)(c.A,{component:"span",variant:"caption",sx:{color:V(e.workspaceDateUpdated)},children:[" ","â ",J(e.workspaceDateUpdated)]})]},e.workspaceId))),n.length>3&&(0,o.jsxs)(c.A,{variant:"caption",color:"text.disabled",children:["+",n.length-3," more"]})]})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.A,{variant:"h5",color:"success.main",children:"0"}),(0,o.jsx)(c.A,{variant:"caption",color:"success.main",children:"All sites active"})]})]})]})}const ee="2fr 1fr 1fr 1.5fr 1.5fr 48px";function te(e){return e>=1e6?`$${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:e>=1e3?`$${Math.round(e/1e3)}K`:`$${e.toLocaleString()}`}function re(e){const t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return t<1?"today":1===t?"1 day ago":t<7?`${t} days ago`:t<14?"1 week ago":t<30?`${Math.floor(t/7)} weeks ago`:t<60?"1 month ago":`${Math.floor(t/30)} months ago`}function oe(e){if(!e)return"text.disabled";const t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return t<7?"text.secondary":t<28?"warning.main":"error.main"}function ne({groupId:e}){const{selectedGroup:t,selectedGroupStats:r,loading:n,error:s,fetchGroupDetail:$,fetchStats:D,removeWorkspace:W}=(0,U.A)(),z=(0,C.rd)(),M=(0,S.A)((e=>e.updateCurrentProject)),L=(0,S.A)((e=>e.pushToLastFiveWorkspaces)),[O,R]=(0,a.useState)(!1),[q,G]=(0,a.useState)(!1),[H,E]=(0,a.useState)(null),[Q,K]=(0,a.useState)(null),[_,J]=(0,a.useState)(!1),V=e=>{const t={id:e.workspaceId,projectName:e.projectName||"",projectType:e.projectType||"",logo:"",plan:""};L(t),M(t),z.push(N.f.dashboard.deal.overview(e.workspaceId))},Y=(0,a.useCallback)((async()=>{if(Q){J(!0);try{await W(e,Q.workspaceId),D(e),E(`Removed ${Q.projectName||"workspace"} from customer profile`)}finally{J(!1),K(null)}}}),[Q,e,W,D]);if((0,a.useEffect)((()=>{$(e),D(e)}),[e,$,D]),n&&!t)return(0,o.jsx)(u.A,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,o.jsx)(x.A,{})});if(!t)return(0,o.jsx)(h.A,{severity:"error",children:"Group not found"});const ne=r,se=t.members;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(u.A,{sx:{px:{xs:2,sm:3,md:5}},children:[(0,o.jsxs)(l.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:1},children:[(0,o.jsxs)(l.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",component:i.N_,to:N.f.dashboard.accounts,sx:{textDecoration:"none","&:hover":{textDecoration:"underline"}},children:"Customer Profiles"}),(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",children:"·"}),(0,o.jsxs)(c.A,{variant:"overline",color:"primary.main",children:[se.length," sites"]})]}),(0,o.jsx)(d.A,{variant:"outlined",size:"small",startIcon:(0,o.jsx)(w.WL,{icon:"eva:edit-fill"}),onClick:()=>R(!0),"aria-label":"edit",children:"Edit"})]}),(0,o.jsx)(c.A,{variant:"h4",sx:{mb:.5},children:t.groupName}),t.description&&(0,o.jsx)(c.A,{variant:"body1",color:"text.secondary",sx:{mb:3,py:3},children:t.description}),s&&(0,o.jsx)(h.A,{severity:"error",sx:{mb:2},children:s}),ne&&(0,o.jsx)(Z,{stats:ne,members:se}),0===se.length?(0,o.jsxs)(u.A,{sx:{textAlign:"center",py:6},children:[(0,o.jsx)(c.A,{variant:"body1",color:"text.secondary",sx:{mb:1},children:"No workspaces in this customer profile yet."}),(0,o.jsx)(c.A,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"Add an existing workspace below, or create a new project and select this customer profile to pre-fill its defaults."}),(0,o.jsx)(d.A,{variant:"contained",startIcon:(0,o.jsx)(w.WL,{icon:"eva:plus-fill"}),onClick:()=>G(!0),children:"Add Workspace"})]}):(0,o.jsxs)(p.A,{"data-testid":"member-sites-table",children:[(0,o.jsxs)(l.A,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{px:{xs:2,md:3},py:2},children:[(0,o.jsx)(c.A,{variant:"h6",fontWeight:"bold",children:"Member Workspaces"}),(0,o.jsxs)(l.A,{direction:"row",spacing:1,alignItems:"center",children:[(0,o.jsxs)(c.A,{variant:"body2",color:"text.secondary",children:[se.length," total"]}),(0,o.jsx)(d.A,{size:"small",startIcon:(0,o.jsx)(w.WL,{icon:"eva:plus-fill"}),onClick:()=>G(!0),children:"Add"})]})]}),(0,o.jsx)(u.A,{sx:{display:{xs:"none",md:"block"}},"data-testid":"member-table-desktop",children:(0,o.jsxs)(u.A,{sx:{overflowX:"auto"},children:[(0,o.jsxs)(u.A,{sx:{display:"grid",gridTemplateColumns:ee,minWidth:700,px:3,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",children:"Site"}),(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",children:"Budget"}),(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",children:"Proposals"}),(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",children:"Status"}),(0,o.jsx)(c.A,{variant:"overline",color:"text.secondary",textAlign:"right",children:"Last Activity"}),(0,o.jsx)(u.A,{})," "]}),se.map((e=>{var t,r;const n=null==ne?void 0:ne.perMemberStats[e.workspaceId],s=(null===(t=null==ne?void 0:ne.perMemberProposals)||void 0===t?void 0:t[e.workspaceId])||[],a=s.filter((e=>"proposal"===e.type)),i=s.filter((e=>"poster"===e.type)),d=a.length>0?(0,o.jsx)(u.A,{children:a.map(((e,t)=>(0,o.jsxs)(l.A,{direction:"row",spacing:.5,alignItems:"center",children:[(0,o.jsx)(c.A,{variant:"caption",children:(0,I.zB)({optionIndex:e.optionIndex,revisionIndex:e.revisionIndex,siteIdentifier:e.siteIdentifier})}),(0,o.jsxs)(c.A,{variant:"caption",sx:{fontFamily:"monospace"},children:["· ",e.ProposalNumber]})]},t)))}):"",p=i.length>0?(0,o.jsx)(u.A,{children:i.map(((e,t)=>{return(0,o.jsxs)(c.A,{variant:"caption",display:"block",sx:{fontFamily:"monospace"},children:[(r=e.siteIdentifier,"Poster"+(r?` A.${r}`:""))," · ",e.ProposalNumber]},t);var r}))}):"";return(0,o.jsxs)(u.A,{"data-testid":"member-row",onClick:()=>V(e),sx:{display:"grid",gridTemplateColumns:ee,minWidth:700,px:3,py:1.5,borderBottom:"1px solid",borderColor:"divider",alignItems:"center",cursor:"pointer","&:hover":{bgcolor:"action.hover"},"&:last-child":{borderBottom:"none"}},children:[(0,o.jsxs)(u.A,{sx:{minWidth:0},children:[(0,o.jsx)(c.A,{variant:"body2",noWrap:!0,fontWeight:"bold",children:e.projectName||`Worksp
1ace #${e.workspaceId}`}),(e.customerFirstName||e.customerLastName)&&(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",noWrap:!0,display:"block",children:[e.customerFirstName,e.customerLastName].filter(Boolean).join(" ")}),e.customerOrganization&&(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",noWrap:!0,display:"block",children:e.customerOrganization}),(e.salesFirstName||e.salesLastName)&&(0,o.jsx)(c.A,{variant:"caption",color:"text.disabled",noWrap:!0,display:"block",children:[e.salesFirstName,e.salesLastName].filter(Boolean).join(" ")})]}),(0,o.jsx)(c.A,{variant:"body2",children:n?te(n.budget):"â"}),(0,o.jsxs)(u.A,{children:[(0,o.jsx)(j.A,{title:d,arrow:!0,placement:"top",children:(0,o.jsx)(c.A,{variant:"body2",component:"span","data-testid":"proposal-count",sx:{cursor:a.length?"help":"default"},children:n?n.proposalCount:"â"})}),(null!==(r=null==n?void 0:n.posterCount)&&void 0!==r?r:0)>0&&(0,o.jsx)(j.A,{title:p,arrow:!0,placement:"top",children:(0,o.jsxs)(c.A,{variant:"caption",color:"text.secondary",component:"span","data-testid":"poster-count",sx:{display:"block",cursor:"help"},children:[null==n?void 0:n.posterCount," posters"]})})]}),(0,o.jsx)(j.A,{title:T(null==n?void 0:n.primaryStatus),arrow:!0,children:(0,o.jsx)(u.A,{children:(0,o.jsx)(k.JU,{color:F(null==n?void 0:n.primaryStatus),variant:"soft",children:P(null==n?void 0:n.primaryStatus)})})}),(0,o.jsx)(c.A,{variant:"body2",textAlign:"right",sx:{color:oe(e.workspaceDateUpdated)},children:e.workspaceDateUpdated?re(e.workspaceDateUpdated):"â"}),(0,o.jsx)(u.A,{sx:{display:"flex",justifyContent:"center"},children:(0,o.jsx)(j.A,{title:"Remove from customer profile",arrow:!0,children:(0,o.jsx)(v.A,{size:"small","aria-label":`remove ${e.projectName||"workspace"}`,onClick:t=>{t.stopPropagation(),K(e)},sx:{opacity:.4,"&:hover":{opacity:1,color:"error.main"}},children:(0,o.jsx)(w.WL,{icon:"eva:close-fill",width:18})})})})]},e.membershipId)}))]})}),(0,o.jsx)(u.A,{sx:{display:{xs:"block",md:"none"}},"data-testid":"member-cards-mobile",children:se.map((e=>{const t=null==ne?void 0:ne.perMemberStats[e.workspaceId];return(0,o.jsxs)(u.A,{"data-testid":"member-card",onClick:()=>V(e),sx:{px:2,py:1.5,borderBottom:"1px solid",borderColor:"divider",cursor:"pointer","&:hover":{bgcolor:"action.hover"},"&:last-child":{borderBottom:"none"}},children:[(0,o.jsxs)(l.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[(0,o.jsxs)(u.A,{sx:{minWidth:0,flex:1},children:[(0,o.jsx)(c.A,{variant:"body2",fontWeight:"bold",noWrap:!0,children:e.projectName||`Workspace #${e.workspaceId}`}),(e.customerFirstName||e.customerLastName)&&(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",noWrap:!0,display:"block",children:[e.customerFirstName,e.customerLastName].filter(Boolean).join(" ")}),e.customerOrganization&&(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",noWrap:!0,display:"block",children:e.customerOrganization})]}),(0,o.jsx)(v.A,{size:"small","aria-label":`remove ${e.projectName||"workspace"}`,onClick:t=>{t.stopPropagation(),K(e)},sx:{opacity:.4,ml:1,"&:hover":{opacity:1,color:"error.main"}},children:(0,o.jsx)(w.WL,{icon:"eva:close-fill",width:18})})]}),(0,o.jsxs)(l.A,{direction:"row",spacing:2,alignItems:"center",sx:{mt:1},children:[(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",children:t?te(t.budget):"â"}),(0,o.jsx)(c.A,{variant:"caption",color:"text.secondary",children:t?`${t.proposalCount} proposals`:"â"}),(0,o.jsx)(k.JU,{color:F(null==t?void 0:t.primaryStatus),variant:"soft",children:P(null==t?void 0:t.primaryStatus)})]}),(0,o.jsx)(c.A,{variant:"caption",sx:{mt:.5,display:"block",color:oe(e.workspaceDateUpdated)},children:e.workspaceDateUpdated?re(e.workspaceDateUpdated):"â"})]},e.membershipId)}))})]})]}),(0,o.jsx)(B.A,{open:O,onClose:()=>{R(!1),$(e)},editGroup:t}),(0,o.jsx)(X,{open:q,onClose:()=>{G(!1),D(e)},groupId:e}),(0,o.jsxs)(g.A,{open:!!Q,onClose:()=>K(null),maxWidth:"xs",fullWidth:!0,children:[(0,o.jsx)(b.A,{children:"Remove Workspace"}),(0,o.jsx)(A.A,{children:(0,o.jsxs)(f.A,{children:["Remove ",(0,o.jsx)("strong",{children:(null==Q?void 0:Q.projectName)||`Worksp
1ace #${null==Q?void 0:Q.workspaceId}`})," from this customer profile? The workspace itself is not deleted â only the membership."]})}),(0,o.jsxs)(y.A,{children:[(0,o.jsx)(d.A,{onClick:()=>K(null),disabled:_,children:"Cancel"}),(0,o.jsx)(d.A,{onClick:Y,color:"error",variant:"contained",disabled:_,children:_?"Removing...":"Remove"})]})]}),(0,o.jsx)(m.A,{open:!!H,autoHideDuration:3e3,onClose:()=>E(null),message:H})]})}function se(){const{groupId:e}=(0,s.g)();return!e||isNaN(Number(e))?(0,o.jsx)(h.A,{severity:"error",children:"Invalid group ID"}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.mg,{children:(0,o.jsx)("title",{children:"Group Detail"})}),(0,o.jsx)(ne,{groupId:Number(e)})]})}},GhOb(e,t,r){function o(e){return null!==e&&""!==e}function n(e,t={}){const r=t.prose?"Option":"Opt",n=t.prose?"Revision":"Rev",s=[];var a;return o(e.optionIndex)&&s.push(0===(a=e.optionIndex)||"0"===a?`Original (${r} 0)`:`${r} ${e.optionIndex}`),o(e.revisionIndex)&&s.push(`${n} ${e.revisionIndex}`),o(e.siteIdentifier)&&s.push(`Site ${e.siteIdentifier}`),s.join(" · ")}function s(e){const t=[`Use proposal ${e.proposalNumber}`];e.projectName&&t.push(e.projectName);const r=n(e);return""!==r&&t.push(r),t.push(i(e.totalPrice)),t.push(l(e.dateCreated)),e.status&&t.push(e.status),e.projectNumber&&t.push(e.projectNumber),t.join(", ")}r.d(t,{K8:()=>d,O2:()=>i,S_:()=>c,WH:()=>o,_1:()=>s,zB:()=>n});const a=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});function i(e){return null===e||0===e?"N/A":a.format(e)}function l(e){if(null===e||""===e)return"N/A";const t=/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00`:e,r=new Date(t);return Number.isNaN(r.getTime())?"N/A":r.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function c(e){return[i(e.totalPrice),l(e.dateCreated),e.status].filter((e=>null!==e&&""!==e)).join(" · ")}function d(e){return[e.proposalNumber,e.projectNumber].filter((e=>null!==e&&""!==e)).join(" · ")}},nzaU(e,t,r){r.d(t,{SP:()=>n,ps:()=>s,qY:()=>a});const o={complete:"Quoted","in-progress":"In Progress",review:"In Review","not-started":"Not Started",attention:"Attention",cancelled:"Cancelled",unknown:"Unknown"},n=e=>{if(!e||"---"===e)return"unknown";const t=e.toLowerCase().trim();return["complete","completed","completed projects","done","finished","approved"].includes(t)?"complete":["in progress","in progress (tasked)","rushes"].includes(t)?"in-progress":["submitted","in review","needs review","needs review or on hold","waiting for video/digideck or justin","check channel"].includes(t)?"review":["not started","new projects (untasked)","draft","incoming projects","proposal requests","unknown"].includes(t)?"not-started":["rejected","attention","on hold","audit/re-lock"].includes(t)?"attention":"cancelled"===t?"cancelled":"not-started"},s=e=>{if(!e||"---"===e)return"";const t=n(e);return o[t]},a=e=>{switch(n(e)){case"complete":return"success";case"in-progress":return"warning";case"review":return"info";case"attention":case"cancelled":return"error";default:return"default"}}}}]); 2//# sourceMappingURL=8465.917b7bacc6e660e026a7.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.