Ë
    ¨Õ°j#:  ã                  ó  — d Z ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlmZmZmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZmZ ddl m Z  erddl!m"Z"m#Z#  e"d«      Z$ejJ                  Z%ejL                  Z&ejN                  Z'ejP                  Z)ejT                  Z+ejX                  Z-ej\                  Z/d d„Z0ed!d„«       Z1	 	 	 	 	 	 d"d„Z2ejf                  d#d„«       Z4d$d„Z5d„ Z6d%d&d„Z7 ejp                  de	jr                  › d�«      Z: ejp                  d«      Z; ejp                  d«      Z<d'd„Z=	 	 d(	 	 	 	 	 	 	 	 	 d)d„Z>d*d„Z?	 	 	 	 	 	 d+	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d,d„Z@d-d„ZAd.d„ZBy)/zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
é    )ÚannotationsN)ÚCallableÚIterableÚMapping)ÚTYPE_CHECKING)Ú	pass_noneé   )Úlog)Únewer)ÚdetectÚmacos)ÚDistutilsByteCompileErrorÚDistutilsPlatformError)Úspawn)ÚTypeVarTupleÚUnpackÚ_Tsc                ó\   — | j                  d«      D �cg c]  }t        |«      ‘Œ c}S c c}w )zEConvert a dot-separated string into a list of numbers for comparisonsú.)ÚsplitÚint)ÚsÚns     úP/var/www/mission/venv/lib/python3.12/site-packages/setuptools/_distutils/util.pyÚsplit_versionr   .   s"   € àŸG™G C›LÖ)�qŒC��FÒ)Ð)ùÒ)s   ”)c                óR   — t        j                  t        j                  | «      «      S )a.  
    Allow for pathlib.Path inputs, coax to a native path string.

    If None is passed, will just pass it through as
    Setuptools relies on this behavior.

    >>> convert_path(None) is None
    True

    Removes empty paths.

    >>> convert_path('foo/./bar').replace('\\', '/')
    'foo/bar'
    )ÚosÚfspathÚpathlibÚPurePath)Úpathnames    r   Úconvert_pathr"   3   s   € ô  �9‰9”W×%Ñ% hÓ/Ó0Ð0ó    c                ó  — t         j                  dk(  rkt         j                  j                  |«      s t         j                  j	                  | |«      S t         j                  j	                  | t        |«      dd «      S t         j                  dk(  r]t         j                  j                  |«      \  }}|d   t         j                  k(  r|dd }t         j                  j	                  | |«      S t        dt         j                  › d�«      ‚)a	  Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    Úposixr	   NÚntr   znothing known about platform 'ú')	r   ÚnameÚpathÚisabsÚjoinÚstrÚ
splitdriveÚsepr   )Únew_rootr!   Ú_driver)   s       r   Úchange_rootr1   F   sÃ   € ô 
‡w�w�'ÒÜ�w‰w�}‰}˜XÔ&Ü—7‘7—<‘< ¨(Ó3Ð3ô —7‘7—<‘< ¬#¨h«-¸¸Ð*;Ó<Ð<ä	�‰�DŠÜŸ™×+Ñ+¨HÓ5‰ˆ�Ø�‰7”b—f‘fÒØ˜˜�8ˆDÜ�w‰w�|‰|˜H dÓ+Ð+ä
 Ð#AÄ"Ç'Á'ÀÈ!Ð!LÓ
MÐMr#   c                 óL  — t         j                  dk(  rNdt         j                  vr<	 ddl} | j	                  t        j
                  «       «      d   t         j                  d<   dt         j                  vrt        «       t         j                  d<   yy# t        t        f$ r Y Œ@w xY w)aL  Ensure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    r%   ÚHOMEr   Né   ÚPLAT)	r   r(   ÚenvironÚpwdÚgetpwuidÚgetuidÚImportErrorÚKeyErrorÚget_platform)r7   s    r   Úcheck_environr=   `   sƒ   € ô 
‡w�w�'Ò˜f¬B¯J©JÑ6ð	Ûà!$§¡¬b¯i©i«kÓ!:¸1Ñ!=ŒB�J‰J�vÑð ”R—Z‘ZÑÜ)›^Œ�
‰
�6Òð  øô œXÐ&ò 	ñ ð	ús   §;B ÂB#Â"B#c                ó  — t        «        t        t        j                  «      }|j	                  d„ |j                  «       D «       «       	 t        | «      j                  |«      S # t        $ r}t        d|› �«      ‚d}~ww xY w)aÃ  
    Perform variable substitution on 'string'.
    Variables are indicated by format-style braces ("{var}").
    Variable is substituted by the value found in the 'local_vars'
    dictionary or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    c              3  ó<   K  — | ]  \  }}|t        |«      f–— Œ y ­w©N©r,   )Ú.0r(   Úvalues      r   ú	<genexpr>zsubst_vars.<locals>.<genexpr>ƒ   s   è ø€ ÒK©¨¨u�4œ˜U›Ô$ÑKùs   ‚zinvalid variable N)
r=   Údictr   r6   ÚupdateÚitemsÚ_subst_compatÚ
format_mapr;   Ú
ValueError)r   Ú
local_varsÚlookupÚvars       r   Ú
subst_varsrN   w   sp   € ô „OÜ”"—*‘*Ó€FØ
‡M�MÑK¸
×8HÑ8HÓ8JÔKÔKð4Ü˜QÓ×*Ñ*¨6Ó2Ð2øÜò 4ÜÐ,¨S¨EÐ2Ó3Ð3ûð4ús   ÁA% Á%	BÁ.A<Á<Bc                óx   — d„ }t        j                  d|| «      }|| k7  rddl}|j                  dt        «       |S )zb
    Replace shell/Perl-style variable substitution with
    format-style. For compatibility.
    c                ó,   — d| j                  d«      › d�S )Nú{r	   ú})Úgroup)Úmatchs    r   Ú_substz_subst_compat.<locals>._subst�   s   € Ø�E—K‘K “NÐ# 2Ð&Ð&r#   z\$([a-zA-Z_][a-zA-Z_0-9]*)r   Nz-shell/Perl-style substitutions are deprecated)ÚreÚsubÚwarningsÚwarnÚDeprecationWarning)r   rU   ÚreplrX   s       r   rH   rH   Š   s?   € ò'ô �6‰6Ð/°¸Ó;€DØˆq‚yÛà�‰Ø;Üô	
ð €Kr#   c                ó   — |t        | «      z   S r@   rA   )ÚexcÚprefixs     r   Úgrok_environment_errorr_   ž   s   € ð ”C˜“HÑÐr#   z[^\\\'\"z ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*"c                ó  — | j                  «       } g }d}| �rqt        j                  | |«      }|€J ‚|j                  «       }|t	        | «      k(  r|j                  | d| «       	 |S | |   t        j                  v r*|j                  | d| «       | |d j                  «       } d}n½| |   dk(  r| d| | |dz   d z   } |dz   }n¡| |   dk(  rt        j                  | |«      }n1| |   dk(  rt        j                  | |«      }nt        d| |   › d�«      ‚|€t        d	| |   › d
�«      ‚|j                  «       \  }}| d| | |dz   |dz
   z   | |d z   } |j                  «       dz
  }|t	        | «      k\  r|j                  | «       	 |S | r�Œq|S )a  Split a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    r   Nú\r	   r'   ú"zthis can't happen (bad char 'z')zbad string (mismatched z	 quotes?)é   )ÚstripÚ_wordchars_rerT   ÚendÚlenÚappendÚstringÚ
whitespaceÚlstripÚ
_squote_reÚ
_dquote_reÚRuntimeErrorrJ   Úspan)r   ÚwordsÚposÚmrf   Úbegs         r   Úsplit_quotedrt   «   sÂ  € ð 	
�‰‹	€AØ€EØ
€Câ
Ü×Ñ  3Ó'ˆØˆ}Ðˆ}Ø�e‰e‹gˆØ”#�a“&Š=Ø�L‰L˜˜4˜C˜Ô!ØðD €LðA ˆS‰6”V×&Ñ&Ñ&ð �L‰L˜˜4˜C˜Ô!Ø�#�$�—‘Ó ˆAØ‰Càˆs‰V�tŠ^ð �$�3�˜!˜C !™G˜I˜,Ñ&ˆAØ˜‘'‰Cð �‰v˜Š}Ü×$Ñ$ Q¨Ó,‘Ø�3‘˜3’Ü×$Ñ$ Q¨Ó,‘ä"Ð%BÀ1ÀSÁ6À(È"Ð#MÓNÐNàˆyÜ Ð#:¸1¸S¹6¸(À)Ð!LÓMÐMàŸ™›‰JˆS�#Ø�$�3�˜!˜C !™G c¨A¡gÐ.Ñ.°°3°4°Ñ8ˆAØ—%‘%“'˜A‘+ˆCà”#�a“&Š=Ø�L‰L˜ŒOØà€LóQ ðP €Lr#   c                ó|   — |€ | j                   › |›�}|dd dk(  r|dd dz   }t        j                  |«        | |Ž  y)z¾
    Perform some action that affects the outside world (e.g. by
    writing to the filesystem). Was previously used to deal with
    "dry run" operations, but now runs unconditionally.
    Néþÿÿÿz,)r   ú))Ú__name__r
   Úinfo)ÚfuncÚargsÚmsgÚverboses       r   Úexecuter~   é   sJ   € ð €{Ø—‘� ˜xÐ(ˆØˆrˆsˆ8�tÒØ�a˜�)˜c‘/ˆCä‡H�HˆS„MÙˆ$‚Kr#   c                óR   — | j                  «       } | dv ry| dv ryt        d| ›�«      ‚)zôConvert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )ÚyÚyesÚtÚtrueÚonÚ1T)r   ÚnoÚfÚfalseÚoffÚ0Fzinvalid truth value )ÚlowerrJ   )Úvals    r   Ú	strtoboolr�   ý   s:   € ð �)‰)‹+€CØ
Ð2Ñ2ØØ	Ð5Ñ	5ØäÐ/°¨wÐ7Ó8Ð8r#   c                óþ  — t         j                  rt        d«      ‚|€|dk(  }|�s$t        j                  d«      \  }}t        j                  d|«       t        j                  |dd¬«      }	|	5  |	j                  d	«       |	j                  d
j                  t        t        | «      «      dz   «       |	j                  d|›d|›d|›d|›d|›d�«       ddd«       t         j                  g}
|
j                  t        j                   «       «       |
j#                  |«       t%        |
«       t'        t        j(                  |fd|› �«       yddlm} | D �]  }|dd dk7  rŒ|dk\  r+|dk(  rdn|}t.        j0                  j3                  ||¬«      }nt.        j0                  j3                  |«      }|}|r0|dt5        |«       |k7  rt7        d|›d|›�«      ‚|t5        |«      d }|r t        j8                  j                  ||«      }t        j8                  j;                  |«      }|sŒÔ|st=        ||«      r#t        j                  d||«        ||||«       �Œt        j>                  d||«       �Œ y# 1 sw Y   �Œ¢xY w)a   Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    zbyte-compiling is disabled.Nr   z.pyz$writing byte-compilation script '%s'Úwzutf-8)Úencodingz2from distutils.util import byte_compile
files = [
z,
z]
z
byte_compile(files, optimize=z, force=z,
         prefix=z, base_dir=z,
         verbose=z,
         direct=True)
z	removing )ÚcompileéýÿÿÿÚ )Úoptimizationzinvalid prefix: filename z doesn't start with zbyte-compiling %s to %sz%skipping byte-compilation of %s to %s) ÚsysÚdont_write_bytecoder   ÚtempfileÚmkstempr
   ry   r   ÚfdopenÚwriter+   ÚmapÚreprÚ
executableÚextendÚ
subprocessÚ"_optim_args_from_interpreter_flagsrh   r   r~   ÚremoveÚ
py_compiler‘   Ú	importlibÚutilÚcache_from_sourcerg   rJ   r)   Úbasenamer   Údebug)Úpy_filesÚoptimizeÚforcer^   Úbase_dirr}   ÚdirectÚ	script_fdÚscript_nameÚscriptÚcmdr‘   ÚfileÚoptÚcfileÚdfileÚ
cfile_bases                    r   Úbyte_compiler¶     sa  € ôH ×ÒÜ'Ð(EÓFÐFð €~Ø'¨1™}ˆò Ü#+×#3Ñ#3°EÓ#:Ñ ˆ�KÜ�‰Ð7¸ÔEÜ—‘˜9 c°GÔ<ˆàñ 	Ø�L‰Lðôð" �L‰L˜Ÿ™¤C¬¨hÓ$7Ó8¸5Ñ@ÔAØ�L‰LðØ&˜\¨°%°ð ;Ø�
˜+ h \ð 2Ø�ð ðô÷'	ô8 �~‰~ÐˆØ�
‰
”:×@Ñ@ÓBÔCØ�
‰
�;ÔÜˆcŒ
Ü”—	‘	˜K˜>¨Y°{°mÐ+DÕEõ 	'àó 	YˆDØ�B�Cˆy˜EÒ!ð ð
 ˜1Š}Ø$¨šM‘b¨x�Ü!Ÿ™×8Ñ8¸ÈCÐ8ÓP‘ä!Ÿ™×8Ñ8¸Ó>�ØˆEÙØ˜œ#˜f›+Ð&¨&Ò0Ü$Ø3°D°8Ð;OÐPVÈzÐZóð ð œc &›k˜mÐ,�ÙÜŸ™Ÿ™ X¨uÓ5�äŸ™×)Ñ)¨%Ó0ˆJÚÙœE $¨Ô.Ü—H‘HÐ6¸¸jÔIÙ˜D %¨Ö/ä—I‘IÐEÀtÈZÖXñ=	Y÷S	ñ 	ús   Á.A$I2É2I<c                óž   — d}| j                  d¬«      }|xr |d   j                  «       d   |d   k7  }|r|nd}|j                  |«      |z   S )zŒReturn a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    z        T)Úkeependséÿÿÿÿr   r“   )Ú
splitlinesr+   )ÚheaderÚindentÚlinesÚends_in_newlineÚsuffixs        r   Úrfc822_escaperÀ   ’  s`   € ð €FØ×Ñ tÐÓ,€Eð ÒF  b¡	× 4Ñ 4Ó 6°qÑ 9¸UÀ2¹YÑ F€OÙ&‰V¨B€Fà�;‰;�uÓ Ñ&Ð&r#   c                 ó>   — t        t        j                  d«      «      S )zKReturn True if the Python interpreter is built with free threading support.ÚPy_GIL_DISABLED)ÚboolÚ	sysconfigÚget_config_var© r#   r   Úis_freethreadedrÇ   ¡  s   € ä”	×(Ñ(Ð):Ó;Ó<Ð<r#   )r   r,   Úreturnz	list[int])r!   ústr | os.PathLike[str]rÈ   r,   )r/   rÉ   r!   rÉ   rÈ   r,   )rÈ   ÚNone)rK   zMapping[str, object]rÈ   r,   )zerror: )r]   Úobjectr^   r,   rÈ   r,   )r   r,   rÈ   z	list[str])NF)
rz   zCallable[[Unpack[_Ts]], object]r{   ztuple[Unpack[_Ts]]r|   rË   r}   rÃ   rÈ   rÊ   )rŒ   r,   rÈ   rÃ   )r   FNNTN)r¨   zIterable[str]r©   r   rª   rÃ   r^   ú
str | Noner«   rÌ   r}   rÃ   r¬   zbool | NonerÈ   rÊ   )r»   r,   rÈ   r,   )rÈ   rÃ   )CÚ__doc__Ú
__future__r   Ú	functoolsÚimportlib.utilr£   r   r   rV   ri   rŸ   r•   rÄ   r—   Úcollections.abcr   r   r   Útypingr   Újaraco.functoolsr   Ú_logr
   Ú	_modifiedr   Úcompilers.platformr   r   Úerrorsr   r   r   Útyping_extensionsr   r   r   Úget_host_platformr<   Úis_mingwÚVERSION_VARÚMACOSX_VERSION_VARÚ
target_verÚget_macosx_target_verÚ_target_ver_from_syscfgÚ!get_macosx_target_ver_from_syscfgÚ_clear_cached_target_verÚ_clear_cached_macosx_verr   r"   r1   Ú	lru_cacher=   rN   rH   r_   r‘   rj   re   rl   rm   rt   r~   r�   r¶   rÀ   rÇ   rÆ   r#   r   ú<module>rä      s  ðñõ #ã Û Û 	Û Û 	Û Û Û 
Û Û ß 7Ñ 7Ý  å &å Ý ß -ß EÝ áß6á
�uÓ
€Cð ×,Ñ,Ð Ø×"Ñ"€Ø�?‰?€Ø×&Ñ&Ð Ø×(Ñ(Ð Ø$)×$AÑ$AÐ !Ø ×9Ñ9Ð ó*ð
 ò1ó ð1ð$NØ$ðNà$ðNð 	óNð4 ×Ñò,ó ð,ó,4ò&ô(ð �—
‘
˜h v×'8Ñ'8Ð&9¸Ð=Ó>€ØˆR�Z‰ZÐ,Ó-€
ØˆR�Z‰ZÐ,Ó-€
ó;ðB Øð	Ø
)ðà
ðð 
ðð ð	ð
 
óó(9ð$ ØØØØØðBYØðBYàðBYð ðBYð ð	BYð
 ðBYð ðBYð ðBYð 
óBYóJ'ô=r#   