
    %h                    L   S SK Jr  S SKrS SKrSSKJr  SSKJr  SSKJ	r	  SSKJ
r
  \R                  (       a  S SKJr  SS	KJr  SS
KJr  SSKJr  SSKJr   " S S\5      r " S S\\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S\5      rg)    )annotationsN   )
BadRequest)HTTPException)cached_property)redirect)WSGIEnvironment)Request)Response   )
MapAdapter)Rulec                      \ rS rSrSrSrg)RoutingException   zlSpecial exceptions that require the application to redirect, notifying
about missing urls, etc.

:internal:
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       S/var/www/auris/envauris/lib/python3.13/site-packages/werkzeug/routing/exceptions.pyr   r      s    r   r   c                  P   ^  \ rS rSrSrSrSU 4S jjr  S     S	S jjrSrU =r	$ )
RequestRedirect   zRaise if the map requests a redirect. This is for example the case if
`strict_slashes` are activated and an url that requires a trailing slash.

The attribute `new_url` contains the absolute destination url.
i4  c                0   > [         TU ]  U5        Xl        g N)super__init__new_url)selfr#   	__class__s     r   r"   RequestRedirect.__init__%   s    !r   c                B    [        U R                  U R                  5      $ r    )r   r#   code)r$   environscopes      r   get_responseRequestRedirect.get_response)   s    
 dii00r   )r#   )r#   strreturnNone)NN)r)   z WSGIEnvironment | Request | Noner*   zdict[str, t.Any] | Noner.   r   )
r   r   r   r   r   r(   r"   r+   r   __classcell__r%   s   @r   r   r      sB     D 59)-111 '1 
	1 1r   r   c                  4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )RequestPath1   zInternal exception.)	path_infoc                .   > [         TU ]  5         Xl        g r    )r!   r"   r5   )r$   r5   r%   s     r   r"   RequestPath.__init__6   s    "r   )r5   r-   r.   r/   )	r   r   r   r   r   	__slots__r"   r   r0   r1   s   @r   r3   r3   1   s    I# #r   r3   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )RequestAliasRedirect;   zAThis rule is an alias and wants to redirect to the canonical URL.c                :   > [         TU ]  5         Xl        X l        g r    )r!   r"   matched_valuesendpoint)r$   r=   r>   r%   s      r   r"   RequestAliasRedirect.__init__>   s    , r   )r>   r=   )r=   t.Mapping[str, t.Any]r>   t.Anyr.   r/   )r   r   r   r   r   r"   r   r0   r1   s   @r   r:   r:   ;   s    K! !r   r:   c                  p   ^  \ rS rSrSr S         S	U 4S jjjr\S
S j5       rSS jrSS jr	Sr
U =r$ )
BuildErrorD   zWRaised if the build system cannot find a URL for an endpoint with the
values provided.
c                V   > [         TU ]  XU5        Xl        X l        X0l        X@l        g r    )r!   r"   r>   valuesmethodadapter)r$   r>   rF   rG   rH   r%   s        r   r"   BuildError.__init__I   s(     	62 r   c                8    U R                  U R                  5      $ r    )closest_rulerH   )r$   s    r   	suggestedBuildError.suggestedV   s      ..r   c                   ^  SU 4S jjnU(       a9  UR                   R                  (       a  [        UR                   R                  US9$ g )Nc           
       > [        S[        R                  " S [        U R                  5      [        TR                  5      5      R                  5       -  S[        [        TR                  =(       d    S5      R                  U R                  5      5      -  S[        U R                  =(       a    TR                  U R                  ;   5      -  /5      $ )Ng\(\?g{Gz?r   )sumdifflibSequenceMatcherr-   r>   ratioboolsetrF   issubset	argumentsmethodsrG   )ruler$   s    r   _score_rule,BuildError.closest_rule.<locals>._score_rule[   s    --DMM*DMM*	
 eg 4DKK$52 6 ? ? OPP4 L1LMM
 r   )key)rY   r   r.   float)map_rulesmax)r$   rH   rZ   s   `  r   rK   BuildError.closest_ruleZ   s3    	 w{{))w{{)){;;r   c                (   SU R                   < 3/nU R                  (       a   UR                  SU R                  < S35        U R                  (       a(  UR                  S[	        U R                  5      < 35        UR                  S5        U R
                  (       Gad  U R                   U R
                  R                   :X  Ga  U R                  (       an  U R
                  R                  bW  U R                  U R
                  R                  ;  a3  UR                  S[	        U R
                  R                  5      < S35        U R
                  R                  R                  [        U R
                  R                  =(       d    S5      5      [        U R                  R                  5       5      -
  nU(       a  UR                  S	[	        U5      < S35        O*UR                  S
U R
                  R                   < S35        SR                  U5      $ )Nz!Could not build url for endpoint z ()z with values .z Did you mean to use methods ?r   z" Did you forget to specify values z Did you mean z	 instead? )r>   rG   appendrF   sortedrL   rX   rW   unionrU   defaultskeysjoin)r$   messagemissing_valuess      r   __str__BuildError.__str__o   s   6t}}6GHI;;NNRa01;;NN]6$+++>*ABCs>>>}} 7 77KK..:4>>+A+AANN"4>>#9#9:=Q@ "&!9!9!?!?//526"((*+", "NN<VN=S<VVWX 0G0G/J)TUwwwr   )rH   r>   rG   rF   r    )
r>   rA   rF   r@   rG   z
str | NonerH   MapAdapter | Noner.   r/   )r.   Rule | None)rH   rq   r.   rr   )r.   r-   )r   r   r   r   r   r"   r   rL   rK   ro   r   r0   r1   s   @r   rC   rC   D   sj     &* & 	
 # 
  / /*   r   rC   c                      \ rS rSrSrSrg)WebsocketMismatch   zyThe only matched rule is either a WebSocket and the request is
HTTP, or the rule is HTTP and the request is a WebSocket.
r   Nr   r   r   r   rt   rt      s    r   rt   c                  "    \ rS rSrSrSS jrSrg)NoMatch   have_match_forwebsocket_mismatchc                    Xl         X l        g r    ry   )r$   rz   r{   s      r   r"   NoMatch.__init__   s    ,"4r   N)rz   zset[str]r{   rT   r.   r/   )r   r   r   r   r8   r"   r   r   r   r   rw   rw      s    8I5r   rw   )
__future__r   rQ   typingt
exceptionsr   r   utilsr   r   TYPE_CHECKING_typeshed.wsgir	   wrappers.requestr
   wrappers.responser   r^   r   rulesr   	Exceptionr   r   r3   r:   LookupErrorrC   rt   rw   r   r   r   <module>r      s    "   # & # ??.*,y 1m%5 1*#" #!+ !F !; F R
 5i 5r   