
    i)i               	          d Z ddlmZ ddlmZmZ 	 ddlZdZddlZej	        ej
        ej        ej        ej        ej        ej        ej        ej        f	ZdddZdS # e$ r dZ	 dddZY dS w xY w)z&An implementation of RFC4013 SASLprep.    )annotations)AnyOptionalNTdatar   prohibit_unassigned_code_pointsOptional[bool]returnc                8   t          | t                    s| S |rg t          t          j        R }nt          }t          j        t          j        d                    fd| D                       } t          j	        
                    d|           } t          j        } || d                   r2 || d                   st          d          g |t          j        R }ng ||R }| D ],t          fd|D                       rt          d          -| S )	aV  An implementation of RFC4013 SASLprep.

        :param data: The string to SASLprep. Unicode strings
            (:class:`str`) are supported. Byte strings
            (:class:`bytes`) are ignored.
        :param prohibit_unassigned_code_points: True / False. RFC 3454
            and RFCs for various SASL mechanisms distinguish between
            `queries` (unassigned code points allowed) and
            `stored strings` (unassigned code points prohibited). Defaults
            to ``True`` (unassigned code points are prohibited).

        :return: The SASLprep'ed version of `data`.
         c                D    g | ]} |           |          rd n|S )  ).0eltin_table_b1in_table_c12s     b/Users/user/workspace/sujinbaek/cqa-test-app/venv/lib/python3.11/site-packages/pymongo/saslprep.py
<listcomp>zsaslprep.<locals>.<listcomp>X   s<    \\\;;WZK[K[\c**3XX\\\    NFKCr   z$SASLprep: failed bidirectional checkc              3  .   K   | ]} |          V  d S )Nr   )r   in_tablechars     r   	<genexpr>zsaslprep.<locals>.<genexpr>q   s+      ==h88D>>======r   z+SASLprep: failed prohibited character check)
isinstancestr_PROHIBITED
stringprepin_table_a1r   r   joinunicodedata	ucd_3_2_0	normalizein_table_d1
ValueErrorin_table_d2any)r   r   
prohibitedr%   r   r   r   s       @@@r   saslprepr*   9   sc     $$$ 	K* 	%?;?
(>??JJ$J ". ,ww\\\\\t\\\
 
 $..vt<< ,;tAw 	4;tBx(( I !!GHHH ?:>z'=>>JJ
 4:3{33J  	P 	PD====*===== P !NOOOP r   Fc                N    t          | t                    rt          d          | S )zSASLprep dummyz[The stringprep module is not available. Usernames and passwords must be instances of bytes.)r   r   	TypeError)r   r   s     r   r*   r*      s4    
 dC   	8   r   )T)r   r   r   r   r	   r   )__doc__
__future__r   typingr   r   r   HAVE_STRINGPREPr"   r   in_table_c21_c22in_table_c3in_table_c4in_table_c5in_table_c6in_table_c7in_table_c8in_table_c9r   r*   ImportErrorr   r   r   <module>r:      s   - , " " " " " "                `" O 	#K; ; ; ; ; ; ;G    O ;?
 
 
 
 
 
 
 
s   A A,+A,