PageSourceSearch

https://www.pingpongathon.com/assets/ProfileRoute-Rvi2UZTp.js

js pingpongathon.com collected 2026-10-04 10:46:16 UTC 10,902 bytes, 1 lines download raw bytes

1import{Y as e,_ as t,et as n,f as r,g as i,s as a,t as o}from"./jsx-runtime-Co6TVm03.js";import{b as s,k as c,m as ee,r as te,y as ne}from"./Objects-CGgF6iLN.js";import{n as l,s as u}from"./Routes-DbaLMCjn.js";import{l as d,r as f}from"./Seo-D5ITvs4i.js";import{s as re,t as ie}from"./GiveToPlayer-D0jM0uH4.js";import{t as p}from"./gsap-Bi_c5vh2.js";import{r as m}from"./Delete-CaT6_QL3.js";import{t as h}from"./Icon-DPAlW5PN.js";import{d as g,o as _,r as v,u as ae}from"./ProfileBL-gBQ4wAzh.js";import{a as oe,t as se}from"./AchievementsBL-JdG_Xo3A.js";import{a as ce}from"./Functions-CPvU6w3V.js";import{L as le,R as ue,T as de,b as fe,rt as pe,y as me}from"./Fetch-CVcM6EkJ.js";import{a as he,f as y,u as b}from"./EventBL-Du50MTqG.js";import{m as ge,n as x,u as S}from"./Analytics-DN1_j0qR.js";import{t as _e}from"./LazyPixelBlast-KdFrDYAp.js";import{t as ve}from"./src-BhoUhRR_.js";import{t as ye}from"./Loading-ROJyuMUI.js";import{r as C}from"./Hooks-BYNwhhDF.js";import{t as w}from"./Carousel-BxVFDUtG.js";import{t as T}from"./SplitText-Bj_bHxnY.js";import{t as E}from"./PlayerCard-Bo66rpvD.js";import{t as D}from"./EventPostsModal-DW7xLsGZ.js";import{i as O,n as k,r as A,t as j}from"./RecentDonation-CiWKLapL.js";import{t as M}from"./ShareModal-D6Wcc2w-.js";import{t as N}from"./ProfileDeleteDialog-BXgWdG0m.js";var P=n(e(),1),F=o();function I({location:e}){let t=d();return f({title:`Player Fundraising Page`,description:`Sponsor this player's ${t.site_name} fundraiser and help end modern slavery. Donations of $2 or more are tax deductible in Australia.`,path:e.pathname,type:`profile`,brand:t})}var L=a(function(){let e=i(),[n,a]=(0,P.useState)(),o=t(),d=r(),[f,I]=(0,P.useState)([]),[L,R]=(0,P.useState)(!1),[be,z]=(0,P.useState)(!1),[B,V]=(0,P.useState)(!1),[H,U]=(0,P.useState)(),[W,G]=(0,P.useState)([]),[xe,Se]=(0,P.useState)([]),[K,q]=(0,P.useState)([]),[Ce,J]=(0,P.useState)(!1),[we,Y]=(0,P.useState)(!1),[X,Z]=(0,P.useState)(!1),Q=W.filter(y),$=W.filter(e=>!y(e)),Te=e.session?.user.app_metadata.role===`admin`&&!!n?.username&&n.id!==e.session?.user.id;C(re(n,e.brandConfig.site_name)),(0,P.useEffect)(()=>{if(ae(o.id,e.profile)&&e.profile?.id){a(e.profile);return}o.id&&Oe(o.id)},[e.profile,o.id]),(0,P.useEffect)(()=>{if(!o.id||!n?.username||!g(o.id)||o.id!==n.id)return;let t=u(n);t&&e.navigate(t,{replace:!0})},[o.id,n?.id,n?.username]),(0,P.useEffect)(()=>{Ee()},[n?.id]),(0,P.useEffect)(()=>{n?.id&&Promise.all([me(n.id),fe()]).then(([e,t])=>Se(se(oe(e),t))).catch(e=>c(e,[`ProfileRoute`,`fetchPlayerAchievements`]))},[n?.id]),(0,P.useEffect)(()=>{if(!n?.id)return;if(_(n.id,e.profile?.id)&&e.playerEvent?.closestEvent){U(e.playerEvent.closestEvent),G(b(e.playerEvent.allEvents??[]));return}let t=!1;return he(n.id).then(e=>{t||(U(e.closestEvent),G(b(e.allEvents)))}).catch(()=>{t||(U(void 0),G([]))}),()=>{t=!0}},[n?.id,e.profile?.id,e.playerEvent]),(0,P.useEffect)(()=>{n?.id&&pe(n.id).then(q).catch(e=>c(e,[`ProfileRoute`,`fetchUserUpdates`]))},[n?.id]);async function Ee(){if(n?.id)try{let e=await de(n.id);I(e)}catch(e){await c(e,[`ProfileRoute`,`getDonations`])}else return null}async function De(){if(!(!n?.username||X)){Z(!0);try{await m(n.username),e.popAlert(`Profile deleted`),Y(!1),e.navigate(`/`)}catch(t){c(t,[`ProfileRoute`,`deleteProfileCascade`]),e.popAlert(`Couldn't delete profile`,void 0,!0)}finally{Z(!1)}}}ve(()=>{if(!n)return;p.registerPlugin(T);let e=T.create(`#profile-name`,{type:`words`}),t=T.create(`#goal-text`,{type:`chars`});p.timeline().from(e.words,{opacity:0,y:-10,delay:.2,stagger:.5,duration:.5,ease:`power1`}).from(t.chars,{opacity:0,y:-2,duration:.3,stagger:.1,ease:`back.inOut`,delay:-.5})},[n]);async function Oe(t){R(!0);try{let e=g(t)?await le(t):await ue(t);a(e)}catch(t){c(t,[`ProfileRoute`,`handleGetProfile`]),e.popAlert(`Could not get this profile`)}finally{R(!1)}}if(L)return(0,F.jsx)(ye,{loadingText:`Loading profile...`});if(n)return(0,F.jsx)(`div`,{className:`p-10`,children:(0,F.jsx)(`div`,{className:`w-100 col middle`,children:(0,F.jsxs)(`div`,{className:`fade-md col w-75 middle mt-20`,children:[(0,F.jsxs)(`div`,{className:`col gap-20 m-10 w-100`,children:[(0,F.jsxs)(`div`,{className:`col gap-20 middle between w-100`,style:{minHeight:50},children:[(0,F.jsx)(`div`,{style:{opacity:.5,width:`100%`,height:`100%`,position:`absolute`,zIndex:-1,top:0},children:(0,F.jsx)(_e,{variant:`square`,pixelSize:8,color:`#c0e2e4`,patternScale:2,patternDensity:1,pixelSizeJitter:0,enableRipples:!0,rippleSpeed:.4,rippleThickness:.12,rippleIntensityScale:1.5,liquid:!1,liquidStrength:.
112,liquidRadius:1.2,liquidWobbleSpeed:5,speed:.5,edgeFade:.25,transparent:!0})}),(0,F.jsxs)(`div`,{className:`col middle gap-20 w-100 mb-5`,children:[(0,F.jsxs)(`button`,{className:`accent row middle center gap-5 mb-10`,onClick:()=>z(!0),children:[(0,F.jsx)(h,{name:`share-social`}),`Share donate link`]}),(0,F.jsx)(ce,{size:180,src:s(n,e.rewards),cssClass:ne(n,e.rewards),className:`clickable`,alt:`Profile Image`,onClick:()=>V(!0)}),(0,F.jsxs)(`div`,{className:`row middle gap-20`,children:[(0,F.jsxs)(`h1`,{id:`profile-name`,style:{zIndex:1},children:[n?.first,` `,n?.last]}),(e.profile?.id===n?.id||e.session?.user.app_metadata.role===`admin`)&&(0,F.jsx)(`button`,{className:`row gap-5 middle outline-secondary`,onClick:()=>e.setProfileStepper({active:!0,defaultProfile:n}),children:(0,F.jsx)(h,{name:`pencil`,className:``})}),Te&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Delete profile`,title:`Delete profile`,className:`row gap-5 middle outline-danger danger`,onClick:()=>Y(!0),children:(0,F.jsx)(h,{name:`trash-outline`})})]}),H&&(0,F.jsxs)(`button`,{onClick:()=>{ge(x.PROFILE_PLAYING_IN,e,{event_id:H.id,event_slug:H.slug,page_url:d.pathname}),e.navigate(l(H?.slug))},style:{fontWeight:500},className:`row middle center gap-10 outline-secondary`,children:[`playing in`,` `,(0,F.jsx)(`b`,{children:H.name}),(0,F.jsx)(h,{name:`arrow-forward`})]}),(0,F.jsx)(`div`,{className:`row w-100 gap-20`,children:(0,F.jsx)(k,{donations:f,totalGoal:n?.goal||0})})]})]}),(0,F.jsxs)(`div`,{className:e.inShrink?`col gap-20`:`row gap-10 w-100`,children:[(0,F.jsxs)(`div`,{className:`boxed outline-secondary w-100 h-100`,children:[(0,F.jsxs)(`div`,{className:`col middle p-20 gap-20`,children:[(0,F.jsx)(`div`,{className:`${e.inShrink||`middle col`} w-100`,children:(0,F.jsx)(`div`,{style:{flexDirection:e.inShrink?`column`:`row-reverse`},className:`accent${e.inShrink?`gap-20`:`gap-10`} middle`,children:(0,F.jsxs)(`div`,{className:`row center gap-10 mt-20`,children:[(0,F.jsxs)(`button`,{className:`outline-secondary row center middle gap-5`,onClick:()=>J(!0),children:[(0,F.jsx)(`strong`,{className:`accent`,style:{padding:3,borderRadius:10},children:K.length}),` `,`Updates`]}),(0,F.jsxs)(`button`,{style:{background:`var(--accent-bold)`},onClick:()=>e.setPaymentStepper({active:!0,openSource:S.PROFILE_QUICK_GIVE,metadata:v(n,e.session?.user.id,H)}),className:`row center middle gap-5 accent`,children:[(0,F.jsx)(h,{name:`card`}),` `,`Give`]}),(0,F.jsxs)(`button`,{className:`row gap-5 middle outline-secondary`,onClick:()=>V(!0),children:[(0,F.jsx)(h,{name:`person-circle`}),`Stats`]})]})})}),(0,F.jsxs)(`div`,{className:`mt-20 mb-20 col middle gap-10`,children:[(0,F.jsx)(`h2`,{children:`Why I'm doing it`}),(0,F.jsx)(`p`,{className:`center `,style:{whiteSpace:`pre-wrap`,fontWeight:600,lineHeight:1.5,fontSize:`var(--text-h4)`,textTransform:`none`},children:n.why})]})]}),` `]}),(0,F.jsx)(`div`,{className:`w-50`,children:(0,F.jsx)(ie,{title:`${n.id===e.session?.user.id?`Kickstart your campaign`:`Give to ${n.first}`}`,onShareClick:()=>z(!0),onClick:t=>{e.setPaymentStepper({metadata:v(n,e.session?.user.id,H),active:!0,openSource:S.PROFILE_GIVE_TO_PLAYER,cart:[{product:{id:0,amount:t,name:e.brandConfig.donation_product_name},quantity:1}]})},align:`center`})})]}),(0,F.jsxs)(`div`,{children:[` `,Q.length>0?(0,F.jsxs)(`div`,{className:`row center w-100 gap-10 col`,children:[(0,F.jsx)(`h2`,{className:`center mb-5 mt-10`,children:`Playing in`}),Q.map(t=>(0,F.jsx)(`div`,{className:`mb-10 w-100`,children:(0,F.jsx)(O,{event:t,isUserEvent:!0,linkSource:x.PROFILE_EVENT_CARD,onClick:()=>e.navigate(l(t.slug))},t.id)},t.id))]}):H&&(0,F.jsxs)(`div`,{className:``,children:[(0,F.jsx)(`h2`,{className:`mb-10 mt-10 center`,children:`Playing in`}),(0,F.jsx)(O,{event:H,linkSource:x.PROFILE_EVENT_CARD,onClick:()=>e.navigate(l(H.slug))},H?.id)]})]}),(0,F.jsx)(`div`,{className:`mt-20`,children:(0,F.jsx)(A,{achievements:xe,mode:`profile`})}),W.length>0&&(0,F.jsx)(`div`,{className:`col gap-10 w-100`,children:$.length>1&&(0,F.jsxs)(`div`,{className:`col`,children:[(0,F.jsxs)(`h2`,{className:`center mt-20 mb-20 pt-20`,children:[n.id===e.session?.user.id?`Your`:`${n.first}'s`,` `,`other upcoming event`,W.length===1||`s`]}),(0,F.jsx)(`div`,{className:`row gap-10 center wrap boxed p-20 outline-secondary`,style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(clamp(200px, 12vw, 400px), 1fr))`},children:$.map(t=>(0,F.jsx)(O,{event:t,isUserEvent:!0,linkSource:x.PROFILE_EVENT_CARD,onClick:()=>e.navigate(l(t.slug))},t.id))})]})}),(0,F.jsx)(`div`,{children:f.length>0&&(0,F.jsxs)(`div`,{className:`boxed outline-secondary p-10`,children:[(0,F.jsxs)(`h3`,{className:`mb-10`,children:[`Recent donations to`,` `,n.first]}),(0,F.jsx)(w,{onClick:()=>{},autoplay:!0,snapOffset:e.inShrink?2:15,resistance:1e5/f.length,loop:!0,interval:3,speed:.5,showDots:`end`,maxDots:8,children:f.map(e=>(0,F.jsx)(j,{donation:e}))})]})})]}),(0,F.jsx)(M,{mode:`profile`,active:be,onClose:()=>z(!1),profile:n,donations:f,event:H}),(0,F.jsx)(N,{active:we,username:n.username??``,displayName:`${n.first??``} ${n.last??``}`.trim()||(n.username??``),isDeleting:X,onClose:()=>Y(!1),onConfirm:()=>De()}),(0,F.jsx)(D,{active:Ce,onClose:()=>J(!1),event:H,updates:K,setUpdates:q,createButtonLabel:e.profile?.id===n?.id&&e.session?`+ Add an update`:null,style:{zIndex:50}}),B&&(()=>{let t=f.reduce((e,t)=>
1e+(t.cents||0),0),r={id:n.id,rank:1,players:[{id:n.id,first:n.first,last:n.last,username:n.username,image_url:n.image_url,card_avatar_id:n.card_avatar_id,card_frame_id:n.card_frame_id,goal:n.goal}],primaryProfile:n,scoreLabel:`$${ee(t,0)}`,scoreValue:t,graphPercentage:100,donationCount:f.length,isVerified:!0};return(0,F.jsx)(E,{active:B,onClose:()=>V(!1),player:r,event:H,isEntryReveal:!0,isEditable:e.profile?.id===n?.id})})()]})})});if(!n)return(0,F.jsxs)(`div`,{className:`dvh-80 vw-100 col middle center gap-20 m-20`,children:[(0,F.jsx)(`h2`,{children:`Something's gone wrong`}),(0,F.jsx)(`h4`,{children:`We can't find this profile`}),(0,F.jsxs)(`p`,{className:`center`,children:[`If this is unexpected, contact us at`,` `,te.orgEmail,` and we'll get it fixed up!`]}),(0,F.jsxs)(`button`,{className:`row gap-5 middle`,onClick:()=>window.location.href=u(e.profile)??`/`,children:[` `,(0,F.jsx)(h,{name:`refresh`}),`Refresh`]})]})});export{L as default,I as meta};

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.