1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3571],{17250:(e,t,r)=>{"use strict";r.d(t,{k:()=>d});var a=r(73154);r(96810);var s=r(14660),n=r.n(s),i=r(88231),l=r(83952);function d(e){let t=(0,l.useRouter)(),r=e.title?`${e.title} \xb7 ${i.ly}`:`${i.ly} \xb7 2025`,s=e.description||i.tC,d=e.imageUrl||i.Fq,o="/"===t.route?i.W6:i.W6.replace(/\/$/,"")+t.asPath.split("?")[0];return(0,a.jsxs)(n(),{children:[(0,a.jsx)("title",{children:r}),(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,a.jsx)("meta",{name:"application-name",content:i.ly}),(0,a.jsx)("meta",{name:"description",content:s},"description"),(0,a.jsx)("meta",{name:"image",content:d},"image"),(0,a.jsx)("meta",{property:"og:type",content:"website"},"og_type"),(0,a.jsx)("meta",{property:"og:site_name",content:i.ly},"og_site_name"),(0,a.jsx)("meta",{property:"og:title",content:r},"og_title"),(0,a.jsx)("meta",{property:"og:description",content:s},"og_description"),(0,a.jsx)("meta",{property:"og:url",content:o},"og_url"),(0,a.jsx)("meta",{property:"og:image",content:d},"og_image"),(0,a.jsx)("meta",{property:"og:image:url",content:d},"og_image_url"),(0,a.jsx)("meta",{property:"og:image:secure_url",content:d},"og_image_secure_url"),(0,a.jsx)("meta",{property:"og:image:alt",content:"Devconnect Argentina"},"og_image_alt"),(0,a.jsx)("meta",{property:"og:image:type",content:"image/png"},"og_image_type"),(0,a.jsx)("meta",{property:"og:image:width",content:"1200"},"og_image_width"),(0,a.jsx)("meta",{property:"og:image:height",content:"630"},"og_image_height"),(0,a.jsx)("meta",{name:"twitter:site",content:i.bF}),(0,a.jsx)("meta",{name:"twitter:card",content:"summary_large_image"},"tw_card"),(0,a.jsx)("meta",{name:"twitter:title",content:r},"tw_title"),(0,a.jsx)("meta",{name:"twitter:description",content:s},"tw_description"),(0,a.jsx)("meta",{name:"twitter:image",content:d},"tw_image"),(0,a.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"}),(0,a.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"}),(0,a.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"}),(0,a.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"}),(0,a.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:"/apple-touch-icon.png"})]})}},25929:(e,t,r)=>{"use strict";r.d(t,{Cf:()=>c,L3:()=>x,c7:()=>m,lG:()=>l,rr:()=>p});var a=r(73154),s=r(96810),n=r(4760),i=r(53943);let l=n.bL;n.l9;let d=n.ZL;n.bm;let o=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(n.hJ,{ref:r,className:(0,i.cn)("fixed inset-0 !z-[10000000] bg-black/80 dialog-overlay",e),...t}));o.displayName=n.hJ.displayName;let c=s.forwardRef(({className:e,children:t,...r},s)=>(0,a.jsxs)(d,{children:[(0,a.jsx)(o,{}),(0,a.jsx)(n.UC,{ref:s,className:(0,i.cn)("fixed left-[50%] top-[50%] !z-[10000001] grid w-full outline-none max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white shadow-lg duration-200 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",e),...r,children:t})]}));c.displayName=n.UC.displayName;let m=({className:e,...t})=>(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});m.displayName="DialogHeader";let x=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(n.hE,{ref:r,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",e),...t}));x.displayName=n.hE.displayName;let p=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(n.VY,{ref:r,className:(0,i.cn)("text-sm text-neutral-500 dark:text-neutral-400",e),...t}));p.displayName=n.VY.displayName},33715:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var a=r(73154),s=r(96810),n=r(17250),i=r(14660),l=r.n(i);let d=(0,r(31962).UU)("https://mealmslwugsqqyoesrxd.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lYWxtc2x3dWdzcXF5b2VzcnhkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDY0MzkwNjcsImV4cCI6MjA2MjAxNTA2N30.B3cYI_ThxOY8tZ487EqGDfUDQm2LgUAyV4wDEpPqzf0");var o=r(25929),c=r(13150),m=r(87266);let x=()=>
1{let[e,t]=(0,s.useState)(null),[r,i]=(0,s.useState)(!0),[x,p]=(0,s.useState)(""),[h,g]=(0,s.useState)(""),[u,v]=(0,s.useState)([]),[y,w]=(0,s.useState)(!1),[b,f]=(0,s.useState)(""),[j,_]=(0,s.useState)(new Set),[N,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)({}),[E,A]=(0,s.useState)("all"),[O,I]=(0,s.useState)(new Set),[L,z]=(0,s.useState)({}),[J,D]=(0,s.useState)({isOpen:!1,title:"",data:null}),[R,q]=(0,s.useState)(new Set),[U,$]=(0,s.useState)({}),F=async()=>{try{w(!0),f("");let{data:e,error:t}=await d.from("atproto_records").select(` 2 id, rkey, created_by, created_at, updated_at, show_on_calendar, 3 record_passed_review, record_needs_review, lexicon, comments, reviewed, is_core_event, admin_override, 4 atproto_dids!created_by(did, alias, is_spammer, contact) 5 `).eq("lexicon","org.devcon.event").order("updated_at",{ascending:!1}),{data:r,error:a}=await d.from("atproto_records_contacts").select(` 6 rkey, email 7 `),s=e&&r?e.map(e=>({...e,contact:r.find(t=>t.rkey===e.rkey)?.email})):e||[];if(t)throw t;v(s)}catch(e){f(e.message)}finally{w(!1)}};(0,s.useEffect)(()=>{let{data:e}=d.auth.onAuthStateChange((e,r)=>{t(r?.user??null),i(!1)});return d.auth.getUser().then(({data:e})=>{t(e.user??null),i(!1)}),()=>{e.subscription.unsubscribe()}},[]),(0,s.useEffect)(()=>{e&&F()},[e]);let T=async e=>{e.preventDefault(),i(!0),g("");let{error:t}=await d.auth.signInWithOtp({email:x,options:{emailRedirectTo:`${window.location.origin}/community-events/admin`}});t?g(t.message):g("Check your email for the magic link!"),i(!1)},P=async()=>{i(!0),await d.auth.signOut(),t(null),i(!1)},V=async(e,t,r)=>{w(!0);try{let{error:t}=await d.from("atproto_records").update({show_on_calendar:r}).eq("id",e);if(t)throw t;await F()}catch(e){f(e.message)}finally{w(!1)}},Y=async(e,t,r)=>{w(!0);try{let{error:t}=await d.from("atproto_records").update({is_core_event:r}).eq("id",e);if(t)throw t;await F()}catch(e){f(e.message)}finally{w(!1)}},W=async(e,t)=>{w(!0);try{let{error:r}=await d.from("atproto_records").update({record_passed_review:t,record_needs_review:null,reviewed:!0}).eq("id",e);if(r)throw r;await F()}catch(e){f(e.message)}finally{w(!1)}},X=(e,t,r)=>{S(a=>({...a,[e]:{...a[e],[t]:r}}))},M=async e=>{w(!0);try{let t=C[e],{error:r}=await d.from("atproto_dids").update({alias:t.alias||null,contact:t.contact||null}).eq("did",e);if(r)throw r;await F();let a=new Set(N);a.delete(e),k(a)}catch(e){f(e.message)}finally{w(!1)}},Z=async(e,t)=>{w(!0);try{let{error:r}=await d.from("atproto_records").update({reviewed:t}).eq("id",e);if(r)throw r;await F()}catch(e){f(e.message)}finally{w(!1)}},G=async e=>{w(!0);try{let t=L[e],{error:r}=await d.from("atproto_records").update({comments:t||null}).eq("id",e);if(r)throw r;await F();let a=new Set(O);a.delete(e),I(a)}catch(e){f(e.message)}finally{w(!1)}},B=async e=>{w(!0);try{let t=null;if(U[e])try{t=JSON.parse(U[e])}catch(e){throw Error("Invalid JSON format")}let r=u.find(t=>t.id===e);if(!r)throw Error("Event not found");let a=r.record_passed_review||r.record_needs_review,s=t?{...a,...t}:a,n=m.env.NEXT_PUBLIC_VALIDATION_URL||"http://localhost:4000/validate-event",i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({record:s})}),l=await i.json();if(console.log("Validation result:",l),!l.valid)throw Error(`Validation failed: ${l.error||"Invalid event data"}`);let{error:o}=await d.from("atproto_records").update({admin_override:t}).eq("id",e);if(o)throw o;await F();let c=new Set(R);c.delete(e),q(c)}catch(e){alert(e.message)}finally{w(!1)}},Q=async e=>{if(confirm("Are you sure you want to remove the admin override?")){w(!0);try{let{error:t}=await d.from("atproto_records").update({admin_override:null}).eq("id",e);if(t)throw t;await F(),c.oR.success("Admin override removed successfully")}catch(e){alert(`Failed to remove admin override: ${e.message}`)}finally{w(!1)}}},H=(e,t)=>{D({isOpen:!0,title:e,data:t})},K=()=>{D({isOpen:!1,title:"",data:null})},ee=u.filter(e=>{if("needs_review"===E){let t=e.record_needs_review&&e.record_passed_review;return(!!e.record_needs_review||!!t)&&!e.reviewed}return"changes_need_review"===E?!!e.record_needs_review&&!!e.record_passed_review:"approved"!==E||!!e.record_passed_review&&!e.record_needs_review}).reduce((e,t)=>
7{let r=t.atproto_dids?.did||"unknown";return e[r]||(e[r]={didInfo:t.atproto_dids,events:[]}),e[r].events.push(t),e},{});return u.map(e=>{var t,r;let a,s;return{...(t=e.record_passed_review||e.record_needs_review,a=(r=e.admin_override)?{...t,...r}:t,s=[],Array.isArray(a.timeslots)&&a.timeslots.length>0?s=a.timeslots.map(e=>({start:e.start_utc,end:e.end_utc,name:e.title||void 0})):a.start_utc&&a.end_utc&&(s=[{start:a.start_utc,end:a.end_utc,name:a.title}]),{id:a.id,name:a.title,description:a.description,organizer:a.organizer?.name,difficulty:a.metadata?.expertise_level||"All Welcome",location:{url:a.metadata?.website||"",text:a.location?.name||""},timeblocks:s,priority:a.metadata?.priority||1,categories:a.metadata?.categories||[],amountPeople:a.metadata?.capacity!==void 0?String(a.metadata.capacity):void 0,event_type:a.event_type}),id:e.id,created_by:e.created_by,created_at:e.created_at,show_on_calendar:e.show_on_calendar,is_core_event:e.is_core_event,eventType:e.record_passed_review?.event_type,eventLink:e.record_passed_review?.main_url}}).filter(e=>e.show_on_calendar),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.k,{title:"Admin",description:"Admin dashboard for Devconnect"}),(0,a.jsx)(l(),{children:(0,a.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,a.jsx)("main",{className:"min-h-screen bg-gray-50",children:(0,a.jsx)("div",{className:"container mx-auto px-4 py-8",children:r?(0,a.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,a.jsx)("div",{className:"text-lg text-gray-600",children:"Loading..."})}):e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Admin Dashboard"}),(0,a.jsxs)("p",{className:"text-gray-600 mb-4",children:["Logged in as ",e.email]}),(0,a.jsx)("button",{onClick:P,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Log out"})]}),!1,(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-gray-900 mb-6",children:"Events by DID"}),!y&&(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:u.length}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Total Events"})]}),(0,a.jsxs)("div",{className:"bg-yellow-50 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-yellow-800",children:u.filter(e=>{let t=e.record_needs_review&&e.record_passed_review;return(!!e.record_needs_review||!!t)&&!e.reviewed}).length}),(0,a.jsx)("div",{className:"text-sm text-yellow-600",children:"Need Review"})]}),(0,a.jsxs)("div",{className:"bg-green-50 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-green-800",children:u.filter(e=>!!e.record_passed_review&&!e.record_needs_review).length}),(0,a.jsx)("div",{className:"text-sm text-green-600",children:"Approved"})]}),(0,a.jsxs)("div",{className:"bg-blue-50 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-blue-800",children:u.filter(e=>!!e.show_on_calendar).length}),(0,a.jsx)("div",{className:"text-sm text-blue-600",children:"On Calendar"})]})]}),(0,a.jsxs)("div",{className:"flex space-x-2 mb-6",children:[(0,a.jsx)("button",{onClick:()=>A("all"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${"all"===E?"bg-blue-600 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"}`,children:'All Events (including "reviewed")'}),(0,a.jsxs)("button",{onClick:()=>A("needs_review"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${"needs_review"===E?"bg-yellow-600 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"}`,children:["New and updated events (",u.filter(e=>{let t=e.record_needs_review&&e.record_passed_review;return(!!e.record_needs_review||!!t)&&!e.reviewed}).length,")"]}),(0,a.jsxs)("button",{onClick:()=>A("approved"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${"approved"===E?"bg-green-600 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"}`,children:["Approved (",u.filter(e=>!!e.record_passed_review&&!e.record_needs_review).length,")"]})]}),y?(0,a.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,a.jsx)("div",{className:"text-gray-600",children:"Loading events..."})}):b?(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:(0,a.jsx)("p",{className:"text-red-800",children:b})}):(0,a.jsx)("div",{className:"space-y-4",children:Object.entries(ee).map(([e,t])=>{let{didInfo:r,events:s}=t,n=N.has(e),i=C[e];return(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,a.jsx)("div",{className:"p-4 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-3 flex-1",children:[(0,a.jsx)("button",{onClick:()=>{let t;(t=new Set(j)).has(e)?t.delete(e):t.add(e),_(t)},className:"text-sm text-gray-500 hover:text-gray-700",children:j.has(e)?"â¼"
7:"â¶"}),n?(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 min-w-[60px]",children:"Alias:"}),(0,a.jsx)("input",{type:"text",value:i?.alias||"",onChange:t=>X(e,"alias",t.target.value),className:"px-2 py-1 border border-gray-300 rounded text-sm flex-1",placeholder:"Enter alias"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 min-w-[60px]",children:"Contact:"}),(0,a.jsx)("input",{type:"text",value:i?.contact||"",onChange:t=>X(e,"contact",t.target.value),className:"px-2 py-1 border border-gray-300 rounded text-sm flex-1",placeholder:"Enter contact info"})]}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:e})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:r?.alias||e}),(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:[e," ⢠",s.length," event",1!==s.length?"s":""]}),r?.contact&&(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:["Contact: ",r.contact]})]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[r?.is_spammer&&(0,a.jsx)("span",{className:"px-2 py-1 bg-red-100 text-red-800 text-xs rounded-full",children:"Spammer"}),n?(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>M(e),className:"px-3 py-1 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 transition-colors",children:"Save"}),(0,a.jsx)("button",{onClick:()=>{let t,r;return(t=new Set(N)).delete(e),k(t),r={...C},void(delete r[e],S(r))},className:"px-3 py-1 bg-gray-600 text-white text-sm rounded-md hover:bg-gray-700 transition-colors",children:"Cancel"})]}):(0,a.jsx)("button",{onClick:()=>{let t;(t=new Set(N)).has(e)?t.delete(e):(t.add(e),S(t=>({...t,[e]:{alias:r?.alias||"",contact:r?.contact||""}}))),k(t)},className:"px-3 py-1 bg-blue-600 text-white text-sm rounded-md hover:bg-blue-700 transition-colors",children:"Edit"})]})]})}),j.has(e)&&(0,a.jsx)("div",{className:"divide-y divide-gray-100",children:s.map(e=>{let t=!!e.record_needs_review&&!e.reviewed,r=!!e.record_passed_review,s=t&&r,n=e.record_passed_review||e.record_needs_review,i=O.has(e.id),l=R.has(e.id);return(0,a.jsx)("div",{className:`p-4 ml-6 ${s?"bg-orange-50 border-l-4 border-orange-400":t?"bg-yellow-50 border-l-4 border-yellow-400":"bg-white"}`,children:(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-4 items-start",children:[(0,a.jsxs)("div",{className:"lg:col-span-1 text-sm text-gray-500",children:["#",e.id]}),(0,a.jsxs)("div",{className:"lg:col-span-2 text-sm text-gray-600",children:[e.created_at?new Date(e.created_at).toLocaleString():"",e.contact&&(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsx)("span",{className:"text-xs text-blue-600 font-medium",children:"Contact: "}),(0,a.jsx)("span",{className:"text-xs text-gray-700",children:e.contact})]}),!e.contact&&n.organizer&&n.organizer.contact&&(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsx)("span",{className:"text-xs text-blue-600 font-medium",children:"Contact: "}),(0,a.jsx)("span",{className:"text-xs text-gray-700",children:n.organizer.contact})]}),(0,a.jsx)("div",{className:"mt-1 space-y-1",children:s?(0,a.jsx)("span",{className:"px-2 py-1 bg-orange-100 text-orange-800 text-xs rounded-full",children:"Updated - Needs Review"}):t?(0,a.jsx)("span",{className:"px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded-full",children:"Not Reviewed"}):r?(0,a.jsx)("span",{className:"px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full",children:"â Approved"}):(0,a.jsx)(a.Fragment,{})})]}),(0,a.jsx)("div",{className:"lg:col-span-5",children:s?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"bg-green-50 rounded-md p-3 max-h-32 overflow-y-auto relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-green-800",children:"â Currently Live (Approved):"}),(0,a.jsx)("button",{onClick:()=>H("Currently Live (Approved)",e.record_passed_review),className:"text-xs text-green-600 hover:text-green-800 underline",children:"Expand"})]}),(0,a.jsx)("pre",{className:"text-xs text-green-700 whitespace-pre-wrap break-words",children:JSON.stringify(e.record_passed_review,null,2)})]}),(0,a.jsxs)("div",{className:"bg-orange-50 rounded-md p-3 max-h-32 overflow-y-auto relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-orange-800",children:"\uD83D\uDCDD Latest Update (Needs Review):"}),(0,a.jsx)("button",{onClick:()=>H("Latest Update (Needs Review)",e.record_needs_review),className:"text-xs text-orange-600 hover:text-orange-800 underline",children:"Expand"})]}),(0,a.jsx)("pre",{className:"text-xs text-orange-700 whitespace-pre-wrap break-words",children:JSON.stringify(e.record_needs_review,null,2)})]})]}):(0,a.jsxs)("div",{className:"bg-gray-50 rounded-md p-3 max-h-40 overflow-y-auto relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-gray-700",children:"Event Data:"}),(0,a.jsx)("button",{onClick:()=>H("Event Data",n),className:"text-xs text-gray-600 hover:text-gray-800 underline",children:"Expand"})]}),(0,a.jsx)("pre",{className:"text-xs text-gray-700 whitespace-pre-wrap break-words",children:JSON.stringify(n,null,2)})]})}),(0,a.jsxs)("div",{className:"lg:col-span-4 gap-2 flex flex-col",children:[(s||!r)&&(0,a.jsx)("div",{className:"flex mb-2",children:(0,a.jsx)("button",{onClick:()=>W(e.id,e.record_needs_review),className:"px-3 py-1 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 transition-colors",children:s?"Approve Changes":"Approve"})}),(0,a.jsxs)("label",{className:"inline-flex items-center",children:[(0,a.jsx)("input",{type:"checkbox",checked:!!e.reviewed,onChange:t=>Z(e.id,t.target.checked),className:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"}),(0,a.jsx)("span",{className:"ml-2 text-sm text-gray-600",children:'Reviewed (removes event from "new and updated" list)'})]}),(0,a.jsxs)("label",{className:"inline-flex items-center",children:[(0,a.jsx)("input",{type:"checkbox",checked:!!e.is_core_event,disabled:!r,onChange:t=>Y(e.id,"is_core_event",t.target.checked),className:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"}),(0,a.jsx)("span",{className:`ml-2 text-sm ${r?"text-gray-600":"text-gray-400"}`,children:"Core Event"}),!r&&(0,a.jsxs)("p",{className:"text-xs text-gray-500 mx-1",children:["(",t?"Approve record first":"Only approved records can be shown on calendar",")"]})]}),(0,a.jsxs)("label",{className:"inline-flex items-center",children:[(0,a.jsx)("input",{type:"checkbox",checked:!!e.show_on_calendar,disabled:!r,onChange:t=>V(e.id,"show_on_calendar",t.target.checked),className:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed"}),(0,a.jsx)("span",{className:`ml-2 text-sm ${r?"text-gray-600":"text-gray-400"}`,children:"Show on Calendar"}),!r&&(0,a.jsxs)("p",{className:"text-xs text-gray-500 mx-1",children:["(",t?"Approve record first":"Only approved records can be shown on calendar",")"]})]}),s&&(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"â¹ï¸ Using currently approved version for calendar"}),(0,a.jsxs)("div",{className:"mt-4 pt-3 border-t border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Comments"}),!i&&(0,a.jsx)("button",{onClick:()=>{var t,r;let a;return t=e.id,r=e.comments,void((a=new Set(O)).has(t)?a.delete(t):(a.add(t),z(e=>({...e,[t]:r||""}))),I(a))},className:"text-xs text-blue-600 hover:text-blue-800",children:e.comments?"Edit":"Add Comment"})]}),i?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("textarea",{value:L[e.id]||"",onChange:t=>{var r,a;return r=e.id,a=t.target.value,void z(e=>({...e,[r]:a}))},placeholder:"Add your comments here...",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm resize-vertical min-h-[80px]"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>G(e.id),className:"px-3 py-1 bg-blue-600 text-white text-xs rounded-md hover:bg-blue-700 transition-colors",children:"Save"}),(0,a.jsx)("button",{onClick:()=>{var t;let r,a;return t=e.id,(r=new Set(O)).delete(t),I(r),a={...L},void(delete a[t],z(a))},className:"px-3 py-1 bg-gray-600 text-white text-xs rounded-md hover:bg-gray-700 transition-colors",children:"Cancel"})]})]}):e.comments?(0,a.jsx)("div",{className:"bg-gray-50 rounded-md p-3",children:(0,a.jsx)("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:e.comments})}):(0,a.jsx)("p",{className:"text-xs text-gray-500 italic",children:"No comments yet"})]}),(0,a.jsxs)("div",{className:"mt-4 pt-3 border-t border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Admin Override (JSON)"}),!l&&(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>{var t,r;let a;return t=e.id,r=e.admin_override,void((a=new Set(R)).has(t)?a.delete(t):(a.add(t),$(e=>({...e,[t]:r?JSON.stringify(r,null,2):""}))),q(a))},className:"text-xs text-blue-600 hover:text-blue-800",children:e.admin_override?"Edit":"Add Override"}),e.admin_override&&(0,a.jsx)("button",{onClick:()=>Q(e.id),className:"text-xs text-red-600 hover:text-red-800",children:"Remove Override"})]})]}),l?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("textarea",{value:U[e.id]||"",onChange:t=>{var r,a;return r=e.id,a=t.target.value,void $(e=>({...e,[r]:a}))},placeholder:'Enter JSON object, e.g. {"priority": 10, "featured": true}',className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm resize-vertical min-h-[120px] font-mono"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>B(e.id),className:"px-3 py-1 bg-blue-600 text-white text-xs rounded-md hover:bg-blue-700 transition-colors",children:"Save"}),(0,a.jsx)("button",{onClick:()=>{var t;let r,a;return t=e.id,(r=new Set(R)).delete(t),q(r),a={...U},void(delete a[t],$(a))},className:"px-3 py-1 bg-gray-600 text-white text-xs rounded-md hover:bg-gray-700 transition-colors",children:"Cancel"})]})]}):e.admin_override?(0,a.jsx)("div",{className:"bg-yellow-50 rounded-md p-3 max-h-32 overflow-y-auto",children:(0,a.jsx)("pre",{className:"text-xs text-yellow-700 whitespace-pre-wrap break-words font-mono",children:JSON.stringify(e.admin_override,null,2)})}):(0,a.jsx)("p",{className:"text-xs text-gray-500 italic",children:"No admin override set"})]})]})]})},e.id)})})]},e)})})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-gray-900 mb-6",children:"Calendar Preview"}),(0,a.jsx)("div",{children:"Preview disabled for performance reasons. Don't worry, events are still working."})]}),(0,a.jsx)(o.lG,{open:J.isOpen,onOpenChange:K,children:(0,a.jsx)(o.Cf,{className:"max-w-4xl max-h-[80vh] overflow-auto",children:(0,a.jsxs)("div",{className:"flex flex-col h-full",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:J.title}),(0,a.jsx)("button",{onClick:K,className:"text-gray-400 hover:text-gray-600",children:"â"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto bg-gray-50 rounded-md p-4",children:(0,a.jsx)("pre",{className:"text-sm text-gray-700 whitespace-pre-wrap break-words",children:JSON.stringify(J.data,null,2)})})]})})})]}):(0,a.jsx)("div",{className:"max-w-md mx-auto",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-gray-900 text-center mb-6",children:"Admin Login"}),(0,a.jsxs)("form",{onSubmit:T,className:"space-y-4",children:[(0,a.jsx)("div",{children:(0,a.jsx)("input",{type:"email",placeholder:"Your email",value:x,onChange:e=>p(e.target.value),required:!0,className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,a.jsx)("button",{type:"submit",disabled:r,className:"w-full px-4 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:r?"Sending...":"Send Magic Link"})]}),h&&(0,a.jsx)("div",{className:"mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md",children:(0,a.jsx)("p",{className:"text-blue-800",children:h})})]})})})})]})}},88231:(e,t,r)=>{"use strict";r.d(t,{Fq:()=>o,Lc:()=>m,W6:()=>d,bF:()=>c,i5:()=>p,ly:()=>i,tC:()=>l});var a=r(96810),s=r(72329),n=r(87266);let i="Devconnect Argentina",l="A collaborative Ethereum week, built by and for everyone.",d="true"===n.env.IS_LOCAL_DEV?"http://localhost:3000/":"https://devconnect.org/",o=`${d}og-argentina.png?reset=1`,c="@EFDevcon",m="@devcon",x="https://tickets.devconnect.org/?mtm_campaign=devconnect.org&mtm_source=website",p=()=>{let{mtm_campaign:e,mtm_kwd:t,mtm_content:r}=(0,s.w)(),[n,i]=a.useState(!1);if(a.useEffect(()=>{i(!0)},[]),!n)return x;if(e||t||r){let a=new URLSearchParams;return e&&a.set("mtm_campaign",e),t&&a.set("mtm_kwd",t),r&&a.set("mtm_content",r),`https://tickets.devconnect.org/?${a.toString()}`}return x}},98970:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/community-events/admin",function(){return r(33715)}])}},e=>{e.O(0,[1460,1962,636,6593,8792],()=>e(e.s=98970)),_N_E=e.O()}]);
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.