+
    ic  c                  s*   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^RIHt ^RIHt R t ! R R]P"                  4      t ! R	 R
]P"                  4      t ! R R]P(                  4      t ! R R]P"                  4      tR tR# )    )annotationsN)Iterator)abc)onlyc                sR    \        \        P                  P                  V 4      4      # N)ZitercollectionsZOrderedDictZfromkeys)Zitems   &4/usr/lib64/python3.14/importlib/resources/readers.pyremove_duplicatesr	      s    ''00788    c                  s(    ] tR t^tR tR tR tRtR# )
FileReaderc                	sd    \         P                  ! VP                  4      P                  V n        R # r   )pathlibPathpathZparent)selfloader   &&r   __init__ZFileReader.__init__   s    LL-44	r
   c                J    \        V P                  P                  V4      4      # z[
Return the file system path to prevent
`resources.path()` from creating a temporary
copy.
strr   joinpathr   resourcer   r   resource_pathZFileReader.resource_path        499%%h/00r
   c                	    V P                   # r   r   r   r   r   filesZFileReader.files"       yyr
   r   N)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__ r
   r   r   r      s    51r
   r   c                  s:   a  ] tR t^&tR tV 3R ltR tR tRtV ;t	# )	ZipReaderc                	s    VP                   P                  R R4      V n         VP                  V4      '       d5   VP                  R4      w   r4V ;P                   VR,           ,          un         VP                  V n        R# )\/Z.N)prefixreplaceZ
is_packageZ
rpartitionarchive)r   r   ZmoduleZ_names   &&&  r   r   ZZipReader.__init__'   s\    mm++D#6V$$**3/JAqKK4#:%K~~r
   c                	s   <  \         SV `  V4      #   \         d"   p\        TP                  ^ ,          4      hRp?ii ; i)r    N)superopen_resourceZKeyErrorFileNotFoundErrorargs)r   r   Zexc	__class__s   && r   r/   ZZipReader.open_resource.   s;    	17(22 	1#CHHQK00	1s    >9>c                s    V P                  4       P                  V4      pVP                  4       ;'       d    VP                  4       # )zN
Workaround for `zipfile.Path.is_file` returning true
for non-existent paths.
)r   r   is_fileZexists)r   r   Ztarget   && r   is_resourceZZipReader.is_resource4   s5    
 &&t,~~33FMMO3r
   c                	sX    \         P                  ! V P                  V P                  4      # r   )zipfiler   r,   r*   r   r   r   r   ZZipReader.files<   s    ||DLL$++66r
   )r,   r*   )
r!   r"   r#   r$   r   r/   r5   r   r%   __classcell__r2      @r   r'   r'   &   s    &147 7r
   r'   c                  s|   a  ] tR t^@tRtR tR tR tR tR t	R t
V 3R lt]R	 4       tR
 t]R 4       tR tRtV ;t# )MultiplexedPathz
Given a series of Traversable objects, implement a merged
version of the interface across all objects. Useful for
namespace packages which may be multihomed at a single
name.
c                	sD   \        \        \        \        V4      4      4      V n        V P                  '       g   R p\        V4      h\        ;QJ d&    R V P                   4       F  '       d   K   RM	  RM! R V P                   4       4      '       g   \        R4      hR# )z.MultiplexedPath must contain at least one pathc              3  s@   "   T F  qP                  4       x  K  	  R # 5ir   is_dir.0r      & r   	<genexpr>Z+MultiplexedPath.__init__.<locals>.<genexpr>M   s     9[T;;==[s   FTz)MultiplexedPath only supports directoriesN)listmap_ensure_traversabler	   _pathsr0   ZallNotADirectoryError)r   pathsZmessages   &* r   r   ZMultiplexedPath.__init__H   so    324Ee4LMN{{{FG#G,,s9T[[9sss9T[[999$%PQQ :r
   c                	s    R  V P                    4       p\        P                  ! R4      p\        P                  ! \        WR7      VR7      p\        V P                  R V 4       4      # )c              3  sP   "   T F  qP                  4        F  q"x  K  	  K  	  R # 5ir   )iterdir)r>   r   Zchild   &  r   r@   *MultiplexedPath.iterdir.<locals>.<genexpr>Q   s     Nkd||~eE~Eks   $&r-   )Zkeyc              3  s*   "   T F	  w  rVx  K  	  R # 5ir   r&   )r>   r-   ZlocsrH   r   r@   rI   T   s     !@:4$s   )rD   operatorZ
attrgetter	itertoolsZgroupbyZsortedrB   _follow)r   childrenZby_nameZgroupss   &   r   rG   ZMultiplexedPath.iterdirP   sN    NdkkN%%f-""6(#@gN4<<!@!@AAr
   c                	    \        V  R 24      hz is not a filer0   r   r   r   
read_bytesZMultiplexedPath.read_bytesV       4& 788r
   c                	rN   rO   rP   r   r1   Zkwargs   &*,r   	read_textZMultiplexedPath.read_textY   rR   r
   c                	    R # )Tr&   r   r   r   r<   ZMultiplexedPath.is_dir\   s    r
   c                	rV   )Fr&   r   r   r   r3   ZMultiplexedPath.is_file_   s    r
   c                	s   <  \         SV `  ! V!  #   \        P                   d%    T P                  ^ ,          P                  ! T!  u # i ; ir    )r.   r   r   ZTraversalErrorrD   )r   Zdescendantsr2   s   &*r   r   ZMultiplexedPath.joinpathb   sH    	97#[11!! 	9 ;;q>**K88	9s    6A
	A
c                s    \         P                  ! V^4      w  r#p \        V4      #   \         d)     T ! T!  u #   \         d    \        T4      u u # i ; ii ; i)z
Construct a MultiplexedPath if needed.

If children contains a sole element, return it.
Otherwise, return a MultiplexedPath of the items.
Unless one of the items is not a Directory, then return the first.
)rK   Zteer   
ValueErrorrE   next)clsrM   ZsubdirsZone_dirZone_files   &&   r   rL   ZMultiplexedPath._followj   s_     &/]]8Q%?"(	&=  	&&G}$% &H~%&	&s)   
' A;AAAAAc                	rN   rO   rP   rS   rT   r   openZMultiplexedPath.open}   rR   r
   c                	s<    V P                   ^ ,          P                  # rW   )rD   r-   r   r   r   r-   ZMultiplexedPath.name   s    {{1~"""r
   c                	sR    R P                  R V P                   4       4      pRV R2# )z, c              3  s.   "   T F  pR V R 2x  K  	  R# 5i)Z'Nr&   r=   r?   r   r@   Z+MultiplexedPath.__repr__.<locals>.<genexpr>   s     >+$AdV1++s   zMultiplexedPath(Z))ZjoinrD   )r   rF   r?   r   __repr__ZMultiplexedPath.__repr__   s)    		>$++>>!%**r
   )rD   )r!   r"   r#   r$   Z__doc__r   rG   rQ   rU   r<   r3   r   classmethodrL   r[   Zpropertyr-   r\   r%   r7   r8   r9   r   r:   r:   @   sd    RB999 & &$9 # #+ +r
   r:   c                  sj    ] tR t^tR t]R R l4       t]R R l4       t]R R l4       t	R t
R	 tR
tR# )NamespaceReaderc           	     	s    R \        V4      9  d   \        R4      h\        \        \        \        V P                  V4      4      !  V n        R# )ZNamespacePathzInvalid pathN)r   rX   r:   ZfilterZboolrB   _resolver   )r   Znamespace_pathr   r   r   ZNamespaceReader.__init__   s8    #n"55^,,#VD#dmm^2T%UV	r
   c                   V ^8  d   QhRR/# )   returnzabc.Traversable | Noner&   Zformat   "r   __annotate__NamespaceReader.__annotate__   s        #9  r
   c                sJ    R V P                  V4       4       p\        VR4      # )a  
Given an item from a namespace path, resolve it to a Traversable.

path_str might be a directory on the filesystem or a path to a
zipfile plus the path within the zipfile, e.g. ``/foo/bar`` or
``/foo/baz.zip/inner_dir`` or ``foo\baz.zip\inner_dir\sub``.

path_str might also be a sentinel used by editable packages to
trigger other behaviors (see python/importlib_resources#311).
In that case, return None.
c              3  sT   "   T F  qP                  4       '       g   K  Vx  K   	  R # 5ir   r;   )r>   Zcandr?   r   r@   Z+NamespaceReader._resolve.<locals>.<genexpr>   s     Q!?;;=!?s   (
(N)_candidate_pathsrY   )rZ   path_strZdirsr4   r   r_   ZNamespaceReader._resolve   s'     R!5!5h!?QD$r
   c               s     V ^8  d   QhRRRR/# )ra   rh   r   rb   zIterator[abc.Traversable]r&   rc   rd   r   re   rf      s     3 3 30I 3r
   c              #  	st   "   \         P                  ! V4      x  V P                  V4       R j  xL
  R #  L5ir   )r   r   _resolve_zip_path)rZ   rh   r   r   rg   Z NamespaceReader._candidate_paths   s(     ll8$$((222s   -868c               r`   )ra   rh   r   r&   rc   rd   r   re   rf      s     	Q 	QC 	Qr
   c           	   #  	s  "   \        \        \        P                  ! R V 4      4      4       F  p\        P
                  ! \        \        \        \        4      ;_uu_ 4        WP                  4       R P                  RR4      R,           p\        P                  ! V RVP                  4        VP                  R4      4      x  RRR4       K  	  R#   + '       g   i     K  ; i5i)z[\\/]Nr(   r)   )ZreversedrA   reZfinditer
contextlibZsuppressr0   ZIsADirectoryErrorrE   ZPermissionErrorZendr+   r6   r   ZstartZlstrip)rh   ZmatchZinnerrH   r   ri   Z!NamespaceReader._resolve_zip_path   s     d2;;x#BCDE$$!!"	  !/77cBSHll8Oekkm#<ell3>OPP  E  s   AC% A#CC%C"	C%c                r   r   r   r   r   r   r   ZNamespaceReader.resource_path   r   r
   c                	r   r   r   r   r   r   r   ZNamespaceReader.files   r    r
   r   N)r!   r"   r#   r$   r   r]   r_   rg   Zstaticmethodri   r   r   r%   r&   r
   r   r^   r^      sP    W
     3 3 	Q 	Q1r
   r^   c                s    \        V \        4      '       g   V # \        P                  ! R\        ^R7       \
        P                  ! V 4      # )z_
Convert deprecated string arguments to traversables (pathlib.Path).

Remove with Python 3.15.
z<String arguments are deprecated. Pass a Traversable instead.)Z
stacklevel)Z
isinstancer   warningsZwarnZDeprecationWarningr   r   r   r   r   rC   rC      s<     dC  MMF <<r
   )Z
__future__r   r   rk   rK   r   rJ   rj   rl   r6   Zcollections.abcr   Z r   Z
_itertoolsr   r	   ZTraversableResourcesr   r'   ZTraversabler:   r^   rC   r&   r
   r   <module>rm      s}    "      	   $  9))  7(( 74F+coo F+R0c.. 0fr
   