PageSourceSearch

https://elletree-treehouse.lovable.app/assets/LinkedInPipelineWidget-DCf1a1_v.js

js elletree-treehouse.lovable.app collected 2026-10-03 03:31:03 UTC 12,203 bytes, 21 lines download raw bytes

vendor: 4,783 bytes, lines 1-21
1import{w as S,G as T,r as s,N as E,j as e,P as k,R as P,al as te,at as ae,au as se,ak as oe,av as re,z as D,e as ne,s as C,D as ie,g as ce,h as le,i as de,y as ue,B as _,aE as pe,aF as me,aG as fe,aH as he,aI as ve,aJ as xe,ag as ge,I as ye,T as je,aC as Ce,u as we,C as be,a as Re,b as Ne,d as _e}from"./index-BpMtm5f0.js";import{L as R}from"./label-BmBp-6Ak.js";import{c as A,R as Se,I as ke}from"./index-B6jguTMF.js";import{P as Ie,a as Pe,b as Ee}from"./popover-D-FuK_VS.js";import{T as De}from"./target-CUuD-EkP.js";import{M as Le}from"./message-circle-YjnTO5RG.js";import{L as Ge}from"./linkedin-CEPhj7Jc.js";import{P as Me}from"./plus-DV5SI1vh.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Te=S("CalendarCheck",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ae=S("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Oe=S("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Fe=S("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);var L="Radio",[$e,O]=T(L),[qe,Ue]=$e(L),F=s.forwardRef((o,c)=>{const{__scopeRadio:a,name:u,checked:r=!1,required:l,disabled:i,value:f="on",onCheck:h,form:n,...p}=o,[v,d]=s.useState(null),m=E(c,j=>d(j)),g=s.useRef(!1),y=v?n||!!v.closest("form"):!0;return e.jsxs(qe,{scope:a,checked:r,disabled:i,children:[e.jsx(k.button,{type:"button",role:"radio","aria-checked":r,"data-state":B(r),"data-disabled":i?"":void 0,disabled:i,value:f,...p,ref:m,onClick:P(o.onClick,j=>{r||h==null||h(),y&&(g.current=j.isPropagationStopped(),g.current||j.stopPropagation())})}),y&&e.jsx(U,{control:v,bubbles:!g.current,name:u,value:f,checked:r,required:l,disabled:i,form:n,style:{transform:"translateX(-100%)"}})]})});F.displayName=L;var $="RadioIndicator",q=s.forwardRef((o,c)=>{const{__scopeRadio:a,forceMount:u,...r}=o,l=Ue($,a);return e.jsx(te,{present:u||l.checked,children:e.jsx(k.span,{"data-state":B(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:c})})});q.displayName=$;var Be="RadioBubbleInput",U=s.forwardRef(({__scopeRadio:o,control:c,checked:a,bubbles:u=!0,...r},l)=>{const i=s.useRef(null),f=E(i,l),h=ae(a),n=se(c);return s.useEffect(()=>{const p=i.current;if(!p)return;const v=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(v,"checked").set;if(h!==a&&m){const g=new Event("click",{bubbles:u});m.call(p,a),p.dispatchEvent(g)}},[h,a,u]),e.jsx(k.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...r,tabIndex:-1,ref:f,style:{...r.style,...n,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});U.displayName=Be;function B(o){return o?"checked":"unchecked"}var We=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],I="RadioGroup",[He,rt]=T(I,[A,O]),W=A(),H=O(),[Ve,ze]=He(I),V=s.forwardRef((o,c)=>{const{__scopeRadioGroup:a,name:u,defaultValue:r,value:l,required:i=!1,disabled:f=!1,orientation:h,dir:n,loop:p=!0,onValueChange:v,...d}=o,m=W(a),g=oe(n),[y,j]=re({prop:l,defaultProp:r??null,onChange:v,caller:I});return e.jsx(Ve,{scope:a,name:u,required:i,disabled:f,value:y,onValueChange:j,children:e.jsx(Se,{asChild:!0,...m,orientation:h,dir:g,loop:p,children:e.jsx(k.div,{role:"radiogroup","aria-required":i,"aria-orientation":h,"data-disabled":f?"":void 0,dir:g,...d,ref:c})})})});V.displayName=I;var z="RadioGroupItem",K=s.forwardRef((o,c)=>{const{__scopeRadioGroup:a,disabled:u,...r}=o,l=ze(z,a),i=l.disabled||u,f=W(a),h=H(a),n=s.useRef(null),p=E(c,n),v=l.value===r.value,d=s.useRef(!1);return s.useEffect(()=>{const m=y=>{We.includes(y.key)&&(d.current=!0)},g=()=>d.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",g)}},[]),e.jsx(ke,{asChild:!0,...f,focusable:!i,active:v,children:e.jsx(F,{disabled:i,required:l.required,
21checked:v,...h,...r,name:l.name,ref:p,onCheck:()=>l.onValueChange(r.value),onKeyDown:P(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:P(r.onFocus,()=>{var m;d.current&&((m=n.current)==null||m.click())})})})});K.displayName=z;var Ke="RadioGroupIndicator",J=s.forwardRef((o,c)=>{const{__scopeRadioGroup:a,...u}=o,r=H(a);return e.jsx(q,{...r,...u,ref:c})});J.displayName=Ke;var X=V,Y=K,Je=J;const Q=s.forwardRef(({className:o,...c},a)=>e.jsx(X,{className:D("grid gap-2",o),...c,ref:a}));Q.displayName=X.displayName;const Z=s.forwardRef(({className:o,...c},a)=>e.jsx(Y,{ref:a,className:D("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o),...c,children:e.jsx(Je,{className:"flex items-center justify-center",children:e.jsx(Oe,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Z.displayName=Y.displayName;const M=[{value:"first_outreach",label:"First Outreach Sent",newStatus:"Warm",activityLabel:"LinkedIn: First Outreach Sent"},{value:"inbound_reply",label:"Inbound Reply / Chatting",newStatus:"Conversation",activityLabel:"LinkedIn: Inbound Reply / Chatting"},{value:"meeting_booked",label:"Meeting Booked",newStatus:"Meeting Set",activityLabel:"LinkedIn: Meeting Booked"}];function Xe({open:o,onOpenChange:c,onLogged:a}){const{toast:u}=ne(),[r,l]=s.useState([]),[i,f]=s.useState(""),[h,n]=s.useState(!1),[p,v]=s.useState("first_outreach"),[d,m]=s.useState(""),[g,y]=s.useState(()=>new Date().toISOString().slice(0,10)),[j,N]=s.useState(!1);s.useEffect(()=>{o&&(async()=>{const{data:{user:t}}=await C.auth.getUser();if(!t)return;const{data:w}=await C.from("contacts").select("id, first_name, last_name, email, pi
21peline_status").eq("user_id",t.id).eq("archived",!1).order("first_name",{ascending:!0}).limit(500);l(w||[])})()},[o]);const x=r.find(t=>t.id===i),b=M.find(t=>t.value===p),ee=async()=>{if(!i){u({title:"Pick a contact",variant:"destructive"});return}N(!0);const{data:{user:t}}=await C.auth.getUser();if(!t){N(!1);return}const w=(x==null?void 0:x.pipeline_status)||"",{error:G}=await C.from("contacts").update({pipeline_status:b.newStatus,last_contacted:g}).eq("id",i).eq("user_id",t.id);if(G){u({title:"Update failed",description:G.message,variant:"destructive"}),N(!1);return}await C.from("contact_activity_log").insert({contact_id:i,user_id:t.id,activity_type:"linkedin_touchpoint",content:`${b.activityLabel}${d?` — ${d}`:""}`,previous_value:w,new_value:b.newStatus}),u({title:"Touchpoint logged",description:`${(x==null?void 0:x.first_name)||"Contact"} → ${b.newStatus}`}),N(!1),f(""),m(""),v("first_outreach"),y(new Date().toISOString().slice(0,10)),c(!1),a==null||a()};return e.jsx(ie,{open:o,onOpenChange:c,children:e.jsxs(ce,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsx(de,{children:"Log LinkedIn Touchpoint"}),e.jsx(ue,{children:"Records the activity and auto-advances the pipeline stage."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(R,{children:"Contact"}),e.jsxs(Ie,{open:h,onOpenChange:n,children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(_,{variant:"outline",role:"combobox",className:"w-full justify-between mt-1",children:[x?`${x.first_name||""} ${x.last_name||""} ${x.email?`· ${x.email}`:""}`.trim():"Search contacts...",e.jsx(Ae,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ee,{className:"w-[400px] p-0",align:"start",children:e.jsxs(pe,{children:[e.jsx(me,{placeholder:"Search by name or email..."}),e.jsxs(fe,{children:[e.jsx(he,{children:"No contacts."}),e.jsx(ve,{children:r.map(t=>{const w=`${t.first_name||""} ${t.last_name||""}`.trim()||t.email||"(no name)";return e.jsxs(xe,{value:`${w} ${t.email||""}`,onSelect:()=>{f(t.id),n(!1)},children:[e.jsx(ge,{className:D("mr-2 h-4 w-4",i===t.id?"opacity-100":"opacity-0")}),e.jsx("span",{children:w}),t.email&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.email})]},t.id)})})]})]})})]}),(x==null?void 0:x.pipeline_status)&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Currently: ",e.jsx("span",{className:"font-medium",children:x.pipeline_status})," → will become ",e.jsx("span",{className:"font-medium",children:b.newStatus})]})]}),e.jsxs("div",{children:[e.jsx(R,{children:"Touchpoint type"}),e.jsx(Q,{value:p,onValueChange:t=>v(t),className:"mt-2 space-y-2",children:M.map(t=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Z,{value:t.value,id:t.value,className:"mt-1"}),e.jsxs(R,{htmlFor:t.value,className:"font-normal cursor-pointer",children:[t.label,e.jsxs("span",{className:"block text-xs text-muted-foreground",children:["→ ",t.newStatus]})]})]},t.value))})]}),e.jsxs("div",{children:[e.jsx(R,{htmlFor:"tp-date",children:"Date"}),e.jsx(ye,{id:"tp-date",type:"date",value:g,onChange:t=>y(t.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(R,{htmlFor:"tp-note",children:"Note (optional)"}),e.jsx(je,{id:"tp-note",value:d,onChange:t=>m(t.target.value),rows:3,className:"mt-1",placeholder:"What did you say? What did they respond?"})]})]}),e.jsxs(Ce,{children:[e.jsx(_,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(_,{onClick:ee,disabled:j||!i,className:"bg-deep-forest hover:bg-deep-forest/90 text-white",children:j?"Saving...":"Log touchpoint"})]})]})})}function nt(){const[o,c]=s.useState({strongIcp:0,warm:0,meetingsSet:0,activeConversations:0}),[a,u]=s.useState(!0),[r,l]=s.useState(!1),i=we();s.useEffect(()=>{f()},[]);const f=async()=>{const{data:{user:n}}=await C.auth.getUser();if(!n)return;const{data:p,error:v}=await C.from("contacts").select("icp_fit, pipeline_status").eq("user_id",n.id).eq("archived",!1);if(v||!p){u(!1);return}c({strongIcp:p.filter(d=>d.icp_fit==="Strong ICP").length,warm:p.filter(d=>d.pipeline_status==="Warm").length,meetingsSet:p.filter(d=>d.pipeline_status==="Meeting Set").length,activeConversations:p.filter(d=>d.pipeline_status==="Conversation").length}),u(!1)},h=[{label:"Strong ICP",value:o.strongIcp,icon:De,color:"hsl(146,40%,40%)"},{label:"Warm Contacts",value:o.warm,icon:Fe,color:"hsl(35,70%,50%)"},{label:"Active Conversations",value:o.activeConversations,icon:Le,color:"hsl(270,40%,50%)"},{label:"Meetings Set",value:o.meetingsSet,icon:Te,color:"hsl(210,50%,50%)"}];return a?null:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-deep-forest",children:[e.jsx(Ge,{className:"h-4 w-4"})," LinkedIn Pipeline"]}),e.jsxs(_,{size:"sm",variant:"outline",onClick:n=>{n.stopPropagation(),l(!0)},children:[e.jsx(Me,{className:"h-4 w-4 mr-1"})," Log touchpoint"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 cursor-pointer",onClick:()=>i("/people-orchard"),children:h.map(n=>e.jsxs(be,{className:"bg-cream hover:shadow-md transition-shadow hover-scale",children:[e.jsx(Re,{className:"pb-2",children:e.jsxs(Ne,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(n.icon,{className:"h-4 w-4",style:{color:n.color}}),n.label]})}),e.jsx(_e,{children:e.jsx("div",{className:"text-3xl font-bold text-sage-dark",children:n.value})})]},n.label))}),e.jsx(Xe,{open:r,onOpenChange:l,onLogged:f})]})}
21export{nt as LinkedInPipelineWidget};

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.