ó
    |chÌ  ã                   ój   • S r SSKJr  SSKJr  SSKJr  SSKJrJ	r	J
r
   " S S5      r " S S	\5      rg
)zœ
Content negotiation deals with selecting an appropriate renderer given the
incoming request.  Typically this will be based on the request's Accept header.
é    )ÚHttp404)Ú
exceptions)Úapi_settings)Ú
_MediaTypeÚmedia_type_matchesÚorder_by_precedencec                   ó$   • \ rS rSrS rSS jrSrg)ÚBaseContentNegotiationé   c                 ó   • [        S5      e)Nz$.select_parser() must be implemented©ÚNotImplementedError)ÚselfÚrequestÚparserss      Úc/var/www/djangovue.mamus.xyz/django/venv/lib/python3.13/site-packages/rest_framework/negotiation.pyÚselect_parserÚ$BaseContentNegotiation.select_parser   s   € Ü!Ð"HÓIÐIó    Nc                 ó   • [        S5      e)Nz&.select_renderer() must be implementedr   )r   r   Ú	renderersÚformat_suffixs       r   Úselect_rendererÚ&BaseContentNegotiation.select_renderer   s   € Ü!Ð"JÓKÐKr   © ©N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Ú__static_attributes__r   r   r   r
   r
      s   † òJ÷Lr   r
   c                   ó4   • \ rS rSr\rS rSS jrS rS r	Sr
g)	ÚDefaultContentNegotiationé   c                 óh   • U H,  n[        UR                  UR                  5      (       d  M*  Us  $    g)zi
Given a list of parsers and a media type, return the appropriate
parser to handle the incoming request.
N)r   Ú
media_typeÚcontent_type)r   r   r   Úparsers       r   r   Ú'DefaultContentNegotiation.select_parser   s1   € ó
 ˆFÜ! &×"3Ñ"3°W×5IÑ5I×JÓJØ’ñ ð r   Nc                 ó�  • U R                   R                  nU=(       d    UR                  R                  U5      nU(       a  U R	                  X%5      nU R                  U5      n[        U5       HÁ  nU H¸  nU H¯  n	[        UR                  U	5      (       d  M   [        U	5      n
[        UR                  5      R                  U
R                  :”  aP  SR                  UR                  4[        S U
R                  R                  5        5       5      -   5      nX‹4s  s  s  $ X‰4s  s  s  $    Mº     MÃ     [        R                   " US9e)zY
Given a request and a list of renderers, return a two-tuple of:
(renderer, media type).
Ú;c              3   óH   #   • U  H  u  pS R                  X5      v •  M     g7f)z{}={}N)Úformat)Ú.0ÚkeyÚvalues      r   Ú	<genexpr>Ú<DefaultContentNegotiation.select_renderer.<locals>.<genexpr>C   s%   é € ð &"â6W©
¨ð %,§N¡N°3×$>Ð$>Ú6Wùs   ‚ ")Úavailable_renderers)ÚsettingsÚURL_FORMAT_OVERRIDEÚquery_paramsÚgetÚfilter_renderersÚget_accept_listr   r   r&   r   Ú
precedenceÚjoinÚtupleÚparamsÚitemsr   ÚNotAcceptable)r   r   r   r   Úformat_query_paramr-   ÚacceptsÚmedia_type_setÚrendererr&   Úmedia_type_wrapperÚfull_media_types               r   r   Ú)DefaultContentNegotiation.select_renderer#   s&  € ð "Ÿ]™]×>Ñ>ÐØ×N '×"6Ñ"6×":Ñ":Ð;MÓ"NˆæØ×-Ñ-¨iÓ@ˆIà×&Ñ& wÓ/ˆô 2°'Ö:ˆNÛ%�Û"0�JÜ)¨(×*=Ñ*=¸z×JÓJä-7¸
Ó-CÐ*ä& x×':Ñ':Ó;×FÑFØ.×9Ñ9ó:ð
 /2¯h©hØ!)×!4Ñ!4Ð 6Ü %ñ &"à6H×6OÑ6O×6UÑ6UÔ6Wó&"ó !"ñ!"ó/˜Oð $,Ð#<Ö<ð $,Ð#7Ö7ó+ #1ó &ñ ;ô2 ×&Ò&¸9ÑEÐEr   c                 ór   • U Vs/ s H  nUR                   U:X  d  M  UPM     nnU(       d  [        eU$ s  snf )z„
If there is a '.json' style format suffix, filter the renderers
so that we only negotiation against those that accept that format.
)r-   r   )r   r   r-   rC   s       r   r8   Ú*DefaultContentNegotiation.filter_renderersP   s>   € ñ
 /8ó 3ªi (Ø Ÿ™¨6Ñ1÷ ©iˆ	ð 3æÜˆMØÐùò	3s   …4�4c                 ó¢   • UR                   R                  SS5      nUR                  S5       Vs/ s H  o3R                  5       PM     sn$ s  snf )zL
Given the incoming request, return a tokenized list of media
type strings.
ÚHTTP_ACCEPTz*/*Ú,)ÚMETAr7   ÚsplitÚstrip)r   r   ÚheaderÚtokens       r   r9   Ú)DefaultContentNegotiation.get_accept_list[   sA   € ð
 —‘×!Ñ! -°Ó7ˆØ+1¯<©<¸Ô+<Ó=Ò+< %—‘–Ñ+<Ñ=Ð=ùÒ=s   °Ar   r   )r   r   r   r    r   r4   r   r   r8   r9   r!   r   r   r   r#   r#      s   † Ø€Hòô+FòZ	õ>r   r#   N)Ú__doc__Údjango.httpr   Úrest_frameworkr   Úrest_framework.settingsr   Úrest_framework.utils.mediatypesr   r   r   r
   r#   r   r   r   Ú<module>rW      s:   ðñõ  å %Ý 0÷ñ ÷
Lñ LôK>Ð 6õ K>r   