a
    ¶
þd9.  ã                ,   @   sŠ  d Z ddlZddlZddlZddlZg d¢Ze d¡Ze d¡Zdd„ Z	e	ƒ Z
dd	„ Ze d
¡Zeƒ Zdd„ Zdd„ Zeƒ Ze d¡Ze d¡Ze d¡Z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-ed.ƒd/ed0ƒd1ed2ƒd3ed4ƒd5ed6ƒd7ed8ƒd9ed:ƒd;ed<ƒd=iZd>d?„ Zeƒ Zd@dAdBdCdDdEœZe dFjf i e¤Žej¡ZdS )Gzi
This gives other modules access to the gritty details about characters and the
encodings that use them.
é    N)	zlatin-1zsloppy-windows-1252zsloppy-windows-1251zsloppy-windows-1250zsloppy-windows-1253zsloppy-windows-1254z
iso-8859-2ÚmacromanÚcp437u   [Ê¼â€˜-â€›]u	   [â€œ-â€Ÿ]c                  C   sV   dt  d¡i} tD ]>}tttddƒƒdg ƒ}| |¡}d |¡}t  |¡| |< q| S )a  
    ENCODING_REGEXES contain reasonably fast ways to detect if we
    could represent a given string in a given encoding. The simplest one is
    the 'ascii' detector, which of course just determines if all characters
    are between U+0000 and U+007F.
    Úasciiz^[ -]*$é€   é   é   z^[ --{0}]*$)ÚreÚcompileÚCHARMAP_ENCODINGSÚbytesÚlistÚrangeÚdecodeÚformat)Zencoding_regexesÚencodingZ
byte_rangeZcharlistÚregex© r   úV/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/ftfy/chardata.pyÚ_build_regexes   s    

r   c                  C   sj   i } t jj ¡ D ]T\}}| d¡r|| d| < || ¡ kr| ¡ }d| }t  |¡|kr| ¡ | |< q| S )Nú;ú&)ÚhtmlÚentitiesÚhtml5ÚitemsÚendswithÚlowerÚupperÚunescape)r   ÚnameÚcharZ
name_upperZentity_upperr   r   r   Ú_build_html_entities<   s    
r!   z&#?[0-9A-Za-z]{1,24};c                 C   s   t t|  | ¡ƒS )zâ
    Given text and a single-byte encoding, check whether that text could have
    been decoded from that single-byte encoding.

    In other words, check whether it can be encoded in that encoding, possibly
    sloppily.
    )ÚboolÚENCODING_REGEXESÚmatch)Útextr   r   r   r   Úpossible_encodingT   s    r&   c                  C   sJ   i } t  tddƒdgtddƒdgtddƒd	gtd
dƒ¡D ]}d| |< q8| S )zÕ
    Build a translate mapping that strips likely-unintended control characters.
    See :func:`ftfy.fixes.remove_control_chars` for a description of these
    codepoint ranges and why they should be removed.
    r   é	   é   é   é    é   ij   ip   iÿþ  iùÿ  iýÿ  N)Ú	itertoolsÚchainr   )Zcontrol_charsÚir   r   r   Ú_build_control_char_mapping_   s    ù	
r/   se   [ÂÃÅÎÐÙ][ ]|[âã][ ][€-„†-Ÿ¡-¿]|[à-ã][€-„†-Ÿ¡-¿][ ]|[ð][ ][€-¿][€-¿]|[ð][€-¿][ ][€-¿]|[ð][€-¿][€-¿][ ]s¥   [Â-ß][]|[Â-Ã][?]|í[ -¯][?]í[°-¿][?€-¿]|í[ -¯][?€-¿]í[°-¿][?]|[à-ï][?][€-¿]|[à-ï][€-¿][?]|[ð-ô][?][€-¿][€-¿]|[ð-ô][€-¿][?][€-¿]|[ð-ô][€-¿][€-¿][?]|z[\x80-\x9f]u   Ä²ZIJu   Ä³Ziju   Å‰u   Ê¼nu   Ç±ZDZu   Ç²ZDzu   Ç³Zdzu   Ç„u   DÅ½u   Ç…u   DÅ¾u   Ç†u   dÅ¾u   Ç‡ZLJu   ÇˆZLju   Ç‰Zlju   ÇŠZNJu   Ç‹ZNju   ÇŒZnju   ï¬€Úffu   ï¬Úfiu   ï¬‚Úflu   ï¬ƒÚffiu   ï¬„Úfflu   ï¬…u   Å¿tu   ï¬†Ústc                  C   s@   ddi} t ddƒD ](}t|ƒ}t d|¡}||kr|| |< q| S )zt
    Build a translate mapping that replaces halfwidth and fullwidth forms
    with their standard-width forms.
    i 0  ú iÿ  iðÿ  ÚNFKC)r   ÚchrÚunicodedataÚ	normalize)Z	width_mapr.   r    Ú	alternater   r   r   Ú_build_width_mapç   s    
r<   uÖ   Ã‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÃÃ‘Ã’Ã“Ã”Ã•Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÃÃžÃŸÄ‚Ä†ÄŒÄŽÄÄ˜ÄšÄžÄ°Ä¹ÅƒÅ‡ÅÅ˜ÅžÅ¢Å®Å°Î’Î“Î”Î•Î–Î—Î˜Î™ÎšÎ›ÎœÎÎžÎŸÎ Î¡Î£Î¤Î¥Î¦Î§Î¨Î©ÎªÎ«Î¬Î­Î®Î¯Ð’Ð“Ð”Ð•Ð–Ð—Ð˜Ð™ÐšÐ›ÐœÐÐžÐŸÐ Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯up   Ã Ã¡Ã¢Ã£Ã¤Ã¥Ã¦Ã§Ã¨Ã©ÃªÃ«Ã¬Ã­Ã®Ã¯ÄƒÄ‡ÄÄÄ™Ä›ÄºÅ•Î°Î±Î²Î³Î´ÎµÎ¶Î·Î¸Î¹ÎºÎ»Î¼Î½Î¾Î¿Ð°Ð±Ð²Ð³Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿u   Ã°Ã³Ä‘ÄŸÏ€ÏƒÑ€ÑƒuÉ   Â€-Â¿Ä„Ä…Ä½Ä¾ÅÅ‚Å’Å“ÅšÅ›ÅžÅŸÅ Å¡Å¤Å¥Å¸Å¹ÅºÅ»Å¼Å½Å¾Æ’Ë†Ë‡Ë˜Ë›ËœËÎ„Î…Î†ÎˆÎ‰ÎŠÎŒÎŽÎÐÐ‚ÐƒÐ„Ð…Ð†Ð‡ÐˆÐ‰ÐŠÐ‹ÐŒÐŽÐÑ‘Ñ’Ñ“Ñ”Ñ•Ñ–Ñ—Ñ˜Ñ™ÑšÑ›ÑœÑžÑŸÒÒ‘â€“â€”â€•â€˜â€™â€šâ€œâ€â€žâ€ â€¡â€¢â€¦â€°â€¹â€ºâ‚¬â„–â„¢ uª   Â€-Â¿Ä„Ä…Ä½Ä¾ÅÅ‚Å’Å“ÅšÅ›ÅžÅŸÅ Å¡Å¤Å¥Å¸Å¹ÅºÅ»Å¼Å½Å¾Æ’Ë†Ë‡Ë˜Ë›ËœËÎ„Î…Î†ÎˆÎ‰ÎŠÎŒÎŽÎÐÐ‚ÐƒÐ„Ð…Ð†Ð‡ÐˆÐ‰ÐŠÐ‹ÐŒÐŽÐÑ‘Ñ’Ñ“Ñ”Ñ•Ñ–Ñ—Ñ˜Ñ™ÑšÑ›ÑœÑžÑŸÒÒ‘â€ â€¡â€¢â€°â€¹â€ºâ‚¬â„–â„¢)Zutf8_first_of_2Zutf8_first_of_3Zutf8_first_of_4Zutf8_continuationZutf8_continuation_strictzé
    (?<! [{utf8_continuation_strict}])
    (
        [{utf8_first_of_2}] [{utf8_continuation}]
        |
        [{utf8_first_of_3}] [{utf8_continuation}]{{2}}
        |
        [{utf8_first_of_4}] [{utf8_continuation}]{{3}}
    )+
)Ú__doc__r   r,   r   r9   r
   r	   ZSINGLE_QUOTE_REZDOUBLE_QUOTE_REr   r#   r!   ZHTML_ENTITY_REZHTML_ENTITIESr&   r/   ZCONTROL_CHARSZALTERED_UTF8_REZLOSSY_UTF8_REZC1_CONTROL_REÚordZ	LIGATURESr<   Z	WIDTH_MAPZ
UTF8_CLUESr   ÚVERBOSEZUTF8_DETECTOR_REr   r   r   r   Ú<module>   sv   


(ÿÿ
ê
è0
öó