+
    	i                     ^    R t ^ RIHt ^RIHt ^RIHt ^RIHt R t	R t
R tR tR	 tR
 tR# )z&Resolve percentages into fixed values.)inf)resolve_math)
check_math)boxesc                   \        V 4      '       d   \        WVR7      p V e   V R8X  d   V # V P                  P                  4       R8X  d   V P                  # V P                  R8X  g   Q hW P                  ,          ^d,          # )zmReturn the percentage of the reference value, or the value unchanged.

``refer_to`` is the length for 100%.

)refer_toautopx%)r   r   unitlowervalue)r   computedr   s   &&&_/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/weasyprint/layout/percent.py
percentager   
   sn     %Ux@}				t	#{{zzS   ++%++    c                    V P                   V,          p\        W0P                   V4      p\        WV4       VR9   d   VR8X  d   \        W^ 4       R# R# R# )zSet a used length value from a computed length value.

``refer_to`` is the length for 100%. If ``refer_to`` is not a number, it
just replaces percentages.

r   N)	min_width
min_height)styler   setattr)boxproperty_namer   r   percents   &&&  r   resolve_one_percentager      sO     IIm$E		84GC(3368IA& 9J3r   c                 v    Vw  r#\        V R V4       \        V RV4       \        V RV4       \        V RV4       R# )leftrighttopbottomN)r   )r   containing_blockcb_width	cb_heights   &&  r   resolve_position_percentagesr#   +   s:    *H31323y13)4r   c                X   \        V\        P                  4      '       d   VP                  pVP                  pMVw  r#\        V \        P
                  4      '       d   TpMTp\        V RV4       \        V RV4       \        V RV4       \        V RV4       \        V RV4       \        V RV4       \        V RV4       \        V RV4       \        V R	V4       \        V R
V4       \        V RV4       VR8X  d   V P                  R,          pVR8X  g#   \        V4      '       g   VP                  R8X  d	   RV n        M2VP                  P                  4       R8X  g   Q hVP                  V n        \        V R^ 4       \        V R\        4       M'\        V RV4       \        V RV4       \        V RV4       V P                  R,          R8H  pR FA  pRV R2pV'       d   \        W4      '       d   K$  \        WV P                  V,          4       KC  	  \        V R	4       \        V R4       R# )z0Set used values as attributes of the box object.margin_leftmargin_right
margin_topmargin_bottompadding_leftpadding_rightpadding_toppadding_bottomwidthr   	max_widthr   heightr
   r	   r   
max_heightborder_collapsecollapseborder__widthN)r   r   r   r   )
isinstancer   Boxr-   r/   PageBoxr   r   r   r   r   r   r   hasattrr   adjust_box_sizing)	r   r    r!   r"   maybe_heightr/   r2   sideprops	   &&       r   resolve_percentagesr=   3   s   "EII..#))$++	.#u}}%% 3x8393l;3>393:3|<3 0,?323X63X6 F 8$Vz&11V[[C5GCJ;;$$&$...CJsL!4sL#6sHi8sL)<sL)<yy*+z9H2f% WS//Csyy/ 3 c7#c8$r   c                    R F  pRV R2pV P                   V,          pVw  rERWE39   d   \        WR4       K6  VP                  R4       F"  pW`P                  9   g   K  \        WR4        Kk  	  \	        W@P                   V P                  4       4      p\	        WPP                   V P                  4       4      p\        WWE34       K  	  R# )top_leftr3   _radius_N)r?   	top_rightbottom_rightbottom_left)    r	   )rE   rE   )r   r   splitremove_decoration_sidesr   border_widthborder_height)r   cornerr   r   rxryr;   s   &      r   resolve_radii_percentagesrM   k   s    J!&199]+  C/LL%D222F3 &
 B		3+;+;+=>BB		3+<+<+>?BC1# Kr   c                    V P                   R ,          R8X  d   VR8X  dA   V P                  V P                  ,           V P                  ,           V P                  ,           pMV P
                  V P                  ,           V P                  ,           V P                  ,           pMwV P                   R ,          R8X  dD   VR8X  d   V P                  V P                  ,           pM:V P
                  V P                  ,           pMV P                   R ,          R8X  g   Q h^ pV^ 8  d   \        W4      R8w  d'   \        W\        ^ \        W4      V,
          4      4       \        V RV 2\        ^ \        V RV 24      V,
          4      4       \        V RV 24      R8w  d1   \        V RV 2\        ^ \        V RV 24      V,
          4      4       R# R# R# )	
box_sizingz
border-boxr-   zpadding-boxzcontent-boxr   max_min_N)r   r)   r*   border_left_widthborder_right_widthr+   r,   border_top_widthborder_bottom_widthgetattrr   max)r   axisdeltas   && r   r9   r9      s   
yy,.7?  3#4#44%%&(+(>(>? 
 #"4"44$$%'*'>'>?  
<	 M	17?$$s'8'88EOOc&8&88Eyy&-777
 qy3'Cs1gc&85&@ABtD6]C73$tf+F+N$OP3$tf&&0C4vAwsd4&M/JU/R(ST 1	 r   N)__doc__mathr   cssr   css.functionsr   formatting_structurer   r   r   r#   r=   rM   r9    r   r   <module>r`      s4    ,   & (,"' 55%p2*Ur   