PageSourceSearch

https://slantapp.ai/assets/ProfessionalProfile-BPPIrsmp.js

js slantapp.ai collected 2026-10-05 15:06:00 UTC 16,784 bytes, 6 lines download raw bytes

1import{aq as Q,R,u as U,c as k,r as g,W as v,F as D,j as e,aD as B,B as m,aP as K,z as G,C as j,a as w,O as N,i as H,E as V,M as W,K as T,N as L,aC as J,Q as y,I as Y,$ as _,a0 as M,a1 as A,a2 as I,aQ as X,q as E,a4 as Z,a5 as ee,L as se}from"./index-tc5-nNLC.js";import{L as O}from"./label-MwGx_WS4.js";import{T as te}from"./textarea-DN2rY_yY.js";import{A as ae}from"./arrow-left-kYemJdx8.js";import{C as ie}from"./circle-check-big-CUgqPmz6.js";import{E as re}from"./external-link-wMXh6D17.js";import{G as le}from"./globe-CrY5Q3gB.js";import{M as ne}from"./mouse-pointer-click-CUquD_H1.js";import{E as C}from"./eye-7YOw3q0i.js";import{L as ce}from"./link-BigN4W0t.js";import{C as oe}from"./circle-plus-BJGAS2Vo.js";import{C as de}from"./copy-Bquar6tk.js";/**
2 * @license lucide-react v0.453.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 xe=Q("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),$={agent:"bg-blue-500/20 text-blue-300 border-blue-500/30",physician:"bg-green-500/20 text-green-300 border-green-500/30",financial:"bg-amber-500/20 text-amber-300 border-amber-500/30",entrepreneur:"bg-purple-500/20 text-purple-300 border-purple-500/30",other:"bg-gray-500/20 text-gray-300 border-gray-500/30"},q={qr_scan:xe,profile_view:C,schedule_link_click:ne,repeat_visit:Y},P={qr_scan:"QR scan",profile_view:"Profile view",schedule_link_click:"Scheduling link click",repeat_visit:"Repeat visit"};function he(i){const n=Date.now()-new Date(i).getTime(),r=Math.floor(n/6e4);if(r<1)return"Just now";if(r<60)return`${r}m ago`;const l=Math.floor(r/60);if(l<24)return`${l}h ago`;const c=Math.floor(l/24);return c<30?`${c}d ago`:new Date(i).toLocaleDateString()}function me({open:i,onOpenChange:n,profileUrl:r,displayName:l}){const{toast:c}=k();return e.jsx(_,{open:i,onOpenChange:n,children:e.jsxs(M,{className:"bg-slate-900 border-slate-700 text-white max-w-sm",children:[e.jsx(A,{children:e.jsx(I,{className:"text-white",children:"Share Profile"})}),e.jsxs("div",{className:"flex flex-col items-center gap-4 py-2",children:[e.jsx("div",{className:"bg-white p-3 rounded-xl",children:e.jsx(X,{value:r,size:180})}),e.jsxs("p",{className:"text-slate-400 text-sm text-center",children:["Scan to view ",e.jsx("span",{className:"text-white font-medium",children:l}),"'s profile"]}),e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{readOnly:!0,value:r,className:"flex-1 text-xs bg-slate-800 border border-slate-700 rounded px-2 py-1.5 text-slate-300 truncate"}),e.jsx(m,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(r),c({title:"Copied!",description:"Profile URL copied to clipboard."})},className:"border-slate-600 text-slate-300 hover:bg-slate-700 shrink-0","data-testid":"button-copy-url",children:e.jsx(de,{className:"h-3.5 w-3.5"})})]})]})]})})}function pe({open:i,onOpenChange:n,profileId:r,connectionId:l,onSuccess:c}){const{toast:o}=k(),[x,p]=g.useState(""),[s,u]=g.useState(""),f=D({mutationFn:async()=>{var b;const d=(b=(await(await y("POST","/api/slant-brain/chains",{title:x.trim(),description:s.trim()||void 0,chainType:"linear"})).json()).chain)==null?void 0:b.id;if(!d)throw new Error("Chain creation failed");return await y("POST",`/api/professionals/${r}/link-chain`,{connectionId:l,chainId:d}),d},onSuccess:()=>{E.invalidateQueries({queryKey:[`/api/professionals/${r}/trail`]}),E.invalidateQueries({queryKey:[`/api/professionals/${r}`]}),o({title:"Chain created",description:"Follow-up chain linked to this connection."}),n(!1),p(""),u(""),c()},onError:t=>{o({title:"Error",description:t.message||"Failed to create chain.",variant:"destructive"})}});return e.jsx(_,{open:i,onOpenChange:n,children:e.jsxs(M,{className:"bg-slate-900 border-slate-700 text-white max-w-md",children:[e.jsx(A,{children:e.jsx(I,{className:"text-white",children:"Create Follow-up Chain"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-slate-400 text-sm",children:"Create a chain to organize follow-up activity with this connection."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(O,{className:"text-slate-300",children:["Chain Title ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(Z,{placeholder:"e.g. Q4 Meetings with Alex",value:x,onChange:t=>p(t.target.value),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500","data-testid":"input-chain-title"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(O,{className:"text-slate-300",children:["Description"," ",e.jsx("span",{className:"text-slate-500 font-normal text-xs",children:"(optional)"})]}),e.jsx(te,{placeholder:"What is this chain for?",value:s,onChange:t=>u(t.target.value),rows:2,className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500 resize-none","data-testid":"textarea-chain-description"})]})]}),e.jsxs(ee,{className:"gap-2",children:[e.jsx(m,{variant:"outline",onClick:()=>n(!1),className:"border-slate-600 text-slate-300 hover:bg-slate-800",children:"Cancel"}),e.jsx(m,{onClick:()=>f.mutate(),disabled:!x.trim()||f.isPending,className:"bg-purple-600 hover:bg-purple-700 text-white","data-testid":"button-create-chain",children:f.isPending?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}),"Creating…"]}):"Create Chain"})]})]})})}function ue({profileId:i}){const[n,r]=g.useState(!1),[l,c]=g.useState(null),{data:o,isLoading:x,refetch:p}=v({queryKey:[`/api/professionals/${i}/trail`],queryFn:()=>fetch(`/api/professionals/${i}/trail?limit=100`,{credentials:"include"}).then(t=>t.status===403?{trail:[],summary:{}}:t.json())});if(x)return e.jsx("div",{className:"space-y-2",children:[1,2,3].map(t=>e.jsx("div",{className:"h-12 bg-white/5 rounded-xl animate-pulse"},t))});const s=(o==null?void 0:o.trail)||[],u=(o==null?void 0:o.summary)||{},f=Object.values(u).reduce((t,h)=>t+h,0);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Object.entries(u).map(([t,h])=>{const d=q[t]||C;return e.jsxs("div",{className:"flex items-center gap-1.5 bg-white/10 px-2 py-1 rounded-lg text-xs text-white/70","data-testid":`summary-${t}`,children:[e.jsx(d,{className:"h-3 w-3 text-purple-400"}),e.jsxs("span",{children:[h," ",P[t]||t]})]},t)}),f===0&&e.jsx("p",{className:"text-white/40 text-xs",children:"No connection events yet. Share your profile to start building your trail."})]}),e.jsx("div",{className:"space-y-2",children:s.map(t=>{const h=q[t.eventType]||C,d=t.sourceUserId?"Authenticated user":t.anonymousFingerprint?"Anonymous visitor":"Unknown visitor";return e.jsx("div",{className:"bg-white/5 border border-white/10 rounded-xl p-3","data-testid":`trail-event-${t.id}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-purple-500/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(h,{className:"h-3.5 w-3.5 text-purple-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-white text-sm font-medium",children:d}),e.jsx("span",{className:"text-white/40 text-xs",children:P[t.eventType]||t.eventType}),e.jsx("span",{className:"text-white/30 text-xs ml-auto",children:he(t.createdAt)})]}),t.linkedChain&&e.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[e.jsx(ce,{className:"h-3 w-3 text-purple-400"}),e.jsx("span",{className:"text-purple-300 text-xs",children:t.linkedChain.title})]}),!t.linkedChainId&&e.jsxs(m,{size:"sm",variant:"ghost",className:"h-6 text-xs text-purple-400 hover:text-purple-300 hover:bg-purple-500/10 px-1.5 mt-1",onClick:()=>{c(t.id),r(!0)},"data-testid":`button-link-chain-${t.id}`,children:[e.jsx(oe,{className:"h-3 w-3 mr-1"}),"Create follow-up chain"]})]})]})},t.id)})}),l&&e.jsx(pe,{open:n,onOpenChange:r,profileId:i,connectionId:l,onSuccess:()=>{c(null),p()}})]})}function Le(){var S;const{id:i}=R(),[,n]=U(),{toast:r}=k(),[l,c]=g.useState(!1),[o,x]=g.useState(!1),p=`${window.location.origin}/professionals/${i}`,{data:s,isLoading:u,isError:f}=v({queryKey:[`/api/professionals/${i}`],queryFn:async()=>{const a=await fetch(`/api/professionals/${i}`,{credentials:"include"});if(!a.ok)throw new Error("Profile not found");return a.json()},enabled:!!i,retry:!1}),{data:t}=v({queryKey:["/api/auth/user"],queryFn:()=>fetch("/api/auth/user",{credentials:"include"}).then(a=>a.ok?a.json():null),retry:!1}),h=!!t&&!!s&&(t.id===s.userId||((S=t.claims)==null?void 0:S.sub)===s.userId),d=D({mutationFn:a=>y("POST",`/api/professionals/${i}/attribute`,{eventType:a}),onError:()=>{}}),b=()=>{s!=null&&s.externalSchedulingUrl&&(d.mutate("schedule_link_click"),window.open(s.externalSchedulingUrl,"_blank","noopener,noreferrer"))};if(u)return e.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-purple-500 border-t-transparent roun
6ded-full"})});if(f||!s)return e.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center text-white",children:e.jsxs("div",{className:"text-center px-6",children:[e.jsx(B,{className:"h-16 w-16 mx-auto mb-4 text-white/20"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Profile not found"}),e.jsx("p",{className:"text-white/50 mb-6",children:"This profile doesn't exist or has been made private."}),e.jsx(m,{onClick:()=>n("/professionals"),className:"bg-white/10 hover:bg-white/20 text-white",children:"Browse Directory"})]})});const F=$[s.category]||$.other,z=s.category.charAt(0).toUpperCase()+s.category.slice(1);return e.jsxs("div",{className:"min-h-screen bg-black text-white",children:[e.jsxs("div",{className:"sticky top-0 z-20 bg-black/80 backdrop-blur-sm border-b border-white/10 px-4 py-3 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>n("/professionals"),className:"text-white/60 hover:text-white transition-colors","data-testid":"button-back",children:e.jsx(ae,{className:"h-5 w-5"})}),e.jsx("span",{className:"text-white font-semibold truncate flex-1",children:s.displayName}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>x(!0),className:"text-white/60 hover:text-white hover:bg-white/10 h-8 w-8 p-0","data-testid":"button-qr",children:e.jsx(K,{className:"h-4 w-4"})}),e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>{navigator.clipboard.writeText(p),r({title:"Copied!",description:"Profile link copied."})},className:"text-white/60 hover:text-white hover:bg-white/10 h-8 w-8 p-0","data-testid":"button-share",children:e.jsx(G,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-6 space-y-5",children:[e.jsx(j,{className:"bg-gradient-to-br from-purple-500/10 to-pink-500/10 border-white/10",children:e.jsxs(w,{className:"p-6",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[s.profileImageUrl?e.jsx("img",{src:s.profileImageUrl,alt:s.displayName,className:"w-20 h-20 rounded-full object-cover flex-shrink-0","data-testid":"img-profile"}):e.jsx("div",{className:"w-20 h-20 rounded-full bg-gradient-to-br from-purple-500 to-pink-500 flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-white font-bold text-3xl",children:s.displayName.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx("h1",{className:"text-2xl font-bold","data-testid":"text-display-name",children:s.displayName}),s.verificationStatus==="verified"&&e.jsx(ie,{className:"h-5 w-5 text-blue-400","data-testid":"icon-verified"})]}),e.jsx(N,{className:H("text-xs border mb-2",F),"data-testid":"badge-category",children:z}),s.bio&&e.jsx("p",{className:"text-white/70 text-sm leading-relaxed","data-testid":"text-bio",children:s.bio})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t border-white/10",children:[e.jsxs("div",{className:"text-center","data-testid":"stat-connections",children:[e.jsx("div",{className:"text-lg font-bold",children:s.connectionCount}),e.jsx("div",{className:"text-white/50 text-xs",children:"Connections"})]}),e.jsxs("div",{className:"text-center","data-testid":"stat-chains",children:[e.jsx("div",{className:"text-lg font-bold",children:s.linkedChainCount}),e.jsx("div",{className:"text-white/50 text-xs",children:"Linked Chains"})]})]}),s.externalSchedulingUrl&&e.jsxs(m,{onClick:b,className:"w-full mt-4 bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white font-semibold py-3","data-testid":"button-schedule",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Schedule a Meeting",e.jsx(re,{className:"h-4 w-4 ml-2"})]})]})}),(s.territories&&s.territories.length>0||s.languages&&s.languages.length>0)&&e.jsx(j,{className:"bg-white/5 border-white/10",children:e.jsxs(w,{className:"p-4 space-y-3",children:[s.territories&&s.territories.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-white/60 text-xs mb-2",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Territories served"]}),e.jsx("div",{className:"flex flex-wrap gap-2","data-testid":"territories",children:s.territories.map(a=>e.jsx(N,{className:"bg-white/10 text-white/80 border-white/20 text-xs","data-testid":`badge-territory-${a.replace(/\s/g,"-").toLowerCase()}`,children:a},a))})]}),s.languages&&s.languages.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-white/60 text-xs mb-2",children:[e.jsx(le,{className:"h-3.5 w-3.5"}),"Languages"]}),e.jsx("div",{className:"flex flex-wrap gap-2","data-testid":"languages",children:s.languages.map(a=>e.jsx(N,{className:"bg-white/10 text-white/80 border-white/20 text-xs",children:a},a))})]})]})}),s.expertiseTags&&s.expertiseTags.length>0&&e.jsxs(j,{className:"bg-white/5 border-white/10",children:[e.jsx(T,{className:"p-4 pb-2",children:e.jsx(L,{className:"text-sm text-white/60",children:"Expertise"})}),e.jsx(w,{className:"px-4 pb-4",children:e.jsx("div",{className:"flex flex-wrap gap-2","data-testid":"expertise-tags",children:s.expertiseTags.map(a=>e.jsx("span",{className:"text-sm bg-white/10 text-white/80 px-3 py-1 rounded-full","data-testid":`tag-expertise-${a.replace(/\s/g,"-").toLowerCase()}`,children:a},a))})})]}
6),s.credentials&&Object.keys(s.credentials).length>0&&e.jsxs(j,{className:"bg-white/5 border-white/10",children:[e.jsx(T,{className:"p-4 pb-2",children:e.jsx(L,{className:"text-sm text-white/60",children:"Credentials"})}),e.jsxs(w,{className:"px-4 pb-4 space-y-2","data-testid":"credentials",children:[s.credentials.yearsOfExperience&&e.jsxs("p",{className:"text-white/80 text-sm",children:[s.credentials.yearsOfExperience," years of experience"]}),s.credentials.licenses&&s.credentials.licenses.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs mb-1",children:"Licenses"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.credentials.licenses.map(a=>e.jsx("span",{className:"text-xs text-white/70 bg-white/10 px-2 py-0.5 rounded",children:a},a))})]}),s.credentials.affiliations&&s.credentials.affiliations.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs mb-1",children:"Affiliations"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.credentials.affiliations.map(a=>e.jsx("span",{className:"text-xs text-white/70 bg-white/10 px-2 py-0.5 rounded",children:a},a))})]}),s.credentials.certifications&&s.credentials.certifications.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs mb-1",children:"Certifications"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.credentials.certifications.map(a=>e.jsx("span",{className:"text-xs text-white/70 bg-white/10 px-2 py-0.5 rounded",children:a},a))})]})]})]}),h&&e.jsx(j,{className:"bg-white/5 border-white/10",children:e.jsxs(w,{className:"p-4",children:[e.jsxs("button",{onClick:()=>c(a=>!a),className:"w-full flex items-center justify-between text-white/60 text-sm","data-testid":"button-toggle-trail",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Connection Attribution Trail"]}),e.jsx("span",{className:"text-xs text-white/40",children:l?"Hide":"Show"})]}),l&&e.jsx("div",{className:"mt-4","data-testid":"section-trail",children:e.jsx(ue,{profileId:i})})]})})]}),e.jsx(me,{open:o,onOpenChange:x,profileUrl:p,displayName:s.displayName})]})}export{Le 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.