\n' + '\n' + '
' + htmlContent + '
\n' + '\n' + ''; const printWindow = window.open('', '_blank'); if (!printWindow) { alert('Popup blocked. Please allow popups for this site to download PDF.'); return; } printWindow.document.write(html); printWindow.document.close(); setTimeout(() => { printWindow.print(); }, 500); } catch (err) { console.error('Evidence pack PDF download failed:', err); alert('Failed to download evidence pack as PDF. Please try again.'); } }, updateTitle() { const title = this.pageTitles[this.currentView] || 'Cyber Security Readiness Portal'; document.title = title; }, init() { this.$watch('currentView', () => { this.sidebarOpen = false; }); this.$watch('currentView', () => this.updateTitle()); this.updateTitle(); // set initial title // Expose for Playwright tests window.__navTo = (v) => { this.currentView = v; }; // Check auth on init this.$nextTick(() => { this.$store.auth.checkSession(); }); // Redirect to login if session drops this.$watch('$store.auth.isAuthenticated', (val) => { if (!val) { this.currentView = 'login'; } }); // Redirect to login when initial session check completes with no auth this.$watch('$store.auth.checkingAuth', (val) => { if (!val && !this.$store.auth.isAuthenticated) { this.currentView = 'login'; } }); }, }; }

Cyber Security Readiness Portal