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%   úN/var/www/html/CropPilot/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