
    c                     B    d dl mZ d dlmZ d dlmZ 	 ddededefd	Zd
S )    )
MarkdownIt)
StateBlock)StateInline{}mdstart_delimiterend_delimiterc                 B   t                    t                    dt          dt          ffd}dt          dt          dt          dt          ffd}| j        j                            dd|           | j        j                            d	d
|           dS )zA plugin to create substitution tokens.

    These, token should be handled by the renderer.

    Example::

        {{ block }}

        a {{ inline }} b

    statesilentc                    	 | j         | j                 	k    s| j         | j        dz            	k    rdS n# t          $ r Y dS w xY w| j        dz   }d}	 	 | j                             |          }n# t          $ r Y dS w xY w	 | j         |dz            k    rd}nn# t          $ r Y dS w xY w|dz   }^|sdS | j        | j        dz   |                                         }|dz   | _        |rdS |                     ddd          }d|_        ||_	        |
                    dd	           |
                    d
|           
  |_        dS )N   F   Tsubstitution_inlinespanr   classsubstitutiontext)srcCharCodepos
IndexErrorindex
ValueErrorsrcstrippushblockcontentattrSetmarkup)r   r   r   found_closingendr   tokenend_charr
   
start_charr	   s          <lib/python3.11/site-packages/mdit_py_plugins/substitution.py_substitution_inlinez1substitution_plugin.<locals>._substitution_inline   s   	!%),
:$UY]3zA u	
  	 	 	55	 i!m	'--h<<   uu$S1W-9 $(M    uu'C	  	5yQ,-3355!G	 	4

0&!<<g~...fd###):=::ts3   /5 
AAA0 0
A>=A>B 
B('B(	startLineendLinec                    | j         |         | j        |         z   }| j        |         }| j        |         | j        z
  dk    rdS | j        ||                                         }	 |d         
k    s7|d         
k    s+|d         	k    s|d         	k    st          |          dk     rdS n# t          $ r Y dS w xY w|dd                                         }	dz  |v rdS |dz   | _	        |rd	S | 
                    d
dd          }d	|_        ||_        |                    dd           |                    d|           
 	 |_        || j	        g|_        d	S )N   Fr   r      r   Tsubstitution_blockdivr   r   r   )bMarkstShifteMarkssCount	blkIndentr   r   lenr   liner   r   r   r    r!   map)r   r)   r*   r   startPosr#   lineTextr   r$   r
   r	   s            r'   _substitution_blockz0substitution_plugin.<locals>._substitution_blockC   s    <	*U\)-DDl9% <	"U_49 	59Xc\*0022
	.A;/1 B<=0 B<=0	
 x==1$ u  	 	 	55	 "~##%% A$& 	5]
 	4

/::g~...fd###):=::
+	ts   'AB- -
B;:B;fencer0   escaper   N)	ordr   boolr   intr   rulerbeforeinline)r   r	   r
   r(   r<   r%   r&   s    ``  @@r'   substitution_pluginrE      s     _%%J=!!H)K ) ) ) ) ) ) ) ) ) )V++&)+47+AE+ + + + + + +Z HN'#79LMMMIO8%:<PQQQQQ    N)r   r   )markdown_itr   markdown_it.rules_blockr   markdown_it.rules_inliner   strrE    rF   r'   <module>rL      s    " " " " " " . . . . . . 0 0 0 0 0 0 FIkR kRkR%(kR?BkR kR kR kR kR kRrF   