Unlisted /plan-lab: Reach Ladder simulator for the planning group

The working simulator for the new matrix plan, served by link only
(noindex, no menu entry, no sitemap). Engine in /assets/plan-lab.js because
the CSP blocks inline scripts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-27 12:38:43 -05:00
parent 7ef8094a4d
commit a2d5706d8e
3 changed files with 866 additions and 1 deletions
+582
View File
@@ -0,0 +1,582 @@
// Reach Ladder plan simulator (unlisted /plan-lab). Built from the working artifact, 2026-09-27.
(function(){
// ── the plan: width, ladder, gap rule ──
// unq: what a pass-up does at an unqualified member ('skip' = passes over them; 'licence' = buys their next licence, never cash)
// wm: cash watermark. A member who qualifies late is paid cash only by their own directs and by positions created after they qualified.
const PLAN = { w: 4, maxL: 8, shape: 'stepped', steps: [10,20,50,100,175,300,500,750], gap: 'fund', unq: 'licence', wm: true,
// placeholder products, one per level, until the real ones exist (Marty, 27 Sep): edit in the plan row
split: 0.5, // entry split: this share of the net entry to the placement upline, the rest to the recruiter (decided 27 Sep)
half: true, // one-direct half step: one recruit unlocks cash from depths 1-2 (levels 2-3); two recruits unlock full reach
fee: 0.20, // admin fee, OUT of every price, to a receiver wallet in the same block (Marty, 27 Sep: 20%, same as InstantAdPay). The other 80% climbs.
products: ['Widget 1','Widget 2','Widget 3','Widget 4','Widget 5','Widget 6','Widget 7','Widget 8'] };
function product(L){ return PLAN.products[L - 1] || ('Widget ' + L); }
function net(L){ return price(L) * (1 - PLAN.fee); } // what climbs after the admin fee
const MAXD = { 2: 8, 3: 5, 4: 4, 5: 3 }, DEFD = { 2: 6, 3: 4, 4: 3, 5: 3 }; // drawable depth per width
function price(L){
const P = Number(document.getElementById('price').value) || 0;
if (PLAN.shape === 'flat') return P;
if (PLAN.shape === 'linear') return P * L;
if (PLAN.shape === 'ratio') return Math.round(P * Math.pow(1.25, L - 1));
const s = PLAN.steps; if (L <= s.length) return s[L - 1];
const r = s.length > 1 && s[s.length - 2] ? s[s.length - 1] / s[s.length - 2] : 1.5;
return Math.round(s[s.length - 1] * Math.pow(r, L - s.length));
}
const $$ = n => '$' + Math.round(n).toLocaleString('en-US');
const cnt = n => Math.round(n).toLocaleString('en-US');
// ── the drawn tree ──
let DEPTHS = 3, W = 1400, ROW = 0;
const H = 470, TOP = 48, GUT = 250;
const svg = document.getElementById('tree');
const NS = 'http://www.w3.org/2000/svg';
function geometry(){ W = Math.max(1400, GUT + Math.pow(PLAN.w, DEPTHS) * 9 + 30); ROW = (H - TOP - 30) / DEPTHS; svg.setAttribute('viewBox', '0 0 ' + W + ' ' + H); svg.style.minWidth = Math.max(980, Math.round(W * 0.8)) + 'px'; }
let quiet = false, tally = null, tallyOrigin = null, licUpFlag = false;
// audit: every dollar spent must be received by someone (a position, or 'above'); licences are never money
const AUD = { spent: 0, received: 0, above: 0, treasury: 0 };
function feeOn(gross){ const f = gross * PLAN.fee; AUD.received += f; AUD.treasury += f; } // the admin wallet's share of a gross price
window.reachAudit = () => ({ treasury: Math.round(AUD.treasury * 100) / 100, spent: Math.round(AUD.spent * 100) / 100, received: Math.round(AUD.received * 100) / 100, above: Math.round(AUD.above * 100) / 100, ok: Math.abs(AUD.spent - AUD.received) <= 0.01 + 1e-9 * AUD.spent });
function tallyFor(d){ return tally[d] || (tally[d] = { n: 0, L: 0, youCash: 0, youLic: 0, above: 0, licUp: 0, cash: {}, lic: {} }); }
let nodes = [], byId = {}, you, totals, youLedger = [], nextId = 0;
function mkNode(depth, parent, idx){
const n = { id: nextId++, depth, parent, idx, children: [], level: 1, directs: 2, get qual(){ return this.directs >= 2; }, cashFrom: 0, cashFromHalf: 0, cash: 0, entry: 0, x: 0, y: 0 };
nodes.push(n); byId[n.id] = n;
if (parent) { parent.children.push(n); parent.entry += net(1); AUD.spent += price(1); AUD.received += net(1); feeOn(price(1)); if (parent === you) { totals.entry += net(1); } } // Rule 0: the entry pays the upline directly above
return n;
}
function layout(){
for (const n of nodes) {
const slots = Math.pow(PLAN.w, n.depth), slotW = (W - GUT - 30) / slots;
n.x = GUT + slotW * (n.idx + 0.5); n.y = TOP + n.depth * ROW;
}
}
function radius(n){ if (n === you) return 17; const s = Math.pow(PLAN.w, n.depth); return s <= 4 ? 14 : s <= 16 ? 12 : s <= 64 ? 10 : s <= 256 ? 7 : s <= 1024 ? 5 : 4; }
function labelled(n){ return n === you || Math.pow(PLAN.w, n.depth) <= 64; }
function build(){
DEPTHS = DEFD[PLAN.w];
geometry();
nodes = []; byId = {}; nextId = 0; AUD.spent = 0; AUD.received = 0; AUD.above = 0; AUD.treasury = 0;
totals = { entry: 0, cash: 0, lic: 0, licV: 0, cashN: 0 }; youLedger = [];
function mk(depth, parent, idx){
const n = mkNode(depth, parent, idx);
if (depth < DEPTHS) for (let k = 0; k < PLAN.w; k++) mk(depth + 1, n, idx * PLAN.w + k);
return n;
}
you = null;
you = mk(0, null, 0);
// entries from your directs were credited before `you` existed: count them now
totals.entry = you.children.length * net(1); you.entry = totals.entry;
you.level = Number(document.getElementById('youLevel').value);
layout();
draw(); paintPays(); renderTotals(); depthLabel(); clearLog('Reset. Click a position, or run a wave.');
const le = document.getElementById('last'); if (le) { le.className = 'last'; le.textContent = 'Nothing bought yet. Your ' + you.children.length + ' directs each paid their entry (' + $$(price(1)) + ') to you. Click a ringed position: its next purchase reaches you.'; }
}
function draw(){
while (svg.firstChild) svg.removeChild(svg.firstChild);
for (let d = 1; d <= DEPTHS; d++) {
const r = document.createElementNS(NS, 'rect');
r.setAttribute('x', 0); r.setAttribute('y', TOP + d * ROW - ROW/2); r.setAttribute('width', W); r.setAttribute('height', ROW);
r.setAttribute('class', 'band'); r.setAttribute('id', 'band' + d);
svg.appendChild(r);
const t = document.createElementNS(NS, 'text');
t.setAttribute('x', 12); t.setAttribute('y', TOP + d * ROW + 4); t.setAttribute('class', 'bandlabel'); t.setAttribute('id', 'bl' + d);
svg.appendChild(t);
}
for (const n of nodes) if (n.parent) {
const p = document.createElementNS(NS, 'path');
p.setAttribute('d', `M${n.parent.x},${n.parent.y} C${n.parent.x},${(n.parent.y+n.y)/2} ${n.x},${(n.parent.y+n.y)/2} ${n.x},${n.y}`);
p.setAttribute('class', 'edge'); p.setAttribute('id', 'e' + n.id);
svg.appendChild(p);
}
for (const n of nodes) {
const g = document.createElementNS(NS, 'g');
g.setAttribute('class', 'node' + (n === you ? ' you' : '') + (n.qual ? '' : ' unq'));
g.setAttribute('id', 'n' + n.id); g.setAttribute('tabindex', '0'); g.setAttribute('role', 'button');
const r = radius(n);
const c = document.createElementNS(NS, 'circle');
c.setAttribute('cx', n.x); c.setAttribute('cy', n.y); c.setAttribute('r', r);
g.appendChild(c);
const t = document.createElementNS(NS, 'text');
t.setAttribute('x', n.x); t.setAttribute('y', n.y); t.setAttribute('id', 't' + n.id);
if (labelled(n)) t.textContent = n.level;
if (r <= 10) t.setAttribute('style', 'font-size:9px');
g.appendChild(t);
if (n.depth === 1 && n.idx === 0) {
const dl = document.createElementNS(NS, 'text');
dl.setAttribute('x', n.x); dl.setAttribute('y', n.y - r - 4); dl.setAttribute('class', 'bandlabel'); dl.setAttribute('style', 'text-anchor:middle;font-weight:700');
dl.textContent = 'YOUR DIRECTS'; g.appendChild(dl);
}
const m = document.createElementNS(NS, 'text');
m.setAttribute('x', n.x); m.setAttribute('y', n.y + r + 3); m.setAttribute('class', 'mny'); m.setAttribute('id', 'm' + n.id);
g.appendChild(m);
const title = document.createElementNS(NS, 'title');
g.appendChild(title);
g.addEventListener('click', e => { e.stopPropagation(); onClick(n, g); });
g.addEventListener('keydown', e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onClick(n, g); } });
svg.appendChild(g);
}
for (const n of nodes) refreshNode(n);
const yl = document.createElementNS(NS, 'text');
yl.setAttribute('x', you.x + 26); yl.setAttribute('y', you.y + 4); yl.setAttribute('class', 'bandlabel'); yl.textContent = 'YOU';
svg.appendChild(yl);
paintReach();
}
function paintReach(){
const A = you.level;
for (let d = 1; d <= DEPTHS; d++) {
const band = document.getElementById('band' + d), lbl = document.getElementById('bl' + d);
if (!band) continue;
if (d < A) { band.setAttribute('fill', 'var(--reach-soft)'); lbl.textContent = `depth ${d} · cash to you at level ${d+1}` + (d === 1 ? ' (and entries)' : ''); }
else if (d === A) { band.setAttribute('fill', 'var(--lic-soft)'); lbl.textContent = `depth ${d} · 1st level-${d+1} = your licence`; }
else { band.setAttribute('fill', 'transparent'); lbl.textContent = `depth ${d} · past you until level ${d}`; }
}
}
function refreshNode(n){
const g = document.getElementById('n' + n.id), t = document.getElementById('t' + n.id);
if (!g) return;
g.classList.toggle('unq', !n.qual);
if (labelled(n)) t.textContent = n.level;
const got = n.cash + n.entry;
g.querySelector('title').textContent = (n === you ? `You · level ${n.level}` : `#${n.id} · depth ${n.depth} · level ${n.level} · ${n.directs} direct${n.directs === 1 ? '' : 's'}`) + (got ? ` · collected ${$$(got)}` : '');
const m = document.getElementById('m' + n.id);
if (m) m.textContent = got && radius(n) >= 7 ? $$(got) : '';
}
// Rule 1 plus the gap rule. A payment of `amt` for level L, starting from `from`: skip `skipN`
// uplines, then climb to the first qualified upline. Under 'skip' a qualified upline more than one
// level behind is passed over too. Returns {to, skipped[], path[]}; to === null means it climbed past you.
// `rem`: a remainder left over after funding a licence. Remainders are cash only, to the first qualified
// upline that already holds the level; they never issue a licence, because they can be smaller than one.
// may `u` take CASH from a payment whose buyer is `origin`? Qualified, and (watermark off, or the buyer is
// u's own direct, or the buyer's position was created after u qualified)
// may `u` take CASH for a level-L payment whose buyer is `origin`?
// two directs: any level, from own directs or positions created after the second direct arrived
// one direct (half step on): levels 2-3 only (depths 1-2), from own directs or positions created after the first arrived
function cashOk(u, origin, L){
const own = !PLAN.wm || !origin || origin.parent === u;
if (u.directs >= 2) return own || origin.id >= u.cashFrom;
if (PLAN.half && u.directs === 1 && L <= 3) return own || origin.id >= u.cashFromHalf;
return false;
}
function route(from, L, skipN, rem, origin){
const skipped = [], path = [];
let cur = from.parent;
for (let i = 0; i < skipN && cur; i++) { path.push(cur); cur = cur.parent; }
while (cur) {
path.push(cur);
if (cur.level >= L) {
if (cashOk(cur, origin, L)) return { to: cur, kind: 'cash', skipped, path };
skipped.push({ n: cur, why: cur.directs === 0 ? 'no directs, holds the level: cash passes them' : cur.directs === 1 ? (PLAN.half && L <= 3 ? 'one direct: this position joined before it: cash passes them' : 'one direct: cash only from depths 1-2' + (PLAN.half ? '' : ' (half step off)')) : 'qualified after this position joined: cash passes them' });
} else if (!rem) {
const behindOk = PLAN.gap === 'fund' || cur.level >= L - 1, licOk = cur.qual || PLAN.unq === 'licence';
if (behindOk && licOk) return { to: cur, kind: 'lic', skipped, path };
skipped.push({ n: cur, why: !licOk ? 'fewer than two directs' : `holds level ${cur.level}, needs ${L-1}` });
} else skipped.push({ n: cur, why: `holds level ${cur.level}, a remainder pays only holders of ${L}` });
cur = cur.parent;
}
return { to: null, skipped, path };
}
// One payment and everything that follows from it: licence, cascade, remainder.
function pay(from, L, amt, skipN, steps, flashes, rem, origin){
const r = route(from, L, skipN, rem, origin);
for (const s of r.skipped) { steps.push({ kind: 'skip', text: `${name(s.n)} skipped (${s.why})` }); flashes.push([s.n, 'flash-skip']); }
if (!r.to) {
if (tally) { const t = tallyFor(tallyOrigin); if (licUpFlag) t.licUp += amt; else t.above += amt; }
AUD.received += amt; AUD.above += amt;
steps.push({ kind: 'cash', text: `${$$(amt)} of level-${L} money went on above you, to your own upline (the company, in this view).` });
markPath(from, null, 'hot-cash'); return;
}
const to = r.to;
if (r.kind === 'cash') {
to.cash += amt; AUD.received += amt; refreshNode(to);
if (tally) { const t = tallyFor(tallyOrigin); if (to === you) t.youCash += amt; else t.cash[to.depth] = (t.cash[to.depth] || 0) + amt; }
if (to === you) { totals.cash += amt; totals.cashN++; youLedger.unshift({ from, L, kind: 'cash', amt }); renderTotals(); }
steps.push({ kind: 'cash', text: `${name(to)} already holds level ${to.level}: cash, ${$$(amt)}.` });
flashes.push([to, 'flash-cash']); markPath(from, to, 'hot-cash'); return;
}
// behind the level: this payment is their next licence (under 'skip' that is always level L)
const n = to.level + 1, cost = net(n); // a licence is worth the level's climbing amount, after the fee
to.level = n; refreshNode(to);
if (tally) { const t = tallyFor(tallyOrigin); if (to === you) t.youLic++; else t.lic[to.depth] = (t.lic[to.depth] || 0) + 1; }
if (to === you) { totals.lic++; totals.licV += cost; youLedger.unshift({ from, L: n, kind: 'lic', amt: cost }); paintReach(); renderTotals(); }
steps.push({ kind: 'lic', text: `${name(to)} held level ${n-1}: this is their licence ${n}${n < L ? ' (funded by a level-' + L + ' payment)' : ''}${to.qual ? '' : ' (fewer than two directs: a licence, never cash)'}. Upgraded. Their level-${n} cost climbs from their position…` });
flashes.push([to, 'flash-lic']); markPath(from, to, 'hot-lic');
const wasYou = licUpFlag; if (to === you) licUpFlag = true;
pay(to, n, cost, n - 2, steps, flashes, false, origin); // the cascade: the licence cost climbs (same buyer's money)
licUpFlag = wasYou;
const left = amt - cost;
if (left > 0.005) { steps.push({ kind: 'cash', text: `The remaining ${$$(left)} of that level-${L} payment climbs on as cash to the first upline holding level ${L}.` }); pay(to, L, left, 0, steps, flashes, true, origin); }
}
function purchase(from, L, steps, flashes){ AUD.spent += price(L); feeOn(price(L)); pay(from, L, net(L), L - 2, steps, flashes, false, from); }
function markPath(from, to, cls){
if (quiet) return;
let cur = from;
while (cur && cur !== to) { const e = document.getElementById('e' + cur.id); if (e) e.classList.add(cls); cur = cur.parent; }
}
function name(n){ return n === you ? 'YOU' : `#${n.id} (${n.depth === 1 ? 'your direct' : n.depth === 2 ? 'grandchild, depth 2' : 'depth ' + n.depth})`; }
function clearHot(){
svg.querySelectorAll('.edge').forEach(e => e.classList.remove('hot-cash', 'hot-lic', 'hot-skip'));
svg.querySelectorAll('.node').forEach(g => g.classList.remove('flash-cash', 'flash-lic', 'flash-skip', 'flash-src'));
}
function onClick(n, g){ if (n === you) return; openPop(n, g); }
const pop = document.createElement('div'); pop.className = 'pop'; pop.hidden = true; document.body.appendChild(pop);
function closePop(){ pop.hidden = true; }
function openPop(n, g){
const r = g.querySelector('circle').getBoundingClientRect();
const nxt = n.level + 1;
const rt = nxt <= PLAN.maxL ? route(n, nxt, nxt - 2, false, n) : { to: null };
const where = rt.to === you ? '<b>lands on YOU</b>' : rt.to ? 'pays ' + name(rt.to) : 'goes above you (to your own upline)';
const how = rt.to ? (rt.kind === 'lic' ? ' as their <b>licence ' + (rt.to.level + 1) + '</b>' + (rt.to.level + 1 < nxt ? ', the remainder climbs on' : '') : ' as cash, ' + $$(price(nxt))) : '';
const skipped = rt.skipped && rt.skipped.length ? '<br>skipping ' + rt.skipped.map(x => name(x.n)).join(', ') : '';
pop.innerHTML = '<div class="t">' + (n.depth === 1 ? '<b>YOUR DIRECT</b> · ' : n.depth === 2 ? '<b>A GRANDCHILD</b> (depth 2) · ' : 'depth ' + n.depth + ' · ') + '#' + n.id + ' · holds level ' + n.level + ' · ' + n.directs + ' direct' + (n.directs === 1 ? '' : 's') + '</div>'
+ '<div class="hint">' + (nxt <= PLAN.maxL ? 'Buying level ' + nxt + ' (' + $$(price(nxt)) + ') ' + where + how + skipped + '.' : 'At the top of the ladder.') + '</div>'
+ (nxt <= PLAN.maxL ? '<button class="primary" id="popBuy">Buy level ' + nxt + ' · ' + product(nxt) + ' · ' + $$(price(nxt)) + (PLAN.fee ? ' (' + $$(net(nxt)) + ' climbs)' : '') + '</button>' : '')
+ '<div class="t" style="margin-top:8px">Directs: ' + n.directs + '</div>'
+ [0, 1, 2].filter(k => k !== n.directs).map(k => '<button data-dir="' + k + '">' + (k === 0 ? 'Mark as no directs' : k === 1 ? 'Mark as one direct (from now)' : 'Mark as two directs (from now)') + '</button>').join('');
pop.hidden = false;
const w = 250, h = pop.offsetHeight || 140;
let left = r.left + r.width / 2 - w / 2, top = r.bottom + 8;
left = Math.max(8, Math.min(left, window.innerWidth - w - 8));
if (top + h > window.innerHeight - 8) top = r.top - h - 8;
pop.style.left = left + 'px'; pop.style.top = top + 'px';
const pb = document.getElementById('popBuy'); if (pb) pb.onclick = () => { closePop(); buy(n); };
pop.querySelectorAll('[data-dir]').forEach(b => b.onclick = () => {
closePop(); const k = Number(b.dataset.dir);
if (k >= 1 && n.directs < 1) n.cashFromHalf = nextId; // the first direct arrives now: depths 1-2 pay from here on
if (k >= 2 && n.directs < 2) n.cashFrom = nextId; // the second: full reach from here on
n.directs = k; refreshNode(n); paintPays();
const older = cnt(nodes.filter(x => x.id < nextId && x !== n).length);
const msg = k === 2 ? name(n) + ' now has two directs: full reach, cash from its own directs and from positions that join from now on. The ' + older + ' existing positions keep passing it.'
: k === 1 ? name(n) + ' now has one direct: ' + (PLAN.half ? 'cash from depths 1-2 (levels 2-3), from its own directs and from positions that join from now on' : 'no cash until the second (half step is off)') + (PLAN.unq === 'licence' ? '; licences still reach it.' : '.')
: name(n) + ' now has no directs: cash passes over it' + (PLAN.unq === 'licence' ? ', licences still reach it.' : '.');
renderLast(null, null, null, msg, k ? 'cash' : 'none');
addLog([{ kind: k ? 'cash' : 'skip', text: msg }], name(n));
});
}
document.addEventListener('click', e => { if (!pop.hidden && !pop.contains(e.target) && !e.target.closest('.node')) closePop(); });
document.addEventListener('keydown', e => { if (e.key === 'Escape') closePop(); });
function renderLast(n, L, steps, override, cls){
const el = document.getElementById('last');
if (override) { el.className = 'last ' + (cls || ''); el.innerHTML = override; return; }
const lic = steps.filter(s => s.kind === 'lic');
const cash = steps.filter(s => s.kind === 'cash');
const youLic = lic.some(s => /^YOU held/.test(s.text));
const youCash = cash.some(s => /^YOU already/.test(s.text));
let text = '<b>' + name(n) + ' bought level ' + L + ' (' + product(L) + ') for ' + $$(price(L)) + '.</b> ';
if (youLic) text += 'That payment was <b>your licence</b>: you were upgraded in the same transaction and the cost went on above you.';
else if (youCash) text += 'It reached you as <b>cash</b>' + (lic.length ? ', after issuing ' + lic.length + ' licence' + (lic.length > 1 ? 's' : '') + ' on the way up' : '') + '.';
else if (lic.length) text += 'It became <b>a licence for ' + lic[0].text.split(' held')[0] + '</b> and the money climbed on from there.';
else if (cash.length && !/above you/.test(cash[0].text)) text += 'It paid <b>' + cash[0].text.split(' already')[0] + '</b> as cash.';
else text += 'It went <b>above you</b>, to your own upline.';
const why = youLic || youCash ? '' : '<span class="why">Not yours: a depth-' + n.depth + ' position pays you only when it buys level ' + (n.depth + 1) + '. It holds level ' + L + ' now' + (L < n.depth + 1 ? ', so ' + (n.depth + 1 - L) + ' more purchase' + (n.depth + 1 - L > 1 ? 's' : '') + ' until its next one reaches you.' : '.') + '</span>';
el.className = 'last ' + (youLic ? 'lic' : youCash ? 'cash' : 'none');
el.innerHTML = text + why;
}
function buy(n){
const L = n.level + 1;
if (L > PLAN.maxL) return;
clearHot();
n.level = L; refreshNode(n);
const steps = [], flashes = [[n, 'flash-src']];
purchase(n, L, steps, flashes);
for (const [m, c] of flashes) { const g = document.getElementById('n' + m.id); if (g) g.classList.add(c); }
addLog(steps, `${name(n)} bought level ${L} for ${$$(price(L))}`);
renderLast(n, L, steps);
paintPays();
return steps;
}
function paintPays(){
for (const n of nodes) {
if (n === you) continue;
const g = document.getElementById('n' + n.id); if (!g) continue;
const r = n.level + 1 <= PLAN.maxL ? route(n, n.level + 1, n.level - 1, false, n) : { to: null };
g.classList.toggle('pays', r.to === you);
}
}
function wave(){
clearHot();
const before = you.level, cashBefore = totals.cash;
const steps = [];
quiet = true; tally = {};
const order = nodes.filter(n => n !== you).sort((a, b) => a.depth - b.depth || a.idx - b.idx);
let bought = 0, licYou = 0, skipYou = 0;
for (const n of order) {
if (!n.qual) continue;
const L = n.level + 1; if (L > PLAN.maxL) continue;
tallyOrigin = n.depth; const tf = tallyFor(n.depth); tf.n++; tf.L = L;
n.level = L; refreshNode(n); bought++;
const sub = [], fl = [];
const licBefore = totals.lic;
purchase(n, L, sub, fl);
if (totals.lic > licBefore) licYou++;
if (sub.some(s => /went on above you/.test(s.text))) skipYou++;
}
quiet = false;
renderWaveTable();
const after = you.level;
steps.push({ kind: 'lic', text: `${bought} positions each bought one level, shallow to deep.` });
steps.push({ kind: after > before ? 'lic' : 'cash', text: after > before
? `YOU went from level ${before} to ${after} without buying anything: ${licYou} licence${licYou === 1 ? '' : 's'} were funded from below.`
: (before >= DEPTHS
? `YOU stayed at level ${before}: your org is only ${DEPTHS} deep, and licence ${before + 1} is funded by a depth-${before} position buying level ${before + 1}. Nothing that deep exists here. Grow the org to keep climbing.`
: `YOU stayed at level ${before}: nothing at depth ${before} bought level ${before + 1} this wave.`) });
steps.push({ kind: 'cash', text: `Cash to you this wave: ${$$(totals.cash - cashBefore)}.` });
if (skipYou) steps.push({ kind: 'skip', text: `${skipYou} payment${skipYou === 1 ? '' : 's'} went on above you: levels that pay uplines higher than you. Not a miss.` });
addLog(steps, 'Wave');
renderLast(null, null, null, '<b>Wave:</b> ' + steps.map(s => s.text).join(' '), after > before ? 'lic' : 'cash');
paintPays();
}
function renderWaveTable(){
const box = document.getElementById('waveBox'), tb = document.querySelector('#waveTable tbody');
if (!box || !tb || !tally) return;
tb.innerHTML = '';
for (const d of Object.keys(tally).map(Number).sort((a, b) => a - b)) {
const t = tally[d];
const toYou = [t.youLic ? '<span class="chip lic">' + t.youLic + ' licence' + (t.youLic > 1 ? 's' : '') + '</span>' : '', t.youCash ? '<b>' + $$(t.youCash) + '</b>' : ''].filter(Boolean).join(' + ') || '—';
const others = Object.keys(t.cash).concat(Object.keys(t.lic)).filter((v, i, a) => a.indexOf(v) === i).map(Number).sort((a, b) => a - b)
.map(k => 'depth ' + k + ': ' + (t.cash[k] ? $$(t.cash[k]) : '') + (t.lic[k] ? (t.cash[k] ? ' + ' : '') + t.lic[k] + ' licence' + (t.lic[k] > 1 ? 's' : '') : '')).join('<br>') || '—';
const tr = document.createElement('tr');
const above = [t.above ? $$(t.above) : '', t.licUp ? $$(t.licUp) + ' <span class="note">(your licence cost, climbing)</span>' : ''].filter(Boolean).join(' + ') || '—';
tr.innerHTML = '<td>' + d + '</td><td>' + t.L + ' (' + $$(price(t.L)) + ')</td><td>' + t.n + '</td><td>' + toYou + '</td><td style="text-align:left">' + others + '</td><td>' + above + '</td>';
tb.appendChild(tr);
}
box.hidden = false;
}
function addLog(steps, head){
const ol = document.getElementById('logList');
if (ol.firstChild && /Nothing yet|Reset\./.test(ol.firstChild.textContent)) ol.innerHTML = '';
const h = document.createElement('li'); h.className = 'head'; h.textContent = head; ol.prepend(h);
let after = h;
for (const s of steps) {
const li = document.createElement('li');
const chip = document.createElement('span'); chip.className = 'chip ' + s.kind; chip.textContent = s.kind === 'lic' ? 'licence' : s.kind === 'skip' ? 'skip' : 'cash';
li.appendChild(chip); li.appendChild(document.createTextNode(' ' + s.text));
after.after(li); after = li;
}
while (ol.children.length > 60) ol.removeChild(ol.lastChild);
}
function clearLog(msg){ document.getElementById('logList').innerHTML = `<li class="head">${msg}</li>`; }
const lastShown = {};
function setV(id, text){
const el = document.getElementById(id); if (!el) return;
if (lastShown[id] !== undefined && lastShown[id] !== text) { el.classList.remove('bump'); void el.offsetWidth; el.classList.add('bump'); }
lastShown[id] = text; el.textContent = text;
}
function renderTotals(){
if (!you) return;
setV('mLevel', you.level);
const sl = document.getElementById('youLevel'); if (sl && Number(sl.value) !== you.level && you.level <= Number(sl.max)) { sl.value = you.level; document.getElementById('youLevelVal').textContent = you.level; }
const mr = document.getElementById('mReach'); if (mr) mr.textContent = you.level;
setV('mEntry', $$(totals.entry));
const en = document.getElementById('mEntryN'); if (en) en.textContent = you.children.length + ' directs × ' + $$(net(1)) + ' (the ' + $$(price(1)) + ' entry after the fee), no qualification';
setV('mCash', $$(totals.cash));
const cn = document.getElementById('mCashN'); if (cn) cn.textContent = totals.cashN + ' payment' + (totals.cashN === 1 ? '' : 's');
setV('mLic', totals.lic);
const lv = document.getElementById('mLicV'); if (lv) lv.textContent = 'worth ' + $$(totals.licV) + ', paid by your org';
setV('mTotal', $$(totals.entry + totals.cash + totals.licV));
setV('mFuel', $$(AUD.treasury)); const fs = document.getElementById('mFuelS'); if (fs) fs.textContent = PLAN.fee ? Math.round(PLAN.fee * 100) + '% out of every price; the other ' + Math.round((1 - PLAN.fee) * 100) + '% climbs' : 'no fee: the whole price climbs';
const ol = document.getElementById('youLedger');
if (ol) {
ol.innerHTML = '';
if (!youLedger.length) ol.innerHTML = '<li><span>Nothing yet.</span><span></span></li>';
for (const e of youLedger.slice(0, 10)) {
const li = document.createElement('li');
li.innerHTML = '<span><span class="chip ' + e.kind + '">' + (e.kind === 'lic' ? 'licence' : 'cash') + '</span> ' + (e.kind === 'lic' ? 'your licence ' + e.L + ', funded by ' : 'level-' + e.L + ' money from ') + name(e.from) + '</span><span>' + (e.kind === 'lic' ? 'licence ' + e.L + ' (' + $$(e.amt) + ')' : '+' + $$(e.amt)) + '</span>';
ol.appendChild(li);
}
}
const ln = document.getElementById('ledgerNote'); if (ln) ln.textContent = 'Each position pays you at most once per level, so the count is what matters: at level L there are ' + PLAN.w + '^' + '(L−1) positions at the depth that pays you, and each pays the level-L price.';
ladder();
}
document.getElementById('youLevel').addEventListener('input', e => {
document.getElementById('youLevelVal').textContent = e.target.value;
you.level = Number(e.target.value); refreshNode(you); paintReach(); paintPays(); renderTotals();
});
document.getElementById('wave').addEventListener('click', wave);
function at(path){ let n = you; for (const ch of path) n = n.children[ch === 'L' ? 0 : 1]; return n; }
const TOUR = [
{ step: 'Step 1 of 7 · your licence', say: 'You hold level 1, like every new member, and so do your directs (labelled). Their entries already paid you. Your FIRST direct buys level 2. Level-2 money pays the first upline, which is you, and you hold exactly one level below, so this payment IS your licence 2: you are upgraded in the same transaction and the money continues above you. No cash yet.',
act: () => buy(at('L')) },
{ step: 'Step 2 of 7 · cash', say: 'Your SECOND direct buys level 2. You now hold level 2, so this one is cash: the level-2 price to you. Watch the bar.',
act: () => buy(at('R')) },
{ step: 'Step 3 of 7 · not yours', say: 'A grandchild, under your first direct, buys level 2. Level-2 money stops at the FIRST upline, its own parent, who already holds level 2, so it is that parent\'s cash and never reaches you. That is why the rings matter: a position pays you only at the one level that maps to its depth.',
act: () => buy(at('LL')) },
{ step: 'Step 4 of 7 · your licence 3', say: 'The same grandchild buys level 3. Level-3 money skips one upline and lands on you; you hold level 2, exactly one below, so this is your licence 3. The amber band steps down a depth and the rings move.',
act: () => buy(at('LL')) },
{ step: 'Step 5 of 7 · cascade', say: 'One purchase can pay two people. A depth-3 position under your second direct buys level 2. It pays its parent (depth 2), who holds exactly level 1: that parent gets licence 2, and the parent\'s own level-2 cost climbs to your second direct as cash. One buyer, one licence issued, one cash payment.',
act: () => buy(at('RLL')) },
{ step: 'Step 6 of 7 · skipped', say: 'Your first direct now has NO directs of its own (dashed). Its other child buys level 2. That money would pay the parent, but the parent has recruited nobody, so cash passes over it and keeps climbing: you catch it. Qualification decides who is skipped; it never holds money back. (With one direct, the half step would let the parent keep this one.)',
act: () => { const l = at('L'); l.directs = 0; refreshNode(l); paintPays(); buy(at('LR')); } },
{ step: 'Step 7 of 7 · the wave', say: 'Everything at once: every position buys one level, shallow to deep. Read the table that appears under the strip: one row per depth, where that depth\'s money went. Then press Run a wave again and watch your level climb without buying anything.',
act: () => wave() },
{ step: 'Done', say: 'That is the whole plan. Now switch the gap rule and the width at the top and run waves again: the tree resets, and the difference shows up in the money bar.', act: null }
];
let ti = -1;
function tourShow(){
const t = TOUR[ti]; document.getElementById('tourStep').textContent = t.step; document.getElementById('tourSay').textContent = t.say;
const nx = document.getElementById('tourNext'); nx.hidden = false; nx.textContent = t.act ? 'Show me' : 'Finish';
document.getElementById('tourStart').textContent = 'Restart tour';
}
document.getElementById('tourStart').addEventListener('click', () => { document.getElementById('youLevel').value = 1; document.getElementById('youLevelVal').textContent = '1'; build(); ti = 0; tourShow(); });
document.getElementById('tourNext').addEventListener('click', () => {
const t = TOUR[ti];
if (t.act) { t.act(); }
if (ti < TOUR.length - 1) { ti++; tourShow(); }
else { document.getElementById('tourNext').hidden = true; }
});
document.getElementById('reset').addEventListener('click', () => { document.getElementById('youLevel').value = 1; document.getElementById('youLevelVal').textContent = '1'; build(); });
document.getElementById('grow').addEventListener('click', grow);
function depthLabel(){ const el = document.getElementById('depthLabel'); if (el) el.textContent = DEPTHS + ' deep, ' + cnt(nodes.length - 1) + ' positions'; const g = document.getElementById('grow'); if (g) g.disabled = DEPTHS >= MAXD[PLAN.w]; }
function grow(){
if (DEPTHS >= MAXD[PLAN.w]) return;
const leaves = nodes.filter(n => n.depth === DEPTHS);
DEPTHS++;
let entries = 0;
for (const n of leaves) for (let k = 0; k < PLAN.w; k++) { mkNode(n.depth + 1, n, n.idx * PLAN.w + k); entries += net(1); }
geometry(); layout(); draw(); paintPays(); renderTotals(); depthLabel();
addLog([{ kind: 'lic', text: `The org is now ${DEPTHS} deep: ${leaves.length * PLAN.w} new level-1 positions joined at the bottom and paid ${$$(entries)} of entries to the row above. Everything else is as it was.` }], 'Grew one depth');
}
// ── ladder table ──
const priceEl = document.getElementById('price');
function ladder(){
document.getElementById('priceVal').textContent = '$' + priceEl.value;
const tb = document.querySelector('#ladder tbody'); if (!tb) return; tb.innerHTML = '';
const rows = [1]; const top = Math.min(12, PLAN.maxL);
for (let L = 2; L <= top; L++) rows.push(L);
if (PLAN.maxL > 12) rows.push('gap', 20, 'gap', PLAN.maxL);
let climb = 0; for (let L = 1; L <= PLAN.maxL; L++) climb += price(L);
for (const L of rows) {
const tr = document.createElement('tr');
if (L === 'gap') { tr.className = 'gap'; tr.innerHTML = '<td colspan="6">⋮</td>'; tb.appendChild(tr); continue; }
const d = L === 1 ? 1 : L - 1, pos = Math.pow(PLAN.w, d);
if (you && L === you.level + 1) tr.className = 'you';
tr.innerHTML = `<td>${L}${you && L === you.level + 1 ? ' <span class="chip lic">your next</span>' : ''}</td><td style="text-align:left">${product(L)} <span class="note">placeholder</span></td><td>${L === 1 ? 'entries from depth 1, no qualification' : 'depth ' + d + ', buying level ' + L}</td><td>${cnt(pos)}</td><td>${$$(pos * net(L))}</td><td>${$$(price(L))}${L === 1 ? ' <span class="note">everyone pays this to enter</span>' : ' <span class="note">or the first payment from depth ' + d + '</span>'}</td>`;
tb.appendChild(tr);
}
const ln = document.getElementById('ladderNote'); if (ln) ln.textContent = PLAN.w + '-wide, ' + PLAN.maxL + ' levels. Potential is one payment from every position at the depth that pays that level, so it grows ' + PLAN.w + '× per level on its own; the price ladder only sets the dollars, and ' + Math.round(PLAN.fee * 100) + '% of every price goes to the admin wallet before anything climbs. Climbing all ' + PLAN.maxL + ' levels yourself would cost ' + $$(climb) + ', which nobody has to do: the first payment at each depth is the licence.';
}
priceEl.addEventListener('input', () => { renderTotals(); for (const n of nodes) refreshNode(n); if (dp) deepRender(); });
// ── deep simulator: the same rules on counts per depth ──
let dp = null;
function deepReset(){
const fill = Number(document.getElementById('deepFill').value) / 100, D = PLAN.maxL;
dp = { D, levels: [], counts: [], lic: [], licV: [], cash: [], entry: [], pays: [], waves: 0, above: 0, spent: 0, treasury: 0 };
window.deepAudit = () => { const rec = dp.cash.reduce((a, b) => a + b, 0) + dp.entry.reduce((a, b) => a + b, 0) + dp.above + dp.treasury; return { spent: Math.round(dp.spent), received: Math.round(rec), ok: Math.abs(dp.spent - rec) <= 1 + 1e-9 * dp.spent }; };
for (let d = 0; d <= D; d++) {
dp.levels[d] = 1;
dp.counts[d] = d === 0 ? 1 : Math.max(1, Math.round(Math.pow(PLAN.w * fill, d)));
dp.lic[d] = 0; dp.licV[d] = 0; dp.cash[d] = 0; dp.entry[d] = 0; dp.pays[d] = 0;
}
for (let d = 1; d <= D; d++) { dp.entry[d - 1] += dp.counts[d] * net(1); dp.spent += dp.counts[d] * price(1); dp.treasury += dp.counts[d] * price(1) * PLAN.fee; } // Rule 0, once, when the org is built
deepRender('Reset. Everyone at level 1, you included; entries paid.');
}
// n payments of `amt` for level L from depth `from`: skip `skipN`, then the gap rule on aggregate levels
function deepPay(n, from, L, amt, skipN, rem){
if (n <= 0) return;
let r = from - 1 - skipN;
while (r >= 0 && !(rem ? dp.levels[r] >= L : (PLAN.gap === 'fund' || dp.levels[r] >= L - 1))) r--;
if (r < 0) { dp.above += n * amt; return; }
if (dp.levels[r] >= L) { dp.cash[r] += n * amt; dp.pays[r] += n; return; }
const nl = dp.levels[r] + 1, cost = net(nl);
const granted = Math.min(dp.counts[r], n);
dp.lic[r] += granted; dp.licV[r] += granted * cost; dp.levels[r] = nl;
deepPay(granted, r, nl, cost, nl - 2); // the licence costs climb from depth r
if (amt - cost > 0.005) deepPay(granted, r, L, amt - cost, 0, true); // the remainder climbs on, cash only
deepPay(n - granted, from, L, amt, skipN); // the rest of this depth's payments, now that r has moved up
}
function deepWave(){
if (!dp) deepReset();
for (let d = 1; d <= dp.D; d++) { const L = dp.levels[d] + 1; if (L > PLAN.maxL) continue; dp.spent += dp.counts[d] * price(L); dp.treasury += dp.counts[d] * price(L) * PLAN.fee; deepPay(dp.counts[d], d, L, net(L), L - 2); dp.levels[d] = Math.max(dp.levels[d], L); }
dp.waves++;
}
function deepRender(note){
document.getElementById('dLevel').textContent = dp.levels[0];
document.getElementById('dReach').textContent = Math.min(dp.levels[0], dp.D);
document.getElementById('dEntry').textContent = $$(dp.entry[0]);
document.getElementById('dCash').textContent = $$(dp.cash[0]);
document.getElementById('dCashN').textContent = cnt(dp.pays[0]) + ' payment' + (dp.pays[0] === 1 ? '' : 's');
document.getElementById('dLic').textContent = dp.lic[0];
document.getElementById('dLicV').textContent = 'worth ' + $$(dp.licV[0]);
document.getElementById('dWaves').textContent = dp.waves;
document.getElementById('dAbove').textContent = $$(dp.above);
document.getElementById('dFuel').textContent = $$(dp.treasury);
const tb = document.querySelector('#deepTable tbody'); tb.innerHTML = '';
const maxCash = Math.max(1, ...dp.cash.map((c, d) => d === 0 ? 0 : c));
for (let d = 0; d <= dp.D; d++) {
const tr = document.createElement('tr');
tr.className = d === 0 ? 'you' : d <= dp.levels[0] ? 'reach' : d === dp.levels[0] + 1 ? 'next' : '';
const per = dp.counts[d] ? (dp.cash[d] + dp.entry[d]) / dp.counts[d] : 0;
tr.innerHTML = '<td>' + (d === 0 ? 'YOU' : d) + '</td><td>' + cnt(dp.counts[d]) + '</td><td>' + dp.levels[d] + '</td><td>' + cnt(dp.lic[d]) + '</td><td>' + $$(dp.entry[d]) + '</td><td>' + $$(dp.cash[d]) + '</td>'
+ '<td class="bar">' + (d === 0 ? '' : '<i style="width:' + Math.round(100 * dp.cash[d] / maxCash) + '%"></i>') + '</td><td>' + $$(per) + '</td>';
tb.appendChild(tr);
}
if (note) document.getElementById('deepNote').textContent = note;
}
function deepRun(k){
const before = dp ? dp.levels[0] : 1; let ran = 0;
for (let i = 0; i < k; i++) { if (dp && dp.levels[0] >= PLAN.maxL) break; deepWave(); ran++; }
const after = dp.levels[0];
deepRender(ran + ' wave' + (ran === 1 ? '' : 's') + ' run. ' + (after > before ? 'You went from level ' + before + ' to ' + after + ' without buying anything: the first payment at each new depth was your licence.' : after >= PLAN.maxL ? 'You hold level ' + PLAN.maxL + ', the top of the ladder. Every payment from every depth is cash from here on.' : 'Your level did not move this time.'));
}
document.getElementById('deepWave').addEventListener('click', () => deepRun(1));
document.getElementById('deepWave5').addEventListener('click', () => deepRun(5));
document.getElementById('deepToTop').addEventListener('click', () => deepRun(80));
document.getElementById('deepReset').addEventListener('click', deepReset);
document.getElementById('deepFill').addEventListener('input', e => { document.getElementById('deepFillVal').textContent = e.target.value + '%'; deepReset(); });
// ── plan controls ──
function applyPlan(){
PLAN.w = Number(document.getElementById('width').value);
PLAN.maxL = Number(document.getElementById('levels').value);
PLAN.shape = document.getElementById('shape').value;
PLAN.steps = document.getElementById('steps').value.split(',').map(s => Number(s.trim())).filter(n => n > 0);
PLAN.products = document.getElementById('products').value.split(',').map(s => s.trim()).filter(Boolean);
PLAN.fee = Number(document.getElementById('fee').value) || 0;
if (!PLAN.steps.length) PLAN.steps = [10];
document.getElementById('stepsCtl').hidden = PLAN.shape !== 'stepped';
document.getElementById('priceCtl').hidden = PLAN.shape === 'stepped';
document.getElementById('gapSkip').setAttribute('aria-pressed', String(PLAN.gap === 'skip'));
document.getElementById('gapFund').setAttribute('aria-pressed', String(PLAN.gap === 'fund'));
document.getElementById('unqSkip').setAttribute('aria-pressed', String(PLAN.unq === 'skip'));
document.getElementById('unqLic').setAttribute('aria-pressed', String(PLAN.unq === 'licence'));
document.getElementById('halfOff').setAttribute('aria-pressed', String(!PLAN.half));
document.getElementById('halfOn').setAttribute('aria-pressed', String(PLAN.half));
document.getElementById('wmOff').setAttribute('aria-pressed', String(!PLAN.wm));
document.getElementById('wmOn').setAttribute('aria-pressed', String(PLAN.wm));
const yl = document.getElementById('youLevel'); yl.max = PLAN.maxL; yl.value = 1; // a new plan starts you at level 1, like everyone
document.getElementById('youLevelVal').textContent = yl.value;
document.getElementById('deepHead').textContent = 'All ' + PLAN.maxL + ' levels, simulated by depth';
svg.setAttribute('aria-label', PLAN.w + '-wide matrix under you');
build(); deepReset();
}
for (const id of ['width', 'levels', 'shape']) document.getElementById(id).addEventListener('change', applyPlan);
document.getElementById('steps').addEventListener('change', applyPlan);
document.getElementById('products').addEventListener('change', applyPlan);
document.getElementById('fee').addEventListener('change', applyPlan);
document.getElementById('gapSkip').addEventListener('click', () => { PLAN.gap = 'skip'; applyPlan(); });
document.getElementById('gapFund').addEventListener('click', () => { PLAN.gap = 'fund'; applyPlan(); });
document.getElementById('unqSkip').addEventListener('click', () => { PLAN.unq = 'skip'; applyPlan(); });
document.getElementById('unqLic').addEventListener('click', () => { PLAN.unq = 'licence'; applyPlan(); });
document.getElementById('halfOff').addEventListener('click', () => { PLAN.half = false; applyPlan(); });
document.getElementById('halfOn').addEventListener('click', () => { PLAN.half = true; applyPlan(); });
document.getElementById('wmOff').addEventListener('click', () => { PLAN.wm = false; applyPlan(); });
document.getElementById('wmOn').addEventListener('click', () => { PLAN.wm = true; applyPlan(); });
applyPlan();
})();
+281
View File
@@ -0,0 +1,281 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="robots" content="noindex,nofollow">
<title>Reach Ladder · plan lab</title>
<meta name="description" content="Working simulator for the new matrix plan. Unlisted; shared by link only.">
</head>
<body>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap">
<style>
:root{
--bg:#F3F5F8; --paper:#FFFFFF; --ink:#18222D; --muted:#5C6B7A; --line:#D7DEE6; --soft:#E9EEF3;
--cash:#6D3FD1; --cash-soft:#EEE7FB; --lic:#D3821A; --lic-soft:#FBEFDD; --reach:#2A8A78; --reach-soft:#DDF1EC;
--skip:#B9463C; --skip-soft:#F8E3E0; --you:#18222D;
--font-d:"Bricolage Grotesque","Avenir Next","Segoe UI",sans-serif;
--font-b:"IBM Plex Sans","Segoe UI",system-ui,sans-serif;
--font-m:"IBM Plex Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
--bg:#10161C; --paper:#171E26; --ink:#E9EEF3; --muted:#9AA8B6; --line:#2C3743; --soft:#1F2833;
--cash:#A88BF0; --cash-soft:#2A2340; --lic:#F0A94A; --lic-soft:#3A2A14; --reach:#5FC7B2; --reach-soft:#16302B;
--skip:#EF8A80; --skip-soft:#3B1F1C; --you:#E9EEF3;
}}
:root[data-theme="dark"]{
--bg:#10161C; --paper:#171E26; --ink:#E9EEF3; --muted:#9AA8B6; --line:#2C3743; --soft:#1F2833;
--cash:#A88BF0; --cash-soft:#2A2340; --lic:#F0A94A; --lic-soft:#3A2A14; --reach:#5FC7B2; --reach-soft:#16302B;
--skip:#EF8A80; --skip-soft:#3B1F1C; --you:#E9EEF3;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 var(--font-b);padding-block:28px 60px;padding-inline:clamp(16px,4vw,40px)}
.wrap{max-width:1120px;margin:0 auto}
h1,h2,h3{font-family:var(--font-d);text-wrap:balance;margin:0}
h1{font-size:clamp(30px,4.6vw,46px);font-weight:800;line-height:1.05;letter-spacing:-.01em}
h2{font-size:22px;font-weight:700;margin-bottom:6px}
h3{font-size:15px;font-weight:700}
.eyebrow{font-family:var(--font-m);font-size:11.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.lede{max-width:64ch;font-size:17px;color:var(--ink);margin:14px 0 0}
.lede b{font-weight:600}
section{margin-top:44px}
p{max-width:68ch}
.note{color:var(--muted);font-size:13.5px}
.tabular{font-variant-numeric:tabular-nums}
.mono{font-family:var(--font-m)}
.rules{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-top:16px}
.rule{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.rule .n{font-family:var(--font-m);font-size:11px;color:var(--muted);letter-spacing:.1em}
.rule h3{margin:4px 0 6px}
.rule p{font-size:13.5px;color:var(--muted);margin:0}
.chip{display:inline-block;padding:1px 8px;border-radius:999px;font-family:var(--font-m);font-size:11.5px;font-weight:500;vertical-align:1px}
.chip.cash{background:var(--cash-soft);color:var(--cash)}
.chip.lic{background:var(--lic-soft);color:var(--lic)}
.chip.reach{background:var(--reach-soft);color:var(--reach)}
.chip.skip{background:var(--skip-soft);color:var(--skip)}
.panel{background:var(--paper);border:1px solid var(--line);border-radius:16px;padding:18px 20px}
.controls{display:flex;flex-wrap:wrap;gap:14px 24px;align-items:end;margin-top:14px}
.ctl label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:4px}
.ctl input[type=range]{width:220px;max-width:60vw;accent-color:var(--reach)}
.ctl .val{font-family:var(--font-m);font-size:13px;margin-left:8px}
select{font:inherit;font-weight:600;border:1px solid var(--line);background:var(--soft);color:var(--ink);border-radius:9px;padding:8px 10px}
button{font:inherit;font-weight:600;border:1px solid var(--line);background:var(--soft);color:var(--ink);border-radius:9px;padding:8px 13px;cursor:pointer}
button:hover{border-color:var(--muted)}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--reach);outline-offset:2px}
button.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.seg button{border:0;border-radius:0;background:var(--paper)}
.seg button[aria-pressed=true]{background:var(--ink);color:var(--bg)}
.treewrap{overflow-x:auto;margin-top:16px;border:1px solid var(--line);border-radius:12px;background:var(--paper)}
svg{display:block;width:100%;height:auto;min-width:980px}
.band{opacity:.55}
.bandlabel{font:500 11.5px var(--font-m);fill:var(--muted)}
.edge{stroke:var(--line);stroke-width:1.4;fill:none}
.edge.hot-cash{stroke:var(--cash);stroke-width:3}
.edge.hot-lic{stroke:var(--lic);stroke-width:3}
.edge.hot-skip{stroke:var(--skip);stroke-width:2.2;stroke-dasharray:4 3}
.node{cursor:pointer}
.node circle{fill:var(--paper);stroke:var(--ink);stroke-width:1.5}
.node.unq circle{stroke-dasharray:3 2;stroke:var(--skip)}
.node.you circle{fill:var(--ink)}
.node text{font:600 11px var(--font-m);fill:var(--ink);text-anchor:middle;dominant-baseline:central;pointer-events:none}
.node.you text{fill:var(--bg)}
.node.flash-cash circle{fill:var(--cash-soft);stroke:var(--cash);stroke-width:3}
.node.flash-lic circle{fill:var(--lic-soft);stroke:var(--lic);stroke-width:3}
.node.flash-skip circle{fill:var(--skip-soft)}
.node.flash-src circle{stroke-width:3;stroke:var(--reach)}
.node.pays circle{stroke:var(--reach);stroke-width:3.5;filter:drop-shadow(0 0 3px var(--reach))}
.node.pays.you circle{filter:none}
.pop{position:fixed;z-index:60;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:10px 12px;box-shadow:0 10px 28px rgba(0,0,0,.22);font-size:13px;width:250px}
.pop .t{font-family:var(--font-m);font-size:11.5px;color:var(--muted)}
.pop .hint{margin:6px 0 8px;line-height:1.4}
.pop .hint b{color:var(--reach)}
.pop button{display:block;width:100%;margin-top:6px;text-align:left}
.last{margin-top:12px;padding:12px 14px;border-radius:12px;background:var(--soft);font-size:14.5px;line-height:1.5;border-left:4px solid var(--line)}
.last.cash{border-left-color:var(--cash)} .last.lic{border-left-color:var(--lic)} .last.none{border-left-color:var(--skip)}
.last .why{display:block;margin-top:4px;color:var(--muted);font-size:13px}
.money{position:sticky;top:8px;z-index:5;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 14px;background:var(--paper);border:1.5px solid var(--reach);border-radius:12px;padding:10px 14px;margin:0 0 12px;box-shadow:0 8px 22px rgba(0,0,0,.10)}
.money .k{font-family:var(--font-m);font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.money .v{font:700 24px/1.15 var(--font-d);font-variant-numeric:tabular-nums;margin-top:2px}
.money .v.cash{color:var(--cash)} .money .v.lic{color:var(--lic)}
.money .s{font-size:12px;color:var(--muted);margin-top:1px}
.money .v.bump{animation:bump .55s ease-out}
@keyframes bump{0%{transform:scale(1.18)}100%{transform:scale(1)}}
@media (prefers-reduced-motion: reduce){.money .v.bump{animation:none}}
.money .ctl label{font-size:10.5px;font-family:var(--font-m);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.money .ctl input[type=range]{width:150px}
.node text.mny{font:600 9px var(--font-m);fill:var(--cash);text-anchor:middle;dominant-baseline:hanging;pointer-events:none}
.ledger{list-style:none;margin:8px 0 0;padding:0;font-size:13.5px}
.ledger li{display:flex;justify-content:space-between;gap:10px;padding:5px 0;border-bottom:1px dashed var(--line)}
.ledger li span:last-child{font-family:var(--font-m);font-variant-numeric:tabular-nums;white-space:nowrap}
.deep-sum{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 14px;margin:12px 0}
.deep-sum .k{font-family:var(--font-m);font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.deep-sum .v{font:700 22px/1.15 var(--font-d);font-variant-numeric:tabular-nums}
.deep-sum .v.cash{color:var(--cash)} .deep-sum .v.lic{color:var(--lic)}
.deep-sum .s{font-size:12px;color:var(--muted)}
#deepTable tr.you td{background:var(--reach-soft);font-weight:600}
#deepTable tr.reach td:first-child{border-left:3px solid var(--reach)}
#deepTable tr.next td:first-child{border-left:3px solid var(--lic)}
#deepTable td.bar{padding:0 10px;min-width:120px}
#deepTable td.bar i{display:block;height:6px;border-radius:3px;background:var(--cash)}
.tour{margin-top:14px;border:1px solid var(--reach);background:var(--reach-soft);border-radius:12px;padding:12px 14px;display:grid;grid-template-columns:1fr auto;gap:10px 14px;align-items:center}
.tour .step{font-family:var(--font-m);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--reach)}
.tour .say{font-size:14.5px;line-height:1.5;margin-top:3px}
.tour .btns{display:flex;gap:8px;white-space:nowrap}
@media (max-width:640px){.tour{grid-template-columns:1fr}}
.legend{display:flex;flex-wrap:wrap;gap:10px 18px;margin-top:10px;font-size:13px;color:var(--muted)}
.legend span::before{content:"";display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:-1px}
.legend .l-cash::before{background:var(--cash)} .legend .l-lic::before{background:var(--lic)} .legend .l-reach::before{background:var(--reach)} .legend .l-skip::before{background:var(--skip)}
.two{display:grid;grid-template-columns:1.1fr .9fr;gap:16px;margin-top:16px}
@media (max-width:820px){.two{grid-template-columns:1fr}}
.log{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:12px 14px;max-height:330px;overflow:auto;font-size:13.5px}
.log ol{margin:0;padding-left:0;list-style:none}
.log li{margin:6px 0}
.log li.head{font-weight:600;padding-top:6px;border-top:1px dashed var(--line)}
.log li.head:first-child{border-top:0;padding-top:0}
.totals{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
.tot{background:var(--soft);border-radius:10px;padding:10px 12px}
.tot .k{font-size:12px;color:var(--muted)}
.tot .v{font:700 24px var(--font-d);font-variant-numeric:tabular-nums}
.tot .v small{font:500 12px var(--font-m);color:var(--muted)}
table{border-collapse:collapse;width:100%;font-size:13.5px}
th,td{padding:7px 10px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
th:first-child,td:first-child,th:nth-child(2),td:nth-child(2){text-align:left}
th{font-family:var(--font-m);font-weight:500;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
tr.gap td{text-align:center;color:var(--muted);font-family:var(--font-m);border-bottom:0}
tr.you td{background:var(--reach-soft)}
.tablewrap{overflow-x:auto;margin-top:12px}
.compare{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}
@media (max-width:700px){.compare{grid-template-columns:1fr}}
.cmp{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:var(--paper)}
.cmp h3{font-size:17px;margin-bottom:8px}
.cmp ul{margin:0;padding-left:18px;font-size:14px}
.cmp li{margin:5px 0}
.cmp.new{border-color:var(--reach)}
.fine{margin-top:36px;font-size:12.5px;color:var(--muted);max-width:70ch}
@media (prefers-reduced-motion: reduce){ .node circle,.edge{transition:none} }
.ctl input[type=text]{max-width:100%;box-sizing:border-box} .controls .ctl{max-width:100%;min-width:0} .money{min-width:0}
@media (max-width:640px){.ctl input[type=text]{width:100%} .ctl select{max-width:100%}}
.node circle,.edge{transition:stroke .25s,fill .25s,stroke-width .25s}
</style>
<div class="wrap">
<div class="eyebrow">Compensation plan · working draft · 27 Sep 2026</div>
<h1>Your reach is your level. Width does the rest.</h1>
<p class="lede">A forced matrix with the same two-directs rule to receive, and three things RM Circle does not have: <b>every payment that reaches you is either cash or your next licence, and the contract knows which</b>; the matrix can be wider than two, so the people you build sit within your reach instead of 28 deep; and prices step up with the product, never double. The working plan is 4 wide, 8 levels, a stepped ladder and the fund-the-gap rule; the other settings are there to compare against.</p>
<section>
<h2>Eight rules, and nothing else</h2>
<div class="rules">
<div class="rule"><div class="n">PLACEMENT</div><h3>Shallowest open slot under your recruiter</h3><p>Your sponsor is the person whose link you used, always. You are placed in the shallowest open slot in their organisation, breadth-first, so orgs fill wide before they fill deep. Decided 27 Sep.</p></div>
<div class="rule"><div class="n">RULE 0</div><h3>Level 1 is the entry</h3><p>Everyone pays the same to come in. After the admin fee, half goes to the recruiter and half to the upline directly above the placement, no qualification, never a licence. Someone with no recruiter is assigned to a member who needs a direct. (In this drawn tree every position was recruited by its upline, so both halves land there.)</p></div>
<div class="rule"><div class="n">RULE 1</div><h3>A level-L purchase pays one upline</h3><p>Skip the first L−2 uplines outright. Then pay the first one with two directs. Same climb as RM Circle today.</p></div>
<div class="rule"><div class="n">RULE 2</div><h3>So depth d pays you when it buys level d+1</h3><p>The positions at depth d under you are the ones whose level-(d+1) purchases land on you. Depth 1 also pays you its entries.</p></div>
<div class="rule"><div class="n">RULE 3</div><h3>Reach = your level</h3><p>At level A you collect cash from depths 1 to A. The first payment from depth A is your next licence. Deeper money routes past you, for now.</p></div>
<div class="rule"><div class="n">RULE 4</div><h3>The gap rule</h3><p><b>Fund the gap</b> (decided 27 Sep, with the stepped ladder): a payment that reaches someone more than one level behind buys their next <span class="chip lic">licence</span>, and the remainder climbs on as <span class="chip cash">cash</span>. Nobody qualified is ever skipped. The RM Circle skip is kept as a switch for comparison only.</p></div>
<div class="rule"><div class="n">RULE 5</div><h3>Licences reach everyone, cash reaches the qualified</h3><p>A pass-up that reaches a member with fewer than two directs buys their next <span class="chip lic">licence</span>; the cost climbs on. Cash steps up with recruits: no directs, entries only; one direct, cash from depths 1 and 2; two directs, full reach. Each step counts from the moment it was reached: cash comes from your own directs and from positions created after it. Positions that passed you before keep passing you.</p></div>
<div class="rule"><div class="n">RULE 6</div><h3>The licence cascades, the contract holds nothing</h3><p>When a licence is issued, its cost moves up that member's chain by Rule 1 and lands on the first person already at that level. Every coin leaves in the block it arrived.</p></div>
</div>
</section>
<section>
<h2>Simulator</h2>
<p class="note">You are the black node. <b>Click any position</b>: a small menu tells you where its next purchase would go <em>before</em> you buy, then lets you buy it or mark it as having one direct (dashed, gets skipped). The strip under the tree says in plain words what each purchase did. <b>Run a wave</b> has the whole organisation buy one level, shallow to deep, so you can watch your own level climb without buying anything.</p>
<div class="panel">
<div class="money" id="money">
<div class="m"><div class="k">Your level</div><div class="v" id="mLevel">1</div><div class="s">reach = depth 1 to <span id="mReach">1</span></div></div>
<div class="m"><div class="k">Entries to you</div><div class="v" id="mEntry">$0</div><div class="s" id="mEntryN">from your directs, no qualification</div></div>
<div class="m"><div class="k">Cash to you</div><div class="v cash" id="mCash">$0</div><div class="s" id="mCashN">0 payments</div></div>
<div class="m"><div class="k">Licences funded for you</div><div class="v lic" id="mLic">0</div><div class="s" id="mLicV">worth $0, paid by your org</div></div>
<div class="m"><div class="k">Total received</div><div class="v" id="mTotal">$0</div><div class="s">entries + cash + licences</div></div>
<div class="m"><div class="k">Admin fee, to the receiver wallet</div><div class="v" id="mFuel">$0</div><div class="s" id="mFuelS">20% out of every price</div></div>
</div>
<div class="controls" id="planRow">
<div class="ctl"><label for="width">Matrix width</label><select id="width"><option value="2">2 wide</option><option value="3">3 wide</option><option value="4" selected>4 wide</option><option value="5">5 wide</option></select></div>
<div class="ctl"><label for="levels">Levels</label><select id="levels"><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="8" selected>8</option><option value="10">10</option><option value="12">12</option><option value="30">30</option></select></div>
<div class="ctl"><label for="shape">Price ladder</label><select id="shape"><option value="stepped" selected>Stepped, by product tier</option><option value="flat">Flat, every level P</option><option value="linear">Linear, P × level</option><option value="ratio">×1.25 per level</option></select></div>
<div class="ctl" id="stepsCtl"><label for="steps">Prices per level, $</label><input id="steps" type="text" value="10,20,50,100,175,300,500,750" size="30" style="font:inherit;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--ink)"></div>
<div class="ctl"><label for="products">Product per level (placeholders)</label><input id="products" type="text" value="Widget 1,Widget 2,Widget 3,Widget 4,Widget 5,Widget 6,Widget 7,Widget 8" size="44" style="font:inherit;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--ink)"></div>
<div class="ctl"><label for="fee">Admin fee, out of every price</label><select id="fee"><option value="0">none</option><option value="0.10">10%</option><option value="0.20" selected>20%, same as InstantAdPay</option><option value="0.30">30%</option></select></div>
<div class="ctl" id="priceCtl" hidden><label for="price">Level-1 price P</label><div><input id="price" type="range" min="5" max="250" step="5" value="25"><span class="val" id="priceVal">$25</span></div></div>
<div class="ctl"><label>Gap rule</label><div class="seg" role="group" aria-label="Gap rule"><button type="button" id="gapSkip" aria-pressed="false">RM Circle skip</button><button type="button" id="gapFund" aria-pressed="true">Fund the gap</button></div></div>
<div class="ctl"><label>Unqualified members</label><div class="seg" role="group" aria-label="Unqualified members"><button type="button" id="unqSkip" aria-pressed="false">Skipped</button><button type="button" id="unqLic" aria-pressed="true">Licences, never cash</button></div></div>
<div class="ctl"><label>One-direct half step</label><div class="seg" role="group" aria-label="Half step"><button type="button" id="halfOff" aria-pressed="false">Off: cash needs two</button><button type="button" id="halfOn" aria-pressed="true">On: one direct = depths 1-2</button></div></div>
<div class="ctl"><label>Late qualifiers</label><div class="seg" role="group" aria-label="Late qualifiers"><button type="button" id="wmOff" aria-pressed="false">Cash from everyone</button><button type="button" id="wmOn" aria-pressed="true">Cash from new positions only</button></div></div>
</div>
<div class="controls">
<div class="ctl"><label for="youLevel">Your level (set by hand)</label><input id="youLevel" type="range" min="1" max="8" value="1"><span class="val" id="youLevelVal">1</span></div>
<div class="ctl"><label>Org depth · <span id="depthLabel"></span></label><button id="grow">Grow one depth deeper (keeps everything)</button></div>
<div class="ctl"><label>&nbsp;</label><button class="primary" id="wave">Run a wave</button></div>
<div class="ctl"><label>&nbsp;</label><button id="reset">Reset</button></div>
</div>
<div class="legend"><span class="l-reach"><b>glowing ring = this position's next purchase lands on you</b></span><span class="l-reach">shaded band = within your reach</span><span class="l-cash">cash to the recipient</span><span class="l-lic">licence issued (cost keeps climbing)</span><span class="l-skip">skipped: one direct, or behind the level under the skip rule</span></div>
<div class="tour" id="tour">
<div><div class="step" id="tourStep">Guided tour</div><div class="say" id="tourSay">Seven clicks, one rule each: cash, licence, cascade, skip, "not yours", and the wave. Press Start; the tree resets and each step tells you what to look at before it happens.</div></div>
<div class="btns"><button class="primary" id="tourStart">Start the tour</button><button id="tourNext" hidden>Next</button></div>
</div>
<div class="treewrap"><svg id="tree" viewBox="0 0 1400 470" aria-label="Matrix under you"></svg></div>
<div class="last" id="last">Nothing bought yet. Click a ringed position first: its money reaches you.</div>
<div id="waveBox" hidden>
<h3 style="margin-top:14px">Where this wave's money went, by the depth that bought</h3>
<div class="tablewrap"><table id="waveTable" class="tabular"><thead><tr><th>Depth</th><th>Bought level</th><th>Positions</th><th>To you</th><th>To others in your org</th><th>Above you</th></tr></thead><tbody></tbody></table></div>
<p class="note">A depth-d position pays <b>you</b> only when it buys level d+1. Anything else it buys pays someone between you and it, or someone above you. "Above you" is not lost money: it is the same rule paying your own upline.</p>
</div>
<div class="two">
<div>
<h3>Every step, in order</h3>
<div class="log" id="log"><ol id="logList"><li class="head">Nothing yet. Click a position, or run a wave.</li></ol></div>
</div>
<div>
<h3>Money that reached you, newest first</h3>
<ol class="ledger" id="youLedger"><li><span>Nothing yet.</span><span></span></li></ol>
<p class="note" style="margin-top:12px" id="ledgerNote"></p>
<p class="note">A wave pays you from every depth up to your reach, and the first payment from the depth at your reach is your next licence. Everyone starts at level 1, you included. In the first wave your directs buy level 2: the first of those payments is your licence 2, the rest is cash. Every wave after that carries you up one rung, funded from below.</p>
</div>
</div>
</div>
</section>
<section>
<h2 id="deepHead">All 8 levels, simulated by depth</h2>
<p class="note">A drawn tree stops early. This runs the <b>same rules on counts per depth</b> with every position qualified (the unqualified and late-qualifier rules need individual positions, so they live in the tree above), so it goes the whole way up the ladder. Every depth's positions buy one level per wave; each purchase climbs the rule, the first payment to a depth one level behind is its licence and the cost keeps climbing, the rest is cash. <b>Fill</b> is how full the matrix is: 100% is a perfect tree (width<sup>d</sup> positions at depth d), lower values thin it out with depth the way real organisations do. Entries are paid once, when the org is built.</p>
<div class="panel">
<div class="controls">
<div class="ctl"><label for="deepFill">Fill per depth</label><input id="deepFill" type="range" min="50" max="100" step="5" value="100"><span class="val" id="deepFillVal">100%</span></div>
<div class="ctl"><label>&nbsp;</label><button class="primary" id="deepWave">Run a wave</button></div>
<div class="ctl"><label>&nbsp;</label><button id="deepWave5">Run 5 waves</button></div>
<div class="ctl"><label>&nbsp;</label><button id="deepToTop">Run until you reach the top</button></div>
<div class="ctl"><label>&nbsp;</label><button id="deepReset">Reset</button></div>
</div>
<div class="deep-sum">
<div><div class="k">Your level</div><div class="v" id="dLevel">1</div><div class="s">reach = depth 1 to <span id="dReach">1</span></div></div>
<div><div class="k">Entries to you</div><div class="v" id="dEntry">$0</div><div class="s">your directs' level 1</div></div>
<div><div class="k">Cash to you</div><div class="v cash" id="dCash">$0</div><div class="s" id="dCashN">0 payments</div></div>
<div><div class="k">Licences funded for you</div><div class="v lic" id="dLic">0</div><div class="s" id="dLicV">worth $0</div></div>
<div><div class="k">Waves run</div><div class="v" id="dWaves">0</div><div class="s">one level per position per wave</div></div>
<div><div class="k">Went above you</div><div class="v" id="dAbove">$0</div><div class="s">levels that pay uplines higher than you</div></div>
<div><div class="k">Admin fee</div><div class="v" id="dFuel">$0</div><div class="s">to the receiver wallet</div></div>
</div>
<div class="tablewrap"><table id="deepTable" class="tabular"><thead><tr><th>Depth</th><th>Positions</th><th>Level now</th><th>Licences funded</th><th>Entries</th><th>Cash collected</th><th></th><th>Per position</th></tr></thead><tbody></tbody></table></div>
<p class="note" id="deepNote" style="margin-top:10px"></p>
</div>
</section>
<section>
<h2>The ladder, in numbers: one product per level</h2>
<p class="note" id="ladderNote"></p>
<div class="panel">
<div class="tablewrap"><table id="ladder" class="tabular"><thead><tr><th>Level</th><th>Delivers</th><th>Paid by</th><th>Positions there</th><th>Potential, if full, after the fee</th><th>Cost to you</th></tr></thead><tbody></tbody></table></div>
</div>
</section>
<p class="fine">Mechanics only. Prices are illustrative knobs, not proposals. What each licence delivers is a separate decision.</p>
</div>
<p class="fine">Unlisted working page for planning. Not a member page, not an offer. Every number here is a mechanic, not a prediction.</p>
<script src="/assets/plan-lab.js?v=20260927a"></script>
</body>
</html>
+3 -1
View File
@@ -3448,7 +3448,9 @@ const server = http.createServer(async (req, res) => {
return res.end(blog.renderPost(post, related));
}
if (p === '/wallets') return sendFile(res, path.join(PUBLIC_DIR, 'wallets.html'));
if (p === '/friday') return sendFile(res, path.join(PUBLIC_DIR, 'friday.html')); // Five Dollar Friday bridge page: ?ref= works like any page (Marty, 2026-09-25)
if (p === '/friday') return sendFile(res, path.join(PUBLIC_DIR, 'friday.html'));
if (p === '/plan-lab') return sendFile(res, path.join(PUBLIC_DIR, 'plan-lab.html'), { 'X-Robots-Tag': 'noindex, nofollow' }); // Reach Ladder simulator for Marty's planning group: unlisted, shared by link (2026-09-27)
if (p === '/plan-lab') return sendFile(res, path.join(PUBLIC_DIR, 'plan-lab.html')); // Reach Ladder simulator for Marty's planning group: unlisted, shared by link (2026-09-27) // Five Dollar Friday bridge page: ?ref= works like any page (Marty, 2026-09-25)
if (p === '/launch') return sendFile(res, path.join(PUBLIC_DIR, 'launch.html'));
if (/^\/view\/[a-f0-9]{32}$/.test(p)) return sendFile(res, path.join(PUBLIC_DIR, 'view.html'));
m = /^\/uploads\/([a-z0-9]{24}\.(?:png|jpg|webp|gif|mp4|webm))$/.exec(p);