+
    Dii                       R t ^ RIHt ^ RIHt ^ RI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" ]PF                  ! R4      t$]PJ                  R8X  d   Rt&Rt'MRt&Rt' ! R R]PP                  ]$,          4      t)R0R R llt*R R lt+R R lt,R R  lt- ! R! R"4      t.R1R# R$ llt/R% R& lt0]
Pb                  R'8X  d"   ^ RI2t2]Pf                  R( R) l4       t4R* R+ lt5R# ^ RI6t6^ RI7t7]Pf                  R, R- l4       t4R. R/ lt5R# )2z
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.
)annotationsN)gettext)StringIO)Path)TracebackType)_default_text_stdout)CYGWIN)get_best_encoding)isatty)open_stream)
strip_ansi)term_len)WIN)ClickException)echoVnt
z[?25lz[?25h
c                      ] tR t^+tR)R R l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4       t]
R R l4       t]
R R 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" R# lltR$ R% ltR& R' ltR(tR# )+ProgressBarNc          "     \    V ^8  d   Qh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RRRRR/# )   iterablezcabc.Iterable[V] | Nonelengthz
int | None	fill_charstr
empty_charbar_templateinfo_sephiddenboolshow_etashow_percentbool | Noneshow_positem_show_funcz)t.Callable[[V | None], str | None] | Nonelabel
str | Nonefilezt.TextIO | Nonecolorupdate_min_stepsintwidthreturnNone )formats   "p/Users/tonyclaw/.openclaw/workspace/services/omi-webhook/venv/lib/python3.14/site-packages/click/_termui_impl.py__annotate__ProgressBar.__annotate__,   s     E+ E+)E+ E+ 	E+
 E+ E+ E+ E+ E+ "E+ E+ BE+ E+ E+ E+  !E+" #E+$ 
%E+    c                	   W0n         W@n        WPn        W`n        Wpn        Wn        Wn        Wn        Wn        T;'       g    R V n	        Vf   \        4       pVf   \        4       pWn        Wn        Wn        ^ V n        VV n        V^ 8H  V n        Vf   ^ RIHp V! VR4      pVR8X  d   RpVf0   Vf   \)        R4      h\*        P,                  ! R\/        V4      4      p\1        V4      V n        W n        ^ V n        . V n        V  V  \8        P8                  ! 4       ;V n        V n        RV n        RV n         RV n!        RV n"        RV n#        \I        V P                  4      V n%        RV n&        R# ) N)length_hintziterable or length is requiredzcabc.Iterable[V]F)'r   r   r   r   r    r"   r#   r%   r&   r'   r   r   r)   r*   r+   _completed_intervalsr-   	autowidthoperatorr8   	TypeErrortcastrangeiterr   posavgtimestartlast_eta	eta_knownfinished	max_widthenteredcurrent_itemr
   _is_atty
_last_line)selfr   r   r   r   r   r   r    r"   r#   r%   r&   r'   r)   r*   r+   r-   r8   s   &&&&&&&&&&&&&&&&& r2   __init__ProgressBar.__init__,   sE   & #$(  ( ,++2
<')D |z	
 0$%!
$z>, 2.F|~ @AAvv0%-@H&*8n	 "%)YY[0
T]$#%)"&*tyy)&*r5   c                   V ^8  d   QhRR/# )r   r.   zProgressBar[V]r0   )r1   s   "r2   r3   r4   s   s      > r5   c                	4    R V n         V P                  4        V # )T)rJ   render_progressrN   s   &r2   	__enter__ProgressBar.__enter__s   s    r5   c               (    V ^8  d   QhRRRRRRRR/# )	r   exc_typeztype[BaseException] | None	exc_valuezBaseException | NonetbzTracebackType | Noner.   r/   r0   )r1   s   "r2   r3   r4   x   s2      , ( !	
 
r5   c                	&    V P                  4        R # N)render_finish)rN   rX   rY   rZ   s   &&&&r2   __exit__ProgressBar.__exit__x   s     	r5   c                   V ^8  d   QhRR/# r   r.   zcabc.Iterator[V]r0   )r1   s   "r2   r3   r4      s        *  r5   c                	|    V P                   '       g   \        R 4      hV P                  4        V P                  4       # ).You need to use progress bars in a with block.)rJ   RuntimeErrorrS   	generatorrT   s   &r2   __iter__ProgressBar.__iter__   s0    |||OPP~~r5   c                   V ^8  d   QhRR/# )r   r.   r   r0   )r1   s   "r2   r3   r4      s        !  r5   c                	*    \        \        V 4      4      # r\   )nextrA   rT   s   &r2   __next__ProgressBar.__next__   s     DJr5   c                   V ^8  d   QhRR/# r   r.   r/   r0   )r1   s   "r2   r3   r4      s      t r5   c                	    V P                   '       g   V P                  '       g   R # V P                  P                  \        4       V P                  P                  4        R # r\   )r    rL   r)   write	AFTER_BARflushrT   s   &r2   r]   ProgressBar.render_finish   s4    ;;;dmmm			"		r5   c                   V ^8  d   QhRR/# r   r.   floatr0   )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      # )      ?)rH   minrB   rv   r   rT   s   &r2   pctProgressBar.pct   s=    ===488uT[[%5%5A6;;!<cBBr5   c                   V ^8  d   QhRR/# ru   r0   )r1   s   "r2   r3   r4      s     4 4E 4r5   c                	    V P                   '       g   R # \        V P                   4      \        \        V P                   4      4      ,          # )        )rC   sumrv   lenrT   s   &r2   time_per_iterationProgressBar.time_per_iteration   s.    xxx488}uS]333r5   c                   V ^8  d   QhRR/# ru   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   rH   r   rB   rT   s   &r2   etaProgressBar.eta   s5    ;;"4===**dkkDHH.DEEr5   c                   V ^8  d   QhRR/# r   r.   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   )rG   r,   r   )rN   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R/# 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   rB   r   )rN   rB   s   & r2   
format_posProgressBar.format_pos   s3    $((m;;"Qt{{m$$C
r5   c                   V ^8  d   QhRR/# 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,   rz   rT   s   &r2   
format_pctProgressBar.format_pct   s$    dhhn%b)+B//r5   c                   V ^8  d   QhRR/# 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,   rz   r-   r   r   rH   listr   mathcosrB   join)rN   
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R/# 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"   rG   rH   r   r&   rK   r   r'   r   r   r   rstrip)rN   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/# rn   r0   )r1   s   "r2   r3   r4      s     , , ,r5   c                	   V P                   '       d   R # V P                  '       g[   V P                  V P                  8w  d>   V P                  V n        \	        V P                  V P
                  V P                  R7       R # . pV P                  '       d   ^ R IpV P                  p^ V n	        \        V P                  4       4      p\        ^ VP                  4       P                  V,
          4      pWS8  dL   V P                  e>   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)r    rL   rM   r'   r   r)   r*   r;   shutilr-   r   r   maxget_terminal_sizecolumnsrI   r   
BEFORE_BARr   rr   )	rN   bufr   	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$)C

:&

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RRR/# )r   n_stepsr,   r.   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 # )NTrx   i)rB   r   rH   rD   rF   rE   rC   rG   )rN   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               $    V ^8  d   QhRRRRRR/# )r   r   r,   rK   zV | Noner.   r/   r0   )r1   s   "r2   r3   r4   0  s!     * *c * *T *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)rK   r:   r+   r   rS   )rN   r   rK   s   &&&r2   updateProgressBar.update0  s`      # ,!!W,!$$(=(==NN4445  "()D% >r5   c                   V ^8  d   QhRR/# rn   r0   )r1   s   "r2   r3   r4   J  s       r5   c                	0    R V n         RV n        RV n        R# )FNT)rG   rK   rH   rT   s   &r2   finishProgressBar.finishJ  s     r5   c                   V ^8  d   QhRR/# ra   r0   )r1   s   "r2   r3   r4   O  s     # #+ #r5   c              #  z  "   V P                   '       g   \        R4      hV P                  '       g   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.
rc   N)	rJ   rd   rL   rA   rK   r:   rS   r   r   )rN   rvs   & r2   re   ProgressBar.generatorO  s      |||OPP}}}yy  ii$&!
 ,,1((*A   KKM  " !s   /B;B;B9A8B;)r:   rL   rM   r;   rC   r   r*   rK   r   rJ   rG   r)   r   rH   r    r   r&   rA   r'   rF   r   rI   rB   r"   r#   r%   rE   r+   r-   )N#r   z%(bar)sz  FTNFNNNNr      r\   )__name__
__module____qualname____firstlineno__rO   rU   r^   rf   rk   r]   propertyrz   r   r   r   r   r   r   r   rS   r   r   r   re   __static_attributes__r0   r5   r2   r   r   +   s    E+N
   C C
 4 4
  
0&6,\1,*4
# #r5   r   c               $    V ^8  d   QhRRRRRR/# )r   re   cabc.Iterable[str]r*   r$   r.   r/   r0   )r1   s   "r2   r3   r3   q  s"     ' '' ' 't 'r5   c                   \        4       pVf   \        4       p\        \        P                  4      '       d   \        V4      '       g   \        W V4      # \        P                  ! \        P                  P                  RR4      RR7      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   F)posixTERMos2moreless)dumbemacs)r   r   r
   sysstdin
_nullpagershlexsplitosenvirongetr   _tempfilepager
_pipepagerplatform
startswithtempfilemkstempcloseunlink)re   r*   stdoutpager_cmd_partsr   fdfilenames   &&     r2   pagerr   q  s_   !#F ~#))F6NN&U33 kk"**..""=UKO3i%@@ A	E::	zz~~f!22&U33s||&&u-->F8U4 4 	)fXu--##%LBHHRLi&511 			( &U3
		(		(s   G /G G)c               (    V ^8  d   QhRRRRRRRR/# 	r   re   r   	cmd_partsz	list[str]r*   r$   r.   r!   r0   )r1   s   "r2   r3   r3     s2     ] ]!].7]@K]	]r5   c           	     `   V'       g   R# ^ RI pV^ ,          pVR,          pVP                  V4      pV'       g   R# \        V4      P                  4       pVP                  p^ RIp	\        \        P                  4      p
Vf[   VR8X  dT   \        P                  P                  RR4       RP                  V4       2pV'       g	   RV
R&   R	pMR
V9   g   RV9   d   R	pV	P                  \        V4      .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  	   TP                  P)                  4          TP+                  4         R	#   \"         d     L=\$         d   pTP'                  4        ThRp?ii ; i  \"         d     LSi ; i  \,         d     Ke  i ; i   TP                  P)                  4        M  \"         d     Mi ; i  TP+                  4        i   \,         d     K!  i ; 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.
FNr   r   LESSr7   r   -RTrRreplace)shellr   enverrorstext)r   whichr   absolutename
subprocessdictr   r   r   r   Popenr   PIPEr   r   rp   BrokenPipeError	Exception	terminater   waitKeyboardInterrupt)re   r   r*   r   cmd
cmd_paramscmd_filepathcmd_pathcmd_namer  r  
less_flagscr
  es   &&&            r2   r   r     s    
A,C2J<<$L
 L!**,H}}H rzz
C }V+

vr23CHHZ4H3IJ
CKEJ#"3E	X*$oo 	 	A 77'D!$'GGMM$	 "	GGMMO  G   
 	
  		 % %	GGMMO  		   % s   7F F7 3G F4G F4F4F//F44G 7GGGGH-G76H-7HH-HH-
HH-H*&H-)H**H-c               (    V ^8  d   QhRRRRRRRR/# r   r0   )r1   s   "r2   r3   r3     s,     , ,!,.7,@K,	,r5   c                   V'       g   R# ^ RI pV^ ,          pVP                  V4      pV'       g   R# \        V4      P                  4       p^ RIp^ RIpVP                  4       w  rR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                  \!        V4      V
.4       \$        P&                  ! V	4       \$        P(                  ! V
4       R#   + '       g   i     L[; 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.
FNr7   wbT)r   r  r   r  r  r   r   r   r   r	   r   r   r   rp   encodecallr   OSErrorr   r   r   )re   r   r*   r   r  r  r  r  r   r   r   r
  encodingfs   &&&           r2   r   r     s    
A,C<<$L L!**,H##%LB779D$ ,H	Xt	$Q	'	'1	H%& 
(X12
 	
		( 
(	'   	
		(s0   >!D2(E 2E	EE EE .Fc               (    V ^8  d   QhRRRRRRRR/# )	r   streamzt.TextIOre   r   r*   r$   r.   r/   r0   )r1   s   "r2   r3   r3   *  s,      !3<G	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   rp   )r(  re   r*   r
  s   &&& r2   r   r   *  s'     d#DT r5   c                      ] tR tRtRR R lltR R ltR R lt]P                  R	 R
 l4       t	]P                  R R l4       t	R R lt	Rt
R# )Editori4  Nc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   editorr(   r  zcabc.Mapping[str, str] | Nonerequire_saver!   	extensionr   r.   r/   r0   )r1   s   "r2   r3   Editor.__annotate__5  s<     
# 
#
# +
# 	
#
 
# 

#r5   c                	6    Wn         W n        W0n        W@n        R # r\   )r-  r  r.  r/  )rN   r-  r  r.  r/  s   &&&&&r2   rO   Editor.__init__5  s     ("r5   c                   V ^8  d   QhRR/# r   r0   )r1   s   "r2   r3   r0  A  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IHp R F  pV! V4      f   K  Vu # 	  R# )Nnotepad)r  vi)VISUALEDITOR)zsensible-editorvimnano)r-  r   r   r   r   r   r  )rN   keyr   r  r-  s   &    r2   
get_editorEditor.get_editorA  sg    ;;";;%C$Br	 & 3 6FV}( 7 r5   c                    V ^8  d   QhRRRR/# )r   	filenamesr   r.   r/   r0   )r1   s   "r2   r3   r0  R  s      $6 4 r5   c                	   ^ RI pV P                  4       pRpV P                  '       d:   \        P                  P                  4       pVP                  V P                  4       RP                  R V 4       4      p VP                  V RV 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                  Y8R	7      4      ThRp?ii ; i)
    Nr   c              3  .   "   T F  pR V R 2x  K  	  R# 5i)"Nr0   ).0r   s   & r2   	<genexpr>$Editor.edit_files.<locals>.<genexpr>\  s     J	H!H:Q	s   T)argsr  r  z{editor}: Editing failed)r-  z{editor}: Editing failed: {e})r-  r  )r  r<  r  r   r   copyr   r   r  r  r   _r1   r$  )	rN   r?  r  r-  r   exc_filenamer  	exit_coder  s	   &&       r2   
edit_filesEditor.edit_filesR  s    ")-888jjoo'GNN488$xxJ	JJ	  xq/WD ! A IA~$01888G    	 12999M	s   ;AC D%DDc                    V ^8  d   QhRRRR/# )r   r
  zbytes | bytearrayr.   zbytes | Noner0   )r1   s   "r2   r3   r0  m  s    @@*@|@r5   c                	    R # r\   r0   rN   r
  s   &&r2   editEditor.editl  s    =@r5   c                    V ^8  d   QhRRRR/# )r   r
  r(   r.   r0   )r1   s   "r2   r3   r0  r  s    777
7r5   c                	    R # r\   r0   rP  s   &&r2   rQ  rR  q  s    47r5   c                    V ^8  d   QhRRRR/# )r   r
  zstr | bytes | bytearray | Noner.   zstr | bytes | Noner0   )r1   s   "r2   r3   r0  t  s     - -7 -<N -r5   c                	>   ^ RI pVf   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3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)rA  Nr5   r   z
z	utf-8-sigzutf-8zeditor-)prefixsuffixr!  rb)r   
isinstancebytes	bytearrayendswithr   r  r"  r   r/  r   fdopenrp   utimepathgetatimegetmtimerL  r.  r   openreaddecode)	rN   r
  r   datar   r  r&  	timestampr   s	   &&       r2   rQ  rR  t  s   <&)Dui011DDMM$//s||D&188E{{7+##9T^^#L	2t$$ % HHTBGG,,T2BGG4D4DT4JQ4NOP ((.IOOTG$   RWW%5%5d%;y%H IIdO dD!!QVVX " $	 233 IIdO 99[)11&$?IIdO3 %$$" "! IIdOsO   2J I#B$J $J J I1*%J & J I.	(	J 1J	<J J)r-  r  r/  r.  )NNTz.txt)r   r   r   r   rO   r<  rL  r>   overloadrQ  r   r0   r5   r2   r+  r+  4  sC    
#"4 ZZ@ @ ZZ7 7- -r5   r+  c               (    V ^8  d   QhRRRRRRRR/# )r   urlr   r  r!   locater.   r,   r0   )r1   s   "r2   r3   r3     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)rA  Nc                    V ^8  d   QhRRRR/# )r   rj  r   r.   r0   )r1   s   "r2   r3   open_url.<locals>.__annotate__  s      3 3 r5   c                ^    ^ RI Hp V P                  R4      '       d   V! V R,          4      p V # )rA  )unquotezfile://:   NN)urllib.parserp  r   )rj  rp  s   & r2   _unquote_fileopen_url.<locals>._unquote_file  s'    (>>)$$#b'"C
r5   darwinrc  z-Wr  z	/dev/nullw)stderrexplorerz/select,rE   z/WAITr7   cygstartz-w.zxdg-open)zhttp://zhttps://)r  r   r   r   rc  r  r  r   r   r#  r$  r   r   r`  dirnamer   
webbrowser)	rj  r  rk  r  rs  rG  nullr  r|  s	   &&&      r2   open_urlr~    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                    V ^8  d   QhRRRR/# )r   chr   r.   r/   r0   )r1   s   "r2   r3   r3     s     
 
S 
T 
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)r  s   &r2   _translate_ch_to_excr    s;    	V|!!	V|CCj	V|jr5   win32c                   V ^8  d   QhRR/# r   r.   zcabc.Iterator[int]r0   )r1   s   "r2   r3   r3     s      , r5   c               #     "   Rx  R# 5i)r   Nr9   r0   r0   r5   r2   raw_terminalr    s
     s   	c                    V ^8  d   QhRRRR/# r   r   r!   r.   r   r0   )r1   s   "r2   r3   r3     s     , ,d ,s ,r5   c                d   V '       dB   \         P                  ! \         P                  . \        3,          \        P
                  4      pM@\         P                  ! \         P                  . \        3,          \        P                  4      pV! 4       pVR9   d   W!! 4       ,          p\        V4       V# ) )r     à)r>   r?   Callabler   msvcrtgetwchegetwchr  )r   funcr   s   &  r2   getcharr    ss    > 66!**RW-v~~>D66!**RW-v}}=DV!! $&LBR 	r5   c                   V ^8  d   QhRR/# r  r0   )r1   s   "r2   r3   r3   2  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   rc  filenotermios	tcgetattrttysetraw	tcsetattr	TCSADRAINr   rr   r   error)r&  r   old_settingss      r2   r  r  1  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                    V ^8  d   QhRRRR/# r  r0   )r1   s   "r2   r3   r3   L  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   rd  re  r	   r   r   r
   r   rp   r  )r   r   r  s   &  r2   r  r  L  sk    ^^rR''(9#))(DiPBszz**

  $ $ ^^^s   BB//C 	r\   )FF)8__doc__
__future__r   collections.abcabccabc
contextlibr   r   r   r   rD   typingr>   r   rI  ior   pathlibr   typesr   _compatr   r   r	   r
   r   r   r   r   
exceptionsr   utilsr   TypeVarr   r  r   rq   Genericr   r   r   r   r   r+  r~  r  r   r  contextmanagerr  r  r  r  r0   r5   r2   <module>r     s   #    	  
        )  &       & IIcN77d?JIJIC#!))A, C#L
'T]@,^m m`DN
 <<7 ,^  4r5   