+
    ^|iH                     d   R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHt ^ RIHt ^RIH t! ^RIH"t" ^RI#H$t$ ^ RI%H&t& ^ RI'H(t( R.t)] ! R R4      4       t*] ! R R]*4      4       t+] ! R R]*4      4       t,R R lt-. ]!P\                  P_                  4        U Uu. uF  w  r],! W.R4      NK  	  upp O]!P`                  P_                  4        U Uu. uF  w  r],! W.R4      NK  	  upp O],! ]!Pb                  R.R4      N],! ]!Pd                  R.R 4      N],! ]!Pf                  R.R!4      N],! ]!Ph                  R.R"4      N],! ]!Pj                  R#.R$4      N],! ]!Pj                  R%.R&4      N],! ]!Pj                  R'.R(4      N],! ]!Pj                  R.R)4      N],! ]!Pj                  R.R*4      N],! ]!Pl                  R+.R,4      N],! ]!Pl                  R+.R-4      N],! ]!Pl                  R+.R.4      N],! ]!Pl                  R+.R/4      N],! ]!Pl                  R+.R04      Nt7],! ]"Pp                  R1.R24      ],! ]"Pp                  R3.R24      ],! ]"Pr                  R4.R24      ],! ]"Pr                  R5.R64      ],! ]"Pt                  R7R8.R24      ],! ]"Pv                  R9.R24      ],! ]"Px                  R7.R:4      ],! ]"Px                  R;.R:4      ],! ]"Pz                  R<.R=4      ],! ]"P|                  R>.R?4      ],! ]"P~                  R<.R@4      ],! ]"P                  R>.RA4      ],! ]"P                  R7R5.R24      ],! ]"P                  RB.R24      ],! ]"P                  R7RC.R:4      ],! ]"P                  R+.RD4      ],! ]"P                  R5.RE4      .tFRF]P                  RG]P                  RH]P                  RI]P                  RJ]P                  RK]P                  /P_                  4        U Uu. uF  w  r],! W.RL4      NK  	  upp tMR{]P                  R|]P                  R}]P                  R~]P                  R]P                  R]P                  R]P                  R]P                  R]P                  R]P                  /
P_                  4        UUu. uF  w  r!],! V]V! V4      RL4      NK  	  upptWRM RN ltXRRO RP lltYRQ tZRR t[RS t\RT t]RU t^RV t_RW t`RX taRY tbRZ tcR[ tdR\ teR] tfR^ tg]P                  R_8X  d   ^ R`IiHjtj ^ RaIkHltlHmtmHntn ]&Rb 4       toM]&Rc 4       to],! ]\Rd.Re4      ],! ]ZR7Rd.Rf4      ],! ]dRg.4      ],! ]^Rh.Ri4      ],! ]_Rj.Ri4      ],! ]`Rk.Rl4      ],! ]aRm.Rn4      ],! ]bRm.Ro4      ],! ]cRp.Rq4      ],! ]eRr.Rs4      ],! ]fRt.Ru4      ],! ]gRv.Rn4      .]7O]FO],! ]Rw.Rx4      N],! ]oRy.Rz4      N]MO]WOtp]"P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  .tyR# u upp i u upp i u upp i u uppi )zU
Module to define and register Terminal IPython shortcuts with
:mod:`prompt_toolkit`
N)	dataclass)AnyOptionalListCallable)get_appKeyBindings)KeyPressEvent)named_commands)!display_completions_like_readline)	InputModeViState	Condition)get_ipython)
auto_match)auto_suggest)filter_from_string)undoc)DEFAULT_BUFFERcreate_ipython_shortcutsc                   ,   a  ] tR t^&t o V 3R ltRtV tR# )BaseBindingc                Z   < V ^8  d   Qh/ S[ S[.S[3,          ;R&   S[S[,          ;R&   # )   commandkeys)r   r   r   r   str)format__classdict__s   "E/usr/lib/python3/dist-packages/IPython/terminal/shortcuts/__init__.py__annotate__BaseBinding.__annotate__&   s,     }os*++  s)O      N__name__
__module____qualname____firstlineno____annotate_func____static_attributes____classdictcell__r!   s   @r"   r   r   &         r%   r   c                   ,   a  ] tR t^,t o V 3R ltRtV tR# )RuntimeBindingc                &   < V ^8  d   Qh/ S[ ;R&   # )r   filterr   )r    r!   s   "r"   r#   RuntimeBinding.__annotate__,   s      r%   r&   Nr'   r/   s   @r"   r2   r2   ,   r0   r%   r2   c                   6   a  ] tR t^1t o RtR tV 3R ltRtV tR# )BindingNc                p    V P                   '       d   \        V P                   4      V n        R # R V n        R # N)	conditionr   r4   )selfs   &r"   __post_init__Binding.__post_init__9   s"    >>>,T^^<DKDKr%   c                6   < V ^8  d   Qh/ S[ S[,          ;R&   # )r   r:   )r   r   )r    r!   s   "r"   r#   Binding.__annotate__1   s      }# r%   )r4   )	r(   r)   r*   r+   r:   r<   r,   r-   r.   r/   s   @r"   r7   r7   1   s       $I  r%   r7   c                $    V ^8  d   QhR\         /# )r   handlerr   )r    s   "r"   r#   r#   @   s     # #x #r%   c                     V P                   P                  R 4      pV P                  pV^ ,          p\        V4      ^8  d   VR,          pV RV R V 2# V RV 2# ).:)r)   splitr(   len)rA   partsnamepackagefinal_modules   &    r"   create_identifierrL   @   sh    $$S)EDAhG
5zA~Ry!L>4&11!D6""r%   z>focused_insert & auto_match & followed_by_closing_paren_or_endz8focused_insert & auto_match & preceded_by_raw_str_prefix"z~focused_insert & auto_match & not_inside_unclosed_string & preceded_by_paired_double_quotes & followed_by_closing_paren_or_end'z~focused_insert & auto_match & not_inside_unclosed_string & preceded_by_paired_single_quotes & followed_by_closing_paren_or_endzXfocused_insert & auto_match & not_inside_unclosed_string & preceded_by_two_double_quoteszXfocused_insert & auto_match & not_inside_unclosed_string & preceded_by_two_single_quotes)z=focused_insert & auto_match & followed_by_closing_round_paren]z9focused_insert & auto_match & followed_by_closing_bracket}z7focused_insert & auto_match & followed_by_closing_bracez6focused_insert & auto_match & followed_by_double_quotez6focused_insert & auto_match & followed_by_single_quote	backspacez_focused_insert & preceded_by_opening_round_paren & auto_match & followed_by_closing_round_parenzWfocused_insert & preceded_by_opening_bracket & auto_match & followed_by_closing_bracketzSfocused_insert & preceded_by_opening_brace & auto_match & followed_by_closing_bracezQfocused_insert & preceded_by_double_quote & auto_match & followed_by_double_quotezQfocused_insert & preceded_by_single_quote & auto_match & followed_by_single_quoteendz@has_suggestion & default_buffer_focused & emacs_like_insert_modec-ezc-frightz_has_suggestion & default_buffer_focused & emacs_like_insert_mode & is_cursor_at_the_end_of_lineescapefzc-rightz;has_suggestion & default_buffer_focused & emacs_insert_modedeletezc-upzQnavigable_suggestions & ~has_line_above & has_suggestion & default_buffer_focusedzc-downzQnavigable_suggestions & ~has_line_below & has_suggestion & default_buffer_focusedz?has_line_above & navigable_suggestions & default_buffer_focusedz?has_line_below & navigable_suggestions & default_buffer_focusedzc-leftdownz/default_buffer_focused & emacs_like_insert_modez]is_cursor_at_the_end_of_line & default_buffer_focused & emacs_like_insert_mode & pass_throughzc-azc-bzc-kzc-wzc-yzc-_z0vi_insert_mode & default_buffer_focused & ebivimc                0    V ^8  d   QhR\         R\        /# )r   bindingsbinding)r
   r7   )r    s   "r"   r#   r#   A  s      +  r%   c                     V P                   ! VP                  / VP                  e   RVP                  /M/ B ! VP                  4       R # )Nr4   )addr   r4   r   )r[   r\   s   &&r"   add_bindingr_   A  s?    LL	)0)CHgnn% oor%   c                $    V ^8  d   QhR\         /# )r   returnr	   )r    s   "r"   r#   r#   H  s     4 4+ 4r%   c                  a  \        4       pT;'       g    . p\         F|  pRpV F\  pVP                  VP                  8X  g   K   VP                  VP                  8X  g   K=  VP                  VP                  8X  g   KZ  Rp M	  V'       d   Kq  \        W#4       K~  	  V 3R lpR pS P                  R8X  d@   S P                  '       d.   \        P                  \        n        \        Wg4      \        n        V# )a  Set up the prompt_toolkit keyboard shortcuts for IPython.

Parameters
----------
shell: InteractiveShell
    The current IPython shell Instance
skip: List[Binding]
    Bindings to skip.

Returns
-------
KeyBindings
    the keybinding instance for prompt toolkit.

FTc                 t   < \        4       pSP                  Vn        SP                  Vn        V P                  # r9   )r   ttimeoutlen
timeoutlen_input_mode)r;   appshells   & r"   get_input_mode0create_ipython_shortcuts.<locals>.get_input_modeh  s0    i++))r%   c                    \         P                  ^\         P                  ^/P                  V^4      pRP	                  V4      p\
        P                  P                  V4       \
        P                  P                  4        Wn	        R# )r   z[{} qN)
r   
NAVIGATIONREPLACEgetr    sysstdoutwriteflushrf   )r;   modeshapecursors   &&  r"   set_input_mode0create_ipython_shortcuts.<locals>.set_input_modeo  sa    %%q)*;*;Q?CCD!L##E*

 

r%   vi)r
   KEY_BINDINGSr   r4   r   r_   editing_modemodal_cursorr   INSERTr   rf   property
input_mode)rh   skipkbr\   skip_this_oneto_skipri   rv   s   f&      r"   r   r   H  s      
B::2DG7??2NNgnn4LLGLL0 $  B      T!e&8&8&8'..%nEIr%   c                    \        4       p\        V P                  V P                  P                  V4       V P                  P	                  4        R# )zReformat code and execute itN)r   reformat_text_before_cursorcurrent_bufferdocumentvalidate_and_handleeventrh   s   & r"   reformat_and_executer     s>    MEe22;;U 
,,.r%   c                    V P                  \        VP                  R VP                   4      4      p VP	                  V4      pV P                  V4       R #   \         d   pT P                  T4        R p?R # R p?ii ; ir9   )delete_before_cursorrG   textcursor_positionreformat_handlerinsert_text	Exception)bufferr   rh   r   formatted_textes   &&&   r"   r   r     sm    &&s8==9S8;S;S+T'UVD!//5>* !4  !s   "A A>"A99A>c                     \        4       p\        VR R4      '       d   VP                  V4      ! V 4      # \        V4      ! V 4      # )handle_returnN)r   getattrr   newline_or_execute_outerr   s   & r"   #handle_return_or_newline_or_executer     s>    MEuot,,""5)%00'.u55r%   c                    a  V 3R  lpV# )c                  < V P                   pVP                  pVP                  '       dD   VP                  P                  pV'       d   VP	                  V4       R# VP                  4        R# VP                  ^8X  d   VP                  pMVP                  RVP                   pS	P                  V4      w  rVVP                  VP                  R pRpVP                  4       '       g   \        WS	4       RpVP                  '       gp   VP                  VP                  VP                  4       ,
          8  g@   S	P                  '       d   VP!                  RV,           4       R# VP!                  R4       R# VR8w  d9   VP"                  '       d'   V'       g   \        WS	4       VP%                  4        R# S	P                  '       d   VP!                  RV,           4       R# VP!                  R4       R# )zCWhen the user presses return, insert a newline or execute the code.NFT

incomplete)r   r   complete_statecurrent_completionapply_completioncancel_completion
line_countr   r   check_completestripr   on_last_linecursor_position_rowempty_line_count_at_the_end
autoindentr   accept_handlerr   )
r   bdcc
check_textstatusindentafter_cursorreformattedrh   s
   &        r"   newline_or_execute4newline_or_execute_outer.<locals>.newline_or_execute  s     JJ!!44B""2&  ##% <<1J 3!"3"34J--j9 vva//12!!##'e4KNNN$$q7T7T7V(VVdVm,  d#l"(8(8(8+A%8!!#dVm,d#r%   r&   )rh   r   s   f r"   r   r     s    .$` r%   c                :    V P                   P                  4        R# )z
Control-P in vi edit mode on readline is history next, unlike default prompt toolkit.

If completer is open this still select previous completion.
N)r   auto_upr   s   &r"   'previous_history_or_previous_completionr     s     
  "r%   c                :    V P                   P                  4        R# )z
Control-N in vi edit mode on readline is history previous, unlike default prompt toolkit.

If completer is open this still select next completion.
N)r   	auto_downr   s   &r"   next_history_or_next_completionr     s     
""$r%   c                f    V P                   pVP                  '       d   VP                  4        R# R# )zDismiss completionN)r   r   r   r   r   s   & r"   dismiss_completionr     s*    A	 r%   c                    V P                   pVP                  '       d   VP                  4        R# VP                  4        R# )zReset bufferN)r   r   r   resetr   s   & r"   reset_bufferr     s.    A			r%   c                    V P                   P                  P                  '       d   V P                   P                  4        R# V P                  P
                  P                  \        4       R# )zReset search bufferN)r   r   r   r   rg   layoutfocusr   r   s   &r"   reset_search_bufferr     sD    $$)))""$		~.r%   c                :    V P                   P                  4        R# )zSuspend to backgroundN)rg   suspend_to_backgroundr   s   &r"   suspend_to_bgr     s    	II##%r%   c                    \        \        RR4      pVe(   \        P                  ! ^ \        P                  4       R# \
        P                  ! R4       R# )z
Quit application with ``SIGQUIT`` if supported or ``sys.exit`` otherwise.

On platforms that support SIGQUIT, send SIGQUIT to the current process.
On other platforms, just exit the process with a message.
SIGQUITNQuit)r   signaloskillr   ro   exit)r   sigquits   & r"   quitr     s6     fi.G
6>>"r%   c                <    V P                   P                  R4       R# )zIndent bufferN    )r   r   r   s   &r"   indent_bufferr   
  s    	$$W-r%   c                b   \        4       pVP                  pV P                  pVP                  pVP                  '       d   VP                  4        VP                  RVP                   R,           pVP                  V4      w  rgTP                  RRT;'       g    ^ ,          ,           RR7       R# )a`  Insert a newline after the cursor indented appropriately.

Fancier version of former ``newline_with_copy_margin`` which should
compute the correct indentation of the inserted line. That is to say, indent
by 4 extra space after a function definition, class definition, context
manager... And dedent by 4 space after ``pass``, ``return``, ``raise ...``.
Nr    F)move_cursor)
r   input_transformer_managerr   r   r   r   r   r   r   r   )r   rh   inputsplitterr   r   r   _r   s   &       r"   newline_autoindentr     s     ME33MA	

A	66%A%%&-D,,T2IAMM$#1-.EMBr%   c                N    V P                   P                  P                  4        R# )z'Open code from input in external editorN)rg   r   open_in_editorr   s   &r"   open_input_in_editorr   #  s    	II++-r%   win32)TryNext)ClipboardEmptytkinter_clipboard_getwin32_clipboard_getc                      \        4       pT P                  P                  TP                  RR4      4       R #   \         d(     \        4       p LE  \        \        3 d      R # i ; i\         d     R # i ; i)N	r   )r   r   r   r   r   r   replace)r   r   s   & r"   	win_paster   0  sp    	&(D 	((dG)DE  	,.^,  		s3   
9 A8
AA'"A8&A''A83A87A8c                    R# )zStub used on other platformsNr&   r   s   &r"   r   r   ?  s     	r%   enterz5default_buffer_focused & ~has_selection & insert_modez>default_buffer_focused & ~has_selection & insert_mode & ebivimzc-\zc-pz'vi_insert_mode & default_buffer_focusedzc-nzc-gz(default_buffer_focused & has_completionszc-cdefault_buffer_focusedsearch_buffer_focusedzc-zsupports_suspendtabzLdefault_buffer_focused & ~has_selection & insert_mode & cursor_in_leading_wszc-oz*default_buffer_focused & emacs_insert_modef2zc-izireadline_like_completions & default_buffer_focused & ~has_selection & insert_mode & ~cursor_in_leading_wszc-vz1default_buffer_focused & ~vi_mode & is_windows_os)c-xrT   )r   r   )rV   r   )rV   c)rV   r   )rV   h)rV   l)rV   u)rV   y)rV   rC   r9   )z__doc__r   r   ro   warningsdataclassesr   typingr   r   r   collections.abcr   "prompt_toolkit.application.currentr   prompt_toolkit.key_bindingr
   (prompt_toolkit.key_binding.key_processorr   #prompt_toolkit.key_binding.bindingsr   nc.prompt_toolkit.key_binding.bindings.completionr   #prompt_toolkit.key_binding.vi_stater   r   prompt_toolkit.filtersr   IPython.core.getipythonr    r   matchr   filtersr   IPython.utils.decoratorsr   prompt_toolkit.enumsr   __all__r   r2   r7   rL   auto_match_parensitemsauto_match_parens_raw_stringdouble_quotesingle_quotedocstring_double_quotesdocstring_single_quotes	skip_overdelete_pairAUTO_MATCH_BINDINGSaccept_or_jump_to_endacceptaccept_wordaccept_tokendiscardswap_autosuggestion_upswap_autosuggestion_downup_and_update_hintdown_and_update_hintaccept_characteraccept_and_move_cursor_leftaccept_and_keep_cursorbackspace_and_resume_hintresume_hintingAUTO_SUGGEST_BINDINGSbeginning_of_linebackward_char	kill_linebackward_kill_wordyankundoSIMPLE_CONTROL_BINDINGSedit_and_executebackward_wordcapitalize_word	kill_worddowncase_worduppercase_wordyank_popyank_last_arglistALT_AND_COMOBO_CONTROL_BINDINGSr_   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   platformIPython.core.errorr   IPython.lib.clipboardr   r   r   r   ry   llm_autosuggestionbeginning_of_bufferend_of_bufferend_of_lineforward_charforward_wordunix_line_discardunix_word_ruboutUNASSIGNED_ALLOWED_COMMANDS)keycmdr   s   000r"   <module>r@     sx   
  
  ! & & $ 6 2 B D C , / !  ' * /%
&   
 [   k  #k
 //557	 8HC 	X	
 8	k ::@@B CHC 	UVWBk 		.k* 		.+k< %%		+=kL %%		+Mk\ 	G]kf 	Cgkp 	Aqkz # X{k@ # XAkF 		-GkV 		)Wkf 		'gkv 		&wkF 		&Gk d **	J
 **	J
 	J
 		i
   	3J
 !!	J
 	
 	F 	
E
 ++		$ --	
	$ ''	I
 ))	
I
 %%	7J
 00	
J
 ++	6E
 ..	9	 ##			}f X 	r##rr||r$$rwwrww eg
 CJK
 " 	++b))))++..))**)) eg#	 CdOP# &4n/!61h#%/&
.
C(.
 <<7*  
F 
F   +		?
 	7H
 D6(/	1
 '	1
 )STL5'#;<%*ABME7$67	V
 )UV 4&*BCA/B C/D E/F )		#G/X Iw STY/Z [/\ %]/d ##NNOOOO	 U^
#s   XX 9X&X,