+
     Bi3              
        a 0 t $ ^ RIHt ^ RIHt ^ RIHtHt ^RIH	t	H
t
 ^RIHt  ]! ]! R4       U u. uF  p ]! T 4      R8w  g   K  RT ,          R	3NK  	  up ]! ]]! ^ ^4      4       U u. uF  q R8w  g   K  T R
3NK  	  up ,           ]! R4       U u. uF;  p ]! T 4      P+                  4       '       g   K!  ]! T 4      R8w  g   K0  RT ,          R
3NK=  	  up ,           . R6O,           4      tR]R&   RtRtRt ! R R]	P6                  4      t ! R R]	P6                  4      t ! R R]	P6                  4      t ! R R]	P6                  4      t ! R R]	P6                  4      t  ! R R]	P6                  4      t! ! R R]	P6                  4      t" ! R R]	PF                  4      t$ ! R  R!]	P6                  4      t% ! R" R#]	P6                  4      t& ! R$ R%]	P6                  4      t' ! R& R']	P6                  4      t( ! R( R)]	P6                  4      t) ! R* R+]	P6                  4      t* ! R, R-]	P6                  4      t+ ! R. R/]	P6                  4      t, ! R0 R1]	P6                  4      t-] ! R2 R3]4      4       t.R4t/R5# u up i u up i u up i )7    )annotations)contextmanager)	dataclassfield)commandsinput)Reader   \z\%03ozisearch-endzisearch-add-character'tuple[tuple[KeySpec, CommandName], ...]isearch_keymap rfc                  "    ] tR t^8tR R ltRtR# )next_historyc                   V ^8  d   QhRR/#    returnNone )formats   "0/usr/lib/python3.14/_pyrepl/historical_reader.py__annotate__next_history.__annotate__9        & &D &    c                	    V P                   pVP                  \        VP                  4      8X  d   VP	                  R 4       R# VP                  VP                  ^,           4       R# )zend of history listN)readerhistoryilenhistoryerrorselect_itemselfr   s   & r   donext_history.do9   sC    KK::QYY'GG)*	ajj1n%r   r   N__name__
__module____qualname____firstlineno__r(   __static_attributes__r   r   r   r   r   8       & &r   r   c                  "    ] tR t^AtR R ltRtR# )previous_historyc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   previous_history.__annotate__B   r   r   c                	    V P                   pVP                  ^ 8X  d   VP                  R4       R# VP                  VP                  ^,
          4       R# )r   zstart of history listN)r    r!   r$   r%   r&   s   & r   r(   previous_history.doB   s:    KK::?GG+,	ajj1n%r   r   Nr*   r   r   r   r2   r2   A   r0   r   r2   c                  "    ] tR t^JtR R ltRtR# )history_search_backwardc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   $history_search_backward.__annotate__K   s     & &D &r   c                	B    V P                   pVP                  R R7       R# )FforwardsNr    search_nextr&   s   & r   r(   history_search_backward.doK   s    KK	u%r   r   Nr*   r   r   r   r8   r8   J   s    & &r   r8   c                  "    ] tR t^PtR R ltRtR# )history_search_forwardc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   #history_search_forward.__annotate__Q   s     % %D %r   c                	B    V P                   pVP                  R R7       R# )Tr<   Nr>   r&   s   & r   r(   history_search_forward.doQ   s    KK	t$r   r   Nr*   r   r   r   rB   rB   P   s    % %r   rB   c                  "    ] tR t^VtR R ltRtR# )restore_historyc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   restore_history.__annotate__W   s      D r   c                	f   V P                   pVP                  \        VP                  4      8w  d   VP	                  4       VP                  VP                  ,          8w  dO   \        VP                  VP                  ,          4      Vn        \        VP                  4      Vn        R Vn        R# R# R# TN)	r    r!   r"   r#   get_unicodelistbufferposdirtyr&   s   & r   r(   restore_history.doW   ss    KK::QYY'}}!))AJJ"77		!** 56AHH 8 (r   r   Nr*   r   r   r   rH   rH   V   s     r   rH   c                  "    ] tR t^`tR R ltRtR# )first_historyc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   first_history.__annotate__a   s     # #D #r   c                	<    V P                   P                  ^ 4       R# )r   N)r    r%   r'   s   &r   r(   first_history.doa   s    "r   r   Nr*   r   r   r   rT   rT   `   s    # #r   rT   c                  "    ] tR t^etR R ltRtR# )last_historyc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   last_history.__annotate__f   s     : :D :r   c                	v    V P                   P                  \        V P                   P                  4      4       R # N)r    r%   r"   r#   rX   s   &r   r(   last_history.dof   s#    DKK$7$7 89r   r   Nr*   r   r   r   r[   r[   e   s    : :r   r[   c                  "    ] tR t^jtR R ltRtR# )operate_and_get_nextc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   !operate_and_get_next.__annotate__k   s     < <D <r   c                	^    V P                   P                  ^,           V P                   n        R# )   N)r    r!   r   rX   s   &r   r(   operate_and_get_next.dok   s    #';;#7#7!#; r   r   Nr*   r   r   r   rb   rb   j   s    < <r   rb   c                  "    ] tR t^otR R ltRtR# )yank_argc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   yank_arg.__annotate__p   s      D r   c                	2   V P                   pVP                  V P                  J d   V;P                  ^,          un        M^ Vn        VP                  VP                  8  d   VP                  R4       R# VP                  R4      pVP                  VP                  VP                  ,
          ^,
          4      P                  4       pV\        V4      ) 8  g   V\        V4      8  d   VP                  R4       R# W2,          pVP                  pVP                  ^ 8  d   \        VP                  4      pM^ p\        V4      WQP                  V,
          VP                  % WAn        V;P                  \        V4      V,
          ,          un        RVn        R# )rf   zbeginning of history listNzno such argT)r    last_command	__class__
yank_arg_ir!   r$   get_argget_itemsplitr"   rO   yank_arg_yankedrN   rP   rQ   )r'   r   awordswbos   &      r   r(   yank_arg.dop   s   KK>>T^^+LLALAL::$GG/0IIbM

1::4q89??AE
{?a3u:oGGM"HHH<<!A%%&AA#Aw%%!)aee	Q!r   r   Nr*   r   r   r   ri   ri   o   s     r   ri   c                  "    ] tR t^tR R ltRtR# )forward_history_isearchc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   $forward_history_isearch.__annotate__        , ,D ,r   c                	    V P                   p\        Vn        VP                  VP                  3Vn        R Vn        RVn        VP                  VP                  4       R# )r   TN)
r    ISEARCH_DIRECTION_FORWARDSisearch_directionr!   rP   isearch_startisearch_termrQ   push_input_transisearch_transr&   s   & r   r(   forward_history_isearch.do   sG    KK8**aee+	1??+r   r   Nr*   r   r   r   r|   r|          , ,r   r|   c                  "    ] tR t^tR R ltRtR# )reverse_history_isearchc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   $reverse_history_isearch.__annotate__   r   r   c                	    V P                   p\        Vn        R Vn        RVn        VP                  VP                  4       VP                  VP                  3Vn	        R# )Tr   N)
r    ISEARCH_DIRECTION_BACKWARDSr   rQ   r   r   r   r!   rP   r   r&   s   & r   r(   reverse_history_isearch.do   sG    KK9	1??+**aee+r   r   Nr*   r   r   r   r   r      r   r   r   c                  "    ] tR t^tR R ltRtR# )isearch_cancelc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   isearch_cancel.__annotate__   s      D r   c                	    V P                   p\        Vn        VP                  4        VP	                  VP
                  ^ ,          4       VP
                  ^,          Vn        RVn        R# )r   TN)r    ISEARCH_DIRECTION_NONEr   pop_input_transr%   r   rP   rQ   r&   s   & r   r(   isearch_cancel.do   sK    KK4		aooa()"r   r   Nr*   r   r   r   r   r      s     r   r   c                  "    ] tR t^tR R ltRtR# )isearch_add_characterc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   "isearch_add_character.__annotate__   s      D r   c                	Z   V P                   pVP                  pV;P                  V P                  R,          ,          un        RVn        VP
                  \        VP                  4      ,           ^,
          pW#V^,            VP                  R,          .8w  d   VP                  4        R# R# )rf   TNrm   )r    rO   r   eventrQ   rP   r"   isearch_next)r'   r   rx   ps   &   r   r(   isearch_add_character.do   sx    KKHH	$**R.(EEC''!+Q<ANN2.//NN 0r   r   Nr*   r   r   r   r   r      s     r   r   c                  "    ] tR t^tR R ltRtR# )isearch_backspacec                   V ^8  d   QhRR/# r   r   )r   s   "r   r   isearch_backspace.__annotate__   s     ) )D )r   c                	    V P                   p\        VP                  4      ^ 8  d   VP                  RR Vn        RVn        R# VP	                  R4       R# )r   NTznothing to ruboutrm   )r    r"   r   rQ   r$   r&   s   & r   r(   isearch_backspace.do   sB    KKq~~"^^CR0ANAGGG'(r   r   Nr*   r   r   r   r   r      s    ) )r   r   c                  "    ] tR t^tR R ltRtR# )isearch_forwardsc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   isearch_forwards.__annotate__         D r   c                	T    V P                   p\        Vn        VP                  4        R # r_   )r    r   r   r   r&   s   & r   r(   isearch_forwards.do   s    KK8	r   r   Nr*   r   r   r   r   r           r   r   c                  "    ] tR t^tR R ltRtR# )isearch_backwardsc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   isearch_backwards.__annotate__   r   r   c                	T    V P                   p\        Vn        VP                  4        R # r_   )r    r   r   r   r&   s   & r   r(   isearch_backwards.do   s    KK9	r   r   Nr*   r   r   r   r   r      r   r   r   c                  "    ] tR t^tR R ltRtR# )isearch_endc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   isearch_end.__annotate__   s      D r   c                	    V P                   p\        Vn        VP                  P	                  4        VP                  4        R Vn        R# rL   )r    r   r   consoleforgetinputr   rQ   r&   s   & r   r(   isearch_end.do   s6    KK4				r   r   Nr*   r   r   r   r   r      s     r   r   c                    a  ] tR t^t$ Rt]! ]R7      tR]R&   ^ t	R]R&   Rt
R]R	&   ]! ]R7      tR
]R&   RtR]R&   ]tR]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ^ tR]R&   RtR]R&   R V 3R lltR V 3R lltR R ltR R lt]R  V 3R! ll4       t]R" R# l4       tR$ V 3R% lltR& V 3R' lltR( R) ltR* R+ ltR, V 3R- lltR.t V ;t!# )/HistoricalReaderzOAdds history support (with incremental history searching) to the
Reader class.
)default_factoryz	list[str]r#   intr!   Nz
int | Noner   zdict[int, str]transient_historyr   strr   r   F)initztuple[int, int]r   zinput.KeymapTranslatorr   rp   rt   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   HistoricalReader.__annotate__   s     
 
t 
r   c                	  < \         SV `  4        \        \        \        \
        \        \        \        \        \        \        \        \        \        \        \        \         \"        \$        3 FC  pWP&                  VP(                  &   WP&                  VP(                  P+                  R R4      &   KE  	  V P,                  V P.                  3V n        \2        P4                  ! \6        \        \        R7      V n        R# )_-)invalid_clscharacter_clsN)super__post_init__r   r2   rH   rT   r[   ri   r|   r   r   r   r   r   r   r   rb   r8   rB   r   r+   replacer!   rP   r   r   KeymapTranslatorr   r   )r'   cro   s   & r   r   HistoricalReader.__post_init__   s    ##!! #"%
A( )*MM!**%:;MM!**,,S#67+
, "]]DHH4"33CX
r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r     s     
 
 G 
r   c                	.   < \         SV `  4       R,           # )\C-n))r   znext-history)z\C-pzprevious-history)z\C-ozoperate-and-get-next)\C-rzreverse-history-isearch)\C-szforward-history-isearch)z\M-rzrestore-history)z\M-.zyank-arg)z\<page down>history-search-forward)z\x1b[6~r   )z
\<page up>history-search-backward)z\x1b[5~r   )r   collect_keymapr'   ro   s   &r   r   HistoricalReader.collect_keymap  s    w%' +
 
 	
r   c                    V ^8  d   QhRRRR/# )r   ir   r   r   r   )r   s   "r   r   r     s     	3 	3S 	3T 	3r   c                	d   V P                  4       V P                  V P                  &   V P                  P                  V4      pVf"   V P                  V,          P                  4       p\        V4      V n        Wn        \        V P                  4      V n	        RV n
        RV P                  n        R # )NT)rM   r   r!   getr#   rstriprN   rO   r"   rP   rQ   last_refresh_cacheinvalidated)r'   r   bufs   && r   r%   HistoricalReader.select_item  s    040@0@0Bt}}-$$((+;,,q/((*C3it{{#
.2+r   c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r     s     E E# E# Er   c                	    V\        V P                  4      8w  d-   V P                  P                  WP                  V,          4      # V P                  P                  WP	                  4       4      # r_   )r"   r#   r   r   rM   )r'   r   s   &&r   rr   HistoricalReader.get_item  sR    DLL!!))--aaAA))--a1A1A1CDDr   c                   V ^8  d   QhRR/# r   r   SimpleContextManagerr   )r   s   "r   r   r   $  s      - r   c           	   #  	   <"   \         SV `  4       ;_uu_ 4        V P                  4       ;_uu_ 4        R x  R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; i5ir_   )r   suspendsuspend_historyr   s   &r   r   HistoricalReader.suspend#  s?     W_ 4 4 6 6 !7 6 6s2   A1AA
	A 
A1
AAA.	(	A1c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   )  s     * *!5 *r   c              #  	   "    V P                   R ,          pV P                   R  Rx  WP                   R &   R#   XT P                   R &   i ; i5i)NNNN)r#   )r'   old_historys   & r   r    HistoricalReader.suspend_history(  s=     	*,,q/KQ)LLOkDLLOs   A$8 AA		Ac                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   1  s       r   c                	  < \         SV `  4         / V n        V P                  e   V P                  \	        V P
                  4      8  d   V P                  V n        \        V P
                  V P                  ,          4      V P                  R&   \	        V P                  4      V n	        RV P                  \	        V P
                  4      &   M\	        V P
                  4      V n        R V n        R #    T P                  4        h ; i)Nr   r   )r   preparer   r   r"   r#   r!   rN   rO   rP   restorer   s   &r   r   HistoricalReader.prepare1  s    	%'D"  ,1B1BSEV1V $ 1 1!%dll43D3D&E!FAt{{+<>&&s4<<'89 #DLL 1 $D	LLNs   CC. .Dc               $    V ^8  d   QhRRRRRR/# )r   linenor   cursor_on_lineboolr   r   r   )r   s   "r   r   r   A  s!     > > >d >s >r   c                	   < V'       dE   V P                   \        8w  d0   R V P                   \        8H  ,          pRV: RV P                  : R2# \        SV `  W4      # )rf(z	-search `z') )r   r   r   r   r   
get_prompt)r'   r   r   dro   s   &&& r   r   HistoricalReader.get_promptA  sK    d448NNT++/IIJA*+T->->??7%f==r   c                    V ^8  d   QhRRRR/# )r   r=   r   r   r   r   )r   s   "r   r   r   H  s     3% 3%t 3% 3%r   c                  V P                   pV P                  4       pV P                  pVP                  R^ V4      pW5^,           V p\	        V4      p\	        V4      p^ pV\	        V P
                  4      8  d   \	        V P                  V4      4      pV'       d
   W(8X  d   RpM
V'       g   Rp V'       d!   V\	        V P
                  4      ^,
          8  p	MV^ 8H  p	V	'       d;   V'       d    V'       g   ^ V n         . V n        RV n        R# V P                  R4       R# YA'       d   ^MR,          pV P                  V4      pV'       g   V P                  V4       R# ^ p
\        VP                  RR7      4       FO  w  rVP                  V4      '       d"   V P                  V4       W*,           V n          R# V
\	        V4      ,          p
KQ  	  EK!  )zSearch history for the current line contents up to the cursor.

Selects the first item found. If nothing is under the cursor, any next
item in history is selected.

FT	not foundN)keependsrm   )rP   rM   r!   rfindr"   r#   rr   rO   rQ   r$   r%   	enumerate
splitlines
startswith)r'   r=   rP   shistory_indexnl_indexprefixmatch_prefixlen_itemout_of_boundslen_accr   lines   &$           r   r?   HistoricalReader.search_nextH  sy    hh 774C(a<$&k6{3t||,,4==78H L L -T\\1BQ1F F - 2L DH"$DK!%DJ  JJ{+(Q2Mm,A  /G$Q\\4\%@A??6**$$]3"}DH3t9$ Br   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   }  s      d r   c                	   V P                   pV P                  pV P                  pV P                  4       pV P                  \
        8H  p V'       d   VP                  W^,           4      pM*VP                  V^ V\        V4      ,           ^,
          4      pVR8w  d   V P                  V4       W n        R# V'       d"   V\        V P                  4      ^,
          8  g   V'       g   V^ 8X  d   V P                  R4       R# V'       d   V^,          pV P                  V4      pRpK  V^,          pV P                  V4      p\        V4      pEK  )rf   Nr  rm   )r   rP   r!   rM   r   r   findr  r"   r%   r#   r$   rr   )r'   str   r   r  r=   s   &     r   r   HistoricalReader.isearch_next}  s   HHMM))-GGFF21u%GGB1s2w;?3Bw  #qC$5$998PQUVPV

;'FAa(AAFAa(AAAr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s     % % %r   c                	h  < \         SV `  4        V P                  4       pV P                  P	                  4        FA  w  r#V\        V P                  4      8  g   K!  W P                  8w  g   K3  W0P                  V&   KC  	  V'       d,   \        '       d   V P                  P                  V4       R # R # R # r_   )
r   finishrM   r   itemsr"   r#   r!   should_auto_add_historyappend)r'   retr   tro   s   &   r   r  HistoricalReader.finish  s     **002DA3t||$$mm);"#Q 3 **LL$ +3r   )rO   rQ   r!   r   r   r   rP   r   )"r+   r,   r-   r.   __doc__r   rN   r#   __annotations__r!   r   dictr   r   r   r   r   r   rp   rt   r   r   r%   rr   r   r   r   r   r   r?   r   r  r/   __classcell__)ro   s   @r   r   r      s     t4GY4Hc#L*#(-d(C~CL#3s3%*%6M?6,1u,=M)=JOS
 
:
 
	3E   * *  > >3%j8% %r   r   TN))z\\zself-insert)r   zisearch-backwards)r   zisearch-forwards)z\C-cisearch-cancel)z\C-gr'  )z\<backspace>zisearch-backspace)0__conditional_annotations__
__future__r   
contextlibr   dataclassesr   r   r   r   r   r    r	   typesr   KeySpecCommandNametuplerangechrmapisalphar   r$  r   r   r   Commandr   r2   r8   rB   rH   rT   r[   FinishCommandrb   ri   r|   r   r   r   r   r   r   r   r   r  )r   r(  s   0@r   <module>r6     sj  ( # " % (   	 ;@,1#JIJq#a&D."hlM"JI-0eBn-ES-Ed#"#-EST sAq6>> 	0 #A$ 	0A./;7 $  !   &8## &&x'' &&h.. &%X-- %h&& #H$$ #
:8## :
<811 <
x 8,h.. ,,h.. ,X%% H,, )(( )x'' (( (""  J%v J% J%Z  C JSs)   I-I-+I2
8I2
I7
5
I7
I7
