
    g`                        d dl mZ d dlZd dlZd dlmZ d dlZd dlm	Z	 erd dl
mZ ej                  	 d	ddd	 	 	 	 	 	 	 d
d       Zy)    )annotationsN)TYPE_CHECKING)add_script_run_ctx)IteratorF)	show_time_cachec             #     	K   ddl m ddlm t	        j
                         	d}dt        j                         	 	 fd}t        t        j                  ||            j                          d rP5  dddd       d	t        	j                  j                        v r	j                          y	j                          yy# 1 sw Y   MxY w# r]5  dddd       n# 1 sw Y   nxY wd	t        	j                  j                        v r	j                          w 	j                          w w xY 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.

    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_textg      ?Tc                     5  r4        }        | _         | _        | _        j                  d|        d d d        y # 1 sw Y   y xY w)Nspinner)textcacher   _enqueue)	spinner_protoSpinnerProtor   r   display_messagedisplay_message_lockmessager   r   s	    O/var/www/openai/venv/lib/python3.12/site-packages/streamlit/elements/spinner.pyset_messagezspinner.<locals>.set_messageV   sI    %"$0NM)3D)9M&*0M'.7M+$$Y> &%%s   7AANFchat_message)streamlit.proto.Spinner_pb2r
   streamlit.string_utilr   stempty	threadingLockr   Timerstartset
_active_dg_ancestor_block_types	container)
r   r   r   
DELAY_SECSr   r   r   r   r   r   s
   ```  @@@@@r   r   r      s    Z D0hhjG JO$>>+ 	? 	? 	9??:{CDJJL 	%"' &W%7%7%M%M!NN !!#  %%  %"' &%%W%7%7%M%M!NN !!#  sO   9E=C  ECAECE E%C1(	E1C:6AEE)zIn progress...)r   strr   boolr   r'   returnzIterator[None])
__future__r   
contextlibr   typingr   	streamlitr   streamlit.runtime.scriptrunnerr   collections.abcr   contextmanagerr        r   <module>r2      sv    #      =(  T  	T 
T  T  	T 
 T  T r1   