1import{r as v,j as e}from"./react-Dr3QwwBG.js";import{u as w,n as j,e as C,d as n,aB as y}from"./index-C86L-Z4G.js";import{a as N}from"./query-0MJ9zGHA.js";import{C as m,D as A,z as S,S as I,f as L,bR as F}from"./icons-CdL-Lonm.js";import"./markdown-Bf1FtwSG.js";const W="/assets/step-create-agent-CHnl5DoC.png",B="/assets/step-add-knowledge-B-ctQ8Od.png",D="/assets/step-configure-agent-DCUvBkZS.png",_="/assets/step-deploy-widget-C93cWMi1.png",E="/assets/step-integrations-Bvktrqoh.png",r=[{id:"agent",title:"Create your first AI agent",description:"Set up an AI-powered agent that can answer questions, capture leads, and help your customers 24/7.",buttonLabel:"Create Agent",route:"/agents/create",checkField:"hasAgent",image:W},{id:"knowledge",title:"Add knowledge sources to your agent",description:"Upload your website, PDFs, or FAQs so your agent can give accurate, helpful answers based on your actual content.",buttonLabel:"Add Knowledge",route:null,checkField:"hasKnowledge",image:B},{id:"configure",title:"Customize agent behavior",description:"Fine-tune your agent's tone, personality, and response style to match your brand voice perfectly.",buttonLabel:"Configure Agent",route:null,checkField:"hasWidgetConfig",image:D},{id:"widget",title:"Deploy your chat widget",description:"Add a single line of code to your website and your AI agent will be live, ready to chat with visitors.",buttonLabel:"Install Widget",route:null,checkField:"installedWidget",image:_},{id:"integrations",title:"Connect integrations",description:"Connect HubSpot, WhatsApp, Calendly and more to automate your workflow and sync data across tools.",buttonLabel:"Explore Integrations",route:"/dashboard/integrations",checkField:"hubspotConnected",image:E}],T=[{icon:I,iconBg:"bg-violet-50 dark:bg-violet-950/30",iconColor:"text-violet-500",title:"Train your AI agent",description:"Upload knowledge sources and fine-tune responses to match your brand voice.",route:"/agents"},{icon:L,iconBg:"bg-blue-50 dark:bg-blue-950/30",iconColor:"text-blue-500",title:"Track conversations",description:"Monitor engagement, leads captured, and top customer questions in real-time.",route:"/conversations"},{icon:F,iconBg:"bg-rose-50 dark:bg-rose-950/30",iconColor:"text-rose-500",title:"Explore integrations",description:"Connect with Slack, WhatsApp, Calendly and more to extend your reach.",route:"/dashboard/integrations"}],G=()=>{const[,g]=w(),[o,d]=v.useState("__init__"),{data:p,isLoading:b}=N({queryKey:[j.onboarding.status.path]});if(b)return e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]","data-testid":"loading-dashboard",children:e.jsx(C,{className:"h-6 w-6 animate-spin text-slate-400"})});const s=p||{hasAgent:!1,hasKnowledge:!1,hasWidgetConfig:!1,hasLead:!1,hasConversation:!1,hubspotConnected:!1,installedWidget:!1,onboardingCompleted:!1,completedSteps:0,totalSteps:5,plan:"STARTER",currentStep:"agent",agentId:null},i=t=>t.checkField==="installedWidget"?s.installedWidget||s.hasConversation:s[t.checkField],u=r.filter(i).length,f=t=>t.route?t.route:s.agentId?`/agents/${s.agentId}`:"/agents";if(o==="__init__"){const t=r.find(a=>!i(a));setTimeout(t?()=>d(t.id):()=>d(null),0)}const x=r.find(t=>t.id===o),h=x?x.image:null;return e.jsx("div",{className:"bg-white dark:bg-background min-h-full",children:e.jsxs("div",{className:"p-4 md:p-6 lg:p-8 max-w-[1100px] mx-auto","data-testid":"dashboard-container",children:[e.jsx("div",{className:"mb-8",children:e.jsx("h1",{className:"text-[22px] font-bold tracking-tight text-slate-900 dark:text-foreground","data-testid":"text-dashboard-title",children:"Get started with ChatType"})}),e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-slate-300 dark:border-slate-600 flex items-center justify-center shrink-0",children:u===5&&e.jsx(m,{className:"h-3 w-3 text-emerald-500"})}),e.jsx("span",{className:"text-[14px] font-medium text-slate-900 dark:text-foreground",children:"Get set up"}),e.jsxs("span",{className:"text-[13px] text-slate-400 dark:text-muted-foreground","data-testid":"text-progress",children:["· ",u," / 5 steps"]})]}),e.jsxs("div",{className:"flex gap-6 items-start mb-10",children:[e.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-card rounded-2xl border border-[#eaecef] dar
1k:border-border shadow-sm overflow-hidden",children:r.map((t,a)=>{const l=i(t),c=o===t.id,k=a===r.length-1;return e.jsxs("div",{"data-testid":`step-card-${t.id}`,children:[e.jsxs("button",{className:"w-full flex items-center gap-3.5 px-5 py-4 text-left hover:bg-slate-50/50 dark:hover:bg-muted/20 transition-colors",onClick:()=>d(c?null:t.id),"data-testid":`step-toggle-${t.id}`,children:[e.jsx("div",{className:n("h-5 w-5 rounded-full flex items-center justify-center shrink-0",l?"bg-emerald-500":"border-2 border-slate-300 dark:border-slate-600"),children:l&&e.jsx(m,{className:"h-3 w-3 text-white"})}),e.jsx("span",{className:n("flex-1 text-[14px] font-medium",l?"text-emerald-700/70 dark:text-emerald-400/70 line-through":"text-slate-900 dark:text-foreground"),children:t.title}),c?e.jsx(A,{className:"h-4 w-4 text-slate-400 dark:text-muted-foreground shrink-0"}):e.jsx(S,{className:"h-4 w-4 text-slate-400 dark:text-muted-foreground shrink-0"})]}),c&&e.jsx("div",{className:"px-5 pb-5 pt-0",children:e.jsxs("div",{className:"ml-[34px]",children:[e.jsx("p",{className:"text-[13px] text-slate-500 dark:text-muted-foreground leading-relaxed mb-4",children:t.description}),e.jsx(y,{variant:"default",size:"sm",className:"rounded-lg h-9 text-[13px] font-medium bg-slate-900 hover:bg-slate-800 dark:bg-foreground dark:hover:bg-foreground
1/90 dark:text-background",onClick:()=>g(f(t)),"data-testid":`step-action-${t.id}`,children:t.buttonLabel})]})}),!k&&e.jsx("div",{className:"mx-5 border-b border-[#eaecef] dark:border-border"})]},t.id)})}),h&&e.jsx("div",{className:"hidden lg:block shrink-0 w-[320px] pt-4",children:e.jsx("img",{src:h,alt:"Step preview",className:"w-full h-auto rounded-xl border border-[#eaecef] dark:border-border shadow-sm","data-testid":"step-preview-image"},o)})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[16px] font-semibold text-slate-900 dark:text-foreground mb-4","data-testid":"text-go-further",children:"Go further"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:T.map(t=>{const a=t.icon;return e.jsxs("button",{onClick:()=>g(t.route),className:"bg-white dark:bg-card rounded-xl border border-[#eaecef] dark:border-border p-5 text-left hover:border-slate-300 dark:hover:border-border/80 transition-colors group","data-testid":`card-${t.title.toLowerCase().replace(/\s+/g,"-")}`,children:[e.jsx("div",{className:n("h-10 w-10 rounded-lg flex items-center justify-center mb-3",t.iconBg),children:e.jsx(a,{className:n("h-5 w-5",t.iconColor)})}),e.jsx("h3",{className:"text-[14px] font-semibold text-slate-900 dark:text-foreground mb-1",children:t.title}),e.jsx("p",{className:"text-[12px] text-slate-500 dark:text-muted-foreground leading-relaxed",children:t.description})]},t.title)})})]})]})})};export{G as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.