
import fs from 'fs';

const content = fs.readFileSync('src/pages/FleetDispatch.tsx', 'utf8');
const lines = content.split('\n');

let divStack = 0;
let headerStack = 0;

lines.forEach((line, index) => {
  const lineNum = index + 1;
  const openingDivs = (line.match(/<div(?![^>]*\/>)/g) || []).length;
  const closingDivs = (line.match(/<\/div>/g) || []).length;

  divStack += openingDivs - closingDivs;

  if (line.includes('case \'')) {
     console.log(`At Line ${lineNum} (${line.trim()}): divStack=${divStack}`);
  }

  if (lineNum % 100 === 0) {
    // console.log(`At Line ${lineNum}: divStack=${divStack}`);
  }
});
console.log(`Final stacks: divStack=${divStack}`);
