Ë
    ÚŠ±jŸi  ã            	       ód  — d Z ddlZddlZddlZddlmZ  ed«      d ed«      d ed«      d	 ed
«      diZ ed«      d ed«      diZd„ Z	d„ Z
dd„Zdd„Z	 	 	 	 dd„Z	 	 	 	 dd„Z ej                  d«      j                   Z	 	 	 	 	 	 dd„Z	 	 	 	 	 	 dd„Zd„ Zd„ Zd d„Zd d„Z	 	 d!d„Z	 	 d!d„Zy)"aˆ  Additional factory functions for common QR codes.

Aside from  :py:func:`make_epc_qr`, the factory functions return a QR code
with the minimum error correction level "L" (or better).

To create a (Micro) QR code which should use a specific error correction level
or version etc., use the "_data" factory functions which return a string which
can be used as input for :py:func:`segno.make()`.
é    N)Úquoteú\z\\ú;z\;ú:z\:ú"z\"ú,z\,c                 ó>   — t        | «      j                  t        «      S ©z~    Escapes ``\``, ``;``, ``"`` and ``:`` in the provided string.

    :param str s: The string to escape.
    :rtype str
    )ÚstrÚ	translateÚ_MECARD_ESCAPE©Úss    úR/var/www/io.vulcan-creative.com/venv/lib/python3.12/site-packages/segno/helpers.pyÚ_escape_mecardr   %   s   € ô ˆq‹6×ÑœNÓ+Ð+ó    c                 ó>   — t        | «      j                  t        «      S r
   )r   r   Ú_VCARD_ESCAPEr   s    r   Ú_escape_vcardr   /   s   € ô ˆq‹6×ÑœMÓ*Ð*r   c                 ó°   — t         }d}|r|d|dk7  r|j                  «       n|› d�z  }|d || «      › d�z  }|�|d ||«      › d�z  }||rdz  }|S dz  }|S )a      Creates WIFI configuration string.

    :param str ssid: The SSID of the network.
    :param password: The password.
    :type password: str or None
    :param security: Authentication type; the value should be "WEP" or "WPA".
            Set to ``None`` to omit the value.
            "nopass" is equivalent to setting the value to ``None`` but in
            the former case, the value is not omitted.
    :type security: str or None
    :param bool hidden: Indicates if the network is hidden (default: ``False``)
    :rtype: str
    zWIFI:zT:Únopassr   zS:zP:zH:true;)r   Úupper)ÚssidÚpasswordÚsecurityÚhiddenÚescapeÚdatas         r   Úmake_wifi_datar   9   s‹   € ô €FØ€DÙØ�"¨°XÒ)=�X—^‘^Ô%À8ÐLÈAÐNÑNˆØˆb‘˜“�˜aÐ Ñ €DØÐØ�"‘V˜HÓ%Ð& aÐ(Ñ(ˆØ™ˆIÑ(€DØ€Kð &)Ñ(€DØ€Kr   c                 óD   — t        j                  t        | |||«      «      S )a(      Creates a WIFI configuration QR code.

    :param str ssid: The SSID of the network.
    :param password: The password.
    :type password: str or None
    :param security: Authentication type; the value should be "WEP" or "WPA".
            Set to ``None`` to omit the value.
            "nopass" is equivalent to setting the value to ``None`` but in
            the former case, the value is not omitted.
    :type security: str or None
    :param bool hidden: Indicates if the network is hidden (default: ``False``)
    :rtype: segno.QRCode
    )ÚsegnoÚmake_qrr   )r   r   r   r   s       r   Ú	make_wifir#   S   s   € ô �=‰=œ¨¨h¸À&ÓIÓJÐJr   c                 óö  ‡— ˆfd„}t         Šd ‰| «      › d�g}|r|j                  d ‰|«      › d�«       |j                   |d|«      «       |j                   |d|«      «       |j                   |d|«      «       |r|j                  d ‰|«      › d�«       |r'	 |j                  d	«      }|j                  d
|› d�«       |j                   |d|«      «       |	|
|||||f}t        |«      r7|D �cg c]  } ‰|xs d«      ‘Œ }}|j                   dj                  |Ž «       |r|j                  d ‰|«      › d�«       |j                  d«       dj                  |«      S # t        $ r Y ŒÂw xY wc c}w )a�      Creates a string encoding the contact information as MeCard.

    :param str name: Name. If it contains a comma, the first part
            is treated as lastname and the second part is treated as forename.
    :param reading: Designates a text string to be set as the kana name in the phonebook
    :type reading: str or None
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the date as YYYYMMDD value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param roomno: Room number (address information).
    :type roomno: str or None
    :param houseno: House number (address information).
    :type houseno: str or None
    :param city: City (address information).
    :type city: str or None
    :param prefecture: Prefecture (address information).
    :type prefecture: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :rtype: str
    c                 ór   •— |syt        |t        «      r|f}|D �cg c]  }| › d ‰|«      › d�‘Œ c}S c c}w )N© r   r   ©Ú
isinstancer   ©ÚnameÚvalÚir   s      €r   Úmake_multifieldz)make_mecard_data.<locals>.make_multifieldŽ   s?   ø€ ÙØÜ�cœ3ÔØ�&ˆCØ03Ö4¨1�4�&˜™& ›)˜ AÒ&Ò4Ð4ùÒ4s   œ4z	MECARD:N:r   zSOUND:ÚTELÚTELAVÚEMAILú	NICKNAME:z%Y%m%dúBDAY:ÚURLÚ z ADR:{0},{1},{2},{3},{4},{5},{6};zMEMO:)r   ÚappendÚextendÚstrftimeÚAttributeErrorÚanyÚformatÚjoin)r*   ÚreadingÚemailÚphoneÚ
videophoneÚmemoÚnicknameÚbirthdayÚurlÚpoboxÚroomnoÚhousenoÚcityÚ
prefectureÚzipcodeÚcountryr-   r   Úadr_propertiesr,   Úadr_datar   s                        @r   Úmake_mecard_datarM   e   s{  ø€ ôR5ô €FØ™˜t›�~ QÐ'Ð(€DÙØ�‰�f™V G›_Ð-¨QÐ/Ô0Ø‡K�K‘  uÓ-Ô.Ø‡K�K‘ ¨Ó4Ô5Ø‡K�K‘ ¨Ó/Ô0ÙØ�‰�i¡ xÓ 0Ð1°Ð3Ô4Ùð	Ø×(Ñ(¨Ó2ˆHð 	�‰�e˜H˜: QÐ'Ô(Ø‡K�K‘  sÓ+Ô,Ø˜V W¨d°JÀÈÐQ€NÜ
ˆ>ÔØ-;Ö<¨‘F˜1š7 •OÐ<ˆÐ<Ø�‰Ð=Ð6×=Ñ=¸xÐHÔIÙØ�‰�e™F 4›L˜>¨Ð+Ô,Ø‡K�K�ÔØ�7‰7�4‹=Ðøô ò 	Ùð	üò =s   ÂE' Ã5E6Å'	E3Å2E3c                 óš   — t        j                  t        di d| “d|“d|“d|“d|“d|“d|“d|“d	|“d
|	“d|
“d|“d|“d|“d|“d|“Ž«      S )a¯      Returns a QR code which encodes a `MeCard <https://en.wikipedia.org/wiki/MeCard>`_

    :param str name: Name. If it contains a comma, the first part
            is treated as lastname and the second part is treated as forename.
    :param reading: Designates a text string to be set as the kana name in the phonebook
    :type reading: str or None
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the date as YYYYMMDD value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param roomno: Room number (address information).
    :type roomno: str or None
    :param houseno: House number (address information).
    :type houseno: str or None
    :param city: City (address information).
    :type city: str or None
    :param prefecture: Prefecture (address information).
    :type prefecture: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :rtype: segno.QRCode
    r*   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   r&   )r!   r"   rM   )r*   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   s                   r   Úmake_mecardrO   ¯   s¹   € ôR �=‰=Ô)ò ;©tð ;¹Wð ;Ù05ð;Ù=Bð;á5?ð;áFJð;ñ 4<ð;ñ GOð;ñ /2ð	;ñ :?ð	;ñ HNð	;ñ
 3:ð;ñ
 AEð;ñ 6@ð;ñ JQð;ñ 3:ð;ó <ð <r   zB^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:(?:-?\d{2}:\d{2})|Z)?)?$c                 óÔ  ‡— ˆfd„}t         Šddd| › �d ‰|«      › �g}|r|j                  d ‰|«      › �«       |j                   |d|«      «       |j                   |d|«      «       |j                   |d	|«      «       |j                   |d
|«      «       |j                   |d|«      «       |j                   |d|«      «       |j                   |d|«      «       |j                   |d|	«      «       |j                   |d|«      «       |j                   |d|«      «       |r|j                  d ‰|«      › �«       |
|||||f}t        |«      r7|D �cg c]  } ‰|xs d«      ‘Œ }}|j                   dj                  |Ž «       |rL	 |j                  d«      }t        |t        «      rt        |«      st        d«      ‚|j                  d|› �«       |r|r|r|st        d«      ‚|r|r|j                  d|› d|› �«       |r|j                  d ‰|«      › �«       |r|j                  d ‰|«      › �«       |rL	 |j                  d«      }t        |t        «      rt        |«      st        d«      ‚|j                  d|› �«       |j                  d«       |j                  d«       dj                  |«      S c c}w # t        $ r Y �Œ2w xY w# t        $ r Y Œ�w xY w) a–
      Creates a string encoding the contact information as vCard 3.0.

    Only a subset of available `vCard 3.0 properties <https://tools.ietf.org/html/rfc2426>`
    is supported.

    :param str name: The name. If it contains a semicolon, , the first part
            is treated as lastname and the second part is treated as forename.
    :param str displayname: Common name.
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param fax: Fax number. Multiple values are allowed.
    :type fax: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the
                     date as ``YYYY-MM-DD`` value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param street: Street address.
    :type street: str or None
    :param city: City (address information).
    :type city: str or None
    :param region: Region (address information).
    :type region: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :param org: Company / organization name.
    :type org: str or None
    :param lat: Latitude.
    :type lat: float or None
    :param lng: Longitude.
    :type lng: float or None
    :param source: URL where to obtain the vCard.
    :type source: str or None
    :param rev: Revision of the vCard / last modification date.
    :type rev: str, datetime.date or None
    :param title: Job Title. Multiple values are allowed.
    :type title: str, iterable of strings, or None
    :param photo_uri: Photo URI. Multiple values are allowed.
    :type photo_uri: str, iterable of strings, or None
    :param cellphone: Cell phone number. Multiple values are allowed.
    :type cellphone: str, iterable of strings, or None
    :param homephone: Home phone number. Multiple values are allowed.
    :type homephone: str, iterable of strings, or None
    :param workphone: Work phone number. Multiple values are allowed.
    :type workphone: str, iterable of strings, or None
    :rtype: str
    c                 óp   •— |syt        |t        «      r|f}|D �cg c]  }| › d ‰|«      › �‘Œ c}S c c}w )Nr&   r   r'   r)   s      €r   r-   z(make_vcard_data.<locals>.make_multifield'  s=   ø€ ÙØÜ�cœ3ÔØ�&ˆCØ/2Ö3¨!�4�&˜™& ›)˜Ò%Ò3Ð3ùÒ3s   œ3zBEGIN:VCARDzVERSION:3.0zN:zFN:zORG:r0   r.   zTEL;TYPE=FAXzTEL;TYPE=VIDEOzTEL;TYPE=CELLzTEL;TYPE=HOMEzTEL;TYPE=WORKr3   ÚTITLEzPHOTO;VALUE=urir1   r4   zADR:{0};;{1};{2};{3};{4};{5}z%Y-%m-%dzG"birthday" does not seem to be a valid date or date/time representationr2   zBIncomplete geo information, please specify latitude and longitude.zGEO:r   zSOURCE:zNOTE:zB"rev" does not seem to be a valid date or date/time representationzREV:z	END:VCARDz
)r   r5   r6   r9   r:   r7   r8   r(   r   Ú_looks_like_datetimeÚ
ValueErrorr;   ) r*   Údisplaynamer=   r>   Úfaxr?   r@   rA   rB   rC   rD   ÚstreetrG   ÚregionrI   rJ   ÚorgÚlatÚlngÚsourceÚrevÚtitleÚ	photo_uriÚ	cellphoneÚ	homephoneÚ	workphoner-   r   rK   r,   rL   r   s                                   @r   Úmake_vcard_datarc   å   sÊ  ø€ ôD4ô €FØ˜=Ø��ˆKØ‘&˜Ó%Ð&Ð'ð)€Dñ Ø�‰�d™6 #›;˜-Ð(Ô)Ø‡K�K‘ ¨Ó/Ô0Ø‡K�K‘  uÓ-Ô.Ø‡K�K‘ °Ó4Ô5Ø‡K�K‘Ð 0°*Ó=Ô>Ø‡K�K‘ °Ó;Ô<Ø‡K�K‘ °Ó;Ô<Ø‡K�K‘ °Ó;Ô<Ø‡K�K‘  sÓ+Ô,Ø‡K�K‘ ¨Ó/Ô0Ø‡K�K‘Ð 1°9Ó=Ô>ÙØ�‰�i¡ xÓ 0Ð1Ð2Ô3Ø˜V T¨6°7¸GÐD€NÜ
ˆ>ÔØ-;Ö<¨‘F˜1š7 •OÐ<ˆÐ<Ø�‰Ð9Ð2×9Ñ9¸8ÐDÔEÙð	Ø×(Ñ(¨Ó4ˆHô ˜(¤CÔ(Ô0DÀXÔ0NÜÐfÓgÐgØ�‰�e˜H˜:Ð&Ô'Ù‘C™S©ÜÐ]Ó^Ð^Ù
‰sØ�‰�d˜3˜%˜q  Ð&Ô'ÙØ�‰�g™f V›nÐ-Ð.Ô/ÙØ�‰�e™F 4›L˜>Ð*Ô+Ù
ð	Ø—,‘,˜zÓ*ˆCô ˜#œsÔ#Ô+?ÀÔ+DÜÐaÓbÐbØ�‰�d˜3˜%�LÔ!Ø‡K�K�ÔØ‡K�K�„OØ�;‰;�tÓÐùò9 =øô
 ò 	Úð	ûô  ò 	Ùð	ús*   ÅKÆK ÉK Ë	KËKË	K'Ë&K'c                 óÎ   — t        j                  t        | |fi d|“d|“d|“d|“d|“d|“d|“d|	“d	|
“d
|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“Ž«      S )aÁ
      Creates a QR code which encodes a `vCard <https://en.wikipedia.org/wiki/VCard>`_
    version 3.0.

    Only a subset of available `vCard 3.0 properties <https://tools.ietf.org/html/rfc2426>`
    is supported.

    :param str name: The name. If it contains a semicolon, , the first part
            is treated as lastname and the second part is treated as forename.
    :param str displayname: Common name.
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param fax: Fax number. Multiple values are allowed.
    :type fax: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the
                     date as ``YYYY-MM-DD`` value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param street: Street address.
    :type street: str or None
    :param city: City (address information).
    :type city: str or None
    :param region: Region (address information).
    :type region: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :param org: Company / organization name.
    :type org: str or None
    :param lat: Latitude.
    :type lat: float or None
    :param lng: Longitude.
    :type lng: float or None
    :param source: URL where to obtain the vCard.
    :type source: str or None
    :param rev: Revision of the vCard / last modification date.
    :type rev: str, datetime.date or None
    :param title: Job Title. Multiple values are allowed.
    :type title: str, iterable of strings, or None
    :param photo_uri: Photo URI. Multiple values are allowed.
    :type photo_uri: str, iterable of strings, or None
    :param cellphone: Cell phone number. Multiple values are allowed.
    :type cellphone: str, iterable of strings, or None
    :param homephone: Home phone number. Multiple values are allowed.
    :type homephone: str, iterable of strings, or None
    :param workphone: Work phone number. Multiple values are allowed.
    :type workphone: str, iterable of strings, or None
    :rtype: segno.QRCode
    r=   r>   rV   r?   r@   rA   rB   rC   rD   rW   rG   rX   rI   rJ   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   )r!   r"   rc   )r*   rU   r=   r>   rV   r?   r@   rA   rB   rC   rD   rW   rG   rX   rI   rJ   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   s                             r   Ú
make_vcardre   a  s  € ôF �=‰=œ¨¨{ò >Á%ð >Ù/4ð>Ù:=ð>á4>ð>áEIð>ñ 3;ð>ñ FNð>ñ .1ð	>ñ 9>ð	>ñ GMð	>ñ
 /3ð>ñ
 <Bð>ñ 29ð>ñ CJð>ñ .1ð>ñ 7:ð>ñ @Cð>ñ 17ð>ñ =@ð>ñ HMð>ñ 4=ð>ñ 4=ð>ñ 4=ð>ñ 4=ð>ó ?ð ?r   c                 ó0   — d„ }d || «      › d ||«      › �S )zt    Creates a geo location URI.

    :param float lat: Latitude
    :param float lng: Longitude
    :rtype: str
    c                 óF   — | d›j                  d«      j                  d«      S )Nz.8fÚ0ú.)Úrstrip)Úfs    r   Úfloat_to_strz#make_geo_data.<locals>.float_to_str»  s"   € Ø�C�× Ñ  Ó%×,Ñ,¨SÓ1Ð1r   zgeo:r   r&   )rZ   r[   rl   s      r   Úmake_geo_datarm   ³  s(   € ò2ð ‘,˜sÓ#Ð$ A¡l°3Ó&7Ð%8Ð9Ð9r   c                 ó@   — t        j                  t        | |«      «      S )z·    Returns a QR code which encodes geographic location using the ``geo`` URI
    scheme.

    :param float lat: Latitude
    :param float lng: Longitude
    :rtype: segno.QRCode
    )r!   r"   rm   )rZ   r[   s     r   Úmake_georo   Á  s   € ô �=‰=œ s¨CÓ0Ó1Ð1r   c                 óª  — d„ }d}dg}| st        d«      ‚|j                  dj                   || «      «      «       d|fd|ffD ]9  \  }}	 ||	«      }
|
sŒ|j                  |› |› ddj                  |
«      › �«       d	}Œ; d
|fd|ffD ]9  \  }}	|	�0|j                  |› |› dt        |	j	                  d«      «      › �«       d	}Œ; dj                  |«      S )a|      Creates either a simple "mailto:" URL or complete e-mail message with
    (blind) carbon copies and a subject and a body.

    :param to: The email address (recipient). Multiple values are allowed.
    :type to: str or iterable of strings
    :param cc: The carbon copy recipient. Multiple values are allowed.
    :type cc: str, iterable of strings, or None
    :param bcc: The blind carbon copy recipient. Multiple values are allowed.
    :type bcc: str, iterable of strings, or None
    :param subject: The subject.
    :type subject: str or None
    :param body: The message body.
    :type body: str or None
    :rtype: str
    c                 óD   — | syt        | t        «      r| fS t        | «      S )Nr&   )r(   r   Útuple)r+   s    r   Úmultiz#make_make_email_data.<locals>.multiÞ  s#   € ÙØÜ�cœ3ÔØ�6ˆMÜ�S‹zÐr   ú?zmailto:z"to" must not be empty or Noner   ÚccÚbccú=ú&ÚsubjectÚbodyúutf-8r4   )rT   r5   r;   r   Úencode)Útoru   rv   ry   rz   rs   Údelimr   Úkeyr+   Úvalss              r   Úmake_make_email_datar�   Í  sù   € ò"ð €EØˆ;€DÙÜÐ9Ó:Ð:Ø‡K�K�—‘™˜r›Ó#Ô$Ø˜B�Z %¨ Ð.ò ‰ˆˆSÙ�S‹zˆÚØ�K‰K˜5˜' #  a¨¯©°«Ð'7Ð8Ô9Ø‰Eð	ð
   Ð)¨F°D¨>Ð:ò ‰ˆˆSØˆ?Ø�K‰K˜5˜' #  a¬¨c¯j©j¸Ó.AÓ(BÐ'CÐDÔEØ‰ðð �7‰7�4‹=Ðr   c           	      óH   — t        j                  t        | ||||¬«      «      S )a�      Encodes either a simple e-mail address or a complete message with
    (blind) carbon copies and a subject and a body.

    :param to: The email address (recipient). Multiple values are allowed.
    :type to: str or iterable of strings
    :param cc: The carbon copy recipient. Multiple values are allowed.
    :type cc: str, iterable of strings, or None
    :param bcc: The blind carbon copy recipient. Multiple values are allowed.
    :type bcc: str, iterable of strings, or None
    :param subject: The subject.
    :type subject: str or None
    :param body: The message body.
    :type body: str or None
    :rtype: segno.QRCode
    ©r}   ru   rv   ry   rz   )r!   r"   r�   rƒ   s        r   Ú
make_emailr„   ö  s+   € ô" �=‰=Ô-°¸ÀØ6=ÀDôJó Kð Kr   c                 ó~  — d}t        j                  d«      }	t        j                  d«      }
|r|j                  «       n|}|r|j                  «       n|}|r|j                  «       n|}| r| j                  «       n| } |�it	        |t
        «      r$	 |j                  |j                  «       «      dz   }n5t	        |t        «      rd|cxk  rt        |«      k  sn t        d|› d	�«      ‚|s|r|r|rt        d
«      ‚|r.dt        |«      cxk  rdk  sn t        dt        |«      › d	�«      ‚|r.dt        |«      cxk  rdk  sn t        dt        |«      › d	�«      ‚| �dt        | «      cxk  rdk  sn t        d| › d	�«      ‚|�dt        |«      cxk  rdk  sn t        d|› d	�«      ‚|rt        |«      dvrt        d|› d	�«      ‚|rt        |«      dk7  rt        d|› d	�«      ‚t        j                  |«      }|	|cxk  r|
k  sn t        d|	› d|
› �«      ‚dddd|xs d| |d|d›�j                  d «      j                  d!«      |xs d|xs dg
}|r|j                  |«       d"j                  |«      }|€d#n|}|dk  r-t        |dd d$¬%«      D ]  \  }}	 |j                  |«       |} n |dk  rd}t        |«      |d$<   d"j                  |«      j                  ||dz
     «      }t        |«      d&kD  rt        d't        |«      › d(�«      ‚|S # t        $ r t        d|› d|› �«      ‚w xY w# t        $ r Y Œ©w xY w))zõ    Validates the input and creates the data for an EPC QR Code.

    DOES NOT belong to the public API, kept separate from make_epc_qr to apply
    tests on the raw data.

    See :py:func:`make_epc_qr` for a description of the parameters.
    )r{   z
iso-8859-1z
iso-8859-2z
iso-8859-4z
iso-8859-5z
iso-8859-7ziso-8859-10ziso-8859-15z0.01z999999999.99Né   zInvalid encoding "z", use one of z6Invalid encoding number only 1 .. 8 are allowed, got "r   zBEither a text or a creditor reference (ISO 11649) must be providedr   éŒ   z4Invalid text, max. 140 characters are allowed, got "é#   zMInvalid creditor reference (ISO 11649), max. 35 characters are allowed, got "éF   z3Invalid name, max. 70 characters are allowed, got "é   é"   z>Invalid IBAN, min. 5 and max. 34 characters are allowed, got ")é   é   z5Invalid BIC, should be 8 or 11 characters long, got "z0Invalid purpose, 4 characters are allowed, got "z+Invalid amount, must be in bigger or equal z and less or equal ÚBCDÚ002r4   ÚSCTÚEURz.2frh   ri   ú
éÿÿÿÿé   )ÚstartiK  z0Payload is too big: Max. 331 bytes allowed, got z bytes)ÚdecimalÚDecimalrj   Ústripr(   r   ÚindexÚlowerrT   ÚintÚlenr5   r;   Ú	enumerater|   ÚUnicodeEncodeError)r*   ÚibanÚamountÚtextÚ	referenceÚbicÚpurposeÚencodingÚ	encodingsÚ
min_amountÚ
max_amountÚtmp_datar   ÚcharsetÚidxÚencs                   r   Ú_make_epc_qr_datar­     s�  € ðK€Iä—‘ Ó(€JÜ—‘ Ó0€JÙ ˆ4�;‰;Œ= d€DÙ&/�	× Ñ Ô"°Y€IÙˆ#�)‰)Œ+ #€CÙˆ4�:‰:Œ< T€DØÐÜ�h¤Ô$ð[Ø$Ÿ?™?¨8¯>©>Ó+;Ó<¸qÑ@‘ô ˜H¤cÔ*°!°xÔ2QÄ3ÀyÃ>Ô2QÜÐUÐV^ÐU_Ð_`ÐaÓbÐbÙ™©±ÜÐ]Ó^Ð^Ù�Aœ˜D›	Ô( SÔ(ÜÐOÔPSÐTXÓPYÈ{ÐZ[Ð\Ó]Ð]Ù	˜1œs 9›~Ô3°Ô3Üð !Ü!$ Y£Ð 0°ð3ó 4ð 	4à€|˜1œs 4›yÔ.¨BÔ.ÜÐNÈtÈfÐTUÐVÓWÐWØ€|˜1œs 4›yÔ.¨BÔ.ÜÐYÐZ^ÐY_Ð_`ÐaÓbÐbÙ
Œs�3‹x˜wÑ&ÜÐPÐQTÐPUÐUVÐWÓXÐXÙ”3�w“< 1Ò$ÜÐKÈGÈ9ÐTUÐVÓWÐWÜ�_‰_˜VÓ$€FØ˜Ô- :Ô-ÜÐFÀzÀlÐReÐfpÐeqÐrÓsÐsØØØØØ’	�rØØØ�f˜S�\Ð"×)Ñ)¨#Ó.×5Ñ5°cÓ:Ø’˜2Ø’˜Rð
€Hñ Ø�‰˜ÔØ�9‰9�XÓ€DØÐ$‰b¨(€GØ�‚{Ü! )¨A¨B -°qÔ9ò 	‰HˆC�ðØ—‘˜CÔ Ø�Ùð		ð �‚{ØˆÜ�g“,€HˆQ�KØ�9‰9�XÓ×%Ñ% i°¸!±Ñ&<Ó=€Dä
ˆ4ƒy�3‚ÜÐKÌCÐPTËIÈ;ÐV\Ð]Ó^Ð^Ø€Køôi ò [Ü Ð#5°h°Z¸~ÈiÈ[Ð!YÓZÐZð[ûôV &ò Ùðús   Â"L ÊL0ÌL-Ì0	L<Ì;L<c                 ó¦   — t        j                  t        | |||||||«      dd¬«      }|j                  dkD  rt	        d|j
                  › d�«      ‚|S )aŠ      Creates and returns an European Payments Council Quick Response Code
    (EPC QR Code) version 002.

    The returned :py:class:`segno.QRCode` uses always the error correction level
    "M" and utilizes max. version 13 to fulfill the constraints of the EPC QR
    Code standard.

    .. note::

        Either the ``text`` or ``reference`` must be provided but not both

    .. note::

        Neither the IBAN, BIC, nor remittance reference number or any other
        information is validated (aside from checks regarding the allowed string
        lengths).

    :param str name: Name of the recipient.
    :param str iban: International Bank Account Number (IBAN)
    :param amount: The amount (in EUR) to transfer.
            The currency is always Euro, no other currencies are supported.
    :type amount: int, float, decimal.Decimal
    :param str text: Remittance Information (unstructured)
    :param str reference: Remittance Information (structured)
    :param str bic: Bank Identifier Code (BIC). Optional, only required
                for non-EEA countries.
    :param str purpose: SEPA purpose code.
    :param encoding: By default, this function tries to find the best,
                minimal encoding. If another encoding should be used, the encoding
                name or the encoding constant (an integer) can be provided:
                ``1``: "UTF-8", ``2``: "ISO 8859-1", ``3``: "ISO 8859-2",
                ``4``: "ISO 8859-4", ``5``: "ISO 8859-5", ``6``: "ISO 8859-7",
                ``7``: "ISO 8859-10", ``8``: "ISO 8859-15"

                The encoding is case-insensitive.
    :type encoding: str or int
    :rtype: segno.QRCode
    ÚmF)ÚerrorÚboost_erroré   z>Invalid EPC QR Code, max. QR Code version 13 is allowed, got "r   )r!   r"   r­   ÚversionrT   Ú
designator)	r*   rŸ   r    r¡   r¢   r£   r¤   r¥   Úqrs	            r   Úmake_epc_qrr¶   Y  sb   € ôV 
�‰Ô(¨¨t°V¸TÀ9Ø),¨g°xóAà ¨eô
5€Bð 
‡z�z�B‚ÜÐYÐZ\×ZgÑZgÐYhÐhiÐjÓkÐkØ€Ir   )NNF)NNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNNN)NNNN)NNNNN)Ú__doc__Úrer–   r!   Úurllib.parser   Úordr   r   r   r   r   r#   rM   rO   ÚcompileÚmatchrS   rc   re   rm   ro   r�   r„   r­   r¶   r&   r   r   ú<module>r½      s+  ðñ	ó 
Û Û Ý ñ ˆƒIˆvÙˆƒHˆeÙˆƒHˆeÙˆƒHˆeð	€ñ ˆƒHˆeÙˆƒHˆeð€ò,ò+óó4Kð$ MQØBFØAEØ<@óGðT HLØIMØAEØ&*ó0<ðf "�r—z‘zÐ"gÓh×nÑnÐ ð DHØHLØIMØHLØAEØ>Bóyðx ?CØCGØDHØCGØ<@Ø9=óO?òd:ò	2ó&óRKð* JNØ-1óKð\ DHØ'+ô1r   