PageSourceSearch

https://pitchdeck.ai/assets/AIIntelligenceChat-JK8_xGjE.js

js pitchdeck.ai collected 2026-10-05 14:52:02 UTC 6,953 bytes, 2 lines download raw bytes

1import{j as e}from"./vendor-query-CTPr7COe.js";import{r as a}from"./vendor-react-CWBOl209.js";import{B as y}from"./index-BwVwZTqu.js";import{I as V}from"./input-e78583lc.js";import{B as G}from"./badge-txOk_X55.js";import{S as P}from"./scroll-area-BvN6iRpo.js";import{u as R}from"./use-mobile-Cy5VxBTP.js";import{u as W}from"./index-B7XEVw87.js";import{m as z}from"./proxy-EGdRh4XT.js";import{a as O,bg as X,bh as Y,bi as $,X as H,i as Q,q as Z}from"./vendor-icons-3o8Kmjow.js";import{A as L}from"./index-DfawMrCs.js";import"./vendor-router-Tzw_FyRy.js";import"./vendor-helmet-CH9LKosZ.js";import"./index-BOBH645Q.js";import"./index-DCdkj2k6.js";import"./index-C8087njY.js";import"./index-TQfL9S1F.js";import"./index-BdQq_4o_.js";const U=["What strategies work best for approaching top-tier VCs?","Analyze the current seed-stage fundraising landscape for 2026","How should I prioritize my investor pipeline by fit score?","Best practices for pitch deck structure and storytelling","Top trends in family office direct investment strategies"];function ue(){const[E,j]=a.useState(!1),[p,M]=a.useState(!1),[l,x]=a.useState([]),[h,w]=a.useState(""),[c,N]=a.useState(!1),[i,d]=a.useState(""),m=a.useRef(null),v=R();a.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[l,i]);const I=async s=>{if(!s.trim()||c)return;const u={role:"user",content:s.trim()},S=[...l,u];x(S),w(""),N(!0),d("");try{const t=await fetch("https://ebjsccztajtdpbewjbet.supabase.co/functions/v1/ai-investor-chat",{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVianNjY3p0YWp0ZHBiZXdqYmV0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQxMTQ0NTgsImV4cCI6MjA3OTY5MDQ1OH0.dxe-WWf4dd0h20llGblVoIGt9BTPAJVMy_5s0D_hjEg"},body:JSON.stringify({messages:S.map(r=>({role:r.role,content:r.content})),stream:!0,use_case:"general"})});if(!t.ok){const r=await t.json().catch(()=>({}));throw t.status===429?new Error("Rate limited — please try again shortly."):t.status===402?new Error("Usage limit reached — please add credits."):new Error(r.error||`HTTP ${t.status}`)}const J=t.headers.get("X-AI-Provider")||"AI",k=t.body?.getReader();if(!k)throw new Error("No response stream");const B=new TextDecoder;let g="",o="";for(;;){const{done:r,value:D}=await k.read();if(r)break;o+=B.decode(D,{stream:!0});let b;for(;(b=o.indexOf(`
2`))!==-1;){let n=o.slice(0,b);if(o=o.slice(b+1),n.endsWith("\r")&&(n=n.slice(0,-1)),!n.startsWith("data: "))continue;const A=n.slice(6).trim();if(A==="[DONE]")break;try{const C=JSON.parse(A).choices?.[0]?.delta?.content;C&&(g+=C,d(g))}catch{}}}x(r=>[...r,{role:"assistant",content:g||"No response.",provider:J}]),d("")}catch(f){W.error(f.message||"AI error"),x(t=>[...t,{role:"assistant",content:`⚠️ ${f.message}`}]),d("")}finally{N(!1)}};if(!E)return e.jsx(z.button,{initial:{scale:.8,opacity:0}
2,animate:{scale:1,opacity:1},onClick:()=>j(!0),className:"fixed bottom-[5.25rem] md:bottom-6 right-4 md:right-6 z-40 w-12 h-12 rounded-full bg-primary text-primary-foreground shadow-lg hover:shadow-xl transition-all flex items-center justify-center group",style:{boxShadow:"var(--shadow-glow)"},"aria-label":"Open AI Assistant",children:e.jsx(O,{className:"w-5 h-5 group-hover:scale-110 transition-transform"})});const T=v?"fixed inset-0 z-50":p?"fixed inset-4 z-50":"fixed bottom-6 right-6 z-50 w-[400px] h-[560px]";return e.jsx(L,{children:e.jsxs(z.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20},className:`${T} bg-card border border-border/50 rounded-2xl shadow-2xl flex flex-col overflow-hidden`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border/50 bg-card/90 backdrop-blur-xl",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(X,{className:"w-4 h-4 text-primary"})}),e.jsx("span",{className:"font-semibold text-sm text-foreground",children:"PitchDecks AI"}),e.jsx(G,{variant:"outline",className:"text-[9px] px-1 py-0 border-primary/30 text-primary",children:"Streaming"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[!v&&e.jsx(y,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>M(!p),children:p?e.jsx(Y,{className:"w-3.5 h-3.5"}):e.jsx($,{className:"w-3.5 h-3.5"})}),e.jsx(y,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>j(!1),children:e.jsx(H,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs(P,{className:"flex-1 px-4 py-3",ref:m,children:[l.length===0&&!i&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center py-6",children:[e.jsx(O,{className:"w-8 h-8 text-primary mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm font-semibold text-foreground mb-1",children:"Investor Intelligence Assistant"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Multi-model AI cascade: NVIDIA Qwen → OpenAI → Gemini"})]}),e.jsx("div",{className:"space-y-1.5",children:U.map(s=>e.jsx("button",{onClick:()=>I(s),className:"w-full text-left text-[11px] px-3 py-2 rounded-lg border border-border/50 hover:bg-secondary/50 hover:border-primary/20 transition-colors text-muted-foreground hover:text-foreground",children:s},s))})]}),l.map((s,u)=>e.jsx("div",{className:`mb-3 ${s.role==="user"?"flex justify-end":""}`,children:e.jsxs("div",{className:`max-w-[85%] rounded-xl px-3 py-2 text-xs leading-relaxed ${s.role==="user"?"bg-primary text-primary-foreground whitespace-pre-wrap":"bg-secondary/50 text-foreground whitespace-pre-wrap"}`,children:[s.content,s.provider&&s.role==="assistant"&&e.jsxs("span",{className:"block mt-1 text-[9px] text-muted-foreground opacity-60",children:["via ",s.provider]})]})},u)),i&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"max-w-[85%] bg-secondary/50 rounded-xl px-3 py-2 text-xs leading-relaxed text-foreground whitespace-pre-wrap",children:[i,e.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-primary/70 ml-0.5 animate-pulse rounded-sm"})]})}),c&&!i&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"bg-secondary/50 rounded-xl px-3 py-3 inline-flex items-center gap-2",children:[e.jsx(Q,{className:"w-3.5 h-3.5 text-primary animate-spin"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Connecting to AI..."})]})})]}),e.jsx("div",{className:"px-4 py-3 border-t border-border/50",children:e.jsxs("form",{onSubmit:s=>{s.preventDefault(),I(h)},className:"flex gap-2",children:[e.jsx(V,{value:h,onChange:s=>w(s.target.value),placeholder:"Ask about investors, fundraising, strategy...",className:"flex-1 bg-background border-border/50 text-xs h-9",disabled:c}),e.jsx(y,{type:"submit",size:"icon",disabled:c||!h.trim(),className:"shrink-0 h-9 w-9 bg-primary text-primary-foreground",children:e.jsx(Z,{className:"w-4 h-4"})})]})})]})})}export{ue as AIIntelligenceChat};

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.