export function seoServicesCalculator(form: FormTs) {
form.addRow(row => {
row.addTextPanel('header', {
computedValue: () => 'SEO Services Calculator',
customStyles: { 'font-size': '1.5rem', 'font-weight': '600', 'color': '#1e293b' }
});
});
form.addSpacer({ height: 20 });
// Business Details Section
const businessSection = form.addSubform('business', { title: '🏢 Business Details' });
businessSection.addRow(row => {
row.addDropdown('industry', {
label: 'Industry',
options: [
{ id: 'local', name: 'Local Business' },
{ id: 'ecommerce', name: 'E-commerce' },
{ id: 'saas', name: 'SaaS / Technology' },
{ id: 'healthcare', name: 'Healthcare / Medical' },
{ id: 'legal', name: 'Legal / Law Firm' },
{ id: 'finance', name: 'Finance / Insurance' },
{ id: 'realestate', name: 'Real Estate' },
{ id: 'other', name: 'Other Industry' }
],
defaultValue: 'local',
isRequired: true
}, '1fr');
row.addDropdown('competition', {
label: 'Competition Level',
options: [
{ id: 'low', name: 'Low Competition' },
{ id: 'medium', name: 'Medium Competition' },
{ id: 'high', name: 'High Competition' },
{ id: 'very-high', name: 'Very High Competition' }
],
defaultValue: 'medium',
tooltip: 'How competitive is your market for target keywords?'
}, '1fr');
});
businessSection.addRow(row => {
row.addDropdown('websiteSize', {
label: 'Website Size',
options: [
{ id: 'small', name: 'Small (1-20 pages)' },
{ id: 'medium', name: 'Medium (20-100 pages)' },
{ id: 'large', name: 'Large (100-500 pages)' },
{ id: 'enterprise', name: 'Enterprise (500+ pages)' }
],
defaultValue: 'small',
isRequired: true
}, '1fr');
row.addDropdown('currentState', {
label: 'Current SEO State',
options: [
{ id: 'none', name: 'No SEO Done' },
{ id: 'basic', name: 'Basic SEO in Place' },
{ id: 'established', name: 'Established SEO Program' },
{ id: 'recovery', name: 'Needs Penalty Recovery' }
],
defaultValue: 'none'
}, '1fr');
});
// Service Package Section
const packageSection = form.addSubform('package', { title: '📦 Service Package' });
packageSection.addRow(row => {
row.addRadioButton('packageType', {
label: 'Package Type',
options: [
{ id: 'starter', name: 'Starter' },
{ id: 'growth', name: 'Growth' },
{ id: 'professional', name: 'Professional' },
{ id: 'enterprise', name: 'Enterprise' },
{ id: 'custom', name: 'Custom' }
],
defaultValue: 'growth'
});
});
packageSection.addRow(row => {
row.addTextPanel('packageDescription', {
computedValue: () => {
const pkg = packageSection.radioButton('packageType')?.value() || 'growth';
const descriptions = {
'starter': 'Basic on-page SEO, 5 keywords, monthly report',
'growth': 'Full on-page SEO, 15 keywords, link building, bi-weekly reports',
'professional': 'Comprehensive SEO, 30 keywords, content creation, weekly reports',
'enterprise': 'Full-service SEO, unlimited keywords, dedicated strategist, custom reporting',
'custom': 'Build your own package with services below'
};
return descriptions[pkg];
},
customStyles: { 'font-size': '0.9rem', 'color': '#64748b', 'font-style': 'italic' }
});
});
// Core Services Section
const servicesSection = form.addSubform('services', { title: '🔧 Core Services' });
servicesSection.addRow(row => {
row.addCheckbox('technicalAudit', {
label: 'Technical SEO Audit',
defaultValue: true,
tooltip: 'Comprehensive website audit for technical issues'
}, '1fr');
row.addCheckbox('keywordResearch', {
label: 'Keyword Research',
defaultValue: true,
tooltip: 'In-depth keyword analysis and strategy'
}, '1fr');
});
servicesSection.addRow(row => {
row.addCheckbox('onPageSeo', {
label: 'On-Page Optimization',
defaultValue: true,
tooltip: 'Title tags, meta descriptions, content optimization'
}, '1fr');
row.addCheckbox('technicalSeo', {
label: 'Technical SEO',
defaultValue: true,
tooltip: 'Site speed, mobile optimization, schema markup'
}, '1fr');
});
servicesSection.addRow(row => {
row.addCheckbox('localSeo', {
label: 'Local SEO',
defaultValue: false,
tooltip: 'Google Business Profile, local citations, map optimization'
}, '1fr');
row.addCheckbox('linkBuilding', {
label: 'Link Building',
defaultValue: true,
tooltip: 'Quality backlink acquisition'
}, '1fr');
});
// Content Services Section
const contentSection = form.addSubform('content', { title: '✍️ Content Services' });
contentSection.addRow(row => {
row.addDropdown('contentCreation', {
label: 'Blog Content',
options: [
{ id: 'none', name: 'No Content' },
{ id: '2-posts', name: '2 Posts/Month' },
{ id: '4-posts', name: '4 Posts/Month' },
{ id: '8-posts', name: '8 Posts/Month' },
{ id: 'custom', name: 'Custom Volume' }
],
defaultValue: 'none'
}, '1fr');
row.addInteger('customPosts', {
label: 'Posts per Month',
min: 1,
max: 30,
defaultValue: 10,
isVisible: () => contentSection.dropdown('contentCreation')?.value() === 'custom'
}, '1fr');
});
contentSection.addRow(row => {
row.addDropdown('contentLength', {
label: 'Average Content Length',
options: [
{ id: 'short', name: 'Short (500-800 words)' },
{ id: 'medium', name: 'Medium (800-1500 words)' },
{ id: 'long', name: 'Long-form (1500-2500 words)' },
{ id: 'pillar', name: 'Pillar Content (2500+ words)' }
],
defaultValue: 'medium',
isVisible: () => contentSection.dropdown('contentCreation')?.value() !== 'none'
}, '1fr');
row.addCheckbox('contentStrategy', {
label: 'Content Strategy',
defaultValue: false,
tooltip: 'Content calendar, topic clusters, keyword mapping'
}, '1fr');
});
// Additional Services Section
const addonsSection = form.addSubform('addons', { title: '➕ Additional Services' });
addonsSection.addRow(row => {
row.addCheckbox('competitorAnalysis', {
label: 'Competitor Analysis',
defaultValue: false,
tooltip: 'Deep dive into competitor strategies'
}, '1fr');
row.addCheckbox('conversionOptimization', {
label: 'Conversion Optimization',
defaultValue: false,
tooltip: 'CRO to turn traffic into leads/sales'
}, '1fr');
});
addonsSection.addRow(row => {
row.addCheckbox('googleAdsManagement', {
label: 'Google Ads Management',
defaultValue: false,
tooltip: 'PPC campaign management alongside SEO'
}, '1fr');
row.addCheckbox('analyticsSetup', {
label: 'Analytics & Tracking',
defaultValue: false,
tooltip: 'GA4, Search Console, conversion tracking'
}, '1fr');
});
// Contract Length
const contractSection = form.addSubform('contract', { title: '📅 Contract Details' });
contractSection.addRow(row => {
row.addDropdown('contractLength', {
label: 'Contract Length',
options: [
{ id: '1', name: 'Month-to-Month' },
{ id: '3', name: '3 Months' },
{ id: '6', name: '6 Months (5% discount)' },
{ id: '12', name: '12 Months (10% discount)' }
],
defaultValue: '6'
}, '1fr');
row.addDropdown('reportingFrequency', {
label: 'Reporting Frequency',
options: [
{ id: 'monthly', name: 'Monthly Reports' },
{ id: 'biweekly', name: 'Bi-Weekly Reports' },
{ id: 'weekly', name: 'Weekly Reports' }
],
defaultValue: 'monthly'
}, '1fr');
});
form.addSpacer({ height: 20, showLine: true, lineStyle: 'dashed' });
// Results Section
const resultsSection = form.addSubform('results', { title: '📊 Pricing Breakdown', isCollapsible: false });
const calculatePricing = () => {
const competition = businessSection.dropdown('competition')?.value() || 'medium';
const websiteSize = businessSection.dropdown('websiteSize')?.value() || 'small';
const industry = businessSection.dropdown('industry')?.value() || 'local';
const packageType = packageSection.radioButton('packageType')?.value() || 'growth';
const contractLength = parseInt(contractSection.dropdown('contractLength')?.value() || '6');
// Base pricing by package
const basePricing = {
'starter': 500,
'growth': 1200,
'professional': 2500,
'enterprise': 5000,
'custom': 0
};
let monthlyPrice = basePricing[packageType];
// Competition multiplier
const competitionMultiplier = {
'low': 1.0,
'medium': 1.2,
'high': 1.5,
'very-high': 2.0
};
monthlyPrice *= competitionMultiplier[competition];
// Website size multiplier
const sizeMultiplier = {
'small': 1.0,
'medium': 1.3,
'large': 1.7,
'enterprise': 2.5
};
monthlyPrice *= sizeMultiplier[websiteSize];
// Industry premium
const industryPremium = {
'local': 0,
'ecommerce': 200,
'saas': 300,
'healthcare': 400,
'legal': 500,
'finance': 500,
'realestate': 200,
'other': 0
};
monthlyPrice += industryPremium[industry];
// Custom package - add individual services
if (packageType === 'custom') {
if (servicesSection.checkbox('technicalAudit')?.value()) monthlyPrice += 300;
if (servicesSection.checkbox('keywordResearch')?.value()) monthlyPrice += 250;
if (servicesSection.checkbox('onPageSeo')?.value()) monthlyPrice += 400;
if (servicesSection.checkbox('technicalSeo')?.value()) monthlyPrice += 350;
if (servicesSection.checkbox('localSeo')?.value()) monthlyPrice += 300;
if (servicesSection.checkbox('linkBuilding')?.value()) monthlyPrice += 500;
} else {
// Add services not in package
if (servicesSection.checkbox('localSeo')?.value()) monthlyPrice += 300;
}
// Content pricing
const contentOption = contentSection.dropdown('contentCreation')?.value() || 'none';
const contentLength = contentSection.dropdown('contentLength')?.value() || 'medium';
const contentPricePerPost = {
'short': 100,
'medium': 200,
'long': 350,
'pillar': 600
};
const postCounts = {
'none': 0,
'2-posts': 2,
'4-posts': 4,
'8-posts': 8,
'custom': contentSection.integer('customPosts')?.value() || 10
};
const contentCost = postCounts[contentOption] * contentPricePerPost[contentLength];
monthlyPrice += contentCost;
if (contentSection.checkbox('contentStrategy')?.value()) monthlyPrice += 300;
// Addons
if (addonsSection.checkbox('competitorAnalysis')?.value()) monthlyPrice += 200;
if (addonsSection.checkbox('conversionOptimization')?.value()) monthlyPrice += 400;
if (addonsSection.checkbox('googleAdsManagement')?.value()) monthlyPrice += 500;
if (addonsSection.checkbox('analyticsSetup')?.value()) monthlyPrice += 150;
// Reporting frequency adjustment
const reportingFreq = contractSection.dropdown('reportingFrequency')?.value() || 'monthly';
if (reportingFreq === 'biweekly') monthlyPrice += 100;
if (reportingFreq === 'weekly') monthlyPrice += 250;
// Contract discount
const discounts = { '1': 0, '3': 0, '6': 0.05, '12': 0.10 };
const discount = discounts[contractLength] || 0;
const discountedPrice = monthlyPrice * (1 - discount);
// One-time setup fee
const setupFee = websiteSize === 'enterprise' ? 2000 : websiteSize === 'large' ? 1000 : 500;
return {
monthlyBase: Math.round(monthlyPrice),
monthlyDiscounted: Math.round(discountedPrice),
setupFee,
contractTotal: Math.round(discountedPrice * contractLength + setupFee),
discount: discount * 100,
contentCost: Math.round(contentCost)
};
};
resultsSection.addRow(row => {
row.addPriceDisplay('setupFee', {
label: 'One-Time Setup Fee',
computedValue: () => calculatePricing().setupFee,
variant: 'default'
}, '1fr');
row.addPriceDisplay('contentCost', {
label: 'Content Creation',
computedValue: () => calculatePricing().contentCost,
variant: 'default',
isVisible: () => calculatePricing().contentCost > 0
}, '1fr');
});
resultsSection.addRow(row => {
row.addTextPanel('discountInfo', {
computedValue: () => {
const discount = calculatePricing().discount;
return discount > 0 ? `${discount}% contract discount applied` : 'No contract discount';
},
customStyles: { 'font-size': '0.9rem', 'color': '#059669', 'text-align': 'center' }
});
});
// Summary Section
const summarySection = form.addSubform('summary', {
title: '💰 Investment Summary',
isCollapsible: false,
sticky: 'bottom'
});
summarySection.addRow(row => {
row.addPriceDisplay('monthlyPrice', {
label: 'Monthly Investment',
computedValue: () => calculatePricing().monthlyDiscounted,
variant: 'large'
}, '1fr');
row.addPriceDisplay('contractTotal', {
label: 'Contract Total',
computedValue: () => calculatePricing().contractTotal,
variant: 'success'
}, '1fr');
});
summarySection.addRow(row => {
row.addTextPanel('note', {
computedValue: () => 'SEO is a long-term investment. Results typically appear within 3-6 months of consistent effort.',
customStyles: { 'font-size': '0.8rem', 'color': '#64748b', 'text-align': 'center' }
});
});
form.configureSubmitButton({
label: 'Get Custom Proposal'
});
}