+
    <j7                       a  R< tR0 t ^ RIt^ RIHtHtHt ^ RIHt ^ RIH	t	H
t
HtHtHtHtHtHt ^RIHt ^RIHtHtHtHt ^RIHt ^RIHt ^R	IHt ^R
IHtH t  ^RI!H"t" ^RI#H$t$  ! R R]4      t% ! R R]]4      t&]'R8X  EdH   ^ RI(t(^ RI)t)^ RI*H+t+ ^ RIH,t,HtH-t- ^RI.H/t/ ^RIHt ^RI0H&t& ^RI1H2t2 ^RI3H4t4 ^RI5H6t6 ^RI7H8t8 ]! 4       t]6! RRRR7      t5]8! RR R!4      t7]7Ps                  R"R#R$4       R%]2! R&4      R']7R(R)R*R+R,/R-]5]4! R.4      .	t:]+! ]:4      t;. R=Ot<]&! ]R/7      ;_uu_ 4       t=/ t>] ^ k ]?! ^d4       EF  t@]<]@]A! ]<4      ,          ,          tB]< EF_  tC]C]B8X  d   K  ])P                  ! R04       ](P                  ! ^ ^
4      ^8  d   ]P                  ]G! ];4      4       ^](PP                  ! 4       R1,          ^,           ,          ]>]B]C3&   ]A! ]>4      ]A! ]<4      ^,
          8  d-   ]>P                  ]I! ]>P                  4       4      ^ ,          4       ]8! R2R37      t7]7P                  R44       ]7P                  R54       ]7P                  R64       ]>P                  4        F/  w  w  tMtNtO]7Ps                  ]M]N]$! ]OR7 ]OR88  d   R9MR:R;7      4       K1  	  ]=P                  ]/P                  ! ]74      4       EKb  	  EK  	  RRR4       R# R#   + '       g   i     R# ; i)>    N)EventRLockThread)TracebackType)IOAnyCallableListOptionalTextIOTypecast)get_console)ConsoleConsoleRenderableRenderableType
RenderHook)Control)	FileProxy)JupyterMixin)
LiveRenderVerticalOverflowMethod)Screen)Textc                   f   a a ] tR t^t oRtV3R lV 3R lltV3R lR ltV3R lR ltRtVt	V ;t
# )	_RefreshThreadz3A thread that calls refresh() at regular intervals.c                (   < V ^8  d   QhRRRS[ RR/# )   liveLiverefresh_per_secondreturnN)float)format__classdict__s   "J/opt/headortail/venv/lib/python3.14/site-packages/pip/_vendor/rich/live.py__annotate___RefreshThread.__annotate__   s"     & &V & &4 &    c                ^   < Wn         W n        \        4       V n        \        SV `  R R7       R# )T)daemonN)r   r!   r   donesuper__init__)selfr   r!   	__class__s   &&&r&   r.   _RefreshThread.__init__   s'    	"4G	%r)   c                   < V ^8  d   QhRR/# r   r"   N )r$   r%   s   "r&   r'   r(      s      d r)   c                :    V P                   P                  4        R # N)r,   setr/   s   &r&   stop_RefreshThread.stop   s    		r)   c                   < V ^8  d   QhRR/# r3   r4   )r$   r%   s   "r&   r'   r(      s     ( (T (r)   c                X   V P                   P                  ^V P                  ,          4      '       gd   V P                  P                  ;_uu_ 4        V P                   P                  4       '       g   V P                  P                  4        RRR4       K  R#   + '       g   i     K  ; i)   N)r,   waitr!   r   _lockis_setrefreshr8   s   &r&   run_RefreshThread.run   sd    ))..T%<%<!<==yy''))II%%' ! > s   ;BB)	)r,   r   r!   )__name__
__module____qualname____firstlineno____doc__r.   r9   rB   __static_attributes____classdictcell____classcell__)r0   r%   s   @@r&   r   r      s+     =& & ( ( (r)   r   c                   Z  a  ] tR t^#t o RtR+RRRRRRR^R	RR
RRRRRRR/	V 3R lR lllt]V 3R lR l4       tV 3R lR ltR,V 3R lR llt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR  lt]V 3R! lR" l4       tR#R/V 3R$ lR% lltV 3R& lR' ltV 3R( lR) ltR*tV tR# )-r    a  Renders an auto-updating live display of any given renderable.

Args:
    renderable (RenderableType, optional): The renderable to live display. Defaults to displaying nothing.
    console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout.
    screen (bool, optional): Enable alternate screen mode. Defaults to False.
    auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()` or `update()` with refresh flag. Defaults to True
    refresh_per_second (float, optional): Number of times per second to refresh the live display. Defaults to 4.
    transient (bool, optional): Clear the renderable on exit (has no effect when screen=True). 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.
    vertical_overflow (VerticalOverflowMethod, optional): How to handle renderable when it is too tall for the console. Defaults to "ellipsis".
    get_renderable (Callable[[], RenderableType], optional): Optional callable to get renderable. Defaults to None.
NconsolescreenFauto_refreshTr!   	transientredirect_stdoutredirect_stderrvertical_overflowellipsisget_renderablec                   < V ^8  d   QhRS[ S[,          RS[ S[,          RS[RS[RS[RS[RS[RS[R	S[R
S[ S[. S[3,          ,          RR/# )r   
renderablerM   rN   rO   r!   rP   rQ   rR   rS   rU   r"   N)r   r   r   boolr#   r   r	   )r$   r%   s   "r&   r'   Live.__annotate__3   s     &
 &
^,&
 '"	&

 &
 &
 "&
 &
 &
 &
 2&
 !"n*<!=>&
 
&
r)   c       	           V^ 8  g   Q R4       hWn         Ve   TM	\        4       V n        W0n        RV n        Wpn        Wn        RV n        RV n        \        4       V n
        RV n        W@n        RV n        V'       d   RMTV n        RV n        WPn        Wn        Wn        \'        V P)                  4       V	R7      V n        R# )r   zrefresh_per_second must be > 0NFT)rS   )_renderabler   rM   _screen_alt_screen_redirect_stdout_redirect_stderr_restore_stdout_restore_stderrr   r?   
ipy_widgetrO   _startedrP   _refresh_threadr!   rS   _get_renderabler   rU   _live_render)r/   rW   rM   rN   rO   r!   rP   rQ   rR   rS   rU   s   &&$$$$$$$$$r&   r.   Live.__init__3   s     "A%G'GG%%")"5w;=  / /2626W
)-(#!'Y9="4!2-&!5F
r)   c                    < V ^8  d   QhRS[ /# r   r"   rX   )r$   r%   s   "r&   r'   rY   \   s      D r)   c                    V P                   # )z'Check if live display has been started.)rc   r8   s   &r&   
is_startedLive.is_started[   s     }}r)   c                    < V ^8  d   QhRS[ /# ri   r   )r$   r%   s   "r&   r'   rY   `   s          r)   c                n    V P                   e   V P                  4       MV P                  pT;'       g    R# )N )re   r[   r/   rW   s   & r&   rU   Live.get_renderable`   s<     ##/   "!! 	
 Rr)   c                $   < V ^8  d   QhRS[ RR/# )r   rA   r"   Nrj   )r$   r%   s   "r&   r'   rY   h   s     - -T -d -r)   c                   V P                   ;_uu_ 4        V P                  '       d    RRR4       R# V P                  P                  V 4       RV n        V P                  '       d!   V P                  P                  R4      V n        V P                  P                  R4       V P                  4        V P                  P                  V 4       V'       d    V P                  4        V P                  '       d5   \        W P                  4      V n        V P                   P#                  4        RRR4       R#   \         d    T P                  4        h i ; i  + '       g   i     R# ; i)zdStart live rendering display.

Args:
    refresh (bool, optional): Also refresh. Defaults to False.
NTF)r?   rc   rM   set_liver\   set_alt_screenr]   show_cursor_enable_redirect_iopush_render_hookrA   	Exceptionr9   rO   r   r!   rd   start)r/   rA   s   &&r&   r|   
Live.starth   s     ZZZ}}} Z LL!!$' DM|||#'<<#>#>t#D LL$$U+$$&LL))$/LLN    '5d<S<S'T$$$**,- Z ! 
 IIK ZZs5   E3E'A-ED6&E84E6EEE'	c                   < V ^8  d   QhRR/# r3   r4   )r$   r%   s   "r&   r'   rY      s     0 0d 0r)   c           
        V P                   ;_uu_ 4        V P                  '       g    RRR4       R# V P                  P                  4        RV n        V P                  '       d0   V P
                  e"   V P
                  P                  4        RV n        RV n        V P                  ;_uu_ 4         V P                  '       g-   V P                  P                  '       g   V P                  4        V P                  4        V P                  P                  4        V P                  '       g7   V P                  P                  '       d   V P                  P                  4        V P                  P                  R4       V P                  '       d   V P                  P!                  R4       V P"                  '       dF   V P                  '       g4   V P                  P%                  V P&                  P)                  4       4       V P*                  e-   V P"                  '       d   V P*                  P-                  4        RRR4       RRR4       R#   T P                  4        T P                  P                  4        T P                  '       g7   T P                  P                  '       d   T P                  P                  4        T P                  P                  R4       T P                  '       d   T P                  P!                  R4       T P"                  '       dF   T P                  '       g4   T P                  P%                  T P&                  P)                  4       4       T P*                  e/   T P"                  '       d   T P*                  P-                  4        i i i ; i  + '       g   i     ELm; i  + '       g   i     R# ; i)zStop live rendering display.NFvisibleT)r?   rc   rM   
clear_liverO   rd   r9   rS   r]   
is_jupyterrA   _disable_redirect_iopop_render_hookis_terminallinerx   rw   rP   controlrf   restore_cursorrb   closer8   s   &r&   r9   	Live.stop   sk   ZZZ=== Z LL##%!DM   T%9%9%E$$))+'+$%.D"0+++DLL4K4K4K--/LL002+++0H0H0H))+LL,,T2'''33E:~~~d.>.>.>,,T->->-M-M-OP2t~~~--/!  Z  --/LL002+++0H0H0H))+LL,,T2'''33E:~~~d.>.>.>,,T->->-M-M-OP2t~~~--/ 8F2  ZZs   N32N3&A
N30N	2-I I0AN	AN	,N	<N	AN	!N	;N3AN&AN-,NN,AN?NN	N0*	N33O	c                   < V ^8  d   QhRR/# )r   r"   r    r4   )r$   r%   s   "r&   r'   rY      s      6 r)   c                B    V P                  V P                  R JR7       V # )N)rA   )r|   r[   r8   s   &r&   	__enter__Live.__enter__   s     

4++47
8r)   c                p   < V ^8  d   QhRS[ S[S[,          ,          RS[ S[,          RS[ S[,          RR/# )r   exc_typeexc_valexc_tbr"   N)r   r   BaseExceptionr   )r$   r%   s   "r&   r'   rY      sG      4./ -( '	
 
r)   c                &    V P                  4        R # r6   )r9   )r/   r   r   r   s   &&&&r&   __exit__Live.__exit__   s     			r)   c                   < V ^8  d   QhRR/# r3   r4   )r$   r%   s   "r&   r'   rY      s     Q QT Qr)   c                   V P                   P                  '       g   V P                   P                  '       Ed   V P                  '       dq   \	        \
        P                  \        4      '       gM   \
        P                  V n        \        R\        V P                   \
        P                  4      4      \
        n        V P                  '       du   \	        \
        P                  \        4      '       gO   \
        P                  V n        \        R\        V P                   \
        P                  4      4      \
        n        R# R# R# R# )z&Enable redirecting of stdout / stderr.r   N)rM   r   r   r^   
isinstancesysstdoutr   r`   r   r_   stderrra   r8   s   &r&   ry   Live._enable_redirect_io   s    <<###t||'>'>'>$$$Z

I-N-N'*zz$!(IdllCJJ,OP
$$$Z

I-N-N'*zz$!(IdllCJJ,OP
 .O$	 (?r)   c                   < V ^8  d   QhRR/# r3   r4   )r$   r%   s   "r&   r'   rY      s     ( (d (r)   c                    V P                   '       d'   \        RV P                   4      \        n        RV n         V P                  '       d)   \        RV P                  4      \        n        RV n        R# R# )z'Disable redirecting of stdout / stderr.r   N)r`   r   r   r   ra   r   r8   s   &r&   r   Live._disable_redirect_io   sW    h(<(<=CJ#'D h(<(<=CJ#'D   r)   c                    < V ^8  d   QhRS[ /# ri   ro   )r$   r%   s   "r&   r'   rY      s     F FN Fr)   c                `    V P                  4       pV P                  '       d   \        V4      # T# )z_Get the renderable that is being displayed

Returns:
    RenderableType: Displayed renderable.
)rU   r]   r   rr   s   & r&   rW   Live.renderable   s-     ((*
%)%5%5%5vj!E:Er)   rA   c                *   < V ^8  d   QhRS[ RS[RR/# )r   rW   rA   r"   N)r   rX   )r$   r%   s   "r&   r'   rY      s"       T d r)   c                  \        V\        4      '       d   V P                  P                  V4      pV P                  ;_uu_ 4        Wn        V'       d   V P                  4        RRR4       R#   + '       g   i     R# ; i)zUpdate the renderable that is being displayed

Args:
    renderable (RenderableType): New renderable to use.
    refresh (bool, optional): Refresh the display. Defaults to False.
N)r   strrM   
render_strr?   r[   rA   )r/   rW   rA   s   &&$r&   updateLive.update   sL     j#&&00<JZZZ) ZZZs   A//B 	c                   < V ^8  d   QhRR/# r3   r4   )r$   r%   s   "r&   r'   rY      s     2 2 2r)   c           	        V P                   ;_uu_ 4        V P                  P                  V P                  4       V P                  P
                  '       d    ^ RIHp ^ RIH	p V P                  f   V! 4       V n
        V! V P                  4       V P                  ;_uu_ 4        V P                  P                  RR7       V P                  P                  V P                  P                  4       RRR4       MV P                  P                   '       d^   V P                  P"                  '       gB   V P                  ;_uu_ 4        V P                  P                  \%        4       4       RRR4       MdV P&                  '       gS   V P(                  '       gA   V P                  ;_uu_ 4        V P                  P                  \%        4       4       RRR4       RRR4       R#   + '       g   i     L; i  \         d    ^ RIpTP                  R4        L?i ; i  + '       g   i     LS; i  + '       g   i     Lf; i  + '       g   i     R# ; i)z&Update the display of the Live Render.)display)OutputNT)r>   z(install "ipywidgets" for Jupyter support)r?   rf   set_renderablerW   rM   r   IPython.displayr   
ipywidgetsr   rb   clear_outputprintImportErrorwarningswarnr   is_dumb_terminalr   rc   rP   )r/   r   r   r   s   &   r&   rA   Live.refresh   sh   ZZZ,,T__=||&&&I71 .*0(044$4?**4+<+<+G+GH ) )))$,,2O2O2O\\\LL&&wy1 "\ MMM$...\\\LL&&wy1 "1 Z ) # N#MM"LMN "\
 "\1 ZZs   AH?G3$A H?$AG 	0$H?H?1H?$H	)H?H?H?*$H,	H? G0+H?3 HH?HH?H)$H?,H<7H??I	c                F   < V ^8  d   QhRS[ S[,          RS[ S[,          /# )r   renderablesr"   )r
   r   )r$   r%   s   "r&   r'   rY      s)       12		 r)   c                   V P                   V P                  n         V P                  P                  '       dr   V P                  ;_uu_ 4        V P
                  '       d   \        P                  ! 4       MV P                  P                  4       pV.VOV P                  NpRRR4       V# V P                  '       g#   V P                  '       g   . VOV P                  NpV#   + '       g   i     T# ; i)z;Process renderables to restore cursor and display progress.N)rS   rf   rM   is_interactiver?   r]   r   homeposition_cursorrc   rP   )r/   r   resets   && r&   process_renderablesLive.process_renderables   s     /3.D.D+<<&&& ''' LLN**::< 
  %F{FD4E4EF  	 dnnn;K;):):;K  s   ACC0	)r]   re   rf   r?   r_   r^   rd   r[   ra   r`   r\   rc   rO   rM   rb   r!   rP   rS   r6   )F)rD   rE   rF   rG   rH   r.   propertyrl   rU   r|   r9   r   r   ry   r   rW   r   rA   r   rI   rJ   )r%   s   @r&   r    r    #   s    &
 &*	&

 &
 "&
 %&&
  &
 !%&
 !%&
 5?&
 BF&
 &
P     - -<0 0>  Q Q( ( F FE  2 2: r)   r    __main__)cycle)Dictr
   Tuple)Align)r   )r    )Panel)Rule)Syntax)Tablea~  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pythonT)line_numbersfoobarbaz123zYou can make the terminal shorter and taller to see the live table hideText 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...typeexampletextzPretty printedz	Syntax...zGive it a try!)rM   g?i@  zExchange Rates)titlezSource CurrencyzDestination CurrencyzExchange Ratez.4fg      ?redgreen)stylec                    V ^8  d   Qh/ ^ \         9   d,   \        \        \        \        3,          \        3,          ;R&   # )r   exchange_rate_dict)__conditional_annotations__r   r   r   r#   )r$   s   "r&   r'   r'      s,    

l
 	>=DsCx%!78=m
 r)   )SGDMYREURUSDAUDJPYCNHHKDCADINRDKKGBPRUBNZDMXNIDRTWDTHBVND)Sr   r   	threadingr   r   r   typesr   typingr   r   r	   r
   r   r   r   r   rq   r   rM   r   r   r   r   r   r   
file_proxyr   jupyterr   live_renderr   r   rN   r   r   r   r   r    rD   randomtime	itertoolsr   r   r   alignr   r   panelr   ruler   syntaxr   tabler   add_rowprogress_renderablesexamples	exchanges
live_tabler   rangeindexlenselect_exchangeexchangesleeprandintlognextpoplistkeys
add_columnitemssourcedestexchange_rater   centerr'   )r   s   @r&   <module>r     s   

 * *  H H H  K K  ! ! ;  (V (&i< iX z(( "iG
	" 	F  %&E	MM#sC 	E89'&	F$45 )*HI* 
g		*;==3ZE'I(>?O%.

3>>!R(1,KKX/BE]]_s*a/C"OX#>? )*S^a-??&**40B0G0G0I+J1+MN$45  !23  !78  15G5M5M5O1NVTMMM,S1+83+>%G 6P !!%,,u"567 &   
	O N 
		s   /FKK 	