import{ao as n,av as u,ah as s,ap as d,cb as f,cf as v,L as g}from"./app-k0jcl5PQ.js";import{E as h,a as l}from"./BzIt8QkE.chunk.js";const _="_removeRecipient_3yabf_1",U="_recipientItem_3yabf_5",x="_showSpinner_3yabf_8",y="_avatarContainer_3yabf_11",S="_recipientDetails_3yabf_15",b="_recipientDetailsWithRemoveButton_3yabf_18",N={removeRecipient:_,recipientItem:U,showSpinner:x,avatarContainer:y,recipientDetails:S,recipientDetailsWithRemoveButton:b},R="shared.userRecipientItemMetadata",r=g.encloseNamespace(R);function C(e){const t=s.getUserType(e),i=s.getUserRole(e);if(t===f.Staff)return i===v.Admin?r("admin"):r("staff");const a=s.getYearGroup(e);return a!=null&&a.name&&a.name!=="Learners"?a.name:r("student")}function j({user:e,anonymiseUsers:t,showDisplayName:i}){var a;if(e.sessionId||e.deleted){const m=l(e,t),o=m.split(" ").filter(c=>!!c);return{name:m,surname:o.slice(1).join(" "),avatarUrl:null}}return{name:t?l(e,!0):i?s.getDisplayName(e):s.getFullName(e),surname:e.surname,avatarUrl:(a=e.avatar)==null?void 0:a.url}}I.defaults={showSubText:!0};function I(e){const{name:t,surname:i,avatarUrl:a}=j(e);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`${N.avatarContainer} ${e.avatarClassName} d-inline-block flex-shrink-0`,children:n.jsx(h,{imageUrl:a,imageCdnUrl:e.imageCdnUrl,initials:s.getInitials(t,i),type:!e.anonymiseUsers&&(e.user.sessionId||e.user.deleted)?"anon":void 0,anonymiseUsers:e.anonymiseUsers,anonymousSvgSize:u.Small})}),n.jsxs("div",{className:e.detailsClassName,children:[n.jsx("h4",{className:d("font-size-normal fw-normal m-0",e.nameClassName),children:t}),e.showSubText&&"id"in e.user&&n.jsx("p",{className:"text-secondary m-0",children:e.getSubText?e.getSubText(e.user):C(e.user)})]})]})}export{I as U,N as s};
//# sourceMappingURL=CnoMMtVD.chunk.js.map
