+
    	in,                     D    R t ^ RIHt ^RIHt R tR t ! R R]4      tR# )zImplement counter styles.

These are defined in CSS Counter Styles Level 3:
https://www.w3.org/TR/css-counter-styles-3/#counter-style-system

)inf)remove_whitespacec                     V w  rVR8X  d   V# R# )zCreate a string from a symbol.string  )string_or_urltype_values   &  ]/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/weasyprint/css/counters.pysymbolr      s     !LE    c                    \        V 4      p \        V 4      ^8X  dg   V w  pVP                  R8X  dP   VP                  R9   d    VP                  V9  d   VP                  # R# VP                  R8w  d   VP                  # R# R# R# )   identnoneN)decimaldisc)r   lentypelower_valuer
   )tokenscounter_styletokens   && r   parse_counter_style_namer      s~    v&F
6{a::   $77$$M9 ;;& :""f,{{" -	 ! r   c                   P   a a ] tR t^#t oRtRR ltRR ltR tV 3R ltRt	Vt
V ;t# )	CounterStylezCounter styles dictionary.

Keep a list of counter styles defined by ``@counter-style`` rules, indexed
by their names.

See https://www.w3.org/TR/css-counter-styles-3/.

c                   V^ ,          R9   d   Vw  r4VR8X  d   RpRV33pRpM_VR8X  dY   RV^ ,          V^ ,          R8X  d   ^MR3p\         ;QJ d    . R VR,           4       F  NK  	  5M! R VR,           4       4      pRpRXRRR	RR
XRRRRRRRXRR/	# W9   d   Vf   . pMW9   d   R# VP                  V4       W,          P                  4       pVR,          '       d   VR,          w  rp
MRRrYV	'       d   WP9   d   W,          pVR,          VR&   VP                  V4       VR,          '       d   VR,          w  rp
MRRrYV	'       d   WR9   d   RRrYKe  VP                  4        F  w  rW,          e   K  Vf   K  WV&   K  	  K  V# V# R# )    	symbols()r   Nfixedc              3   *   "   T F	  pR V3x  K  	  R# 5i)r   Nr   ).0arguments   & r   	<genexpr>/CounterStyle.resolve_counter.<locals>.<genexpr>6   s       H9FXXx(s   :r   NNsystemnegativeprefixsuffixrangeautopadfallbackr   symbolsadditive_symbolssymbolicextends)r   r   )NcyclicNr   r   )r    )r   -r3   r   r   r   )tupleappendcopyitems)selfcounter_nameprevious_typescounter_type	argumentsr&   r.   r)   counterr1   _extended_counternamer
   s   &&&           r   resolve_counterCounterStyle.resolve_counter,   s   ?55&2#Lx'/$i02',)A,Yq\W-D$P%  H9B2 H%%  H9B2 H H(&=.&wI7"B
 
 !%!#/!!,/(--/Gx  %,X%6""&
 >'+|$(8(BGH%"))&1x((-4X->**.
6#;*3Y '7'='='?"=0U5F,1DM (@ #NNC "r   c                   V'       g   V'       g   Q hT;'       g    V P                  W$4      pVf   RV 9   d   V P                  VR4      # R# VR,          '       d   VR,          w  rVpMRRRrvpVf   . pMWd9   d   V P                  VR4      # VP                  V4       V'       d   W`9   d   W,          pVR,          VR&   VR,          '       d   VR,          w  rVpMRRRrvpWd9   d   V P                  VR4      # VP                  V4       VP                  4        F  w  rW9,          e   K  V
f   K  WV	&   K  	  K  V P                  VR4      # VR,          R9   d%   \        ) \        rVR9   d   ^pM	VR8X  d   ^ pW33pM	VR,          pV F  w  rYu;8:  d
   V8:  g   K  M K   M&	  T P                  YR	,          ;'       g    RVR
7      # RpV^ 8  pV'       d6   R VR,          ;'       g    R 4       w  ppVR9   pV'       d   \        V4      pVR8X  dW   \        VR,          4      pV^8  d   V P                  VR4      # V^,
          V,          p\        VR,          V,          4      pEMNVR8X  d   \        VR,          4      pV^8  d   V P                  VR4      # W,
          p^ Tu;8:  d   V8  d   M M\        VR,          V,          4      pEMT P                  YR	,          ;'       g    RVR
7      # VR8X  du   \        VR,          4      pV^8  d   V P                  VR4      # V^,
          V,          pV^,
          V,          ^,           p\        VR,          V,          4      V,          pEMHVR8X  d   \        VR,          4      pV^8  d   V P                  VR4      # . pV^ 8w  dD   V^,          pVP                  \        VR,          VV,          ,          4      4       VV,          pKJ  RP                  \        V4      4      pEMVR8X  d   V^ 8X  d   \        VR,          ^ ,          4      pEM. p\        VR,          4      pV^8  d   V P                  VR4      # \        V4      pV^ 8w  d;   VP                  \        VR,          VV,          ,          4      4       VV,          pKA  RP                  \        V4      4      pMVR8X  d   V^ 8X  d)   VR,           F  w  ppV^ 8X  g   K  \        V4      pK  	  M. p\        VR,          4      ^8  d   V P                  VR4      # VR,           F[  w  ppVV,          pVP                  \        V4      .V,          4       VVV,          ,          pV^ 8X  g   KJ  RP                  V4      p M	  Vf%   T P                  YR	,          ;'       g    RVR
7      # Vf   Q hVR,          ;'       g    RpV^ ,          \        V4      ,
          pV'       d+   X'       d#   V\        X4      \        X4      ,           ,          pV^ 8  d!   V\        V^,          4      ,          V,           pV'       d   X'       d   XV,           X,           pV# )zjGenerate the counter representation.

See https://www.w3.org/TR/css-counter-styles-3/#generate-a-counter

Nr   r   r&   r0   r*   
alphabeticadditiver-   )r>   c              3   8   "   T F  p\        V4      x  K  	  R # 5iN)r   )r"   	characters   & r   r$   ,CounterStyle.render_value.<locals>.<genexpr>   s       0MK '0y!!Ks   r'   numericr2   r.   r    r/   r,   )r+   N)rH   r0   r5   )r0   rH   rN   rI   r7   )rE   render_valuer9   r;   r   absr   r   joinreversedextend)r<   counter_valuer=   rA   r>   r1   r&   fixed_numberrC   rD   r
   	min_range	max_rangecounter_rangesinitialis_negativenegative_prefixnegative_suffixuse_negativelengthindexrepeatreversed_partsweightsymbol_stringpartsrepetitionsr,   pad_differences   &&&&&                        r   rO   CounterStyle.render_valueg   sK    ,&&OOT11,O?D ((	BB 8,3H,=)G\,0*d\G !N%$$]I>>l+ ~#'< $4X$>!8$$4;H4E1G\48*d\G+,,]IFF%%f-#3#9#9#;KD},1B(- $< ((	BB 7~-$'4y33	:%	(46N$W-N$2 I6Y66 %3 $$z2??i- % / /
 #a'0M:&KK*KK0M,O_ AB   #M 2 X+,Fz((	BB"Q&&0EWY/67Gw+,Fz((	BB!0EE"F" !3E!:;((!:#6#C#C)#1 ) 3 3 z!+,Fz((	BB"Q&&0E#a'F2Q6FWY/67&@G|#+,Fz((	BBN1$"%%fI&}v'=>'@ A&(ggh~67Gy ! !3A!67!#WY/0A:,,]IFF #M 2#q("))&	*=6+AB+D E!f,M''(>":;z!!-45G-H-H)FM{"("7 .I w123a7,,]IFF-45G-H-H)FM"/6"9KLL&"7!8;!FG!Vk%99M$)"$''%. .I ((!:#6#C#C)#1 ) 3 3 """ en''Q#g,.<c/2S5IIINA$vc!f~5?G <%//AG r   c                    V P                  V4      pVf   RV 9   d   V P                  RV4      # R# \        VR,          ;'       g    R4      p\        VR,          ;'       g    R4      pV P                  W!R7      pVf   Q hWF,           V,           # )z2Generate the content of a ::marker pseudo-element.r   r   r(   r)   )r=   r3   )r   z. )rE   render_markerr   rO   )r<   r=   rT   rA   r(   r)   r
   s   &&&    r   ri   CounterStyle.render_marker  s    &&|4?D )))]CC );;^<)==-=>!!-!K   ~&&r   c                2   < \        \        SV `	  4       4      # rK   )r   superr:   )r<   	__class__s   &r   r:   CounterStyle.copy&  s    EGLN++r   r   rK   )NNN)__name__
__module____qualname____firstlineno____doc__rE   rO   ri   r:   __static_attributes____classdictcell____classcell__)rm   __classdict__s   @@r   r   r   #   s&     9vl\'", ,r   r   N)	rs   mathr   r   r   r   r   dictr   r   r   r   <module>rz      s*     %	#E,4 E,r   