
    ch	                        S r SSKJr  SSKrSSKrSSKrSSKJrJrJ	r	  SSK
Jr  \(       a  SSKJr  SS jrSS jrSS	 jr " S
 S\\\4   5      rSS jrg)zA bunch of useful utilities.    )annotationsN)TYPE_CHECKINGAnyCallable)RootContainer)DeltaGeneratorc                R   ^ ^ / m[         R                  " T 5      SU U4S jj5       nU$ )z2Decorator to memoize the result of a no-args func.c                 H   > T(       d  TR                  T " 5       5        TS   $ )Nr   )append)funcresults   aC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\streamlit/util.pywrapped_funcmemoize.<locals>.wrapped_func"   s    MM$&!ay    )returnr   )	functoolswraps)r   r   r   s   ` @r   memoizer      s+    F__T 
 r   c                T  ^ ^ T R                   R                  nSSS/ [        5       0 /m[        R                  " T 5      (       a"  UU 4S j[        R
                  " T 5       5       nO$U4S jT R                  R                  5        5       nSR                  S U 5       5      nU SU S	3$ )
zxA clean repr for a class, excluding both values that are likely defaults,
and those explicitly default for dataclasses.
N Fc              3    >#    U  H|  nUR                   (       d  M  [        TUR                  5      UR                  :w  d  M<  [        TUR                  5      T;  d  MX  UR                  [        TUR                  5      4v   M~     g 7fN)reprgetattrnamedefault).0fdefaultsselfs     r   	<genexpr>repr_.<locals>.<genexpr>4   sm      
-vv , aff%2 , aff%X5	 ,QVVWT166*+-s   B"BB)Bc              3  >   >#    U  H  u  pUT;  d  M  X4v   M     g 7fr    )r   r   vr    s      r   r"   r#   <   s      W,A&1QhEVvv,As   
z, c              3  6   #    U  H  u  pU S U< 3v   M     g7f)=Nr%   )r   fieldvalues      r   r"   r#   >   s     Q[\UugQui0[s   ())		__class____name__setdataclassesis_dataclassfields__dict__itemsjoin)r!   	classnamefields_valsfield_reprsr    s   `   @r   repr_r9   +   s     ''I  UBr:H%%
 ''-
 XDMM,?,?,AW))Q[QQK[+a((r   c                    [         R                  " SSS9n[        U [        5      (       a  U R	                  S5      OU nUR                  U5        UR                  5       $ )zaReturn the md5 hash of the given string.

This should not be used for security-related purposes.
md5F)usedforsecurityzutf-8)hashlibnew
isinstancestrencodeupdate	hexdigest)shbs      r   calc_md5rG   B   sG     	E51A'3//QAHHQK;;=r   c                  ,    \ rS rSrSrSS jrSS jrSrg)	AttributeDictionaryP   a  
A dictionary subclass that supports attribute-style access.

This class extends the functionality of a standard dictionary to allow items
to be accessed via attribute-style dot notation in addition to the traditional
key-based access. If a dictionary item is accessed and is itself a dictionary,
it is automatically wrapped in another `AttributeDictionary`, enabling recursive
attribute-style access.
c                     U R                  U5      n[        U[        5      (       a  [        U5      $ U$ ! [         a+  n[        S[        U 5      R                   SU S35      UeS nAff = f)N'z' object has no attribute ')__getitem__r?   dictrI   KeyErrorAttributeErrortyper.   )r!   keyitemerrs       r   __getattr__AttributeDictionary.__getattr__[   sr    	##C(D0:40F0F&t,PDP 	 DJ''((CC5J	s   05 5 
A*&A%%A*c                    X U'   g r   r%   )r!   r   r*   s      r   __setattr__AttributeDictionary.__setattr__d   s	    T
r   r%   N)rR   r@   r   r   )r   r@   r*   r   r   None)r.   
__module____qualname____firstlineno____doc__rU   rX   __static_attributes__r%   r   r   rI   rI   P   s    r   rI   c                P    U R                   R                  [        R                  :H  $ )z.Check if the DeltaGenerator is in the sidebar.)
_active_dg_root_containerr   SIDEBAR)dgs    r   
in_sidebarre   h   s    ==((M,A,AAAr   )r   Callable[..., Any]r   rf   )r!   r   r   r@   )rD   zbytes | strr   r@   )rd   r   r   bool)r^   
__future__r   r0   r   r=   typingr   r   r   !streamlit.proto.RootContainer_pb2r   streamlit.delta_generatorr   r   r9   rG   rN   rI   re   r%   r   r   <module>rl      sN    # "    / / ;8
).$sCx. 0Br   