Regulatory Compliance Checker

Regulatory Compliance Checker

Simulate a compliance audit for your text against common regulations.

${analysisResults.issuesFound} potential compliance issue(s) detected.

`; } else { overallStatusEl.className = 'text-center mb-4 p-4 rounded-md bg-green-100 text-green-800'; overallStatusEl.innerHTML = `

Looking Good

No immediate compliance issues detected based on the text provided.

`; } checklistEl.innerHTML = ''; analysisResults.results.forEach(result => { const icon = { pass: ``, fail: ``, warn: `` }[result.status]; const li = document.createElement('li'); li.className = 'flex items-start gap-3 p-3'; li.innerHTML = `
${icon}

${result.name}

${result.details}

`; checklistEl.appendChild(li); }); resultsPanel.classList.remove('hidden'); } function downloadPdf() { if (!analysisResults) return; const { jsPDF } = window.jspdf; const pdf = new jsPDF(); pdf.setFont('helvetica', 'bold'); pdf.setFontSize(22); pdf.text('Compliance Report', 105, 20, { align: 'center' }); pdf.setFontSize(12); pdf.text(`Regulation: ${analysisResults.regulationName}`, 15, 40); pdf.text(`Date: ${new Date().toLocaleDateString()}`, 15, 50); const overallStatus = analysisResults.issuesFound > 0 ? `Issues Found (${analysisResults.issuesFound})` : 'No Issues Detected'; pdf.text(`Overall Status: ${overallStatus}`, 15, 60); const head = [['Check', 'Status', 'Details']]; const body = analysisResults.results.map(r => [r.name, r.status.toUpperCase(), r.details]); pdf.autoTable({ startY: 70, head: head, body: body, theme: 'grid', headStyles: { fillColor: '#1e293b' }, didParseCell: function(data) { if (data.section === 'body') { if (data.cell.raw === 'PASS') data.cell.styles.textColor = '#16a34a'; if (data.cell.raw === 'FAIL') data.cell.styles.textColor = '#dc2626'; if (data.cell.raw === 'WARN') data.cell.styles.textColor = '#f59e0b'; } } }); pdf.save('Compliance_Report.pdf'); } checkBtn.addEventListener('click', runChecks); document.getElementById('download-pdf-btn').addEventListener('click', downloadPdf); });
Scroll to Top