1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29168],{39763:function(e,t,a){a.d(t,{Z:function(){return i}});var n=a(2265),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),i=(e,t)=>{let a=(0,n.forwardRef)((a,i)=>{let{color:l="currentColor",size:d=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:u="",children:p,...m}=a;return(0,n.createElement)("svg",{ref:i,...r,width:d,height:d,stroke:l,strokeWidth:c?24*Number(o)/Number(d):o,className:["lucide","lucide-".concat(s(e)),u].join(" "),...m},[...t.map(e=>{let[t,a]=e;return(0,n.createElement)(t,a)}),...Array.isArray(p)?p:[p]])});return a.displayName="".concat(e),a}},63639:function(e,t,a){a.d(t,{Z:function(){return n}});let n=(0,a(39763).Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},76858:function(e,t,a){a.d(t,{Z:function(){return n}});let n=(0,a(39763).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},66901:function(e,t,a){a.d(t,{Z:function(){return n}});let n=(0,a(39763).Z)("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},96362:function(e,t,a){a.d(t,{Z:function(){return n}});let n=(0,a(39763).Z)("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]])},15863:function(e,t,a){a.d(t,{Z:function(){return n}});let n=(0,a(39763).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},82023:function(e,t,a){a.d(t,{Z:function(){return n}});let n=(0,a(39763).Z)("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]])},27648:function(e,t,a){a.d(t,{default:function(){return r.a}});var n=a(72972),r=a.n(n)},99376:function(e,t,a){var n=a(35475);a.o(n,"useParams")&&a.d(t,{useParams:function(){return n.useParams}}),a.o(n,"usePathname")&&a.d(t,{usePathname:function(){return n.usePathname}}),a.o(n,"useRouter")&&a.d(t,{useRouter:function(){return n.useRouter}}),a.o(n,"useSearchParams")&&a.d(t,{useSearchParams:function(){return n.useSearchParams}})},46409:function(e,t,a){a.r(t),a.d(t,{default:function(){return g}});var n=a(57437),r=a(2265),s=a(27648),i=a(79820),l=a(69174),d=a(96362),o=a(15863),c=a(82023),u=a(66901),p=a(63639),m=a(76858),f=a(30399),x=a(18949),h=a(84881),v=a(71837);function g(){let{user:e}=(0,h.a)(),[t,a]=(0,r.useState)([]),[g,y]=(0,r.useState)([]),[j,N]=(0,r.useState)(!0);(0,r.useEffect)(()=>{let t=null==e?void 0:e.workspace_id;if(!t)return;let n=!1;return(async()=>{N(!0);try{let[e,r]=await Promise.all([(0,f.Jt)(t),x.X.list().catch(()=>({personas:[]}))]);if(n)return;y(r.personas||[]);let s=await Promise.all((e||[]).map(async e=>{try{let a=(await v.api.get("/lead-pipelines/".concat(e.id,"/ai-calling-settings?workspace_id=").concat(encodeURIComponent(t)))).data||{};return{...e,ai_enabled:!!a.is_enabled,persona_id:a.persona_id||null,agent_name:a.agent_name,voice_type:a.voice_type,language:a.language,num_questions:Array.isArray(a.qualification_questions)?a.qualification_questions.length:0}}catch(t){return{...e,ai_enabled:!1,num_questions:0}}}));n||a(s)}finally{n||N(!1)}})(),()=>{n=!0}},[null==e?void 0:e.workspace_id]);let w=e=>{var t;return(null===(t=g.find(t=>t.id===e))||void 0===t?void 0:t.persona_name)||null};return(0,n.jsxs)("div",{className:"container mx-auto p-4 md:p-6 space-y-4 max-w-6xl",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold",children:"Pipelines"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"One row per pipeline \xb7 click to edit its Engagement Plan (call \xb7 voice \xb7 RAG \xb7 routing)"})]}),(0,n.jsxs)(s.default,{href:"/dashboard/agent-studio",className:"text-xs text-violet-600 hover:text-violet-700 inline-flex items-center gap-1",children:["Agent Studio ",(0,n.jsx)(d.Z,{className:"h-3 w-3"})]})]}),j?(0,n.jsxs)("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[(0,n.jsx)(o.Z,{className:"h-5 w-5 animate-spin mr-2"})," Loading pipelinesâ¦"]}):0===t.length?(0,n.jsx)(i.Zb,{className:"border-dashed",children:(0,n.jsxs)(i.aY,{className:"py-16 text-center text-sm text-muted-foreground",children:["No pipelines yet. ",(0,n.jsx)(s.default,{href:"/dashboard/leads",className:"text-violet-600 hover:underline",children:"Open Leads"})," to create one."]})}):(0,n.jsx)(i.Zb,{children:(0,n.jsxs)(i.aY,{className:"p-0",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[1.6fr_1.2fr_1fr_1fr_auto] gap-0 bg-slate-50 dark:bg-slate-900/40 px-4 py-2 text-[11px] uppercase font-semibold text-muted-foreground border-b",children:[(0,n.jsx)("div",{children:"Pipeline"}),(0,n.jsx)("div",{children:"Persona / Agent"}),(0,n.jsx)("div",{children:"Voice \xb7 Language"}),(0,n.jsx)("div",{children:"AI status"}),(0,n.jsx)("div",{})]}),(0,n.jsx)("div",{className:"divide-y divide-border",children:t.map(e=>{let t=w(e.persona_id);return(0,n.jsxs)(s.default,{href:"/dashboard/pipelines/".concat(e.id),className:"grid grid-cols-[1.6fr_1.2fr_1fr_1fr_auto] gap-0 items-center px-4 py-3 hover:bg-muted/30 transition",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"font-medium flex items-center gap-1.5",children:[e.name,e.is_default&&(0,n.jsx)(l.C,{variant:"secondary",className:"text-[10px]",children:"â
default"})]}),e.description&&(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground line-clamp-1 mt-0.5",children:e.description})]}),(0,n.jsxs)("div",{className:"text-xs",children:[t?(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(c.Z,{className:"h-3 w-3 text-violet-500"}),(0,n.jsx)("span",{className:"font-medium",children:t})]}):(0,n.jsx)("span",{className:"text-muted-foreground italic",children:"no persona attached"}),e.agent_name&&(0,n.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:['says "',e.agent_name,'"']})]}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:e.voice_type?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:e.voice_type}),(0,n.jsx)("div",{className:"text-[10px]",children:(e.language||"en").toUpperCase()})]}):(0,n.jsx)("span",{className:"italic",children:"â"})}),(0,n.jsx)("div",{className:"flex items-center gap-1.5 text-xs",children:e.ai_enabled?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{className:"h-3.5 w-3.5 text-emerald-600"}),(0,n.jsxs)("span",{className:"text-emerald-700 dark:text-emerald-400 font-medium",children:["Active \xb7 ",e.num_questions," qs"]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.Z,{className:"h-3.5 w-3.5 text-amber-500"}),(0,n.jsx)("span",{className:"text-amber-700 dark:text-amber-400",children:"No AI plan"})]})}),(0,n.jsx)(m.Z,{className:"h-4 w-4 text-muted-foreground"})]},e.id)})})]})})]})}},69174:function(e,t,a){a.d(t,{C:function(){return l}});var n=a(57437);a(2265);var r=a(90535),s=a(93448);let i=(0,r.j)("inline-flex items-center rounded-[4px] border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:a,...r}=e;return(0,n.jsx)("div",{className:(0,s.cn)(i({variant:a}),t),...r})}},79820:function(e,t,a){a.d(t,{Ol:function(){return l},SZ:function(){return o},Zb:function(){return i},aY:function(){return c},eW:function(){return u},ll:function(){return d}});var n=a(57437),r=a(2265),s=a(93448);let i=r.forwardRef((e,t)=>
1{let{className:a,...r}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("rounded-[4px] border bg-card text-card-foreground shadow",a),...r})});i.displayName="Card";let l=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",a),...r})});l.displayName="CardHeader";let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("font-display font-semibold leading-none tracking-tight",a),...r})});d.displayName="CardTitle";let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("text-sm text-muted-foreground",a),...r})});o.displayName="CardDescription";let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("p-6 pt-0",a),...r})});c.displayName="CardContent";let u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("flex items-center p-6 pt-0",a),...r})});u.displayName="CardFooter"},18949:function(e,t,a){a.d(t,{X:function(){return r}});var n=a(71837);let r={list:async e=>(await n.api.get("/agent-personas",{params:e})).data,get:async e=>(await n.api.get("/agent-personas/".concat(e))).data,create:async e=>(await n.api.post("/agent-personas",e)).data,update:async(e,t)=>(await n.api.patch("/agent-personas/".concat(e),t)).data,remove:async e=>(await n.api.delete("/agent-personas/".concat(e))).data,attachToPipeline:async(e,t)=>(await n.api.post("/agent-personas/attach/pipeline/".concat(e),{persona_id:t})).data,attachToVoice:async e=>(await n.api.post("/agent-personas/attach/voice",{persona_id:e})).data,knowledgeCollections:async()=>(await n.api.get("/agent-personas/knowledge-collections")).data,test:async(e,t,a)=>(await n.api.post("/agent-personas/".concat(e,"/test"),{message:t,history:a},{timeout:6e4})).data,testCall:async(e,t)=>(await n.api.post("/agent-personas/".concat(e,"/test-call"),{...t,mode:"call"},{timeout:6e4})).data,testVoice:async(e,t)=>(await n.api.post("/agent-personas/".concat(e,"/test-voice"),{...t,mode:"voice"},{timeout:6e4})).data,testClassify:async(e,t)=>(await n.api.post("/agent-personas/".concat(e,"/test-classify"),{...t,mode:"classify"},{timeout:6e4})).data}},30399:function(e,t,a){a.d(t,{Jt:function(){return r}});var n=a(71837);async function r(e,t){var a,r,s,i;return(await n.api.get("/lead-pipelines",{params:{workspace_id:e,include_stages:null!==(a=null==t?void 0:t.includeStages)&&void 0!==a&&a,include_counts:null!==(r=null==t?void 0:t.includeCounts)&&void 0!==r&&r,active_only:null===(s=null==t?void 0:t.activeOnly)||void 0===s||s,branch_id:null==t?void 0:t.branchId,include_workspace_wide:null===(i=null==t?void 0:t.includeWorkspaceWide)||void 0===i||i}})).data.pipelines}},93448:function(e,t,a){a.d(t,{cn:function(){return s}});var n=a(61994),r=a(53335);function s(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.m6)((0,n.W)(t))}},90535:function(e,t,a){a.d(t,{j:function(){return i}});var n=a(61994);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,s=n.W,i=(e,t)=>a=>{var n;if((null==t?void 0:t.variants)==null)return s(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:i,defaultVariants:l}=t,d=Object.keys(i).map(e=>{let t=null==a?void 0:a[e],n=null==l?void 0:l[e];if(null===t)return null;let s=r(t)||r(n);return i[e][s]}),o=a&&Object.entries(a).reduce((e,t)=>{let[a,n]=t;return void 0===n||(e[a]=n),e},{});return s(e,d,null==t?void 0:null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:a,className:n,...r}=t;return Object.entries(r).every(e=>{let[t,a]=e;return Array.isArray(a)?a.includes({...l,...o}[t]):({...l,...o})[t]===a})?[...e,a,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}}}]);
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.