o
    ¶úåh	  ã                   @  s@   d dl mZ d dlmZ d dlZedƒdd	d
„ƒZddd„ZdS )é    )Úannotations)Ú	lru_cacheNéd   ÚcÚstrÚreturnÚintc                 C  sª   t | ƒ}d|  krdk rdS  |dks7d|  krdks7n d|  kr)dks7n d	|  kr5d
kr9dS  ndS t | ¡}|dkrDdS |dv rJdS t | ¡dv rSdS dS )z¯Determine how many columns are needed to display a character in a terminal.

    Returns -1 if the character is not printable.
    Returns 0, 1 or 2 for other characters.
    é    é   é   r   i   i   i(   i.   i`   ic   ÚCcéÿÿÿÿ)ÚMeÚMn)ÚFÚWé   )ÚordÚunicodedataÚcategoryÚeast_asian_width)r   Úor   © r   úT/var/www/html/openai_agents/venv/lib/python3.10/site-packages/_pytest/_io/wcwidth.pyÚwcwidth   s&   ÿþ
r   Úsc                 C  s8   d}t  d| ¡D ]}t|ƒ}|dk r dS ||7 }q|S )zŽDetermine how many columns are needed to display a string in a terminal.

    Returns -1 if the string contains non-printable characters.
    r   ÚNFCr   )r   Ú	normalizer   )r   Úwidthr   Úwcr   r   r   Úwcswidth.   s   
r    )r   r   r   r   )r   r   r   r   )Ú
__future__r   Ú	functoolsr   r   r   r    r   r   r   r   Ú<module>   s    &