import{o as t}from"./rolldown-runtime-iuO8RvI4.js";import{rn as e}from"./vendor-all-8-CDy6IrTY.js";import{Ei as n,Mi as a,ki as s}from"./vendor-frame-CwiylG4Y.js";import{k as i,w as r}from"./vendor-all-3-CWo5e8Lw.js";var o=t(a()),l=s();function c(t){return((t=t.replace(/\*+$/,"")).match(/\*\*/g)||[]).length%2==1&&(t+="**"),t}function m(t){const e=t.split(""),n=[""];for(let a=1;a<=e.length;a++)n.push(c(e.slice(0,a).join("")));return Array.from(new Set(n))}function u({message:t,onFinish:e,makeIntermediateMessages:n=m,msPerToken:a=15,wait:s=0}){const i=(0,o.useMemo)(()=>n(t),[t,n]),[r,c]=(0,o.useState)(0),u=r>i.length-1;return(0,o.useEffect)(()=>{if(u)return void setTimeout(()=>{e?.()},s);const t=setInterval(()=>{clearInterval(t),c(t=>t+1)},a);return()=>clearInterval(t)},[i.length,r,a,e,s,u]),(0,l.jsx)(p,{children:(i[r]??i[i.length-1]).split("\n").map((t,e)=>(0,l.jsx)(d,{children:t},e))})}function p({className:t,...e}){return(0,l.jsx)("div",{...e,"aria-hidden":"true",className:n("flex-col justify-start items-start gap-1 inline-flex",t)})}function d({children:t}){return(0,l.jsx)(e,{className:"[text-wrap:pretty]",children:t})}function f({steps:t,skipAnimation:e,onAnimationComplete:n}){const[a,s]=(0,o.useState)(0),c=e?0:8,m=e?0:250,p=(0,o.useCallback)(()=>{s(t=>t+1)},[s]),d=(0,o.useCallback)(e=>{e!==a||e!==t.length-1?e===a&&e<t.length-1&&setTimeout(()=>p(),m):n?.()},[a,t,p,n,m]);return(0,l.jsx)("div",{className:"flex flex-col gap-5",children:(0,l.jsx)(i,{children:t.slice(0,a+1).map((t,n)=>"string"==typeof t.content?(0,l.jsx)("div",{role:"img",className:t.className||"text-xl font-claude-response text-text-100","aria-label":t.content.replace(/\*\*/g,""),...t.ariaAttributes,children:(0,l.jsx)(u,{message:t.content,msPerToken:c,wait:0,onFinish:()=>d(n)})},n):"function"==typeof t.content?(0,l.jsx)(r.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:e?0:.4},className:t.className,...t.ariaAttributes,children:t.content(()=>d(n))},n):(0,l.jsx)(r.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:e?0:.4},className:t.className,onAnimationComplete:()=>d(n),...t.ariaAttributes,children:t.content},n))})})}function h(t,e,n){return{content:t,className:e,ariaAttributes:n}}var x="onboarding_mcp_return_step",g="mcp_oauth_in_progress",j="onboarding_connector_index",v="onboarding_connector_title_shown";export{f as a,x as i,j as n,h as o,v as r,g as t};