1import{f as w,a as pe,b as e,A as ve,M as R,j as g,t as v,l as o,d as W,q as h,v as u,p as d,S as U,O as ke}from"./web-BUHQE0Wf.js";import{d as a}from"./ISASYZ5H-S5GGxXwb.js";import{u as Se,s as Ce}from"./app-provide-tenant-9oVRNj6t.js";import{d as xe,P as Be,s as we}from"./ProfileAvatarGroup-BjR3QY0S.js";import{G as c,a0 as M,v as Ue}from"./_...404_-BMCgpLOw.js";import{d as i}from"./Dialog-DMtc3cqF.js";import{S as Me}from"./SvgX-B24sudcj.js";import{b as De}from"./blockUserModalStyles-DEqJ8iKO.js";import{u as Oe}from"./app-provide-eventbus-Dl7h8REP.js";import"./MetaData-H4Za0Aak.js";import"./index-Dq5glPJK.js";var Te=v("<br>"),p=v("<div>"),Ee=v("<div><!$><!/><!$><!/><!$><!/><!$><!/>"),Ae=v("<span>"),Ne=v("<div><div><!$><!/><div><!$><!/><span>@<!$><!/></span></div></div><section><h3>This user will no longer be able to:</h3><ul><li>See your post, comments, replies on any community</li><li>Tag or find your profile through search</li><li>Follow you (if they are currently following you, you will be unfollowed)</li><li>Join your community (if they are currently in your community already, they will be blocked)</li></ul></section><section><h3>You will no longer be able to:</h3><ul><li>See <span>@<!$><!/>'s</span> posts, comments, replies on any community</li><li>Tag or find their profile through search</li><li>Follow them (if you are currently following them, they will be unfollowed)</li><li>Find their community through Discovery</li></ul></section><!$><!/><!$><!/>");const Je=()=>{const re=Oe(),{refreshData:ne}=xe(),[j,q]=w(!1),[le,z]=w(!1),{currentModal:ie,clearModal:oe}=Se(),[k,G]=w(!1),[J,$]=w(),D=pe(()=>{const n=ie();return n?.type==="BLOCK_USER"?n.options:void 0}),O=()=>{ke(()=>{oe(),q(!1),z(!1),$("")})},T=n=>{n||(j()?se():O())},se=()=>{const n=D()?.onBlockUser;re.emitEvent("locals.user.onBlockUser",{userId:D()?.profile.id??0}),O(),n?.(),ne({profile:!0}
1).catch(Ce)},L=(n,s)=>{k()||($(""),G(!0),we.blockUser({userId:n,check_is_supporter:s}).then(r=>{r?.code==="OK"?r.data.is_blocked?q(!0):!r.data.is_blocked&&r.data.is_supporter?z(!0):$("Unable to block user"):$(`Unable to block user: ${r?.code??"Unknown error"}`)}).catch(r=>{$("Unable to block user")}).finally(()=>{G(!1)}))},t=De(),E=()=>e(a.CloseButton,{get class(){return c(i().closeButton,t.closeButton)},get children(){return e(Me,{})}});return e(U,{get when(){return D()},keyed:!0,children:({profile:n})=>e(a.Root,{open:!0,modal:!0,onOpenChange:T,get children(){return e(a.Portal,{get children(){return[e(a.Overlay,{get class(){return i().overlay},onClick:O}),e(ve,{get children(){return[e(R,{get when(){return j()},get children(){var s=g(p);return o(s,e(a.Content,{get class(){return c(i().content,t.confirmContent)},get children(){return[e(a.Title,{get class(){return c(i().header,i().title,t.title)},get children(){return["You have blocked user",g(Te),"@",W(()=>n.username)]}}),e(a.Description,{get class(){return c(i().description,t.confirmDescription)},get children(){return["You can manage your Block list on your profile.",e(M,{onClick:async()=>T(!1),get class(){return t.finalConfirmButton},children:"OK"}),W(()=>E())]}})]}})),h(()=>u(s,i().positioner)),s}}),e(R,{get when(){return le()},get children(){var s=g(p);return o(s,e(a.Content,{get class(){return c(i().content,t.confirmContent)},get children(){return[e(a.Title,{get class(){return c(i().header,i().title,t.title)},children:"Are you sure you want to block this user?"}),e(a.Description,{get class(){return c(i().description,t.confirmDescription)},get children(){return["This user is a supporter in your community. If you block them, they will also be blocked from your community and any active renewing subscription they have in your community will also be canceled. Are you sure you want to block this user?",(()=>{var r=g(Ee),m=r.firstChild,[S,C]=d(m.nextSibling),A=S.nextSibling,[b,N]=d(A.nextSibling),x=b.nextSibling,[B,_]=d(x.nextSibling),P=B.nextSibling,[Y,F]=d(P.nextSibling);return o(r,e(M,{onClick:()=>L(n.id,!1),get class(){return c(t.button,t.submitButton)},fullWidth:!0,get disabled(){return k()},children:"Yes, Block User"}),S,C),o(r,e(M,{onClick:()=>T(!1),get class(){return c(t.button,t.cancelButton)},fullWidth:!0,get disabled(){return k()},children:"No, Cancel"}),b,N),o(r,e(U,{get when(){return J()},keyed:!0,children:I=>(()=>{var y=g(p);return o(y,I),h(()=>u(y,t.error)),y})()}),B,_),o(r,E,Y,F),h(()=>u(r,t.confirmButtonContainer)),r})()]}})]}})),h(()=>u(s,i().positioner)),s}}),e(R,{when:!0,get children(){var s=g(p);return o(s,e(a.Content,{get class(){return c(i().content,t.mainContent)},get children(){return[e(a.Title,{get class(){return c(i().header,i().title,t.mainTitle)},children:"Block User"}),e(a.Description,{get class(){return i().description},get children(){var r=g(Ne),m=r.firstChild,S=m.firstChild,[C,A]=d(S.nextSibling),b=C.nextSibling,N=b.firstChild,[x,B]=d(N.nextSibling),_=x.nextSibling,P=_.firstChild,Y=P.nextSibling,[F,I]=d(Y.nextSibling),y=m.nextSibling,X=y.nextSibling,ae=X.firstChild,ce=ae.nextSibling,ue=ce.firstChild,de=ue.firstChild,K=de.nextSibling,ge=K.firstChild,he=ge.nextSibling,[H,me]=d(he.nextSibling);H.nextSibling;var be=X.nextSibling,[Q,fe]=d(be.nextSibling),$e=Q.nextSibling,[_e,ye]=d($e.nextSibling);return o(m,e(Be,{get class(){return t.avatar},get src(){return n.avatar},size:80,get label(){return n.name}}),C,A),o(b,e(U,{get when(){return n.name},get children(){var l=g(Ae);return o(l,()=>n.name),h(()=>u(l,t.name)),l}}),x,B),o(_,()=>n.username,F,I),o(K,()=>n.username,H,me),o(r,e(M,{onClick:()=>L(n.id,!0),get class(){return c(t.button,t.submitButton)},fullWidth:!0,get disabled(){return k()},color:"inherit",children:"Block User"}),Q,fe),o(r,e(U,{get when(){return J()},keyed:!0,children:l=>(()=>{var f=g(p);return o(f,l),h(()=>u(f,t.error)),f})()}),_e,ye),h(l=>{var f=t.description,V=t.avatarContainer,Z=t.nameContainer,ee=t.username,te=Ue({color:"text.primary"});return f!==l.e&&u(r,l.e=f),V!==l.t&&u(m,l.t=V),Z!==l.a&&u(b,l.a=Z),ee!==l.o&&u(_,l.o=ee),te!==l.i&&u(K,l.i=te),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r}}),W(()=>E())]}})),h(()=>u(s,c(i().positioner,t.mainPositioner))),s}})]}})]}})}})})};export{Je 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.