
    @(i                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  \(       a  SS	KJr  SS
KJr  SSKJr  SSKJr  \" S\ 35      rSS jr S       SS jjr " S S5      rg)z
Miscellaneous utilities
    )annotations)	getLogger)TYPE_CHECKING)quote)on_win)urlparse)PackagesNotFoundError)Iterable)Enum)	MatchSpec   )LibMambaIndexHelperzconda.c           	         U R                  S5      (       a%  SU ;   a  U $ [        (       a  U R                  SS5      n [        U 5      nUR                  (       Ga&  UR
                  R                  S5      n[        (       a  UR                  (       au  [        UR                  5      S:X  a\  UR                  S   S:X  aI  SR                  UR                  /U Vs/ s H  n[        U5      PM     sn-   5      nUR                  SS	9nO`SR                  US S USS   Vs/ s H  n[        U5      PM     sn-   5      nO+SR                  U Vs/ s H  n[        U5      PM     sn5      nUR                  US
9n[        U5      $ U $ s  snf s  snf s  snf )Nzfile:%\/   r   : )netloc)path)
startswithr   replacer   schemer   splitr   lenjoinr   str)channelparts
componentspr   s        S/data/cameron/miniconda/lib/python3.13/site-packages/conda_libmamba_solver/utils.pyescape_channel_urlr$      sC   '""'>N6oodC0GWE|||ZZ%%c*
6||ELL 1Q 65<<?c;QxxJ1OJq%(J1O OPR0xx
2AJqrN1SNq%(N1S ST88z:z!U1Xz:;D4(5zN 2P 2T:s   F
F
	Fc                   [        U5      S:  d  [        S5      eSnU Ha  n[        U R                  U5      5      nU(       d)  U(       a   [	        U/U R
                  5      nSUl        Ue  gUc  UnMT  X5-  nU(       a  Ma    g   [        U5      $ )a  
Assess whether the given specs are compatible with each other.
This is done by querying the index for each spec and taking the
intersection of the results. If the intersection is empty, the
specs are incompatible.

If raise_not_found is True, a PackagesNotFoundError will be raised
when one of the specs is not found. Otherwise, False will be returned
because the intersection will be empty.
r   zMust specify at least two specsNF)r   
ValueErrorsetsearchr	   channelsallow_retrybool)indexspecsraise_not_foundmatchedspecresultsexcs          r#   compatible_specsr3   4   s     u:?:;;Gell4()+TFENNC"'	?Gw " =    c                  @    \ rS rSrSrS	S jrS
S jrSS jrSS jrSr	g)EnumAsBoolsY   ad  
Allows an Enum to be bool-evaluated with attribute access.

>>> update_modifier = UpdateModifier("update_deps")
>>> update_modifier_as_bools = EnumAsBools(update_modifier)
>>> update_modifier == UpdateModifier.UPDATE_DEPS  # from this
    True
>>> update_modidier_as_bools.UPDATE_DEPS  # to this
    True
>>> update_modifier_as_bools.UPDATE_ALL
    False
c                    Xl         U R                   R                  R                  R                  5        Vs1 s H  o"R                  iM     snU l        g s  snf N)_enum	__class____members__valuesname_names)selfenumvs      r#   __init__EnumAsBools.__init__g   s=    
'+zz';';'G'G'N'N'PQ'P!vv'PQQs   Ac                    US;   a  [        U R                  U5      $ XR                  ;   a  U R                  R                  U:H  $ [	        SU SU R                  R
                  R                   35      e)N)r>   value'z' is not a valid name for )getattrr:   r?   r>   AttributeErrorr;   __name__r@   r>   s     r#   __getattr__EnumAsBools.__getattr__k   sc    $$4::t,,;;::??d**q&@AUAUA^A^@_`aar4   c                8    U R                   R                  U5      $ r9   )r:   __eq__)r@   objs     r#   rO   EnumAsBools.__eq__r   s    zz  %%r4   c                t    U R                    Vs0 s H  oU R                  R                  U:H  _M     sn$ s  snf r9   )r?   r:   r>   rK   s     r#   _dictEnumAsBools._dictu   s.    :>++F+$djjoo--+FFFs   #5)r:   r?   N)rA   r   )r>   r   returnr+   )rP   objectrU   r+   )rU   zdict[str, bool])
rJ   
__module____qualname____firstlineno____doc__rC   rL   rO   rS   __static_attributes__ r4   r#   r6   r6   Y   s    Rb&Gr4   r6   N)r   r   rU   r   )T)r,   r   r-   zIterable[MatchSpec]r.   r+   rU   r+   )rZ   
__future__r   loggingr   typingr   urllib.parser   conda.common.compatr   conda.common.urlr   conda.exceptionsr	   collections.abcr
   rA   r   conda.models.match_specr   r,   r   rJ   logr$   r3   r6   r\   r4   r#   <module>rg      s    #     & % 2(1*&
#$0 UY""':"MQ"	"JG Gr4   