�
��gq � �\ � d Z ddlZddlZ G d� dej � � Zd ed� � ed� � ed� � ed � � ed
� � ed� � ed� � d
�fd ed� � ed � � ed
� � ed� � ed� � d�fd ed � � ed� � ed� � ed
� � ed� � ed� � d�fd ed� � ed � � ed
� � ed� � ed� � d�fd�Zi Zd� Z ej e� � dS )z�Extend the Python codecs module with a few encodings that are used in OpenType (name table)
but missing from Python. See https://github.com/fonttools/fonttools/issues/236 for details.� Nc �0 � e Zd Zd� Zd� Zdd�Zdd�Zd� ZdS ) �ExtendCodecc �` � || _ || _ || _ d� |� � � D � � | _ t d� |� � � D � � � � | _ t j | j | j
| j �� � | _ t j
|| j � � d S )Nc � � i | ]\ }}||�� S � r )�.0�k�vs �j/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fontTools/encodings/codecs.py�
<dictcomp>z(ExtendCodec.__init__.<locals>.<dictcomp>
s � �9�9�9���A��1�9�9�9� c 3 �4 K � | ]}t |� � V � �d S �N)�len)r r
s r � <genexpr>z'ExtendCodec.__init__.<locals>.<genexpr> s( � � � �<�<�a�3�q�6�6�<�<�<�<�<�<r
)�name�encode�decode)r �
base_encoding�mapping�items�reverse�max�values�max_len�codecs� CodecInfor r �info�register_error�error)�selfr r r s r �__init__zExtendCodec.__init__ s� � ��� �*������9�9������9�9�9����<�<�7�>�>�+;�+;�<�<�<�<�<����$���4�;�t�{�
�
�
�� � ��d�D�J�/�/�/�/�/r
c �V � t j |� � }t |� � } |� � }|rw ||| j | j �� � } || z
}nX# |$ rN}
| ||d |
j � | j | j � � z
} ||
� � \ }}||z
}||d � }Y d }
~
nd }
~
ww xY w|�w||fS )N)�errors)r �lookup_errorr r r �start)
r! �mapper�output_type�exc_type�inputr$ �base_error_handler�length�out�part�e�replacement�poss
r �_mapzExtendCodec._map s� � �#�0��8�8���U�����k�m�m��� $�
$��v�e�T�%7�� �J�J�J���t������
$�
$�
$��v�v�e�I�a�g�I�.��0B�D�I�N�N�N��#5�#5�a�#8�#8� ��S��{�"���c�d�d������������
$����
� $� �F�{�s �A �B"�AB�B"�strictc �\ � | � t j t t ||� � S r )r2 r r �bytes�UnicodeEncodeError�r! r* r$ s r r zExtendCodec.encode&