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

const target = `Re=C.useMemo(()=>ye.reduce((p,b)=>{const prof=(Je.find(P=>P.name===b.profileName&&P.agentId===b.agentId)||Je.find(P=>P.name===b.profileName&&!P.agentId)||(r?ui:[]).find(P=>P.name===b.profileName));return p+(prof?prof.price:b.price||0)},0),[ye,Je,r,ui])`;

let count = 0;
let idx = 0;
while (true) {
    idx = content.indexOf(target, idx);
    if (idx === -1) break;
    count++;
    idx += target.length;
}
console.log("Count of occurrences:", count);
