# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .allowlist_item import AllowlistItem
from .embed_variant import EmbedVariant
from .file_input_config import FileInputConfig
from .widget_config_response_avatar import WidgetConfigResponseAvatar
from .widget_config_response_syntax_highlight_theme import WidgetConfigResponseSyntaxHighlightTheme
from .widget_end_feedback_config import WidgetEndFeedbackConfig
from .widget_expandable import WidgetExpandable
from .widget_feedback_mode import WidgetFeedbackMode
from .widget_language_preset_response import WidgetLanguagePresetResponse
from .widget_placement import WidgetPlacement
from .widget_styles import WidgetStyles
from .widget_text_contents import WidgetTextContents


class WidgetConfigResponse(UncheckedBaseModel):
    variant: typing.Optional[EmbedVariant] = pydantic.Field(default=None)
    """
    The variant of the widget
    """

    placement: typing.Optional[WidgetPlacement] = pydantic.Field(default=None)
    """
    The placement of the widget on the screen
    """

    expandable: typing.Optional[WidgetExpandable] = pydantic.Field(default=None)
    """
    Whether the widget is expandable
    """

    avatar: typing.Optional[WidgetConfigResponseAvatar] = pydantic.Field(default=None)
    """
    The avatar of the widget
    """

    feedback_mode: typing.Optional[WidgetFeedbackMode] = pydantic.Field(default=None)
    """
    The feedback mode of the widget
    """

    end_feedback: typing.Optional[WidgetEndFeedbackConfig] = pydantic.Field(default=None)
    """
    Configuration for feedback collected at the end of the conversation
    """

    bg_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The background color of the widget
    """

    text_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text color of the widget
    """

    btn_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The button color of the widget
    """

    btn_text_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The button text color of the widget
    """

    border_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The border color of the widget
    """

    focus_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The focus color of the widget
    """

    border_radius: typing.Optional[int] = pydantic.Field(default=None)
    """
    The border radius of the widget
    """

    btn_radius: typing.Optional[int] = pydantic.Field(default=None)
    """
    The button radius of the widget
    """

    action_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The action text of the widget
    """

    start_call_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The start call text of the widget
    """

    end_call_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The end call text of the widget
    """

    expand_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The expand text of the widget
    """

    listening_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display when the agent is listening
    """

    speaking_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display when the agent is speaking
    """

    shareable_page_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display when sharing
    """

    shareable_page_show_terms: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show terms and conditions on the shareable page
    """

    terms_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display for terms and conditions
    """

    terms_html: typing.Optional[str] = pydantic.Field(default=None)
    """
    The HTML to display for terms and conditions
    """

    terms_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    The key to display for terms and conditions
    """

    show_avatar_when_collapsed: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show the avatar when the widget is collapsed
    """

    disable_banner: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to disable the banner
    """

    override_link: typing.Optional[str] = pydantic.Field(default=None)
    """
    The override link for the widget
    """

    markdown_link_allowed_hosts: typing.Optional[typing.List[AllowlistItem]] = pydantic.Field(default=None)
    """
    List of allowed hostnames for clickable markdown links. Use { hostname: '*' } to allow any domain. Empty means no links are allowed.
    """

    markdown_link_include_www: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to automatically include www. variants of allowed hosts
    """

    markdown_link_allow_http: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to allow http:// in addition to https:// for allowed hosts
    """

    mic_muting_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to enable mic muting
    """

    transcript_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget should show the conversation transcript as it goes on
    """

    text_input_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the user should be able to send text messages
    """

    conversation_mode_toggle_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to enable the conversation mode toggle in the widget
    """

    default_expanded: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget should be expanded by default
    """

    always_expanded: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget should always be expanded
    """

    dismissible: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget can be dismissed by the user
    """

    show_agent_status: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show agent working/done/error status during tool use
    """

    show_conversation_id: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show the conversation ID after disconnection.
    """

    strip_audio_tags: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to strip audio markup from messages.
    """

    syntax_highlight_theme: typing.Optional[WidgetConfigResponseSyntaxHighlightTheme] = pydantic.Field(default=None)
    """
    Theme for code block syntax highlighting. Defaults to auto-detection by the widget when not set.
    """

    text_contents: typing.Optional[WidgetTextContents] = pydantic.Field(default=None)
    """
    Text contents of the widget
    """

    styles: typing.Optional[WidgetStyles] = pydantic.Field(default=None)
    """
    Styles for the widget
    """

    language: str
    supported_language_overrides: typing.Optional[typing.List[str]] = None
    language_presets: typing.Optional[typing.Dict[str, WidgetLanguagePresetResponse]] = pydantic.Field(default=None)
    """
    Language presets for the widget
    """

    text_only: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the agent uses text-only mode
    """

    supports_text_only: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the agent can be switched to text-only mode
    """

    first_message: typing.Optional[str] = None
    use_rtc: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to use WebRTC for conversation connections
    """

    file_input_config: typing.Optional[FileInputConfig] = pydantic.Field(default=None)
    """
    Configuration for file upload in the widget
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
