(function () { 'use strict'; var $ = function (id) { return document.getElementById(id); }; var n = function (v, d) { return Number(v || 0).toLocaleString('en-US', { maximumFractionDigits: d || 0 }); }; fetch('/api/public/stats').then(function (r) { return r.json(); }).then(function (s) { $('sPlayers').textContent = n(s.players); $('sRefuels').textContent = n(s.refuels); $('sDrips').textContent = n(s.chapterDrips); $('sPaid').textContent = n(s.polPaid, 3); if (s.thresholdPol) $('sThreshold').textContent = n(s.thresholdPol, 2); if (s.refSharePct) $('sRef').textContent = s.refSharePct + ' percent'; document.querySelectorAll('.sRefPct').forEach(function (e) { if (s.refSharePct) e.textContent = s.refSharePct + ' percent'; }); document.querySelectorAll('.sThresh').forEach(function (e) { if (s.thresholdPol) e.textContent = n(s.thresholdPol, 2); }); }).catch(function () { $('stats').hidden = true; }); })(); // shown inside someone else's frame (traffic exchanges, rotators; 2026-10-03): the game keeps progress and the sharer's // referral in cookies that browsers drop inside a frame, so play and sign-in open in a new tab, carrying the share link (function () { var framed = false; try { framed = window.top !== window.self; } catch (e) { framed = true; } if (!framed) return; var q = new URLSearchParams(location.search), r = String(q.get('r') || q.get('ref') || '').replace(/[^A-Za-z0-9_.-]/g, '').slice(0, 40); document.querySelectorAll('a[href]').forEach(function (a) { if (a.getAttribute('href').charAt(0) === '#') return; if (r && /^\/(play|signin)$/.test(a.pathname) && a.host === location.host) a.href = '/r/' + encodeURIComponent(r); a.target = '_blank'; a.rel = 'noopener'; }); })();