<wxs src="../common/utils.wxs" module="_"/><view class="class {{chatItemClass}}" style="{{_._style([style, customStyle])}}" bindlongpress="handleLongPress"><view class="{{classPrefix}}__avatar"><slot name="avatar"/><block wx:if="{{avatar}}"><image src="{{avatar}}" class="{{classPrefix}}__avatar-image"></image></block></view><view class="{{contentClasses}}"><view class="{{classPrefix}}__base"><slot name="name"/><text wx:if="{{showName}}" class="{{classPrefix}}__name">{{name}}</text><text wx:if="{{datetime}}" class="{{classPrefix}}__time">{{datetime}}</text></view><block wx:if="{{status === 'pending'}}"><view style="width: 100%"><chat-loading animation="{{animation}}"></chat-loading></view></block><block wx:else><view class="{{classPrefix}}__detail"><block wx:if="{{content.length > 0}}"><block wx:for="{{content}}" wx:key="index"><attachments wx:if="{{item.type === 'attachment' && role === 'user'}}" items="{{item.data}}" removable="{{false}}" inChat="{{true}}"></attachments><chat-thinking wx:if="{{item.type === 'thinking'}}" content="{{item.data}}" role="{{role}}" status="{{status}}"></chat-thinking><chat-content wx:elif="{{item.type === 'text' || item.type === 'markdown'}}" content="{{item}}" role="{{role}}" status="{{status}}"></chat-content></block></block><block wx:else><slot name="content"/></block></view></block><view wx:if="{{role === 'assistant'}}" class="{{classPrefix}}__actionbar"><slot name="actionbar"></slot></view></view></view>