+
    j                        R t ^ RIt^RIHtHt ^RIHt ^RIHt ^RI	H
t
 ^RIHtHtHtHtHtHtHtHtHtHtHtHtHtHtHt ^RIHtHt R tR	 tR
 t Rs!Rs"Rt#Rt$Rt%Rs&Rt'Rs(Rs)Rs*RRRR/t+Rt,RRRR/s-\P        s.R t/]RRR3]RRR3]RRR3]RR R3]RR!R"3]RR#R$3]RR%R$3]RR&R'3]RR(R)3]RR*R*3]RR+R"3]R,,           RR-R-33t0]R.,           R/]R0,           R1]R2,           R3]R4,           R5]R6,           R7]R8,           R9]R:,           R;/t1RR<RR=/t2R> t3R? t4R@ t5Rt6RAt7RRRC lt8]8! RB4      w  t9t:]7t;RD t<RE t=RSRF lt>RG t?RSRH lt@RI tARJ tBRSRK ltC^^^utDtEtFRLtGRM tHRTRN ltIRURO ltJRP tKRQ tLR# )Vu  sshj.ui — draw the inline grid (segments -> rows -> one frame).

B2 step 4b: moved verbatim from sshj_cli.py (single-file era) — no
behavior change. Owns the ms_* formatting trio, the column-width
constants, the detail band, row_segments, render, incoming_rows and
scroll_feed_up. The active theme channels (SEL/C_*/TARGET_ATTR) are
module globals this file mutates via apply_theme and reads in render —
so the test that asserts a channel swap must read them from THIS
module, not from the sshj_cli re-export (which snapshots the values).
Edges: cmd (ssh command preview), theme (THEMES + apply_theme data),
term (CSI/_identity_display_tier), tailnet (TAILNET_MARK footer),
lastused (human_age), jsonio (update_needed).
N)ssh_cmd_argsssh_cmd_str)update_needed)	human_age)TAILNET_MARK)CSIK_BSK_CTRLK_DOWNK_ENDK_ENTERK_ESCK_HOMEK_LEFTK_PGDNK_PGUPK_RIGHTK_TABK_UP_identity_display_tier)THEMESVERc                B    V f   R# V R8  d   V R R2# V R,          R R2# )u,   Latency -> '123ms' / '1.2s' (None -> '—').   —i  .0fms.1fs r   s   &src/sshj/ui.pyms_fmtr!      s2    	z	DyS}gc]!    c                P    V f   \         # V ^d8  d   R# V ^8  d   R# V R8  d   R# R# )z8Latency -> green/amber/red channel (None -> muted dash).z[32mz[2;32mi  z[2;31m[31m)C_DIMr   s   &r    ms_colorr&   '   s-    	z	Cx	Cx	Cxr"   c                    V '       g   R# \        V 4      pR F,  w  r#W8  g   K  W,          pV^
8  d
   VR V 2u # VR V 2u # 	  VR R2# )u   Bandwidth (bytes/s) -> atuin-style compact M/s label. Decimal units
(K=1e3) — this is bytes transferred, not bits. None/0 -> '' (the caller
omits the leg; a failed transfer shows nothing rather than a lie). Kr   r   ))g    eAG)g    .AM)g     @@r)   )float)bpsvdivsufxs   &    r    
speed_bandr2   4   s`     c
A88A&'"faWSE?AQsGC5/A 9 WA;r"   z[1;4;38;2;116;156;213mz[1;38;2;116;156;213mz[2mz[1mz[0mz[36mz[3mz[90mz[2;9mz[38;2;116;156;213mupu   ●downu   ○u   ⠋⠙⠹⠸⠼⡴⡦⡧r(   z[9;90mc                N   \         P                  ! V 4      ;'       g    \         R,          pVR,          VP                  RVR,          4      ussVR,          VR,          ussVR,          VR,          ussRVR	,          R
VR,          /sVR,          e   VR,          s	V # \
        s	V # )zCopy THEMES[name] onto the module globals every draw reads. Unknown
names degrade to nord. Idempotent; safe to call before every run.nordselsel_marktealgraystrikeyellowr3   	target_upr4   target_downtarget_default)
r   getSELSEL_MARKC_TEALC_GRAYC_STRIKEC_YELLOWTARGET_ATTRTARGET_DEFAULT)namets   & r    apply_themerK   Z   s    
 	

4**F6NAeHaeeJ%9MCvY&	NFF8akHh;=1ABK,-.>,?,KQ'(NK  Kr"   movestage_aliasinsertstage_addressleftexitpage_uppagepage_dnhometopendbottomconnectquitRsortTz-tXz-XYz-YNz-NAz-AFz-fVz-v   ↑   ↓c                    V \         9   d   \         V ,          # V P                  R4      '       d(   RV \        R4      ,          P                  4       ,          # RV P                  4       ,          # )zyHuman form of a key for the hint: arrows keep their glyph, ctrl
letters get a space, everything else is wrapped in <...>.zctrl+z	<ctrl %s>z<%s>)	_MOVE_SYM
startswithlenlower)ks   &r    _key_displayrl      sQ     	I~|||GQs7|_22444AGGIr"   c                @   V P                  R. 4       Uu. uF  qR8w  g   K  VNK  	  ppV P                  R. 4       Uu. uF  qR8w  g   K  VNK  	  pp. pV'       d   V'       d   \        V4      \        V4      8X  dm   \        ;QJ d"    R W2,            4       F  '       d   K   RM	  RM! R W2,            4       4      '       d'   VP                  RP	                  W#,           4      4       RV P                  R. 4      9   d*   RV P                  R. 4      9   d   VP                  R4       MQRV P                  R. 4      9   d   VP                  R4       M(RV P                  R. 4      9   d   VP                  R	4       RP	                  V4      ;'       g    R# u upi u upi )
u   The move keys for the hint, paired down/up in vim order: opt-in
single letters first ('j/k'), then the arrows ('↑/↓'). Default (no
letters bound) is just '↑/↓'.r4   r3   c              3   >   "   T F  p\        V4      ^8H  x  K  	  R# 5i)   Nri   .0rk   s   & r    	<genexpr>%_move_keys_display.<locals>.<genexpr>   s     1ACFaKs   FT/u   ↑/↓rd   re   )r@   ri   allappendjoin)kmaprk   dkukpartss   &    r    _move_keys_displayr}      s4    XXfb)	9)&[!!)B	9XXdB'	5'9!!'B	5E	bSWB'111111SXXbg&'txxb!!f0D&DY	$#	#U	488FB'	'U88E?''i' 
:	5s   FFFFc                  l    / p \          F'  w  rr4V P                  V. 4      P                  V4       K)  	  V # N)KEYMAP
setdefaultrw   )ry   rk   _aliasact_lbls        r    _default_kmapr      s4    D &3R ''* !'Kr"   z <ctrl t/x/y/n/a/f/v>: flagsFc                j  a S;'       g    \        4       o\        S4      pV3R lpV! RR4      pV! RR4      pV! RR4      pV! RR4      pR	V: R
V: RV: RV: RV: R2pR	V: RV: RV: RV: R2	p	V '       g   W3# RP                  R \         4       4      p
VRV
,          ,           RV
,          3# )u  The topbar keymap hint, generated from the keymap (one source of
truth) — `kmap` (action -> [keys], the config-merged map; None = the
built-in default) so an opt-in single-letter binding (j/k in config)
shows in the hint without a code edit (the SG1-6 "hint and handler
can't drift" guarantee, now across the config layer). Returns
(long, short). `flags_active` shows the flag keys in place of the
plain keymap (the B11 behavior). Each action's PRIMARY key (first in
the list) is shown — alternates are for the hands, the hint is for
the glance. The sort MODE is NOT here (it lives on the input line,
which is always visible); only the sort ACTION is.c                 \   < \        SP                  V 4      ;'       g    V.^ ,          4      #     )rl   r@   )actiondefaultry   s   &&r    primkeymap_hint.<locals>.prim   s&    TXXf-::'A>??r"   rM   rightrO   tabrP   r\   zctrl+r z$: move, type: filter, <enter>: ssh, z	: alias, z: addr, z	: close, z: sortu    move · <enter> ssh · u
    alias · u	    addr · z closeru   c              3   `   "   T F$  q\        \        4      R  P                  4       x  K&  	  R # 5ir   )ri   r	   rj   rq   s   & r    rs   keymap_hint.<locals>.<genexpr>   s$     E1V,,..s   ,.z <ctrl %s>: flags)r   r}   rx   FLAG_TOGGLES)flags_activery   rL   r   r   r   rP   sortkeylongshortletterss   &f         r    keymap_hintr      s     ""=?Dd#D@ (E

&CD68$G UCw0D eS$(E{hhEEEG%//g%& &r"   c                   V P                  R4      R8X  d   R# V P                  R4      R8X  dT   V P                  RR4      pV'       d.   RV9   d'   R\        P                  P                  V4      ,           # T;'       g    R# V P                  R	R4      pV'       d0   VP	                  \        P                  P                  R
4      R
4      # R# )u   Where a connection comes from, as a short label for the [ src ] line.
Config files → basename; rc/source → ~-basename; history → 'history'.srchisthistoryrcsrc_pathr(   ru   z~/from~config)r@   ospathbasenamereplace
expanduser)hps   & r    source_labelr      s     	uuU|vuuU|tEE*b!-.3!8tbgg&&q))L!))tL	fbAyy++C0#66r"   c                   \        WV4      p VP                  R4      pV^V p. ^ rvV\        V4      8  dz   WW,          pVR9   dO   V^,           \        V4      8  d8   VP	                  VR,           WW^,           ,          ,           4       V^,          pKm  VP	                  V4       V^,          pK  RP                  V4      #   \         d    \        T4      p Li ; i)u?  The non-default ssh options for a host, as a compact '·'-joined string
(the resolved command's flags minus the `ssh` and the `-- target`).
Empty when the command carries no options. This is the structured
flag view the operator asked to see (B10/B11) — not a repeat of the
command string, but its options pulled out.z--r   u    · )z-oz-pz-Lz-Rz-iz-Jz-c)r   index
ValueErrorri   rw   rx   )	hoststatus
extra_argsargsrW   flagsoutias	   &&&      r    _flag_breakdownr     s     j1Djj 3KE
c%j.H::q1us5z?QJJq3w1u-.FAJJqMFA;;s  $is   C CCc                   . p\        WV4      pV'       d    VP                  R\        3V\        3.4       V P	                  R4      '       dY   VR8H  pV'       d   RM
VR8X  d   RMRpTP                  R\        3\
        R,           \        3Y'       d   \        M\        3.4       VR8X  d   V'       d   \        VP	                  R4      4      p	\        VP	                  R4      4      p
. pV	'       d   VP                  RV	,           4       V
'       d   VP                  R	V
,           4       V'       d/   VP                  R
\        3RP                  V4      \        3.4       . pVR,           F`  pRP                  R V 4       4      p\        V4      V8  d%   VRV^,
           R,           V^ ,          ^,          3.pVP                  V4       Kb  	  V# )aZ  atuin-style always-on PREVIEW band (RQ11), placed under the command
footer. Content-driven and capped at 3 muted lines; the row already
shows host/port/user/age/conns so the band only adds what the row
cannot: the non-default flags in play, the tailnet state when this
is a tailnet device, and (B14) the measured up/down bandwidth when
this host is up. Anti-redundancy: it never re-labels a column.
Returns a list of [(text, attr), ...] line-segments (may be empty).
`speed` is {"up": bps|None, "down": bps|None} (or None); a down host
shows no speed line (nothing meaningful to say about a dead link).z	  flags: tailnetr3   r4      ·z  tailnet: z device re   rd   z	  speed: r   N   Nr(   c              3   *   "   T F	  w  rVx  K  	  R # 5ir   r   rr   rJ   _s   &  r    rs   $detail_band_lines.<locals>.<genexpr>C  s     *TTQqTs   N   …)
r   rw   r%   rD   r@   r   rC   r2   rx   ri   )r   r   r   wdtspeedlinesfbr3   statedubitsr   segstexts   &&&&&          r    detail_band_linesr     s    E	J	/B	{E*RL9:uuYt^6V+; 	}e,#j0%8f68 	9 ~%uyy()uyy'KK	"KK	"LL;.88D>624 5 Cb		ww*T**t9s?(37^e+T!WQZ89D

4	 
 Jr"   c                P   . ^r2V  F  w  rEV'       g   K  W18  d    Mq\        V4      W,
          ^,           8  d   VRW,
          ^,            pTP                  V'       d   WT,           \        ,           MT4       V\        V4      ,          pK  	  RP                  V4      V^,
          3# )u   The row's visible content (attrs+text, left to right, no
positioning/erase sequences) — what the row shows on screen. Used for
the per-row dirty comparison: two rows render identically iff these
are equal. Returns (content, logical_length).Nr(   )ri   rw   C_RESETrx   )segmentswidthr|   r1   r   attrss   &&    r    _line_contentr   K  s    
 119t9uy1}$Q'DelW,DA	SY   775>1q5  r"   c                    \        W#4      w  rV\         V R\         RV 2pVf   V P                  V4       V# VP                  V4       V# )u
  Erase row y1 (1-based) and paint segments [(text, attrs), ...]
left-to-right from column 1. The cursor tracks the writes, so each
segment's own fixed-width padding IS its column — never re-pad.
Returns the number of characters written (the row's logical length).

The row is NOT padded out to the screen width: the `CSI 2K` at the
start already erases the whole row, and a shorter LOGICAL line is what
keeps rotation safe — when the terminal reflows on resize, a row of
length L splits into ceil(L/new_width) rows; a full-width padded row
always splits, scattering stale text into the feed area.

`buf` (optional): when given, the row's escape sequences are APPENDED
to it instead of written — render() composes the rows it needs into
one buffer and issues a single write.;1H2K)r   r   putrw   )termy1r   r   bufcontentlengthseqs   &&&&&   r    	_put_liner   ]  sS     $H4OGE"SRy
)C
{ M 	

3Mr"   c                h    \        V\        W#4      ^,           4       F  p\        WR.V4       K  	  R# )z<Blank every row of the widget (incl. the reserved note row).Nr   N)rangeminr   )r   rV   
footer_rowhgtr   ys   &&&&& r    _eraser   u  s+    3J,q01$K=#. 2r"   c                 N    \        V 4      V8:  d   V P                  V4      # W) R  # r   )ri   rjust)r   r   s   &&r    _rjustr   |  s'     #D	U 24::eEVWEr"   c                   RVRR3.p^V^,
          rW,
          ^,           p	V'       dZ   \        V4      V	8  d   VR\        ^ V	4       pWy\        V4      ,
          ^,          ,           p
W8  d   Tp
VP                  WR34       V'       d   VP                  W\        34       MGV'       d@   V \        V4      ,
          pW^,           8  d
   V^,           pVP                  W\        34       VP                  R R7       . ^rV F[  w  rpW8  d   K  W8  d#   VP                  RW,
          ,          R34       TpVP                  VV34       V\        V4      ,          pK]  	  W8:  d(   VP                  RW,
          ^,           ,          R34       V# )uR  The `[ source ]` indicator line (atuin's `[ GLOBAL ]`).
`[` at the first column, `]` at the right edge of the last-called column,
source label centered between them, and the fuzzy search term / digit
pick typed at the name column (where host names begin) — that's where
the cursor sits and writes. `display` may also hold the whole ssh
command (tab: the command staged for the shell's input field).
`sort_label` (e.g. "recent" / "last success" / "alpha") shows the active
sort mode, muted, right after the `]` — always visible, so the operator
can see which order the list is in (<ctrl r> cycles it). It sits at the
FAR-RIGHT margin of the line, and only while the field is EMPTY — a
staged command / search term (display) owns the line then, and the
order is irrelevant mid-edit, so the label yields and the source label
keeps its full width.
N]c                     V ^ ,          # r   r   )r   s   &r    <lambda>%input_line_segments.<locals>.<lambda>  s    adr"   )keyr   )ro   [N)ri   maxrw   rF   rD   r\   )r   name_colbracket_colr   display
sort_labelpiecesinner_linner_rspancscr   r1   colr   attrs   &&&&&&           r    input_line_segmentsr     sX    {C67F+/Wq D
s8d?ms1d|$Cc#h1,,;Aqtn%x(34	 3z?"aqBrv./
KKNK#!!!477KK$/0AT4L!	SY " 	xSCGaK($/0Kr"   g      ?c                `    V '       g   R# V P                  R4      '       d   V RR R,           # T # )u  Append the underline parameter to an existing SGR sequence, keeping
its color/params untouched (``'' -> '\x1b[4m'``). Used for the selected
row's ADDRESS text: underline the address, keep its status color as-is
(2026-09-21: "underline the selected address too, only the text, keep its
color as it is"). The target's right pad and the ⇆N count are separate
unstyled segments, so the underline covers the address text only — never
the whole field.z[4mmNz;4m)endswith)sgrs   &r    
_underliner    s.     !$c!2!2CHu;;r"   c                \   VR8X  d(   \         V\        \         4      ,          ,          \        rM&VR9   d   \        V,          VR8X  d   RM\        rMRRrVP	                  V R,          4      p\        V'       d   \        W,
          4      MR\        4      pV P	                  RV R,          4      pV P	                  R	4      '       d   \        MRp\        P	                  V\        4      pV
'       d   R
\        V
4      ,           MRp\        ^W|,
          4      pV R,          p\        V4      V8  d   VRV^,
           R,           pVRV\        V4      ,
           p\        ^ V\        V4      ,
          \        V4      ,
          4      pV^,           RV 2 \        3VR\         2 V3\        \        V4      \        4      \!        V4      3TV'       d   \"        M\        3RTV'       d   \$        MR3RV,          R3V'       d   TV'       d   \&        M\        3MRRTV'       d   \)        V4      MT3.
pV\        V4      ,
          ^ 8  d+   VP+                  RV\        V4      ,
          ,          R34       V'       d6   VP+                  RV\        V4      ,
          ,          V,           \,        34       V# )u&  One grid row as [(text, attrs), ...]. `tick` drives the checking
throbber. The health signal lives in the TARGET line, not the glyph:
up -> foreground dot; down -> muted open dot + strikethrough target;
check -> muted animated throbber (progress, no health color).

Stable-columns contract (SG1-5): the session-count column is
FRAME-WIDE (`frame_cnt_w` = the max over all visible rows, computed in
`render`), so `⇆1 -> ⇆12` reserves the extra space for EVERY row and the
target column's right edge never moves between frames. The dynamic
numbers (ms, age) are rjust'd into fixed widths (`W_SPEED`, `W_AGE`);
`_rjust` truncates a would-be overflow rather than widen the column.
The target text left-anchors its (expanding) column; the session count
(⇆N), when present, right-anchors the column's edge.checkr3   r(   r   Naliasr   dispr      ⇆targetr   >)r3   r4   r   r(   N)  N)THROBBERri   r%   STATUS_GLYPHr@   r   r   W_AGEr   rG   rH   strr   W_GLYPHr!   W_SPEEDr&   rC   rA   rB   r  rw   rD   )r   str   giw_idxis_selhwtgt_w	last_usednown_outtickframe_cnt_wglyphgattrluager  tstgt_attrcnttmaxtgtnmnm_padr   s   &&&&&&&&&&&&&             r    row_segmentsr(    s    
W}s8} 45uu	~	#B'd
"uDu	qz	"B
)CH%
?C557$D y))rBr>2H %%#e*
2C q%%&D
H+C
3x$)4!8nu$
 
mrCG|	BBRL3r7*+FF1UG)u%!G9&	r
G	$hrl3	f&	FS%	vt
 24&he-	vz(#8=D$ c#hSD3s8O,d34
SK#c(23c96BCKr"   c                  aab \        V4      pV^ 8X  dE   V P                  \         V	 R\         R24       V P                  \         R\         24       RW^3# VP                  4       ob\        ^\        \        V4      4      4      pV\        ,           \        ,           \        ,           ^,           p\        R V 4       ^R7      p\        ;QJ d    Vb3R lV 4       F  '       g   K   RM	  R	M! Vb3R lV 4       4      pV'       d   \        Vb3R
 lV 4       ^ R7      ^,           M^ pVV,
          ^,
          p\        R V 4       ^ R7      ^,           p\        ^\        V\        V\        ,          4      4      4      p\        ^VV,
          4      pRRV 2 RRV 2 RRRV 2 2P                  4       p\!        V3R lV 4       4      p\!        V3R lV 4       4      pV'       d)   SP"                  P%                  W,          R,          4      MRpVR8X  d   RRp pMR\        p pR\&         2p!V!\(        3.p"\+        4       '       d   V"P-                  R\(        R,           34       \!        R V" 4       4      p#T"p$T#p%Rp&\/        \1        V4      V4      w  p'p(V'V(3 F0  p)V\        V)4      ,
          ^,          p*V*V#^,           8  g   K,  V*V)3p& M	  V&'       dZ   V&w  p*p)V$P-                  R\        ^ V*V%,
          4      ,          R34       V$P-                  V)\2        34       V*\        V)4      ,           p%Rp+\4        p,VP6                  p-VP8                  ;_uu_ 4        VP:                  VP<                  VP>                  p0p/p.RRR4       X0'       g	   X/'       d    \A        X.X/V0V\        V%^4      ,
          4      p+V+'       d   V-'       d   RV+,           p+\4        \B        ,           p,Tp1T+p2\        V%^,           V1\        V24      ,
          ^,           4      p3V$P-                  R\        ^ V3V%,
          ^,
          4      ,          R34       V$P-                  V2V,34       V3\        V24      ,           p%\        ^ \        W*^,
          ^,          ,
          VV
,
          4      4      p4\        ;QJ d    V3R lV 4       F  '       g   K   RM	  R	M! V3R lV 4       4      p5V5'       d'   \        V^,          4      \        \D        4      ,          M^ p6. p7\G        V
4       F  p8V4V8,           p9V9V8  d    MVV9,          p:SP"                  P%                  V:R,          4      p;V7P-                  \I        V:V;SPJ                  P%                  V:R,          4      V9VV9V8H  VVWESbP%                  V:R,          ^ 4      V6V4      4       K  	  W,          p<V\        ,           \        ,           \        ,           ^,           p=V\        ,           \        ,           \        ,           p>T=p?\M        V<4      p@\O        VV?V>V@VV4      pA\Q        V<VV4      pB\Q        V<VVRR7      pCVCVB8w  d
   RXC,           MRpDRXB,           pEV'       d
   RV,           MRpF\        XD4      VD'       d   ^M^ ,           pGVVG,
          pHXD'       dT   XH^8  dM   \        ^V^,
          4      pIR XDVI^,
          ) R ,           pD\        VD4      VD'       d   ^M^ ,           pGVVG,
          pHXH^ 8  d   ^ pH\        XE4      \        XF4      ,           XH8  d   RpF\        XE4      XH8  d(   XH^8  d   R XE\        ^ XH^,
          4      ) R ,           MRpEXE\2        3.pJXF'       d   XJP-                  XFV 34       \!        R! XJ 4       4      pKXD'       dS   VXK,
          \        XD4      ,
          pLVL^ 8  d   XJP-                  RXL,          R34       XJP-                  XD\2        34       M+XJP-                  R\        ^VXK,
          4      ,          R34       \S        T<TYV'       d   VP%                  V<R,          4      MRR"7      pMV$V\        3..V7,           XAXJ.,           VM,           pN^\        V74      ,           pOVPU                  4       R#,          pPVP'       d   XNP-                  R$\        VPU                  4       4       R%2\        3.4       XP FX  w  pQpRpSVQ'       d   XQ R&XR 2MXRp@RV@R' 2\        3XSR( \        3R\V        R),          ,           \        3.pTXNP-                  VT4       KZ  	  . pUXN F#  pT\Y        VTV4      w  pVpWXUP-                  VV4       K%  	  \        XU4      pX\        VV?\        V4      ,           4      pY\        V	XO,           V4      pZV'       d>   V^ ,          e3   V^ ,          XU8X  d%   V^,          WV38X  d   XUV^,          V	XO,           XY3# V^ ,          RJ ;'       g    V^,          WV38g  p[. p\V['       d<   X\P-                  \         \        ^\        W4      4       R\         R*24       WV3V^&   X['       g   V^ ,          p]\G        \        XX\        V]4      4      4       Ft  p8V8XX8  d
   XUV8,          MRp^V8\        X]4      8  d
   X]V8,          MRp_X^V_8w  g   K9  \[        T \        V	V8,           V4      V8\        XN4      8  d
   XNV8,          MR/.VX\R+7       Kv  	  M6\]        XN4       F'  w  p8pT\[        V \        V	V8,           V4      VTVX\R+7       K)  	  X\'       d?   X\P-                  R,\         XZ R-XY R.24       V P                  RP_                  V\4      4       XUV^ &   \        V	\        XN4      ,           ^,
          V4      V^&   \        XM4      V^&   . p`VN F#  pT\Y        VTV4      w  pWpaX`P-                  Va4       K%  	  X`XOXY^,
          3V^&   XUV^,          XZVY3#   + '       g   i     ELZ; i)0u;  Paint the widget into rows top.. (1-based) — but ONLY when the frame
differs from the last one actually drawn (flicker rule: a full-screen
erase + repaint every tick is visible as flicker, so clean frames are
not emitted at all; the main loop skips its wipe when the signature is
unchanged). Returns (drawn_signature, footer_row, input_row,
input_cursor_col); the row below footer is the reserved note row
(blanked on exit). `display` is the text shown in the [ source ] input
line (search term or digit pick); the signature tracks its length so
re-paints stay correct.r   r   zsshj: no hosts foundemptyc              3   F   "   T F  p\        VR ,          4      x  K  	  R# 5i)r  Nrp   rr   r   s   & r    rs   render.<locals>.<genexpr>)  s     04aQx[!!4s   !)r   c              3   T   <"   T F  pSP                  VR ,          4      x  K  	  R# 5i)r  N)r@   rr   r   cntss   & r    rs   r-  *  s!     51$((1W:&&s   %(TFc           
   3      <"   T F6  p\        R \        SP                  VR,          4      4      ,           4      x  K8  	  R# 5i)r  r  N)ri   r  r@   r/  s   & r    rs   r-  +  s0     G$Q#ec$((1W:"67788$s   >Ac              3   f   "   T F'  p\        VP                  R VR,          4      4      x  K)  	  R# 5i)r  r  N)ri   r@   r,  s   & r    rs   r-  2  s'     @4a3quuVQwZ0114s   /1r(   <HOSTr  TARGETc              3   z   <"   T F0  pSP                   P                  VR ,          4      R8X  g   K,  ^x  K2  	  R# 5i)r  r3   Nr   r@   rr   r   checkers   & r    rs   r-  9  s-     G1 2 21W: >$ FQQ   );
;c              3   z   <"   T F0  pSP                   P                  VR ,          4      R8X  g   K,  ^x  K2  	  R# 5i)r  r4   Nr7  r8  s   & r    rs   r-  :  s-     I1 2 21W: >& HQQr:  r  Nr4   u'   down — enter still tries (5s timeout)r$   z sshj vz	 - UPDATEc              3   <   "   T F  w  r\        V4      x  K  	  R # 5ir   rp   r   s   &  r    rs   r-  M  s     -utqCFFu   r   r   c              3   n   <"   T F*  pSP                   P                  VR ,          4      R8H  x  K,  	  R# 5i)r  r  Nr7  r8  s   & r    rs   r-  ~  s)     JT'..$$QwZ0G;Ts   25)resolvedu    → r   c              3   <   "   T F  w  r\        V4      x  K  	  R # 5ir   rp   r   s   &  r    rs   r-    s     )&$!s1vv&r=  )r   r   u    ← incoming ()@z<30z>2r3   J)r   z[?25h;Hr
  )0ri   r   r   r%   r   countsr   r  r  r  r  anyr   intNAME_CAPrstripsumr   r@   r   C_BOLDr   rw   r   boolrD   rC   stalelocklanr!  rI   r   C_ITALICr  r   r(  latencyr   r   r   r   incoming_listr  r   r   	enumeraterx   )cr   rowsr7   r9  r  r  identr   r   rV   rk   drawnconnsr   r   
speed_scanry   r   nr  left_wr  any_cntcnt_wspacenames_wr  
hdr_prefixr3   dn
sel_statusnote_txt	note_attrtitletsegs	title_lentopbarr1   kb	cand_full
cand_shortcandkb_xidtxtid_attrrN  _lan_ts_namerW   tierid_startstartany_chkr  bodyr   r  r   r  shr   r   input_text_colr   
input_line	cmd_aliascmd_resr   rP   midright_wroomkeepfooterusedgapbandr   	input_idxincuseripr#  seg
frame_rowsr   r   n_linescur_col	input_rowfreshframeoldnew_cold_clensr   r0  sc   &&&f&&&&&&&&&&&&&&                                                                                @r    renderr    s/
    	D	AAv 	C5SR()E7.wi891%%<<>D3s1v;EW_w&.2F040!<Ec55ccc555G#* G$G01 
 &L1E@4@!LqPG	QGS!123	4B52:E&zNAbT6N"awY')*0&(  
GG	GB	II	IB;?##DIg$67TJ VG)) %) cUOEV_Ek6J#678-u--I FA	B
 (Z(8$?IzJ'c$iA%9q= B	 (
 

dsSD1H--t45tVn%3t9EGKKE	 99ehh

5c 
 'tS%s1ayI%KEx'G q1ucCIo12sSHqL1$455t<=tWo&s4y  3s!e\)1q512EcJTJcccJTJJG+23sQw<#h-'DD1XQY7H^^'
+LB(;(;AgJ(G!#UB#Ir5!*!G*a1H!%u. 	/  
B')E1Q6H'/G+e3K N
r
C$S.+s%,j:J  B
J7I"j*tDG#*i#7WwRE?D'4(?RC%jAA.G=D1cAgqkl++e*U2W}ax
4y3s8d"
4y43719utSD1H--.//"VnF
sI&')&))DDj3u:%7MM39d+,ufo&sSC$J//67 RZ * $.>>"W+#>046D z5)*+d2j&5II
ECII 



#C
U-@-@-B)C(DAFNOP MD"c$(TF!B4.bCS	NE*2h',t,,e46C LL ! J"3,
'"  *oG
 #~G45GC)OS)I
 q%%(j*@aSsO+
 58S9_g== !H;;aSsO ;EE 	uSCM233se1=>c?aAhs7CH-.A%&[JqMbE#c(lCFE~$C!GS 1q3u:~58 *|Se=	 /  &FAsdCa-sCUC 'yi['!<= E!H3U#a'-E!H4yE!H D!#s+	6F  i1-E!HuQxG33 
s   %o		o	c                n    V P                  4       pV'       d   ^\        ^\        V4      4      ,           # ^ # )z<Number of incoming-connection footer rows to reserve (0..4).)rS  r   ri   )rX  r  s   & r    incoming_rowsr  +  s-    



C%(AAs3x  /a/r"   c                    V P                  4       w  r#\        V4       F  pV P                  \         V R24       K  	  R# )zPush the screen up by n lines so the top of the (soon drawn) grid
lands at the writing line; the feed moves into the scrollback.z;1H
N)sizer   r   r   )r   rZ  r   r   r   s   &&   r    scroll_feed_upr  1  s6     yy{HC1XC5U#$ r"   )FNr   r   )r   NNN)M__doc__r   cmdr   r   jsonior   lastusedr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   themer   r   r!   r&   r2   rA   rB   r%   rL  r   rC   rQ  rD   rE   rF   r  r  rG   rH   rK   r   r   rg   rl   r}   r   _KEYBINDS_SHORT_FLAG_KEYS_HINTr   KEYBINDSKEYBINDS_SHORTFLAG_KEYS_HINTr   r   r   r   r   r   r   r   r  r  r  rI  r  r(  r  r  r  r   r"   r    <module>r     s5   
 * !  !* * * * * 
$ #%	
		#
 h1=R.< 
T4F+T6F+dMH-
T?H-T6F+T9F+T9F+T6E*
T5H-dII.
T6F+c\4F+
B SL$
SL$
SL$
SL$
SL$
SL$
SL$ 5&%(	(& 0&F 'u- . 2(X!$0/F/t Q %
<DNV4r0%r"   