
    %hW$                       S r SSKJr  SSKrSSKrSSKrSSKrSSKJ	r	  SSK
Jr  SSKJr  \" 5       r\R                   " S5      r\" \5      rSrS	rSS
 jr\4SS jjr " S S5      r\" 5       rSS jr S         SS jjr " S S5      rg)zObject representations for debugging purposes. Unlike the default
repr, these expose more information and produce HTML instead of ASCII.

Together with the CSS and JavaScript of the debugger this gives a
colorful and more compact output.
    )annotationsN)deque)format_exception_only)escapez(?:\r\n|\r|\n){2,}zL<div class=box>
  <h3>%(title)s</h3>
  <pre class=help>%(text)s</pre>
</div>zQ<div class=box>
  <h3>%(title)s</h3>
  %(repr)s
  <table>%(items)s</table>
</div>c                4    [        5       R                  U 5      $ )z1Creates a debug repr of an object as HTML string.)DebugReprGeneratorrepr)objs    K/var/www/auris/envauris/lib/python3.13/site-packages/werkzeug/debug/repr.py
debug_reprr   &   s    $$S))    c                    [        5       nU [        L a0  UR                  [        R                  " S5      R
                  5      nOUR                  U 5      n[        R                  R                  U5        g)z\Print the object details to stdout._write (for the interactive
console of the web debugger.
   N)	r   missingdump_localssys	_getframef_localsdump_objectstdout_write)r
   genrvs      r   dumpr   +   sP     
C
g~__S]]1-667__S!JJbr   c                  0    \ rS rSrSrSS jrSS	S jjrSrg)
_Helper7   zyDisplays an HTML version of the normal help, for the interactive
debugger only because it requires a patched sys.stdout.
c                    g)Nz(Type help(object) for help about object. selfs    r   __repr___Helper.__repr__<   s    9r   Nc                   Uc%  [         R                  R                  SU < S35        g SS KnUR	                  U5        [         R                  R                  5       n[        R                  U5      n[        U5      S:  a  US   nSR                  USS  5      nOSnUS   n[         R                  R                  [        XVS.-  5        g )Nz<span class=help></span>r   r   z

Help)titletext)r   r   r   pydochelpreset_paragraph_resplitlenjoin	HELP_HTML)r!   topicr)   r   
paragraphsr'   r(   s          r   __call___Helper.__call__?   s    =JJ 1$AB

5ZZ"((,
z?QqME;;z!"~.DEa=D

)&DDEr   r   returnstrN)r1   zt.Any | Noner6   None)__name__
__module____qualname____firstlineno____doc__r"   r3   __static_attributes__r   r   r   r   r   7   s    :F Fr   r   c                *   [        U[        5      (       a  U H  n[        U5      UL d  M  U s  $    O[        U5      UL a  U $ SnUR                  R                  S;  a  SUR                  R                   S3nU [        U5      R
                   SU  S3$ )N )__builtin__
exceptionsz<span class="module">z.</span>())
isinstancetupletype	__class__r;   r:   )innerr
   baseclsmodules        r   _add_subclass_inforN   T   s    $CCyC  
cd	F
}}'DD()A)A(B(KXd3i(()5'33r   c                $   ^ ^^^ SUU UU4S jjnU$ )Nc                  > U(       a  [        T ST
 3UT5      $ T/nSn[        U5       HV  u  pVU(       a  UR                  S5        UT	:X  a  UR                  S5        SnUR                  U R                  U5      5        MX     U(       a  UR                  S5        UR                  T
5        [        SR	                  U5      UT5      $ )Nz...F, <span class="extended">Tr%   rA   )rN   	enumerateappendr	   r/   )r!   r
   	recursivebufhave_extended_sectionidxitemrK   leftlimitrights          r   proxy#_sequence_repr_maker.<locals>.proxyd   s    %c%&93EEf %"3IC

4 e|

45(,%JJtyy' ( !JJy!

5!"''#,T::r   )r!   r   r
   zt.Iterable[t.Any]rU   boolr6   r7   r   )rZ   r\   rK   r[   r]   s   ```` r   _sequence_repr_makerr`   a   s    ; ;" Lr   c                     \ rS rSrSS jr\" SS\5      r\" SS\5      r	\" SS\
5      r\" S	S\5      r\" S
S\5      rSS jrSSS jjr S       SS jjrSS jrSS jrSS jrS S jrS S jrS!S jr S"       S#S jjrSrg)$r   x   c                    / U l         g r8   _stackr    s    r   __init__DebugReprGenerator.__init__y   s	    #%r   []rD   rE   zset([z])zfrozenset([z/<span class="module">collections.</span>deque([c                r    [        UR                  5      n[        R                  " USS5      nSU 3nSU S3$ )Nzunicode-escapeignorerz&re.compile(<span class="string regex">z</span>))r	   patterncodecsdecode)r!   r
   rm   s      r   
regex_reprDebugReprGenerator.regex_repr   s=    s{{#--)98DgY-7yIIr   c           	     z   S/n[        U5      n[        U5      U-
  S:  a-  UR                  [        US U 5      S[        XBS  5      S45        OUR	                  [        U5      5        UR	                  S5        SR                  U5      nUS   S;   d  US   S:X  a  US	   S;   a  [        XQ[        [        45      $ U$ )
Nz<span class="string">   rR   r%   rA   r   z'"br   )	r	   r.   extendr   rT   r/   rN   bytesr7   )r!   r
   r[   rV   rl   outs         r   string_reprDebugReprGenerator.string_repr   s    &'I q6E>AJJ1Ve9%-1V9%	 JJvay!

9ggcl Q45=QqTS[QqTU]%c== 
r   c           	        U(       a  [        SU[        5      $ S/nSn[        UR                  5       5       Hq  u  nu  pxU(       a  UR	                  S5        XcS-
  :X  a  UR	                  S5        SnUR	                  SU R                  U5       S	U R                  U5       S
35        Ms     U(       a  UR	                  S5        UR	                  S5        [        SR                  U5      U[        5      $ )Nz{...}{FrQ   r   rR   Tz%<span class="pair"><span class="key">z</span>: <span class="value">z</span></span>r%   }rA   )rN   dictrS   itemsrT   r	   r/   )	r!   drU   r[   rV   rW   rX   keyvalues	            r   	dict_reprDebugReprGenerator.dict_repr   s     %gq$77e %!*1779!5C#

4 ai

45(,%JJ7		#7G H((,		%(8'9I "6 !JJy!

3!"''#,488r   c                6    [        U5      nS[        U5       S3$ )Nz<span class="object">r%   )r	   r   )r!   r
   rl   s      r   object_reprDebugReprGenerator.object_repr   s    I&vayk99r   c                $   U[         L a  S[         < S3$ [        U[        [        [        45      (       a  SU< S3$ [        U[
        5      (       d  [        U[        5      (       a  U R                  U5      $ [        U[        5      (       a  U R                  U5      $ [        U[        5      (       a  U R                  X5      $ [        U[        5      (       a  U R                  X5      $ [        U[        5      (       a  U R                  X5      $ [        U[         5      (       a  U R#                  X5      $ [        U[$        5      (       a  U R'                  X5      $ [        U[(        5      (       a  U R+                  X5      $ U R-                  U5      $ )Nz<span class="help">r%   z<span class="number">)helperrF   intfloatcomplexr7   rv   rx   	RegexTyperp   list	list_reprrG   
tuple_reprsetset_repr	frozensetfrozenset_reprr}   r   r   
deque_reprr   )r!   r
   rU   s      r   dispatch_repr DebugReprGenerator.dispatch_repr   s<   &=(
'::cC011*3'99c3:c5#9#9##C((c9%%??3''c4  >>#11c5!!??322c3==00c9%%&&s66c4  >>#11c5!!??322$$r   c                     SR                  [        [        R                  " 5       S S 6 5      nS[        UR                  5       5       S3$ ! [         a    Sn N+f = f)NrA   rs   ?z*<span class="brokenrepr">&lt;broken repr (z)&gt;</span>)r/   r   r   exc_info	Exceptionr   strip)r!   infos     r   fallback_repr DebugReprGenerator.fallback_repr   sa    	770#,,.!2DEFD  &tzz| 45\C	
  	D	s   -A AAc                ~   SnU R                    H  nX1L d  M	  Sn  O   U R                   R                  U5          U R                  X5      U R                   R                  5         $ ! [         a-    U R                  5       s U R                   R                  5         $ f = f! U R                   R                  5         f = f)NFT)re   rT   r   popr   r   )r!   r
   rU   rY   s       r   r	   DebugReprGenerator.repr   s    	KKD{ 	   	3	,))#9 KKOO  ,))++KKOO, KKOOs#   A& &B B  BB   B<c           
        S nS n[        U[        5      (       aW  Sn/ nUR                  5        H?  u  pV[        U[        5      (       d  S n  O%UR	                  XPR                  U5      45        MA     UcR  / nU R                  U5      n[        U5       H.  n UR	                  XPR                  [        X5      5      45        M0     SnWS[        R                  U5      SS  3-  nU R                  X4U5      $ ! [         a     Mq  f = f)NzContents ofzDetails for r   )rF   r}   r~   r7   rT   r	   dirgetattrr   objectr"   render_object_dump)r!   r
   r	   r~   r'   r   r   s          r   r   DebugReprGenerator.dump_object   s    .2c4  !EE!iik
!#s++ Ec99U#345	 *
 =E99S>D3xLL#yy1B'C!DE  
 "E1V__S)!B/011&&uT::	 ! s   *C66
DDc                    UR                  5        VVs/ s H  u  p#X R                  U5      4PM     nnnU R                  US5      $ s  snnf )NzLocal variables in frame)r~   r	   r   )r!   r   r   r   r~   s        r   r   DebugReprGenerator.dump_locals
  sD    ;<779E9ZS#yy'(9E&&u.HII Fs   ANc                    / nU H&  u  pVUR                  S[        U5       SU S35        M(     U(       d  UR                  S5        [        [        U5      SU(       a  UOS S3SR                  U5      S.-  $ )	Nz<tr><th>z<td><pre class=repr>z</pre>z<tr><td><em>Nothing</em>z<pre class=repr>rA   
)r'   r	   r~   )rT   r   OBJECT_DUMP_HTMLr/   )r!   r~   r'   r	   
html_itemsr   r   s          r   r   %DebugReprGenerator.render_object_dump  s     
JC5I%PVWX  89E]&tt&<FCYYz*#
 
 	
r   rd   )r6   r9   )r
   zt.Pattern[t.AnyStr]r6   r7   )F   )r
   zstr | bytesr[   r   r6   r7   )   )r   z7dict[int, None] | dict[str, int] | dict[str | int, int]rU   r_   r[   r   r6   r7   )r
   t.Anyr6   r7   )r
   r   rU   r_   r6   r7   r5   r
   r   r6   r7   )r   zdict[str, t.Any]r6   r7   r8   )r~   zlist[tuple[str, str]]r'   r7   r	   z
str | Noner6   r7   )r:   r;   r<   r=   rf   r`   r   r   rG   r   r   r   r   r   r   r   rp   rx   r   r   r   r   r	   r   r   r   r?   r   r   r   r   r   x   s    & %S#t4I%c36J#GT37H)-yIN%94JJ> 	9B9 9 	9
 
92:%.
;0J
 LP
*
36
>H
	
 
r   r   r   )r
   r   r6   r9   )rJ   r7   r
   r   rK   ztype | tuple[type, ...]r6   r7   )   )
rZ   r7   r\   r7   rK   rH   r[   r   r6   z>t.Callable[[DebugReprGenerator, t.Iterable[t.Any], bool], str])r>   
__future__r   rn   rer   typingtcollectionsr   	tracebackr   
markupsafer   r   r   compiler,   rH   r   r0   r   r   r   r   r   rN   r`   r   r   r   r   <module>r      s    #  	 
   + 
(

01		 *
  	F F4 

4 56
!%.1C.b
 b
r   