o
    tBh"	                     @   sD   d dl mZ ddlmZ ddgZG dd dZdedefd	dZd
S )    )Any   )SourceLocationSource	is_sourcec                	   @   s~   e Zd ZdZdZdeddfdedededd	fd
dZdedefddZ	defddZ
dedefddZdedefddZd	S )r   z,A representation of source input to GraphQL.)__weakref____dict__bodynamelocation_offsetzGraphQL requestr   r	   r
   r   returnNc                 C   sN   || _ || _t|tst|}|jdkrtd|jdkr"td|| _dS )a  Initialize source input.

        The ``name`` and ``location_offset`` parameters are optional, but they are
        useful for clients who store GraphQL documents in source files. For example,
        if the GraphQL input starts at line 40 in a file named ``Foo.graphql``, it might
        be useful for ``name`` to be ``"Foo.graphql"`` and location to be ``(40, 0)``.

        The ``line`` and ``column`` attributes in ``location_offset`` are 1-indexed.
        r   z:line in location_offset is 1-indexed and must be positive.z<column in location_offset is 1-indexed and must be positive.N)	r	   r
   
isinstancer   _makeline
ValueErrorcolumnr   )selfr	   r
   r    r   n/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/graphql/language/source.py__init__   s   




zSource.__init__positionc                 C   sB   | j d |  }|rt|}t|d d }nd}d}t||S )Nr   )r	   
splitlineslenr   )r   r   linesr   r   r   r   r   get_location+   s   
zSource.get_locationc                 C   s   d| j j d| jdS )N<z name=>)	__class____name__r
   )r   r   r   r   __repr__5   s   zSource.__repr__otherc                 C   s*   t |tr|j| jkpt |to|| jkS N)r   r   r	   strr   r!   r   r   r   __eq__8   s   zSource.__eq__c                 C   s
   | |k S r"   r   r$   r   r   r   __ne__=   s   
zSource.__ne__)r   
__module____qualname____doc__	__slots__r   r#   r   intr   r    r   boolr%   r&   r   r   r   r   r      s$    

sourcer   c                 C   s
   t | tS )zLTest if the given value is a Source object.

    For internal use only.
    )r   r   )r-   r   r   r   r   A   s   
N)typingr   locationr   __all__r   r,   r   r   r   r   r   <module>   s
    9