Ë
    ÑÕ°jï%  ã                  ó   — d dl mZ d dlmZ d dlZd dlmZ ddl	m
Z
 ddlmZ ddœ	 	 	 	 	 	 	 	 	 dd„Z G d	„ d
eeej                  e   f   «      Z G d„ de
eej                  e   f   e«      Z G d„ de«      ZddlmZ y)é    )ÚannotationsN)Úcleandocé   )ÚImmutableDictMixin)ÚCallbackDict©Údocc               ón  ‡ ‡‡— |€�d‰ › d�g}‰t         u r|j                  d«       n[‰€|j                  d«       n|j                  d‰j                  › d�«       ‰�|j                  d‰›d�«       |j                  d	«       d
j                  |«      }t	        ˆˆ ˆfd„ˆ ˆfd„ˆ fd„t        |«      ¬«      S )a±  Return a new property object for a cache header. Useful if you
    want to add support for a cache extension in a subclass.

    :param key: The attribute name present in the parsed cache-control header dict.
    :param empty: The value to use if the key is present without a value.
    :param type: The type to convert the string value to instead of a string. If
        conversion raises a ``ValueError``, the returned value is ``None``.
    :param doc: The docstring for the property. If not given, it is generated
        based on the other params.

    .. versionchanged:: 3.1
        Added the ``doc`` param.

    .. versionchanged:: 2.0
        Renamed from ``cache_property``.
    zThe ``z`` attribute.z"A ``bool``, either present or not.z
A ``str``,zA ``z``,z``z`` if present with no value,zor ``None`` if not present.ú c                ó*   •— | j                  ‰‰‰«      S ©N)Ú_get_cache_value)ÚxÚemptyÚkeyÚtypes    €€€ú[/var/www/mission/venv/lib/python3.12/site-packages/werkzeug/datastructures/cache_control.pyú<lambda>z(cache_control_property.<locals>.<lambda>1   s   ø€ �!×$Ñ$ S¨%°Ó6€ ó    c                ó*   •— | j                  ‰|‰«      S r   )Ú_set_cache_value)r   Úvr   r   s     €€r   r   z(cache_control_property.<locals>.<lambda>2   s   ø€ �Q×'Ñ'¨¨Q°Ó5€ r   c                ó&   •— | j                  ‰«      S r   )Ú_del_cache_value)r   r   s    €r   r   z(cache_control_property.<locals>.<lambda>3   s   ø€ �!×$Ñ$ SÓ)€ r   r   )ÚboolÚappendÚ__name__ÚjoinÚpropertyr   )r   r   r   r	   Úpartss   ```  r   Úcache_control_propertyr!      s¬   ú€ ð& €{Ø˜#˜˜mÐ,Ð-ˆà”4‰<Ø�L‰LÐ=Õ>àˆ|Ø—‘˜\Õ*à—‘˜t D§M¡M ?°#Ð6Ô7àÐ Ø—‘˜r % Ð*FÐGÔHà�L‰LÐ6Ô7à�h‰h�u‹oˆäÝ6Ü5Û)Ü�S‹Mô	ð r   c                  ó
  ‡ — e Zd ZU dZ edde«      Zded<    edde«      Z	ded<    ed	de«      Z
ded
<    edde«      Zded<   	 	 d	 	 	 dˆ fd„Z	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Z ee«      Zˆ xZS )Ú_CacheControla¸  Subclass of a dict that stores values for a Cache-Control header.  It
    has accessors for all the cache-control directives specified in RFC 2616.
    The class does not differentiate between request and response directives.

    Because the cache-control directives in the HTTP header use dashes the
    python descriptors use underscores for that.

    To get a header of the :class:`CacheControl` object again you can convert
    the object into a string or call the :meth:`to_header` method.  If you plan
    to subclass it and add your own items have a look at the sourcecode for
    that class.

    .. versionchanged:: 3.1
        Dict values are always ``str | None``. Setting properties will
        convert the value to a string. Setting a non-bool property to
        ``False`` is equivalent to setting it to ``None``. Getting typed
        properties will return ``None`` if conversion raises
        ``ValueError``, rather than the string.

    .. versionchanged:: 2.1
        Setting int properties such as ``max_age`` will convert the
        value to an int.

    .. versionchanged:: 0.4
       Setting ``no_cache`` or ``private`` to ``True`` will set the
       implicit value ``"*"``.
    zno-storeNr   Úno_storezmax-ageú
int | NoneÚmax_agezno-transformÚno_transformzstale-if-errorÚstale_if_errorc                ó8   •— t         ‰| �  ||«       |d u| _        y r   )ÚsuperÚ__init__Úprovided)ÚselfÚvaluesÚ	on_updateÚ	__class__s      €r   r+   z_CacheControl.__init__Z   s    ø€ ô
 	‰Ñ˜ Ô+Ø dÐ*ˆ�r   c                ór   — |t         u r|| v S || vry| |   x}€|S |�	  ||«      }|S |S # t        $ r Y yw xY w©ú+Used internally by the accessor properties.N)r   Ú
ValueError)r-   r   r   r   Úvalues        r   r   z_CacheControl._get_cache_valueb   sf   € ð ”4‰<Ø˜$�;Ðà�d‰?Øà˜#‘YÐˆEÐ'ØˆLàÐðÙ˜U›�ð ˆˆuˆøô ò Ùðús   ž* ª	6µ6c                óÀ   — |t         u r|rd| |<   y| j                  |d«       y|�|du r| j                  |d«       y|du rd| |<   y|� ||«      }t        |«      | |<   y)r3   NFT)r   ÚpopÚstr)r-   r   r5   r   s       r   r   z_CacheControl._set_cache_valuew   sj   € ð ”4‰<ÙØ ��S’	à—‘˜˜dÕ#Øˆ]˜e u™nØ�H‰H�S˜$ÕØ�d‰]ØˆD�ŠIàÐÙ˜U›�ä˜E›
ˆD�ŠIr   c                ó   — || v r| |= yyr2   © )r-   r   s     r   r   z_CacheControl._del_cache_valueŠ   s   € à�$‰;Ø�S‘	ð r   c                ó,   — t        j                  | «      S )z6Convert the stored values into a cache control header.)ÚhttpÚdump_header©r-   s    r   Ú	to_headerz_CacheControl.to_header�   s   € ä×Ñ Ó%Ð%r   c                ó"   — | j                  «       S r   )r?   r>   s    r   Ú__str__z_CacheControl.__str__“   s   € Ø�~‰~ÓÐr   c                ó˜   — dj                  d„ t        | j                  «       «      D «       «      }dt        | «      j                  › d|› d�S )Nr   c              3  ó0   K  — | ]  \  }}|› d |›�–— Œ y­w)ú=Nr:   )Ú.0Úkr   s      r   ú	<genexpr>z)_CacheControl.__repr__.<locals>.<genexpr>—   s   è ø€ ÒH©4¨1¨a˜Q˜C˜q  œ,ÑHùs   ‚ú<ú>)r   ÚsortedÚitemsr   r   )r-   Úkv_strs     r   Ú__repr__z_CacheControl.__repr__–   sA   € Ø—‘ÑH´6¸$¿*¹*»,Ó3GÔHÓHˆØ”4˜“:×&Ñ&Ð' q¨¨°Ð2Ð2r   )r:   N)r.   zBcabc.Mapping[str, t.Any] | cabc.Iterable[tuple[str, t.Any]] | Noner/   z+cabc.Callable[[_CacheControl], None] | None)r   r8   r   út.Anyr   útype[t.Any] | NoneÚreturnrN   )r   r8   r5   rN   r   rO   rP   ÚNone)r   r8   rP   rQ   )rP   r8   )r   Ú
__module__Ú__qualname__Ú__doc__r!   r   r$   Ú__annotations__Úintr&   r'   r(   r+   r   r   r   r?   rA   rM   ÚstaticmethodÚcache_propertyÚ__classcell__)r0   s   @r   r#   r#   8   sä   ø… ññ8 ,¨J¸¸dÓC€HˆdÓCÙ0°¸DÀ#ÓF€GˆZÓFÙ/°ÀÀdÓK€L�$ÓKÙ!7Ð8HÈ$ÐPSÓ!T€N�JÓTð VXØAEð+àRð+ð ?õ+ðØðØ$ðØ,>ðà	óð*#Øð#Ø$ð#Ø,>ð#à	ó#ó&ó
&ó ó3ñ "Ð"8Ó9„Nr   r#   c                  óŠ   — e Zd ZU dZ edde«      Zded<    edde«      Z	ded	<    ed
de«      Z
ded<    edde«      Zded<   y)ÚRequestCacheControla  A cache control for requests.  This is immutable and gives access
    to all the request-relevant cache control headers.

    To get a header of the :class:`RequestCacheControl` object again you can
    convert the object into a string or call the :meth:`to_header` method.  If
    you plan to subclass it and add your own items have a look at the sourcecode
    for that class.

    .. versionchanged:: 3.1
        Dict values are always ``str | None``. Setting properties will
        convert the value to a string. Setting a non-bool property to
        ``False`` is equivalent to setting it to ``None``. Getting typed
        properties will return ``None`` if conversion raises
        ``ValueError``, rather than the string.

    .. versionchanged:: 3.1
       ``max_age`` is ``None`` if present without a value, rather
       than ``-1``.

    .. versionchanged:: 3.1
        ``no_cache`` is a boolean, it is ``True`` instead of ``"*"``
        when present.

    .. versionchanged:: 3.1
        ``max_stale`` is ``True`` if present without a value, rather
        than ``"*"``.

    .. versionchanged:: 3.1
       ``no_transform`` is a boolean. Previously it was mistakenly
       always ``None``.

    .. versionchanged:: 3.1
       ``min_fresh`` is ``None`` if present without a value, rather
       than ``"*"``.

    .. versionchanged:: 2.1
        Setting int properties such as ``max_age`` will convert the
        value to an int.

    .. versionadded:: 0.5
        Response-only properties are not present on this request class.
    úno-cacheNr   Úno_cachez	max-staleTzint | t.Literal[True] | NoneÚ	max_stalez	min-freshr%   Ú	min_freshzonly-if-cachedÚonly_if_cached)r   rR   rS   rT   r!   r   r]   rU   rV   r^   r_   r`   r:   r   r   r[   r[   �   sa   … ñ)ñV ,¨J¸¸dÓC€HˆdÓCÙ.DØØØó/€IÐ+ó ñ
 3°;ÀÀcÓJ€IˆzÓJÙ1Ð2BÀDÈ$ÓO€N�DÔOr   r[   c                  ó   — e Zd ZU dZ eddd«      Zded<    edde«      Zded<    ed	dd«      Z	ded	<    ed
de«      Z
ded<    edde«      Zded<    edde«      Zded<    edde«      Zded<    edde«      Zded<    edde«      Zded<   y)ÚResponseCacheControla  A cache control for responses.  Unlike :class:`RequestCacheControl`
    this is mutable and gives access to response-relevant cache control
    headers.

    To get a header of the :class:`ResponseCacheControl` object again you can
    convert the object into a string or call the :meth:`to_header` method.  If
    you plan to subclass it and add your own items have a look at the sourcecode
    for that class.

    .. versionchanged:: 3.1
        Dict values are always ``str | None``. Setting properties will
        convert the value to a string. Setting a non-bool property to
        ``False`` is equivalent to setting it to ``None``. Getting typed
        properties will return ``None`` if conversion raises
        ``ValueError``, rather than the string.

    .. versionchanged:: 3.1
        ``no_cache`` is ``True`` if present without a value, rather than
        ``"*"``.

    .. versionchanged:: 3.1
        ``private`` is ``True`` if present without a value, rather than
        ``"*"``.

    .. versionchanged:: 3.1
       ``no_transform`` is a boolean. Previously it was mistakenly
       always ``None``.

    .. versionchanged:: 3.1
        Added the ``must_understand``, ``stale_while_revalidate``, and
        ``stale_if_error`` properties.

    .. versionchanged:: 2.1.1
        ``s_maxage`` converts the value to an int.

    .. versionchanged:: 2.1
        Setting int properties such as ``max_age`` will convert the
        value to an int.

    .. versionadded:: 0.5
       Request-only properties are not present on this response class.
    r\   TNzstr | t.Literal[True] | Noner]   Úpublicr   Úprivatezmust-revalidateÚmust_revalidatezproxy-revalidateÚproxy_revalidatezs-maxager%   Ús_maxageÚ	immutablezmust-understandÚmust_understandzstale-while-revalidateÚstale_while_revalidate)r   rR   rS   rT   r!   r]   rU   r   rc   rd   re   rf   rV   rg   rh   ri   rj   r:   r   r   rb   rb   Ó   sÐ   … ñ)ñV .DØ�D˜$ó.€HÐ*ó ñ *¨(°D¸$Ó?€FˆDÓ?Ù,BØ�4˜ó-€GÐ)ó ñ 3Ð3DÀdÈDÓQ€O�TÓQÙ3Ð4FÈÈdÓSÐ�dÓSÙ1°*¸dÀCÓH€HˆjÓHÙ,¨[¸$ÀÓE€IˆtÓEÙ2Ð3DÀdÈDÓQ€O�TÓQÙ)?Ø  $¨ó*Ð˜Jô r   rb   é   )r<   )
r   r8   r   rN   r   rO   r	   z
str | NonerP   rN   )Ú
__future__r   Úcollections.abcÚabcÚcabcÚtypingÚtÚinspectr   Úmixinsr   Ú
structuresr   r!   r8   ÚOptionalr#   r[   rb   Ú r<   r:   r   r   ú<module>rw      s£   ðÝ "å Û Ý å &Ý $ð LPñ*Ø	ð*Øð*Ø"4ð*Ø>Hð*à
ó*ôZb:�L  a§j¡j°¡oÐ!5Ñ6ô b:ôJ3PÐ,¨S°!·*±*¸S±/Ð-AÑBÀMô 3Pôl:˜=ô :ö| r   