+
     h_  c            
       sX   ^ RI t ^ RIHt ^ RIHt ^ RIHtHtHtH	t	 ] P                  R8  d   ^ RIHt M^ RI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# )    N)Fraction)ceil)castListOptionalSequence)Protocolc                   s<   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__   "</usr/lib/python3.14/site-packages/pip/_vendor/rich/_ratio.py__annotate__ZEdge.__annotate__   s/      3-  N	 
       )__name__
__module____qualname____firstlineno__Z__doc__r   r   r   __annotate_func____static_attributes____classdictcell__r      @r   r   r      s     ;DEL  r   r   c                sh    V ^8  d   QhR\         R\        \        ,          R\        \         ,          /# )r   totaledgesreturn)r   r   r   r   r      "r   r   r      s)     :" :" :"Xd^ :"S	 :"r   c                s   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   s8   "   T F  q;'       g    ^ x  K  	  R# 5i)r    Nr   ).0r   s   & r   	<genexpr> ratio_resolve.<locals>.<genexpr>2   s     <ed			es   c              3   sR   "   T F  w  rVP                   ;'       g    ^x  K  	  R# 5i)i   N)r   )r'   Z_edges   &  r   r(   r)   ;   s     KNDJJOO!ONs   '')r   r   Z	enumeratezipsumr   r   Zdivmodr   r   r   )r"   r#   r*   ZsizesZ	_FractionZindexr   Zflexible_edgesZ	remainingZportionZ	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                s    V ^8  d   QhR\         R\        \         ,          R\        \         ,          R\        \         ,          R\        \         ,          /# )r   r"   ratiosmaximumsvaluesr$   )r   r   r%   r&   r   r   r   Q   sD      S	-1#Y@DS		#Yr   c                s   \        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)r+   r,   appendZminZround)r"   r.   r/   r0   r   Z_maxtotal_ratiototal_remainingZresultr1   ZmaximumZvaluedistributeds   &&&&         r   ratio_reducer5   Q   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c          	      s    V ^8  d   QhR\         R\        \         ,          R\        \        \         ,          ,          R\        \         ,          /# )r   r"   r.   minimumsr$   )r   r   r   r%   r&   r   r   r   q   s=     ! !!S	!-5d3i-@!	#Y!r   c                s   V'       d)   \        W4       UUu. uF  w  r4V'       d   TM^ NK  	  ppp\        V4      p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.
)r+   r,   r1   ZlenZmaxr   )r"   r.   r6   r   Z_minr2   r3   Zdistributed_totalr1   Z	_minimumsZminimumr4   s   &&&         r   ratio_distributer7   q   s     :=f:OP:O;54%Q&:OPf+K O#%%%FC#f+%		f0?gtE,Ck,Q'RSK)K{& 1 ' Qs   C Z__main__)	dataclassc                   s8   a  ] tR t^t o Rt^t^tV 3R ltRtV t	R# )ENc                r	   r
   r   r   r   r   r   ZE.__annotate__   s-     sm"    	 r   r   )
r   r   r   r   r   r   r   r   r   r   r    r!   r   r9   r9      s     "	  r   r9   )i   i   )N)ZsysZ	fractionsr   Zmathr   Ztypingr   r   r   r   Zversion_infor   Zpip._vendor.typing_extensionsr   r-   r5   r7   r   Zdataclassesr8   r9   ZresolvedZprintr,   r   r   r   <module>r:      s    
   1 1v68 :"z@!H z%  
 S1T1a=!D!Q-4A"OPH	#h- r   