PageSourceSearch

https://indiancaucus.org/_next/static/chunks/pages/app/admin/vendors-15a8a4a069dea147.js

js indiancaucus.org collected 2026-10-02 01:08:40 UTC 23,958 bytes, 7 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3753],{2838:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/admin/vendors",function(){return a(39815)}])},7166:(e,t,a)=>{"use strict";a.d(t,{BC:()=>l,C3:()=>x,H_:()=>m,dR:()=>i,ey:()=>o,gg:()=>r,uv:()=>c});let r=["admin","moderator","staff","participant","volunteer"],n={admin:{app:!0,moderate:!0,checkin:!0,payments:!0,ban:!0,vendors:!0},moderator:{app:!0,moderate:!0,checkin:!0,payments:!1,ban:!1,vendors:!1},volunteer:{app:!0,moderate:!1,checkin:!0,payments:!0,ban:!1,vendors:!0},staff:{app:!0,moderate:!0,checkin:!0,payments:!0,ban:!0,vendors:!0},participant:{app:!0,moderate:!1,checkin:!0,payments:!0,ban:!1,vendors:!0}},s={app:!0,moderate:!1,checkin:!1,payments:!1,ban:!1,vendors:!1},o=e=>n[e]||s,i=e=>o(e).app,d={admin:{label:"Admin",summary:"Full access — everything on the dashboard and in the app.",can:["All dashboard pages + settings","All moderation & member management","Check-in & Terminal","Announcements, channels, polls, activity log, roles"],cannot:[]},staff:{label:"Staff",summary:"Back-office: the dashboard and app as a manager, minus admin-only settings.",can:["Orders, contacts, campaigns, donors, vendors, comms","Moderation & check-in / Terminal","Events & programs"],cannot:["Announcements, channels, polls, insights, activity log, roles (admin only)"]},moderator:{label:"Moderator",summary:"Trust & safety — review and act on member content.",can:["Reports, members, photos, directory, marketplace","Event check-in","Volunteer hours & shifts"],cannot:["Terminal / payments","Finance, contact & vendor data","Admin-only settings","Ban members (staff/admin only)"]},participant:{label:"Participant",summary:"Program coordinator — the performer running order, plus the door tools on event day.",can:["View & manage the performer running order","Email group assignments (their event)","Collect payments (Terminal / Tap to Pay)","Check people in","Add a contact","View vendors (read-only)"],cannot:["Browse or search the contact list — adding is all they can do","Remove a vendor or draft vendor outreach","Moderation, member management, banning","Everything else on the dashboard"]},volunteer:{label:"Volunteer",summary:"Event helper — app-only. Blocked from the dashboard entirely.",can:["Collect payments (Terminal / Tap to Pay)","Check people in","Add a contact","Log their volunteer hours","Read the performer running order (no edits)","View vendors (read-only)"],cannot:["The dashboard (redirected to the app)","Browse or search the contact list — adding is all they can do","Change anything about a performer","Remove a vendor or draft vendor outreach","Moderation, settings"]}},l=e=>d[e]||d.staff,c=e=>o(e).ban,m=e=>o(e).vendors,p=[{kind:"sale",label:"New sale",desc:"When a Terminal payment succeeds",appUrl:"/app/admin/orders"},{kind:"donation",label:"New donation",desc:"When someone donates online",appUrl:"/app/admin/donors"},{kind:"subscriber",label:"New contact",desc:"When someone signs up from the website",appUrl:"/app/admin/contacts"},{kind:"vendor",label:"New vendor",desc:"When a vendor signs up or buys a booth",appUrl:"/app/admin/vendors"},{kind:"performer",label:"New participant",desc:"When someone signs up to perform",appUrl:"/app/admin/participants"},{kind:"sms",label:"Incoming text",desc:"When someone texts the number",appUrl:"/app/admin/communications"},{kind:"call",label:"Incoming call",desc:"When someone calls the number",appUrl:"/app/admin/communications"},{kind:"report",label:"New content report",desc:"When a member reports a post or photo",appUrl:"/app/admin/reports"},{kind:"suggestion",label:"New directory suggestion",desc:"When a member suggests a place to review",appUrl:"/app/admin/directory"},{kind:"ban",label:"Member banned",desc:"When a member is banned or suspended",appUrl:"/app/admin/members"},{kind:"support",label:"New support ticket",desc:"When someone opens or replies to a ticket",appUrl:"/app/admin/support"},{kind:"volunteer",label:"Volunteer activity",desc:"New volunteer sign-ups and hours to verify",appUrl:"/app/admin/volunteer-hours"}];p.map(e=>e.kind);let h={sale:["admin","staff","volunteer","participant","moderator"],donation:["admin","staff"],subscriber:["admin","staff"],vendor:["admin","staff"],performer:["admin","staff","participant"],sms:["admin","staff"],call:["admin","staff"],report:["admin","staff","moderator","participant"],suggestion:["admin","staff","moderator","participant"],ban:["admin","staff"],support:["admin","staff"],volunteer:["admin","staff"]},x=e=>p.filter(t=>(function(e,t){let a=h[t];return!a||a.includes(e||"staff")})(e,t.kind))},39815:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>u});var r=a(37876),n=a(14232),s=a(89099),o=a(62422),i=a(62406),d=a(94430),l=a(96642),c=a(78007),m=a(62486),p=a(7166),h=a(88174),x=a(40861),b=a(60494);function u(){let e=(0,s.useRouter)(),{member:t,loading:a}=(0,i.IG)(),{confirm:u,promptText:f,toast:g}
1=(0,d.j)(),[y,w]=(0,n.useState)(null),[v,k]=(0,n.useState)(null),[j,N]=(0,n.useState)(new Date().getFullYear()),[C,$]=(0,n.useState)(""),[_,S]=(0,n.useState)(null),[A,E]=(0,n.useState)(null);async function T(e){E({vendor:e,busy:!0});try{let t=await fetch("/api/member/mod/vendor-pitch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e.email})});E({vendor:e,busy:!1,...await t.json()})}catch{E({vendor:e,busy:!1,error:"Could not draft"})}}(0,n.useEffect)(()=>{if(!a){if(t&&!(t.is_staff&&(0,p.H_)(t.staff_role)))return void e.replace("/app");let a=(0,l.Lj)("vendors");a?.data&&null===y&&w(a.data),fetch("/api/member/mod/vendors").then(e=>{if(!e.ok)throw Error("offline");return e.json()}).then(e=>{w(e.vendors||[]),k(null),(0,l.Io)("vendors",e.vendors||[])}).catch(()=>{let e=(0,l.Lj)("vendors");e?.data?(w(e.data),k({at:e.at})):w([])})}},[a,t]);let I=["staff","admin"].includes(t?.staff_role),M=t?.staff_role==="admin",[U,L]=(0,n.useState)(!1),O=[{key:"diwali-2026",label:"Diwali Mela 2026"},{key:"garba-2026",label:"Dandiya Dhamaka 2026"}];async function P(e,t=null){try{let a=await (await fetch(`/api/member/mod/vendor-logistics?event=${encodeURIComponent(e.key)}`)).json();if(a.error)return void g(a.error,"error");let r=await f({title:"Anything to add?",message:'Appears as "From the team". Load-in times, parking and the venue are already in the email.',placeholder:"Optional note",initial:a.note||"",allowEmpty:!0});if(null===r)return;let n=!1;!t&&a.unknownPackage&&(n=await u({title:"Include the unmatched vendors?",message:`${a.matched} bought a ${e.label} package. ${a.unknownPackage} more registered before we recorded which package, so we can't tell which event they're for.`,confirmLabel:`Include all ${a.matched+a.unknownPackage}`,cancelLabel:`Only the ${a.matched}`}));let s=t?1:a.matched+(n?a.unknownPackage:0);if(!s)return void g("Nobody to email for that event","error");if(!await u({title:t?`Email ${t.company||t.name||t.email}?`:`Email ${s} vendor${1===s?"":"s"}?`,message:`Load-in times, parking and what to bring for ${e.label}.`,confirmLabel:"Send"}))return;L(!0);let o=await fetch("/api/member/mod/vendor-logistics",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e.key,includeUnknown:n,note:r,...t?{vendorIds:[t.id]}:{}})}),i=await o.json().catch(()=>({}));if(!o.ok)return void g(i.error||"Could not send","error");let d=(i.skippedUnknownPackage||0)+(i.skippedNoEmail||0);g(`${i.sent} emailed${i.failed?` \xb7 ${i.failed} failed`:""}${d?` \xb7 ${d} skipped`:""}`,i.failed?"error":"success")}catch{g("Could not send","error")}finally{L(!1)}}let W=e=>new Date(e.created_at).getFullYear(),R=y||[],D=Array.from(new Set([new Date().getFullYear(),...R.map(W)])).sort((e,t)=>t-e),B=R.filter(e=>W(e)===j),F=C.trim()?B.filter(e=>[e.company,e.name,e.email].some(e=>String(e||"").toLowerCase().includes(C.trim().toLowerCase()))):B;async function V(e){let t=await f({title:"Vendor email",message:`Where ${e.company||e.name||"this vendor"} gets their load-in details.`,placeholder:"[email protected]",initial:e.email||""});if(null===t)return;let a=t.trim();if(a&&a!==(e.email||"")){S(e.id);try{let t=await fetch(`/api/member/mod/vendors?id=${e.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a})}),r=await t.json().catch(()=>({}));if(!t.ok)return void g(r.error||"Could not save","error");w(t=>{let n=(t||[]).map(t=>t.id===e.id?{...t,email:r.vendor?.email||a}:t);return(0,l.Io)("vendors",n),n}),g("Email updated.","success")}catch{g("Could not save","error")}finally{S(null)}}}async function H(e){if(await u({title:"Remove this vendor submission?",confirmLabel:"Remove",danger:!0})){S(e);try{if(!(await fetch(`/api/member/mod/vendors?id=${e}`,{method:"DELETE"})).ok)throw Error();w(t=>(t||[]).filter(t=>t.id!==e)),g("Removed.","success")}catch{g("Could not remove","error")}finally{S(null)}}}return(0,r.jsxs)(o.Ay,{title:"Vendors",active:"/app/admin",children:[(0,r.jsx)("div",{className:"app-fade-up flex items-center gap-2 mb-3",children:(0,r.jsx)("h1",{className:"text-xl font-extrabold text-brand-navy dark:text-white",children:"Vendors"})}),(0,r.jsxs)("p",{className:"app-fade-up text-gray-500 dark:text-white/55 text-sm mb-4",children:["Vendor registrations — submitted after a vendor pays and fills in their details.",!I&&" View only — ask a staff member to change anything here."]}),t?.staff_role==="admin"&&(0,r.jsx)(m.A,{endpoint:"/api/member/mod/sponsorship"}),M&&(0,r.jsxs)("div",{className:"bg-white border border-orange-100 rounded-2xl p-4 shadow-xs mb-4",children:[(0,r.jsx)("p",{className:"font-bold text-brand-navy dark:text-white text-sm",children:"Email load-in details"}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-xs mt-0.5 mb-3",children:"Arrival window, par
1king and what to bring. Times come from the event, so they’re never last year’s."}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:O.map(e=>(0,r.jsxs)("button",{onClick:()=>P(e),disabled:U,className:"flex items-center gap-1.5 bg-white border border-orange-100 dark:border-white/10 dark:bg-white/5 text-brand-navy dark:text-white text-sm font-bold px-4 py-2.5 rounded-xl disabled:opacity-50",children:[(0,r.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),(0,r.jsx)("polyline",{points:"22,6 12,13 2,6"})]}),U?"Sending…":e.label]},e.key))})]}),(0,r.jsx)(c.A,{offline:v,noun:"vendors"}),null===y?(0,r.jsx)("div",{className:"space-y-2",children:[0,1,2].map(e=>(0,r.jsx)("div",{className:"h-28 rounded-2xl bg-white border border-orange-100 app-shine"},e))}):(0,r.jsxs)(r.Fragment,{children:[D.length>1&&(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 mb-4",children:D.map(e=>(0,r.jsx)("button",{onClick:()=>N(e),className:`text-xs font-bold px-3 py-1.5 rounded-full border transition-all ${e===j?"bg-brand-orange text-white border-brand-orange":"bg-white text-gray-500 dark:text-white/55 border-orange-100"}`,children:e},e))}),B.length>0&&(0,r.jsx)("input",{value:C,onChange:e=>$(e.target.value),placeholder:"Search company, name, or email…",className:"w-full border border-orange-100 rounded-xl px-4 py-2.5 text-sm mb-3"}),(0,r.jsxs)("p",{className:"text-gray-400 dark:text-white/45 text-xs font-semibold uppercase tracking-wide mb-2",children:[F.length," registration",1===F.length?"":"s"," \xb7 ",j]}),0===F.length?(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-sm text-center py-10",children:C.trim()?"No vendors match your search.":`No vendor registrations for ${j}.`}):(0,r.jsx)("div",{className:"space-y-2",children:F.map(e=>{let t,a;return(0,r.jsxs)("div",{className:"bg-white border border-orange-100 rounded-2xl p-4 shadow-xs",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"font-bold text-brand-navy dark:text-white",children:e.company||"—"}),(0,r.jsx)("p",{className:"text-gray-600 dark:text-white/70 text-sm mt-0.5",children:e.name||"—"}),(0,r.jsxs)("p",{className:"text-gray-500 dark:text-white/55 text-xs mt-0.5",children:[e.email||"no email",e.phone?` \xb7 ${e.phone}`:""]})]}),I&&(0,r.jsx)("button",{onClick:()=>H(e.id),disabled:_===e.id,className:"text-gray-300 dark:text-white/30 hover:text-red-500 transition-colors disabled:opacity-40 shrink-0","aria-label":"Remove",children:(0,r.jsxs)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,r.jsx)("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),(0,r.jsx)("path",{d:"M10 11v6"}),(0,r.jsx)("path",{d:"M14 11v6"})]})})]}),e.package&&(0,r.jsxs)("span",{className:`inline-block text-[11px] font-bold rounded-full px-2 py-0.5 mt-1.5 ${(0,x.xi)(e)?"bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-300":"bg-gray-100 text-gray-600 dark:bg-white/10 dark:text-white/60"}`,children:[(0,x.xi)(e)?"\uD83C\uDF72 ":"",e.package]}),e.address&&(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-xs mt-1.5",children:e.address}),e.goods&&(0,r.jsxs)("p",{className:"text-gray-600 dark:text-white/70 text-sm mt-1.5",children:[(0,r.jsx)("span",{className:"text-gray-400 dark:text-white/45",children:"Selling: "}),e.goods]}),(0,x.xi)(e)&&(0,r.jsxs)("div",{className:"mt-2 rounded-xl bg-amber-50/60 dark:bg-amber-500/10 border border-amber-100 dark:border-amber-500/20 px-3 py-2 space-y-0.5",children:[(0,r.jsxs)("p",{className:"text-[11px] text-gray-600 dark:text-white/60",children:[(0,r.jsx)("b",{className:"text-gray-800 dark:text-white/80",children:"Permit"})," ",e.food_permit||(0,r.jsx)("em",{className:"text-red-600 not-italic font-semibold",children:"missing"})]}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-600 dark:text-white/60",children:[(0,r.jsx)("b",{className:"text-gray-800 dark:text-white/80",children:"Insurance"})," ",e.food_insurance||(0,r.jsx)("em",{className:"text-red-600 not-italic font-semibold",children:"missing"})]}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-600 dark:text-white/60",children:[(0,r.jsx)("b",{className:"text-gray-800 dark:text-white/80",children:"Cert"})," ",e.food_safe_cert||(0,r.jsx)("em",{className:"text-red-600 not-italic font-semibold",children:"missing"})]}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-500 dark:text-white/50",children:["none"===e.food_propane?"No open flame":"propane"===e.food_propane?"\uD83D\uDD25 Propane":"other"===e.food_propane?"\uD83D\uDD25 Open flame":"Flame not stated",e.food_amps?` \xb7 ${e.food_amps}A power`:" \xb7 no power"]}),e.food_menu&&(0,r.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-white/45",children:e.food_menu})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 mt-1.5",children:[e.website&&(0,r.jsx)("a",{href:(t=e.website)?/^https?:\/\//i.test(t)?t:`https://${t}`:null,target:"_blank",rel:"noreferrer",className:"text-brand-orange dark:text-brand-saffron text-xs font-bold",children:"Website ↗"}),e.social&&(0,r.jsx)("span",{className:"text-gray-500 dark:text-white/55 text-xs",children:e.social}),I&&e.email&&(0,r.jsx)("button",{onClick:()=>T(e),className:"text-brand-navy dark:text-white/80 text-xs font-bold",children:"AI outreach"}),I&&(0,r.jsx)("button",{onClick:()=>V(e),disabled:_===e.id,className:"text-brand-navy dark:text-white/80 text-xs font-bold disabled:opacity-40",children:e.email?"Edit email":"Add email"}),M&&e.email&&(0,r.jsx)("button",{onClick:()=>{let t=O.find(t=>(0,h.C)(e.package,t.key));if(!t)return void g("No package recorded, so we can’t tell which event — use the buttons above","error");P(t,e)},disabled:U,className:"text-brand-navy dark:text-white/80 text-xs font-bold disabled:opacity-40",children:"Send load-in"})]}),(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] mt-2",children:(a=e.created_at)?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"America/Ne
1w_York"}):""})]},e.id)})})]}),A&&(0,r.jsx)("div",{className:"app-backdrop fixed inset-0 z-50 flex items-end sm:items-center justify-center p-3",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>E(null),children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#0F1B33] rounded-3xl shadow-2xl w-full max-w-lg max-h-[85vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-100 dark:border-white/10 sticky top-0 bg-white dark:bg-[#0F1B33]",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"font-bold text-brand-navy dark:text-white",children:"Outreach draft"}),(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-xs truncate",children:A.vendor?.company||A.vendor?.name||A.vendor?.email})]}),(0,r.jsx)("button",{onClick:()=>E(null),className:"w-8 h-8 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center text-gray-500 dark:text-white/60 text-lg leading-none",children:"\xd7"})]}),(0,r.jsxs)("div",{className:"px-5 py-4",children:[A.busy&&(0,r.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-sm",children:"Writing a personal re-invite…"}),!A.busy&&(A.aiUnavailable||A.unavailable)&&(0,r.jsx)(b.A,{what:"AI outreach"}),!A.busy&&!A.aiUnavailable&&!A.unavailable&&A.error&&(0,r.jsx)("p",{className:"text-red-500 text-sm",children:A.error}),!A.busy&&A.email&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-brand-navy dark:text-white font-semibold text-sm",children:A.subject}),(0,r.jsx)("p",{className:"text-gray-800 dark:text-white/80 text-sm whitespace-pre-wrap bg-gray-50 dark:bg-white/5 border border-gray-100 dark:border-white/10 rounded-xl p-3",children:A.email}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:()=>{navigator.clipboard?.writeText(`Subject: ${A.subject}
2
3${A.email}`).then(()=>E(e=>({...e,copied:!0}))).catch(()=>{})},className:"text-xs font-bold text-white bg-brand-navy rounded-xl px-4 py-2",children:A.copied?"✓ Copied":"Copy"}),(0,r.jsx)("a",{href:`mailto:${encodeURIComponent(A.vendor?.email||"")}?subject=${encodeURIComponent(A.subject||"")}&body=${encodeURIComponent(A.email||"")}`,className:"text-xs font-bold text-brand-orange border border-orange-200 rounded-xl px-4 py-2",children:"Email"}),(0,r.jsx)("button",{onClick:()=>T(A.vendor),className:"text-xs font-bold text-gray-500 dark:text-white/55 px-3 py-2",children:"Regenerate"})]})]})]})]})})]})}},40861:(e,t,a)=>{"use strict";function r(e){var t;return t=e?.package,/\bfood\s+vendors?\b/i.test(String(t||"").trim())||!!(e?.food_permit||e?.food_menu||e?.food_insurance||e?.food_safe_cert)}a.d(t,{xi:()=>r})},60494:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var r=a(37876);let n="[email protected]";function s({what:e="This AI feature",className:t=""}){let a=encodeURIComponent("AI assistant is unavailable"),s=encodeURIComponent(`Hello,
4
5${e} is showing as unavailable in the admin tools.
6
7Sent from the admin tools.`);return(0,r.jsxs)("div",{className:`rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3.5 ${t}`,children:[(0,r.jsxs)("p",{className:"text-sm font-bold text-amber-900",children:[e," is unavailable"]}),(0,r.jsx)("p",{className:"text-xs text-amber-800 mt-1 leading-relaxed",children:"This needs an administrator — trying again won’t help. It usually means the AI account needs topping up or the daily limit has been reached."}),(0,r.jsxs)("a",{href:`mailto:${n}?subject=${a}&body=${s}`,className:"inline-flex items-center gap-1.5 mt-2.5 text-xs font-bold text-white rounded-xl px-3.5 py-2",style:{background:"linear-gradient(135deg,#F26644,#FF9933)"},children:[(0,r.jsxs)("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),(0,r.jsx)("polyline",{points:"22,6 12,13 2,6"})]}),"Email the support desk"]}),(0,r.jsx)("p",{className:"text-[11px] text-amber-700 mt-1.5",children:n})]})}},62486:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var r=a(37876),n=a(14232);function s({endpoint:e="/api/admin/sponsorship"}
7){let[t,a]=(0,n.useState)(null),[s,o]=(0,n.useState)(!1),[i,d]=(0,n.useState)("");async function l(t){o(!0),d("");try{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({open:t})}),n=await r.json().catch(()=>({}));if(!r.ok)throw Error(n.error||"Could not save");a(t),d(t?"Sponsorship is now open.":"Sponsorship is now closed.")}catch(e){d(e.message)}finally{o(!1)}}return(0,n.useEffect)(()=>{fetch(e).then(e=>e.json()).then(e=>a(!!e.open)).catch(()=>a(!0))},[e]),(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-100 shadow-xs p-5 mb-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-bold text-gray-900",children:"Event sponsorship"}),(0,r.jsx)("p",{className:"text-sm mt-0.5",children:null===t?(0,r.jsx)("span",{className:"text-gray-400",children:"Loading…"}):t?(0,r.jsx)("span",{className:"text-brand-green-dark dark:text-brand-green-light font-semibold",children:"Open — Sponsor tile & links visible everywhere"}):(0,r.jsx)("span",{className:"text-gray-500 font-semibold",children:"Closed — hidden across the app & site"})})]}),(0,r.jsx)("button",{onClick:()=>l(!t),disabled:s||null===t,"aria-label":"Toggle sponsorship",className:`relative w-14 h-8 rounded-full transition-colors disabled:opacity-50 shrink-0 ${t?"bg-brand-green-dark":"bg-gray-300"}`,children:(0,r.jsx)("span",{className:`absolute top-1 left-1 w-6 h-6 rounded-full bg-white shadow-sm transition-transform ${t?"translate-x-6":""}`})})]}),(0,r.jsx)("p",{className:"text-gray-400 text-xs mt-2",children:"You only run sponsorships around Diwali Mela & Dandiya Dhamaka — turn this off the rest of the year."}),i&&(0,r.jsx)("p",{className:`text-sm mt-2 font-medium ${i.includes("open")?"text-brand-green-dark dark:text-brand-green-light":i.includes("closed")?"text-gray-600":"text-red-600"}`,children:i})]})}},78007:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var r=a(37876),n=a(96642);function s({offline:e,noun:t="data"}){return e?(0,r.jsxs)("div",{className:"app-fade-up flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-2xl px-3.5 py-2.5 mb-4",children:[(0,r.jsx)("svg",{width:"16",height:"16",className:"text-amber-500 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M1 1l22 22M16.72 11.06A10.94 10.94 0 0 1 19 12.55M5 12.55a10.94 10.94 0 0 1 5.17-2.39M10.71 5.05A16 16 0 0 1 22.58 9M1.42 9a15.91 15.91 0 0 1 4.7-2.88M8.53 16.11a6 6 0 0 1 6.95 0M12 20h.01"})}),(0,r.jsxs)("p",{className:"text-amber-700 text-xs font-semibold",children:["Offline — showing ",t," saved ",(0,n.w0)(e.at),"."]})]}):null}},88174:(e,t,a)=>{"use strict";function r(e,t){let a=String(t||"").replace(/-\d{4}$/,"").trim().toLowerCase();if(!a)return!1;let r=(({diwali:["diwali"],garba:["dandiya","garba","navratri"],holi:["holi"]})[a]||[a]).filter(Boolean),n=String(e||"").toLowerCase();return!!n&&r.some(e=>n.includes(e))}a.d(t,{C:()=>r})},96642:(e,t,a)=>{"use strict";a.d(t,{Io:()=>n,Lj:()=>s,w0:()=>o});let r="ic_cache_";function n(e,t){try{localStorage.setItem(r+e,JSON.stringify({at:Date.now(),data:t}))}catch{}}function s(e){try{let t=localStorage.getItem(r+e);return t?JSON.parse(t):null}catch{return null}}function o(e){if(!e)return"";let t=Math.floor((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t} min ago`;let a=Math.floor(t/60);if(a<24)return`${a} hr${1===a?"":"s"} ago`;let r=Math.floor(a/24);return`${r} day${1===r?"":"s"} ago`}}},e=>{e.O(0,[8230,900,8766,2422,636,6593,8792],()=>e(e.s=2838)),_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.