o
    Yh                     @  s   U d dl mZ d dlZd dlZd dlmZmZ d dlZd dl	m
Z
mZmZ d dlmZ er3d dlmZ dZded	< ej	
ddddddddZdS )    )annotationsN)TYPE_CHECKINGFinal)LayoutConfigWidthvalidate_width)add_script_run_ctx)Iteratorg      ?r   
DELAY_SECSIn progress...Fcontent)	show_time_cachewidthtextstrr   boolr   r   r   returnIterator[None]c                #  s*   ddl m  ddlm t|dd t|dt dt	 zId f	d	d
}t
tt|  dV  W rj
 dW d   n1 sQw   Y  dtjjv rd  dS   dS dS r
 dW d   n1 s}w   Y  dtjjv r  w   w w )a,  Display a loading spinner while executing a block of code.

    Parameters
    ----------
    text : str
        The text to display next to the spinner. This defaults to
        ``"In progress..."``.

        The text can optionally contain 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

    show_time : bool
        Whether to show the elapsed time next to the spinner text. If this is
        ``False`` (default), no time is displayed. If this is ``True``,
        elapsed time is displayed with a precision of 0.1 seconds. The time
        format is not configurable.

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

        - ``"content"`` (default): The width of the element matches the
          width of its content, but doesn't exceed the width of the parent
          container.
        - ``"stretch"``: The width of the element matches 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.

    Example
    -------
    >>> import streamlit as st
    >>> import time
    >>>
    >>> with st.spinner("Wait for it...", show_time=True):
    >>>     time.sleep(5)
    >>> st.success("Done!")
    >>> st.button("Rerun")

    .. output ::
        https://doc-spinner.streamlit.app/
        height: 210px

    r   )Spinner)
clean_textT)allow_content)r   r   Nonec                    sj   ) r#  } | _ | _| _jd| d W d    d S W d    d S 1 s.w   Y  d S )Nspinner)layout_config)r   cacher   _enqueue)spinner_proto	SpinnerProtor   r   display_messagedisplay_message_lockr   messager   r    [/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/streamlit/elements/spinner.pyset_messagem   s   
"zspinner.<locals>.set_messageNFchat_message)r   r   )streamlit.proto.Spinner_pb2r   streamlit.string_utilr   r   r   stempty	threadingLockr   Timerr
   startset
_active_dg_ancestor_block_types	container)r   r   r   r   r%   r#   r   r$   r   %   s6   ;


r   )r   )
r   r   r   r   r   r   r   r   r   r   )
__future__r   
contextlibr+   typingr   r   	streamlitr)   #streamlit.elements.lib.layout_utilsr   r   r   streamlit.runtime.scriptrunnerr   collections.abcr	   r
   __annotations__contextmanagerr   r#   r#   r#   r$   <module>   s"   