ó
     “,jÿ  ã            
       óF  • S SK r S SKrS SKrS SKJr  S SKJrJrJrJ	r	  SSK
Jr  SSKJr  \	" S5      r " S S	\5      r\	" S
5      rS\S\4   S\S\S\S\4   4S jrSrSr " S S\5      r " S S\5      rS\4S jrSSSS.rS\S\4S jrSS\S\\\4   \-  S\4S jjrg) é    N©Údeepcopy)ÚAnyÚCallableÚProtocolÚTypeVaré   )ÚVARIABLE_RE)ÚConfigValidationErrorÚ_DInc                   ó6   • \ rS rSrSrS\S\\/\4   4S jrSr	g)Ú	Decoratoré   zLProtocol to mark a function as returning its child with identical signature.ÚnameÚreturnc                 ó   • g ©N© )Úselfr   s     Ú�C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\confection/util.pyÚ__call__ÚDecorator.__call__   s   € ¸Só    r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ústrr   r   r   Ú__static_attributes__r   r   r   r   r      s   † ÙVà@˜SÐ@ X¨t¨f°d¨lÑ%;×@r   r   ÚPartialTÚfunc.ÚargsÚkwargsr   c                 ó\   • [         R                  " U /UQ70 UD6nU R                  Ul        U$ )zfWrapper around functools.partial that retains docstrings and can include
other workarounds if needed.
)Ú	functoolsÚpartialr   )r"   r#   r$   Úpartial_funcs       r   r'   r'      s0   € ô ×$Ò$ TÐ;¨DÒ;°FÑ;€LØŸ<™<€LÔØÐr   zsCan't write to frozen dictionary. This is likely an internal error. Are you writing to a default function argument?zkCan't write to frozen list. Maybe you're trying to modify a computed property or default function argument?c                   ó`   ^ • \ rS rSrSr\S.S\SS4U 4S jjjrS rSS	 jr	SS
 jr
S rSrU =r$ )ÚSimpleFrozenDicté-   zÑSimplified implementation of a frozen dict, mainly used as default
function or method argument (for arguments that should default to empty
dictionary). Will raise an error if the user attempts to add to dict.
©Úerrorr-   r   Nc                ó2   >• [         TU ]  " U0 UD6  Xl        g)z‹Initialize the frozen dict. Can be initialized with pre-defined
values.

error (str): The error message when user tries to assign to dict.
N)ÚsuperÚ__init__r-   )r   r-   r#   r$   Ú	__class__s       €r   r0   ÚSimpleFrozenDict.__init__3   s   ø€ ô 	‰Ò˜$Ð) &Ò)Ø�
r   c                 ó,   • [        U R                  5      er   ©ÚNotImplementedErrorr-   )r   ÚkeyÚvalues      r   Ú__setitem__ÚSimpleFrozenDict.__setitem__A   ó   € Ü! $§*¡*Ó-Ð-r   c                 ó,   • [        U R                  5      er   r4   )r   r6   Údefaults      r   ÚpopÚSimpleFrozenDict.popD   r:   r   c                ó,   • [        U R                  5      er   r4   )r   Úotherr$   s      r   ÚupdateÚSimpleFrozenDict.updateG   r:   r   c           
      óˆ   • U R                  [        U R                  5        VVs0 s H  u  p#X#_M	     snn5      5      $ s  snnf r   )r1   r   Úitems)r   ÚmemoÚkÚvs       r   Ú__deepcopy__ÚSimpleFrozenDict.__deepcopy__J   s2   € Ø�~‰~œh¸¿¹¼Ô'Fº±°¨ª¹Ò'FÓGÓHÐHùÓ'Fs   ¤>r   )r   )r   r   r   r   r   ÚDEFAULT_FROZEN_DICT_ERRORr   r0   r8   r=   rA   rH   r    Ú__classcell__©r1   s   @r   r*   r*   -   sF   ø† ñð /òð ðð
 
÷ð ò.ô.ô.÷Ið Ir   r*   c                   óv   ^ • \ rS rSrSr\S.S\SS4U 4S jjjrS rS	 r	S
 r
S rS rS rS rS rS rSrU =r$ )ÚSimpleFrozenListéN   aV  Wrapper class around a list that lets us raise custom errors if certain
attributes/methods are accessed. Mostly used for properties that return an
immutable list (and that we don't want to convert to a tuple to not break
too much backwards compatibility). If a user accidentally calls
frozen_list.append(), we can raise a more helpful error.
r,   r-   r   Nc                ó,   >• Xl         [        TU ]  " U6   g)z`Initialize the frozen list.

error (str): The error message when user tries to mutate the list.
N)r-   r/   r0   )r   r-   r#   r1   s      €r   r0   ÚSimpleFrozenList.__init__V   s   ø€ ð Œ
Ü‰Ò˜$Òr   c                 ó,   • [        U R                  5      er   r4   ©r   r#   r$   s      r   ÚappendÚSimpleFrozenList.appendb   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   ÚclearÚSimpleFrozenList.cleare   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   ÚextendÚSimpleFrozenList.extendh   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   ÚinsertÚSimpleFrozenList.insertk   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   r=   ÚSimpleFrozenList.popn   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   ÚremoveÚSimpleFrozenList.removeq   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   ÚreverseÚSimpleFrozenList.reverset   r:   r   c                 ó,   • [        U R                  5      er   r4   rS   s      r   ÚsortÚSimpleFrozenList.sortw   r:   r   c                 ó2   • U R                  S U  5       5      $ )Nc              3   ó8   #   • U  H  n[        U5      v •  M     g 7fr   r   )Ú.0rG   s     r   Ú	<genexpr>Ú0SimpleFrozenList.__deepcopy__.<locals>.<genexpr>{   s   é € Ð8²4¨aœh qŸk˜k²4ùs   ‚rL   )r   rE   s     r   rH   ÚSimpleFrozenList.__deepcopy__z   s   € Ø�~‰~Ñ8±4Ó8Ó8Ð8r   )r   r   r   r   r   ÚDEFAULT_FROZEN_LIST_ERRORr   r0   rT   rW   rZ   r]   r=   rb   re   rh   rH   r    rK   rL   s   @r   rN   rN   N   s]   ø† ñð /ò
 ð ð
 ð 
÷	
 ð 
 ò.ò.ò.ò.ò.ò.ò.ò.÷9ð 9r   rN   c                 óò   • [        U S5      (       d  gU R                  5        Vs/ s H4  n[        U[        5      (       d  M  UR	                  S5      (       d  M2  UPM6     nn[        U5      (       a  ggs  snf )NÚkeysFÚ@T)Úhasattrrr   Ú
isinstancer   Ú
startswithÚlen)ÚobjrF   Úid_keyss      r   Ú
is_promiserz   ~   sW   € Ü�3˜×ÑØØŸ(™(œ*ÓQš*�Q¬
°1´c×(:‹q¸q¿|¹|ÈC×?P�q™*€GÐQÜ
ˆ7‡|�|ØØùò Rs   ¥A4ÁA4ÁA4TF)ÚTrueÚFalseÚNoner7   c                 ó~   •  [         R                  " U 5      $ ! [         a    U [        ;   a  [        U    s $ U s $ f = f)zËLoad a JSON string if possible, otherwise default to original value.

Also handles Python-style literals ``True``, ``False``, and ``None``
which are not valid JSON but are commonly used in config files.
)ÚjsonÚloadsÚ	ExceptionÚ_PYTHON_LITERALS)r7   s    r   Útry_load_jsonrƒ   Š   s>   € ðÜ�zŠz˜%Ó Ð øÜó ØÔ$Ó$Ü# EÑ*Ò*ØŠðús   ‚ ˜<·<»<Údatac                 ó   • [        U [        5      (       a  [        R                  " U 5      (       a  U $  [        R
                  " U 5      n [        R                  " SSU 5      $ ! [         a!  nS[        U 5       SU S3n[        XS9UeSnAff = f)zGDump a config value as JSON and output user-friendly error if it fails.z(Couldn't serialize config value of type z: zž. Make sure all values in your config are JSON-serializable. If you want to include Python objects, use a registered function that returns the object instead.)ÚconfigÚdescNz\$(?!\{)z$$)ru   r   r
   Úsearchr   Údumpsr�   Útyper   ÚreÚsub)r7   r„   ÚeÚerr_msgs       r   Útry_dump_jsonr�   ˜   s“   € ô �%œ×Ñ¤+×"4Ò"4°U×";Ñ";Øˆð	FÜ—
’
˜5Ó!ˆô �6Š6�+˜t UÓ+Ð+øô ó Fà6´t¸E³{°mÀ2ÀaÀSð I"ð #ð 	ô $¨4Ñ>ÀAÐEûðFús   ´A" Á"
BÁ,BÂB)Ú )r&   r   r‹   Úcopyr   Útypingr   r   r   r   Ú
_constantsr
   Ú_errorsr   r   r   r!   r'   rJ   rp   Údictr*   ÚlistrN   Úboolrz   r‚   r   rƒ   r�   r   r   r   Ú<module>r˜      sü   ðÛ Û Û 	Ý ß 3Ó 3å #Ý *áˆvƒ€ôA�ô Añ �:Ó€ðØ
�3˜�=Ñ
!ðØ*-ðØ9<ðàˆc�8ˆmÑôð=ð ð-ð ôI�tô IôB-9�tô -9ð`�tô ð !¨5¸$Ñ?Ð ð˜ð  ô ñ,˜ð , D¨¨d¨¡O°cÑ$9ð ,À3ö ,r   