
    'g                    X    d dl mZ d dlmZ d dlZddlmZ ddZ	 G d dee
e
f         Zy)	    )annotationsN   )CallbackDictc                8     t         fd fd fdd       S )zReturn a new property object for a content security policy header.
    Useful if you want to add support for a csp extension in a
    subclass.
    c                &    | j                        S N)
_get_valuexkeys    S/var/www/html/knws/venv/lib/python3.12/site-packages/werkzeug/datastructures/csp.py<lambda>zcsp_property.<locals>.<lambda>       !,,s#     c                (    | j                  |      S r   )
_set_value)r   vr   s     r   r   zcsp_property.<locals>.<lambda>   s    Q\\#q) r   c                &    | j                        S r   )
_del_valuer
   s    r   r   zcsp_property.<locals>.<lambda>   r   r   zaccessor for )property)r   s   `r   csp_propertyr   	   s%    
 #)#
w	 r   c                      e Zd ZU dZ ed      Zded<    ed      Zded<    ed      Zded<    ed	      Z	ded
<    ed      Z
ded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded<    ed      Zded <    ed!      Zded"<    ed#      Zded$<    ed%      Zded%<    ed&      Zded'<    ed(      Zded)<    ed*      Zded+<    ed,      Zded-<    ed.      Zded/<    ed0      Zded1<    ed2      Zded3<   	 	 d;	 	 	 	 	 d< fd4Zd=d5Z d>d6Z!d?d7Z"d@d8Z#d@d9Z$d@d:Z% xZ&S )AContentSecurityPolicyaV  Subclass of a dict that stores values for a Content Security Policy
    header. It has accessors for all the level 3 policies.

    Because the csp directives in the HTTP header use dashes the
    python descriptors use underscores for that.

    To get a header of the :class:`ContentSecuirtyPolicy` 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.

    .. versionadded:: 1.0.0
       Support for Content Security Policy headers was added.

    zbase-uri
str | Nonebase_uriz	child-src	child_srczconnect-srcconnect_srczdefault-srcdefault_srczfont-srcfont_srczform-actionform_actionzframe-ancestorsframe_ancestorsz	frame-src	frame_srczimg-srcimg_srczmanifest-srcmanifest_srcz	media-src	media_srcznavigate-tonavigate_toz
object-src
object_srczprefetch-srcprefetch_srczplugin-typesplugin_typesz	report-to	report_toz
report-uri
report_urisandboxz
script-src
script_srczscript-src-attrscript_src_attrzscript-src-elemscript_src_elemz	style-src	style_srczstyle-src-attrstyle_src_attrzstyle-src-elemstyle_src_elemz
worker-src
worker_srcc                8    t         |   ||       |d u| _        y r   )super__init__provided)selfvalues	on_update	__class__s      r   r6   zContentSecurityPolicy.__init__A   s     
 	+d*r   c                $    | j                  |      S )+Used internally by the accessor properties.)getr8   r   s     r   r	   z ContentSecurityPolicy._get_valueI   s    xx}r   c                8    || j                  |d       y|| |<   yr=   N)pop)r8   r   values      r   r   z ContentSecurityPolicy._set_valueM   s    =HHS$DIr   c                    || v r| |= yyrA    r?   s     r   r   z ContentSecurityPolicy._del_valueT   s    $;S	 r   c                    ddl m}  ||       S )z6Convert the stored values into a cache control header.   )dump_csp_header)httprH   )r8   rH   s     r   	to_headerzContentSecurityPolicy.to_headerY   s    *t$$r   c                "    | j                         S r   )rJ   )r8   s    r   __str__zContentSecurityPolicy.__str___   s    ~~r   c                    dj                  d t        | j                               D              }dt        |       j                   d| dS )N c              3  0   K   | ]  \  }}| d |  yw)=NrE   ).0kr   s      r   	<genexpr>z1ContentSecurityPolicy.__repr__.<locals>.<genexpr>c   s     H41aQCq,Hs   <>)joinsorteditemstype__name__)r8   kv_strs     r   __repr__zContentSecurityPolicy.__repr__b   sA    H6$**,3GHH4:&&'q22r   )rE   N)r9   z>cabc.Mapping[str, str] | cabc.Iterable[tuple[str, str]] | Noner:   z3cabc.Callable[[ContentSecurityPolicy], None] | NonereturnNone)r   strr]   r   )r   r_   rC   r   r]   r^   )r   r_   r]   r^   )r]   r_   )'rZ   
__module____qualname____doc__r   r   __annotations__r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r6   r	   r   r   rJ   rL   r\   __classcell__)r;   s   @r   r   r      s     (
3Hj3(5Iz5*=9K9*=9K9'
3Hj3*=9K9"./@"AOZA(5Iz5&y1GZ1+N;L*;(5Iz5*=9K9),7J
7+N;L*;+N;L*;(5Iz5),7J
7&y1GZ1),7J
7"./@"AOZA"./@"AOZA(5Iz5!-.>!?NJ?!-.>!?NJ?),7J
7 RTIM+N+ G+ 
	+
% 3r   r   )r   r_   r]   zt.Any)
__future__r   collections.abcabccabctypingt
structuresr   r   r_   r   rE   r   r   <module>rl      s-    "   $
N3Lc2 N3r   