o
    ,&]i9>                     @  s   U d dl mZ d dlmZ d dlmZmZmZmZ d dl	m
Z
mZ d dlmZ d dlmZ d dlmZ d dlmZ erOd d	lmZ d d
l	mZmZ d dlmZ G dd deZeed B dB Zded< eeB dB Z ded< G dd dZ!dS )    )annotations)Enum)TYPE_CHECKINGLiteral	TypeAliascast)LayoutConfigvalidate_width)StreamlitAPIException)Heading)gather_metrics)
clean_text)DeltaGenerator)TextAlignmentWidth)SupportsStrc                   @  s   e Zd ZdZdZdZdS )HeadingProtoTagh1h2h3N)__name__
__module____qualname__	TITLE_TAG
HEADER_TAGSUBHEADER_TAG r   r   X/var/www/html/IGF-ODF-V3/venv/lib/python3.10/site-packages/streamlit/elements/heading.pyr       s    r   FNr   AnchorDividerc                   @  s   e Zd Zed	d(dddddd)ddZed	d(dddddd)ddZed	d(ddddd*ddZed+ddZe	d,d!d"Z
e				d-d.d&d'ZdS )/HeadingMixinheaderNFstretchleft)helpdividerwidthtext_alignmentbodyr   anchorr   r$   
str | Noner%   r   r&   r   r'   r   returnr   c             	   C  <   t |dd t||d}| jjdtjtj||||d|dS )aA  Display text in header formatting.

        Parameters
        ----------
        body : str
            The text to display as GitHub-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            See the ``body`` parameter of |st.markdown|_ for additional,
            supported Markdown directives.

            .. |st.markdown| replace:: ``st.markdown``
            .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str or None
            A tooltip that gets displayed next to the header. If this is
            ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        divider : bool, "blue", "green", "orange", "red", "violet", "yellow", "gray"/"grey", or "rainbow"
            Shows a colored divider below the header. If this is ``True``,
            successive headers will cycle through divider colors, except gray
            and rainbow. That is, the first header will have a blue line, the
            second header will have a green line, and so on. If this is a
            string, the color can be set to one of the following: blue, green,
            orange, red, violet, yellow, gray/grey, or rainbow.

        width : "stretch", "content", or int
            The width of the header element. This can be one of the following:

            - ``"stretch"`` (default): The width of the element matches the
              width of the parent container.
            - ``"content"``: The width of the element matches the width of its
              content, but doesn't exceed the width of the parent container.
            - An integer specifying the width in pixels: The element has a
              fixed width. If the specified width is greater than the width of
              the parent container, the width of the element matches the width
              of the parent container.

        text_alignment : "left", "center", "right", or "justify"
            The horizontal alignment of the text within the element. This can
            be one of the following:

            - ``"left"`` (default): Text is aligned to the left edge.
            - ``"center"``: Text is centered.
            - ``"right"``: Text is aligned to the right edge.
            - ``"justify"``: Text is justified (stretched to fill the available
              width with the last line left-aligned).

            .. note::
                For text alignment to have a visible effect, the element's
                width must be wider than its content. If you use
                ``width="content"`` with short text, the alignment may not be
                noticeable.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.header("_Streamlit_ is :blue[cool] :sunglasses:")
        >>> st.header("This is a header with a divider", divider="gray")
        >>> st.header("These headers have rotating dividers", divider=True)
        >>> st.header("One", divider=True)
        >>> st.header("Two", divider=True)
        >>> st.header("Three", divider=True)
        >>> st.header("Four", divider=True)

        .. output::
           https://doc-header.streamlit.app/
           height: 600px

        Tallow_contentr&   r'   headingtagr(   r)   r$   r%   layout_config)r	   r   dg_enqueuer    _create_heading_protor   r   selfr(   r)   r$   r%   r&   r'   r4   r   r   r   r!   +      [zHeadingMixin.header	subheaderc             	   C  r,   )ah  Display text in subheader formatting.

        Parameters
        ----------
        body : str
            The text to display as GitHub-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            See the ``body`` parameter of |st.markdown|_ for additional,
            supported Markdown directives.

            .. |st.markdown| replace:: ``st.markdown``
            .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str or None
            A tooltip that gets displayed next to the subheader. If this is
            ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        divider : bool, "blue", "green", "orange", "red", "violet", "yellow", "gray"/"grey", or "rainbow"
            Shows a colored divider below the header. If this is ``True``,
            successive headers will cycle through divider colors, except gray
            and rainbow. That is, the first header will have a blue line, the
            second header will have a green line, and so on. If this is a
            string, the color can be set to one of the following: blue, green,
            orange, red, violet, yellow, gray/grey, or rainbow.

        width : "stretch", "content", or int
            The width of the subheader element. This can be one of the following:

            - ``"stretch"`` (default): The width of the element matches the
              width of the parent container.
            - ``"content"``: The width of the element matches the width of its
              content, but doesn't exceed the width of the parent container.
            - An integer specifying the width in pixels: The element has a
              fixed width. If the specified width is greater than the width of
              the parent container, the width of the element matches the width
              of the parent container.

        text_alignment : "left", "center", "right", or "justify"
            The horizontal alignment of the text within the element. This can
            be one of the following:

            - ``"left"`` (default): Text is aligned to the left edge.
            - ``"center"``: Text is centered.
            - ``"right"``: Text is aligned to the right edge.
            - ``"justify"``: Text is justified (stretched to fill the available
              width with the last line left-aligned).

            .. note::
                For text alignment to have a visible effect, the element's
                width must be wider than its content. If you use
                ``width="content"`` with short text, the alignment may not be
                noticeable.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.subheader("_Streamlit_ is :blue[cool] :sunglasses:")
        >>> st.subheader("This is a subheader with a divider", divider="gray")
        >>> st.subheader("These subheaders have rotating dividers", divider=True)
        >>> st.subheader("One", divider=True)
        >>> st.subheader("Two", divider=True)
        >>> st.subheader("Three", divider=True)
        >>> st.subheader("Four", divider=True)

        .. output::
           https://doc-subheader.streamlit.app/
           height: 500px

        Tr-   r/   r0   r1   r3   )r	   r   r5   r6   r    r7   r   r   r8   r   r   r   r;      r:   zHeadingMixin.subheadertitle)r$   r&   r'   c                C  s:   t |dd t||d}| jjdtjtj|||d|dS )aV  Display text in title formatting.

        Each document should have a single `st.title()`, although this is not
        enforced.

        Parameters
        ----------
        body : str
            The text to display as GitHub-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            See the ``body`` parameter of |st.markdown|_ for additional,
            supported Markdown directives.

            .. |st.markdown| replace:: ``st.markdown``
            .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str or None
            A tooltip that gets displayed next to the title. If this is
            ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        width : "stretch", "content", or int
            The width of the title element. This can be one of the following:

            - ``"stretch"`` (default): The width of the element matches the
              width of the parent container.
            - ``"content"``: The width of the element matches the width of its
              content, but doesn't exceed the width of the parent container.
            - An integer specifying the width in pixels: The element has a
              fixed width. If the specified width is greater than the width of
              the parent container, the width of the element matches the width
              of the parent container.

        text_alignment : "left", "center", "right", or "justify"
            The horizontal alignment of the text within the element. This can
            be one of the following:

            - ``"left"`` (default): Text is aligned to the left edge.
            - ``"center"``: Text is centered.
            - ``"right"``: Text is aligned to the right edge.
            - ``"justify"``: Text is justified (stretched to fill the available
              width with the last line left-aligned).

            .. note::
                For text alignment to have a visible effect, the element's
                width must be wider than its content. If you use
                ``width="content"`` with short text, the alignment may not be
                noticeable.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.title("This is a title")
        >>> st.title("_Streamlit_ is :blue[cool] :sunglasses:")

        .. output::
           https://doc-title.streamlit.app/
           height: 220px

        Tr-   r/   r0   )r2   r(   r)   r$   r3   )r	   r   r5   r6   r    r7   r   r   )r9   r(   r)   r$   r&   r'   r4   r   r   r   r<      s   PzHeadingMixin.titlec                 C  s
   t d| S )zGet our DeltaGenerator.r   )r   )r9   r   r   r   r5   ]  s   
zHeadingMixin.dgstrc                 C  sB   | du rdS g d}| |v rt d| S td|  dd| d)	NTauto)	redorangeyellowbluegreenvioletgraygreyrainbowr=   z&Divider parameter has invalid value: `z`. Please choose from: z, .)r   r
   join)r%   valid_colorsr   r   r   _handle_divider_colorb  s   
z"HeadingMixin._handle_divider_colorr2   r   HeadingProtoc                 C  s   t  }| j|_t||_|rt||_|d ur@|du r d|_n t	|t
r)||_n|du r5td| dtdt|j d|rE||_|S )NFTz$Anchor parameter has invalid value: z-. Supported values: None, any string or Falsez#Anchor parameter has invalid type: )rL   valuer2   r   r(   r    rK   r%   hide_anchor
isinstancer=   r)   r
   typer   r$   )r2   r(   r)   r$   r%   protor   r   r   r7   w  s(   


z"HeadingMixin._create_heading_proto)N)r(   r   r)   r   r$   r*   r%   r   r&   r   r'   r   r+   r   )r(   r   r)   r   r$   r*   r&   r   r'   r   r+   r   )r+   r   )r%   r   r+   r=   )NNF)r2   r   r(   r   r)   r   r$   r*   r%   r   r+   rL   )r   r   r   r   r!   r;   r<   propertyr5   staticmethodrK   r7   r   r   r   r   r    *   sB    ii]r    )"
__future__r   enumr   typingr   r   r   r   #streamlit.elements.lib.layout_utilsr   r	   streamlit.errorsr
   streamlit.proto.Heading_pb2r   rL   streamlit.runtime.metrics_utilr   streamlit.string_utilr   streamlit.delta_generatorr   r   r   streamlit.type_utilr   r   r=   r   __annotations__boolr   r    r   r   r   r   <module>   s    