+
    	i%                         R 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 4       tR	 tR
 tRR ltRR ltR# )zLayout for floating boxes.)inf)boxes)handle_min_max_width)resolve_percentagesresolve_position_percentages)shrink_to_fit) inline_replaced_box_width_height)table_wrapper_widthc                 b    V P                   R 8X  d   \        WVP                   4      V n         R# R# )autoN)widthr   )boxcontextcontaining_blocks   &&&]/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/weasyprint/layout/float.pyfloat_widthr      s*     yyF!'0@0F0FG	     c                   ^RI Hp ^RIHp ^RIHp	 VP                  VP                  r\        WV34       VR8X  d"   VP                  VP                  4       ,
          p\        WV34       VP                  R8X  d   ^ Vn        VP                  R8X  d   ^ Vn        VP                  R8X  d   ^ Vn        VP                  R8X  d   ^ Vn        \!        W4      pVe   V;P                  V,          un	        \#        V\$        P&                  4      '       d   \)        W4       MVP                  R8X  d   \+        WV4       VP,                  '       d   \/        WW34       \#        V\$        P0                  4      '       d   V! WWVRW4RRRRRR7      w  r   pM\#        V\$        P2                  4      '       d   V! WVWbRVVRR	7	      w  r  pMX\#        V\$        P4                  4      '       d   V	! WVWbRVVR
7      w  r  pM$\#        V\$        P&                  4      '       g   Q hRp\7        WV4      pV P8                  P;                  V4       W3# )z/Set the width and position of floating ``box``.)block_container_layout)flex_layout)grid_layoutr   NTF)
bottom_space
skip_stackpage_is_emptyabsolute_boxesfixed_boxesadjoining_marginsfirst_letter_stylefirst_line_stylediscard	max_lines)r   r   r   r   r   r   r   )r   r   r   r   r   r   )blockr   flexr   gridr   r   heightr   
position_ycontent_box_yr   margin_leftmargin_right
margin_topmargin_bottomget_clearance
isinstancer   BlockReplacedBoxr   r   is_table_wrapperr	   BlockContainerBoxFlexContainerBoxGridContainerBoxfind_float_positionexcluded_shapesappend)r   r   r   r   r   r   r   r   r   r   cb_width	cb_height	clearance	resume_at_s   &&&&&&&        r   float_layoutr:      s    .!!+113C3J3Ji	23 F''*:*H*H*JJ 	 !&;<
& 
6!
~~
F"g+I)##u--..(?	f	C"23
G8*?@#u..//%;|~"tdT	&+"1a
 
C//	0	0"-|!~#U	#41a
 
C//	0	0"-|!~#	#%1a #u556666	
g,<
=C""3'>r   c                   V P                   '       dQ   V P                   R,          P                  pVP                  V8  d#   VP                  ^ W1P                  ,
          4       \        WV4      w  rEpVP                  R,          R8X  d   WFVP                  4       ,
          ,          pVP                  WAP                  ,
          WQP                  ,
          4       V# )z,Get the right position of the float ``box``.floatright)r3   r%   	translateavoid_collisionsstylemargin_width
position_x)r   r   r   	highest_yrC   r%   available_widths   &&&    r   r2   r2   X   s     ++B/::	>>I%MM!Y78 /?&/(+JO yyW$(8(8(:::
MM*~~-zNN/JKJr   c                   V P                    FN  pVP                  4       '       g   K  VP                  R,          VP                  R,          R39   g   KH  \        u # 	  RpVP                  V,           pV P
                   F}  pVP                  R,          VP                  R,          R39   g   K0  VP                  VP                  4       rWWV,           8  g   KZ  \        T;'       g    ^ Wx,           V,
          4      pK  	  V# )zDReturn None if there is no clearance, otherwise the clearance value.clearr<   bothN)broken_out_of_flow
is_floatedrA   r   r%   r3   margin_heightmax)	r   r   collapsed_marginbroken_shaper7   hypothetical_positionexcluded_shapeyhs	   &&&      r   r+   r+   t   s      22""$$yy!l&8&8&A6%JJ
 3
 INN-==!1199W."6"6w"?!HH!,,n.J.J.Lq$1u,^^!ae.C&CE		 2 r   c                    V P                   pV'       d   VP                  MVP                  4       pV'       d   VP                  4       MVP	                  4       pV'       d   VP                  4       MVP                  4       pVP                  4       ^ 8X  d&   VP                  4       '       d   ^ ^ VP                  3#  . pV F  p	V	P                  p
V	P                  4       pYu;8  d   W,           8  g=   M WV,           u;8  d   W,           8  g    M W8  g   KZ  W,           WW,           8:  g   Ko  VP                  V	4       K  	  V U	u. uF>  p	V	P                  R,          R8X  g   K  V	P                  V	P                  4       ,           NK@  	  pp	V U	u. uF)  p	V	P                  R,          R8X  g   K  V	P                  NK+  	  pp	VP                  4       pVP                  4       VP                  ,           pV'       g%   WP                  ,          pWP                  ,          pV'       g	   V'       df   V'       d   \        \        V4      V4      pV'       d   \!        \!        V4      V4      pWoV,
          8  d   \!        R V 4       4      pVV8  d   TpEK   TP                  R,          R9   gk   \#        T\$        P&                  4      '       gK   TP(                  '       g9   \#        T\$        P*                  4      '       g   TP-                  4       '       g   Q hTpTP                  R,          R8X  d   TP                  R,          R8X  d   \#        T\$        P&                  4      '       d   TpM[TP(                  '       d
   Y,
          pM@\#        T\$        P*                  4      '       g   TP-                  4       '       g   Q hY,
          pY,
          pT'       g&   TTP                  ,          pYQP.                  ,          pTTT3# u up	i u up	i )	    r<   leftr=   c              3   d   "   T F&  pVP                   VP                  4       ,           x  K(  	  R # 5i)N)r%   rK   ).0shapes   & r   	<genexpr>#avoid_collisions.<locals>.<genexpr>   s.      %3!1 $$u':':'<<<!1s   .0none	directionrtl)r=   rU   )r3   r%   border_box_yrB   border_widthrK   border_heightrJ   r   r4   rA   rC   content_box_xr'   r(   rL   minr,   r   LineBoxr.   r-   establishes_formatting_contextr)   )r   r   r   outerr3   r%   	box_width
box_heightcolliding_shapesrX   shape_position_yshape_margin_heightleft_boundsright_boundsmax_left_boundmax_right_boundnew_position_yrC   rE   s   &&&&               r   r@   r@      sl   --O#(c.>.>.@J&+  "1A1A1CI(-""$33D3D3FJ
aCNN$4$4!%++++
$E$//"'"5"5"7! 8!78!$; 8!78!/!7() ''. % */){{7#v- 4Eu11333) 	 / *0){{7#w. E) 	 0 *779**,/?/E/EE 	 oo-N///O ,!$S%5~!F"%c,&7"I ^;;!$ %3!1%3 "3 "J.!/J 
7	0	03&&3..//**,,.	-  J
yyV#!!+.%7#u}}-- -
%%% -8

 sE$:$:;;6688:9,8
%6Ocoo%
nn$
z?22]/0s   P'%PP1PN)rT   )T)__doc__mathr   formatting_structurer   min_maxr   percentr   r   	preferredr   replacedr   tabler	   r   r:   r2   r+   r@    r   r   <module>ry      sJ       ( ) F $ 6 & H H@F8&f3r   