U e5dŠ#ã@s¸ddlZddlZddlZddlmZe d¡ZdZdZdd„Z dd „Z d d „Z Gd d „d ej ƒZ Gdd„dej ƒZGdd„dejƒZGdd„de ejƒZGdd„de ejƒZdd„ZdS)éN)Ú ucd_3_2_0u [.。.。]sxn--zxn--cCsüg}|D] }t |¡rq| t |¡¡qd |¡}t d|¡}|D]j}t |¡s¢t |¡s¢t  |¡s¢t  |¡s¢t  |¡s¢t  |¡s¢t  |¡s¢t |¡s¢t |¡rDtd|ƒ‚qDdd„|Dƒ}t|ƒrøtdd„|Dƒƒràtdƒ‚|d rð|d søtd ƒ‚|S) NÚÚNFKCzInvalid character %rcSsg|]}t |¡‘qS©)Ú stringprepZ in_table_d1©Ú.0Úxrrú&/usr/lib64/python3.8/encodings/idna.pyÚ )sznameprep..css|]}t |¡VqdS)N)rZ in_table_d2rrrr Ú 1sznameprep..zViolation of BIDI requirement 2réÿÿÿÿzViolation of BIDI requirement 3)rZ in_table_b1ÚappendZ map_table_b2ÚjoinÚ unicodedataÚ normalizeZ in_table_c12Z in_table_c22Z in_table_c3Z in_table_c4Z in_table_c5Z in_table_c6Z in_table_c7Z in_table_c8Z in_table_c9Ú UnicodeErrorÚany)ÚlabelZnewlabelÚcZRandALrrr ÚnameprepsB    ÿþýüûúùø rcCsðz| d¡}Wntk r"Yn*Xdt|ƒkrYndX| d¡}|dd…D]&}dt|ƒkrrdksVntd ƒ‚qVt|dƒdkr–td ƒ‚|t|ƒfStƒ}t |¡}|rÊ|dsÊd}|d=nd }|D] }|rä| d¡| t|ƒ¡qÒt ||ƒt|ƒfS) Nr)úunsupported error handling ©órró.r rrrzlabel too longr,) rrÚUnicodeEncodeErrorÚsplitrÚ bytearrayÚdotsÚextendr r")ÚselfÚinputÚerrorsr&ÚlabelsrÚ trailing_dotrrr r‘s4       z Codec.encodecCsÀ|dkrtd|ƒ‚|sdSt|tƒs.t|ƒ}t|kr`z| d¡t|ƒfWStk r^YnX| d¡}|rŠt|dƒdkrŠd}|d=nd }g}|D]}| t |ƒ¡q–d  |¡|t|ƒfS) Nr)úUnsupported error handling ©rrrr-r rÚ.r) rr!r"rr$rÚUnicodeDecodeErrorr/rr'r)r3r4r5r6r7r&rrrr r$¶s(   z Codec.decodeN)r))r))Ú__name__Ú __module__Ú __qualname__rr$rrrr r(s %r(c@seZdZdd„ZdS)ÚIncrementalEncoderc Cs¸|dkrtd|ƒ‚|sdSt |¡}d}|rT|dsBd}|d=n|sT|d=|rTd}tƒ}d}|D]4}|r|| d¡|d7}| t|ƒ¡|t|ƒ7}qb||7}|t|ƒ7}t|ƒ|fS) Nr)r*r+r,r r-ré)rr1r/r0r2r rr"© r3r4r5Úfinalr6r7r&Úsizerrrr Ú_buffer_encodeÙs2    z!IncrementalEncoder._buffer_encodeN)r<r=r>rDrrrr r?Øsr?c@seZdZdd„ZdS)ÚIncrementalDecoderc CsÎ|dkrtd|ƒ‚|sdSt|tƒr2t |¡}nt|dƒ}| d¡}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}|D]*}| t|ƒ¡|rž|d 7}|t|ƒ7}q€d |¡|}|t|ƒ7}||fS) Nr)r8r9rr:rr rr@) rr!r#r1r/rr'rrrArrr Ú_buffer_decodeüs6      z!IncrementalDecoder._buffer_decodeN)r<r=r>rFrrrr rEûsrEc@s eZdZdS)Ú StreamWriterN©r<r=r>rrrr rG"srGc@s eZdZdS)Ú StreamReaderNrHrrrr rI%srIc Cs tjdtƒjtƒjttttdS)NZidna)Únamerr$ÚincrementalencoderÚincrementaldecoderÚ streamwriterÚ streamreader) ÚcodecsÚ CodecInfor(rr$r?rErGrIrrrr Ú getregentry*sùrQ)rÚrerOrrÚcompiler1rrrr r'r(ÚBufferedIncrementalEncoderr?ÚBufferedIncrementalDecoderrErGrIrQrrrr Ús  .+)H#'