o
    j                     @  s   d dl mZ d dlmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZmZmZ e
r0d dlmZ eeef Z	 G dd deZG d	d
 d
eZG dd deZdddZdS )    )annotations)CallableIterableMutableMapping)r   )Path)TYPE_CHECKINGAny	TypedDictcast)NotRequiredc                   @  s   e Zd ZU dZded< 	 ded< 	 ded< 	 ded< 	 ded	< 	 ded
< 	 ded< 	 ded< 	 ded< 	 ded< 	 ded< 	 ded< 	 ded< 	 ded< dS )OptionsTypezOptions for parsing.int
maxNestingboolhtmllinkifytypographerstrquotesxhtmlOutbreaks
langPrefix%Callable[[str, str, str], str] | None	highlightzNotRequired[bool]store_labels	tasklistsalertstasklists_editablestrikethrough_single_tildeN__name__
__module____qualname____doc____annotations__ r%   r%   W/var/www/html/fyndo/pharma/fyndo/venv/lib/python3.10/site-packages/markdown_it/utils.pyr      s<   
 r   c                   @  s$   e Zd ZU dZded< 	 ded< dS )
PresetTypez%Preset configuration for markdown-it.r   optionsz3MutableMapping[str, MutableMapping[str, list[str]]]
componentsNr   r%   r%   r%   r&   r'   6   s   
 r'   c                   @  sn  e Zd ZdZd:ddZd;ddZd<ddZd=ddZd>ddZd?ddZ	d@ddZ
d@ddZed?ddZejdAddZedBd d!ZejdCd"d!ZedBd#d$ZejdCd%d$ZedBd&d'ZejdCd(d'Zed@d)d*ZejdDd+d*ZedBd,d-ZejdCd.d-ZedBd/d0ZejdCd1d0Zed@d2d3ZejdDd4d3ZedEd6d7ZejdFd8d7Zd9S )GOptionsDictzMA dictionary, with attribute access to core markdownit configuration options.r(   r   returnNonec                 C  s   t tt|| _d S N)r
   r   dict_options)selfr(   r%   r%   r&   __init__E   s   zOptionsDict.__init__keyr   r   c                 C  s
   | j | S r-   r/   r0   r2   r%   r%   r&   __getitem__H      
zOptionsDict.__getitem__valuec                 C  s   || j |< d S r-   r3   )r0   r2   r7   r%   r%   r&   __setitem__K   s   zOptionsDict.__setitem__c                 C  s   | j |= d S r-   r3   r4   r%   r%   r&   __delitem__N   s   zOptionsDict.__delitem__Iterable[str]c                 C  
   t | jS r-   )iterr/   r0   r%   r%   r&   __iter__Q   r6   zOptionsDict.__iter__r   c                 C  r;   r-   )lenr/   r=   r%   r%   r&   __len__T   r6   zOptionsDict.__len__c                 C  r;   r-   )reprr/   r=   r%   r%   r&   __repr__W   r6   zOptionsDict.__repr__c                 C  r;   r-   )r   r/   r=   r%   r%   r&   __str__Z   r6   zOptionsDict.__str__c                 C  
   | j d S )z%Internal protection, recursion limit.r   r3   r=   r%   r%   r&   r   ]      
zOptionsDict.maxNestingc                 C     || j d< d S )Nr   r3   r0   r7   r%   r%   r&   r   b      r   c                 C  rD   )zEnable HTML tags in source.r   r3   r=   r%   r%   r&   r   f   rE   zOptionsDict.htmlc                 C  rF   )Nr   r3   rG   r%   r%   r&   r   k   rH   c                 C  rD   )z1Enable autoconversion of URL-like texts to links.r   r3   r=   r%   r%   r&   r   o   rE   zOptionsDict.linkifyc                 C  rF   )Nr   r3   rG   r%   r%   r&   r   t   rH   c                 C  rD   )z$Enable smartquotes and replacements.r   r3   r=   r%   r%   r&   r   x   rE   zOptionsDict.typographerc                 C  rF   )Nr   r3   rG   r%   r%   r&   r   }   rH   c                 C  rD   )zQuote characters.r   r3   r=   r%   r%   r&   r      rE   zOptionsDict.quotesc                 C  rF   )Nr   r3   rG   r%   r%   r&   r      rH   c                 C  rD   )z&Use '/' to close single tags (<br />).r   r3   r=   r%   r%   r&   r      rE   zOptionsDict.xhtmlOutc                 C  rF   )Nr   r3   rG   r%   r%   r&   r      rH   c                 C  rD   )z)Convert newlines in paragraphs into <br>.r   r3   r=   r%   r%   r&   r      rE   zOptionsDict.breaksc                 C  rF   )Nr   r3   rG   r%   r%   r&   r      rH   c                 C  rD   )z&CSS language prefix for fenced blocks.r   r3   r=   r%   r%   r&   r      rE   zOptionsDict.langPrefixc                 C  rF   )Nr   r3   rG   r%   r%   r&   r      rH   r   c                 C  rD   )zEHighlighter function: (content, langName, langAttrs) -> escaped HTML.r   r3   r=   r%   r%   r&   r      rE   zOptionsDict.highlightc                 C  rF   )Nr   r3   rG   r%   r%   r&   r      rH   N)r(   r   r+   r,   )r2   r   r+   r   )r2   r   r7   r   r+   r,   )r2   r   r+   r,   )r+   r:   )r+   r   )r+   r   )r7   r   r+   r,   )r+   r   )r7   r   r+   r,   )r7   r   r+   r,   )r+   r   )r7   r   r+   r,   )r    r!   r"   r#   r1   r5   r8   r9   r>   r@   rB   rC   propertyr   setterr   r   r   r   r   r   r   r   r%   r%   r%   r&   r*   ?   s\    







r*   path
str | Pathr+   list[list[Any]]c                 C  s   t | jdd}g }d}d}|jdd}tt|D ]M}||  dkrg|dkr8||||d   g d}n-|dkrO|d d	||d |  d
}n|d
kre|d d	||d |  d}|}q|S )Nzutf-8)encodingr   T)keepends.       )	r   	read_text
splitlinesranger?   rstripappendstripjoin)rK   texttestssectionlast_poslinesir%   r%   r&   read_fixture_file   s&     rb   N)rK   rL   r+   rM   )
__future__r   collections.abcr   r   r   MutableMappingABCpathlibr   typingr   r   r	   r
   typing_extensionsr   r   EnvTyper   r'   r*   rb   r%   r%   r%   r&   <module>   s    $	p