ó
    ùŠÂjÑ  ã                   ó¬   • S SK r S SKJr  S SKJrJrJr  S SKJrJ	r	J
r
       SS\S\S\\   S\\   S	\\   S
\\   S\\   S\4S jjrS\S\S\4S jrg)é    N)Úcompare_digest)ÚDictÚOptionalÚUnion)ÚquoteÚ	urlencodeÚurlparseÚsecretÚnameÚinitial_countÚissuerÚ	algorithmÚdigitsÚperiodÚreturnc                 óÚ  • USLnUSL=(       a    US:g  n	USL=(       a    US:g  n
USL=(       a    US:g  nU(       a  SOSnSnSU 0n[        U5      nUb  [        U5      S	-   U-   nX>S
'   U(       a  X.S'   U	(       a  UR                  5       US'   U
(       a  X^S'   U(       a  XnS'   UR                  5        Hˆ  u  nn[        U[        5      (       d  [        S5      eUS:X  aW  [        U5      nUR                  S:w  d"  UR                  (       a  UR                  (       d  [        SR                  U5      5      eUUU'   MŠ     UR                  XÏ[        U5      R                  SS5      5      nU$ )a  
Returns the provisioning URI for the OTP; works for either TOTP or HOTP.

This can then be encoded in a QR Code and used to provision the Google
Authenticator app.

For module-internal use.

See also:
    https://github.com/google/google-authenticator/wiki/Key-Uri-Format

:param secret: the hotp/totp secret used to generate the URI
:param name: name of the account
:param initial_count: starting counter value, defaults to None.
    If none, the OTP type will be assumed as TOTP.
:param issuer: the name of the OTP issuer; this will be the
    organization title of the OTP entry in Authenticator
:param algorithm: the algorithm used in the OTP generation.
:param digits: the length of the OTP generated code.
:param period: the number of seconds the OTP generator is set to
    expire every code.
:param kwargs: other query string parameters to include in the URI
:returns: provisioning uri
NÚsha1é   é   ÚhotpÚtotpzotpauth://{0}/{1}?{2}r
   Ú:r   Úcounterr   r   r   z*All otpauth uri parameters must be stringsÚimageÚhttpsz{} is not a valid urlÚ+z%20)r   ÚupperÚitemsÚ
isinstanceÚstrÚ
ValueErrorr	   ÚschemeÚnetlocÚpathÚformatr   Úreplace)r
   r   r   r   r   r   r   ÚkwargsÚis_initial_count_presentÚis_algorithm_setÚis_digits_setÚis_period_setÚotp_typeÚbase_uriÚurl_argsÚlabelÚkÚvÚ	image_uriÚuris                       ÚA/var/www/website/venv/lib/python3.13/site-packages/pyotp/utils.pyÚ	build_urir5      sf  € ðF  -°DÐ8Ðð !¨Ð,×D°¸fÑ1DÐØ $Ð&×6¨6°Q©;€MØ $Ð&×7¨6°R©<€Mæ1‰v°v€HØ&€Hà2:¸FÐ1C€Hä�$‹K€EØÑÜ�f“ Ñ# eÑ+ˆØ#�ÑæØ+�ÑÞØ )§¡Ó 1ˆ�ÑÞØ#�ÑÞØ#�ÑØ—‘–‰ˆˆ1Ü˜!œS×!Ñ!ÜÐIÓJÐJØ�‹<Ü  ›ˆIØ×Ñ 7Ó*°)×2B×2BÈ)Ï.Ï.Ü Ð!8×!?Ñ!?À	Ó!JÓKÐKØˆ�‹ñ ð �/‰/˜(¬9°XÓ+>×+FÑ+FÀsÈEÓ+RÓ
S€CØ€Jó    Ús1Ús2c                 ó²   • [         R                  " SU 5      n [         R                  " SU5      n[        U R                  S5      UR                  S5      5      $ )a  
Timing-attack resistant string comparison.

Normal comparison using == will short-circuit on the first mismatching
character. This avoids that by scanning the whole string, though we
still reveal to a timing attack whether the strings are the same
length.
ÚNFKCzutf-8)ÚunicodedataÚ	normalizer   Úencode)r7   r8   s     r4   Ústrings_equalr>   P   sG   € ô 
×	Ò	˜v rÓ	*€BÜ	×	Ò	˜v rÓ	*€BÜ˜"Ÿ)™) GÓ,¨b¯i©i¸Ó.@ÓAÐAr6   )NNNNN)r;   Úhmacr   Útypingr   r   r   Úurllib.parser   r   r	   r    Úintr5   Úboolr>   © r6   r4   Ú<module>rE      sµ   ðÛ Ý ß (Ñ (ß 3Ñ 3ð $(Ø Ø#Ø Ø ñFØðFà
ðFð ˜C‘=ðFð �S‰Mð	Fð
 ˜‰}ðFð �S‰MðFð �S‰MðFð 	õFðRB�cð B˜sð B tõ Br6   