PageSourceSearch

https://ui.contactsplus.com/assets/TeamMembersPage-Dh0R-ni4.js

js contactsplus.com collected 2026-10-02 10:16:57 UTC 11,363 bytes, 1 lines download raw bytes

1import{_ as U,C as G,o as Y,H as le,a5 as ue,m as s,c as i,b as t,aI as z,e as u,y as $,F as P,f as m,g as k,x as ce,t as y,z as de,T as me,h as J,r as Q,l as b,L as ve,a1 as pe,O as ye,u as fe,E as be,B as K,q as ke,k as ge,D as we,ax as he}from"./index-CZs8E7p5.js";import{B as Ce,u as Te}from"./BookActivityPreviewPanel-sUL0Lqdt.js";import{u as X}from"./useDismissableMenu-DvSy2zO-.js";import{g as Z,S as xe,p as q,h as Ie,d as Me,i as _e,s as $e}from"./team-helpers-7rg_xhCn.js";import{a as Re}from"./avatarColor-gmfTd8bI.js";import{_ as Se}from"./Loading-Dtog0XF_.js";import{S as Pe}from"./SkeletonList-Cspu2ZsC.js";/* empty css                                                                     */const Be=["aria-label"],Ae={key:0,class:"check","aria-hidden":"true"},Oe={key:0,class:"check","aria-hidden":"true"},Fe=["disabled","title"],Le={key:0,class:"reason"},Ne={__name:"MemberKebabMenu",props:{member:{type:Object,required:!0},team:{type:Object,default:null},adminCount:{type:Number,default:0},isSelf:{type:Boolean,default:!1}},emits:["make-admin","change-to-member","remove","set-permission"],setup(v,{emit:N}){const x=v,M=N,{open:r,toggle:c,close:g,triggerProps:E,menuProps:B,wrapRef:_,menuRef:l}=X({registry:"team-members-row-kebab"}),p=Q(null),I=Q({position:"fixed",visibility:"hidden"});function R(){const d=p.value,a=l.value;if(!d||!a)return;const w=6,f=d.getBoundingClientRect(),T=a.getBoundingClientRect().height,L=window.innerHeight-f.bottom,H=f.top,V=L<T+w&&H>L;I.value={position:"fixed",visibility:"visible",right:`${Math.max(0,window.innerWidth-f.right)}px`,...V?{bottom:`${Math.max(0,window.innerHeight-f.top+w)}px`}:{top:`${f.bottom+w}px`}}}G(r,async d=>{d&&(I.value={position:"fixed",visibility:"hidden"},await ve(),R())});function S(){r.value&&g()}Y(()=>window.addEventListener("scroll",S,!0)),le(()=>window.removeEventListener("scroll",S,!0));const D=b(()=>Z(x.member,x.team)),C=b(()=>{var d;return((d=x.member)==null?void 0:d.role)!=="admin"?null:D.value?"The book owner can't be changed.":x.adminCount<=1?"The last admin can't be changed.":null});function W(){g(),M("make-admin")}function A(){C.value||(g(),M("change-to-member"))}function O(){g(),M("remove")}function F(d){var a;g(),d!==((a=x.member)==null?void 0:a.contactPermission)&&M("set-permission",d)}return(d,a)=>{var f;const w=ue("router-link");return s(),i("div",{ref_key:"wrapRef",ref:_,class:"menu-wrap",onClick:a[3]||(a[3]=J(()=>{},["stop"]))},[t("button",z({ref_key:"triggerRef",ref:p,type:"button",class:"row-kebab","aria-label":`Actions for ${v.member.name||v.member.email||"this member"}`},u(E),{onClick:a[0]||(a[0]=(...T)=>u(c)&&u(c)(...T))}),[...a[4]||(a[4]=[t("svg",{viewBox:"0 0 24 24"},[t("circle",{cx:"5",cy:"12",r:"1.6"}),t("circle",{cx:"12",cy:"12",r:"1.6"}),t("circle",{cx:"19",cy:"12",r:"1.6"})],-1)])],16,Be),(s(),$(me,{to:"body"},[u(r)?(s(),i("div",z({key:0,ref_key:"menuRef",ref:l,class:"row-menu",style:I.value},u(B)),[v.member.role!=="admin"?(s(),i(P,{key:0},[t("button",{type:"button",role:"menuitem",class:"row-menu-item",onClick:a[1]||(a[1]=T=>F("view"))},[v.member.contactPermission==="view"?(s(),i("span",Ae,"✓")):m("",!0),a[5]||(a[5]=k(" Can view ",-1))]),t("button",{type:"button",role:"menuitem",class:"row-menu-item",onClick:a[2]||(a[2]=T=>F("edit"))},[v.member.contactPermission!=="view"?(s(),i("span",Oe,"✓")):m("",!0),a[6]||(a[6]=k(" Can edit ",-1))]),a[7]||(a[7]=t("div",{class:"row-menu-sep",role:"separator"},null,-1))],64)):m("",!0),v.member.role!=="admin"?(s(),i("button",{key:1,type:"button",role:"menuitem",class:"row-menu-item",onClick:W}," Make admin ")):(s(),i("button",{key:2,type:"button",role:"menuitem",class:ce(["row-menu-item",{"row-menu-item--stacked":!!C.value}]),disabled:!!C.value,title:C.value||void 0,onClick:A},[a[8]||(a[8]=k(" Change to member ",-1)),C.value?(s(),i("span",Le,y(C.value),1)):m("",!0)],10,Fe)),v.isSelf&&((f=v.team)!=null&&f.id)?(s(),$(w,{key:3,to:`/teams/${v.team.id}/sharing`,role:"menuitem",class:"row-menu-item",onClick:u(g)},{default:de(()=>[...a[9]||(a[9]=[k(" Change what I share… ",-1)])]),_:1},8,["to","onClick"])):m("",!0),a[10]||(a[10]=t("div",{class:"row-menu-sep",role:"separator"},null,-1)),t("button",{type:"button",role:"menuitem",class:"row-menu-item row-menu-item--danger",onClick:O}," Remove from book… ")],16)):m("",!0)]))],512)}}},Ee=U(Ne,[["__scopeId","data-v-0c15ab10"]]),De={class:"team-members"},We={class:"settings-block"},He={class:"settings-block-label"},Ve={class:"count-pill"},ze={class:"settings-card"},Qe=["src","alt"],je={class:"info"},Ke={key:0,class:"role-pill owner"},qe={key:1,class:"role-pill admin"},Ue={class:"meta"},Ge={class:"m-share",title:"What this member shares into the book."},Ye={class:"val"},Je={key:0,class:"settings-block"},Xe={class:"settings-block-label"},Ze={class:"count-pill"},et={key:0,class:"settings-card"},tt={class:"info"},nt={class:"meta"},ot={class:"pend-meta"},at={class:"pend-actions"},st=["onClick"],it=["onClick"],rt=["onClick"],lt={key:1,class:"empty"},ut={key:2,class:"team-members__empty"},ct={__name:"TeamMembersPage",emits:["open-invite"],setup(v,{emit:N}){const x=N,M=ke();ge();
1const r=pe(),c=ye(),g=fe(),E=be(),{confirm:B}=he(),_=Q(!1),l=b(()=>{var e;return M.params.teamId||((e=r.teams[0])==null?void 0:e.id)}),p=b(()=>r.teams.find(e=>e.id===l.value)||null),I=b(()=>r.membersByTeam[l.value]||[]),R=b(()=>r.invitesByTeam[l.value]||[]),S=b(()=>_e(p.value)),D=Te(p),C=b(()=>$e(I.value,p.value)),W=b(()=>I.value.filter(e=>e.role==="admin").length),A=b(()=>{var e,n;return((e=g.account)==null?void 0:e.accountId)??((n=g.account)==null?void 0:n.id)??null});function O(e){return Z(e,p.value)}function F(e){return A.value!=null&&(e==null?void 0:e.accountId)!=null&&String(e.accountId)===String(A.value)}function d(e){return e.photo?void 0:Re(e.accountId,E.isDark)}const a={color:"var(--text2)",background:"var(--hover)"};function w(e){return e.name||e.email||""}const{open:f,toggle:T,close:L,triggerProps:H,wrapRef:V}=X();async function ee(e){try{await r.updateMember(l.value,e.accountId,{role:"admin"})}catch{c.addToast({type:"error",text:"Failed to update member role",duration:2.5})}}async function te(e){try{await r.updateMember(l.value,e.accountId,{role:"member"})}catch{c.addToast({type:"error",text:"Failed to update member role",duration:2.5})}}async function ne(e,n){try{await r.updateMember(l.value,e.accountId,{contactPermission:n}),c.addToast({type:"info",text:"Changes saved",duration:2.5})}catch{c.addToast({type:"error",text:"Couldn't save settings",duration:2.5})}}async function oe(e){var o;if(await B(`They'll lose access to "${((o=p.value)==null?void 0:o.name)||"this book"}" right away. Contacts they already synced to their own account are theirs to keep.`,{title:`Remove ${w(e)}?`,confirmText:"Remove",danger:!0}))try{await r.removeMember(l.value,e.accountId),r.refreshInviteQuota(l.value).catch(h=>{})}catch{c.addToast({type:"error",text:"Failed to remove member",duration:2.5})}}async function ae(e){const n=e.url||"";if(!n){c.addToast({type:"error",text:"Invite link not available",duration:2.5});return}try{await navigator.clipboard.writeText(n),c.addToast({type:"info",text:"Invite link copied",duration:2})}catch{c.addToast({type:"error",text:"Failed to copy link",duration:2.5})}}async function se(e){try{await r.resendInvite(l.value,e.id),c.addToast({type:"info",text:`Invite resent to ${e.email}`,duration:2})}catch(n){(n==null?void 0:n.status)===404?c.addToast({type:"error",text:"Resend isn't available yet.",duration:2.5}):c.addToast({type:"error",text:"Failed to resend invite",duration:2.5})}}async function ie(e){var o;if(await B(`${e.email} won’t be able to join “${((o=p.value)==null?void 0:o.name)||"this book"}” with the invitation they received.`,{title:"Revoke this invite?",confirmText:"Revoke invite",danger:!0}))try{await r.deleteInvite(l.value,e.id),r.refreshInviteQuota(l.value).catch(h=>{})}catch{c.addToast({type:"error",text:"Failed to revoke invite",duration:2.5})}}function re(e){const n=Me(e.sent??e.created);return(e.timesResent>0?"Resent ":"Invited ")+n}async function j(e){if(e){_.value=!0;try{await Promise.all([r.fetchMembers(e),r.fetchInvites(e)])}finally{_.value=!1}}}return Y(async()=>{r.teams.length||await r.fetchTeams(),await j(l.value)}),G(l,e=>{e&&j(e)}),(e,n)=>(s(),i("div",De,[p.value?(s(),i(P,{key:0},[t("div",We,[t("div",He,[n[4]||(n[4]=k(" Members ",-1)),t("span",Ve,y(I.value.length),1),u(xe)?(s(),i("div",{key:0,ref_key:"activityPreviewWrapEl",ref:V,class:"activity-preview-wrap",onClick:n[1]||(n[1]=J(()=>{},["stop"]))},[t("button",z({type:"button",class:"label-link"},u(H),{onClick:n[0]||(n[0]=(...o)=>u(T)&&u(T)(...o))}),[...n[3]||(n[3]=[t("svg",{viewBox:"0 0 24 24"},[t("path",{d:"M3 12h4l3 8 4-16 3 8h4"})],-1),k(" View activity ",-1)])],16),u(f)?(s(),$(Ce,{key:0,class:"activity-preview-panel","team-id":l.value,onClose:u(L)},null,8,["team-id","onClose"])):m("",!0)],512)):m("",!0)]),t("div",ze,[(s(!0),i(P,null,K(C.value,o=>(s(),i("div",{key:o.accountId,class:"settings-list-row"},[t("span",{class:"m-ava",style:we(d(o))},[o.photo?(s(),i("img",{key:0,src:o.photo,alt:w(o),referrerpolicy:"no-referrer",loading:"lazy"},null,8,Qe)):(s(),i(P,{key:1},[k(y(u(q)(o.name||o.email)),1)],64))],4),t("div",je,[t("b",null,[k(y(w(o))+" ",1),O(o)?(s(),i("span",Ke,"OWNER")):o.role==="admin"?(s(),i("span",qe,"ADMIN")):m("",!0)]),t("div",Ue,y(o.email),1)]),t("div",Ge,[n[5]||(n[5]=t("svg",{viewBox:"0 0 24 24"},[t("path",{d:"M21 12a9 9 0 1 1-3-6.7L21 8"}),t("path",{d:"M21 3v5h-5"})],-1)),n[6]||(n[6]=k(" Contributes: ",-1)),t("span",Ye,y(u(Ie)(o)),1)]),S.value&&!O(o)?(s(),$(Ee,{key:0,member:o,team:p.value,"admin-count":W.value,"is-self":F(o),onMakeAdmin:h=>ee(o),onSetPermission:h=>ne(o,h),onChangeToMember:h=>te(o),onRemove:h=>oe(o)}
1,null,8,["member","team","admin-count","is-self","onMakeAdmin","onSetPermission","onChangeToMember","onRemove"])):m("",!0)]))),128))]),_.value?(s(),$(Pe,{key:0,variant:"team",count:3,style:{padding:"12px 0"}})):m("",!0)]),S.value?(s(),i("div",Je,[t("div",Xe,[n[7]||(n[7]=k(" Pending invites ",-1)),t("span",Ze,y(R.value.length),1)]),R.value.length?(s(),i("div",et,[(s(!0),i(P,null,K(R.value,o=>(s(),i("div",{key:o.id,class:"settings-list-row"},[t("span",{class:"m-ava",style:a},y(u(q)(o.email)),1),t("div",tt,[t("b",null,y(o.email),1),t("div",nt,"Invited as "+y(o.role??"member")+" · waiting to accept",1)]),t("span",ot,y(re(o)),1),t("div",at,[t("button",{type:"button",class:"link-btn",onClick:h=>ae(o)},"Copy link",8,st),t("button",{type:"button",class:"link-btn",onClick:h=>se(o)},"Resend",8,it),t("button",{type:"button",class:"link-btn danger",onClick:h=>ie(o)},"Revoke",8,rt)])]))),128))])):(s(),i("div",lt,[n[8]||(n[8]=t("span",{class:"e-ic"},[t("svg",{viewBox:"0 0 24 24"},[t("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),t("path",{d:"M3 7l9 6 9-6"})])],-1)),n[9]||(n[9]=t("h4",null,"No invites waiting",-1)),n[10]||(n[10]=t("p",null,"Invite someone and they'll appear here until they accept.",-1)),u(D).canInviteMoreMembers.value?(s(),i("button",{key:0,type:"button",class:"btn btn-secondary",onClick:n[2]||(n[2]=o=>x("open-invite"))}," Invite members ")):m("",!0)]))])):m("",!0)],64)):_.value||u(r).loading?(s(),$(Se,{key:1})):(s(),i("div",ut,[...n[11]||(n[11]=[t("p",null,"That shared address book isn't available.",-1)])]))]))}},gt=U(ct,[["__scopeId","data-v-9aa5f6d4"]]);export{gt as default};

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.