1import{j as e,m as me,aX as $e,ao as bt,a5 as yt,k as vt,c as d,aq as ue,I as f,O as Fe,ah as jt,B as J,L as Nt,N as kt,U as St,ax as wt,s as Te,d as xe,l as Ct,a3 as At,S as Mt,af as Ie,a4 as Rt}from"./index-Daj28piR.js";import{r as l,L as Ee}from"./vendor-react-BahdI5Xr.js";import{D as Pe,O as Lt}from"./funnelRatesConfig-N5TeZS-5.js";import{H as $t,C as Ft,A as Tt}from"./hash-BYgXigxq.js";import{M as It}from"./mail-DR1jehPT.js";import{R as Et}from"./repeat-mHPP2-qt.js";import{T as _e}from"./trending-up-Tu8rB0rg.js";import{T as Pt,M as _t}from"./trending-down-BFfxh8c8.js";import{P as zt}from"./PublicFooter-Cfm4Ronl.js";import{A as Ot}from"./arrow-left-DCr738i3.js";import"./vendor-pdf-D46ffnHm.js";import"./vendor-charts-CFTq_AuP.js";import"./TrustBadges-B2YuNXXj.js";const ze=[{id:"live-webinar",label:"Live Webinar",desc:"Registration â attendance â pitch â sale"},{id:"automated-webinar",label:"Automated Webinar / VSL",desc:"Opt-in â watch â CTA â sale"},{id:"challenge",label:"5-Day Challenge",desc:"Sign-up â participation â offer â sale"},{id:"low-ticket",label:"Low-Ticket Funnel",desc:"Ad/opt-in â tripwire sale â upsell â backend offer"},{id:"lead-magnet",label:"Lead Magnet Funnel",desc:"Opt-in â nurture sequence â sale"}
1,{id:"book-funnel",label:"Book Funnel w/ Upsells",desc:"Book purchase â OTO1 â OTO2 â backend offer"}],Vt=()=>{var Se,we;const[g,X]=l.useState("estimate"),[z,Oe]=l.useState(""),[O,Ve]=l.useState(""),[k,Be]=l.useState(""),[Z,pe]=l.useState({}),[ee,De]=l.useState("3000"),[h,qe]=l.useState(!0),[ge,We]=l.useState(""),[he,Ue]=l.useState(""),[v,He]=l.useState("one-time"),[V,Ge]=l.useState("6"),[te,Ke]=l.useState("80"),[H,Qe]=l.useState("6"),[se,Ye]=l.useState("800"),[G,Je]=l.useState("20"),[ae,Xe]=l.useState("5000"),[Ze,et]=l.useState(Pe),[re,tt]=l.useState(Lt),[R,oe]=l.useState(null),[ne,fe]=l.useState({conservative:{},average:{},optimistic:{}}),[le,be]=l.useState(!1),[ie,st]=l.useState(!0),[S,at]=l.useState("average"),[K,rt]=l.useState("monthly");l.useEffect(()=>{(async()=>{try{const{data:s}=await Te.from("app_settings").select("key, value").in("key",["calculator_funnel_rates","calculator_organic_rates"]);if(s)for(const r of s){if(r.key==="calculator_funnel_rates"&&r.value){const n=r.value,o={...Pe};for(const[c,x]of Object.entries(n))o[c]&&(o[c]={...o[c],scenarios:x.scenarios??o[c].scenarios});et(o)}r.key==="calculator_organic_rates"&&r.value&&tt(r.value)}}catch{}})()},[]);const a=k?Ze[k]:null;l.useEffect(()=>{a!=null&&a.priceFields&&pe(t=>{const s={};for(const r of a.priceFields)s[r.key]=t[r.key]??r.defaultValue;return s})},[k]);const ye=t=>parseFloat(Z[t]||"0")||0,ot=async()=>{var t,s,r,n;if(!h){oe({scenarios:{conservative:{cpc:0,cpl:0},average:{cpc:0,cpl:0},optimistic:{cpc:0,cpl:0}}});return}if(!k){xe.error("Please select a marketing system type.");return}be(!0);try{const{data:o,error:c}=await Te.functions.invoke("generate-funnel-benchmarks",{body:{industry:ge||void 0,niche:he||void 0,funnel_type:((t=ze.find(x=>x.id===k))==null?void 0:t.label)||k}});if(c)throw c;if(o!=null&&o.error)throw new Error(o.error);if(Ct.log("Ad cost benchmarks received:",JSON.stringify(o)),!((s=o==null?void 0:o.scenarios)!=null&&s.conservative)||!((r=o==null?void 0:o.scenarios)!=null&&r.average)||!((n=o==null?void 0:o.scenarios)!=null&&n.optimistic))throw new Error("Invalid benchmark data structure received");oe(o),fe({conservative:{},average:{},optimistic:{}})}catch(o){console.error(o),xe.error(o.message||"Failed to generate ad cost benchmarks")}be(!1)},nt=()=>{if(!k){xe.error("Please select a marketing system type.");return}h?ot():oe({scenarios:{conservative:{cpc:0,cpl:0},average:{cpc:0,cpl:0},optimistic:{cpc:0,cpl:0}}})},ve=(t,s)=>s===(a==null?void 0:a.main_sale_stage)&&G?ne[t][s]??parseFloat(G)/100:ne[t][s]??(a==null?void 0:a.scenarios[t].rates[s])??0,je=t=>(R==null?void 0:R.scenarios[t].cpc)??0,lt=(t,s,r)=>{fe(n=>({...n,[t]:{...n[t],[s]:r}}))},Ne=t=>{var n;const s=ye(t),r=((n=a==null?void 0:a.priceFields[0])==null?void 0:n.key)===t;if(r&&v==="monthly"){const o=(parseFloat(te)||80)/100,c=parseFloat(H)||6;return o>=1?s*c:s*(1-Math.pow(o,c))/(1-o)}else if(r&&v==="payment-plan")return s*(parseInt(V)||1);return s},ce=t=>{if(!a||!R)return null;try{const s=h&&parseFloat(ee)||0,r=je(t),n=a.stages,o=n.map(i=>i.key),c=o.map(i=>ve(t,i)),x=o.indexOf(a.main_sale_stage),C=a.upsell_sale_stage?o.indexOf(a.upsell_sale_stage):-1,b=c.slice(0,x+1).reduce((i,m)=>i*m,1);let u=null,N=null,A=null;if(g==="buyer-goal")u=parseInt(O)||0,N=b>0?Math.ceil(u/b):0;else if(g==="revenue-goal"){const i=parseFloat(z)||0;let m=0;if(a.priceFields.length>0){const Y=c.slice(0,x+1).reduce((_,T)=>_*T,1);for(const _ of a.priceFields){const T=o.indexOf(_.revenueStage),pt=T>=0?c.slice(0,T+1).reduce((ht,ft)=>ht*ft,1):0,gt=Y>0?pt/Y:0;m+=Ne(_.key)*gt}}u=m>0?Math.ceil(i/m):0,N=b>0?Math.ceil(u/b):0}const B=parseFloat(se)||0,D=parseFloat(ae)||0,E=Math.round(B*re.list_rate+D*re.social_rate);let y,M;N!==null?(y=N,M=Math.max(0,y-E),A=r>0?M*r:0):(M=r>0?Math.round(s/r):s>0?100:0,y=M+E);let F=y;const p=[y],q={};n.forEach((i,m)=>{q[i.key]=m});for(let i=0;i<c.length;i++){const m=n[i];m.sourceStage&&q[m.sourceStage]!==void 0&&(F=p[q[m.sourceStage]+1]??0),F=Math.round(F*c[i]),p.push(F)}const W=a.priceFields,Ce={};n.forEach((i,m)=>{Ce[i.key]=m+1});let U=0;const Ae={};for(const i of W){const m=p[Ce[i.revenueStage]??-1]||0,Y=Math.round(m),_=Ne(i.key),T=Y*_;Ae[i.key]=T,U+=T}const dt=p[x+1]||0,de=Math.round(dt),P=A!==null?A:s,Me=U-P,mt=P>0?Me/P*100:U>0?1/0:0,ut=de>0?P/de:0,xt=y>0?U/y:0;let Q=0,Re=0;const Le=a.front_end_sale_stage;if(Le){const i=o.indexOf(Le);Q=i>=0?Math.round(p[i+1]||0):0,Re=Q>0?P/Q:0}return{leads:y,leadsFromAds:M,leadsFromList:E,stageVolumes:p,sales:de,frontEndSales:Q,frontEndCpa:Re,revenueBreakdown:Ae,totalRevenue:U,adSpend:P,profit:Me,roi:mt,cpa:ut,revenuePerLead:xt,requiredAdSpend:A,requiredLeads:N,targetSales:u,mainSalesIdx:x,upsellSalesI
1dx:C}}catch(s){return console.error("calcResults error for scenario",t,s),null}},I=l.useMemo(()=>!a||!R?null:{conservative:ce("conservative"),average:ce("average"),optimistic:ce("optimistic")},[a,R,ne,Z,ee,h,v,te,H,V,se,ae,G,g,z,O,re]),j=K==="monthly"?1:K==="quarterly"?3:12,it={conservative:Pt,average:_t,optimistic:_e},ke={conservative:"text-orange-400",average:"text-primary",optimistic:"text-emerald-400"},w=t=>{const s=Math.abs(t),r=t<0?"-":"";return s>=1e6?`${r}$${(s/1e6).toFixed(1)}M`:s>=1e3?`${r}$${(s/1e3).toFixed(1)}K`:`${r}$${s.toFixed(0)}`},L=t=>{const s=Math.abs(t);return`${t<0?"-":""}$${s.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`},$=t=>Math.round(t).toLocaleString(),ct=le||!k||(g==="revenue-goal"&&!z||g==="buyer-goal"&&!O);return e.jsxs(me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"rounded-2xl bg-card shadow-card overflow-hidden",children:[e.jsxs("button",{onClick:()=>st(!ie),className:"w-full flex items-center justify-between p-5 hover:bg-secondary/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx($e,{className:"text-primary",size:18})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h2",{className:"font-bold text-foreground text-sm",children:"Marketing System Calculator"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Estimate revenue across different marketing system types"})]})]}),ie?e.jsx(bt,{size:16,className:"text-muted-foreground"}):e.jsx(yt,{size:16,className:"text-muted-foreground"})]}),e.jsx(vt,{children:ie&&e.jsx(me.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3},className:"overflow-hidden",children:e.jsxs("div",{className:"px-5 pb-5 space-y-5",children:[e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-2 block",children:"What do you want to calculate?"}),e.jsx("div",{className:"grid grid-cols-3 gap-1 p-1 bg-secondary/50 rounded-lg",children:[{id:"estimate",label:"Estimate Results",icon:$e,desc:"Forward projection using real-world averages"},{id:"revenue-goal",label:"Revenue Goal",icon:ue,desc:"Reverse-engineer from a target revenue"},{id:"buyer-goal",label:"Buyer Goal",icon:$t,desc:"Reverse-engineer from desired # of buyers"}].map(t=>e.jsxs("button",{onClick:()=>X(t.id),className:`flex flex-col items-center gap-1 text-xs font-medium py-3 px-3 rounded-md transition-all ${g===t.id?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(t.icon,{size:15}),e.jsx("span",{children:t.label})]},t.id))})]}),g==="revenue-goal"&&e.jsxs("div",{className:"p-3 rounded-xl bg-primary/5 border border-primary/20",children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Monthly Revenue Goal ($)"}),e.jsx(f,{type:"number",placeholder:"50000",value:z,onChange:t=>Oe(t.target.value)}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"We'll calculate how many leads, ad spend, and sales you need to hit this target"})]}),g==="buyer-goal"&&e.jsxs("div",{className:"p-3 rounded-xl bg-primary/5 border border-primary/20",children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"# of New Buyers Desired (Monthly)"}),e.jsx(f,{type:"number",placeholder:"20",value:O,onChange:t=>Ve(t.target.value)}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"We'll reverse-engineer the leads, ad spend, and system metrics needed"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Fe,{size:14,className:"text-primary"}),e.jsx(d,{className:"text-xs font-semibold text-foreground",children:"Your Business"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Industry"}),e.jsx(f,{type:"text",placeholder:"e.g. Health & Wellness, Real Estate, SaaS",value:ge,onChange:t=>We(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Niche / Target Audience"}),e.jsx(f,{type:"text",placeholder:"e.g. Female entrepreneurs, B2B tech founders",value:he,onCh
1ange:t=>Ue(t.target.value)})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(It,{size:14,className:"text-primary"}),e.jsx(d,{className:"text-xs font-semibold text-foreground",children:"Existing Business Assets"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 p-3 rounded-xl bg-secondary/20 border border-border/50",children:[e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Total Contact / Email List"}),e.jsx(f,{type:"number",placeholder:"800",value:se,onChange:t=>Ye(t.target.value)}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Email list, CRM contacts, past clients"})]}),e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Avg. Close Rate (%)"}),e.jsx(f,{type:"number",placeholder:"20",value:G,onChange:t=>Je(t.target.value),min:"0",max:"100"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"% of opportunities that become buyers"})]}),e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Social Media Following"}),e.jsx(f,{type:"number",placeholder:"5000",value:ae,onChange:t=>Xe(t.target.value)}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Combined across all platforms"})]})]})]}),e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-2 block",children:"Marketing System Type"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:ze.map(t=>e.jsxs("button",{onClick:()=>Be(t.id),className:`text-left p-3 rounded-xl border transition-all text-xs ${k===t.id?"border-primary bg-primary/5 shadow-sm":"border-border bg-secondary/20 hover:border-muted-foreground/30"}`,children:[e.jsx("span",{className:"font-medium text-foreground block",children:t.label}),e.jsx("span",{className:"text-muted-foreground text-[10px] leading-tight block mt-0.5",children:t.desc})]},t.id))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ue,{size:14,className:"text-primary"}),e.jsx(d,{className:"text-xs font-semibold text-foreground",children:"Pricing"})]}),e.jsx("div",{className:`grid grid-cols-1 ${(((Se=a==null?void 0:a.priceFields)==null?void 0:Se.length)||0)>2?"md:grid-cols-2 lg:grid-cols-4":"md:grid-cols-2"} gap-4`,children:((a==null?void 0:a.priceFields)||[{key:"offer",label:"Offer Price ($)",placeholder:"997",defaultValue:"997",revenueStage:""},{key:"upsell",label:"Upsell / Downsell Price ($)",placeholder:"297",defaultValue:"297",revenueStage:""}]).map((t,s)=>e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:s===0&&v==="monthly"?"Monthly Price ($)":s===0&&v==="payment-plan"?"Payment Amount ($)":t.label}),e.jsx(f,{type:"number",placeholder:t.placeholder,value:Z[t.key]||"",onChange:r=>pe(n=>({...n,[t.key]:r.target.value}))})]},t.key))}),e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Payment Type"}),e.jsx("div",{className:"grid grid-cols-3 gap-1 p-1 bg-secondary/50 rounded-lg",children:[{id:"one-time",label:"One-Time",icon:jt},{id:"monthly",label:"Monthly Recurring",icon:Et},{id:"payment-plan",label:"Payment Plan",icon:Ft}].map(t=>e.jsxs("button",{onClick:()=>He(t.id),className:`flex items-center justify-center gap-1.5 text-xs font-medium py-2.5 px-3 rounded-md transition-all ${v===t.id?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(t.icon,{size:13}),t.label]},t.id))})]}),v==="monthly"&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-3 rounded-xl bg-secondary/20 border border-border/50",children:[e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Stick Rate (%)"}),e.jsx(f,{type:"number",placeholder:"80",value:te,onChange:t=>Ke(t.target.value),min:"0",max:"100"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"% of clients who continue paying each month"})]}),e.jsxs("div",{children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Avg. Months Retained"}),e.jsx(f,{type:"number",placeholder:"6",value:H,onChange:t=>Qe(t.target.value),min:"1"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"How long you model customer retention"})]})]}),v==="payment-plan"&&e.jsx("div",{className:"p-3 rounded-xl bg-secondary/20 border border-border/50",children:e.jsxs("div",{className:"max-w-xs",children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Number of Payments"}),e.jsx(f,{type:"number",placeholder:"6",value:V,onChange:t=>Ge(t.target.value),min:"1"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Total value: ",w(ye(((we=a==null?void 0:a.priceFields[0])==null?void 0:we.key)||"offer")*(parseInt(V)||1))]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{className:"text-xs font-semibold text-foreground",children:"Running Paid Ads?"}),e.jsx("button",{onClick:()=>
1qe(!h),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${h?"bg-primary":"bg-secondary"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-background transition-transform ${h?"translate-x-6":"translate-x-1"}`})})]}),h&&e.jsxs("div",{className:"p-3 rounded-xl bg-secondary/20 border border-border/50",children:[e.jsx(d,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Monthly Ad Spend ($)"}),e.jsx(f,{type:"number",placeholder:"3000",value:ee,onChange:t=>De(t.target.value)}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Paid leads will be combined with your organic assets above"})]})]}),e.jsxs(J,{onClick:nt,disabled:ct,className:"w-full gap-2",children:[le?e.jsx(Nt,{size:16,className:"animate-spin"}):e.jsx(kt,{size:16}),le?"Fetching Ad Cost Benchmarksâ¦":h?"Generate AI Ad Cost Benchmarks":"Calculate Results"]}),a&&R&&I&&e.jsxs(me.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-5",children:[e.jsx("div",{className:"flex gap-1 p-1 rounded-xl bg-secondary/40",children:["conservative","average","optimistic"].map(t=>{const s=it[t];return e.jsxs("button",{onClick:()=>at(t),className:`flex-1 flex items-center justify-center gap-1.5 py-2 rounded-lg text-xs font-medium transition-all capitalize ${S===t?"bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(s,{size:13,className:ke[t]}),t]},t)})}),e.jsx("div",{className:"flex gap-1 justify-end",children:["monthly","quarterly","annual"].map(t=>e.jsx("button",{onClick:()=>rt(t),className:`px-3 py-1 rounded-lg text-[10px] font-medium transition-colors capitalize ${K===t?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground"}`,children:t},t))}),(()=>{const t=I[S];if(!t)return null;const s=[{label:"Revenue",value:w(t.totalRevenue*j),icon:ue,color:"text-emerald-400"},{label:"Profit",value:w(t.profit*j),icon:_e,color:t.profit>=0?"text-emerald-400":"text-destructive"},{label:"ROI",value:t.roi===1/0?"â":`${t.roi.toFixed(0)}%`,icon:Fe,color:"text-primary"},{label:"Sales",value:$(t.sales*j),icon:St,color:"text-blue-400"}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:s.map(r=>e.jsxs("div",{className:"rounded-xl bg-secondary/30 p-3.5 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(r.icon,{size:12,className:r.color}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:r.label})]}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:r.value})]},r.label))})})(),g!=="estimate"&&(()=>{const t=I[S];return t?e.jsxs("div",{className:"rounded-xl bg-primary/5 p-4 border border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Tt,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-xs font-semibold text-foreground",children:g==="revenue-goal"?`To hit ${w(parseFloat(z)||0)}/mo revenue`:`To get ${O||0} new buyers/mo`})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"rounded-lg bg-background p-3 border border-border/50",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground block mb-1",children:"Required Leads"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:$(t.requiredLeads??t.leads)})]}),e.jsxs("div",{className:"rounded-lg bg-background p-3 border border-border/50",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground block mb-1",children:h?"Leads from Ads":"Additional Leads Needed"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:$(t.leadsFromAds)})]}),e.jsxs("div",{className:"rounded-lg bg-background p-3 border border-border/50",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground block mb-1",children:h?"Est. Ad Spend Needed":"Equiv. Ad Spend"}),e.jsx("span",{className:"text-lg font-bold text-primary",children:w(t.requiredAdSpend??t.adSpend)}),!h&&e.jsx("p",{className:"text-[9px] text-muted-foreground mt-0.5",children:"If you ran ads instead"})]}),e.jsxs("div",{className:"rounded-lg bg-background p-3 border border-border/50",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground block mb-1",children:"Organic Leads"}),e.jsx("span",{className:"text-lg font-bold text-emerald-400",children:$(t.leadsFromList)})]})]})]}):null})(),e.jsxs("div",{className:"rounded-xl bg-secondary/20 p-4 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(wt,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-xs font-semibold text-foreground",children:"System Breakdown"})]}),e.jsx("div",{className:"space-y-2",children:a.stages.map((t,s)=>{const r=t.key,n=I[S];if(!n)return null;
1s===n.mainSalesIdx||n.upsellSalesIdx;const o={};a.stages.forEach((b,u)=>{o[b.key]=u});const c=(t.sourceStage&&o[t.sourceStage]!==void 0?n.stageVolumes[o[t.sourceStage]+1]:n.stageVolumes[s])??0,x=n.stageVolumes[s+1]??0,C=ve(S,r);return e.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-foreground font-medium truncate",children:t.name}),e.jsxs("span",{className:"text-muted-foreground",children:[$(c*j)," â ",$(x*j)]})]}),e.jsx("div",{className:"w-full bg-secondary/60 rounded-full h-1.5",children:e.jsx("div",{className:"bg-primary/70 h-1.5 rounded-full transition-all",style:{width:`${Math.min(C*100,100)}%`}})})]}),e.jsx("div",{className:"w-16 flex-shrink-0",children:(()=>{const b=t.warnThreshold??.8,u=C>b;return e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"number",min:0,max:100,value:Math.round(C*100),onChange:N=>{const A=parseFloat(N.target.value),B=Math.min(Math.max(A||0,0),100);lt(S,r,B/100)},className:`w-full h-7 rounded-md bg-background px-2 text-xs text-center text-foreground border outline-none transition-colors ${u?"border-amber-400 focus:border-amber-500":"border-border focus:border-primary"}`,title:u?`Rates above ${Math.round(b*100)}% are uncommon for ${t.name}`:void 0}),e.jsx("span",{className:"text-[9px] text-muted-foreground text-center block",children:"%"}),u&&e.jsx("span",{className:"text-[8px] text-amber-500 text-center block leading-tight",children:"High"})]})})()})]},r)})})]}),(()=>{var E,y,M,F;const t=I[S];if(!t)return null;const s=je(S),r=v==="monthly"?`LTV per Client (${H}mo)`:v==="payment-plan"?`Total per Client (${V}x)`:"Revenue per Sale",n=t.sales>0?t.totalRevenue/t.sales:0,o=t.leads>0?t.adSpend/t.leads:0,c=((y=(E=a==null?void 0:a.stages)==null?void 0:E[0])==null?void 0:y.name)||"Lead",x=((M=t.stageVolumes)==null?void 0:M[1])||0,C=x>0?t.adSpend/x:0,b=[{label:"Cost per Click (Ads)",value:s>0?L(s):"Organic"},{label:"Visitors from Ads",value:`${(t.leadsFromAds*j).toLocaleString()}`},{label:"Organic Visitors",value:`${(t.leadsFromList*j).toLocaleString()}`},{label:"Total Visitors",value:`${(t.leads*j).toLocaleString()}`},{label:"Cost per Visitor (All)",value:o>0?L(o):"â"}],u=a==null?void 0:a.front_end_sale_stage,N=u?((F=a==null?void 0:a.stages.find(p=>p.key===u))==null?void 0:F.name)||"Front-End Buyer":null,A=[{label:`Cost per ${c}`,value:C>0?L(C):"â"},...N?[{label:`Cost per ${N}`,value:t.frontEndCpa>0?L(t.frontEndCpa):"â"}]:[],{label:"Cost per Acquisition (CAC)",value:t.cpa>0?L(t.cpa):"â"}],B=[{label:"Revenue per Visitor",value:L(t.revenuePerLead)},{label:r,value:L(n)},...((a==null?void 0:a.priceFields)||[]).map(p=>({label:`${p.label.replace(" ($)","")} Revenue`,value:w((t.revenueBreakdown[p.key]||0)*j)}))],D=(p,q)=>e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:p}),q.map(W=>e.jsxs("div",{className:"flex justify-between text-xs py-1 border-b border-border/30 last:border-0",children:[e.jsx("span",{className:"text-muted-foreground",children:W.label}),e.jsx("span",{className:"text-foreground font-medium",children:W.value})]},W.label))]});return e.jsxs("div",{className:"rounded-xl bg-secondary/20 p-4 border border-border/50",children:[e.jsx("h3",{className:"text-xs font-semibold text-foreground mb-4",children:"Marketing Money Math"}),e.jsxs("div",{className:"space-y-5",children:[D("Traffic",b),D("Conversion Costs",A),D("Revenue",B)]})]})})(),e.jsxs("div",{className:"rounded-xl bg-secondary/20 p-4 border border-border/50 overflow-x-auto",children:[e.jsxs("h3",{className:"text-xs font-semibold text-foreground mb-3",children:["Scenario Comparison (",K,")"]}),e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted-foreground border-b border-border/40",children:[e.jsx("th",{className:"text-left py-2 font-medium",children:"Metric"}),["conservative","average","optimistic"].map(t=>e.jsx("th",{className:`text-right py-2 font-medium capitalize ${ke[t]}
1`,children:t},t))]})}),e.jsx("tbody",{children:[{label:"Revenue",key:"totalRevenue",format:w},{label:"Profit",key:"profit",format:w},{label:"Sales",key:"sales",format:t=>$(t)},{label:"ROI",key:"roi",format:t=>t===1/0?"â":`${t.toFixed(0)}%`}].map(t=>e.jsxs("tr",{className:"border-b border-border/20",children:[e.jsx("td",{className:"py-2 text-muted-foreground",children:t.label}),["conservative","average","optimistic"].map(s=>{const r=I[s],n=r?r[t.key]:0,o=t.key==="roi"?1:j;return e.jsx("td",{className:"py-2 text-right text-foreground font-medium",children:t.format(n*o)},s)})]},t.label))})]})]})]})]})})})]})},ts=()=>{const{isWhiteLabeled:g}=At(),X=[{"@type":["SoftwareApplication","WebApplication"],"@id":"https://marketerprompts.com/calculator/#tool",name:"Marketing Funnel Calculator by Be Known, LLC",applicationCategory:"BusinessApplication",applicationSubCategory:"MarketingApplication",operatingSystem:"Web",url:"https://marketerprompts.com/calculator",producer:{"@id":"https://beknownonline.com/#org"},offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},description:"Free marketing funnel calculator that models conversion rates, cost per lead, and revenue projections across six standardized funnel types (Live Webinar, Auto Webinar/VSL, and more) with AI-powered industry benchmarks.",featureList:["Six funnel types modeled (Live Webinar, Auto Webinar/VSL, Application, Low-Ticket, High-Ticket, Newsletter)","AI-powered industry benchmark suggestions","Cost per lead, cost per show, cost per close","Revenue and ROAS projections","Free â no signup required"]},{"@type":"FAQPage",mainEntity:[{"@type":"Question",name:"How do I calculate marketing funnel conversion rates?",acceptedAnswer:{"@type":"Answer",text:"Conversion rate at each funnel stage = (people who advanced to the next stage) ÷ (people who entered the current stage) à 100. Typical webinar funnels see 30â50% registration-to-show, 5â15% show-to-sale, and 1â3% top-of-funnel-click-to-sale. The free Marketing Funnel Calculator at marketerprompts.com/calculator models all of these for six funnel types."}},{"@type":"Question",name:"What's a good cost per lead for a coaching or consulting funnel?",acceptedAnswer:{"@type":"Answer",text:"For coaching and consulting webinar funnels in 2026, a healthy cost per registration is typically $8â$25 on Meta and $15â$40 on YouTube depending on niche, offer price, and creative quality. Higher-ticket offers ($5K+) can profitably absorb $50â$100+ cost per lead. Use the Marketing Funnel Calculator to model your specific economics."}},{"@type":"Question",name:"How much should I spend on ads to launch a webinar funnel?",acceptedAnswer:{"@type":"Answer",text:"A reliable test budget is 3â5x the price of your offer per day, run for at least 7â14 days. For a $1,000 offer that means $3,000â$7,000 across the test window. The funnel calculator shows you the exact ad spend required to hit a given revenue target based on your assumed conversion rates."}},{"@type":"Question",name:"Is the Marketing Funnel Calculator free?",acceptedAnswer:{"@type":"Answer",text:"Yes. The funnel calculator is 100% free, requires no signup, and gives you immediate access to AI-suggested industry benchmarks for six standardized funnel types."}}]}];return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Mt,{title:"Free Marketing Funnel Calculator | Be Known, LLC",description:"Calculate your marketing funnel metrics â conversion rates, cost per lead, revenue projections. Free tool for coaches and consultants.",canonical:"https://marketerprompts.com/calculator",breadcrumbs:[{name:"Home",url:"https://marketerprompts.com/"},{name:"Funnel Calculator",url:"https://marketerprompts.com/calculator"}],jsonLd:X}),e.jsx("header",{className:"border-b border-border bg-card/80 backdrop-blur-sm sticky top-0 z-30",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-3 flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs(Ee,{to:"/dashboard",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Ot,{size:16}),e.jsx("span",{className:"font-semibold text-foreground tracking-tight",children:"Marketing Tools Dashboard"})]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[!g&&e.jsx("a",{href:"https://beknownonline.com/start",target:"_blank",rel:"noopener noreferrer",children:e.jsxs(J,{size:"sm",className:"gap-1.5 text-xs",children:[e.jsx(Ie,{size:14}),"We'll Build It For You"]})}),e.jsx(Rt,{})]})]})}),e.jsxs("main",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground tracking-tight",style:{letterSpacing:"-0.03em"},children:"Marketing System Calculator"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Model potential outcomes for your one-to-many marketing systems with AI-powered industry benchmarks."})]}),e.jsx(Vt,{}),e.jsxs("div",{className:"mt-10 rounded-2xl bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 p-6 sm:p-8 text-center",children:[e.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Let our team build it for you"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-5 max-w-lg mx-auto",children:"Skip the guesswork - our full-service marketing team handles your marketing systems, ads, copy, design, and tech setup so you can focus on closing deals"}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[e.jsx("a",{href:"https://beknownonline.com/start",target:"_blank",rel:"noopener noreferrer",children:e.jsxs(J,{size:"lg",className:"gap-2",children:[e.jsx(Ie,{size:16}),"Get Started Now"]})}),e.jsx(Ee,{to:"/pricing",children:e.jsx(J,{variant:"outline",size:"lg",children:"View Pricing Plans"})})]})]})]}),e.jsx(zt,{})]})};export{ts 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.