const fs = require('fs');
const content = fs.readFileSync('./dist/server.cjs', 'utf8');

const targetIdx = content.indexOf('function getCustomProfiles');
if (targetIdx !== -1) {
  console.log(content.substring(targetIdx - 100, targetIdx + 1500));
} else {
  // Try searching for getCustomProfiles
  let idx = 0;
  while (true) {
    idx = content.indexOf("getCustomProfiles", idx);
    if (idx === -1) break;
    console.log(`Found getCustomProfiles at index ${idx}`);
    console.log(content.substring(idx - 100, idx + 300));
    console.log('------------------');
    idx += "getCustomProfiles".length;
  }
}
