
    h1                         S SK r S SKrS SKJr  S SKJrJr    S SKrSr
Sr  SS\\   S\S	\4S
 jjr " S S5      r " S S\5      r " S S\5      r " S S5      rg! \	 a    S SKr NMf = f! \	 a    Sr
 NYf = f)    N)Executor)OptionalcastTFi   encodingsuppress_deflate_headerreturnc                     U S:X  a  S[         R                  -   $ U(       a  [         R                  * $ [         R                  $ )Ngzip   )zlib	MAX_WBITS)r   r   s     K/var/www/html/env/lib/python3.13/site-packages/aiohttp/compression_utils.pyencoding_to_moder      s2     6DNN""5DNN?I4>>I    c                   >    \ rS rSrS\4S\S\\   S\\   4S jjrSr	g)ZlibBaseHandler   Nmodeexecutormax_sync_chunk_sizec                 (    Xl         X l        X0l        g N)_mode	_executor_max_sync_chunk_size)selfr   r   r   s       r   __init__ZlibBaseHandler.__init__   s     
!$7!r   )r   r   r   )
__name__
__module____qualname____firstlineno__MAX_SYNC_CHUNK_SIZEintr   r   r   __static_attributes__ r   r   r   r      s9     (,-@	88 8$8 &c]	8 8r   r   c                      ^  \ rS rSrSSSS\R
                  S\4S\\   S\	S\\
   S\\
   S\
S	\\   S
\\
   4U 4S jjjrS\S\4S jrS\S\4S jr\R                   4S\
S\4S jjrSrU =r$ )ZLibCompressor)   NFr   r   levelwbitsstrategyr   r   c                   > [         TU ]  Uc  [        X5      OUUUS9  Uc%  [        R                  " U R
                  US9U l        O$[        R                  " U R
                  XSS9U l        [        R                  " 5       U l	        g )Nr   r   r   )r+   r,   )r+   r,   r*   )
superr   r   r   compressobjr   _compressorasyncioLock_compress_lock)	r   r   r   r*   r+   r,   r   r   	__class__s	           r   r   ZLibCompressor.__init__*   s}     	 = !C 3 	 	
 =#//djj8TD#//jj8 D &llnr   datar   c                 8    U R                   R                  U5      $ r   )r1   compressr   r7   s     r   compress_syncZLibCompressor.compress_syncE   s    ((..r   c                   #    U R                    ISh  vN   U R                  bv  [        U5      U R                  :  a]  [        R                  " 5       R                  U R                  U R                  R                  U5      I Sh  vN sSSS5      ISh  vN   $ U R                  U5      sSSS5      ISh  vN   $  N N9 N+ N! , ISh  vN  (       d  f       g= f7f)a  Compress the data and returned the compressed bytes.

Note that flush() must be called after the last call to compress()

If the data size is large than the max_sync_chunk_size, the compression
will be done in the executor. Otherwise, the compression will be done
in the event loop.
N)
r4   r   lenr2   get_running_looprun_in_executorr   r1   r9   r;   r:   s     r   r9   ZLibCompressor.compressH   s      &&& ))5I 9 99$557GGNND$4$4$=$=t  '&& %%d+ '&& '&&&su   CB=CA.CB?C	CCCC+C7C8C?CCCCCCCr   c                 8    U R                   R                  U5      $ r   )r1   flush)r   r   s     r   rC   ZLibCompressor.flush_   s    %%d++r   )r4   r1   )r   r    r!   r"   r   Z_DEFAULT_STRATEGYr#   r   strboolr$   r   r   bytesr;   r9   Z_FINISHrC   r%   __classcell__r5   s   @r   r(   r(   )   s     #'(-##//'+-@-3-- "&- }	-
 }- - 8$- &c]- -6/% /E /,5 ,U ,. !% ,# ,% , ,r   r(   c            
          ^  \ rS rSrSSS\4S\\   S\S\\   S\\	   4U 4S jjjr
SS	\S
\	S\4S jjrSS	\S
\	S\4S jjrSS\	S\4S jjr\S\4S j5       r\S\4S j5       r\S\4S j5       rSrU =r$ )ZLibDecompressorc   NFr   r   r   r   c                 |   > [         TU ]  [        X5      UUS9  [        R                  " U R
                  S9U l        g )Nr.   )r+   )r/   r   r   r   decompressobjr   _decompressor)r   r   r   r   r   r5   s        r   r   ZLibDecompressor.__init__d   s>     	!(D 3 	 	

 "//djjAr   r7   
max_lengthr   c                 8    U R                   R                  X5      $ r   )rQ   
decompressr   r7   rS   s      r   decompress_sync ZLibDecompressor.decompress_syncr   s    !!,,T>>r   c                   #    U R                   be  [        U5      U R                   :  aL  [        R                  " 5       R	                  U R
                  U R                  R                  X5      I Sh  vN $ U R                  X5      $  N7f)zDecompress the data and return the decompressed bytes.

If the data size is large than the max_sync_chunk_size, the decompression
will be done in the executor. Otherwise, the decompression will be done
in the event loop.
N)	r   r>   r2   r?   r@   r   rQ   rU   rW   rV   s      r   rU   ZLibDecompressor.decompressu   su      %%1D	D555 113CC 2 2 = =t   ##D55s   A.B0B1Blengthc                 x    US:  a  U R                   R                  U5      $ U R                   R                  5       $ )Nr   )rQ   rC   )r   r[   s     r   rC   ZLibDecompressor.flush   s?     z $$V,	
 ##))+	
r   c                 .    U R                   R                  $ r   )rQ   eofr   s    r   r_   ZLibDecompressor.eof   s    !!%%%r   c                 .    U R                   R                  $ r   )rQ   unconsumed_tailr`   s    r   rc    ZLibDecompressor.unconsumed_tail   s    !!111r   c                 .    U R                   R                  $ r   )rQ   unused_datar`   s    r   rf   ZLibDecompressor.unused_data   s    !!---r   )rQ   )r   )r   r    r!   r"   r#   r   rF   rG   r   r$   r   rH   rW   rU   rC   propertyr_   rc   rf   r%   rJ   rK   s   @r   rM   rM   c   s     #'(-'+-@B3-B "&B 8$	B
 &c]B B?E ?s ?5 ?6U 6 6E 6 
C 
 
 &T & & 2 2 2 .U . .r   rM   c                   >    \ rS rSrS	S jrS\S\4S jrS\4S jrSrg)
BrotliDecompressor   r   Nc                 d    [         (       d  [        S5      e[        R                  " 5       U l        g )NzIThe brotli decompression is not available. Please install `Brotli` module)
HAS_BROTLIRuntimeErrorbrotliDecompressor_objr`   s    r   r   BrotliDecompressor.__init__   s+    z1  '')	r   r7   c                     [        U R                  S5      (       a)  [        [        U R                  R	                  U5      5      $ [        [        U R                  R                  U5      5      $ )NrU   )hasattrrq   r   rH   rU   processr:   s     r   rW   "BrotliDecompressor.decompress_sync   sK    499l++tyy33D9::E499,,T233r   c                     [        U R                  S5      (       a(  [        [        U R                  R	                  5       5      $ g)NrC   r   )rt   rq   r   rH   rC   r`   s    r   rC   BrotliDecompressor.flush   s.    499g&&tyy011r   )rq   )r   N)	r   r    r!   r"   r   rH   rW   rC   r%   r&   r   r   rj   rj      s&    *4E 4e 4
u r   rj   )NF)r2   r   concurrent.futuresr   typingr   r   
brotlicffiro   ImportErrorrm   r#   rF   rG   r$   r   r   r(   rM   rj   r&   r   r   <module>r}      s      ' !# J   #$)JsmJ!J 	J	8 	87,_ 7,t3. 3.l a    Js.   A A. 
A+(A. *A++A. .A98A9