+
    Ri[              	      ^   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHtH	t	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
IHt R.t/ R^'bR^bR^bR^ bR^!bR^"bR^#bR^$bR^%bR^ZbR^[bR^\bR^]bR^^bR^_bR^`bR^abt/ R^1bR^(bR^)bR^*bR^+bR^,bR^-bR^.bR^/bR^dbR^ebR^fbR^gbR^hbR^ibR^jbR^kbt/ RR+bRR+bRR,bRR-bRR.bRR/bRR0bRR1bRR2bRR3bRR4bRR5bRR6bRR7bRR8bRR9bRR:bt] ! ]4      ] ! ]4      8X  g   Q h] ! ]4      ] ! ]4      8X  g   Q h] ! ]4      ] ! ]4      8X  g   Q hR;R R llt!]]"]#3,          t$ ! R R 4      t% ! R! R"]]]"]"]"3,          ]"3,          4      t&]%! R#R$7      t']%! R%R$7      t(]&! 4       t) ! R& R']]]#3,          4      t*R( R) lt+ ! R* R]4      t,R# )<z
Output for vt100 terminals.

A lot of thanks, regarding outputting of colors, goes to the Pygments project:
(We don't rely on Pygments anymore, because many things are very custom, and
everything has been highly optimized.)
http://pygments.org/
)annotationsN)CallableDictHashableIterableSequenceTextIOTuple)CursorShape)Size)Output)ANSI_COLOR_NAMESAttrs)is_dumb_terminal)
ColorDepth)flush_stdoutVt100_Outputansidefault	ansiblackansired	ansigreen
ansiyellowansiblueansimagentaansicyanansigrayansibrightblackansibrightredansibrightgreenansibrightyellowansibrightblueansibrightmagentaansibrightcyan	ansiwhitec          
     ,    V ^8  d   QhRRRRRRRRRR/# )	   rintgbexcludeSequence[str]returnstr )formats   "Z/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/prompt_toolkit/output/vt100.py__annotate__r1   l   s0      s s s ] TW     c                   \        V4      p\        W,
          4      \        W,
          4      ,           \        W ,
          4      ,           pV^8  d   VP                  . RO4       RpRp\        P	                  4        F]  w  pw  rp
VR8w  g   K  Ws9  g   K  W,
          ^,          W,
          ^,          ,           W*,
          ^,          ,           pW8  g   KY  TpTpK_  	  V# )z
Find closest ANSI color. Return it by name.

:param r: Red (Between 0 and 255.)
:param g: Green (Between 0 and 255.)
:param b: Blue (Between 0 and 255.)
:param exclude: A tuple of color names to exclude. (E.g. ``('ansired', )``.)
r   )ansilightgrayansidarkgrayr#   r    )listabsextendANSI_COLORS_TO_RGBitems)r&   r(   r)   r*   
saturationdistancematchnamer2g2b2ds   &&&&        r0   _get_closest_ansi_colorrD   l   s     7mG QUc!%j(3qu:5JBRS HE0668lrr= T%8AA-A=A| 9 Lr2   c                  J    ] tR t^tRtR
R R lltRR R lltRR R lltRtR	# )_16ColorCachezv
Cache which maps (r, g, b) tuples to 16 ansi colors.

:param bg: Cache for background colors, instead of foreground.
c                    V ^8  d   QhRRRR/# )r%   bgboolr,   Noner.   )r/   s   "r0   r1   _16ColorCache.__annotate__   s     < <4 <D <r2   c                	     Wn         / V n        R # N)rH   _cache)selfrH   s   &&r0   __init___16ColorCache.__init__   s    9;r2   c               $    V ^8  d   QhRRRRRR/# r%   valuetuple[int, int, int]r*   r+   r,   _ColorCodeAndNamer.   )r/   s   "r0   r1   rK      s$      )4A	r2   c                v    V\        V4      3pV P                  pW49  d   V P                  W4      WC&   WC,          # )z`
Return a (ansi_code, ansi_name) tuple. (E.g. ``(44, 'ansiblue')``.) for
a given (r,g,b) value.
)tuplerN   _get)rO   rT   r*   keycaches   &&&  r0   get_code_16ColorCache.get_code   s9     g/52EJzr2   c               $    V ^8  d   QhRRRRRR/# rS   r.   )r/   s   "r0   r1   rK      s$      )4A	r2   c                	    Vw  r4p\        W4WRR 7      pV P                  '       d   \        V,          pWv3# \        V,          pWv3# )r*   )rD   rH   BG_ANSI_COLORSFG_ANSI_COLORS)rO   rT   r*   r&   r(   r)   r>   codes   &&&     r0   rY   _16ColorCache._get   sL     a'aA 777!%(D { "%(D{r2   )rN   rH   N)Fr.   )	__name__
__module____qualname____firstlineno____doc__rP   r\   rY   __static_attributes__r.   r2   r0   rF   rF      s    < r2   rF   c                  2    ] tR t^tRtR R ltR R ltRtR# )_256ColorCachez2
Cache which maps (r, g, b) tuples to 256 colors.
c                   V ^8  d   QhRR/# r%   r,   rJ   r.   )r/   s   "r0   r1   _256ColorCache.__annotate__   s     $ $$ $r2   c                	f   . pVP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R	4       VP                  R
4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       Rp\        ^4       FQ  pW#^$,          ^,          ,          pW#^,          ^,          ,          pW#^,          ,          pVP                  WEV34       KS  	  \        ^^4       F&  p^V^
,          ,           pVP                  WwV34       K(  	  Wn        R# )    Nrr   rr   rr      rr   rr   rr   ru   rr   ru   ru   rr   )rr   rr      ru   rr   ru   rr   ru   ru      r|   r|      r~   r~      rr   rr   rr   r   rr   r   r   rr   )\   r   r   r   rr   r   rr   r   r   r   r   r   )rr   _            r   )appendrangecolors)rO   r   
valuerangeir&   r(   r)   vs   &       r0   rP   _256ColorCache.__init__   s`   -/ 	()()()()()()()()()()()()()()()() :
sAGq=)AFa<(Aq5!AMM1)$	  q"AAF
AMM1)$  r2   c                    V ^8  d   QhRRRR/# )r%   rT   rU   r,   r'   r.   )r/   s   "r0   r1   rp      s      !5 # r2   c                	    Vw  r#pRp^ p\        V P                  4       FU  w  pw  rp
V^8  g   K  W(,
          ^,          W9,
          ^,          ,           WJ,
          ^,          ,           pW8  g   KQ  TpTpKW  	  W`V&   V# )  r6   )	enumerater   )rO   rT   r&   r(   r)   r=   r>   r   r@   rA   rB   rC   s   &&          r0   __missing___256ColorCache.__missing__   sy    a !(5OA|Bw VMQVM1QVMA<E H  6 Ur2   )r   N)rf   rg   rh   ri   rj   rP   r   rk   r.   r2   r0   rm   rm      s    $L r2   rm   F)rH   Tc                  J    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltRt	R# )_EscapeCodeCacher   z
Cache for VT100 escape codes. It maps
(fgcolor, bgcolor, bold, underline, strike, italic, blink, reverse, hidden, dim) tuples to VT100
escape sequences.

:param true_color: When True, use 24bit colors instead of 256 colors.
c                    V ^8  d   QhRRRR/# )r%   color_depthr   r,   rJ   r.   )r/   s   "r0   r1   _EscapeCodeCache.__annotate__
  s     ' 'J '4 'r2   c                	    Wn         R # rM   r   )rO   r   s   &&r0   rP   _EscapeCodeCache.__init__
  s    &r2   c                    V ^8  d   QhRRRR/# )r%   attrsr   r,   r-   r.   )r/   s   "r0   r1   r     s     ( ( (3 (r2   c           
     	z   Vw
  pppppppp	p
p. pTP                  T P                  T;'       g    R T;'       g    R 4      4       V'       d   VP                  R4       V'       d   VP                  R4       V'       d   VP                  R4       V'       d   VP                  R4       V'       d   VP                  R4       V	'       d   VP                  R4       V
'       d   VP                  R4       V'       d   VP                  R4       V'       d!   R	R
P                  V4      ,           R,           pMRpWV&   V# ) 12354789z[0;;m[0m)r9   _colors_to_coder   join)rO   r   fgcolorbgcolorbold	underlinestrikeitalicblinkreversehiddendimpartsresults   &&            r0   r   _EscapeCodeCache.__missing__  s     	
T))'--RBGHLLLLLLLLLLLLLLLL%036FFUr2   c                    V ^8  d   QhRRRR/# )r%   colorr-   r,   rU   r.   )r/   s   "r0   r1   r   7  s     
 
 
0D 
r2   c                     \        V^4      pV^,	          ^,          pV^,	          ^,          pV^,          pW4V3#   \         d    h i ; i)z'Turn 'ffffff', into (0xff, 0xff, 0xff).)r'   
ValueError)rO   r   rgbr&   r(   r)   s   &&    r0   _color_name_to_rgb#_EscapeCodeCache._color_name_to_rgb7  sV    	eR.C d"AT!Ad
A7N  		s	   ; Ac               $    V ^8  d   QhRRRRRR/# )r%   fg_colorr-   bg_colorr,   zIterable[str]r.   )r/   s   "r0   r1   r   C  s!     7  7  7 s 7 } 7 r2   c                   a aaa RoR VVVV 3R llp. pVP                  V! SR4      4       VP                  V! SR4      4       \        \        V4      # )zB
Return a tuple with the vt100 values  that represent this color.
r   c               $    V ^8  d   QhRRRRRR/# )r%   r   r-   rH   rI   r,   z	list[int]r.   )r/   s   "r0   r1   6_EscapeCodeCache._colors_to_code.<locals>.__annotate__L  s&     (	E (	Es (	E (	E (	Er2   c                X  < V'       d   \         M\        pV '       d    SP                  \        P                  8X  d   . # W9   d
   W ,          .#  SP                  V 4      pSP                  \        P                  8X  dM   T'       d)   SS
8w  d   S.pM. p\        P                  Y4R 7      w  rVT.# \        P                  T4      w  rVToT.# SP                  \        P                  8X  d   Tw  rxp	T'       d   ^0M^&^YxT	.# T'       d   ^0M^&^\        T,          .#   \         d    . u # i ; ir`   )ra   rb   r   r   DEPTH_1_BITr   r   DEPTH_4_BIT_16_bg_colorsr\   _16_fg_colorsDEPTH_24_BIT_256_colors)r   rH   tabler   r*   rc   r?   r&   r(   r)   r   fg_ansir   rO   s   &&        r0   get-_EscapeCodeCache._colors_to_code.<locals>.getL  s    ')NnED,,
0F0FF	 ~%11%8C
 ##z'='==#x/'.iG&(G%2%;%;C%;%Q
 $v%2%;%;C%@
"& $v %%)@)@@!GA!#%R21;; $&R2;s3CDD1 " Is   D D)(D)FT)r9   mapr-   )rO   r   r   r   r   r   s   fff  @r0   r    _EscapeCodeCache._colors_to_codeC  sQ     (	E (	ET c(E*+c(D)*3r2   r   N)
rf   rg   rh   ri   rj   rP   r   r   r   rk   r.   r2   r0   r   r     s!    '(T
7  7 r2   r   c                    V ^8  d   QhRRRR/# )r%   filenor'   r,   ztuple[int, int]r.   )r/   s   "r0   r1   r1   }  s     $ $c $o $r2   c                ^    \         P                  ! V 4      pVP                  VP                  3# )zg
Get the size of this pseudo terminal.

:param fileno: stdout.fileno()
:returns: A (rows, cols) tuple.
)osget_terminal_sizelinescolumns)r   sizes   & r0   	_get_sizer   }  s'     'D::t||##r2   c                     ] tR tRt$ Rt]! 4       tR]R&   RQR R llt]	RRR R	 ll4       t
R
 R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR. R/ ltR0 R1 ltR2 R3 ltRSR4 R5 llt R6 R7 lt!R8 R9 lt"R: R; lt#R< R= lt$R> R? lt%R@ RA lt&RB RC lt'RD RE lt(RF RG lt)RH RI lt*]+RJ RK l4       t,RL RM lt-RN RO lt.RPt/R# )Tr   i  a  
:param get_size: A callable which returns the `Size` of the output terminal.
:param stdout: Any object with has a `write` and `flush` method + an 'encoding' property.
:param term: The terminal environment variable. (xterm, xterm-256color, linux, ...)
:param enable_cpr: When `True` (the default), send "cursor position
    request" escape sequences to the output in order to detect the cursor
    position. That way, we can properly determine how much space there is
    available for the UI (especially for drop down menus) to render. The
    `Renderer` will still try to figure out whether the current terminal
    does respond to CPR escapes. When `False`, never attempt to send CPR
    requests.
zset[int]_fds_not_a_terminalNc               4    V ^8  d   QhRRRRRRRRR	R
RR
RR/# )r%   stdoutr   get_sizezCallable[[], Size]term
str | Nonedefault_color_depthColorDepth | Noneenable_bellrI   
enable_cprr,   rJ   r.   )r/   s   "r0   r1   Vt100_Output.__annotate__  sP     #1 #1#1 %#1 	#1
 /#1 #1 #1 
#1r2   c           
     	F  a \         ;QJ d    V3R  lR 4       F  '       d   K   RM	  RM! V3R  lR 4       4      '       g   Q h. V n        SV n        W@n        W n        W0n        WPn        W`n        \        P                  \        \        P                  4      \        P                  \        \        P                  4      \        P                  \        \        P                  4      \        P                  \        \        P                  4      /V n        RV n        RV n        R# )c              3  <   <"   T F  p\        SV4      x  K  	  R # 5irM   )hasattr).0ar   s   & r0   	<genexpr>(Vt100_Output.__init__.<locals>.<genexpr>  s     B/A!761%%/As   FTN)writeflush)all_bufferr   r   r   r   r   r   r   r   r   r   DEPTH_8_BITr   _escape_code_caches_cursor_shape_changed_cursor_visible)rO   r   r   r   r   r   r   s   &f&&&&&r0   rP   Vt100_Output.__init__  s     sB/ABsssB/ABBBBB"$$#6 !	&$ ""$4Z5K5K$L""$4Z5K5K$L""$4Z5K5K$L##%5j6M6M%N	H
  &+"
 -1r2   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r%   r   r   r   r   r   r   r   rI   r,   r   r.   )r/   s   "r0   r1   r     s<     2
 2
2
 2
 /	2

 2
 
2
r2   c                  a  SP                  4       pSP                  4       '       gy   Ve   WPP                  9  de   Rp\
        P                  P                  We,          4       \
        P                  P                  4        Ve   V P                  P                  V4       R V3R llpV ! SVVVVR7      #   \        P                   d    Rp Li ; i)z{
Create an Output class from a pseudo terminal.
(This will take the dimensions by reading the pseudo
terminal attributes.)
Nz+Warning: Output is not a terminal (fd=%r).
c                   V ^8  d   QhRR/# r%   r,   r   r.   )r/   s   "r0   r1   +Vt100_Output.from_pty.<locals>.__annotate__  s     	@ 	@$ 	@r2   c                    < R R r \        SP                  4       4      w  r\        T ;'       g    ^T;'       g    ^PR7      #   \         d     L.i ; i)N)rowsr   )r   r   OSErrorr   )r  r   r   s     r0   r   'Vt100_Output.from_pty.<locals>.get_size  sR     "4' )&--/ : TZZRB??  s   A AA)r   r   r   )
r   ioUnsupportedOperationisattyr   sysstderrr   r   add)clsr   r   r   r   fdmsgr   s   &f&&&   r0   from_ptyVt100_Output.from_pty  s    "	B }}BJ"<S<S2S@CJJSX&JJ~''++B/	@ 	@   3#
 	
5 && 	B	s   B7 7CCc                   V ^8  d   QhRR/# r   r.   )r/   s   "r0   r1   r     s        $  r2   c                	"    V P                  4       # rM   )r   rO   s   &r0   r   Vt100_Output.get_size  s    ~~r2   c                   V ^8  d   QhRR/# )r%   r,   r'   r.   )r/   s   "r0   r1   r     s     $ $ $r2   c                6    V P                   P                  4       # )zReturn file descriptor.)r   r   r  s   &r0   r   Vt100_Output.fileno  s    {{!!##r2   c                   V ^8  d   QhRR/# )r%   r,   r-   r.   )r/   s   "r0   r1   r     s     $ $# $r2   c                .    V P                   P                  # )z Return encoding used for stdout.)r   encodingr  s   &r0   r  Vt100_Output.encoding  s    {{###r2   c                    V ^8  d   QhRRRR/# r%   datar-   r,   rJ   r.   )r/   s   "r0   r1   r     s     " "c "d "r2   c                <    V P                   P                  V4       R# )z
Write raw data to output.
N)r   r   rO   r  s   &&r0   	write_rawVt100_Output.write_raw  s     	D!r2   c                    V ^8  d   QhRRRR/# r  r.   )r/   s   "r0   r1   r     s     7 7# 7$ 7r2   c                \    V P                   P                  VP                  RR4      4       R# )zV
Write text to output.
(Removes vt100 escape codes. -- used for safely writing text.)
?N)r   r   replacer   s   &&r0   r   Vt100_Output.write  s!    
 	DLL56r2   c                    V ^8  d   QhRRRR/# )r%   titler-   r,   rJ   r.   )r/   s   "r0   r1   r     s     
 
s 
t 
r2   c                    V P                   R9  dC   V P                  RP                  VP                  RR4      P                  RR4      4      4       R# R# )z
Set terminal title.
z]2;{}r%  r   Nlinuxzeterm-color)r   r!  r/   r'  )rO   r*  s   &&r0   	set_titleVt100_Output.set_title  sO     99 
 
 NN&&u}}VR'@'H'HQS'TU	
r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s      T r2   c                	(    V P                  R 4       R# )r   N)r/  r  s   &r0   clear_titleVt100_Output.clear_title  s    rr2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s     " "d "r2   c                (    V P                  R4       R# )zK
Erases the screen with the background color and moves the cursor to
home.
z[2JNr!  r  s   &r0   erase_screenVt100_Output.erase_screen  s    
 	y!r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   "  s     , , ,r2   c                	(    V P                  R 4       R# )z[?1049h[HNr7  r  s   &r0   enter_alternate_screen#Vt100_Output.enter_alternate_screen"  s    *+r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   %  s     & &t &r2   c                	(    V P                  R 4       R# )z[?1049lNr7  r  s   &r0   quit_alternate_screen"Vt100_Output.quit_alternate_screen%      }%r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   (  s     
& 
&d 
&r2   c                	    V P                  R 4       V P                  R4       V P                  R4       V P                  R4       R# )z[?1000hz[?1003hz[?1015hz[?1006hNr7  r  s   &r0   enable_mouse_support!Vt100_Output.enable_mouse_support(  s8    }% 	}% 	}% 	}%r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   7  s     & &t &r2   c                	    V P                  R 4       V P                  R4       V P                  R4       V P                  R4       R# )z[?1000lz[?1015lz[?1006lz[?1003lNr7  r  s   &r0   disable_mouse_support"Vt100_Output.disable_mouse_support7  s2    }%}%}%}%r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   =  s     ! !4 !r2   c                (    V P                  R4       R# )zI
Erases from the current cursor position to the end of the current line.
z[KNr7  r  s   &r0   erase_end_of_lineVt100_Output.erase_end_of_line=  s     	x r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   C  s     ! !D !r2   c                (    V P                  R4       R# )zK
Erases the screen from the current line down to the bottom of the
screen.
z[JNr7  r  s   &r0   
erase_downVt100_Output.erase_downC  s    
 	x r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   J  s     " "$ "r2   c                	(    V P                  R 4       R# )r   Nr7  r  s   &r0   reset_attributesVt100_Output.reset_attributesJ  s    y!r2   c               $    V ^8  d   QhRRRRRR/# )r%   r   r   r   r   r,   rJ   r.   )r/   s   "r0   r1   r   M  s!     
1 
1E 
1
 
1t 
1r2   c                Z    V P                   V,          pV P                  W1,          4       R# )z?
Create new style and output.

:param attrs: `Attrs` instance.
N)r   r!  )rO   r   r   escape_code_caches   &&& r0   set_attributesVt100_Output.set_attributesM  s'     !44[A 	(/0r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   Y  s     # #$ #r2   c                	(    V P                  R 4       R# )z[?7lNr7  r  s   &r0   disable_autowrapVt100_Output.disable_autowrapY      z"r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   \  s     # # #r2   c                	(    V P                  R 4       R# )z[?7hNr7  r  s   &r0   enable_autowrapVt100_Output.enable_autowrap\  r`  r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   _  s     & & &r2   c                	(    V P                  R 4       R# )z[?2004hNr7  r  s   &r0   enable_bracketed_paste#Vt100_Output.enable_bracketed_paste_  rB  r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   b  s     & & &r2   c                	(    V P                  R 4       R# )z[?2004lNr7  r  s   &r0   disable_bracketed_paste$Vt100_Output.disable_bracketed_pasteb  rB  r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r   e  s     # #t #r2   c                (    V P                  R4       R# )zP
For vt100 only.
Put the terminal in cursor mode (instead of application mode).
z[?1lNr7  r  s   &r0   reset_cursor_key_mode"Vt100_Output.reset_cursor_key_modee  s     	z"r2   c               $    V ^8  d   QhRRRRRR/# )r%   rowr'   columnr,   rJ   r.   )r/   s   "r0   r1   r   m  s!     6 6s 6 6D 6r2   c                8    V P                  RW3,          4       R# )z
Move cursor position.
z[%i;%iHNr7  )rO   rr  rs  s   &&&r0   cursor_gotoVt100_Output.cursor_gotom  s     	}}45r2   c                    V ^8  d   QhRRRR/# r%   amountr'   r,   rJ   r.   )r/   s   "r0   r1   r   s  s     0 0 0 0r2   c                	|    V^ 8X  d   R# V^8X  d   V P                  R4       R# V P                  RV,          4       R# )rr   z[Az[%iANr7  rO   ry  s   &&r0   	cursor_upVt100_Output.cursor_ups  0    Q;q[NN8$NN:./r2   c                    V ^8  d   QhRRRR/# rx  r.   )r/   s   "r0   r1   r   {  s     0 0# 0$ 0r2   c                	|    V^ 8X  d   R# V^8X  d   V P                  R4       R# V P                  RV,          4       R# )rr   z[Bz[%iBNr7  r{  s   &&r0   cursor_downVt100_Output.cursor_down{  s2    Q;q[ NN8$NN:./r2   c                    V ^8  d   QhRRRR/# rx  r.   )r/   s   "r0   r1   r     s     0 0S 0T 0r2   c                	|    V^ 8X  d   R# V^8X  d   V P                  R4       R# V P                  RV,          4       R# )rr   z[Cz[%iCNr7  r{  s   &&r0   cursor_forwardVt100_Output.cursor_forward  r~  r2   c                    V ^8  d   QhRRRR/# rx  r.   )r/   s   "r0   r1   r     s     0 0c 0d 0r2   c                	|    V^ 8X  d   R# V^8X  d   V P                  R4       R# V P                  RV,          4       R# )rr   z[%iDNr7  r{  s   &&r0   cursor_backwardVt100_Output.cursor_backward  s0    Q;q[NN4 NN:./r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s     ( (T (r2   c                	\    V P                   R9   d   RV n         V P                  R4       R# R# )TNFz[?25l)TNr   r!  r  s   &r0   hide_cursorVt100_Output.hide_cursor  s)    </#(D NN;' 0r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s     1 1T 1r2   c                	\    V P                   R9   d   RV n         V P                  R4       R# R# )FNTz[?12l[?25h)FNr  r  s   &r0   show_cursorVt100_Output.show_cursor  s*    =0#'D NN/0 1r2   c                    V ^8  d   QhRRRR/# )r%   cursor_shaper
   r,   rJ   r.   )r/   s   "r0   r1   r     s     
 
[ 
T 
r2   c                	D   V\         P                  8X  d   R # RV n        V P                  \         P                  R\         P
                  R\         P                  R\         P                  R\         P                  R\         P                  R/P                  VR4      4       R # )	NTz[2 qz[6 qz[4 qz[1 qz[5 qz[3 qr   )r
   _NEVER_CHANGEr   r!  BLOCKBEAM	UNDERLINEBLINKING_BLOCKBLINKING_BEAMBLINKING_UNDERLINEr   )rO   r  s   &&r0   set_cursor_shapeVt100_Output.set_cursor_shape  s|    ;444%)"!!:  *%%z**J)):..
 c,#		
r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s     ' 'D 'r2   c                ^    V P                   '       d   RV n         V P                  R4       R# R# )zReset cursor shape.Fz[0 qN)r   r!  r  s   &r0   reset_cursor_shapeVt100_Output.reset_cursor_shape  s+     %%%).D& NN:&	 &r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s     
( 
(t 
(r2   c                    V P                   '       g   R# RP                  V P                   4      p. V n         \        V P                  V4       R# )z#
Write to output stream and flush.
Nr   )r   r   r   r   r   s   & r0   r   Vt100_Output.flush  s7     |||wwt||$T[[$'r2   c                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s      T r2   c                H    V P                  R4       V P                  4        R# )z*
Asks for a cursor position report (CPR).
z[6nN)r!  r   r  s   &r0   ask_for_cprVt100_Output.ask_for_cpr  s     	y!

r2   c                   V ^8  d   QhRR/# )r%   r,   rI   r.   )r/   s   "r0   r1   r     s       r2   c                	   V P                   '       g   R # \        P                  P                  RR4      R8X  d   R # \	        V P
                  4      '       d   R #  V P                  P                  4       #   \         d     R # i ; i)FPROMPT_TOOLKIT_NO_CPRr   r   )	r   r   environr   r   r   r   r  r   r  s   &r0   responds_to_cprVt100_Output.responds_to_cpr  sg     ::>>126#=DII&&	;;%%'' 		s   A4 4BBc                   V ^8  d   QhRR/# ro   r.   )r/   s   "r0   r1   r     s      d r2   c                p    V P                   '       d$   V P                  R4       V P                  4        R# R# )zSound bell.r,  N)r   r!  r   r  s   &r0   bellVt100_Output.bell  s(    NN4 JJL r2   c                   V ^8  d   QhRR/# )r%   r,   r   r.   )r/   s   "r0   r1   r     s     " " "r2   c                   V P                   e   V P                   # V P                  pVf   \        P                  # \	        V4      '       d   \        P
                  # VR9   d   \        P                  # \        P                  # )z
Return the default color depth for a vt100 terminal, according to the
our term value.

We prefer 256 colors almost always, because this is what most terminals
support these days, and is a good default.
r-  )r   r   r   DEFAULTr   r   r   )rO   r   s   & r0   get_default_color_depth$Vt100_Output.get_default_color_depth  sn     ##/+++yy<%%%D!!)))++)))!!!r2   )
r   r   r   r   r   r   r   r   r   r   )NNTT)NNT)rr   rr   )0rf   rg   rh   ri   rj   setr   __annotations__rP   classmethodr  r   r   r  r!  r   r/  r3  r8  r<  r@  rE  rI  rM  rQ  rU  rZ  r^  rc  rg  rk  ro  ru  r|  r  r  r  r  r  r  r  r   r  propertyr  r  r  rk   r.   r2   r0   r   r     s     %(E)#1J 2
 2
h $$"7
",&
&&!!"
1##&&#60000(
1

 '
(   " "r2   rs   r{   r}   r   rt   rv   rw   )rr   rr   ru   ry   rz   r   r   r   )rr   rr   r   r   r   re   )-rj   
__future__r   r  r   r	  typingr   r   r   r   r   r   r	   prompt_toolkit.cursor_shapesr
   prompt_toolkit.data_structuresr   prompt_toolkit.outputr   prompt_toolkit.stylesr   r   prompt_toolkit.utilsr   r   r   r   __all__rb   ra   r:   r  rD   r'   r-   rV   rF   rm   r   r   r   r   r   r   r.   r2   r0   <module>r     s   # 	 	 
 N N N 4 / ( 9 1 # & 
2  r	
  "  2   r R r   b!" #$ b%& ',2  r	
  "  2   s S s   c!" #$ c%& '.  # " ) # ! # $ " %  "!$ '%& )'( *)* (+, +-. (/ 6 >c"233 33
>c"233 33
#&6"77 77D #s(O & &R?T%S#.34 ?D '&y tE3J' y x$p"6 p"r2   