+
    <j.                        R 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	H
t
Ht ^ RIHt ^ RIHt ^ RIHtHtHtHt ^ RIHt ]P,                  ! ]4      t]],           t ^ RIt]],          t ^ RIt]],          tR	 R
 ltR R ltR R lt R R lt!R R lt"R R lt#R R lt$RR R llt%R R lt&R R lt'R R R llt(R#   ] d    ]P9                  R4        Lpi ; i  ] d    ]P9                  R4        Li ; i)!zUtilities related archives.N)IterableListOptional)ZipInfo)InstallationError)BZ2_EXTENSIONSTAR_EXTENSIONSXZ_EXTENSIONSZIP_EXTENSIONS)
ensure_dirzbz2 module is not availablezlzma module is not availablec                $    V ^8  d   QhR\         /#    returnint)formats   "R/opt/headortail/venv/lib/python3.14/site-packages/pip/_internal/utils/unpacking.py__annotate__r   +   s      s     c                 ^    \         P                  ! ^ 4      p \         P                  ! V 4       V # )zBGet the current umask which involves having to set it temporarily.)osumask)masks    r   current_umaskr   +   s    88A;DHHTNKr   c                F    V ^8  d   QhR\         R\        \         ,          /# )r   pathr   )strr   )r   s   "r   r   r   2   s     	 	C 	DI 	r   c                    V P                  R 4      P                  R4      p R V 9   dF   RV 9   d&   V P                  R 4      V P                  R4      8  g   RV 9  d   V P                  R ^4      # RV 9   d   V P                  R^4      # V R.# )/\ )lstripfindsplitr   s   &r   split_leading_dirr&   2   sz    ;;s""4(D
d{	$))C.499T?:t4?Ozz#q!!	zz$""bzr   c                F    V ^8  d   QhR\         \        ,          R\        /# )r   pathsr   )r   r   bool)r   s   "r   r   r   >   s      8C= T r   c                n    RpV  F,  p\        V4      w  r4V'       g    R# Vf   TpK#  W18w  g   K+   R# 	  R# )zuReturns true if all the paths have the same leading path name
(i.e., everything is in one subdirectory in an archive)NFT)r&   )r(   common_prefixr   prefixrests   &    r   has_leading_dirr.   >   s>     M(.""M$  r   c                <    V ^8  d   QhR\         R\         R\        /# )r   	directorytargetr   r   r)   )r   s   "r   r   r   M   s!     # #3 # # #r   c                    \         P                  P                  V 4      p\         P                  P                  V4      p\         P                  P                  W#.4      pWB8H  # )zD
Return true if the absolute path of target is within the directory
)r   r   abspathcommonprefix)r0   r1   abs_directory
abs_targetr,   s   &&   r   is_within_directoryr8   M   sH     GGOOI.M(JWW!!="=>F""r   c                $    V ^8  d   QhR\         /# r   r   )r   s   "r   r   r   X   s     , ,3 ,r   c                  4    R \        4       ( ,          ^I,          # )i  )r    r   r   !_get_default_mode_plus_executabler<   X   s    MO##e++r   c                (    V ^8  d   QhR\         RR/# )r   r   r   Nr   )r   s   "r   r   r   \   s     8 8S 8T 8r   c                D    \         P                  ! V \        4       4       R# )zl
Make file present at path have execute for user/group/world
(chmod +x) is no-op on windows per python docs
N)r   chmodr<   r%   s   &r   2set_extracted_file_to_default_mode_plus_executablerA   \   s    
 HHT467r   c                0    V ^8  d   QhR\         R\        /# )r   infor   )r   r)   )r   s   "r   r   r   d   s     > > >T >r   c                     V P                   ^,	          p\        T;'       d(    \        P                  ! V4      ;'       d
    V^I,          4      # )   )external_attrr)   statS_ISREG)rC   modes   & r   zip_item_is_executablerJ   d   s<    #D <<d+<<u==r   c                @    V ^8  d   QhR\         R\         R\        RR/# )r   filenamelocationflattenr   Nr2   )r   s   "r   r   r   k   s(     + + + +d +d +r   c                N   \        V4       \        V R4      p \        P                  ! VRR7      p\	        VP                  4       4      ;'       d    TpVP                  4        EFR  pVP                  pTpV'       d   \        V4      ^,          p\        P                  P                  W4      p\        P                  P                  V4      p	\        W4      '       g   Rp
\        V
P                  WV4      4      hVP!                  R4      '       g   VP!                  R4      '       d   \        V4       K  \        V	4       VP                  V4      p \        VR4      ;_uu_ 4       p\"        P$                  ! W4       RRR4       VP'                  4        \)        V4      '       d   \+        V4       EKR  EKU  	  VP'                  4        R#   + '       g   i     LV; i  TP'                  4        \)        T4      '       d   \+        T4       i i ; i  TP'                  4        i ; i)	a  
Unzip the file (with path `filename`) to the destination `location`.  All
files are written based on system defaults and umask (i.e. permissions are
not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied after being
written. Note that for windows, any execute changes using os.chmod are
no-ops per the python docs.
rbT)
allowZip64zQThe zip file ({}) has a file ({}) trying to install outside target directory ({})r   r    wbN)r   openzipfileZipFiler.   namelistinfolistrL   r&   r   r   joindirnamer8   r   r   endswithshutilcopyfileobjcloserJ   rA   )rL   rM   rN   zipfpzipleadingrC   namefndirmessagefpdestfps   &&&          r   
unzip_filerg   k   s    x4 E ooe5!#,,.1==gLLND==DB&t,Q/h+B''//"%C&x444  (xX(NOO{{32;;t#4#423 XXd^Ob$6**26 ( HHJ-d33J2N 45 #: 	 ( HHJ-d33J2N 4 	sH   C9H H *)H G (G?G 4H GG  /HH H$c                4    V ^8  d   QhR\         R\         RR/# )r   rL   rM   r   Nr>   )r   s   "r   r   r      s&     ] ] ] ] ]r   c                |  a aaa \        S4       S P                  4       P                  R4      '       g&   S P                  4       P                  R4      '       d   RpMS P                  4       P                  \        4      '       d   RpMlS P                  4       P                  \        4      '       d   RpM@S P                  4       P                  R4      '       d   RpM\
        P                  RS 4       R	p\        P                  ! S VR
R7      p \        VP                  4        Uu. uF  qDP                  NK  	  up4      p \        P                  o\        4       oV'       dr   VP                  4        F]  p\        VP                  4      w  rgWtn        VP                  4       '       g   K8  \        VP                   4      w  rW8X  g   KW  Wn        K_  	  R VVV V3R llp
VP#                  SV
R7       VP)                  4        R# u upi   \$         d    \'        S SY54        L1i ; i  TP)                  4        i ; i)a  
Untar the file (with path `filename`) to the destination `location`.
All files are written based on system defaults and umask (i.e. permissions
are not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied on top of the
default.  Note that for windows, any execute changes using os.chmod are
no-ops per the python docs.
z.gzz.tgzzr:gzzr:bz2zr:xzz.tarrz-Cannot determine compression type for file %szr:*zutf-8)encodingc                d    V ^8  d   QhR\         P                  R\        R\         P                  /# )r   memberr   r   )tarfileTarInfor   )r   s   "r   r    untar_file.<locals>.__annotate__   s)     % %7?? %# %'// %r   c                   < V P                   p  S! V S4      p T P                  4       '       d   T^I,          '       d
   ST n         T # RT n         T #   \        P                   d8    \        P                  R ,          R9   d   \        P
                  ! T S4      p  Lh i ; i  \        P                   d#   pRp\        TP                  ST4      4      hRp?ii ; i):N   Nz%Invalid member in the tar file {}: {}N>   rr   	      rr   
      rr         )
rI   rn   LinkOutsideDestinationErrorsysversion_info
tar_filterTarErrorr   r   isfile)	rm   r   	orig_modeexcrd   data_filterdefault_mode_plus_executablerL   rM   s	   &&   r   
pip_filteruntar_file.<locals>.pip_filter   s    "KK	"!,VX!>2 ==??y5'8'8">FK  #'FKA #>> "++B/ 4  &-%7%7%IF!" '' 	EG ,$ 		s0   	A ABB BB C4CC)filterN)r   lowerrZ   r   r	   loggerwarningrn   rS   r.   
getmembersra   r   r<   r&   islnklinkname
extractallAttributeError_untar_without_filterr]   )rL   rM   rI   tarrm   r`   	name_lead	name_restlnk_leadlnk_restr   r   r   s   ff         @@r   
untar_filer      s    x~~  ''8>>+;+D+DV+L+L			"	">	2	2			"	"=	1	1			"	"6	*	*;	
 
,,x
8CC!S^^=M"N=M6;;=M"NO
:	8!--K ,M+N( "nn.F+<V[[+I(I"+K||~~->v-O*#0.6O /% %N NN8JN7 			E #O  	D!(HcC	Dv 			sO   H) &H:H) H AH) ,H) )H) H) H&#H) %H&&H) )H;c          
      `    V ^8  d   QhR\         R\         R\        P                  R\        RR/# )r   rL   rM   r   r`   r   N)r   rn   TarFiler)   )r   s   "r   r   r      sE     7I 7I7I7I 
7I 	7I
 
7Ir   c                P   VP                  4        EF  pVP                  pV'       d   \        V4      ^,          p\        P                  P                  W4      p\        W4      '       g   Rp\        VP                  WV4      4      hVP                  4       '       d   \        V4       K  VP                  4       '       d    VP                  WF4       K   VP!                  V4      p	\        \        P                  P'                  T4      4       T	f   Q h\)        TR4      ;_uu_ 4       p
\*        P,                  ! Y4       RRR4       T	P/                  4        TP1                  YF4       TP2                  ^I,          '       g   EKt  \5        T4       EK  	  R#   \         d/   p\        P                  RT TP                  T4        Rp?EK  Rp?ii ; i  \"        \$        3 d/   p\        P                  RT TP                  T4        Rp?EK  Rp?ii ; i  + '       g   i     L; i)z/Fallback for Python without tarfile.data_filterzQThe tar file ({}) has a file ({}) trying to install outside target directory ({})z/In the tar file %s the member %s is invalid: %sNrR   )r   ra   r&   r   r   rX   r8   r   r   isdirr   issym_extract_member	Exceptionr   r   extractfileKeyErrorr   rY   rS   r[   r\   r]   utimerI   rA   )rL   rM   r   r`   rm   rb   r   rd   r   re   rf   s   &&&&       r   r   r      s    .."[["2&q)Bww||H)"8220  $GNN88$LMM<<>>t\\^^##F1__V, rwwt,->!>dD!!V""2. "HHJIIf#{{U""B4Ha #   	 EKK	 	 n- 	 EKK	 	 "!s<   FG)HG""GGH$"HHH%c                V    V ^8  d   QhR\         R\         R\        \         ,          RR/# )r   rL   rM   content_typer   N)r   r   )r   s   "r   r   r   3  s:     R RRR 3-R 
	Rr   c                 H   \         P                  P                  V 4      p VR 8X  gF   V P                  4       P	                  \
        4      '       g   \        P                  ! V 4      '       d$   \        WV P	                  R4      '       * R7       R# VR8X  g\   \        P                  ! V 4      '       g@   V P                  4       P	                  \        \        ,           \        ,           4      '       d   \        W4       R# \        P!                  RV VV4       \#        RV 24      h)zapplication/zipz.whl)rN   zapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz#Cannot determine archive format of N)r   r   realpathr   rZ   r
   rT   
is_zipfilerg   rn   
is_tarfiler   r   r	   r   r   criticalr   )rL   rM   r   s   &&&r   unpack_filer   3  s    
 ww)H))>>$$^44h''883D3DV3L/LM,,h''>>$$^n%D}%TUU8& 	+	
  "EhZ PQQr   )T)N))__doc__loggingr   r[   rG   r}   rn   rT   typingr   r   r   r   pip._internal.exceptionsr   pip._internal.utils.filetypesr   r   r	   r
   pip._internal.utils.miscr   	getLogger__name__r   SUPPORTED_EXTENSIONSbz2ImportErrordebuglzmar   r&   r.   r8   r<   rA   rJ   rg   r   r   r   r;   r   r   <module>r      s    !  	   
   + +  6  0			8	$ &6 0N*1M)
	#,8>+\]@7ItR Ri  0
LL./0  1
LL/01s$   #C 1C$ C! C!$C?>C?