import{j as e}from"./iframe-B8FSoBNY.js";import{c as f}from"./compiler-runtime-BXE7OOXE.js";import{r as u}from"./full-conversation-normalized-LUbl1coD.js";import{C as l}from"./ai-message-DLdAGhWH.js";import{M as g,g as h}from"./message-types-CEyA7Qm7.js";import{B as M}from"./index-B0y2_lLF.js";import{S as P}from"./stack-CN4X31TA.js";import"./preload-helper-PPVm8Dsz.js";import"./create-slot-recipe-context-DAhDE6G_.js";import"./factory-DAJZwK4o.js";import"./create-recipe-context-BU56IzEo.js";import"./collaborative-markdown-editor-Bj0GvTvv.js";import"./rich-text-theme-Bkhh9rAZ.js";import"./index-DaXC_qY_.js";import"./index-DpB4ozcR.js";import"./flex-DAJL4AFZ.js";import"./CodeBlockPlugin-C3OWpvP8.js";import"./index-cFwdnc0b.js";import"./textarea-rqmaWSc5.js";import"./factory-BR3bc_RM.js";import"./use-field-context-DoxKQlMm.js";import"./computed-style-C0hzrq9-.js";import"./table-BKNSzs2r.js";import"./FloatingTextFormatToolbarPlugin-B6jc8xvg.js";import"./resource-badge-Bw5UoU4J.js";import"./createLucideIcon-CcBBUKX8.js";import"./file-text-D5m8MJlG.js";import"./tooltip-DZxUoouw.js";import"./portal-CZHfPTRw.js";import"./normalize-props-D7NI5JRu.js";import"./tooltip-C_a-XGZ8.js";import"./use-presence-context-DK2PGZth.js";import"./create-split-props-u5h9OPvL.js";import"./overflow-CkG1DOya.js";import"./icon-button-DHiUe7rR.js";import"./button-C7it2n8t.js";import"./spinner-ZYH_gvW-.js";import"./index-CXwl6T4k.js";import"./x-D42ziktz.js";import"./markdown-editor-Y4eMsgVb.js";import"./LexicalHistoryPlugin.prod-BQAibkDj.js";import"./TreeViewPlugin-CyVKCrKJ.js";import"./markdown-BLUemkxK.js";import"./prompt-input-BLCttowi.js";import"./rich-message-BIkzo1SM.js";import"./ai-response-ySM6s0iN.js";import"./tool-invocation-timeline-B-cS0W6M.js";import"./trash-2-BO05slEk.js";import"./mutation-observer-CAfGweIM.js";import"./link-DE5grRtm.js";import"./diff-bubble-_zZypMRt.js";import"./diff-editor-DV9BXqbn.js";const d=u,R=t=>(t.parts??[]).some(r=>r.type==="text"&&"text"in r),j=t=>(t.parts??[]).some(r=>r.type==="reasoning"||r.type==="tool"),T=d.find(t=>t.role==="assistant"&&j(t))??d[0],W=d.find(t=>t.role==="user"&&R(t))??d[0],Tr={title:"Chat UI/Message Parts Renderer",component:g,parameters:{layout:"padded"}},x=t=>{const r=f.c(10),{message:s}=t;let a;r[0]!==s.role?(a=h(s.role),r[0]=s.role,r[1]=a):a=r[1];const o=a;let i;r[2]!==s?(i=e.jsx(g,{message:s}),r[2]=s,r[3]=i):i=r[3];let m;r[4]!==o||r[5]!==i?(m=e.jsx(l.Content,{from:o,children:i}),r[4]=o,r[5]=i,r[6]=m):m=r[6];let p;return r[7]!==o||r[8]!==m?(p=e.jsx(M,{maxW:"960px",w:"full",borderWidth:"1px",borderRadius:"md",bg:"bg",p:"md",children:e.jsx(P,{gap:"sm",children:e.jsx(l.Root,{from:o,children:m})})}),r[7]=o,r[8]=m,r[9]=p):p=r[9],p},n={render:()=>e.jsx(x,{message:T})},c={render:()=>e.jsx(x,{message:W})};n.parameters={...n.parameters,docs:{...n.parameters?.docs,source:{originalSource:`{
  render: () => <MessagePreview message={assistantMessageWithRichParts} />
}`,...n.parameters?.docs?.source}}};c.parameters={...c.parameters,docs:{...c.parameters?.docs,source:{originalSource:`{
  render: () => <MessagePreview message={userMessageWithText} />
}`,...c.parameters?.docs?.source}}};const Wr=["AssistantReasoningAndToolParts","UserTextParts"];export{n as AssistantReasoningAndToolParts,c as UserTextParts,Wr as __namedExportsOrder,Tr as default};
