
    !<i                         d dl mZ erd dlmZ  G d d          Z G d de          Z e            Z edd	          Zd
S )    )TYPE_CHECKING)ArgumentCollectionc                   8    e Zd Z	 	 	 ddededz  defdZdd
ZdS )LimitedChoicer   NFminmax
allow_nonec                     || _         |	| j         pdn|| _        | j        | j         k     rt          d          || _        dS )a  Group validator that limits the number of selections per group.

        Commonly used for enforcing mutually-exclusive parameters (default behavior).

        Parameters
        ----------
        min: int
            The minimum (inclusive) number of CLI parameters allowed.
            If negative, then **all** parameters in the group must have CLI values provided.
        max: int | None
            The maximum (inclusive) number of CLI parameters allowed.
            Defaults to ``1`` if ``min==0``, ``min`` otherwise.
        allow_none: bool
            If :obj:`True`, also allow 0 CLI parameters (even if ``min`` is greater than 0).
            Defaults to :obj:`False`.
        N   zmax must be >=min.)r   r   
ValueErrorr	   )selfr   r   r	   s       /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/cyclopts/validators/_group.py__init__zLimitedChoice.__init__   sH    , &)kDHMs8dh1222$    argument_collectionr   c                    t          |          }|                    d          }t          |          }| j        r|dk    rd S | j        dk     ro||k    rd S d |D             }d |D             }t	          ||z
            }t          |          dk    rt          d|d                    t          d|           | j        |cxk    r| j        k    rn nd S d	d
                    d |D                       z   dz   }| j        dk    r| j        dk    rt          d|           t          d| d| d| j         d
| j         d	          )NT)	value_setr   c                     h | ]	}|j         
S  name.0as     r   	<setcomp>z)LimitedChoice.__call__.<locals>.<setcomp>/   s    ===A===r   c                     h | ]	}|j         
S r   r   r   s     r   r   z)LimitedChoice.__call__.<locals>.<setcomp>0   s    LLLafLLLr   r   zMissing argument: zMissing arguments: {z, c              3   z   K   | ]6}|j         r$|j         d          j        r|j         d          j        n|j        V  7dS )r   N)tokenskeywordr   r   s     r   	<genexpr>z)LimitedChoice.__call__.<locals>.<genexpr>;   s]         -.HY!9LYAHQK''STSY     r   }zMutually exclusive arguments: z	Received z arguments: z. Only [z] choices may be specified.)len	filter_byr	   r   sortedr   r   join)	r   r   
group_sizepopulated_argument_collectionn_arguments	all_namessupplied_namesmissing_names	offenderss	            r   __call__zLimitedChoice.__call__$   s   ,--
(;(E(EPT(E(U(U%788? 	{a//FX\\[((==)<===ILL.KLLLN"9~#=>>M=!!Q&& !HmA6F!H!HIII !F}!F!FGGGX000000000F ))  :    
   x1}}Q !M)!M!MNNN }}}}}DH}}X\X`}}}  r   )r   NF)r   r   )__name__
__module____qualname__intboolr   r.   r   r   r   r   r      sl          	% %% 4Z% 	% % % %8" " " " " "r   r   c                        e Zd Z fdZ xZS )MutuallyExclusivec                 H    t                                                       dS )zAlias for :class:`LimitedChoice` to make intentions more obvious.

        Only 1 argument in the group can be supplied a value.
        N)superr   )r   	__class__s    r   r   zMutuallyExclusive.__init__J   s!    
 	r   )r/   r0   r1   r   __classcell__)r8   s   @r   r5   r5   I   s8                r   r5   T)r	   N)typingr   cyclopts.argumentr   r   r5   mutually_exclusiveall_or_noner   r   r   <module>r?      s                5444444? ? ? ? ? ? ? ?D        '&(( mB4000r   