
    ȯei3                    .   U d dl mZ d dlZd dlmZ d dlmZmZmZm	Z	 d dl
Z
d dl
mZ d dlmZ  ee      Zded<    ed	ed
ef         Z ede      ZddZdddZ	 	 d	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 d	 	 	 	 	 	 	 	 	 	 	 ddZ	 d	 	 	 	 	 	 	 	 	 	 	 ddZddZy)    )annotationsN)Callable)AnyFinalTypeVarcast)config)
get_loggerr   _LOGGERTFunc.)boundTObjc                     t        j                  d      } | t         j                  j                  k(  xs t         j                  j	                  |       S )a  True if we should print deprecation warnings to the browser.

    Deprecation warnings are only shown when showErrorDetails is set to "full"
    or the legacy True value. All other values ("stacktrace", "type", "none",
    False) hide deprecation warnings in the browser.
    zclient.showErrorDetails)r	   
get_optionShowErrorDetailsConfigOptionsFULLis_true_variation)show_error_detailss    \/var/www/html/glpi_dashboard/venv/lib/python3.12/site-packages/streamlit/deprecation_util.py!_error_details_in_browser_enabledr      sJ      **+DEfBBGGG 	V//AABTU    c                p    t               r|rt        j                  |        t        j                  |        y)a3  Show a deprecation warning message.

    Parameters
    ----------
    message : str
        The deprecation warning message.
    show_in_browser : bool, default=True
        Whether to show the deprecation warning in the browser. When this is True,
        we will show the deprecation warning in the browser only if the user has
        set `client.showErrorDetails` to "full" or the legacy True value. All
        other values ("stacktrace", "type", "none", False) will hide deprecation
        warnings in the browser (but still log them to the console).
    N)r   	streamlitwarningr   )messageshow_in_browsers     r   show_deprecation_warningr   -   s(     )*'" OOGr   c           	     P    |r
d|  } d| }d|  d| d|  d| d	|rd| z   S dz   S )	Nzst.zPlease replace `z` with `z`.

`z` will be removed after .z

  )old_namenew_nameremoval_dateextra_messageinclude_st_prefixs        r   make_deprecated_name_warningr'   B   sk     
#
# 8*HXJ 7:-l^1	>%2T-!	< 9;	<r   c                     t        j                         d fd       }|_         j                  |_        t	        d|      S )a  Wrap an `st` function whose name has changed.

    Wrapped functions will run as normal, but will also show an st.warning
    saying that the old name will be removed after removal_date.

    (We generally set `removal_date` to 3 months from the deprecation date.)

    Parameters
    ----------
    func
        The `st.` function whose name has changed.

    old_name
        The function's deprecated name within __init__.py.

    removal_date
        A date like "2020-01-01", indicating the last day we'll guarantee
        support for the deprecated name.

    extra_message
        An optional extra message to show in the deprecation warning.

    name_override
        An optional name to use in place of func.__name__.
    c            	          | i |}t        t        xs# t        d      rt        j                        nd             |S )N__name__unknown)r   r'   hasattrstrr*   )argskwargsresultr%   funcname_overrider"   r$   s      r   wrapped_funcz)deprecate_func_name.<locals>.wrapped_funcu   sR    t&v& ( T*1$
*CC&	
 r   r   )r.   r   r/   r   returnr   )	functoolswrapsr*   __doc__r   )r1   r"   r$   r%   r2   r3   s   ````` r   deprecate_func_namer8   T   sI    B __T   %L<<L&&r   c                .    t        | fd      S )a  Wrap an `st` object whose name has changed.

    Wrapped objects will behave as normal, but will also show an st.warning
    saying that the old name will be removed after `removal_date`.

    (We generally set `removal_date` to 3 months from the deprecation date.)

    Parameters
    ----------
    obj
        The `st.` object whose name has changed.

    old_name
        The object's deprecated name within __init__.py.

    new_name
        The object's new name within __init__.py.

    removal_date
        A date like "2020-01-01", indicating the last day we'll guarantee
        support for the deprecated name.

    include_st_prefix
        If False, does not prefix each of the object names in the deprecation
        message with `st.*`. Defaults to True.
    c                 4    t        t                     S )N)r&   )r   r'   )r&   r#   r"   r$   s   r   <lambda>z$deprecate_obj_name.<locals>.<lambda>   s    (((LDU
 r   )_create_deprecated_obj_wrapper)objr"   r#   r$   r&   s    ````r   deprecate_obj_namer>      s    D *	
 r   c                \     ddfd G  fdd      t        d              S )zCreate a wrapper for an object that has been deprecated. The first
    time one of the object's properties or functions is accessed, the
    given `show_warning` callback will be called.
    Fc                      s
d          y y NTr!   )has_shown_warningshow_warnings   r   maybe_show_warningz:_create_deprecated_obj_wrapper.<locals>.maybe_show_warning   s     ! $N !r   c                  T    e Zd Zd fdZdfdZedd       Zed	fd       Zy)
/_create_deprecated_obj_wrapper.<locals>.Wrapperc           
         j                  j                        D ]1  }t        | j                  |t        | j	                  |                   3 y N)_get_magic_functions	__class__setattrproperty_make_magic_function_proxy)selfnameWrapperr=   s     r   __init__z8_create_deprecated_obj_wrapper.<locals>.Wrapper.__init__   sF    44S]]C NNT<<TBCr   c                ^    || j                   v rt        | |      S          t        |      S rH   )__dict__getattr)rN   attrrD   r=   s     r   __getattr__z;_create_deprecated_obj_wrapper.<locals>.Wrapper.__getattr__   s1    
 t}}$tT** 3%%r   c                l    d}t        |       D cg c]  }||vr|j                  d      r| c}S c c}w )N)rJ   rS   __getattribute__rV   __)dir
startswith)self_clsignorerO   s      r   rI   zD_create_deprecated_obj_wrapper.<locals>.Wrapper._get_magic_functions   sC     RF  Mv%$//$*?   s   1c                     d fd}|S )Nc                *             t              S rH   )rT   )_selfr.   rD   rO   r=   s     r   proxyzY_create_deprecated_obj_wrapper.<locals>.Wrapper._make_magic_function_proxy.<locals>.proxy   s    "$sD))r   )r`   r   r.   r   r4   r   r!   )rO   ra   rD   r=   s   ` r   rM   zJ_create_deprecated_obj_wrapper.<locals>.Wrapper._make_magic_function_proxy   s    * Lr   Nr4   None)rU   r-   r4   r   )r\   ztype[object]r4   z	list[str])rO   r-   r4   zCallable[[Any], Any])r*   
__module____qualname__rQ   rV   staticmethodrI   rM   )rP   rD   r=   s   r   rP   rF      s5    			& 
	 
	 
	 
	r   rP   r   rb   )r   )r=   rC   rP   rB   rD   s   ``@@@r   r<   r<      s,    
 & &P 	""r   )r4   bool)T)r   r-   r   rg   r4   rc   rA   )r"   r-   r#   r-   r$   r-   r%   
str | Noner&   rg   r4   r-   )NN)r1   r   r"   r-   r$   r-   r%   rh   r2   rh   r4   r   )r=   r   r"   r-   r#   r-   r$   r-   r&   rg   r4   r   )r=   r   rC   zCallable[[], Any]r4   r   )
__future__r   r5   collections.abcr   typingr   r   r   r   r   r	   streamlit.loggerr
   r*   r   __annotations__r   objectr   r   r   r'   r8   r>   r<   r!   r   r   <module>ro      s,   #  $ , ,   'H% %xS12vV$2 !%"  	
  	, !% $2'
2'2' 2' 	2'
 2' 2't #)	)) ) 	)
 ) 
)X6#r   