1import{r as m,j as e,af as C,ag as L,p as Y,s as w,n as $,L as T,t as E}from"./index-BNrdOJig.js";import{S as O}from"./SiteNav-BcGgqsav.js";import{F as H}from"./FanFreeBanner-Bn5Nkcw_.js";import{S as I}from"./SiteFooter-dnnZxriw.js";import{T as j}from"./ticket-DY92lRWa.js";import{M as P}from"./map-pin-BRjVggch.js";import"./dropdown-menu-KsqIXfPg.js";import"./index-Dc9JXvma.js";import"./index-xFoOlCOp.js";import"./index-BgFHfwbL.js";import"./chevron-down-Bsk54EUt.js";import"./globe-BA4Wl8PS.js";import"./gift-zW-OXeDx.js";import"./input-CwAqzCK4.js";import"./mail-Dg76bAst.js";function g(t,l,d,o){const c=new Date(t,l,1),h=(d-c.getDay()+7)%7;return new Date(t,l,1+h+(o-1)*7)}function A(t,l,d){const o=new Date(t,l+1,0),c=(o.getDay()-d+7)%7;return new Date(t,l,o.getDate()-c)}function B(t){const l=t%19,d=Math.floor(t/100),o=t%100,c=Math.floor(d/4),h=d%4,p=Math.floor((d+8)/25),u=Math.floor((d-p+1)/3),x=(19*l+d-c-u+15)%30,y=Math.floor(o/4),r=o%4,i=(32+2*h+2*y-x-r)%7,a=Math.floor((l+11*x+22*i)/451),s=Math.floor((x+i-7*a+114)/31)-1,n=(x+i-7*a+114)%31+1;return new Date(t,s,n)}function J(t){const l=B(t),d=new Date(t,l.getMonth(),l.getDate()-2);return[{date:new Date(t,0,1),name:"New Year's Day",type:"federal"},{date:g(t,0,1,3),name:"Martin Luther King Jr. Day",type:"federal"},{date:new Date(t,1,2),name:"Groundhog Day",type:"cultural"},{date:new Date(t,1,14),name:"Valentine's Day",type:"cultural"},{date:g(t,1,1,3),name:"Presidents' Day",type:"federal"},{date:new Date(t,2,17),name:"St. Patrick's Day",type:"cultural"},{date:d,name:"Good Friday",type:"cultural"},{date:l,name:"Easter Sunday",type:"cultural"},{date:new Date(t,3,22),name:"Earth Day",type:"cultural"},{date:new Date(t,4,5),name:"Cinco de Mayo",type:"cultural"},{date:g(t,4,0,2),name:"Mother's Day",type:"cultural"},{date:A(t,4,1),name:"Memorial Day",type:"federal"},{date:new Date(t,5,14),name:"Flag Day",type:"cultural"},{date:g(t,5,0,3),name:"Father's Day",type:"cultural"},{date:new Date(t,5,19),name:"Juneteenth",type:"federal"},{date:new Date(t,6,4),name:"Independence Day",type:"federal"},{date:g(t,8,1,1),name:"Labor Day",type:"federal"},{date:g(t,9,1,2),name:"Columbus Day / Indigenous Peoples' Day",type:"federal"},{date:new Date(t,9,31),name:"Halloween",type:"cultural"},{date:new Date(t,10,1),name:"DÃa de los Muertos",type:"cultural"},{date:new Date(t,10,11),name:"Veterans Day",type:"federal"},{date:g(t,10,4,4),name:"Thanksgiving Day",type:"federal"},{date:new Date(t,11,25),name:"Christmas Day",type:"federal"},{date:new Date(t,11,26),name:"Kwanzaa (begins)",type:"cultural"},{date:new Date(t,11,31),name:"New Year's Eve",type:"cultural"}]}function W(t,l){const d=new Set([t-1,t,t+1]),o=[];for(const c of d)o.push(...J(c));return o.filter(c=>c.date.getFullYear()===t&&c.date.getMonth()===l)}function D(t){return new Date(t.getFullYear(),t.getMonth(),1)}function N(t,l){return new Date(t.getFullYear(),t.getMonth()+l,1)}function k(t,l){return t.getFullYear()===l.getFullYear()&&t.getMonth()===l.getMonth()&&t.getDate()===l.getDate()}const q=["January","February","March","April","May","June","July","August","September","October","November","December"],R=["S","M","T","W","T","F","S"];function z({events:t,selected:l,onSelect:d}){const[o,c]=m.useState(()=>D(new Date)),h=m.useMemo(()=>{const i=D(o).getDay(),a=new Date(o.getFullYear(),o.getMonth()+1,0).getDate(),s=[];for(let n=0;n<i;n++)s.push(null);for(let n=1;n<=a;n++)s.push(new Date(o.getFullYear(),o.getMonth(),n));for(;s.length%7!==0;)s.push(null);return s},[o]),p=m.useMemo(()=>{const r=new Map;for(const i of t){const a=new Date(i.starts_at),s=`${a.getFullYear()}-${a.getMonth()}-${a.getDate()}`,n=r.get(s)??[];n.push(i),r.set(s,n)}return r},[t]),u=m.useMemo(()=>W(o.getFullYear(),o.getMonth()),[o]),x=m.useMemo(()=>{const r=new Map;for(const i of u){const a=`${i.date.getFullYear()}-${i.date.getMonth()}-${i.date.getDate()}`,s=r.get(a)??[];s.push(i),r.set(a,s)}return r},[u]),y=new Date;return e.jsxs("div",{className:"rounded-2xl border-2 border-primary/40 bg-black p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{onClick:()=>c(N(o,-1)),className:"h-9 w-9 grid place-items-center rounded-full border border-primary/40 text-primary hover:bg-primary hover:text-black transition","aria-label":"Previous month",children:e.jsx(C,{className:"w-4 h-4"})}),e.jsxs("div",{className:"font-display text-xl text-primary uppercase tracking-wider",children:[q[o.getMonth()]," ",o.getFullYear()]}),e.jsx("button",{onClick:()=>c(N(o,1)),className:"h-9 w-9 grid place-items-center rounded-full border border-primary/40 text-primary hover:bg-primary hover:text-black transition","aria-label":"Next month",children:e.jsx(L,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:R.map((r,i)=>e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-primary/60 text-center py-1",children:r},i))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:h.map((r,i)=>{if(!r)return e.jsx("div",{className:"aspect-square"},i);const a=`${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`,n=(p.get(a)??[]).length>0,b=x.get(a)??[],v=b.length>0,S=b.map(_=>_.name).join(" · "),F=k(r,y),f=l&&k(r,l);return e.jsxs("button",{onClick:()=>d(f?null:r),title:S||void 0,className:`aspect-square rounded-lg text-sm font-bold flex flex-col items-center justify-center transition-all relative 2 ${f?"bg-primary text-black":n?"bg-primary/15 text-primary border border-primary/50 hover:bg-primary/30":v?"text-white/90 hover:bg-white/10":"text-primary/50 hover:text-primary hover:bg-primary/10"} 3 ${F&&!f?"ring-1 ring-primary":""}`,children:[e.jsx("span",{children:r.getDate()}),n&&!f&&e.jsx("span",{className:"absolute bottom-1 h-1 w-1 rounded-full bg-primary"}),v&&!n&&!f&&e.jsx("span",{className:"absolute bottom-1 h-1 w-1 rounded-full bg-white/80"})]},i)})}),u.length>0&&e.jsxs("div",{className:"mt-5 pt-4 border-t border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-widest text-primary/60 mb-2",children:[e.jsx(Y,{className:"w-3 h-3"})," Holidays this month"]}),e.jsx("ul",{className:"space-y-1.5",children:u.sort((r,i)=>r.date.getDate()-i.date.getDate()).map((r,i)=>e.jsxs("li",{className:"flex items-center justify-between text-xs gap-3",children:[e.jsxs("button",{onClick:()=>d(r.date),className:"text-left text-primary/90 hover:text-primary truncate flex items-center gap-2",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${r.type==="federal"?"bg-primary":"bg-white/70"}`}),e.jsx("span",{className:"truncate",children:r.name})]}),e.jsx("span",{className:"text-primary/50 tabular-nums shrink-0",children:r.date.toLocaleDateString(void 0,{month:"short",day:"numeric"})})]},i))})]})]})}function M(t){return new Date(t).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}function G(t){return new Date(t).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function ce(){const[t,l]=m.useState([]),[d,o]=m.useState([]),[c,h]=m.useState(null),[p,u]=m.useState(""),[x,y]=m.useState(!0);m.useEffect(()=>{(async()=>{const a=new Date().toISOString(),{data:s}=await w.from("events").select("id, slug, title, cover_url, venue_name, city, country, starts_at, artist_id").eq("status","published").gte("starts_at",a).order("starts_at",{ascending:!0}),n=s??[];if(l(n),n.length){const{data:b}=await w.from("ticket_tiers").select("event_id, price_cents, currency").in("event_id",n.map(v=>v.id));o(b??[])}y(!1)})()},[]);const r=m.useMemo(()=>{const a=new Map;for(const s of d){const n=a.get(s.event_id);
3(!n||s.price_cents<n.cents)&&a.set(s.event_id,{cents:s.price_cents,currency:s.currency})}return a},[d]),i=m.useMemo(()=>{let a=t;if(c&&(a=a.filter(s=>{const n=new Date(s.starts_at);return n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()})),p.trim()){const s=p.toLowerCase();a=a.filter(n=>n.title.toLowerCase().includes(s)||n.venue_name.toLowerCase().includes(s)||(n.city??"").toLowerCase().includes(s))}return a},[t,c,p]);return e.jsxs("div",{className:"min-h-screen bg-black text-primary",children:[e.jsx(O,{}),e.jsxs("main",{className:"pt-[var(--site-nav-offset)] pb-24 max-w-[1400px] mx-auto px-6",children:[e.jsx("div",{className:"-mx-6 mb-8",children:e.jsx(H,{})}),e.jsxs("section",{className:"text-center mb-12",children:[e.jsx("div",{className:"inline-block px-3 py-1 rounded-full border border-primary/40 text-[10px] uppercase tracking-[0.3em] font-bold mb-4",children:"Events · Live · Real"}),e.jsxs("h1",{className:"font-display text-5xl md:text-7xl uppercase tracking-tight leading-none",children:["Live Shows.",e.jsx("br",{}),e.jsx("span",{className:"text-white",children:"Real Tickets."})]}),e.jsx("p",{className:"text-primary/70 mt-5 max-w-xl mx-auto text-sm",children:"Support independent artists directly. 100% of every ticket goes straight to the artist."})]}),e.jsxs("div",{className:"grid lg:grid-cols-[380px_1fr] gap-8",children:[e.jsxs("aside",{className:"space-y-5",children:[e.jsx(z,{events:t,selected:c,onSelect:h}),e.jsxs("div",{className:"rounded-2xl border border-primary/30 bg-black p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] uppercase tracking-widest text-primary/60 mb-2",children:[e.jsx($,{className:"w-3 h-3"})," Search"]}),e.jsx("input",{value:p,onChange:a=>u(a.target.value),placeholder:"Artist, venue, cityâ¦",className:"w-full bg-black border border-primary/40 rounded-lg px-3 py-2 text-sm text-primary placeholder:text-primary/40 focus:outline-none focus:border-primary"}),(c||p)&&e.jsx("button",{onClick:()=>{h(null),u("")},className:"mt-3 text-[10px] uppercase tracking-widest text-primary/70 hover:text-primary",children:"Clear filters"})]})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-5",children:[e.jsx("h2",{className:"font-display text-2xl uppercase tracking-wider",children:c?M(c.toISOString()):"All upcoming"}),e.jsxs("div",{className:"text-xs text-primary/60",children:[i.length," ",i.length===1?"event":"events"]})]}),x?e.jsx("div",{className:"text-primary/60 text-sm",children:"Loadingâ¦"}):i.length===0?e.jsxs("div",{className:"rounded-2xl border-2 border-dashed border-primary/30 p-12 text-center",children:[e.jsx(j,{className:"w-10 h-10 mx-auto text-primary/40 mb-3"}),e.jsx("div",{className:"font-display text-xl uppercase tracking-wider",children:"No events"}),e.jsx("p",{className:"text-xs text-primary/60 mt-2",children:c?"Nothing on this date. Try another day.":"Check back soon for upcoming shows."})]}):e.jsx("div",{className:"grid sm:grid-cols-2 gap-5",children:i.map(a=>{const s=r.get(a.id);return e.jsxs(T,{to:"/events/$slug",params:{slug:a.slug},className:"group rounded-2xl overflow-hidden border-2 border-primary/30 bg-black hover:border-primary transition-all hover:-translate-y-1",children:[e.jsxs("div",{className:"aspect-[16/10] bg-gradient-to-br from-primary/20 to-black relative overflow-hidden",children:[a.cover_url?e.jsx("img",{src:E(a.cover_url,960),alt:a.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy",decoding:"async"}):e.jsx("div",{className:"w-full h-full grid place-items-center",children:e.jsx(j,{className:"w-16 h-16 text-primary/30"})}),e.jsxs("div",{className:"absolute top-3 left-3 bg-primary text-black px-2.5 py-1 rounded-md font-bold text-[11px] uppercase tracking-wider",children:[M(a.starts_at)," · ",G(a.starts_at)]})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"font-display text-lg uppercase tracking-tight text-primary leading-tight line-clamp-2",children:a.title}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-primary/70",children:[e.jsx(P,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"line-clamp-1",children:[a.venue_name,a.city?` · ${a.city}`:""]})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-widest text-primary/60",children:s?s.cents===0?"Free":`From $${(s.cents/100).toFixed(2)}`:"TBA"}),e.jsx("span",{className:"text-[10px] uppercase tracking-widest font-bold text-primary group-hover:underline",children:"Tickets â"})]})]})]},a.id)})})]})]})]}),e.jsx(I,{})]})}
3export{ce as component};
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.