PageSourceSearch

https://www.riversidecivicassociation.org/assets/portal-C4x491Lh.js

js riversidecivicassociation.org collected 2026-10-03 18:55:09 UTC 58,710 bytes, 1 lines download raw bytes

1import{v as B,x as S,s as C,ai as ce,ap as ee,a2 as f,O as e,ar as me,as as _,B as j,a8 as G,U as xe,b as I,ae as ue,ah as y,T as $,L as b,I as N,i as z,l as T,m as F,j as L,k,X as se}from"./index-D-c8-fYZ.js";import{u as K,f as w}from"./format-CUODkqrs.js";import{p as te}from"./priorities-DTMVglQS.js";import{B as W,b as he}from"./badge-D8ErgQDh.js";import{T as U}from"./textarea-DnkN3wM-.js";import{T as pe,b as ge,c as P,a as D}from"./tabs-D_tA_wUv.js";import{C as q}from"./checkbox-M5MtGpq7.js";import{r as M}from"./auth-middleware-CH-SKM81.js";import{L as fe,a as be,C as ne,b as X,P as je}from"./plus-D-cr4cWv.js";import{L as ye}from"./layout-dashboard-cuaNRfgj.js";import{C as re}from"./calendar-days-KTn8mSxB.js";import{H as ve}from"./heart-DOp0l-6N.js";import{C as J}from"./circle-alert-DIi9XbOk.js";import{C as Q}from"./clock-iMW8-eaj.js";import{E as ae}from"./external-link-DOy47esE.js";import{C as Ne}from"./circle-check-Cx2WrWLY.js";import{T as ie}from"./trash-2-CXlHlFTb.js";import"./index-B5s9tAr3.js";const _e=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],we=B("file-text",_e);const ke=[["path",{d:"M11 12h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 14",key:"1j4xps"}],["path",{d:"m7 18 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"uospg8"}],["path",{d:"m2 13 6 6",key:"16e5sb"}]],Se=B("hand-helping",ke);const Ce=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Me=B("settings",Ce);const Ae=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Re=B("upload",Ae);function le(s,r=new Date){const i=s.filter(n=>!n.deleted_at).map(n=>n.checked_in_at).sort(),c=new Date(r);return c.setFullYear(c.getFullYear()-1),{totalMeetingsAttended:i.length,firstMeetingAt:i[0]??null,mostRecentMeetingAt:i[i.length-1]??null,meetingsLast12Months:i.filter(n=>new Date(n)>=c).length}}const Pe=S({method:"GET"}).middleware([M]).handler(C("6a25c98b976b793a1053558deeb17d1c719e1a4b85e1e73d3831e2f8abc435eb")),De=S({method:"POST"}).middleware([M]).handler(C("8d70ef96956bb306fb120de5290cd95b527cb47e8b3477be938f890036340366")),ze=S({method:"POST"}).middleware([M]).handler(C("57e7d6a53a6a326fb77cf948dc26a15102f9e543af2443104f9c9c2af990a358")),de=S({method:"POST"}).middleware([M]).handler(C("3356e8e7f455f9d8292f00dc441138f0439b0e992ba1d12d5fd2ccfeb7bc4556")),Te=S({method:"POST"}).middleware([M]).handler(C("29f4b73597ca60bf493f2320b3c4e221a8259fe6f27e29c0651982afb2329088")),Fe=S({method:"POST"}).middleware([M]).handler(C("e1976f5898de0470ddffaed3639876e6378a25b585ae4fab6c3d12471701392f")),Le=S({method:"POST"}).middleware([M]).handler(C("fd7f962f8de06ac8f7323b01a4dc156b861f77fa8e19bacfe89833f3135b6765")),Ee=S({method:"POST"}).middleware([M]).handler(C("9fe9b51d1acdd6686f2c9aa2b6c07b1b6a38daa181b4c350c5132bc9454a0f4d")),Ve=S({method:"POST"}).middleware([M]).handler(C("73c84d57e64ab15cd9f26ceb2d6e947917541b8ba5a7338afb34decb3c685578")),Ie=S({method:"GET"}).middleware([M]).handler(C("a96a2c04becf3775182dfed70010e229278cf38c71f2a37e0dae2e021bcda69e")),Oe=S({method:"POST"}).middleware([M]).handler(C("2eeed33990c0bb0a92ece61c2484545704358a2f17e286c6b695b73950742eab")),Ue=S({method:"POST"}).middleware([M]).handler(C("dd6acb91bb8904ef859c433053c6efc2a26a55c3c633952de4db69abd493a6f3"));function Rs(){const{session:s,user:r,loading:i}=ce(),c=ee();return f.useEffect(()=>{!i&&!s&&c({to:"/login"})},[i,s,c]),i||!s?e.jsx("section",{className:"min-h-[60vh] grid place-items-center",children:e.jsx("p",{className:"text-muted-foreground",children:i?"Loading…":"Redirecting to sign in…"})}):e.jsx($e,{email:r?.email??""})}function $e({email:s}){const r=ee(),i=me(),c=_(Pe),[n,m]=f.useState("dashboard"),{data:d,isLoading:p,error:g}=K({queryKey:["portal"],queryFn:()=>c()});async function a(){await ue.auth.signOut(),y.success("Signed out"),r({to:"/"})}if(p)return e.jsx("section",{className:"min-h-[60vh] grid place-items-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Loading portal…"})});if(g||!d){const u=g?.message??"unknown error";return e.jsx("section",{className:"min-h-[60vh] grid place-items-center px-4",children:e.jsxs("div",{className:"max-w-md text-center space-y-4",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Portal unavailable"}),e.jsx("p",{className:"text-muted-foreground",children:"We couldn't load your member data right now. This is usually a temporary issue."}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono bg-muted rounded px-3 py-2 text-left break-all",children:u}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-center",children:[e.jsx(j,{onClick:()=>i.invalidateQueries({queryKey:["portal"]}),children:"Try again"}),e.jsx(j,{variant:"outline",asChild:!0,children:e.jsx("a",{href:`mailto:${G.email}`,children:"Email RCA"})})]})]})})}const t=()=>i.invalidateQueries({queryKey:["portal"]}),o=d.profile?.display_name||s;return e.jsx("section",{className:"bg-background py-10",children:e.jsxs("div",{className:"container-civic",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow mb-1",children:"Member portal"}),e.jsxs("h1",{className:"font-serif text-3xl sm:text-4xl font-semibold text-ink",children:["Welcome, ",o]}),e.jsx("div",{className:"mt-2 flex gap-2",children:d.roles.map(u=>e.jsx(W,{variant:"secondary",className:"capitalize",children:u},u))})]}),e.jsxs(j,{variant:"outline",onClick:a,children:[e.jsx(fe,{className:"size-4"})," Sign out"]})]}),e.jsxs(pe,{value:n,onValueChange:u=>m(u),children:[e.jsxs(ge,{className:"flex-wrap h-auto gap-1 mb-6",children:[e.jsxs(P,{value:"dashboard",className:"flex items-center gap-1.5",children:[e.jsx(ye,{className:"size-3.5"})," Dashboard"]}),e.jsxs(P,{value:"profile",className:"flex items-center gap-1.5",children:[e.jsx(xe,{className:"size-3.5"})," Profile"]}),e.jsxs(P,{value:"membership",className:"flex items-center gap-1.5",children:[e.jsx(be,{className:"size-3.5"})," Membership"]}),e.jsxs(P,{value:"meetings",className:"flex items-center gap-1.5",children:[e.jsx(we,{className:"size-3.5"})," Meetings"]}),e.jsxs(P,{value:"events",className:"flex items-center gap-1.5",children:[e.jsx(re,{className:"size-3.5"})," Events"]}),e.jsxs(P,{value:"uploads",className:"flex items-center gap-1.5",children:[e.jsx(Re,{className:"size-3.5"})," Uploads"]}),e.jsxs(P,{value:"interests",className:"flex items-center gap-1.5",children:[e.jsx(ve,{className:"size-3.5"})," Interests"]}),e.jsxs(P,{value:"volunteer",className:"flex items-center gap-1.5",children:[e.jsx(Se,{className:"size-3.5"})," Volunteer"]}),e.jsxs(P,{value:"surveys",className:"flex items-center gap-1.5",children:[e.jsx(ne,{className:"size-3.5"})," Surveys"]}),e.jsxs(P,{value:"settings",className:"flex items-center gap-1.5",children:[e.jsx(Me,{className:"size-3.5"})," Settings"]})]}),e.jsx(D,{value:"dashboard",children:e.jsx(He,{data:d,switchTab:m})}),e.jsx(D,{value:"profile",children:e.jsx(Be,{profile:d.profile,email:s,onSaved:t})}),e.jsx(D,{value:"membership",children:e.jsx(Ge,{membership:d.membership,duesPayments:d.duesPayments,household:d.household,onChange:t})}),e.jsx(D,{value:"meetings",children:e.jsxs("div",{className:"space-y-8",children:[e.jsx(cs,{attendance:d.attendance??[]}),e.jsx(Ke,{notes:d.notes,meetingArchive:d.meetingArchive??[],documents:d.documents,isAdmin:d.isAdmin,onChange:t})]})}),e.jsx(D,{value:"events",children:e.jsx(ls,{events:d.events,myRsvps:d.myRsvps,onSaved:t})}),e.jsx(D,{value:"uploads",children:e.jsx(Ze,{onSaved:t})}),e.jsx(D,{value:"interests",children:e.jsx(es,{interests:d.interests,onSaved:t})}),e.jsx(D,{value:"volunteer",children:e.jsx(ns,{volunteer:d.volunteer,onSaved:t})}),e.jsx(D,{value:"surveys",children:e.jsx(as,{surveys:d.surveys,myResponses:d.mySurveyResponses,onSaved:t})}),e.jsx(D,{value:"settings",children:e.jsx(rs,{profile:d.profile,email:s,onSaved:t})})]}),e.jsxs("p",{className:"mt-10 text-sm text-muted-foreground",children:["Need help?"," ",e.jsx("a",{href:`mailto:${G.email}`,className:"underline hover:text-primary",children:"Email RCA"})," ","or"," ",e.jsx(I,{to:"/contact",className:"underline hover:text-primary",children:"use the contact form"}),"."]})]})})}function He({data:s,switchTab:r}){const i=!s.profile?.phone||!s.profile?.address||!s.profile?.resident_status,c=!s.membership||["Pending","Expired"].includes(s.membership.status),n=!s.interests||!s.interests.interests?.length,m=!s.recentUploads||s.recentUploads.length===0,d=s.duesPayments[0]??null,p=new Set((s.mySurveyResponses??[]).map(t=>t.survey_id)),g=(s.surveys??[]).filter(t=>!p.has(t.id)).length,a=(s.events??[]).length;return e.jsxs("div",{className:"space-y-6",children:[s.isAdmin&&e.jsxs(I,{to:"/admin",className:"flex items-center justify-between rounded-xl border border-primary/30 bg-primary/5 px-5 py-4 transition-colors hover:bg-primary/10",children:[e.jsx("span",{className:"font-semibold text-primary",children:"RCA Admin tools"}),e.jsx("span",{className:"text-sm text-primary",children:"Members, submissions & announcements →"})]}),(s.roles??[]).includes("officer")&&e.jsx(ms,{}),s.announcements.length>0&&e.jsx("div",{className:"space-y-3",children:s.announcements.map(t=>e.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-5 py-4",children:[e.jsx("p",{className:"font-semibold text-amber-900",children:t.title}),e.jsx("p",{className:"text-sm text-amber-800 mt-1",children:t.body})]},t.id))}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(H,{label:"Membership",value:s.membership?.status??"Not on file",ok:s.membership?.status==="Active"}),e.jsx(H,{label:"Dues",value:d?`Paid ${d.payment_date?w(new Date(d.payment_date),"MMM d, yyyy"):""}`:"Not on file",ok:!!d&&d.verified_by_admin===!0}),e.jsx(H,{label:"Uploads",value:`${s.recentUploads.length} submitted`,ok:s.recentUploads.length>0}),e.jsx(H,{label:"Interests",value:s.interests?.interests?.length?`${s.interests.interests.length} selected`:"None selected",ok:!n})]}),e.jsx(os,{attendance:s.attendance??[],switchTab:r}),(i||c||n||m||g>0||a>0)&&e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl font-semibold text-ink mb-3",children:"Next steps"}),e.jsxs("div",{className:"space-y-2",children:[g>0&&e.jsx(O,{icon:e.jsx(ne,{className:"size-4 text-primary"}),text:`You have ${g} open survey${g>1?"s":""} to complete.`,action:"Take Survey",onAction:()=>r("surveys")}),a>0&&e.jsx(O,{icon:e.jsx(re,{className:"size-4 text-primary"}),text:`${a} upcoming event${a>
11?"s":""} — RSVP to let RCA know you're coming.`,action:"View Events",onAction:()=>r("events")}),i&&e.jsx(O,{icon:e.jsx(J,{className:"size-4 text-amber-600"}),text:"Complete your member profile so RCA can reach you.",action:"Go to Profile",onAction:()=>r("profile")}),c&&e.jsx(O,{icon:e.jsx(J,{className:"size-4 text-amber-600"}),text:"Pay or confirm your dues for this year.",action:"Go to Membership",onAction:()=>r("membership")}),n&&e.jsx(O,{icon:e.jsx(Q,{className:"size-4 text-muted-foreground"}),text:"Tell RCA what issues matter to you.",action:"Select Interests",onAction:()=>r("interests")}),m&&e.jsx(O,{icon:e.jsx(Q,{className:"size-4 text-muted-foreground"}),text:"Share photos, documents, or stories with RCA.",action:"Go to Uploads",onAction:()=>r("uploads")})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2",children:"Your top issues"}),[s.interests?.top_issue_1,s.interests?.top_issue_2,s.interests?.top_issue_3].filter(Boolean).length?e.jsx("ul",{className:"flex flex-wrap gap-2",children:[s.interests?.top_issue_1,s.interests?.top_issue_2,s.interests?.top_issue_3].filter(Boolean).map((t,o)=>e.jsx("li",{className:"inline-flex items-center rounded-full border border-border bg-secondary/60 px-3 py-1 text-sm text-foreground/85",children:t},o))}):e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You haven't ranked your top issues yet."," ",e.jsx("button",{type:"button",onClick:()=>r("interests"),className:"font-semibold text-primary hover:underline cursor-pointer",children:"Select them →"})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2",children:"RCA's current priorities"}),e.jsx("ul",{className:"flex flex-wrap gap-2",children:te.slice(0,6).map(t=>e.jsx("li",{children:e.jsx(I,{to:t.detailPath??"/priorities",className:"inline-flex items-center rounded-full border border-border px-3 py-1 text-sm text-foreground/85 hover:bg-muted",children:t.title})},t.slug))}),e.jsx(I,{to:"/priorities",className:"mt-3 inline-flex items-center gap-1 text-sm font-semibold text-primary hover:underline",children:"All priorities →"})]})]}),s.captains?.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2",children:"Block captains"}),e.jsx("ul",{className:"grid gap-2 sm:grid-cols-2",children:s.captains.map((t,o)=>e.jsxs("li",{className:"rounded-lg border border-border px-3 py-2 text-sm",children:[e.jsx("p",{className:"font-semibold text-ink",children:t.block_or_area}),e.jsx("p",{className:"text-foreground/85",children:t.captain_name}),t.contact_email&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-primary hover:underline break-all",children:t.contact_email}),t.contact_phone&&e.jsx("p",{className:"text-muted-foreground",children:t.contact_phone})]},o))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-1",children:"Next Meeting"}),e.jsx("p",{className:"font-serif text-lg font-semibold text-ink",children:$.title}),e.jsxs("p",{className:"text-sm text-foreground/80 mt-1",children:[$.date," · ",$.time]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:$.location}),e.jsx(j,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>r("meetings"),children:"View meeting notes"})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl font-semibold text-ink mb-3",children:"Quick links"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:[{tab:"profile",label:"Update Profile"},{tab:"membership",label:"Pay Dues"},{tab:"meetings",label:"View Meeting Notes"},{tab:"uploads",label:"Upload Photos or Documents"},{tab:"interests",label:"Select Issues You Care About"},{tab:"volunteer",label:"Volunteer"}].map(({tab:t,label:o})=>e.jsx("button",{type:"button",onClick:()=>r(t),className:"inline-flex items-center gap-1 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted cursor-pointer transition-colors",children:o},t))})]})]})}function H({label:s,value:r,ok:i}){return e.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-1",children:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[i?e.jsx(Ne,{className:"size-4 text-green-600 shrink-0"}):e.jsx(Q,{className:"size-4 text-amber-500 shrink-0"}),e.jsx("span",{className:"font-medium text-sm text-ink",children:r})]})]})}function O({icon:s,text:r,action:i,onAction:c}){return e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-card px-4 py-3",children:[e.jsx("span",{className:"shrink-0",children:s}
1),e.jsx("p",{className:"text-sm text-foreground/90 flex-1",children:r}),e.jsx("button",{type:"button",onClick:c,className:"shrink-0 text-sm font-semibold text-primary hover:underline",children:i})]})}function Be({profile:s,email:r,onSaved:i}){const c=_(de),[n,m]=f.useState({display_name:s?.display_name??"",phone:s?.phone??"",address:s?.address??"",bio:s?.bio??"",resident_status:s?.resident_status??"",household_type:s?.household_type??"",block_or_cross_street:s?.block_or_cross_street??"",years_connected:s?.years_connected??"",communication_preferences:s?.communication_preferences??"",sms_consent:s?.sms_consent??!1,photo_story_permission:s?.photo_story_permission??!1,public_recognition_consent:s?.public_recognition_consent??!1}),[d,p]=f.useState(!1);function g(t){return{value:n[t],onChange:o=>m(u=>({...u,[t]:o.target.value}))}}async function a(t){t.preventDefault(),p(!0);try{await c({data:n}),y.success("Profile saved"),i()}catch(o){y.error(o.message)}finally{p(!1)}}return e.jsxs("form",{onSubmit:a,className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-5 max-w-2xl",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"My Profile"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your profile is visible only to RCA admins by default (you can change this under Settings). RCA uses your contact info and block to reach you and understand neighborhood-level concerns — it is never shared publicly or sold."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Email"}),e.jsx(N,{value:r,disabled:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Email is managed by your sign-in method."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"display_name",children:"Display name"}),e.jsx(N,{id:"display_name",...g("display_name"),maxLength:120})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"phone",children:"Phone"}),e.jsx(N,{id:"phone",...g("phone"),maxLength:40})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"address",children:"Street address"}),e.jsx(N,{id:"address",...g("address"),maxLength:255})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"Why we ask: your address and phone help RCA confirm you're inside the boundary, reach you about your block, and map concerns by area. Admins only."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"block_or_cross_street",children:"Block or nearest cross street"}),e.jsx(N,{id:"block_or_cross_street",...g("block_or_cross_street"),maxLength:120})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"resident_status",children:"Resident status"}),e.jsxs(z,{value:n.resident_status,onValueChange:t=>m(o=>({...o,resident_status:t})),children:[e.jsx(T,{id:"resident_status",children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:["Current resident","Former resident","Property owner","Renter","Business owner","Community partner","Supporter"].map(t=>e.jsx(k,{value:t,children:t},t))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"household_type",children:"Household type"}),e.jsxs(z,{value:n.household_type,onValueChange:t=>m(o=>({...o,household_type:t})),children:[e.jsx(T,{id:"household_type",children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:["Household","Senior household","Business/community sponsor","Supporter"].map(t=>e.jsx(k,{value:t,children:t},t))})]})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"years_connected",children:"Years connected to Riverside Terrace"}),e.jsxs(z,{value:n.years_connected,onValueChange:t=>m(o=>({...o,years_connected:t})),children:[e.jsx(T,{id:"years_connected",children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:["New resident","1–5 years","6–10 years","10+ years","Multigenerational"].map(t=>e.jsx(k,{value:t,children:t},t))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"communication_preferences",children:"Communication preference"}),e.jsxs(z,{value:n.communication_preferences,onValueChange:t=>m(o=>({...o,communication_preferences:t})),children:[e.jsx(T,{id:"communication_preferences",children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:["Email","Text","Phone"].map(t=>e.jsx(k,{value:t,children:t},t))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"bio",children:"About you"}
1),e.jsx(U,{id:"bio",...g("bio"),rows:4,maxLength:1e3,placeholder:"Your block, how long you've lived here, your connection to Riverside Terrace, and what you care about."})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/40 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:"Permissions & Consents"}),e.jsx(E,{id:"sms_consent",checked:n.sms_consent,onChange:t=>m(o=>({...o,sms_consent:t})),label:"I consent to receive SMS text messages from RCA."}),e.jsx(E,{id:"photo_story_permission",checked:n.photo_story_permission,onChange:t=>m(o=>({...o,photo_story_permission:t})),label:"RCA may use my photos or stories in communications with my approval."}),e.jsx(E,{id:"public_recognition_consent",checked:n.public_recognition_consent,onChange:t=>m(o=>({...o,public_recognition_consent:t})),label:"RCA may recognize my contributions publicly."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",disabled:d,children:d?"Saving…":"Save profile"})})]})}const Ye={Active:"bg-green-100 text-green-800 border-green-200",Pending:"bg-amber-100 text-amber-800 border-amber-200",Expired:"bg-red-100 text-red-800 border-red-200",Comped:"bg-blue-100 text-blue-800 border-blue-200",Sponsor:"bg-purple-100 text-purple-800 border-purple-200"};function Ge({membership:s,duesPayments:r,household:i,onChange:c}){return e.jsxs("div",{className:"space-y-6 max-w-2xl",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Membership"}),s?e.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Status"}),e.jsx("span",{className:`mt-1 inline-block rounded-full border px-3 py-0.5 text-sm font-semibold ${Ye[s.status]??"bg-gray-100 text-gray-800"}`,children:s.status})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Year"}),e.jsx("p",{className:"font-semibold text-ink",children:s.membership_year})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Type"}),e.jsx("p",{className:"font-semibold text-ink",children:s.membership_type})]})]}),s.dues_amount!=null&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Dues amount"}),e.jsxs("p",{className:"font-semibold text-ink",children:["$",s.dues_amount]})]}),s.renewal_date&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Renewal date"}),e.jsx("p",{className:"font-semibold text-ink",children:w(new Date(s.renewal_date),"MMMM d, yyyy")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Voting eligibility"}),e.jsx("p",{className:"text-sm text-foreground/90",children:s.voting_eligibility_status}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"RCA members are allowed to vote in annual board elections. Additional eligibility rules, rights, responsibilities, and procedures are governed by RCA bylaws."})]})]}):e.jsxs("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"No membership record on file."}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"RCA will create your membership record after your dues are received and verified."})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-4",children:[e.jsx("h3",{className:"font-semibold text-ink",children:"Annual Dues"}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between border-b border-border pb-2",children:[e.jsx("span",{children:"Household Membership"}),e.jsx("span",{className:"font-semibold",children:"$50"})]}),e.jsxs("div",{className:"flex justify-between pt-1",children:[e.jsx("span",{children:"Senior Household Membership"}),e.jsx("span",{className:"italic text-muted-foreground",children:"Amount pending RCA confirmation"})]})]}),e.jsx("a",{href:G.paypalUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(j,{type:"button",className:"mt-1",children:["Pay Dues Through PayPal ",e.jsx(ae,{className:"size-4"})]})}),e.jsx("div",{className:"rounded-lg bg-muted/60 px-4 py-3 text-sm text-muted-foreground",children:"After payment, RCA will match your PayPal payment to your member profile. Payment c
1onfirmation is not automatic — it may take a few days to process."})]}),r.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 shadow-sm",children:[e.jsx("h3",{className:"font-semibold text-ink mb-3",children:"Payment History"}),e.jsx("div",{className:"space-y-3",children:r.map(n=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm border-b border-border pb-2 last:border-0 last:pb-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:n.payment_date?w(new Date(n.payment_date),"MMMM d, yyyy"):"Date not recorded"}),n.payment_method&&e.jsxs("span",{className:"ml-2 text-muted-foreground",children:["via ",n.payment_method]}),n.payment_reference&&e.jsxs("span",{className:"ml-2 text-muted-foreground",children:["Ref: ",n.payment_reference]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[n.amount!=null&&e.jsxs("span",{className:"font-semibold",children:["$",n.amount]}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${n.verified_by_admin?"bg-green-100 text-green-800":"bg-amber-100 text-amber-800"}`,children:n.verified_by_admin?"Verified":"Pending verification"})]})]},n.id))})]}),e.jsx(Qe,{household:i,onChange:c})]})}function Qe({household:s,onChange:r}){const i=_(De),c=_(ze),[n,m]=f.useState(""),[d,p]=f.useState(""),[g,a]=f.useState(""),[t,o]=f.useState(!1);return e.jsxs("div",{className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-ink",children:"Household members"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Add the people covered by your household membership. This is private — only you and RCA admins can see it."})]}),s.length>0&&e.jsx("ul",{className:"space-y-2",children:s.map(u=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg border border-border px-3 py-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("span",{className:"font-medium text-ink",children:u.full_name}),u.relationship&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",u.relationship]}),u.email&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",u.email]})]}),e.jsx("button",{type:"button","aria-label":`Remove ${u.full_name}`,onClick:async()=>{try{await c({data:{id:u.id}}),y.success("Removed"),r()}catch(h){y.error(h.message)}},className:"rounded-full p-1 text-muted-foreground hover:text-destructive",children:e.jsx(ie,{className:"size-3.5"})})]},u.id))}),e.jsxs("form",{onSubmit:async u=>{if(u.preventDefault(),!!n.trim()){o(!0);try{await i({data:{full_name:n.trim(),relationship:d.trim()||null,email:g.trim()||null}}),y.success("Household member added"),m(""),p(""),a(""),r()}catch(h){y.error(h.message)}finally{o(!1)}}},className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"hh-name",children:"Full name"}),e.jsx(N,{id:"hh-name",value:n,onChange:u=>m(u.target.value),maxLength:200})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"hh-rel",children:"Relationship"}),e.jsx(N,{id:"hh-rel",value:d,onChange:u=>p(u.target.value),maxLength:80,placeholder:"e.g. Spouse"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"hh-email",children:"Email (optional)"}),e.jsx(N,{id:"hh-email",type:"email",value:g,onChange:u=>a(u.target.value),maxLength:255})]}),e.jsx("div",{className:"sm:col-span-3",children:e.jsxs(j,{type:"submit",size:"sm",disabled:t,children:[e.jsx(X,{className:"size-4"})," ",t?"Adding…":"Add household member"]})})]})]})}function Ke({notes:s,documents:r,meetingArchive:i,isAdmin:c,onChange:n}){const[m,d]=f.useState(null),[p,g]=f.useState(!1);return e.jsxs("div",{className:"space-y-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink mb-4",children:"Meeting Documents"}),r.length===0?e.jsx("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-muted-foreground",children:"No documents available yet. Check back after the next meeting."}):e.jsx("div",{className:"space-y-3",children:r.map(a=>e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm flex flex-wrap gap-4 items-start justify-between",children:[e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.meeting_type&&e.jsx("span",{className:"text-xs rounded-full border border-border px-2 py-0.5 text-muted-foreground",children:a.meeting_type}),a.meeting_date&&e.jsx("span",{className:"text-xs text-muted-foreground",children:w(new Date(a.meeting_date),"MMMM d, yyyy")})]}),e.jsx("p",{className:"font-semibold text-ink",children:a.title}
1),a.description&&e.jsx("p",{className:"text-sm text-foreground/80",children:a.description})]}),a.file_url?e.jsx("a",{href:a.file_url,target:"_blank",rel:"noopener noreferrer",className:"shrink-0",children:e.jsxs(j,{variant:"outline",size:"sm",children:[e.jsx(ae,{className:"size-4"})," Download"]})}):e.jsx("span",{className:"text-sm text-muted-foreground italic shrink-0",children:"Coming after RCA review."})]},a.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Meeting Notes"}),c&&!p&&!m&&e.jsxs(j,{size:"sm",onClick:()=>g(!0),children:[e.jsx(X,{className:"size-4"})," New note"]})]}),(p||m)&&c&&e.jsx(We,{initial:m,onCancel:()=>{g(!1),d(null)},onSaved:()=>{g(!1),d(null),n()}}),s.length===0?e.jsx("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-muted-foreground",children:"No meeting notes yet."}):e.jsx("ul",{className:"space-y-4",children:s.map(a=>e.jsxs("li",{className:"rounded-xl border border-border bg-card p-6 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:w(new Date(a.meeting_date),"MMMM d, yyyy")}),e.jsx("h3",{className:"font-serif text-xl font-semibold text-ink mt-1",children:a.title})]}),c&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>d(a),children:e.jsx(je,{className:"size-4"})}),e.jsx(qe,{id:a.id,onDeleted:n})]})]}),e.jsx("div",{className:"mt-4 whitespace-pre-wrap text-foreground/90 leading-relaxed",children:a.content})]},a.id))})]}),i.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Meeting Archive"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Summaries of earlier general membership meetings, drawn from the minutes."}),e.jsx("ul",{className:"mt-4 space-y-4",children:i.map(a=>e.jsxs("li",{className:"rounded-xl border border-border bg-card p-6 shadow-sm",children:[e.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[w(new Date(`${a.date}T12:00:00`),"MMMM d, yyyy")," · ",a.kind]}),e.jsx("p",{className:"mt-1 font-serif text-lg font-semibold text-ink",children:a.location}),e.jsx("ul",{className:"mt-4 space-y-1.5 text-sm leading-relaxed text-foreground/85",children:a.covered.map(t=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-primary",children:"→"}),t]},t))}),a.guests&&a.guests.length>0&&e.jsxs("div",{className:"mt-4 border-t border-border pt-4",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Guests"}),e.jsx("ul",{className:"mt-2 space-y-1.5 text-sm leading-relaxed text-muted-foreground",children:a.guests.map(t=>e.jsx("li",{children:t},t))})]})]},a.date))})]})]})}function We({initial:s,onCancel:r,onSaved:i}){const c=_(Te),[n,m]=f.useState(s?.title??""),[d,p]=f.useState(s?.meeting_date??new Date().toISOString().slice(0,10)),[g,a]=f.useState(s?.content??""),[t,o]=f.useState(!1);async function u(h){h.preventDefault(),o(!0);try{await c({data:{id:s?.id,title:n,meeting_date:d,content:g}}),y.success(s?"Note updated":"Note published"),i()}catch(l){y.error(l.message)}finally{o(!1)}}return e.jsxs("form",{onSubmit:u,className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-4 mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-serif text-xl font-semibold text-ink",children:s?"Edit note":"New meeting note"}),e.jsx(j,{type:"button",variant:"ghost",size:"sm",onClick:r,children:e.jsx(se,{className:"size-4"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[e.jsx(b,{htmlFor:"n-title",children:"Title"}),e.jsx(N,{id:"n-title",value:n,onChange:h=>m(h.target.value),required:!0,maxLength:200})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"n-date",children:"Meeting date"}),e.jsx(N,{id:"n-date",type:"date",value:d,onChange:h=>p(h.target.value),required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"n-content",children:"Notes"}),e.jsx(U,{id:"n-content",value:g,onChange:h=>a(h.target.value),rows:10,required:!0,maxLength:2e4})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),e.jsx(j,{type:"submit",disabled:t,children:t?"Saving…":s?"Save changes":"Publish note"})]})]})}function qe({id:s,onDeleted:r}){const i=_(Fe),[c,n]=f.useState(!1);async function m(){if(confirm("Delete this meeting note?")){n(!0);try{await i({data:{id:s}}),y.success("Note deleted"),r()}catch(d){y.error(d.message)}finally{n(!1)}}}
1return e.jsx(j,{variant:"ghost",size:"sm",onClick:m,disabled:c,children:e.jsx(ie,{className:"size-4"})})}const Xe=["Photo","Video","Document","Story","Meeting material","Historical record","Other"],Je={Submitted:"bg-amber-100 text-amber-800","Under Review":"bg-blue-100 text-blue-800",Approved:"bg-green-100 text-green-800",Published:"bg-green-200 text-green-900",Rejected:"bg-red-100 text-red-800",Archived:"bg-gray-100 text-gray-700"};function Ze({onSaved:s}){const r=_(Ie),i=_(Ve),[c,n]=f.useState(!1),[m,d]=f.useState(!1),{data:p,isLoading:g,refetch:a}=K({queryKey:["myUploads"],queryFn:()=>r()}),t={title:"",upload_type:"Photo",description:"",date_taken_or_document_date:"",location_or_block:"",file_url:"",file_type:"",permission_to_contact:!1,permission_to_publish:!1,sensitive_content:!1},[o,u]=f.useState(t);async function h(l){l.preventDefault(),d(!0);try{await i({data:{...o,date_taken_or_document_date:o.date_taken_or_document_date||null,file_url:o.file_url||null,description:o.description||null,location_or_block:o.location_or_block||null,file_type:o.file_type||null}}),y.success("Upload submitted. RCA will review it."),u(t),n(!1),a(),s()}catch(x){y.error(x.message)}finally{d(!1)}}return e.jsxs("div",{className:"space-y-6 max-w-2xl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"My Uploads"}),!c&&e.jsxs(j,{size:"sm",onClick:()=>n(!0),children:[e.jsx(X,{className:"size-4"})," New upload"]})]}),e.jsx("div",{className:"rounded-lg bg-muted/50 border border-border px-4 py-3 text-sm text-muted-foreground",children:"All uploads are private by default. Files are not published publicly unless approved by an RCA admin. Sensitive content is flagged for private review only."}),c&&e.jsxs("form",{onSubmit:h,className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-serif text-xl font-semibold text-ink",children:"Submit an Upload"}),e.jsx(j,{type:"button",variant:"ghost",size:"sm",onClick:()=>n(!1),children:e.jsx(se,{className:"size-4"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"u-title",children:"Title *"}),e.jsx(N,{id:"u-title",value:o.title,onChange:l=>u(x=>({...x,title:l.target.value})),required:!0,maxLength:200})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"u-type",children:"Upload type *"}),e.jsxs(z,{value:o.upload_type,onValueChange:l=>u(x=>({...x,upload_type:l})),children:[e.jsx(T,{id:"u-type",children:e.jsx(F,{})}),e.jsx(L,{children:Xe.map(l=>e.jsx(k,{value:l,children:l},l))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"u-date",children:"Date taken or document date"}),e.jsx(N,{id:"u-date",type:"date",value:o.date_taken_or_document_date,onChange:l=>u(x=>({...x,date_taken_or_document_date:l.target.value}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"u-desc",children:"Description"}),e.jsx(U,{id:"u-desc",value:o.description,onChange:l=>u(x=>({...x,description:l.target.value})),rows:3,maxLength:2e3})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"u-loc",children:"Location or block (optional)"}),e.jsx(N,{id:"u-loc",value:o.location_or_block,onChange:l=>u(x=>({...x,location_or_block:l.target.value})),maxLength:200})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"u-url",children:"File URL (Google Drive, Dropbox, etc.)"}),e.jsx(N,{id:"u-url",type:"url",value:o.file_url,onChange:l=>u(x=>({...x,file_url:l.target.value})),placeholder:"https://…"})]})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/40 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:"Permissions"}),e.jsx(E,{id:"u-contact",checked:o.permission_to_contact,onChange:l=>u(x=>({...x,permission_to_contact:l})),label:"RCA may contact me about this upload."}),e.jsx(E,{id:"u-publish",checked:o.permission_to_publish,onChange:l=>u(x=>({...x,permission_to_publish:l})),label:"I give RCA permission to publish this publicly (requires admin approval)."}),e.jsx(E,{id:"u-sensitive",checked:o.sensitive_content,onChange:l=>u(x=>({...x,sensitive_content:l})),label:"This upload contains sensitive information (complaints, nuisance properties, etc.) — for private RCA review only."})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx(j,{type:"submit",disabled:m,children:m?"Submitting…":"Submit upload"})]})]}),g?e.jsx("p",{className:"text-muted-foreground",children:"Loading uploads…"}):!p||p.length===0?e.jsx("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-muted-foreground",children:'No uploads yet. Click "New upload" to share photos, documents, or stories with RCA.'}):e.jsx("ul",{className:"space-y-3",children:p.map(l=>e.jsx("li",{className:"rounded-xl border border-border bg-card p-5 shadow-sm flex flex-wrap gap-3 items-start justify-between",children:e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs rounded-full border border-border px-2 py-0.5 text-muted-foreground",children:l.upload_type}),e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 font-medium ${Je[l.status]??"bg-gray-100 text-gray-700"}`,children:l.status}),l.sensitive_content&&e.jsx("span",{className:"text-xs rounded-full bg-red-100 text-red-800 px-2 py-0.5",children:"Sensitive — private review"})]}),e.jsx("p",{className:"font-semibold text-ink",children:l.title}
1),l.description&&e.jsx("p",{className:"text-sm text-foreground/80",children:l.description}),e.jsx("p",{className:"text-xs text-muted-foreground",children:w(new Date(l.created_at),"MMMM d, yyyy")})]})},l.id))})]})}const Z=[...te.map(s=>s.title),"Other"];function es({interests:s,onSaved:r}){const i=_(Le),[c,n]=f.useState(s?.interests??[]),[m,d]=f.useState(s?.top_issue_1??""),[p,g]=f.useState(s?.top_issue_2??""),[a,t]=f.useState(s?.top_issue_3??""),[o,u]=f.useState(s?.comments??""),[h,l]=f.useState(!1);function x(v){n(V=>V.includes(v)?V.filter(Y=>Y!==v):[...V,v])}async function A(v){v.preventDefault(),l(!0);try{await i({data:{interests:c,top_issue_1:m||null,top_issue_2:p||null,top_issue_3:a||null,comments:o||null}}),y.success("Interests saved"),r()}catch(V){y.error(V.message)}finally{l(!1)}}return e.jsxs("form",{onSubmit:A,className:"space-y-6 max-w-2xl",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Issues I Care About"}),e.jsx("div",{className:"rounded-lg bg-muted/50 border border-border px-4 py-3 text-sm text-muted-foreground",children:"Your issue interests help RCA understand neighborhood priorities. RCA does not publish private complaints, sensitive addresses, or unverified allegations publicly."}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-ink mb-3",children:"Select all that apply"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:Z.map(v=>e.jsxs("label",{className:`flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm cursor-pointer transition-colors ${c.includes(v)?"border-primary bg-primary/10 text-primary font-medium":"border-border hover:bg-muted"}`,children:[e.jsx(q,{checked:c.includes(v),onCheckedChange:()=>x(v),className:"shrink-0"}),v]},v))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:"Rank your top 3 priorities"}),[{label:"#1 Priority",val:m,set:d},{label:"#2 Priority",val:p,set:g},{label:"#3 Priority",val:a,set:t}].map(({label:v,val:V,set:Y})=>{const oe=[m,p,a].filter(R=>R&&R!==V);return e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{children:v}),e.jsxs(z,{value:V||"__none__",onValueChange:R=>Y(R==="__none__"?"":R),children:[e.jsx(T,{children:e.jsx(F,{placeholder:"Select an issue…"})}),e.jsxs(L,{children:[e.jsx(k,{value:"__none__",children:"None"}),Z.filter(R=>!oe.includes(R)).map(R=>e.jsx(k,{value:R,children:R},R))]})]})]},v)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"i-comments",children:"Tell RCA more about what you want the neighborhood to focus on (optional)"}),e.jsx(U,{id:"i-comments",value:o,onChange:v=>u(v.target.value),rows:4,maxLength:2e3,placeholder:"Share any additional context or priorities…"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",disabled:h,children:h?"Saving…":"Save interests"})})]})}const ss=["Block Captain","Cleanup Volunteer","Meeting Support","Communications Volunteer","Resource Verifier","Membership Outreach","Events Volunteer","Youth and Families Volunteer","History / Story Collection Volunteer","Public Safety Committee Interest","Beautification Committee Interest"],ts=["Less than 1 hour/month","1–2 hours/month","3–5 hours/month","5–10 hours/month","10+ hours/month"];function ns({volunteer:s,onSaved:r}){const i=_(Ee),[c,n]=f.useState(s?.roles??[]),[m,d]=f.useState(s?.monthly_time_available??""),[p,g]=f.useState(s?.preferred_contact_method??""),[a,t]=f.useState(s?.notes??""),[o,u]=f.useState(!1);function h(x){n(A=>A.includes(x)?A.filter(v=>v!==x):[...A,x])}async function l(x){x.preventDefault(),u(!0);try{await i({data:{roles:c,monthly_time_available:m||null,preferred_contact_method:p||null,notes:a||null}}),y.success("Volunteer preferences saved"),r()}catch(A){y.error(A.message)}finally{u(!1)}}return e.jsxs("form",{onSubmit:l,className:"space-y-6 max-w-2xl",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Volunteer Interests"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-ink mb-3",children:"Roles I'm interested in"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ss.map(x=>e.jsxs("label",{className:`flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm cursor-pointer transition-colors ${c.includes(x)?"border-primary bg-primary/10 text-primary font-medium":"border-border hover:bg-muted"}`,children:[e.jsx(q,{checked:c.includes(x),onCheckedChange:()=>h(x),className:"shrink-0"}),x]},x))})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Monthly time available"}),e.jsxs(z,{value:m,onValueChange:d,children:[e.jsx(T,{children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:ts.map(x=>e.jsx(k,{value:x,children:x},x))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Preferred contact method"}),e.jsxs(z,{value:p,onValueChange:g,children:[e.jsx(T,{children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:["Email","Text","Phone"].map(x=>e.jsx(k,{value:x,children:x},x))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"v-notes",children:"Notes (optional)"}),e.jsx(U,{id:"v-notes",value:a,onChange:x=>t(x.target.value),rows:3,maxLength:1e3,placeholder:"Anything RCA should know about your availability or interests…"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",disabled:o,children:o?"Saving…":"Save preferences"})})]})}function rs({profile:s,email:r,onSaved:i}){const c=_(de),[n,m]=f.useState({communication_preferences:s?.communication_preferences??"",sms_consent:s?.sms_consent??!1,photo_story_permission:s?.photo_story_permission??!1,public_recognition_consent:s?.public_recognition_consent??!1,profile_visibility:s?.profile_visibility??"private"}),[d,p]=f.useState(!1);
1async function g(a){a.preventDefault(),p(!0);try{await c({data:n}),y.success("Settings saved"),i()}catch(t){y.error(t.message)}finally{p(!1)}}return e.jsxs("form",{onSubmit:g,className:"rounded-xl border border-border bg-card p-6 shadow-sm space-y-5 max-w-xl",children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"Settings"}),e.jsxs("p",{className:"text-sm text-muted-foreground -mt-2",children:["Signed in as ",e.jsx("span",{className:"font-medium text-foreground",children:r})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Communication preference"}),e.jsxs(z,{value:n.communication_preferences,onValueChange:a=>m(t=>({...t,communication_preferences:a})),children:[e.jsx(T,{children:e.jsx(F,{placeholder:"Select…"})}),e.jsx(L,{children:["Email","Text","Phone"].map(a=>e.jsx(k,{value:a,children:a},a))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Profile visibility"}),e.jsxs(z,{value:n.profile_visibility,onValueChange:a=>m(t=>({...t,profile_visibility:a})),children:[e.jsx(T,{children:e.jsx(F,{})}),e.jsxs(L,{children:[e.jsx(k,{value:"private",children:"Private — RCA admins only (default)"}),e.jsx(k,{value:"members",children:"Visible to RCA members"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your address, payment status, and uploads are always private to you and RCA admins regardless of this setting."})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/40 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:"Consents"}),e.jsx(E,{id:"s-sms",checked:n.sms_consent,onChange:a=>m(t=>({...t,sms_consent:a})),label:"I consent to receive SMS text messages from RCA."}),e.jsx(E,{id:"s-photo",checked:n.photo_story_permission,onChange:a=>m(t=>({...t,photo_story_permission:a})),label:"RCA may use my photos or stories in communications with my approval."}),e.jsx(E,{id:"s-recog",checked:n.public_recognition_consent,onChange:a=>m(t=>({...t,public_recognition_consent:a})),label:"RCA may recognize my contributions publicly."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",disabled:d,children:d?"Saving…":"Save settings"})})]})}function E({id:s,checked:r,onChange:i,label:c}){return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(q,{id:s,checked:r,onCheckedChange:n=>i(!!n),className:"mt-0.5 shrink-0"}),e.jsx("label",{htmlFor:s,className:"text-sm text-foreground/90 cursor-pointer leading-snug",children:c})]})}function as({surveys:s,myResponses:r,onSaved:i}){if(!s.length)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"No open surveys right now. When RCA publishes a neighborhood survey, it'll appear here."});const c=new Set(r.map(n=>n.survey_id));return e.jsx("div",{className:"space-y-4",children:s.map(n=>e.jsx(is,{survey:n,done:c.has(n.id),onSaved:i},n.id))})}function is({survey:s,done:r,onSaved:i}){const c=_(Ue),[n,m]=f.useState(!1),[d,p]=f.useState({}),[g,a]=f.useState(!1),t=Array.isArray(s.questions)?s.questions:[];function o(h,l){p(x=>({...x,[h]:l}))}function u(h,l){p(x=>{const A=Array.isArray(x[h])?x[h]:[];return{...x,[h]:A.includes(l)?A.filter(v=>v!==l):[...A,l]}})}return e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h3",{className:"font-serif text-lg font-semibold text-ink",children:s.title}),r&&e.jsx(W,{children:"Response submitted"})]}),s.description&&e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.description}),r&&!n?e.jsxs("p",{className:"mt-3 text-sm text-muted-foreground",children:["Thanks — your response is recorded."," ",e.jsx("button",{type:"button",onClick:()=>m(!0),className:"font-semibold text-primary hover:underline",children:"Update it"})]}):n?e.jsxs("form",{className:"mt-4 space-y-5",onSubmit:async h=>{h.preventDefault(),a(!0);try{await c({data:{survey_id:s.id,answers:d}}),y.success("Response submitted"),m(!1),i()}catch(l){y.error(l.message)}finally{a(!1)}},children:[t.map(h=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:h.label}),h.type==="text"&&e.jsx(U,{rows:2,value:d[h.id]??"",onChange:l=>o(h.id,l.target.value)}),h.type==="scale"&&e.jsx("div",{className:"flex flex-wrap gap-2",children:["1","2","3","4","5"].map(l=>e.jsx(j,{type:"button",size:"sm",variant:d[h.id]===l?"default":"outline",onClick:()=>o(h.id,l),children:l},l))}),h.type==="single"&&e.jsx("div",{className:"space-y-1.5",children:(h.options??[]).map(l
1=>e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"radio",name:h.id,checked:d[h.id]===l,onChange:()=>o(h.id,l)}),l]},l))}),h.type==="multi"&&e.jsx("div",{className:"space-y-1.5",children:(h.options??[]).map(l=>e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:Array.isArray(d[h.id])&&d[h.id].includes(l),onChange:()=>u(h.id,l)}),l]},l))})]},h.id)),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{type:"submit",size:"sm",disabled:g,className:"bg-accent text-accent-foreground hover:bg-accent/90",children:g?"Submitting…":"Submit response"}),e.jsx(j,{type:"button",size:"sm",variant:"ghost",onClick:()=>m(!1),children:"Cancel"})]})]}):e.jsx(j,{size:"sm",className:"mt-3",onClick:()=>m(!0),children:"Take the survey"})]})}function ls({events:s,myRsvps:r,onSaved:i}){if(!s.length)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming events right now. RCA meetings, cleanups, and community events will appear here to RSVP."});const c=new Map(r.map(n=>[n.event_id,n.response]));return e.jsx("div",{className:"space-y-4",children:s.map(n=>e.jsx(ds,{event:n,current:c.get(n.id)??null,onSaved:i},n.id))})}function ds({event:s,current:r,onSaved:i}){const c=_(Oe),[n,m]=f.useState(null),d=[{value:"going",label:"Going"},{value:"maybe",label:"Maybe"},{value:"not_going",label:"Can't go"}];return e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[e.jsx("h3",{className:"font-serif text-lg font-semibold text-ink",children:s.title}),s.event_date&&e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:w(new Date(s.event_date),"EEEE, MMMM d, yyyy · h:mm a")}),s.location&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.location}),s.description&&e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-foreground/85 whitespace-pre-wrap",children:s.description}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.map(p=>e.jsx(j,{size:"sm",variant:r===p.value?"default":"outline",disabled:n!==null,onClick:async()=>{m(p.value);try{await c({data:{event_id:s.id,response:p.value}}),y.success("RSVP saved"),i()}catch(g){y.error(g.message)}finally{m(null)}},children:p.label},p.value)),r&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["You responded: ",r==="not_going"?"Can't go":r]})]})]})}function os({attendance:s,switchTab:r}){const i=le(s);return e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-serif text-xl font-semibold text-ink",children:"My RCA engagement"}),i.totalMeetingsAttended>0&&e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>r("meetings"),children:"View attendance history"})]}),i.totalMeetingsAttended===0?e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"No RCA meeting attendance on record yet. Check in at the next general meeting and it will appear here."}):e.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Meetings attended"}),e.jsx("dd",{className:"mt-1 font-serif text-2xl font-semibold text-ink",children:i.totalMeetingsAttended})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Last 12 months"}),e.jsx("dd",{className:"mt-1 font-serif text-2xl font-semibold text-ink",children:i.meetingsLast12Months})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Most recent"}),e.jsx("dd",{className:"mt-1 font-medium text-ink",children:i.mostRecentMeetingAt?w(new Date(i.mostRecentMeetingAt),"MMM d, yyyy"):"—"})]})]})]})}function cs({attendance:s}){const r=le(s);return e.jsxs("section",{children:[e.jsx("h2",{className:"font-serif text-2xl font-semibold text-ink",children:"My meeting attendance"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Meetings you've checked in to. Only you and RCA officers can see this."}),s.length===0?e.jsx("p",{className:"mt-4 rounded-lg border border-border bg-card p-5 text-muted-foreground",children:"No attendance recorded yet. Digital check-in started in 2026 — meetings 
1you attended before then were recorded on paper sign-in sheets and aren't listed here."}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"mt-3 text-sm text-muted-foreground",children:[r.totalMeetingsAttended," total · ",r.meetingsLast12Months," in the last 12 months",r.firstMeetingAt&&` · first attended ${w(new Date(r.firstMeetingAt),"MMM d, yyyy")}`]}),e.jsx("ul",{className:"mt-4 space-y-2",children:s.map(i=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border bg-card px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-ink",children:i.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i.event_date?w(new Date(i.event_date),"MMMM d, yyyy"):w(new Date(i.checked_in_at),"MMMM d, yyyy")})]}),i.first_time_attendee&&e.jsx(W,{variant:"outline",children:"First meeting"})]},i.id))})]})]})}function ms(){const s=_(he),{data:r,isLoading:i}=K({queryKey:["officer-meetings"],queryFn:()=>s(),retry:!1});if(i||!r?.length)return null;const c=r.filter(n=>n.window_state==="open"||n.window_state==="before").slice(0,3);return c.length===0?null:e.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/5 p-5",children:[e.jsx("h2",{className:"font-serif text-xl font-semibold text-ink",children:"Officer meeting tools"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Check neighbors in at the door, or watch attendance as it comes in."}),e.jsx("ul",{className:"mt-4 space-y-3",children:c.map(n=>e.jsxs("li",{className:"rounded-lg border border-border bg-card p-4",children:[e.jsx("p",{className:"font-medium text-ink",children:n.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.event_date?w(new Date(n.event_date),"EEE, MMM d · h:mm a"):"Date to be announced"," · ",n.window_state==="open"?`check-in open · ${n.attendance_count} checked in`:"check-in not open yet"]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(j,{asChild:!0,size:"sm",children:e.jsx(I,{to:"/admin/meetings/$meetingId/desk",params:{meetingId:n.id},children:"Registration desk"})}),e.jsx(j,{asChild:!0,size:"sm",variant:"outline",children:e.jsx(I,{to:"/admin/meetings/$meetingId/attendance",params:{meetingId:n.id},children:"Live attendance"})}),e.jsx(j,{asChild:!0,size:"sm",variant:"outline",children:e.jsx(I,{to:"/admin/meetings/$meetingId/qr",params:{meetingId:n.id},children:"QR code"})})]})]},n.id))})]})}export{Rs 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.