1import{r as e,j as a}from"./vendor-ui-D8nRNr8y.js";import{u as s,t,a as l,g as n}from"../index-Dle7DM_9.js";import{B as c}from"./button-PEL70qli.js";import{C as i,a as r,b as o,c as d,d as g}from"./card-Cf1CFQ1z.js";import{B as x}from"./badge-Con_0RWI.js";import{D as m,a as p,b as v,c as h,d as u}from"./dialog-BfsutAOC.js";import{a as E,m as j,j as b,k as P,c as f,L as N,A as y}from"./vendor-utils-Cp3weVsl.js";import"./vendor-react-CfEmTUCH.js";import"./vendor-trpc-DNhrIxIs.js";const C=[{id:1,name:"No Poverty",color:"#E5243B",icon:"ð¯"},{id:2,name:"Zero Hunger",color:"#DDA250",icon:"ð¾"},{id:3,name:"Good Health & Well-Being",color:"#4C9F38",icon:"â¤ï¸"},{id:4,name:"Quality Education",color:"#C6192B",icon:"ð"},{id:5,name:"Gender Equality",color:"#FF3A21",icon:"âï¸"},{id:6,name:"Clean Water & Sanitation",color:"#26BDE2",icon:"ð§"},{id:7,name:"Affordable & Clean Energy",color:"#FCCC0A",icon:"â¡"},{id:8,name:"Decent Work & Economic Growth",color:"#A21942",icon:"ð¼"},{id:9,name:"Industry, Innovation & Infrastructure",color:"#DD1C3B",icon:"ðï¸"},{id:10,name:"Reduced Inequalities",color:"#DD1C3B",icon:"ð¤"},{id:11,name:"Sustainable Cities & Communities",color:"#FCC30B",icon:"ðï¸"},{id:12,name:"Responsible Consumption",color:"#BF8B2E",icon:"â»ï¸"},{id:13,name:"Climate Action",color:"#407D52",icon:"ð"},{id:14,name:"Life Below Water",color:"#0A97D9",icon:"ð"},{id:15,name:"Life on Land",color:"#56C596",icon:"ð³"},{id:16,name:"Peace, Justice & Strong Institutions",color:"#00689D",icon:"â®ï¸"},{id:17,name:"Partnerships for the Goals",color:"#1F4788",icon:"ð¤²"}];function w(){const[w,D]=e.useState(null),[G,B]=e.useState(!1),[A,k]=e.useState(null),[S,I]=e.useState(null),{isAuthenticated:T}=s(),{data:_,isLoading:L}=t.events.list.useQuery(),{data:R,isLoading:F}=t.events.upcoming.useQuery(),M="upcoming"===w?R:_,W="upcoming"===w?F:L,Y=t.registrations.registerTeam.useMutation({onSuccess:()=>{l.success("Team registered for event!"),B(!1),k(null),I(null)},onError:e=>{l.error(e.message||"Failed to register team")}}),q=[{value:"regional",label:"Regional",color:"#E5243B"},{value:"championship",label:"Championship",color:"#26BDE2"},{value:"qualifier",label:"Qualifier",color:"#4C9F38"}],Q=M?.filter(e=>!e.title?.toLowerCase().includes("test")&&(!w||"upcoming"===w||e.eventType===w))||[],H=e=>{switch(e){case"open":return"bg-green-100 text-green-800";case"closed":return"bg-red-100 text-red-800";case"completed":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}},U=e=>{const a=q.find(a=>a.value===e);return a?.color||"#E5243B"},V=e=>{T?(k(e),I(null),B(!0)):window.location.href=n()};return a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:156",className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 py-12 px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:157",className:"max-w-7xl mx-auto",children:[a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:159",className:"mb-12",children:[a.jsx("h1",{"data-loc":"client/src/pages/EventsPage.tsx:160",className:"text-4xl font-bold text-gray-900 mb-4",children:"Tournaments & Events"}),a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:161",className:"text-xl text-gray-600",children:"Join women and girls across North America and the Caribbean in tournaments advancing the Global Goals"})]}),a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:167",className:"mb-8 flex flex-wrap gap-3",children:[a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:168",variant:null===w?"default":"outline",onClick:()=>D(null),className:"bg-[#E5243B] hover:bg-[#C41E3A]",children:"All Events"}),a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:175",variant:"upcoming"===w?"default":"outline",onClick:()=>D("upcoming"),children:"Upcoming Only"}),q.map(e=>a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:182",variant:w===e.value?"default":"outline",onClick:()=>D(e.value),style:{backgroundColor:w===e.value?e.color:"transparent",color:w===e.value?"white":"inherit",borderColor:e.color},children:e.label},e.value))]}),W&&a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:199",className:"flex justify-center items-center py-12",children:a.jsx(E,{"data-loc":"client/src/pages/EventsPage.tsx:200",className:"animate-spin h-8 w-8 text-[#E5243B]"})}),a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:205",className:"mb-16",children:[a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:206",className:"text-center mb-12",children:[a.jsx("h2",{"data-loc":"client/src/pages/EventsPage.tsx:207",className:"text-4xl lg:text-5xl font-bold text-gray-900 mb-4",children:"Roadmap to 2030"}),a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:208",className:"text-xl text-gray-600 max-w-2xl mx-auto",children:"Expanding tournaments across North America and the Caribbean"})]}),a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:212",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[{id:1,name:"Houston",year:"2026",image:"/manus-storage/IMG_2384_4e04dc8a.PNG",description:"Regional Championship"},{id:2,name:"New York",year:"2027",image:"/manus-storage/IMG_0683_14a8daf4.jpeg",description:"Championship Tournament"},{id:3,name:"Dominica",year:"2027",image:"/manus-storage/IMG_0684_eb4c9ca3.jpeg",description:"Caribbean Regional"},{id:4,name:"Los Angeles",year:"2027",image:"/manus-storage/IMG_0685_76a4009f.jpeg",description:"West Coast Championship"},{id:5,name:"Miami",year:"2028",image:"/manus-storage/IMG_0687_15dc4608.jpeg",description:"Southeast Regional"},{id:6,name:"Toronto",year:"2028",image:"/manus-storage/IMG_0688_80cbc017.jpeg",description:"Canada Championship"}].map((e,s)=>a.jsx(j.div,{"data-loc":"client/src/pages/EventsPage.tsx:214",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.1*s,duration:.5},children:a.jsxs(i,{"data-loc":"client/src/pages/EventsPage.tsx:221",className:"overflow-hidden hover:shadow-xl transition-all duration-300 h-full flex flex-col",children:[a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:222",className:"relative h-64 overflow-hidden bg-gray-200",children:[a.jsx("img",{"data-loc":"client/src/pages/EventsPage.tsx:223",src:e.image,alt:e.name,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300"}),a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:228",className:"absolute inset-0 bg-gradient-to-t from-black/40 to-transparent"}),a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:229",className:"absolute bottom-4 left-4 right-4",children:[a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:230",className:"text-white text-sm font-semibold",children:e.description}),a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:231",className:"text-white/80 text-xs",children:e.year})]})]}),a.jsx(r,{"data-loc":"client/src/pages/EventsPage.tsx:234",className:"pb-2",children:a.jsx(o,{"data-loc":"client/src/pages/EventsPage.tsx:235",className:"text-2xl text-gray-900",children:e.name})}),a.jsx(d,{"data-loc":"client/src/pages/EventsPage.tsx:237",className:"flex-1 flex flex-col justify-end",children:a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:238",className:"w-full bg-[#E5243B] hover:bg-[#C41E3A] text-white",onClick:()=>V(e),children:"Choose Your Global Goal"})})]})},e.name))})]}),!W&&Q&&Q.length>0?a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:253",className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:Q.map(e=>a.jsxs(i,{"data-loc":"client/src/pages/EventsPage.tsx:255",className:"overflow-hidden hover:shadow-lg transition-shadow",children:[e.imageUrl&&a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:257",className:"relative h-48 overflow-hidden bg-gray-200",children:[a.jsx("img",{"data-loc":"client/src/pages/EventsPage.tsx:258",src:e.imageUrl,alt:e.title,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300"}),a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:263",className:"absolute top-4 left-4",children:a.jsx(x,{"data-loc":"client/src/pages/EventsPage.tsx:264",style:{backgroundColor:U(e.eventType),color:"white"},children:e.eventType})}),a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:273",className:"absolute top-4 right-4",children:a.jsx(x,{"data-loc":"client/src/pages/EventsPage.tsx:274",className:H(e.status),children:e.status})})]}),a.jsxs(r,{"data-loc":"client/src/pages/EventsPage.tsx:280",children:[a.jsx(o,{"data-loc":"client/src/pages/EventsPage.tsx:281",className:"text-lg",children:e.title}),a.jsx(g,{"data-loc":"client/src/pages/EventsPage.tsx:282",className:"line-clamp-2",children:e.description})]}),a.jsxs(d,{"data-loc":"client/src/pages/EventsPage.tsx:286",className:"space-y-4",children:[a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:287",className:"space-y-2 text-sm",children:[a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:288",className:"flex items-center gap-2 text-gray-600",children:[a.jsx(b,{"data-loc":"client/src/pages/EventsPage.tsx:289",className:"h-4 w-4"}),e.location]}),a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:292",className:"flex items-center gap-2 text-gray-600",children:[a.jsx(P,{"data-loc":"client/src/pages/EventsPage.tsx:293",className:"h-4 w-4"}),new Date(e.startDate).toLocaleDateString()," -"," ",new Date(e.endDate).toLocaleDateString()]}),e.maxTeams&&a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:298",className:"flex items-center gap-2 text-gray-600",children:[a.jsx(f,{"data-loc":"client/src/pages/EventsPage.tsx:299",className:"h-4 w-4"}),e.registeredTeams||0," / ",e.maxTeams," teams"]}
1)]}),e.registrationDeadline&&a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:306",className:"text-xs text-gray-500",children:["Registration deadline: ",new Date(e.registrationDeadline).toLocaleDateString()]}),a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:311",className:"flex gap-2 pt-4",children:[a.jsx(N,{"data-loc":"client/src/pages/EventsPage.tsx:312",href:`/events/${e.id}`,children:a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:313",variant:"outline",className:"flex-1",children:"View Details"})}),"open"===e.status&&a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:318",className:"flex-1 bg-[#E5243B] hover:bg-[#C41E3A]",onClick:()=>V(e),children:"Register"})]})]})]},e.id))}):W||Q&&0!==Q.length?null:a.jsx(i,{"data-loc":"client/src/pages/EventsPage.tsx:331",className:"text-center py-12",children:a.jsxs(d,{"data-loc":"client/src/pages/EventsPage.tsx:332",children:[a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:333",className:"text-gray-500 mb-4",children:"No events found matching your criteria."}),a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:334",variant:"outline",onClick:()=>D(null),className:"text-[#E5243B]",children:"View All Events"})]})})]}),a.jsx(m,{"data-loc":"client/src/pages/EventsPage.tsx:347",open:G,onOpenChange:B,children:a.jsxs(p,{"data-loc":"client/src/pages/EventsPage.tsx:348",className:"max-w-2xl max-h-96 overflow-y-auto",children:[a.jsxs(v,{"data-loc":"client/src/pages/EventsPage.tsx:349",children:[a.jsx(h,{"data-loc":"client/src/pages/EventsPage.tsx:350",children:"Which Global Goal Will You Kick For?"}),a.jsxs(u,{"data-loc":"client/src/pages/EventsPage.tsx:351",children:["Choose the Global Goal your team will support at ",A?.name||A?.title]})]}),T?a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:364",className:"space-y-4",children:[a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:366",className:"grid grid-cols-2 sm:grid-cols-3 gap-3 max-h-80 overflow-y-auto",children:C.map(e=>a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:368",className:"p-3 rounded-lg border-2 cursor-pointer transition-all "+(S===e.id?"border-[#E5243B] bg-red-50 shadow-md":"border-gray-200 hover:border-gray-300"),style:{borderColor:S===e.id?e.color:"inherit",backgroundColor:S===e.id?`${e.color}15`:"transparent"},onClick:()=>I(e.id),children:a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:381",className:"text-center",children:[a.jsx("div",{"data-loc":"client/src/pages/EventsPage.tsx:382",className:"text-2xl mb-1",children:e.icon}),a.jsxs("p",{"data-loc":"client/src/pages/EventsPage.tsx:383",className:"text-xs font-semibold text-gray-900",children:["SDG ",e.id]}),a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:384",className:"text-xs text-gray-600 line-clamp-2",children:e.name})]})},e.id))}),S&&a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:392",className:"p-4 rounded-lg border-2",style:{borderColor:C.find(e=>e.id===S)?.color,backgroundColor:`${C.find(e=>e.id===S)?.color}10`},children:[a.jsxs("p",{"data-loc":"client/src/pages/EventsPage.tsx:399",className:"font-semibold text-gray-900",children:["You selected: SDG ",S," - ",C.find(e=>e.id===S)?.name]}),a.jsxs("p",{"data-loc":"client/src/pages/EventsPage.tsx:402",className:"text-sm text-gray-600 mt-1",children:["Your team will represent this Global Goal at ",A?.name||A?.title]})]}),a.jsx(c,{"data-loc":"client/src/pages/EventsPage.tsx:409",className:"w-full bg-[#E5243B] hover:bg-[#C41E3A] text-white",disabled:!S||Y.isPending,onClick:()=>{S&&A&&Y.mutate({eventId:A.id,teamId:S})},children:Y.isPending?"Registering...":"Register for This Goal"})]}):a.jsxs("div",{"data-loc":"client/src/pages/EventsPage.tsx:357",className:"text-center py-6",children:[a.jsx("p",{"data-loc":"client/src/pages/EventsPage.tsx:358",className:"text-gray-600 mb-4",children:"Sign in to register your team"}),a.jsxs("a",{"data-loc":"client/src/pages/EventsPage.tsx:359",href:n(),className:"inline-flex items-center gap-2 bg-[#E5243B] hover:bg-[#C41E3A] text-white px-6 py-2 rounded-lg font-semibold transition-all",children:["Sign In ",a.jsx(y,{"data-loc":"client/src/pages/EventsPage.tsx:360",size:16})]})]})]})})]})}export{w 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.