+
    i              
          ^ RI Ht ^ RIHt ^ RIHtHtHtHtH	t	  ! R R]	4      t
R R ltR R	 ltRR R llt]R8X  dJ   ^ RIHt ] ! R R4      4       t]! ^n]! R
^^4      ]! R
^^4      ]! R
^^4      .4      t]! ]! ]4      4       R
# R
# )    )Fraction)ceil)castListOptionalSequenceProtocolc                   <   a  ] tR t^t o RtRt^t^tV 3R ltRt	V t
R# )Edgez1Any object that defines an edge (such as Layout).Nc                N   < V ^8  d   Qh/ S[ S[,          ;R&   S[;R&   S[;R&   #    sizeratiominimum_sizer   int)format__classdict__s   "^/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_vendor/rich/_ratio.py__annotate__Edge.__annotate__   s/      3-  N	 
       )__name__
__module____qualname____firstlineno____doc__r   r   r   __annotate_func____static_attributes____classdictcell__r   s   @r   r   r      s     ;DEL  r   r   c                h    V ^8  d   QhR\         R\        \        ,          R\        \         ,          /# )r   totaledgesreturn)r   r   r   r   )r   s   "r   r   r      s)     :" :" :"Xd^ :"S	 :"r   c                   V Uu. uF  q"P                   ;'       g    RNK  	  pp\        pRV9   Ed    \        \        W14      4       UUUu. uF  w  pw  rbVe   K  WR3NK  	  ppppV \	        R V 4       4      ,
          pV^ 8:  d:   \        W14       UUu. uF!  w  rbVf   VP
                  ;'       g    ^MTNK#  	  upp# V! V\	        R V 4       4      4      p	V F7  w  rRWP                  ,          VP
                  8:  g   K(  VP
                  W5&    K  	  V! ^ 4      p
V F.  w  rR\        WP                  ,          V
,           ^4      w  rjWcV&   K0  	   \        \        \        ,          V4      # u upi u upppi u uppi )a`  Divide total space to satisfy size, ratio, and minimum_size, constraints.

The returned list of integers should add up to total in most cases, unless it is
impossible to satisfy all the constraints. For instance, if there are two edges
with a minimum size of 20 each and `total` is 30 then the returned list will be
greater than total. In practice, this would mean that a Layout object would
clip the rows that would overflow the screen height.

Args:
    total (int): Total number of characters.
    edges (List[Edge]): Edges within total space.

Returns:
    List[int]: Number of characters for each edge.
Nc              3   8   "   T F  q;'       g    ^ x  K  	  R# 5i)r   Nr   ).0r   s   & r   	<genexpr> ratio_resolve.<locals>.<genexpr>,   s     <ed			es   c              3   R   "   T F  w  rVP                   ;'       g    ^x  K  	  R# 5i)   N)r   )r*   _edges   &  r   r+   r,   5   s     KNDJJOO!ONs   '')r   r   	enumeratezipsumr   r   divmodr   r   r   )r%   r&   r0   sizes	_Fractionindexr   flexible_edges	remainingportion	remainders   &&         r   ratio_resolver<      sy   " .33UTii4UE3I %- (1U1B'C
'C#| UM'C 	 
 C<e<<<	> #&e"3"3JD .2\$##((qtC"3 
 sKNKK

 *KE#t'8'88#00	 * "!I-"(::)=	)I1"M#e  . S	5!!S 4
s"   E-E-E2E2E92	E9c                    V ^8  d   QhR\         R\        \         ,          R\        \         ,          R\        \         ,          R\        \         ,          /# )r   r%   ratiosmaximumsvaluesr'   )r   r   )r   s   "r   r   r   K   sD      S	-1#Y@DS		#Yr   c                   \        W4       UUu. uF  w  rEV'       d   TM^ NK  	  ppp\        V4      pV'       g
   VR,          # T p. pVP                  p	\        WV4       F_  w  rJpV'       dJ   V^ 8  dC   \        V
\	        WG,          V,          4      4      pV	! W,
          4       W|,          pWd,          pKW  V	! V4       Ka  	  V# u uppi )aD  Divide an integer total in to parts based on ratios.

Args:
    total (int): The total to divide.
    ratios (List[int]): A list of integer ratios.
    maximums (List[int]): List of maximums values for each slot.
    values (List[int]): List of values

Returns:
    List[int]: A list of integers guaranteed to sum to total.
:NNN)r2   r3   appendminround)r%   r>   r?   r@   r   _maxtotal_ratiototal_remainingresultrB   maximumvaluedistributeds   &&&&         r   ratio_reducerL   K   s     7:&6KL6K{ute"6KFLf+KayOF]]F!$Vv!>[1_guU-D{-R'STK5&'*O K5M "? M Ms   CNc          	          V ^8  d   QhR\         R\        \         ,          R\        \        \         ,          ,          R\        \         ,          /# )r   r%   r>   minimumsr'   )r   r   r   )r   s   "r   r   r   k   s=     ! !!S	!-5d3i-@!	#Y!r   c                   V'       d)   \        W4       UUu. uF  w  r4V'       d   TM^ NK  	  ppp\        V4      pV^ 8  g   Q R4       hT p. pVP                  pVf   ^ .\        V4      ,          p	MTp	\        W4       FI  w  r:V^ 8  d$   \	        V
\        W6,          V,          4      4      pMTpV! V4       WS,          pWk,          pKK  	  V# u uppi )a   Distribute an integer total in to parts based on ratios.

Args:
    total (int): The total to divide.
    ratios (List[int]): A list of integer ratios.
    minimums (List[int]): List of minimum values for each slot.

Returns:
    List[int]: A list of integers guaranteed to sum to total.
zSum of ratios must be > 0)r2   r3   rB   lenmaxr   )r%   r>   rN   r   _minrF   rG   distributed_totalrB   	_minimumsminimumrK   s   &&&         r   ratio_distributerV   k   s     :=f:OP:O;54%Q&:OPf+K?777?O#%%%FC#f+%		f0?gtE,Ck,Q'RSK)K{& 1 ' Qs   C__main__)	dataclassc                   8   a  ] tR t^t o Rt^t^tV 3R ltRtV t	R# )ENc                N   < V ^8  d   Qh/ S[ S[,          ;R&   S[;R&   S[;R&   # r   r   )r   r   s   "r   r   E.__annotate__   s-     sm"    	 r   r   )
r   r   r   r   r   r   r   r    r!   r"   r#   s   @r   rZ   rZ      s     "	  r   rZ   )N)	fractionsr   mathr   typingr   r   r   r   r	   r   r<   rL   rV   r   dataclassesrX   rZ   resolvedprintr3   r   r   r   <module>rc      s      ; ;8 :"z@!H z%  
 S1T1a=!D!Q-4A"OPH	#h- r   