Automated Legal Dispute Analyzer

Automated Legal Dispute Analyzer

Assess the strengths and weaknesses of a legal dispute based on your inputs.

Case Information

Step 1 of 3

Disclaimer: This tool provides a preliminary analysis for informational purposes only and does not constitute legal advice. Consult with a qualified attorney for your specific situation.

Amount: $${parseInt(details.damages).toLocaleString()}

Strengths

${strengths.length > 0 ? `
    ${strengths.map(s => `
  • ${s}
  • `).join('')}
` : '

No significant strengths identified.

'}

Weaknesses / Areas to Improve

${weaknesses.length > 0 ? `
    ${weaknesses.map(w => `
  • ${w}
  • `).join('')}
` : '

No significant weaknesses identified.

'}
`; container.innerHTML = html; } // --- Core & Navigation Logic --- function showTab(tabNumber) { document.querySelectorAll('.tab-pane').forEach(p => p.classList.add('hidden')); getEl(`tab-${tabNumber}`).classList.remove('hidden'); document.querySelectorAll('.tab-btn').forEach(b => { b.classList.toggle('active', b.dataset.tab === `tab-${tabNumber}`); b.classList.toggle('inactive', b.dataset.tab !== `tab-${tabNumber}`); }); currentTab = tabNumber; updateNavigation(); } function updateNavigation() { prevBtn.disabled = currentTab === 1; nextBtn.textContent = currentTab === totalTabs - 1 ? 'Analyze Dispute' : 'Next'; nextBtn.style.display = currentTab === totalTabs ? 'none' : 'inline-block'; stepIndicator.textContent = `Step ${currentTab} of ${totalTabs}`; } function saveTabData() { if (currentTab === 1) { appData.details = { partyA: getEl('partyA').value, partyB: getEl('partyB').value, disputeType: getEl('disputeType').value, disputeSummary: getEl('disputeSummary').value, damages: getEl('damages').value, desiredOutcome: getEl('desiredOutcome').value, }; } else if (currentTab === 2) { appData.evidence = evidenceFactors.map(factor => ({ id: factor.id, text: factor.text, strength: parseInt(getEl(factor.id).value), weight: factor.weight })); } } function generateFullReport() { if (!getEl('form-dispute-details').checkValidity()) { getEl('form-dispute-details').reportValidity(); showTab(1); return; } saveTabData(); // Save final tab data showTab(3); getEl('report-content').classList.add('hidden'); getEl('report-loading').classList.remove('hidden'); setTimeout(() => { renderReport(); getEl('report-loading').classList.add('hidden'); getEl('report-content').classList.remove('hidden'); }, 1500); } function downloadPdf() { const { jsPDF } = window.jspdf; const doc = new jsPDF(); const { details, evidence } = appData; doc.setFontSize(18); doc.text("Legal Dispute Analysis Report", 105, 20, { align: 'center' }); doc.setFontSize(12); doc.text(`Dispute: ${details.partyA} vs. ${details.partyB}`, 14, 35); const tableBody = evidence.map(item => { const strengthMap = ["N/A", "Weak", "Moderate", "Strong"]; return [item.text, strengthMap[item.strength]]; }); doc.autoTable({ startY: 45, head: [['Evidence Factor', 'Assessed Strength']], body: tableBody, theme: 'grid', headStyles: { fillColor: [79, 70, 229] } // Indigo }); const finalY = doc.autoTable.previous.finalY; doc.setFontSize(12); doc.text("Disclaimer: This is a simulated analysis and not legal advice.", 105, finalY + 15, { align: 'center' }); doc.save(`Dispute-Analysis-${details.partyA}.pdf`); } // --- Event Listeners --- nextBtn.addEventListener('click', () => { if (currentTab < totalTabs - 1) { if (!getEl('form-dispute-details').checkValidity()) { getEl('form-dispute-details').reportValidity(); return; } saveTabData(); showTab(currentTab + 1); } else if (currentTab === totalTabs - 1) { generateFullReport(); } }); prevBtn.addEventListener('click', () => { if (currentTab > 1) { saveTabData(); showTab(currentTab - 1); } }); getEl('download-pdf-btn').addEventListener('click', downloadPdf); // --- Initialization --- populateEvidenceForm(); updateNavigation(); });
Scroll to Top