
    /h                    2   d dl mZ d dlZd dlZd dlmZ ddlmZ ddlm	Z	 ddlm
Z
 ddlmZ dd	lmZ dd
lmZ  ej        d          Z	 	 	 	 	 	 	 	 	 d)d*dZ ej        dej        ej        z            Z ej        d          Zd+d"Z	 	 d,d-d'Zdd(lmZ dS ).    )annotationsN)datetime   )
_dt_as_utc)generate_etag)
parse_date)parse_etags)parse_if_range_header)unquote_etagz&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)T
http_range
str | Nonehttp_if_rangehttp_if_modified_sincehttp_if_none_matchhttp_if_matchetagdatabytes | Nonelast_modifieddatetime | str | Noneignore_if_rangeboolreturnc	                   ||t          |          }n|t          d          d}	t          |t                    rt	          |          }|#t          |                    d                    }d}
|s| t          |          }
|
|
j        |
j        }nt	          |          }|r
|r||k    rd}	|rt          |          \  }}|
/|
j
        (t          |
j
                                      |          }	nMt          |          }|r|                    |          }	t          |          }|r|                    |           }	|	 S )a  Convenience method for conditional requests.
    :param http_range: Range HTTP header
    :param http_if_range: If-Range HTTP header
    :param http_if_modified_since: If-Modified-Since HTTP header
    :param http_if_none_match: If-None-Match HTTP header
    :param http_if_match: If-Match HTTP header
    :param etag: the etag for the response for comparison.
    :param data: or alternatively the data of the response to automatically
                 generate an etag using :func:`generate_etag`.
    :param last_modified: an optional date of the last modification.
    :param ignore_if_range: If `False`, `If-Range` header will be taken into
                            account.
    :return: `True` if the resource was modified, otherwise `False`.

    .. versionadded:: 2.2
    Nzboth data and etag givenFr   )microsecondT)r   	TypeError
isinstancestrr   r   replacer
   dater   r   r	   containscontains_weak	is_strong)r   r   r   r   r   r   r   r   r   
unmodifiedif_rangemodified_since_if_none_matchif_matchs                  G/var/www/html/venv/lib/python3.11/site-packages/werkzeug/sansio/http.pyis_resource_modifiedr+      s   6 |(T""		2333J-%% 2"=11  "=#8#8Q#8#G#GHHH 8z5 )77 9*2-#$:;; - M^,K,K
 :t$$aHM$=$X]33<<TBBJJ'(:;;M ? +88>>

 #=11H :!)!3!3D!9!99
>    zr
    ([^=;]*)
    (?:\s*=\s*
      (
        "(?:[^\\"]|\\.)*"
      |
        .*?
      )
    )?
    \s*;\s*
    )flagss   \\([0-3][0-7]{2}|.)mt.Match[bytes]bytesc                    |                      d          }t          |          dk    r|S t          |d                              dd          S )N      big)grouplenintto_bytes)r.   vs     r*   _cookie_unslash_replacer:   q   sC    	

A
1vv{{q!99a'''r,   cookiecls#type[ds.MultiDict[str, str]] | Noneds.MultiDict[str, str]c                >   |t          j        dt          j                  }| s
 |            S |  d} g }t                              |           D ]\  }}|                                }|                                }|s0t          |          dk    rj|d         |d         cxk    rdk    rQn nNt          	                    t          |dd                                                                       d	
          }|                    ||f            ||          S )a)  Parse a cookie from a string.

    The same key can be provided multiple times, the values are stored
    in-order. The default :class:`MultiDict` will have the first value
    first, and all values can be retrieved with
    :meth:`MultiDict.getlist`.

    :param cookie: The cookie header as a string.
    :param cls: A dict-like class to store the parsed cookies in.
        Defaults to :class:`MultiDict`.

    .. versionchanged:: 3.0
        Passing bytes, and the ``charset`` and ``errors`` parameters, were removed.

    .. versionadded:: 2.2
    Nztype[ds.MultiDict[str, str]];r   r   "r2   r   )errors)tcastds	MultiDict
_cookie_refindallstripr6   _cookie_unslash_resubr:   encodedecodeappend)r;   r<   outckcvs        r*   parse_cookierS   z   s$   ( {f3R\BB suu\\\F
C$$V,,  BXXZZXXZZ 	r77a<<BqERV2222s22222#'''AbD):): fIf&&  	

B83s88Or,   )datastructures)	NNNNNNNNT)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r.   r/   r   r0   )NN)r;   r   r<   r=   r   r>   )
__future__r   retypingrD   r   	_internalr   httpr   r   r	   r
   r   compile_etag_rer+   ASCIIVERBOSErH   rK   r:   rS    rT   rF    r,   r*   <module>r`      s   " " " " " " 				           " " " " " "                         ( ( ( ( ( (      2:?@@ " $)-%) $+/ L L L L L^ RZ
 (RZ
  
  RZ 788 ( ( ( ( /3, , , , ,` $ # # # # # # #r,   