B
    f’»d	  ã               @   sF   d dl Z d dlmZ e  d¡Zdd„ Zdd„ Zeeeedœd	d
„Z	dS )é    N)Úunpackz[\U00010000-\U0010FFFF]c             C   s   t  dd„ | ¡S )Nc             S   s$   d  dd„ td|  ¡  d¡ƒD ƒ¡S )NÚ c             s   s   | ]}t |ƒV  qd S )N)Úchr)Ú.0Úi© r   ú9/tmp/pip-unpacked-wheel-rcokkf2l/pyrogram/parser/utils.pyú	<genexpr>   s    z3add_surrogates.<locals>.<lambda>.<locals>.<genexpr>z<HHzutf-16le)Újoinr   ÚgroupÚencode)Úmatchr   r   r   Ú<lambda>   s    z add_surrogates.<locals>.<lambda>)ÚSMP_REÚsub)Útextr   r   r   Úadd_surrogates   s    r   c             C   s   |   dd¡ d¡S )Nzutf-16Úsurrogatepass)r   Údecode)r   r   r   r   Úremove_surrogates#   s    r   )ÚsourceÚoldÚnewÚstartc             C   s"   | d |… | |d …   ||d¡ S )Né   )Úreplace)r   r   r   r   r   r   r   Úreplace_once(   s    r   )
ÚreÚstructr   Úcompiler   r   r   ÚstrÚintr   r   r   r   r   Ú<module>   s
   
	