+
    wi`                     n   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt	 ^ RI
Ht ^ RIHt ^ RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ]P:                  ! R4      t]P>                  R8X  d   Rt Rt!MRt Rt! ! R R]PD                  ],          4      t#R.R R llt$R R lt%R R lt&R R lt' ! R  R!4      t(R/R" R# llt)R$ R% lt*]'       d"   ^ RI+t+]PX                  R& R' l4       t-R( R) lt.R# ^ RI/t/^ RI0t0]PX                  R* R+ l4       t-R, R- lt.R# )0z
This module contains implementations for the termui module. To keep the
import time of Click down, some infrequently used functionality is
placed in this module and only imported as needed.
N)gettext)StringIO)which)TracebackType)_default_text_stdout)CYGWIN)get_best_encoding)isatty)open_stream)
strip_ansi)term_len)WIN)ClickException)echoVnt
z[?25lz[?25h
c                     a  ] tR t^'t o 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]
V 3R lR l4       t]
V 3R lR l4       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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R(tV tR# )+ProgressBarNc                    < V ^8  d   QhRS[ P                  S[ P                  S[,          ,          RS[ P                  S[,          RS[RS[RS[RS[RS[RS[ P                  S[,          R	S[R
S[ P                  S[ P                  S[ P                  S[,          .S[ P                  S[,          3,          ,          RS[ P                  S[,          RS[ P                  S[ P                  ,          RS[ P                  S[,          RS[RS[RR/# )   iterablelength	fill_char
empty_charbar_templateinfo_sepshow_etashow_percentshow_positem_show_funclabelfilecolorupdate_min_stepswidthreturnN)	tOptionalIterabler   intstrboolCallableTextIO)format__classdict__s   "a/Users/ahmad/.openclaw/workspace/scripts/.venv/lib/python3.14/site-packages/click/_termui_impl.py__annotate__ProgressBar.__annotate__(   s&    C0 C0**QZZ]+C0 

3C0 	C0
 C0 C0 C0 C0 jj&C0 C0 

1::qzz!}oqzz#.N#OPC0 zz#C0 jj"C0 zz$C0 C0  !C0" 
#C0    c                   W0n         W@n        WPn        W`n        Wpn        Wn        Wn        Wn        T;'       g    R V n        Vf   \        4       pVf   \        4       pWn        Wn        Wn        ^ V n        Wn        V^ 8H  V n        Vf   ^ RIHp V! VR4      pVR8X  d   RpVfI   Vf   \'        R4      h\(        P*                  ! \(        P,                  \.        ,          \1        V4      4      p\3        V4      V n        W n        ^ V n        . V n        V  V  \:        P:                  ! 4       ;V n        V n        RV n         RV n!        RV n"        RV n#        RV n$        \K        V P                  4      '       * V n&        RV n'        R# ) N)length_hintziterable or length is requiredF)(r   r   r   r   r   r   r    r!   r"   r   r   r#   r$   r%   _completed_intervalsr&   	autowidthoperatorr8   	TypeErrorr(   castr*   r   rangeiterr   posavgtimestartlast_eta	eta_knownfinished	max_widthenteredcurrent_itemr	   	is_hidden
_last_line)selfr   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r8   s   &&&&&&&&&&&&&&&& r2   __init__ProgressBar.__init__(   sH   $ #$(  ( ,++2
<')D |z	
 0$%!
$z>, 2.F|~ @AAvvajjmU6];H#'>	"$%)YY[0
T]$#*."+/#)$))#44+/r5   c                   < V ^8  d   QhRR/# )r   r'   zProgressBar[V] )r0   r1   s   "r2   r3   r4   m   s      + r5   c                4    R V n         V P                  4        V # )T)rI   render_progressrM   s   &r2   	__enter__ProgressBar.__enter__m   s    r5   c                   < V ^8  d   QhRS[ P                  S[ P                  S[,          ,          RS[ P                  S[,          RS[ P                  S[,          RR/# )r   exc_type	exc_valuetbr'   N)r(   r)   TypeBaseExceptionr   )r0   r1   s   "r2   r3   r4   r   sW      **QVVM23 ::m, JJ}%	
 
r5   c                &    V P                  4        R # N)render_finish)rM   rX   rY   rZ   s   &&&&r2   __exit__ProgressBar.__exit__r   s     	r5   c                D   < V ^8  d   QhRS[ P                  S[,          /# r   r'   r(   Iteratorr   )r0   r1   s   "r2   r3   r4   z   s        !**Q-  r5   c                |    V P                   '       g   \        R 4      hV P                  4        V P                  4       # ).You need to use progress bars in a with block.)rI   RuntimeErrorrS   	generatorrT   s   &r2   __iter__ProgressBar.__iter__z   s0    |||OPP~~r5   c                    < V ^8  d   QhRS[ /# rc   )r   )r0   r1   s   "r2   r3   r4      s        !  r5   c                *    \        \        V 4      4      # r^   )nextr@   rT   s   &r2   __next__ProgressBar.__next__   s     DJr5   c                   < V ^8  d   QhRR/# r   r'   NrQ   )r0   r1   s   "r2   r3   r4      s      t r5   c                    V P                   '       d   R # V P                  P                  \        4       V P                  P	                  4        R # r^   )rK   r#   write	AFTER_BARflushrT   s   &r2   r_   ProgressBar.render_finish   s,    >>>			"		r5   c                    < V ^8  d   QhRS[ /# rc   float)r0   r1   s   "r2   r3   r4      s     C CU Cr5   c                    V P                   '       d   R # \        V P                  \        V P                  ;'       g    ^4      ;'       g    ^,          R 4      # )      ?)rG   minrA   rz   r   rT   s   &r2   pctProgressBar.pct   s=    ===488uT[[%5%5A6;;!<cBBr5   c                    < V ^8  d   QhRS[ /# rc   ry   )r0   r1   s   "r2   r3   r4      s     4 4E 4r5   c                    V P                   '       g   R # \        V P                   4      \        \        V P                   4      4      ,          # )        )rB   sumrz   lenrT   s   &r2   time_per_iterationProgressBar.time_per_iteration   s.    xxx488}uS]333r5   c                    < V ^8  d   QhRS[ /# rc   ry   )r0   r1   s   "r2   r3   r4      s      U r5   c                    V P                   eA   V P                  '       g/   V P                  V P                   V P                  ,
          ,          # R# )Nr   )r   rG   r   rA   rT   s   &r2   etaProgressBar.eta   s5    ;;"4===**dkkDHH.DEEr5   c                    < V ^8  d   QhRS[ /# rc   r,   )r0   r1   s   "r2   r3   r4      s      C r5   c                   V P                   '       dp   \        V P                  4      pV^<,          pV^<,          pV^<,          pV^<,          pV^,          pV^,          pV^ 8  d   V RVR RVR RVR 2# VR RVR RVR 2# R# )<   zd 02:r7   )rF   r+   r   )rM   r(   secondsminuteshourss   &    r2   
format_etaProgressBar.format_eta   s    >>>DHHA"fG"HA"fG"HAFE"HA1uBuRj'"QwrlCC1WRL'">>r5   c                    < V ^8  d   QhRS[ /# rc   r   )r0   r1   s   "r2   r3   r4      s      C r5   c                x    \        V P                  4      pV P                  e   VRV P                   2,          pV# )N/)r,   rA   r   )rM   rA   s   & r2   
format_posProgressBar.format_pos   s3    $((m;;"Qt{{m$$C
r5   c                    < V ^8  d   QhRS[ /# rc   r   )r0   r1   s   "r2   r3   r4      s     0 0C 0r5   c                P    \        V P                  ^d,          4      R R2R,          # )d   z 4%   NN)r+   r~   rT   s   &r2   
format_pctProgressBar.format_pct   s$    dhhn%b)+B//r5   c                    < V ^8  d   QhRS[ /# rc   r   )r0   r1   s   "r2   r3   r4      s      C r5   c                   V P                   ef   \        V P                  V P                  ,          4      pV P                  V,          pW P
                  V P                  V,
          ,          ,          pV# V P                  '       d    V P                  V P                  ,          pV# \        V P
                  V P                  ;'       g    ^,          4      pV P                  ^ 8w  dg   V P                  V\        \        P                  ! V P                  V P                  ,          4      R,          R,           V P                  ,          4      &   RP                  V4      pV# )Ng       @g      ?r7   )r   r+   r~   r&   r   r   rG   listr   mathcosrA   join)rM   
bar_lengthbarcharss   &   r2   
format_barProgressBar.format_bar   s   ;;"TXX

23J..:-C??djj:&=>>C 
 ]]]..4::-C 
 DJJOO!<=E&&!+ NN $((T-D-D"DEKcQ**% ''%.C
r5   c                    < V ^8  d   QhRS[ /# rc   r   )r0   r1   s   "r2   r3   r4      s      c r5   c           	        V P                   p. pV P                  e   Vf   V P                  '       * pV P                  '       d    VP                  V P	                  4       4       V'       d    VP                  V P                  4       4       V P                  '       dD   V P                  '       d2   V P                  '       g    VP                  V P                  4       4       V P                  e1   V P                  V P                  4      pVe   VP                  V4       V P                  RV P                  RV P                  4       RV P                  P!                  V4      /,          P#                  4       # )Nr"   r   info)r   r   r    appendr   r   r   rF   rG   r   r!   rJ   r   r"   r   r   r   rstrip)rM   r   	info_bits	item_infos   &   r2   format_progress_line ProgressBar.format_progress_line   s   ((	;;"|';#}},L===T__./T__./===T^^^DMMMT__./*++D,=,=>I$  + t(**95 &(	r5   c                   < V ^8  d   QhRR/# rr   rQ   )r0   r1   s   "r2   r3   r4      s     + + +r5   c                l   ^ RI pV P                  '       d[   V P                  V P                  8w  d>   V P                  V n        \	        V P                  V P
                  V P                  R7       R# . pV P                  '       d   V P                  p^ V n        \        V P                  4       4      p\        ^ VP                  4       P                  V,
          4      pWS8  d>   VP                  \        4       VP                  RV P                   ,          4       WPn        WPn        V P                  pV P                   e   V P                   pVP                  \        4       V P                  4       p\        V4      pV P                   e   V P                   V8  d   Wn        VP                  V4       VP                  RWh,
          ,          4       RP#                  V4      pWpP                  8w  dE   Wpn        \	        WpP
                  V P                  RR7       V P
                  P%                  4        R# R# )    N)r#   r$    r7   F)r#   r$   nl)shutilrK   rL   r"   r   r#   r$   r;   r&   r   r   maxget_terminal_sizecolumnsr   
BEFORE_BARrH   r   rv   )	rM   r   buf	old_widthclutter_length	new_widthclear_widthlineline_lens	   &        r2   rS   ProgressBar.render_progress   s   >>> $**,"&**TZZdiitzzB>>>

IDJ%d&?&?&ABNAv779AANRSI$

:&

3/0!*"Jjj>>%..K

:((*D>>>!T^^h%>%N

4

3+012wws| ??""OIITZZEBIIOO #r5   c                $   < V ^8  d   QhRS[ RR/# )r   n_stepsr'   N)r+   )r0   r1   s   "r2   r3   r4     s     1 1 1 1r5   c                d   V ;P                   V,          un         V P                  e#   V P                   V P                  8  d   RV n        \        P                  ! 4       V P                  ,
          R8  d   R # \        P                  ! 4       V n        V P                   '       d9   \        P                  ! 4       V P
                  ,
          V P                   ,          pM&\        P                  ! 4       V P
                  ,
          pV P                  RR  V.,           V n        V P                  R JV n        R # )NTr|   i)rA   r   rG   rC   rE   rD   rB   rF   )rM   r   steps   && r2   	make_stepProgressBar.make_step  s    G;;"txx4;;'> DMIIK$--'3.		
 888IIK$**,8D99;+D88BC=D6)D0r5   c                N   < V ^8  d   QhRS[ RS[P                  S[,          RR/# )r   r   rJ   r'   N)r+   r(   r)   r   )r0   r1   s   "r2   r3   r4   )  s*     * *c *A *$ *r5   c                    Ve   W n         V ;P                  V,          un        V P                  V P                  8  d5   V P                  V P                  4       V P	                  4        ^ V n        R# R# )a  Update the progress bar by advancing a specified number of
steps, and optionally set the ``current_item`` for this new
position.

:param n_steps: Number of steps to advance.
:param current_item: Optional item to set as ``current_item``
    for the updated position.

.. versionchanged:: 8.0
    Added the ``current_item`` optional parameter.

.. versionchanged:: 8.0
    Only render when the number of steps meets the
    ``update_min_steps`` threshold.
N)rJ   r:   r%   r   rS   )rM   r   rJ   s   &&&r2   updateProgressBar.update)  s`      # ,!!W,!$$(=(==NN4445  "()D% >r5   c                   < V ^8  d   QhRR/# rr   rQ   )r0   r1   s   "r2   r3   r4   C  s       r5   c                0    R V n         RV n        RV n        R# )FNT)rF   rJ   rG   rT   s   &r2   finishProgressBar.finishC  s     r5   c                D   < V ^8  d   QhRS[ P                  S[,          /# rc   rd   )r0   r1   s   "r2   r3   r4   H  s     # #1::a= #r5   c              #  z  "   V P                   '       g   \        R4      hV P                  '       d   V P                   Rj  xL
  R# V P                   F?  pWn        V P
                  ^ 8X  d   V P                  4        Vx  V P                  ^4       KA  	  V P                  4        V P                  4        R#  Lw5i)zReturn a generator which yields the items added to the bar
during construction, and updates the progress bar *after* the
yielded block returns.
rg   N)	rI   rh   rK   r@   rJ   r:   rS   r   r   )rM   rvs   & r2   ri   ProgressBar.generatorH  s      |||OPP>>>yy  ii$&!
 ,,1((*A   KKM  " !s   /B;B;B9A8B;)r:   rL   r;   rB   r   r$   rJ   r   rI   rF   r#   r   rG   r   rK   r!   r@   r"   rE   r   rH   rA   r   r   r    rD   r%   r&   )N#r   z%(bar)sz  TNFNNNNr      r^   )__name__
__module____qualname____firstlineno__rN   rU   r`   rj   ro   r_   propertyr~   r   r   r   r   r   r   r   rS   r   r   r   ri   __static_attributes____classdictcell__r1   s   @r2   r   r   '   s     C0 C0J 
         C C
 4 4
  
  0 0 & 6+ +Z1 1,* *4 
# #r5   r   c                    V ^8  d   QhR\         P                  \        ,          R\         P                  \        ,          RR/# )r   ri   r$   r'   Nr(   r*   r,   r)   r-   )r0   s   "r2   r3   r3   j  s2     $ $QZZ_ $QZZ-= $ $r5   c                   \        4       pVf   \        4       p\        \        P                  4      '       d   \        V4      '       g   \        W V4      # \        P                  P                  RR4      ;'       g    RP                  4       pV'       d6   \        '       d   \        WV4      '       d   R# M\        WV4      '       d   R# \        P                  P                  R4      R9   d   \        W V4      # \        '       g&   \        P                  P                  R4      '       d   \        V RV4      '       d   R# \        V RV4      '       d   R# ^ RIpVP!                  4       w  rV\        P"                  ! V4        \        V RV4      '       d    \        P$                  ! V4       R# \        W V4      \        P$                  ! V4       #   \        P$                  ! T4       i ; i)	z2Decide what method to use for paging through text.NPAGERr7   TERMos2moreless)dumbemacs)r   r   r	   sysstdin
_nullpagerosenvirongetstripr   _tempfilepager
_pipepagerplatform
startswithtempfilemkstempcloseunlink)ri   r$   stdout	pager_cmdr   fdfilenames   &&     r2   pagerr  j  s\   !#F ~#))F6NN&U33.44";;=I3iE:: ;	e44	zz~~f!22&U33s||&&u-->654 4 	)VU++##%LBHHRLi// 			( &U3
		(		(s   G .G G(c                    V ^8  d   QhR\         P                  \        ,          R\        R\         P                  \        ,          R\        /# r   ri   cmdr$   r'   r   )r0   s   "r2   r3   r3     s:     > >!**S/ > >AJJt<L >QU >r5   c           	        \        V4      pVf   R# ^ RIp\        \        P                  4      pVP                  R^4      R,          P                  4       pVfi   V^ ,          R8X  d[   \        P                  P                  RR4       RP                  VR,          4       2pV'       g	   R	VR&   R
pMRV9   g   RV9   d   R
pVP                  V.R
VP                  VRR
R7      pVP                  f   Q h V  F1  p	V'       g   \        V	4      p	VP                  P                  V	4       K3  	  VP                  P                  4          VP#                  4         R
#   \        \         3 d     L(i ; i  \          d     K:  i ; i)zPage through text by feeding it to another program.  Invoking a
pager through this might support colors.

Returns True if the command was found, False otherwise and thus another
pager should be attempted.
NFr   r   LESSr7   r   r   -RTrRreplace)shellr   enverrorstextr9   )r   
subprocessdictr   r   rsplitsplitr   r   PopenPIPEr   r   rt   r   OSErrorKeyboardInterruptwait)
ri   r  r$   cmd_absoluter  r  
cmd_detail
less_flagscr  s
   &&&       r2   r   r     sj    :L
rzz
C C#B'--/J}A&0

vr23CHHZ^4L3MN
CKEJ#"3E	oo 	 	A 77	D!$'GGMM$	  	
 	FFH + &'   ! 		s$   57E E2 E/.E/2F Fc                    V ^8  d   QhR\         P                  \        ,          R\        R\         P                  \        ,          R\        /# r  r   )r0   s   "r2   r3   r3     sA     # #zz##	# ::d# 
	#r5   c                   \        V4      pVf   R# ^ RIp^ RIpVP                  4       w  rgRP	                  V 4      pV'       g   \        V4      p\        \        P                  4      p	\        VR4      ^ ,          ;_uu_ 4       p
V
P                  VP                  V	4      4       RRR4        VP                  W7.4       \        P                  ! V4       \        P                   ! V4       R#   + '       g   i     LQ; i  \         d     LNi ; i  \        P                  ! T4       \        P                   ! T4       i ; i)zPage through text by invoking a program on a temporary file.

Returns True if the command was found, False otherwise and thus another
pager should be attempted.
NFr7   wbT)r   r  r   r   r   r   r   r   r   r
   rt   encodecallr  r   r   r   )ri   r  r$   r  r  r   r   r  r  encodingfs   &&&        r2   r   r     s     :L##%LB779D$ ,H	Xt	$Q	'	'1	H%& 
(01
 	
		( 
(	'   	
		(s0   !C..D .C>	DD DD .E c                    V ^8  d   QhR\         P                  R\         P                  \        ,          R\         P                  \
        ,          RR/# )r   streamri   r$   r'   N)r(   r/   r*   r,   r)   r-   )r0   s   "r2   r3   r3     sA      HH!"C9:D9I	r5   c                `    V F'  pV'       g   \        V4      pV P                  V4       K)  	  R# )z>Simply print unformatted text.  This is the ultimate fallback.N)r   rt   )r%  ri   r$   r  s   &&& r2   r   r     s'     d#DT r5   c                   l   a  ] tR tRt o 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RtV t	R# )Editori  Nc          
         < V ^8  d   QhRS[ P                  S[,          RS[ P                  S[ P                  S[S[3,          ,          RS[RS[RR/# )r   editorr  require_save	extensionr'   N)r(   r)   r,   Mappingr-   )r0   r1   s   "r2   r3   Editor.__annotate__  s[     
# 
#

3
# ZZ		#s(+,
# 	
#
 
# 

#r5   c                6    Wn         W n        W0n        W@n        R # r^   )r*  r  r+  r,  )rM   r*  r  r+  r,  s   &&&&&r2   rN   Editor.__init__  s     ("r5   c                    < V ^8  d   QhRS[ /# rc   r   )r0   r1   s   "r2   r3   r.    s      C r5   c                    V P                   e   V P                   # R F.  p\        P                  P                  V4      pV'       g   K,  Vu # 	  \        '       d   R# R F  p\        V4      f   K  Vu # 	  R# )Nnotepadvi)VISUALEDITOR)zsensible-editorvimnano)r*  r   r   r   r   r   )rM   keyr   r*  s   &   r2   
get_editorEditor.get_editor  sd    ;;";;%C$Br	 & 36FV}( 7 r5   c                $   < V ^8  d   QhRS[ RR/# )r   r  r'   Nr   )r0   r1   s   "r2   r3   r.    s      # $ r5   c                   ^ RI pV P                  4       pRpV P                  '       d:   \        P                  P                  4       pVP                  V P                  4        VP                  V RV R2VRR7      pVP                  4       pV^ 8w  d%   \        \        R4      P                  VR7      4      hR#   \         d+   p\        \        R4      P                  Y7R	7      4      ThRp?ii ; i)
r   Nz ""T)r  r  z{editor}: Editing failed)r*  z{editor}: Editing failed: {e})r*  e)r  r:  r  r   r   copyr   r  r  r   _r0   r  )rM   r  r  r*  r   r  	exit_coder?  s   &&      r2   	edit_fileEditor.edit_file  s    "04888jjoo'GNN488$
	  F82hZq!9wd SAIA~$01888G    	 12999M	s   #AB: :C/%C**C/c                   < V ^8  d   QhRS[ P                  S[ P                  ,          RS[ P                  S[ P                  ,          /# )r   r  r'   )r(   r)   AnyStr)r0   r1   s   "r2   r3   r.  3  s5     - -AHH- -!**QXX2F -r5   c                D   ^ RI pV'       g   RpM\        V\        \        34      '       d   TpMgV'       d!   VP	                  R4      '       g
   VR,          p\
        '       d#   VP                  RR4      P                  R4      pMVP                  R4      pVP                  RV P                  R7      w  rE \        P                  ! VR	4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! V\        P                  P                  V4      \        P                  P!                  V4      ^,
          34       \        P                  P!                  V4      pV P#                  V4       V P$                  '       d>   \        P                  P!                  V4      V8X  d    \        P&                  ! V4       R# \)        VR
4      ;_uu_ 4       pVP+                  4       pRRR4       \        V\        \        34      '       d   X\        P&                  ! V4       # XP-                  R4      P                  RR4      \        P&                  ! V4       #   + '       g   i     EL; i  + '       g   i     L; i  \        P&                  ! T4       i ; i)r   Nr5   r   z
z	utf-8-sigzutf-8zeditor-)prefixsuffixr  rb)r   
isinstancebytes	bytearrayendswithr   r  r   r   r,  r   fdopenrt   utimepathgetatimegetmtimerC  r+  r   openreaddecode)	rM   r  r   datar   namer#  	timestampr   s	   &&       r2   editEditor.edit3  s   Dui011DDMM$//s||D&188E{{7+##9T^^#L	2t$$ % HHTBGG,,T2BGG4D4DT4JQ4NOP ((.INN4    RWW%5%5d%;y%H IIdO dD!!QVVX " $	 233 IIdO 99[)11&$?IIdO3 %$$" "! IIdOsO   6J I 'B#J $J J I4-%J ) J  I1	+	J 4J	?J J)r*  r  r,  r+  )NNTz.txt)
r   r   r   r   rN   r:  rC  rZ  r   r   r   s   @r2   r(  r(    s-     
# 
#  ,- -r5   r(  c                H    V ^8  d   QhR\         R\        R\        R\        /# )r   urlr  locater'   )r,   r-   r+   )r0   s   "r2   r3   r3   c  s.     D D# DT D4 DC Dr5   c                 $   ^ RI pR R lp\        P                  R8X  d   R.pV'       d   VP                  R4       V'       d   VP                  R4       VP                  V! V 4      4       \	        RR	4      p VP                  WVR
7      P                  4       VP                  4        # \        '       di   V'       d   V! V 4      p RRV  2.pM>R.pV'       d   VP                  R4       VP                  R4       VP                  V 4        VP                  V4      # \        '       dr   V'       d+   V! V 4      p R\        P                  P                  V 4      .pM-R.pV'       d   VP                  R4       VP                  V 4        VP                  V4      #  V'       d1   \        P                  P                  V! V 4      4      ;'       g    Rp MV! V 4      p VP                  RV .4      pV'       d   VP                  4       # ^ #   TP                  4        i ; i  \         d     ^# i ; i  \         d     ^# i ; i  \         dD    T P                  R4      '       d)   T'       g!   T'       g   ^ RIpTP	                  T 4        ^ #  ^# i ; i)r   Nc                0    V ^8  d   QhR\         R\         /# )r   r]  r'   r   )r0   s   "r2   r3   open_url.<locals>.__annotate__f  s      3 3 r5   c                 ^    ^ RI Hp V P                  R4      '       d   V! V R,          4      p V # )r   )unquotezfile://:   NN)urllib.parserc  r   )r]  rc  s   & r2   _unquote_fileopen_url.<locals>._unquote_filef  s'    (>>)$$#b'"C
r5   darwinrT  z-Wr  z	/dev/nullw)stderrexplorerz/select,rD   z/WAITr7   cygstartz-w.zxdg-open)zhttp://zhttps://)r  r   r   r   rT  r  r  r   r   r!  r  r   r   rQ  dirnamer   
webbrowser)	r]  r  r^  r  rf  argsnullr  ro  s	   &&&      r2   open_urlrr  c  s    ||xxKKKKM#&'K%	##D#6;;=JJL	$C(3% 01D9DG$KKOKK	??4(( 
$C 45D<DD!KK	??4((
''//-"45<<C$Cj#./668OO JJL  		  		  >>1226$OOC s`   9H H 	H/ I #+I &I 6I HH,+H,/H>=H>)J+J3JJc                Z    V ^8  d   QhR\         R\        P                  \        ,          /# )r   chr'   )r,   r(   r)   r\   )r0   s   "r2   r3   r3     s#     
 
S 
QZZ%> 
r5   c                     V R 8X  d   \        4       hV R8X  d   \        '       g   \        4       hV R8X  d   \        '       d   \        4       hR# )N)r  r   EOFError)rt  s   &r2   _translate_ch_to_excrz    s;    	V|!!	V|CCj	V|jr5   c                N    V ^8  d   QhR\         P                  \        ,          /# rc   r(   re   r+   )r0   s   "r2   r3   r3     s      !**S/ r5   c               #      "   Rx  R# 5i)r   Nr9   rQ   rQ   r5   r2   raw_terminalr~    s
     s   	c                0    V ^8  d   QhR\         R\        /# r   r   r'   r-   r,   )r0   s   "r2   r3   r3     s     - -d -s -r5   c                     V '       d   \         P                  pM\         P                  pV! 4       pVR9   d   W!! 4       ,          p\        V4       V# ) )r     à)msvcrtgetwchegetwchrz  )r   funcr   s   &  r2   getcharr    sD    @ >>D==DV!! $&LBR 	r5   c                N    V ^8  d   QhR\         P                  \        ,          /# rc   r|  )r0   s   "r2   r3   r3     s      !**S/ r5   c               #     "   \        \        P                  4      '       g   \        R 4      p V P	                  4       pM \        P                  P	                  4       pRp  \
        P                  ! V4      p \        P                  ! V4       Vx  \
        P                  ! V\
        P                  V4       \        P                  P                  4        V e   V P                  4        R# R#   \
        P                  ! T\
        P                  T4       \        P                  P                  4        T e   T P                  4        i i ; i  \
        P                   d     R# i ; i5i)z/dev/ttyN)r	   r   r   rT  filenotermios	tcgetattrttysetraw	tcsetattr	TCSADRAINr   rv   r   error)r#  r   old_settingss      r2   r~  r~    s     
 cii  Z AB!!#BA	",,R0L

2!!"g&7&7F

  "=GGI ! !!"g&7&7F

  "=GGI !}} 		sD   AE&E
 6C, AE
 (E&,AEE
 
E#E&"E##E&c                0    V ^8  d   QhR\         R\        /# r  r  )r0   s   "r2   r3   r3     s      d s r5   c                    \        4       ;_uu_ 4       p\        P                  ! V^ 4      P                  \	        \
        P                  4      R4      pV '       d?   \        \
        P                  4      '       d    \
        P                  P                  V4       \        V4       VuuRRR4       #   + '       g   i     R# ; i)    r  N)r~  r   rU  rV  r   r   r   r	   r   rt   rz  )r   r   rt  s   &  r2   r  r    sk    ^^rR''(9#))(DiPBszz**

  $ $ ^^^s   BB//C 	r^   )FF)1__doc__
contextlibr   r   r   rC   typingr(   r   rA  ior   r   r   typesr   _compatr   r   r   r	   r
   r   r   r   
exceptionsr   utilsr   TypeVarr   rX  r   ru   Genericr   r  r   r   r   r(  rr  rz  r  contextmanagerr~  r  r  r  rQ   r5   r2   <module>r     s     	 
        )  &       & IIcN77d?JIJI@#!))A, @#F
$N>B#L^ ^BDN
  -`  4r5   