PageSourceSearch

https://app.xlift.ai/assets/IntentPage-BEY5ZesF.js

js xlift.ai collected 2026-10-05 13:20:24 UTC 27,305 bytes, 11 lines download raw bytes

1import{v as oe,ai as W,as as de,au as ke,o as w,A as L,al as S,a4 as I,U as k,j as e,C as v,G as j,aO as be,$ as ve,X as f,ao as ze,T as y,D as A,E as D,L as ie,av as Ce,am as B,S as Se,H as Ie,I as qe,ac as Me,ab as Ne,W as H,F as _,K as ae,aP as $e,ar as E,aN as Te,B as Ee,a5 as R,Z as N,a0 as ce}from"./index-dE8a1mPK.js";import{A as ue}from"./AiWriteButton-BOd6FUXb.js";import{P as Re}from"./ProspectClaimBadge-2xQ265-n.js";import{W as De}from"./WatchAuthorButton-VV-g86IZ.js";import{I as me}from"./IconPlus-B47PY1MC.js";import{I as U}from"./IconRoute-BmxJMQgj.js";import{I as O}from"./IconSend-D-OEBegQ.js";import{I as he}from"./IconX-B50qDTAe.js";import{C as Fe}from"./Checkbox-CVTqs_Fd.js";import{I as Ae}from"./IconClock-DGXUTa2e.js";import{I as re}from"./IconHeart-CFNXoJCy.js";import{I as Be}from"./IconRepeat-BAxCrsfr.js";import{I as Pe}from"./IconBookmark-OdqwEN7V.js";import{I as le}from"./IconMessageReply-B0QqDoCF.js";import{I as Le}from"./IconQuote-DAmadQor.js";import{I as xe}from"./IconMinus-BVycA7-_.js";import{I as Qe}from"./IconExternalLink-DcQXcLz7.js";import{S as Q}from"./Select-DebRlW67.js";import{N as Ke}from"./NumberInput-EbCp_odp.js";import{T as pe}from"./Textarea-BtbUvWWM.js";import{T as $}from"./Table-5ftamFSf.js";import"./InputsGroupFieldset-C0syow2C.js";import"./CheckIcon-DkMc45y2.js";import"./OptionsDropdown-wonErrz5.js";import"./get-env-uyVen0u2.js";/**
2 * @license @tabler/icons-react v3.43.0 - MIT
3 *
4 * This source code is licensed under the MIT license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const He=[["path",{d:"M7 12l5 5l10 -10",key:"svg-0"}],["path",{d:"M2 12l5 5m5 -5l5 -5",key:"svg-1"}]],_e=oe("outline","checks","Checks",He);/**
7 * @license @tabler/icons-react v3.43.0 - MIT
8 *
9 * This source code is licensed under the MIT license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const We=[["path",{d:"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],Xe=oe("outline","dots","Dots",We);function Ns(){var ee,se,te,ne;W(),de();const{hasFeature:l}=ke(),m=l("bulkDmFromIntent"),[r,x]=w.useState(new Set(["looking-for","does-anyone-know","recommend-a","what-do-you-use"])),[a,p]=w.useState(""),[t,o]=w.useState(""),[i,h]=w.useState([]),[s,n]=w.useState(null),[g,z]=w.useState(new Set),[C,T]=w.useState(new Set),c=(...d)=>T(u=>new Set([...u,...d]));function b(d){const u=new Set(g);u.has(d)?u.delete(d):u.add(d),z(u)}function q(d){z(new Set(d))}function M(){z(new Set)}const X=L({queryKey:["intent-presets"],queryFn:()=>k.listIntentPresets()}),G=L({queryKey:["accounts"],queryFn:()=>k.listAccounts()}),J=L({queryKey:["lists"],queryFn:()=>k.listLists()}),Y=L({queryKey:["campaigns"],queryFn:()=>k.listCampaigns()}),P=w.useMemo(()=>{var d;return(((d=G.data)==null?void 0:d.accounts)||[]).filter(u=>u.executionMode==="cookie"&&u.status==="active")},[G.data]),Z=w.useMemo(()=>{var d;return(((d=Y.data)==null?void 0:d.campaigns)||[]).filter(u=>u.type==="sequence"&&u.status==="running")},[Y.data]),F=S({mutationFn:()=>k.fetchIntentFeed({presets:[...r].join(","),topic:a.trim(),customs:i.length?btoa(JSON.stringify(i)):"",perQuery:15}),onError:d=>I(d)});function ge(d){const u=new Set(r);u.has(d)?u.delete(d):u.add(d),x(u)}function je(){const d=t.trim();!d||i.includes(d)||(h([...i,d]),o(""))}function fe(d){h(i.filter(u=>u!==d))}const ye=r.size===0&&i.length===0,we=(ee=P[0])==null?void 0:ee.id;return e.jsxs(v,{gap:"md",children:[e.jsxs(j,{justify:"space-between",wrap:"wrap",gap:"xs",children:[e.jsxs(j,{gap:"xs",children:[e.jsx(be,{size:20}),e.jsx(ve,{order:2,children:"Intent feed"})]}),e.jsx(f,{leftSection:e.jsx(ze,{size:14}),onClick:()=>F.mutate(),loading:F.isPending,disabled:ye,children:"Find live intent"})]}),e.jsx(y,{c:"dimmed",size:"sm",children:"Real-time tweets where someone is literally asking for what you sell. Each row is a one-stop cockpit — like, reply, DM, quote, add to a list, or enroll the author in a running sequence in one click. Dismissed tweets never show again."}),e.jsx(A,{withBorder:!0,children:e.jsxs(v,{gap:"sm",children:[e.jsxs("div",{children:[e.jsx(y,{size:"xs",fw:500,c:"dimmed",mb:4,children:"Listening for"}),e.jsx(j,{gap:6,wrap:"wrap",children:(((se=X.data)==null?void 0:se.presets)||[]).map(d=>e.jsx(D,{variant:r.has(d.id)?"filled":"light",color:r.has(d.id)?"dark":"gray",style:{cursor:"pointer",textTransform:"none"},onClick:()=>ge(d.id),children:d.label},d.id))})]}),e.jsxs(j,{grow:!0,align:"flex-end",children:[e.jsx(ie,{label:"Scope to a topic (optional)",description:"Appended to every preset. e.g. 'shopify', 'crm', 'newsletter tool'.",placeholder:"shopify",value:a,onChange:d=>p(d.currentTarget.value)}),e.jsxs(j,{align:"flex-end",gap:"xs",children:[e.jsx(ie,{label:"Custom query",description:"Your own X search string",placeholder:'"is there a tool that"',value:t,onChange:d=>o(d.currentTarget.value),style:{flex:1}}),e.jsx(f,{variant:"default",onClick:je,disabled:!t.trim(),children:"Add"})]})]}),i.length>0&&e.jsxs(j,{gap:6,wrap:"wrap",children:[e.jsx(y,{size:"xs",c:"dimmed",children:"Custom:"}),i.map(d=>e.jsx(D,{variant:"light",color:"grape",rightSection:e.jsx(y,{size:"xs",style:{cursor:"pointer"},onClick:()=>fe(d),children:"×"}),style:{textTransform:"none"},children:d},d))]})]})}),F.data&&(()=>{const d=(F.data.tweets||[]).filter(u=>!C.has(u.id));return e.jsx(A,{withBorder:!0,children:e.jsxs(v,{gap:"xs",children:[e.jsxs(j,{justify:"space-between",children:[e.jsxs(j,{gap:"xs",children:[e.jsxs(y,{fw:600,children:[d.length," tweets"]}),F.data.hiddenByDismissals>0&&e.jsxs(D,{size:"xs",variant:"light",color:"gray",children:[F.data.hiddenByDismissals," hidden"]}),a&&e.jsxs(D,{size:"xs",variant:"light",children:["topic: ",a]})]}),e.jsxs(j,{gap:"xs",children:[g.size===0&&d.length>0&&e.jsx(f,{size:"xs",variant:"default",leftSection:e.jsx(_e,{size:12}),onClick:()=>q(d.map(u=>u.id)),children:"Select all visible"}),e.jsx(y,{size:"xs",c:"dimmed",children:"Ranked by recency × reach × first-mover"})]})]}),g.size>0&&e.jsx(A,{withBorder:!0,bg:"var(--xb-bg-soft)",style:{position:"sticky",top:0,zIndex:2},children:e.jsxs(j,{justify:"space-between",wrap:"wrap",gap:"sm",children:[e.jsxs(j,{gap:"xs",children:[e.jsxs(D,{color:"dark",size:"lg",children:[g.size," selected"]}),e.jsx(f,{size:"xs",variant:"subtle",onClick:M,children:"Clear"})]}),e.jsxs(j,{gap:"xs",wrap:"wrap",children:[e.jsx(f,{size:"xs",variant:"default",leftSection:e.jsx(me,{size:12}),onClick:()=>n({kind:"bulk-add-to-list",tweets:d.filter(u=>g.has(u.id))}),children:"Add all to list"}),e.jsx(f,{size:"xs",variant:"default",leftSection:e.jsx(U,{size:12}),onClick:()=>n({kind:"bulk-enroll",tweets:d.filter(u=>g.has(u.id))}),children:"Enroll all in sequence"}),e.jsx(f,{size:"xs",color:"grape",leftSection:e.jsx(O,{size:12}),onClick:()=>
11{if(!m){Ce({reason:"Bulk DM from intent feed requires a paid plan.",code:"plan-gate"});return}n({kind:"bulk-dm",tweets:d.filter(u=>g.has(u.id))})},children:"DM all (rotate accounts)"}),e.jsx(f,{size:"xs",variant:"subtle",color:"red",leftSection:e.jsx(he,{size:12}),onClick:async()=>{const u=[...g];await k.bulkDismissIntent(u),B.show({color:"gray",message:`Dismissed ${u.length}`}),c(...u),M()},children:"Dismiss all"})]})]})}),e.jsx(Se,{h:720,children:e.jsxs(v,{gap:"xs",children:[d.map(u=>e.jsx(Oe,{tweet:u,accountId:we,selected:g.has(u.id),onToggleSelect:()=>b(u.id),onOpenAction:K=>n({kind:K,tweet:u}),onDismiss:()=>{k.dismissIntentTweet(u.id).then(()=>{var K;B.show({color:"gray",message:`Dismissed @${(K=u.author)==null?void 0:K.userName}`}),c(u.id)})}},u.id)),d.length===0&&e.jsx(y,{c:"dimmed",size:"sm",ta:"center",py:"md",children:"No matching tweets right now. Try fewer scopes or different patterns."})]})})]})})})(),(s==null?void 0:s.kind)==="reply"&&e.jsx(Ue,{tweet:s.tweet,accounts:P,onClose:()=>n(null),onSent:()=>n(null)}),(s==null?void 0:s.kind)==="dm"&&e.jsx(Ve,{tweet:s.tweet,accounts:P,onClose:()=>n(null),onSent:()=>n(null)}),(s==null?void 0:s.kind)==="quote"&&e.jsx(Ge,{tweet:s.tweet,accounts:P,onClose:()=>n(null),onSent:()=>n(null)}),(s==null?void 0:s.kind)==="add-to-list"&&e.jsx(Je,{tweet:s.tweet,lists:((te=J.data)==null?void 0:te.lists)||[],onClose:()=>n(null)}),(s==null?void 0:s.kind)==="remove-from-list"&&e.jsx(Ye,{tweet:s.tweet,onClose:()=>n(null)}),(s==null?void 0:s.kind)==="enroll-sequence"&&e.jsx(Ze,{tweet:s.tweet,campaigns:Z,onClose:()=>n(null)}),(s==null?void 0:s.kind)==="bulk-add-to-list"&&e.jsx(es,{tweets:s.tweets,lists:((ne=J.data)==null?void 0:ne.lists)||[],onClose:()=>n(null),onDone:M}),(s==null?void 0:s.kind)==="bulk-enroll"&&e.jsx(ss,{tweets:s.tweets,campaigns:Z,onClose:()=>n(null),onDone:M}),(s==null?void 0:s.kind)==="bulk-dm"&&e.jsx(ts,{tweets:s.tweets,accounts:P,onClose:()=>n(null),onDone:M})]})}function Oe({tweet:l,accountId:m,onOpenAction:r,onDismiss:x,selected:a,onToggleSelect:p}){const t=l,o=t.author||{},i=de(),h=S({mutationFn:()=>k.engageLike(m,t.id,o.userName),onSuccess:()=>B.show({color:"pink",message:"Liked"}),onError:g=>I(g)}),s=S({mutationFn:()=>k.engageRetweet(m,t.id,o.userName),onSuccess:()=>B.show({color:"cyan",message:"Retweeted"}),onError:g=>I(g)}),n=S({mutationFn:()=>k.engageBookmark(m,t.id,o.userName),onSuccess:()=>B.show({color:"gray",message:"Bookmarked"}),onError:g=>I(g)});return e.jsx(A,{withBorder:!0,p:"sm",style:{borderColor:a?"var(--mantine-color-text)":void 0,borderWidth:a?2:void 0},children:e.jsxs(j,{align:"flex-start",gap:"sm",wrap:"nowrap",children:[e.jsx(Fe,{checked:!!a,onChange:p,"aria-label":`Select tweet by @${o.userName}`,mt:4}),e.jsx(Ie,{src:o.profilePicture,radius:"xl",size:"md",children:(o.userName||"?").slice(0,1).toUpperCase()}),e.jsxs(v,{gap:4,style:{flex:1,minWidth:0},children:[e.jsxs(j,{gap:6,wrap:"nowrap",children:[e.jsxs(qe,{href:`https://x.com/${o.userName}`,target:"_blank",rel:"noreferrer",fw:600,size:"sm",children:["@",o.userName]}),o.name&&e.jsx(y,{size:"xs",c:"dimmed",truncate:!0,maw:200,children:o.name}),(o.isVerified||o.isBlueVerified)&&e.jsx(Me,{size:12,color:"var(--mantine-color-blue-6)"}),e.jsx(Re,{handle:o.userName}),e.jsx(y,{size:"xs",c:"dimmed",children:"·"}),e.jsxs(y,{size:"xs",c:"dimmed",children:[e.jsx(Ne,{size:10,style:{verticalAlign:-2}})," ",ns(o.followers)]}),e.jsx(y,{size:"xs",c:"dimmed",children:"·"}),e.jsx(H,{label:t.createdAt?new Date(t.createdAt).toLocaleString():"",children:e.jsxs(y,{size:"xs",c:"dimmed",children:[e.jsx(Ae,{size:10,style:{verticalAlign:-2}})," ",is(t._ageHours)]})}),e.jsxs(D,{size:"xs",variant:"light",color:t._score>=100?"green":t._score>=60?"orange":"gray",ml:"auto",children:["score ",t._score]})]}),e.jsx(y,{size:"sm",style:{whiteSpace:"pre-wrap"},children:t.text}),e.jsxs(j,{gap:4,mt:4,wrap:"wrap",align:"center",children:[e.jsx(H,{label:"Like",withArrow:!0,children:e.jsx(_,{size:"sm",variant:"subtle",color:"pink",onClick:()=>h.mutate(),loading:h.isPending,"aria-label":"Like",children:e.jsx(re,{size:14})})}),e.jsx(H,{label:"Retweet",withArrow:!0,children:e.jsx(_,{size:"sm",variant:"subtle",color:"cyan",onClick:()=>s.mutate(),loading:s.isPending,"aria-label":"Retweet",children:e.jsx(Be,{size:14})})}),e.jsx(H,{label:"Bookmark on X",withArrow:!0,children:e.jsx(_,{size:"sm",variant:"subtle",color:"gray",onClick:()=>n.mutate(),loading:n.isPending,"aria-label":"Bookmark",children:e.jsx(Pe,{size:14})})}),e.jsx(ae,{orientation:"vertical",mx:4}),e.jsx(f,{size:"xs",variant:"light",leftSection:e.jsx(le,{size:12}),onClick:()=>r("reply"),children:"Reply"}),e.jsx(f,{size:"xs",variant:"light",color:"grape",leftSection:e.jsx($e,{size:12}),onClick:()=>r("dm"),children:"DM"}),e.jsx(f,{size:"xs",variant:"light",color:"indigo",leftSection:e.jsx(Le,{size:12}),onClick:()=>r("quote"),children:"Quote"}),e.jsx(ae,{orientation:"vertical",mx:4}),e.jsx(f,{size:"xs",variant:"default",leftSection:e.jsx(me,{size:12}),onClick:()=>r("add-to-list"),children:"Add to list"}),e.jsx(f,{size:"xs",variant:"default",leftSection:e.jsx(U,{size:12}),onClick:()=>r("enroll-sequence"),children:"Enroll"}),o.userName&&e.jsx(De,{handle:o.userName,size:"sm"}),e.jsxs(E,{position:"bottom-end",withArrow:!0,children:[e.jsx(E.Target,{children:e.jsx(_,{size:"sm",variant:"subtle",color:"gray","aria-label":"More actions",children:e.jsx(Xe,{size:14})})}),e.jsxs(E.Dropdown,{children:[e.jsx(E.Item,{leftSection:e.jsx(xe,{size:14}),onClick:()=>r("remove-from-list"),children:"Remove from list…"}),e.jsx(E.Item,{leftSection:e.jsx(Te,{size:14}),onClick:()=>i(`/discover?seed=${encodeURIComponent(o.userName||"")}`),children:"Find similar accounts"}),e.jsx(E.Item,{leftSection:e.jsx(Qe,{size:14}),component:"a",href:t.url||`https://x.com/i/status/${t.id}`,target:"_blank",rel:"noreferrer",children:"Open on X"}),e.jsx(E.Divider,{}),e.jsx(E.Item,{leftSection:e.jsx(he,{size:14}),color:"red",onClick:x,children:"Dismiss — never show again"})]})]}),e.jsx(Ee,{style:{flex:1}}),e.jsxs(y,{size:"xs",c:"dimmed",children:[e.jsx(le,{size:11,style:{verticalAlign:-2}})," ",t.replyCount||0," · ",e.jsx(re,{size:11,style:{verticalAlign:-2}})," ",t.likeCount||0]})]})]})]})})}function Ue({tweet:l,accounts:m,onClose:r,onSent:x}){var h,s;const[a,p]=w.useState(((h=m[0])==null?void 0:h.id)||null),[t,o]=w.useState(""),i=S({mutationFn:()=>{var n;return k.engageReply(a,l.id,t,(n=l.author)==null?void 0:n.userName)},onSuccess:()=>{R("Reply sent."),x==null||x()},onError:n=>I(n)});return e.jsx(N,{opened:!0,onClose:r,title:`Reply to @${((s=l.author)==null?void 0:s.userName)||"?"}`,size:"lg",children:e.jsx(V,{tweet:l,accounts:m,accountId:a,setA
11ccountId:p,text:t,setText:o,maxLength:280,aiKind:"reply-to-tweet",sendLabel:"Send reply",sending:i.isPending,onSend:()=>i.mutate(),onClose:r})})}function Ve({tweet:l,accounts:m,onClose:r,onSent:x}){var h,s;const[a,p]=w.useState(((h=m[0])==null?void 0:h.id)||null),[t,o]=w.useState(""),i=S({mutationFn:()=>{var n;return k.sendTestDm(a,{recipientHandle:((n=l.author)==null?void 0:n.userName)||"",text:t})},onSuccess:()=>{R("DM sent."),x==null||x()},onError:n=>I(n)});return e.jsx(N,{opened:!0,onClose:r,title:`DM @${((s=l.author)==null?void 0:s.userName)||"?"}`,size:"lg",children:e.jsx(V,{tweet:l,accounts:m,accountId:a,setAccountId:p,text:t,setText:o,maxLength:1500,aiKind:"dm-cold",sendLabel:"Send DM",sending:i.isPending,onSend:()=>i.mutate(),onClose:r})})}function Ge({tweet:l,accounts:m,onClose:r,onSent:x}){var h,s;const[a,p]=w.useState(((h=m[0])==null?void 0:h.id)||null),[t,o]=w.useState(""),i=S({mutationFn:()=>{var n;return k.engageQuote(a,l.url||`https://x.com/i/status/${l.id}`,t,(n=l.author)==null?void 0:n.userName)},onSuccess:()=>{R("Quote tweet posted."),x==null||x()},onError:n=>I(n)});return e.jsx(N,{opened:!0,onClose:r,title:`Quote @${((s=l.author)==null?void 0:s.userName)||"?"}`,size:"lg",children:e.jsx(V,{tweet:l,accounts:m,accountId:a,setAccountId:p,text:t,setText:o,maxLength:280,aiKind:"quote-commentary",sendLabel:"Post quote tweet",sending:i.isPending,onSend:()=>i.mutate(),onClose:r})})}function V({tweet:l,accounts:m,accountId:r,setAccountId:x,text:a,setText:p,maxLength:t,aiKind:o,sendLabel:i,sending:h,onSend:s,onClose:n}){var g,z;return e.jsxs(v,{gap:"sm",children:[e.jsxs(A,{withBorder:!0,p:"xs",children:[e.jsx(y,{size:"xs",c:"dimmed",mb:4,children:"The tweet:"}),e.jsx(y,{size:"sm",style:{whiteSpace:"pre-wrap"},children:l.text})]}),e.jsxs(j,{justify:"space-between",align:"flex-end",children:[e.jsx(Q,{size:"xs",label:"From account",data:m.map(C=>({value:C.id,label:`@${C.handle}`})),value:r,onChange:x,w:240}),e.jsx(ue,{kind:o,context:{sourceText:l.text,sourceAuthor:((g=l.author)==null?void 0:g.userName)||"",recipientHandle:((z=l.author)==null?void 0:z.userName)||""},current:a,onResult:p})]}),e.jsx(pe,{autoFocus:!0,minRows:4,autosize:!0,value:a,onChange:C=>p(C.currentTarget.value),placeholder:"Type your message…",maxLength:t}),e.jsxs(j,{justify:"space-between",children:[e.jsxs(y,{size:"xs",c:"dimmed",children:[a.length," / ",t]}),e.jsxs(j,{gap:"xs",children:[e.jsx(f,{variant:"subtle",onClick:n,children:"Cancel"}),e.jsx(f,{onClick:s,loading:h,disabled:!a.trim()||!r,children:i})]})]})]})}function Je({tweet:l,lists:m,onClose:r}){const x=W(),[a,p]=w.useState(null),t=l.author||{},o=S({mutationFn:()=>k.addHandles(a,{handles:[{handle:t.userName,name:t.name||"",bio:t.description||"",followers:t.followers??null}]}),onSuccess:i=>{R(i.added?`Added @${t.userName}`:`@${t.userName} was already in this list`),x.invalidateQueries({queryKey:["lists"]}),x.invalidateQueries({queryKey:["list",a]}),r()},onError:i=>I(i)});return e.jsx(N,{opened:!0,onClose:r,title:`Add @${t.userName} to a list`,size:"sm",children:e.jsxs(v,{gap:"sm",children:[e.jsx(Q,{label:"List",data:m.map(i=>({value:i.id,label:`${i.name} · ${i.handleCount||0} handles`})),value:a,onChange:p,searchable:!0,placeholder:m.length?"Pick a list":"No lists yet — create one first"}),e.jsxs(j,{justify:"flex-end",children:[e.jsx(f,{variant:"subtle",onClick:r,children:"Cancel"}),e.jsx(f,{onClick:()=>o.mutate(),loading:o.isPending,disabled:!a,children:"Add"})]})]})})}function Ye({tweet:l,onClose:m}){const r=W(),a=(l.author||{}).userName,{data:p,isLoading:t,error:o}=L({queryKey:["lists-containing",a],queryFn:()=>k.listsContainingHandle(a),enabled:!!a}),i=(p==null?void 0:p.lists)||[],h=S({mutationFn:async n=>k.removeHandle(n,a),onSuccess:(n,g)=>{R(`Removed @${a} from list`),r.invalidateQueries({queryKey:["lists-containing",a]}),r.invalidateQueries({queryKey:["lists"]}),r.invalidateQueries({queryKey:["list",g]})},onError:n=>I(n)}),s=S({mutationFn:async()=>{for(const n of i)await k.removeHandle(n.id,a)},onSuccess:()=>{R(`Removed @${a} from ${i.length} list(s)`),r.invalidateQueries({queryKey:["lists-containing",a]}),r.invalidateQueries({queryKey:["lists"]}),m()},onError:n=>I(n)});return e.jsx(N,{opened:!0,onClose:m,title:`Remove @${a} from a list`,size:"sm",children:e.jsxs(v,{gap:"sm",children:[t&&e.jsx(y,{size:"sm",c:"dimmed",children:"Loading lists…"}),o&&e.jsx(y,{size:"sm",c:"red",children:o.message}),!t&&!o&&i.length===0&&e.jsxs(y,{size:"sm",c:"dimmed",children:["@",a," isn't in any of your lists."]}),i.length>0&&e.jsxs(v,{gap:6,children:[i.map(n=>e.jsxs(j,{justify:"space-between",wrap:"nowrap",children:[e.jsxs(y,{size:"sm",truncate:!0,children:[n.name," ",e.jsxs(y,{span:!0,size:"xs",c:"dimmed",children:["· ",n.handleCount," handles"]})]}),e.jsx(f,{size:"xs",variant:"default",color:"red",leftSection:e.jsx(xe,{size:12}),onClick:()=>h.mutate(n.id),loading:h.isPending&&h.variables===n.id,children:"Remove"})]},n.id)),i.length>1&&e.jsxs(f,{variant:"light",color:"red",size:"xs",onClick:()=>s.mutate(),loading:s.isPending,mt:4,children:["Remove from all ",i.length," lists"]})]}),e.jsx(j,{justify:"flex-end",children:e.jsx(f,{onClick:m,variant:"default",children:"Close"})})]})})}function Ze({tweet:l,campaigns:m,onClose:r}){var o;const[x,a]=w.useState(((o=m[0])==null?void 0:o.id)||null),p=l.author||{},t=S({mutationFn:()=>k.enrollHandleInSequence(x,{handle:p.userName,vars:{name:p.name||"",bio:p.description||"",followers:p.followers??null}}),onSuccess:i=>{B.show({color:i.alreadyEnrolled?"yellow":"green",message:i.alreadyEnrolled?`@${p.userName} is already enrolled in this sequence`:`@${p.userName} enrolled — first step fires immediately`}),r()},onError:i=>I(i)});return m.length?e.jsx(N,{opened:!0,onClose:r,title:`Enroll @${p.userName} in a sequence`,size:"sm",children:e.jsxs(v,{gap:"sm",children:[e.jsx(y,{size:"xs",c:"dimmed",children:"They'll start at step 1 (immediately) and run through the configured drip. The sequence's stop-on-reply rule still applies."}),e.jsx(Q,{label:"Running sequence",data:m.map(i=>({value:i.id,label:i.name})),value:x,onChange:a,searchable:!0}),e.jsxs(j,{justify:"flex-end",children:[e.jsx(f,{variant:"subtle",onClick:r,children:"Cancel"}),e.jsx(f,{onClick:()=>t.mutate(),loading:t.isPending,disabled:!x,children:"Enroll"})]})]})}):e.jsx(N,{opened:!0,onClose:r,title:"No running sequence campaigns",size:"sm",children:e.jsxs(v,{gap:"sm",children:[e.jsx(y,{size:"sm",c:"dimmed",children:"Sequences are the multi-step drips that auto-warm a prospect. Create one (from Campaigns → New → Sequence) and come back — you'll be able to drop high-intent tweets straight into it."}),e.jsx(j,{justify:"flex-end",children:e.jsx(f,{onClick:r,variant:"default",children:"Close"})})]})})}function es({tweets:l,lists:m,onClose:r,onDone:x}){const a=W(),[p,t]=w.useState(null),o=l.map(h=>{const s=h.author||{};return{handle:s.userName,name:s.name||"",bio:s.description||"",followers:s.followers??null}}).filter(h=>h.handle),i=S({mutationFn:()=>k.addHandles(p,{handles:o}),onSuccess:h=>{R(`Added ${h.added} new (${h.skipped||0} dupes/empty). List total: ${h.total}`),a.invalidateQueries({queryKey:["lists"]}),a.invalidateQueries({queryKey:["list",p]}),x==null||x(),r()},onError:h=>I(h)});return e.jsx(N,{opened:!0,onClose:r,title:`Add ${o.length} prospects to a list`,size:"md",children:e.jsxs(v,{gap:"sm",children:[e.jsx(Q,{label:"List",data:m.map(h=>({value:h.id,label:`${h.name} · ${h.handleCount||0} handles`})),value:p,onChange:t,searchable:!0,placeholder:m.length?"Pick a list":"No lists yet — create one first"}),e.jsxs(y,{size:"xs",c:"dimmed",children:["Each prospect is added with 
11name + bio + follower count pre-filled in their vars, so your DM templates can reference ",e.jsx("code",{children:"{{name}}"})," / ",e.jsx("code",{children:"{{bio}}"})," immediately."]}),e.jsxs(j,{justify:"flex-end",children:[e.jsx(f,{variant:"subtle",onClick:r,children:"Cancel"}),e.jsxs(f,{onClick:()=>i.mutate(),loading:i.isPending,disabled:!p,children:["Add ",o.length]})]})]})})}function ss({tweets:l,campaigns:m,onClose:r,onDone:x}){var s;const[a,p]=w.useState(((s=m[0])==null?void 0:s.id)||null),[t,o]=w.useState(null),i=l.map(n=>{var g;return(g=n.author)==null?void 0:g.userName}).filter(Boolean);async function h(){o({done:0,total:i.length,ok:0,dup:0,fail:0});for(let n=0;n<l.length;n++){const z=l[n].author||{};try{const C=await k.enrollHandleInSequence(a,{handle:z.userName,vars:{name:z.name||"",bio:z.description||"",followers:z.followers??null}});o(T=>({...T,done:n+1,ok:T.ok+(C.alreadyEnrolled?0:1),dup:T.dup+(C.alreadyEnrolled?1:0)}))}catch{o(C=>({...C,done:n+1,fail:C.fail+1}))}}}return m.length?e.jsx(N,{opened:!0,onClose:r,title:`Enroll ${i.length} prospects in a sequence`,size:"md",children:e.jsxs(v,{gap:"sm",children:[e.jsx(ce,{color:"gray",variant:"light",icon:e.jsx(U,{size:14}),children:"Each prospect starts at step 1 (fires immediately) and runs through the full drip. The sequence's stop-on-reply rule still applies — replies kill the flow per prospect. Already-enrolled prospects skip silently."}),e.jsx(Q,{label:"Running sequence",data:m.map(n=>({value:n.id,label:n.name})),value:a,onChange:p,searchable:!0}),t&&e.jsx(v,{gap:4,children:e.jsxs(y,{size:"sm",children:[t.done," / ",t.total," processed —"," ",e.jsx("strong",{children:t.ok})," new,"," ",t.dup," already enrolled,"," ",t.fail," failed"]})}),e.jsxs(j,{justify:"flex-end",children:[e.jsx(f,{variant:"subtle",onClick:r,children:(t==null?void 0:t.done)===(t==null?void 0:t.total)?"Close":"Cancel"}),(!t||t.done<t.total)&&e.jsxs(f,{onClick:h,disabled:!a,children:["Enroll ",i.length]})]})]})}):e.jsx(N,{opened:!0,onClose:r,title:"No running sequence campaigns",size:"sm",children:e.jsxs(v,{gap:"sm",children:[e.jsxs(y,{size:"sm",c:"dimmed",children:["Create a sequence (Campaigns → New → Sequence) and start it, then come back — you'll be able to drop these ",i.length," prospects straight into the drip."]}),e.jsx(j,{justify:"flex-end",children:e.jsx(f,{onClick:r,children:"Close"})})]})})}function ts({tweets:l,accounts:m,onClose:r,onDone:x}){const[a,p]=w.useState(""),[t,o]=w.useState(60),[i,h]=w.useState(new Set(m.map(c=>c.id))),[s,n]=w.useState(null),g=l.map(c=>{const b=c.author||{};return{handle:b.userName,name:b.name||"",bio:b.description||""}}).filter(c=>c.handle),z=S({mutationFn:()=>k.bulkDmFromIntent({recipients:g,text:a,accountIds:[...i],staggerMinutes:t}),onSuccess:c=>{var q,M;n(c);const b=[`${c.queued} DMs queued across ${Object.keys(c.accounts).length} accounts — spread over ${c.staggerMinutes}min`];(q=c.skipped)!=null&&q.length&&b.push(`${c.skipped.length} skipped (already claimed by other accounts)`),(M=c.claimed)!=null&&M.length&&b.push(`${c.claimed.length} sent anyway despite existing claim (${c.bulkOverride})`),R(b.join(" · "))},onError:c=>I(c)});function C(c){const b=new Set(i);b.has(c)?b.delete(c):b.add(c),h(b)}const T=w.useMemo(()=>{const c=[...i];if(!c.length)return{};const b=Object.fromEntries(c.map(q=>[q,0]));for(let q=0;q<g.length;q++)b[c[q%c.length]]++;return b},[i,g.length]);return e.jsx(N,{opened:!0,onClose:()=>{r(),s&&(x==null||x())},title:`Send DM to ${g.length} prospects`,size:"lg",children:e.jsxs(v,{gap:"sm",children:[e.jsx(ce,{color:"grape",variant:"light",icon:e.jsx(O,{size:14}),children:"DMs are round-robined across the selected accounts and staggered over the time window so no single account looks bursty. The worker enforces each account's daily DM cap — anything past the cap stays queued for tomorrow."}),e.jsxs(j,{justify:"space-between",align:"flex-end",children:[e.jsx(Ke,{label:"Stagger window",description:"Total minutes to spread the dispatch over",value:t,onChange:c=>o(Math.max(1,Math.min(720,Number(c)||60))),min:1,max:720,step:15,w:180}),e.jsx(ue,{kind:"dm-cold",context:{topic:"cold outreach DM",audience:"multi-account drip"},current:a,onResult:p})]}),e.jsx(pe,{label:"DM body",description:"Vars: {{handle}}, {{name}}, {{bio}}. Same body, personalized per recipient.",value:a,onChange:c=>p(c.currentTarget.value),autosize:!0,minRows:4,maxLength:1500,placeholder:"Hey {{name}}, saw your tweet — quick question…"}),e.jsxs(v,{gap:4,children:[e.jsx(y,{size:"xs",fw:500,c:"dimmed",children:"From accounts (round-robin)"}),e.jsx(j,{gap:6,wrap:"wrap",children:m.map(c=>e.jsxs(D,{variant:i.has(c.id)?"filled":"light",color:i.has(c.id)?"dark":"gray",style:{cursor:"pointer"},onClick:()=>C(c.id),children:["@",c.handle,T[c.id]?` · ${T[c.id]}`:""]},c.id))})]}),s?e.jsx(A,{withBorder:!0,children:e.jsxs(v,{gap:"xs",children:[e.jsxs(y,{size:"sm",fw:600,children:["Queued ",s.queued," DMs · finishes ~",new Date(s.finishAt).toLocaleTimeString()]}),e.jsxs($,{withColumnBorders:!0,fz:"xs",children:[e.jsx($.Thead,{children:e.jsxs($.Tr,{children:[e.jsx($.Th,{children:"Account"}),e.jsx($.Th,{children:"DMs queued"})]})}),e.jsx($.Tbody,{children:Object.entries(s.accounts).map(([c,b])=>{var M;const q=((M=m.find(X=>X.id===c))==null?void 0:M.handle)||c;return e.jsxs($.Tr,{children:[e.jsxs($.Td,{children:["@",q]}),e.jsx($.Td,{children:b})]},c)})})]})]})}):null,e.jsxs(j,{justify:"space-between",children:[e.jsxs(y,{size:"xs",c:"dimmed",children:[a.length," / 1500"]}),e.jsxs(j,{gap:"xs",children:[e.jsx(f,{variant:"subtle",onClick:()=>{r(),s&&(x==null||x())},children:s?"Close":"Cancel"}),!s&&e.jsxs(f,{leftSection:e.jsx(O,{size:14}),onClick:()=>z.mutate(),loading:z.isPending,disabled:!a.trim()||i.size===0,color:"grape",children:["Send ",g.length," DMs"]})]})]})]})})}function ns(l){return l==null?"?":l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function is(l){return l==null?"?":l<1?`${Math.round(l*60)}m ago`:l<24?`${Math.round(l)}h ago`:`${Math.round(l/24)}d ago`}export{Ns 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.