1import{r as f,af as D,a2 as _,j as e,H as q,a3 as O,A as M,L as G,a as H,ag as Y,u as B,a5 as K,F as Q,m as V,U as J}from"./index-CWNsbLFD.js";import{A as X}from"./AgentReport-DyEn40Yo.js";import{s as Z,R as ee,S as se,L as te,F as re}from"./scroll-into-view-BJSaIwru.js";import{L}from"./loader-circle-BbcUmWx4.js";import{C as F}from"./check-BjVBSAz9.js";import{C as ne}from"./clipboard-list-mIcIn8yR.js";import{G as ae}from"./globe-DLMaZYYN.js";import{B as oe}from"./building-2-BAANppgT.js";const A={status:"idle",phases:{site:"pending",position:"pending",workers:"pending",profile:"pending"},site:null,siteNote:null,position:null,workers:[],searches:[],report:"",result:null,error:null};function z(s,t,a,i){return s.find(c=>c.key===t)?s.map(c=>c.key===t?{...c,...i}:c):[...s,{key:t,label:a,status:"running",finding:null,accounts:null,note:null,lastSearch:null,...i}]}function ie(){const[s,t]=f.useState(A),a=f.useRef(null),i=f.useCallback(()=>{a.current?.abort(),a.current=null,t(A)},[]),r=f.useCallback(async d=>{a.current?.abort();const l=new AbortController;a.current=l,t({...A,status:"running",phases:{...A.phases}});const g=n=>{t(o=>{switch(n.type){case"stage":{const y=String(n.stage);if(y==="site")return{...o,phases:{...o.phases,site:n.status==="done"?"done":"running"},site:n.site??o.site,siteNote:n.note?String(n.note):o.siteNote};if(y==="position")return{...o,phases:{...o.phases,position:n.status==="done"?"done":"running"},position:n.position??o.position};if(y==="worker"){const b=String(n.worker),u=String(n.label??b),k=n.status==="done"?z(o.workers,b,u,{status:"done",finding:n.finding??null,accounts:n.accounts??null,note:n.note?String(n.note):null}):z(o.workers,b,u,{status:"running"}),j=k.length>0&&k.every(C=>C.status==="done");return{...o,workers:k,phases:{...o.phases,workers:j?"done":"running"}}}return y==="profile"?{...o,phases:{...o.phases,profile:n.status==="done"?"done":"running"}}:o}case"search":{const y=String(n.worker??""),b=String(n.query);return{...o,searches:[...o.searches,{worker:y,query:b}],workers:o.workers.map(u=>u.key===y?{...u,lastSearch:b}:u)}}case"delta":return{...o,report:o.report+String(n.content)};case"result":{const y=n.result;return{...o,status:"done",result:y,phases:{site:"done",position:"done",workers:"done",profile:"done"},workers:o.workers.map(b=>({...b,status:"done"}))}}case"error":return{...o,status:"error",error:String(n.message)};default:return o}})};try{const n=await fetch("/api/agents/icp-generator",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d),signal:l.signal});if(!n.ok){let u="Something went wrong. Please try again.",k=null;try{const j=await n.json();j.error&&(u=j.error),j.code&&(k=j.code)}catch{}if(n.status===401&&k==="login_required"){t(j=>({...j,status:"login_required"}));return}t(j=>({...j,status:"error",error:u}));return}if(!n.body)throw new Error("no response body");const o=n.body.getReader(),y=new TextDecoder;let b="";for(;;){const{done:u,value:k}=await o.read();if(u)break;b+=y.decode(k,{stream:!0});const j=b.split(` 2`);b=j.pop()??"";for(const C of j)if(C.startsWith("data: "))try{g(JSON.parse(C.slice(6)))}catch{}}t(u=>u.status==="running"?{...u,status:"error",error:"The run was interrupted. Please try again."}:u)}catch(n){if(n.name==="AbortError")return;console.error("ICP generator stream failed:",n),t(o=>({...o,status:"error",error:"Connection lost. Please try again."}))}},[]),c=f.useCallback(d=>r(d),[r]),m=f.useCallback(d=>r({share:d}),[r]);return{state:s,run:c,runShared:m,reset:i}}const le=[{grade:"A",band:"80 and above",text:"Multiple independent sources show this segment feels the problem and pays to solve it. Build the outbound list."},{grade:"B",band:"60 to 79",text:"A credible profile with real gaps. Usually the budget owner or the trigger is still a guess. Test it before you scale spend."},{grade:"C",band:"40 to 59",text:"Plausible but largely unproven. The evidence was thin, so treat the profile as a hypothesis and run the tests at the end."},{grade:"D",band:"below 40",text:"The public evidence does not support a confident profile yet. Almost always a segment defined too broadly, not an absent customer."}];function de(s){const t=s.split(` 3`).find(d=>d.includes("Your ICP:"))??"";if(!t.includes("|"))return null;const a=t.replace(/\*/g,""),i=/Your ICP:\s*([^|\n]+?)\s*(?:\||$)/.exec(a)?.[1]?.trim()??null,r=/Confidence:\s*([A-D])\b/.exec(a)?.[1]??null,c=/Fit signal:\s*(\d{1,3})\s*\/\s*100/.exec(a)?.[1],m=c?Math.min(100,Number(c)):null;return!i&&!r?null:{icpLabel:i||null,grade:r,score:m}}function ce(s){const t=s.split(` 4`),a=t.findIndex(i=>i.includes("Your ICP:"));return a>=0&&a<3?t.slice(a+1).join(` 5`):s}const E=[{key:"site",label:"Read the site"},{key:"position",label:"Pick segments"},{key:"workers",label:"Analysts in parallel"},{key:"profile",label:"The profile"}];function he({state:s}){const t=E.filter(i=>s.phases[i.key]==="done").length;let a="";if(s.status==="running")if(s.phases.site==="running")a="Fetching the site: homepage, pricing page and live job boardâ¦";else if(s.phases.position==="running")a="Reading what this business sells and picking the segments worth testingâ¦";else if(s.phases.workers==="running"){const i=s.workers.filter(r=>r.status==="running").length;a=i>1?`${i} researchers are working at the same timeâ¦`:"The last researcher is finishing upâ¦"}else s.phases.profile==="running"&&(a="Writing the profile from what the team foundâ¦");else s.status==="done"&&(a=s.result?.cached?"Profiled recently. Showing the saved profile instantly.":"Profile complete.");return e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:s.status==="done"?"Done":`Step ${Math.min(t+1,4)} of 4`}),s.status==="running"&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"usually takes about 90 seconds"})]}),e.jsx("ol",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:E.map(i=>{const r=s.phases[i.key];return e.jsxs("li",{className:`border px-3 py-2.5 flex items-center gap-2.5 text-sm transition ${r==="done"?"border-foreground bg-foreground text-background":r==="running"?"border-foreground bg-background":"border-border bg-card text-muted-foreground"}`,children:[r==="done"?e.jsx(F,{className:"w-4 h-4 shrink-0"}):r==="running"?e.jsx(L,{className:"w-4 h-4 shrink-0 animate-spin"}):e.jsx("span",{className:"w-4 h-4 shrink-0 rounded-full border border-current opacity-50"}),e.jsx("span",{className:"font-medium truncate",children:i.label})]},i.key)})}),a&&e.jsx("p",{className:"mt-3 text-sm text-muted-foreground","aria-live":"polite",children:a})]})}function ue(s){return s==="STRONG"?"border-emerald-600/30 bg-emerald-600/10 text-emerald-700":s==="MODERATE"?"border-amber-600/30 bg-amber-600/10 text-amber-700":"border-border bg-card text-muted-foreground"}function xe({worker:s}){const t=s.key==="accounts",a=s.status==="running",i=s.status==="done"&&!s.finding&&!s.accounts;return e.jsxs("div",{className:`border bg-background p-4 flex flex-col gap-2 transition ${a?"border-foreground":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t?e.jsx(oe,{className:"w-4 h-4 shrink-0"}):e.jsx(J,{className:"w-4 h-4 shrink-0"}),e.jsx("p",{className:"font-semibold text-sm truncate",children:t?"Account researcher":`${s.label} analyst`})]}),a?e.jsx(L,{className:"w-4 h-4 shrink-0 animate-spin text-muted-foreground"}):e.jsx(F,{className:"w-4 h-4 shrink-0"})]}),a&&e.jsx("p",{className:"text-xs text-muted-foreground break-words","aria-live":"polite",children:s.lastSearch?`Searching: "${s.lastSearch}"`:"Digging into the evidenceâ¦"}),s.finding&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center border border-foreground px-2 py-0.5 text-xs font-bold",children:["Fit ",s.finding.fitScore,"/100"]}),e.jsxs("span",{className:`inline-flex items-center border px-2 py-0.5 text-xs font-semibold ${ue(s.finding.demand)}`,children:["Signal: ",s.finding.demand]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s.finding.summary})]}),s.accounts&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center border border-foreground px-2 py-0.5 text-xs font-bold",children:[s.accounts.accounts.length," verified"]}),e.jsxs("span",{className:"inline-flex items-center border border-border bg-card px-2 py-0.5 text-xs font-semibold text-muted-foreground",children:[s.accounts.searched," searches"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s.accounts.accounts.length?`Named companies the search results actually surfaced: ${s.accounts.accounts.slice(0,4).map(r=>r.name).join(", ")}${s.accounts.accounts.length>4?" and more":""}.`:s.note==="no_key"?"Web search was unavailable on this run, so no accounts were verified.":"The searches surfaced no company that could be verified, so none are listed."})]}),i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"This researcher hit a snag; the profile rests on the others."})]})}function me({state:s}){const{site:t,siteNote:a}=s;
5if(!a&&!t)return null;const r=t&&t.pagesRead>0?[`${t.pagesRead} page${t.pagesRead===1?"":"s"} read`,t.pricePoints.length?`${t.pricePoints.length} price point${t.pricePoints.length===1?"":"s"} found`:"no readable pricing page",t.openRoles.length?`${t.openRoleCount??t.openRoles.length} open role${(t.openRoleCount??t.openRoles.length)===1?"":"s"}`:"no live job board",t.techStack.length?`${t.techStack.length} technologies detected`:null].filter(Boolean).join(" · "):a==="no_site"?"No website on this run, so the profile rests on the description and the live evidence alone.":"The site could not be read, so the profile rests on the live evidence alone.";return e.jsxs("div",{className:"border border-border bg-background p-4 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(ae,{className:"w-4 h-4 shrink-0"}),e.jsx("p",{className:"font-semibold text-sm",children:"Site reader"})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r})]})}function ge({state:s}){return!s.site&&!s.siteNote&&!s.position&&s.workers.length===0?null:e.jsxs("div",{className:"mb-8",children:[e.jsx(me,{state:s}),s.position&&e.jsxs("div",{className:"border border-border bg-background p-4 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(ne,{className:"w-4 h-4 shrink-0"}),e.jsx("p",{className:"font-semibold text-sm",children:"Manager"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["Read the business (",s.position.category||"uncategorised",","," ",s.position.motion||"motion unclear",") and hired ",s.position.segments.length," ","segment analyst",s.position.segments.length===1?"":"s",":"," ",s.position.segments.map(t=>t.label).join(", "),", plus an account researcher. All working at once."]})]}),s.workers.length>0&&e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:s.workers.map(t=>e.jsx(xe,{worker:t},t.key))})]})}function pe(s){return s==="A"||s==="B"?"border-emerald-600/30 bg-emerald-600/10 text-emerald-700":s==="C"?"border-amber-600/30 bg-amber-600/10 text-amber-700":s==="D"?"border-red-600/30 bg-red-600/10 text-red-700":"border-border bg-card text-foreground"}function fe({state:s}){const t=de(s.report),{position:a,result:i}=s,r=i?.icpLabel??t?.icpLabel??null,c=i?.grade??t?.grade??null,m=i?.score??t?.score??null,d=i?.accountCount??null,l=i?.companyName??a?.companyName??null,g=i?.oneLiner??a?.oneLiner??null;if(!r&&!l)return null;const n="inline-flex items-center px-3 py-1.5 text-sm font-semibold border";return e.jsxs(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"border-2 border-foreground bg-background p-6 sm:p-10 mb-8",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Your ideal customer"}),e.jsx("p",{className:"font-display text-3xl sm:text-4xl lg:text-5xl leading-tight mb-5",children:r??"â¦"}),e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap mb-5",children:[m!==null&&e.jsxs("span",{className:`${n} border-foreground bg-foreground text-background`,children:["Fit signal ",m,"/100"]}),c&&e.jsxs("span",{className:`${n} ${pe(c)}`,children:["Confidence ",c]}),d!==null&&d>0&&e.jsxs("span",{className:`${n} border-border bg-card text-foreground`,children:[d," matching account",d===1?"":"s"]})]}),l&&e.jsxs("p",{className:"text-base sm:text-lg leading-relaxed",children:[e.jsxs("span",{className:"font-semibold",children:[l,"."]})," ",e.jsx("span",{className:"text-muted-foreground",children:g})]})]})}function T({title:s,children:t}){return e.jsxs("details",{className:"group border border-border bg-background",children:[e.jsxs("summary",{className:"flex items-center justify-between gap-3 px-5 py-4 cursor-pointer select-none list-none [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{className:"font-semibold text-sm",children:s}),e.jsx(B,{className:"w-4 h-4 text-muted-foreground shrink-0 transition group-open:rotate-180"})]}),e.jsx("div",{className:"px-5 pb-5 border-t border-border pt-4",children:t})]})}function x({label:s,children:t}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground
5/70 mb-1",children:s}),e.jsx("div",{className:"text-sm text-muted-foreground leading-relaxed",children:t})]})}function be({state:s}){const{site:t,position:a,workers:i,searches:r}=s,c=i.filter(d=>d.finding),m=i.find(d=>d.key==="accounts")?.accounts??null;return!a&&c.length===0?null:e.jsxs("div",{className:"mt-8 space-y-3",children:[t&&t.pagesRead>0&&e.jsx(T,{title:`What we read on ${t.domain}`,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(x,{label:"Pages read",children:[t.pagesRead," page",t.pagesRead===1?"":"s",t.title?`, starting with "${t.title}"`:""]}),e.jsx(x,{label:"Pricing signals",children:t.pricePoints.length?`${t.pricePoints.join(", ")} across ${t.tierCount} plan${t.tierCount===1?"":"s"}. Free tier: ${t.hasFreeTier?"yes":"no"}. Contact-sales tier: ${t.hasEnterpriseContact?"yes":"no"}.`:"No pricing page was readable, so the price band was treated as unknown."}),e.jsx(x,{label:"Hiring signals",children:t.openRoles.length?t.openRoles.map(d=>d.title).join(", "):"No live job board was readable."}),t.techStack.length>0&&e.jsx(x,{label:"Tech detected",children:t.techStack.join(", ")})]})}),a&&e.jsx(T,{title:"How the manager read this business",children:e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsx(x,{label:"Category",children:a.category||"not stated"}),e.jsx(x,{label:"Market",children:a.market||"not stated"}),e.jsx(x,{label:"How they sell",children:a.motion||"not stated"}),e.jsx(x,{label:"Price band",children:a.priceBand}),e.jsx(x,{label:"Geography",children:a.geography}),e.jsx(x,{label:"Problem solved",children:a.problem||"not stated"})]})}),c.map(d=>{const l=d.finding;if(!l)return null;const g=a?.segments.find(n=>
5n.key===l.key);return e.jsx(T,{title:`${l.label}: the full findings (${l.fitScore}/100)`,children:e.jsxs("div",{className:"space-y-4",children:[g?.hypothesis&&e.jsx(x,{label:"Hypothesis tested",children:g.hypothesis}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsx(x,{label:"Company size",children:l.companySize||"not established"}),e.jsx(x,{label:"Industries",children:l.industries.join(", ")||"not established"}),e.jsx(x,{label:"Budget owner",children:l.buyerTitles.join(", ")||"not established"}),e.jsx(x,{label:"Also in the room",children:l.influencers.join(", ")||"not established"})]}),l.theirWords.length>0&&e.jsx(x,{label:"In their words",children:e.jsx("ul",{className:"space-y-1.5 mt-1",children:l.theirWords.map((n,o)=>e.jsxs("li",{children:["â",n,"â"]},o))})}),l.triggers.length>0&&e.jsx(x,{label:"Triggers",children:e.jsx("ul",{className:"space-y-1.5 mt-1",children:l.triggers.map((n,o)=>e.jsx("li",{children:n},o))})}),l.usesToday.length>0&&e.jsx(x,{label:"What they use today",children:e.jsx("ul",{className:"space-y-1.5 mt-1",children:l.usesToday.map((n,o)=>e.jsxs("li",{children:[e.jsx("span",{className:"font-medium text-foreground",children:n.name}),": ",n.note]},o))})}),l.willingnessToPay&&e.jsx(x,{label:"Willingness to pay",children:l.willingnessToPay}),l.disqualifiers.length>0&&e.jsx(x,{label:"Who to say no to",children:e.jsx("ul",{className:"space-y-1.5 mt-1",children:l.disqualifiers.map((n,o)=>e.jsx("li",{children:n},o))})}),l.evidence.length>0&&e.jsx(x,{label:"Evidence and sources",children:e.jsx("ul",{className:"space-y-2 mt-1",children:l.evidence.map((n,o)=>e.jsxs("li",{children:[n.point,n.source&&e.jsxs(e.Fragment,{children:[" ",/^https?:\/\//.test(n.source)?e.jsx("a",{href:n.source,target:"_blank",rel:"noopener noreferrer nofollow",className:"underline underline-offset-4 decoration-border hover:decoration-foreground break-all",children:"source"}):e.jsxs("span",{className:"text-muted-foreground/70",children:["(",n.source,")"]})]})]},o))})})]})},d.key)}),m&&e.jsx(T,{title:`Target accounts: ${m.accounts.length} verified from ${m.searched} searches`,children:m.accounts.length?e.jsx("ul",{className:"space-y-3",children:m.accounts.map((d,l)=>e.jsxs("li",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold text-foreground",children:d.name}),d.segment&&e.jsx("span",{className:"ml-2 inline-flex items-center border border-border bg-card px-1.5 py-0.5 text-[11px] text-muted-foreground align-middle",children:d.segment}),e.jsxs("span",{className:"text-muted-foreground",children:[": ",d.signal," "]}),e.jsx("a",{href:d.source,target:"_blank",rel:"noopener noreferrer nofollow",className:"underline underline-offset-4 decoration-border hover:decoration-foreground",children:"source"})]},l))}):e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"No company could be verified against a real search result on this run, so none are listed. Every account here has to appear in the search results with the URL that says so; an unsourced list is a generated one, and that is the thing this tool refuses to ship."})}),r.length>0&&e.jsx(T,{title:`Every search this run made (${r.length})`,children:e.jsx("ul",{className:"space-y-2",children:r.map((d,l)=>e.jsxs("li",{className:"text-sm text-muted-foreground break-words",children:[e.jsxs("span",{className:"text-muted-foreground/60",children:[d.worker,":"]})," â",d.query,"â"]},l))})})]})}const W="#9ca3af",R="#d4d4d8",v="#18181b",N="#71717a",U="#fafafa";function p(s){return e.jsx("text",{x:s.x,y:s.y,textAnchor:"middle",fontSize:s.size??11,fontWeight:s.bold?700:500,fontFamily:s.mono?"ui-monospace, SFMono-Regular, monospace":void 0,fill:s.color??v,stroke:U,strokeWidth:4,strokeLinejoin:"round",paintOrder:"stroke",children:s.children})}function w(s){return e.jsxs("g",{children:[e.jsx("path",{d:s.d,fill:"none",stroke:W,strokeWidth:1.75,strokeDasharray:s.dashed?"5 5":void 0}),e.jsx("circle",{cx:s.from[0],cy:s.from[1],r:3.2,fill:W}),e.jsx("circle",{cx:s.to[0],cy:s.to[1],r:3.2,fill:W})]})}function $(s){const t=s.cy-38,a=s.x+38;return e.jsxs("g",{children:[e.jsx("rect",{x:s.x,y:t,width:"76",height:"76",rx:s.rx??14,fill:"#fff",stroke:R,strokeWidth:"1.25",filter:"url
5(#icp-shadow)"}),s.children,e.jsx(p,{x:a,y:s.cy+58,bold:!0,mono:!0,size:10.5,children:s.name}),e.jsx(p,{x:a,y:s.cy+73,size:9.5,color:N,children:s.sub})]})}function je(){const s=[{cy:80,name:"segment-analyst",sub:"segment 1, picked live",kind:"people"},{cy:195,name:"segment-analyst",sub:"segment 2, picked live",kind:"people"},{cy:310,name:"segment-analyst",sub:"segment 3, if hired",kind:"people"},{cy:425,name:"account-researcher",sub:"sourced names only",kind:"building"}];return e.jsxs("figure",{className:"mt-2",children:[e.jsx("div",{className:"overflow-x-auto border border-border bg-background",children:e.jsxs("svg",{viewBox:"0 0 1340 660",role:"img","aria-label":"Workflow diagram: the website typed into the input box flows into an IF node checking whether it was profiled in the last 21 days. True returns the saved profile instantly. False runs the site reader, which fetches the homepage, pricing page and job board, then a manager agent that fans out in parallel to two or three segment analyst nodes chosen at runtime plus an account researcher node, each running its own web searches. All of them wire back into the profile writer, which streams the ideal customer profile with a fit signal, a confidence grade and named accounts, saved back to the results cache.",className:"min-w-[1120px] w-full h-auto",children:[e.jsxs("defs",{children:[e.jsx("pattern",{id:"icp-grid",width:"18",height:"18",patternUnits:"userSpaceOnUse",children:e.jsx("circle",{cx:"1.5",cy:"1.5",r:"1.1",fill:"#e4e4e7"})}),e.jsx("filter",{id:"icp-shadow",x:"-30%",y:"-30%",width:"160%",height:"160%",children:e.jsx("feDropShadow",{dx:"0",dy:"1.5",stdDeviation:"2.5",floodColor:"#18181b",floodOpacity:"0.1"})})]}),e.jsx("rect",{width:"1340",height:"660",fill:U}),e.jsx("rect",{width:"1340",height:"660",fill:"url(#icp-grid)"}),e.jsx(w,{d:"M108,255 C140,255 170,255 202,255",from:[108,255],to:[202,255]}),e.jsx(w,{d:"M240,217 C330,20 1100,20 1226,213",from:[240,217],to:[1226,213]}),e.jsx(w,{d:"M278,255 C312,255 348,255 382,255",from:[278,255],to:[382,255]}),e.jsx(w,{d:"M458,255 C494,255 526,255 562,255",from:[458,255],to:[562,255]}),s.map(t=>e.jsx(w,{d:`M638,255 C712,255 712,${t.cy} 762,${t.cy}`,from:[638,255],to:[762,t.cy]},`out-${t.cy}`)),s.map(t=>e.jsx(w,{d:`M838,${t.cy} C910,${t.cy} 910,255 982,255`,from:[838,t.cy],to:[982,255]},`in-${t.cy}`)),e.jsx(w,{d:"M1058,255 C1100,255 1152,255 1188,255",from:[1058,255],to:[1188,255]}),e.jsx(w,{d:"M240,293 C240,330 240,376 240,414",from:[240,293],to:[240,414],dashed:!0}),e.jsx(w,{d:"M420,293 C420,330 420,376 420,414",from:[420,293],to:[420,414],dashed:!0}),e.jsx(w,{d:"M600,293 C600,330 600,376 600,414",from:[600,293],to:[600,414],dashed:!0}),e.jsx(w,{d:"M800,463 C800,490 800,516 800,544",from:[800,463],to:[800,544],dashed:!0}),e.jsx(w,{d:"M1020,293 C1020,330 1020,376 1020,414",from:[1020,293],to:[1020,414],dashed:!0}),e.jsx(w,{d:"M1226,293 C1226,616 560,644 268,452",from:[1226,293],to:[268,452],dashed:!0}),e.jsx(p,{x:700,y:38,size:11,color:N,children:"true: profiled recently, answered instantly"}),e.jsx(p,{x:330,y:247,size:10.5,color:N,children:"false"}),e.jsx(p,{x:712,y:140,size:10.5,color:N,children:"fan out, all at once"}),e.jsx(p,{x:912,y:140,size:10.5,color:N,children:"fan back in"}),e.jsx(p,{x:520,y:646,size:10.5,color:N,children:"profile saved for 21 days"}),e.jsx($,{x:32,cy:255,rx:38,name:"website input",sub:"the box on this page",children:e.jsx("path",{d:"M73,244 L62,258 h5 l-2,10 11,-14 h-5 z",fill:v})}),e.jsx($,{x:202,cy:255,name:"cache check",sub:"profiled in last 21d?",children:e.jsx("text",{x:"240",y:"261",textAnchor:"middle",fontSize:"16",fontWeight:"800",fill:v,children:"IF"})}),e.jsx($,{x:382,cy:255,name:"site-reader",sub:"no model, just facts",children:e.jsxs("g",{stroke:v,strokeWidth:"1.6",fill:"none",children:[e.jsx("circle",{cx:"420",cy:"255",r:"15"}),e.jsx("ellipse",{cx:"420",cy:"255",rx:"6.5",ry:"15"}),e.jsx("line",{x1:"405",y1:"255",x2:"435",y2:"255"})]})}),e.jsx($,{x:562,cy:255,name:"manager-agent",sub:"hires the analysts",children:e.jsxs("g",{stroke:v,strokeWidth:"1.6",fill:"none",strokeLinejoin:"round",children:[e.jsx("rect",{x:"588",y:"241",width:"24",height:"30",rx:"2"}),e.jsx("rect",{x:"595",y:"237",width:"10",height:"7",rx:"1.5",fill:"#fff"}),e.jsx("line",{x1:"593",y1:"252",x2:"607",y2:"252"}),e.jsx("line",{x1:"593",y1:"258",x2:"607",y2:"258"}),e.jsx("line",{x1:"593",y1:"264",x2:"602",y2:"264"})]})}),s.map(t=>e.jsx($,{x:762,cy:t.cy,name:t.name,sub:t.sub,children:t.kind==="people"?e.jsxs("g",{stroke:v,strokeWidth:"1.6",fill:"none",strokeLinecap:"round",children:[e.jsx("circle",{cx:794,cy:t.cy-8,r:"5"}),e.jsx("path",{d:`M786,${t.cy+8} a8,8 0 0 1 16,0`}),e.jsx("circle",{cx:809,cy:t.cy-6,r:"4"}),e.jsx("path",{d:`M803,${t.cy+8} a6,6 0 0 1 12,0`})]}):e.jsxs("g",{stroke:v,strokeWidth:"1.6",fill:"none",strokeLinejoin:"round",children:[e.jsx("rect",{x:788,y:t.cy-14,width:"24",height:"28",rx:"1.5"}),e.jsx("line",{x1:794,y1:t.cy-7,x2:798,y2:t.cy-7}),e.jsx("line",{x1:802,y1:t.cy-7,x2:806,y2:t.cy-7}),e.jsx("line",{x1:794,y1:t.cy+1,x2:798,y2:t.cy+1}),e.jsx("line",{x1:802,y1:t.cy+1,x2:806,y2:t.cy+1})]})},t.cy)),e.jsx($,{x:982,cy:255,name:"profile-writer",sub:"streams the answer",children:e.jsxs("g",{stroke:v,strokeWidth:"1.6",fill:"none",strokeLinejoin:"round",children:[e.jsx("rect",{x:"1008",y:"240",width:"24",height:"30",rx:"2"}),e.jsx("line",{x1:"1013",y1:"249",x2:"1027",y2:"249"}),e.jsx("line",{x1:"1013",y1:"256",x2:"1027",y2:"256"}),e.jsx("line",{x1:"1013",y1:"263",x2:"1022",y2:"263"})]})}),e.jsxs($,{x:1188,cy:255,rx:38,name:"the ICP",sub:"on this page + PDF",children:[e.jsx("path",{d:"M1216,246 l6,6 12,-13",stroke:v,strokeWidth:"2.4",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"1226",cy:"255",r:"16",stroke:v,strokeWidth:"1.4",fill:"none"})]}),e.jsxs("g",{children:[e.jsx("rect",{x:"196",y:"414",width:"88",height:"42",rx:"8",fill:"#fff",stroke:R,strokeWidth:"1.25",filter:"url
5(#icp-shadow)"}),e.jsx(p,{x:240,y:433,bold:!0,mono:!0,size:9.5,children:"postgres"}),e.jsx(p,{x:240,y:447,size:9,color:N,children:"results cache"})]}),e.jsxs("g",{children:[e.jsx("rect",{x:"376",y:"414",width:"88",height:"42",rx:"8",fill:"#fff",stroke:R,strokeWidth:"1.25",filter:"url(#icp-shadow)"}),e.jsx(p,{x:420,y:433,bold:!0,mono:!0,size:9.5,children:"http fetch"}),e.jsx(p,{x:420,y:447,size:9,color:N,children:"pricing + jobs"})]}),e.jsxs("g",{children:[e.jsx("rect",{x:"556",y:"414",width:"88",height:"42",rx:"8",fill:"#fff",stroke:R,strokeWidth:"1.25",filter:"url(#icp-shadow)"}),e.jsx(p,{x:600,y:433,bold:!0,mono:!0,size:9.5,children:"ai model"}),e.jsx(p,{x:600,y:447,size:9,color:N,children:"strict JSON"})]}),e.jsxs("g",{children:[e.jsx("rect",{x:"756",y:"544",width:"88",height:"42",rx:"8",fill:"#fff",stroke:R,strokeWidth:"1.25",filter:"url(#icp-shadow)"}),e.jsx(p,{x:800,y:563,bold:!0,mono:!0,size:9.5,children:"web search"}),e.jsx(p,{x:800,y:577,size:9,color:N,children:"2 queries each"})]}),e.jsxs("g",{children:[e.jsx("rect",{x:"976",y:"414",width:"88",height:"42",rx:"8",fill:"#fff",stroke:R,strokeWidth:"1.25",filter:"url(#icp-shadow)"}),e.jsx(p,{x:1020,y:433,bold:!0,mono:!0,size:9.5,children:"ai model"}),e.jsx(p,{x:1020,y:447,size:9,color:N,children:"streamed"})]})]})}),e.jsx("figcaption",{className:"text-xs text-muted-foreground mt-3",children:"The real pipeline behind this page. Swipe sideways on a phone to follow the whole flow."})]})}function ye({state:s,query:t}){const[a,i]=f.useState(!1),r=s.result;if(!r)return null;const c=r.shareId?`https://koso.ai/agents/icp-generator?r=${r.shareId}`:`https://koso.ai/agents/icp-generator?d=${encodeURIComponent(t)}`,m=`${r.companyName??"This business"} should sell to ${r.icpLabel??"a segment the agents picked"}${r.score!==null?` (fit signal ${r.score}/100`:""}${r.score!==null&&r.grade?`, confidence ${r.grade})`:r.score!==null?")":""}. Free ICP generator by Koso:`,d=async()=>{try{await navigator.clipboard.writeText(c),i(!0),setTimeout(()=>i(!1),2e3)}catch{}},l=()=>{navigator.share?.({title:"Free ICP Generator",text:m,url:c}).catch(()=>{})},g="inline-flex items-center gap-1.5 border border-border bg-background px-3 py-1.5 text-xs font-semibold hover:border-foreground transition";return e.jsxs("div",{className:"-mt-3 mb-8 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground mr-1",children:"Share this profile:"}),typeof navigator<"u"&&"share"in navigator&&e.jsxs("button",{type:"button",onClick:l,className:g,children:[e.jsx(se,{className:"w-3.5 h-3.5"})," Share"]}),e.jsx("button",{type:"button",onClick:d,className:g,children:a?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"w-3.5 h-3.5"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3.5 h-3.5"})," Copy link"]})}),e.jsx("a",{href:`https://twitter.com/intent/tweet?text=${encodeURIComponent(m)}&url=${encodeURIComponent(c)}`,target:"_blank",rel:"noopener noreferrer",className:g,children:"X"}),e.jsx("a",{href:`https://wa.me/?text=${encodeURIComponent(`${m} ${c}`)}`,target:"_blank",rel:"noopener noreferrer",className:g,children:"WhatsApp"}),e.jsx("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(c)}`,target:"_blank",rel:"noopener noreferrer",className:g,children:"LinkedIn"}),r.shareId&&e.jsxs("a",{href:`/api/agents/icp-generator/pdf/${r.shareId}`,target:"_blank",rel:"noopener noreferrer",className:g,children:[e.jsx(re,{className:"w-3.5 h-3.5"})," PDF report"]})]})}const we=["stripe.com","linear.app","notion.so"];function Ae(){const[s,t]=f.useState("domain"),[a,i]=f.useState(""),{state:r,run:c,runShared:m}=ie(),{d,q:l,r:g}=D.useSearch(),n=D.useNavigate(),o=r.status==="running",y=r.status!=="idle"&&r.status!=="login_required";f.useEffect(()=>{r.status==="login_required"&&(window.location.href=`/login?next=${encodeURIComponent(_())}`)},[r.status]);const b=f.useRef(null),u=f.useRef(!1),k=f.useRef(!!g),[j,C]=f.useState(""),P=(h,I)=>{const S=h.trim();!S||o||(u.current=!0,t(I),i(S),C(S),c(I==="domain"?{domain:S}:{description:S}),n({search:I==="domain"?{d:S}:{q:S},replace:!0,resetScroll:!1}))};return f.useEffect(()=>{u.current||(g?(u.current=!0,m(g)):d?(u.current=!0,t("domain"),i(d),C(d),c({domain:d})):l&&(u.current=!0,t("text"),i(l),C(l),c({description:l})))},[g,d,l,c,m]),f.useEffect(()=>{r.status==="done"&&r.result?.shareId&&n({search:{r:r.result.shareId},replace:!0,resetScroll:!1})},[r.status,r.result,n]),f.useEffect(()=>{r.status==="running"&&Z(b.current)},[r.status]),e.jsxs("main",{children:[e.jsx(q,{}),e.jsx(O,{current:"icp-generator"}),e.jsxs("section",{className:"relative overflow-hidden border-b border-border",children:[e.jsx("div",{className:"absolute inset-0 grid-bg pointer-events-none"}),e.jsxs("div",{className:"relative max-w-3xl mx-auto px-4 sm:px-6 pt-8 pb-10 lg:pt-12 lg:pb-14 text-center",children:[e.jsxs("h1",{className:"h-section",children:["Who Should You",e.jsx("br",{}),"Actually Sell To?"]}),e.jsx("p",{className:"text-base sm:text-lg text-muted-foreground max-w-xl mx-auto mt-4 leading-relaxed",children:"Give us your website. Agents read your real pricing page and job board, research who actually has this problem, and hand you an ideal customer profile with the buying committee, the triggers, who to say no to, and named accounts that match."}),e.jsxs("form",{className:"mt-7 flex flex-col gap-3 sm:gap-0 sm:flex-row sm:shadow-[0_16px_50px_-20px_rgba(0,0,0,0.25)]",onSubmit:h=>{h.preventDefault(),P(a,s)},children:[s==="domain"?e.jsx("input",{type:"text",value:a,onChange:h=>i(h.target.value),placeholder:"yourcompany.com",maxLength:300,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,className:"sm:flex-1 border-2 border-foreground bg-background px-5 sm:px-6 h-[72px] text-base sm:text-lg outline-none placeholder:text-muted-foreground
5/60 min-w-0 text-center sm:text-left","aria-label":"The website to build an ideal customer profile for"}):e.jsx("textarea",{value:a,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),P(a,s))},placeholder:"Describe what you sell, e.g. A scheduling tool that books field service jobs for small HVAC companiesâ¦",rows:3,maxLength:700,className:"sm:flex-1 border-2 border-foreground bg-background px-5 sm:px-6 py-4 min-h-[110px] text-base sm:text-lg outline-none placeholder:text-muted-foreground/60 min-w-0 resize-none text-left","aria-label":"Describe the business to build an ideal customer profile for"}),e.jsx("button",{type:"submit",disabled:o||!a.trim(),className:"inline-flex items-center justify-center gap-2 bg-foreground text-background border-2 border-foreground px-8 h-14 sm:h-[72px] text-lg font-bold hover:opacity-90 transition disabled:opacity-40 shrink-0",children:o?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-5 h-5 animate-spin"})," Building"]}):e.jsxs(e.Fragment,{children:["Build ICP ",e.jsx(M,{className:"w-5 h-5"})]})})]}),s==="domain"&&e.jsxs("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:"Try:"}),we.map(h=>e.jsx("button",{type:"button",onClick:()=>P(h,"domain"),className:"border border-border bg-card px-3 py-1 hover:border-foreground transition",children:h},h))]}),e.jsx("button",{type:"button",onClick:()=>{t(s==="domain"?"text":"domain"),i("")},className:"mt-4 text-sm text-muted-foreground underline underline-offset-4 decoration-border hover:decoration-foreground transition",children:s==="domain"?"No website yet? Describe what you sell instead":"Have a website? Use that instead, it makes the profile sharper"}),e.jsx("p",{className:"mt-6 text-xs text-muted-foreground uppercase tracking-widest",children:"Free · first run without sign-in · profile in ~90 seconds"})]})]}),y&&e.jsx("section",{ref:b,className:"border-b border-border bg-card/50 scroll-mt-28 sm:scroll-mt-24",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-12 lg:py-16",children:[e.jsx(he,{state:r}),r.status==="error"?e.jsx("div",{className:"border border-red-600/30 bg-red-600/5 text-red-700 px-5 py-4 text-sm",children:r.error}):e.jsxs(e.Fragment,{children:[r.status==="done"&&r.result?.cached&&e.jsx(ee,{subject:r.result.companyName,ranAt:r.result.analyzedAt,shared:k.current,agentPath:"/agents/icp-generator",cta:"Build your own ICP"}),e.jsx(ge,{state:r}),e.jsx(fe,{state:r}),r.status==="done"&&e.jsx(ye,{state:r,query:j}),r.report?e.jsxs("div",{className:"border border-border bg-background p-6 sm:p-10",children:[e.jsx("h2",{className:"text-xs uppercase tracking-[0.25em] text-muted-foreground mb-6",children:"The profile, in full"}),e.jsx(X,{text:ce(r.report)}),o&&e.jsx("span",{className:"inline-block w-2 h-5 bg-foreground
5/70 animate-pulse align-text-bottom"})]}):o&&e.jsx("div",{className:"border border-border bg-background p-6 sm:p-10 text-sm text-muted-foreground",children:"Your profile will appear here once the researchers report backâ¦"}),e.jsx(be,{state:r}),r.status==="done"&&e.jsxs("p",{className:"mt-6 text-xs text-muted-foreground",children:["AI-generated profile from public evidence, for deciding who to go after next, not a guarantee and not business advice. Once you have enough closed-won deals, your own CRM beats anything on the open web.",r.result?.cached&&` First built ${new Date(r.result.analyzedAt).toLocaleDateString()}.`]})]})]})}),e.jsx("section",{className:"border-b border-border bg-foreground text-background",children:e.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 lg:px-10 py-14 lg:py-20 flex flex-col lg:flex-row lg:items-center gap-8 justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"h-sub !text-background",children:"Want An Agent Like This For Your Business?"}),e.jsx("p",{className:"text-background/70 mt-3 max-w-xl",children:"This page reads a website, dispatches a research team and writes a document, which is the architecture Koso builds for clients every week. The same shape scores your inbound leads against this profile, keeps your account list fresh, or drafts the first touch for every account that trips a trigger."})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs("a",{href:"/book",className:"inline-flex items-center gap-2 bg-background text-foreground px-6 py-3 font-semibold hover:opacity-90 transition",children:["Book a free call ",e.jsx(M,{className:"w-4 h-4"})]}),e.jsxs(G,{to:"/agents",className:"inline-flex items-center gap-2 border border-background/40 px-6 py-3 font-semibold hover:border-background transition",children:["All agents ",e.jsx(H,{className:"w-4 h-4"})]})]})]})}),e.jsx("section",{id:"how-it-works",className:"border-b border-border",children:e.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 lg:px-10 py-14 lg:py-20",children:[e.jsx("h2",{className:"h-sub mb-4",children:"It Reads Your Site Before It Reasons."}),e.jsx("p",{className:"text-muted-foreground max-w-2xl mb-10 leading-relaxed",children:"Every other ICP generator hands your URL to a language model and prints what the model already believed. This one fetches the site first, because two facts on it decide most of the profile: your advertised prices bound who can afford you, and your open roles say how you sell. Only then does a manager agent pick the segments worth testing and put analysts on them, all at once, each checking its segment against live web evidence."}),e.jsx(je,{})]})}),e.jsx("section",{id:"whats-inside",className:"border-b border-border bg-card/50",children:e.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 lg:px-10 py-14 lg:py-20",children:[e.jsx("h2",{className:"h-sub mb-4",children:"What Lands In The Profile."}),e.jsx("p",{className:"text-muted-foreground max-w-2xl mb-10 leading-relaxed",children:"Eight sections, written to be used rather than filed. The two most teams are missing are the disqualifiers and the filter set: one stops you working accounts that will never close, the other turns the profile into a list you can actually build today."}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-px bg-border border border-border",children:[{h:"Firmographics",t:"Size, industries, geography and the budget signal, tied to what your pricing page says a buyer has to be able to spend."},{h:"The buying committee",t:"Who owns the budget, who else is in the room, and the specific objection that stalls each of them."},{h:"Triggers to watch",t:"The observable events that mean an account is in market now: a hire, a raise, a migration, a public complaint."},{h:"Who to say no to",t:"The companies inside your segment that look like buyers and are not. The half of an ICP that saves money."},{h:"In their words",t:"How these buyers describe the problem themselves, pulled from real threads and reviews. Your copy writes itself from here."},{h:"Where to find them",t:"The channels that actually reach this buyer, plus a filter set ready to paste into Sales Navigator or Apollo."},{h:"Target accounts",t:"Named companies with the signal that made them a fit and the source URL that proves it, or an honest empty list."},{h:"What would prove it",t:"The cheapest test that would confirm or kill the profile, because a profile is a hypothesis until a customer signs."}].map(h=>e.jsxs("div",{className:"bg-background p-6",children:[e.jsx("h3",{className:"font-semibold mb-2",children:h.h}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h.t})]},h.h))})]})}),e.jsx("section",{id:"grades",className:"border-b border-border",children:e.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 lg:px-10 py-14 lg:py-20",children:[e.jsx("h2",{className:"h-sub mb-4",children:"What The Confidence Grades Mean."}),e.jsx("p",{className:"text-muted-foreground max-w-2xl mb-10 leading-relaxed",children:"The fit signal reads how strong the evidence is for the winning segment, and it is pulled down when the analysts had to fall back on general knowledge instead of finding real sources. A low grade is
5information, not a failure: it usually means the segment was drawn too broadly to prove anything about."}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-px bg-border border border-border",children:le.map(h=>e.jsxs("div",{className:"bg-background p-6",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2",children:[e.jsx("h3",{className:"font-display text-3xl",children:h.grade}),e.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground/70 shrink-0",children:h.band})]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h.text})]},h.grade))}),e.jsx("p",{className:"text-sm text-muted-foreground mt-6 max-w-2xl leading-relaxed",children:"Every profile ends with the cheapest test that would prove or kill it, because a profile built from public evidence is a hypothesis, and only a signed customer settles it."})]})}),e.jsx("section",{id:"faq",className:"border-b border-border",children:e.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 lg:px-10 py-14 lg:py-20",children:[e.jsx("h2",{className:"h-sub mb-10",children:"ICP Generator FAQ"}),e.jsx("div",{className:"max-w-3xl space-y-3",children:Y.map(h=>e.jsxs("details",{className:"group border border-border bg-background",children:[e.jsxs("summary",{className:"flex items-center justify-between gap-3 px-5 py-4 cursor-pointer select-none list-none [&::-webkit-details-marker]:hidden",children:[e.jsx("h3",{className:"font-semibold text-sm sm:text-base",children:h.q}),e.jsx(B,{className:"w-4 h-4 text-muted-foreground shrink-0 transition group-open:rotate-180"})]}),e.jsx("p",{className:"px-5 pb-5 pt-1 text-sm sm:text-[15px] text-muted-foreground leading-relaxed",children:h.a})]},h.q))})]})}),e.jsx(K,{current:"icp-generator"}),e.jsx(Q,{})]})}export{Ae as component};
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.