PageSourceSearch

https://socialselling.ai/_next/static/chunks/66769.34373e786e0f012f.js

js socialselling.ai collected 2026-10-05 14:51:57 UTC 35,577 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66769],{66769:function(e,a,t){t.r(a),t.d(a,{default:function(){return V}});var s=t(57437),r=t(2265),l=t(99376),n=t(79820),i=t(12381),d=t(40279),o=t(75060),c=t(69174),m=t(74291),u=t(23675),x=t(15291),p=t(32060),f=t(58896),h=t(99397),g=t(28124),v=t(95805),b=t(73247),j=t(32489),N=t(15863),y=t(17684),w=t(42208),k=t(15868),C=t(13781),_=t(18930),S=t(31047),z=t(71837),Z=t(14438),R=t(84881),A=t(41988);let P=[{value:"#059669",label:"Emerald"},{value:"#10b981",label:"Green"},{value:"#14b8a6",label:"Teal"},{value:"#0d9488",label:"Cyan"},{value:"#22c55e",label:"Lime"},{value:"#16a34a",label:"Forest"},{value:"#15803d",label:"Dark Green"},{value:"#047857",label:"Deep Emerald"},{value:"#065f46",label:"Pine"},{value:"#064e3b",label:"Evergreen"}];function V(){var e,a,t;let V=(0,l.useRouter)(),{user:F}=(0,R.a)(),Q=null==F?void 0:F.workspace_id,[D,I]=(0,r.useState)([]),[E,B]=(0,r.useState)(!0),[M,T]=(0,r.useState)(""),[U,L]=(0,r.useState)("all"),[Y,O]=(0,r.useState)("all"),[X,W]=(0,r.useState)(!1),[$,q]=(0,r.useState)(null),[H,K]=(0,r.useState)({name:"",description:"",color:"#059669"}),[G,J]=(0,r.useState)(!1),[ee,ea]=(0,r.useState)(null),[et,es]=(0,r.useState)(!1),[er,el]=(0,r.useState)(!1),[en,ei]=(0,r.useState)(null),[ed,eo]=(0,r.useState)("lead"),[ec,em]=(0,r.useState)(""),[eu,ex]=(0,r.useState)([]),[ep,ef]=(0,r.useState)([]),[eh,eg]=(0,r.useState)(!1),[ev,eb]=(0,r.useState)(!1),[ej,eN]=(0,r.useState)(""),[ey,ew]=(0,r.useState)("sales"),ek=(0,r.useCallback)(async()=>{if(Q)try{B(!0);let e=await z.api.get("/segments?workspace_id=".concat(Q));I(e.data||[])}catch(e){Z.A.error((0,z.getErrorMessage)(e,"Failed to load segments")),I([])}finally{B(!1)}},[Q]),eC=(0,r.useCallback)(async()=>{if(Q)try{var e,a;let t=await z.api.get("/lead-pipelines?workspace_id=".concat(Q));ex((null===(e=t.data)||void 0===e?void 0:e.pipelines)||t.data||[]);let s=await z.api.get("/crm/pipelines?workspace_id=".concat(Q));ef((null===(a=s.data)||void 0===a?void 0:a.pipelines)||s.data||[])}catch(e){console.error("Failed to fetch pipelines:",e)}},[Q]);(0,r.useEffect)(()=>{ek(),eC()},[ek,eC]);let e_=D.filter(e=>{let a=e.name.toLowerCase().includes(M.toLowerCase())||(e.description||"").toLowerCase().includes(M.toLowerCase()),t="all"===U||e.segment_type===U,s="all"===Y||"active"===Y&&e.is_active||"inactive"===Y&&!e.is_active;return a&&t&&s}),eS=()=>{q(null),K({name:"",description:"",color:"#059669"}),W(!0)},ez=(e,a)=>{a.stopPropagation(),q(e),K({name:e.name,description:e.description||"",color:e.color||"#059669"}),W(!0)},eZ=async()=>{if(!H.name.trim()){Z.A.error("Name is required");return}try{J(!0);let e={name:H.name,description:H.description||void 0,color:H.color,segment_type:"static"};$?(await z.api.put("/segments/".concat($.id),e),Z.A.success("Segment updated")):(await z.api.post("/segments?workspace_id=".concat(Q),e),Z.A.success("Segment created")),W(!1),q(null),K({name:"",description:"",color:"#059669"}),ek()}catch(e){Z.A.error((0,z.getErrorMessage)(e,"Failed to save segment"))}finally{J(!1)}},eR=async()=>{if(ee)try{es(!0),await z.api.delete("/segments/".concat(ee,"?permanent=true")),Z.A.success("Segment deleted"),ea(null),ek()}catch(e){Z.A.error((0,z.getErrorMessage)(e,"Failed to delete segment"))}finally{es(!1)}},eA=e=>{V.push("/dashboard/segments/".concat(e))},eP=(e,a)=>{a.stopPropagation(),ei(e),eo("lead"),em(""),eb(!1),eN(""),ew("sales"),el(!0)},eV=async()=>{if(!en){Z.A.error("No segment selected");return}if(ev){if(!ej.trim()){Z.A.error("Please enter a pipeline name");return}}else if(!ec){Z.A.error("Please select a pipeline");return}try{eg(!0);let t=ec;if(ev){var e,a;let s="lead"===ed?"/lead-pipelines?workspace_id=".concat(Q):"/crm/pipelines?workspace_id=".concat(Q),r=await z.api.post(s,{name:ej.trim(),template:ey,description:"Created for segment: ".concat((null===(e=D.find(e=>e.id===en))||void 0===e?void 0:e.name)||"Unknown")});t=(null===(a=r.data.pipeline)||void 0===a?void 0:a.id)||r.data.id,Z.A.success("Created ".concat("lead"===ed?"Lead":"CRM"," pipeline: ").concat(ej)),eC()}let s=await z.api.post("/segments/".concat(en,"/add-to-pipeline"),{pipeline_type:ed,pipeline_id:t});Z.A.success(s.data.message||"Added contacts to pipeline"),el(!1),ei(null),em(""),eb(!1),eN("")}catch(e){Z.A.error((0,z.getErrorMessage)(e,"Failed to add to pipeline"))}finally{eg(!1)}},eF=M||"all"!==U||"all"!==Y,eQ=D.reduce((e,a)=>e+(a.member_count||0),0),eD=D.filter(e=>e.is_active).length;return(0,s.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-green-50/30 to-emerald-50/20 dark:from-slate-950 dar
1k:via-green-950/10 dark:to-slate-950 relative",children:[(0,s.jsxs)("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[(0,s.jsx)("div",{className:"absolute -top-40 -right-40 w-80 h-80 bg-gradient-to-br from-green-400/20 to-emerald-500/20 rounded-full blur-3xl animate-pulse"}),(0,s.jsx)("div",{className:"absolute top-1/2 -left-20 w-60 h-60 bg-gradient-to-br from-teal-400/10 to-green-500/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"1s"}})]}),(0,s.jsxs)("div",{className:"relative p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 animate-[fadeInUp_0.6s_ease-out]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[(0,s.jsx)(f.Z,{className:"h-6 w-6 text-emerald-600"}),"Segments"]}),(0,s.jsx)("p",{className:"text-muted-foreground",children:"Create contact segments for targeted campaigns"})]}),(0,s.jsxs)(i.z,{onClick:eS,className:"bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700 shadow-lg shadow-green-500/25 hover:shadow-green-500/40 transition-all duration-300 rounded-xl border-0",children:[(0,s.jsx)(h.Z,{className:"h-4 w-4 mr-2"}),"Create Segment"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 animate-[fadeInUp_0.6s_ease-out]",children:[(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-2xl p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-32 h-32 bg-emerald-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-white/80 mb-1",children:"Total Segments"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-white",children:D.length}),(0,s.jsx)("p",{className:"text-xs text-white/60 mt-1",children:"Contact groups"})]}),(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300",children:(0,s.jsx)(g.Z,{className:"w-6 h-6 text-white"})})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-2xl p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-32 h-32 bg-emerald-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-700/80 mb-1",children:"Total Contacts"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-emerald-900",children:eQ.toLocaleString()}),(0,s.jsx)("p",{className:"text-xs text-emerald-700/60 mt-1",children:"Across all segments"})]}),(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-emerald-500/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300",children:(0,s.jsx)(v.Z,{className:"w-6 h-6 text-emerald-600"})})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-2xl p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #047857 0%, #065f46 50%, #064e3b 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-32 h-32 bg-emerald-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-white/80 mb-1",children:"Active Segments"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-white",children:eD}),(0,s.jsx)("p",{className:"text-xs text-white/60 mt-1",children:"Ready for campaigns"})]}),(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300",children:(0,s.jsx)(f.Z,{className:"w-6 h-6 text-white"})})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center animate-[fadeInUp_0.6s_ease-out]",children:[(0,s.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,s.jsx)(b.Z,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,s.jsx)(d.I,{placeholder:"Search segments...",value:M,onChange:e=>T(e.target.value),className:"pl-10 bg-white/70 dark:bg-slate-900/70 backdrop-blur-xl border-white/20 rounded-xl"})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsxs)(x.Ph,{value:U,onValueChange:L,children:[(0,s.jsx)(x.i4,{className:"w-[140px] bg-white/70 dark:bg-slate-900/70 backdrop-blur-xl border-white/20 rounded-xl",children:(0,s.jsx)(x.ki,{placeholder:"Type"})}),(0,s.jsxs)(x.Bw,{children:[(0,s.jsx)(x.Ql,{value:"all",children:"All Types"}),(0,s.jsx)(x.Ql,{value:"static",children:"Static"}),(0,s.jsx)(x.Ql,{value:"dynamic",children:"Dynamic"}),(0,s.jsx)(x.Ql,{value:"hybrid",children:"Hybrid"})]})]}),(0,s.jsxs)(x.Ph,{value:Y,onValueChange:O,children:[(0,s.jsx)(x.i4,{className:"w-[140px] bg-white/70 dark:bg-slate-900/70 backdrop-blur-xl border-white/20 rounded-xl",children:(0,s.jsx)(x.ki,{placeholder:"Status"})}),(0,s.jsxs)(x.Bw,{children:[(0,s.jsx)(x.Ql,{value:"all",children:"All Status"}),(0,s.jsx)(x.Ql,{value:"active",children:"Active"}),(0,s.jsx)(x.Ql,{value:"inactive",children:"Inactive"})]})]}),eF&&(0,s.jsxs)(i.z,{variant:"ghost",size:"sm",onClick:()=>{T(""),L("all"),O("all")},className:"text-muted-foreground hover:text-foreground",children:[(0,s.jsx)(j.Z,{className:"h-4 w-4 mr-1"}),"Clear"]})]})]}),E?(0,s.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,s.jsx)(N.Z,{className:"h-8 w-8 animate-spin text-emerald-500"})}):0===e_.length?(0,s.jsx)(n.Zb,{className:"backdrop-blur-xl bg-white/70 dark:bg-slate-900/70 border-white/20 shadow-xl rounded-2xl",children:(0,s.jsxs)(n.aY,{className:"text-center py-20",children:[(0,s.jsx)(f.Z,{className:"h-12 w-12 mx-auto text-muted-foreground
1/50 mb-4"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:eF?"No segments match your filters":"No segments yet"}),!eF&&(0,s.jsx)(i.z,{onClick:eS,variant:"link",className:"mt-2 text-emerald-600",children:"Create your first segment"})]})}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 animate-[fadeInUp_0.6s_ease-out]",children:e_.map((e,a)=>(0,s.jsxs)(n.Zb,{className:"backdrop-blur-xl bg-white/80 dark:bg-slate-900/80 border-white/20 shadow-lg hover:shadow-xl rounded-2xl cursor-pointer transition-all duration-300 hover:scale-[1.02] group overflow-hidden",onClick:()=>eA(e.id),style:{animationDelay:"".concat(50*a,"ms")},children:[(0,s.jsx)("div",{className:"h-1.5",style:{backgroundColor:e.color}}),(0,s.jsxs)(n.aY,{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center transition-transform group-hover:scale-110",style:{backgroundColor:"".concat(e.color,"20")},children:(0,s.jsx)(f.Z,{className:"w-5 h-5",style:{color:e.color}})}),(0,s.jsxs)(p.h_,{children:[(0,s.jsx)(p.$F,{asChild:!0,onClick:e=>e.stopPropagation(),children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(y.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(p.AW,{align:"end",children:[(0,s.jsxs)(p.Xi,{onClick:a=>{a.stopPropagation(),eA(e.id)},children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"View Members"]}),(0,s.jsxs)(p.Xi,{onClick:a=>ez(e,a),children:[(0,s.jsx)(k.Z,{className:"h-4 w-4 mr-2"}),"Edit"]}),(0,s.jsxs)(p.Xi,{onClick:a=>eP(e.id,a),children:[(0,s.jsx)(C.Z,{className:"h-4 w-4 mr-2"}),"Add to Pipeline"]}),(0,s.jsxs)(p.Xi,{onClick:a=>{a.stopPropagation(),ea(e.id)},className:"text-red-600",children:[(0,s.jsx)(_.Z,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]}),(0,s.jsx)("h3",{className:"font-semibold text-lg mb-1 truncate",children:e.name}),e.description&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground truncate mb-3",children:e.description}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-auto pt-3 border-t border-slate-100 dark:border-slate-800",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(v.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,s.jsx)("span",{className:"font-medium",children:e.member_count.toLocaleString()}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"contacts"})]}),(0,s.jsx)(c.C,{variant:"secondary",className:e.is_active?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400":"bg-slate-100 text-slate-600",children:e.is_active?"Active":"Inactive"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-muted-foreground",children:[(0,s.jsx)(S.Z,{className:"h-3 w-3"}),"Created ",(0,A.WU)(new Date(e.created_at),"MMM d, yyyy")]})]})]},e.id))})]}),(0,s.jsx)(m.Vq,{open:X,onOpenChange:W,children:(0,s.jsxs)(m.cZ,{className:"sm:max-w-[500px]",children:[(0,s.jsxs)(m.fK,{children:[(0,s.jsx)(m.$N,{children:$?"Edit Segment":"Create Segment"}),(0,s.jsx)(m.Be,{children:$?"Update your segment details":"Create a new segment to group contacts for targeted campaigns"})]}),(0,s.jsxs)("div",{className:"space-y-4 py-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{htmlFor:"name",children:"Name *"}),(0,s.jsx)(d.I,{id:"name",placeholder:"e.g., BMW Customers, High Value Leads",value:H.name,onChange:e=>K({...H,name:e.target.value})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{htmlFor:"description",children:"Description"}),(0,s.jsx)(u.g,{id:"description",placeholder:"Optional description for this segment",value:H.description,onChange:e=>K({...H,description:e.target.value}),rows:3})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{children:"Color"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:P.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>K({...H,color:e.value}),className:"w-8 h-8 rounded-lg transition-all ".concat(H.color===e.value?"ring-2 ring-offset-2 ring-emerald-500 scale-110":"hover:scale-105"),style:{backgroundColor:e.value},title:e.label},e.value))})]})]}),(0,s.jsxs)(m.cN,{children:[(0,s.jsx)(i.z,{variant:"outline",onClick:()=>W(!1),children:"Cancel"}),(0,s.jsxs)(i.z,{onClick:eZ,disabled:G,className:"bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700",children:[G&&(0,s.jsx)(N.Z,{className:"h-4 w-4 mr-2 animate-spin"}),$?"Save Changes":"Create Segment"]})]})]})}),(0,s.jsx)(m.Vq,{open:!!ee,onOpenChange:()=>ea(null),children:(0,s.jsxs)(m.cZ,{className:"sm:max-w-[400px]",children:[(0,s.jsxs)(m.fK,{children:[(0,s.jsx)(m.$N,{
1children:"Delete Segment"}),(0,s.jsx)(m.Be,{children:"Are you sure you want to delete this segment? This action cannot be undone. All members will be removed from this segment."})]}),(0,s.jsxs)(m.cN,{children:[(0,s.jsx)(i.z,{variant:"outline",onClick:()=>ea(null),children:"Cancel"}),(0,s.jsxs)(i.z,{variant:"destructive",onClick:eR,disabled:et,children:[et&&(0,s.jsx)(N.Z,{className:"h-4 w-4 mr-2 animate-spin"}),"Delete"]})]})]})}),(0,s.jsx)(m.Vq,{open:er,onOpenChange:el,children:(0,s.jsxs)(m.cZ,{className:"sm:max-w-[500px]",children:[(0,s.jsxs)(m.fK,{children:[(0,s.jsxs)(m.$N,{className:"flex items-center gap-2",children:[(0,s.jsx)(C.Z,{className:"h-5 w-5 text-emerald-600"}),"Add to Pipeline"]}),(0,s.jsx)(m.Be,{children:"Add all contacts from this segment to a pipeline. You can select an existing pipeline or create a new one."})]}),(0,s.jsxs)("div",{className:"space-y-4 py-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{children:"Pipeline Type"}),(0,s.jsxs)(x.Ph,{value:ed,onValueChange:e=>{eo(e),em(""),ew("sales")},children:[(0,s.jsx)(x.i4,{children:(0,s.jsx)(x.ki,{placeholder:"Select type"})}),(0,s.jsxs)(x.Bw,{children:[(0,s.jsx)(x.Ql,{value:"lead",children:"Lead Pipeline"}),(0,s.jsx)(x.Ql,{value:"crm",children:"CRM Pipeline"})]})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.z,{type:"button",variant:ev?"outline":"default",size:"sm",onClick:()=>eb(!1),className:ev?"":"bg-emerald-600 hover:bg-emerald-700",children:"Select Existing"}),(0,s.jsxs)(i.z,{type:"button",variant:ev?"default":"outline",size:"sm",onClick:()=>eb(!0),className:ev?"bg-emerald-600 hover:bg-emerald-700":"",children:[(0,s.jsx)(h.Z,{className:"h-4 w-4 mr-1"}),"Create New"]})]}),!ev&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{children:"Select Pipeline"}),(0,s.jsxs)(x.Ph,{value:ec,onValueChange:em,children:[(0,s.jsx)(x.i4,{children:(0,s.jsx)(x.ki,{placeholder:"Select ".concat("lead"===ed?"lead":"CRM"," pipeline")})}),(0,s.jsx)(x.Bw,{children:("lead"===ed?eu:ep).map(e=>(0,s.jsx)(x.Ql,{value:e.id,children:e.name},e.id))})]}),0===("lead"===ed?eu:ep).length&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No ","lead"===ed?"lead":"CRM",' pipelines found. Click "Create New" to create one.']})]}),ev&&(0,s.jsxs)("div",{className:"space-y-4 p-4 border rounded-lg bg-slate-50 dark:bg-slate-900/50",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{htmlFor:"pipelineName",children:"Pipeline Name *"}),(0,s.jsx)(d.I,{id:"pipelineName",placeholder:"e.g., ".concat((null===(e=D.find(e=>e.id===en))||void 0===e?void 0:e.name)||"Segment"," Pipeline"),value:ej,onChange:e=>eN(e.target.value)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o._,{children:"Template"}),(0,s.jsxs)(x.Ph,{value:ey,onValueChange:ew,children:[(0,s.jsx)(x.i4,{children:(0,s.jsx)(x.ki,{placeholder:"Select template"})}),(0,s.jsx)(x.Bw,{children:"lead"===ed?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.Ql,{value:"sales",children:"Sales (7 stages)"}),(0,s.jsx)(x.Ql,{value:"onboarding",children:"Onboarding (6 stages)"}),(0,s.jsx)(x.Ql,{value:"support",children:"Support (5 stages)"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.Ql,{value:"sales",children:"Sales (6 stages)"}),(0,s.jsx)(x.Ql,{value:"course",children:"Course (6 stages)"}),(0,s.jsx)(x.Ql,{value:"fees",children:"Fees (4 stages)"})]})})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Templates provide pre-configured stages for common workflows"})]})]}),en&&(0,s.jsx)("div",{className:"p-3 bg-emerald-50 dark:bg-emerald-950/30 rounded-lg",children:(0,s.jsxs)("p",{className:"text-sm text-emerald-700 dark:text-emerald-400",children:[(0,s.jsx)("strong",{children:(null===(a=D.find(e=>e.id===en))||void 0===a?void 0:a.member_count)||0}),' contacts from "',null===(t=D.find(e=>e.id===en))||void 0===t?void 0:t.name,'" will be added to the ',ev?"new":"selected"," pipeline"]})})]}),(0,s.jsxs)(m.cN,{children:[(0,s.jsx)(i.z,{variant:"outline",onClick:()=>el(!1),children:"Cancel"}),(0,s.jsxs)(i.z,{onClick:eV,disabled:eh||!ev&&!ec||ev&&!ej.trim(),className:"bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700",children:[eh&&(0,s.jsx)(N.Z,{className:"h-4 w-4 mr-2 animate-spin"}),ev?"Create & Add":"Add to Pipeline"]})]})]})})]})}},69174:function(e,a,t){t.d(a,{C:function(){return i}});var s=t(57437);t(2265);var r=t(90535),l=t(93448);let n=(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 i(e){let{className:a,variant:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)(n({variant:t}),a),...r})}},12381:function(e,a,t){t.d(a,{d:function(){return d},z:function(){return o}});var s=t(57437),r=t(2265),l=t(37053),n=t(90535),i=t(93448);let d=(0,n.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[4px] text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-[4px] px-3 text-xs",lg:"h-10 rounded-[4px] px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=r.forwardRef((e,a)=>{let{className:t,variant:r,size:n,asChild:o=!1,...c}=e,m=o?l.g7:"button";return(0,s.jsx)(m,{className:(0,i.cn)(d({variant:r,size:n,className:t})),ref:a,...c})});o.displayName="Button"},79820:function(e,a,t){t.d(a,{Ol:function(){return i},SZ:function(){return o},Zb:function(){return n},aY:function(){return c},eW:function(){return m},ll:function(){return d}});var s=t(57437),r=t(2265),l=t(93448);let n=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("rounded-[4px] border bg-card text-card-foreground shadow",t),...r})});
1n.displayName="Card";let i=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",t),...r})});i.displayName="CardHeader";let d=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("font-display font-semibold leading-none tracking-tight",t),...r})});d.displayName="CardTitle";let o=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("text-sm text-muted-foreground",t),...r})});o.displayName="CardDescription";let c=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("p-6 pt-0",t),...r})});c.displayName="CardContent";let m=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("flex items-center p-6 pt-0",t),...r})});m.displayName="CardFooter"},74291:function(e,a,t){t.d(a,{$N:function(){return f},Be:function(){return h},Vq:function(){return d},cN:function(){return p},cZ:function(){return u},fK:function(){return x},hg:function(){return o}});var s=t(57437),r=t(2265),l=t(49027),n=t(93448),i=t(20653);let d=l.fC,o=l.xz,c=l.h_;l.x8;let m=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.aV,{ref:a,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})});m.displayName=l.aV.displayName;let u=r.forwardRef((e,a)=>{let{className:t,children:r,overlayClassName:d,...o}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(m,{className:d}),(0,s.jsxs)(l.VY,{ref:a,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200","w-[calc(100%-1rem)] xs:w-[calc(100%-2rem)] sm:w-full max-w-lg","p-4 sm:p-6","max-h-[90vh] sm:max-h-[85vh]","rounded-lg sm:rounded-lg","flex flex-col","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",t),...o,children:[r,(0,s.jsxs)(l.x8,{className:"absolute right-3 top-3 sm:right-4 sm:top-4 z-50 rounded-full opacity-70 ring-offset-background transition-all hover:opacity-100 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground bg-white dark:bg-gray-900 shadow-md border border-gray-200 dark:border-gray-700 p-1.5",children:[(0,s.jsx)(i.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=l.VY.displayName;let x=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left flex-shrink-0",a),...t})};x.displayName="DialogHeader";let p=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 flex-shrink-0 mt-4",a),...t})};p.displayName="DialogFooter";let f=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.Dx,{ref:a,className:(0,n.cn)("font-display text-lg font-semibold leading-none tracking-tight",t),...r})});f.displayName=l.Dx.displayName;let h=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.dk,{ref:a,className:(0,n.cn)("text-sm text-muted-foreground",t),...r})});h.displayName=l.dk.displayName},32060:function(e,a,t){t.d(a,{$F:function(){return o},AW:function(){return c},Ju:function(){return x},VD:function(){return p},Xi:function(){return m},bO:function(){return u},h_:function(){return d}});var s=t(57437),r=t(2265),l=t(70085),n=t(93448),i=t(20653);let d=l.fC,o=l.xz;l.ZA,l.Uv,l.Tr,l.Ee,r.forwardRef((e,a)=>{let{className:t,inset:r,children:d,...o}=e;return(0,s.jsxs)(l.fF,{ref:a,className:(0,n.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",t),...o,children:[d,(0,s.jsx)(i.XCv,{className:"ml-auto"})]})}).displayName=l.fF.displayName,r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.tu,{ref:a,className:(0,n.cn)("z-50 min-w-[8rem] overflow-hidden rounded-[4px] border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",t),...r})}).displayName=l.tu.displayName;let c=r.forwardRef((e,a)=>{let{className:t,sideOffset:r=4,...i}=e;return(0,s.jsx)(l.Uv,{children:(0,s.jsx)(l.VY,{ref:a,sideOffset:r,className:(0,n.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[4px] border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",t),...i})})});c.displayName=l.VY.displayName;let m=r.forwardRef((e,a)=>{let{className:t,inset:r,...i}=e;return(0,s.jsx)(l.ck,{ref:a,className:(0,n.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",r&&"pl-8",t),...i})});m.displayName=l.ck.displayName;let u=r.forwardRef((e,a)=>{let{className:t,children:r,checked:d,...o}=e;return(0,s.jsxs)(l.oC,{ref:a,className:(0,n.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:d,...o,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.wU,{children:(0,s.jsx)(i.nQG,{className:"h-4 w-4"})})}),r]})});u.displayName=l.oC.displayName,r.forwardRef((e,a)=>{let{className:t,children:r,...d}=e;return(0,s.jsxs)(l.Rk,{ref:a,className:(0,n.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...d,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.wU,{children:(0,s.jsx)(i.jXb,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=l.Rk.displayName;let x=r.forwardRef((e,a)=>{let{className:t,inset:r,...i}=e;return(0,s.jsx)(l.__,{ref:a,className:(0,n.cn)("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",t),...i})});x.displayName=l.__.displayName;let p=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.Z0,{ref:a,className:(0,n.cn)("-mx-1 my-1 h-px bg-muted",t),...r})});p.displayName=l.Z0.displayName},40279:function(e,a,t){t.d(a,{I:function(){return n}});var s=t(57437),r=t(2265),l=t(93448);let n=r.forwardRef((e,a)=>{let{className:t,type:r,error:n,...i}=e;return(0,s.jsx)("input",{type:r,"aria-invalid":n?"true":void 0,className:(0,l.cn)("flex h-9 w-full rounded-[4px] border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n&&"border-red-500 focus-visible:ring-red-500",t),ref:a,...i})});n.displayName="Input"},75060:function(e,a,t){t.d(a,{_:function(){return o}});var s=t(57437),r=t(2265),l=t(6394),n=t(90535),i=t(93448);let d=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.f,{ref:a,className:(0,i.cn)(d(),t),...r})});o.displayName=l.f.displayName},15291:function(e,a,t){t.d(a,{Bw:function(){return x},DI:function(){return c},Ph:function(){return o},Ql:function(){return f},i4:function(){return u},ki:function(){return m},n5:function(){return p}});var s=t(57437),r=t(2265),l=t(56873),n=t(40875),i=t(30401),d=t(93448);let o=l.fC,c=l.ZA,m=l.B4,u=r.forwardRef((e,a)=>{let{className:t,children:r,...i}=e;return(0,s.jsxs)(l.xz,{ref:a,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 dark:text-gray-100 px-3 py-2 text-sm r
1ing-offset-white dark:ring-offset-gray-950 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-950 dark:focus:ring-gray-300 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...i,children:[r,(0,s.jsx)(l.JO,{asChild:!0,children:(0,s.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=l.xz.displayName;let x=r.forwardRef((e,a)=>{let{className:t,children:r,position:n="popper",...i}=e;return(0,s.jsx)(l.h_,{children:(0,s.jsx)(l.VY,{ref:a,className:(0,d.cn)("relative z-50 min-w-[8rem] overflow-hidden rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-950 dark:text-gray-100 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...i,children:(0,s.jsx)(l.l_,{className:(0,d.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});x.displayName=l.VY.displayName;let p=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.__,{ref:a,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...r})});p.displayName=l.__.displayName;let f=r.forwardRef((e,a)=>{let{className:t,children:r,...n}=e;return(0,s.jsxs)(l.ck,{ref:a,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 dark:focus:bg-gray-700 focus:text-gray-900 dark:focus:text-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.wU,{children:(0,s.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(l.eT,{children:r})]})});f.displayName=l.ck.displayName,r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.Z0,{ref:a,className:(0,d.cn)("-mx-1 my-1 h-px bg-gray-100 dark:bg-gray-700",t),...r})}).displayName=l.Z0.displayName},23675:function(e,a,t){t.d(a,{g:function(){return n}});var s=t(57437),r=t(2265),l=t(93448);let n=r.forwardRef((e,a)=>{let{className:t,error:r,...n}=e;return(0,s.jsx)("textarea",{"aria-invalid":r?"true":void 0,className:(0,l.cn)("flex min-h-[80px] w-full rounded-[4px] border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r&&"border-red-500 focus-visible:ring-red-500",t),ref:a,...n})});n.displayName="Textarea"},93448:function(e,a,t){t.d(a,{cn:function(){return l}});var s=t(61994),r=t(53335);function l(){for(var e=arguments.length,a=Array(e),t=0;t<e;t++)a[t]=arguments[t];return(0,r.m6)((0,s.W)(a))}}}]);

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.