Ë
    º2Úi”  ã            
       óV  — d Z ddlZddlmZmZ ddlmZ ddlmZ ddl	Z	ddl
mZ ddlmZ ddlmZmZ dd	lmZ dd
lmZ  ee¬«      ddededefd„«       Z ee¬«      ddedededefd„«       Z ee¬«      ddedededefd„«       Zddedededefd„Zddedededefd„Zdedefd„Zy)zHTools for generating QR codes. This module depends on the Segno library.é    N)ÚMappingÚAny)Úescape)Ú	mark_safe)Úvalidate_arguments)ÚPYDANTIC_CONFIG)ÚDEFAULT_CACHE_ENABLEDÚDEFAULT_URL_SIGNATURE_ENABLED)Úmake_qr_code_url)ÚQRCodeOptions)ÚconfigÚdataÚqr_code_optionsÚ
force_textc                 ó°   — |r1t        j                  t        | «      fi |j                  «       ¤ddi¤ŽS t        j                  | fi |j                  «       ¤ŽS )aa  Creates a QR code that encodes the given `data` with the given `qr_code_options`.

    :param str data: The data to encode
    :param qr_code_options: Options to create and serialize the QR code.
    :param bool force_text: Tells whether we want to force the `data` to be considered as text string and encoded in byte mode.
    :rtype: segno.QRCode
    ÚmodeÚbyte)ÚsegnoÚmakeÚstrÚkw_make)r   r   r   s      úK/var/www/html/acx/venv/lib/python3.12/site-packages/qr_code/qrcode/maker.pyÚmake_qrr      sJ   € ñ Ü�z‰zœ#˜d›)ÑN ×'>Ñ'>Ó'@ÑNÀvÒNÐNÜ�:‰:�dÑ8˜o×5Ñ5Ó7Ñ8Ð8ó    Úreturnc                 ó¨   — t        | ||¬«      }t        j                  «       } |j                  |fi |j	                  «       ¤Ž |j                  «       S )aZ  
    Creates a bytes object representing a QR code image for the provided `data`.

    :param str data: The data to encode
    :param qr_code_options: Options to create and serialize the QR code.
    :param bool force_text: Tells whether we want to force the `data` to be considered as text string and encoded in byte mode.
    :rtype: bytes
    ©r   )r   ÚioÚBytesIOÚsaveÚkw_saveÚgetvalue)r   r   r   ÚqrÚouts        r   Úmake_qr_code_imager%       sE   € ô 
��°:Ô	>€BÜ
�*‰*‹,€CØ€B‡G�GˆCÑ-�?×*Ñ*Ó,Ò-Ø�<‰<‹>Ðr   c                 óL  — t        | ||¬«      }|j                  «       }|j                  d«       |j                  dk(  r½t	        | t
        «      rdd}g d¢}|j                  r7|j                  |j                  «      }|dkD  r|d   ||<   |j                  |d<   |D ]  }	 | j                  |«      } n  nt	        | t        «      st        | «      }n| }t        d |j                  d
i |¤Ž› dt        |«      › d	�«      S t         |j                  d
i |¤Ž«      S # t        $ r Y Œˆw xY w)z‹
    Generates a <svg> or <img> tag representing the QR code for the given `data`.
    This tag can be embedded into an HTML document.
    r   ÚkindÚpngÚ )zutf-8z
iso-8859-1z	shift-jisr   z
<img src="z" alt="z">© )r   r!   ÚpopÚimage_formatÚ
isinstanceÚbytesÚencodingÚindexÚdecodeÚUnicodeDecodeErrorr   r   Úpng_data_urir   Ú
svg_inline)	r   r   r   r#   ÚkwÚaltÚ	encodingsÚeiÚes	            r   Úmake_embedded_qr_coder:   0   s(  € ô 
��°:Ô	>€BØ	×	 Ñ	 Ó	"€Bð ‡F�Fˆ6„NØ×#Ñ# uÒ,Ü�dœEÔ"ØˆCÚ<ˆIØ×'Ò'Ø—_‘_ _×%=Ñ%=Ó>�Ø˜’6Ø$-¨a¡L�I˜b‘MØ#2×#;Ñ#;�I˜a‘LØò �ðØŸ+™+ a›.�CÙñô ˜D¤#Ô&Ü�d“)‰CàˆCÜ˜: o b§o¡oÑ&;¸Ñ&;Ð%<¸GÄFÈ3ÃKÀ=ÐPRÐSÓTÐTÜ�]�R—]‘]Ñ( RÑ(Ó)Ð)øô *ò Ùðús   ÂDÄ	D#Ä"D#Úqr_code_argsc                 ó4   — t        |«      }t        | ||¬«      S )Nr   )Ú_options_from_argsr:   )r   r;   r   Úoptionss       r   Úmake_qr_code_with_argsr?   R   s   € Ü  Ó.€GÜ   w¸:ÔFÐFr   c                 óè   — |j                  dt        «      }t        |t        «      s|dk(   }|j                  dt        «      }t        |t        «      s|dk(   }t        |«      }t        | ||||¬«      S )NÚcache_enabledÚFalseÚurl_signature_enabled)r   rA   rC   )r+   r	   r-   Úboolr
   r=   r   )r   r;   r   rA   rC   r>   s         r   Úmake_qr_code_url_with_argsrE   W   sƒ   € Ø ×$Ñ$ _Ô6KÓL€MÜ�m¤TÔ*Ø)¨WÑ4Ð4ˆØ(×,Ñ,Ð-DÔFcÓdÐÜÐ+¬TÔ2Ø$9¸WÑ$DÐ DÐÜ  Ó.€GÜ˜D '°jÐP]ð  vKô  Lð  Lr   Úargsc                 óÜ   — | j                  d«      }|rt        |t        «      st        d«      ‚|S | j	                  «       D ��ci c]  \  }}||dk7  r|nd“Œ }}}t        di |¤Ž}|S c c}}w )z=Returns a QRCodeOptions instance from the provided arguments.r>   z3The options argument must be of type QRCodeOptions.ÚNoneNr*   )Úgetr-   r   Ú	TypeErrorÚitems)rF   r>   ÚkÚvr5   s        r   r=   r=   b   st   € à�h‰h�yÓ!€GÙÜ˜'¤=Ô1ÜÐQÓRÐRð
 €Nð 9=¿
¹
»×E±°°1ˆa�a˜6’k‘ tÑ+ÐEˆÑEÜÑ% "Ñ%ˆØ€Nùó Fs   ÁA()T)Ú__doc__r   Útypingr   r   Údjango.utils.htmlr   Údjango.utils.safestringr   r   Úpydanticr   Úqr_code.qrcoder   Úqr_code.qrcode.constantsr	   r
   Úqr_code.qrcode.server   Úqr_code.qrcode.utilsr   rD   r   r.   r%   r   r:   Údictr?   rE   r=   r*   r   r   ú<module>rX      s#  ðÙ NÛ 	ß å $Ý -Û Ý 'å *ß YÝ 1Ý .ñ ˜?Ô+ñ9�#ð 9¨ð 9À4ò 9ó ,ð9ñ ˜?Ô+ñ˜Sð °=ð Èdð Ð^cò ó ,ðñ ˜?Ô+ñ* ð *°mð *ÐQUð *Ðadò *ó ,ð*ñBG ð G°Dð GÀdð GÐVYó Gñ
L Sð L¸ð LÈ$ð LÐZ]ó Lð
˜Wð 
¨ô 
r   