+
    '(j#                       R t ^ RIHt ^ RIHt ^ RIHtHt ^ RIH	t	H
t
HtHt ^ RIt^RIHt ]	'       d   ^ RIHt  ! R R	4      t ! R
 R]RR7      t]! R4      t ]! RR7       ! R R]
],          4      4       t ! R R]
],          4      tR# )a  
class Ruler

Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
[[MarkdownIt#inline]] to manage sequences of functions (rules):

- keep rules in defined order
- assign the name to each rule
- enable/disable rules
- add/replace rules
- allow assign rules to additional named chains (in the same)
- caching lists of active rules

You will not need use this class directly until write plugins. For simple
rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
[[MarkdownIt.use]].
)annotations)Iterable)	dataclassfield)TYPE_CHECKINGGeneric	TypedDictTypeVarN)EnvType)
MarkdownItc                  x    ] tR t^ tR R lt]R R l4       t]P                  R R l4       t]R R l4       tR	t	R
# )	StateBasec               $    V ^8  d   QhRRRRRR/# )   srcstrmdr   envr
    )formats   "F/home/ubuntu/cf-venv/lib/python3.14/site-packages/markdown_it/ruler.py__annotate__StateBase.__annotate__!   s!      C Z g     c                	*    Wn         W0n        W n        R # N)r   r   r   )selfr   r   r   s   &&&&r   __init__StateBase.__init__!   s    r   c                   V ^8  d   QhRR/# )r   returnr   r   )r   s   "r   r   r   '   s      S r   c                	    V P                   # r   )_srcr   s   &r   r   StateBase.src&   s    yyr   c                    V ^8  d   QhRRRR/# )r   valuer   r    Noner   )r   s   "r   r   r   +   s     9 9 9 9r   c                	     Wn         R V n        R # r   )r"   _srcCharCode)r   r&   s   &&r   r   r$   *   s    	48r   c                   V ^8  d   QhRR/# )r   r    ztuple[int, ...]r   )r   s   "r   r   r   0   s     ! !_ !r   c                	    \         P                  ! R \        ^R7       V P                  fF   \        ;QJ d    . R V P
                   4       F  NK  	  5M! R V P
                   4       4      V n        V P                  # )z?StateBase.srcCharCode is deprecated. Use StateBase.src instead.)
stacklevelc              3  8   "   T F  p\        V4      x  K  	  R # 5ir   )ord).0cs   & r   	<genexpr>(StateBase.srcCharCode.<locals>.<genexpr>7   s     %@ic!ffis   )warningswarnDeprecationWarningr)   tupler"   r#   s   &r   srcCharCodeStateBase.srcCharCode/   sZ    M	

 $ %%@dii%@%@dii%@ @D   r   )r"   r)   r   r   r   N)
__name__
__module____qualname____firstlineno__r   propertyr   setterr7   __static_attributes__r   r   r   r   r       sG    
   	ZZ9 9 ! !r   r   c                  "    ] tR t^;t$ R]R&   RtR# )RuleOptionsType	list[str]altr   N)r9   r:   r;   r<   __annotations__r?   r   r   r   rA   rA   ;   s    	Nr   rA   F)total
RuleFuncTvT)slotsc                  R    ] tR t^Ct$ R]R&   R]R&   ]! RR7      tR]R&   R	]R
&   RtR# )Ruler   nameboolenabledF)reprrF   fnrB   rC   r   N)r9   r:   r;   r<   rD   r   rN   r?   r   r   r   rI   rI   C   s     
IM&B
&	Nr   rI   c                      ] tR t^KtR R ltR R ltR R ltRR R	 lltRR
 R lltRR R llt	RR R llt
RR R lltRR R lltRR R lltRR R lltR R ltR R ltRtR# ) Rulerc                   V ^8  d   QhRR/# r   r    r'   r   )r   s   "r   r   Ruler.__annotate__L   s     B B$ Br   c                	"    . V n         R V n        R # r   )	__rules__	__cache__r#   s   &r   r   Ruler.__init__L   s    13 >Br   c                    V ^8  d   QhRRRR/# )r   rJ   r   r    intr   )r   s   "r   r   rS   T   s      S S r   c                l    \        V P                  4       F  w  r#VP                  V8X  g   K  Vu # 	  R# )zFind rule index by name)	enumeraterU   rJ   )r   rJ   irules   &&  r   __find__Ruler.__find__T   s/     0GAyyD  1 	r   c                   V ^8  d   QhRR/# rR   r   )r   s   "r   r   rS   [   s     6 6T 6r   c                   R0pV P                    F;  pVP                  '       g   K  VP                   F  pVP                  V4       K  	  K=  	  / V n        V F  p. V P                  V&   V P                    F]  pVP                  '       g   K  V'       d   WBP                  9  d   K1  V P                  V,          P                  VP                  4       K_  	  K  	  R# )zBuild rules lookup cache N)rU   rL   rC   addrV   appendrN   )r   chainsr^   rJ   chains   &    r   __compile__Ruler.__compile__[   s    NND<<<

4  ! #
 E$&DNN5!|||e883u%,,TWW5 ' r   Nc               (    V ^8  d   QhRRRRRRRR/# 	r   ruleNamer   rN   rF   optionsRuleOptionsType | Noner    r'   r   )r   s   "r   r   rS   n   s,      !+6L	r   c                    V P                  V4      pT;'       g    / pVR8X  d   \        RV 24      hW P                  V,          n        VP	                  R. 4      V P                  V,          n        RV n        R# )zReplace rule by name with new function & options.

:param ruleName: rule name to replace.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
Parser rule not found: rC   Nr[   )r_   KeyErrorrU   rN   getrC   rV   )r   rl   rN   rm   indexs   &&&& r   atRuler.atn   si     h'--RB;4XJ?@@#%u $+KKr$:u!r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   
beforeNamer   rl   rN   rF   rm   rn   r    r'   r   )r   s   "r   r   rS      s<        	
 ( 
r   c                    V P                  V4      pT;'       g    / pVR8X  d   \        RV 24      hV P                  P                  V\        \
        ,          ! VRW4P                  R. 4      4      4       RV n        R# )a  Add new rule to chain before one with given name.

:param beforeName: new rule will be added before this one.
:param ruleName: new rule will be added before this one.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
rp   TrC   Nr[   r_   rq   rU   insertrI   rF   rr   rV   )r   rw   rl   rN   rm   rs   s   &&&&& r   beforeRuler.before   sp     j)--RB;4ZLABB4
#HdBE28NO	
 r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   	afterNamer   rl   rN   rF   rm   rn   r    r'   r   )r   s   "r   r   rS      s<        	
 ( 
r   c                   V P                  V4      pT;'       g    / pVR8X  d   \        RV 24      hV P                  P                  V^,           \        \
        ,          ! VRW4P                  R. 4      4      4       RV n        R# )a  Add new rule to chain after one with given name.

:param afterName: new rule will be added after this one.
:param ruleName: new rule will be added after this one.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
rp   TrC   Nr[   ry   )r   r~   rl   rN   rm   rs   s   &&&&& r   afterRuler.after   st     i(--RB;4YK@AAAItJ'$KKr<RS	
 r   c               (    V ^8  d   QhRRRRRRRR/# rk   r   )r   s   "r   r   rS      s,      !+6L	r   c                    V P                   P                  \        \        ,          ! TRY#;'       g    / P	                  R. 4      4      4       RV n        R# )zPush new rule to the end of chain.

:param ruleName: new rule will be added to the end of chain.
:param fn: new rule function.
:param options: new rule options (not mandatory).

TrC   N)rU   re   rI   rF   rr   rV   )r   rl   rN   rm   s   &&&&r   push
Ruler.push   sC     	XtR--R1D1DUB1OP	
 r   c               $    V ^8  d   QhRRRRRR/# r   nameszstr | Iterable[str]ignoreInvalidrK   r    rB   r   )r   s   "r   r   rS      $      (9=	r   c                ,   \        V\        4      '       d   V.p. pV Fk  pV P                  V4      pV^ 8  d   V'       d   K%  V^ 8  d   V'       g   \        RV 24      hRV P                  V,          n        VP                  V4       Km  	  RV n        V# )zEnable rules with given names.

:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
!Rules manager: invalid rule name TN
isinstancer   r_   rq   rU   rL   re   rV   r   r   r   resultrJ   idxs   &&&   r   enableRuler.enable   s     eS!!GED--%Ca]a!B4&IJJ*.DNN3'MM$  r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   rS      s$     1 1(19=1	1r   c                    \        V\        4      '       d   V.pV P                   F
  pRVn        K  	  V P	                  W4      # )a  Enable rules with given names, and disable everything else.

:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
F)r   r   rU   rL   r   )r   r   r   r^   s   &&& r   
enableOnlyRuler.enableOnly   s<     eS!!GENND DL #{{500r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   rS      r   r   c                ,   \        V\        4      '       d   V.p. pV Fk  pV P                  V4      pV^ 8  d   V'       d   K%  V^ 8  d   V'       g   \        RV 24      hRV P                  V,          n        VP                  V4       Km  	  RV n        V# )zDisable rules with given names.

:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
r   FNr   r   s   &&&   r   disableRuler.disable   s     eS!!GED--%Ca]a!B4&IJJ*/DNN3'MM$  r   c                    V ^8  d   QhRRRR/# )r   	chainNamer   r    zlist[RuleFuncTv]r   )r   s   "r   r   rS      s     7 7# 7/? 7r   c                    V P                   f!   V P                  4        V P                   f   Q hV P                   P                  V. 4      ;'       g    . # )a  Return array of active functions (rules) for given chain name.
It analyzes rules configuration, compiles caches if not exists and returns result.

Default chain name is `''` (empty string). It can't be skipped.
That's done intentionally, to keep signature monomorphic for high speed.

)rV   rh   rr   )r   r   s   &&r   getRulesRuler.getRules   sI     >>!>>---~~!!)R066B6r   c                   V ^8  d   QhRR/# r   r    rB   r   )r   s   "r   r   rS     s     0 0y 0r   c                V    V P                    Uu. uF  qP                  NK  	  up# u upi )z Return all available rule names.)rU   rJ   r   rs   & r   get_all_rulesRuler.get_all_rules  s      $/1///s   &c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rS     s     = =) =r   c                ~    V P                    Uu. uF"  qP                  '       g   K  VP                  NK$  	  up# u upi )zReturn the active rule names.)rU   rL   rJ   r   s   & r   get_active_rulesRuler.get_active_rules  s(     $<1))<<<s   ::)rV   rU   r   )F)rc   )r9   r:   r;   r<   r   r_   rh   rt   r{   r   r   r   r   r   r   r   r   r?   r   r   r   rP   rP   K   sI    B6&$0001 070= =r   rP   )__doc__
__future__r   collections.abcr   dataclassesr   r   typingr   r   r   r	   r3   utilsr
   markdown_itr   r   rA   rF   rI   rP   r   r   r   <module>r      s   $ # $ ( = =  &! !6iu  \"
 F 7:  H=GJ H=r   