o
    Ëý°jT= ã                   @   sD  U d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dl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 d d	lmZ d d
lmZ d dlmZ d dlmZmZmZ d dlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ej+dkr‘d dlm,Z,m-Z-m.Z. n
d dl/m,Z,m-Z-m.Z. ddl0m1Z1m2Z2 ddl3m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZAmBZB ddlCmDZE ddlFmGZGmHZH ddlImJZJmKZK ddlLmMZMmNZN ddlOmPZP ddlQmRZR ddlSmTZT dd lUmVZV dd!lWmXZX dd"lYmZZZm[Z[ dd#l\m]Z] dd$l^m_Z_m`Z` dd%lambZbmcZc dd&ldmeZemfZf e�rJdd'lgmhZh dd(limjZj dd)lkmlZl e m¡ d*kZnee)eod+f gd+f Zpe,d, Zqe,d- ZrG d.d/„ d/ƒZsesƒ Ztd0Zue;jve;jwd1œZxG d2d3„ d3e$ƒZye	G d4d5„ d5ƒƒZze.G d6d7„ d7e-ƒƒZ{e.G d8d9„ d9e-ƒƒZ|e)e|e{eof Z}e!e)e}eXf  Z~eAƒ ZG d:d;„ d;e€ƒZ�G d<d=„ d=ƒZ‚G d>d?„ d?ƒZƒG d@dA„ dAƒZ„G dBdC„ dCƒZ…G dDdE„ dEƒZ†G dFdG„ dGƒZ‡G dHdI„ dIƒZˆd€dKe‰dLedMedMeˆf f fdNdO„ZŠdLe‰fdPdQ„Z‹e;jwe;jve;jŒe;jndRœZ�dSdT„ e� Ž¡ D ƒZ�e	G dUdV„ dVej�ƒƒZ‘G dWdX„ dXeƒZ’da“e%dY e”dZ< d�d[d\„Z•dLe‰fd]d^„Z–e–ƒ �rId d_l—m˜Z˜ e˜d`da� G dbdc„ dcƒZ™ešddk�r e™ƒ Z›e› œdedfdgdJd`ddhdidjdkdlœdmdnœ¡ e› œdodpe�e›ƒ¡ e› ždg dJdqg dr¢dsdtœduœd`dvg dw¢dxdtœdyg dz¢d{dtœd|œd}œd~œ¡ e› œd¡ dS dS )‚é    N)ÚABCÚabstractmethod)Ú	dataclassÚfield)Údatetime)Úwraps)Úgetpass)Úescape)Úisclass)Úislice)ÚRLock)Ú	monotonic)Ú	FrameTypeÚ
ModuleTypeÚTracebackType)ÚIOÚTYPE_CHECKINGÚAnyÚCallableÚDictÚIterableÚListÚMappingÚ
NamedTupleÚOptionalÚTextIOÚTupleÚTypeÚUnionÚcast)é   é   )ÚLiteralÚProtocolÚruntime_checkableé   )ÚerrorsÚthemes)Ú_emoji_replace)ÚFormatTimeCallableÚ	LogRender)ÚAlignÚAlignMethod)ÚColorSystem)ÚControl)ÚEmojiVariant)ÚNullHighlighterÚReprHighlighter©Úrender)ÚMeasurementÚmeasure_renderables)ÚPagerÚSystemPager)ÚPrettyÚis_expandable)Ú	rich_cast)ÚRegion)Úrender_scope)ÚScreen)ÚSegment)ÚStyleÚ	StyleType©ÚStyled)ÚDEFAULT_TERMINAL_THEMEÚTerminalTheme)ÚTextÚTextType)ÚThemeÚ
ThemeStack)ÚWindowsConsoleFeatures)ÚLive©ÚStatusÚWindowsrE   )ÚdefaultÚleftÚcenterÚrightÚfull)ÚfoldÚcropÚellipsisÚignorec                   @   s   e Zd ZdS )ÚNoChangeN)Ú__name__Ú
__module__Ú__qualname__© r[   r[   ú‹/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/pip/_vendor/rich/console.pyrW   O   s    rW   a9  <!DOCTYPE html>
<head>
<meta charset="UTF-8">
<style>
{stylesheet}
body {{
    color: {foreground};
    background-color: {background};
}}
</style>
</head>
<html>
<body>
    <code>
        <pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
    </code>
</body>
</html>
)Ú256colorÚ16colorc                   @   s$   e Zd ZU dZeed< 	 eed< dS )ÚConsoleDimensionszSize of the terminal.ÚwidthÚheightN)rX   rY   rZ   Ú__doc__ÚintÚ__annotations__r[   r[   r[   r\   r_   n   s   
 r_   c                   @   sÀ  e Zd ZU dZeed< 	 eed< 	 eed< 	 eed< 	 eed< 	 eed< 	 eed< 	 d	Z	e
e ed
< 	 d	Ze
e ed< 	 dZe
e ed< 	 d	Ze
e ed< 	 d	Ze
e ed< 	 d	Ze
e ed< edefdd„ƒZd dd„Zeeeeeeeeedœ	deeef deeef deeef d
ee
e ef dee
e ef dee
e ef dee
e ef dee
e ef dee
e ef dd fdd„Zdedd fdd„Zdedd fdd„Zdededd fdd„Zd	S )!ÚConsoleOptionsz$Options for __rich_console__ method.ÚsizeÚlegacy_windowsÚ	min_widthÚ	max_widthÚis_terminalÚencodingÚ
max_heightNÚjustifyÚoverflowFÚno_wrapÚ	highlightÚmarkupra   Úreturnc                 C   s   | j  d¡ S )z+Check if renderables should use ascii only.Úutf)rk   Ú
startswith©Úselfr[   r[   r\   Ú
ascii_only•   s   zConsoleOptions.ascii_onlyc                 C   s   t  t ¡}| j ¡ |_|S )zdReturn a copy of the options.

        Returns:
            ConsoleOptions: a copy of self.
        )re   Ú__new__Ú__dict__Úcopy)rv   Úoptionsr[   r[   r\   rz   š   s   
zConsoleOptions.copy)	r`   rh   ri   rm   rn   ro   rp   rq   ra   r`   c       	         C   sÈ   |   ¡ }
t|tƒstd|ƒ |
_|
_t|tƒs||
_t|tƒs"||
_t|tƒs*||
_t|tƒs2||
_t|tƒs:||
_t|tƒsB||
_	t|tƒsJ||
_
t|	tƒsb|	durV|	|
_|	du r\dntd|	ƒ|
_|
S )zUpdate values, return a copy.r   N)rz   Ú
isinstancerW   Úmaxrh   ri   rm   rn   ro   rp   rq   rl   ra   )rv   r`   rh   ri   rm   rn   ro   rp   rq   ra   r{   r[   r[   r\   Úupdate¤   s,   








zConsoleOptions.updatec                 C   s   |   ¡ }td|ƒ |_|_|S )zÑUpdate just the width, return a copy.

        Args:
            width (int): New width (sets both min_width and max_width)

        Returns:
            ~ConsoleOptions: New console options instance.
        r   )rz   r}   rh   ri   )rv   r`   r{   r[   r[   r\   Úupdate_widthÉ   s   	zConsoleOptions.update_widthc                 C   s   |   ¡ }| |_|_|S )z¯Update the height, and return a copy.

        Args:
            height (int): New height

        Returns:
            ~ConsoleOptions: New Console options instance.
        )rz   rl   ra   )rv   ra   r{   r[   r[   r\   Úupdate_heightÖ   s   	zConsoleOptions.update_heightc                 C   s*   |   ¡ }td|ƒ |_|_| |_|_|S )a  Update the width and height, and return a copy.

        Args:
            width (int): New width (sets both min_width and max_width).
            height (int): New height.

        Returns:
            ~ConsoleOptions: New console options instance.
        r   )rz   r}   rh   ri   ra   rl   )rv   r`   ra   r{   r[   r[   r\   Úupdate_dimensionsã   s   
z ConsoleOptions.update_dimensions)rr   re   )rX   rY   rZ   rb   r_   rd   Úboolrc   Ústrrm   r   ÚJustifyMethodrn   ÚOverflowMethodro   rp   rq   ra   Úpropertyrw   rz   Ú	NO_CHANGEr   rW   r~   r   r€   r�   r[   r[   r[   r\   re   w   s~   
 
õ
ý
ü
ûúùø	÷
öõ
ô%re   c                   @   s&   e Zd ZdZdedef fdd„ZdS )ÚRichCastz5An object that may be 'cast' to a console renderable.rr   ÚConsoleRenderablec                 C   ó   d S ©Nr[   ru   r[   r[   r\   Ú__rich__÷   s   zRichCast.__rich__N)rX   rY   rZ   rb   r   rƒ   rŒ   r[   r[   r[   r\   rˆ   ó   s    rˆ   c                   @   s&   e Zd ZdZ						ddd	„Zd
S )r‰   z-An object that supports the console protocol.ÚconsoleÚConsoler{   re   rr   ÚRenderResultc                 C   rŠ   r‹   r[   ©rv   r�   r{   r[   r[   r\   Ú__rich_console__ÿ   s   z"ConsoleRenderable.__rich_console__N)r�   rŽ   r{   re   rr   r�   )rX   rY   rZ   rb   r‘   r[   r[   r[   r\   r‰   û   s    ÿÿþr‰   c                   @   s   e Zd ZdZdS )ÚCaptureErrorz(An error in the Capture context manager.N)rX   rY   rZ   rb   r[   r[   r[   r\   r’     s    r’   c                   @   s>   e Zd ZdZddeddfdd„Zdd	d
ddee fdd„ZdS )ÚNewLinez$A renderable to generate new line(s)r%   Úcountrr   Nc                 C   s
   || _ d S r‹   )r”   ©rv   r”   r[   r[   r\   Ú__init__  s   
zNewLine.__init__r�   rŽ   r{   re   c                 c   s   � t d| j ƒV  d S )NÚ
)r>   r”   r�   r[   r[   r\   r‘     s   €zNewLine.__rich_console__©r%   )	rX   rY   rZ   rb   rc   r–   r   r>   r‘   r[   r[   r[   r\   r“     s    ÿÿþr“   c                   @   sH   e Zd ZdZdeee  dededdfdd„Zd	d
dede	fdd„Z
dS )ÚScreenUpdatez)Render a list of lines at a given offset.ÚlinesÚxÚyrr   Nc                 C   ó   || _ || _|| _d S r‹   )Ú_linesr›   rœ   )rv   rš   r›   rœ   r[   r[   r\   r–   #  ó   
zScreenUpdate.__init__r�   rŽ   r{   c                 c   s@   � | j }tj}t| j| jƒD ]\}}|||ƒV  |E d H  qd S r‹   )r›   r.   Úmove_toÚ	enumeraterž   rœ   )rv   r�   r{   r›   r    ÚoffsetÚliner[   r[   r\   r‘   (  s   €þzScreenUpdate.__rich_console__)rX   rY   rZ   rb   r   r>   rc   r–   re   r�   r‘   r[   r[   r[   r\   r™      s    "ÿÿþr™   c                   @   s\   e Zd ZdZddd„Zddd	„Zd
eee  dee dee	 ddfdd„Z
defdd„ZdS )ÚCapturezÐContext manager to capture the result of printing to the console.
    See :meth:`~rich.console.Console.capture` for how to use.

    Args:
        console (Console): A console instance to capture output.
    r�   rŽ   rr   Nc                 C   s   || _ d | _d S r‹   )Ú_consoleÚ_result)rv   r�   r[   r[   r\   r–   :  s   
zCapture.__init__c                 C   ó   | j  ¡  | S r‹   )r¥   Úbegin_captureru   r[   r[   r\   Ú	__enter__>  ó   
zCapture.__enter__Úexc_typeÚexc_valÚexc_tbc                 C   s   | j  ¡ | _d S r‹   )r¥   Úend_capturer¦   ©rv   r«   r¬   r­   r[   r[   r\   Ú__exit__B  s   zCapture.__exit__c                 C   s   | j du r	tdƒ‚| j S )zGet the result of the capture.Nz<Capture result is not available until context manager exits.)r¦   r’   ru   r[   r[   r\   ÚgetJ  s
   
ÿzCapture.get)r�   rŽ   rr   N)rr   r¤   )rX   rY   rZ   rb   r–   r©   r   r   ÚBaseExceptionr   r°   rƒ   r±   r[   r[   r[   r\   r¤   2  s    


þýü
ûr¤   c                	   @   s`   e Zd ZdZddddededdfd	d
„Zddd„Zdee	e
  dee
 dee ddfdd„ZdS )ÚThemeContextzbA context manager to use a temporary theme. See :meth:`~rich.console.Console.use_theme` for usage.Tr�   rŽ   ÚthemeÚinheritrr   Nc                 C   r�   r‹   )r�   r´   rµ   )rv   r�   r´   rµ   r[   r[   r\   r–   V  rŸ   zThemeContext.__init__c                 C   s   | j  | j¡ | S r‹   )r�   Ú
push_themer´   ru   r[   r[   r\   r©   [  s   zThemeContext.__enter__r«   r¬   r­   c                 C   s   | j  ¡  d S r‹   )r�   Ú	pop_themer¯   r[   r[   r\   r°   _  s   zThemeContext.__exit__©T)rr   r³   )rX   rY   rZ   rb   rG   r‚   r–   r©   r   r   r²   r   r°   r[   r[   r[   r\   r³   S  s    

þýüûr³   c                   @   sn   e Zd ZdZ			ddddee deded	df
d
d„Zddd„Zdee	e
  dee
 dee d	dfdd„ZdS )ÚPagerContextzZA context manager that 'pages' content. See :meth:`~rich.console.Console.pager` for usage.NFr�   rŽ   ÚpagerÚstylesÚlinksrr   c                 C   s*   || _ |d u r
tƒ n|| _|| _|| _d S r‹   )r¥   r7   rº   r»   r¼   )rv   r�   rº   r»   r¼   r[   r[   r\   r–   k  s   
zPagerContext.__init__c                 C   r§   r‹   )r¥   Ú_enter_bufferru   r[   r[   r\   r©   w  rª   zPagerContext.__enter__r«   r¬   r­   c                 C   sš   |d u rF| j j�0 | j jd d … }| j jd d …= |}| js#t |¡}n| js+t |¡}| j  |¡}W d   ƒ n1 s;w   Y  | j	 
|¡ | j  ¡  d S r‹   )r¥   Ú_lockÚ_bufferr»   r>   Ústrip_stylesr¼   Ústrip_linksÚ_render_bufferrº   ÚshowÚ_exit_buffer)rv   r«   r¬   r­   ÚbufferÚsegmentsÚcontentr[   r[   r\   r°   {  s   

ø	zPagerContext.__exit__©NFF)rr   r¹   )rX   rY   rZ   rb   r   r6   r‚   r–   r©   r   r²   r   r°   r[   r[   r[   r\   r¹   h  s4    ûþýüû
ú

þýüûr¹   c                	   @   s‚   e Zd ZdZ	ddddededdfd	d
„Zddœdedee ddfdd„Z	ddd„Z
deee  dee dee ddfdd„ZdS )ÚScreenContextziA context manager that enables an alternative screen. See :meth:`~rich.console.Console.screen` for usage.Ú r�   rŽ   Úhide_cursorÚstylerr   Nc                 C   s"   || _ || _t|d�| _d| _d S )N©rÌ   F)r�   rË   r=   ÚscreenÚ_changed)rv   r�   rË   rÌ   r[   r[   r\   r–   ’  s   
zScreenContext.__init__rÍ   Úrenderablesc                G   sJ   |rt |ƒdkrt|Ž n|d | j_|dur|| j_| jj| jdd� dS )a+  Update the screen.

        Args:
            renderable (RenderableType, optional): Optional renderable to replace current renderable,
                or None for no change. Defaults to None.
            style: (Style, optional): Replacement style, or None for no change. Defaults to None.
        r%   r   NrÊ   )Úend)ÚlenÚGrouprÎ   Ú
renderablerÌ   r�   Úprint)rv   rÌ   rÐ   r[   r[   r\   r~   š  s   
ÿzScreenContext.updatec                 C   s*   | j  d¡| _| jr| jr| j  d¡ | S )NTF)r�   Úset_alt_screenrÏ   rË   Úshow_cursorru   r[   r[   r\   r©   ¬  s   zScreenContext.__enter__r«   r¬   r­   c                 C   s0   | j r| j d¡ | jr| j d¡ d S d S d S )NFT)rÏ   r�   rÖ   rË   r×   r¯   r[   r[   r\   r°   ²  s   ýzScreenContext.__exit__©rÊ   )rr   rÉ   )rX   rY   rZ   rb   r‚   r@   r–   ÚRenderableTyper   r~   r©   r   r²   r   r°   r[   r[   r[   r\   rÉ   �  s<    ÿÿÿÿ
þ	ÿÿÿ
þ

þýüûrÉ   c                   @   sn   e Zd ZdZddœdddeddfd	d
„Zeded fdd„ƒZ						ddd„Z	ddddde
fdd„ZdS )rÓ   a$  Takes a group of renderables and returns a renderable object that renders the group.

    Args:
        renderables (Iterable[RenderableType]): An iterable of renderable objects.
        fit (bool, optional): Fit dimension of group to contents, or fill available space. Defaults to True.
    T©ÚfitrÐ   rÙ   rÛ   rr   Nc                G   s   || _ || _d | _d S r‹   )Ú_renderablesrÛ   Ú_render)rv   rÛ   rÐ   r[   r[   r\   r–   Æ  rŸ   zGroup.__init__c                 C   s   | j d u rt| jƒ| _ | j S r‹   )rÝ   ÚlistrÜ   ru   r[   r[   r\   rÐ   Ë  s   
zGroup.renderablesr�   rŽ   r{   re   r4   c                 C   s"   | j r
t||| jƒS t|j|jƒS r‹   )rÛ   r5   rÐ   r4   ri   r�   r[   r[   r\   Ú__rich_measure__Ñ  s   zGroup.__rich_measure__c                 c   s   � | j E d H  d S r‹   )rÐ   r�   r[   r[   r\   r‘   Ù  s   €zGroup.__rich_console__)r�   rŽ   r{   re   rr   r4   )rX   rY   rZ   rb   r‚   r–   r†   r   rÐ   rß   r�   r‘   r[   r[   r[   r\   rÓ   ¾  s&    ÿÿ
þÿÿþrÓ   TrÛ   rr   .c                    s.   dt dtt f dt dtf f‡ fdd„}|S )z½A decorator that turns an iterable of renderables in to a group.

    Args:
        fit (bool, optional): Fit dimension of group to contents, or fill available space. Defaults to True.
    Úmethod.rr   c                    s(   t ˆ ƒdtdtdtf‡‡ fdd„ƒ}|S )zGConvert a method that returns an iterable of renderables in to a Group.ÚargsÚkwargsrr   c                     s   ˆ| i |¤Ž}t |dˆ iŽS )NrÛ   )rÓ   )rá   râ   rÐ   )rÛ   rà   r[   r\   Ú_replaceë  s   z*group.<locals>.decorator.<locals>._replace)r   r   rÓ   )rà   rã   rÚ   )rà   r\   Ú	decoratoræ  s   zgroup.<locals>.decorator)r   r   rÙ   rÓ   )rÛ   rä   r[   rÚ   r\   Úgroupß  s   ÿ
þrå   c                  C   sV   zt  W n
 ty   Y dS w t ƒ } | jj}dt| jƒv s!|dkr#dS |dkr)dS dS )z-Check if we're running in a Jupyter notebook.Fzgoogle.colabÚZMQInteractiveShellTÚTerminalInteractiveShell)Úget_ipythonÚ	NameErrorÚ	__class__rX   rƒ   )ÚipythonÚshellr[   r[   r\   Ú_is_jupyterõ  s   ÿrí   )ÚstandardÚ256Ú	truecolorÚwindowsc                 C   s   i | ]\}}||“qS r[   r[   )Ú.0ÚnameÚsystemr[   r[   r\   Ú
<dictcomp>  ó    rõ   c                   @   s<   e Zd ZU dZeed< eed�Ze	e
 ed< dZeed< dS )ÚConsoleThreadLocalsz(Thread local values for Console context.Útheme_stack)Údefault_factoryrÅ   r   Úbuffer_indexN)rX   rY   rZ   rb   rH   rd   r   rÞ   rÅ   r   r>   rú   rc   r[   r[   r[   r\   r÷     s
   
 r÷   c                   @   s.   e Zd ZdZedee dee fdd„ƒZdS )Ú
RenderHookz(Provides hooks in to the render process.rÐ   rr   c                 C   s   dS )aL  Called with a list of objects to render.

        This method can return a new list of renderables, or modify and return the same list.

        Args:
            renderables (List[ConsoleRenderable]): A number of renderable objects.

        Returns:
            List[ConsoleRenderable]: A replacement list of renderables.
        Nr[   )rv   rÐ   r[   r[   r\   Úprocess_renderables  s    zRenderHook.process_renderablesN)rX   rY   rZ   rb   r   r   r‰   rü   r[   r[   r[   r\   rû     s    ÿþrû   rI   Ú_windows_console_featuresc                  C   s"   t d urt S ddlm}  | ƒ a t S )Nr%   ©Úget_windows_console_features)rý   Ú_windowsrÿ   rþ   r[   r[   r\   rÿ   /  s
   rÿ   c                   C   s   t otƒ j S )zDetect legacy Windows.)ÚWINDOWSrÿ   Úvtr[   r[   r[   r\   Údetect_legacy_windows9  ó   r  )ÚinitF)Ústripc                <   @   s
  e Zd ZU dZejZeeef e	d< dddddddddddddddddddddde
ƒ dddddd	œd
eed  dee dee dee dedee dedeee  dedee dee dee dee dededededee dededed eeef d!ed" d#ee d$ed%eeg ef  d&eeg ef  deeeef  f8d'd(„Zd)efd*d+„Zed)ee fd,d-„ƒZejd.ee d)dfd/d-„ƒZed)ee fd0d1„ƒZed)efd2d3„ƒZ e jd4ed)dfd5d3„ƒZ ed)e!fd6d7„ƒZ"d)ee# fd8d9„Z$�dd:d;„Z%�dd<d=„Z&�dd@dA„Z'�ddBdC„Z(dDe)d)dfdEdF„Z*�ddGdH„Z+�ddIdJ„Z,dKe-dLe-dMe-d)dfdNdO„Z.�ddPdQ„Z/d)efdRdS„Z0ddTœdedUed)dfdVdW„Z1�ddXdY„Z2ddTœdedUed)e3fdZd[„Z4ed)ee fd\d]„ƒZ5ed)efd^d_„ƒZ6ed)efd`da„ƒZ7ed)efdbdc„ƒZ8ed)e9fddde„ƒZ:ed)e;fdfdg„ƒZ<e<jdhe=eef d)dfdidg„ƒZ<ed)efdjdk„ƒZ>e>jded)dfdldk„ƒZ>ed)efdmdn„ƒZ?e?jded)dfdodn„ƒZ?�ddpdq„Z@d)eAfdrds„ZB	�ddteeC duedved)eDfdwdx„ZE�ddzed)dfd{d|„ZF�dd}ed)dfd~d„ZGd€d�d‚dƒd„œd…eHd†ed‡edˆed‰ed)dŠfd‹dŒ„ZI�dd�ed)efdŽd�„ZJ�dd�ed)efd‘d’„ZKed)efd“d”„ƒZL	�dd•edee d)d–fd—d˜„ZMdd™œdšeHd›ee9 d)eNfdœd�„ZO	�ddšeHd›ee9 d)ePe fdždŸ„ZQ	�ddddd œdšeHd›ee9 deeR d¡ed¢ed)eee  fd£d¤„ZSd¥ddddddd¦œd§edeeeRf d¨eeT d©eeU dee dee dee d!eeV d)dªfd«d¬„ZWdd­œd®eeeRf d¯eeeRef  d)eRfd°d±„ZXddddd²œd³ePe- d´edµed¨eeT dee dee dee d)eeY fd¶d·„ZZ	¥�dd¸d¹dºd»œd¼e[d½edeeeRf d¾e\d)df
d¿dÀ„Z]dÁe^d)dfdÂdÃ„Z_dÄdÅdddÆœd³e-d´edµedeeeeRf  dee d)dfdÇdÈ„Z`dÄdÅdddddddddddddÉœd³e-d´edµedeeeeRf  d¨eeT d©eeU dÊee dee dee dee dee dee dËedee dÌed)df dÍdÎ„Za	�dddÏddddddddÐœ	dÑee dÒe-dÓedeef dedÔedÕedÖed×ed¯eee-ge-f  dØed)dfdÙdÚ„ZbdddÛœdšeHdÜeec d›ee9 d)dfdÝdÞ„Zd	ß�ddàeee  dáedâed)dfdãdä„Zedådæddddçdådèœdee déedee dêedëedìePeeeff  díed)dfdîdï„Zgeheijjfdðedñeg eek f d)e=eeelee-f f fdòdó„ƒZmdÄdÅdddddddydôœ	d³e-d´edµedeeeeRf  d¨eeT dee dee dee dõedöed)dfd÷dø„Zn�ddùdú„ZodûePe d)efdüdý„Zp	¥�ddddddþœdÿe[dede�d e�deeq d)ef�d�d„Zrdd�dœ�dedued)ef�d�d„Zsdd�dœ�de�dedued)df�d	�d
„Ztdddd�dœdeeu �de�dee �ded)ef
�d�d„Zvddewd�dœ�dedeeu �de�de�ded)df�d�d„ZxdS (  rŽ   a]  A high level console interface.

    Args:
        color_system (str, optional): The color system supported by your terminal,
            either ``"standard"``, ``"256"`` or ``"truecolor"``. Leave as ``"auto"`` to autodetect.
        force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect terminal. Defaults to None.
        force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter. Defaults to None.
        force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto detect. Defaults to None.
        soft_wrap (Optional[bool], optional): Set soft wrap default on print method. Defaults to False.
        theme (Theme, optional): An optional style theme object, or ``None`` for default theme.
        stderr (bool, optional): Use stderr rather than stdout if ``file`` is not specified. Defaults to False.
        file (IO, optional): A file object where the console should write to. Defaults to stdout.
        quiet (bool, Optional): Boolean to suppress all output. Defaults to False.
        width (int, optional): The width of the terminal. Leave as default to auto-detect width.
        height (int, optional): The height of the terminal. Leave as default to auto-detect height.
        style (StyleType, optional): Style to apply to all output, or None for no style. Defaults to None.
        no_color (Optional[bool], optional): Enabled no color mode, or None to auto detect. Defaults to None.
        tab_size (int, optional): Number of spaces used to replace a tab character. Defaults to 8.
        record (bool, optional): Boolean to enable recording of terminal output,
            required to call :meth:`export_html` and :meth:`export_text`. Defaults to False.
        markup (bool, optional): Boolean to enable :ref:`console_markup`. Defaults to True.
        emoji (bool, optional): Enable emoji code. Defaults to True.
        emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None.
        highlight (bool, optional): Enable automatic highlighting. Defaults to True.
        log_time (bool, optional): Boolean to enable logging of time by :meth:`log` methods. Defaults to True.
        log_path (bool, optional): Boolean to enable the logging of the caller by :meth:`log`. Defaults to True.
        log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%X] ".
        highlighter (HighlighterType, optional): Default highlighter.
        legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto detect. Defaults to ``None``.
        safe_box (bool, optional): Restrict box options that don't render on legacy Windows.
        get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime object (used by Console.log),
            or None for datetime.now.
        get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses time.monotonic.
    Ú_environÚautoNFr!   Tz[%X])Úcolor_systemÚforce_terminalÚforce_jupyterÚforce_interactiveÚ	soft_wrapr´   ÚstderrÚfileÚquietr`   ra   rÌ   Úno_colorÚtab_sizeÚrecordrq   ÚemojiÚemoji_variantrp   Úlog_timeÚlog_pathÚlog_time_formatÚhighlighterrg   Úsafe_boxÚget_datetimeÚget_timer  r	  )r  rî   rï   rð   rñ   r
  r  r  r  r´   r  r  r  r`   ra   rÌ   r  r  r  rq   r  r  rp   r  r  r  r  ÚHighlighterTyperg   r  r  r  c                C   s  |d ur|| _ |d u rtƒ n|| _| jr|
pd}
|pd}|| _|
| _|| _|| _|| _|| _|| _	|| _
|| _|d u rBtƒ oA| j n|| _|
d u r^| j  d¡}|d ur^| ¡ r^t|ƒ| j }
|d u rt| j  d¡}|d urt| ¡ rtt|ƒ}|| _|
| _|| _|  || _|| _|	| _|| _|d u r“d | _n|dkr�|  ¡ | _nt| | _t ¡ | _t|||d�| _|p²t| _|| _|p»t j!| _"|pÀt#| _$|| _%|d urË|nd| j v | _&|d u rÜ| j'oÛ| j( n|| _)t ¡ | _*t+t,|d u rít-j.n|ƒd�| _/g | _0g | _1d | _2d	| _3d S )
Né]   éd   ÚCOLUMNSÚLINESr  )Ú	show_timeÚ	show_pathÚtime_formatÚNO_COLOR)rø   F)4r  rí   Ú
is_jupyterr  Ú_widthÚ_heightr  r  Ú_markupÚ_emojiÚ_emoji_variantÚ
_highlightr  rg   r±   Úisdigitrc   Ú_force_terminalÚ_filer  r  Ú_color_systemÚ_detect_color_systemÚCOLOR_SYSTEMSÚ	threadingr   r¾   r*   Ú_log_renderÚ_null_highlighterr  r  r   Únowr  r   r  rÌ   r  rj   Úis_dumb_terminalÚis_interactiveÚ_record_buffer_lockr÷   rH   r'   ÚDEFAULTÚ_thread_localsÚ_record_bufferÚ_render_hooksÚ_liveÚ_is_alt_screen)rv   r	  r
  r  r  r  r´   r  r  r  r`   ra   rÌ   r  r  r  rq   r  r  rp   r  r  r  r  rg   r  r  r  r  Úcolumnsrš   r[   r[   r\   r–   j  s†   #ÿ€ý

ý

ÿÿ€ý
ÿ
zConsole.__init__rr   c                 C   s   d| j › dt| jƒ› d�S )Nz<console width=ú ú>)r`   rƒ   r0  ru   r[   r[   r\   Ú__repr__Ú  s   zConsole.__repr__c                 C   s(   | j p| jr	tjntj}t|d|ƒ}|S )z Get the file object to write to.Úrich_proxied_file)r/  r  ÚsysÚstdoutÚgetattr)rv   r  r[   r[   r\   r  Ý  s   zConsole.fileÚnew_filec                 C   ó
   || _ dS )zSet a new file object.N)r/  )rv   rH  r[   r[   r\   r  ä  s   
c                 C   ó   | j jS ©zGet a thread local buffer.)r;  rÅ   ru   r[   r[   r\   r¿   é  ó   zConsole._bufferc                 C   rJ  rK  ©r;  rú   ru   r[   r[   r\   Ú_buffer_indexî  rL  zConsole._buffer_indexÚvaluec                 C   s   || j _d S r‹   rM  )rv   rO  r[   r[   r\   rN  ó  ó   c                 C   rJ  )z!Get the thread local theme stack.)r;  rø   ru   r[   r[   r\   Ú_theme_stack÷  rL  zConsole._theme_stackc                 C   s    | j rtjS | jr| jrdS tr"| jrtjS tƒ }|jrtjS tj	S | j
 dd¡ ¡  ¡ }|dv r4tjS | j
 dd¡ ¡  ¡ }| d¡\}}}t |tj¡}|S )z"Detect color system from env vars.NÚ	COLORTERMrÊ   )rð   Ú24bitÚTERMú-)r&  r-   Ú	TRUECOLORrj   r7  r  rg   rÿ   rð   Ú	EIGHT_BITr  r±   r  ÚlowerÚ
rpartitionÚ_TERM_COLORSÚSTANDARD)rv   Úwindows_console_featuresÚ
color_termÚtermÚ
_term_nameÚ_hyphenÚcolorsr	  r[   r[   r\   r1  ü  s(   ÿÿýzConsole._detect_color_systemc                 C   s   |  j d7  _ dS )z4Enter in to a buffer context, and buffer all output.r%   N)rN  ru   r[   r[   r\   r½     ó   zConsole._enter_bufferc                 C   s   |  j d8  _ |  ¡  dS )z5Leave buffer context, and render content if required.r%   N)rN  Ú_check_bufferru   r[   r[   r\   rÄ     s   zConsole._exit_bufferÚliverJ   c                 C   sF   | j � | jdurt d¡‚|| _W d  ƒ dS 1 sw   Y  dS )zçSet Live instance. Used by Live context manager.

        Args:
            live (Live): Live instance using this Console.

        Raises:
            errors.LiveError: If this Console has a Live context currently active.
        Nz+Only one live display may be active at once)r¾   r>  r&   Ú	LiveError)rv   rd  r[   r[   r\   Úset_live  s
   	

"ýzConsole.set_livec                 C   s2   | j � d| _W d  ƒ dS 1 sw   Y  dS )zClear the Live instance.N)r¾   r>  ru   r[   r[   r\   Ú
clear_live+  s   "ÿzConsole.clear_liveÚhookc                 C   s8   | j � | j |¡ W d  ƒ dS 1 sw   Y  dS )zpAdd a new render hook to the stack.

        Args:
            hook (RenderHook): Render hook instance.
        N)r¾   r=  Úappend)rv   rh  r[   r[   r\   Úpush_render_hook0  s   "ÿzConsole.push_render_hookc                 C   s6   | j � | j ¡  W d  ƒ dS 1 sw   Y  dS )z'Pop the last renderhook from the stack.N)r¾   r=  Úpopru   r[   r[   r\   Úpop_render_hook9  s   "ÿzConsole.pop_render_hookc                 C   s   |   ¡  | S )z,Own context manager to enter buffer context.©r½   ru   r[   r[   r\   r©   >  s   zConsole.__enter__r«   Ú	exc_valueÚ	tracebackc                 C   ó   |   ¡  dS )zExit buffer context.N)rÄ   )rv   r«   rn  ro  r[   r[   r\   r°   C  rP  zConsole.__exit__c                 C   rp  )z`Begin capturing console output. Call :meth:`end_capture` to exit capture mode and return output.Nrm  ru   r[   r[   r\   r¨   G  rP  zConsole.begin_capturec                 C   s$   |   | j¡}| jdd…= |  ¡  |S )zhEnd capture mode and return captured string.

        Returns:
            str: Console output.
        N)rÂ   r¿   rÄ   )rv   Úrender_resultr[   r[   r\   r®   K  s   zConsole.end_capture©rµ   rµ   c                C   s   | j j||d� dS )a�  Push a new theme on to the top of the stack, replacing the styles from the previous theme.
        Generally speaking, you should call :meth:`~rich.console.Console.use_theme` to get a context manager, rather
        than calling this method directly.

        Args:
            theme (Theme): A theme instance.
            inherit (bool, optional): Inherit existing styles. Defaults to True.
        rr  N)rQ  r¶   ©rv   r´   rµ   r[   r[   r\   r¶   V  s   	zConsole.push_themec                 C   s   | j  ¡  dS )z9Remove theme from top of stack, restoring previous theme.N)rQ  r·   ru   r[   r[   r\   r·   a  r  zConsole.pop_themec                C   s   t | ||ƒS )a  Use a different theme for the duration of the context manager.

        Args:
            theme (Theme): Theme instance to user.
            inherit (bool, optional): Inherit existing console styles. Defaults to True.

        Returns:
            ThemeContext: [description]
        )r³   rs  r[   r[   r\   Ú	use_themee  s   
zConsole.use_themec                 C   s   | j dur
t| j  S dS )zpGet color system string.

        Returns:
            Optional[str]: "standard", "256" or "truecolor".
        N)r0  Ú_COLOR_SYSTEMS_NAMESru   r[   r[   r\   r	  q  s   

zConsole.color_systemc                 C   s   t | jddƒpd ¡ S )zGet the encoding of the console file, e.g. ``"utf-8"``.

        Returns:
            str: A standard encoding string.
        rk   úutf-8)rG  r  rX  ru   r[   r[   r\   rk   ~  s   zConsole.encodingc                 C   sJ   | j dur| j S t| jddƒ}z|du rdW S |ƒ W S  ty$   Y dS w )zÉCheck if the console is writing to a terminal.

        Returns:
            bool: True if the console writing to a device capable of
            understanding terminal codes, otherwise False.
        NÚisattyF)r.  rG  r  Ú
ValueError)rv   rw  r[   r[   r\   rj   ‡  s   
üzConsole.is_terminalc                 C   s$   | j  dd¡}| ¡ dv }| jo|S )zxDetect dumb terminal.

        Returns:
            bool: True if writing to a dumb terminal, otherwise False.

        rT  rÊ   )ÚdumbÚunknown)r  r±   rX  rj   )rv   Ú_termÚis_dumbr[   r[   r\   r7  š  s   
zConsole.is_dumb_terminalc              	   C   s$   t | jj| j| jd| j| j| jd�S )zGet default console options.r%   )rl   rf   rg   rh   ri   rk   rj   )re   rf   ra   rg   r`   rk   rj   ru   r[   r[   r\   r{   ¦  s   ùzConsole.optionsc                 C   sV  | j dur| jdurt| j | j | jƒS | jrtddƒS d}d}tr4zt ¡ \}}W n; ty3   Y n3w zt t	j
 ¡ ¡\}}W n% tttfye   zt t	j ¡ ¡\}}W n tttfyb   Y nw Y nw | j d¡}|durx| ¡ rxt|ƒ}| j d¡}|durŠ| ¡ rŠt|ƒ}|p�d}|p‘d}t| j du r�|| j n| j | jdu r§|ƒS | jƒS )zGet the size of the console.

        Returns:
            ConsoleDimensions: A named tuple containing the dimensions.
        NéP   é   r   r!  )r'  r(  r_   rg   r7  r  ÚosÚget_terminal_sizeÚOSErrorrE  Ú	__stdin__ÚfilenoÚAttributeErrorrx  Ú
__stdout__r  r±   r-  rc   )rv   r`   ra   r@  rš   r[   r[   r\   rf   ³  sH   
ÿÿ€ýþþzConsole.sizeÚnew_sizec                 C   s   |\}}|| _ || _dS )zvSet a new size for the terminal.

        Args:
            new_size (Tuple[int, int]): New width and height.
        N)r'  r(  )rv   r†  r`   ra   r[   r[   r\   rf   á  s   
c                 C   rJ  )zsGet the width of the console.

        Returns:
            int: The width (in characters) of the console.
        )rf   r`   ru   r[   r[   r\   r`   ì  ó   zConsole.widthc                 C   rI  )zFSet width.

        Args:
            width (int): New width.
        N)r'  )rv   r`   r[   r[   r\   r`   õ  ó   
c                 C   rJ  )zpGet the height of the console.

        Returns:
            int: The height (in lines) of the console.
        )rf   ra   ru   r[   r[   r\   ra   þ  r‡  zConsole.heightc                 C   rI  )zISet height.

        Args:
            height (int): new height.
        N)r(  )rv   ra   r[   r[   r\   ra     rˆ  c                 C   s   |   t ¡ ¡ dS )z3Play a 'bell' sound (if supported by the terminal).N)Úcontrolr.   Úbellru   r[   r[   r\   rŠ    rb  zConsole.bellc                 C   s   t | ƒ}|S )aá  A context manager to *capture* the result of print() or log() in a string,
        rather than writing it to the console.

        Example:
            >>> from rich.console import Console
            >>> console = Console()
            >>> with console.capture() as capture:
            ...     console.print("[bold magenta]Hello World[/]")
            >>> print(capture.get())

        Returns:
            Capture: Context manager with disables writing to the terminal.
        )r¤   )rv   Úcapturer[   r[   r\   r‹    s   zConsole.capturerº   r»   r¼   c                 C   s   t | |||d�S )a  A context manager to display anything printed within a "pager". The pager application
        is defined by the system and will typically support at least pressing a key to scroll.

        Args:
            pager (Pager, optional): A pager object, or None to use :class:`~rich.pager.SystemPager`. Defaults to None.
            styles (bool, optional): Show styles in pager. Defaults to False.
            links (bool, optional): Show links in pager. Defaults to False.

        Example:
            >>> from rich.console import Console
            >>> from rich.__main__ import make_test_card
            >>> console = Console()
            >>> with console.pager():
                    console.print(make_test_card())

        Returns:
            PagerContext: A context manager.
        )rº   r»   r¼   )r¹   )rv   rº   r»   r¼   r[   r[   r\   rº   %  s   zConsole.pagerr%   r”   c                 C   s"   |dksJ dƒ‚|   t|ƒ¡ dS )zqWrite new line(s).

        Args:
            count (int, optional): Number of new lines. Defaults to 1.
        r   zcount must be >= 0N)rÕ   r“   r•   r[   r[   r\   r£   <  s   zConsole.lineÚhomec                 C   s.   |r|   t ¡ t ¡ ¡ dS |   t ¡ ¡ dS )z‡Clear the screen.

        Args:
            home (bool, optional): Also move the cursor to 'home' position. Defaults to True.
        N)r‰  r.   ÚclearrŒ  )rv   rŒ  r[   r[   r\   r�  F  s   zConsole.clearÚdotszstatus.spinnerg      ð?g      )@)ÚspinnerÚspinner_styleÚspeedÚrefresh_per_secondÚstatusr�  r�  r‘  r’  rL   c                C   s$   ddl m} ||| ||||d�}|S )at  Display a status and spinner.

        Args:
            status (RenderableType): A status renderable (str or Text typically).
            spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots".
            spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner".
            speed (float, optional): Speed factor for spinner animation. Defaults to 1.0.
            refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5.

        Returns:
            Status: A Status object that may be used as a context manager.
        r%   rK   )r�   r�  r�  r‘  r’  )r“  rL   )rv   r“  r�  r�  r‘  r’  rL   Ústatus_renderabler[   r[   r\   r“  Q  s   úzConsole.statusrÃ   c                 C   s$   | j r| js|  t |¡¡ dS dS )zqShow or hide the cursor.

        Args:
            show (bool, optional): Set visibility of the cursor.
        TF)rj   rg   r‰  r.   r×   )rv   rÃ   r[   r[   r\   r×   r  s   zConsole.show_cursorÚenablec                 C   s.   d}| j r| js|  t |¡¡ d}|| _|S )aº  Enables alternative screen mode.

        Note, if you enable this mode, you should ensure that is disabled before
        the application exits. See :meth:`~rich.Console.screen` for a context manager
        that handles this for you.

        Args:
            enable (bool, optional): Enable (True) or disable (False) alternate screen. Defaults to True.

        Returns:
            bool: True if the control codes were written.

        FT)rj   rg   r‰  r.   Ú
alt_screenr?  )rv   r•  Úchangedr[   r[   r\   rÖ   }  s   zConsole.set_alt_screenc                 C   s   | j S )z†Check if the alt screen was enabled.

        Returns:
            bool: True if the alt screen was enabled, otherwise False.
        )r?  ru   r[   r[   r\   Úis_alt_screen’  s   zConsole.is_alt_screenrË   rÉ   c                 C   s   t | ||pdd�S )au  Context manager to enable and disable 'alternative screen' mode.

        Args:
            hide_cursor (bool, optional): Also hide the cursor. Defaults to False.
            style (Style, optional): Optional style for screen. Defaults to None.

        Returns:
            ~ScreenContext: Context which enables alternate screen on enter, and disables it on exit.
        rÊ   )rË   rÌ   )rÉ   )rv   rË   rÌ   r[   r[   r\   rÎ   ›  s   zConsole.screen©r{   rÔ   r{   c                C   s   t  | |p| j|¡}|S )aó  Measure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains
        information regarding the number of characters required to print the renderable.

        Args:
            renderable (RenderableType): Any renderable or string.
            options (Optional[ConsoleOptions], optional): Options to use when measuring, or None
                to use default options. Defaults to None.

        Returns:
            Measurement: A measurement of the renderable.
        )r4   r±   r{   )rv   rÔ   r{   Úmeasurementr[   r[   r\   Úmeasure©  s   zConsole.measurec           	      c   sä   � |p| j }|jdk rdS t|ƒ}t|dƒr!t|ƒs!| | |¡}nt|tƒr7| j||j	|j
d�}| | |¡}n	t d|›d�¡‚zt|ƒ}W n tyV   t d|›d�¡‚w t}|D ]}t||ƒrf|V  q[|  ||¡E dH  q[dS )	ak  Render an object in to an iterable of `Segment` instances.

        This method contains the logic for rendering objects with the console protocol.
        You are unlikely to need to use it directly, unless you are extending the library.

        Args:
            renderable (RenderableType): An object supporting the console protocol, or
                an object that may be converted to a string.
            options (ConsoleOptions, optional): An options object, or None to use self.options. Defaults to None.

        Returns:
            Iterable[Segment]: An iterable of segments that may be rendered.
        r%   Nr‘   )rp   rq   zUnable to render zC; A str, Segment or object with __rich_console__ method is requiredzobject z is not renderable)r{   ri   r:   Úhasattrr
   r‘   r|   rƒ   Ú
render_strrp   rq   r&   ÚNotRenderableErrorÚiterÚ	TypeErrorr>   r3   )	rv   rÔ   r{   Ú_optionsÚrender_iterableÚtext_renderableÚiter_renderÚ_SegmentÚrender_outputr[   r[   r\   r3   º  s8   €



ÿ
ÿ
ÿÿ
üzConsole.render)rÌ   ÚpadÚ	new_linesr§  r¨  c             	   C   sÔ   | j �] |p| j}|  ||¡}|rt ||¡}tttj||j||d�d|j	ƒƒ}|j	durW|j	t
|ƒ }	|	dkrW|rFtd|j |ƒtdƒgntd|j |ƒgg}
| |
|	 ¡ |W  d  ƒ S 1 scw   Y  dS )aG  Render objects in to a list of lines.

        The output of render_lines is useful when further formatting of rendered console text
        is required, such as the Panel class which draws a border around any renderable object.

        Args:
            renderable (RenderableType): Any object renderable in the console.
            options (Optional[ConsoleOptions], optional): Console options, or None to use self.options. Default to ``None``.
            style (Style, optional): Optional style to apply to renderables. Defaults to ``None``.
            pad (bool, optional): Pad lines shorter than render width. Defaults to ``True``.
            new_lines (bool, optional): Include "
" characters at end of lines.

        Returns:
            List[List[Segment]]: A list of lines, where a line is a list of Segment objects.
        )Úinclude_new_linesr§  Nr   rA  r—   )r¾   r{   r3   r>   Úapply_stylerÞ   r   Úsplit_and_crop_linesri   ra   rÒ   Úextend)rv   rÔ   r{   rÌ   r§  r¨  Úrender_optionsÚ	_renderedrš   Úextra_linesÚpad_liner[   r[   r\   Úrender_linesì  s6   
üøÿ
ÿý$åzConsole.render_linesrÊ   )rÌ   rm   rn   r  rq   rp   r  Útextrm   rn   rE   c                C   s´   |p|du o| j }	|p|du o| j}
|p|du o| j}|
r-t|||	| jd�}||_||_nt|	r7t|| jd�n||||d�}|rE|pD| j	nd}|durX|t
|ƒƒ}| |¡ |S |S )a©  Convert a string to a Text instance. This is is called automatically if
        you print or log a string.

        Args:
            text (str): Text to render.
            style (Union[str, Style], optional): Style to apply to rendered text.
            justify (str, optional): Justify method: "default", "left", "center", "full", or "right". Defaults to ``None``.
            overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to ``None``.
            emoji (Optional[bool], optional): Enable emoji, or ``None`` to use Console default.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use Console default.
            highlight (Optional[bool], optional): Enable highlighting, or ``None`` to use Console default.
            highlighter (HighlighterType, optional): Optional highlighter to apply.
        Returns:
            ConsoleRenderable: Renderable object.

        N)rÌ   r  r  )Údefault_variant)rm   rn   rÌ   )r*  r)  r,  Úrender_markupr+  rm   rn   rE   r(   r  rƒ   Úcopy_styles)rv   r²  rÌ   rm   rn   r  rq   rp   r  Úemoji_enabledÚmarkup_enabledÚhighlight_enabledÚ	rich_textÚ_highlighterÚhighlight_textr[   r[   r\   r�  !  s8   üÿú	€ 
zConsole.render_str)rN   ró   rN   c             
   C   s”   t |tƒr|S z| j |¡}|du rt |¡}|jr| ¡ W S |W S  tjyI } z|dur9|  	|¡W  Y d}~S t 
d|›d|› �¡d‚d}~ww )a!  Get a Style instance by it's theme name or parse a definition.

        Args:
            name (str): The name of a style or a style definition.

        Returns:
            Style: A Style object.

        Raises:
            MissingStyle: If no style could be parsed from name.

        NzFailed to get style z; )r|   r?   rQ  r±   ÚparseÚlinkrz   r&   ÚStyleSyntaxErrorÚ	get_styleÚMissingStyle)rv   ró   rN   rÌ   Úerrorr[   r[   r\   r¿  \  s"   

ÿþ€ýzConsole.get_style©rm   r  rq   rp   ÚobjectsÚseprÑ   c                   s2  g }|j ‰ g ‰ˆj }	ˆ ‰ˆdv rdtddf‡ ‡fdd„}
|
‰t}|s)|du r,| jr,| j}d‡‡‡‡‡fdd„}|D ]F}t|ƒ}t|tƒrP|	| j||||d	�ƒ q9t|t	ƒrZ|	|ƒ q9t|t
ƒrg|ƒ  ˆ|ƒ q9t|ƒrw|ƒ  ˆt||d
�ƒ q9|	|t|ƒƒƒ q9|ƒ  | jdur—|  | j¡‰‡fdd„|D ƒ}|S )a  Combine a number of renderables and text into one renderable.

        Args:
            objects (Iterable[Any]): Anything that Rich can render.
            sep (str): String to write between print data.
            end (str): String to write at end of print data.
            justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``.
            emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use console default.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default.

        Returns:
            List[ConsoleRenderable]: A list of things to render.
        )rO   rP   rQ   rÔ   rr   Nc                    s   ˆ t | ttˆƒƒƒ d S r‹   )r+   r   r,   )rÔ   )Ú_appendrm   r[   r\   Úalign_append›  s   z2Console._collect_renderables.<locals>.align_appendc                     s2   ˆrt ˆˆˆd�} ˆ |  ˆ¡ƒ ˆd d …= d S d S )N)rm   rÑ   )rE   Újoin)Úsep_text)ri  rÑ   rm   rÄ  r²  r[   r\   Ú
check_text¤  s
   ýz0Console._collect_renderables.<locals>.check_text)r  rq   r  )r  c                    ó   g | ]}t |ˆ ƒ‘qS r[   rA   ©rò   rÔ   rÍ   r[   r\   Ú
<listcomp>Á  rö   z0Console._collect_renderables.<locals>.<listcomp>©rr   N)ri  rÙ   r5  r,  r  r:   r|   rƒ   r�  rE   r‰   r9   r8   rÌ   r¿  )rv   rÃ  rÄ  rÑ   rm   r  rq   rp   rÐ   Úappend_textrÆ  rº  rÉ  rÔ   r[   )rÅ  ri  rÑ   rm   rÄ  rÌ   r²  r\   Ú_collect_renderablesz  sD   
ÿÿ




zConsole._collect_renderablesu   â”€z	rule.linerP   )Ú
charactersrÌ   ÚalignÚtitlerÐ  rÑ  c                C   s*   ddl m} |||||d�}|  |¡ dS )u­  Draw a line with optional centered title.

        Args:
            title (str, optional): Text to render over the rule. Defaults to "".
            characters (str, optional): Character(s) to form the line. Defaults to "â”€".
            style (str, optional): Style of line. Defaults to "rule.line".
            align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center".
        r%   )ÚRule)rÒ  rÐ  rÌ   rÑ  N)ÚrulerÓ  rÕ   )rv   rÒ  rÐ  rÌ   rÑ  rÓ  rÔ  r[   r[   r\   rÔ  Å  s   zConsole.ruler‰  c                 G   sJ   | j s#| � | j dd„ |D ƒ¡ W d  ƒ dS 1 sw   Y  dS dS )z’Insert non-printing control codes.

        Args:
            control_codes (str): Control codes, such as those that may move the cursor.
        c                 s   ó   � | ]}|j V  qd S r‹   )Úsegment)rò   Ú_controlr[   r[   r\   Ú	<genexpr>â  ó   € z"Console.control.<locals>.<genexpr>N)r7  r¿   r¬  )rv   r‰  r[   r[   r\   r‰  Ú  s
   "ÿÿzConsole.controlrA  r—   )rÄ  rÑ   rÌ   rp   c                G   s4   |  dd„ |D ƒ¡}| j|||ddddd|d�	 dS )a·  Output to the terminal. This is a low-level way of writing to the terminal which unlike
        :meth:`~rich.console.Console.print` won't pretty print, wrap text, or apply markup, but will
        optionally apply highlighting and a basic style.

        Args:
            sep (str, optional): String to write between print data. Defaults to " ".
            end (str, optional): String to write at end of print data. Defaults to "\\n".
            style (Union[str, Style], optional): A style to apply to output. Defaults to None.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use
                console default. Defaults to ``None``.
        c                 s   s   � | ]}t |ƒV  qd S r‹   )rƒ   )rò   Ú_objectr[   r[   r\   rØ  ÷  s   € zConsole.out.<locals>.<genexpr>FTrV   )rÌ   rp   r  rq   ro   rn   rT   rÑ   N)rÇ  rÕ   )rv   rÄ  rÑ   rÌ   rp   rÃ  Ú
raw_outputr[   r[   r\   Úoutä  s   
÷zConsole.out)rÄ  rÑ   rÌ   rm   rn   ro   r  rq   rp   r`   ra   rT   r  Únew_line_startro   rT   rÝ  c             
   G   s¢  |st ƒ f}|du r| j}|r|du rd}|du rd}d}| jdd… }| �¡ | j|||||||	d�}|D ]}| |¡}q5| jj|||
durLt|
| jƒnt	||||	d�}g }|j
}| j}|du rm|D ]	}||||ƒƒ qbn|D ]}|t |||ƒ|  |¡¡ƒ qo|rštd dd	„ |D ƒ¡ ¡ ƒd
krš| dt ¡ ¡ |r±| jj
}tj|| jdd�D ]}||ƒ q©n| j 
|¡ W d  ƒ dS W d  ƒ dS 1 sÊw   Y  dS )a[  Print to the console.

        Args:
            objects (positional args): Objects to log to the terminal.
            sep (str, optional): String to write between print data. Defaults to " ".
            end (str, optional): String to write at end of print data. Defaults to "\\n".
            style (Union[str, Style], optional): A style to apply to output. Defaults to None.
            justify (str, optional): Justify method: "default", "left", "right", "center", or "full". Defaults to ``None``.
            overflow (str, optional): Overflow method: "ignore", "crop", "fold", or "ellipsis". Defaults to None.
            no_wrap (Optional[bool], optional): Disable word wrapping. Defaults to None.
            emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to ``None``.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to ``None``.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``.
            width (Optional[int], optional): Width of output, or ``None`` to auto-detect. Defaults to ``None``.
            crop (Optional[bool], optional): Crop output to width of terminal. Defaults to True.
            soft_wrap (bool, optional): Enable soft wrap mode which disables word wrapping and cropping of text or ``None`` for
                Console default. Defaults to ``None``.
            new_line_start (bool, False): Insert a new line at the start if the output contains more than one line. Defaults to ``False``.
        NTrV   FrÂ  )rm   rn   r`   ra   ro   rq   rp   rÊ   c                 s   rÕ  r‹   )r²  ©rò   rÖ  r[   r[   r\   rØ  Z  rÙ  z Console.print.<locals>.<genexpr>r%   r   ©r§  )r“   r  r=  rÏ  rü   r{   r~   Úminr`   r‡   r¬  r3   r>   rª  r¿  rÒ   rÇ  Ú
splitlinesÚinsertr£   r¿   r«  )rv   rÄ  rÑ   rÌ   rm   rn   ro   r  rq   rp   r`   ra   rT   r  rÝ  rÃ  Úrender_hooksrÐ   rh  r­  Únew_segmentsr¬  r3   rÔ   Úbuffer_extendr£   r[   r[   r\   rÕ     sz   %ù	ù
ÿÿÿÿ
ÿ
ýÐ+"ÕzConsole.printé   )	ÚdataÚindentrp   Ú	skip_keysÚensure_asciiÚcheck_circularÚ	allow_nanrN   Ú	sort_keysÚjsonrç  rè  ré  rê  rë  rì  rí  c       	         C   sx   ddl m} |du r|j||||||||	|
d�	}nt|tƒs&td|›d�ƒ‚|||||||||	|
d�	}| j|dd� dS )	aó  Pretty prints JSON. Output will be valid JSON.

        Args:
            json (Optional[str]): A string containing JSON.
            data (Any): If json is not supplied, then encode this data.
            indent (Union[None, int, str], optional): Number of spaces to indent. Defaults to 2.
            highlight (bool, optional): Enable highlighting of output: Defaults to True.
            skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
            ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
            check_circular (bool, optional): Check for circular references. Defaults to True.
            allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
            default (Callable, optional): A callable that converts values that can not be encoded
                in to something that can be JSON encoded. Defaults to None.
            sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
        r   )ÚJSONN)rè  rp   ré  rê  rë  rì  rN   rí  z/json must be str. Did you mean print_json(data=z) ?T)r  )Úpip._vendor.rich.jsonrï  Ú	from_datar|   rƒ   r   rÕ   )rv   rî  rç  rè  rp   ré  rê  rë  rì  rN   rí  rï  Újson_renderabler[   r[   r\   Ú
print_jsong  s:   ÷

ÿ÷zConsole.print_json)Úregionr{   rô  c          
      C   sz   | j st d¡‚|p| j}|du r!d }}| |j|jp| j¡}n|\}}}}| ||¡}| j||d�}	|  |	||¡ dS )a³  Update the screen at a given offset.

        Args:
            renderable (RenderableType): A Rich renderable.
            region (Region, optional): Region of screen to update, or None for entire screen. Defaults to None.
            x (int, optional): x offset. Defaults to 0.
            y (int, optional): y offset. Defaults to 0.

        Raises:
            errors.NoAltScreen: If the Console isn't in alt screen mode.

        ú0Alt screen must be enabled to call update_screenNr   r™  )	r˜  r&   ÚNoAltScreenr{   r�   ri   ra   r±  Úupdate_screen_lines)
rv   rÔ   rô  r{   r­  r›   rœ   r`   ra   rš   r[   r[   r\   Úupdate_screen¤  s   

ÿzConsole.update_screenr   rš   r›   rœ   c                 C   s>   | j st d¡‚t|||ƒ}|  |¡}| j |¡ |  ¡  dS )a”  Update lines of the screen at a given offset.

        Args:
            lines (List[List[Segment]]): Rendered lines (as produced by :meth:`~rich.Console.render_lines`).
            x (int, optional): x offset (column no). Defaults to 0.
            y (int, optional): y offset (column no). Defaults to 0.

        Raises:
            errors.NoAltScreen: If the Console isn't in alt screen mode.
        rõ  N)r˜  r&   rö  r™   r3   r¿   r¬  rc  )rv   rš   r›   rœ   Úscreen_updaterÆ   r[   r[   r\   r÷  Æ  s   

zConsole.update_screen_linesr  r    r[   ©r`   r¯  r´   Ú	word_wrapÚshow_localsÚsuppressÚ
max_framesr¯  rû  rü  rý  rþ  c          
   	   C   s0   ddl m} ||||||||d�}	|  |	¡ dS )a  Prints a rich render of the last exception and traceback.

        Args:
            width (Optional[int], optional): Number of characters used to render code. Defaults to 88.
            extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
            theme (str, optional): Override pygments theme used in traceback
            word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False.
            show_locals (bool, optional): Enable display of local variables. Defaults to False.
            suppress (Iterable[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.
            max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100.
        r%   )Ú	Tracebackrú  N)ro  rÿ  rÕ   )
rv   r`   r¯  r´   rû  rü  rý  rþ  rÿ  ro  r[   r[   r\   Úprint_exceptionÚ  s   ù	zConsole.print_exceptionr¢   Úcurrentframec                 C   sp   | d7 } |ƒ }|dur)| r|r|j }| d8 } | r|s|dus J ‚|jj|j|jfS t ¡ |  }|j|j|j	jfS )aE  Get caller frame information.

        Args:
            offset (int): the caller offset within the current frame stack.
            currentframe (Callable[[], Optional[FrameType]], optional): the callable to use to
                retrieve the current frame. Defaults to ``inspect.currentframe``.

        Returns:
            Tuple[str, int, Dict[str, Any]]: A tuple containing the filename, the line number and
                the dictionary of local variables associated with the caller frame.

        Raises:
            RuntimeError: If the stack offset is invalid.
        r%   N)
Úf_backÚf_codeÚco_filenameÚf_linenoÚf_localsÚinspectÚstackÚfilenameÚlinenoÚframe)r¢   r  r  Ú
frame_infor[   r[   r\   Ú_caller_frame_infoý  s   þzConsole._caller_frame_info)	rÄ  rÑ   rÌ   rm   r  rq   rp   Ú
log_localsÚ_stack_offsetr  r  c       	      
      s^  |
st ƒ f}
| jdd… }| �– | j|
||||||d�}ˆ dur)‡ fdd„|D ƒ}|  |	¡\}}}| d¡r8dntj |¡}| tj	¡d }|rZdd„ | 
¡ D ƒ}| t|d	d
�¡ | j| ||  ¡ |||d�g}|D ]}| |¡}qjg }|j}| j}| j}|D ]	}||||ƒƒ q| jj}tj|| jdd�D ]}||ƒ q–W d  ƒ dS 1 s¨w   Y  dS )aÀ  Log rich content to the terminal.

        Args:
            objects (positional args): Objects to log to the terminal.
            sep (str, optional): String to write between print data. Defaults to " ".
            end (str, optional): String to write at end of print data. Defaults to "\\n".
            style (Union[str, Style], optional): A style to apply to output. Defaults to None.
            justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``.
            overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to None.
            emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to None.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to None.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to None.
            log_locals (bool, optional): Boolean to enable logging of locals where ``log()``
                was called. Defaults to False.
            _stack_offset (int, optional): Offset of caller from end of call stack. Defaults to 1.
        NrÂ  c                    rÊ  r[   rA   rË  rÍ   r[   r\   rÌ  M  rö   zConsole.log.<locals>.<listcomp>ú<éÿÿÿÿc                 S   s    i | ]\}}|  d ¡s||“qS )Ú__)rt   )rò   ÚkeyrO  r[   r[   r\   rõ   S  s    ýÿzConsole.log.<locals>.<dictcomp>z	[i]locals)rÒ  )r  ÚpathÚline_noÚ	link_pathFrß  )r“   r=  rÏ  r  rt   r  r  ÚabspathrY  rÄ  Úitemsri  r<   r4  r  rü   r¬  r3   r{   r¿   r>   r«  r`   )rv   rÄ  rÑ   rÌ   rm   r  rq   rp   r  r  rÃ  rã  rÐ   r	  r  Úlocalsr  r  Ú
locals_maprh  rä  r¬  r3   r­  rÔ   rå  r£   r[   rÍ   r\   Úlog   s^   ù	þúÿ

ÿ
ý"ÕzConsole.logc                 C   sF  | j r| jdd…= dS | j�‹ | jdkry| jr2ddlm} || j|  | jdd… ¡ƒ | jdd…= nW|  | jdd… ¡}| jdd…= |r�z trX| j	j
}| d¡D ]}||ƒ qPn| j	 
|¡ | j	 ¡  W n, tyx } z|j› d�|_‚ d}~ww W d  ƒ dS W d  ƒ dS W d  ƒ dS W d  ƒ dS 1 sœw   Y  dS )z$Check if the buffer may be rendered.Nr   r%   )ÚdisplayTzG
*** You may need to add PYTHONIOENCODING=utf-8 to your environment ***)r  r¿   r¾   rN  r&  Újupyterr  rÂ   r  r  Úwriterá  ÚflushÚUnicodeEncodeErrorÚreason)rv   r  r²  r  r£   rÁ  r[   r[   r\   rc  r  sB   

ÿ€þíÿ
öú"ízConsole._check_bufferrÅ   c                 C   s²   g }|j }| j}| j}| jr'| j� | j |¡ W d  ƒ n1 s"w   Y  | j }| jr5|r5t	 
|¡}|D ]\}}}	|rI||j|||d�ƒ q7|rM|	sQ||ƒ q7d |¡}
|
S )z)Render buffered output, and clear buffer.N)r	  rg   rÊ   )ri  r0  rg   r  r9  r<  r¬  rj   r  r>   Úremove_colorr3   rÇ  )rv   rÅ   Úoutputri  r	  rg   Únot_terminalr²  rÌ   r‰  Úrenderedr[   r[   r\   rÂ   �  s2   ÿ

ýÿ€
zConsole._render_buffer)rq   r  ÚpasswordÚstreamÚpromptr&  r'  c          	      C   sœ   d}|r%|   ¡ �}| j|||dd� W d  ƒ n1 sw   Y  | ¡ }| jr0| j |¡ d}|r:t||d�}|S |rH| j |¡ | ¡ }|S t|ƒ}|S )a5  Displays a prompt and waits for input from the user. The prompt may contain color / style.

        It works in the same way as Python's builtin :func:`input` function and provides elaborate line editing and history features if Python's builtin :mod:`readline` module is previously loaded.

        Args:
            prompt (Union[str, Text]): Text to render in the prompt.
            markup (bool, optional): Enable console markup (requires a str prompt). Defaults to True.
            emoji (bool, optional): Enable emoji (requires a str prompt). Defaults to True.
            password: (bool, optional): Hide typed text. Defaults to False.
            stream: (TextIO, optional): Optional file to read input from (rather than stdin). Defaults to None.

        Returns:
            str: Text read from stdin.
        rÊ   )rq   r  rÑ   N)r'  )	r‹  rÕ   r±   rg   r  r  r   ÚreadlineÚinput)	rv   r(  rq   r  r&  r'  Ú
prompt_strr‹  Úresultr[   r[   r\   r*  ª  s$   
ÿûÿzConsole.input©r�  r»   r�  c                C   sŒ   | j sJ dƒ‚| j�2 |rd dd„ | jD ƒ¡}nd dd„ | jD ƒ¡}|r4| jdd…= W d  ƒ |S W d  ƒ |S 1 s?w   Y  |S )a©  Generate text from console contents (requires record=True argument in constructor).

        Args:
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            styles (bool, optional): If ``True``, ansi escape codes will be included. ``False`` for plain text.
                Defaults to ``False``.

        Returns:
            str: String containing console contents.

        úITo export console contents set record=True in the constructor or instancerÊ   c                 s   s(   � | ]\}}}|r|  |¡n|V  qd S r‹   r2   )rò   r²  rÌ   Ú_r[   r[   r\   rØ  æ  s
   € ÿ
ÿz&Console.export_text.<locals>.<genexpr>c                 s   s   � | ]	}|j s|jV  qd S r‹   )r‰  r²  rÞ  r[   r[   r\   rØ  ë  s   € ý
ÿN)r  r9  rÇ  r<  )rv   r�  r»   r²  r[   r[   r\   Úexport_textÔ  s*   ÿþ

þ
þ
óþ
ôòzConsole.export_textr  c                C   sL   | j ||d�}t|ddd��}| |¡ W d  ƒ dS 1 sw   Y  dS )a§  Generate text from console and save to a given location (requires record=True argument in constructor).

        Args:
            path (str): Path to write text files.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            styles (bool, optional): If ``True``, ansi style codes will be included. ``False`` for plain text.
                Defaults to ``False``.

        r-  Úwtrv  ©rk   N)r0  Úopenr  )rv   r  r�  r»   r²  Ú
write_filer[   r[   r\   Ú	save_textô  s   
"ÿzConsole.save_text©r´   r�  Úcode_formatÚinline_stylesr7  r8  c             	   C   sÞ  | j sJ dƒ‚g }|j}|pt}d}|du rtn|}	| j�È |rYt t | j¡¡D ].\}
}}t	|
ƒ}
|rS| 
|¡}|jrFd|j› d|
› d�}
|rQd|› d|
› d�n|
}
||
ƒ q)ndi }t t | j¡¡D ]8\}
}}t	|
ƒ}
|r˜| 
|¡}| |t|ƒd	 ¡}|jr�d
|› d|j› d|
› d�}
n	d|› d|
› d�}
||
ƒ qdg }|j}| ¡ D ]\}}|r·|d|› d|› d�ƒ q¦d |¡}|	jd |¡||jj|jjd�}|rÝ| jdd…= W d  ƒ |S W d  ƒ |S 1 sèw   Y  |S )a  Generate HTML from console contents (requires record=True argument in constructor).

        Args:
            theme (TerminalTheme, optional): TerminalTheme object containing console colors.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            code_format (str, optional): Format string to render HTML, should contain {foreground}
                {background} and {code}.
            inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
                larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
                Defaults to False.

        Returns:
            str: String containing console contents as HTML.
        r.  rÊ   Nz	<a href="z">z</a>z<span style="z</span>r%   z<a class="rz" href="z<span class="rz.rz {Ú}r—   )ÚcodeÚ
stylesheetÚ
foregroundÚ
background)r  ri  rC   ÚCONSOLE_HTML_FORMATr9  r>   Úfilter_controlÚsimplifyr<  r	   Úget_html_styler½  Ú
setdefaultrÒ   r  rÇ  ÚformatÚforeground_colorÚhexÚbackground_color)rv   r´   r�  r7  r8  Ú	fragmentsri  Ú_themer;  Úrender_code_formatr²  rÌ   r/  rÔ  r»   Ústyle_numberÚstylesheet_rulesÚstylesheet_appendÚ
style_ruleÚrendered_coder[   r[   r\   Úexport_html  sp   ÿþ
ÿ

÷
ÿ

€
ü
Ø)þ
Ù)×)zConsole.export_htmlc                C   sP   | j ||||d�}t|ddd��}| |¡ W d  ƒ dS 1 s!w   Y  dS )aû  Generate HTML from console contents and write to a file (requires record=True argument in constructor).

        Args:
            path (str): Path to write html file.
            theme (TerminalTheme, optional): TerminalTheme object containing console colors.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            code_format (str, optional): Format string to render HTML, should contain {foreground}
                {background} and {code}.
            inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
                larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
                Defaults to False.

        r6  r1  rv  r2  N)rO  r3  r  )rv   r  r´   r�  r7  r8  Úhtmlr4  r[   r[   r\   Ú	save_htmlM  s   ü"ÿzConsole.save_htmlrÍ  )rd  rJ   rr   N)rr   rŽ   rÈ   r˜   r¸   )TNr‹   rØ   )r   r   )yrX   rY   rZ   rb   r  Úenvironr  r   rƒ   rd   r1   r   r"   r‚   rG   r   rc   r@   r/   r   r)   r   r   Úfloatr–   rC  r†   r  Úsetterr   r>   r¿   rN  rH   rQ  r-   r1  r½   rÄ   rf  rg  rû   rj  rl  r©   r   r°   r¨   r®   r¶   r·   r³   rt  r	  rk   rj   r7  re   r{   r_   rf   r   r`   ra   rŠ  r¤   r‹  r6   r¹   rº   r£   r�  rÙ   r“  r×   rÖ   r˜  rÎ   r4   r›  r   r3   r?   r±  r„   r…   r  r�  r¿  r‰   rÏ  rF   r,   rÔ  r.   r‰  rÜ  rÕ   ró  r;   rø  r÷  r   r   Ústaticmethodr  r  r   r   r  r  rc  rÂ   r   r*  r0  r5  rD   rO  r>  rQ  r[   r[   r[   r\   rŽ   D  s  
 #àÿýúùø	÷
öõ
ôóòñðïîíìëêéèç
æåäãâá 
àp	-
ÿÿÿÿ
þ
ùþüûúù
ø!	ÿÿÿ
þÿÿÿ
þÿÿÿ
þ5ýùþýûúù

ø9öþ
üûúùø	÷
ö
õ<ÿ
ÿÿ
þ$÷þýüúùø	÷

öMþúþü
ûú
ùúþýüûú
ù#ðþýüûúùø	÷
öõôóòñð
ïeþôþüûúùø	÷
öõô
óAûþüû
ú#ÿ
ÿÿÿ
þ÷ýüûúùø	÷

ö#þÿþý%õþýüûúùø	÷
öõ
ôRþùþüûúùø&*, úýüûúùO
ùþüûúùørŽ   Ú__main__zJSONRPC [i]request[/i]é   gÍÌÌÌÌÌô?z2.0Úsubtracté*   é   )ÚminuendÚ
subtrahendr    )Újsonrpcrà   ÚparamsÚidzHello, World!z{'a': 1}z&Which one is correct team name in NBA?)zNew York BullszLos Angeles KingszGolden State WarriorsúHuston Rocketr`  )Úquestionr{   Úanswer)ÚansweredÚq1z	5 + 7 = ?)é
   é   é   é   rg  z
12 - 8 = ?)r%   ræ  r    é   ri  )rc  rd  Úq2)ÚsportÚmaths)ró   ÚemptyÚquizÚfoor¸   )rr   rI   )Ÿr  r  ÚplatformrE  r3  Úabcr   r   Údataclassesr   r   r   Ú	functoolsr   r   rP  r	   r
   Ú	itertoolsr   r   Útimer   Útypesr   r   r   Útypingr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úversion_infor"   r#   r$   Úpip._vendor.typing_extensionsrÊ   r&   r'   r(   r4  r)   r*   rÑ  r+   r,   Úcolorr-   r‰  r.   r  r/   r  r0   r1   rq   r3   r´  r›  r4   r5   rº   r6   r7   Úprettyr8   r9   Úprotocolr:   rô  r;   Úscoper<   rÎ   r=   rÖ  r>   rÌ   r?   r@   ÚstyledrB   Úterminal_themerC   rD   r²  rE   rF   r´   rG   rH   r   rI   rd  rJ   r“  rL   rô   r  rƒ   r  r„   r…   rW   r‡   r>  rW  r[  rZ  r_   re   rˆ   r‰   rÙ   r�   r5  Ú	Exceptionr’   r“   r™   r¤   r³   r¹   rÉ   rÓ   r‚   rå   rí   rV  r2  r  ru  Úlocalr÷   rû   rý   rd   rÿ   r  Úpip._vendor.coloramar  rŽ   rX   r�   r  ÚreprrÕ   r[   r[   r[   r\   Ú<module>   s  
 D
	{
!'/$!ü


            
5üùøþýýùòýÿ"Ê