PageSourceSearch

https://the-lost-art.com/assets/CommunityCalendarTab-CY8thNby.js

js the-lost-art.com collected 2026-10-05 18:01:10 UTC 16,131 bytes, 1 lines download raw bytes

1import{r as p,j as e}from"./react-vendor-BS-Esnrx.js";import{F as u}from"./dj-feature-BhX2-AdB.js";import{aF as P,d as _,b as J,j as G,X as D,h as E,g as O,G as N,U as W}from"./lucide-ke3X4oaS.js";import"./dj-data-Dd6c-HdA.js";import"./motion-BN_7uyJg.js";const o="#00ccff",V=["general","broadcast","battle","challenge","meetup","release"],z={broadcast:"📻",battle:"⚔️",challenge:"🏆",meetup:"🤝",release:"💿",general:"📅"},j={broadcast:"#ef4444",battle:"#f59e0b",challenge:"#a78bfa",meetup:"#34d399",release:"#f97316",general:"#00ccff"},X=["January","February","March","April","May","June","July","August","September","October","November","December"],q=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],v={label:{fontFamily:"ui-monospace, monospace",fontSize:10,letterSpacing:"0.15em",textTransform:"uppercase",color:o,fontWeight:700},btn:(t=!1)=>({background:t?o:"rgba(0,204,255,0.08)",color:t?"#020617":o,border:`1px solid ${t?o:"rgba(0,204,255,0.3)"}`,borderRadius:8,padding:"8px 16px",cursor:"pointer",fontWeight:700,fontSize:13,transition:"all 0.15s"})};function M(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function H(t){return new Date(t).toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})}function Q({event:t,onRsvp:y,onSelect:a}){const m=j[t.eventType]??o;return e.jsxs("div",{onClick:a,style:{background:"#0f172a",border:"1px solid #1e293b",borderLeft:`3px solid ${m}`,borderRadius:10,padding:14,cursor:"pointer",transition:"border-color 0.15s"},onMouseEnter:i=>i.currentTarget.style.borderColor=m,onMouseLeave:i=>i.currentTarget.style.borderColor="#94a3b8",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[e.jsx("span",{style:{fontSize:14},children:e.jsx(u,{devId:"5e6b77",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"span",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:fc19e7d84932561417f4c9ae021f8b0c8b99e00005bf76960a2f83caee27e090"},children:z[t.eventType]??"📅"})}),e.jsx("h3",{style:{margin:0,fontSize:14,color:"#e2e8f0",fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.jsx(u,{devId:"46d1e0",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"h3",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:b893322d77b54ddd3b75aaf3a20c3209577a9c72c9311f63a879f09f6c47cab6"},children:t.title})})]}),e.jsxs("div",{style:{display:"flex",gap:10,fontSize:11,color:"#e2e8f0",flexWrap:"wrap"},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[e.jsx(E,{size:10}),H(t.startsAt),!t.allDay&&` · ${M(t.startsAt)}`]}),t.location&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[e.jsx(O,{size:10}),t.location]}),t.isOnline&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[e.jsx(N,{size:10}),"Online"]}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[e.jsx(W,{size:10}),t.rsvpCount," going"]})]})]}),e.jsx("span",{style:{fontSize:10,background:`${m}20`,color:m,borderRadius:4,padding:"2px 6px",fontWeight:700,flexShrink:0},children:e.jsx(u,{devId:"0937cf",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"span",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:26478b3e9778771eab1df27791d2e1076cc8c25e5781e63e2dca2028de2f23c4"},children:t.eventType})})]}),t.myRsvp&&e.jsxs("div",{style:{marginTop:8,fontSize:11,color:"#00FF41",fontWeight:700},children:["✓ You're ",t.myRsvp]})]})}function Z({onClose:t,onCreated:y}){const[a,m]=p.useState({title:"",description:"",eventType:"general",location:"",isOnline:!1,eventUrl:"",startsAt:"",endsAt:"",allDay:!1,color:"#00ccff"}),[i,h]=p.useState(!1),[T,C]=p.useState(""),x=d=>g=>m(s=>({...s,[d]:g.target.value})),S=d=>g=>m(s=>({...s,[d]:g.target.checked}));async function w(){if(!a.title.trim()||!a.startsAt){C("Title and start date are required");return}h(!0);try{const d=await fetch("/api/community/calendar",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",...a})});if(d.ok)y(),t();else{const g=await d.json();C(g.error||"Failed")}}finally{h(!1)}}const f={width:"100%",background:"#020617",border:"1px solid #334155",borderRadius:8,padding:"10px 12px",color:"#e2e8f0",fontSize:14,marginBottom:12,boxSizing:"border-box"};return e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.85)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:e.jsxs("div",{style:{background:"#0f172a",border:`1px solid ${o}`,borderRadius:16,padding:24,width:"100%",maxWidth:480,maxHeight:"90vh",overflow:"auto"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20},children:[e.jsx("span",{style:v.label,children:"Add Event"}),e.jsx("button",{onClick:t,style:{background:"none",border:"none",color:"#e2e8f0",cursor:"pointer"},children:e.jsx(D,{size:16})})]}),T&&e.jsx("p",{style:{color:"#ef4444",fontSize:12,marginBottom:12},children:e.jsx(u,{devId:"69e70d",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"p",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionH
1ash:"sha256:ca00fccfb408989eddc401062c4d1219a6aceb6b9b55412357f1790862e8f178"},children:T})}),e.jsx("input",{value:a.title,onChange:x("title"),placeholder:"Event title *",style:f}),e.jsx("select",{value:a.eventType,onChange:x("eventType"),style:f,children:V.map(d=>e.jsxs("option",{value:d,children:[z[d]," ",d.charAt(0).toUpperCase()+d.slice(1)]},d))}),e.jsx("textarea",{value:a.description,onChange:x("description"),placeholder:"Description",rows:2,style:{...f,resize:"vertical"}}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:12,marginBottom:12},children:[e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:11,color:"#e2e8f0",display:"block",marginBottom:4},children:"Starts *"}),e.jsx("input",{type:"datetime-local",value:a.startsAt,onChange:x("startsAt"),style:{...f,marginBottom:0}})]}),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:11,color:"#e2e8f0",display:"block",marginBottom:4},children:"Ends"}),e.jsx("input",{type:"datetime-local",value:a.endsAt,onChange:x("endsAt"),style:{...f,marginBottom:0}})]})]}),e.jsx("input",{value:a.location,onChange:x("location"),placeholder:"Location",style:f}),e.jsxs("div",{style:{display:"flex",gap:16,marginBottom:16},children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",color:"#e2e8f0",fontSize:13},children:[e.jsx("input",{type:"checkbox",checked:a.isOnline,onChange:S("isOnline")})," Online event"]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",color:"#e2e8f0",fontSize:13},children:[e.jsx("input",{type:"checkbox",checked:a.allDay,onChange:S("allDay")})," All day"]})]}),a.isOnline&&e.jsx("input",{value:a.eventUrl,onChange:x("eventUrl"),placeholder:"Event URL / stream link",style:f}),e.jsx("button",{onClick:w,disabled:i,style:{...v.btn(!0),width:"100%"},children:e.jsx(u,{devId:"a3c499",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"button",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:014456b922de8d2635a1b590ffe212216f82f40bb5d2c32e061aee3bd2e2b1b7"},children:i?"Adding…":"Add to Calendar"})})]})})}function oe({session:t}){const y=new Date,[a,m]=p.useState(y.getFullYear()),[i,h]=p.useState(y.getMonth()),[T,C]=p.useState([]),[x,S]=p.useState([]),[w,f]=p.useState(!0),[d,g]=p.useState(!1),[s,K]=p.useState(null),[I,F]=p.useState("list"),R=p.useCallback(async()=>{f(!0);try{const n=`${a}-${String(i+1).padStart(2,"0")}`,[l,c]=await Promise.all([fetch(`/api/community/calendar?month=${n}`,{credentials:"include"}),fetch("/api/community/calendar?upcoming=true",{credentials:"include"})]);if(l.ok){const r=await l.json();C(r.events??[])}if(c.ok){const r=await c.json();S(r.events??[])}}finally{f(!1)}},[a,i]);p.useEffect(()=>{R()},[R]);async function B(n,l){t&&(await fetch("/api/community/calendar",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rsvp",eventId:n,status:l})}),C(c=>c.map(r=>r.id===n?{...r,myRsvp:l}:r)),S(c=>c.map(r=>r.id===n?{...r,myRsvp:l}:r)))}function $(){i===0?(h(11),m(n=>n-1)):h(n=>n-1)}function U(){i===11?(h(0),m(n=>n+1)):h(n=>n+1)}const L=new Date(a,i,1).getDay(),Y=new Date(a,i+1,0).getDate(),A=[...Array(L).fill(null),...Array.from({length:Y},(n,l)=>l+1)];for(;A.length%7!==0;)A.push(null);const k={};for(const n of T){const l=new Date(n.startsAt);if(l.getFullYear()===a&&l.getMonth()===i){const c=l.getDate();k[c]||(k[c]=[]),k[c].push(n)}}return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16,flexWrap:"wrap",gap:10},children:[e.jsxs("div",{children:[e.jsx("div",{style:v.label,children:"Community Calendar"}),e.jsx("p",{style:{margin:"4px 0 0",color:"#e2e8f0",fontSize:13},children:"Events, broadcasts, battles & meetups"})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>F(n=>n==="calendar"?"list":"calendar"),style:{...v.btn(!1),padding:"6px 12px",fontSize:12},children:e.jsx(u,{devId:"5c1d0e",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"button",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionH
1ash:"sha256:553637dabecbad83221130560dfc52243ff53784bb9d6a9a5d293097dd98b69a"},children:I==="calendar"?"📋 List":"📅 Calendar"})}),t&&e.jsxs("button",{onClick:()=>g(!0),style:{...v.btn(!0),display:"flex",alignItems:"center",gap:6},children:[e.jsx(P,{size:14})," Add Event"]})]})]}),I==="calendar"?e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{onClick:$,style:{background:"none",border:"1px solid #1e293b",borderRadius:6,color:"#e2e8f0",padding:"6px 10px",cursor:"pointer"},children:e.jsx(_,{size:14})}),e.jsxs("span",{style:{color:"#e2e8f0",fontWeight:700,fontSize:15},children:[X[i]," ",a]}),e.jsx("button",{onClick:U,style:{background:"none",border:"1px solid #1e293b",borderRadius:6,color:"#e2e8f0",padding:"6px 10px",cursor:"pointer"},children:e.jsx(J,{size:14})})]}),e.jsx("div",{style:{overflowX:"auto",overscrollBehavior:"contain"},children:e.jsxs("div",{style:{minWidth:280},children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:q.map(n=>e.jsx("div",{style:{textAlign:"center",fontSize:10,color:"#e2e8f0",fontWeight:700,padding:"4px 0"},children:n},n))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:A.map((n,l)=>{const c=n?k[n]??[]:[],r=n===y.getDate()&&i===y.getMonth()&&a===y.getFullYear();return e.jsx("div",{style:{minHeight:60,background:n?"#0f172a":"transparent",border:n?`1px solid ${r?o:"#94a3b8"}`:"none",borderRadius:6,padding:4},children:n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:11,color:r?o:"#e2e8f0",fontWeight:r?700:400,marginBottom:2},children:n}),c.slice(0,2).map(b=>e.jsxs("div",{onClick:()=>K(b),style:{fontSize:9,background:`${j[b.eventType]??o}30`,color:j[b.eventType]??o,borderRadius:3,padding:"1px 4px",marginBottom:2,cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[z[b.eventType]," ",b.title]},b.id)),c.length>2&&e.jsxs("div",{style:{fontSize:9,color:"#e2e8f0"},children:["+",c.length-2," more"]})]})},l)})})]})})]}):e.jsxs("div",{children:[e.jsx("div",{style:{...v.label,marginBottom:10},children:"Upcoming Events"}),w?e.jsx("div",{children:[...Array(4)].map((n,l)=>e.jsx("div",{style:{height:80,background:"#0f172a",borderRadius:10,marginBottom:8}},l))}):x.length===0?e.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"#e2e8f0"},children:[e.jsx(G,{size:32,style:{marginBottom:8,opacity:.4}}),e.jsx("p",{style:{margin:0},children:"No upcoming events. Add one!"})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:x.map(n=>e.jsx(Q,{event:n,onRsvp:B,onSelect:()=>K(n)},n.id))})]}),s&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.85)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:e.jsxs("div",{style:{background:"#0f172a",border:`1px solid ${j[s.eventType]??o}`,borderRadius:16,padding:24,width:"100%",maxWidth:460},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:20},children:e.jsx(u,{devId:"04852e",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"span",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:a6731a55d09e5e1110fbd0117a33cf3d87dab6015af56f7a972b8e5f26f3835c"},children:z[s.eventType]??"📅"})}),e.jsx("span",{style:{fontSize:11,background:`${j[s.eventType]??o}20`,color:j[s.eventType]??o,borderRadius:4,padding:"2px 6px",fontWeight:700},children:e.jsx(u,{devId:"04852f",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"span",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:c7d2e825d49ba79bcb5e9af85308306e670bba650e2ee38384b162aa9e01ec9a"},children:s.eventType})})]}),e.jsx("button",{onClick:()=>K(null),style:{background:"none",border:"none",color:"#e2e8f0",cursor:"pointer"},children:e.jsx(D,{size:16})})]}),e.jsx("h2",{style:{margin:"0 0 8px",color:"#e2e8f0",fontSize:18},children:e.jsx(u,{devId:"e3f96e",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"h2",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionH
1ash:"sha256:5a63d5c36df384ce7518e1ad4366417269c87620ab05291d6664d236aa252856"},children:s.title})}),s.description&&e.jsx("p",{style:{color:"#e2e8f0",fontSize:13,lineHeight:1.5,marginBottom:14},children:e.jsx(u,{devId:"8ae9a4",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"p",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:2bdee7e7bd8ba2241cf057ec07a6954b06711fa6799268962c31f49b07cc18c1"},children:s.description})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:13,color:"#e2e8f0",marginBottom:16},children:[e.jsxs("span",{children:[e.jsx(E,{size:13,style:{marginRight:6}}),H(s.startsAt),!s.allDay&&` at ${M(s.startsAt)}`]}),s.location&&e.jsxs("span",{children:[e.jsx(O,{size:13,style:{marginRight:6}}),s.location]}),s.isOnline&&e.jsxs("span",{children:[e.jsx(N,{size:13,style:{marginRight:6}}),"Online event"]}),e.jsxs("span",{children:[e.jsx(W,{size:13,style:{marginRight:6}}),s.rsvpCount," going"]})]}),s.eventUrl&&e.jsx("a",{href:s.eventUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"block",color:o,fontSize:13,marginBottom:16,wordBreak:"break-all"},children:e.jsx(u,{devId:"8aa9d5",guard:{file:"src/components/community/CommunityCalendarTab.tsx",tagName:"a",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:a0892ccb16e6fc86846cb1451523bd60863798b08d93422d01a6441b57b8182b"},children:s.eventUrl})}),t&&e.jsx("div",{style:{display:"flex",gap:8},children:["going","maybe","not_going"].map(n=>e.jsx("button",{onClick:()=>B(s.id,n),style:{flex:1,padding:"8px 0",borderRadius:8,cursor:"pointer",fontSize:12,fontWeight:700,background:s.myRsvp===n?o:"rgba(0,204,255,0.08)",color:s.myRsvp===n?"#020617":o,border:`1px solid ${s.myRsvp===n?o:"rgba(0,204,255,0.3)"}`},children:n==="going"?"✓ Going":n==="maybe"?"? Maybe":"✗ Can't go"},n))})]})}),d&&e.jsx(Z,{onClose:()=>g(!1),onCreated:R})]})}export{oe 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.