PageSourceSearch

https://atzuma.co.il/assets/SimulatorTab-DHJgpjQp.js

js atzuma.co.il collected 2026-09-24 21:11:00 UTC 26,447 bytes, 13 lines download raw bytes

1import{j as e}from"./index-BtgGoHYl.js";import{r as n}from"./router-BXL9ASSk.js";import{a as Z,b as ee,S as je,M as E}from"./consoleUi-IZsRkTdl.js";import{c as oe}from"./createLucideIcon-0jETPTlQ.js";import{S as we}from"./shield-check-BYF1_51M.js";import{A as ve}from"./alert-triangle-dzMD7fwt.js";import{L as Ne}from"./layers-CYmH_g14.js";import{D as ke}from"./download-BHnnZ1yJ.js";import{S as Se}from"./save-y-r7PvMF.js";import{D as Pe}from"./dollar-sign-C817x2by.js";import{U as Te}from"./users-B9Vi1TvT.js";import"./vendor-BNcAc9ko.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"[email protected]"}}catch{}})();try{(function(){var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new r.Error().stack;c&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[c]="20dec3c7-30f3-4b7f-9c00-9cef7e0d985d",r._sentryDebugIdIdentifier="sentry-dbid-20dec3c7-30f3-4b7f-9c00-9cef7e0d985d")})()}catch{}const te=oe("Columns",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"12",x2:"12",y1:"3",y2:"21",key:"1efggb"}]]),M=oe("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),B=async(r,c)=>{const h=localStorage.getItem("auth_token"),m=await fetch(r,{...c,headers:{Authorization:`Bearer ${h}`,Accept:"application/json",...c?.body?{"Content-Type":"application/json"}:{},...c?.headers}});if(!m.ok)throw new Error(`Request failed (${m.status})`);return m.json()},Re=()=>B("/api/v1/admin/simulator/histogram"),se=()=>B("/api/v1/admin/simulator/project",{method:"POST",body:JSON.stringify({mode:"current"})}),ae=(r,c)=>B("/api/v1/admin/simulator/project",{method:"POST",body:JSON.stringify({mode:"score",bands:r,payerFloor:c})}),Ce=r=>B("/api/v1/admin/simulator/optimize",{method:"POST",body:JSON.stringify({weights:r})}),le=async(r,c)=>{const h=localStorage.getItem("auth_token"),m=await fetch(r,{...c,headers:{Authorization:`Bearer ${h}`,Accept:"application/json",...c?.body?{"Content-Type":"application/json"}:{},...c?.headers}});if(!m.ok){const g=await m.json().catch(()=>null);throw new Error(g?.error??`Request failed (${m.status})`)}return m.json()},re=()=>le("/api/v1/admin/policy-versions"),De=(r,c,h,m)=>le("/api/v1/admin/policy-versions",{method:"POST",body:JSON.stringify({name:r,note:c,config:h,projection_snapshot:m})}),Ae=({result:r,loading:c})=>{if(c)return e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-violet-200 p-4 text-[12.5px] text-slate-400",children:"Searching for the recommended split…"});if(!r.ready)return e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 text-[12.5px] text-slate-400",children:"Recommended split needs tonight's precompute first."});if(r.error)return e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-amber-200 p-4 text-[12.5px] text-amber-700",children:r.error});const h=r.confidence?.extrapolation_flags??[];return e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-violet-200 p-4",children:[e.jsxs("div",{className:"text-[13px] font-semibold text-slate-700 mb-2 inline-flex items-center gap-1.5",children:[e.jsx(M,{className:"w-4 h-4 text-violet-500"})," Why this split — chosen from history"]}),e.jsx("ul",{className:"space-y-1 text-[12.5px] text-slate-600 list-disc list-inside mb-3",children:(r.explanation?.drivers??[]).map((m,g)=>e.jsx("li",{children:m},g))}),e.jsxs("div",{className:"pt-2 border-t border-slate-100",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400 mb-1.5",children:"Confidence"}),h.length===0?e.jsxs("div",{className:"text-[12px] text-emerald-700 inline-flex items-start gap-1.5",children:[e.jsx(we,{className:"w-3.5 h-3.5 flex-none mt-0.5"})," Every recommended quota is within the range these groups were historically sent — no extrapolation."]}):e.jsx("ul",{className:"space-y-1 text-[12px] text-amber-700",children:h.map((m,g)=>e.jsxs("li",{className:"inline-flex items-start gap-1.5",children:[e.jsx(ve,{className:"w-3.5 h-3.5 flex-none mt-0.5"})," ",m]},g))})]}),e.jsxs("div",{className:"pt-2 mt-2 border-t border-slate-100 text-[11px] text-slate-400",children:[r.confidence?.note," Drag it, edit it, save it as a draft, or compare it — nothing auto-applies.",r.search&&e.jsxs("span",{className:"block mt-0.5",children:["Evaluated ",r.search.candidates_evaluated.toLocaleStr
1ing()," candidate policies · ",r.search.structure]})]})]})},i=r=>Math.round(r).toLocaleString(),S=r=>"₪"+Math.round(r).toLocaleString(),H={gal:{label:"Gal original",payerFloor:!1,note:"Pure engagement tiers — value-blind. Reproduces the report’s policy-C.",bands:[{id:"T0",lo:0,quota:0},{id:"T2",lo:.1,quota:2},{id:"T4",lo:3.2,quota:4},{id:"T5",lo:6,quota:5}]},optionb:{label:"Option B (hybrid)",payerFloor:!0,note:"Gal tiers + payer floor (payers min 2/wk) + blocked gate + new-user rule.",bands:[{id:"T0",lo:0,quota:0},{id:"T2",lo:.1,quota:2},{id:"T4",lo:3.2,quota:4},{id:"T5",lo:6,quota:5}]}},Ee={T0:"#94a3b8",T1:"#64748b",T2:"#60a5fa",T4:"#818cf8",T5:"#4f46e5",NEW:"#f59e0b",blocked:"#cbd5e1"},ne=r=>["#94a3b8","#60a5fa","#818cf8","#4f46e5","#7c3aed"][r]??"#94a3b8",$=r=>e.jsx("span",{className:"ml-1 cursor-help text-slate-400 border-b border-dotted border-slate-400 text-[11px]",title:r,children:"?"}),$e=({bins:r,bands:c,onMove:h})=>{const v=(r??[]).filter(o=>o.lo<=8),k=Math.max(1,...v.map(o=>o.n)),p=o=>24+o/8*572,N=[...c].sort((o,u)=>o.lo-u.lo),[w,j]=n.useState(null),d=o=>u=>{u.preventDefault(),j(o)},q=n.useCallback(o=>{if(!w)return;const u=o.currentTarget.getBoundingClientRect(),a=Math.max(.1,Math.min(8,(o.clientX-u.left-24)/572*8));h(w,Math.round(a*10)/10)},[w,h]);return e.jsxs("svg",{width:"100%",viewBox:"0 0 620 176",className:"select-none touch-none",onPointerMove:q,onPointerUp:()=>j(null),onPointerLeave:()=>j(null),children:[N.map((o,u)=>{const a=u+1<N.length?N[u+1].lo:8;return e.jsx("rect",{x:p(o.lo),y:24,width:Math.max(0,p(a)-p(o.lo)),height:126,fill:ne(u),opacity:.06},o.id)}),v.map(o=>{const u=o.n/k*118;return e.jsx("rect",{x:p(o.lo),y:150-u,width:572/(8/.1)-.5,height:u,fill:"#93c5fd",opacity:.9},o.lo)}),N.filter(o=>o.lo>0).map(o=>e.jsxs("g",{onPointerDown:d(o.id),className:"cursor-ew-resize",children:[e.jsx("line",{x1:p(o.lo),y1:18,x2:p(o.lo),y2:150,stroke:"#4f46e5",strokeWidth:w===o.id?2.5:1.5}),e.jsx("rect",{x:p(o.lo)-16,y:4,width:32,height:15,rx:3,fill:"#4f46e5"}),e.jsx("text",{x:p(o.lo),y:15,fontSize:"10",fill:"#fff",textAnchor:"middle",fontWeight:"700",children:o.lo})]},o.id)),[0,2,4,6,8].map(o=>e.jsxs("text",{x:p(o),y:166,fontSize:"9",fill:"#94a3b8",textAnchor:"middle",children:[o,o===8?"+":""]},o)),e.jsx("text",{x:620/2,y:176,fontSize:"9",fill:"#64748b",textAnchor:"middle",children:"engagement score (open=1, click=3, 45-day half-life) — score-0 pile shown separately, left"})]})},Me=({embedded:r=!1})=>{const[c,h]=n.useState(H.optionb.bands.map(t=>({...t}))),[m,g]=n.useState(!0),[y,P]=n.useState("optionb"),[v,k]=n.useState(null),[p,N]=n.useState(null),[w,j]=n.useState(null),[d,q]=n.useState(null),[o,u]=n.useState(null),[a,ie]=n.useState(null),[ce,F]=n.useState(!1),R=n.useRef(null),[de,G]=n.useState([]),[I,U]=n.useState(!1),z=n.useCallback(()=>{re().then(t=>G(t.versions.filter(s=>s.status!=="archived"))).catch(()=>G([]))},[]);n.useEffect(z,[z]);const[C,xe]=n.useState({signatures:1,revenue:1,unsub_penalty:1}),[J,me]=n.useState(null),[L,Q]=n.useState(!1),[pe,he]=n.useState(!1),V=n.useCallback(t=>{Q(!0),Ce(t).then(s=>{me(s),s.ready&&s.bands&&(h(s.bands.map(l=>({...l}))),g(s.payer_floor??!0),P("Custom"),j(null),k("Recommended split"))}).catch(s=>u(String(s.message??s))).finally(()=>Q(!1))},[]),O=n.useCallback(t=>{j(t),P("Custom"),k(null),t.config.mode==="score"&&t.config.bands&&(h(t.config.bands.map(s=>({...s}))),g(t.config.payer_floor??!0))},[]);n.useEffect(()=>{const t=new URLSearchParams(window.location.search),s=t.get("policy"),l=t.get("policyA"),x=t.get("policyB");!s&&!(l&&x)||re().then(({versions:T})=>{const f=b=>T.find(A=>String(A.id)===b);if(s){const b=f(s);b&&O(b)}else if(l&&x){const b=f(l),A=f(x);A&&O(A),b&&b.config.mode==="score"&&b.config.bands?ae(b.config.bands,b.config.payer_floor??!0).then(_=>N({name:b.name,scenario:_})):b&&se().then(_=>N({name:b.name,scenario:_}))}}).catch(()=>{})},[]);const ue=()=>{if(!a||y==="current")return;const t=window.prompt('Draft name (e.g. "Vocabulary-2026-07"):',w?.name??"");if(!t)return;U(!0);const s={mode:"score",bands:c,payer_floor:m},l={excess:a.excess,sigsRisk:a.sigsRisk,revRisk:a.revRisk,payersBelow2:a.payersBelow2,projWeeklyTotal:a.projWeeklyTotal};De(t,null,s,l).then(x=>{j(x.version),z()}).catch(x=>window.alert("Save failed: "+(x.message??x))).finally(()=>U(!1))};n.useEffect(()=>{Re().then(q).catch(t=>u(String(t.message??t)))},[]);const Y=n.useCallback((t,s,l)=>{F(!0),(t==="current"?se():ae(s,l)).then(ie).catch(T=>u(String(T.message??T))).finally(()=>F(!1))},[]);n.useEffect(()=>(R.current&&clearTimeout(R.current),R.current=setTimeout(()=>Y(y,c,m),200),()=>{R.current&&clearTimeout(R.current)}),[y,c,m,Y]);const be=t=>{if(P(t),k(null),t==="current")return;const s=H[t];h(s.bands.map(l=>({...l}))),g(s.payerFloor)},fe=(t,s)=>{h(l=>l.map(x=>x.id===t?{...x,lo:s}:x)),P("Custom"),j(null),k(null)},ge=(t,s)=>{h(l=>l.map(x=>x.id===t?{...x,quota:Math.max(0,Math.min(7,s))}:x)),P("Custom"),j(null),k(null)},W=y==="current"?"Current policy":v||(w?w.name:y==="Custom"?"Custom"
1:H[y].label),K=n.useMemo(()=>{if(!d?.histogram||!d.zeroPile||!d.weeks)return 0;const t=d.histogram.reduce((s,l)=>s+l.sumActual,0)+d.zeroPile.sumActual;return Math.round(t/d.weeks)},[d]),X=n.useMemo(()=>a?Object.entries(a.groups).map(([t,s])=>({id:t,...s})):[],[a]),ye=()=>{if(!a)return;const t=X.map(l=>`| ${l.id} | ${i(l.n)} | ${l.quota}/wk | ${i(l.projWeekly)} | ${l.erosionUnsub1k??"—"} |`).join(`
2`),s=`# Scenario: ${W}
3
4Projected weekly volume: ${i(a.projWeeklyTotal)} (actual last-180d avg: ${i(K)})
5
6| Group | People | Quota | Proj weekly | Unsub/1k |
7|---|---|---|---|---|
8${t}
9
10**Risk (cost of enforcing):** ${i(a.excess)} excess sends · ${i(a.sigsRisk)} signatures at risk · ${S(a.revRisk)} Hero revenue at risk · ${i(a.payersBelow2)} payers below 2/wk (${S(a.payersBelow2Rev)}/12mo).`;window.alert(`Export (markdown) — in the build this downloads a .md/.csv:
11
12`+s)},D=({label:t,val:s,base:l,money:x,good:T})=>{const f=l!=null?s-l:null,b=f!=null&&(T==="low"&&f>0||T==="high"&&f<0);return e.jsxs("div",{className:"flex items-baseline justify-between text-[13px]",children:[e.jsx("span",{className:"text-slate-600",children:t}),e.jsxs("span",{className:"font-semibold tabular-nums",children:[x?S(s):i(s),f!=null&&Math.abs(f)>0&&e.jsxs("span",{className:`ml-1.5 text-[11px] ${b?"text-red-600":"text-emerald-600"}`,children:[f>0?"+":"",x?S(f):i(f)]})]})]})};return o?e.jsxs("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center text-red-600 text-sm",children:["Simulator failed to load: ",o]}):d?d.ready?e.jsxs("div",{className:r?"bg-slate-50":"min-h-screen bg-slate-50",children:[!r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-yellow-50 border-b border-yellow-200 text-yellow-900 px-5 py-2 text-[12.5px] flex items-center gap-3 flex-wrap",children:[e.jsx("b",{children:"SEGMENT & FREQUENCY SIMULATOR"}),e.jsxs("span",{children:["Live precomputed data (",i(d.listSize??0)," people, ",d.windowDays,"-day window). Drag & edit — nothing changes live sending."]})]}),e.jsxs("div",{className:"bg-slate-900 text-slate-200 px-5 h-[52px] flex items-center gap-5",children:[e.jsx("span",{className:"font-extrabold tracking-widest text-[12.5px] text-white",children:"EMAIL ORCHESTRATION"}),e.jsx("span",{className:"px-3 py-1 text-[13px] rounded-lg bg-white text-slate-900 font-semibold",children:"Segments"}),e.jsx("span",{className:"text-slate-500 text-[13px]",children:"· Simulate"})]})]}),e.jsxs("div",{className:"max-w-6xl mx-auto px-5 py-6",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-1.5",children:[e.jsxs("h1",{className:"text-[22px] font-bold tracking-tight text-slate-900 inline-flex items-center gap-2",children:[e.jsx(Ne,{className:"w-5 h-5 text-slate-400"})," Frequency simulator"]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>a&&N({name:W,scenario:a}),className:Z,children:[e.jsx(te,{className:"w-4 h-4"})," Pin to compare"]}),e.jsxs("button",{onClick:ye,className:Z,children:[e.jsx(ke,{className:"w-4 h-4"})," Export scenario"]}),e.jsxs("button",{onClick:ue,disabled:I||y==="current",className:ee,children:[e.jsx(Se,{className:"w-4 h-4"})," ",I?"Saving…":"Save as draft version"]})]})]}),e.jsx("p",{className:"text-slate-500 text-[13.5px] max-w-2xl mb-4",children:"Drag the boundaries and quotas — see who gets what and what it costs. Nothing here changes live sending; applying a policy stays a human edit in the segment editor. Saved drafts and activation live in the Versions panel on Segments Home."}),e.jsxs(je,{children:["Read-only what-if. Every number is an exact per-user projection from the last ",d.windowDays," days — the advisor guards any real ramp."]}),e.jsxs("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:[e.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400",children:"Preset:"}),["current","gal","optionb"].map(t=>e.jsx("button",{onClick:()=>{j(null),be(t)},className:`text-[12.5px] px-3 py-1.5 rounded-full border font-semibold ${y===t?"bg-indigo-600 border-indigo-600 text-white":"bg-white border-slate-200 text-slate-600 hover:border-indigo-300"}`,children:t==="current"?"Current policy":t==="gal"?"Gal original":"Option B (hybrid)"},t)),de.filter(t=>t.config.mode==="score").map(t=>e.jsxs("button",{onClick:()=>O(t),className:`text-[12.5px] px-3 py-1.5 rounded-full border font-semibold ${w?.id===t.id?"bg-violet-600 border-violet-600 text-white":"bg-white border-violet-200 text-violet-600 hover:border-violet-300"}`,children:[t.status==="active"?"● ":"",t.name]},t.id)),e.jsxs("button",{onClick:()=>{he(t=>!t),J||V(C)},className:`text-[12.5px] px-3 py-1.5 rounded-full border font-semibold inline-flex items-center gap-1 ${v==="Recommended split"?"bg-violet-600 border-violet-600 text-white":"bg-white border-violet-200 text-violet-600 hover:border-violet-300"}`,children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Recommended split"]}),v&&e.jsx("span",{className:"text-[12.5px] px-3 py-1.5 rounded-full bg-violet-50 border border-violet-200 text-violet-700 font-semibold",children:v}),y==="Custom"&&!w&&!v&&e.jsx("span",{className:"text-[12.5px] px-3 py-1.5 rounded-full bg-amber-50 border border-amber-200 text-amber-700 font-semibold",children:"Custom"}),ce&&e.jsx("span",{className:"text-[11px] text-slate-400",children:"recalculating…"})]}),pe&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-violet-200 p-4",children:[e.jsxs("div",{className:"text-[13px] font-semibold text-slate-700 mb-1 inline-flex items-center gap-1.5",children:[e.jsx(M,{className:"w-4 h-4 text-violet-500"})," Tune the trade-off"]}),e.jsx("p",{className:"text-[11.5px] text-slate-500 mb-3",children:"Set what matters most — the recommended split is re-searched from the last 180 days against these weights. You decide the trade-off; nothing is hard-coded."}),[["signatures","Protect signatures"],["revenue","Protect revenue"],["unsub_penalty","Minim
12ize unsubscribes"]].map(([t,s])=>e.jsxs("div",{className:"mb-2.5",children:[e.jsxs("div",{className:"flex justify-between text-[12px] text-slate-600 mb-0.5",children:[e.jsx("span",{children:s}),e.jsx("span",{className:"tabular-nums font-semibold",children:C[t].toFixed(1)})]}),e.jsx("input",{type:"range",min:0,max:5,step:.5,value:C[t],onChange:l=>xe(x=>({...x,[t]:+l.target.value})),className:"w-full accent-violet-600","aria-label":s})]},t)),e.jsxs("button",{onClick:()=>V(C),disabled:L,className:ee+" mt-1",children:[e.jsx(M,{className:"w-4 h-4"})," ",L?"Searching…":"Recompute recommendation"]})]}),e.jsx(Ae,{result:J??{ready:!0},loading:L})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-4 mb-4",children:[e.jsxs("div",{className:"lg:col-span-3 bg-white rounded-xl shadow-sm border border-slate-200 p-4",children:[e.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400 mb-2",children:["Score-tier mode — drag the boundaries ",$("Each boundary splits the engagement-score axis into a group. Drag to change who belongs where.")]}),y==="current"?e.jsx("div",{className:"text-[13px] text-slate-500 py-8 text-center",children:"Current policy is rules-based (segments) — shown as an exact preset in the panels below. Switch to Gal or Option B to drag score boundaries."}):e.jsxs(e.Fragment,{children:[e.jsx($e,{bins:d.histogram,bands:c,onMove:fe}),e.jsxs("div",{className:"flex gap-2 flex-wrap mt-3",children:[[...c].sort((t,s)=>t.lo-s.lo).map((t,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 border border-slate-200 rounded-lg px-2.5 py-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:ne(s)}}),e.jsx("span",{className:"text-[12px] font-semibold text-slate-700",children:t.lo===0?"score 0":`≥ ${t.lo}`}),e.jsx("span",{className:"text-slate-300",children:"·"}),e.jsx("input",{type:"number",min:0,max:7,value:t.quota,onChange:l=>ge(t.id,+l.target.value),className:"w-12 border border-slate-200 rounded px-1.5 py-0.5 text-[12px] tabular-nums","aria-label":`quota for ${t.id}`}),e.jsx("span",{className:"text-[11.5px] text-slate-500",children:"/wk"})]},t.id)),e.jsxs("label",{className:"flex items-center gap-1.5 border border-slate-200 rounded-lg px-2.5 py-1.5 text-[12px] text-slate-600",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:t=>{g(t.target.checked),P("Custom"),j(null),k(null)}})," Payer floor (min 2/wk)"]}),e.jsxs("span",{className:"flex items-center gap-1.5 border border-slate-200 rounded-lg px-2.5 py-1.5 text-[12px] text-slate-400",children:[e.jsx("input",{type:"checkbox",checked:!0,disabled:!0})," Blocked gate (always on)"]})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 flex flex-col justify-center items-center text-center",children:[e.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400 mb-2",children:["Score-0 pile ",$("Everyone with no durable engagement score — no human open or click in the trailing 6 months. Shown separately so the 0.1–8 histogram stays readable.")]}),e.jsx("div",{className:"text-[26px] font-bold text-slate-700 tabular-nums",children:i(d.zeroPile?.n??0)}),e.jsxs("div",{className:"text-[11.5px] text-slate-400 mt-1",children:[d.listSize?(100*(d.zeroPile?.n??0)/d.listSize).toFixed(0):0,"% of the list"]}),e.jsxs("div",{className:"text-[11px] text-slate-400 mt-2",children:[i(d.zeroPile?.nAct90??0)," of them signed/paid in 90d → T1, floored at 1/wk"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[e.jsx(E,{tone:"plain",label:"Projected weekly volume",value:i(a?.projWeeklyTotal??0),help:"People × their group quota, per week. Compare to what we actually sent.",sub:`actual 180d avg: ${i(K)}/wk`}),e.jsx(E,{tone:(a?.revRisk??0)>5e3?"warn":"ok",label:"Hero revenue at risk",value:S(a?.revRisk??0),help:"Attributed Hero revenue riding on the sends this policy would cut (excess vs allowance × attribution). The cost of enforcing.",sub:`of ${S(d.emailAttrib180?.heroRev??0)} email-attributed`}),e.jsx(E,{tone:(a?.sigsRisk??0)>4e4?"warn":"plain",label:"Signatures at risk",value:i(a?.sigsRisk??0),help:"Attributed signatures riding on the cut sends.",sub:`of ${i(d.emailAttrib180?.sigs??0)} email-attributed`}),e.jsx(E,{tone:(a?.payersBelow2??0)>8e3?"warn":"ok",label:"Payers below 2/wk",value:i(a?.payersBelow2??0),help:(a?.blockedGatedPayers??0)>0?`${i(a?.blockedGatedPayers??0)} of these ${i(a?.payersBelow2??0)} are BLOCKED payers — suppression already holds them at 0/wk. The payer floor only raises a score-tier quota to 2/wk; it never overrides the blocked gate (blocked is an absolute suppression decision, outside the frequency model). That's why "payer floor: on" doesn't catch them.`:"Payers this policy would drop under 2 emails/week — the donor-silencing risk.",sub:(a?.payersBelow2Rev??0)>0?`${S(a?.payersBelow2Rev??0)}/12mo behind them`:"none silenced"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-slate-200 text-[13px] font-semibold text-slate-700",children:["Groups ",$("People per group, the weekly quota, and each group’s historical unsub/1k — the erosion signal.")]}),e.jsxs("table",{className:"w-full text-[13px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-[10.5px] uppercase tracking-wider text-slate-400 border-b border-slate-100",children:[e.jsx("th",{className:"px-4 py-2",children:"Group"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"People"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"% payers"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Quota"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Proj/wk"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Unsub/1k"})]})}),e.jsx("tbody",{children:X.map(t=>e.jsxs("tr",{className:"border-b border-slate-50",children:[e.jsxs("td",{className:"px-4 py-2 font-medium text-slate-700",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full mr-2",style:{background:Ee[t.id]??"#94a3b8"}}),t.id]}),e.jsx("td",{className:"px-4 py-2 text-right tabular-nums",children:i(t.n)}),e.jsxs("td",{className:"px-4 py-2 text-right tabular-nums text-slate-500",children:[t.pctPayers,"%"]}),e.jsxs("td",{className:"px-4 py-2 text-right tabular-nums font-semibold",children:[t.quota,"/wk"]}),e.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-slate-600",children:i(t.projWeekly)}),e.jsx("td",{className:`px-4 py-2 text-right tabular-nums font-semibold ${t.erosionUnsub1k==null?"text-slate-300":t.erosionUnsub1k<=2?"text-slate-500":t.erosionUnsub1k<=4?"text-amber-600":"text-red-600"}`,children:t.erosionUnsub1k??"—"})]},t.id))})]}),e.jsx("div",{className:"px-4 py-2 text-[11px] text-slate-400 border-t border-slate-100",children:"Erosion = each group’s own historical unsub/1k — “who these people are today.” Advisor ceiling 4.0/1k. The advisor guards any real ramp."})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4",children:[e.jsxs("div",{className:"text-[13px] font-semibold text-slate-700 mb-2 inline-flex items-center gap-1.5",children:[e.jsx(Pe,{className:"w-4 h-4 text-slate-400"})," Cost of enforcing ",$("The §14 methodology: sends beyond each group’s allowance, and the signatures + Hero revenue attributed to them.")]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{label:"Excess sends",val:a?.excess??0,base:p?.scenario.excess,good:"low"}),e.jsx(D,{label:"Signatures at risk",val:a?.sigsRisk??0,base:p?.scenario.sigsRisk,good:"low"}),e.jsx(D,{label:"Hero revenue at risk",val:a?.revRisk??0,base:p?.scenario.revRisk,money:!0,good:"low"}),e.jsx(D,{label:"Payers below 2/wk",val:a?.payersBelow2??0,base:p?.scenario.payersBelow2,good:"low"}),e.jsxs("div",{className:"pt-2 border-t border-slate-100 text-[11.5px] text-slate-500 inline-flex items-start gap-1.5",children:[e.jsx(Te,{className:"w-3.5 h-3.5 flex-none mt-0.5"})," ",i(a?.cold??0)," cold-by-exposure (<2 sends) — candidates for a re-engagement test, not a 0/wk sentence."]}),(a?.blockedGatedPayers??0)>0&&e.jsxs("div",{className:"text-[11.5px] text-slate-400",children:["Blocked gate holds ",i(a?.blockedGatedPayers??0)," payers out of the frequency system (suppression, separate from this cost)."]})]}),p&&e.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-100 text-[11px] text-slate-400",children:["Δ vs pinned: ",e.jsx("b",{children:p.name})," ",e.jsx("button",{onClick:()=>N(null),className:"underline ml-1",children:"clear"})]})]})]}),p&&a&&e.jsxs("div",{className:"mt-4 bg-white rounded-xl shadow-sm border border-indigo-200 p-4",children:[e.jsxs("div",{className:"text-[13px] font-semibold text-slate-700 mb-2 inline-flex items-center gap-1.5",children:[e.jsx(te,{className:"w-4 h-4 text-indigo-500"})," A/B compare"]}),e.jsx("div",{className:"grid grid-cols-2 gap-4 text-[13px]",children:[{t:`A · ${p.name}`,s:p.scenario},{t:`B · ${W}`,s:a}].map(({t,s})=>e.jsxs("div",{className:"border border-slate-200 rounded-lg p-3",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400 mb-1.5",children:t}),e.jsxs("div",{className:"space-y-1 tabular-nums",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Proj weekly"}),e.jsx("b",{children:i(s.projWeeklyTotal)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Revenue at risk"}),e.jsx("b",{children:S(s.revRisk)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Signatures at risk"}),e.jsx("b",{children:i(s.sigsRisk)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Payers < 2/wk"}),e.jsx("b",{children:i(s.payersBelow2)})]})]})]},t))})]})]})]}):e.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center text-slate-500 text-sm max-w-md mx-auto text-center px-4",children:"Simulator data isn’t precomputed yet — waiting on tonight’s profiles:daily-refresh --stage=6 run."}):e.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center text-slate-400 text-sm",children:"Loading simulator…"})},Je=()=>e.jsx(Me,{embedded:!0});export{Je as default};
13//# sourceMappingURL=SimulatorTab-DHJgpjQp.js.map

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.