+
    CO|j†;  ã                  ó<  € ^ RI Ht ^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ]
'       d   ^ RIHs ^ RIHs ^ RIHs ^ RIHt MRsRsRsR R ltR R lt  ! R R]]!]!R,          3,          4      t" ! R R]4      t#RR.t$R# )é    )ÚannotationsN)ÚIteratorÚMapping)Úcached_property)ÚTYPE_CHECKINGÚAny)Ú	FieldInfo)ÚSettingsError)ÚSecretVersion)Ú	InitState)ÚEnvSettingsSource©Údefault©ÚCredentials©ÚSecretManagerServiceClient)ÚBaseSettingsc               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚNone© )Úformats   "Ú`C:\Users\alokc\chatbot\backend\venv\Lib\site-packages\pydantic_settings/sources/providers/gcp.pyÚ__annotate__r      s   € ÷ ñ  4ñ ó    c                 ó  €  ^ RI Hs ^ RIHs \
        P                  ! 4       ;_uu_ 4        \
        P                  ! R\        R7       ^ RI	H
s
 RRR4       R#   + '       g   i     R# ; i  \         d   p \        R4      T hRp ? ii ; i)r   r   r   Úignore)Úcategoryr   NzjGCP Secret Manager dependencies are not installed, run `pip install pydantic-settings[gcp-secret-manager]`)Úgoogle.authr   Úgoogle_auth_defaultÚgoogle.auth.credentialsr   ÚwarningsÚcatch_warningsÚfilterwarningsÚFutureWarningÚgoogle.cloud.secretmanagerr   ÚImportError)Úes    r   Úimport_gcp_secret_managerr,      sb   € ð

Ý>Ý7ä×$Ò$×&Õ&Ü×#Ò# H´}ÕEÝM÷ '×&×&Ò&ûô ô ÜØxó
àð	ûðús4   ‚)A, «#AÁA, ÁA)	Á#A, Á)A, Á,BÁ7BÂBc               ó    € V ^8„  d   QhRRRR/# )r   ÚexcÚ	Exceptionr   Úboolr   )r   s   "r   r   r   -   s   € ÷ ñ ˜Yð ¨4ñ r   c                óJ   €  ^ RI Hp \        W4      #   \         d     R# i ; i)r   )ÚNotFoundF)Úgoogle.api_core.exceptionsr2   Ú
isinstancer*   )r.   r2   s   & r   Ú_is_not_found_errorr5   -   s'   € ðÝ7ä˜#Ó(Ð(øÜô Úðús   ‚ “"¡"c                  óÖ   € ] tR t^6t$ R]R&   R]R&   R R lt]R R l4       tR	 R
 lt]	R R l4       t
]R R l4       tRR R lltRR R lltR R ltR R ltR R ltR R ltRtR# )ÚGoogleSecretManagerMappingzdict[str, str | None]Ú_loaded_secretsr   Ú_secret_clientc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   Úsecret_clientr   Ú
project_idÚstrÚcase_sensitiver0   r   r   r   )r   s   "r   r   Ú'GoogleSecretManagerMapping.__annotate__:   s+   € ÷ .ñ .Ð&@ð .Ècð .Ðcgð .Ðlpñ .r   c                	ó8   € / V n         Wn        W n        W0n        R # ©N)r8   r9   Ú_project_idÚ_case_sensitive)Úselfr;   r<   r>   s   &&&&r   Ú__init__Ú#GoogleSecretManagerMapping.__init__:   s   € Ø!ˆÔØ+ÔØ%ÔØ-Ör   c               ó   € V ^8„  d   QhRR/# ©r   r   r=   r   )r   s   "r   r   r?   A   s   € ÷ Iñ I 3ñ Ir   c                	óL   € V P                   P                  V P                  4      # rA   )r9   Úcommon_project_pathrB   ©rD   s   &r   Ú_gcp_project_pathÚ,GoogleSecretManagerMapping._gcp_project_path@   s   € à×"Ñ"×6Ñ6°t×7GÑ7GÓHÐHr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Ú
lower_namer=   Ú
candidatesú	list[str]r   r   )r   s   "r   r   r?   D   s"   € ÷ ñ ¸#ð È9ð ÐY\ñ r   c           	     	ó¸   € \        V4      ^8X  d
   V^ ,          # VP                  4        VR,          p\        P                  ! RV RV RV R2\        ^R7       V# )é   z)Secret collision: Found multiple secrets z normalizing to 'z
'. Using 'z' for case-insensitive lookup.)Ú
stackleveléÿÿÿÿ)ÚlenÚsortr%   ÚwarnÚUserWarning)rD   rO   rP   Úwinners   &&& r   Ú_select_case_insensitive_secretÚ:GoogleSecretManagerMapping._select_case_insensitive_secretD   si   € Üˆz‹?˜aÔØ˜a•=Ð ð 	�‰ÔØ˜B•ˆÜ�ŠØ7¸
°|ÐCTÐU_ÐT`ð aØ�XÐ;ð=äØõ		
ð ˆr   c               ó   € V ^8„  d   QhRR/# )r   r   zdict[str, str]r   )r   s   "r   r   r?   T   s   € ÷ ñ  .ñ r   c                	óä  € / p/ pV P                   P                  V P                  R 7      pV F�  pV P                   P                  VP                  4      P                  RR4      pWQV&   V P                  '       d   KP  VP                  4       pWb9  d   . W&&   W&,          P                  V4       Kƒ  	  V P                  '       g-   VP                  4        F  w  rgV P                  Wg4      W&   K  	  V# ))ÚparentÚsecretÚ )r9   Úlist_secretsrL   Úparse_secret_pathÚnameÚgetrC   ÚlowerÚappendÚitemsr[   )rD   ÚmappingÚnormalized_groupsÚsecretsr`   rd   rO   rP   s   &       r   Ú_secret_name_mapÚ+GoogleSecretManagerMapping._secret_name_mapS   sÛ   € à"$ˆà24Ðà×%Ñ%×2Ñ2¸$×:PÑ:PÐ2ÓQˆÛˆFØ×&Ñ&×8Ñ8¸¿¹ÓE×IÑIÈ(ÐTVÓWˆDØ �D‰Mà×'×'Ò'Ø!ŸZ™Z›\�
ØÔ6Ø46Ð%Ñ1Ø!Õ-×4Ñ4°TÖ:ñ ð ×#×#Ð#Ø*;×*AÑ*AÖ*CÑ&�
Ø&*×&JÑ&JÈ:Ó&b�Ó#ñ +Dð ˆr   c               ó   € V ^8„  d   QhRR/# )r   r   rQ   r   )r   s   "r   r   r?   k   s   € ÷ 2ñ 2˜yñ 2r   c                	óH   € \        V P                  P                  4       4      # rA   )Úlistrl   ÚkeysrK   s   &r   Ú_secret_namesÚ(GoogleSecretManagerMapping._secret_namesj   s   € ä�D×)Ñ)×.Ñ.Ó0Ó1Ð1r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úkeyr=   Úversionr   r   )r   s   "r   r   r?   n   s&   € ÷ Wñ W¨ð W°cð WÈñ Wr   c                	óN   € V P                   P                  V P                  W4      # rA   )r9   Úsecret_version_pathrB   )rD   ru   rv   s   &&&r   Ú_secret_version_pathÚ/GoogleSecretManagerMapping._secret_version_pathn   s!   € Ø×"Ñ"×6Ñ6°t×7GÑ7GÈÓVÐVr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úgcp_secret_namer=   rv   r   ú
str | Noner   )r   s   "r   r   r?   q   s"   € ÷ ñ °ð ¸sð ÐR\ñ r   c                	óÄ   €  V P                   P                  V P                  W4      R 7      P                  P                  P                  R4      #   \         d     R# i ; i©)rd   zUTF-8N)r9   Úaccess_secret_versionry   ÚpayloadÚdataÚdecoder/   )rD   r|   rv   s   &&&r   Ú_get_secret_valueÚ,GoogleSecretManagerMapping._get_secret_valueq   sX   € ð	Ø×&Ñ&×<Ñ<Ø×.Ñ.¨ÓHð =ó ç‰g—d‘dŸ6™6 '›?ð+øô ô 	Úð	ús   ‚AA ÁAÁAc               ó    € V ^8„  d   QhRRRR/# )r   r|   r=   r   r}   r   )r   s   "r   r   r?   y   s   € ÷ ñ ¸#ð À*ñ r   c                	ó  €  V P                   P                  V P                  V4      R 7      P                  P                  P                  R4      #   \         d)   p\        T4      '       d   \        T4      Th Rp?R# Rp?ii ; ir   )	r9   r€   ry   r�   r‚   rƒ   r/   r5   ÚKeyError)rD   r|   r+   s   && r   Ú_get_secret_value_or_raiseÚ5GoogleSecretManagerMapping._get_secret_value_or_raisey   sq   € ð	Ø×&Ñ&×<Ñ<Ø×.Ñ.¨Ó?ð =ó ç‰g—d‘dŸ6™6 '›?ð+øô ô 	Ü" 1×%Ò%Ü˜Ó/°QÐ6Ýûð	ús   ‚AA ÁBÁA>Á>Bc               ó    € V ^8„  d   QhRRRR/# )r   ru   r=   r   r}   r   )r   s   "r   r   r?   ƒ   s   € ÷ )ñ )˜sð ) zñ )r   c                	óè  € WP                   9   d   V P                   V,          # V P                  '       d2   V P                  V4      V P                   V&   V P                   V,          # V P                  P	                  V4      pVf*   V P                  P	                  VP                  4       4      pV'       d    V P                  V4      V P                   V&   M\        V4      hV P                   V,          # rA   )r8   rC   r‰   rl   re   rf   r„   rˆ   )rD   ru   r|   s   && r   Ú__getitem__Ú&GoogleSecretManagerMapping.__getitem__ƒ   sÈ   € Ø×&Ñ&Ô&Ø×'Ñ'¨Õ,Ð,à××ÐØ(,×(GÑ(GÈÓ(LˆD× Ñ  Ñ%Ø×'Ñ'¨Õ,Ð,à×/Ñ/×3Ñ3°CÓ8ˆØÒ"Ø"×3Ñ3×7Ñ7¸¿	¹	»ÓDˆOçØ(,×(>Ñ(>¸Ó(OˆD× Ñ  Ò%ä˜3“-Ðà×#Ñ# CÕ(Ð(r   c               ó   € V ^8„  d   QhRR/# )r   r   Úintr   )r   s   "r   r   r?   –   s   € ÷ 'ñ '˜ñ 'r   c                	ó,   € \        V P                  4      # rA   )rV   rr   rK   s   &r   Ú__len__Ú"GoogleSecretManagerMapping.__len__–   s   € Ü�4×%Ñ%Ó&Ð&r   c               ó   € V ^8„  d   QhRR/# )r   r   zIterator[str]r   )r   s   "r   r   r?   ™   s   € ÷ (ñ (˜-ñ (r   c                	ó,   € \        V P                  4      # rA   )Úiterrr   rK   s   &r   Ú__iter__Ú#GoogleSecretManagerMapping.__iter__™   s   € Ü�D×&Ñ&Ó'Ð'r   )rC   r8   rB   r9   N)Úlatest)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__rE   ÚpropertyrL   r[   r   rl   rr   ry   r„   r‰   r�   r’   r—   Ú__static_attributes__r   r   r   r7   r7   6   sz   ‡ Ø*Ó*Ø.Ó.õ.ð ôIó ðIõð ôó ðð, ô2ó ð2÷W÷õõ)õ&'÷(ñ (r   r7   c                  ó¤   a € ] tR t^�t$ R]R&   R]R&   R]R&   R]R&   RR V 3R	 llltR
 V 3R lltR R ltR R ltR V 3R llt	R R lt
RtV ;t# )Ú!GoogleSecretManagerSettingsSourceúCredentials | NoneÚ_credentialsú!SecretManagerServiceClient | Noner9   r}   rB   Ú_explicit_project_idc               óD   € V ^8„  d   QhRRRRRRRRRRR	R
RRRR
RRRRRR/# )r   Úsettings_clsztype[BaseSettings]Úcredentialsr£   r<   r}   Ú
env_prefixÚenv_parse_none_strÚenv_parse_enumszbool | Noner;   r¥   r>   Úproject_id_fieldr=   Ú_init_statezInitState | Noner   r   r   )r   s   "r   r   Ú.GoogleSecretManagerSettingsSource.__annotate__£   sx   € ÷ ;%ñ ;%à(ð;%ð (ð;%ð ð	;%ð
 ð;%ð 'ð;%ð %ð;%ð 9ð;%ð $ð;%ð ð;%ð &ð;%ð 
ñ;%r   c           
     óÒ   <€ \         e   \        e	   \        f   \        4        W0n        RV n        W n        Wpn        W�n        RV n	        \        SV `-  VVVRVVV
R7       RV n	        R# )a)  Settings source that reads secrets from Google Cloud Secret Manager.

Args:
    project_id: The GCP project to read secrets from. If not provided, it is
        resolved lazily (see below).
    project_id_field: The key, populated by a previous (higher priority)
        settings source, to use as the ``project_id`` when one is not passed
        explicitly. This must match the key used in ``current_state`` by the
        previous source (typically the field name or its preferred alias).
        For example, with ``some_field: str = Field(alias='GCP_PROJECT')``,
        previous env sources will expose the value under ``'GCP_PROJECT'``.
        Defaults to ``'project_id'``.

The ``project_id`` is resolved lazily in :meth:`__call__` rather than at
construction time so that it can be sourced from settings resolved by previous
sources (only available via ``current_state`` once the source is called).
Resolution order is:

1. the explicit ``project_id`` argument
2. the ``project_id_field`` value from previous settings sources
3. ``google.auth.default()``
NF)r>   rª   Úenv_ignore_emptyr«   r¬   r®   T)r   r   r#   r,   r¦   rB   r¤   r9   Ú_project_id_fieldÚ_env_vars_loadedÚsuperrE   )rD   r¨   r©   r<   rª   r«   r¬   r;   r>   r­   r®   Ú	__class__s   &&&&&&&&&&&€r   rE   Ú*GoogleSecretManagerSettingsSource.__init__£   sx   ø€ ôH &Ò-´Ò1DÔH[ÒHcÜ%Ô'ð
 %/Ô!ØˆÔØ'ÔØ+ÔØ!1ÔØ %ˆÔä‰ÑØØ)Ø!Ø"Ø1Ø+Ø#ð 	ô 	
ð !%ˆÖr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úfieldr	   Ú
field_namer=   r   ztuple[Any, str, bool]r   )r   s   "r   r   r¯   à   s"   € ÷ /$ñ /$ Yð /$¸Cð /$ÐDYñ /$r   c                ó  <€ \        R VP                   4       R4      pV'       Ed   \        V P                  \        4      '       dò   V P                  W4       F×  w  rEpV P                  '       d   TpM\V P                  P                  P                  V4      pVf4   V P                  P                  P                  VP                  4       4      pV'       g   K�  V P                  P                  Ws4      pVf   K¢  V P                  P                  P                  R4      '       d   W‚V3u # W„V3u # 	  RVR3# \        SV `9  W4      w  ršpV P                  P                  P                  R4      '       d	   V	e   W’V3# WšV3# )a´  Override get_field_value to get the secret value from GCP Secret Manager.
Look for a SecretVersion metadata field to specify a particular SecretVersion.

Args:
    field: The field to get the value for
    field_name: The declared name of the field

Returns:
    A tuple of (value, key, value_is_complex), where `key` is the identifier used
    to populate the model (either the field name or an alias, depending on
    configuration).
c              3  ój   "  € T F)  p\        V\        4      '       g   K  VP                  x € K+  	  R # 5irA   )r4   r   rv   )Ú.0Úms   & r   Ú	<genexpr>ÚDGoogleSecretManagerSettingsSource.get_field_value.<locals>.<genexpr>î   s    é € Ða±.¨QÄJÈqÔR_×D`œy˜qŸyžy³.ùs   ‚3Ÿ3NÚpopulate_by_nameF)ÚnextÚmetadatar4   Úenv_varsr7   Ú_extract_field_infor>   rl   re   rf   r„   r¨   Úmodel_configr´   Úget_field_value)rD   r¸   r¹   Úsecret_versionÚ	field_keyÚenv_nameÚvalue_is_complexr|   Úenv_valÚvalru   Ú
is_complexrµ   s   &&&         €r   rÆ   Ú1GoogleSecretManagerSettingsSource.get_field_valueà   sW  ø€ ô Ña°%·.².ÓaÐcgÓhˆ÷
 ˆ>œj¨¯©Ô8R×SÒSØ9=×9QÑ9QÐRWÖ9dÑ5�	Ð%5Ø×&×&Ð&Ø2:‘Oà&*§m¡m×&DÑ&D×&HÑ&HÈÓ&R�OØ&Ò.Ø*.¯-©-×*HÑ*H×*LÑ*LÈXÏ^É^ÓM]Ó*^˜ç"‘?Ø"Ÿm™m×=Ñ=¸oÓ^�GØÔ*ð  ×,Ñ,×9Ñ9×=Ñ=Ð>P×QÒQØ#*Ð8HÐ#HÒHØ&Ð3CÐCÒCñ :eð& ˜ UÐ*Ð*ä$™wÑ6°uÓIÑˆ�*ð ×Ñ×)Ñ)×-Ñ-Ð.@×AÒAÀcÂoØ JÐ.Ð.Ø˜Ð#Ð#r   c               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   r¯     s   € ÷ *\ñ *\ dñ *\r   c                ó,  € V P                   e   R# V P                  pV P                  pVf>   V P                  P	                  V P
                  4      p\        V\        4      '       d   TpV P                  RJ ;'       d    VRJ pVRJ pV'       g	   V'       d7   \        4       w  rgV'       d   TpV'       d   \        V\        4      '       d   TpVf   \        R4      hW n        Wn         V P                  f   \        V P                  R7      V n        R# R# )a  Resolve the credentials, project_id and Secret Manager client.

``project_id`` is resolved, in order of precedence, from: the explicit
``project_id`` argument, the ``project_id_field`` value from previous settings
sources (``current_state``), and finally ``google.auth.default()``.
NzÚproject_id is required to be specified either as an argument, via a previous settings source, or from google.auth.default. See https://google-auth.readthedocs.io/en/master/reference/google.auth.html#google.auth.default)r©   )rB   r¦   r¤   Úcurrent_statere   r²   r4   r=   r9   r#   ÚAttributeErrorr   )rD   r<   r©   Ústate_project_idÚneed_credentialsÚneed_projectÚ_credsrB   s   &       r   Ú_resolve_gcp_projectÚ6GoogleSecretManagerSettingsSource._resolve_gcp_project  s  € ð ×ÑÒ'Ùà×.Ñ.ˆ
Ø×'Ñ'ˆð ÒØ#×1Ñ1×5Ñ5°d×6LÑ6LÓMÐÜÐ*¬C×0Ò0Ø-�
ð  ×.Ñ.°$Ð6×NÐN¸;È$Ð;NÐØ! TÐ)ˆßŸ|Ü"5Ó"7ÑˆFßØ$�ß¤
¨;¼× <Ò <Ø(�
àÒÜ ðnóð ð (ÔØ%ÔØ×ÑÒ&Ü"<È×IZÑIZÔ"[ˆDÖñ 'r   c               ó   € V ^8„  d   QhRR/# )r   r   zMapping[str, str | None]r   )r   s   "r   r   r¯   =  s   € ÷ 
ñ 
Ð 8ñ 
r   c                	óð   € V P                   '       g   / # V P                  4        V P                  e   V P                  f   \	        R4      h\        V P                  V P                  V P                  R7      # )NzæGoogleSecretManagerSettingsSource: could not determine GCP project_id or initialize the Secret Manager client. Pass project_id explicitly or ensure it is available via application default credentials or a previous settings source.)r<   r>   )r³   r×   rB   r9   r
   r7   r>   rK   s   &r   Ú_load_env_varsÚ0GoogleSecretManagerSettingsSource._load_env_vars=  ss   € ð ×$×$Ð$ØˆIà×!Ñ!Ô#Ø×ÑÒ# t×':Ñ':Ò'BÜðJóð ô *Ø×Ñ¨D×,<Ñ,<ÈT×M`ÑM`ô
ð 	
r   c               ó   € V ^8„  d   QhRR/# )r   r   zdict[str, Any]r   )r   s   "r   r   r¯   M  s   € ÷ "ñ "˜.ñ "r   c                	óX   <€ R V n         V P                  4       V n        \        SV `  4       # )T)r³   rÛ   rÃ   r´   Ú__call__)rD   rµ   s   &€r   rß   Ú*GoogleSecretManagerSettingsSource.__call__M  s+   ø€ ð !%ˆÔØ×+Ñ+Ó-ˆŒÜ‰wÑÓ!Ð!r   c               ó   € V ^8„  d   QhRR/# rH   r   )r   s   "r   r   r¯   T  s   € ÷ 
ñ 
˜#ñ 
r   c                	ó¤   € V P                   e   V P                   MV P                  pV P                  P                   RV: RV P                  : R2# )Nz(project_id=z, env_nested_delimiter=Ú))rB   r¦   rµ   rš   Úenv_nested_delimiter)rD   r<   s   & r   Ú__repr__Ú*GoogleSecretManagerSettingsSource.__repr__T  sR   € ð *.×)9Ñ)9Ò)E�T×%Ò%È4×KdÑKdˆ
à�~‰~×&Ñ&Ð' |°J±>ÐAXÐY]×YrÑYrÑXuÐuvÐwð	
r   )r¤   r³   r¦   rB   r²   r9   rÃ   )	NNNNNNTr<   N)rš   r›   rœ   r�   rž   rE   rÆ   r×   rÛ   rß   rå   r    Ú__classcell__)rµ   s   @r   r¢   r¢   �   sQ   ø‡ Ø$Ó$Ø5Ó5ØÓØ$Ó$÷;%ò ;%÷z/$ð /$õb*\õX
÷ "ð "÷
ó 
r   r¢   )%Ú
__future__r   Ú_annotationsr%   Úcollections.abcr   r   Ú	functoolsr   Útypingr   r   Úpydantic.fieldsr	   Ú
exceptionsr
   Útypesr   Úutilsr   Úenvr   r"   r   r#   r$   r   r)   r   Úpydantic_settings.mainr   r,   r5   r=   r7   r¢   Ú__all__r   r   r   Ú<module>rô      s†   ðÝ 2ã ß -Ý %ß %å %å 'Ý !Ý Ý "çÝ:Ý3ÝEæ3à€KØ!%ÐØÐõõ$ôd( ¨¨c°D­j¨Õ!9ô d(ôN}
Ð(9ô }
ð@ (Ð)LÐ
M‚r   