<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-inherit="mail.Thread" t-inherit-mode="extension">
        <xpath expr="//*[@name='content']" position="before">
            <div t-if="props.thread?.livechatWelcomeMessage" class="bg-100 py-3">
                <Message message="props.thread.livechatWelcomeMessage" hasActions="false" thread="props.thread"/>
            </div>
        </xpath>
        <xpath expr="//*[@name='content']" position="after">
            <Message t-if="chatbotService.isTyping" message="props.thread.chatbotTypingMessage" hasActions="false" isInChatWindow="env.inChatWindow" isTypingMessage="true"  thread="props.thread"/>
        </xpath>
        <xpath expr="//*[hasclass('o-mail-Thread-empty')]" position="replace">
            <t t-if="props.thread.type !== 'livechat'">$0</t>
        </xpath>
        <xpath expr="//*[hasclass('o-mail-Thread-newMessage')]" position="replace">
            <t t-if="!chatbotService.active">$0</t>
        </xpath>
    </t>
    <t t-inherit="mail.NotificationMessage" t-inherit-mode="extension">
        <xpath expr="//*[hasclass('o-mail-NotificationMessage')]" position="attributes">
            <attribute name="t-attf-class" add="{{ props.thread.type === 'livechat' ? 'o-livechat-NoPinMenu' : '' }}" separator=" "/>
        </xpath>
    </t>
</templates>
