§
    £”j³  ã                   óf   — d Z ddlmZmZmZ ddlmZ d„ Z G d„ de¦  «        Z G d„ d¦  «        Z	d	S )
zHhelper for importing pdf structures into a ReportLab generated document
é    )ÚformatÚ	PDFObjectÚ	pdfdocEnc)ÚstrTypesc                 óˆ  — t          t          t          ¦  «        rt          nt          f}|t          t          fz   }| D ]„}t          ||¦  «        srt          |¦  «        dk    rt          dt          |¦  «        z   ¦  «        ‚t          |d         t          ¦  «        s%t          dt          |d         ¦  «        z   ¦  «        ‚Œ…d S )Né   zTsequence elts must be strings/bytes/PDFPatternIfs or singletons containing strings: r   zCSingletons must contain strings/bytes or PDFObject instances only: )Ú
isinstancer   Útupler   ÚPDFPatternIfÚlenÚ
ValueErrorÚascii)Úpattern_sequenceÚallowedTypesÚxs      úk/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/reportlab/pdfbase/pdfpattern.pyÚ_patternSequenceCheckr      sØ   € Ý)­(µEÑ:Ô:ÐK•8�8ÅÀ€LØ¥9­\Ð":Ñ:€LØð tð tˆÝ˜!˜LÑ)Ô)ð 	tÝ�1‰vŒv�qŠyˆyÝ Ð!wÕx}Ð~ñ  yAô  yAñ  "Añ  Bô  Bð  BÝ˜a œd¥8Ñ,Ô,ð tÝ Ð!fÕglÐmnÐopÔmqÑgrÔgrÑ!rÑsÔsÐsøðtð tó    c                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	Ú
PDFPatternr   c                 ó@   — t          |¦  «         || _        || _        dS )a  
        Description of a kind of PDF object using a pattern.

        Pattern sequence should contain strings, singletons of form [string] or
        PDFPatternIf objects.
        Strings are literal strings to be used in the object.
        Singletons are names of keyword arguments to include.
        PDFpatternIf objects allow some conditionality.
        Keyword arguments can be non-instances which are substituted directly in string conversion,
        or they can be object instances in which case they should be pdfdoc.* style
        objects with a x.format(doc) method.
        Keyword arguments may be set on initialization or subsequently using __setitem__, before format.
        "constant object" instances can also be inserted in the patterns.
        N)r   ÚpatternÚ	arguments)Úselfr   Úkeywordargss      r   Ú__init__zPDFPattern.__init__   s%   € õ 	Ð.Ñ/Ô/Ð/Ø'ˆŒØ$ˆŒˆˆr   c                 ó   — || j         |<   d S ©N©r   )r   ÚitemÚvalues      r   Ú__setitem__zPDFPattern.__setitem__%   s   € Ø$ˆŒ�tÑÐÐr   c                 ó   — | j         |         S r   r   )r   r    s     r   Ú__getitem__zPDFPattern.__getitem__(   s   € ØŒ~˜dÔ#Ð#r   c              #   ó  K  — | j         }| j        }|D �]v}t          |t          ¦  «        rt	          |¦  «        V — Œ*t          |t
          ¦  «        r|                     |¦  «        V — ŒWt          |t          ¦  «        r\t          |  	                    |j
        ¦  «        ¦  «        }|o|d         }|  	                    |r|j        n|j        ¦  «        D ]}|V — ŒŒÈ|d         }|                     |d ¦  «        }	|	€t          dt          |¦  «        z  ¦  «        ‚t          |	t
          ¦  «        rt          |	|¦  «        V — �Œ0t          |	t          ¦  «        rt	          |	¦  «        V — �ŒXt	          t!          |	¦  «        ¦  «        V — �Œxd S )Nr   z%s value not defined)r   Ú_PDFPattern__documentr	   r   r   r   r   r   ÚlistÚevalÚcondÚthenPartÚelsePartÚgetr   r   Ústr)
r   ÚLr   Údocumentr   Úresultr)   ÚzÚnamer!   s
             r   r(   zPDFPattern.eval+   s¢  è è € Ø”Nˆ	Ø”?ˆØð 	0ñ 	0ˆAÝ˜!�HÑ%Ô%ð 0Ý ‘l”lÐ"Ð"Ð"Ð"Ý˜A�iÑ(Ô(ð 0Ø—h’h˜xÑ(Ô(Ð(Ð(Ð(Ð(Ý˜A�lÑ+Ô+ð 0Ý˜dŸiši¨¬Ñ/Ô/Ñ0Ô0�ØÐ+ &¨¤)�ØŸš°Ð#E 1¤: :¸1¼:ÑFÔFð ð �AØ�G�G�G�Gðð ˜”t�Ø!Ÿš d¨DÑ1Ô1�Ø�=Ý$Ð%;½eÀD¹k¼kÑ%IÑJÔJÐJÝ˜e¥IÑ.Ô.ð 0Ý   xÑ0Ô0Ð0Ð0Ð0Ñ0Ý ¥hÑ/Ô/ð 0Ý# EÑ*Ô*Ð*Ð*Ð*Ñ*å#¥C¨¡J¤JÑ/Ô/Ð/Ð/Ð/Ñ/ð)	0ð 	0r   c                 ó~   — || _         	 d                     |                      | j        ¦  «        ¦  «        | ` S # | ` w xY w)Nr   )r&   Újoinr(   r   )r   r/   s     r   r   zPDFPattern.formatD   sC   € Ø"ˆŒð	 Ø—8’8˜DŸIšI d¤lÑ3Ô3Ñ4Ô4à��ø��ÐÐÐÐs   ‰,8 ¸<c                 ót   — t                                | j        ¦  «        }| j        |_        | j        |_        |S r   )ÚobjectÚ__new__Ú	__class__r   r   )r   Úcs     r   ÚclonezPDFPattern.cloneK   s,   € Ý�NŠN˜4œ>Ñ*Ô*ˆØ”LˆŒ	Ø”nˆŒØˆr   N)
Ú__name__Ú
__module__Ú__qualname__Ú__RefOnly__r   r"   r$   r(   r   r:   © r   r   r   r      ss   € € € € € Ø€Kð%ð %ð %ð&%ð %ð %ð$ð $ð $ð0ð 0ð 0ð2 ð  ð  ðð ð ð ð r   r   c                   ó   — e Zd ZdZg g fd„ZdS )r   zÙcond will be evaluated as [cond] in PDFpattern eval.
    It should evaluate to a list with value 0/1 etc etc.
    thenPart is a list to be evaluated if the cond evaulates true,
    elsePart is the false sequence.
    c                 óŽ   — t          |t          ¦  «        s|g}|||fD ]}t          |¦  «         Œ|| _        || _        || _        d S r   )r	   r'   r   r)   r*   r+   )r   r)   r*   r+   r   s        r   r   zPDFPatternIf.__init__W   sX   € Ý˜$�tÑ$Ô$Ð3¨d¨V dØ�x Ð)ð 	%ð 	%ˆAÝ! !Ñ$Ô$Ð$Ð$ØˆŒ	Ø ˆŒØ ˆŒˆˆr   N)r;   r<   r=   Ú__doc__r   r?   r   r   r   r   Q   s9   € € € € € ðð ð
 %'°ð !ð !ð !ð !ð !ð !r   r   N)
rB   Úreportlab.pdfbase.pdfdocr   r   r   Úreportlab.lib.utilsr   r   r   r   r?   r   r   ú<module>rE      s«   ðð	€à AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AØ (Ð (Ð (Ð (Ð (Ð (ðtð tð tð?ð ?ð ?ð ?ð ?�ñ ?ô ?ð ?ðB!ð !ð !ð !ð !ñ !ô !ð !ð !ð !r   