export function amlKycComplianceCalculator(form: FormTs) {
// Business type base complexity
const businessComplexity: Record<string, number> = {
'bank': 1.5,
'credit-union': 1.2,
'fintech': 1.3,
'crypto': 1.6,
'msb': 1.4,
'insurance': 1.1,
'broker-dealer': 1.4,
'investment-advisor': 1.2,
'payment-processor': 1.3,
'other': 1.0
};
// Customer volume tiers (monthly)
const volumePricing: Record<string, { setup: number; perCustomer: number }> = {
'small': { setup: 5000, perCustomer: 2.50 },
'medium': { setup: 15000, perCustomer: 1.75 },
'large': { setup: 35000, perCustomer: 1.25 },
'enterprise': { setup: 75000, perCustomer: 0.85 }
};
// Risk level multipliers
const riskMultipliers: Record<string, number> = {
'low': 0.8,
'moderate': 1.0,
'high': 1.4,
'very-high': 1.8
};
form.addRow(row => {
row.addTextPanel('header', {
computedValue: () => 'AML/KYC Compliance Cost Calculator',
customStyles: { 'font-size': '1.5rem', 'font-weight': '600', 'color': '#1e293b' }
});
});
form.addSpacer({ height: 20 });
// Business Profile Section
const businessSection = form.addSubform('businessProfile', { title: '🏢 Business Profile' });
businessSection.addRow(row => {
row.addDropdown('businessType', {
label: 'Business Type',
options: [
{ id: 'bank', name: 'Bank / Credit Institution' },
{ id: 'credit-union', name: 'Credit Union' },
{ id: 'fintech', name: 'Fintech Company' },
{ id: 'crypto', name: 'Cryptocurrency / Digital Assets' },
{ id: 'msb', name: 'Money Services Business (MSB)' },
{ id: 'insurance', name: 'Insurance Company' },
{ id: 'broker-dealer', name: 'Broker-Dealer' },
{ id: 'investment-advisor', name: 'Investment Advisor' },
{ id: 'payment-processor', name: 'Payment Processor' },
{ id: 'other', name: 'Other Regulated Entity' }
],
defaultValue: 'fintech',
isRequired: true
}, '1fr');
row.addDropdown('customerVolume', {
label: 'Monthly Customer Volume',
options: [
{ id: 'small', name: 'Small (under 1,000 customers)' },
{ id: 'medium', name: 'Medium (1,000 - 10,000 customers)' },
{ id: 'large', name: 'Large (10,000 - 100,000 customers)' },
{ id: 'enterprise', name: 'Enterprise (100,000+ customers)' }
],
defaultValue: 'medium',
isRequired: true
}, '1fr');
});
businessSection.addRow(row => {
row.addDropdown('riskLevel', {
label: 'Business Risk Level',
options: [
{ id: 'low', name: 'Low Risk' },
{ id: 'moderate', name: 'Moderate Risk' },
{ id: 'high', name: 'High Risk' },
{ id: 'very-high', name: 'Very High Risk (PEPs, high-risk jurisdictions)' }
],
defaultValue: 'moderate',
isRequired: true
}, '1fr');
row.addDropdown('jurisdiction', {
label: 'Primary Jurisdiction',
options: [
{ id: 'us', name: 'United States' },
{ id: 'eu', name: 'European Union' },
{ id: 'uk', name: 'United Kingdom' },
{ id: 'multi', name: 'Multi-jurisdiction' },
{ id: 'other', name: 'Other' }
],
defaultValue: 'us',
isRequired: true
}, '1fr');
});
// KYC Services Section
const kycSection = form.addSubform('kycServices', { title: '👤 KYC Services' });
kycSection.addRow(row => {
row.addDropdown('kycLevel', {
label: 'KYC Verification Level',
options: [
{ id: 'basic', name: 'Basic (ID verification only)' },
{ id: 'standard', name: 'Standard (ID + address + sanctions)' },
{ id: 'enhanced', name: 'Enhanced Due Diligence (EDD)' },
{ id: 'comprehensive', name: 'Comprehensive (EDD + ongoing monitoring)' }
],
defaultValue: 'standard',
isRequired: true
}, '1fr');
row.addInteger('monthlyVerifications', {
label: 'Expected Monthly Verifications',
min: 10,
max: 1000000,
defaultValue: 500
}, '1fr');
});
kycSection.addRow(row => {
row.addCheckbox('documentVerification', {
label: 'Document verification (ID, passport)',
defaultValue: true
}, '1fr');
row.addCheckbox('biometricVerification', {
label: 'Biometric verification (facial recognition)',
defaultValue: false
}, '1fr');
});
kycSection.addRow(row => {
row.addCheckbox('pepScreening', {
label: 'PEP screening (Politically Exposed Persons)',
defaultValue: true
}, '1fr');
row.addCheckbox('sanctionsScreening', {
label: 'Sanctions & watchlist screening',
defaultValue: true
}, '1fr');
});
kycSection.addRow(row => {
row.addCheckbox('adverseMedia', {
label: 'Adverse media monitoring',
defaultValue: false
}, '1fr');
row.addCheckbox('businessVerification', {
label: 'Business/corporate verification (KYB)',
defaultValue: false
}, '1fr');
});
// AML Services Section
const amlSection = form.addSubform('amlServices', { title: '🔍 AML Services' });
amlSection.addRow(row => {
row.addCheckbox('transactionMonitoring', {
label: 'Transaction monitoring system',
defaultValue: true
}, '1fr');
row.addCheckbox('sarFiling', {
label: 'SAR/STR filing support',
defaultValue: true
}, '1fr');
});
amlSection.addRow(row => {
row.addCheckbox('riskAssessment', {
label: 'Risk assessment framework',
defaultValue: true
}, '1fr');
row.addCheckbox('caseManagement', {
label: 'Case management system',
defaultValue: false
}, '1fr');
});
amlSection.addRow(row => {
row.addDropdown('transactionVolume', {
label: 'Monthly Transaction Volume',
options: [
{ id: 'low', name: 'Low (under 10,000)' },
{ id: 'medium', name: 'Medium (10,000 - 100,000)' },
{ id: 'high', name: 'High (100,000 - 1 million)' },
{ id: 'very-high', name: 'Very High (1 million+)' }
],
defaultValue: 'medium',
isVisible: () => amlSection.checkbox('transactionMonitoring')?.value() === true
}, '1fr');
});
// Training & Compliance Section
const trainingSection = form.addSubform('training', { title: '📚 Training & Compliance' });
trainingSection.addRow(row => {
row.addCheckbox('staffTraining', {
label: 'Staff AML/KYC training program',
defaultValue: true
}, '1fr');
row.addCheckbox('policyDevelopment', {
label: 'Policy & procedure development',
defaultValue: true
}, '1fr');
});
trainingSection.addRow(row => {
row.addCheckbox('auditPreparation', {
label: 'Regulatory audit preparation',
defaultValue: false
}, '1fr');
row.addCheckbox('complianceOfficer', {
label: 'Outsourced Compliance Officer',
defaultValue: false
}, '1fr');
});
trainingSection.addRow(row => {
row.addInteger('employeeCount', {
label: 'Number of Employees to Train',
min: 1,
max: 10000,
defaultValue: 10,
isVisible: () => trainingSection.checkbox('staffTraining')?.value() === true
}, '1fr');
});
form.addSpacer({ height: 20, showLine: true, lineStyle: 'dashed' });
// Cost Summary Section
const summarySection = form.addSubform('summary', { title: '📊 Cost Breakdown', isCollapsible: false });
summarySection.addRow(row => {
row.addPriceDisplay('setupCost', {
label: 'Initial Setup Cost',
computedValue: () => {
const volume = businessSection.dropdown('customerVolume')?.value() || 'medium';
const businessType = businessSection.dropdown('businessType')?.value() || 'fintech';
const risk = businessSection.dropdown('riskLevel')?.value() || 'moderate';
const jurisdiction = businessSection.dropdown('jurisdiction')?.value() || 'us';
let baseCost = volumePricing[volume]?.setup || 15000;
baseCost *= businessComplexity[businessType] || 1;
baseCost *= riskMultipliers[risk] || 1;
if (jurisdiction === 'multi') baseCost *= 1.5;
// KYC additions
if (kycSection.checkbox('biometricVerification')?.value()) baseCost += 5000;
if (kycSection.checkbox('businessVerification')?.value()) baseCost += 3000;
// AML additions
if (amlSection.checkbox('transactionMonitoring')?.value()) baseCost += 10000;
if (amlSection.checkbox('caseManagement')?.value()) baseCost += 5000;
// Training & compliance
if (trainingSection.checkbox('policyDevelopment')?.value()) baseCost += 5000;
if (trainingSection.checkbox('auditPreparation')?.value()) baseCost += 3000;
return Math.round(baseCost);
},
variant: 'default'
}, '1fr');
row.addPriceDisplay('monthlySoftware', {
label: 'Monthly Software/Tools',
computedValue: () => {
const volume = businessSection.dropdown('customerVolume')?.value() || 'medium';
const kycLevel = kycSection.dropdown('kycLevel')?.value() || 'standard';
const monthlyVerifications = kycSection.integer('monthlyVerifications')?.value() || 500;
let baseCost = 500;
// KYC level costs
const kycCosts: Record<string, number> = {
'basic': 300,
'standard': 600,
'enhanced': 1200,
'comprehensive': 2000
};
baseCost += kycCosts[kycLevel] || 600;
// Per-verification costs
const perVerification = volumePricing[volume]?.perCustomer || 1.75;
baseCost += monthlyVerifications * perVerification;
// Feature additions
if (kycSection.checkbox('biometricVerification')?.value()) baseCost += 500;
if (kycSection.checkbox('adverseMedia')?.value()) baseCost += 400;
if (amlSection.checkbox('transactionMonitoring')?.value()) baseCost += 1500;
if (amlSection.checkbox('caseManagement')?.value()) baseCost += 800;
return Math.round(baseCost);
},
variant: 'default',
suffix: '/month'
}, '1fr');
});
summarySection.addRow(row => {
row.addPriceDisplay('monthlyServices', {
label: 'Monthly Professional Services',
computedValue: () => {
let cost = 0;
if (trainingSection.checkbox('complianceOfficer')?.value()) cost += 3000;
if (amlSection.checkbox('sarFiling')?.value()) cost += 500;
const employeeCount = trainingSection.integer('employeeCount')?.value() || 10;
if (trainingSection.checkbox('staffTraining')?.value()) {
cost += Math.ceil(employeeCount / 10) * 200; // Ongoing training
}
return cost;
},
variant: 'default',
suffix: '/month'
}, '1fr');
row.addPriceDisplay('annualAudit', {
label: 'Annual Audit/Review',
computedValue: () => {
const volume = businessSection.dropdown('customerVolume')?.value() || 'medium';
const risk = businessSection.dropdown('riskLevel')?.value() || 'moderate';
const baseAudit: Record<string, number> = {
'small': 5000,
'medium': 10000,
'large': 20000,
'enterprise': 40000
};
let cost = baseAudit[volume] || 10000;
cost *= riskMultipliers[risk] || 1;
if (trainingSection.checkbox('auditPreparation')?.value()) cost *= 0.8; // Discount with prep
return Math.round(cost);
},
variant: 'default',
suffix: '/year'
}, '1fr');
});
const finalSection = form.addSubform('final', {
title: '💰 Total Cost Estimate',
isCollapsible: false,
sticky: 'bottom'
});
finalSection.addRow(row => {
row.addPriceDisplay('firstYearCost', {
label: 'First Year Total',
computedValue: () => {
const volume = businessSection.dropdown('customerVolume')?.value() || 'medium';
const businessType = businessSection.dropdown('businessType')?.value() || 'fintech';
const risk = businessSection.dropdown('riskLevel')?.value() || 'moderate';
const jurisdiction = businessSection.dropdown('jurisdiction')?.value() || 'us';
const kycLevel = kycSection.dropdown('kycLevel')?.value() || 'standard';
const monthlyVerifications = kycSection.integer('monthlyVerifications')?.value() || 500;
// Setup cost
let setupCost = volumePricing[volume]?.setup || 15000;
setupCost *= businessComplexity[businessType] || 1;
setupCost *= riskMultipliers[risk] || 1;
if (jurisdiction === 'multi') setupCost *= 1.5;
if (kycSection.checkbox('biometricVerification')?.value()) setupCost += 5000;
if (kycSection.checkbox('businessVerification')?.value()) setupCost += 3000;
if (amlSection.checkbox('transactionMonitoring')?.value()) setupCost += 10000;
if (amlSection.checkbox('caseManagement')?.value()) setupCost += 5000;
if (trainingSection.checkbox('policyDevelopment')?.value()) setupCost += 5000;
if (trainingSection.checkbox('auditPreparation')?.value()) setupCost += 3000;
// Monthly software
let monthlySoftware = 500;
const kycCosts: Record<string, number> = { 'basic': 300, 'standard': 600, 'enhanced': 1200, 'comprehensive': 2000 };
monthlySoftware += kycCosts[kycLevel] || 600;
monthlySoftware += monthlyVerifications * (volumePricing[volume]?.perCustomer || 1.75);
if (kycSection.checkbox('biometricVerification')?.value()) monthlySoftware += 500;
if (kycSection.checkbox('adverseMedia')?.value()) monthlySoftware += 400;
if (amlSection.checkbox('transactionMonitoring')?.value()) monthlySoftware += 1500;
if (amlSection.checkbox('caseManagement')?.value()) monthlySoftware += 800;
// Monthly services
let monthlyServices = 0;
if (trainingSection.checkbox('complianceOfficer')?.value()) monthlyServices += 3000;
if (amlSection.checkbox('sarFiling')?.value()) monthlyServices += 500;
const employeeCount = trainingSection.integer('employeeCount')?.value() || 10;
if (trainingSection.checkbox('staffTraining')?.value()) {
monthlyServices += Math.ceil(employeeCount / 10) * 200;
}
// Annual audit
const baseAudit: Record<string, number> = { 'small': 5000, 'medium': 10000, 'large': 20000, 'enterprise': 40000 };
let annualAudit = baseAudit[volume] || 10000;
annualAudit *= riskMultipliers[risk] || 1;
if (trainingSection.checkbox('auditPreparation')?.value()) annualAudit *= 0.8;
return Math.round(setupCost + (monthlySoftware * 12) + (monthlyServices * 12) + annualAudit);
},
variant: 'large'
}, '1fr');
row.addPriceDisplay('ongoingAnnual', {
label: 'Ongoing Annual Cost',
computedValue: () => {
const volume = businessSection.dropdown('customerVolume')?.value() || 'medium';
const risk = businessSection.dropdown('riskLevel')?.value() || 'moderate';
const kycLevel = kycSection.dropdown('kycLevel')?.value() || 'standard';
const monthlyVerifications = kycSection.integer('monthlyVerifications')?.value() || 500;
// Monthly software
let monthlySoftware = 500;
const kycCosts: Record<string, number> = { 'basic': 300, 'standard': 600, 'enhanced': 1200, 'comprehensive': 2000 };
monthlySoftware += kycCosts[kycLevel] || 600;
monthlySoftware += monthlyVerifications * (volumePricing[volume]?.perCustomer || 1.75);
if (kycSection.checkbox('biometricVerification')?.value()) monthlySoftware += 500;
if (kycSection.checkbox('adverseMedia')?.value()) monthlySoftware += 400;
if (amlSection.checkbox('transactionMonitoring')?.value()) monthlySoftware += 1500;
if (amlSection.checkbox('caseManagement')?.value()) monthlySoftware += 800;
// Monthly services
let monthlyServices = 0;
if (trainingSection.checkbox('complianceOfficer')?.value()) monthlyServices += 3000;
if (amlSection.checkbox('sarFiling')?.value()) monthlyServices += 500;
const employeeCount = trainingSection.integer('employeeCount')?.value() || 10;
if (trainingSection.checkbox('staffTraining')?.value()) {
monthlyServices += Math.ceil(employeeCount / 10) * 200;
}
// Annual audit
const baseAudit: Record<string, number> = { 'small': 5000, 'medium': 10000, 'large': 20000, 'enterprise': 40000 };
let annualAudit = baseAudit[volume] || 10000;
annualAudit *= riskMultipliers[risk] || 1;
if (trainingSection.checkbox('auditPreparation')?.value()) annualAudit *= 0.8;
return Math.round((monthlySoftware * 12) + (monthlyServices * 12) + annualAudit);
},
variant: 'large',
suffix: '/year'
}, '1fr');
});
finalSection.addRow(row => {
row.addTextPanel('disclaimer', {
computedValue: () => 'This calculator provides estimates only. Actual compliance costs depend on specific regulatory requirements, business complexity, and vendor selection. Consult with a compliance professional for accurate program budgeting.',
customStyles: { 'font-size': '0.8rem', 'color': '#64748b', 'font-style': 'italic' }
});
});
form.configureSubmitButton({
label: 'Get Compliance Consultation'
});
}