PageSourceSearch

https://www.startuphub.ai/_next/static/chunks/3308-9b822f4d84dabeed.js

js startuphub.ai collected 2026-09-25 15:05:07 UTC 44,447 bytes, 4 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3308],{3308:(e,t,s)=>{s.r(t),s.d(t,{SearchAssistantSheet:()=>em});var r=s(95155),a=s(12115),n=s(98500),i=s.n(n),l=s(76717),o=s(99412),c=s(66959),d=s(21767),u=s(50049),m=s(76498),h=s(7810),x=s(89974),p=s(65576),g=s(15197),f=s(92289),b=s(92451),v=s(94514),j=s(21362),y=s(67635),w=s(66088),N=s(65246),k=s(59320),S=s(50538),A=s(51914),C=s(33210),$=s(91958),I=s(17463),D=s(93770),T=s(56558),E=s(96909),R=s(72055),z=s(40980),O=s(6296),U=s(96035),L=s(68459);function F({open:e,onRestore:t,onClose:s}){let[n,i]=(0,a.useState)(null),[l,o]=(0,a.useState)(!0),[d,u]=(0,a.useState)(null),[m,h]=(0,a.useState)(null),x=(0,a.useCallback)(async()=>{u(null);try{let e=await fetch("/api/search/assistant/sessions",{cache:"no-store"});if(!e.ok)throw Error(String(e.status));let t=await e.json();o(!1!==t.signedIn),i(t.sessions??[])}catch{u("Could not load your history."),i([])}},[]);(0,a.useEffect)(()=>{e&&x()},[e,x]);let p=async e=>{h(e);try{let r=await fetch(`/api/search/assistant/sessions/${e}`,{cache:"no-store"});if(!r.ok)throw Error(String(r.status));let a=await r.json();t(e,a.messages??[]),s()}catch{u("Could not open that conversation.")}finally{h(null)}},g=async(e,t)=>{t.stopPropagation(),i(t=>(t??[]).filter(t=>t.id!==e));try{let t=await fetch(`/api/search/assistant/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw Error(String(t.status))}catch{i(n??[]),u("Could not delete that conversation.")}};return e?(0,r.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2",children:[(0,r.jsx)(S.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Your conversations"}),(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-7 px-2 text-[11px]",onClick:s,children:"Back to chat"})]}),(0,r.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2",children:[d&&(0,r.jsx)("p",{className:"px-2 py-1.5 text-xs text-destructive",role:"alert",children:d}),null===n&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 py-6 text-xs text-muted-foreground",children:[(0,r.jsx)(O.A,{className:"h-3.5 w-3.5 animate-spin"})," Loading your chats..."]}),null!==n&&!l&&(0,r.jsx)("p",{className:"px-2 py-6 text-xs text-muted-foreground",children:"Sign in to keep your conversations and pick one back up later."}),null!==n&&l&&0===n.length&&!d&&(0,r.jsx)("p",{className:"px-2 py-6 text-xs text-muted-foreground",children:"No saved conversations yet. Ask something and it will show up here."}),(n??[]).map(e=>(0,r.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>p(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),p(e.id))},className:(0,z.cn)("group flex w-full cursor-pointer items-start gap-2 rounded-md px-2 py-2 text-left transition-colors","hover:bg-muted focus:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",m===e.id&&"opacity-60"),children:[(0,r.jsx)(U.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"block truncate text-xs font-medium text-foreground",children:e.title}),(0,r.jsxs)("span",{className:"mt-0.5 block text-[10px] text-muted-foreground",children:[e.messageCount," message",1===e.messageCount?"":"s",(0,r.jsx)("span",{className:"mx-1 opacity-40",children:"\xb7"}),function(e){let t=new Date(e).getTime();if(!Number.isFinite(t))return"";let s=Math.round((Date.now()-t)/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;let r=Math.round(s/60);return r<24?`${r}h ago`:7>Math.round(r/24)?new Date(e).toLocaleDateString("en-US",{weekday:"short"}):new Date(e).toLocaleDateString("en-US",{day:"numeric",month:"short"})}(e.updatedAt)]})]}),m===e.id?(0,r.jsx)(O.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}):(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon","aria-label":`Delete conversation: ${e.title}`,className:"h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100",onClick:t=>g(e.id,t),children:(0,r.jsx)(L.A,{className:"h-3 w-3"})})]},e.id))]})]}):null}function M(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}let P=new Set(["image/png","image/jpeg","image/jpg","image/webp","image/gif"]);function _(e){return P.has((e.type||"").toLowerCase())}function W(e){let t=e.endsWith("==")?2:+!!e.endsWith("=");return Math.floor(3*e.length/4)-t}async function B(e){if(!_(e))return null;let t=(e.type||"").toLowerCase(),s=URL.createObjectURL(e),r=async()=>{var r;let a=await (r=e,new Promise(e=>{let t=new FileReader;t.onload=()=>{let s=String(t.result||""),r=s.indexOf(",");e(r>-1?s.slice(r+1):null)},t.onerror=()=>
1e(null),t.readAsDataURL(r)}));return!a||W(a)>5242880?(URL.revokeObjectURL(s),null):{id:crypto.randomUUID(),name:e.name||"image",mimeType:t,data:a,previewUrl:s}};if("image/gif"===t)return r();try{let a=await createImageBitmap(e),n=Math.min(1,1600/Math.max(a.width,a.height));if(1===n&&e.size<=5242880&&"image/jpeg"===t)return a.close(),r();let i=document.createElement("canvas");i.width=Math.max(1,Math.round(a.width*n)),i.height=Math.max(1,Math.round(a.height*n));let l=i.getContext("2d");if(!l)return a.close(),r();l.drawImage(a,0,0,i.width,i.height),a.close();let o=i.toDataURL("image/jpeg",.85),c=o.slice(o.indexOf(",")+1);if(!c||W(c)>5242880)return URL.revokeObjectURL(s),null;return{id:crypto.randomUUID(),name:e.name||"image",mimeType:"image/jpeg",data:c,previewUrl:s}}catch{return r()}}var H=s(77735);function V(e,t){let s,a=[],n=/\*\*([^*]+)\*\*|\*([^*]+)\*/g,i=0,l=0;for(;null!==(s=n.exec(e));)s.index>i&&a.push(e.slice(i,s.index)),void 0!==s[1]?a.push((0,r.jsx)("strong",{children:s[1]},`${t}-b-${l}`)):void 0!==s[2]&&a.push((0,r.jsx)("em",{children:s[2]},`${t}-i-${l}`)),i=n.lastIndex,l+=1;return i<e.length&&a.push(e.slice(i)),a}function q({text:e,className:t}){let s=e.trim().replace(/([.!?])\s+\*\s+(?=\*\*|\w)/g,"$1\n* ").replace(/\s+\*\s+(?=\*\*)/g,"\n* ").split("\n").map(e=>e.trim()).filter(Boolean),a=[],n=[],i=0,l=()=>{0!==n.length&&(a.push((0,r.jsx)("ul",{className:"my-1.5 list-disc space-y-1 pl-4 marker:text-muted-foreground",children:n.map((e,t)=>(0,r.jsx)("li",{className:"leading-relaxed",children:V(e.replace(/^[*-]\s+/,""),`li-${i}-${t}`)},t))},`ul-${i}`)),i+=1,n=[])};for(let e of s){let t=e.match(/^[*-]\s+(.*)/);if(t){n.push(t[1]);continue}l(),a.push((0,r.jsx)("p",{className:"my-1 first:mt-0 last:mb-0 leading-relaxed",children:V(e,`p-${i}`)},`p-${i}`)),i+=1}return(l(),0===a.length)?(0,r.jsx)("p",{className:t,children:e}):(0,r.jsx)("div",{className:t,children:a})}var Y=s(44500),J=s(89239),K=s(42763);let G={broken:"Assistant is broken",wrong_answer:"Assistant gave a wrong answer",tech:"Technical problem on the site",other:"Something else"};async function Z(e){let t=e.turns.filter(e=>"string"==typeof e?.content&&e.content.trim()).map(e=>({role:e.role,content:e.content.trim()}));try{var s,r,a;let n,i,l=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:(s=e.reason,(i=(n=t.find(e=>"user"===e.role)?.content?.trim())?n.replace(/\s+/g," ").slice(0,90):"")?`${G[s]}: ${i}`:G[s]),message:(r=e.reason,a=e.note,["Reported from the AI assistant.",`Reason: ${G[r]}`,a.trim()?`
2What the customer said:
3${a.trim()}`:"",`
4Conversation (${t.length} turn${1===t.length?"":"s"}) is attached to this ticket.`].filter(Boolean).join("\n").slice(0,8e3)),transcript:t,pagePath:e.pagePath??window.location.pathname})});if(401===l.status)return{ok:!1,requiresAuth:!0};let o=await l.json().catch(()=>({}));if(!l.ok)return{ok:!1,requiresAuth:!1,error:String(o.error||`Could not file the report (${l.status})`)};let c=o.ticket??o;return{ok:!0,reference:String(c?.reference??""),id:String(c?.id??"")}}catch(e){return{ok:!1,requiresAuth:!1,error:e instanceof TypeError?"Could not reach the server. A browser extension or a lost connection blocked the request.":e.message||"Could not file the report"}}}let Q=[{value:"broken",label:"It is broken",hint:"Errors, nothing happens, or it stopped mid-answer"},{value:"wrong_answer",label:"Wrong answer",hint:"It said something untrue or found nothing that exists"},{value:"tech",label:"Technical problem",hint:"Something else on the site is not working"},{value:"other",label:"Something else",hint:"Anything the options above do not cover"}];function X({open:e,onOpenChange:t,turns:s}){let[n,i]=(0,a.useState)("wrong_answer"),[l,o]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),[h,x]=(0,a.useState)(null),[p,g]=(0,a.useState)(!1);async function f(){d(!0),x(null),g(!1);let e=await Z({reason:n,note:l,turns:s});(d(!1),!1===e.ok&&!0===e.requiresAuth)?g(!0):!1===e.ok&&!0!==e.requiresAuth?x(e.error):m({reference:e.reference})}function b(e){t(e),e||setTimeout(()=>{m(null),x(null),g(!1),o("")},200)}let j=s.filter(e=>"user"===e.role).length;return(0,r.jsx)(K.Dialog,{open:e,onOpenChange:b,children:(0,r.jsx)(K.DialogContent,{className:"sm:max-w-md",children:u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(K.DialogHeader,{children:[(0,r.jsxs)(K.DialogTitle,{className:"flex items-center gap-2 text-base",children:[(0,r.jsx)(v.A,{className:"h-4 w-4 text-success"})," Report sent"]}),(0,r.jsx)(K.DialogDescription,{children:u.reference?(0,r.jsxs)(r.Fragment,{children:["Your reference is ",(0,r.jsx)("span",{className:"font-mono text-foreground",children:u.reference}),". The conversation is attached, so there is nothing else to describe."]}):(0,r.jsx)(r.Fragment,{children:"The conversation is attached, so there is nothing else to describe."})})]}),(0,r.jsx)(K.DialogFooter,{children:(0,r.jsx)(J.$,{onClick:()=>b(!1),children:"Done"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(K.DialogHeader,{children:[(0,r.jsxs)(K.DialogTitle,{className:"flex items-center gap-2 text-base",children:[(0,r.jsx)(k.A,{className:"h-4 w-4"})," Report this conversation"]}),(0,r.jsxs)(K.DialogDescription,{children:["The whole conversation goes with it, so you do not have to explain what happened.",j>0&&(0,r.jsxs)(r.Fragment,{children:[" ",j," question",1===j?"":"s"," will be attached."]})]})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"grid gap-1.5",children:Q.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>i(e.value),className:(0,z.cn)("rounded-md border px-3 py-2 text-left transition-colors",n===e.value?"border-brand bg-brand/5":"border-border hover:bg-muted/40"),"aria-pressed":n===e.value,children:[(0,r.jsx)("div",{className:"text-sm font-medium text-foreground",children:e.label}),(0,r.jsx)("div",{className:"text-[11px] text-muted-foreground",children:e.hint})]},e.value))}
4),(0,r.jsx)("textarea",{value:l,onChange:e=>o(e.target.value.slice(0,2e3)),placeholder:"Anything to add? Optional.",rows:3,className:"w-full resize-none rounded-md border border-input bg-background px-3 py-2 text-sm outline-none focus-visible:ring-1 focus-visible:ring-ring"}),p&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Reports are attached to your account so we can reply."," ",(0,r.jsx)("a",{href:"/login",className:"font-medium text-brand underline",children:"Sign in"})," to send this one."]}),h&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:h})]}),(0,r.jsxs)(K.DialogFooter,{children:[(0,r.jsx)(J.$,{variant:"ghost",onClick:()=>b(!1),children:"Cancel"}),(0,r.jsx)(J.$,{onClick:()=>void f(),disabled:c,children:c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"})," Sending"]}):"Send report"})]})]})})})}var ee=s(31528);let et="sh.search-assistant.session",es="sh.search-assistant.web-search",er="sh.search-assistant.transcript",ea=["sh.search-assistant.transcript.search","sh.search-assistant.transcript.support"],en={Startup:u.A,Investor:m.A,Person:h.A,Job:x.A,MCPServer:p.A,Post:g.A,Email:f.A,Discovery:b.A},ei={role:"assistant",content:"What are you looking for? I can search startups, investors, and jobs; check AI trends; help you publish an article on StartupHub (paste your draft here and I'll walk you through images, categories, tags, and editorial vs newswire tiers); find emails; scan tech stacks; and more."},el=["I want to publish on StartupHub","What is trending in AI right now?","Find startups using SGLang","Find startups using Klaviyo","Find startups using Decagon","Find stealth-mode companies","Which investors back agentic AI","Find email of CEO at stripe.com","Scan tech stack for vercel.com","Agent readiness score for anthropic.com","Remote AI engineering jobs","Find MCP servers for Next.js","Cyber security startups with growing headcount","Y Combinator AI startups from 2025","B2B SaaS startups in fintech","Compare Stripe vs Ramp tech stack","Find jobs at AI startups","Open source AI infrastructure companies","Enterprise AI startups in healthcare","Recent Series A AI startups","Find people working at Anthropic","Monitor changes for openai.com"];function eo({step:e}){var t;let s="done"===e.status;return(0,r.jsxs)("div",{className:"flex items-center gap-2 py-0.5 font-mono text-[11px] leading-none text-muted-foreground",children:[s?(0,r.jsx)(v.A,{className:"h-3 w-3 shrink-0 text-success","aria-hidden":!0}):(0,r.jsx)(Y.KV,{state:(t=e.tool,/^(search|find|list)_/.test(t)?"searching":/^(scan|validate|discover|get)_/.test(t)?"connecting":/deep_intel|matches|monitor/.test(t)?"solving":"working"),size:20,className:"-my-1 shrink-0","aria-label":e.label||"Working"}),(0,r.jsx)("span",{className:(0,z.cn)(s&&"text-foreground/70"),children:e.label})]})}function ec({card:e,onNavigate:t}){let s=en[e.type]||u.A,n="Email"===e.type,l="Discovery"===e.type,o=!!e.checkoutUrl,d=e.checkoutUrl||e.href,m=o||l||/^https?:\/\//i.test(d),[h,x]=(0,a.useState)(!1),[p,g]=(0,a.useState)(!1),b=!!(e.description||e.facts?.length),N=async()=>{if(n)try{await navigator.clipboard.writeText(e.name),g(!0),setTimeout(()=>g(!1),2e3)}catch{}};return n?e.emailVerdict?(0,r.jsxs)("div",{children:[(0,r.jsx)(ee.v,{compact:!0,result:{email:e.emailVerdict.email||e.name,valid:e.emailVerdict.valid,reason:"",status:e.emailVerdict.status,confidence_score:e.emailVerdict.confidence_score},copied:p?"singleEmail":null,onCopy:()=>void N()}),e.href?(0,r.jsxs)(i(),{href:e.href,onClick:t,className:"mt-1.5 inline-flex items-center gap-1 text-[10px] font-medium text-primary hover:underline",children:["Open email tools",(0,r.jsx)(j.A,{className:"h-3 w-3"})]}):null]}):(0,r.jsxs)("div",{className:"rounded-md border border-brand/30 bg-brand/5 px-2.5 py-2.5",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-brand/25 bg-brand/10",children:(0,r.jsx)(f.A,{className:"h-4 w-4 text-brand","aria-hidden":!0})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-mono text-[13px] font-medium text-foreground break-all",children:e.name}),e.excerpt?(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:e.excerpt}):null,e.meta?(0,r.jsx)("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:e.meta}):null]}),(0,r.jsxs)(c.$n,{type:"button",variant:"outline",size:"sm",className:"h-7 shrink-0 px-2 text-[10px]",onClick:()=>void N(),children:[p?(0,r.jsx)(v.A,{className:"h-3 w-3"}):(0,r.jsx)(y.A,{className:"h-3 w-3"}),p?"Copied":"Copy"]})]}),e.href?(0,r.jsxs)(i(),{href:e.href,onClick:t,className:"mt-2 inline-flex items-center gap-1 text-[10px] font-medium text-primary hover:underline",children:["Open email tools",(0,r.jsx)(j.A,{className:"h-3 w-3"})]}):null]}):(0,r.jsxs)("div",{className:"rounded-md border border-border/80 bg-card/60 overflow-hidden",children:[(0,r.jsxs)("div",{className:"group flex items-center gap-2.5 px-2.5 py-2 transition-colors hover:bg-accent/50",children:[(0,r.jsxs)(i(),{href:d,onClick:t,target:m?"_blank":void 0,rel:o?"sponsored nofollow noopener noreferrer":m?"nofollow noopener noreferrer":void 0,className:"flex min-w-0 flex-1 items-center gap-2.5",children:[e.logoUrl?(0,r.jsx)("img",{src:e.logoUrl,alt:"",className:"h-7 w-7 shrink-0 rounded border border-border object-cover"}):(0,r.jsx)("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded border border-border bg-muted/50",children:(0,r.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate text-[13px] font-medium text-foreground",children:e.name}),(0,r.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:e.actionLabel||e.meta||e.excerpt||e.type})]})]}),b&&(0,r.jsx)("button",{type:"button",onClick:()=>x(e=>!e),"aria-expanded":h,"aria-label":h?`Hide details for ${e.name}`:`Show details for ${e.name}`,className:"shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",children:(0,r.jsx)(w.A,{className:(0,z.cn)("h-3.5 w-3.5 transition-transform",h&&"rotate-180")}
4)}),(0,r.jsx)(j.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"})]}),b&&h&&(0,r.jsxs)("div",{className:"border-t border-border/60 bg-muted/20 px-2.5 py-2",children:[e.description&&(0,r.jsx)("p",{className:"mb-2 text-[11px] leading-relaxed text-muted-foreground",children:e.description}),e.facts?.length?(0,r.jsx)("dl",{className:"grid grid-cols-2 gap-x-3 gap-y-1",children:e.facts.map(e=>(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("dt",{className:"text-[9px] uppercase tracking-wide text-muted-foreground/70",children:e.label}),(0,r.jsx)("dd",{className:"truncate text-[11px] font-medium text-foreground",title:e.value,children:e.value})]},e.label))}):null,(0,r.jsxs)(i(),{href:d,onClick:t,className:"mt-2 inline-flex items-center gap-1 text-[10px] font-medium text-primary hover:underline",children:["View full profile",(0,r.jsx)(j.A,{className:"h-3 w-3"})]})]}),e.previewHtml&&"Post"===e.type&&(0,r.jsx)("div",{className:"border-t border-border/60 px-2.5 py-2 text-[11px] leading-relaxed text-muted-foreground max-h-32 overflow-y-auto prose prose-sm dark:prose-invert prose-p:my-1 prose-a:text-primary",dangerouslySetInnerHTML:{__html:e.previewHtml.slice(0,2e3)}})]})}let ed={role:"assistant",content:"What do you need help with? Ask me anything about your account, billing, profiles, listings, or the directory. If something is broken, tell me what happened and I can pass the whole conversation to the team with the flag button above."},eu=["Something on the site is broken","How do I claim my company profile?","A question about my billing","How do I submit a startup?","How do I remove my profile?"];function em({open:e,onOpenChange:t,initialQuery:s,pageContext:n,mode:i="search"}){let u="support"===i,{user:m,openAuthModal:h}=(0,l.As)(),[x,p]=(0,a.useState)([u?ed:ei]),[g,f]=(0,a.useState)(""),[j,w]=(0,a.useState)(!1),[O,U]=(0,a.useState)(12),[L,P]=(0,a.useState)(null),[W,V]=(0,a.useState)(!1),J=function(e){let[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(!1),[i,l]=(0,a.useState)(""),[o,c]=(0,a.useState)(null),d=(0,a.useRef)(null),u=(0,a.useRef)(e);u.current=e,(0,a.useEffect)(()=>{s(!!M())},[]);let m=(0,a.useCallback)(()=>{try{d.current?.stop()}catch{}n(!1),l("")},[]),h=(0,a.useCallback)(()=>{let e=M();if(!e)return void c("Dictation is not supported in this browser.");if(d.current)try{d.current.abort()}catch{}let t=new e;t.lang="u">typeof navigator&&navigator.language||"en-US",t.continuous=!0,t.interimResults=!0,t.onresult=e=>{let t="";for(let s=e.resultIndex;s<e.results.length;s++){let r=e.results[s],a=r[0]?.transcript??"";r.isFinal?u.current(a):t+=a}l(t)},t.onerror=e=>{let t=e?.error??"";"no-speech"!==t&&"aborted"!==t&&(c("not-allowed"===t?"Microphone access was blocked. Allow it in your browser settings.":"Dictation stopped unexpectedly."),n(!1),l(""))},t.onend=()=>{n(!1),l("")},d.current=t,c(null);try{t.start(),n(!0)}catch{c("Could not start dictation."),n(!1)}},[]),x=(0,a.useCallback)(()=>{r?m():h()},[r,h,m]);return(0,a.useEffect)(()=>()=>{try{d.current?.abort()}catch{}},[]),{supported:t,listening:r,interim:i,error:o,start:h,stop:m,toggle:x}}((0,a.useCallback)(e=>{let t=e.trim();t&&f(e=>(e&&!/\s$/.test(e)?`${e} ${t}`:`${e}${t}`).slice(0,25e3))},[])),[K,G]=(0,a.useState)([]),[Z,Q]=(0,a.useState)(null),ee=(0,a.useRef)(null),en=(0,a.useCallback)(async e=>{let t=Array.from(e);if(!t.length)return;Q(null);let s=t.filter(_),r=t.length-s.length;G(e=>(e.length>=4&&Q("You can attach up to 4 images."),e));let a=4-K.length;if(a<=0)return void Q("You can attach up to 4 images.");let n=[],i=0;for(let e of s.slice(0,a)){let t=await B(e);t?n.push(t):i++}n.length&&G(e=>[...e,...n].slice(0,4));let l=[];r&&l.push(`${r} file${1===r?"":"s"} skipped (images only)`),i&&l.push(`${i} image${1===i?"":"s"} too large even after resizing`),s.length>a&&l.push(`only the first ${a} added (max 4)`),l.length&&Q(l.join("; ")+".")},[K.length]),em=(0,a.useCallback)(e=>{G(t=>{let s=t.find(t=>t.id===e);if(s)try{URL.revokeObjectURL(s.previewUrl)}catch{}return t.filter(t=>t.id!==e)}),Q(null)},[]),eh=(0,a.useCallback)(()=>{G(e=>{for(let t of e)try{URL.revokeObjectURL(t.previewUrl)}catch{}return[]}),Q(null)},[]),[ex,ep]=(0,a.useState)([]),[eg,ef]=(0,a.useState)(!1),[eb,ev]=(0,a.useState)(null),[ej,ey]=(0,a.useState)(!1),[ew,eN]=(0,a.useState)(!1),ek=(0,a.useRef)(null),eS=(0,a.useRef)(null),eA=(0,a.useRef)(!1),eC=x.filter(e=>"user"===e.role).length,e$=eC>=12,eI=(0,a.useCallback)(()=>x.filter((e,t)=>
4"user"===e.role||"assistant"===e.role&&t>0).map(e=>`${"user"===e.role?"You":"Assistant"}: ${e.content}`).join("\n\n"),[x]),eD=(0,a.useCallback)(async()=>{let e=eI();if(e.trim())try{await navigator.clipboard.writeText(e),ey(!0),setTimeout(()=>ey(!1),2e3)}catch{}},[eI]),eT=(0,a.useCallback)(async(e,t)=>{t&&(eA.current=!0,p(e=>[...e,t])),w(!0),ep([]);let s={messages:e,sessionId:L};(n?.path||n?.url||n?.title||n?.searchFilters)&&(s.pageContext=n),m&&ew&&(s.webSearchEnabled=!0);let r="",a=[],i=[],l="anthropic/claude-haiku-4.5";try{let e=await fetch("/api/search/assistant/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!e.ok||!e.body)throw Error("stream unavailable");let t=e.body.getReader(),n=new TextDecoder,o="";for(;;){let{done:e,value:s}=await t.read();if(e)break;o+=n.decode(s,{stream:!0});let{events:c,rest:d}=function(e){let t=[],s=e.split("\n\n"),r=s.pop()||"";for(let e of s){let s=e.trim();if(s.startsWith("data:"))try{t.push(JSON.parse(s.slice(5).trim()))}catch{}}return{events:t,rest:r}}(o);for(let e of(o=d,c))if("step"===e.type)ep(t=>{let s=t.findIndex(t=>t.tool===e.step.tool&&"running"===t.status);if(s>=0){let r=[...t];return r[s]=e.step,r}return[...t,e.step]});else if("reply"===e.type)r=e.text;else if("cards"===e.type)a=e.cards;else if("filters"===e.type)e.applyLive&&(0,H.fw)(e.patch);else if("done"===e.type){if(e.sessionId){P(e.sessionId);try{localStorage.setItem(et,e.sessionId)}catch{}}U(e.remaining),l=e.model,i=e.toolSteps,ev(e.model)}else"error"===e.type&&(r=e.message)}}catch{try{let e=await fetch("/api/search/assistant",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),t=await e.json();if(r=t.reply||"Try rephrasing or use /search.",a=Array.isArray(t.cards)?t.cards:[],i=Array.isArray(t.toolSteps)?t.toolSteps:[],t.sessionId){P(t.sessionId);try{localStorage.setItem(et,t.sessionId)}catch{}}"number"==typeof t.remaining&&U(t.remaining),t.model&&ev(t.model)}catch{r="Connection issue. Try again or use /search directly."}}p(e=>[...e,{role:"assistant",content:r||"Done.",cards:a,toolSteps:i,model:l}]),ep([]),w(!1)},[L,m,ew,n]),eE=(0,a.useCallback)(async(e,t)=>{let s=x[e-1],r=x[e];if(r&&"assistant"===r.role){p(s=>s.map((s,r)=>r===e?{...s,feedback:t}:s));try{await fetch("/api/search/assistant/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:t,sessionId:L,userMessage:s?.role==="user"?s.content:void 0,assistantReply:r.content,model:r.model})})}catch{}}},[x,L]),eR=(0,a.useCallback)(async()=>{if(j||e$)return;let e=x.map((e,t)=>({t:e,i:t})).filter(({t:e})=>"user"===e.role).pop()?.i;if(void 0===e)return;let t=x[e];p(t=>t.slice(0,e));let s=[...x.slice(0,e).filter((e,t)=>"user"===e.role||"assistant"===e.role&&t>0).map(({role:e,content:t})=>({role:e,content:t}))];await eT(s,{role:"user",content:t.content})},[j,e$,x,eT]),ez=(0,a.useCallback)((e,t)=>{eA.current=t.some(e=>"user"===e.role);let s=t.map(e=>({role:e.role,content:e.content,cards:e.cards??void 0,toolSteps:e.toolSteps??void 0}));p(s.length?s:[u?ed:ei]),P(e),ep([]),ev(null);try{localStorage.setItem(et,e)}catch{}eS.current?.focus()},[u]),eO=(0,a.useCallback)(async e=>{try{let t=await fetch(`/api/search/assistant/sessions/${e}`);if(!t.ok)return!1;let s=await t.json();if(!Array.isArray(s.messages)||!s.session?.id)return!1;return ez(s.session.id,s.messages),!0}catch{return!1}},[ez]),eU=(0,a.useCallback)(()=>{eA.current=!1,V(!1),eh(),p([u?ed:ei]),P(null),f(""),U(12),ep([]),ev(null);try{for(let e of(sessionStorage.removeItem(er),ea))sessionStorage.removeItem(e)}catch{}try{localStorage.removeItem(et)}catch{}eS.current?.focus()},[u,eh]);(0,a.useEffect)(()=>{m||eN(!1)},[m]),(0,a.useEffect)(()=>{ek.current&&(ek.current.scrollTop=ek.current.scrollHeight)},[x,j,ex]),(0,a.useEffect)(()=>{if(!e)return;try{let e=localStorage.getItem(es);"1"===e&&eN(!0)}catch{}if(s?.trim()){eU(),f(s.trim()),setTimeout(()=>eS.current?.focus(),150);return}if(eA.current)return void setTimeout(()=>eS.current?.focus(),150);let t=function(){for(let e of[er,...ea])try{let t=sessionStorage.getItem(e);if(!t)continue;let s=JSON.parse(t);if(1!==s.version||!Array.isArray(s.turns))continue;return{version:1,sessionId:s.sessionId??null,remaining:s.remaining??12,turns:s.turns,activeModel:s.activeModel??null}}catch{continue}return null}(),r=t?.turns.some(e=>"user"===e.role);if(t&&r){eA.current=!0,p(t.turns),P(t.sessionId),U(t.remaining??12),ev(t.activeModel),f(""),ep([]),setTimeout(()=>eS.current?.focus(),150);return}let a=null;try{a=localStorage.getItem(et)}catch{}a&&eO(a).then(e=>{e||r||p([u?ed:ei])}),setTimeout(()=>eS.current?.focus(),150)},[e,s,u,eU,eO]),(0,a.useEffect)(()=>
4{if(x.some(e=>"user"===e.role)||L){var e={version:1,sessionId:L,remaining:O,turns:x.map(({imagePreviews:e,...t})=>t),activeModel:eb};try{for(let t of(sessionStorage.setItem(er,JSON.stringify(e)),ea))sessionStorage.removeItem(t)}catch{}}},[x,L,O,eb]);let eL=(0,a.useCallback)(async e=>{let t=e.trim(),s=K.length>0;if(!t&&!s||t.length>25e3||j||e$)return;let r=t||"Read this image and tell me what is in it.",a=K.map(e=>({mimeType:e.mimeType,data:e.data})),n=[...x.filter((e,t)=>"user"===e.role||"assistant"===e.role&&t>0).map(({role:e,content:t})=>({role:e,content:t})),s?{role:"user",content:r,images:a}:{role:"user",content:r}];f("");let i=K.map(e=>e.previewUrl);G([]),Q(null),await eT(n,{role:"user",content:r,...i.length?{imagePreviews:i}:{}})},[j,x,e$,eT,K]),eF=(0,a.useCallback)(async()=>{await eL(g)},[g,eL]),eM=(0,a.useCallback)(e=>{if(!m)return void h({subtitle:"Sign in to search the live web from chat."});eN(e);try{localStorage.setItem(es,e?"1":"0")}catch{}},[m,h]),eP="affiliate-redirect"===eb?"Sponsored partners":eb?.includes("sonnet")?"Deep search":"Fast search";return(0,r.jsxs)(o.cj,{open:e,onOpenChange:t,children:[(0,r.jsxs)(o.h,{side:"right",showCloseButton:!1,className:"flex w-full flex-col gap-0 border-l border-border bg-background p-0 sm:max-w-xl",children:[(0,r.jsxs)(o.Fm,{className:"shrink-0 space-y-0 border-b border-border bg-muted/20 px-4 py-3 text-left",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-brand/25 bg-brand/10 shadow-sm",children:(0,r.jsx)(N.A,{className:"h-4 w-4 text-brand"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)(o.qp,{className:"text-sm font-semibold tracking-tight",children:"Ask StartupHub"}),(0,r.jsxs)(o.Qs,{className:"text-[11px] text-muted-foreground",children:["Directory search in plain language",O<12&&(0,r.jsxs)("span",{className:"text-foreground/60",children:[" \xb7 ",O," left today"]})]})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Copy conversation",onClick:()=>void eD(),children:ej?(0,r.jsx)(v.A,{className:"h-3.5 w-3.5 text-success"}):(0,r.jsx)(y.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Report this conversation",title:"Report this conversation",onClick:()=>ef(!0),children:(0,r.jsx)(k.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon",className:(0,z.cn)("h-7 w-7",W&&"bg-muted text-foreground"),"aria-label":"Your conversations",title:"Your conversations","aria-pressed":W,onClick:()=>V(e=>!e),children:(0,r.jsx)(S.A,{className:"h-3.5 w-3.5"})}),(0,r.jsxs)(c.$n,{type:"button",variant:"outline",size:"sm",className:"h-7 shrink-0 gap-1 rounded-md px-2 text-[11px] font-medium",onClick:()=>{eU()},children:[(0,r.jsx)(A.A,{className:"h-3 w-3"}),"New chat"]}),(0,r.jsx)(o.kN,{asChild:!0,children:(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Close assistant",children:(0,r.jsx)(C.A,{className:"h-3.5 w-3.5"})})})]})]}),eb&&(0,r.jsx)(c.Ex,{variant:"secondary",className:"mt-2.5 h-5 rounded-md px-1.5 text-[10px] font-normal",children:eP}),!m&&(0,r.jsxs)("p",{className:"mt-2 text-[11px] text-muted-foreground",children:["Fast search."," ",(0,r.jsx)("button",{type:"button",className:"font-medium text-foreground underline-offset-2 hover:underline",onClick:()=>h({subtitle:"Sign in for Deep search: comparisons, matching, and longer chats."}),children:"Sign in"})," ","for Deep search, web lookup, and a higher daily cap."]})]}),(0,r.jsx)(F,{open:W,onRestore:ez,onClose:()=>V(!1)}),(0,r.jsx)("div",{ref:ek,className:(0,z.cn)("flex-1 overflow-y-auto px-4 py-4",W&&"hidden"),children:(0,r.jsxs)("div",{className:"mx-auto max-w-none space-y-5",children:[n?.title&&0===eC&&!j?(0,r.jsxs)("p",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-[12px] leading-relaxed text-muted-foreground",children:["Asking about ",(0,r.jsx)("span",{className:"font-medium text-foreground",children:n.title})]}):null,x.map((e,s)=>{let a="assistant"===e.role&&s>0&&!x.slice(s+1).some(e=>"assistant"===e.role);return(0,r.jsx)("div",{className:(0,z.cn)("flex flex-col gap-2","user"===e.role?"items-end":"items-stretch"),children:"user"===e.role?(0,r.jsxs)("div",{className:"max-w-[88%] rounded-lg border border-border bg-muted/40 px-3 py-2 text-[13px] leading-relaxed text-foreground shadow-sm",children:[e.imagePreviews?.length?(0,r.jsx)("div",{className:"mb-2 flex flex-wrap gap-1.5",children:e.imagePreviews.map((e,t)=>(0,r.jsx)("img",{src:e,alt:`Attached image ${t+1}`,className:"h-16 w-16 rounded border border-border object-cover"},e))}):null,e.content]}
4):(0,r.jsxs)("div",{className:"space-y-2.5",children:[s>0&&(0,r.jsx)(q,{text:e.content,className:"text-[13px] text-foreground/90"}),0===s&&(0,r.jsx)(q,{text:e.content,className:"text-[13px] text-muted-foreground"}),e.toolSteps&&e.toolSteps.length>0&&(0,r.jsx)("div",{className:"rounded-md border border-border/60 bg-muted/20 px-2.5 py-2",children:e.toolSteps.map((e,t)=>(0,r.jsx)(eo,{step:e},`${e.tool}-${t}`))}),e.cards&&e.cards.length>0&&(0,r.jsx)("div",{className:"space-y-1.5",children:e.cards.map(e=>(0,r.jsx)(ec,{card:e,onNavigate:()=>t(!1)},e.href))}),s>0&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1 pt-0.5",children:[a&&(0,r.jsxs)(c.$n,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-[11px] text-muted-foreground",disabled:j,onClick:()=>void eR(),children:[(0,r.jsx)($.A,{className:"h-3 w-3"}),"Try again"]}),(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon",className:(0,z.cn)("h-7 w-7",1===e.feedback&&"text-success"),"aria-label":"Good response",onClick:()=>void eE(s,1),children:(0,r.jsx)(I.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(c.$n,{type:"button",variant:"ghost",size:"icon",className:(0,z.cn)("h-7 w-7",-1===e.feedback&&"text-destructive"),"aria-label":"Bad response",onClick:()=>void eE(s,-1),children:(0,r.jsx)(D.A,{className:"h-3.5 w-3.5"})})]})]})},`${e.role}-${s}`)}),j&&(0,r.jsx)("div",{className:"space-y-2 border-t border-border/50 pt-3",children:ex.length>0?(0,r.jsx)("div",{className:"rounded-md border border-border/60 bg-muted/20 px-2.5 py-2",children:ex.map((e,t)=>(0,r.jsx)(eo,{step:e,live:!0},`live-${e.tool}-${t}`))}):(0,r.jsxs)("div",{className:"flex items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,r.jsx)(Y.KV,{state:"working",size:20,"aria-label":"Planning next steps"}),"Planning next steps"]})})]})}),(0,r.jsxs)("div",{className:(0,z.cn)("shrink-0 border-t border-border bg-muted/10 p-3 backdrop-blur-sm",W&&"hidden"),children:[0===eC&&!j&&!e$&&(0,r.jsxs)("div",{className:"mb-2.5 -mx-1",children:[(0,r.jsx)("p",{className:"mb-1.5 px-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Try a search"}),(0,r.jsx)("div",{className:"flex gap-2 overflow-x-auto px-1 pb-0.5 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",role:"list","aria-label":"Suggested searches",children:(u?eu:el).map(e=>(0,r.jsx)(c.$n,{type:"button",variant:"outline",size:"sm",role:"listitem",className:"h-7 shrink-0 rounded-full border-border/80 bg-card px-3 text-[11px] font-normal text-foreground hover:bg-accent/60",onClick:()=>void eL(e),children:e},e))})]}),(K.length>0||Z)&&(0,r.jsxs)("div",{className:"mb-2 space-y-1.5",children:[K.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map(e=>(0,r.jsxs)("div",{className:"group relative h-14 w-14 overflow-hidden rounded-md border border-border bg-muted",children:[(0,r.jsx)("img",{src:e.previewUrl,alt:e.name,className:"h-full w-full object-cover"}),(0,r.jsx)("button",{type:"button",onClick:()=>em(e.id),"aria-label":`Remove ${e.name}`,className:"absolute right-0.5 top-0.5 rounded-full bg-background/90 p-0.5 text-foreground opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100",children:(0,r.jsx)(C.A,{className:"h-3 w-3"})})]},e.id))}),Z&&(0,r.jsx)("p",{className:"text-[11px] text-destructive",role:"alert",children:Z})]}),(0,r.jsx)("input",{ref:ee,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&en(e.target.files),e.target.value=""}}),(0,r.jsxs)("form",{className:"relative rounded-xl border border-border bg-card shadow-sm focus-within:ring-1 focus-within:ring-brand/30",onSubmit:e=>{e.preventDefault(),eF()},onDragOver:e=>{e.dataTransfer.types.includes("Files")&&e.preventDefault()},onDrop:e=>{e.dataTransfer.files?.length&&(e.preventDefault(),en(e.dataTransfer.files))},children:[(0,r.jsx)("textarea",{ref:eS,value:g,onChange:e=>f(e.target.value.slice(0,25e3)),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eF())},onPaste:e=>{let t=Array.from(e.clipboardData?.files??[]);t.length&&(e.preventDefault(),en(t))},rows:2,placeholder:e$?"Daily limit reached. Try /search":"Ask anything about startups, investors, jobs...",disabled:j||e$,className:"block w-full resize-none bg-transparent px-3 py-2.5 pr-12 pb-10 text-[13px] leading-relaxed text-foreground placeholder:text-muted-foreground focus:outline-none disabled:opacity-50"}),(J.interim||J.error)&&(0,r.jsx)("p",{className:(0,z.cn)("px-3 pb-1 text-[11px] italic",J.error?"text-destructive not-italic":"text-muted-foreground"),"aria-live":"polite",children:J.error||J.interim}),(0,r.jsxs)("div",{className:"absolute bottom-2 left-2 flex items-center gap-1.5",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>ee.current?.click(),disabled:j||e$||K.length>=4,"aria-label":"Attach an image",title:K.length>
4=4?"Up to 4 images":"Attach an image (or paste / drop one)",className:"flex items-center gap-1.5 rounded-md border border-border bg-card px-2 py-1 text-[10px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:[(0,r.jsx)(T.A,{className:"h-3 w-3"}),"Image"]}),J.supported&&(0,r.jsx)("button",{type:"button",onClick:J.toggle,disabled:j||e$,"aria-pressed":J.listening,"aria-label":J.listening?"Stop dictation":"Dictate your message",title:J.listening?"Stop dictation":"Dictate your message",className:(0,z.cn)("flex items-center gap-1.5 rounded-md border px-2 py-1 text-[10px] font-medium transition-colors disabled:opacity-50",J.listening?"border-destructive/40 bg-destructive/10 text-destructive":"border-border bg-card text-muted-foreground hover:text-foreground"),children:J.listening?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:"relative flex h-2 w-2","aria-hidden":"true",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-destructive opacity-70"}),(0,r.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-destructive"})]}),"Listening"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.A,{className:"h-3 w-3"}),"Dictate"]})}),(0,r.jsxs)("button",{type:"button",onClick:()=>eM(!ew),className:(0,z.cn)("flex items-center gap-1.5 rounded-md border px-2 py-1 text-[10px] font-medium transition-colors",ew&&m?"border-brand/40 bg-brand/10 text-brand":"border-border bg-muted/30 text-muted-foreground hover:bg-muted/50"),"aria-pressed":ew&&!!m,"aria-label":"Toggle web search",children:[(0,r.jsx)(b.A,{className:"h-3 w-3"}),"Web"]}),(0,r.jsx)(d.d,{checked:ew&&!!m,onCheckedChange:eM,"aria-label":"Enable web search",className:"scale-75 data-[state=checked]:bg-brand"})]}),(0,r.jsx)(c.$n,{type:"submit",size:"icon",disabled:j||!g.trim()&&0===K.length||e$,"aria-label":"Send",className:(0,z.cn)("absolute bottom-2 right-2 h-8 w-8 rounded-lg",!g.trim()||j||e$?"bg-muted text-muted-foreground":"bg-brand text-brand-foreground hover:bg-brand/90"),children:(0,r.jsx)(R.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("p",{className:"mt-1.5 text-center font-mono text-[10px] text-muted-foreground",children:[g.length>5e3?`${g.length.toLocaleString()} chars`:`${25e3-g.length} chars`," \xb7 Enter to send \xb7 Shift+Enter for newline",m?"":" \xb7 Sign in for Deep search"]})]})]}),(0,r.jsx)(X,{open:eg,onOpenChange:ef,turns:x.map(e=>({role:e.role,content:e.content}))})]})}},31528:(e,t,s)=>{s.d(t,{v:()=>f});var r=s(95155);s(12115);var a=s(66959),n=s(94514),i=s(33210),l=s(94961),o=s(67635),c=s(439),d=s(66669),u=s(92289),m=s(40980);let h={deliverable:"Deliverable",not_deliverable:"Not deliverable",unknown:"Can't verify"},x={deliverable:"This mailbox exists and accepts mail. Safe to send to.",not_deliverable:"This mailbox does not exist. Sending will bounce, remove from your list.",unknown:"The receiving mailserver did not reveal whether the mailbox exists (typically a catch-all domain). Treat with caution; a send may reach the target or be silently dropped."};function p({status:e,size:t=40}){return"deliverable"===e?(0,r.jsx)(n.A,{size:t,className:"text-success",strokeWidth:3}):"not_deliverable"===e?(0,r.jsx)(i.A,{size:t,className:"text-destructive",strokeWidth:3}):(0,r.jsx)(l.A,{size:t,className:"text-warning",strokeWidth:2.5})}function g({pct:e,stroke:t,bg:s,size:a=36}){let n=(a-6)/2,i=2*Math.PI*n,l=Math.max(0,Math.min(100,e))/100*i,o=a/2;return(0,r.jsxs)("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:"shrink-0",children:[(0,r.jsx)("circle",{cx:o,cy:o,r:n,fill:"none",stroke:s,strokeWidth:4}),(0,r.jsx)("circle",{cx:o,cy:o,r:n,fill:"none",stroke:t,strokeWidth:4,strokeLinecap:"round",strokeDasharray:`${l} ${i}`,transform:`rotate(-90 ${o} ${o})`}),(0,r.jsx)("text",{x:o,y:o+1,textAnchor:"middle",dominantBaseline:"middle",fontSize:.32*a,fontWeight:700,className:"fill-foreground",children:Math.round(e)})]})}function f({result:e,copied:t,onCopy:s,compact:i=!1}){let l=e.status?e.status:e.valid?"deliverable":"not_deliverable",f="deliverable"===l?{text:"text-success",bg:"bg-success/10",border:"border-success/30",fill:"bg-success",badge:"success",donutStroke:"rgb(34, 197, 94)",donutBg:"rgba(34, 197, 94, 0.15)"}:"not_deliverable"===l?{text:"text-destructive",bg:"bg-destructive/10",border:"border-destructive/30",fill:"bg-destructive",badge:"destructive",donutStroke:"rgb(220, 38, 38)",donutBg:"rgba(220, 38, 38, 0.15)"}:{text:"text-warning",bg:"bg-warning/10",border:"border-warning/30",fill:"bg-warning",badge:"warning",donutStroke:"rgb(217, 119, 6)",donutBg:"rgba(217, 119, 6, 0.15)"},b=e.confidence_score,v=(e.email||"").split("@")[1]||"",j=v?`https://t2.gstatic.
4com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://${v}&size=64`:null;return(0,r.jsx)(a.Zp,{className:f.border,children:(0,r.jsxs)(a.Wu,{className:i?"p-3":"p-6 md:p-8",children:[(0,r.jsxs)("div",{className:(0,m.cn)("flex items-center md:items-start",i?"flex-row gap-3":"flex-col md:flex-row gap-6"),children:[(0,r.jsx)("div",{className:(0,m.cn)("shrink-0 rounded-full flex items-center justify-center border-2",f.bg,f.border,i?"h-12 w-12":"w-24 h-24"),children:(0,r.jsx)(p,{status:l,size:i?22:40})}),(0,r.jsxs)("div",{className:(0,m.cn)("flex-1 min-w-0 w-full",i?"text-left":"text-center md:text-left"),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Email"}),(0,r.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2 min-w-0 flex-wrap",i?"justify-start":"justify-center md:justify-start"),children:[(0,r.jsx)("span",{className:(0,m.cn)("font-mono font-semibold text-foreground truncate max-w-full break-all",i?"text-sm":"text-lg"),children:e.email}),(0,r.jsx)(a.$n,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>e.email&&s(e.email,"singleEmail"),title:"Copy email",children:"singleEmail"===t?(0,r.jsx)(n.A,{size:14,className:"text-success"}):(0,r.jsx)(o.A,{size:14,className:"text-muted-foreground"})})]}),(0,r.jsx)("div",{className:(0,m.cn)("flex items-center gap-2 flex-wrap",i?"mt-2 justify-start":"mt-3 justify-center md:justify-start"),children:(0,r.jsxs)(a.Ex,{variant:f.badge,className:"gap-1",children:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${f.fill}`}),h[l]]})})]}),(0,r.jsx)("p",{className:(0,m.cn)(f.text,i?"text-xs mt-2":"text-sm mt-4"),children:x[l]})]})]}),(0,r.jsxs)("div",{className:(0,m.cn)("grid grid-cols-3 border-t border-border",i?"gap-2 mt-3 pt-3":"gap-4 mt-6 pt-6"),children:[(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsxs)("div",{className:"text-xs text-muted-foreground uppercase tracking-wider flex items-center justify-center gap-1 mb-2",children:[(0,r.jsx)(c.A,{size:12})," Status"]}),(0,r.jsxs)(a.Ex,{variant:f.badge,className:"gap-1",children:[(0,r.jsx)("span",{className:(0,m.cn)("w-1.5 h-1.5 rounded-full",f.fill)}),h[l]]})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsxs)("div",{className:"text-xs text-muted-foreground uppercase tracking-wider flex items-center justify-center gap-1 mb-2",children:[(0,r.jsx)(d.A,{size:12})," Confidence"]}),null==b?(0,r.jsx)("span",{className:"text-sm font-semibold text-muted-foreground",children:"—"}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(g,{pct:b,stroke:f.donutStroke,bg:f.donutBg,size:i?28:36}),(0,r.jsx)("span",{className:(0,m.cn)("text-xs font-semibold",f.text),children:null==b?"—":b>=85?"High":b>=50?"Medium":"Low"})]})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsxs)("div",{className:"text-xs text-muted-foreground uppercase tracking-wider flex items-center justify-center gap-1 mb-2",children:[(0,r.jsx)(u.A,{size:12})," Domain"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[j&&(0,r.jsx)("img",{src:j,alt:"",className:"h-4 w-4 rounded-sm object-contain shrink-0",onError:e=>{e.target.style.display="none"}}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground truncate",title:v,children:v||"—"})]})]})]})]})})}}}]);

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.