// Fuel Your Offers (2026-10-24), LinkSpin: the Monthly Refuel panel on Credits and Ads. The streak lives on InstantAdPay // and is shared by both sites; /api/my/refuel relays InstantAdPay's view. Hidden while the refuelStreak switch is off. (function () { const $ = id => document.getElementById(id); const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); const n = v => Number(v || 0).toLocaleString('en-US'); window.FUEL = window.FUEL || {}; function site(name, s, minUsd) { return s && s.refueled ? '
' + name + '+' + s.pct + '% · ' + n(s.bonus) + ' credits
' : '
' + name + 'not yet ($' + minUsd + '+ counts)
'; } function body(v) { if (v.error) return '

' + esc(v.error) + '

'; if (!v.active) { return '

' + (v.started ? 'Your last streak ended. ' : '') + 'A package of $' + v.minUsd.linkspin + ' or more here, or $' + v.minUsd.iap + '+ on InstantAdPay, ' + (v.started ? 'starts it again' : 'starts your monthly refuel streak and sets your own refuel day') + '.

' + '

Bonus ad credits: month 1 +' + v.ladder.single[0] + '%, then +' + v.ladder.single.slice(1).join('%, +') + '%. Refuel both sites in the same cycle and each gets +' + v.ladder.both.join('%, +') + '%.

' + 'Start my streak'; } const c = v.cycle || {}; let h = v.windowOpen ? '

Your refuel window is open. Refuel day ' + esc(v.refuelDayLabel) + ', grace to ' + esc(v.graceLabel) + ' (Central). Next refuel: +' + v.next.single + '%, or +' + v.next.both + '% on each site with both.

' : '

Next refuel day ' + esc(v.refuelDayLabel) + ' (Central). Window opens ' + esc(v.opensLabel) + ', grace to ' + esc(v.graceLabel) + '.

'; if (c.month) h += '
' + site('InstantAdPay', c.iap, v.minUsd.iap) + site('LinkSpin', c.linkspin, v.minUsd.linkspin) + '
'; if (!v.windowOpen && c.month && !c.both) h += '

Refuel ' + (c.linkspin && c.linkspin.refueled ? 'InstantAdPay ($' + v.minUsd.iap + '+)' : 'LinkSpin ($' + v.minUsd.linkspin + '+)') + ' before ' + esc(v.opensLabel) + ' and both sites move to +' + v.next.secondEngine + '%.

'; if (v.pitStop && (v.pitStop.linkspin || v.pitStop.usedLinkspin)) h += '

Pit Stop ' + (v.pitStop.linkspin ? 'available here: +' + v.pitStop.pct + '% on a $' + v.minUsd.linkspin + '+ top-up, once this cycle. It does not count as your refuel.' : 'used here this cycle.') + '

'; h += '

' + (v.freeMiss.available ? 'One free miss left this year.' : 'Free miss for this year used.') + '

'; return h + '' + (v.windowOpen ? 'Refuel now' : 'Buy a package') + ''; } async function load() { const panel = $('rfPanel'); if (!panel) return; try { const v = await (await fetch('/api/my/refuel', { cache: 'no-store' })).json(); window.FUEL.refuel = v; if (!v || !v.on) { panel.hidden = true; return; } $('rfMeta').textContent = v.active ? 'streak: ' + v.streak + ' month' + (v.streak === 1 ? '' : 's') : 'shared with InstantAdPay'; $('rfBody').innerHTML = body(v); panel.hidden = false; } catch (e) { panel.hidden = true; } } window.FUEL.loadRefuel = load; load(); setInterval(load, 300000); })();