+
    UBiO1                         R t ^ RIt^ RIt^ RIHtHtHt ^RIHt ^RI	H
t
 Rt Rt  ! R R]4      t ! R	 R
]
4      t]P                   ! R]4        ! R R]4      t]P                   ! R]4       R# )z
This module implements Git's wildmatch pattern matching which itself is derived
from Rsync's wildmatch. Git uses wildmatch for its ".gitignore" files.
N)AnyStrOptionalTuple)util)RegexPatternlatin1ps_dc                       ] tR t^tRtRtR# )GitWildMatchPatternErrorzT
The :class:`GitWildMatchPatternError` indicates an invalid git wild match
pattern.
 N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       C/usr/lib/python3.14/site-packages/pathspec/patterns/gitwildmatch.pyr
   r
      s     r   r
   c                   |   a  ] tR t^$t o RtRt]V 3R lR l4       t]V 3R lR l4       t	]V 3R lR l4       t
RtV tR	# )
GitWildMatchPatternzU
The :class:`GitWildMatchPattern` class represents a compiled Git wildmatch
pattern.
c                \   < V ^8  d   QhRS[ RS[S[S[ ,          S[S[,          3,          /#    patternreturn)r   r   r   bool)format__classdict__s   "r   __annotate__ GitWildMatchPattern.__annotate__.   s6     E EE HVhtn,-Er   c                @   \        V\        4      '       d   \        pMB\        V\        4      '       d   \        pVP                  \        4      pM\        RV: R24      hTpVP                  R4      '       d   VP                  4       pMVP                  4       pVP                  R4      '       d   RpRpEM VR8X  d   RpRpEMV'       Ed   VP                  R4      '       d   RpVR	,          pMR
pRpVP                  R4      pVR,          '       * p\        \        V4      ^,
          ^ R4       F.  p	Wy^,
          ,          p
Wy,          pV
R8X  g   K#  VR8X  g   K,  Wy K0  	  \        V4      ^8X  d(   V^ ,          R8X  d   V^,          '       g   R\         R2pV^ ,          '       g   V^  MQ\        V4      ^8X  g    \        V4      ^8X  d1   V^,          '       g"   V^ ,          R8w  d   VP                  ^ R4       M V'       g   \        RV: 24      hVR,          '       g   \        V4      ^8  d   RVR&   VEf   R.pRp\        V4      ^,
          p\!        V4       EFI  w  rVR8X  d   V	^ 8X  d   W8X  d   VP#                  R4       K-  V	^ 8X  d   VP#                  R4       RpKI  W8X  d7   V'       d   VP#                  R\         R24       Kr  VP#                  R4       K  VP#                  R4       R
pK  VR8X  dN   V'       d   VP#                  R4       VP#                  R4       W8X  d   VP#                  R\         R24       R
pK  V'       d   VP#                  R4        VP#                  V P%                  V4      4       Y8X  d   TP#                  R\         R24       R
pEKL  	  VP#                  R4       RP)                  V4      pMTpMRpRpVe    V\        J d   VP+                  \        4      pWE3#   \&         d   p\        RT: 24      ThRp?ii ; i)aq  
Convert the pattern into a regular expression.

*pattern* (:class:`str` or :class:`bytes`) is the pattern to convert into a
regular expression.

Returns the uncompiled regular expression (:class:`str`, :class:`bytes`, or
:data:`None`); and whether matched files should be included (:data:`True`),
excluded (:data:`False`), or if it is a null-operation (:data:`None`).
zpattern:! is not a unicode or byte string.z\ #N/!F:   NNTz**z^.+(?P<z>/).*$zInvalid git pattern: ^z[^/]+(?:/.*)?z(?:.+/)?z(?P<z>/).*z/.*z(?:/.+)?*z[^/]+z(?:(?P<z>/).*)?$ )
isinstancestrbytesdecode_BYTES_ENCODING	TypeErrorendswithlstripstrip
startswithsplitrangelen	_DIR_MARKinsertr
   	enumerateappend_translate_segment_glob
ValueErrorjoinencode)clsr   return_typeoriginal_patternregexincludeoverride_regexpattern_segsis_dir_patterniprevsegoutput
need_slashendes   &&              r   pattern_to_regex$GitWildMatchPattern.pattern_to_regex-   s    ;'5!!;^^O,7	Xg[(IJ	KKe ^^7]]_7 57#~ 57w GbkGG > --$< %R((> #l#a'B/q!D
/Ct|t		 0 
,1aD!8a yk0N
q// 	QLQ3|#4#9,q// A$D! 	
 #%:;K:N#O
PP
r

s<014
 LUFJ
l
a
CL)t	
aAH }}}&6 }}Z z8 YKu-.
 }}Z z
*	}}SmmG	
 }}wyk12j 
}}S[}}S0056 
 }}wyk12ju *x MM#GGFOE E
 57
;%/<<(5	7  [%(=>N=Q&RSYZZ[s   ' O==PPPc                &   < V ^8  d   QhRS[ RS[ /# r   )r,   )r   r   s   "r   r   r      s     l lc lc lr   c                R   RpRp^ \        V 4      rCW48  Edy   W,          pV^,          pV'       d"   RpV\        P                  ! V4      ,          pKA  VR8X  d   RpKL  VR8X  d   VR,          pK^  VR8X  d   VR,          pKp  VR	8X  d   TpWd8  d$   W,          R
8X  g   W,          R8X  d
   V^,          pWd8  d   W,          R8X  d
   V^,          pWd8  d   W,          R8w  d   V^,          pK  Wd8  dr   V^,          pR	pW,          R
8X  d   VR,          pV^,          pMW,          R8X  d   VR,          pV^,          pWpW6 P                  RR4      ,          pW',          pTpEKS  VR,          pEK_  V\        P                  ! V4      ,          pEK  V'       d   \	        RV : 24      hV# )a  
Translates the glob pattern to a regular expression. This is used in the
constructor to translate a path segment glob pattern to its corresponding
regular expression.

*pattern* (:class:`str`) is the glob pattern.

Returns the regular expression (:class:`str`).
Fr)   \Tr'   z[^/]*?z[^/][r$   r&   ]z\\z\[z9Escape character found with no next character to escape: )r7   reescapereplacer=   )r   rX   rC   rH   rM   charjexprs   &       r   r<   +GitWildMatchPattern._translate_segment_glob   s    &
%c'lS	
*461F	RYYt_EF 
WE 
VOE 	
A 	wGJ#%s):!VQ 	w7:$!VQ 'gjC'!VQw !VQT
c
ckd1fa
*
 ckd1fa 
Q\!!$//T ]U 
Q
 e^U 
RYYt_E	OPW{[	\\	,r   c                &   < V ^8  d   QhRS[ RS[ /# )r   sr   )r   )r   r   s   "r   r   r   e  s      v & r   c                B  a \        V \        4      '       d
   \        pT pMB\        V \        4      '       d   \        pV P                  \        4      pM\        RV : R24      hRoRP                  V3R lV 4       4      pV\        J d   VP                  \        4      # V# )z
Escape special characters in the given string.

*s* (:class:`str` or :class:`bytes`) a filename or a string that you want to
escape, usually before adding it to a ".gitignore".

Returns the escaped string (:class:`str` or :class:`bytes`).
zs:r!   z[]!*#?r)   c              3   F   <"   T F  qS9   d
   R V,           MTx  K  	  R# 5i)rS   Nr   ).0xmeta_characterss   & r   	<genexpr>-GitWildMatchPattern.escape.<locals>.<genexpr>z  s     O1#7taxQ>s   !)r+   r,   r-   r.   r/   r0   r>   r?   )r_   rA   string
out_stringrd   s   &   @r   rX   GitWildMatchPattern.escaped  s     3;6!U;HH_%6	Ru=>	?? /wwOOO*E


O
,,
r   r   N)r   r   r   r   r   	__slots__classmethodrO   staticmethodr<   rX   r   __classdictcell__)r   s   @r   r   r   $   sQ      E EN l l\  r   r   gitwildmatchc                   t   a a ] tR tRt oRtV3R lV 3R llt]V3R lR l4       t]V 3R l4       t	Rt
VtV ;t# )	GitIgnorePatterni  z
The :class:`GitIgnorePattern` class is deprecated by :class:`GitWildMatchPattern`.
This class only exists to maintain compatibility with v0.4.
c                   < V ^8  d   QhRR/# r   r   Nr   )r   r   s   "r   r   GitIgnorePattern.__annotate__  s     6 6D 6r   c                P   < V P                  4        \        \        V `  ! V/ VB  R# )
Warn about deprecation.
N)_deprecatedsuperrp   __init__)selfargskw	__class__s   &*,r   rx   GitIgnorePattern.__init__  s&     $($5"5r   c                   < V ^8  d   QhRR/# rr   r   )r   r   s   "r   r   rs     s     ' 'd 'r   c                 @    \         P                  ! R\        ^R7       R# )ru   z_GitIgnorePattern ('gitignore') is deprecated. Use GitWildMatchPattern ('gitwildmatch') instead.)
stacklevelN)warningswarnDeprecationWarningr   r   r   rv   GitIgnorePattern._deprecated  s    
 --A'r   c                L   < V P                  4        \        \        V `  ! V/ VB # )ru   )rv   rw   rp   rO   )r@   rz   r{   r|   s   &*,r   rO   !GitIgnorePattern.pattern_to_regex  s'    
 //		6	C	CCr   r   )r   r   r   r   r   rx   rl   rv   rk   rO   r   rm   __classcell__)r|   r   s   @@r   rp   rp     sD     
6 6 ' ' D D Dr   rp   	gitignore)r   rW   r   typingr   r   r   r)   r   r   r   r/   r8   r=   r
   r   register_patternrp   r   r   r   <module>r      s   
 
  
  " 	z [, [z
   n&9 :D* DB   k#3 4r   