Ë
    êÿæiéë  ã                  ó"	  — d dl m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	 d dl
mZmZ d dl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mZ d dlmZmZmZ d dl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-m.Z.m/Z/m0Z0m1Z1 erd dl2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9m:Z:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE ddlFmGZG ddlHmIZImJZJ ddlKmLZLmMZM  e+deN«      ZO e0d«      ZPe"g eQf   ZR ej`                  de-e!«      ZS G d„ de«      ZT	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dw	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dxd'„ZU G d(„ d)ee!«      ZV G d*„ d+e#eS   e&eS   «      ZWd,d dd!dd"d#d$d%d&d!d-œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dyd.„ZXej²                  	 	 	 	 dzdd,d dd!dd"d#d$d%d&d!d/œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d{d0„«       ZZej²                  	 	 	 	 dzdd,d dd!dd"d#d$d%d&d!d/œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d|d1„«       ZZ	 	 	 	 	 d}dd,d dd!dd"d#d$d%d&d!d/œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d~d2„ZZ G d3„ d4e«      Z[ G d5„ d6e[«      Z\ G d7„ d8e[«      Z] G d9„ d:e[«      Z^ G d;„ d<e[«      Z_ G d=„ d>e[«      Z` G d?„ d@e^«      Za G dA„ dBe[«      Zb G dC„ dDe[«      Zc G dE„ dFe[«      Zd G dG„ dHe[«      Ze G dI„ dJe[«      Zf G dK„ dLe[«      Zg G dM„ dNe*«      Zhe G dO„ dP«      «       Zi G dQ„ dRe?«      ZjekdSk(  �rfd dllZld dlmZmddTlnmoZo ddUlpmqZq ddVlrmsZs ddWlHmJZJ  esdXdYd ¬Z«      Zr eJd[d\d]«      ZHeHjé                  d^d_d`«       da eodb«      dceHdddedfdgœdher eqdi«      g	Zud djlvmwZw  eweu«      Zx e8d ¬k«      Z7 ej e]«       gejjó                  «       ¢ e`«       ‘­e7d!dlœŽ5 Zzezj÷                  dmdn¬o«      Z|ezj÷                  dpdn¬o«      Z}ezj÷                  dqd¬o«      Z~ezjþ                  swez�j                  e|dr¬s«       ez�j                  e}dt¬s«        em�j                  du«        el�j                  d dv«      dk  rez�j                   e„ex«      «       ezjþ                  sŒwddd«       yy# 1 sw Y   yxY w)é    )ÚannotationsN)ÚABCÚabstractmethod©Údeque)Ú	dataclassÚfield)Ú	timedelta)Ú	RawIOBaseÚUnsupportedOperation)Úceil)Úmmap)Úlength_hint)ÚPathLikeÚstat)ÚEventÚRLockÚThread)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚBinaryIOÚCallableÚContextManagerÚDequeÚDictÚGenericÚIterableÚListÚLiteralÚ
NamedTupleÚNewTypeÚOptionalÚTextIOÚTupleÚTypeÚTypeVarÚUnion)ÚSelfé   )ÚfilesizeÚget_console)ÚConsoleÚGroupÚJustifyMethodÚRenderableType)ÚHighlighter)ÚJupyterMixin)ÚLive)ÚProgressBar)ÚSpinner)Ú	StyleType)ÚColumnÚTable)ÚTextÚTextTypeÚTaskIDÚProgressTypeÚ_Ic                  óL   ‡ — e Zd ZdZdˆ fd„Zdd„Zdd„Z	 	 	 	 	 	 	 	 d	d„Zˆ xZS )
Ú_TrackThreadz)A thread to periodically update progress.c                ó|   •— || _         || _        || _        t        «       | _        d| _        t        ‰| �  d¬«       y )Nr   T)Údaemon)ÚprogressÚtask_idÚupdate_periodr   ÚdoneÚ	completedÚsuperÚ__init__)ÚselfrB   rC   rD   Ú	__class__s       €úb/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/rich/progress.pyrH   z_TrackThread.__init__C   s9   ø€ Ø ˆŒØˆŒØ*ˆÔÜ“GˆŒ	àˆŒÜ‰Ñ ÐÕ%ó    c                óÔ  — | j                   }| j                  j                  }| j                  }d}| j                  j
                  } ||«      sh| j                  j                  j                  rH| j                  }||k7  r ||||z
  «       |} ||«      s!| j                  j                  j                  rŒH| j                  j                  | j                   | j                  d¬«       y )Nr   T)rF   Úrefresh)
rC   rB   ÚadvancerD   rE   ÚwaitÚliveÚ
is_startedrF   Úupdate)rI   rC   rO   rD   Úlast_completedrP   rF   s          rK   Úrunz_TrackThread.runL   sµ   € Ø—,‘,ˆØ—-‘-×'Ñ'ˆØ×*Ñ*ˆØˆØ�y‰y�~‰~ˆÙ�}Ô%¨$¯-©-×*<Ñ*<×*GÒ*GØŸ™ˆIØ Ò*Ù˜ ¨^Ñ!;Ô<Ø!*�ñ	 �}Ô%¨$¯-©-×*<Ñ*<×*GÓ*Gð 	�‰×Ñ˜TŸ\™\°T·^±^ÈTÐÕRrL   c                ó&   — | j                  «        | S ©N©Ústart©rI   s    rK   Ú	__enter__z_TrackThread.__enter__Z   ó   € Ø�
‰
ŒØˆrL   c                óX   — | j                   j                  «        | j                  «        y rW   )rE   ÚsetÚjoin©rI   Úexc_typeÚexc_valÚexc_tbs       rK   Ú__exit__z_TrackThread.__exit__^   s   € ð 	�	‰	�‰ŒØ�	‰	�rL   )rB   ú
'Progress'rC   z'TaskID'rD   Úfloat©ÚreturnÚNone)rh   z'_TrackThread'©ra   zOptional[Type[BaseException]]rb   zOptional[BaseException]rc   zOptional[TracebackType]rh   ri   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__rH   rU   r[   rd   Ú__classcell__©rJ   s   @rK   r?   r?   @   sA   ø„ Ù3õ&óSóðà/ðð )ðð (ð	ð
 
÷rL   r?   TFé
   úbar.backúbar.completeúbar.finishedú	bar.pulsec           
   #  ó,  K  — |rt        d«      gng }|j                  t        |	|
||¬«      t        |¬«      t	        d¬«      f«       t        ||||||xs d|dœŽ}|5  |j                  | ||||¬«      E d	{  –—†  d	d	d	«       y	7 Œ# 1 sw Y   y	xY w­w)
a¥  Track progress by iterating over a sequence.

    You can also track progress of an iterable, which might require that you additionally specify ``total``.

    Args:
        sequence (Iterable[ProgressType]): Values you wish to iterate over and track progress.
        description (str, optional): Description of task show next to progress bar. Defaults to "Working".
        total: (float, optional): Total number of steps. Default is len(sequence).
        completed (int, optional): Number of steps completed so far. Defaults to 0.
        auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
        transient: (bool, optional): Clear the progress on exit. Defaults to False.
        console (Console, optional): Console to write to. Default creates internal Console instance.
        refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
        style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
        complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
        finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
        pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
        update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1.
        disable (bool, optional): Disable display of progress.
        show_speed (bool, optional): Show speed if total isn't known. Defaults to True.
    Returns:
        Iterable[ProgressType]: An iterable of the values in the sequence.

    ú([progress.description]{task.description}©ÚstyleÚcomplete_styleÚfinished_styleÚpulse_style)Ú
show_speedT)Úelapsed_when_finishedrq   ©Úauto_refreshÚconsoleÚ	transientÚget_timeÚrefresh_per_secondÚdisable)ÚtotalrF   ÚdescriptionrD   N)Ú
TextColumnÚextendÚ	BarColumnÚTaskProgressColumnÚTimeRemainingColumnÚProgressÚtrack)Úsequencer‡   r†   rF   r€   r�   r‚   rƒ   r„   ry   rz   r{   r|   rD   r…   r}   ÚcolumnsrB   s                     rK   rŽ   rŽ   h   sÃ   è ø€ ñX EPŒÐ>Ó	?Ñ@ÐUWð ð ‡N�NäØØ-Ø-Ø'ô	ô ¨*Ô5Ü°dÔ;ð		
ôô Ø	Ø!ØØØØ-Ò3°Øò€Hò 
Ø—>‘>ØØØØ#Ø'ð "ó 
÷ 	
ð 	
÷ 
ˆð	
ø÷ 
ˆüs0   ‚ABÁBÁ8BÁ9BÁ=	BÂBÂBÂBc                  ó  — e Zd ZdZ	 d	 	 	 	 	 	 	 	 	 dd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Ze	dd„«       Z
d d„Zdd	„Ze	d!d
„«       Ze	d!d„«       Zdd„Zdd„Zdd„Zd"d#d„Zd$d„Zd"d#d„Zd"d%d„Zd&d„Zd'd(d„Zd d„Zd)d„Zd*d„Zy)+Ú_Readerz9A reader that tracks progress while it's being read from.c                óJ   — || _         || _        || _        || _        d| _        y ©NF)ÚhandlerB   ÚtaskÚclose_handleÚ_closed)rI   r•   rB   r–   r—   s        rK   rH   z_Reader.__init__¹   s(   € ð ˆŒØ ˆŒØˆŒ	Ø(ˆÔØˆ�rL   c                ó:   — | j                   j                  «        | S rW   )r•   r[   rZ   s    rK   r[   z_Reader.__enter__Æ   s   € Ø�‰×ÑÔØˆrL   c                ó$   — | j                  «        y rW   )Úcloser`   s       rK   rd   z_Reader.__exit__Ê   s   € ð 	�
‰
�rL   c                ó   — | S rW   © rZ   s    rK   Ú__iter__z_Reader.__iter__Ò   s   € ØˆrL   c                ó�   — t        | j                  «      }| j                  j                  | j                  t        |«      ¬«       |S ©N©rO   )Únextr•   rB   rO   r–   Úlen)rI   Úlines     rK   Ú__next__z_Reader.__next__Õ   s4   € Ü�D—K‘KÓ ˆØ�‰×Ñ˜dŸi™i´°T³ÐÔ;ØˆrL   c                ó   — | j                   S rW   )r˜   rZ   s    rK   Úclosedz_Reader.closedÚ   s   € à�|‰|ÐrL   c                ó6   — | j                   j                  «       S rW   )r•   ÚfilenorZ   s    rK   r©   z_Reader.filenoÞ   ó   € Ø�{‰{×!Ñ!Ó#Ð#rL   c                ó6   — | j                   j                  «       S rW   )r•   ÚisattyrZ   s    rK   r¬   z_Reader.isattyá   rª   rL   c                ó.   — | j                   j                  S rW   )r•   ÚmoderZ   s    rK   r®   z_Reader.modeä   ó   € à�{‰{×ÑÐrL   c                ó.   — | j                   j                  S rW   )r•   ÚnamerZ   s    rK   r±   z_Reader.nameè   r¯   rL   c                ó6   — | j                   j                  «       S rW   )r•   ÚreadablerZ   s    rK   r³   z_Reader.readableì   ó   € Ø�{‰{×#Ñ#Ó%Ð%rL   c                ó6   — | j                   j                  «       S rW   )r•   ÚseekablerZ   s    rK   r¶   z_Reader.seekableï   r´   rL   c                 ó   — yr”   r�   rZ   s    rK   Úwritablez_Reader.writableò   s   € ØrL   c                óœ   — | j                   j                  |«      }| j                  j                  | j                  t        |«      ¬«       |S r    )r•   ÚreadrB   rO   r–   r£   )rI   ÚsizeÚblocks      rK   rº   z_Reader.readõ   s:   € Ø—‘× Ñ  Ó&ˆØ�‰×Ñ˜dŸi™i´°U³ÐÔ<ØˆrL   c                óŠ   — | j                   j                  |«      }| j                  j                  | j                  |¬«       |S r    )r•   ÚreadintorB   rO   r–   )rI   ÚbÚns      rK   r¾   z_Reader.readintoú   s6   € Ø�K‰K× Ñ  Ó#ˆØ�‰×Ñ˜dŸi™i°ÐÔ3ØˆrL   c                óœ   — | j                   j                  |«      }| j                  j                  | j                  t        |«      ¬«       |S r    )r•   ÚreadlinerB   rO   r–   r£   )rI   r»   r¤   s      rK   rÂ   z_Reader.readlineÿ   s:   € Ø�{‰{×#Ñ# DÓ)ˆØ�‰×Ñ˜dŸi™i´°T³ÐÔ;ØˆrL   c           	     ó¸   — | j                   j                  |«      }| j                  j                  | j                  t        t        t        |«      «      ¬«       |S r    )r•   Ú	readlinesrB   rO   r–   ÚsumÚmapr£   )rI   ÚhintÚliness      rK   rÄ   z_Reader.readlines  sA   € Ø—‘×%Ñ% dÓ+ˆØ�‰×Ñ˜dŸi™i´´S¼¸e³_Ó1EÐÔFØˆrL   c                ó^   — | j                   r| j                  j                  «        d| _        y )NT)r—   r•   r›   r˜   rZ   s    rK   r›   z_Reader.close	  s"   € Ø×ÒØ�K‰K×ÑÔØˆ�rL   c                óŒ   — | j                   j                  ||«      }| j                  j                  | j                  |¬«       |S )N©rF   )r•   ÚseekrB   rS   r–   )rI   ÚoffsetÚwhenceÚposs       rK   rÌ   z_Reader.seek  s8   € Ø�k‰k×Ñ˜v vÓ.ˆØ�‰×Ñ˜TŸY™Y°#ÐÔ6Øˆ
rL   c                ó6   — | j                   j                  «       S rW   )r•   ÚtellrZ   s    rK   rÑ   z_Reader.tell  s   € Ø�{‰{×ÑÓ!Ð!rL   c                ó   — t        d«      ‚)NÚwrite©r   )rI   Úss     rK   rÓ   z_Reader.write  s   € Ü" 7Ó+Ð+rL   c                ó   — t        d«      ‚)NÚ
writelinesrÔ   )rI   rÈ   s     rK   r×   z_Reader.writelines  s   € Ü" <Ó0Ð0rL   N)T)
r•   r   rB   re   r–   r;   r—   Úboolrh   ri   )rh   z	'_Reader'rj   )rh   r   )rh   Úbytes©rh   rØ   )rh   Úint)rh   Ústr)éÿÿÿÿ)r»   rÛ   rh   rÙ   )r¿   z"Union[bytearray, memoryview, mmap])rÇ   rÛ   rh   zList[bytes]rg   )r   )rÍ   rÛ   rÎ   rÛ   rh   rÛ   )rÕ   r   rh   rÛ   )rÈ   zIterable[Any]rh   ri   )rk   rl   rm   rn   rH   r[   rd   rž   r¥   Úpropertyr§   r©   r¬   r®   r±   r³   r¶   r¸   rº   r¾   rÂ   rÄ   r›   rÌ   rÑ   rÓ   r×   r�   rL   rK   r’   r’   ¶   sû   „ ÙCð "ðàðð ðð ð	ð
 ðð 
óóðà/ðð )ðð (ð	ð
 
óóóð
 òó ðó$ó$ð ò ó ð ð ò ó ð ó&ó&óôó
ô
ô
ó
ô
ó
"ó,ô1rL   r’   c                  ó8   — e Zd ZdZdd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zy)	Ú_ReadContextzEA utility class to handle a context for both a reader and a progress.c                ó    — || _         || _        y rW   )rB   Úreader)rI   rB   râ   s      rK   rH   z_ReadContext.__init__   s   € Ø ˆŒØ ˆ�rL   c                ój   — | j                   j                  «        | j                  j                  «       S rW   )rB   rY   râ   r[   rZ   s    rK   r[   z_ReadContext.__enter__$  s%   € Ø�‰×ÑÔØ�{‰{×$Ñ$Ó&Ð&rL   c                ór   — | j                   j                  «        | j                  j                  |||«       y rW   )rB   Ústoprâ   rd   r`   s       rK   rd   z_ReadContext.__exit__(  s*   € ð 	�‰×ÑÔØ�‰×Ñ˜X w°Õ7rL   N)rB   re   râ   r=   rh   ri   )rh   r=   rj   )rk   rl   rm   rn   rH   r[   rd   r�   rL   rK   rà   rà     s:   „ ÙOó!ó'ð8à/ð8ð )ð8ð (ð	8ð
 
ô8rL   rà   ú
Reading...)r‡   r€   r�   r‚   rƒ   r„   ry   rz   r{   r|   r…   c          
     óì   — |rt        d«      gng }|j                  t        ||	|
|¬«      t        «       t	        «       f«       t        ||||||xs d|dœŽ}|j                  | ||¬«      }t        ||«      S )a  Read bytes from a file while tracking progress.

    Args:
        file (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode.
        total (int): Total number of bytes to read.
        description (str, optional): Description of task show next to progress bar. Defaults to "Reading".
        auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
        transient: (bool, optional): Clear the progress on exit. Defaults to False.
        console (Console, optional): Console to write to. Default creates internal Console instance.
        refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
        style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
        complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
        finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
        pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
        disable (bool, optional): Disable display of progress.
    Returns:
        ContextManager[BinaryIO]: A context manager yielding a progress reader.

    rw   rx   rq   r   )r†   r‡   )rˆ   r‰   rŠ   ÚDownloadColumnrŒ   r�   Ú	wrap_filerà   )Úfiler†   r‡   r€   r�   r‚   rƒ   r„   ry   rz   r{   r|   r…   r�   rB   râ   s                   rK   ré   ré   2  sž   € ñJ EPŒÐ>Ó	?Ñ@ÐUWð ð ‡N�NäØØ-Ø-Ø'ô	ô ÓÜÓ!ð		
ôô Ø	Ø!ØØØØ-Ò3°Øò€Hð ×Ñ ¨E¸{ÐÓK€FÜ˜ &Ó)Ð)rL   )r†   r‡   r€   r�   r‚   rƒ   r„   ry   rz   r{   r|   r…   c                ó   — y rW   r�   ©rê   r®   Ú	bufferingÚencodingÚerrorsÚnewliner†   r‡   r€   r�   r‚   rƒ   r„   ry   rz   r{   r|   r…   s                     rK   Úopenrñ   s  ó   € ð, 	rL   c                ó   — y rW   r�   rì   s                     rK   rñ   rñ   Œ  rò   rL   c          
     óö   — |rt        d«      gng }|j                  t        ||||¬«      t        «       t	        «       f«       t        |||	|
||xs d|dœŽ}|j                  | |||||||¬«      }t        ||«      S )a®  Read bytes from a file while tracking progress.

    Args:
        path (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode.
        mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt".
        buffering (int): The buffering strategy to use, see :func:`io.open`.
        encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`.
        errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`.
        newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`
        total: (int, optional): Total number of bytes to read. Must be provided if reading from a file handle. Default for a path is os.stat(file).st_size.
        description (str, optional): Description of task show next to progress bar. Defaults to "Reading".
        auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
        transient: (bool, optional): Clear the progress on exit. Defaults to False.
        console (Console, optional): Console to write to. Default creates internal Console instance.
        refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
        style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
        complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
        finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
        pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
        disable (bool, optional): Disable display of progress.
        encoding (str, optional): The encoding to use when reading in text mode.

    Returns:
        ContextManager[BinaryIO]: A context manager yielding a progress reader.

    rw   rx   rq   r   )r®   rí   rî   rï   rð   r†   r‡   )rˆ   r‰   rŠ   rè   rŒ   r�   rñ   rà   )rê   r®   rí   rî   rï   rð   r†   r‡   r€   r�   r‚   rƒ   r„   ry   rz   r{   r|   r…   r�   rB   râ   s                        rK   rñ   rñ   ¥  s´   € ñb EPŒÐ>Ó	?Ñ@ÐUWð ð ‡N�NäØØ-Ø-Ø'ô	ô ÓÜÓ!ð		
ôô Ø	Ø!ØØØØ-Ò3°Øò€Hð �]‰]ØØØØØØØØð ó 	€Fô ˜ &Ó)Ð)rL   c                  óL   — e Zd ZU dZdZded<   d	d
d„Zdd„Zdd„Ze	dd„«       Z
y)ÚProgressColumnz3Base class for a widget to use in progress display.NúOptional[float]Úmax_refreshc                ó.   — || _         i | _        d | _        y rW   )Ú_table_columnÚ_renderable_cacheÚ_update_time)rI   Útable_columns     rK   rH   zProgressColumn.__init__   s   € Ø)ˆÔØMOˆÔØ-1ˆÕrL   c                ó2   — | j                   xs
 t        «       S )z.Get a table column, used to build tasks table.)rú   r7   rZ   s    rK   Úget_table_columnzProgressColumn.get_table_column  s   € à×!Ñ!Ò-¤V£XÐ-rL   c                ó.  — |j                  «       }| j                  �=|j                  s1	 | j                  |j                     \  }}|| j                  z   |kD  r|S | j                  |«      }||f| j                  |j                  <   |S # t
        $ r Y Œ9w xY w)a  Called by the Progress object to return a renderable for the given task.

        Args:
            task (Task): An object containing information regarding the task.

        Returns:
            RenderableType: Anything renderable (including str).
        )rƒ   rø   rF   rû   ÚidÚKeyErrorÚrender)rI   r–   Úcurrent_timeÚ	timestampÚ
renderables        rK   Ú__call__zProgressColumn.__call__	  s›   € ð —}‘}“ˆØ×ÑÐ'°·²ð&Ø(,×(>Ñ(>¸t¿w¹wÑ(GÑ%�	˜:ð ˜t×/Ñ/Ñ/°,Ò>Ø%Ð%à—[‘[ Ó&ˆ
Ø+7¸Ð*Dˆ×Ñ˜tŸw™wÑ'ØÐøô ò Ùðús   ªB Â	BÂBc                 ó   — y)z"Should return a renderable object.Nr�   ©rI   r–   s     rK   r  zProgressColumn.render   s   � rL   rW   )rý   úOptional[Column]rh   ri   )rh   r7   ©r–   ú'Task'rh   r0   )rk   rl   rm   rn   rø   Ú__annotations__rH   rÿ   r  r   r  r�   rL   rK   rö   rö   û  s2   … Ù=à#'€K�Ó'ô2ó
.óð. ò1ó ñ1rL   rö   c                  ó<   ‡ — e Zd ZdZ	 dddœ	 	 	 dˆ fd„Zdd„Zˆ xZS )	ÚRenderableColumnz�A column to insert an arbitrary column.

    Args:
        renderable (RenderableType, optional): Any renderable. Defaults to empty string.
    N©rý   c               ó4   •— || _         t        ‰| �	  |¬«       y ©Nr  )r  rG   rH   )rI   r  rý   rJ   s      €rK   rH   zRenderableColumn.__init__,  s   ø€ ð %ˆŒÜ‰Ñ lÐÕ3rL   c                ó   — | j                   S rW   )r  r	  s     rK   r  zRenderableColumn.render2  s   € Ø�‰ÐrL   )Ú )r  r0   rý   r
  r  ©rk   rl   rm   rn   rH   r  ro   rp   s   @rK   r  r  %  s/   ø„ ñð ,.ð4ØSWñ4Ø(ð4Ø@Põ4÷rL   r  c                  óf   ‡ — e Zd ZdZ	 	 	 	 	 d	 	 	 	 	 	 	 	 	 dˆ fd„Z	 	 d	 	 	 	 	 	 	 dd„Zd	d„Zˆ xZS )
ÚSpinnerColumna‰  A column with a 'spinner' animation.

    Args:
        spinner_name (str, optional): Name of spinner animation. Defaults to "dots".
        style (StyleType, optional): Style of spinner. Defaults to "progress.spinner".
        speed (float, optional): Speed factor of spinner. Defaults to 1.0.
        finished_text (TextType, optional): Text used when task is finished. Defaults to " ".
    c                ó¤   •— t        |||¬«      | _        t        |t        «      rt	        j
                  |«      n|| _        t        ‰| �!  |¬«       y )N©ry   Úspeedr  )	r5   ÚspinnerÚ
isinstancerÜ   r9   Úfrom_markupÚfinished_textrG   rH   )rI   Úspinner_namery   r  r  rý   rJ   s         €rK   rH   zSpinnerColumn.__init__@  sN   ø€ ô ˜|°5ÀÔFˆŒô ˜-¬Ô-ô ×Ñ˜]Ô+àð 	Ôô
 	‰Ñ lÐÕ3rL   c                ó*   — t        |||¬«      | _        y)a-  Set a new spinner.

        Args:
            spinner_name (str): Spinner name, see python -m rich.spinner.
            spinner_style (Optional[StyleType], optional): Spinner style. Defaults to "progress.spinner".
            speed (float, optional): Speed factor of spinner. Defaults to 1.0.
        r  N)r5   r  )rI   r  Úspinner_styler  s       rK   Úset_spinnerzSpinnerColumn.set_spinnerP  s   € ô ˜|°=ÈÔNˆ�rL   c                óŒ   — |j                   r| j                  }|S | j                  j                  |j	                  «       «      }|S rW   )Úfinishedr  r  r  rƒ   )rI   r–   Útexts      rK   r  zSpinnerColumn.render_  sH   € ð �}Š}ð ×Ñð 	ð
 ˆð —‘×$Ñ$ T§]¡]£_Ó5ð 	ð
 ˆrL   )Údotsúprogress.spinnerç      ð?Ú N)
r  rÜ   ry   úOptional[StyleType]r  rf   r  r:   rý   r
  )r'  r(  )r  rÜ   r!  r*  r  rf   rh   ri   r  )rk   rl   rm   rn   rH   r"  r  ro   rp   s   @rK   r  r  6  sŒ   ø„ ñð #Ø%7ØØ"%Ø)-ð4àð4ð #ð4ð ð	4ð
  ð4ð 'õ4ð& .@Øð	OàðOð +ðOð ð	Oð
 
óO÷rL   r  c                  óR   ‡ — e Zd ZdZ	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zˆ xZS )rˆ   zA column containing text.c                óˆ   •— || _         || _        || _        || _        || _        t
        ‰| �  |xs t        d¬«      ¬«       y )NT©Úno_wrapr  )Útext_formatÚjustifyry   ÚmarkupÚhighlighterrG   rH   r7   )rI   r/  ry   r0  r1  r2  rý   rJ   s          €rK   rH   zTextColumn.__init__k  sD   ø€ ð 'ˆÔØ&-ˆŒØˆŒ
ØˆŒØ&ˆÔÜ‰Ñ lÒ&J´fÀTÔ6JÐÕKrL   c                óB  — | j                   j                  |¬«      }| j                  r-t        j                  || j
                  | j                  ¬«      }n"t        || j
                  | j                  ¬«      }| j                  r| j                  j                  |«       |S ©N©r–   )ry   r0  )	r/  Úformatr1  r9   r  ry   r0  r2  Ú	highlight)rI   r–   Ú_textr%  s       rK   r  zTextColumn.render{  sv   € Ø× Ñ ×'Ñ'¨TÐ'Ó2ˆØ�;Š;Ü×#Ñ# E°·±ÀTÇ\Á\ÔR‰Dä˜ T§Z¡Z¸¿¹ÔFˆDØ×ÒØ×Ñ×&Ñ& tÔ,ØˆrL   )ÚnoneÚleftTNN)r/  rÜ   ry   r6   r0  r/   r1  rØ   r2  úOptional[Highlighter]rý   r
  rh   ri   ©r–   r  rh   r9   r  rp   s   @rK   rˆ   rˆ   h  sm   ø„ Ù#ð
 "Ø!'ØØ-1Ø)-ðLàðLð ðLð ð	Lð
 ðLð +ðLð 'ðLð 
õL÷ rL   rˆ   c                  óT   ‡ — e Zd ZdZ	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zˆ xZS )rŠ   a  Renders a visual progress bar.

    Args:
        bar_width (Optional[int], optional): Width of bar or None for full width. Defaults to 40.
        style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
        complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
        finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
        pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
    c                ól   •— || _         || _        || _        || _        || _        t
        ‰| �  |¬«       y r  )Ú	bar_widthry   rz   r{   r|   rG   rH   )rI   r?  ry   rz   r{   r|   rý   rJ   s          €rK   rH   zBarColumn.__init__‘  s;   ø€ ð #ˆŒØˆŒ
Ø,ˆÔØ,ˆÔØ&ˆÔÜ‰Ñ lÐÕ3rL   c                ó\  — t        |j                  �t        d|j                  «      ndt        d|j                  «      | j                  €dnt        d| j                  «      |j
                   |j                  «       | j                  | j                  | j                  | j                  ¬«	      S )z&Gets a progress bar widget for a task.Nr   r*   )	r†   rF   ÚwidthÚpulseÚanimation_timery   rz   r{   r|   )r4   r†   ÚmaxrF   r?  Ústartedrƒ   ry   rz   r{   r|   r	  s     rK   r  zBarColumn.render¡  s„   € äØ(,¯
©
Ð(>”#�a˜Ÿ™Ô$ÀDÜ˜!˜TŸ^™^Ó,ØŸ.™.Ð0‘$´c¸!¸T¿^¹^Ó6LØ—l‘lÐ"ØŸ=™=›?Ø—*‘*Ø×.Ñ.Ø×.Ñ.Ø×(Ñ(ô

ð 
	
rL   )é(   rr   rs   rt   ru   N)r?  úOptional[int]ry   r6   rz   r6   r{   r6   r|   r6   rý   r
  rh   ri   )r–   r  rh   r4   r  rp   s   @rK   rŠ   rŠ   †  sj   ø„ ñð $&Ø%Ø$2Ø$2Ø!,Ø)-ð4à ð4ð ð4ð "ð	4ð
 "ð4ð ð4ð 'ð4ð 
õ4÷ 
rL   rŠ   c                  ó   — e Zd ZdZdd„Zy)ÚTimeElapsedColumnzRenders time elapsed.c                óÒ   — |j                   r|j                  n|j                  }|€t        dd¬«      S t	        t        dt        |«      «      ¬«      }t        t        |«      d¬«      S )zShow time elapsed.ú-:--:--úprogress.elapsed©ry   r   )Úseconds)r$  Úfinished_timeÚelapsedr9   r
   rD  rÛ   rÜ   )rI   r–   rP  Údeltas       rK   r  zTimeElapsedColumn.render³  sS   € à(,¯ª�$×$Ò$¸4¿<¹<ˆØˆ?Ü˜	Ð);Ô<Ð<Ü¤# a¬¨W«Ó"6Ô7ˆÜ”C˜“JÐ&8Ô9Ð9rL   Nr<  ©rk   rl   rm   rn   r  r�   rL   rK   rI  rI  °  s
   „ Ùô:rL   rI  c                  ór   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zedd„«       Zdd„Zˆ xZS )	r‹   a  Show task progress as a percentage.

    Args:
        text_format (str, optional): Format for percentage display. Defaults to "[progress.percentage]{task.percentage:>3.0f}%".
        text_format_no_percentage (str, optional): Format if percentage is unknown. Defaults to "".
        style (StyleType, optional): Style of output. Defaults to "none".
        justify (JustifyMethod, optional): Text justification. Defaults to "left".
        markup (bool, optional): Enable markup. Defaults to True.
        highlighter (Optional[Highlighter], optional): Highlighter to apply to output. Defaults to None.
        table_column (Optional[Column], optional): Table Column to use. Defaults to None.
        show_speed (bool, optional): Show speed if total is unknown. Defaults to False.
    c	                óL   •— || _         || _        t        ‰	| �  ||||||¬«       y )N)r/  ry   r0  r1  r2  rý   )Útext_format_no_percentager}   rG   rH   )
rI   r/  rU  ry   r0  r1  r2  rý   r}   rJ   s
            €rK   rH   zTaskProgressColumn.__init__Ê  s9   ø€ ð *CˆÔ&Ø$ˆŒÜ‰ÑØ#ØØØØ#Ø%ð 	õ 	
rL   c                óš   — |€t        dd¬«      S t        j                  t        |«      g d¢d«      \  }}||z  }t        |d›|› d�d¬«      S )zµRender the speed in iterations per second.

        Args:
            task (Task): A Task object.

        Returns:
            Text: Text object containing the task speed.
        r  zprogress.percentagerM  )r  u   Ã—10Â³u   Ã—10â�¶u   Ã—10â�¹u   Ã—10Â¹Â²éè  z.1fz it/s)r9   r+   Úpick_unit_and_suffixrÛ   )Úclsr  ÚunitÚsuffixÚ
data_speeds        rK   Úrender_speedzTaskProgressColumn.render_speedà  s_   € ð ˆ=Ü˜Ð"7Ô8Ð8Ü×4Ñ4Ü�‹JÚ<Øó
‰ˆˆfð
 ˜T‘\ˆ
Ü�z #Ð& v h¨eÐ4Ð<QÔRÐRrL   c                óø  — |j                   €5| j                  r)| j                  |j                  xs |j                  «      S |j                   €| j
                  n| j                  }|j                  |¬«      }| j                  r-t        j                  || j                  | j                  ¬«      }n"t        || j                  | j                  ¬«      }| j                  r| j                  j                  |«       |S r4  )r†   r}   r]  Úfinished_speedr  rU  r/  r6  r1  r9   r  ry   r0  r2  r7  )rI   r–   r/  r8  r%  s        rK   r  zTaskProgressColumn.renderô  sÁ   € Ø�:‰:Ð $§/¢/Ø×$Ñ$ T×%8Ñ%8Ò%F¸D¿J¹JÓGÐGà.2¯j©jÐ.@ˆD×*Ò*Àd×FVÑFVð 	ð ×"Ñ"¨Ð"Ó-ˆØ�;Š;Ü×#Ñ# E°·±ÀTÇ\Á\ÔR‰Dä˜ T§Z¡Z¸¿¹ÔFˆDØ×ÒØ×Ñ×&Ñ& tÔ,ØˆrL   )z-[progress.percentage]{task.percentage:>3.0f}%r  r9  r:  TNNF)r/  rÜ   rU  rÜ   ry   r6   r0  r/   r1  rØ   r2  r;  rý   r
  r}   rØ   rh   ri   )r  r÷   rh   r9   r<  )	rk   rl   rm   rn   rH   Úclassmethodr]  r  ro   rp   s   @rK   r‹   r‹   ¼  s›   ø„ ñð KØ)+Ø!Ø!'ØØ-1Ø)-Ø ð
àð
ð $'ð
ð ð	
ð
 ð
ð ð
ð +ð
ð 'ð
ð ð
ð 
õ
ð, òSó ðS÷&rL   r‹   c                  óB   ‡ — e Zd ZdZdZ	 	 	 d	 	 	 	 	 dˆ fd„Zdd„Zˆ xZS )rŒ   a  Renders estimated time remaining.

    Args:
        compact (bool, optional): Render MM:SS when time remaining is less than an hour. Defaults to False.
        elapsed_when_finished (bool, optional): Render time elapsed when the task is finished. Defaults to False.
    ç      à?c                óB   •— || _         || _        t        ‰| �  |¬«       y r  )Úcompactr~   rG   rH   )rI   rd  r~   rý   rJ   s       €rK   rH   zTimeRemainingColumn.__init__  s$   ø€ ð ˆŒØ%:ˆÔ"Ü‰Ñ lÐÕ3rL   c                ó–  — | j                   r|j                  r|j                  }d}n|j                  }d}|j                  €t        d|¬«      S |€!t        | j                  rd|¬«      S d|¬«      S t        t        |«      d«      \  }}t        |d«      \  }}| j                  r|s
|d›d	|d›�}n|d
›d	|d›d	|d›�}t        ||¬«      S )zShow time remaining.rL  zprogress.remainingr  rM  z--:--rK  é<   Ú02dÚ:Úd)	r~   r$  rO  Útime_remainingr†   r9   rd  ÚdivmodrÛ   )rI   r–   Ú	task_timery   ÚminutesrN  ÚhoursÚ	formatteds           rK   r  zTimeRemainingColumn.render  sØ   € à×%Ò%¨$¯-ª-Ø×*Ñ*ˆIØ&‰Eà×+Ñ+ˆIØ(ˆEà�:‰:ÐÜ˜ %Ô(Ð(àÐÜ 4§<¢<˜ÀeÔLÐL°YÀeÔLÐLô "¤# i£.°"Ó5Ñˆ�Ü ¨Ó,‰ˆˆwà�<Š<¡Ø" 3˜- q¨°¨Ð6‰Ià  ˜) 1 W¨S M°°7¸3°-Ð@ˆIä�I UÔ+Ð+rL   )FFN)rd  rØ   r~   rØ   rý   r
  r<  )rk   rl   rm   rn   rø   rH   r  ro   rp   s   @rK   rŒ   rŒ     s@   ø„ ñð €Kð Ø&+Ø)-ð	4àð4ð  $ð4ð 'õ	4÷,rL   rŒ   c                  ó   — e Zd ZdZdd„Zy)ÚFileSizeColumnzRenders completed filesize.c                ól   — t        j                  t        |j                  «      «      }t	        |d¬«      S )úShow data completed.zprogress.filesizerM  )r+   ÚdecimalrÛ   rF   r9   ©rI   r–   Ú	data_sizes      rK   r  zFileSizeColumn.render7  s)   € ä×$Ñ$¤S¨¯©Ó%8Ó9ˆ	Ü�IÐ%8Ô9Ð9rL   Nr<  rR  r�   rL   rK   rq  rq  4  s
   „ Ù%ô:rL   rq  c                  ó   — e Zd ZdZdd„Zy)ÚTotalFileSizeColumnzRenders total filesize.c                óˆ   — |j                   �(t        j                  t        |j                   «      «      nd}t	        |d¬«      S )rs  r  zprogress.filesize.totalrM  )r†   r+   rt  rÛ   r9   ru  s      rK   r  zTotalFileSizeColumn.render@  s4   € à9=¿¹Ð9O”H×$Ñ$¤S¨¯©£_Ô5ÐUWˆ	Ü�IÐ%>Ô?Ð?rL   Nr<  rR  r�   rL   rK   rx  rx  =  s   „ Ù!ô@rL   rx  c                  ó.   ‡ — e Zd ZdZddˆ fd„Zdd„Zˆ xZS )ÚMofNCompleteColumnaH  Renders completed count/total, e.g. '  10/1000'.

    Best for bounded tasks with int quantities.

    Space pads the completed count so that progress length does not change as task progresses
    past powers of 10.

    Args:
        separator (str, optional): Text to separate completed and total values. Defaults to "/".
    c                ó4   •— || _         t        ‰| �	  |¬«       y r  )Ú	separatorrG   rH   )rI   r}  rý   rJ   s      €rK   rH   zMofNCompleteColumn.__init__R  s   ø€ Ø"ˆŒÜ‰Ñ lÐÕ3rL   c                óÜ   — t        |j                  «      }|j                  �t        |j                  «      nd}t        t	        |«      «      }t        ||› d�›| j                  › |› �d¬«      S )zShow completed/total.Ú?ri  úprogress.downloadrM  )rÛ   rF   r†   r£   rÜ   r9   r}  )rI   r–   rF   r†   Útotal_widths        rK   r  zMofNCompleteColumn.renderV  sc   € ä˜Ÿ™Ó'ˆ	Ø#'§:¡:Ð#9”�D—J‘J”¸sˆÜœ#˜e›*“oˆÜØ˜+˜ a˜Ð(¨¯©Ð(8¸¸Ð@Ø%ô
ð 	
rL   )Ú/N)r}  rÜ   rý   r
  r<  r  rp   s   @rK   r{  r{  F  s   ø„ ñ	ö4÷
rL   r{  c                  ó:   ‡ — e Zd ZdZ	 d	 	 	 	 	 dˆ fd„Zdd„Zˆ xZS )rè   z¤Renders file size downloaded and total, e.g. '0.5/2.3 GB'.

    Args:
        binary_units (bool, optional): Use binary units, KiB, MiB etc. Defaults to False.
    c                ó4   •— || _         t        ‰| �	  |¬«       y r  )Úbinary_unitsrG   rH   )rI   r…  rý   rJ   s      €rK   rH   zDownloadColumn.__init__h  s   ø€ ð )ˆÔÜ‰Ñ lÐÕ3rL   c                ó¼  — t        |j                  «      }|j                  �t        |j                  «      n|}| j                  rt	        j
                  |g d¢d«      \  }}nt	        j
                  |g d¢d«      \  }}|dk(  rdnd}||z  }|d|› d�›}|j                  �#t        |j                  «      }	|	|z  }
|
d|› d�›}nd	}|› d
|› d|› �}t        |d¬«      }|S )z.Calculate common unit for completed and total.)	rÙ   ÚKiBÚMiBÚGiBÚTiBÚPiBÚEiBÚZiBÚYiBi   )	rÙ   ÚkBÚMBÚGBÚTBÚPBÚEBÚZBÚYBrW  r*   r   z,.Úfr  r‚  r)  r€  rM  )rÛ   rF   r†   r…  r+   rX  r9   )rI   r–   rF   Ú unit_and_suffix_calculation_baserZ  r[  Ú	precisionÚcompleted_ratioÚcompleted_strr†   Útotal_ratioÚ	total_strÚdownload_statusÚdownload_texts                 rK   r  zDownloadColumn.rendern  sÿ   € ä˜Ÿ™Ó'ˆ	ð  $Ÿz™zÐ5ŒC�—
‘
ŒO¸9ð 	)ð ×ÒÜ#×8Ñ8Ø0ÚQØó‰LˆD‘&ô $×8Ñ8Ø0ÚIØó‰LˆD�&ð
  š‘A¨ˆ	à# dÑ*ˆØ*¨2¨i¨[¸¨/Ð:ˆà�:‰:Ð!Ü˜Ÿ
™
“OˆEØ $™,ˆKØ& r¨)¨°A oÐ6‰IàˆIà*˜O¨1¨Y¨K°q¸¸ÐAˆÜ˜_Ð4GÔHˆØÐrL   )FN)r…  rØ   rý   r
  rh   ri   r<  r  rp   s   @rK   rè   rè   a  s1   ø„ ñð LPð4Ø ð4Ø8Hð4à	õ4÷!rL   rè   c                  ó   — e Zd ZdZdd„Zy)ÚTransferSpeedColumnz&Renders human readable transfer speed.c                ó°   — |j                   xs |j                  }|€t        dd¬«      S t        j                  t        |«      «      }t        |› d�d¬«      S )zShow data transfer speed.r  zprogress.data.speedrM  z/s)r_  r  r9   r+   rt  rÛ   )rI   r–   r  r\  s       rK   r  zTransferSpeedColumn.render•  sR   € à×#Ñ#Ò1 t§z¡zˆØˆ=Ü˜Ð#8Ô9Ð9Ü×%Ñ%¤c¨%£jÓ1ˆ
Ü�z�l "Ð%Ð-BÔCÐCrL   Nr<  rR  r�   rL   rK   r¡  r¡  ’  s   „ Ù0ôDrL   r¡  c                  ó(   — e Zd ZU dZded<   	 ded<   y)ÚProgressSamplez$Sample of progress for a given time.rf   r  rF   N)rk   rl   rm   rn   r  r�   rL   rK   r¤  r¤  ž  s   … Ù.àÓØØÓØ$rL   r¤  c                  ó°  — e Zd ZU dZded<   	 ded<   	 ded<   	 ded	<   	 d
ed<   	 dZded<   	 dZded<   	  ee¬«      Z	ded<   	  eddd¬«      Z
ded<   	  eddd¬«      Zded<   	 dZded<   	  ed„ dd¬«      Zded<    ede¬«      Zded<   	 d)d „Zed*d!„«       Zed+d"„«       Zed+d#„«       Zed*d$„«       Zed)d%„«       Zed+d&„«       Zed+d'„«       Zd,d(„Zy)-ÚTaskz…Information regarding a progress task.

    This object should be considered read-only outside of the :class:`~Progress` class.

    r;   r  rÜ   r‡   r÷   r†   rf   rF   ÚGetTimeCallableÚ	_get_timeNrO  TrØ   Úvisible)Údefault_factoryzDict[str, Any]ÚfieldsF)ÚdefaultÚinitÚreprÚ
start_timeÚ	stop_timer_  c                 ó   — t        d¬«      S )NrW  )Úmaxlenr   r�   rL   rK   Ú<lambda>zTask.<lambda>Ñ  s	   € ¤¨TÕ 2rL   )rª  r­  r®  zDeque[ProgressSample]Ú	_progress)r®  rª  r   Ú_lockc                ó"   — | j                  «       S )z(float: Get the current time, in seconds.)r¨  rZ   s    rK   rƒ   zTask.get_time×  s   € à�~‰~ÓÐrL   c                ó   — | j                   duS )z#bool: Check if the task as started.N)r¯  rZ   s    rK   rE  zTask.startedÛ  s   € ð �‰ dÐ*Ð*rL   c                óN   — | j                   €y| j                   | j                  z
  S )zPOptional[float]: Get the number of steps remaining, if a non-None total was set.N©r†   rF   rZ   s    rK   Ú	remainingzTask.remainingà  s$   € ð �:‰:ÐØØ�z‰z˜DŸN™NÑ*Ð*rL   c                ó    — | j                   €y| j                  �| j                  | j                   z
  S | j                  «       | j                   z
  S )z]Optional[float]: Time elapsed since task was started, or ``None`` if the task hasn't started.N)r¯  r°  rƒ   rZ   s    rK   rP  zTask.elapsedç  sC   € ð �?‰?Ð"ØØ�>‰>Ð%Ø—>‘> D§O¡OÑ3Ð3Ø�}‰}‹ §¡Ñ0Ð0rL   c                ó   — | j                   duS )zCheck if the task has finished.N)rO  rZ   s    rK   r$  zTask.finishedð  s   € ð ×!Ñ!¨Ð-Ð-rL   c                ó„   — | j                   sy| j                  | j                   z  dz  }t        dt        d|«      «      }|S )zOfloat: Get progress of task as a percentage. If a None total was set, returns 0ç        ç      Y@)r†   rF   ÚminrD  )rI   rF   s     rK   Ú
percentagezTask.percentageõ  s>   € ð �zŠzØØ—^‘^ d§j¡jÑ0°EÑ9ˆ	Ü˜œs 3¨	Ó2Ó3ˆ	ØÐrL   c                óJ  — | j                   €y| j                  5  | j                  }|s
	 ddd«       y|d   j                  |d   j                  z
  }|dk(  r
	 ddd«       yt	        |«      }t        |«       t        d„ |D «       «      }||z  }|cddd«       S # 1 sw Y   yxY w)z=Optional[float]: Get the estimated speed in steps per second.NrÝ   r   c              3  ó4   K  — | ]  }|j                   –— Œ y ­wrW   rË   )Ú.0Úsamples     rK   Ú	<genexpr>zTask.speed.<locals>.<genexpr>  s   è ø€ Ð!OÁ°v &×"2Õ"2Áùó   ‚)r¯  rµ  r´  r  Úiterr¢   rÅ   )rI   rB   Ú
total_timeÚiter_progressÚtotal_completedr  s         rK   r  z
Task.speedþ  s™   € ð �?‰?Ð"ØØ�Z‹ZØ—~‘~ˆHÙØ÷ ˆZð " "™×/Ñ/°(¸1±+×2GÑ2GÑGˆJØ˜QŠØ÷ ˆZô ! ›NˆMÜ�ÔÜ!Ñ!OÁÓ!OÓOˆOØ# jÑ0ˆEØ÷ �ZŠZús   šB³%BÁ!.BÂB"c                óx   — | j                   ry| j                  }|sy| j                  }|€yt        ||z  «      }|S )zJOptional[float]: Get estimated time to completion, or ``None`` if no data.r¾  N)r$  r  rº  r   )rI   r  rº  Úestimates       rK   rj  zTask.time_remaining  sC   € ð �=Š=ØØ—
‘
ˆÙØØ—N‘Nˆ	ØÐØÜ˜	 EÑ)Ó*ˆØˆrL   c                óT   — | j                   j                  «        d| _        d| _        y)zReset progress.N)r´  ÚclearrO  r_  rZ   s    rK   Ú_resetzTask._reset  s"   € à�‰×ÑÔØ!ˆÔØ"ˆÕrL   )rh   rf   rÚ   )rh   r÷   rg   )rk   rl   rm   rn   r  rO  r©  r	   Údictr«  r¯  r°  r_  r´  r   rµ  rƒ   rÞ   rE  rº  rP  r$  rÁ  r  rj  rÐ  r�   rL   rK   r¦  r¦  §  s_  … ñð 	ƒJØGàÓØ'àÓØ>àÓØ*àÓØ+à%)€M�?Ó)Ø(à€GˆTÓØJá"°4Ô8€FˆNÓ8Ø?á"'°¸5ÀuÔ"M€J�ÓMØNá!&¨t¸%ÀeÔ!L€IˆÓLØNà&*€N�OÓ*Ø>á',Ù2¸ÀUô(€IÐ$ó ñ ˜e°UÔ;€Eˆ5Ó;Øó ð ò+ó ð+ð ò+ó ð+ð ò1ó ð1ð ò.ó ð.ð òó ðð òó ðð" òó ðô#rL   r¦  c                  ó$  — e Zd ZdZdddddddddddœ
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d)d„Zed*d	„«       Zed+d
„«       Zed,d„«       Z	ed-d„«       Z
ed.d„«       Zd/d„Zd/d„Zd0d„Z	 	 	 	 	 	 	 	 d1d„Z	 	 	 	 	 d2	 	 	 	 	 	 	 	 	 	 	 	 	 d3d„Z	 d4dddœ	 	 	 	 	 	 	 	 	 d5d„Zej&                  	 	 	 	 d6ddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d7d„«       Zej&                  	 	 	 	 d6ddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d8d„«       Z	 	 	 	 	 d9ddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d:d„Zd;d„Zd;d„Zdddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d<d„Zddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d=d „Zd>d?d!„Zd/d"„Zd@d#„ZdAd$„ZdBd%„Zd@d&„Z	 	 	 	 dC	 	 	 	 	 	 	 	 	 	 	 	 	 dDd'„Zd;d(„Z y)Er�   ad  Renders an auto-updating progress bar(s).

    Args:
        console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout.
        auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()`.
        refresh_per_second (float, optional): Number of times per second to refresh the progress information. Defaults to 10.
        speed_estimate_period: (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30.
        transient: (bool, optional): Clear the progress on exit. Defaults to False.
        redirect_stdout: (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True.
        redirect_stderr: (bool, optional): Enable redirection of stderr. Defaults to True.
        get_time: (Callable, optional): A callable that gets the current time, or None to use Console.get_time. Defaults to None.
        disable (bool, optional): Disable progress display. Defaults to False
        expand (bool, optional): Expand tasks table to fit width. Defaults to False.
    NTrq   g      >@F)
r�   r€   r„   Úspeed_estimate_periodr‚   Úredirect_stdoutÚredirect_stderrrƒ   r…   Úexpandc       
   	     óÈ  — |dkD  sJ d«       ‚t        «       | _        |xs | j                  «       | _        || _        |	| _        |
| _        i | _        t        d«      | _	        t        |xs
 t        «       |||||| j                  ¬«      | _        |xs | j                  j                  | _        | j                  j                   | _        | j                  j"                  | _        y )Nr   zrefresh_per_second must be > 0)r�   r€   r„   r‚   rÔ  rÕ  Úget_renderable)r   rµ  Úget_default_columnsr�   rÓ  r…   rÖ  Ú_tasksr;   Ú_task_indexr3   r,   rØ  rQ   r�   rƒ   ÚprintÚlog)rI   r�   r€   r„   rÓ  r‚   rÔ  rÕ  rƒ   r…   rÖ  r�   s               rK   rH   zProgress.__init__5  sÇ   € ð " AÒ%ÐGÐ'GÓGÐ%Ü“WˆŒ
ØÒ< $×":Ñ":Ó"<ˆŒØ%:ˆÔ"àˆŒØˆŒØ*,ˆŒÜ#)¨!£9ˆÔÜØÒ,œ{›}Ø%Ø1ØØ+Ø+Ø×.Ñ.ô
ˆŒ	ð !Ò9 D§L¡L×$9Ñ$9ˆŒØ—\‘\×'Ñ'ˆŒ
Ø—<‘<×#Ñ#ˆ�rL   c                óP   — t        d«      t        «       t        «       t        «       fS )a§  Get the default columns used for a new Progress instance:
           - a text column for the description (TextColumn)
           - the bar itself (BarColumn)
           - a text column showing completion percentage (TextColumn)
           - an estimated-time-remaining column (TimeRemainingColumn)
        If the Progress instance is created without passing a columns argument,
        the default columns defined here will be used.

        You can also create a Progress instance using custom columns before
        and/or after the defaults, as in this example:

            progress = Progress(
                SpinnerColumn(),
                *Progress.get_default_columns(),
                "Elapsed:",
                TimeElapsedColumn(),
            )

        This code shows the creation of a Progress display, containing
        a spinner to the left, the default columns, and a labeled elapsed
        time column.
        rw   )rˆ   rŠ   r‹   rŒ   )rY  s    rK   rÙ  zProgress.get_default_columnsY  s(   € ô2 ÐAÓBÜ‹KÜÓ ÜÓ!ð	
ð 	
rL   c                ó.   — | j                   j                  S rW   )rQ   r�   rZ   s    rK   r�   zProgress.consolex  s   € à�y‰y× Ñ Ð rL   c                óŒ   — | j                   5  t        | j                  j                  «       «      cddd«       S # 1 sw Y   yxY w)zGet a list of Task instances.N)rµ  ÚlistrÚ  ÚvaluesrZ   s    rK   ÚtaskszProgress.tasks|  s*   € ð �Z‹ZÜ˜Ÿ™×*Ñ*Ó,Ó-÷ �ZŠZúó	   �#:ºAc                óŒ   — | j                   5  t        | j                  j                  «       «      cddd«       S # 1 sw Y   yxY w)zA list of task IDs.N)rµ  rá  rÚ  ÚkeysrZ   s    rK   Útask_idszProgress.task_ids‚  s*   € ð �Z‹ZÜ˜Ÿ™×(Ñ(Ó*Ó+÷ �ZŠZúrä  c                óÆ   — | j                   5  | j                  s
	 ddd«       yt        d„ | j                  j                  «       D «       «      cddd«       S # 1 sw Y   yxY w)z'Check if all tasks have been completed.NTc              3  ó4   K  — | ]  }|j                   –— Œ y ­wrW   )r$  )rÄ  r–   s     rK   rÆ  z$Progress.finished.<locals>.<genexpr>Ž  s   è ø€ ÐFÑ1E¨�t—}•}Ñ1EùrÇ  )rµ  rÚ  Úallrâ  rZ   s    rK   r$  zProgress.finishedˆ  sC   € ð �Z‹ZØ—;’;Ø÷ ˆZô ÑF°·±×1CÑ1CÔ1EÓFÓF÷ �ZŠZús   �A¤)AÁA c                óV   — | j                   s| j                  j                  d¬«       yy)zStart the progress display.T)rN   N)r…   rQ   rY   rZ   s    rK   rY   zProgress.start�  s    € à�|Š|Ø�I‰I�O‰O DˆOÕ)ð rL   c                óâ   — | j                   sc| j                  j                  «        | j                  j                  s2| j                  j
                  s| j                  j                  «        yyyy)zStop the progress display.N)r…   rQ   rå   r�   Úis_interactiveÚ
is_jupyterrÜ  rZ   s    rK   rå   zProgress.stop•  sN   € à�|Š|Ø�I‰I�N‰NÔØ—<‘<×.Ò.°t·|±|×7NÒ7NØ—‘×"Ñ"Õ$ð 8OÐ.ð rL   c                ó&   — | j                  «        | S rW   rX   rZ   s    rK   r[   zProgress.__enter__œ  r\   rL   c                ó$   — | j                  «        y rW   )rå   r`   s       rK   rd   zProgress.__exit__   s   € ð 	�	‰	�rL   r   c              #  ó°  K  — |€t        t        |«      «      xs d}|€| j                  |||¬«      }n| j                  |||¬«       | j                  j
                  r8t        | ||«      5 }|D ]  }|–— |xj                  dz  c_        Œ 	 ddd«       y| j                  }	| j                  }
|D ]  }|–—  |	|d«        |
«        Œ y# 1 sw Y   yxY w­w)aC  Track progress by iterating over a sequence.

        You can also track progress of an iterable, which might require that you additionally specify ``total``.

        Args:
            sequence (Iterable[ProgressType]): Values you want to iterate over and track progress.
            total: (float, optional): Total number of steps. Default is len(sequence).
            completed (int, optional): Number of steps completed so far. Defaults to 0.
            task_id: (TaskID): Task to track. Default is new task.
            description: (str, optional): Description of task, if new task is created.
            update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1.

        Returns:
            Iterable[ProgressType]: An iterable of values taken from the provided sequence.
        Nr¹  r*   )
rf   r   Úadd_taskrS   rQ   r€   r?   rF   rO   rN   )rI   r�   r†   rF   rC   r‡   rD   Útrack_threadÚvaluerO   rN   s              rK   rŽ   zProgress.track¨  sÉ   è ø€ ð0 ˆ=Üœ+ hÓ/Ó0Ò8°DˆEàˆ?Ø—m‘m K°uÈ	�mÓR‰Gà�K‰K˜ u¸	ˆKÔBà�9‰9×!Ò!Ü˜d G¨]Ô;¸|Û%�EØ’KØ ×*Ò*¨aÑ/Ö*ñ &÷ <Ð;ð
 —l‘lˆGØ—l‘lˆGÛ!�Ø’Ù˜ Ô#Ù•	ñ "÷ <Ð;üs   ‚A)CÁ+!C
Â=CÃ
CÃCræ   )rC   r‡   c               ó  — d}|�|}n0|�.| j                   5  | j                  |   j                  }ddd«       |€t        d«      ‚|€| j	                  ||¬«      }n| j                  ||¬«       t        || |d¬«      S # 1 sw Y   ŒNxY w)aj  Track progress file reading from a binary file.

        Args:
            file (BinaryIO): A file-like object opened in binary mode.
            total (int, optional): Total number of bytes to read. This must be provided unless a task with a total is also given.
            task_id (TaskID): Task to track. Default is new task.
            description (str, optional): Description of task, if new task is created.

        Returns:
            BinaryIO: A readable file-like object in binary mode.

        Raises:
            ValueError: When no total value can be extracted from the arguments or the task.
        Nz?unable to get the total number of bytes, please specify 'total'©r†   F©r—   )rµ  rÚ  r†   Ú
ValueErrorrò  rS   r’   )rI   rê   r†   rC   r‡   Útotal_bytess         rK   ré   zProgress.wrap_fileÕ  s’   € ð. (,ˆØÐØ‰KØÐ Ø—“Ø"Ÿk™k¨'Ñ2×8Ñ8�÷ àÐÜØQóð ð
 ˆ?Ø—m‘m K°{�mÓC‰Gà�K‰K˜ {ˆKÔ3ä�t˜T 7¸Ô?Ð?÷ �ús   –A=Á=B)r†   rC   r‡   c                ó   — y rW   r�   ©
rI   rê   r®   rí   rî   rï   rð   r†   rC   r‡   s
             rK   rñ   zProgress.openÿ  ó   € ð 	rL   c                ó   — y rW   r�   rû  s
             rK   rñ   zProgress.open  rü  rL   c               óú  — dj                  t        |d¬«      «      }
|
dvrt        d|›�«      ‚|dk(  }|
dk(  r"|dk(  rt        j                  dt
        «       d	}n|
d
v r|dk(  rt        d«      ‚|dk(  rd	}|€t        |«      j                  }|€| j                  |	|¬«      }n| j                  ||¬«       t        j                  |d|¬«      }t        || |d¬«      }|dv rt        j                  |||||¬«      S |S )a#  Track progress while reading from a binary file.

        Args:
            path (Union[str, PathLike[str]]): The path to the file to read.
            mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt".
            buffering (int): The buffering strategy to use, see :func:`io.open`.
            encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`.
            errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`.
            newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`.
            total (int, optional): Total number of bytes to read. If none given, os.stat(path).st_size is used.
            task_id (TaskID): Task to track. Default is new task.
            description (str, optional): Description of task, if new task is created.

        Returns:
            BinaryIO: A readable file-like object in binary mode.

        Raises:
            ValueError: When an invalid mode is given.
        r  F)Úreverse)ÚbrÚrtÚrzinvalid mode r*   r   zaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be usedrÝ   )r  r  r   zcan't have unbuffered text I/Orö  Úrb)rí   Tr÷  )r  r  )rî   rï   rð   Úline_buffering)r_   Úsortedrø  ÚwarningsÚwarnÚRuntimeWarningr   Úst_sizerò  rS   Úiorñ   r’   ÚTextIOWrapper)rI   rê   r®   rí   rî   rï   rð   r†   rC   r‡   Ú_moder  r•   râ   s                 rK   rñ   zProgress.open  s#  € ðB —‘œ˜t¨UÔ3Ó4ˆØÐ)Ñ)Ü˜}¨T¨HÐ5Ó6Ð6ð # a™ˆØ�DŠ=˜Y¨!š^Ü�M‰MØsÜôð ‰IØ�kÑ!Ø˜AŠ~Ü Ð!AÓBÐBØ˜a’Ø�	ð ˆ=Ü˜“J×&Ñ&ˆEð ˆ?Ø—m‘m K°u�mÓ=‰Gà�K‰K˜ uˆKÔ-ô —‘˜˜t¨yÔ9ˆÜ˜  w¸TÔBˆð �;ÑÜ×#Ñ#ØØ!ØØØ-ôð ð ˆrL   c                ó¦   — | j                   5  | j                  |   }|j                  €| j                  «       |_        ddd«       y# 1 sw Y   yxY w)zéStart a task.

        Starts a task (used when calculating elapsed time). You may need to call this manually,
        if you called ``add_task`` with ``start=False``.

        Args:
            task_id (TaskID): ID of task.
        N)rµ  rÚ  r¯  rƒ   )rI   rC   r–   s      rK   Ú
start_taskzProgress.start_taskl  s:   € ð �Z‹ZØ—;‘;˜wÑ'ˆDØ�‰Ð&Ø"&§-¡-£/�”÷ �Z‰Zús   �1AÁAc                ó¸   — | j                   5  | j                  |   }| j                  «       }|j                  €||_        ||_        ddd«       y# 1 sw Y   yxY w)z†Stop a task.

        This will freeze the elapsed time on the task.

        Args:
            task_id (TaskID): ID of task.
        N)rµ  rÚ  rƒ   r¯  r°  )rI   rC   r–   r  s       rK   Ú	stop_taskzProgress.stop_taskz  sF   € ð �Z‹ZØ—;‘;˜wÑ'ˆDØŸ=™=›?ˆLØ�‰Ð&Ø".�”Ø)ˆDŒN÷ �Z‰Zús   �:AÁA)r†   rF   rO   r‡   r©  rN   c               ó<  — | j                   5  | j                  |   }	|	j                  }
|�&||	j                  k7  r||	_        |	j	                  «        |�|	xj                  |z  c_        |�||	_        |�||	_        |�||	_        |	j                  j                  |«       |	j                  |
z
  }| j                  «       }|| j                  z
  }|	j                  }|j                  }|r.|d   j                  |k  r |«        |r|d   j                  |k  rŒ|dkD  r|j                  t        ||«      «       |	j                  �6|	j                  |	j                  k\  r|	j                   €|	j"                  |	_        ddd«       |r| j%                  «        yy# 1 sw Y   ŒxY w)a˜  Update information associated with a task.

        Args:
            task_id (TaskID): Task id (returned by add_task).
            total (float, optional): Updates task.total if not None.
            completed (float, optional): Updates task.completed if not None.
            advance (float, optional): Add a value to task.completed if not None.
            description (str, optional): Change task description if not None.
            visible (bool, optional): Set visible flag if not None.
            refresh (bool): Force a refresh of progress information. Default is False.
            **fields (Any): Additional data fields required for rendering.
        Nr   )rµ  rÚ  rF   r†   rÐ  r‡   r©  r«  rS   rƒ   rÓ  r´  Úpopleftr  Úappendr¤  rO  rP  rN   )rI   rC   r†   rF   rO   r‡   r©  rN   r«  r–   Úcompleted_startÚupdate_completedr  Úold_sample_timer´  r  s                   rK   rS   zProgress.update‰  sq  € ð0 �Z‹ZØ—;‘;˜wÑ'ˆDØ"Ÿn™nˆOàÐ  U¨d¯j©jÒ%8Ø"�”
Ø—‘”ØÐ"Ø—’ 'Ñ)•ØÐ$Ø!*�”ØÐ&Ø#.�Ô ØÐ"Ø&�”Ø�K‰K×Ñ˜vÔ&Ø#Ÿ~™~°Ñ?ÐàŸ=™=›?ˆLØ*¨T×-GÑ-GÑGˆOØŸ™ˆIà×'Ñ'ˆGÙ 	¨!¡× 6Ñ 6¸Ò HÙ”	ñ  	¨!¡× 6Ñ 6¸Ó Hà !Ò#Ø× Ñ ¤°Ð>NÓ!OÔPà—
‘
Ð&Ø—N‘N d§j¡jÒ0Ø×&Ñ&Ð.à%)§\¡\�Ô"÷A ñD Ø�L‰L�Nð ÷E ˆZús   �DFÄA"FÆF)rY   r†   rF   r©  r‡   c               ó>  — | j                  «       }| j                  5  | j                  |   }	|	j                  «        |r|nd|	_        |�||	_        ||	_        |�||	_        |r||	_        |�||	_	        d|	_
        ddd«       | j                  «        y# 1 sw Y   ŒxY w)ax  Reset a task so completed is 0 and the clock is reset.

        Args:
            task_id (TaskID): ID of task.
            start (bool, optional): Start the task after reset. Defaults to True.
            total (float, optional): New total steps in task, or None to use current total. Defaults to None.
            completed (int, optional): Number of steps completed. Defaults to 0.
            visible (bool, optional): Set visible flag if not None.
            description (str, optional): Change task description if not None. Defaults to None.
            **fields (str): Additional data fields required for rendering.
        N)rƒ   rµ  rÚ  rÐ  r¯  r†   rF   r©  r«  r‡   rO  rN   )
rI   rC   rY   r†   rF   r©  r‡   r«  r  r–   s
             rK   ÚresetzProgress.resetÆ  s‘   € ð, —}‘}“ˆØ�Z‹ZØ—;‘;˜wÑ'ˆDØ�K‰KŒMÙ.3™l¸ˆDŒOØÐ Ø"�”
Ø&ˆDŒNØÐ"Ø&�”ÙØ$�”ØÐ&Ø#.�Ô Ø!%ˆDÔ÷ ð 	�‰�÷ ˆZús   �ABÂBc                ó¶  — | j                  «       }| j                  5  | j                  |   }|j                  }|xj                  |z  c_        |j                  |z
  }|| j                  z
  }|j
                  }|j                  }	|r.|d   j                  |k  r |	«        |r|d   j                  |k  rŒt        |«      dkD  r |	«        t        |«      dkD  rŒ|j                  t        ||«      «       |j                  �G|j                  |j                  k\  r.|j                  €"|j                  |_        |j                  |_        ddd«       y# 1 sw Y   yxY w)z«Advance task by a number of steps.

        Args:
            task_id (TaskID): ID of task.
            advance (float): Number of steps to advance. Default is 1.
        r   rW  N)rƒ   rµ  rÚ  rF   rÓ  r´  r  r  r£   r  r¤  r†   rO  rP  r  r_  )
rI   rC   rO   r  r–   r  r  r  r´  r  s
             rK   rO   zProgress.advanceí  s  € ð —}‘}“ˆØ�Z‹ZØ—;‘;˜wÑ'ˆDØ"Ÿn™nˆOØ�NŠN˜gÑ%�NØ#Ÿ~™~°Ñ?ÐØ*¨T×-GÑ-GÑGˆOØŸ™ˆIà×'Ñ'ˆGÙ 	¨!¡× 6Ñ 6¸Ò HÙ”	ñ  	¨!¡× 6Ñ 6¸Ó Hä�i“. 4Ò'Ù”	ô �i“. 4Ó'à×Ñœ^¨LÐ:JÓKÔLà—
‘
Ð&Ø—N‘N d§j¡jÒ0Ø×&Ñ&Ð.à%)§\¡\�Ô"Ø&*§j¡j�Ô#÷) �Z‰Zús   �BEÂ4#EÃA.EÅEc                ó€   — | j                   s2| j                  j                  r| j                  j                  «        yyy)z*Refresh (render) the progress information.N)r…   rQ   rR   rN   rZ   s    rK   rN   zProgress.refresh  s,   € à�|Š| §	¡	× 4Ò 4Ø�I‰I×ÑÕð !5ˆ|rL   c                ó2   — t        | j                  «       Ž }|S )z*Get a renderable for the progress display.)r.   Úget_renderables)rI   r  s     rK   rØ  zProgress.get_renderable  s   € ä˜D×0Ñ0Ó2Ð3ˆ
ØÐrL   c              #  óJ   K  — | j                  | j                  «      }|–— y­w)z5Get a number of renderables for the progress display.N)Úmake_tasks_tablerã  )rI   Útables     rK   r  zProgress.get_renderables  s   è ø€ à×%Ñ% d§j¡jÓ1ˆØ‹ùs   ‚!#c                óÚ   ‡— d„ | j                   D «       }t        j                  |d| j                  dœŽ}|D ]1  Š‰j                  sŒ |j
                  ˆfd„| j                   D «       Ž  Œ3 |S )z×Get a table to render the Progress display.

        Args:
            tasks (Iterable[Task]): An iterable of Task instances, one per row of the table.

        Returns:
            Table: A table instance.
        c              3  ó�   K  — | ]>  }t        |t        «      rt        d ¬«      n|j                  «       j	                  «       –— Œ@ y­w)Tr-  N)r  rÜ   r7   rÿ   Úcopy)rÄ  Ú_columns     rK   rÆ  z,Progress.make_tasks_table.<locals>.<genexpr>#  sG   è ø€ ð 
ñ (�ô ˜g¤sÔ+ô ˜tÕ$à×-Ñ-Ó/×4Ñ4Ó6ó7ñ (ùs   ‚AA)r   r*   )ÚpaddingrÖ  c              3  ór   •K  — | ].  }t        |t        «      r|j                  ‰¬ «      n |‰«      –— Œ0 y­w)r5  N)r  rÜ   r6  )rÄ  Úcolumnr–   s     €rK   rÆ  z,Progress.make_tasks_table.<locals>.<genexpr>0  s@   øè ø€ ð ñ '3˜Fô  *¨&´#Ô6ð #ŸM™M¨t˜MÔ4á!'¨£ó.ñ '3ùs   ƒ47)r�   r8   ÚgridrÖ  r©  Úadd_row)rI   rã  Útable_columnsr  r–   s       @rK   r  zProgress.make_tasks_table  si   ø€ ñ
ð  Ÿ<š<ó
ˆô —
‘
˜M°6À$Ç+Á+ÒNˆãˆDØ�|‹|Ø�—‘óð '+§l¢lóò	ð ð ˆrL   c                óf   — | j                   5  | j                  «       cddd«       S # 1 sw Y   yxY w)z+Makes the Progress class itself renderable.N)rµ  rØ  rZ   s    rK   Ú__rich__zProgress.__rich__;  s   € à�Z‹ZØ×&Ñ&Ó(÷ �ZŠZús   �'§0c                óš  — | j                   5  t        | j                  |||||| j                  | j                   ¬«      }|| j                  | j                  <   |r| j                  | j                  «       | j                  }t        t        | j                  «      dz   «      | _        ddd«       | j                  «        S # 1 sw Y   ŒxY w)a  Add a new 'task' to the Progress display.

        Args:
            description (str): A description of the task.
            start (bool, optional): Start the task immediately (to calculate elapsed time). If set to False,
                you will need to call `start` manually. Defaults to True.
            total (float, optional): Number of total steps in the progress if known.
                Set to None to render a pulsing animation. Defaults to 100.
            completed (int, optional): Number of steps completed so far. Defaults to 0.
            visible (bool, optional): Enable display of the task. Defaults to True.
            **fields (str): Additional data fields required for rendering.

        Returns:
            TaskID: An ID you can use when calling `update`.
        )r©  r«  r¨  rµ  r*   N)	rµ  r¦  rÛ  rƒ   rÚ  r  r;   rÛ   rN   )	rI   r‡   rY   r†   rF   r©  r«  r–   Únew_task_indexs	            rK   rò  zProgress.add_task@  s¬   € ð0 �Z‹ZÜØ× Ñ ØØØØØØŸ-™-Ø—j‘jô	ˆDð -1ˆD�K‰K˜×(Ñ(Ñ)ÙØ—‘ × 0Ñ 0Ô1Ø!×-Ñ-ˆNÜ%¤c¨$×*:Ñ*:Ó&;¸aÑ&?Ó@ˆDÔ÷ ð  	�‰ŒØÐ÷# ˆZús   �BCÃC
c                ó`   — | j                   5  | j                  |= ddd«       y# 1 sw Y   yxY w)z]Delete a task if it exists.

        Args:
            task_id (TaskID): A task ID.

        N)rµ  rÚ  )rI   rC   s     rK   Úremove_taskzProgress.remove_taskk  s!   € ð �Z‹ZØ—‘˜GÐ$÷ �Z‰Zús   �$¤-)r�   zUnion[str, ProgressColumn]r�   úOptional[Console]r€   rØ   r„   rf   rÓ  rf   r‚   rØ   rÔ  rØ   rÕ  rØ   rƒ   zOptional[GetTimeCallable]r…   rØ   rÖ  rØ   rh   ri   )rh   zTuple[ProgressColumn, ...])rh   r-   )rh   z
List[Task])rh   zList[TaskID]rÚ   rg   )rh   r)   rj   )Nr   Nú
Working...çš™™™™™¹?)r�   úIterable[ProgressType]r†   r÷   rF   rÛ   rC   úOptional[TaskID]r‡   rÜ   rD   rf   rh   r3  rW   )
rê   r   r†   rG  rC   r4  r‡   rÜ   rh   r   ©rÝ   NNN)rê   ú"Union[str, 'PathLike[str]', bytes]r®   úLiteral['rb']rí   rÛ   rî   úOptional[str]rï   r8  rð   r8  r†   rG  rC   r4  r‡   rÜ   rh   r   )rê   r6  r®   z"Union[Literal['r'], Literal['rt']]rí   rÛ   rî   r8  rï   r8  rð   r8  r†   rG  rC   r4  r‡   rÜ   rh   r$   ©r  rÝ   NNN)rê   r6  r®   ú1Union[Literal['rb'], Literal['rt'], Literal['r']]rí   rÛ   rî   r8  rï   r8  rð   r8  r†   rG  rC   r4  r‡   rÜ   rh   zUnion[BinaryIO, TextIO])rC   r;   rh   ri   )rC   r;   r†   r÷   rF   r÷   rO   r÷   r‡   r8  r©  úOptional[bool]rN   rØ   r«  r   rh   ri   )rC   r;   rY   rØ   r†   r÷   rF   rÛ   r©  r;  r‡   r8  r«  r   rh   ri   )r*   )rC   r;   rO   rf   rh   ri   )rh   r0   )rh   zIterable[RenderableType])rã  zIterable[Task]rh   r8   )Tr¿  r   T)r‡   rÜ   rY   rØ   r†   r÷   rF   rÛ   r©  rØ   r«  r   rh   r;   )!rk   rl   rm   rn   rH   r`  rÙ  rÞ   r�   rã  rç  r$  rY   rå   r[   rd   rŽ   ré   ÚtypingÚoverloadrñ   r  r  rS   r  rO   rN   rØ  r  r  r+  rò  r/  r�   rL   rK   r�   r�   %  s  „ ñð$ &*Ø!Ø$&Ø'+ØØ $Ø $Ø.2ØØñ"$à,ð"$ð #ð"$ð ð	"$ð
 "ð"$ð  %ð"$ð ð"$ð ð"$ð ð"$ð ,ð"$ð ð"$ð ð"$ð 
ó"$ðH ò
ó ð
ð< ò!ó ð!ð ò.ó ð.ð
 ò,ó ð,ð
 òGó ðGó*ó
%óðà/ðð )ðð (ð	ð
 
óð "&ØØ$(Ø'Ø"ð+à(ð+ð ð+ð ð	+ð
 "ð+ð ð+ð ð+ð 
 ó+ð`  $ð(@ð
 %)Ø'ñ(@àð(@ð ð(@ð
 "ð(@ð ð(@ð 
ó(@ðT ‡_�_ð
 Ø"&Ø $Ø!%ðð  $Ø$(Ø'ñà0ðð ðð ð	ð
  ðð ðð ðð ðð "ðð ðð 
òó ðð ‡_�_ð
 Ø"&Ø $Ø!%ðð  $Ø$(Ø'ñà0ðð 1ðð ð	ð
  ðð ðð ðð ðð "ðð ðð 
òó ðð$ CFØØ"&Ø $Ø!%ðKð  $Ø$(Ø'ñKà0ðKð @ðKð ð	Kð
  ðKð ðKð ðKð ðKð "ðKð ðKð 
!óKóZ2ó*ð& "&Ø%)Ø#'Ø%)Ø"&Øñ;àð;ð ð	;ð
 #ð;ð !ð;ð #ð;ð  ð;ð ð;ð ð;ð 
ó;ðB Ø!%ØØ"&Ø%)ñ%àð%ð ð	%ð
 ð%ð ð%ð  ð%ð #ð%ð ð%ð 
ó%ôN1ó< ó
ó
ó
óB)ð Ø!&ØØð)àð)ð ð)ð ð	)ð
 ð)ð ð)ð ð)ð 
ó)ôV%rL   r�   Ú__main__)ÚPanel)ÚRule)ÚSyntax)r8   a~  def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
    """Iterate and generate a tuple with a flag for last value."""
    iter_values = iter(values)
    try:
        previous_value = next(iter_values)
    except StopIteration:
        return
    for value in iter_values:
        yield False, previous_value
        previous_value = value
    yield True, previous_valueÚpython)Úline_numbersÚfooÚbarÚbazÚ1Ú2Ú3z:Text may be printed while the progress bars are rendering.z(In fact, [i]any[/i] renderable will workzSuch as [magenta]tables[/]...zPretty printed structures...ÚexamplezPretty printed)Útyper%  z	Syntax...zGive it a try!)Úcycle)Úrecord)r�   r‚   z[red]DownloadingrW  rö  z[green]Processingz[yellow]Thinkingrb  r¡   g333333Ó?g{®Gáz„?éd   )r1  Nr   TNFNrq   rr   rs   rt   ru   r2  FT)"r�   r3  r‡   rÜ   r†   r÷   rF   rÛ   r€   rØ   r�   r0  r‚   rØ   rƒ   úOptional[Callable[[], float]]r„   rf   ry   r6   rz   r6   r{   r6   r|   r6   rD   rf   r…   rØ   r}   rØ   rh   r3  )rê   r   r†   rÛ   r‡   rÜ   r€   rØ   r�   r0  r‚   rØ   rƒ   rO  r„   rf   ry   r6   rz   r6   r{   r6   r|   r6   r…   rØ   rh   úContextManager[BinaryIO]r5  )&rê   r6  r®   z"Union[Literal['rt'], Literal['r']]rí   rÛ   rî   r8  rï   r8  rð   r8  r†   rG  r‡   rÜ   r€   rØ   r�   r0  r‚   rØ   rƒ   rO  r„   rf   ry   r6   rz   r6   r{   r6   r|   r6   r…   rØ   rh   zContextManager[TextIO])&rê   r6  r®   r7  rí   rÛ   rî   r8  rï   r8  rð   r8  r†   rG  r‡   rÜ   r€   rØ   r�   r0  r‚   rØ   rƒ   rO  r„   rf   ry   r6   rz   r6   r{   r6   r|   r6   r…   rØ   rh   rP  r9  )&rê   r6  r®   r:  rí   rÛ   rî   r8  rï   r8  rð   r8  r†   rG  r‡   rÜ   r€   rØ   r�   r0  r‚   rØ   rƒ   rO  r„   rf   ry   r6   rz   r6   r{   r6   r|   r6   r…   rØ   rh   z7Union[ContextManager[BinaryIO], ContextManager[TextIO]])…Ú
__future__r   r
  r<  r  Úabcr   r   Úcollectionsr   Údataclassesr   r	   Údatetimer
   r   r   Úmathr   r   Úoperatorr   Úosr   r   Ú	threadingr   r   r   Útypesr   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   Útyping_extensionsr)   r  r+   r,   r�   r-   r.   r/   r0   r2  r1   Újupyterr2   rQ   r3   Úprogress_barr4   r  r5   ry   r6   r  r7   r8   r%  r9   r:   rÛ   r;   r<   rf   r§  r=   r?   rŽ   r’   rà   ré   r=  rñ   rö   r  r  rˆ   rŠ   rI  r‹   rŒ   rq  rx  r{  rè   r¡  r¤  r¦  r�   rk   ÚrandomÚtimeÚpanelr?  Úruler@  ÚsyntaxrA  r(  Úprogress_renderablesÚ	itertoolsrL  ÚexamplesrÙ  rB   rò  Útask1Útask2Útask3r$  rS   ÚsleepÚrandintrÝ  r¢   r�   rL   rK   Ú<module>rk     s8  ðÝ "ã 	Û Û ß #Ý ß (Ý ß .Ý Ý Ý  ß ß *Ñ *Ý ÷÷ ÷ ÷ ÷ ñ ñ, å&ç #ß BÓ BÝ $Ý !Ý Ý %Ý Ý ß  ß  á	�˜3Ó	€á�~Ó&€à˜2˜u˜9Ñ%€ð €V‡^�^�D˜& (Ó+€ô%�6ô %ðT $Ø!ØØØ!%ØØ.2Ø "Ø!Ø .Ø .Ø(ØØØð!K
Ø$ðK
àðK
ð ðK
ð ð	K
ð
 ðK
ð ðK
ð ðK
ð ,ðK
ð ðK
ð ðK
ð ðK
ð ðK
ð ðK
ð ðK
ð ðK
ð  ð!K
ð" ó#K
ô\d1ˆi˜ô d1ôN8�> "Ñ% w¨r¡{ô 8ð2 $ØØ!%ØØ.2Ø "Ø!Ø .Ø .Ø(Øñ>*Ø
ð>*àð>*ð ð	>*ð
 ð>*ð ð>*ð ð>*ð ,ð>*ð ð>*ð ð>*ð ð>*ð ð>*ð ð>*ð ð>*ð ó>*ðB ‡�ð Ø"Ø Ø!ð	ð  Ø#ØØ!%ØØ.2Ø "Ø!Ø .Ø .Ø(Øñ'	Ø
,ð	à
,ð	ð ð	ð ð		ð
 ð	ð ð	ð ð	ð ð	ð ð	ð ð	ð ð	ð ,ð	ð ð	ð ð	ð  ð!	ð" ð#	ð$ ð%	ð& ð'	ð( ò)	ó ð	ð0 ‡�ð Ø"Ø Ø!ð	ð  Ø#ØØ!%ØØ.2Ø "Ø!Ø .Ø .Ø(Øñ'	Ø
,ð	à
ð	ð ð	ð ð		ð
 ð	ð ð	ð ð	ð ð	ð ð	ð ð	ð ð	ð ,ð	ð ð	ð ð	ð  ð!	ð" ð#	ð$ ð%	ð& ð'	ð( ò)	ó ð	ð4 ?BØØ"Ø Ø!ðS*ð  Ø#ØØ!%ØØ.2Ø "Ø!Ø .Ø .Ø(Øñ'S*Ø
,ðS*à
;ðS*ð ðS*ð ð	S*ð
 ðS*ð ðS*ð ðS*ð ðS*ð ðS*ð ðS*ð ðS*ð ,ðS*ð ðS*ð ðS*ð  ð!S*ð" ð#S*ð$ ð%S*ð& ð'S*ð( =ó)S*ôl'1�Sô '1ôT�~ô ô"/�Nô /ôd�ô ô<'
�ô '
ôT	:˜ô 	:ôE˜ô EôP-,˜.ô -,ô`:�^ô :ô@˜.ô @ô
˜ô 
ô6.�^ô .ôb	D˜.ô 	Dô%�Zô %ð ÷z#ð z#ó ðz#ôzN	%ˆ|ô N	%ðb ˆzÓÛÛåÝÝÝáð
	"ð 	Øô€Fñ  �%˜ Ó&€EØ	‡M�M�#�s˜CÔ ð 	EÙÐ8Ó9Ø'ØØ&ØÐ$4Ñ5ØØÙÐÓð
Ðõ  áÐ)Ó*€Há˜TÔ"€Gá	Ù‹ð
à	×	%Ñ	%Ó	'ð
ñ 	Óñ
ð Øó
ð 
Ø×!Ñ!Ð"4¸DÐ!ÓAˆØ×!Ñ!Ð"5¸TÐ!ÓBˆØ×!Ñ!Ð"4¸DÐ!ÓAˆà×#Ò#Ø�OŠO˜E¨3ˆOÔ/Ø�OŠO˜E¨3ˆOÔ/ØˆD�JŠJ�tÔØˆv�~Š~˜a Ó%¨Ò)Ø—’™T (›^Ô,ð ×#Ó#÷
ð 
ð] ÷\
ð 
ús   Î>B<RÒR