Ë
    ¼vëj÷  ã                  ó$  — d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
 ddlmZ erddlmZ d	ZeD � ��ci c]+  \  } }| D ]!  }|j!                  «       j#                  «       |“Œ# Œ- c}}} Zej'                  d
„ eD «       «       eD ��ci c]  \  }}||d   j#                  «       “Œ c}}Zdd„Zdd„Ze
dd„«       Ze
dd„«       Zddd„Z ej4                  dej6                  › ej8                  › ej:                  › d�«      Zyc c}}} w c c}}w )z3
Mappings between PostgreSQL and Python encodings.
é    )ÚannotationsN)ÚTYPE_CHECKINGÚAny)Úcacheé   )ÚNotSupportedError)ÚBaseConnection)())ÚBIG5ÚWIN950Ú
Windows950Úbig5))ÚEUC_CNÚgb2312))ÚEUC_JIS_2004Úeuc_jis_2004))ÚEUC_JPÚeuc_jp))ÚEUC_KRÚeuc_kr))ÚGB18030Úgb18030))ÚGBKÚWIN936Ú
Windows936Úgbk))Ú
ISO_8859_5z	iso8859-5))Ú
ISO_8859_6z	iso8859-6))Ú
ISO_8859_7z	iso8859-7))Ú
ISO_8859_8z	iso8859-8))ÚJOHABÚjohab))ÚKOI8RÚKOI8zkoi8-r))ÚKOI8Uzkoi8-u))ÚLATIN1ÚISO88591z	iso8859-1))ÚLATIN10Ú	ISO885916z
iso8859-16))ÚLATIN2ÚISO88592z	iso8859-2))ÚLATIN3ÚISO88593z	iso8859-3))ÚLATIN4ÚISO88594z	iso8859-4))ÚLATIN5ÚISO88599z	iso8859-9))ÚLATIN6Ú	ISO885910z
iso8859-10))ÚLATIN7Ú	ISO885913z
iso8859-13))ÚLATIN8Ú	ISO885914z
iso8859-14))ÚLATIN9Ú	ISO885915z
iso8859-15))ÚSHIFT_JIS_2004Úshift_jis_2004))ÚSJISÚMskanjiÚShiftJISÚWIN932Ú
Windows932Ú	shift_jis))Ú	SQL_ASCIIÚascii))ÚUHCÚWIN949Ú
Windows949Úcp949))ÚUTF8ÚUnicodeúutf-8))ÚWIN1250Úcp1250))ÚWIN1251ÚWINÚcp1251))ÚWIN1252Úcp1252))ÚWIN1253Úcp1253))ÚWIN1254Úcp1254))ÚWIN1255Úcp1255))ÚWIN1256Úcp1256))ÚWIN1257Úcp1257))ÚWIN1258ÚABCÚTCVNÚTCVN5712ÚVSCIIÚcp1258))ÚWIN866ÚALTÚcp866))ÚWIN874Úcp874c              #  ó|   K  — | ]4  \  }}|D ]*  }d |v r$|j                  d d«      j                  «       |f–— Œ, Œ6 y­w)Ú_Ú N)ÚreplaceÚencode)Ú.0ÚaliasesÚvÚas       úS/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/psycopg/_encodings.pyú	<genexpr>rp   G   sQ   è ø€ ò áˆ�Øòð 	
Ø
ˆa�xð ‡Y�Yˆs�BÓ×ÑÓ  !Ô$ðØ$ñùs   ‚:<c                ó6   — | r| j                   j                  S dS )z
    Return the Python encoding name of a psycopg connection.

    Default to utf8 if the connection has no encoding info.
    rI   )ÚpgconnÚ	_encoding)Úconns    ro   Úconn_encodingru   Q   s   € ñ %)ˆ4�;‰;× Ñ Ð5¨gÐ5ó    c                óª   — ddl m}  || «      }|j                  d«      x}r#	 t        t	        |«      j                  «       «      S y# t        $ r Y yw xY w)zù
    Return the Python encoding name passed in a conninfo string. Default to utf8.

    Because the input is likely to come from the user and not normalised by the
    server, be somewhat lenient (non-case-sensitive lookup, ignore noise chars).
    r   )Úconninfo_to_dictÚclient_encodingrI   )Úconninforx   ÚgetÚpg2pyencÚstrrj   r   )rz   rx   ÚparamsÚpgencs       ro   Úconninfo_encodingr€   Z   s_   € õ +á˜hÓ'€FØ—
‘
Ð,Ó-Ð-€uÐ-ð	ÜœC ›J×-Ñ-Ó/Ó0Ð0ð øô !ò 	Øàð	ús   £!A Á	AÁAc                óN   — t         t        j                  | «      j                     S )zzConvert a Python encoding name to PostgreSQL encoding name.

    Raise LookupError if the Python encoding is unknown.
    )Ú	pg_codecsÚcodecsÚlookupÚname)r…   s    ro   Úpy2pgencr†   m   s   € ô ”V—]‘] 4Ó(×-Ñ-Ñ.Ð.rv   c                óÌ   — 	 t         | j                  dd«      j                  dd«      j                  «          S # t        $ r! | j	                  dd«      }t        d|›�«      ‚w xY w)z˜Convert a PostgreSQL encoding name to Python encoding name.

    Raise NotSupportedError if the PostgreSQL encoding is not supported by
    Python.
    ó   -rv   ó   _Úutf8ri   zcodec not available in Python: )Ú	py_codecsri   ÚupperÚKeyErrorÚdecoder   )r…   Úsnames     ro   r|   r|   v   sh   € ðMÜ˜Ÿ™ d¨CÓ0×8Ñ8¸¸sÓC×IÑIÓKÑLÐLøÜò MØ—‘˜F IÓ.ˆÜÐ"AÀ%ÀÐ KÓLÐLðMús	   ‚69 ¹*A#c                ó¤   — | j                  «       s2| d   dv r|| z   } | j                  «       st        j                  d| «      } | d   dk(  r|| z   } | S )z¨
    Reduce a string to a valid Python identifier.

    Replace all non-valid chars with '_' and prefix the value with `!prefix` if
    the first letter is an '_'.
    r   Ú
1234567890rg   )ÚisidentifierÚ	_re_cleanÚsub)ÚsÚprefixs     ro   Ú_as_python_identifierr—   „   sV   € ð �>‰>ÔØˆQ‰4�<ÑØ˜‘
ˆAØ�~‰~ÔÜ—‘˜c 1Ó%ˆAàˆ�tˆs‚{Ø�Q‰JˆØ€Hrv   z[^z_])rt   zBaseConnection[Any] | NoneÚreturnr}   )rz   r}   r˜   r}   )r…   r}   r˜   Úbytes)r…   r™   r˜   r}   )Úf)r•   r}   r–   r}   r˜   r}   )Ú__doc__Ú
__future__r   Úrerƒ   ÚstringÚtypingr   r   Ú	functoolsr   Úerrorsr   Ú_connection_baser	   Ú
_py_codecsrŒ   rj   r‹   Úupdater‚   ru   r€   r†   r|   r—   ÚcompileÚascii_lowercaseÚascii_uppercaseÚdigitsr“   )rl   rm   rn   Úks   0000ro   ú<module>rª      s)  ðñõ #ã 	Û Û ß %Ý å %áÝ0ð-€
ð^ 6@×QÐQ¡z w°ÈÒQÀAˆQ�W‰W‹Y×ÑÓ Ñ"ÐQÐÔQ€	ð 
× Ñ ñ à ôô ð +5×5¡$ ! QˆQ��!‘—‘“ÑÓ5€	ó6óð& ò/ó ð/ð ò
Mó ð
Môð$ ˆB�J‰JØˆ×	Ñ	Ð  ×!7Ñ!7Ð 8¸¿¹¸ÀrÐJó�	ùôe Rùó 6s   ¹0DÂD