
    Pi                     h   d dl mZ d dlmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZmZ erdd	lmZmZ d
ddd
d
d
d
ddddee         dededee         dee         dee         ded         ddfdZedk    r2d dlmZ  e             dededd
fdZ ed d!            e             d
S d
S )"    )Mapping)TYPE_CHECKINGAnyOptionalTuple   )ReprHighlighter)Panel)Pretty)Table)TextTextType)ConsoleRenderableOverflowMethodNTF)title	sort_keysindent_guides
max_length
max_string	max_depthoverflowscopezMapping[str, Any]r   r   r   r   r   r   r   r   returnr   c                D   t                      }t          j        dd          }	|	                    d           dt          t
          t          f         dt          t          t
          f         fd}
|r#t          | 	                                |
	          n| 	                                }|D ]]\  }}t          j        ||                    d
          rdndfd          }|	                    |t          |||||||                     ^t          j        |	|dd          S )a  Render python variables in a given scope.

    Args:
        scope (Mapping): A mapping containing variable names and values.
        title (str, optional): Optional title. Defaults to None.
        sort_keys (bool, optional): Enable sorting of items. Defaults to True.
        indent_guides (bool, optional): Enable indentation guides. Defaults to False.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.
        max_depth (int, optional): Maximum depths of locals before truncating, or None to disable. Defaults to None.
        overflow (OverflowMethod, optional): How to handle overflowing locals, or None to disable. Defaults to None.

    Returns:
        ConsoleRenderable: A renderable object.
    )r   r   F)paddingexpandright)justifyitemr   c                 `    | \  }}|                     d           |                                fS )z2Sort special variables first, then alphabetically.__)
startswithlower)r   key_s      ^/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/rich/scope.py
sort_itemsz render_scope.<locals>.sort_items-   s-    QNN4(((#))++66    )r$   r!   zscope.key.specialz	scope.key)z =zscope.equals)highlighterr   r   r   r   r   zscope.border)r   border_styler   )r	   r   grid
add_columnr   strr   boolsorteditemsr   assembler"   add_rowr   r
   fit)r   r   r   r   r   r   r   r   r)   items_tabler'   r0   r$   valuekey_texts                  r&   render_scoper7      sQ   6 "##K*VE:::K7+++7sCx 7U49-= 7 7 7 7
 6?QF5;;==j1111EKKMME 
 

U=)=)=N%%;O"
 
 	'+%%#!  	
 	
 	
 	
 9#	   r(   __main__)printfoobarc                 z    g d}ddg ddgdd}t          t          t                      dd	
                     d S )N)r         N   TFzHello Worldz1.1confirmFruitPurchase)appleorangemangoespomelog+?	194521489)versionmethodparamsidz	[i]localsF)r   r   )r9   r7   locals)r:   r;   list_of_thingsdict_of_thingss       r&   testrM   Q   sY    GGG,???G	
 
 	l688;%HHHIIIIIr(   gk	W4@g?$	@)collections.abcr   typingr   r   r   r   r)   r	   panelr
   prettyr   tabler   textr   r   consoler   r   r.   intr7   __name__richr9   floatrM    r(   r&   <module>rZ      s   # # # # # # 6 6 6 6 6 6 6 6 6 6 6 6 ( ( ( ( ( (                                   ;:::::::: !% $ $#+/; ; ;; H; 	;
 ; ; ; }; '(; ; ; ; ;| z	EGGGJ% Je J J J J J 	D&	EGGGGG! r(   