+
     i!  c                  s   ^ RI Ht ^ RIt^ RIHt ^ RIHt ^RIHtH	t	H
t
 ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt RRRRRRRRRRRR R!RR"RR#R$/	tR R lt ! R R]	P                  4      tR R ltR R lt]P8                  ! ]P:                  ]]4       ]P<                  ! ]P:                  R4       ]P>                  ! ]P:                  R4       R# )%    )annotationsN)cached_property)IO)Image	ImageFileImagePalette)i8)i16be)i32be)si16be)si32be)DeferredErrorc                    V ^8  d   QhRRRR/# )   prefixbytesreturnbool format   "9/usr/lib64/python3.14/site-packages/PIL/PsdImagePlugin.py__annotate__r   2   s     & &E &d &    c                s$    V P                  R 4      # )s   8BPS)Z
startswith)r      &r   _acceptr   2   s    W%%r   c                  s    ] tR t^:tRtRtRtR R lt]R R l4       t	]
R R	 l4       t]
R
 R l4       tR R ltR R ltRtR# )PsdImageFileZPSDzAdobe PhotoshopFc                   V ^8  d   QhRR/# )r   r   Noner   r   r   r   r   PsdImageFile.__annotate__?   s     Q Qt Qr   c                	sD   V P                   P                  pV! ^4      p\        V4      '       d   \        V^4      ^8w  d   Rp\	        V4      h\        V^4      p\        V^4      p\        V^4      p\
        Wd3,          w  rxW8  d   Rp\        V4      hVR8X  d   V^8X  d   Rp^pWpn        \        V^4      \        V^4      3V n	        \        V! ^4      4      p	V	'       d3   V! V	4      p
VR8X  d$   V	R8X  d   \        P                  ! RV
4      V n        . V n        \        V! ^4      4      p	V	'       d   V P                   P                  4       V	,           pV P                   P                  4       V8  d   V! ^4       \        V! ^4      4      pV! \        V! ^4      4      4      p\!        V4      ^,          '       g	   V! ^4       V! \        V! ^4      4      4      p
\!        V
4      ^,          '       d	   V! ^4       V P                  P#                  WV
34       VR8X  g   K  WP$                  R	&   K  R
V n        \        V! ^4      4      p	V	'       d{   V P                   P                  4       V	,           p\        V! ^4      4      p	V	'       d&   V P                   P                  4       V n        Wn        V P                   P+                  V4       R
V n        \/        V P                   VRV P0                  ,           V4      V n        V P                   V n        ^V n        ^V n        R
# )i   znot a PSD fileznot enough channelsRGBRGBAPi   zRGB;Li  Zicc_profileN)r    r    )fpreadr   i16SyntaxErrorMODESZOSError_modei32_sizer   rawpalette	resourcestellr   lenappendZinfo_layers_position_layers_sizeseek	_n_frames	_maketilesizetile_fpframe
_min_frame)selfr$   ZsmsgZpsd_bitsZpsd_channelsZpsd_modemodechannelsr6   ZdataZendZidnames   &             r   _openZPsdImageFile._open?   sg   ww||
 HqzzSAY!^"Cc""q":1bzq":34"'C#,5=\Q.DH
BZQ+

 47|:Ds{ts{+//>
 47|'',,.4'C'',,.3&Qa\BtAwK(D	AGCQL)t9q==G%%r&67:/3IIm,
 !%47|'',,.4'CtAw<D(,%$(!GGLL%)
 dggtVdii-?J	 77
r   c               r   )r   r   Glist[tuple[str, str, tuple[int, int, int, int], list[ImageFile._Tile]]]r   r   r   r   r   r      s      	Pr   c                	s   . pV P                   e   \        V P                  \        4      '       d   V P                  P                  hV P                  P                  V P                   4       \        P                  ! \        P                  ! V P                  V P                  4      4      p\        W P                  4      p\        V4      V n        V# N)r1   
isinstancer8   r   exr3   ioZBytesIOr   
_safe_readr2   
_layerinfor/   r4   )r;   layersZ_layer_datas   &  r   rH   ZPsdImageFile.layers   s       ,$((M22hhkk!HHMM$//0**Y%9%9$((DDUDU%VWK->->?FVr   c               r   r   r   intr   r   r   r   r   r      s      # r   c                	sj    V P                   f   \        V P                  4      V n         V P                   # rB   )r4   r/   rH   r;   r   r   n_framesZPsdImageFile.n_frames   s&    >>! -DN~~r   c               r   )r   r   r   r   r   r   r   r   r      s     $ $T $r   c                	s2    \        V P                  4      ^8  # )   )r/   rH   rK   r   r   is_animatedZPsdImageFile.is_animated   s    4;;!##r   c               r   )r   layerrJ   r   r   r   r   r   r   r   r      s      # $ r   c                	s$   V P                  V4      '       g   R # \        V P                  \        4      '       d   V P                  P                  hV P
                  V^,
          ,          w  r#r$W0n        W@n        Wn        V P                  V n	        R # rB   )
Z_seek_checkrC   r8   r   rD   rH   r(   r7   r9   r#   )r;   rO   _r=   r7   s   &&   r   r3   ZPsdImageFile.seek   sh    &&dhh..((++  ;;uqy1
	
((r   c               r   rI   r   r   r   r   r   r      s      c r   c                	s    V P                   # rB   )r9   rK   r   r   r.   ZPsdImageFile.tell   s    zzr   )r8   r1   r2   r:   r(   r4   r*   r#   r9   r,   r-   r7   N)Z__name__Z
__module__Z__qualname__Z__firstlineno__r   Zformat_descriptionZ!_close_exclusive_fp_after_loadingr@   r   rH   ZpropertyrL   rN   r3   r.   Z__static_attributes__r   r   r   r   r   :   se    F*(-%Qf    
 $ $ r   r   c               s$    V ^8  d   QhRRRRRR/# )r   r#   	IO[bytes]ct_bytesrJ   r   rA   r   r   r   r   r   r      s)     X XX XLXr   c           	     s&  a  . pR  V 3R llp\        V! ^4      4      pV\        V4      ^,          8  d   Rp\        V4      h\        \        V4      4       EFR  p\	        V! ^4      4      p\	        V! ^4      4      p\	        V! ^4      4      p	\	        V! ^4      4      p
. p\        V! ^4      4      pV^8  db   S P                  V^,          ^,           \        P                  4       \        V! ^4      4      pS P                  V\        P                  4       K  \        V4       F@  p\        V! ^4      4      pVR8X  d   RpM	RV,          pVP                  V4       V! ^4       KB  	  VP                  4        VR.8X  d   RpMV. RO8X  d   RpMV. RO8X  d   RpMR	pV! ^4       R	p\        V! ^4      4      pV'       d   S P                  4       V,           p\        V! ^4      4      pV'       d(   S P                  V^,
          \        P                  4       \        V! ^4      4      pV'       d!   S P                  V\        P                  4       \        V! ^4      4      pV'       d   V! V4      P                  R
R4      pS P                  V4       VP                  VVWW334       EKU  	  . p\        V4       FS  w  pw  ppp. pV F,  p\!        S VV^4      pV'       g   K  VP#                  V4       K.  	  VP                  VVVV34       KU  	  V# )c               r   )r   r6   rJ   r   r   r   r   r   r   r   Z _layerinfo.<locals>.__annotate__   s     . .3 .5 .r   c                s2   < \         P                  ! SV 4      # rB   )r   rF   )r6   r#   s   &r   r$   Z_layerinfo.<locals>.read   s    ##B--r   z4Layer block too short for number of layers requestedi  Ar!   RLr     zlatin-1Zreplace)BGrT   )rS   rW   rX   rT   )si16Zabsr&   rangesi32r%   r3   rE   ZSEEK_CURr)   r0   Zsortr.   r   ZdecodeZ	enumerater5   Zextend)r#   rR   rH   r$   Zctr<   rP   Zy0Zx0Zy1Zx1ZbandsZct_typesr6   ZtypeZbr=   r?   Zdata_endZlengthZ	layerinfoibboxr7   ZmZts   f&                        r   rG   rG      s    F. . 
d1gB 3r7R< D#3r7^$q']$q']$q']$q'] tAw<a<GGHqL2%r{{3tAw<DGGD"++&xAtAw<Du}4LLLOG ! 	

SE>Do%D**DD 	R47|wwy4'Ha\FR[[1a\F,Q[F F|**9i@GGHtTBB#345y ~ I!*6!2D$A"aq)AqA  	$dD12 "3 r   c          
     s,    V ^8  d   QhRRRRRRRRR	R
/# )r   filerQ   r=   Zstrr]   ztuple[int, int, int, int]r>   rJ   r   zlist[ImageFile._Tile]r   r   r   r   r   r     s4     + +
++&?+KN++r   c           	     s8   . pV P                   p\        V! ^4      4      pV^,          V^ ,          ,
          pV^,          V^,          ,
          pV P                  4       p	V^ 8X  db   \        V4       FQ  p
W,          pVR8X  d
   VR,          pVP	                  \
        P                  ! RW)V4      4       WV,          ,           p	KS  	  MV^8X  d   ^ pV! W8,          ^,          4      pV P                  4       p	\        V4       Fo  p
W,          pVR8X  d
   VR,          pVP	                  \
        P                  ! RW)V4      4       \        V4       F  pV	\        W4      ,           p	V^,          pK   	  Kq  	  V P                  V	4       V	^,          '       d	   V! ^4       V# )r   CMYKz;Ir+   Zpackbits)r$   r%   r.   rZ   r0   r   Z_Tiler3   )r^   r=   r]   r>   Ztilesr$   ZcompressionZxsizeZysizeZoffsetZchannelrO   r\   Z	bytecountZys   &&&&           r   r5   r5     sW    E99Dd1g,KGd1gEGd1gEYY[Fa XGMEv~LLeDEem+F ' 
	 )A-.	XGMEv~LLT5IJ5\#i"33Q " ' 	IIfzzQLr   z.psdzimage/vnd.adobe.photoshop)r    rM   )Z1rM   )r       )rU   rM   )rM   r`   )r   r`   )r"   rM   )   r`   )r    ra   )   r`   )r_   rb   )i   r`   )r`   r`   )i	   r`   )ZLABra   ) Z
__future__r   rE   Z	functoolsr   Ztypingr   rV   r   r   r   Z_binaryr   r   r%   r	   r)   r
   rY   r   r[   Z_utilr   r'   r   r   rG   r5   Zregister_openr   Zregister_extensionZregister_mimer   r   r   <module>rc      s   $ # 	 %  , ,  ! ! # #   H
H
H
H
J
K
H
H
J	$&9&& DXv+d   L''w ?   ,,f 5   L'')D Er   