PageSourceSearch

https://endgame.ai/assets/ClubsView-Di3HMH31.js

js endgame.ai collected 2026-10-02 19:34:11 UTC 10,455 bytes, 1 lines download raw bytes

1import{u as A,c as L,d as G,a3 as j,H as t,f as l,F as q,i as O,p as k,q as P,g as u,Q as U,l as i,m as a,O as B,j as I,Z as E,v as z,cd as J,n as F,fG as H,f7 as T,fH as K,S as N,B as b,bX as Y,c3 as Q,_ as W,ac as X,T as Z,Y as D}from"./index-A0Cx28Hu.js";import{J as ee}from"./JoinClubModal-Db-igtTg.js";import{C as te}from"./CreateClubFormModal-B5qi5-FZ.js";const le={class:"space-y-2"},ne={class:"bg-nd-bg-secondary rounded-lg p-4 hover:bg-nd-bg-hover transition-colors"},se={class:"flex items-start justify-between gap-3"},ae={class:"flex items-start gap-3 flex-1 min-w-0"},ue={class:"w-[50px] h-[50px] shrink-0"},ie={class:"flex-1 min-w-0 space-y-2"},re={class:"flex items-center gap-2 flex-wrap"},oe={key:0,class:"inline-flex items-center px-2 py-0.5 bg-nd-primary rounded text-xs text-nd-white"},ce={key:1,class:"inline-flex items-center px-2 py-0.5 bg-nd-overlay-light rounded text-xs text-nd-text-tertiary"},de={class:"text-base md:text-lg font-normal text-nd-text-primary flex items-center gap-1.5 min-w-0"},be={key:0,class:"tooltip shrink-0 inline-flex top-[1px]"},xe={class:"tooltiptext"},pe={class:"truncate"},ve=["onClick"],me={key:3,class:"ml-auto text-xs text-nd-text-muted italic"},ye={key:0,class:"text-xs text-nd-text-disabled -mt-1.5"},fe={key:1,class:"text-xs text-nd-text-muted italic whitespace-pre-line break-words line-clamp-2"},he={key:2,class:"text-xs text-nd-text-disabled"},we={class:"flex items-center gap-2 text-xs text-nd-text-muted"},ge={class:"flex items-center gap-1"},Ce={key:0,class:"inline-flex items-center px-2 py-0.5 bg-orange-500/20 text-orange-400 rounded text-xs"},ke={key:0,class:"inline-flex items-center px-2 py-0.5 bg-red-600 rounded text-xs text-nd-white"},Ie={key:1,class:"inline-flex items-center px-2 py-0.5 bg-red-600 rounded text-xs text-nd-white"},_={__name:"ClubsList",props:{clubs:Array,withMemberSince:Boolean,withIntro:Boolean,withJoinRequest:Boolean,withInClubTag:Boolean,userClubs:Array},emits:"updated",setup(y,{emit:f}){const{t:h}=A(),c=L(ee),r=y,x=f;function p(e){const s=H.crossClubsInvitationsByClub.value?.find((o=>o.clubId===e));return s?s.count:0}function v(e){const s=r.userClubs.find((o=>o.clubId==e));return s?s.relation:h("noneText")}function m(e){const s=r.userClubs.find((o=>o.clubId==e));return!!s&&s.relation=="Owner"}function w(e){const s=r.userClubs.find((o=>o.clubId==e));return!!s&&s.relation=="Admin"}function $(e){const s=r.userClubs.find((o=>o.clubId==e));return!!s&&s.relation=="Member"}function d(e){const s=r.userClubs.find((o=>o.clubId==e));return!s||s.relation=="None"}return G((()=>{c.closeAll()})),(e,s)=>{const o=j("font-awesome-icon"),R=j("router-link");return t(),l("div",le,[(t(!0),l(q,null,O(y.clubs,(n=>(t(),l("div",{key:n.clubId},[k(R,{to:"/club/"+n.clubId,class:"block"},{default:P((()=>[u("div",ne,[u("div",se,[u("div",ae,[u("div",ue,[k(U,{artworkPath:`/img/club/${n.clubId}`,sizePx:50,requestSizePx:100,rounded:"full"},null,8,["artworkPath"])]),u("div",ie,[u("div",re,[w(n.clubId)?(t(),l("span",oe,i(e.$t("adminLabel")),1)):a("",!0),y.withInClubTag&&$(n.clubId)?(t(),l("span",ce,i(e.$t("inClub")),1)):a("",!0),u("h3",de,[n.isOfficial?(t(),l("span",be,[s[1]||(s[1]=u("span",{class:"ch-verified-icon",style:{width:"16px",height:"16px"}},null,-1)),u("span",xe,i(e.$t("officialClubText")),1)])):a("",!0),u("span",pe,i(n.title),1)]),y.withJoinRequest&&d(n.clubId)?(t(),l("button",{key:2,onClick:B((S=>(async function(C){const{isCanceled:g}=await c.reveal({clubId:C.clubId,clubTitle:C.title});g||x("updated")})(n)),["prevent"]),class:"ml-auto text-xs text-nd-text-secondary hover:text-nd-text-primary border border-nd-border-strong hover:border-nd-text-disabled rounded-full px-3 py-1 transition-colors cursor-pointer"},i(e.$t("joinRequest")),9,ve)):a("",!0),y.withJoinRequest&&v(n.clubId)==="Pending"?(t(),l("span",me," ("+i(e.$t("pendingClubRequest"))+") ",1)):a("",!0)]),m(n.clubId)?(t(),l("div",ye,i(e.$t("createdByYouText")),1)):a("",!0),y.withIntro&&n.intro?(t(),l("div",fe,i(n.intro),1)):a("",!0),y.withMemberSince?(t(),l("div",he,i(e.$t("clubMemberSinceText"))+": "+i(I(E)(n.joinedAt).format("LL")),1)):a("",!0),u("div",we,[u("span",ge,[k(o,{icon:"fa-solid fa-people-group"}),z(" "+i(n.membersCount)+" "+i(e.$t(I(J)(n.membersCount,"member")).toLowerCase()),1)]),n.pendingRequestsCount>0?(t(),l("span",Ce,i(n.pendingRequestsCount)+" "+i(e.$t(I(J)(n.pendingRequestsCount,"request")).toLowerCase()),1)):a("",!0),p(n.clubId)>0?(t(),l("span",{key:1,class:F(["w-[20px] min-w-[20px] h-[20px] rounded-full bg-nd-alert text-nd-white text-[12px] font-semibold inline-flex items-center justify-center leading-[20px]",p(n.clubId)>9?"w-auto px-1.5":""])},i(p(n.clubId)>99?"99+":p(n.clubId)),3)):a("",!0)])])]),u("div",{class:"flex items-start gap-1.5 shrink-0",onClick:s[0]||(s[0]=B((()=>{}),["prevent"]))}
1,[n.isClubSuspended?(t(),l("span",ke,i(e.$t("suspendedStatusText")),1)):a("",!0),n.isClubBlocked?(t(),l("span",Ie,i(e.$t("blockedStatusText")),1)):a("",!0)])])])])),_:2},1032,["to"])])))),128))])}}},$e={key:0,class:"flex justify-center py-10"},Te={__name:"MyClubs",setup(y){let f=[],h=[];const c=b(!1);async function r(){c.value=!0,f=await T.getMyClubs(),h=f.map((function(x){return{clubId:x.clubId,relation:x.isOwner?"Owner":x.isAdmin?"Admin":"Member"}})),c.value=!1,K()}return r(),(x,p)=>(t(),l(q,null,[c.value?(t(),l("div",$e,[...p[0]||(p[0]=[u("div",{class:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-nd-text-primary"},null,-1)])])):a("",!0),c.value?a("",!0):(t(),N(_,{key:1,clubs:I(f),withMemberSince:!0,withIntro:!1,withJoinRequest:!1,withInClubTag:!1,userClubs:I(h),onUpdated:r},null,8,["clubs","userClubs"]))],64))}},qe={class:"space-y-4"},Re={class:"w-full md:w-[400px]"},Me={key:0,class:"space-y-3"},je={class:"text-sm font-medium text-nd-text-tertiary"},_e={class:"text-sm font-medium text-nd-text-tertiary"},Ae={key:0,class:"flex justify-center py-10"},Se={key:1,class:"space-y-0"},Be={key:2,class:"flex justify-center py-6"},Je={key:3,class:"flex justify-center py-4"},Le={__name:"AllClubs",props:{isGuest:Boolean},setup(y){const{t:f}=A();let h=[];const c=b([]);let r=0;const x=b(!1),p=b(!1),v=b(!1),m=b(""),w=b([]),$=b(!1),d=b(""),e={};async function s(){p.value=!0,h=await T.getMyClubRelations(),r=0,c.value=[],await o(r),p.value=!1}async function o(C){const g=await T.getAllClubs(C);x.value=g.hasMore,g.clubs.length>0&&c.value.push(g.clubs)}async function R(){v.value=!0,r++,await o(r),v.value=!1}async function n(){w.value=[],m.value.length>40?d.value=f("tooLongClubNameWarningText"):(d.value="",m.value.length<3?w.value=[]:Object.hasOwnProperty.call(e,m.value)?w.value=e[m.value]:($.value=!0,S()))}s();const S=Q((async function(){let C=await T.searchForClubs(m.value);w.value=C,e[m.value]=w.value,$.value=!1}),300);return(C,g)=>(t(),l("div",qe,[u("div",Re,[k(Y,{placeholder:I(f)("searchClub"),type:"text",modelValue:m.value,"onUpdate:modelValue":g[0]||(g[0]=M=>m.value=M),onKeyup:n,onKeyEnter:n,validationError:d.value,invalid:!!d.value},null,8,["placeholder","modelValue","validationError","invalid"])]),w.value.length?(t(),l("div",Me,[u("h3",je,i(C.$t("searchResults"))+":",1),k(_,{clubs:w.value,withMemberSince:!1,withIntro:!0,withJoinRequest:!y.isGuest,withInClubTag:!0,userClubs:I(h),onUpdated:n},null,8,["clubs","withJoinRequest","userClubs"])])):a("",!0),w.value.length===0?(t(),l(q,{key:1},[u("h3",_e,i(C.$t("topClubs"))+":",1),p.value?(t(),l("div",Ae,[...g[1]||(g[1]=[u("div",{class:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-nd-text-primary"},null,-1)])])):a("",!0),p.value?a("",!0):(t(),l("div",Se,[(t(!0),l(q,null,O(c.value,((M,V)=>(t(),l("div",{key:V},[k(_,{clubs:M,withMemberSince:!1,withIntro:!0,withJoinRequest:!y.isGuest,withInClubTag:!0,userClubs:I(h),onUpdated:s},null,8,["clubs","withJoinRequest","userClubs"])])))),128))])),v.value?(t(),l("div",Be,[...g[2]||(g[2]=[u("div",{class:"inline-block animate-spin rounded-full h-6 w-6 border-b-2 border-nd-text-primary"},null,-1)])])):a("",!0),x.value&&!v.value?(t(),l("div",Je,[u("button",{onClick:R,class:"px-6 py-2 bg-nd-bg-secondary border border-nd-border-subtle rounded-full text-nd-text-primary text-sm hover:bg-nd-overlay-light transition-colors cursor-pointer"},i(C.$t("getMoreLabel")),1)])):a("",!0)],64)):a("",!0)]))}},Ge={class:"min-h-screen bg-nd-bg-primary text-nd-text-primary p-3 md:p-6 max-w-[1400px] mx-auto"},Oe={key:0,class:"flex items-center justify-center py-20"},Ve={key:1,class:"flex flex-col items-center justify-center py-20 space-y-6"},Pe={class:"text-nd-error text-lg text-center"},Ue={key:2,class:"space-y-4 md:space-y-6"},Ee={class:"flex items-start justify-between gap-3"},ze={class:"font-display text-2xl md:text-4xl font-normal leading-tight"},Fe={class:"max-w-[320px]"},He={key:0},Ke={key:1},We=W({__name:"ClubsView",setup(y){const{t:f}=A(),h=b(!0),c=b(""),r=b(""),x=b(0),p=b(!1),v=b(!1),m=L(te);async function w(){await m.reveal()}G((()=>{m.closeAll()})),(async function(){try{let d=await X.getUserInfo();p.value=d.isAdmin,v.value=d.isGuest;try{v.value?r.value="allClubs":(x.value=await T.getMyClubsCount(),r.value=x.value>0?"myClubs":"allClubs")}catch(e){throw x.value=0,e}h.value=!1}catch{c.value=f("cannotLoadClubsMessage")}})();const $=D((()=>{const d=[{value:"allClubs",label:f("allClubsTab")}];return v.value||d.push({value:"myClubs",label:`${f("myClubsTab")} (${x.value})`}),d}));return(d,e)=>{const s=j("font-awesome-icon");return t(),l("div",Ge,[h.value&&!c.value?(t(),l("div",Oe,[...e[1]||(e[1]=[u("div",{class:"inline-block animate-spin rounded-full h-10 w-10 border-b-2 border-nd-text-primary"},null,-1)])])):a("",!0),c.value?(t(),l("div",Ve,[k(s,{icon:"fa-solid fa-circle-exclamation",class:"text-nd-error text-4xl"}),u("span",Pe,i(c.value),1)])):a("",!0),h.value||c.value?a("",!0):(t(),l("div",Ue,[u("header",Ee,[u("h1",ze,i(d.$t("clubsTitle")),1),v.value?a("",!0):(t(),l("button",{key:0,onClick:w,class:"h-8 md:h-10 px-3 md:px-6 bg-nd-primary curs
1or-pointer rounded-full text-nd-text-on-primary text-xs md:text-sm font-medium hover:opacity-90 transition-all flex items-center gap-2 shrink-0"},i(d.$t("createClub")),1))]),u("div",Fe,[k(Z,{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=o=>r.value=o),options:$.value},null,8,["modelValue","options"])]),r.value!=="myClubs"||v.value?a("",!0):(t(),l("div",He,[k(Te)])),r.value==="allClubs"?(t(),l("div",Ke,[k(Le,{isGuest:v.value},null,8,["isGuest"])])):a("",!0)]))])}}},[["__scopeId","data-v-7f777b4c"]]);export{We 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.