PageSourceSearch

https://foamglow.com/assets/VolunteerSignup-D9UgYk13.js

js foamglow.com collected 2026-09-30 13:42:07 UTC 17,237 bytes, 31 lines download raw bytes

1import{c as p,u as ne,F as le,r as i,j as e,L as w,B as N,b as T}from"./index-Dehqc7cc.js";import{n as oe}from"./notifyInquiry-B38Prit3.js";import{I as d}from"./input-BOOoKITO.js";import{L as c}from"./label-B4P8Qvui.js";import{C as k,a as M}from"./card-DZbbnuGV.js";import{B as L}from"./badge-Gmj_ZuIH.js";import{S as ce,a as me,b as de,c as he,d as xe}from"./select-zQkc6IrV.js";import{U as pe,S as ue,T as ge}from"./switch-B2WHlZVn.js";import{L as v,S as Y}from"./SEOHead-DnfH-Wfc.js";import{u as be}from"./useBrandContent-WKYL-d7Z.js";import{g as fe}from"./brandImages-CL9r3c8H.js";import{f as je,b as we,c as Ne,g as ve}from"./useVolunteerOpportunities-CZ1mg9Ok.js";import{s as E,m as h,U as W}from"./client-Bw6Mo37w.js";import{C as ye}from"./circle-check-CKuTFnzC.js";import{A as Fe}from"./arrow-left-DxhpUZfa.js";import{M as Se}from"./map-pin-DkYgOWcU.js";import{C as _e,M as Ce}from"./index-D0YX9d6v.js";import{C as ke}from"./clock-Cux2o9Pn.js";import{H as Me}from"./hand-heart-XSwoKMuq.js";import{S as Le}from"./shield-CgFpKd93.js";import{A as Ee}from"./arrow-right-DVHLytnR.js";import{M as Ae,C as Ie}from"./megaphone-Csf5_TwG.js";import{P as Pe}from"./party-popper-Bq6WMhcq.js";import{C as ze}from"./car-Dqba6IRD.js";import{f as y}from"./format--YuNkvsf.js";import"./index-CotvKMWO.js";import"./chevron-down-DCrVhF6o.js";import"./check-DrJKdnej.js";import"./useQuery-D7Z-4oYh.js";import"./brandPhotoFolders-Czad84dy.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const De=p("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const $e=p("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Ue=p("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Ve=p("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
22 * @license lucide-react v0.462.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const Be=p("Shirt",[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]]);/**
27 * @license lucide-react v0.462.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const Re=p("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]),x={initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6}},He=["XS","S","M","L","XL","2XL","3XL"],Oe={users:W,megaphone:Ae,droplets:De,camera:Ie,wrench:Re,trash2:ge,"heart-pulse":$e,"party-popper":Pe,car:ze,mic:Ue},Ge={Registration:"📋","Course Marshal":"🏁","Water Station":"💧",Photography:"📸","Setup Crew":"🔧","Cleanup Crew":"🧹","First Aid":"🩹","Finish Line":"🎉",Parking:"🚗","MC / Announcer":"🎤"};function Nt(){var R,H,O,G,q;const{slug:F}=ne(),[S]=le(),{data:s,isLoading:X}=je(F||""),{data:u=[]}=we((s==null?void 0:s.id)||""),{getBrand:Z}=be(),A=i.useMemo(()=>u.map(t=>
31t.id),[u]),{data:I=[]}=Ne(A),{data:J={}}=ve(A),[n,K]=i.useState(null),[g,P]=i.useState(null),[r,m]=i.useState({name:"",email:"",phone:"",tshirt_size:"",emergency_contact_name:"",emergency_contact_phone:""}),[z,D]=i.useState(!1),[Q,ee]=i.useState(!1),[_,$]=i.useState(!1),[b,te]=i.useState(S.get("group")||null),[C,se]=i.useState([]),[f,ae]=i.useState("");i.useEffect(()=>{S.get("group")&&$(!0),E.from("fundraise_groups").select("id, org_name, city, state").eq("status","approved").order("org_name").then(({data:t})=>{t&&se(t)})},[S]);const U=i.useMemo(()=>{if(!f)return C;const t=f.toLowerCase();return C.filter(a=>a.org_name.toLowerCase().includes(t)||a.city.toLowerCase().includes(t))},[C,f]),V=i.useMemo(()=>I.filter(t=>t.role_id===n),[I,n]),re=async t=>{if(t.preventDefault(),!(!s||!n||!g||!r.name||!r.email)){D(!0);try{const l={id:crypto.randomUUID(),opportunity_id:s.id,role_id:n,shift_id:g,name:r.name,email:r.email,phone:r.phone||null,tshirt_size:r.tshirt_size||null,emergency_contact_name:r.emergency_contact_name||null,emergency_contact_phone:r.emergency_contact_phone||null};_&&b&&(l.group_id=b);const{error:o}=await E.from("volunteer_signups").insert(l);if(o)throw o;E.functions.invoke("send-contact-confirmation",{body:{name:r.name,email:r.email,subject:"volunteer-signup"}}).catch(()=>{}),ee(!0),oe({inquiry_type:"volunteer",title:`New volunteer signup: ${r.name}`,submitter_name:r.name,submitter_email:r.email}),T.success("You're signed up! Check your email for confirmation.")}catch(a){T.error(a.message||"Something went wrong")}finally{D(!1)}}};if(X)return e.jsx(v,{children:e.jsx("div",{className:"min-h-screen bg-[hsl(213,80%,10%)] flex items-center justify-center",children:e.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-[#39FF14] border-t-transparent rounded-full"})})});if(!s)return e.jsx(v,{children:e.jsx("div",{className:"min-h-screen bg-[hsl(213,80%,10%)] flex items-center justify-center text-white",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Opportunity not found"}),e.jsx(w,{to:"/volunteer",children:e.jsx(N,{className:"bg-[#39FF14] text-[#0A2540]",children:"Back to Opportunities"})})]})})});const ie=s.hero_image||((R=s.event)==null?void 0:R.hero_image)||fe(((H=s.event)==null?void 0:H.brand)||"muddy-dash"),B=((G=Z((O=s.event)==null?void 0:O.brand))==null?void 0:G.name)||((q=s.event)==null?void 0:q.brand);return Q?e.jsxs(v,{children:[e.jsx(Y,{title:`Signed Up! | ${s.title}`,description:"You're confirmed as a volunteer.",canonicalPath:`/volunteer/${F}`}),e.jsx("div",{className:"min-h-screen bg-[hsl(213,80%,10%)] flex items-center justify-center",children:e.jsxs(h.div,{className:"text-center px-4",...x,children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-[#39FF14]/20 flex items-center justify-center",children:e.jsx(ye,{className:"h-10 w-10 text-[#39FF14]"})}),e.jsx("h1",{className:"text-3xl md:text-5xl font-black text-white mb-4",children:"You're In! 🎉"}),e.jsxs("p",{className:"text-white/70 text-lg max-w-md mx-auto mb-8",children:["Thank you for signing up to volunteer at ",e.jsx("span",{className:"text-[#39FF14] font-bold",children:s.title}),". We've sent a confirmation to your email."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[e.jsx(w,{to:"/volunteer",children:e.jsx(N,{className:"bg-[#39FF14] text-[#0A2540] font-bold border-0 hover:bg-[#00E676]",children:"Browse More Opportunities"})}),e.jsx(w,{to:"/events",children:e.jsx(N,{variant:"outline",className:"border-[#39FF14]/50 text-[#39FF14] bg-[#39FF14]/10 hover:bg-[#39FF14]/20",children:"See All Events"})})]})]})})]}):e.jsxs(v,{children:[e.jsx(Y,{title:`Volunteer at ${s.title} | EventLab`,description:s.description||`Sign up to volunteer at ${s.title}`,canonicalPath:`/volunteer/${F}`}),e.jsxs("section",{className:"relative h-[50vh] min-h-[350px] flex items-end overflow-hidden bg-[hsl(213,80%,10%)]",children:[e.jsx("img",{src:ie||"",alt:s.title,className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[hsl(213,80%,10%)] via-[hsl(213,80%,10%,0.4)] to-transparent"}),e.jsxs("div",{className:"relative z-10 container mx-auto px-4 pb-8",children:[e.jsxs(w,{to:"/volunteer",className:"inline-flex items-center text-[#39FF14] hover:text-[#00E676] mb-4 text-sm font-medium",children:[e.jsx(Fe,{className:"mr-1 h-4 w-4"})," Back to Opportunities"]}),e.jsxs(h.div,{...x,children:[B&&e.jsx(L,{className:"bg-[#39FF14] text-[#0A2540] font-bold border-0 mb-3",children:B}),e.jsx("h1",{className:"text-3xl md:text-5xl font-black text-white mb-3",children:s.title}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-white/70 text-sm",children:[s.location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Se,{className:"h-4 w-4"})," ",s.location]}),s.date&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_e,{className:"h-4 w-4"})," ",y(new Date(s.date),"EEEE, MMMM d, yyyy")]})]})]})]})]}),e.jsx("section",{className:"py-12 md:py-20 bg-[hsl(213,80%,10%)]",children:e.jsxs("div",{className:"container mx-auto px-4",children:[s.description&&e.jsx(h.p,{...x,className:"text-white/80 text-lg max-w-3xl mb-12",children:s.description}),e.jsxs(h.div,{...x,className:"mb-12",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white mb-6 flex items-center gap-2",children:[e.jsx("span",{className:"w-8 h-8 rounded-full bg-[#39FF14] text-[#0A2540] flex items-center justify-center text-sm font-black",children:"1"}),"Choose Your Role"]}),u.length===0?e.jsx("p",{className:"text-white/50",children:"No roles have been created yet. Check back soon!"}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:u.map(t=>{const a=n===t.id;
31return e.jsx(k,{className:`cursor-pointer transition-all duration-300 ${a?"bg-[#39FF14]/10 border-[#39FF14] shadow-[0_0_25px_rgba(57,255,20,0.2)]":"bg-white/5 border-white/10 hover:border-[#39FF14]/40"}`,onClick:()=>{K(t.id),P(null)},children:e.jsxs(M,{className:"p-6",children:[(()=>{const l=t.icon?Oe[t.icon]:null;if(l)return e.jsx(l,{className:"h-8 w-8 mb-3 text-[#39FF14]"});const o=Ge[t.name]||"⭐";return e.jsx("div",{className:"text-3xl mb-3",children:o})})(),e.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:t.name}),t.description&&e.jsx("p",{className:"text-white/60 text-sm mb-3",children:t.description}),t.max_signups&&e.jsxs(L,{className:`${a?"bg-[#39FF14] text-[#0A2540]":"bg-white/10 text-white/70"} border-0`,children:[e.jsx(W,{className:"h-3 w-3 mr-1"})," ",t.max_signups," spots"]})]})},t.id)})})]}),n&&e.jsxs(h.div,{...x,className:"mb-12",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white mb-6 flex items-center gap-2",children:[e.jsx("span",{className:"w-8 h-8 rounded-full bg-[#39FF14] text-[#0A2540] flex items-center justify-center text-sm font-black",children:"2"}),"Pick Your Shift"]}),V.length===0?e.jsx("p",{className:"text-white/50",children:"No shifts available for this role yet."}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:V.map(t=>{const a=g===t.id,l=J[t.id]||0,o=t.max_volunteers-l,j=o<=0;return e.jsx(k,{className:`transition-all duration-300 ${j?"opacity-50 cursor-not-allowed bg-white/5 border-white/10":a?"bg-[#39FF14]/10 border-[#39FF14] shadow-[0_0_25px_rgba(57,255,20,0.2)] cursor-pointer":"bg-white/5 border-white/10 hover:border-[#39FF14]/40 cursor-pointer"}`,onClick:()=>{j||P(t.id)},children:e.jsxs(M,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ke,{className:"h-4 w-4 text-[#39FF14]"}),e.jsxs("span",{className:"text-white font-bold",children:[y(new Date(t.start_time),"h:mm a")," – ",y(new Date(t.end_time),"h:mm a")]})]}),e.jsx("p",{className:"text-white/60 text-sm mb-2",children:y(new Date(t.start_time),"EEEE, MMM d")}),e.jsx(L,{className:`${j?"bg-red-500/20 text-red-400":a?"bg-[#39FF14] text-[#0A2540]":"bg-white/10 text-white/70"} border-0`,children:j?"FULL":`${o} spots left`})]})},t.id)})})]}),n&&g&&e.jsxs(h.div,{...x,children:[e.jsxs("h2",{className:"text-2xl font-bold text-white mb-6 flex items-center gap-2",children:[e.jsx("span",{className:"w-8 h-8 rounded-full bg-[#39FF14] text-[#0A2540] flex items-center justify-center text-sm font-black",children:"3"}),"Your Information"]}),e.jsx(k,{className:"bg-white/5 border-white/10 max-w-2xl",children:e.jsx(M,{className:"p-6",children:e.jsxs("form",{onSubmit:re,className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs(c,{className:"text-white/80 flex items-center gap-1 mb-1",children:[e.jsx(pe,{className:"h-3.5 w-3.5"})," Full Name *"]}),e.jsx(d,{required:!0,value:r.name,onChange:t=>m(a=>({...a,name:t.target.value})),className:"bg-white/5 border-white/10 text-white",placeholder:"Jane Doe"})]}),e.jsxs("div",{children:[e.jsxs(c,{className:"text-white/80 flex items-center gap-1 mb-1",children:[e.jsx(Ce,{className:"h-3.5 w-3.5"})," Email *"]}),e.jsx(d,{required:!0,type:"email",value:r.email,onChange:t=>m(a=>({...a,email:t.target.value})),className:"bg-white/5 border-white/10 text-white",placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsxs(c,{className:"text-white/80 flex items-center gap-1 mb-1",children:[e.jsx(Ve,{className:"h-3.5 w-3.5"})," Phone"]}),e.jsx(d,{value:r.phone,onChange:t=>m(a=>({...a,phone:t.target.value})),className:"bg-white/5 border-white/10 text-white",placeholder:"(555) 123-4567"})]}),e.jsxs("div",{children:[e.jsxs(c,{className:"text-white/80 flex items-center gap-1 mb-1",children:[e.jsx(Be,{className:"h-3.5 w-3.5"})," T-Shirt Size"]}),e.jsxs(ce,{value:r.tshirt_size,onValueChange:t=>m(a=>({...a,tshirt_size:t})),children:[e.jsx(me,{className:"bg-white/5 border-white/10 text-white",children:e.jsx(de,{placeholder:"Select size"})}),e.jsx(he,{children:He.map(t=>e.jsx(xe,{value:t,children:t},t))})]})]})]}),e.jsxs("div",{className:"border-t border-white/10 pt-4 mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"h-4 w-4 text-[#39FF14]"}),e.jsx(c,{className:"text-white/80 text-sm font-bold",children:"I'm volunteering for a fundraising group"})]}),e.jsx(ue,{checked:_,onCheckedChange:$})]}),_&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{placeholder:"Search groups by name or city...",value:f,onChange:t=>ae(t.target.value),className:"bg-white/5 border-white/10 text-white text-sm"}),e.jsx("div",{className:"max-h-40 overflow-y-auto space-y-1 rounded-lg border border-white/10 p-2 bg-white/5",children:U.length===0?e.jsx("p",{className:"text-white/40 text-xs text-center py-3",children:"No approved groups foun
31d"}):U.map(t=>e.jsxs("div",{className:`flex items-center justify-between px-3 py-2 rounded-md cursor-pointer transition-colors text-sm ${b===t.id?"bg-[#39FF14]/20 border border-[#39FF14]/40":"hover:bg-white/5"}`,onClick:()=>te(t.id),children:[e.jsx("span",{className:"text-white font-medium",children:t.org_name}),e.jsxs("span",{className:"text-white/40 text-xs",children:[t.city,", ",t.state]})]},t.id))}),b&&e.jsx("p",{className:"text-[#39FF14] text-xs",children:"✓ Your shift earnings ($50) will be credited to this group"})]})]}),e.jsxs("div",{className:"border-t border-white/10 pt-4 mt-4",children:[e.jsxs("p",{className:"text-white/60 text-sm mb-3 flex items-center gap-1",children:[e.jsx(Le,{className:"h-3.5 w-3.5"})," Emergency Contact (optional)"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-white/80 mb-1",children:"Contact Name"}),e.jsx(d,{value:r.emergency_contact_name,onChange:t=>m(a=>({...a,emergency_contact_name:t.target.value})),className:"bg-white/5 border-white/10 text-white",placeholder:"Emergency contact name"})]}),e.jsxs("div",{children:[e.jsx(c,{className:"text-white/80 mb-1",children:"Contact Phone"}),e.jsx(d,{value:r.emergency_contact_phone,onChange:t=>m(a=>({...a,emergency_contact_phone:t.target.value})),className:"bg-white/5 border-white/10 text-white",placeholder:"(555) 987-6543"})]})]})]}),e.jsxs(N,{type:"submit",disabled:z,className:"w-full mt-6 bg-[#39FF14] text-[#0A2540] font-bold text-base py-6 border-0 hover:bg-[#00E676] shadow-[0_0_20px_rgba(57,255,20,0.3)] hover:shadow-[0_0_30px_rgba(57,255,20,0.5)]",children:[z?"Signing Up...":"Confirm Volunteer Sign-Up"," ",e.jsx(Ee,{className:"ml-2 h-5 w-5"})]})]})})})]})]})})]})}export{Nt 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.