1import{T as me,a3 as ue,r,aC as pe,aD as he,aE as be,aF as ge,aG as je,aH as fe,aI as Ne,aJ as ve,aK as ye,j as e,P,B as m,C as c,H as b,aL as we,ag as Ce,ah as ke,ai as O,aj as z,I as V}from"./index-BTqgdxf7.js";import{P as G,T as Se}from"./trash-2-GrBGvXOp.js";import{C as Te}from"./chevron-right-De9wuZEB.js";import{A as Q}from"./arrow-left-D_qluDeZ.js";import{P as Fe}from"./play-DsVuZ30F.js";import{E as Re}from"./eye-CzaQHl1B.js";import{C as De}from"./check-B2zzFxP_.js";import{U as Ae}from"./users-D3dNimbP.js";import{S as Pe}from"./send-0vttXh7a.js";/** 2 * @license lucide-react v1.7.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Le=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Me=me("pause",Le);function W(a){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(a/100)}function q(a){const u={draft:"bg-elevated text-muted border-border",active:"bg-green-500/10 text-green-400 border-green-500/20",paused:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",completed:"bg-blue-500/10 text-blue-400 border-blue-500/20",archived:"bg-elevated text-muted border-border"},i={draft:"Draft",active:"Active",paused:"Paused",completed:"Completed",archived:"Archived"},j=u[a]??"bg-elevated text-muted border-border";return e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border ${j}`,children:i[a]??a})}function Ue(a){const i={pending:"bg-elevated text-muted border-border",scheduled:"bg-blue-500/10 text-blue-400 border-blue-500/20",sent:"bg-blue-500/10 text-blue-400 border-blue-500/20",delivered:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",replied:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",booked:"bg-green-500/10 text-green-400 border-green-500/20",failed:"bg-red-500/10 text-red-400 border-red-500/20",opted_out:"bg-elevated text-muted border-border"}[a]??"bg-elevated text-muted border-border";return e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border ${i}`,children:a.replace(/_/g," ")})}function S(a){const u={estimate_followup:"bg-blue-500/10 text-blue-400 border-blue-500/20",seasonal:"bg-orange-500/10 text-orange-400 border-orange-500/20",maintenance_upsell:"bg-purple-500/10 text-purple-400 border-purple-500/20",deductible_reset:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",referral:"bg-green-500/10 text-green-400 border-green-500/20",review_solicitation:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",custom:"bg-elevated text-muted border-border"},i={estimate_followup:"Follow-Up",seasonal:"Seasonal",maintenance_upsell:"Upsell",deductible_reset:"Deductible",referral:"Referral",review_solicitation:"Reviews",custom:"Custom"},j=u[a]??"bg-elevated text-muted border-border";return e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border ${j}`,children:i[a]??a})}function g({label:a,value:u,subtext:i}){return e.jsxs(c,{className:"p-4",children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:a}),e.jsx("p",{className:"text-2xl font-bold text-foreground",children:u}),i&&e.jsx("p",{className:"text-xs text-muted mt-1",children:i})]})}const Ee=[{key:"{{name}}",label:"Customer Name"},{key:"{{vehicle}}",label:"Vehicle"},{key:"{{damageType}}",label:"Damage Type"},{key:"{{estimateLow}}",label:"Est. Low"},{key:"{{estimateHigh}}",label:"Est. High"},{key:"{{shopName}}",label:"Shop Name"},{key:"{{shopPhone}}",label:"Shop Phone"},{key:"{{state}}",label:"State"},{key:"{{referralDiscount}}",label:"Referral $"},{key:"{{googleReviewLink}}",label:"Review Link"}];function Qe(){const{shop:a}=ue(),[u,i]=r.useState("list"),[j,J]=r.useState([]),[U,K]=r.useState([]),[Y,X]=r.useState(!0),[T,Z]=r.useState("all"),[d,F]=r.useState(null),[E,ee]=r.useState([]),[se,te]=r.useState(0),[ae,_]=r.useState(!1),[B,L]=r.useState(null),[M,f]=r.useState(!1),[p,o]=r.useState(1),[t,y]=r.useState(null),[N,R]=r.useState(""),[w,D]=r.useState(""),[v,C]=r.useState(""),[k,A]=r.useState(""),[$,H]=r.useState(!1),x=r.useCallback(async()=>{try{const[s,l]=await Promise.all([pe(a.id,T!=="all"?T:void 0),he()]);J(s.data),K(l.data)}catch{}finally{X(!1)}},[a.id,T]);r.useEffect(()=>{x()},[x]);const re=r.useCallback(async s=>{_(!0),i("detail"),L(null);try{const[l,n]=await Promise.all([be(a.id,s),ge(a.id,s)]);F(l.data),ee(n.data),te(n.total)}catch{i("list")}finally{_(!1)}},[a.id]),le=r.useCallback(async s=>{f(!0);try{const l=await je(a.id,s);F(l.data),x()}catch{}finally{f(!1)}},[a.id,x]),ie=r.useCallback(async s=>{f(!0);try{const l=await fe(a.id,s);F(l.data),x()}catch{}finally{f(!1)}},[a.id,x]),de=r.useCallback(async s=>{if(confirm("Are you sure you want to archive this campaign?")){f(!0);try{await Ne(a.id,s),i("list"),x()}catch{}finally{f(!1)}}},[a.id,x]),ne=r.useCallback(async s=>{try{const l=await ve(a.id,s);L(l.data.message)}catch{L("Unable to generate preview.")}},[a.id]),ce=r.useCallback(async()=>
6{if(!(!N||!v)){H(!0);try{const s=await ye(a.id,{name:N,description:w||void 0,templateType:(t==null?void 0:t.type)??"custom",messageTemplate:v,followUpTemplate:k||void 0,audienceFilters:t==null?void 0:t.audienceFilters,triggerType:t==null?void 0:t.triggerType,triggerConfig:t==null?void 0:t.triggerConfig,sendLimits:t==null?void 0:t.sendLimits});o(1),y(null),R(""),D(""),C(""),A(""),i("list"),x()}catch{}finally{H(!1)}}},[a.id,N,w,v,k,t,x]),I=r.useCallback(s=>{y(s),R(s.name),D(s.description),C(s.messageTemplate),A(s.followUpTemplate??""),o(2),i("create")},[]),oe=r.useCallback(()=>{y(null),R(""),D(""),C(""),A(""),o(1),i("create")},[]),xe=r.useCallback(s=>{C(l=>`${l}${s}`)},[]);if(u==="list")return e.jsx(P,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Campaigns"}),e.jsx("p",{className:"text-sm text-muted mt-1",children:"Proactively reach out to customers with targeted messages"})]}),e.jsxs(m,{onClick:oe,className:"gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),"Create Campaign"]})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground mb-3",children:"Quick Start Templates"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:U.map(s=>e.jsxs(c,{className:"p-4 cursor-pointer hover:border-primary/40 transition-colors",onClick:()=>I(s),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:s.name}),S(s.type)]}),e.jsx("p",{className:"text-xs text-muted mb-3",children:s.description}),e.jsx("p",{className:"text-xs text-green-400",children:s.expectedImpact})]},s.type))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground mr-3",children:"Your Campaigns"}),["all","active","paused","draft","completed"].map(s=>e.jsx("button",{type:"button",onClick:()=>Z(s),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${T===s?"bg-primary/10 text-primary-text border border-primary/30":"text-muted hover:text-foreground border border-border hover:border-border"}`,children:s==="all"?"All":s.charAt(0).toUpperCase()+s.slice(1)},s))]}),Y?e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{className:"h-24 w-full"}),e.jsx(b,{className:"h-24 w-full"})]}):j.length===0?e.jsxs(c,{className:"p-8 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-elevated border border-border flex items-center justify-center mx-auto mb-3",children:e.jsx(we,{className:"w-6 h-6 text-muted"})}),e.jsx("p",{className:"text-sm font-semibold text-foreground mb-1",children:"No campaigns yet"}),e.jsx("p",{className:"text-xs text-muted mb-4",children:"Choose a template above or create a custom campaign to start reaching your customers."})]}):e.jsx("div",{className:"space-y-3",children:j.map(s=>{const l=s.stats;return e.jsx(c,{className:"p-4 cursor-pointer hover:border-primary/40 transition-colors",onClick:()=>re(s.id),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-3 min-w-0",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:s.name}),q(s.status),S(s.templateType)]}),s.description&&e.jsx("p",{className:"text-xs text-muted",children:s.description})]})}),e.jsxs("div",{className:"flex items-center gap-6 text-xs text-muted flex-shrink-0",children:[l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l.sent}),e.jsx("p",{children:"Sent"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l.replied}),e.jsx("p",{children:"Replied"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l.booked}),e.jsx("p",{children:"Booked"})]})]}),e.jsx(Te,{className:"w-4 h-4 text-muted"})]})]})},s.id)})})]})});if(u==="detail"){if(ae||!d)return e.jsx(P,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(b,{className:"h-8 w-48"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(b,{className:"h-20"}),e.jsx(b,{className:"h-20"}),e.jsx(b,{className:"h-20"}),e.jsx(b,{className:"h-20"})]}),e.jsx(b,{className:"h-64"})]})});const s=d.stats??{sent:0,delivered:0,replied:0,booked:0,optedOut:0,failed:0,revenueCents:0},l=s.delivered>0?(s.replied/s.delivered*100).toFixed(1):"0",n=s.replied>0?(s.booked/s.replied*100).toFixed(1):"0";return e.jsx(P,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{i("list"),F(null)},className:"p-1.5 rounded-lg hover:bg-elevated transition-colors",children:e.jsx(Q,{className:"w-4 h-4 text-muted"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-xl font-bold text-foreground",children:d.name}),q(d.status),S(d.templateType)]}),d.description&&e.jsx("p",{className:"text-sm text-muted mt-0.5",children:d.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d.status==="draft"||d.status==="paused"?e.jsxs(m,{onClick:()=>
6le(d.id),disabled:M,className:"gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),"Activate"]}):d.status==="active"?e.jsxs(m,{onClick:()=>ie(d.id),disabled:M,variant:"secondary",className:"gap-2",children:[e.jsx(Me,{className:"w-4 h-4"}),"Pause"]}):null,e.jsx("button",{type:"button",onClick:()=>de(d.id),disabled:M,className:"p-2 rounded-lg text-red-400 hover:bg-red-500/10 transition-colors",children:e.jsx(Se,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-3",children:[e.jsx(g,{label:"Sent",value:s.sent}),e.jsx(g,{label:"Delivered",value:s.delivered}),e.jsx(g,{label:"Replied",value:s.replied,subtext:`${l}% rate`}),e.jsx(g,{label:"Booked",value:s.booked,subtext:`${n}% rate`}),e.jsx(g,{label:"Opted Out",value:s.optedOut}),e.jsx(g,{label:"Failed",value:s.failed}),e.jsx(g,{label:"Revenue",value:W(s.revenueCents),subtext:"Attributed"})]}),e.jsxs(Ce,{defaultValue:"message",children:[e.jsxs(ke,{children:[e.jsx(O,{value:"message",children:"Message Template"}),e.jsxs(O,{value:"sends",children:["Send History (",se,")"]})]}),e.jsx(z,{value:"message",children:e.jsxs(c,{className:"p-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Message Template"}),e.jsx("div",{className:"bg-elevated p-3 rounded-lg border border-border",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:d.messageTemplate})})]}),d.followUpTemplate&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Follow-up Template"}),e.jsx("div",{className:"bg-elevated p-3 rounded-lg border border-border",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:d.followUpTemplate})})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs(m,{variant:"secondary",onClick:()=>ne(d.id),className:"gap-2",children:[e.jsx(Re,{className:"w-4 h-4"}),"Preview Personalized"]})}),B&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Preview (sample customer)"}),e.jsx("div",{className:"bg-green-500/5 border border-green-500/20 p-3 rounded-lg",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:B})})]})]})}),e.jsx(z,{value:"sends",children:e.jsx(c,{className:"p-0",children:E.length===0?e.jsx("div",{className:"p-8 text-center",children:e.jsx("p",{className:"text-sm text-muted",children:"No messages sent yet."})}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left text-xs font-medium text-muted px-4 py-3",children:"Customer"}),e.jsx("th",{className:"text-left text-xs font-medium text-muted px-4 py-3",children:"Phone"}),e.jsx("th",{className:"text-left text-xs font-medium text-muted px-4 py-3",children:"Status"}),e.jsx("th",{className:"text-left text-xs font-medium text-muted px-4 py-3",children:"Sent"}),e.jsx("th",{className:"text-left text-xs font-medium text-muted px-4 py-3",children:"Revenue"})]})}),e.jsx("tbody",{children:E.map(h=>e.jsxs("tr",{className:"border-b border-border last:border-0",children:[e.jsx("td",{className:"px-4 py-3 text-sm text-foreground",children:h.customerName??"--"}),e.jsx("td",{className:"px-4 py-3 text-sm text-muted",children:h.customerPhone}),e.jsx("td",{className:"px-4 py-3",children:Ue(h.status)}),e.jsx("td",{className:"px-4 py-3 text-xs text-muted",children:h.sentAt?new Date(h.sentAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"--"}),e.jsx("td",{className:"px-4 py-3 text-sm text-foreground",children:h.attributedRevenueCents?W(h.attributedRevenueCents):"--"})]},h.id))})]})})})})]})]})})}return e.jsx(P,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{i("list"),o(1),y(null)},className:"p-1.5 rounded-lg hover:bg-elevated transition-colors",children:e.jsx(Q,{className:"w-4 h-4 text-muted"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-foreground",children:t?`New Campaign: ${t.name}`:"Create Campaign"}),e.jsxs("p",{className:"text-sm text-muted mt-0.5",children:["Step ",p," of ",t?3:4]})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:(t?[1,2,3]:[1,2,3,4]).map(s=>{const l=t?["","Message","Audience","Review"]:["Template","Message","Audience","Review"],n=t?1:0;return e.jsxs("div",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-colors ${s+n===p+n?"bg-primary/10 text-primary-text border border-primary/30":s+n<p+n?"bg-green-500/10 text-green-400 border border-green-500/20":"text-muted border border-border"}`,children:[s+n<p+n?e.jsx(De,{className:"w-3 h-3"}):e.jsx("span",{className:"w-3 h-3 flex items-center justify-center text-[10px]",children:s}),l[s]]},s)})}),p===1&&!t&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Choose a starting point"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[U.map(s=>e.jsxs(c,{className:"p-4 cursor-pointer hover:border-primary/40 transition-colors",onClick:()=>I(s),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:s.name}),S(s.type)]}),e.jsx("p",{className:"text-xs text-muted mb-2",children:s.description}),e.jsx("p",{className:"text-xs text-green-400",children:s.expectedImpact})]},s.type)),e.jsx(c,{className:"p-4 cursor-pointer hover:border-primary/40 transition-colors border-dashed",onClick:()=>{y(null),o(2)},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-elevated flex items-center justify-center",children:e.jsx(G,{className:"w-5 h-5 text-muted"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Build from Scratch"}),e.jsx("p",{className:"text-xs text-muted",children:"Create a fully custom campaign"})]})]})})]})]}),p===2&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(c,{className:"p-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted mb-1 block",children:"Campaign Name"}),e.jsx(V,{value:N,onChange:s=>R(s.target.value),placeholder:"e.g., Estimate Follow-Up"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted mb-1 block",children:"Description (optional)"}),e.jsx(V,{value:w,onChange:s=>D(s.target.value),placeholder:"Brief description of this campaign"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted mb-1 block",children:"Message Template"}
6),e.jsx("textarea",{value:v,onChange:s=>C(s.target.value),placeholder:"Hi {{name}}, still thinking about that {{damageType}} repair...",rows:4,className:"w-full bg-elevated border border-border rounded-lg px-3 py-2 text-sm text-foreground placeholder:text-subtle focus:outline-none focus:ring-2 focus:ring-primary/40 resize-none"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:Ee.map(s=>e.jsx("button",{type:"button",onClick:()=>xe(s.key),className:"px-2 py-0.5 rounded text-[10px] font-medium bg-elevated border border-border text-muted hover:text-foreground hover:border-primary/30 transition-colors",children:s.label},s.key))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted mb-1 block",children:"Follow-up Template (optional)"}),e.jsx("textarea",{value:k,onChange:s=>A(s.target.value),placeholder:"Quick follow-up on your {{vehicle}} repair...",rows:3,className:"w-full bg-elevated border border-border rounded-lg px-3 py-2 text-sm text-foreground placeholder:text-subtle focus:outline-none focus:ring-2 focus:ring-primary/40 resize-none"})]})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(m,{variant:"secondary",onClick:()=>{t?i("list"):o(1)},children:"Back"}),e.jsx(m,{onClick:()=>o(3),disabled:!N||!v,children:"Next: Audience"})]})]}),p===3&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(c,{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Ae,{className:"w-5 h-5 text-muted"}),e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Audience"})]}),t?e.jsxs("div",{className:"bg-elevated p-3 rounded-lg border border-border",children:[e.jsxs("p",{className:"text-sm text-foreground mb-2",children:["Using template audience filter: ",e.jsx("strong",{children:t.name})]}),e.jsxs("ul",{className:"text-xs text-muted space-y-1",children:[t.audienceFilters.hasEstimate&&e.jsx("li",{children:"Has an estimate"}),t.audienceFilters.hasAppointment===!1&&e.jsx("li",{children:"Has not booked an appointment"}),t.audienceFilters.estimateAgeMinDays&&e.jsxs("li",{children:["Estimate is ",t.audienceFilters.estimateAgeMinDays,"+ days old"]}),t.audienceFilters.appointmentStatus&&e.jsxs("li",{children:["Appointment status: ",t.audienceFilters.appointmentStatus]}),t.audienceFilters.completedWithinDays&&e.jsxs("li",{children:["Completed within ",t.audienceFilters.completedWithinDays," days"]}),t.audienceFilters.lastRepairDaysAgo&&e.jsxs("li",{children:["Last repair ",t.audienceFilters.lastRepairDaysAgo,"+ days ago"]}),t.audienceFilters.reviewRatingMin&&e.jsxs("li",{children:["Review rating ",t.audienceFilters.reviewRatingMin,"+ stars"]}),e.jsx("li",{children:"Has phone number"})]})]}):e.jsxs("div",{className:"bg-elevated p-3 rounded-lg border border-border",children:[e.jsx("p",{className:"text-sm text-foreground",children:"All customers with a phone number will be eligible for this campaign."}),e.jsx("p",{className:"text-xs text-muted mt-1",children:"Compliance limits still apply: max 4 messages/customer/month, 7-day gap between campaigns."})]})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(m,{variant:"secondary",onClick:()=>o(2),children:"Back"}),e.jsx(m,{onClick:()=>o(4),children:"Next: Review"})]})]}),p===4&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(c,{className:"p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Review Campaign"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Name"}),e.jsx("p",{className:"text-sm text-foreground",children:N})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Type"}),S((t==null?void 0:t.type)??"custom")]}),w&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Description"}),e.jsx("p",{className:"text-sm text-foreground",children:w})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Message"}),e.jsx("div",{className:"bg-elevated p-3 rounded-lg border border-border",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:v})})]}),k&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:"Follow-up"}),e.jsx("div",{className:"bg-elevated p-3 rounded-lg border border-border",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:k})})]}),e.jsx("div",{className:"bg-blue-500/5 border border-blue-500/20 p-3 rounded-lg",children:e.jsxs("p",{className:"text-xs text-blue-400",children:[e.jsx("strong",{children:"Compliance:"})," Messages will only be sent during quiet hours (9am-8pm local time), with a maximum of 4 per customer per month and a 7-day gap between campaigns. Customers can opt out at any time by replying STOP."]})})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(m,{variant:"secondary",onClick:()=>o(3),children:"Back"}),e.jsxs(m,{onClick:ce,disabled:$,className:"gap-2",children:[e.jsx(Pe,{className:"w-4 h-4"}),$?"Creating...":"Create Campaign"]})]})]})]})})}export{Qe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.