PageSourceSearch

https://app.thefestivalbabes.com/assets/Events-Qt3ADF7U.js

js thefestivalbabes.com collected 2026-10-04 20:47:33 UTC 38,163 bytes, 2 lines download raw bytes

1import{u as Lt,e as Ut,k as Ot,r as d,E as Te,D as se,l as He,f as _t,j as e,g as Qe,C as B,T as Xe,B as p,o as qt,aw as zt,ax as Yt,ay as Je,S as re,a0 as ae,i as f,F as Pe,X as me,t as Ze,dd as Bt,aq as et,ar as tt,at as st,au as Gt,I as Wt,a1 as ue,h as pe,b as Ee,U as Kt,aF as Ht,aG as Qt,aH as Xt,aM as De,a as xe}from"./index-CAQ9C6-z.js";import{G as Jt}from"./GoogleMapEmbed-BvjPiQIM.js";import{S as at,a as nt,b as it,c as rt,d as U}from"./select-C1jcuWaT.js";import{I as Me}from"./ImageWithFallback-BR12WY07.js";import{r as Zt}from"./topLevelRedirect-2Xz_bpdG.js";import{s as es,e as ne,g as ts,C as ss,a as as,b as ns,c as lt}from"./event-placeholder-festival-OnXQIF51.js";import{p as C}from"./parseISO-DIJ4syKH.js";import{i as Re}from"./isSameDay-CfKV2ei9.js";import{f as y,s as is}from"./format-DECx0Hkk.js";import{L as ct}from"./list-25igHJbV.js";import{G as ot}from"./grid-3x3-zXpuL1Bo.js";import{C as dt}from"./chevron-left-B-A6hXmU.js";import{F as mt}from"./filter-B4etKnWY.js";import{D as ie}from"./dollar-sign-Bkqe7NdJ.js";import{a as rs,s as ls,e as cs,i as os}from"./isSameMonth-BFxLZRxh.js";import{M as ut}
1from"./map-pin-D4gTktfR.js";import{C as $e}from"./chevron-up-BOfZRiUg.js";import{C as Ae}from"./chevron-down--E-1bxpl.js";import{C as ds}from"./circle-x-9JZCRHgs.js";import{e as ms}from"./endOfMonth-Cj4XZLSX.js";import{i as us}from"./isPast-D9j8gErP.js";import"./index-BdQq_4o_.js";import"./index-Q3UH4NY9.js";import"./imageUrl-wKkGP1ld.js";import"./en-US-K2-Byqu-.js";import"./differenceInCalendarDays-BvXbP6kq.js";function ps(n,o,D){if(!n||!n.includes("/api/public/images/")||n.includes("?w=")||n.includes("&w="))return n;const b=n.includes("?")?"&":"?",j=`w=${o}`;return`${n}${b}${j}`}const pt={creator:"Free",premium_creator:"VIP",all_access_creator:"All Access"},G=n=>n.requiredTier?n.requiredTier:n.isPremiumOnly?"premium_creator":"creator",ft=n=>typeof n.canRsvp=="boolean"?!n.canRsvp:!1,O=(n,o)=>{if(!n||n<=0)return"Free";const D=n/100;return new Intl.NumberFormat(void 0,{style:"currency",currency:o||"USD"}).format(D)},xt={festival:"Festival",workshop:"Workshop",networking:"Networking",meetup:"Meetup"},le=n=>{const o=C(n.endTime);return us(o)},Ie=n=>n.maxAttendees?(n.attendeeCount??0)>=n.maxAttendees:!1,xs=(n,o)=>le(n)?{canRsvp:!1,reason:"past_event"}:Ie(n)?{canRsvp:!1,reason:"sold_out"}:ft(n)?G(n)==="all_access_creator"?{canRsvp:!1,reason:"all_access_required"}:{canRsvp:!1,reason:"premium_required"}:n.isPremiumOnly&&o==="creator"?{canRsvp:!1,reason:"premium_required"}:{canRsvp:!0},ht=n=>{var D;const o=((D=n==null?void 0:n.message)==null?void 0:D.toLowerCase())||"";return o.includes("already")&&o.includes("rsvp")?"You have already RSVP'd to this event.":o.includes("capacity")||o.includes("full")||o.includes("sold out")?"This event has reached full capacity.":o.includes("all access")?"This event requires an All Access membership.":o.includes("premium")||o.includes("vip")||o.includes("403")?"This event requires a VIP membership.":o.includes("payment")||o.includes("charge")||o.includes("stripe")?"Payment could not be processed. Please try again.":o.includes("not found")||o.includes("404")?"This event could not be found. It may have been removed.":"Something went wrong. Please try again."};function qs(){const{user:n,isAuthenticated:o,isLoading:D}=Lt();Ut();const{toast:b}=Ot(),[j,gt]=d.useState("list"),[M,he]=d.useState(new Date),[_,P]=d.useState(1),[s,vt]=d.useState(null),[fe,R]=d.useState(!1),[Ve,W]=d.useState(!1),[q,ge]=d.useState("all"),[z,ve]=d.useState("all"),[m,Y]=d.useState(null),[je,we]=d.useState(null),[jt,be]=d.useState(null),[K,wt]=d.useState(!1),[H,Q]=d.useState(null),[ce,Ne]=d.useState(null),X=d.useRef(null),[Fe,$]=d.useState(""),[oe,Le]=d.useState(!1),[bt,Nt]=d.useState(!1),ye=10,[A,Ue]=d.useState(()=>typeof window>"u"?"all":new URLSearchParams(window.location.search).get("tab")==="vip"?"vip":"all"),[Oe,_e]=d.useState({open:!1,tier:"vip"}),qe=n==null?void 0:n.role,Ce=qe==="creator"||!qe,I=d.useCallback(t=>{_e({open:!0,tier:t})},[]),ze=d.useRef(!1);d.useEffect(()=>{if(typeof window>"u")return;const t=new URLSearchParams(window.location.search);if(t.get("tab")!==A){t.set("tab",A);const l=t.toString(),x=`${window.location.pathname}${l?`?${l}`:""}`;ze.current?window.history.pushState({},"",x):window.history.replaceState({},"",x)}ze.current=!0},[A]),d.useEffect(()=>{if(typeof window>"u")return;const t=()=>{const a=new URLSearchParams(window.location.search);Ue(a.get("tab")==="vip"?"vip":"all")};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[]);const yt=d.useCallback(t=>{Ue(t==="vip"?"vip":"all"),P(1)},[]);d.useEffect(()=>{const t=new URLSearchParams(window.location.search),a=t.get("rsvp_success"),l=t.get("rsvp_cancelled"),x=t.get("session_id"),h=t.get("event_id"),g=()=>{window.history.replaceState({},"",window.location.pathname)};if(a==="true"&&x&&h){let c=!1;return(async()=>{try{const r=await(await Te("POST",`/api/premium/events/${h}/confirm-rsvp`,{sessionId:x})).json();if(c)return;r.confirmed?b({title:"RSVP Confirmed",description:"Your payment was successful and you are now registered for this event!"}):r.pending&&b({title:"RSVP received — you're on the list",description:r.message||"Your seat is locked in. We'll send your confirmation email as soon as the payment settles (usually within a minute)."}),se.invalidateQueries({queryKey:["/api/premium/events"]})}catch(i){if(c)return;b({title:"Couldn't confirm RSVP",description:(i==null?void 0:i.message)||"Your payment may still be processing. Try refreshing in a moment.",variant:"destructive"}),se.invalidateQueries({queryKey:["/api/premium/events"]})}finally{c||g()}})(),()=>{c=!0}}else a==="true"?(b({title:"RSVP Confirmed",description:"Your payment was successful and you are now registered for this event!"}),se.invalidateQueries({queryKey:["/api/premium/events"]}),g()):l==="true"&&(b({title:"RSVP Cancelled",description:"Your payment was cancelled. You can try again anytime."}),g())},[b]);const E=He({mutationFn:async({eventId:t,donationAmountCents:a})=>
1{we(t),X.current=t;const l={};return a&&(l.donationAmountCents=a),(await Te("POST",`/api/premium/events/${t}/rsvp`,l)).json()},onSuccess:t=>{const a=X.current;X.current=null,Y(null),t.requiresPayment&&t.checkoutUrl?Zt(t.checkoutUrl):(se.invalidateQueries({queryKey:["/api/premium/events"]}),fe&&(s==null?void 0:s.id)===a?(b({title:"RSVP Confirmed",description:"You have successfully RSVP'd to this event!"}),R(!1)):Ne({type:"success",message:"Your RSVP was confirmed successfully."})),we(null)},onError:t=>{const a=X.current;X.current=null,Y(null);const l=ht(t);fe&&(s==null?void 0:s.id)===a?b({title:"RSVP Failed",description:l,variant:"destructive"}):Ne({type:"error",message:l}),we(null)}}),Ye=He({mutationFn:async t=>(be(t),(await Te("POST",`/api/premium/events/${t}/rsvp/cancel`)).json()),onSuccess:t=>{b({title:"RSVP Cancelled",description:t!=null&&t.refundNote?"Your RSVP has been cancelled. For refunds, please contact support.":"Your RSVP has been cancelled successfully."}),se.invalidateQueries({queryKey:["/api/premium/events"]}),R(!1),be(null)},onError:t=>{b({title:"Cancel Failed",description:ht(t),variant:"destructive"}),be(null)}}),{data:de,isLoading:Ct,isError:kt,refetch:St}=_t({queryKey:["/api/premium/events"],enabled:o}),J=de||[];d.useEffect(()=>{if(typeof window>"u")return;const t=new URLSearchParams(window.location.search);if(t.get("rsvp_success")==="true"||t.get("rsvp_cancelled")==="true")return;const a=t.get("event_id");if(!a||!de||de.length===0)return;const l=document.getElementById(`event-${a}`);l&&l.scrollIntoView({behavior:"smooth",block:"start"})},[de]);const ke=d.useMemo(()=>A!=="vip"?J:J.filter(t=>{const a=G(t);return a==="premium_creator"||a==="all_access_creator"}),[J,A]),Be=d.useMemo(()=>J.filter(t=>{const a=G(t);return a==="premium_creator"||a==="all_access_creator"}).length,[J]),Tt=Array.from(new Set(ke.map(t=>t.location))).filter(Boolean).sort(),Ge=q!=="all"||z!=="all"||H!==null,We=ke.filter(t=>{if(q!=="all"&&t.eventType!==q||z!=="all"&&t.location!==z)return!1;if(H){const a=C(t.startTime);if(!Re(a,C(H)))return!1}return!0}),Z=d.useCallback(t=>{gt(t),P(1),t==="calendar"&&Q(null)},[]);if(D||Ct)return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(Qe,{className:"h-12 w-64"}),e.jsx(Qe,{className:"h-[600px] w-full"})]});if(kt)return e.jsx("div",{className:"space-y-8 p-8",children:e.jsx(B,{className:"p-12 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(Xe,{className:"w-16 h-16 text-destructive"}),e.jsx("h3",{className:"text-xl font-semibold","data-testid":"text-error-title",children:"Unable to Load Events"}),e.jsx("p",{className:"text-muted-foreground","data-testid":"text-error-description",children:"We couldn't load the events right now. Please check your connection and try again."}),e.jsxs(p,{onClick:()=>St(),"data-testid":"button-retry",children:[e.jsx(qt,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})})});const Se=t=>{vt(t),R(!0),W(!1),Le(!1)},Pt=()=>{he(new Date)},Et=()=>{he(es(M))},Dt=()=>{he(rs(M,1))},Mt=t=>ke.filter(a=>{const l=C(a.startTime);return Re(l,t)}),Rt=t=>{const a=C(t.startTime),l=C(t.endTime),x=encodeURIComponent(t.title),h=encodeURIComponent(t.description||""),g=encodeURIComponent(t.location||""),c=v=>v.toISOString().replace(/-|:|\.\d{3}/g,""),i=v=>v.toISOString(),r=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${x}&dates=${c(a)}/${c(l)}&details=${h}&location=${g}`,N=`https://outlook.live.com/calendar/0/deeplink/compose?subject=${x}&startdt=${i(a)}&enddt=${i(l)}&body=${h}&location=${g}`,w=v=>v.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;"),u=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//TFB//Events//EN","CALSCALE:GREGORIAN","BEGIN:VEVENT",`UID:event-${t.id}@tfb`,`DTSTAMP:${c(new Date)}`,`DTSTART:${c(a)}`,`DTEND:${c(l)}`,`SUMMARY:${w(t.title)}`,`DESCRIPTION:${w(t.description||"")}`,`LOCATION:${w(t.location||"")}`,"END:VEVENT","END:VCALENDAR"].join(`\r
2`);return{googleUrl:r,outlookUrl:N,ics:u}},$t=(t,a)=>{if(typeof window>"u")return;const l=new Blob([a],{type:"text/calendar;charset=utf-8"}),x=URL.createObjectURL(l),h=document.createElement("a");h.href=x,h.download=`${ns(t.title)}.ics`,document.body.appendChild(h),h.click(),h.remove(),setTimeout(()=>URL.revokeObjectURL(x),4e3)},At=()=>{if(!s)return null;const t=C(s.startTime),a=C(s.endTime),l=y(t,"EEEE, MMMM do"),x=r=>{const N=r.getMinutes();return y(r,N===0?"ha":"h:mma").toLowerCase()},h=`${x(t)} - ${x(a)}`,{googleUrl:g,outlookUrl:c,ics:i}=Rt(s);return e.jsx(et,{open:fe,onOpenChange:R,children:e.jsxs(tt,{className:"sm:max-w-lg p-0","aria-describedby":void 0,children:[e.jsx(st,{className:"sr-only",children:s.title}),e.jsxs("div",{className:"overflow-y-auto max-h-[90vh]",children:[e.jsxs("div",{className:"relative w-full bg-muted rounded-t-lg overflow-hidden",children:[e.jsx(Me,{src:ps(s.imageUrl,1024),alt:s.title,fallbackSrc:ne,className:"w-full h-auto max-h-[60vh] object-contain",containerClassName:"w-full flex items-center justify-center","data-testid":`img-event-${s.id}`}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-2",children:[G(s)==="all_access_creator"?e.jsxs(f,{className:"bg-amber-500 text-white","data-testid":"badge-dialog-all-access",children:[e.jsx(re,{className:"w-3 h-3 mr-1"}),"All Access Event"]}):s.isPremiumOnly?e.jsxs(f,{className:"bg-amber-500 text-white","data-testid":"badge-dialog-vip",children:[e.jsx(pe,{className:"w-3 h-3 mr-1"}),"VIP Event"]}
2):null,s.pricingType==="donation"&&e.jsxs(f,{className:"bg-green-600 text-white","data-testid":"badge-dialog-donation",children:[e.jsx(ie,{className:"w-3 h-3 mr-1"}),"Donation"]}),s.pricingType==="fixed"&&s.priceInCents&&s.priceInCents>0&&e.jsx(f,{className:"bg-green-600 text-white","data-testid":"badge-dialog-price",children:O(s.priceInCents,s.currency)})]})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx("div",{children:e.jsx("h2",{className:`${ts(s.title)} font-bold break-words`,"data-testid":"text-event-title",children:s.title})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ee,{className:"w-5 h-5 text-muted-foreground flex-shrink-0"}),e.jsxs("span",{className:"text-base",children:[l," @ ",h]})]}),e.jsx("p",{className:"text-sm text-muted-foreground ml-8",children:"All times in ET"})]}),s.description&&e.jsx("p",{className:"text-base text-foreground","data-testid":"text-event-description",children:s.description}),Ie(s)&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Kt,{className:"w-4 h-4"}),e.jsx(f,{variant:"destructive","data-testid":"badge-sold-out",children:"Sold Out"})]}),s.location&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ut,{className:"w-5 h-5 flex-shrink-0 text-muted-foreground mt-0.5"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-base",children:s.location}),s.address&&e.jsx("a",{href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(s.address)}`,target:"_blank",rel:"noopener noreferrer",className:"block text-sm text-primary hover:underline","data-testid":"link-event-address",children:s.address})]})]}),!bt&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>Le(!oe),className:"flex items-center gap-2 text-sm text-muted-foreground hover-elevate active-elevate-2 rounded-md px-2 py-1","data-testid":"button-toggle-map",children:[oe?e.jsx($e,{className:"w-4 h-4"}):e.jsx(Ae,{className:"w-4 h-4"}),oe?"Hide Map":"Show Map"]}),oe&&e.jsx(Jt,{address:s.address||s.location,height:200,testId:"iframe-event-map",onError:()=>Nt(!0)})]})]}),e.jsxs("div",{className:"pt-2 space-y-3",children:[(()=>{const r=xs(s,n==null?void 0:n.role),N=s.pricingType==="fixed"&&(s.priceInCents??0)>0,w=O(s.priceInCents,s.currency),u=je===s.id&&E.isPending,v=jt===s.id&&Ye.isPending,V=le(s),k=s.rsvpStatus==="waitlist"&&s.rsvpPaymentStatus==="pending";if(V)return e.jsx(f,{variant:"secondary",className:"w-full justify-center py-2","data-testid":"badge-past-event",children:"This event has ended"});if(s.rsvpStatus==="confirmed")return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(p,{className:"w-full justify-center gap-2 bg-green-600 cursor-default",disabled:!0,"data-testid":"button-attending",children:[e.jsx(Pe,{className:"w-4 h-4"}),"Attending"]}),e.jsx(p,{variant:"outline",className:"w-full justify-center gap-2 text-destructive",onClick:()=>Ye.mutate(s.id),disabled:v,"data-testid":"button-cancel-rsvp",children:v?e.jsx(ue,{className:"w-4 h-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"w-4 h-4"}),"Cancel RSVP"]})})]});if(k){const L=s.pricingType==="donation";return e.jsx(p,{className:"w-full justify-center gap-2",onClick:()=>{L?(R(!1),s.suggestedAmountCents?$((s.suggestedAmountCents/100).toFixed(2)):$(""),Y(s)):E.mutate({eventId:s.id})},disabled:u,"data-testid":"button-complete-payment",children:u?e.jsx(ue,{className:"w-5 h-5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4"}),"Complete Payment"]})})}if(!r.canRsvp&&r.reason==="sold_out")return e.jsx(p,{className:"w-full justify-center gap-2",disabled:!0,"data-testid":"button-sold-out",children:"Sold Out"});if(!r.canRsvp&&(r.reason==="premium_required"||r.reason==="all_access_required")){const L=G(s),T=pt[L],te=L==="all_access_creator",Ft=te?"all_access":"vip";return e.jsxs("div",{className:"bg-muted/50 border border-border rounded-lg p-4 text-center space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 text-amber-600",children:[te?e.jsx(re,{className:"w-5 h-5"}):e.jsx(pe,{className:"w-5 h-5"}),e.jsxs("span",{className:"font-semibold",children:[T," Event"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:te?"Upgrade to All Access to RSVP":"Upgrade to VIP or All Access to RSVP"}),e.jsxs(p,{variant:"outline",onClick:()=>{R(!1),I(Ft)},className:"w-full","data-testid":"button-upgrade-for-rsvp",children:["Upgrade to ",T]})]})}const F=s.pricingType==="donation",S=s.pricingType==="fixed"&&N;return e.jsx(p,{className:"w-full justify-center gap-2",onClick:()=>{S||F?(R(!1),F&&s.suggestedAmountCents?$((s.suggestedAmountCents/100).toFixed(2)):$(""),Y(s)):E.mutate({eventId:s.id})},disabled:u,"data-testid":"button-rsvp",children:u?e.jsx(ue,{className:"w-5 h-5 animate-spin"}):e.jsxs(e.Fragment,{children:[(S||F)&&e.jsx(ie,{className:"w-4 h-4"}),F?"RSVP - Donate":`RSVP ${S?`- ${w}`:""}`]})})})(),e.jsxs(Ht,{open:Ve,onOpenChange:W,children:[e.jsx(Qt,{asChild:!0,children:e.jsxs(p,{variant:"outline",className:"w-full justify-center gap-2","data-testid":"button-add-to-calendar",children:[e.jsx(ss,{className:"w-5 h-5"}),"ADD TO CALENDAR",Ve?e.jsx($e,{className:"w-4 h-4 ml-1"}):e.jsx(Ae,{className:"w-4 h-4 ml-1"})]})}),e.jsxs(Xt,{className:"w-full min-w-[200px]",align:"center",children:[e.jsx(De,{asChild:!0,onClick:()=>W(!1),children:e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"cursor-pointer font-medium","data-testid":"link-google-calendar",children:"Google"})}),e.jsx(De,{onClick:()=>{W(!1),$t(s,i)},className:"cursor-pointer font-medium","data-testid":"link-apple-calendar",children:"Apple"}),e.jsx(De,{asChild:!0,onClick:()=>W(!1),children:e.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"cursor-pointer font-medium","data-testid":"link-outlook-calendar",children:"Outlook"})})]})]})]})]})]})]})})},It=()=>{const t=ls(M),a=ms(M),l=is(t,{weekStartsOn:1}
2),x=cs(a,{weekStartsOn:1}),h=as({start:l,end:x}),g=new Date;return e.jsx("div",{className:"space-y-4",children:e.jsx(B,{children:e.jsx(xe,{className:"p-2 sm:p-4 md:p-6",children:e.jsxs("div",{className:"grid grid-cols-7 gap-px bg-border rounded-lg overflow-hidden",children:[["M","T","W","T","F","S","S"].map((c,i)=>e.jsxs("div",{className:"bg-muted p-1 sm:p-2 md:p-3 text-center text-xs sm:text-sm font-medium",children:[e.jsx("span",{className:"sm:hidden",children:c}),e.jsx("span",{className:"hidden sm:inline",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"][i]})]},i)),h.map((c,i)=>{const r=Mt(c),N=os(c,M),w=Re(c,g);if(r.length===1){const u=r[0],v=C(u.startTime),V=y(v,v.getMinutes()===0?"ha":"h:mma").toLowerCase(),k=ee;return e.jsxs("button",{type:"button",onClick:()=>k?I("vip"):Se(u),className:`group relative bg-card min-w-0 overflow-hidden min-h-[60px] sm:min-h-[80px] md:min-h-[120px] text-left hover-elevate ${N?"":"opacity-60"}`,"data-testid":k?`button-vip-tease-feature-${u.id}`:`event-feature-${u.id}`,children:[e.jsx(Me,{src:u.imageUrl||ne,fallbackSrc:ne,alt:u.title,className:`absolute inset-0 w-full h-full object-cover transition-transform duration-300 group-hover:scale-[1.04] ${k?"blur-sm scale-105":""}`,containerClassName:"absolute inset-0 w-full h-full",sizes:"(max-width: 1024px) 100vw, 800px",responsiveWidths:[480,800,1280],priority:!0,"data-testid":`img-event-feature-${u.id}`}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/50 to-transparent","aria-hidden":"true"}),e.jsxs("div",{className:"relative h-full flex flex-col justify-between p-1 sm:p-2 min-h-[60px] sm:min-h-[80px] md:min-h-[120px]",children:[e.jsx("div",{className:"flex justify-between items-start",children:e.jsx("span",{className:w?"w-5 h-5 sm:w-6 sm:h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs sm:text-sm font-bold":"text-xs sm:text-sm font-semibold text-white drop-shadow",children:y(c,"d")})}),e.jsx("div",{className:"min-w-0",children:k?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] sm:text-xs font-medium text-white drop-shadow",children:[e.jsx(ae,{className:"w-3 h-3"}),"Members only"]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"hidden sm:block text-[9px] md:text-[10px] font-medium uppercase tracking-wide text-white/85 drop-shadow leading-none mb-0.5",children:V}),e.jsx("p",{className:"text-[10px] sm:text-xs font-semibold text-white drop-shadow line-clamp-2 leading-tight",children:u.title})]})})]})]},i)}return e.jsxs("div",{className:`bg-card min-w-0 overflow-hidden min-h-[60px] sm:min-h-[80px] md:min-h-[120px] p-1 sm:p-2 ${N?"":"text-muted-foreground"}`,children:[e.jsx("div",{className:"flex justify-between items-start mb-1",children:e.jsx("span",{className:`text-xs sm:text-sm ${w?"w-5 h-5 sm:w-6 sm:h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold":"font-medium"}`,children:y(c,"d")})}),e.jsxs("div",{className:"space-y-0.5 sm:space-y-1",children:[r.slice(0,2).map(u=>{const v=C(u.startTime),V=y(v,v.getMinutes()===0?"ha":"h:mma").toLowerCase(),k=ee;return e.jsx("button",{onClick:()=>k?I("vip"):Se(u),className:"flex w-full min-w-0 overflow-hidden items-center text-left text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 sm:py-1 rounded bg-primary/15 text-primary hover-elevate transition-colors cursor-pointer whitespace-nowrap","data-testid":k?`button-vip-tease-chip-${u.id}`:`event-${u.id}`,children:k?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ae,{className:"w-3 h-3"}),e.jsx("span",{children:"Members only"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"hidden sm:inline font-medium shrink-0",children:[V," - "]}),e.jsx("span",{className:"block min-w-0 flex-1 truncate",children:u.title})]})},u.id)}),r.length>2&&e.jsxs("button",{onClick:()=>{if(ee){I("vip");return}Q(y(c,"yyyy-MM-dd")),Z("list")},className:"text-[10px] text-primary hover:underline cursor-pointer","data-testid":`button-more-events-${y(c,"yyyy-MM-dd")}`,children:["+",r.length-2," more"]})]})]},i)})]})})})})},Ke=(t,a=!1)=>{const l=C(t.startTime),x=C(t.endTime),h=y(l,"EEE, MMM d"),g=T=>{const te=T.getMinutes();return y(T,te===0?"ha":"h:mma")},c=`${g(l)} - ${g(x)}`,i=t.pricingType==="fixed"&&(t.priceInCents??0)>0,r=t.pricingType==="donation",N=O(t.priceInCents,t.currency),w=G(t),u=w==="all_access_creator",v=!u&&t.isPremiumOnly,V=Ie(t),k=!a&&ft(t),F=pt[w],S=ee&&!a,L=S?()=>I("vip"):()=>Se(t);return e.jsx(B,{id:`event-${t.id}`,style:{scrollMarginTop:"5rem"},className:`overflow-visible cursor-pointer hover-elevate transition-all ${a?"opacity-60":""}`,onClick:L,tabIndex:0,role:"button",onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),L())},"data-testid":S?`button-vip-tease-card-${t.id}`:`card-event-${t.id}`,children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4 p-3 sm:p-4",children:[e.jsxs("div",{className:"relative w-full sm:w-40 md:w-48 h-40 sm:h-28 md:h-32 flex-shrink-0 rounded-lg overflow-hidden bg-muted",children:[e.jsx(Me,{src:t.imageUrl||ne,alt:t.title,fallbackSrc:ne,className:`w-full h-full object-cover ${a?"grayscale":""} ${S?"blur-sm scale-105":""}`,containerClassName:"w-full h-full",sizes:"(max-width: 640px) 100v
2w, 240px",responsiveWidths:[240,480],"data-testid":`img-event-list-${t.id}`}),e.jsxs("div",{className:"absolute top-2 left-2 flex flex-wrap gap-1",children:[a&&e.jsx(f,{variant:"secondary",className:"text-xs","data-testid":`badge-past-${t.id}`,children:"Past"}),!S&&V&&!a&&e.jsx(f,{variant:"destructive",className:"text-xs","data-testid":`badge-sold-out-${t.id}`,children:"Sold Out"}),u&&e.jsxs(f,{className:"bg-amber-500 text-white text-xs","data-testid":`badge-all-access-${t.id}`,children:[e.jsx(re,{className:"w-3 h-3 mr-1"}),"All Access"]}),v&&e.jsxs(f,{className:"bg-amber-500 text-white text-xs","data-testid":`badge-vip-${t.id}`,children:[e.jsx(pe,{className:"w-3 h-3 mr-1"}),"VIP"]}),!S&&r&&e.jsxs(f,{className:"bg-green-600 text-white text-xs","data-testid":`badge-donation-${t.id}`,children:[e.jsx(ie,{className:"w-3 h-3 mr-1"}),"Donation"]}),!S&&i&&e.jsx(f,{className:"bg-green-600 text-white text-xs","data-testid":`badge-price-${t.id}`,children:N})]})]}),e.jsx("div",{className:"flex-1 min-w-0",children:S?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-1",children:h}),e.jsx("h3",{className:`${lt(t.title)} font-semibold mb-1 break-words`,children:t.title}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground italic hidden sm:block",children:"Event details, location and RSVP unlock with VIP membership."}),e.jsxs("div",{className:"flex flex-wrap gap-2 sm:gap-3 text-xs sm:text-sm text-muted-foreground mt-2",children:[e.jsx(f,{variant:"secondary",className:"text-xs",children:xt[t.eventType]||t.eventType}),e.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),I("vip")},className:"rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring","data-testid":`button-vip-tease-lock-${t.id}`,children:e.jsxs(f,{className:"bg-amber-500 text-white text-xs cursor-pointer",children:[e.jsx(ae,{className:"w-3 h-3 mr-1"}),"Unlock with ",F]})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground mb-1",children:[h," @ ",c]}),e.jsx("h3",{className:`${lt(t.title)} font-semibold mb-1 break-words`,children:t.title}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground line-clamp-2 hidden sm:block",children:t.description}),e.jsxs("div",{className:"flex flex-wrap gap-2 sm:gap-3 text-xs sm:text-sm text-muted-foreground mt-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"truncate max-w-[120px] sm:max-w-none",children:t.location})]}),e.jsx(f,{variant:"secondary",className:"text-xs",children:xt[t.eventType]||t.eventType}),t.rsvpStatus==="confirmed"&&e.jsxs(f,{className:"bg-green-600 text-white text-xs","data-testid":`badge-attending-${t.id}`,children:[e.jsx(Pe,{className:"w-3 h-3 mr-1"}),"Attending"]}),k&&e.jsxs(f,{className:"bg-amber-500 text-white text-xs","data-testid":`badge-unlock-${t.id}`,children:[e.jsx(ae,{className:"w-3 h-3 mr-1"}),"Unlock with ",F]})]})]})})]})},t.id)},Vt=()=>{const t=[...We].sort((i,r)=>new Date(i.startTime).getTime()-new Date(r.startTime).getTime()),a=t.filter(i=>!le(i)),l=t.filter(i=>
2le(i)).reverse(),x=(_-1)*ye,h=x+ye,g=a.slice(x,h),c=Math.ceil(a.length/ye);return g.length===0&&l.length===0?e.jsx(B,{children:e.jsx(xe,{className:"p-12 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(Ee,{className:"w-16 h-16 text-muted-foreground"}),e.jsx("h3",{className:"text-xl font-semibold",children:"No Events"}),e.jsx("p",{className:"text-muted-foreground",children:"There are no events scheduled at this time."})]})})}):e.jsxs("div",{className:"space-y-4",children:[g.length===0&&!K?e.jsx(B,{children:e.jsx(xe,{className:"p-8 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(Ee,{className:"w-12 h-12 text-muted-foreground"}),e.jsx("h3",{className:"text-lg font-semibold",children:"No Upcoming Events"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Check back later for new events."})]})})}):g.map(i=>Ke(i,!1)),c>1&&e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 mt-4 sm:mt-6",children:[e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>P(i=>Math.max(1,i-1)),disabled:_===1,"data-testid":"button-previous-page",children:[e.jsx(dt,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline ml-1",children:"Previous"})]}),e.jsx("div",{className:"flex gap-1",children:(()=>{const i=[];if(c<=7)for(let r=1;r<=c;r++)i.push(r);else{i.push(1);const r=Math.max(2,_-1),N=Math.min(c-1,_+1);r>2&&i.push("start-ellipsis");for(let w=r;w<=N;w++)i.push(w);N<c-1&&i.push("end-ellipsis"),i.push(c)}return i.map(r=>typeof r=="string"?e.jsx("span",{className:"flex items-center px-1 text-muted-foreground",children:"..."},r):e.jsx(p,{variant:r===_?"default":"outline",size:"sm",onClick:()=>P(r),className:"w-8 sm:w-10","data-testid":`page-${r}`,children:r},r))})()}),e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>P(i=>Math.min(c,i+1)),disabled:_===c,"data-testid":"button-next-page",children:[e.jsx("span",{className:"hidden sm:inline mr-1",children:"Next"}),e.jsx(Ze,{className:"w-4 h-4"})]})]}),l.length>0&&e.jsxs("div",{className:"pt-4 border-t",children:[e.jsxs(p,{variant:"ghost",className:"w-full justify-center gap-2 text-muted-foreground",onClick:()=>wt(!K),"data-testid":"button-toggle-past-events",children:[K?e.jsx($e,{className:"w-4 h-4"}):e.jsx(Ae,{className:"w-4 h-4"}),K?"Hide":"Show"," Past Events (",l.length,")"]}),K&&e.jsx("div",{className:"space-y-4 mt-4",children:l.map(i=>Ke(i,!0))})]})]})},ee=A==="vip"&&Ce;return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(zt,{value:A,onValueChange:yt,children:e.jsxs(Yt,{"data-testid":"tabs-events-section",children:[e.jsx(Je,{value:"all","data-testid":"tab-events-all",children:"All Events"}),e.jsxs(Je,{value:"vip","data-testid":"tab-events-vip",children:[e.jsx(re,{className:"w-3.5 h-3.5 mr-1.5"}),"VIP Events",Ce&&e.jsx(ae,{className:"w-3 h-3 ml-1.5"}),!Ce&&Be>0&&e.jsx(f,{variant:"secondary",className:"ml-2",children:Be})]})]})}),ce&&e.jsxs("div",{className:`flex items-center justify-between gap-3 px-4 py-3 rounded-md border ${ce.type==="success"?"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200":"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200"}`,"data-testid":"banner-rsvp-result",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[ce.type==="success"?e.jsx(Pe,{className:"w-4 h-4 flex-shrink-0"}):e.jsx(Xe,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:ce.message})]}),e.jsx(p,{variant:"ghost",size:"icon",onClick:()=>Ne(null),className:"flex-shrink-0","data-testid":"button-dismiss-rsvp-banner",children:e.jsx(me,{className:"w-4 h-4"})})]}),ee&&e.jsx(hs,{onUpgrade:()=>I("vip")}),e.jsxs("div",{className:"sm:hidden flex items-center justify-between gap-2",children:[e.jsx("div",{children:j==="list"?e.jsx("h1",{className:"text-xl font-bold",children:"Upcoming Events"}):e.jsx("h1",{className:"text-xl font-bold",children:y(M,"MMMM yyyy")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{variant:j==="list"?"default":"outline",size:"icon",onClick:()=>
2Z("list"),"data-testid":"button-mobile-view-list",children:e.jsx(ct,{className:"w-5 h-5"})}),e.jsx(p,{variant:j==="calendar"?"default":"outline",size:"icon",onClick:()=>Z("calendar"),"data-testid":"button-mobile-view-calendar",children:e.jsx(ot,{className:"w-5 h-5"})})]})]}),e.jsxs("div",{className:"hidden sm:flex sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[j==="calendar"&&e.jsx(p,{variant:"outline",onClick:Pt,"data-testid":"button-today",children:"Today"}),j==="calendar"&&e.jsxs(e.Fragment,{children:[e.jsx(p,{variant:"ghost",size:"icon",onClick:Et,"data-testid":"button-prev-month",children:e.jsx(dt,{className:"w-5 h-5"})}),e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-center min-w-[160px]",children:y(M,"MMMM yyyy")}),e.jsx(p,{variant:"ghost",size:"icon",onClick:Dt,"data-testid":"button-next-month",children:e.jsx(Ze,{className:"w-5 h-5"})})]}),j==="list"&&e.jsx("h2",{className:"text-xl md:text-2xl font-bold",children:"Upcoming Events"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{variant:j==="list"?"default":"outline",size:"icon",onClick:()=>Z("list"),"data-testid":"button-view-list",children:e.jsx(ct,{className:"w-5 h-5"})}),e.jsx(p,{variant:j==="calendar"?"default":"outline",size:"icon",onClick:()=>Z("calendar"),"data-testid":"button-view-calendar",children:e.jsx(ot,{className:"w-5 h-5"})})]})]}),(j==="list"||j==="calendar")&&e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mt,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Filters:"})]}),e.jsxs(at,{value:q,onValueChange:t=>{ge(t),P(1)},children:[e.jsx(nt,{className:"w-full sm:w-[140px] min-w-0","data-testid":"select-event-type",children:e.jsx(it,{placeholder:"Event Type"})}),e.jsxs(rt,{children:[e.jsx(U,{value:"all",children:"All Types"}),e.jsx(U,{value:"festival",children:"Festival"}),e.jsx(U,{value:"workshop",children:"Workshop"}),e.jsx(U,{value:"networking",children:"Networking"}),e.jsx(U,{value:"meetup",children:"Meetup"})]})]}),e.jsxs(at,{value:z,onValueChange:t=>{ve(t),P(1)},children:[e.jsx(nt,{className:"w-full sm:w-[180px] min-w-0","data-testid":"select-location",children:e.jsx(it,{placeholder:"Location"})}),e.jsxs(rt,{children:[e.jsx(U,{value:"all",children:"All Locations"}),Tt.map(t=>e.jsx(U,{value:t,children:t},t))]})]}),H&&e.jsxs(f,{variant:"secondary",className:"gap-1","data-testid":"badge-date-filter",children:[y(C(H),"MMM d, yyyy"),e.jsx("button",{onClick:t=>{t.stopPropagation(),Q(null),P(1)},className:"ml-1","data-testid":"button-clear-date-filter",children:e.jsx(me,{className:"w-3 h-3"})})]}),Ge&&e.jsxs(p,{variant:"ghost",size:"sm",onClick:()=>{ge("all"),ve("all"),Q(null),P(1)},className:"text-muted-foreground","data-testid":"button-clear-filters",children:[e.jsx(me,{className:"w-4 h-4 mr-1"}),"Clear All"]}),e.jsxs("span",{className:"text-sm text-muted-foreground w-full sm:w-auto sm:ml-auto",children:[We.filter(t=>!le(t)).length," upcoming"]})]}),j==="calendar"&&Ge&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2 bg-muted/50 border border-border rounded-md text-sm","data-testid":"banner-active-filters",children:[e.jsx(mt,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("span",{className:"text-muted-foreground",children:["Filtered:",q!=="all"&&` ${q}`,z!=="all"&&` ${z}`]}),e.jsxs(p,{variant:"ghost",size:"sm",onClick:()=>{ge("all"),ve("all"),Q(null)},className:"text-muted-foreground","data-testid":"button-clear-calendar-filters",children:[e.jsx(me,{className:"w-3 h-3 mr-1"}),"Clear"]})]}),j==="calendar"&&It(),j==="list"&&Vt(),At(),e.jsx(Bt,{open:Oe.open,onOpenChange:t=>_e(a=>({...a,open:t})),defaultTier:Oe.tier,reasonTitle:"Unlock VIP creator events",reasonDescription:"VIP and All Access members get RSVP access to private parties, festivals and exclusive creator gatherings."}),e.jsx(et,{open:!!m,onOpenChange:t=>{!t&&!E.isPending&&(Y(null),$(""))},children:e.jsxs(tt,{className:"sm:max-w-sm","aria-describedby":void 0,children:[e.jsx(st,{children:"Confirm RSVP"}),e.jsx(Gt,{children:(m==null?void 0:m.pricingType)==="donation"?"Enter your donation amount to RSVP. You will be redirected to checkout to complete payment.":"You are about to RSVP to a paid event. You will be redirected to checkout to complete payment."}),m&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:[e.jsx("p",{className:"font-semibold text-base","data-testid":"text-confirm-event-name",children:m.title}),m.pricingType==="donation"?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground font-semibold",children:"$"}),e.jsx(Wt,{type:"number",step:"0.01",min:m.minAmountCents?(m.minAmountCents/100).toFixed(2):"0.01",value:Fe,onCh
2ange:t=>$(t.target.value),placeholder:m.suggestedAmountCents?(m.suggestedAmountCents/100).toFixed(2):"0.00",className:"pl-7 text-lg font-bold","data-testid":"input-donation-amount"})]}),m.minAmountCents&&m.minAmountCents>0&&e.jsxs("p",{className:"text-xs text-muted-foreground","data-testid":"text-min-donation",children:["Minimum: ",O(m.minAmountCents,m.currency)]}),m.suggestedAmountCents&&m.suggestedAmountCents>0&&e.jsxs("p",{className:"text-xs text-muted-foreground","data-testid":"text-suggested-donation",children:["Suggested: ",O(m.suggestedAmountCents,m.currency)]})]}):e.jsx("p",{className:"text-2xl font-bold text-primary","data-testid":"text-confirm-price",children:O(m.priceInCents,m.currency)})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(p,{variant:"outline",className:"flex-1",onClick:()=>{Y(null),$("")},disabled:E.isPending,"data-testid":"button-cancel-rsvp",children:"Cancel"}),e.jsx(p,{className:"flex-1",onClick:()=>{if(m.pricingType==="donation"){const t=Math.round(parseFloat(Fe)*100);if(!t||t<=0){b({title:"Invalid amount",description:"Please enter a valid donation amount.",variant:"destructive"});return}const a=m.minAmountCents||0;if(a>0&&t<a){b({title:"Below minimum",description:`Minimum donation is ${O(a,m.currency)}.`,variant:"destructive"});return}E.mutate({eventId:m.id,donationAmountCents:t})}else E.mutate({eventId:m.id})},disabled:je===m.id&&E.isPending,"data-testid":"button-confirm-rsvp",children:je===m.id&&E.isPending?e.jsx(ue,{className:"w-4 h-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),m.pricingType==="donation"?"Donate & RSVP":"Confirm & Pay"]})})]})]})]})})]})}function hs({onUpgrade:n}){return e.jsx(B,{className:"border-primary/30 bg-gradient-to-br from-primary/10 via-background to-background cursor-pointer hover-elevate",onClick:n,tabIndex:0,role:"button",onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},"data-testid":"button-vip-tease-hero",children:e.jsx(xe,{className:"p-6 sm:p-8",children:e.jsxs("div",{className:"flex flex-col items-center text-center gap-3",children:[e.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/15",children:e.jsx(pe,{className:"h-7 w-7 text-primary"})}),e.jsx("h2",{className:"font-heading text-2xl sm:text-3xl font-bold text-foreground","data-testid":"text-vip-tease-headline",children:"Unlock VIP creator events"}),e.jsx("p",{className:"max-w-xl text-sm sm:text-base text-muted-foreground",children:"Members get exclusive RSVPs to private parties, VIP festival passes, and intimate workshops with industry pros, all in one tab."}),e.jsx("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:e.jsxs(p,{size:"lg",onClick:o=>{o.stopPropagation(),n()},"data-testid":"button-vip-tease-upgrade",children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Become a member"]})})]})})})}export{qs 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.