{% extends "console/react_shell_base.html" %}
{% load vite_tags %}

{% block page_title %}Chat - {{ agent.name|default:'Agent' }} · Gobii{% endblock %}

{% block react_shell_content %}
<div class="{% if immersive %}min-h-screen{% else %}py-12 px-6{% endif %}">
  <div id="gobii-frontend-root"
       class="{% if immersive %}w-full{% else %}mx-auto max-w-5xl{% endif %}"
       data-app="agent-chat"
       data-immersive="{% if immersive %}true{% else %}false{% endif %}"
       data-agent-id="{{ agent.id }}"
       data-agent-name="{{ agent.name|default:'' }}"
       data-agent-color="{{ agent.get_display_color|default_if_none:'' }}"
       data-agent-avatar-url="{{ agent.get_avatar_thumbnail_url|default_if_none:'' }}"
       data-agent-email="{{ agent_email }}"
       data-agent-sms="{{ agent_sms }}"
       data-max-chat-upload-size-bytes="{{ max_chat_upload_size_bytes|default_if_none:'' }}"
       data-fish-collateral-enabled="{% if fish_collateral_enabled %}true{% else %}false{% endif %}"
       data-user-plan="{{ user_plan|default:'' }}"
       data-startup-trial-days="{{ startup_trial_days|default:0 }}"
       data-scale-trial-days="{{ scale_trial_days|default:0 }}"
       data-startup-task-credits="{{ startup_task_credits|default:0 }}"
       data-scale-task-credits="{{ scale_task_credits|default:0 }}"
       data-trial-eligible="{% if trial_eligible %}true{% else %}false{% endif %}"
       data-pricing-modal-almost-full-screen="{% if pricing_modal_almost_full_screen %}true{% else %}false{% endif %}"
       data-cta-pricing-cancel-text-under-btn="{% if cta_pricing_cancel_text_under_btn %}true{% else %}false{% endif %}"
       data-cta-start-free-trial="{% if cta_start_free_trial %}true{% else %}false{% endif %}"
       data-cta-unlock-agent-copy="{% if cta_unlock_agent_copy %}true{% else %}false{% endif %}"
       data-cta-pick-a-plan="{% if cta_pick_a_plan %}true{% else %}false{% endif %}"
       data-cta-continue-agent-btn="{% if cta_continue_agent_btn %}true{% else %}false{% endif %}"
       data-cta-no-charge-during-trial="{% if cta_no_charge_during_trial %}true{% else %}false{% endif %}"
       data-personal-signup-preview-available="{% if personal_signup_preview_available %}true{% else %}false{% endif %}"
       data-personal-signup-preview-processing-available="{% if personal_signup_preview_processing_available %}true{% else %}false{% endif %}"
       data-agent-signup-preview-state="{{ agent_signup_preview_state|default:'' }}"
       data-is-proprietary-mode="{% if settings.GOBII_PROPRIETARY_MODE %}true{% else %}false{% endif %}"
       data-is-staff="{% if request.user.is_staff or request.user.is_superuser %}true{% else %}false{% endif %}"
       data-audit-url="{% if request.user.is_staff or request.user.is_superuser %}{% url 'console-agent-audit' agent_id=agent.id %}{% endif %}"
       data-audit-url-template="{% if request.user.is_staff or request.user.is_superuser %}{% url 'console-agent-audit' agent_id='00000000-0000-0000-0000-000000000000' %}{% endif %}"
       data-viewer-user-id="{{ request.user.id }}"
       data-viewer-email="{{ request.user.email|default_if_none:'' }}"
       data-collaborator-invite-url="{% url 'agent_detail' pk=agent.id %}"
       data-can-manage-collaborators="{% if can_manage_collaborators %}true{% else %}false{% endif %}"
       data-is-collaborator="{% if is_collaborator %}true{% else %}false{% endif %}"
       {% if pipedream_integrations_enabled %}
       data-pipedream-apps-url="{% url 'console-pipedream-apps' %}"
       data-pipedream-app-search-url="{% url 'console-pipedream-app-search' %}"
       {% endif %}>
  </div>
</div>
{% endblock %}

{% block extra_js %}
  {% vite_asset 'src/main.tsx' %}
{% endblock %}
