Ë
    úmxi9>  ã                  ó  — 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rd d	lmZ d d
l	mZmZ d dlmZ  G d„ de«      Zeed   z  dz  Zded<   eez  dz  Z ded<    G d„ d«      Z!y)é    )Úannotations)ÚEnum)ÚTYPE_CHECKINGÚLiteralÚ	TypeAliasÚcast)ÚLayoutConfigÚvalidate_width)ÚStreamlitAPIException)ÚHeading)Úgather_metrics)Ú
clean_text)ÚDeltaGenerator)ÚTextAlignmentÚWidth)ÚSupportsStrc                  ó   — e Zd ZdZdZdZy)ÚHeadingProtoTagÚh1Úh2Úh3N)Ú__name__Ú
__module__Ú__qualname__Ú	TITLE_TAGÚ
HEADER_TAGÚSUBHEADER_TAG© ó    úQ/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/elements/heading.pyr   r       s   „ Ø€IØ€JØ�Mr   r   FNr   ÚAnchorÚDividerc                  ó2  — e Zd Z e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dddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Zedd„«       Ze	dd„«       Z
e		 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„«       Zy)ÚHeadingMixinÚheaderNFÚstretchÚleft)ÚhelpÚdividerÚwidthÚtext_alignmentc          
     ó¾   — t        |d¬«       t        ||¬«      }| j                  j                  dt        j                  t        j                  ||||¬«      |¬«      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©ÚtagÚbodyÚanchorr(   r)   ©Úlayout_config)r
   r	   ÚdgÚ_enqueuer$   Ú_create_heading_protor   r   ©Úselfr3   r4   r(   r)   r*   r+   r6   s           r    r%   zHeadingMixin.header+   sg   € ôv 	�u¨DÕ1Ü$¨5ÀÔPˆà�w‰w×ÑØÜ×.Ñ.Ü#×.Ñ.ØØØØð /ó ð (ð  ó 

ð 
	
r   Ú	subheaderc          
     ó¾   — t        |d¬«       t        ||¬«      }| j                  j                  dt        j                  t        j                  ||||¬«      |¬«      S )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   r5   )r
   r	   r7   r8   r$   r9   r   r   r:   s           r    r<   zHeadingMixin.subheader•   sg   € ôv 	�u¨DÕ1Ü$¨5ÀÔPˆà�w‰w×ÑØÜ×.Ñ.Ü#×1Ñ1ØØØØð /ó ð (ð  ó 

ð 
	
r   Útitle)r(   r*   r+   c          	     ó¼   — t        |d¬«       t        ||¬«      }| j                  j                  dt        j                  t        j                  |||¬«      |¬«      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   r3   r4   r(   r5   )r
   r	   r7   r8   r$   r9   r   r   )r;   r3   r4   r(   r*   r+   r6   s          r    r>   zHeadingMixin.titleÿ   sd   € ô` 	�u¨DÕ1Ü$¨5ÀÔPˆà�w‰w×ÑØÜ×.Ñ.Ü#×-Ñ-ØØØð	 /ó ð (ð  ó 	
ð 		
r   c                ó   — t        d| «      S )zGet our DeltaGenerator.r   )r   )r;   s    r    r7   zHeadingMixin.dg]  s   € ô Ð$ dÓ+Ð+r   c                óv   — | du ryg d¢}| |v rt        d| «      S t        d| › ddj                  |«      › d�«      ‚)	NTÚauto)	ÚredÚorangeÚyellowÚblueÚgreenÚvioletÚgrayÚgreyÚrainbowÚstrz&Divider parameter has invalid value: `z`. Please choose from: z, ú.)r   r   Újoin)r)   Úvalid_colorss     r    Ú_handle_divider_colorz"HeadingMixin._handle_divider_colorb  sY   € à�d‰?Øò

ˆð �lÑ"Ü˜˜wÓ'Ð'Ü#Ø4°W°IÐ=TÐUY×U^ÑU^Ð_kÓUlÐTmÐmnÐoó
ð 	
r   c                ó\  — t        «       }| j                  |_        t        |«      |_        |rt
        j                  |«      |_        |�Y|du rd|_        nMt        |t        «      r||_        n5|du rt        d|› d�«      ‚t        dt        |«      j                  › d�«      ‚|r||_        |S )NFTz$Anchor parameter has invalid value: z-. Supported values: None, any string or Falsez#Anchor parameter has invalid type: )ÚHeadingProtoÚvaluer2   r   r3   r$   rP   r)   Úhide_anchorÚ
isinstancerL   r4   r   Útyper   r(   )r2   r3   r4   r(   r)   Úprotos         r    r9   z"HeadingMixin._create_heading_protow  sÄ   € ô “ˆØ—I‘IˆŒ	Ü Ó%ˆŒ
ÙÜ(×>Ñ>¸wÓGˆEŒMØÐØ˜‰Ø$(�Õ!Ü˜F¤CÔ(Ø%�•Ø˜4‘Ü+Ø:¸6¸(ð CBð Bóð ô
 ,Ø9¼$¸v»,×:OÑ:OÐ9Pð QBð Bóð ñ
 ØˆEŒJàˆr   )N)r3   r   r4   r!   r(   ú
str | Noner)   r"   r*   r   r+   r   Úreturnr   )r3   r   r4   r!   r(   rX   r*   r   r+   r   rY   r   )rY   r   )r)   r"   rY   rL   )NNF)r2   r   r3   r   r4   r!   r(   rX   r)   r"   rY   rR   )r   r   r   r   r%   r<   r>   Úpropertyr7   ÚstaticmethodrP   r9   r   r   r    r$   r$   *   sñ  „ Ù�HÓð ðg
ð
  Ø Ø Ø(.ñg
àðg
ð ðg
ð
 ðg
ð ðg
ð ðg
ð &ðg
ð 
òg
ó ðg
ñR �KÓ ð ðg
ð
  Ø Ø Ø(.ñg
àðg
ð ðg
ð
 ðg
ð ðg
ð ðg
ð &ðg
ð 
òg
ó !ðg
ñR �GÓð ð[
ð
  Ø Ø(.ñ[
àð[
ð ð[
ð
 ð[
ð ð[
ð &ð[
ð 
ò[
ó ð[
ðz ò,ó ð,ð ò
ó ð
ð( ð ØØ ðØðàðð ðð ð	ð
 ðð 
òó ñr   r$   )"Ú
__future__r   Úenumr   Útypingr   r   r   r   Ú#streamlit.elements.lib.layout_utilsr	   r
   Ústreamlit.errorsr   Ústreamlit.proto.Heading_pb2r   rR   Ústreamlit.runtime.metrics_utilr   Ústreamlit.string_utilr   Ústreamlit.delta_generatorr   r   r   Ústreamlit.type_utilr   r   rL   r!   Ú__annotations__Úboolr"   r$   r   r   r    ú<module>rh      ss   ðö #å ß :Ó :ç LÝ 2Ý ?Ý 9Ý ,áÝ8ßHÝ/ô�dô ð ˜' %™.Ñ(¨4Ñ/€ˆ	Ó /Ø˜C‘Z $Ñ&€ˆÓ &÷mò mr   