const fs = require('fs');

let content = fs.readFileSync('contractors_module.js', 'utf8');

content = content.replace(
    /const matchStatus = statusFilter === 'all' \|\| ab\.status === statusFilter;/g,
    "const matchStatus = statusFilter === 'all' || statusFilter === '' || ab.status === statusFilter;"
);

fs.writeFileSync('contractors_module.js', content, 'utf8');

let indexHtml = fs.readFileSync('index.html', 'utf8');
indexHtml = indexHtml.replace(/v=20260610f/g, 'v=20260610g').replace(/v=20260610e/g, 'v=20260610g');
fs.writeFileSync('index.html', indexHtml, 'utf8');

console.log('Fixed status filter bug and busted cache to v=20260610g');
