export function salesPersonalityQuiz(form: FormTs) {
form.setTitle(() => '💼 What\'s Your Sales Personality?');
const scores = form.state<Record<string, number>>({
hunter: 0, farmer: 0, consultant: 0, challenger: 0
});
const updateScore = (archetype: string, points: number) => {
scores.update(current => ({ ...current, [archetype]: (current[archetype] || 0) + points }));
};
const getTopArchetype = () => {
const s = scores();
const archetypes = ['hunter', 'farmer', 'consultant', 'challenger'] as const;
let top = 'hunter';
let topScore = 0;
for (const a of archetypes) {
if ((s[a] || 0) > topScore) { topScore = s[a] || 0; top = a; }
}
return top;
};
const archetypeData: Record<string, { name: string; emoji: string; tagline: string; color: string; strengths: string }> = {
hunter: { name: 'The Hunter', emoji: '🎯', tagline: 'Always on the prowl for new opportunities', color: '#ef4444', strengths: 'Prospecting, Cold outreach, Closing deals' },
farmer: { name: 'The Farmer', emoji: '🌱', tagline: 'Growing deep roots with existing customers', color: '#22c55e', strengths: 'Account management, Upselling, Retention' },
consultant: { name: 'The Consultant', emoji: '🧠', tagline: 'Solving problems, not pushing products', color: '#3b82f6', strengths: 'Solution selling, Discovery, Building trust' },
challenger: { name: 'The Challenger', emoji: '⚡', tagline: 'Teaching customers what they need', color: '#8b5cf6', strengths: 'Insight selling, Negotiation, Value creation' }
};
const defaultArchetype = { name: 'The Hunter', emoji: '🎯', tagline: 'Always on the prowl for new opportunities', color: '#ef4444', strengths: 'Prospecting, Cold outreach, Closing deals' };
const getArchetypeInfo = (key: string) => archetypeData[key] ?? defaultArchetype;
form.configureCompletionScreen({
type: 'text',
title: () => `${getArchetypeInfo(getTopArchetype()).emoji} You're ${getArchetypeInfo(getTopArchetype()).name}!`,
message: () => {
const info = getArchetypeInfo(getTopArchetype());
return `${info.tagline}. Your strengths: ${info.strengths}. Check your email for your full personality profile!`;
}
});
const pages = form.addPages('quiz-pages', { heightMode: 'current-page' });
// ============ PAGE 1: Sales Approach ============
const page1 = pages.addPage('approach', { mobileBreakpoint: 500 });
page1.addRow(row => {
row.addTextPanel('header1', {
label: 'Step 1 of 5: Your Sales Approach',
computedValue: () => 'Answer honestly - there are no wrong answers!',
customStyles: { fontSize: '0.9rem', color: '#6b7280', marginBottom: '1rem' }
});
});
page1.addSpacer({ height: '24px' });
page1.addRow(row => {
row.addRadioButton('new_vs_existing', {
label: 'What energizes you more in sales?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'new', name: '🎯 Hunting for new business and closing fresh deals' },
{ id: 'existing', name: '🌱 Growing relationships with existing customers' },
{ id: 'solving', name: '🧠 Solving complex problems for clients' },
{ id: 'teaching', name: '⚡ Teaching customers something they didn\'t know' }
],
onValueChange: (val) => {
if (val === 'new') updateScore('hunter', 3);
else if (val === 'existing') updateScore('farmer', 3);
else if (val === 'solving') updateScore('consultant', 3);
else updateScore('challenger', 3);
}
});
});
page1.addRow(row => {
row.addRadioButton('cold_calling', {
label: 'How do you feel about cold calling?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'love', name: '🎯 Love it - it\'s where the action is!' },
{ id: 'necessary', name: '⚡ Necessary evil - I push through' },
{ id: 'prefer_warm', name: '🌱 Prefer warm introductions' },
{ id: 'avoid', name: '🧠 Avoid it - I prefer inbound leads' }
],
onValueChange: (val) => {
if (val === 'love') updateScore('hunter', 3);
else if (val === 'necessary') updateScore('challenger', 2);
else if (val === 'prefer_warm') updateScore('farmer', 2);
else updateScore('consultant', 2);
}
});
});
// ============ PAGE 2: Communication Style ============
const page2 = pages.addPage('communication', { mobileBreakpoint: 500 });
page2.addRow(row => {
row.addTextPanel('header2', {
label: 'Step 2 of 5: Communication Style',
computedValue: () => 'How do you connect with prospects and customers?',
customStyles: { fontSize: '0.9rem', color: '#6b7280', marginBottom: '1rem' }
});
});
page2.addSpacer({ height: '24px' });
page2.addRow(row => {
row.addRadioButton('pitch_style', {
label: 'How would you describe your pitch style?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'direct', name: '🎯 Direct and to the point - time is money' },
{ id: 'relationship', name: '🌱 Relationship-focused - build rapport first' },
{ id: 'educational', name: '🧠 Educational - help them understand their needs' },
{ id: 'provocative', name: '⚡ Provocative - challenge their thinking' }
],
onValueChange: (val) => {
if (val === 'direct') updateScore('hunter', 3);
else if (val === 'relationship') updateScore('farmer', 3);
else if (val === 'educational') updateScore('consultant', 3);
else updateScore('challenger', 3);
}
});
});
page2.addRow(row => {
row.addRadioButton('objection_handling', {
label: 'When a prospect objects, you typically:',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'overcome', name: '🎯 Quickly overcome it and push forward' },
{ id: 'understand', name: '🌱 Take time to understand their concern' },
{ id: 'probe', name: '🧠 Probe deeper to find the root cause' },
{ id: 'reframe', name: '⚡ Reframe their perspective entirely' }
],
onValueChange: (val) => {
if (val === 'overcome') updateScore('hunter', 2);
else if (val === 'understand') updateScore('farmer', 2);
else if (val === 'probe') updateScore('consultant', 2);
else updateScore('challenger', 2);
}
});
});
// ============ PAGE 3: Deal Preferences ============
const page3 = pages.addPage('deals', { mobileBreakpoint: 500 });
page3.addRow(row => {
row.addTextPanel('header3', {
label: 'Step 3 of 5: Deal Preferences',
computedValue: () => 'What types of deals do you prefer working on?',
customStyles: { fontSize: '0.9rem', color: '#6b7280', marginBottom: '1rem' }
});
});
page3.addSpacer({ height: '24px' });
page3.addRow(row => {
row.addRadioButton('deal_size', {
label: 'What\'s your ideal deal type?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'volume', name: '🎯 Many smaller deals - volume is king' },
{ id: 'expand', name: '🌱 Expand existing accounts over time' },
{ id: 'complex', name: '🧠 Complex enterprise deals requiring expertise' },
{ id: 'transform', name: '⚡ Transformational deals that change businesses' }
],
onValueChange: (val) => {
if (val === 'volume') updateScore('hunter', 3);
else if (val === 'expand') updateScore('farmer', 3);
else if (val === 'complex') updateScore('consultant', 3);
else updateScore('challenger', 3);
}
});
});
page3.addRow(row => {
row.addRadioButton('sales_cycle', {
label: 'How do you feel about long sales cycles?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'short', name: '🎯 Prefer short cycles - close and move on' },
{ id: 'patient', name: '🌱 Patient - good things take time' },
{ id: 'thorough', name: '🧠 Thorough discovery is worth the time' },
{ id: 'accelerate', name: '⚡ I try to accelerate by creating urgency' }
],
onValueChange: (val) => {
if (val === 'short') updateScore('hunter', 2);
else if (val === 'patient') updateScore('farmer', 2);
else if (val === 'thorough') updateScore('consultant', 2);
else updateScore('challenger', 2);
}
});
});
// ============ PAGE 4: Success Metrics ============
const page4 = pages.addPage('metrics', { mobileBreakpoint: 500 });
page4.addRow(row => {
row.addTextPanel('header4', {
label: 'Step 4 of 5: Success & Motivation',
computedValue: () => 'What drives you and how do you measure success?',
customStyles: { fontSize: '0.9rem', color: '#6b7280', marginBottom: '1rem' }
});
});
page4.addSpacer({ height: '24px' });
page4.addRow(row => {
row.addRadioButton('success_metric', {
label: 'What\'s your most important success metric?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'new_logos', name: '🎯 New logos / customer acquisition' },
{ id: 'nrr', name: '🌱 Net revenue retention / expansion' },
{ id: 'csat', name: '🧠 Customer satisfaction / NPS' },
{ id: 'deal_size', name: '⚡ Average deal size / value' }
],
onValueChange: (val) => {
if (val === 'new_logos') updateScore('hunter', 3);
else if (val === 'nrr') updateScore('farmer', 3);
else if (val === 'csat') updateScore('consultant', 3);
else updateScore('challenger', 3);
}
});
});
page4.addRow(row => {
row.addRadioButton('motivation', {
label: 'What motivates you most in sales?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'winning', name: '🎯 Winning against competitors' },
{ id: 'helping', name: '🌱 Helping customers succeed long-term' },
{ id: 'solving', name: '🧠 Solving difficult problems' },
{ id: 'impact', name: '⚡ Making a real business impact' }
],
onValueChange: (val) => {
if (val === 'winning') updateScore('hunter', 2);
else if (val === 'helping') updateScore('farmer', 2);
else if (val === 'solving') updateScore('consultant', 2);
else updateScore('challenger', 2);
}
});
});
// ============ PAGE 5: Work Style ============
const page5 = pages.addPage('workstyle', { mobileBreakpoint: 500 });
page5.addRow(row => {
row.addTextPanel('header5', {
label: 'Step 5 of 5: Work Style',
computedValue: () => 'Final questions about how you work',
customStyles: { fontSize: '0.9rem', color: '#6b7280', marginBottom: '1rem' }
});
});
page5.addSpacer({ height: '24px' });
page5.addRow(row => {
row.addRadioButton('preparation', {
label: 'How do you prepare for important meetings?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'minimal', name: '🎯 Quick research - I\'m best on my feet' },
{ id: 'history', name: '🌱 Review relationship history and past interactions' },
{ id: 'deep', name: '🧠 Deep research on their business challenges' },
{ id: 'insight', name: '⚡ Prepare insights they won\'t expect' }
],
onValueChange: (val) => {
if (val === 'minimal') updateScore('hunter', 2);
else if (val === 'history') updateScore('farmer', 2);
else if (val === 'deep') updateScore('consultant', 2);
else updateScore('challenger', 2);
}
});
});
page5.addRow(row => {
row.addRadioButton('lost_deal', {
label: 'When you lose a deal, you typically:',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'move_on', name: '🎯 Move on quickly - plenty more fish' },
{ id: 'nurture', name: '🌱 Keep nurturing - timing might change' },
{ id: 'analyze', name: '🧠 Analyze what went wrong in detail' },
{ id: 'learn', name: '⚡ Learn and apply insights to future deals' }
],
onValueChange: (val) => {
if (val === 'move_on') updateScore('hunter', 2);
else if (val === 'nurture') updateScore('farmer', 2);
else if (val === 'analyze') updateScore('consultant', 2);
else updateScore('challenger', 2);
}
});
});
page5.addSpacer({ height: '20px' });
// Results Preview
page5.addRow(row => {
row.addTextPanel('resultLabel', {
label: '🎭 Your Sales Personality',
computedValue: () => '',
customStyles: { fontSize: '1.2rem', fontWeight: '700', textAlign: 'center', marginTop: '1rem' }
});
});
page5.addRow(row => {
row.addTextPanel('resultEmoji', {
computedValue: () => getArchetypeInfo(getTopArchetype()).emoji,
customStyles: { fontSize: '4rem', textAlign: 'center' }
});
});
page5.addRow(row => {
row.addTextPanel('resultName', {
computedValue: () => getArchetypeInfo(getTopArchetype()).name,
customStyles: () => ({
fontSize: '2rem', fontWeight: 'bold', textAlign: 'center',
color: getArchetypeInfo(getTopArchetype()).color || '#1e293b'
})
});
});
page5.addRow(row => {
row.addTextPanel('resultTagline', {
computedValue: () => getArchetypeInfo(getTopArchetype()).tagline,
customStyles: { fontSize: '1.1rem', color: '#64748b', fontStyle: 'italic', textAlign: 'center', marginBottom: '0.5rem' }
});
});
page5.addRow(row => {
row.addTextPanel('resultStrengths', {
computedValue: () => `💪 Strengths: ${getArchetypeInfo(getTopArchetype()).strengths}`,
customStyles: { fontSize: '0.95rem', color: '#374151', textAlign: 'center', padding: '12px', background: '#f8fafc', borderRadius: '8px' }
});
});
// ============ Lead Capture Page ============
const leadPage = pages.addPage('lead_capture', { mobileBreakpoint: 500 });
leadPage.addRow(row => {
row.addTextPanel('lead_header', {
label: 'Step 6 of 6: Get Your Full Profile',
computedValue: () => 'Enter your details to receive your complete personality report',
customStyles: { fontSize: '0.9rem', color: '#6b7280', marginBottom: '1rem' }
});
});
leadPage.addSpacer({ height: '24px' });
leadPage.addRow(row => {
row.addTextbox('first_name', {
label: 'First Name',
isRequired: true,
placeholder: 'John'
}, '1fr');
row.addTextbox('last_name', {
label: 'Last Name',
isRequired: true,
placeholder: 'Smith'
}, '1fr');
});
leadPage.addRow(row => {
row.addEmail('email', {
label: 'Work Email',
isRequired: true,
placeholder: 'john@company.com'
});
});
leadPage.addRow(row => {
row.addDropdown('role', {
label: 'Current Role',
isRequired: true,
placeholder: 'Select your role',
options: [
{ id: 'sdr', name: '📞 SDR / BDR' },
{ id: 'ae', name: '💼 Account Executive' },
{ id: 'am', name: '🌱 Account Manager' },
{ id: 'manager', name: '👔 Sales Manager' },
{ id: 'director', name: '📊 Director / VP Sales' },
{ id: 'other', name: '📋 Other' }
]
});
});
leadPage.addRow(row => {
row.addCheckboxList('consent', {
orientation: 'vertical',
options: [
{ id: 'report', name: '📄 Send me my full personality profile', isRequired: true },
{ id: 'tips', name: '💡 Send me sales tips for my personality type' },
{ id: 'coaching', name: '📞 I\'m interested in sales coaching' }
],
defaultValue: ['report']
});
});
form.configurePdf('profile', (pdf) => {
pdf.configure({
filename: 'sales-personality-profile.pdf',
pageSize: 'A4',
allowUserDownload: true,
downloadButtonLabel: '📄 Download Profile',
header: { title: 'Your Sales Personality Profile', subtitle: getArchetypeInfo(getTopArchetype()).name },
footer: { text: 'Generated by FormTs Sales Personality Quiz', showPageNumbers: true }
});
pdf.addSection('Your Personality Type', section => {
const info = getArchetypeInfo(getTopArchetype());
section.addRow(row => {
row.addField('Personality', `${info.emoji} ${info.name}`);
});
section.addRow(row => {
row.addField('Description', info.tagline);
});
section.addRow(row => {
row.addField('Key Strengths', info.strengths);
});
});
});
form.configureSubmitButton({
label: () => `📧 Get My ${getArchetypeInfo(getTopArchetype()).name} Profile`
});
form.configureSubmitBehavior({
sendToServer: true
});
}