export function intellectualPropertyValuationCalculator(form: FormTs) {
// IP types and base valuation fees
const ipTypes: Record<string, { baseFee: number, hours: number }> = {
'patent-utility': { baseFee: 5000, hours: 20 },
'patent-design': { baseFee: 2500, hours: 10 },
'patent-portfolio': { baseFee: 15000, hours: 50 },
'trademark-single': { baseFee: 1500, hours: 6 },
'trademark-portfolio': { baseFee: 5000, hours: 18 },
'copyright-single': { baseFee: 1000, hours: 4 },
'copyright-portfolio': { baseFee: 3500, hours: 12 },
'trade-secret': { baseFee: 3000, hours: 12 },
'software-code': { baseFee: 4000, hours: 15 },
'brand-value': { baseFee: 8000, hours: 30 },
'licensing-rights': { baseFee: 3500, hours: 14 },
'comprehensive': { baseFee: 25000, hours: 80 }
};
// Valuation purposes
const valuationPurposes: Record<string, number> = {
'internal': 0.8,
'licensing': 1.0,
'sale-acquisition': 1.2,
'litigation': 1.5,
'tax-reporting': 1.1,
'financing': 1.15,
'insurance': 0.9,
'bankruptcy': 1.3
};
form.addRow(row => {
row.addTextPanel('header', {
computedValue: () => 'Intellectual Property Valuation Calculator',
customStyles: { 'font-size': '1.5rem', 'font-weight': '600', 'color': '#1e293b' }
});
});
form.addSpacer({ height: 20 });
// IP Type Section
const ipSection = form.addSubform('ipType', { title: '๐ก Intellectual Property Details' });
ipSection.addRow(row => {
row.addDropdown('type', {
label: 'IP Type',
options: [
{ id: 'patent-utility', name: 'Utility Patent' },
{ id: 'patent-design', name: 'Design Patent' },
{ id: 'patent-portfolio', name: 'Patent Portfolio' },
{ id: 'trademark-single', name: 'Single Trademark' },
{ id: 'trademark-portfolio', name: 'Trademark Portfolio' },
{ id: 'copyright-single', name: 'Single Copyright' },
{ id: 'copyright-portfolio', name: 'Copyright Portfolio' },
{ id: 'trade-secret', name: 'Trade Secret' },
{ id: 'software-code', name: 'Software / Source Code' },
{ id: 'brand-value', name: 'Brand Valuation' },
{ id: 'licensing-rights', name: 'Licensing Rights' },
{ id: 'comprehensive', name: 'Comprehensive IP Audit' }
],
defaultValue: 'patent-utility',
isRequired: true
}, '1fr');
row.addDropdown('industry', {
label: 'Industry',
options: [
{ id: 'technology', name: 'Technology / Software' },
{ id: 'pharma', name: 'Pharmaceutical / Biotech' },
{ id: 'manufacturing', name: 'Manufacturing' },
{ id: 'consumer', name: 'Consumer Products' },
{ id: 'media', name: 'Media / Entertainment' },
{ id: 'financial', name: 'Financial Services' },
{ id: 'healthcare', name: 'Healthcare' },
{ id: 'automotive', name: 'Automotive' },
{ id: 'other', name: 'Other' }
],
defaultValue: 'technology',
isRequired: true
}, '1fr');
});
ipSection.addRow(row => {
row.addDropdown('purpose', {
label: 'Valuation Purpose',
options: [
{ id: 'internal', name: 'Internal Planning' },
{ id: 'licensing', name: 'Licensing Negotiation' },
{ id: 'sale-acquisition', name: 'Sale / Acquisition' },
{ id: 'litigation', name: 'Litigation Support' },
{ id: 'tax-reporting', name: 'Tax Reporting / Transfer Pricing' },
{ id: 'financing', name: 'Financing / Collateral' },
{ id: 'insurance', name: 'Insurance Purposes' },
{ id: 'bankruptcy', name: 'Bankruptcy / Restructuring' }
],
defaultValue: 'licensing',
isRequired: true
}, '1fr');
row.addInteger('assetCount', {
label: 'Number of IP Assets',
min: 1,
max: 100,
defaultValue: 1
}, '1fr');
});
// Scope Section
const scopeSection = form.addSubform('scope', { title: '๐ Valuation Scope' });
scopeSection.addRow(row => {
row.addDropdown('methodology', {
label: 'Valuation Methodology',
options: [
{ id: 'cost', name: 'Cost Approach' },
{ id: 'market', name: 'Market Approach' },
{ id: 'income', name: 'Income Approach' },
{ id: 'relief-royalty', name: 'Relief from Royalty' },
{ id: 'multi-method', name: 'Multi-Method (+50%)' }
],
defaultValue: 'income',
isRequired: true
}, '1fr');
row.addDropdown('reportType', {
label: 'Report Type',
options: [
{ id: 'summary', name: 'Summary Letter' },
{ id: 'detailed', name: 'Detailed Report (+30%)' },
{ id: 'expert', name: 'Expert Report (Litigation) (+75%)' }
],
defaultValue: 'detailed',
isRequired: true
}, '1fr');
});
scopeSection.addRow(row => {
row.addCheckbox('marketResearch', {
label: 'Comparable Transaction Research (+$1,500)',
defaultValue: false
}, '1fr');
row.addCheckbox('financialAnalysis', {
label: 'Detailed Financial Analysis (+$2,000)',
defaultValue: false
}, '1fr');
});
scopeSection.addRow(row => {
row.addCheckbox('legalReview', {
label: 'Legal Status Review (+$1,000)',
defaultValue: true
}, '1fr');
row.addCheckbox('competitiveAnalysis', {
label: 'Competitive Landscape Analysis (+$1,500)',
defaultValue: false
}, '1fr');
});
// Service Section
const serviceSection = form.addSubform('service', { title: 'โ๏ธ Service Options' });
serviceSection.addRow(row => {
row.addDropdown('expertLevel', {
label: 'Valuator Level',
options: [
{ id: 'analyst', name: 'Senior Analyst' },
{ id: 'manager', name: 'Valuation Manager (+20%)' },
{ id: 'director', name: 'Director / Partner (+50%)' },
{ id: 'expert-witness', name: 'Expert Witness (+100%)' }
],
defaultValue: 'manager',
isRequired: true
}, '1fr');
row.addDropdown('urgency', {
label: 'Timeline',
options: [
{ id: 'standard', name: 'Standard (4-6 weeks)' },
{ id: 'expedited', name: 'Expedited (2-3 weeks) (+30%)' },
{ id: 'rush', name: 'Rush (1-2 weeks) (+60%)' }
],
defaultValue: 'standard',
isRequired: true
}, '1fr');
});
serviceSection.addRow(row => {
row.addCheckbox('certification', {
label: 'Certified Valuation Report (+$750)',
defaultValue: false
}, '1fr');
row.addCheckbox('presentation', {
label: 'Management Presentation (+$500)',
defaultValue: false
}, '1fr');
});
// Additional Services Section
const addonsSection = form.addSubform('addons', { title: 'โจ Additional Services' });
addonsSection.addRow(row => {
row.addCheckbox('dueDiligence', {
label: 'IP Due Diligence (+$3,000)',
defaultValue: false
}, '1fr');
row.addCheckbox('infringementAnalysis', {
label: 'Infringement Risk Analysis (+$2,500)',
defaultValue: false
}, '1fr');
});
addonsSection.addRow(row => {
row.addCheckbox('licensingStrategy', {
label: 'Licensing Strategy (+$2,000)',
defaultValue: false
}, '1fr');
row.addCheckbox('portfolioOptimization', {
label: 'Portfolio Optimization (+$3,500)',
defaultValue: false
}, '1fr');
});
addonsSection.addRow(row => {
row.addCheckbox('expertTestimony', {
label: 'Expert Testimony (per day) (+$5,000)',
defaultValue: false
}, '1fr');
row.addCheckbox('updateService', {
label: 'Annual Update Service (+$2,500)',
defaultValue: false
}, '1fr');
});
form.addSpacer({ height: 20, showLine: true, lineStyle: 'dashed' });
// Summary Section
const summarySection = form.addSubform('summary', { title: '๐ฐ Cost Estimate', isCollapsible: false });
summarySection.addRow(row => {
row.addPriceDisplay('baseFee', {
label: 'Base Valuation Fee',
computedValue: () => {
const type = ipSection.dropdown('type')?.value() || 'patent-utility';
const purpose = ipSection.dropdown('purpose')?.value() || 'licensing';
const assetCount = ipSection.integer('assetCount')?.value() || 1;
let fee = ipTypes[type]?.baseFee ?? 0;
fee *= valuationPurposes[purpose] || 1.0;
// Asset count adjustment (diminishing per-asset cost)
if (assetCount > 1) {
fee += (assetCount - 1) * (fee * 0.3);
}
return Math.round(fee);
},
variant: 'default'
}, '1fr');
row.addPriceDisplay('methodologyFee', {
label: 'Methodology & Report',
computedValue: () => {
const type = ipSection.dropdown('type')?.value() || 'patent-utility';
const methodology = scopeSection.dropdown('methodology')?.value() || 'income';
const reportType = scopeSection.dropdown('reportType')?.value() || 'detailed';
const baseFee = ipTypes[type]?.baseFee ?? 0;
let adjustment = 0;
// Methodology adjustment
if (methodology === 'multi-method') adjustment += baseFee * 0.5;
// Report type adjustment
if (reportType === 'detailed') adjustment += baseFee * 0.3;
if (reportType === 'expert') adjustment += baseFee * 0.75;
return Math.round(adjustment);
},
variant: 'default',
prefix: '+'
}, '1fr');
});
summarySection.addRow(row => {
row.addPriceDisplay('scopeFee', {
label: 'Scope Add-ons',
computedValue: () => {
let total = 0;
if (scopeSection.checkbox('marketResearch')?.value()) total += 1500;
if (scopeSection.checkbox('financialAnalysis')?.value()) total += 2000;
if (scopeSection.checkbox('legalReview')?.value()) total += 1000;
if (scopeSection.checkbox('competitiveAnalysis')?.value()) total += 1500;
return total;
},
variant: 'default',
prefix: '+'
}, '1fr');
row.addPriceDisplay('serviceFee', {
label: 'Service Adjustments',
computedValue: () => {
const type = ipSection.dropdown('type')?.value() || 'patent-utility';
const expertLevel = serviceSection.dropdown('expertLevel')?.value() || 'manager';
const urgency = serviceSection.dropdown('urgency')?.value() || 'standard';
const baseFee = ipTypes[type]?.baseFee ?? 0;
let adjustment = 0;
// Expert level
const expertMultipliers: Record<string, number> = {
'analyst': 0, 'manager': 0.2, 'director': 0.5, 'expert-witness': 1.0
};
adjustment += baseFee * (expertMultipliers[expertLevel] || 0);
// Urgency
const urgencyMultipliers: Record<string, number> = {
'standard': 0, 'expedited': 0.3, 'rush': 0.6
};
adjustment += baseFee * (urgencyMultipliers[urgency] || 0);
// Certifications
if (serviceSection.checkbox('certification')?.value()) adjustment += 750;
if (serviceSection.checkbox('presentation')?.value()) adjustment += 500;
return Math.round(adjustment);
},
variant: 'default',
prefix: '+'
}, '1fr');
});
summarySection.addRow(row => {
row.addPriceDisplay('addonsFee', {
label: 'Additional Services',
computedValue: () => {
let total = 0;
if (addonsSection.checkbox('dueDiligence')?.value()) total += 3000;
if (addonsSection.checkbox('infringementAnalysis')?.value()) total += 2500;
if (addonsSection.checkbox('licensingStrategy')?.value()) total += 2000;
if (addonsSection.checkbox('portfolioOptimization')?.value()) total += 3500;
if (addonsSection.checkbox('expertTestimony')?.value()) total += 5000;
if (addonsSection.checkbox('updateService')?.value()) total += 2500;
return total;
},
variant: 'default',
prefix: '+'
});
});
const finalSection = form.addSubform('final', {
title: '๐งพ Total Estimate',
isCollapsible: false,
sticky: 'bottom'
});
finalSection.addRow(row => {
row.addPriceDisplay('totalFee', {
label: 'Estimated Total',
computedValue: () => {
const type = ipSection.dropdown('type')?.value() || 'patent-utility';
const purpose = ipSection.dropdown('purpose')?.value() || 'licensing';
const assetCount = ipSection.integer('assetCount')?.value() || 1;
const methodology = scopeSection.dropdown('methodology')?.value() || 'income';
const reportType = scopeSection.dropdown('reportType')?.value() || 'detailed';
const expertLevel = serviceSection.dropdown('expertLevel')?.value() || 'manager';
const urgency = serviceSection.dropdown('urgency')?.value() || 'standard';
// Base fee
let fee = ipTypes[type]?.baseFee ?? 0;
fee *= valuationPurposes[purpose] || 1.0;
if (assetCount > 1) {
fee += (assetCount - 1) * (fee * 0.3);
}
// Methodology
if (methodology === 'multi-method') fee *= 1.5;
// Report type
if (reportType === 'detailed') fee *= 1.3;
if (reportType === 'expert') fee *= 1.75;
// Expert level
const expertMultipliers: Record<string, number> = {
'analyst': 1.0, 'manager': 1.2, 'director': 1.5, 'expert-witness': 2.0
};
fee *= expertMultipliers[expertLevel] || 1.0;
// Urgency
const urgencyMultipliers: Record<string, number> = {
'standard': 1.0, 'expedited': 1.3, 'rush': 1.6
};
fee *= urgencyMultipliers[urgency] || 1.0;
// Scope add-ons
if (scopeSection.checkbox('marketResearch')?.value()) fee += 1500;
if (scopeSection.checkbox('financialAnalysis')?.value()) fee += 2000;
if (scopeSection.checkbox('legalReview')?.value()) fee += 1000;
if (scopeSection.checkbox('competitiveAnalysis')?.value()) fee += 1500;
// Service add-ons
if (serviceSection.checkbox('certification')?.value()) fee += 750;
if (serviceSection.checkbox('presentation')?.value()) fee += 500;
// Additional services
if (addonsSection.checkbox('dueDiligence')?.value()) fee += 3000;
if (addonsSection.checkbox('infringementAnalysis')?.value()) fee += 2500;
if (addonsSection.checkbox('licensingStrategy')?.value()) fee += 2000;
if (addonsSection.checkbox('portfolioOptimization')?.value()) fee += 3500;
if (addonsSection.checkbox('expertTestimony')?.value()) fee += 5000;
if (addonsSection.checkbox('updateService')?.value()) fee += 2500;
return Math.round(fee);
},
variant: 'large'
});
});
finalSection.addRow(row => {
row.addTextPanel('timeEstimate', {
computedValue: () => {
const type = ipSection.dropdown('type')?.value() || 'patent-utility';
const hours = ipTypes[type]?.hours ?? 0;
return `Estimated engagement: ${hours}-${hours + 10} hours`;
},
customStyles: { 'font-size': '0.9rem', 'color': '#64748b', 'text-align': 'center' }
});
});
finalSection.addRow(row => {
row.addTextPanel('disclaimer', {
computedValue: () => 'This estimate is for planning purposes. Final fees depend on IP complexity, available documentation, and specific valuation requirements. A detailed scope discussion is required before engagement.',
customStyles: { 'font-size': '0.8rem', 'color': '#64748b', 'font-style': 'italic' }
});
});
form.configureSubmitButton({
label: 'Request Valuation Proposal'
});
}