Generate Professional NDAs in Seconds
Attorney-Drafted
← Terms.Law
🤝 Business Deal
👔 Employee
🔧 Contractor
💰 Investor
🏢 M&A
💻 Tech/Software
💼 Executive Asst
📊 Sales Rep
🌎 Overseas
📈 Due Diligence
💕 Relationship
One-Way
Mutual
Live Preview
Auto-updates
`); win.document.close(); win.focus(); setTimeout(() => win.print(), 250); } function copyToClipboard() { const content = document.getElementById('documentPreview'); const range = document.createRange(); range.selectNodeContents(content); const selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range); document.execCommand('copy'); selection.removeAllRanges(); showToast('Copied to clipboard!'); } async function downloadDocx() { try { const { Document, Packer, Paragraph, TextRun, AlignmentType } = docx; const content = document.getElementById('documentPreview'); const plainText = content.textContent || content.innerText; const paragraphs = plainText.split('\n').filter(p => p.trim()).map(p => { const isHeading = /^\d+\./.test(p) || p === p.toUpperCase(); return new Paragraph({ children: [new TextRun({ text: p.trim(), bold: isHeading })], spacing: { after: 200 }, alignment: p.includes('NON-DISCLOSURE AGREEMENT') || p.includes('CONFIDENTIALITY AGREEMENT') ? AlignmentType.CENTER : AlignmentType.JUSTIFIED }); }); const doc = new Document({ sections: [{ properties: {}, children: paragraphs }] }); const blob = await Packer.toBlob(doc); const scenarios = { business: 'Business', employee: 'Employee', contractor: 'Contractor', investor: 'Investor', merger: 'MA', tech: 'Tech', executive: 'ExecAsst', sales: 'SalesRep', overseas: 'International', duediligence: 'DueDiligence' }; const fileName = `${scenarios[scenario] || 'NDA'}-${isMutual ? 'Mutual' : 'Unilateral'}-NDA-${new Date().toISOString().split('T')[0]}.docx`; saveAs(blob, fileName); showToast('Downloaded!'); } catch (error) { console.error('DOCX error:', error); showToast('Error. Try copying instead.'); } } // ============================================ // INIT // ============================================ document.addEventListener('DOMContentLoaded', () => { document.getElementById('effectiveDate').value = new Date().toISOString().split('T')[0]; // Check URL params const params = new URLSearchParams(window.location.search); const urlScenario = params.get('scenario') || params.get('type'); const urlMutual = params.get('mutual'); if (urlScenario && SCENARIO_CONFIG[urlScenario]) { selectScenario(urlScenario); } if (urlMutual === 'false') { setDirection('oneway'); } updatePreview(); });