/** Offline Chromium layout/keyboard regression checks using production HTML/CSS/renderers.
* Install Playwright outside the source tree; run with NODE_PATH pointing to that node_modules.
* Uses synthetic records; never starts the backend or sends requests to assessment targets.
*/
const { chromium } = require("playwright");
const fs = require("fs"),
http = require("http"),
path = require("path");
const root = path.resolve(__dirname, "..");
const out =
process.env.CSAI_UI_ARTIFACTS ||
fs.mkdtempSync(path.join(require("os").tmpdir(), "csai-ui-"));
fs.mkdirSync(out, { recursive: true });
const html = fs
.readFileSync(root + "/web/templates/index.html", "utf8")
.replace(/