
    /_i                        U d dl mZ d dlmZmZ d dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZ  ee      Zded	<   dd
ZddZddZy)    )annotations)AnyFinalN)config)get_dg_singleton_instance)	exception)
get_loggerr   _LOGGERc                   ddl m ddlm}  G fdd|      }ddlm} ||_        ddlm}  |dd	d
dd      }|j                  |j                  j                  t        |       | | j                  d
ddddt        g	             y )Nr   )Box)Panelc                  6     e Zd Z	 d	 	 	 	 	 	 	 d fdZ xZS )0_print_rich_exception.<locals>.ConfigurablePanelc                <    t        |   |||n d      fi | y )NuP   ────
    
────
    
────
────
    
────
)super__init__)self
renderableboxkwargsr   	__class__s       S/var/www/html/land_sniper/venv/lib/python3.12/site-packages/streamlit/error_util.pyr   z9_print_rich_exception.<locals>.ConfigurablePanel.__init__"   s2     G? st	
     )N)r   r   r   z
Box | Noner   r   returnNone)__name__
__module____qualname__r   __classcell__)r   r   s   @r   ConfigurablePanelr   !   s8     #		 	 		
 	 	r   r    )	traceback)Console256TX   F   )color_systemforce_terminalwidthno_colortab_sized      )r(   show_locals
max_frames	word_wrapextra_linessuppress)rich.boxr   
rich.panelr   richr!   rich.consoler"   print	Tracebackfrom_exceptiontype__traceback__	streamlit)er   r    rich_tracebackr"   consoler   s         @r   _print_rich_exceptionr?      s     E  1,N %G MM  //GOO[ 	0 
	
r   c                \    t               j                  }t        j                  || d       y)z#Show the exception on the frontend.T)is_uncaught_app_exceptionN)r   main_dgr   
_exception)exmain_delta_generators     r   _show_exceptionrF   O   s$    46>>-rTRr   c                    d}t        j                  d      r	 t        |        d}|st        j                  d|        t        |        y# t        $ r d}Y 2w xY w)zHandle an exception that originated from a user app.

    By default, we show exceptions directly in the browser. However,
    if the user has disabled client error details, we display a generic
    warning in the frontend instead.
    Fzlogger.enableRichTzUncaught app execution)exc_infoN)r   
get_optionr?   	Exceptionr
   errorrF   )rD   error_loggeds     r   handle_uncaught_app_exceptionrM   U   sb     L,-
	! ""%L .<B  	! !L		!s   A AA)r<   BaseExceptionr   r   )rD   rN   r   r   )
__future__r   typingr   r   r;   r   $streamlit.delta_generator_singletonsr   streamlit.elementsr   streamlit.loggerr	   r   r
   __annotations__r?   rF   rM    r   r   <module>rV      s<    #    J ( 'H% %0fSr   