const fs = require('fs');

// Fix Piperack3D.tsx
let p3d = fs.readFileSync('src/components/three/Piperack3D.tsx', 'utf8');
p3d = p3d.replace("import ExportMenu from '../components/ExportMenu';\n", '');
p3d = p3d.replace("import FallbackDiagram from '../FallbackDiagram';\n", '');
p3d = p3d.replace(/label="Vento \(Transversal\)"\s*\/>/g, '/>');
p3d = p3d.replace('<SceneCanvas moduleId="piperack">', '<SceneCanvas moduleId="piperack" fallback={<div />}>');
fs.writeFileSync('src/components/three/Piperack3D.tsx', p3d);

// Fix PiperackModule.tsx
let pmod = fs.readFileSync('src/pages/PiperackModule.tsx', 'utf8');
pmod = pmod.replace("import { ExportMenu } from '../components/ExportMenu';", "import ExportMenu from '../components/ExportMenu';");
fs.writeFileSync('src/pages/PiperackModule.tsx', pmod);
