const fs = require('fs');
const content = fs.readFileSync('dist/assets/index-D9sWWWv_.js', 'utf8');

const target = "const Hi=tr.find";
const indexHi = content.indexOf(target);
if (indexHi !== -1) {
  // Let's search inside the parent component function, which starts way before indexHi and goes on for thousands of characters.
  // Let's search for any useEffect that references 'Hm' or 'ys' or 'ko'.
  console.log("Searching for useEffect blocks that might contain timers or simulation calls...");
  let idx = 0;
  while ((idx = content.indexOf("C.useEffect", idx)) !== -1) {
    const block = content.substring(idx, idx + 1200);
    if (block.includes("ys") || block.includes("Hn") || block.includes("Aktivasi Pembayaran") || block.includes("Tripay")) {
      console.log(`\n--- Found matching useEffect at offset ${idx} ---`);
      console.log(block);
    }
    idx += 11;
  }
} else {
  console.log("Hi block not found");
}
