SuperChatPal AI Agent Discovery Form
Tell us about your organisation, customer journey, repetitive work and systems. We will use your answers to recommend an appropriate AI Agent solution and prepare a tailored quotation.
Quotation Brief
Selected scope
Estimated current administrative cost
Commercial note
This automated result is an initial scoping guide, not a binding quotation. Final pricing should follow a discovery review, technical validation, data-protection assessment and confirmation of third-party software costs.
function formDataObject(){ const fd = new FormData(form), obj = {}; for(const [k,v] of fd.entries()){ if(obj[k]) obj[k] = Array.isArray(obj[k]) ? [...obj[k],v] : [obj[k],v]; else obj[k]=v; } return obj; }
function asArray(v){ return !v ? [] : Array.isArray(v) ? v : [v]; }
function calculateScore(d){ let score=0; score += asArray(d.functions).length; score += asArray(d.channels).length * 1.2; score += asArray(d.integrations).length * 1.5; score += Number(d.monthlyVolume || 0); if(d.sso==="Yes") score+=2; if(d.audit==="Yes") score+=2; if(d.approval==="Yes") score+=2; if(asArray(d.dataTypes).some(x=>/Health|Payment|HR|Confidential/.test(x))) score+=4; if(d.apiAccess==="No" || d.apiAccess==="Not sure") score+=1; if(d.contentReady==="0" || d.contentReady==="1") score+=2; return score; }
function tierFromScore(s){ if(s < 10) return ["Starter AI Agent","A focused assistant for FAQs, lead capture or simple booking on one main channel."]; if(s < 20) return ["Business Automation AI Agent","A multi-function agent with workflow automation and selected system integrations."]; if(s < 31) return ["Advanced Integrated AI Agent","A multi-channel solution with several integrations, escalation rules and stronger governance."]; return ["Enterprise AI Agent Ecosystem","A complex, high-volume or regulated solution requiring technical discovery, governance and phased implementation."]; } function renderResult(d){ const score=calculateScore(d), [tier,rec]=tierFromScore(score); document.getElementById('tier').textContent=tier; document.getElementById('recommendation').textContent=rec; const selected=[...asArray(d.goals),...asArray(d.functions),...asArray(d.channels),...asArray(d.integrations)]; document.getElementById('scopePills').innerHTML=selected.length?selected.map(x=>`${escapeHtml(x)}`).join(""):"No scope items selected."; const hrs=Number(d.hoursPerWeek||0), rate=Number(d.hourlyCost||0); const yearly=hrs*rate*52; document.getElementById('costEstimate').textContent = yearly>0 ? `Approximately ${d.currency||""} ${yearly.toLocaleString(undefined,{maximumFractionDigits:0})} per year, based on the workload and hourly cost entered. This is not a guaranteed saving.` : "Not calculated because weekly hours and/or hourly cost were not supplied."; document.getElementById('result').style.display='block'; document.getElementById('result').scrollIntoView({behavior:'smooth'}); }
function escapeHtml(s){return String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));}
form.addEventListener('submit', e=>{ e.preventDefault(); const goals=form.querySelectorAll('input[name="goals"]:checked').length; const funcs=form.querySelectorAll('input[name="functions"]:checked').length; const chans=form.querySelectorAll('input[name="channels"]:checked').length; if(!goals || !funcs || !chans){ alert("Please select at least one business goal, AI function and operating channel."); return; } latestData=formDataObject(); latestData.generatedAt=new Date().toISOString(); latestData.complexityScore=calculateScore(latestData); latestData.complexityTier=tierFromScore(latestData.complexityScore)[0]; renderResult(latestData); });
function updateProgress(){ const required=[...form.querySelectorAll('[required]')]; const done=required.filter(el => el.type==="checkbox" ? el.checked : el.value.trim()).length; const pct=Math.round(done/required.length*100); document.getElementById('progressBar').style.width=pct+"%"; document.getElementById('progressText').textContent=pct+"% of essential fields complete"; } form.addEventListener('input',updateProgress); form.addEventListener('change',updateProgress); updateProgress();
function saveDraft(){
localStorage.setItem('scpDraft',JSON.stringify(formDataObject()));
alert("Draft saved in this browser.");
}
function loadDraft(){
const raw=localStorage.getItem('scpDraft');
if(!raw){alert("No saved draft was found.");return;}
const d=JSON.parse(raw);
form.reset();
Object.entries(d).forEach(([k,v])=>{
const vals=asArray(v);
form.querySelectorAll(`[name="${CSS.escape(k)}"]`).forEach(el=>{
if(el.type==="checkbox"||el.type==="radio") el.checked=vals.includes(el.value) || (k==="consent" && vals.includes("on"));
else el.value=vals[0]||"";
});
});
updateProgress();
alert("Draft loaded.");
}
function blobDownload(content,type,filename){
const blob=new Blob([content],{type}), a=document.createElement('a');
a.href=URL.createObjectURL(blob); a.download=filename; a.click(); URL.revokeObjectURL(a.href);
}
function downloadJSON(){
if(!Object.keys(latestData).length) latestData=formDataObject();
blobDownload(JSON.stringify(latestData,null,2),'application/json','superchatpal-ai-agent-brief.json');
}
function downloadCSV(){
if(!Object.keys(latestData).length) latestData=formDataObject();
const rows=[["Field","Answer"]];
Object.entries(latestData).forEach(([k,v])=>rows.push([k,Array.isArray(v)?v.join("; "):v]));
const csv=rows.map(r=>r.map(x=>`"${String(x??"").replace(/"/g,'""')}"`).join(",")).join("\n");
blobDownload(csv,'text/csv','superchatpal-ai-agent-brief.csv');
}
function emailBrief(){
if(!Object.keys(latestData).length) latestData=formDataObject();
const subject=encodeURIComponent(`AI Agent Quote Request – ${latestData.businessName||"New Enquiry"}`);
const body=encodeURIComponent(Object.entries(latestData).map(([k,v])=>`${k}: ${Array.isArray(v)?v.join(", "):v}`).join("\n"));
window.location.href=`mailto:?subject=${subject}&body=${body}`;
}
