+
   e=տc                       R t ^ RIt^ RItR t ! R R4      t]R8X  d'   R t]P                  ! ]4      t]	! R]
! ]4      4       R# R# )z:Simple textbox editing widget with Emacs-like keybindings.Nc                   V P                  V^,           V\        P                  W1,
          ^,
          4       V P                  W^,           \        P                  WB,
          ^,
          4       V P                  W2^,           \        P                  WB,
          ^,
          4       V P                  V^,           V\        P                  W1,
          ^,
          4       V P                  W\        P                  4       V P                  W\        P                  4       V P                  W4\        P                  4       V P                  W2\        P                  4       R# )zVDraw a rectangle with corners at the provided upper-left
and lower-right coordinates.
N)
vlinecurses	ACS_VLINEhline	ACS_HLINEaddchACS_ULCORNERACS_URCORNERACS_LRCORNERACS_LLCORNER)winulyulxlrylrxs   &&&&&%/usr/lib/python3.14/curses/textpad.py	rectangler      s     IIc!eS&**CIM:IIcq5&**CIM:IIcq5&**CIM:IIc!eS&**CIM:IIc++,IIc++,IIc++,IIc++,    c                   t   a  ] tR t^t o RtRR ltR tR tR tR t	R t
R tR	 tR
 tR tR tRR ltRtV tR# )Textboxa=  Editing widget using the interior of a window object.
 Supports the following Emacs-like key bindings:

Ctrl-A      Go to left edge of window.
Ctrl-B      Cursor left, wrapping to previous line if appropriate.
Ctrl-D      Delete character under cursor.
Ctrl-E      Go to right edge (stripspaces off) or end of line
            (stripspaces on).
Ctrl-F      Cursor right, wrapping to next line when appropriate.
Ctrl-G      Terminate, returning the window contents.
Ctrl-H      Delete character backward.
Ctrl-J      Terminate if the window is 1 line, otherwise move to start
            of next line.
Ctrl-K      If line is blank, delete it, otherwise clear to end of line.
Ctrl-L      Refresh screen.
Ctrl-N      Cursor down; move down one line.
Ctrl-O      Insert a blank line at cursor location.
Ctrl-P      Cursor up; move up one line.

Move operations do nothing if the cursor is at an edge where the
movement is not possible.  The following synonyms are supported where
possible:

KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P,
KEY_DOWN = Ctrl-N, KEY_BACKSPACE = Ctrl-h
c                |    Wn         W n        V P                  4        ^V n        RV n        VP                  ^4       R#    N)r   insert_mode_update_max_yxstripspaceslastcmdkeypad)selfr   r   s   &&&r   __init__Textbox.__init__.   s3    &

1r   c                v    V P                   P                  4       w  rV^,
          V n        V^,
          V n        R# r   )r   getmaxyxmaxymaxx)r   r$   r%   s   &  r   r   Textbox._update_max_yx6   s,    XX&&(
1H	1H	r   c                    \        V\        P                  ,          .4      P                  V P                  P
                  R 4      # )replace)bytesr   
A_CHARTEXTdecoder   encodingr   chs   &&r   _decodeTextbox._decode;   s4     b6,,,-.55dhh6G6GSSr   c                    V P                   P                  ! . VO^N5!  P                  V P                   P                  R4      # )r   r(   )r   instrr+   r,   r   yxs   &*r   _char_atTextbox._char_at@   s6     xx~~%r%1%,,TXX->->	JJr   c                    V P                   P                  ! . VO^N5!  ^ ,          V P                   P                  ! V!  \        P                  ,          ,          # )r   )r   r2   inchr   A_ATTRIBUTESr3   s   &*r   _cell_atTextbox._cell_atF   sA    
 xx~~%r%1%a(488=="+=@S@S+SSSr   c                @    V P                  V4      P                  4       # Nr/   isprintable)r   cells   &&r   _isprintTextbox._isprintM   s     ||D!--//r   c                Z    V^8*  ;'       d     V P                  V4      P                  4       # )   r>   r-   s   &&r   _printable_keyTextbox._printable_keyR   s(     Tz<<dll2.::<<r   c                    V P                  4        V P                  p V P                  W4      R8w  d!   \        V P                  V^,           4      p V# V^ 8X  d    V# V^,
          pKL  )zmGo to the location of the first blank on the given line,
returning the index of the last non-blank character. )r   r%   r5   min)r   ylasts   && r   _end_of_lineTextbox._end_of_lineX   sg     	yy}}Q%,499d1f-   !8Dr   c                   V P                  4        V P                  P                  4       w  r#R p V P                  '       d   V P	                  4       pW P
                  8  dR   W0P                  8  dB   V P                  P                  V P                  V4      V\        P                  ,          4       MnV P                  P                  V4       V P                  '       d   V P                  X4      '       g   M)TpV P                  P                  4       w  r#Ve   K  W#3pK  Ve   V P                  P                  ! V!   R # R # r=   )r   r   getyxr   r:   r$   r%   inschr/   r   r9   r   rA   move)r   r.   rJ   xbackyxoldchs   &&    r   _insert_printable_charTextbox._insert_printable_charf   s    !II~!yy.
 t||B/f6I6I1IJHHNN2###4==+?+?BXX^^%FQ~HHMM6" r   c                   V P                  4        V P                  P                  4       w  r#Wn        V P	                  V4      '       d   V P                  V4       ^# V\        P                  P                  8X  d   V P                  P                  V^ 4       ^# V\        P                  P                  \        P                  \        P                  P                  \        P                  \        P                  P                  39   Ed   V^ 8  d$   V P                  P                  W#^,
          4       MV^ 8X  d   MyV P                  '       d;   V P                  P                  V^,
          V P!                  V^,
          4      4       M-V P                  P                  V^,
          V P"                  4       V\        P                  P                  \        P                  \        P                  P                  39   d   V P                  P%                  4        ^# V\        P                  P&                  8X  d   V P                  P%                  4        ^# V\        P                  P(                  8X  dg   V P                  '       d-   V P                  P                  W P!                  V4      4       ^# V P                  P                  W P"                  4        ^# V\        P                  P*                  \        P,                  39   dn   W0P"                  8  d%   V P                  P                  W#^,           4       ^# W P.                  8X  d    ^# V P                  P                  V^,           ^ 4        ^# V\        P                  P0                  8X  d   ^ # V\        P                  P2                  8X  dI   V P.                  ^ 8X  d   ^ # W P.                  8  d$   V P                  P                  V^,           ^ 4       ^# V\        P                  P4                  8X  dr   V^ 8X  d3   V P!                  V4      ^ 8X  d   V P                  P7                  4        ^# V P                  P                  W#4       V P                  P9                  4         ^# V\        P                  P:                  8X  d   V P                  P=                  4        ^# V\        P                  P>                  \        P@                  39   d   W P.                  8  dy   V P                  P                  V^,           V4       W0P!                  V^,           4      8  d:   V P                  P                  V^,           V P!                  V^,           4      4       ^# V\        P                  PB                  8X  d   V P                  PE                  4        ^# V\        P                  PF                  \        PH                  39   d   V^ 8  dy   V P                  P                  V^,
          V4       W0P!                  V^,
          4      8  d:   V P                  P                  V^,
          V P!                  V^,
          4      4       ^# )z!Process a single editing command.)%r   r   rO   r   rE   rU   r   asciiSOHrQ   STXKEY_LEFTBSKEY_BACKSPACEDELr   rL   r%   delchEOTENQACK	KEY_RIGHTr$   BELNLVTdeletelnclrtoeolFFrefreshSOKEY_DOWNSIinsertlnDLEKEY_UP)r   r.   rJ   rR   s   &&  r   
do_commandTextbox.do_command   sa   !r""''+v u 6<<###HHMM!Qr q FLL$$V__LLOO((LL$$& & 1ua1%a!!!ac4#4#4QqS#9:ac499-flloov';';V\\=M=MNN V U 6<<###HHNNR Q 6<<###a!2!21!56L I a+H G FLL$$f&6&67799}a1%B A ii> ; ac1%: 9 6<<###6<<??"yyA~YYac1%, + 6<<??"Av$++A.!3!!#& ! a#!!#  6<<??"HH  FLLOOV__5599}ac1%((1--HHMM!A#t'8'81'=>  6<<??"HH  FLL$$fmm441uac1%((1--HHMM!A#t'8'81'=>r   c                   RpV P                  4        \        V P                  ^,           4       F  pV P                  P	                  V^ 4       V P                  V4      pV^ 8X  d   V P                  '       d   KK  \        V P                  ^,           4       F4  pV P                  '       d	   WC8  d    MWP                  W$4      ,           pK6  	  V P                  ^ 8  g   K  VR,           pK  	  V# )z.Collect and return the contents of the window. 
)	r   ranger$   r   rQ   rL   r   r%   r5   )r   resultrJ   stoprR   s   &    r   gatherTextbox.gather   s    tyy{#AHHMM!Q$$Q'DqyT---499Q;'###--"55 ( yy1}$ $ r   Nc                     V P                   P                  4       pV'       d	   V! V4      pV'       g   K5  V P                  V4      '       g    V P	                  4       # V P                   P                  4        Ky  )z2Edit in the widget window and collect the results.)r   getchrq   rj   ry   )r   validater.   s   && r   editTextbox.edit   sW    !Bb\??2&&{{} HHr   )r   r   r%   r$   r   r   )Fr=   )__name__
__module____qualname____firstlineno____doc__r    r   r/   r5   r:   rA   rE   rL   rU   rq   ry   r~   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sP     4
T
KT0
=#4AF" r   r   __main__c                    ^	^r!^^rCV P                  V^,
          VR4       \        P                  ! W!W44      p\        W^,
          V^,
          W2,           WA,           4       V P	                  4        \        V4      P                  4       # )	   zUse Ctrl-G to end editing.)addstrr   newwinr   rj   r   r~   )stdscrncolsnlinesr   r   r   s   &     r   test_editboxr      sl    1vrSc!eS">?mmF34&a%QckBs|  ""r   zContents of text box:)r   r   curses.asciir   r   r   r   wrapperstrprintrepr r   r   <module>r      sS    @  -L L\ z# ..
&C	
!49- r   