§
    ¥”j(?  ã            	       óN  — d Z ddlZddlmZ ddl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mZmZ ddlmZmZ g d	¢Zd
Z	 d„ Zd„ Zd„ ZdZdZdTdee         defd„Zdefd„ZdTdefd„Zdefd„Z dUd„Z!	 dVde"fd„Z#dWde"fd„Z$dXde"fd„Z% ed¬¦  «         G d „ d!¦  «        ¦   «         Z& G d"„ d#e'¦  «        Z( G d$„ d%e(¦  «        Z) G d&„ d'e)¦  «        Z* G d(„ d)e)¦  «        Z+ G d*„ d+e(¦  «        Z, G d,„ d-e)¦  «        Z-d.„ Z. G d/„ d0e¦  «        Z/ G d1„ d2e¦  «        Z0 G d3„ d4¦  «        Z1dd5œd6e2d7efd8„Z3 ed9¦  «        Z4 ed:¦  «        Z5 ed;¦  «        Z6d<ee4de6f         d=ee4ge5f         dee5de6f         fd>„Z7d?ee4         dee4ddf         fd@„Z8	 dTdAee9e:f         deee9e:f                  fdB„Z;dTdAe9fdC„Z<dTdAe9fdD„Z= G dE„ dFe>¦  «        Z?dG„ Z@dH„ ZAdI„ ZBdeeCgef         fdJ„ZDdKeCdefdL„ZE G dM„ dNee4         ¦  «        ZFdOee4         dee4         fdP„ZGdQ„ ZH G dR„ dSeI¦  «        ZJdS )Yzý
Utility functions for PDF library.
Taken from PyPDF2 with modifications and additions, see
:ref:`here <pypdf2-license>` for the original license of the PyPDF2 project.

Generally, all of these constitute internal API, except for the exception
classes.
é    N)Ú	dataclass)ÚdatetimeÚtimezone)ÚEnum)ÚBytesIO)ÚCallableÚ	GeneratorÚIterableÚOptionalÚTypeVarÚUnion)ÚCancelableAsyncIteratorÚConsList)ÚDEFAULT_CHUNK_SIZEr   ÚIndirectObjectExpectedÚOrderedEnumÚPdfErrorÚPdfReadErrorÚPdfStreamErrorÚPdfStrictReadErrorÚPdfWriteErrorÚFormFillingErrorÚ	SingletonÚStringWithLanguageÚ!assert_writable_and_random_accessÚchunk_streamÚchunked_digestÚchunked_writeÚfinalise_outputÚget_and_applyÚinstance_testÚis_regular_characterÚisoparseÚlift_iterable_asyncÚpeekÚprepare_rw_output_streamÚrdÚread_non_whitespaceÚread_until_delimiterÚread_until_regexÚread_until_whitespaceÚskip_over_commentsÚskip_over_whitespacei   c                 ó"   — t          | d¦  «        S )Né   )Úround©Úxs    úe/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pyhanko/pdf_utils/misc.pyr'   r'   ;   s   € Ý��A‰;Œ;Ðó    c                 ó   ‡ — ˆ fd„S )Nc                 ó$   •— t          | ‰¦  «        S ©N)Ú
isinstance)r2   Úclss    €r3   ú<lambda>zinstance_test.<locals>.<lambda>@   s   ø€ •Z  3Ñ'Ô'€ r4   © )r9   s   `r3   r!   r!   ?   s   ø€ Ø'Ð'Ð'Ð'Ð'r4   c              #   óÔ   K  — t          | ¦  «        }	 	 t          |¦  «        }n# t          $ r Y d S w xY w	 t          |¦  «        }n# t          $ r t          d¦  «        ‚w xY w||fV — ŒW)NTzList has odd number of elements)ÚiterÚnextÚStopIterationÚ
ValueError)ÚlstÚiÚx1Úx2s       r3   Ú	pair_iterrE   C   s�   è è € ÝˆS‰	Œ	€Að	ð	Ý�a‘”ˆBˆBøÝð 	ð 	ð 	ØˆFˆFð	øøøð	@Ý�a‘”ˆBˆBøÝð 	@ð 	@ð 	@ÝÐ>Ñ?Ô?Ð?ð	@øøøà�"ˆfˆˆˆð	s   ”$ ¤
2±2¶A ÁA s    
	 s
   ()<>[]{}/%ÚmaxcharsÚreturnc                 ó<   — t          t          | |¬¦  «        d         S )a  
    Reads non-whitespace characters and returns them.
    Stops upon encountering whitespace, or, if ``maxchars`` is not ``None``,
    when maxchars is reached.

    :param stream:
        stream to read
    :param maxchars:
        maximal number of bytes to read before returning
    )rF   r   )Ú_read_until_classÚPDF_WHITESPACE)ÚstreamrF   s     r3   r+   r+   U   s   € õ �^¨V¸hÐGÑGÔGÈÔJÐJr4   c                 óŠ   — t          t          t          z   | ¦  «        \  }}|s |                      dt          j        ¦  «         |S )zõ
    Read until a token delimiter (i.e. a delimiter character or a PDF
    whitespace character) is encountered, and rewind the stream to the previous
    character.

    :param stream:
        A stream.
    :return:
        The bytes read.
    éÿÿÿÿ)rI   rJ   ÚPDF_DELIMITERSÚseekÚosÚSEEK_CUR)rK   ÚresultÚends      r3   r)   r)   d   s?   € õ $¥Nµ^Ñ$CÀVÑLÔL�K€FˆCØð %Ø�Š�B�œÑ$Ô$Ð$Ø€Mr4   Úclass_charsc                 ó\   ‡ ‡‡‡— dŠˆ ˆˆˆfd„}d                       |¦   «         ¦  «        ‰fS )NFc               3   óø   •K  — ‰sd n‰                      ¦   «         ‰z   } ‰�‰                      ¦   «         | k     rA‰                     d¦  «        }|sdŠd S |‰v rd S |V — ‰®'‰                      ¦   «         | k     °?d S d S )Né   T)ÚtellÚread)Ústop_atÚtokrT   rS   rF   rK   s     €€€€r3   Ú_buildz!_read_until_class.<locals>._buildx   sš   øè è € à&ÐD�$�$¨F¯KªK©M¬M¸HÑ,DˆØÐ &§+¢+¡-¤-°'Ò"9Ð"9Ø—+’+˜a‘.”.ˆCØð Ø�Ø�Ø�kÐ!Ð!Ø�ØˆIˆIˆIð Ð &§+¢+¡-¤-°'Ò"9Ð"9Ð"9Ð"9Ð"9Ð"9r4   r4   )Újoin)rT   rK   rF   r\   rS   s   ``` @r3   rI   rI   u   sR   øøøø€ Ø
€Cð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð �8Š8�F�F‘H”HÑÔ˜sÐ"Ð"r4   Ú
byte_valuec                 ó&   — | t           vo| t          vS r7   )rJ   rN   )r^   s    r3   r"   r"   ‡   s   € Ø�^Ð+ÐP°
Å.Ð0PÐPr4   Fc                 óf  — t           d         }	 |t           v r3|s|rdS t          d¦  «        ‚|                      d¦  «        }|t           v °3|dk    rn=|                      dt          j        ¦  «         t          | ¦  «         t           d         }Œ€|r |                      dt          j        ¦  «         |S )zQ
    Finds and reads the next non-whitespace character (ignores whitespace).
    r   Tr4   úStream ended prematurelyrW   ó   %rM   )rJ   r   rY   rO   rP   rQ   r,   )rK   Ú	seek_backÚ	allow_eofr[   s       r3   r(   r(   ‹   sÆ   € õ ˜Ô
€Cð$Ø•^Ð#Ð#Øð EØð EØ˜3å(Ð)CÑDÔDÐDØ—+’+˜a‘.”.ˆCð •^Ð#Ð#ð �$Š;ˆ;Øà�KŠK˜�BœKÑ(Ô(Ð(Ý˜vÑ&Ô&Ð&Ý  Ô#ˆCð$ð ð %Ø�Š�B�œÑ$Ô$Ð$Ø€Jr4   Tc                 ó^  — t           d         }d}|t           v rp|                      d¦  «        }|s|rt          d¦  «        ‚dS |dz  }|r6|dk    r|dk    S |dk    r$|                      d¦  «        }|dk    s|s|dk    S n	|t           v °p|                      dt          j        ¦  «         |dk    S )a  
    Similar to :func:`read_non_whitespace`, but returns a ``bool`` if more than
    one whitespace character was read.

    Will return the cursor to before the first non-whitespace character
    encountered, or after the first end-of-line sequence if one is encountered.
    r   rW   ra   Tó   
ó   rM   )rJ   rY   r   rO   rP   rQ   )rK   Ústop_after_eolÚerror_on_end_of_streamr[   ÚcntÚnxts         r3   r-   r-   ¤   sÕ   € õ ˜Ô
€CØ
€CØ
•Ð
Ð
Ø�kŠk˜!‰nŒnˆØð 	Ø%ð Ý$Ð%?Ñ@Ô@Ð@à�tØˆq‰ˆØð 
	Ø�eŠ|ˆ|Ø˜Q’w�Ø˜’�à—k’k !‘n”n�Ø˜%’<�< s�<Ø š7�Nð ð% •Ð
Ð
ð( ‡K‚K�•B”KÑ Ô Ð Ø�Š7€Nr4   c                 ó  — |                       d¦  «        }d}|dk    rKd}|dvr|                       d¦  «        }|dv°t          | |¬¦  «         |                       d¦  «        }|dk    °K|r |                      dt          j        ¦  «         |S )a�  
    Skip over comments and position the cursor at the first byte after
    the chunk of continuous whitespace starting with the EOL sequence following
    the comment. If there is no comment under the cursor, do nothing.

    :param stream:
        stream to read
    :param error_on_end_of_stream:
        Raise an error if the stream ended prematurely.
    :return:
        ``True`` if a comment was read.
    rW   Frb   T)rf   rg   r4   )ri   rM   )rY   r-   rO   rP   rQ   )rK   ri   r[   Úseens       r3   r,   r,   È   s¯   € ð �+Š+�a‰.Œ.€CØ€DØ
�Š+ˆ+ØˆØÐ,Ð,Ð,Ø—+’+˜a‘.”.ˆCð Ð,Ð,Ð,åØÐ+Að	
ñ 	
ô 	
ð 	
ð �kŠk˜!‰nŒnˆð �Š+ˆ+ð ð %ð 	�Š�B�œÑ$Ô$Ð$Ø€Kr4   Ú
ignore_eofc                 óJ  — d}	 |                       d¦  «        }|s|r|S t          d¦  «        ‚|                     |¦  «        }|�X||d|                     ¦   «         …         z  }|                      |                     ¦   «         t          |¦  «        z
  d¦  «         n||z  }ŒŸ|S )ah  
    Reads until the regular expression pattern matched (ignore the match)
    Raise :class:`PdfStreamError` on premature end-of-file.

    :param stream:
        stream to search
    :param regex:
        regex to match
    :param ignore_eof:
        if true, ignore end-of-line and return immediately
    :raises PdfStreamError:
        on premature EOF
    r4   Té   zStream has ended unexpectedlyNrW   )rY   r   ÚsearchÚstartrO   Úlen)rK   Úregexrn   Únamer[   Úms         r3   r*   r*   ç   s³   € ð €DðØ�kŠk˜"‰oŒoˆØð 	Fàð FØ�å$Ð%DÑEÔEÐEØ�LŠL˜ÑÔˆØˆ=Ø�C˜˜!Ÿ'š'™)œ)˜Ô$Ñ$ˆDØ�KŠK˜Ÿš™	œ	¥C¨¡H¤HÑ,¨aÑ0Ô0Ð0ØØ�‰ˆðð €Kr4   )Úfrozenc                   óX   — e Zd ZU dZeed<   dZee         ed<   dZee         ed<   d„ Z	dS )r   z2
    A string with a language attached to it.
    ÚvalueNÚ	lang_codeÚcountry_codec                 ó   — | j         S r7   )ry   ©Úselfs    r3   Ú__str__zStringWithLanguage.__str__  s
   € ØŒzÐr4   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚstrÚ__annotations__rz   r   r{   r   r;   r4   r3   r   r     sb   € € € € € € ðð ð €J€J�JØ#€Iˆx˜Œ}Ð#Ð#Ñ#Ø"&€L�(˜3”-Ð&Ð&Ñ&ðð ð ð ð r4   r   c                   ó$   ‡ — e Zd Zdefˆ fd„Zˆ xZS )r   Úmsgc                 óJ   •— || _          t          ¦   «         j        |g|¢R Ž  d S r7   ©r‡   ÚsuperÚ__init__©r~   r‡   ÚargsÚ	__class__s      €r3   r‹   zPdfError.__init__  ó/   ø€ ØˆŒØ�‰ŒÔ˜Ð$˜tÐ$Ð$Ð$Ð$Ð$Ð$r4   ©r€   r�   r‚   r„   r‹   Ú__classcell__©rŽ   s   @r3   r   r     óD   ø€ € € € € ð%˜Cð %ð %ð %ð %ð %ð %ð %ð %ð %ð %r4   r   c                   ó   — e Zd ZdS )r   N©r€   r�   r‚   r;   r4   r3   r   r     ó   € € € € € Ø€Dr4   r   c                   ó   — e Zd ZdS )r   Nr•   r;   r4   r3   r   r     r–   r4   r   c                   ó2   ‡ — e Zd Zddee         fˆ fd„Zˆ xZS )r   Nr‡   c                 óP   •— t          ¦   «                              |pd¬¦  «         d S )Nzindirect object expected)r‡   )rŠ   r‹   )r~   r‡   rŽ   s     €r3   r‹   zIndirectObjectExpected.__init__$  s*   ø€ Ý‰Œ×Ò˜SÐ>Ð$>ÐÑ?Ô?Ð?Ð?Ð?r4   r7   )r€   r�   r‚   r   r„   r‹   r‘   r’   s   @r3   r   r   #  sY   ø€ € € € € ð@ð @˜H SœMð @ð @ð @ð @ð @ð @ð @ð @ð @ð @r4   r   c                   ó   — e Zd ZdS )r   Nr•   r;   r4   r3   r   r   (  r–   r4   r   c                   ó   — e Zd ZdS )r   Nr•   r;   r4   r3   r   r   ,  r–   r4   r   c                 óf   ‡ ‡— t          ‰ ¦  «        Š t          ‰ ¦  «        Šˆˆ fd„}‰ |¦   «         fS )Nc               3   ó$   •K  — ‰ V — ‰E d {V —† d S r7   r;   )ÚfirstÚitrs   €€r3   Ú_itrzpeek.<locals>._itr4  s%   øè è € ØˆˆˆØˆˆˆˆˆˆˆˆˆr4   )r=   r>   )rŸ   r    rž   s   ` @r3   r%   r%   0  sJ   øø€ Ý
ˆs‰)Œ)€CÝ�‰IŒI€Eðð ð ð ð ð ð �$�$‘&”&ˆ=Ðr4   c                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )r   z6
    Ordered enum (from the Python documentation)
    c                 óL   — | j         |j         u r| j        |j        k    S t          ‚r7   ©rŽ   ry   ÚNotImplementedError©r~   Úothers     r3   Ú__ge__zOrderedEnum.__ge__@  ó&   € ØŒ>˜Uœ_Ð,Ð,Ø”: ¤Ò,Ð,Ý!Ð!r4   c                 óL   — | j         |j         u r| j        |j        k    S t          ‚r7   r£   r¥   s     r3   Ú__gt__zOrderedEnum.__gt__E  ó&   € ØŒ>˜Uœ_Ð,Ð,Ø”: ¤Ò+Ð+Ý!Ð!r4   c                 óL   — | j         |j         u r| j        |j        k    S t          ‚r7   r£   r¥   s     r3   Ú__le__zOrderedEnum.__le__J  r¨   r4   c                 óL   — | j         |j         u r| j        |j        k     S t          ‚r7   r£   r¥   s     r3   Ú__lt__zOrderedEnum.__lt__O  r«   r4   N©r€   r�   r‚   rƒ   r§   rª   r­   r¯   r;   r4   r3   r   r   ;  sZ   € € € € € ðð ð"ð "ð "ð
"ð "ð "ð
"ð "ð "ð
"ð "ð "ð "ð "r4   r   c                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )ÚVersionEnumz¸
    Ordered enum with support for ``None``, for future-proofing version-based
    enums. In such enums, the value ``None`` can be used as a stand-in for
    "any future version".
    c                 ód   — | j         |j         u r| j        }|j        }|€dS |€dS ||k    S t          ‚©NTFr£   ©r~   r¦   ÚvalÚ	other_vals       r3   r§   zVersionEnum.__ge__\  sE   € ØŒ>˜Uœ_Ð,Ð,Ø”*ˆCØœˆIØˆ{Ø�tØÐ"Ø�uà˜iÒ'Ð'Ý!Ð!r4   c                 óh   — | j         |j         u r| j        }|j        }|€|d uS |€dS ||k    S t          ‚©NFr£   rµ   s       r3   rª   zVersionEnum.__gt__h  sJ   € ØŒ>˜Uœ_Ð,Ð,Ø”*ˆCØœˆIØˆ{Ø ¨Ð,Ð,ØÐ"Ø�uà˜Y’Ð&Ý!Ð!r4   c                 ód   — | j         |j         u r| j        }|j        }|€dS |€dS ||k    S t          ‚r´   r£   rµ   s       r3   r­   zVersionEnum.__le__t  sE   € ØŒ>˜Uœ_Ð,Ð,Ø”*ˆCØœˆIØÐ Ø�tØ�Ø�uà˜iÒ'Ð'Ý!Ð!r4   c                 óh   — | j         |j         u r| j        }|j        }|€|d uS |€dS ||k     S t          ‚r¹   r£   rµ   s       r3   r¯   zVersionEnum.__lt__€  sI   € ØŒ>˜Uœ_Ð,Ð,Ø”*ˆCØœˆIØÐ Ø $�Ð&Ø�Ø�uà˜Y’Ð&Ý!Ð!r4   Nr°   r;   r4   r3   r²   r²   U  sZ   € € € € € ðð ð
"ð 
"ð 
"ð
"ð 
"ð 
"ð
"ð 
"ð 
"ð
"ð 
"ð 
"ð 
"ð 
"r4   r²   c                   ó   — e Zd Zd„ Zd„ ZdS )ÚLazyJoinc                 ó"   — || _         || _        d S r7   )ÚsepÚiterator)r~   r¿   rÀ   s      r3   r‹   zLazyJoin.__init__Ž  s   € ØˆŒØ ˆŒˆˆr4   c                 ó@   — | j                              | j        ¦  «        S r7   )r¿   r]   rÀ   r}   s    r3   r   zLazyJoin.__str__’  s   € ØŒx�}Š}˜Tœ]Ñ+Ô+Ð+r4   N)r€   r�   r‚   r‹   r   r;   r4   r3   r½   r½   �  s2   € € € € € ð!ð !ð !ð,ð ,ð ,ð ,ð ,r4   r½   )ÚdefaultÚ
dictionaryÚfunctionc                óP   — 	 | |         }n# t           $ r |cY S w xY w ||¦  «        S r7   )ÚKeyError)rÃ   ÚkeyrÄ   rÂ   ry   s        r3   r    r    –  sD   € ðØ˜3”ˆˆøÝð ð ð Øˆˆˆðøøøàˆ8�E‰?Œ?Ðs   ‚ ‹™ÚXÚYÚRÚgenÚfuncc              #   ó~   K  — 	 	  |t          | ¦  «        ¦  «        V — n# t          $ r}|j        cY d }~S d }~ww xY wŒ;r7   )r>   r?   ry   )rË   rÌ   Úes      r3   Úmap_with_returnrÏ   £  sb   è è € ðð	Ø�$•t˜C‘y”y‘/”/Ð!Ð!Ð!Ð!øÝð 	ð 	ð 	Ø”7ˆNˆNˆNˆNˆNˆNøøøøð	øøøðs   …   
;ª6°;¶;r2   c              #   ó   K  — | E d {V —† d S r7   r;   r1   s    r3   Ú_as_genrÑ   ®  s   è è € Ø€L€L€L€L€L€L€L€L€Lr4   Útemp_bufferc              #   ó6  K  — d}|�||k     rŒ| }|�/||z
  }|t          | ¦  «        k     rt          | ¦  «        d |…         }|                     |¦  «        }||z  }|sd S |t          |¦  «        k     rt          |¦  «        d |…         }n|}|V — |®„||k     °Šd S d S )Nr   )rs   Ú
memoryviewÚreadinto)rÒ   rK   Úmax_readÚ
total_readÚread_bufferÚto_readÚ
bytes_readÚto_feeds           r3   r   r   ²  sÜ   è è € ð €JØ
Ð
˜j¨8Ò3Ð3à!ˆØÐØ Ñ+ˆGØ�˜[Ñ)Ô)Ò)Ð)Ý(¨Ñ5Ô5°h°w°hÔ?�Ø—_’_ [Ñ1Ô1ˆ
Ø�jÑ ˆ
Øð 	ØˆFð �˜KÑ(Ô(Ò(Ð(Ý  Ñ-Ô-¨k¨z¨kÔ:ˆGˆGà!ˆGØˆˆˆð% Ð
˜j¨8Ò3Ð3Ð3Ð3Ð3Ð3r4   c                 óZ   — t          | ||¬¦  «        D ]}|                     |¦  «         Œd S ©N)rÖ   )r   Úupdate)rÒ   rK   ÚmdrÖ   Úchunks        r3   r   r   Ë  s?   € Ý˜k¨6¸HÐEÑEÔEð ð ˆØ
�	Š	�%ÑÔÐÐðð r4   c                 óZ   — t          | ||¬¦  «        D ]}|                     |¦  «         Œd S rÝ   )r   Úwrite)rÒ   rK   ÚoutputrÖ   rà   s        r3   r   r   Ð  s?   € Ý˜k¨6¸HÐEÑEÔEð ð ˆØ�Š�UÑÔÐÐðð r4   c                   ó   — e Zd Zd„ ZdS )r   c                 óŠ   ‡— t                                | |||¦  «        }t                                |¦  «        Šˆfd„|_        |S )Nc                 ó   •— ‰S r7   r;   )Ú_Úinstances    €r3   r:   z#Singleton.__new__.<locals>.<lambda>Ù  s   ø€  € r4   )ÚtypeÚ__new__Ú__call__)Úmcsru   ÚbasesÚdctr9   rè   s        @r3   rê   zSingleton.__new__Ö  s@   ø€ Ý�lŠl˜3  e¨SÑ1Ô1ˆÝ—=’= Ñ%Ô%ˆØ(Ð(Ð(Ð(ˆŒØˆ
r4   N)r€   r�   r‚   rê   r;   r4   r3   r   r   Õ  s#   € € € € € ðð ð ð ð r4   r   c                 ó˜   — |                       ¦   «         st          d¦  «        ‚|                      ¦   «         o|                      ¦   «         S )z´
    Raise an error if the buffer in question is not writable, and return
    a boolean to indicate whether it supports random-access reading.

    :param output:
    :return:
    zOutput buffer is not writable)ÚwritableÚIOErrorÚseekableÚreadable©rã   s    r3   r   r   Ý  sD   € ð �?Š?ÑÔð 7ÝÐ5Ñ6Ô6Ð6Ø�?Š?ÑÔÐ2 §¢Ñ!2Ô!2Ð2r4   c                 ób   — | €t          ¦   «         } nt          | ¦  «        st          ¦   «         } | S )aB  
    Prepare an output stream that supports both reading and writing.
    Intended to be used for writing & updating signed files:
    when producing a signature, we render the PDF to a byte buffer with
    placeholder values for the signature data, or straight to the provided
    output stream if possible.

    More precisely: this function will return the original output stream
    if it is writable, readable and seekable.
    If the ``output`` parameter is ``None``, not readable or not seekable,
    this function will return a :class:`.BytesIO` instance instead.
    If the ``output`` parameter is not ``None`` and not writable,
    :class:`.IOError` will be raised.

    :param output:
        A writable file-like object, or ``None``.
    :return:
        A file-like object that supports reading, writing and seeking.
    )r   r   rô   s    r3   r&   r&   ï  s2   € ð( €~Ý‘”ˆˆå0°Ñ8Ô8ð 	Ý‘Y”YˆFà€Mr4   c                 ó¾   — | �Z| |urVt          |t          ¦  «        sJ ‚|                     ¦   «         }|                      |¦  «         |                     ¦   «          | S |S )zñ
    Several internal APIs transparently replaces non-readable/seekable
    buffers with BytesIO for signing operations, but we don't want to
    expose that to the public API user.
    This internal API function handles the unwrapping.
    )r8   r   Ú	getbufferrâ   Úrelease)Úorig_outputÚreturned_outputÚraw_bufs      r3   r   r     sk   € ð Ð ;°oÐ#EÐ#Eå˜/­7Ñ3Ô3Ð3Ð3Ð3Ø!×+Ò+Ñ-Ô-ˆØ×Ò˜'Ñ"Ô"Ð"Ø�ŠÑÔÐØÐØÐr4   c                  óL   — 	 ddl m}  | S # t          $ r t          j        cY S w xY w)Nr   )r#   )Údateutil.parserr#   ÚImportErrorr   Úfromisoformat)Úparses    r3   Ú_get_isoparser    sJ   € ð&à5Ð5Ð5Ð5Ð5Ð5àˆøÝð &ð &ð &õ Ô%Ð%Ð%Ð%ð&øøøs   ‚
 Š#¢#Údt_strc                 ó†   — t          ¦   «         } || ¦  «        }|j        € |                     t          j        ¬¦  «        }|S )N)Útzinfo)r  r  Úreplacer   Úutc)r  r   Údts      r3   r#   r#   *  s:   € Ý'4¡¤€EØ	ˆˆv‰Œ€BØ	„yÐà�ZŠZ�xœ|ˆZÑ,Ô,ˆØ€Ir4   c                   ó8   — e Zd Zdefd„Zd„ Zdee         fd„ZdS )Ú_LiftedIterablerG   c              ƒ   ó.   K  — t          | j        ¦  «        S r7   )r>   rB   r}   s    r3   Ú	__anext__z_LiftedIterable.__anext__4  s   è è € Ý�D”F‰|Œ|Ðr4   c              ƒ   ó
   K  — d S r7   r;   r}   s    r3   Úcancelz_LiftedIterable.cancel7  s   è è € Øˆr4   rB   c                 ó.   — t          |¦  «        | _        d S r7   )r=   rB   )r~   rB   s     r3   r‹   z_LiftedIterable.__init__:  s   € Ý�a‘”ˆŒˆˆr4   N)r€   r�   r‚   rÈ   r  r  r
   r‹   r;   r4   r3   r	  r	  3  s]   € € € € € ð ð ð ð ð ðð ð ð˜( 1œ+ð ð ð ð ð ð r4   r	  rB   c                 ó    — t          | ¦  «        S r7   )r	  )rB   s    r3   r$   r$   >  s   € Ý˜1ÑÔÐr4   c                  ó   — | D ]}|�|c S Œ	d S r7   r;   )r�   Úargs     r3   Úcoalescer  B  s)   € Øð ð ˆØˆ?ØˆJˆJˆJð àˆ4r4   c                   ó$   ‡ — e Zd Zdefˆ fd„Zˆ xZS )r   r‡   c                 óJ   •— || _          t          ¦   «         j        |g|¢R Ž  d S r7   r‰   rŒ   s      €r3   r‹   zFormFillingError.__init__J  r�   r4   r�   r’   s   @r3   r   r   I  r“   r4   r   r7   )FF)FT)T)F)Krƒ   rP   Údataclassesr   r   r   Úenumr   Úior   Útypingr   r	   r
   r   r   r   Úpyhanko_certvalidator.utilr   r   Ú__all__r   r'   r!   rE   rJ   rN   ÚintÚbytesr+   r)   rI   r"   r(   Úboolr-   r,   r*   r   Ú	Exceptionr   r   r   r   r   r   r%   r   r²   r½   Údictr    rÈ   rÉ   rÊ   rÏ   rÑ   Ú	bytearrayrÔ   r   r   r   ré   r   r   r&   r   r„   r  r#   r	  r$   r  r@   r   r;   r4   r3   ú<module>r!     s„  ððð ð 
€	€	€	Ø !Ð !Ð !Ð !Ð !Ð !Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ Jà HÐ HÐ HÐ HÐ HÐ HÐ HÐ Hð ð  ð  €ðD Ð ðð
ð ð ð(ð (ð (ðð ð ð "€Ø€ðKð K¨H°S¬Mð KÀUð Kð Kð Kð Kð Eð ð ð ð ð"#ð # 5ð #ð #ð #ð #ð$Q Sð Qð Qð Qð Qðð ð ð ð4 :>ð!ð !à	ð!ð !ð !ð !ðHð ¸tð ð ð ð ð>ð °ð ð ð ð ð@ €�$ÐÑÔð
ð 
ð 
ð 
ð 
ñ 
ô 
ñ Ôð
ð%ð %ð %ð %ð %ˆyñ %ô %ð %ð	ð 	ð 	ð 	ð 	�8ñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	˜ñ 	ô 	ð 	ð@ð @ð @ð @ð @˜\ñ @ô @ð @ð
	ð 	ð 	ð 	ð 	�Hñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	�\ñ 	ô 	ð 	ðð ð ð"ð "ð "ð "ð "�$ñ "ô "ð "ð45"ð 5"ð 5"ð 5"ð 5"�$ñ 5"ô 5"ð 5"ðp,ð ,ð ,ð ,ð ,ñ ,ô ,ð ,ð IMð ð ð ˜dð °8ð ð ð ð ð €GˆC�L„L€Ø€GˆC�L„L€Ø€GˆC�L„L€ðØ	�1�d˜A�:Ô	ðØ&.°¨s°A¨vÔ&6ðàˆq�$˜ˆzÔðð ð ð ðˆx˜Œ{ð ˜y¨¨D°$¨Ô7ð ð ð ð ð
 AEðð Ø�y *Ð,Ô-ðàˆe�I˜zÐ)Ô*Ô+ðð ð ð ð2ð  	ð ð ð ð ð
ð ˜yð ð ð ð ð
ð ð ð ð �ñ ô ð ð3ð 3ð 3ð$ð ð ð:ð ð ð$	&�x   x Ô0ð 	&ð 	&ð 	&ð 	&ð�Sð ˜Xð ð ð ð ðð ð ð ð Ð-¨aÔ0ñ ô ð ð˜8 Aœ;ð Ð+BÀ1Ô+Eð ð ð ð ðð ð ð%ð %ð %ð %ð %�zñ %ô %ð %ð %ð %r4   