PageSourceSearch

https://indiancaucus.org/_next/static/chunks/pages/dashboard/campaigns-13f3d3b715531b1d.js

js indiancaucus.org collected 2026-09-24 14:28:38 UTC 79,095 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6356],{4096:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/campaigns",function(){return r(53362)}])},53362:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var a=r(37876),s=r(14232),i=r(10553),n=r(90030),l=r(74982),o=r(27110);r(65364);let d={launch:{id:"launch",label:"App Launch",desc:"Announce the app with prominent App Store + Google Play download buttons",color:"#0F2044",bg:"#eef2ff",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),(0,a.jsx)("path",{d:"M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),(0,a.jsx)("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),(0,a.jsx)("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]}),fields:[{key:"headline",label:"Headline",placeholder:"The Indian Caucus app is here",type:"text",required:!0},{key:"body",label:"Short intro",placeholder:"One or two lines on why to download it now…",type:"textarea",required:!0}]},saathi:{id:"saathi",label:"Meet Saathi",desc:"Announce the in-app AI companion with App Store + Google Play buttons",color:"#F26644",bg:"#fff7ed",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M12 3.4c1.7 2 2.4 3.2 2.4 4.5a2.4 2.4 0 0 1-4.8 0c0-1.3.7-2.5 2.4-4.5z"}),(0,a.jsx)("path",{d:"M4 13.1c2.4-1.5 13.6-1.5 16 0"}),(0,a.jsx)("path",{d:"M4 13.1c1.7 4.1 14.3 4.1 16 0"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Meet Saathi — your community companion",type:"text"},{key:"body",label:"Short intro",placeholder:"One or two lines about what Saathi can do…",type:"textarea"}]},hindi:{id:"hindi",label:"Free Hindi Lessons",desc:"Announce the free in-app Hindi course, with App Store + Google Play buttons",color:"#c2410c",bg:"#fff7ed",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M3 8.5 12 4l9 4.5-9 4.5z"}),(0,a.jsx)("path",{d:"M7 11v4c0 1.5 2.5 2.5 5 2.5s5-1 5-2.5v-4"}),(0,a.jsx)("path",{d:"M21 8.5V14"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Learn Hindi — free, for the whole family",type:"text"},{key:"body",label:"Short intro",placeholder:"Leave blank for the default — it leads on it being free and on children talking to their grandparents.",type:"textarea"}]},event:{id:"event",label:"Event Announcement",desc:"Promote an upcoming event with image, date, and RSVP button",color:"#F26644",bg:"#fff7ed",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,a.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,a.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),fields:[{key:"title",label:"Event name",placeholder:"Diwali Mela 2025",type:"text",required:!0},{key:"date",label:"Date & time",placeholder:"Saturday, October 4 \xb7 12 PM – 6 PM",type:"text"},{key:"location",label:"Location",placeholder:"Buchmuller Park, Secaucus NJ",type:"text"},{key:"description",label:"Description",placeholder:"Tell people what to expect…",type:"textarea",required:!0},{key:"buttons",label:"Buttons",type:"buttons",addLabel:"Add button",defaultText:"RSVP Now",defaultUrl:"https://indiancaucus.org/events"}]},program:{id:"program",label:"Diwali Program Book",desc:"Share the interactive digital program with a big “Read the Program” button",color:"#e85d04",bg:"#fff7ed",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),(0,a.jsx)("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),fields:[{key:"headline",label:"Headline (optional)",placeholder:"The Diwali Mela program is here",type:"text"},{key:"body",label:"Message (optional — a festive default is used if blank)",placeholder:"One or two lines inviting people to read this year’s program…",type:"textarea"},{key:"ctaText",label:"Button text (optional)",placeholder:"Read the Program",type:"text"}]},vendor:{id:"vendor",label:"Vendor / Sponsor",desc:"Invite businesses to 
1sponsor or book a stall, linking to the sponsor page",color:"#0d9488",bg:"#f0fdfa",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M3 9l1-5h16l1 5"}),(0,a.jsx)("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"}),(0,a.jsx)("path",{d:"M9 21v-6h6v6"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Partner with us at Diwali Mela 2026",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Tell businesses why they should sponsor or book a stall…",type:"textarea",required:!0},{key:"ctaText",label:"Sponsor button text",placeholder:"Become a Sponsor",type:"text"},{key:"buttons",label:"Extra buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"",defaultUrl:""}]},performer:{id:"performer",label:"Performer Details",desc:"Send performers arrival times, USB instructions, and event details",color:"#9a3412",bg:"#fff7ed",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M9 18V5l12-2v13"}),(0,a.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,a.jsx)("circle",{cx:"18",cy:"16",r:"3"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Your Diwali Mela performance details",type:"text",required:!0},{key:"body",label:"Event details",placeholder:"Venue, schedule, parking, what to expect…",type:"textarea",required:!0},{key:"arrivalA",label:"Group A arrival time",placeholder:"11:30 AM",type:"text"},{key:"arrivalB",label:"Group B arrival time",placeholder:"2:30 PM",type:"text"},{key:"buttons",label:"Buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"View Event",defaultUrl:"https://indiancaucus.org/events"}]},performer_verify:{id:"performer_verify",label:"Confirm Performer Details",desc:"Ask this year’s performers to verify their names & registration before you lock the lineup",color:"#9a3412",bg:"#fff7ed",defaultTarget:"participants",lockTarget:!0,icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M9 11l3 3L22 4"}),(0,a.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Please confirm your performance details",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Leave blank to use the default review-your-details message…",type:"textarea"},{key:"deadline",label:"Lock date (optional)",placeholder:"Fri, Oct 24",type:"text"},{key:"buttons",label:"Buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"Review my details",defaultUrl:"https://indiancaucus.org/app/participate"}]},newsletter:{id:"newsletter",label:"Community Update",desc:"Share news, announcements, or a general message with your list",color:"#0F2044",bg:"#f0f4ff",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.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,a.jsx)("polyline",{points:"22,6 12,13 2,6"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Community Update — October 2025",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Write your update here…",type:"textarea",required:!0},{key:"buttons",label:"Buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"Learn More",defaultUrl:"https://indiancaucus.org"}]},donation:{id:"donation",label:"Donation Appeal",desc:"Drive donations with a compelling ask and a big Donate Now button",color:"#7c3aed",bg:"#faf5ff",icon:(0,a.jsx)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})}),fields:[{key:"headline",label:"Headline",placeholder:"Help us bring the community together",type:"text",required:!0},{key:"body",label:"Appeal message",placeholder:"Explain why you need support and what donations will fund…",type:"textarea",required:!0},{key:"ctaText",label:"Donate button text",placeholder:"Donate Now",type:"text"},{key:"buttons",label:"Extra buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"",defaultUrl:""}]},diya:{id:"diya",label:"Light a Diya",desc:"Invite contacts to light a diya on the community w
1all this Diwali",color:"#c9752b",bg:"#fdf3ea",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M12 3c0 2-2 3-2 5a2 2 0 0 0 4 0c0-2-2-3-2-5z"}),(0,a.jsx)("path",{d:"M4 14c2 3 5 4 8 4s6-1 8-4c-3 1-5 1.5-8 1.5S7 15 4 14z"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Light a diya on our community wall \uD83E\uDE94",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Invite them to light a diya for $11, dedicate it to a loved one, and watch the wall glow as Diwali nears…",type:"textarea",required:!0},{key:"ctaText",label:"Button text",placeholder:"Light a Diya \xb7 $11",type:"text"},{key:"buttons",label:"Extra buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"",defaultUrl:""}]},phone:{id:"phone",label:"Collect Phone Numbers",desc:"Ask contacts to add their mobile number for SMS event alerts",defaultTarget:"nophone",color:"#0891b2",bg:"#ecfeff",icon:(0,a.jsx)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("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"})}),fields:[],noImage:!0},update_details:{id:"update_details",label:"Update Contact Info",desc:"Ask contacts to confirm their name, email, mobile & mailing address so your records are complete",defaultTarget:"all",color:"#0F2044",bg:"#f0f4ff",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),(0,a.jsx)("circle",{cx:"9",cy:"10",r:"2"}),(0,a.jsx)("path",{d:"M5 17a3 3 0 0 1 6 0"}),(0,a.jsx)("line",{x1:"14",y1:"9",x2:"18",y2:"9"}),(0,a.jsx)("line",{x1:"14",y1:"13",x2:"18",y2:"13"})]}),fields:[],noImage:!0},volunteer_recruit:{id:"volunteer_recruit",label:"Recruit Volunteers",desc:"Ask your whole list to sign up as event volunteers",color:"#0891b2",bg:"#ecfeff",defaultTarget:"all",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,a.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),(0,a.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Lend a hand at our next event",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Tell people why you need volunteers and what they’ll do…",type:"textarea",required:!0},{key:"ctaText",label:"Button text",placeholder:"Become a Volunteer",type:"text"},{key:"buttons",label:"Extra buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"",defaultUrl:""}]},fundraiser_recruit:{id:"fundraiser_recruit",label:"Start a Fundraiser",desc:"Invite your whole list to start their own peer-to-peer fundraiser",color:"#F26644",bg:"#fff1ea",defaultTarget:"all",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"}),(0,a.jsx)("path",{d:"M12 8v6M9 11h6"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Rally your circle for our community",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Encourage people to start their own fundraiser and share it…",type:"textarea",required:!0},{key:"ctaText",label:"Button text",placeholder:"Start my fundraiser",type:"text"},{key:"buttons",label:"Extra buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"",defaultUrl:""}]},social:{id:"social",label:"Follow Us on Social",desc:"Ask your list to follow on Facebook & Instagram, with branded buttons",color:"#E1306C",bg:"#fdf2f8",defaultTarget:"all",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,a.jsx)("line",{x1:"17.5",y1:"6.5",x2:"17.5",y2:"6.5"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Stay connected with us",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Event photos, reminders, and community news — first on social. Give us a follow!",type:"textarea",required:!0}]},volunteer_info:{id:"volunteer_info",label:"Message Volunteers",desc:"Send details or instructions to your volunteer team",color:"#0e7490",bg:"#ecfeff",defaultTarget:"volunteers",icon:(0,a.jsx)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"})}),fields:[{key:"headline",label:"Headline",placeholder:"Volunteer briefing — Diwali Mela",type:"text",required:!0},{key:"body",label:"Message",placeholder:"Share arrival time, location, what to bring, who to ask for…",type:"textarea",required:!0},{key:"buttons",label:"Buttons (optional)",type:"buttons",addLabel:"Add button",defaultText:"View details",defaultUrl:"https://indiancaucus.org/events"}]},volunteer_onboarding:{id:"volunteer_onboarding",label:"Volunteer Onboarding",desc:"Nudge volunteers who haven’t finished ID, agreements & intake — auto-targets the not-onboarded only",color:"#F26644",bg:"#fff7ed",defaultTarget:"volunteers_unonboarded",icon:(0,a.jsxs)("svg",{width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M9 11l3 3L22 4"}),(0,a.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]}),fields:[{key:"headline",label:"Headline",placeholder:"Complete your volunteer onboarding",type:"text"},{key:"body",label:"Intro (optional — a friendly default is used if blank)",placeholder:"Thank y
1ou for volunteering! Please finish onboarding in the app…",type:"textarea"},{key:"buttons",label:"Button",type:"buttons",addLabel:"Add button",defaultText:"Open the app & onboard",defaultUrl:"https://indiancaucus.org/app/volunteer-onboarding"}]}},c=[{label:"Events",ids:["event","program"]},{label:"Performers",ids:["performer","performer_verify"]},{label:"Volunteers",ids:["volunteer_recruit","volunteer_info","volunteer_onboarding"]},{label:"Vendors & Sponsors",ids:["vendor"]},{label:"Fundraising",ids:["donation","diya","fundraiser_recruit"]},{label:"Contacts",ids:["phone","update_details"]},{label:"App & Social",ids:["launch","saathi","social"]},{label:"General",ids:["newsletter","plain"]}],h=(()=>{let e=new Set,t=c.map(t=>{let r=t.ids.map(e=>d[e]).filter(Boolean);return r.forEach(t=>e.add(t.id)),{label:t.label,items:r}}),r=Object.values(d).filter(t=>!e.has(t.id));if(r.length){let e=t.find(e=>"General"===e.label);e?e.items.push(...r):t.push({label:"General",items:r})}return t.filter(e=>e.items.length)})();function x({status:e}){return"sent"===e?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 bg-green-100 text-green-700 text-xs font-semibold px-2.5 py-1 rounded-full",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),"Sent"]}):"scheduled"===e?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 bg-orange-100 text-orange-700 text-xs font-semibold px-2.5 py-1 rounded-full",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[#F26644]"}),"Scheduled"]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 bg-amber-100 text-amber-700 text-xs font-semibold px-2.5 py-1 rounded-full",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),"Draft"]})}function u({value:e,onChange:t}
1){let r=(0,s.useRef)(),[i,n]=(0,s.useState)(!1),[l,o]=(0,s.useState)("");async function d(e){let r=e.target.files[0];if(r){if(r.size>5242880)return void o("Max 5 MB");n(!0),o("");try{let e=await fetch(`/api/admin/upload-image?filename=${encodeURIComponent(r.name)}`,{method:"POST",body:r}),a=await e.json();a.url?t(a.url):o(a.error||"Upload failed")}catch{o("Upload failed")}n(!1)}}return(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:["Image ",(0,a.jsx)("span",{className:"text-gray-400 dark:text-white/40 font-normal normal-case",children:"(optional, max 5 MB)"})]}),e?(0,a.jsxs)("div",{className:"relative rounded-xl overflow-hidden border border-gray-200 dark:border-white/10",children:[(0,a.jsx)("img",{src:e,alt:"Uploaded",className:"w-full max-h-48 object-cover"}),(0,a.jsx)("button",{type:"button",onClick:()=>t(""),className:"absolute top-2 right-2 bg-black/60 text-white text-xs px-2.5 py-1 rounded-lg hover:bg-black/80",children:"Remove"})]}):(0,a.jsxs)("div",{onClick:()=>r.current.click(),className:"border-2 border-dashed border-gray-200 dark:border-white/10 rounded-xl p-6 text-center cursor-pointer hover:border-[#F26644] hover:bg-gray-50 dark:hover:bg-white/6 transition-all",children:[i?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 text-gray-400 dark:text-white/40 text-sm",children:[(0,a.jsxs)("svg",{className:"animate-spin",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Uploading…"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{width:"28",height:"28",className:"text-gray-300 dark:text-white/40 mx-auto mb-2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("polyline",{points:"21 15 16 10 5 21"})]}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-sm",children:"Click to upload image"}),(0,a.jsx)("p",{className:"text-gray-300 dark:text-white/40 text-xs mt-1",children:"JPG, PNG, WebP"})]}),(0,a.jsx)("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:d})]}),l&&(0,a.jsx)("p",{className:"text-red-500 text-xs mt-1",children:l})]})}function p({value:e,onChange:t,field:r}){let s=Array.isArray(e)?e:[];function i(e,r,a){t(s.map((t,s)=>s===e?{...t,[r]:a}:t))}return(0,a.jsxs)("div",{className:"space-y-2.5",children:[s.map((e,n)=>(0,a.jsxs)("div",{className:"rounded-xl border border-gray-200 dark:border-white/10 bg-gray-50/60 dark:bg-white/6 p-3 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("span",{className:"text-[11px] font-semibold text-gray-400 dark:text-white/40 uppercase tracking-wide",children:["Button ",n+1]}),(0,a.jsx)("button",{type:"button",onClick:()=>{t(s.filter((e,t)=>t!==n))},className:"text-gray-300 dark:text-white/40 hover:text-red-500 transition-colors",title:"Remove button",children:(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("input",{type:"text",value:e.text||"",onChange:e=>i(n,"text",e.target.value),placeholder:r?.defaultText?`Button text (e.g. ${r.defaultText})`:"Button text",className:"w-full border border-gray-200 dark:border-white/10 rounded-lg px-3 py-2.5 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all bg-white dark:bg-white/4"}),(0,a.jsx)("input",{type:"url",value:e.url||"",onChange:e=>i(n,"url",e.target.value),placeholder:r?.defaultUrl||"https://indiancaucus.org",className:"w-full border border-gray-200 dark:border-white/10 rounded-lg px-3 py-2.5 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focu
1s:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all bg-white dark:bg-white/4"})]},n)),(0,a.jsxs)("button",{type:"button",onClick:function(){t([...s,{text:r?.defaultText||"",url:r?.defaultUrl||""}])},className:"flex items-center gap-1.5 text-[#F26644] text-sm font-semibold hover:opacity-80 transition-opacity",children:[(0,a.jsxs)("svg",{width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r?.addLabel||"Add button"]})]})}function g({status:e}){let t={clicked:["bg-violet-100","text-violet-700","bg-violet-500","Clicked"],opened:["bg-green-100","text-green-700","bg-green-500","Opened"],delivered:["bg-orange-100","text-orange-700","bg-[#F26644]","Delivered"],sent:["bg-gray-100 dark:bg-white/6","text-gray-600 dark:text-white/60","bg-gray-400","Sent"],bounced:["bg-red-100","text-red-700","bg-red-500","Bounced"],complained:["bg-red-100","text-red-700","bg-red-500","Complained"],failed:["bg-red-100","text-red-700","bg-red-500","Failed"]},[r,s,i,n]=t[e]||t.sent;return(0,a.jsxs)("span",{className:`inline-flex items-center gap-1 ${r} ${s} text-xs font-semibold px-2.5 py-1 rounded-full`,children:[(0,a.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${i}`}),n]})}function m({value:e,onChange:t,locked:r,subCount:s,volunteerCount:i,volunteerUnonboardedCount:n,vendorCount:l,noPhoneCount:o,participantCount:d,nonVendorCount:c}){var h;let x=[{id:"all",label:"All contacts",count:s},{id:"nonvendors",label:"No vendors",count:c},{id:"volunteers",label:"Volunteers",count:i},{id:"volunteers_unonboarded",label:"Not onboarded",count:n},{id:"vendors",label:"Vendors",count:l},{id:"participants",label:"Participants",count:d},{id:"nophone",label:"No phone yet",count:o}];if(r){let t=x.find(t=>t.id===e)||x[0];return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Send to"}),(0,a.jsxs)("div",{className:"px-3 py-3 rounded-xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/5 flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:t.label}),(0,a.jsx)("p",{className:"text-xs text-gray-400 dark:text-white/40 mt-0.5",children:null!=t.count?t.count.toLocaleString():"—"})]}),(0,a.jsxs)("span",{className:"text-xs font-semibold text-gray-400 dark:text-white/45 inline-flex items-center gap-1.5",children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),(0,a.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Performers only"]})]})]})}return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Send to"}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2",children:x.map(r=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.id),className:`text-left px-3 py-3 rounded-xl border transition-all ${e===r.id?"border-[#F26644] bg-[#0F2044]/5":"border-gray-200 dark:border-white/10 hover:bg-gray-50"}`,children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:r.label}),(0,a.jsx)("p",{className:"text-xs text-gray-400 dark:text-white/40 mt-0.5",children:null!=r.count?r.count.toLocaleString():"—"})]},r.id))}),"transactional"==("volunteers"===(h=e)||"volunteers_unonboarded"===h||"nophone"===h||"participants"===h||"nonvendors"===h?"transactional":"broadcast")&&(0,a.jsx)("p",{className:"text-xs text-gray-400 dark:text-white/40 mt-2",children:"Sent one email at a time from our own list — reliable, but Resend records no opens or clicks for it."})]})}function b(e,t,r,a,s,i,n,l){let o="volunteers"===e?r:"volunteers_unonboarded"===e?n:"vendors"===e?a:"nophone"===e?s:"participants"===e?i:"nonvendors"===e?l:t;
1return{label:null!=o?o.toLocaleString():"all",audience:"volunteers"===e?"volunteers":"volunteers_unonboarded"===e?"volunteers who haven’t onboarded":"vendors"===e?"vendors":"nophone"===e?"contacts without a phone":"participants"===e?"performers":"nonvendors"===e?"contacts (vendors excluded)":"contacts"}}function y(){let{isAdmin:e}=(0,n.It)(),{data:t}=(0,i.useSession)(),r=t?.user?.email||"",[d,c]=(0,s.useState)([]),[y,f]=(0,s.useState)(""),[w,k]=(0,s.useState)(!0),[v,j]=(0,s.useState)("list"),[N,S]=(0,s.useState)(null),[C,_]=(0,s.useState)({}),[F,T]=(0,s.useState)(""),[M,B]=(0,s.useState)(""),[L,A]=(0,s.useState)("all"),[R,P]=(0,s.useState)(!1);async function z(e,t){let r=(C[e]||"").trim();if(r){P(!0);try{let a=await fetch("/api/admin/translate-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r,to:t})}),s=await a.json();s.text&&_(t=>({...t,[e]:s.text}))}catch{}finally{P(!1)}}}let[E,W]=(0,s.useState)(""),[O,$]=(0,s.useState)(!1),[D,H]=(0,s.useState)("");async function I(){let e=E.trim();if(e){$(!0),H("");try{let t=await fetch("/api/admin/segment-suggest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:e})}),r=await t.json();r.target?(A(r.target),H(r.reason||r.label||"")):r.unavailable&&H("AI unavailable.")}catch{H("Could not match.")}finally{$(!1)}}}let[V,q]=(0,s.useState)(!1),[U,J]=(0,s.useState)(!1),[G,X]=(0,s.useState)(null),[Q,Y]=(0,s.useState)(""),[K,Z]=(0,s.use
1State)(null),[ee,et]=(0,s.useState)(null),[er,ea]=(0,s.useState)(null),[es,ei]=(0,s.useState)(null),[en,el]=(0,s.useState)(null),[eo,ed]=(0,s.useState)(null),[ec,eh]=(0,s.useState)(null),[ex,eu]=(0,s.useState)(""),[ep,eg]=(0,s.useState)(!1),[em,eb]=(0,s.useState)(!1),[ey,ef]=(0,s.useState)(null),[ew,ek]=(0,s.useState)(!1),[ev,ej]=(0,s.useState)(null),[eN,eS]=(0,s.useState)(""),[eC,e_]=(0,s.useState)(null),[eF,eT]=(0,s.useState)(null);(0,s.useEffect)(()=>{!r||ep||ex||eu(r)},[r,ep,ex]);let[eM,eB]=(0,s.useState)(!1),[eL,eA]=(0,s.useState)(""),[eR,eP]=(0,s.useState)(!1),[ez,eE]=(0,s.useState)(""),eW=N?.fields?.find(e=>"text"===e.type&&("headline"===e.key||"title"===e.key))?.key,eO=N?.fields?.find(e=>"textarea"===e.type)?.key;async function e$(){let e=eL.trim();if(!e)return void eE("Describe what this email is about");eP(!0),eE("");try{let t=await fetch("/api/admin/draft-email-copy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e,templateLabel:N?.label,templateId:N?.id,target:L,subject:M})}),r=await t.json().catch(()=>({}));if(!t.ok||r.error)throw Error(r.error||`Request failed (${t.status})`);r.subject&&B(r.subject),_(e=>{let t={...e};return eW&&r.headline&&(t[eW]=r.headline),eO&&r.body&&(t[eO]=r.body),t}),eB(!1)}catch(e){eE(e.message||"Could not generate a draft. Please try again.")}finally{eP(!1)}}
1let[eD,eH]=(0,s.useState)(!1),[eI,eV]=(0,s.useState)(null),[eq,eU]=(0,s.useState)([]),[eJ,eG]=(0,s.useState)(!1);function eX(){return k(!0),fetch("/api/admin/campaigns").then(e=>e.json()).then(e=>{c(e.campaigns??[]),k(!1)}).catch(()=>k(!1))}async function eQ(){eH(!0);try{await fetch("/api/admin/sync-campaign-stats",{method:"POST"}),await eX()}catch{}eH(!1)}async function eY(e){let t=await fetch(`/api/admin/campaigns?id=${e.id}`);ej((await t.json()).campaign),eS(""),Y(""),X(null),j("edit-draft")}async function eK(){if(ev){J(!0),Y("");try{let e=await fetch(`/api/admin/campaigns?id=${ev.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({send:!0,subject:ev.subject,target:ev.target_segment||"all"})}),t=await e.json();if(!e.ok||t.error)throw Error(t.error||"Send failed");X(`sent:${t.sent}`),await eX(),j("list")}catch(e){Y(e.message)}J(!1)}}async function eZ(){if(ev&&eN){J(!0),Y("");try{let e=await fetch(`/api/admin/campaigns?id=${ev.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:ev.subject,scheduledAt:(0,o.$e)(eN),target:ev.target_segment||"all"})}),t=await e.json();if(!e.ok||t.error)throw Error(t.error||"Schedule failed");await eX(),j("list")}catch(e){Y(e.message)}J(!1)}}async function e0(e){e_(e);try{(await fetch(`/api/admin/campaigns?id=${e}`,{method:"DELETE"})).ok&&await eX()}catch{}e_(null)}async function e2(e){let t=await fetch(`/api/admin/campaigns?id=${e}`),r=await t.json().catch(()=>({}));return r.campaign?.html_content||""}async function e1(e){let t=await e2(e.id);if(!t)return alert("Could not load the campaign content.");(await fetch("/api/admin/campaigns",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:e.subject,htmlContent:t,send:!1,target:e.target_segment||"all"})})).ok?eX():alert("Could not duplicate.")}async function e4(e){if(!confirm(`Resend "${e.subject}" to everyone in "${e.target_segment||"all"}" again? This can't be undone.`))return;let t=await e2(e.id);if(!t)return alert("Could not load the campaign content.");let r=await fetch("/api/admin/campaigns",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:e.subject,htmlContent:t,send:!0,target:e.target_segment||"all"})}),a=await r.json().catch(()=>({}));r.ok?(alert(`Resent to ${a.sent??0} recipient${1===a.sent?"":"s"}.`),eX()):alert(a.error||"Resend failed.")}(0,s.useEffect)(()=>{eX().then(()=>fetch("/api/admin/sync-campaign-stats",{method:"POST"})).then(()=>eX()).catch(()=>{}),fetch("/api/admin/stats").then(e=>e.json()).then(e=>{Z(e.total),et(e.volunteers??null),ea(e.volunteersUnonboarded??null),ei(e.vendors??null),el(e.nonVendors??null),ed(null!=e.total&&null!=e.phones?e.total-e.phones:null),eh(e.participants??null)}).catch(()=>{}),fetch("/api/admin/welcome-emails").then(e=>e.json()).then(e=>{eV(e.stats||null),eU(e.welcomeEmails||[])}).catch(()=>{})},[]);let[e5,e6]=(0,s.useState)(!1);async function e3(e){let t=prompt("Subject for the resend to non-openers:",`Reminder: ${e.subject}`);if(null!==t&&confirm(`Re-send "${e.subject}" to everyone who hasn't opened it yet? This can't be undone.`)){e6(!0);try{let r=await fetch("/api/admin/campaign-resend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({campaignId:e.id,subject:t})}),a=await r.json().catch(()=>({}));r.ok?(alert(`Re-sent to ${a.sent??0} non-opener${1===a.sent?"":"s"}.`),eT(null),eX()):alert(a.error||"Resend failed.")}finally{e6(!1)}}}function e9(){try{let e={...C,imageUrl:F};if(N?.id==="launch")return(0,l.Cq)(e);if(N?.id==="saathi")return(0,l.xx)(e);if(N?.id==="hindi")return(0,l.Hm)(e);if(N?.id==="event")return(0,l.J5)(e);if(N?.id==="program")return(0,l.oR)(e);if(N?.id==="newsletter")return(0,l.AL)(e);if(N?.id==="performer")return(0,l.Vo)(e);if(N?.id==="performer_verify")return(0,l.YI)(e);if(N?.id==="vendor")return(0,l.Bn)(e);if(N?.id==="donation")return(0,l.dx)(e);if(N?.id==="diya")return(0,l.Ec)(e);if(N?.id==="volunteer_recruit")return(0,l.Xr)(e);if(N?.id==="fundraiser_recruit")return(0,l.MF)(e);if(N?.id==="volunteer_info")return(0,l.$N)(e);if(N?.id==="volunteer_onboarding")return(0,l.gQ)(e);if(N?.id==="social")return(0,l.K0)(e);if(N?.id==="phone")return(0,l.jc)({firstName:"{{name}}"});if(N?.id==="update_details")return(0,l.sX)({firstName:"{{name}}"})}catch{}return""}async function e8(){if(!ex)return;eb(!0),ef(null);let e=await fetch("/api/admin/send-test-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:ex,subject:`[TEST] ${M}`,html:e9(),broadcast:!0})}),t=await e.json();eb(!1),ef(t.ok?"sent":t.error||"error")}
1async function e7(e=!1,t=null){J(!0),Y(""),X(null),ek(!1);let r=e9();try{let a=await fetch("/api/admin/campaigns",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:M,htmlContent:r,send:!e&&!t,scheduledAt:t,target:L})}),s=await a.json();s.error?Y(s.error):(X(e?"draft":t?"scheduled":`sent:${s.sent}`),eX(),e||setTimeout(()=>j("list"),1500))}catch{Y("The connection dropped before we heard back. Check the campaign list before sending again — it may already have gone out."),eX()}finally{J(!1)}}let te=d.filter(e=>"sent"===e.status),tt=te.reduce((e,t)=>e+Number(t.recipient_count||0),0),tr=te.reduce((e,t)=>e+Number(t.opened||0),0),ta=te.reduce((e,t)=>e+Number(t.clicked||0),0),ts=tt?Math.round(tr/tt*100):0,ti=tt?Math.round(ta/tt*100):0,tn=y.trim().toLowerCase(),tl=tn?d.filter(e=>[e.subject,e.target_segment,e.status].some(e=>String(e||"").toLowerCase().includes(tn))):d,to=ev?b(ev.target_segment||"all",K,ee,es,eo,ec,er,en):null;if("edit-draft"===v&&ev)return(0,a.jsxs)(n.Ay,{title:"Edit Draft",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,a.jsx)("button",{onClick:()=>j("list"),className:"text-gray-400 dark:text-white/40 hover:text-gray-700 transition-colors",children:(0,a.jsxs)("svg",{width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),(0,a.jsx)("polyline",{points:"12 19 5 12 12 5"})]})}),(0,a.jsx)("span",{className:"text-gray-700 dark:text-white/60 font-semibold text-sm",children:"Draft campaign"})]}),(0,a.jsxs)("div",{className:"max-w-xl space-y-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Subject line"}),(0,a.jsx)("input",{type:"text",value:ev.subject,onChange:e=>ej(t=>({...t,subject:e.target.value})),className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-3 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Email preview"}),(0,a.jsx)("div",{className:"border border-gray-200 dark:border-white/10 rounded-xl overflow-hidden",style:{height:320},children:(0,a.jsx)("iframe",{srcDoc:ev.html_content,title:"Email preview",style:{width:"100%",height:"100%",border:"none"},sandbox:"allow-same-origin"})})]}),(0,a.jsx)(m,{value:ev.target_segment||"all",onChange:e=>ej(t=>({...t,target_segment:e})),subCount:K,volunteerCount:ee,volunteerUnonboardedCount:er,vendorCount:es,noPhoneCount:eo,participantCount:ec,nonVendorCount:en}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Schedule send (optional)"}),(0,a.jsx)("input",{type:"datetime-local",value:eN,onChange:e=>eS(e.target.value),min:(0,o.S4)(),className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-3 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all"}),(0,a.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-xs mt-1",children:["Time is ",(0,a.jsx)("b",{children:"Eastern (ET)"}),". Leave blank to send immediately. Scheduled sends check every 15 minutes."]})]}),Q&&(0,a.jsx)("div",{className:"bg-red-50 border border-red-100 dark:bg-red-400/10 dark:border-red-400/20 rounded-xl px-4 py-3 text-red-600 text-xs",children:Q}),(0,a.jsx)("div",{className:"flex gap-3 pt-1",children:eN?(0,a.jsx)("button",{onClick:eZ,disabled:U||!e,className:"flex-1 text-white text-sm font-bold py-3 rounded-xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:U?"Scheduling…":`Schedule for ${(0,o.sX)(eN)}`}):(0,a.jsxs)("button",{onClick:()=>ek(!0),disabled:U||!ev.subject||!e,className:"flex-1 flex items-center justify-center gap-2 text-white text-sm font-bold py-3 rounded-xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:[(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,a.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),"Send broadcast to ",to.label," ",to.audience]})}),ew&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.5)"},children:(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-3xl shadow-2xl w-full max-w-sm p-5 sm:p-7",children:[(0,a.jsx)("h3",{className:"font-bold text-gray-900 dark:text-white text-lg text-center mb-2",children:"Ready to send?"}),(0,a.jsx)("p",{className:"text-gray-500 dark:text-white/60 text-sm text-center mb-1",children:(0,a.jsxs)("strong",{children:['"',ev.subject,'"']})}),(0,a.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-sm text-center mb-6",children:["This will send to ",(0,a.jsxs)("strong",{children:[to.label," ",to.audience]}),". Cannot be undone."]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:()=>ek(!1),className:"flex-1 border border-gray-200 dark:border-white/10 text-gray-600 dark:text-white/60 text-sm font-semibold py-3 rounded-2xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all",children:"Cancel"}),(0,a.jsx)("button",{onClick:()=>{ek(!1),eK()},disabled:U,className:"flex-1 text-white text-sm font-bold py-3 rounded-2xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:U?"Sending…":"Send now"})]})]})})]})]});if("list"===v)return(0,a.jsxs)(n.Ay,{title:"Campaigns",children:[eF&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)"},children:(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-3xl shadow-2xl w-full max-w-2xl flex flex-col",style:{maxHeight:"90vh"},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-white/10",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-bold text-gray-900 dark:text-white text-sm truncate",children:eF.subject}),(0,a.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-xs mt-0.5",children:["Sent ",(0,o.lQ)(eF.sent_at)," \xb7 ",Number(eF.recipient_count||0).toLocaleString()," recipients",eF.resend_broadcast_id?(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",Number(eF.opened||0).toLocaleString()," opens"," \xb7 ",Number(eF.clicked||0).toLocaleString()," clicks"]}):(0,a.jsxs)(a.Fragment,{children:[" \xb7 ","sent individually — no open tracking"]})]})]}),(0,a.jsx)("button",{onClick:()=>eT(null),className:"w-8 h-8 rounded-full bg-gray-100 dark:bg-white/6 hover:bg-gray-200 flex items-center justify-center text-gray-500 dark:text-white/60 transition-colors ml-3 shrink-0 text-lg leading-none",children:"\xd7"})]}),eF.resend_broadcast_id&&e&&(0,a.jsxs)("div",{className:"px-6 py-3 border-b border-gray-100 dark:border-white/10 flex items-center justify-between gap-3 flex-wrap",children:[(0,a.jsxs)("p",{className:"text-xs text-gray-500 dark:text-white/50",children:[Math.max(0,Number(eF.recipient_count||0)-Number(eF.opened||0)).toLocaleString()," recipient",Number(eF.recipient_count||0)-Number(eF.opened||0)==1?"":"s"," haven’t opened it yet."]}),(0,a.jsxs)("button",{onClick:()=>e3(eF),disabled:e5,className:"flex items-center gap-1.5 text-xs font-bold text-white px-4 py-2 rounded-xl shadow-xs hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg,#F26644,#FF9933)"},children:[(0,a.jsxs)("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,a.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),e5?"Sending…":"Resend to non-openers"]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden rounded-b-3xl",children:eF.html_content?(0,a.jsx)("iframe",{srcDoc:eF.html_content,title:"Campaign preview",style:{width:"100%",height:"100%",minHeight:400,border:"none"},sandbox:"allow-same-origin"}):(0,a.jsx)("div",{className:"flex items-center justify-center h-40 text-gray-400 dark:text-white/40 text-sm",children:"Loading…"})})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-6",children:[(0,a.jsxs)("p",{className:"text-gray-500 dark:text-white/60 text-sm",children:[d.length," campaign",1!==d.length?"s":""," total"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{onClick:eQ,disabled:eD||!e,title:"Sync open & click stats",className:"flex items-center gap-1.5 border border-gray-200 dark:border-white/10 bg-white dark:bg-white/4 text-gray-600 dark:text-white/60 text-xs font-semibold px-3 py-2.5 rounded-xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all shadow-xs disabled:opacity-50",children:[(0,a.jsxs)("svg",{width:"13",height:"13",className:eD?"animate-spin":"",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,a.jsx)("polyline",{points:"1 20 1 14 7 14"}),(0,a.jsx)("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),eD?"Syncing…":"Sync stats"]}),(0,a.jsxs)("button",{onClick:()=>j("pick"),disabled:!e,className:"flex items-center gap-2 text-white font-bold text-sm px-5 py-2.5 rounded-2xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:[(0,a.jsxs)("svg",{width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Campaign"]})]})]}),d.length>0&&(0,a.jsx)("div",{className:"mb-4 flex items-center gap-2",children:(0,a.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[(0,a.jsxs)("svg",{className:"absolute left-3.5 to
1p-1/2 -translate-y-1/2 text-gray-400 dark:text-white/40",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,a.jsx)("input",{type:"text",placeholder:"Search…",value:y,onChange:e=>f(e.target.value),className:"w-full bg-white dark:bg-white/4 border border-gray-200 dark:border-white/10 rounded-xl pl-9 pr-4 py-2.5 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all shadow-xs"})]})}),!w&&d.length>0&&(0,a.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 md:gap-4 mb-6",children:[{label:"Campaigns sent",value:te.length.toLocaleString()},{label:"Recipients reached",value:tt.toLocaleString()},{label:"Open rate",value:`${ts}%`},{label:"Click rate",value:`${ti}%`}].map(({label:e,value:t})=>(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 rounded-2xl border border-gray-100 dark:border-white/10 p-4 md:p-5 shadow-xs",children:[(0,a.jsx)("p",{className:"text-2xl font-black text-gray-900 dark:text-white",children:t}),(0,a.jsx)("p",{className:"text-gray-500 dark:text-white/60 text-xs font-medium mt-0.5",children:e})]},e))}),eI&&(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-2xl border border-gray-100 dark:border-white/10 shadow-xs mb-6 overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>eG(e=>!e),className:"w-full flex items-center gap-4 px-5 py-4 text-left hover:bg-gray-50/60 dark:hover:bg-white/6 transition-colors",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center text-white shrink-0",style:{background:"linear-gradient(135deg,#F26644,#FF9933)"},children:(0,a.jsxs)("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.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,a.jsx)("polyline",{points:"22,6 12,13 2,6"})]})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-gray-900 dark:text-white font-semibold text-sm",children:"Welcome Emails"}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-xs mt-0.5",children:"Automatically sent to every new contact"})]}),(0,a.jsxs)("div",{className:"hidden sm:flex items-center gap-5 mr-2 text-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-black text-gray-900 dark:text-white leading-none",children:eI.sent.toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mt-1",children:"Sent"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-black text-gray-900 dark:text-white leading-none",children:eI.delivered.toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mt-1",children:"Delivered"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-black text-gray-900 dark:text-white leading-none",children:eI.opened.toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mt-1",children:"Opened"})]}),eI.bounced+eI.failed>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-black text-red-500 leading-none",children:(eI.bounced+eI.failed).toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mt-1",children:"Failed"})]})]}),(0,a.jsx)("svg",{width:"18",height:"18",className:`text-gray-300 dark:text-white/40 shrink-0 transition-transform ${eJ?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,a.jsxs)("div",{className:"sm:hidden grid grid-cols-3 gap-2 px-5 pb-4 text-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-black text-gray-900 dark:text-white",children:eI.sent.toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px]",children:"Sent"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-black text-gray-900 dark:text-white",children:eI.delivered.toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px]",children:"Delivered"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-black text-gray-900 dark:text-white",children:eI.opened.toLocaleString()}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-[11px]",children:"Opened"})]})]}),eJ&&(0,a.jsx)("div",{className:"border-t border-gray-100 dark:border-white/10",children:0===eq.length?(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-sm text-center py-8",children:"No welcome emails sent yet."}):(0,a.jsx)("div",{className:"max-h-96 overflow-auto divide-y divide-gray-50",children:eq.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("p",{className:"text-gray-900 dark:text-white text-sm font-medium truncate",children:[e.first_name?`${e.first_name} \xb7 `:"",e.email]}),(0,a.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-xs mt-0.5",children:[(0,o.b3)(e.sent_at),e.error?` \xb7 ${e.error}`:""]})]}),(0,a.jsx)(g,{status:e.status})]},e.id))})})]}),G?.startsWith("sent:")&&(0,a.jsxs)("div",{className:"mb-5 flex items-center gap-3 bg-green-50 border border-green-200 dark:bg-green-400/10 dark:border-green-400/20 rounded-2xl px-5 py-4",children:[(0,a.jsx)("svg",{width:"18",height:"18",className:"text-green-600 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,a.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,a.jsxs)("p",{className:"text-green-800 font-semibold text-sm",children:["Sent to ",G.split(":")[1]," subscribers!"]})]}),w?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-gray-300 dark:text-white/40 py-10 justify-center",children:[(0,a.jsxs)("svg",{className:"animate-spin",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading…"]}):0===d.length?(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-2xl border border-gray-100 dark:border-white/10 shadow-xs text-center py-16",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-gray-100 dark:bg-white/6 flex items-center justify-center mx-auto mb-3",children:(0,a.jsxs)("svg",{width:"22",height:"22",className:"text-gray-300 dark:text-white/40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,a.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-sm font-medium",children:"No campaigns yet"}),(0,a.jsx)("p",{className:"text-gray-300 dark:text-white/40 text-xs mt-1",children:'Click "New Campaign" to get started'})]}):(0,a.jsx)("div",{className:"space-y-3",children:tl.map(t=>(0,a.jsxs)("div",{className:`bg-white dark:bg-white/4 rounded-2xl border border-gray-100 dark:border-white/10 shadow-xs px-5 py-4 flex items-center gap-4 ${"sent"===t.status?"cursor-pointer hover:bg-gray-50/60 dark:hover:bg-white/6 transition-colors":""}`,onClick:"sent"===t.status?async()=>{eT({...t,html_content:null});let e=await fetch(`/api/admin/campaigns?id=${t.id}`),r=await e.json();eT({...t,html_content:r.campaign?.html_content})}:void 0,children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center text-white shrink-0",style:{background:"sent"===t.status?"linear-gradient(135deg,#F26644,#FF9933)":"scheduled"===t.status?"linear-gradient(135deg,#0F2044,#2d4a8a)":"linear-gradient(135deg,#9ca3af,#d1d5db)"},children:(0,a.jsxs)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,a.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-gray-900 dark:text-white font-semibold text-sm truncate",children:t.subject}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-xs mt-0.5",children:"sent"===t.status&&t.sent_at?`Sent ${(0,o.lQ)(t.sent_at)}`:"scheduled"===t.status&&t.scheduled_at?`Scheduled for ${(0,o.b3)(t.scheduled_at)}`:`Created ${(0,o.lQ)(t.created_at)}`}),"sent"===t.status&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1 text-xs text-gray-400 dark:text-white/40",children:[(0,a.jsxs)("span",{children:[Number(t.recipient_count||0).toLocaleString()," sent"]}),t.resend_broadcast_id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{children:[Number(t.opened||0).toLocaleString()," opens",t.recipient_count?` (${Math.round(Number(t.opened||0)/t.recipient_count*100)}%)`:""]}),(0,a.jsxs)("span",{children:[Number(t.clicked||0).toLocaleString()," clicks",t.recipient_count?` (${Math.round(Number(t.clicked||0)/t.recipient_count*100)}%)`:""]})]}):(0,a.jsx)("span",{children:"sent individually — no open tracking"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[("draft"===t.status||"scheduled"===t.status)&&e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),eY(t)},className:"text-xs font-semibold border border-gray-200 dark:border-white/10 bg-white dark:bg-white/4 text-gray-600 dark:text-white/60 px-3 py-1.5 rounded-lg hover:bg-gray-50 dark:hover:bg-white/6 transition-all",children:"Edit"}),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),e0(t.id)},disabled:eC===t.id,className:"text-gray-300 dark:text-white/40 hover:text-red-500 transition-colors disabled:opacity-50",title:"Delete draft",children:eC===t.id?(0,a.jsxs)("svg",{className:"animate-spin",width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,a.jsx)("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),(0,a.jsx)("path",{d:"M10 11v6"}),(0,a.jsx)("path",{d:"M14 11v6"})]})})]}),"sent"===t.status&&e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),e1(t)},className:"text-xs font-semibold border border-gray-200 dark:border-white/10 bg-white dark:bg-white/4 text-gray-600 dark:text-white/60 px-3 py-1.5 rounded-lg hover:bg-gray-50 dark:hover:bg-white/6 transition-all",children:"Duplicate"}),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),e4(t)},className:"text-xs font-semibold text-white bg-[#F26644] px-3 py-1.5 rounded-lg hover:opacity-90 transition-all",children:"Resend"})]}),(0,a.jsx)(x,{status:t.status})]})]},t.id))})]});if("pick"===v)return(0,a.jsxs)(n.Ay,{title:"New Campaign",children:[(0,a.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,a.jsx)("button",{onClick:()=>j("list"),className:"text-gray-400 dark:text-white/40 hover:text-gray-700 transition-colors",children:(0,a.jsxs)("svg",{width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),(0,a.jsx)("polyline",{points:"12 19 5 12 12 5"})]})}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-white/60 text-sm",children:"Choose a template to get started"})]}),(0,a.jsx)("div",{className:"space-y-8",children:h.map(e=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-bold text-gray-400 dark:text-white/40 uppercase tracking-wider mb-3",children:e.label}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:e.items.map(e=>(0,a.jsxs)("button",{onClick:()=>{S(e),_("event"===e.id?{buttons:[{text:"",url:""}]}:{}),T(""),B(""),A(e.defaultTarget||"all"),eS(""),X(null),Y(""),q(!1),j("compose")}
1,className:"bg-white dark:bg-white/4 rounded-2xl border-2 border-gray-100 dark:border-white/10 p-6 text-left hover:border-gray-300 hover:shadow-md transition-all group",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center text-white mb-4",style:{background:e.color},children:e.icon}),(0,a.jsx)("p",{className:"font-bold text-gray-900 dark:text-white text-sm mb-1 group-hover:text-[#F26644] transition-colors",children:e.label}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-xs leading-relaxed",children:e.desc})]},e.id))})]},e.label))})]});let td=e9().replace(/\{\{\{contact\.email\}\}\}/g,"[email protected]").replace(/\{\{\{contact\.first_name\|Friend\}\}\}/g,"Friend"),{label:tc,audience:th}=b(L,K,ee,es,eo,ec,er,en);return(0,a.jsxs)(n.Ay,{title:N.label,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,a.jsx)("button",{onClick:()=>j("pick"),className:"text-gray-400 dark:text-white/40 hover:text-gray-700 transition-colors",children:(0,a.jsxs)("svg",{width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),(0,a.jsx)("polyline",{points:"12 19 5 12 12 5"})]})}),(0,a.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-white",style:{background:N.color},children:N.icon&&(0,a.jsx)("span",{style:{transform:"scale(0.7)"},children:N.icon})}),(0,a.jsx)("span",{className:"text-gray-700 dark:text-white/60 font-semibold text-sm",children:N.label})]}),(0,a.jsx)("div",{className:"lg:hidden mb-3",children:(0,a.jsx)("div",{className:"flex bg-gray-100 dark:bg-white/6 rounded-xl p-1 gap-1",children:[["Edit",!1],["Preview",!0]].map(([e,t])=>(0,a.jsx)("button",{onClick:()=>q(t),className:`flex-1 text-sm font-bold py-2 rounded-lg transition-all ${V===t?"bg-white dark:bg-white/4 text-[#0F2044] shadow-xs":"text-gray-500 dark:text-white/60"}`,children:e},e))})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{className:`space-y-5 ${V?"hidden lg:block":""}`,children:[(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-2xl border border-gray-100 dark:border-white/10 shadow-xs p-5 sm:p-6 space-y-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:["Email subject line ",(0,a.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,a.jsx)("input",{type:"text",value:M,onChange:e=>B(e.target.value),placeholder:"e.g. Diwali Mela 2025 — You're invited!",className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-3 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all"})]}),!!eO&&(eM?(0,a.jsxs)("div",{className:"rounded-xl border border-[#F26644]/15 bg-[#0F2044]/3 p-3 space-y-2.5",children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide",children:"What's this email about?"}),(0,a.jsx)("textarea",{value:eL,onChange:e=>eA(e.target.value),rows:3,placeholder:"e.g. Diwali Mela on Nov 1 at Buchmuller Park — free entry, food stalls and live performances. Invite everyone to RSVP.",className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-3 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all resize-y"}),ez&&(0,a.jsx)("p",{className:"text-red-500 text-xs",children:ez}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:e$,disabled:eR||!e||!eL.trim(),className:"inline-flex items-center gap-2 text-white text-xs font-bold px-4 py-2.5 rounded-xl shadow-xs hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg,#F26644,#FF9933)"},children:eR?"Drafting…":"Generate draft"}),(0,a.jsx)("button",{type:"button",onClick:()=>eB(!1),className:"text-gray-500 dark:text-white/60 text-xs font-semibold px-3 py-2.5 rounded-xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all",children:"Cancel"}),(0,a.jsx)("span",{className:"text-gray-400 dark:text-white/40 text-[11px] ml-auto hidden sm:inline",children:"Fills subject + copy \xb7 review before sending"})]})]}):(0,a.jsxs)("button",{type:"button",onClick:()=>{eB(!0),eE("")},disabled:!e,className:"inline-flex items-center gap-1.5 border border-gray-200 dark:border-white/10 bg-white dark:bg-white/4 text-gray-700 dark:text-white/60 text-xs font-semibold px-3 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all disabled:opacity-50",children:[(0,a.jsx)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M12 3l1.9 4.8L19 9.7l-4.1 2.9L16 18l-4-2.7L8 18l1.1-5.4L5 9.7l5.1-1.9z"})}),"Draft with AI"]})),!N?.lockTarget&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Describe your audience (AI)"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{value:E,onChange:e=>W(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),I())},placeholder:"e.g. volunteers who haven't onboarded",className:"flex-1 border border-gray-200 dark:border-white/10 rounded-xl px-3 py-2 text-sm dark:text-white dark:placeholder-white/30"}),(0,a.jsx)("button",{type:"button",onClick:I,disabled:O||!E.trim(),className:"text-sm font-bold text-white bg-[#0F2044] rounded-xl px-4 disabled:opacity-50",children:O?"…":"Match"})]}),D&&(0,a.jsxs)("p",{className:"text-xs text-gray-500 dark:text-white/60 mt-1",children:["Picked below: ",D]})]}),(0,a.jsx)(m,{value:L,onChange:A,locked:N?.lockTarget,subCount:K,volunteerCount:ee,volunteerUnonboardedCount:er,vendorCount:es,noPhoneCount:eo,participantCount:ec,nonVendorCount:en}),"participants"===L&&(0,a.jsxs)("div",{className:"rounded-xl border border-orange-200 bg-orange-50 dark:bg-white/6 dark:border-white/10 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-bold text-brand-navy dark:text-white uppercase tracking-wide",children:"Personalize per performer"}),(0,a.jsxs)("p",{className:"text-[13px] text-gray-600 dark:text-white/60 mt-1 leading-relaxed",children:["Type ",(0,a.jsx)("code",{className:"font-mono font-bold text-brand-orange",children:"{{group}}"})," or"," ",(0,a.jsx)("code",{className:"font-mono font-bold text-brand-orange",children:"{{time}}"})," anywhere in the email and each performer sees only their own group and arr
1ival time. Someone with two acts gets both groups and the earlier time; anyone not yet assigned reads “to be confirmed”. Don’t paste the lineup itself — that shows everyone else’s slot to everyone."]})]}),(0,a.jsx)(u,{value:F,onChange:T}),N.fields.map(e=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:[e.label," ",e.required&&(0,a.jsx)("span",{className:"text-red-400",children:"*"})]}),"buttons"===e.type?(0,a.jsx)(p,{field:e,value:C[e.key]||[],onChange:t=>_(r=>({...r,[e.key]:t}))}):"textarea"===e.type?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("textarea",{value:C[e.key]||"",onChange:t=>_(r=>({...r,[e.key]:t.target.value})),placeholder:e.placeholder,rows:5,className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-3 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all resize-y"}),(C[e.key]||"").trim()&&(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,a.jsx)("span",{className:"text-[11px] text-gray-400 dark:text-white/40 font-semibold",children:"Translate:"}),[["hi","हिंदी"],["gu","ગુજરાતી"]].map(([t,r])=>(0,a.jsx)("button",{type:"button",disabled:R,onClick:()=>z(e.key,t),className:"text-[11px] font-bold text-[#F26644] border border-orange-200 rounded-lg px-2 py-0.5 disabled:opacity-50",children:r},t)),R&&(0,a.jsx)("span",{className:"text-[11px] text-gray-400 dark:text-white/40",children:"translating…"})]})]}):(0,a.jsx)("input",{type:e.type,value:C[e.key]||"",onChange:t=>_(r=>({...r,[e.key]:t.target.value})),placeholder:e.placeholder,className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-3 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all"})]},e.key))]}),(0,a.jsxs)("div",{className:"bg-gray-50 dark:bg-white/6 rounded-2xl border border-gray-100 dark:border-white/10 p-4 space-y-2",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide",children:"Send a test first"}),(0,a.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-white/40 leading-relaxed",children:"Test emails use the same broadcast footer and unsubscribe flow you’ll see in the final send. Defaults to your own inbox — change the address to test elsewhere."}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)("input",{type:"email",value:ex,onChange:e=>{eg(!0),eu(e.target.value)},placeholder:r||"[email protected]",className:"w-full sm:flex-1 min-w-0 border border-gray-200 dark:border-white/10 rounded-xl px-3 py-2.5 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] bg-white dark:bg-white/4 transition-all"}),(0,a.jsx)("button",{type:"button",onClick:e8,disabled:em||!ex||!M||!e,className:"shrink-0 border border-gray-200 dark:border-white/10 bg-white dark:bg-white/4 text-gray-700 dark:text-white/60 text-xs font-semibold px-4 py-2.5 rounded-xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all disabled:opacity-50 whitespace-nowrap",children:em?"Sending…":r&&ex===r?"Send test to myself":"Send test"})]}),ey&&(0,a.jsx)("p",{className:`text-xs font-medium ${"sent"===ey?"text-green-600":"text-red-500"}`,children:"sent"===ey?"Test sent! Check your inbox.":`Error: ${ey}`})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/60 uppercase tracking-wide mb-1.5",children:"Schedule send (optional)"}),(0,a.jsx)("input",{type:"datetime-local",value:eN,onChange:e=>eS(e.target.value),min:(0,o.S4)(),className:"w-full border border-gray-200 dark:border-white/10 rounded-xl px-4 py-2.5 text-sm dark:text-white dark:placeholder-white/30 focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all bg-white dark:bg-white/4"}),(0,a.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-xs mt-1",children:"Leave blank to send now or save as draft. Scheduled sends check every 15 min."})]}),Q&&(0,a.jsx)("div",{className:"bg-red-50 border border-red-100 dark:bg-red-400/10 dark:border-red-400/20 rounded-xl px-4 py-3 text-red-600 text-xs",children:Q}),"draft"===G&&(0,a.jsx)("p",{className:"text-green-600 text-sm font-medium",children:"Draft saved."}),"scheduled"===G&&(0,a.jsx)("p",{className:"text-orange-600 text-sm font-medium",children:"Scheduled! Will send at the time you set."}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:()=>e7(!0),disabled:U||!M||!e,className:"border border-gray-200 dark:border-white/10 bg-white dark:bg-white/4 text-gray-700 dark:text-white/60 text-sm font-semibold px-5 py-3 rounded-xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all disabled:opacity-50",children:"Save draft"}),eN?(0,a.jsxs)("button",{onClick:()=>e7(!1,(0,o.$e)(eN)),disabled:U||!M||!e,className:"flex-1 flex items-center justify-center gap-2 text-white text-sm font-bold py-3 rounded-xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:[(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,a.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,a.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),"Schedule for ",(0,o.sX)(eN)]}):(0,a.jsxs)("button",{onClick:()=>ek(!0),disabled:U||!M||!e,className:"flex-1 flex items-center justify-center gap-2 text-white text-sm font-bold py-3 rounded-xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:[(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,a.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),"Send broadcast to ",tc," ",th]})]}),ew&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.5)"},children:(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-3xl shadow-2xl w-full max-w-sm p-5 sm:p-7",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-orange-100 flex items-center justify-center mx-auto mb-4",children:(0,a.jsxs)("svg",{width:"22",height:"22",className:"text-orange-500",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,a.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}),(0,a.jsx)("h3",{className:"font-bold text-gray-900 dark:text-white text-lg text-center mb-2",children:"Ready to send?"}),(0,a.jsx)("p",{className:"text-gray-500 dark:text-white/60 text-sm text-center mb-1",children:(0,a.jsxs)("strong",{children:['"',M,'"']})}),(0,a.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-sm text-center mb-6",children:["This will send a broadcast to ",(0,a.jsxs)("strong",{children:[tc," ",th]}),". This cannot be undone."]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:()=>ek(!1),className:"flex-1 border border-gray-200 dark:border-white/10 text-gray-600 dark:text-white/60 text-sm font-semibold py-3 rounded-2xl hover:bg-gray-50 dark:hover:bg-white/6 transition-all",children:"Cancel"}),(0,a.jsx)("button",{onClick:()=>e7(!1),disabled:U,className:"flex-1 text-white text-sm font-bold py-3 rounded-2xl shadow-md hover:opacity-90 transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #F26644, #FF9933)"},children:U?"Sending…":"Send now"})]})]})})]}),(0,a.jsx)("div",{className:`lg:sticky lg:top-24 lg:self-start ${!V?"hidden lg:block":""}`,children:(0,a.jsxs)("div",{className:"bg-white dark:bg-white/4 roun
1ded-2xl border border-gray-100 dark:border-white/10 shadow-xs overflow-hidden",children:[(0,a.jsxs)("div",{className:"bg-gray-50 dark:bg-white/6 border-b border-gray-100 dark:border-white/10 px-4 py-3 flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex gap-1.5",children:[(0,a.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-red-400"}),(0,a.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-400"}),(0,a.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-green-400"})]}),(0,a.jsx)("span",{className:"text-gray-400 dark:text-white/40 text-xs ml-2 font-mono truncate",children:"Live preview"})]}),(0,a.jsx)("div",{className:"overflow-auto max-h-[70vh]",dangerouslySetInnerHTML:{__html:td||'<div style="padding:40px;text-align:center;color:#9ca3af;font-family:sans-serif;font-size:14px;">Fill in the fields to see a preview</div>'}})]})})]})]})}},72552:()=>{},72784:(e,t,r)=>{"use strict";var a=r(65364);r(72552);var s=r(14232),i=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(s),n=void 0!==a&&a.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,r=t.name,a=void 0===r?"stylesheet":r,s=t.optimizeForSpeed,i=void 0===s?n:s;d(l(a),"`name` must be a string"),this._name=a,this._deletedRulePlaceholder="#"+a+"-deleted-rule____{}",d("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,r=e.prototype;return r.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(n||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},r.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},r.insertRule=function(e,t){if(d(l(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var r=this.getSheet();"number"!=typeof t&&(t=r.cssRules.length);try{r.insertRule(e,t)}catch(t){return n||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var a=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,a))}return this._rulesCount++},r.replaceRule=function(e,t){if(this._optimizeForSpeed){var r=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!r.cssRules[e])return e;r.deleteRule(e);try{r.insertRule(t,e)}catch(a){n||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),r.insertRule(this._deletedRulePlaceholder,e)}}else{var a=this._tags[e];d(a,"old rule at index `"+e+"` not found"),a.textContent=t}return e},r.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},r.cssRules=function(){var e=this;return this._tags.reduce(function(t,r){return r?t=t.concat(Array.prototype.map.call(e.getSheetForTag(r).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},r.makeStyleTag=function(e,t,r){t&&d(l(t),"makeStyleTag accepts only strings as second parameter");var a=document.createElement("style");this._nonce&&a.setAttribute("nonce",this._nonce),a.type="text/css",a.setAttribute("data-"+e,""),t&&a.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return r?s.insertBefore(a,r):s.appendChild(a),a},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0},h={};function x(e,t){if(!t)return"jsx-"+e;var r=String(t),a=e+r;return h[a]||(h[a]="jsx-"+c(e+"-"+r)),h[a]}function u(e,t){var r=e+t;return h[r]||(h[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[r]}var p=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,a=void 0===r?null:r,s=t.optimizeForSpeed,i=void 0!==s&&s;this._sheet=a||new o({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),a&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),a=r.styleId,s=r.rules;if(a in this._instancesCounts){this._instancesCounts[a]+=1;return}var i=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[a]=i,this._instancesCounts[a]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var a=this._fromServer&&this._fromServer[r];a?(a.parentNode.removeChild(a),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],a=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:a}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,a=e.id;if(r){var s=x(a,r);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return u(s,e)}):[u(s,t)]}}return{styleId:x(a),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=s.createContext(null);g.displayName="StyleSheetContext";var m=i.default.useInsertionEffect||i.default.useLayoutEffect,b=new p;function y(e){var t=b||s.useContext(g);return t&&m(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}y.dynamic=function(e){return e.map(function(e){return x(e[0],e[1])}).join(" ")},t.style=y},75961:(e,t,r)=>{"use strict";e.exports=r(72784).style}},e=>{e.O(0,[8230,6475,30,3965,636,6593,8792],()=>e(e.s=4096)),_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.