+
    IV-j>'  ã                   óJ  € R t ^ RIt^ RIHt ]P                  ! R4      t]P                  ! R]P                  ]P                  ,          ]P                  ,          4      t	]P                  ! R]P                  ]P                  ,          ]P                  ,          4      t]P                  ! R]P                  4      t ! R R]4      t ! R	 R
]4      tRR ltR R ltR R ltR R ltR tR tR tR tR t/ tR tR tR!R ltR"R lt ! R R4      t R t!R t"R t# ! R R]4      t$R# )#z 
pygments.util
~~~~~~~~~~~~~

Utility functions.

:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
N)ÚTextIOWrapperz[/\\ ]z”
    <!DOCTYPE\s+(
     [a-zA-Z_][a-zA-Z0-9]*
     (?: \s+      # optional in HTML5
     [a-zA-Z_][a-zA-Z0-9]*\s+
     "[^"]*")?
     )
     [^>]*>
z<(.+?)(\s.*?)?>.*?</.+?>z\s*<\?xml[^>]*\?>c                   ó   € ] tR t^tRtRtR# )ÚClassNotFoundzCRaised if one of the lookup functions didn't find a matching class.© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Ú^/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/pygments/util.pyr   r      s   † ÝMr   r   c                   ó   € ] tR t^"tRtRtR# )ÚOptionErrorzw
This exception will be raised by all option processing functions if
the type or value of the argument is not correct.
r   Nr   r   r   r   r   r   "   s   † õr   r   c                óÔ   € V P                  W4      pV'       d   VP                  4       pWR9  d9   \        RP                  VRP	                  \        \        V4      4      4      4      hV# )zq
If the key `optname` from the dictionary is not in the sequence
`allowed`, raise an error, otherwise return it.
z%Value for option {} must be one of {}z, )ÚgetÚlowerr   ÚformatÚjoinÚmapÚstr)ÚoptionsÚoptnameÚallowedÚdefaultÚnormcaseÚstrings   &&&&& r   Úget_choice_optr   (   sZ   € ð
 �[‰[˜Ó*€FßØ—‘“ˆØÔÜÐA×HÑHÈÐRV×R[ÑR[Ô\_Ô`cÐelÓ\mÓRnÓoÓpÐpØ€Mr   c                ój  € V P                  W4      p\        V\        4      '       d   V# \        V\        4      '       d   \        V4      # \        V\        4      '       g   \        RV: RV R24      hVP                  4       R9   d   R# VP                  4       R9   d   R# \        RV: RV R24      h)	a  
Intuitively, this is `options.get(optname, default)`, but restricted to
Boolean value. The Booleans can be represented as string, in order to accept
Boolean value from the command line arguments. If the key `optname` is
present in the dictionary `options` and is not associated with a Boolean,
raise an `OptionError`. If it is absent, `default` is returned instead.

The valid string values for ``True`` are ``1``, ``yes``, ``true`` and
``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off``
(matched case-insensitively).
úInvalid type ú for option z%; use 1/0, yes/no, true/false, on/offTFúInvalid value )Ú1ÚyesÚtrueÚon)Ú0ÚnoÚfalseÚoff)r   Ú
isinstanceÚboolÚintr   r   r   ©r   r   r   r   s   &&& r   Úget_bool_optr/   5   s´   € ð �[‰[˜Ó*€FÜ�&œ$×ÒØˆÜ	�FœC×	 Ò	 Ü�F‹|ÐÜ˜¤×$Ò$Ü˜M¨&©°<À¸yð I<ð <ó =ð 	=à	�‰‹Ð5Ô	5ÙØ	�‰‹Ð6Ô	6Ùä˜N¨6©*°LÀÀ	ð J<ð <ó =ð 	=r   c                óº   € V P                  W4      p \        V4      #   \         d    \        RT: RT R24      h\         d    \        RT: RT R24      hi ; i)z?As :func:`get_bool_opt`, but interpret the value as an integer.r    r!   z ; you must give an integer valuer"   )r   r-   Ú	TypeErrorr   Ú
ValueErrorr.   s   &&& r   Úget_int_optr3   R   s~   € à�[‰[˜Ó*€Fð8Ü�6‹{ÐøÜô 8Ü˜M¨&©°<À¸yð I7ð 7ó 8ð 	8äô 8Ü˜N¨6©*°LÀÀ	ð J7ð 7ó 8ð 	8ð8ús   “
 ž&AÁAc                óä   € V P                  W4      p\        V\        4      '       d   VP                  4       # \        V\        \
        34      '       d   \	        V4      # \        RV: RV R24      h)z¥
If the key `optname` from the dictionary `options` is a string,
split it at whitespace and return it. If it is already a list
or a tuple, it is returned as a list.
r    r!   z; you must give a list value)r   r+   r   ÚsplitÚlistÚtupler   )r   r   r   Úvals   &&& r   Úget_list_optr9   ^   sj   € ð �+‰+�gÓ
'€CÜ�#”s×ÒØ�y‰y‹{ÐÜ	�Cœ$¤˜×	'Ò	'Ü�C‹yÐä˜M¨#©°¸W¸Ið F3ð 3ó 4ð 	4r   c                 óF  € V P                   '       g   R # . pV P                   P                  4       P                  4        FA  pVP                  4       '       d)   VP                  RVP                  4       ,           4       KA   M	  R P	                  V4      P                  4       # )Ú Ú )r   ÚstripÚ
splitlinesÚappendr   Úlstrip)ÚobjÚresÚlines   &  r   Údocstring_headlinerD   n   sq   € Ø�;�;ˆ;ÙØ
€CØ—‘×!Ñ!Ó#×.Ñ.Ö0ˆØ�:‰:�<Š<Ø�J‰J�s˜TŸZ™Z›\Õ)Ö*áñ	 1ð
 �7‰7�3‹<×ÑÓ Ð r   c                óH   a € V 3R lpS P                   Vn         \        V4      # )zAReturn a static text analyser function that returns float values.c           	      ó¾   <€  S! V 4      pT'       g   R #  \        R\        R \        T4      4      4      #   \          d     R # i ; i  \        \
        3 d     R # i ; i)g        g      ð?)Ú	ExceptionÚminÚmaxÚfloatr2   r1   )ÚtextÚrvÚfs   & €r   Útext_analyseÚ%make_analysator.<locals>.text_analyse|   sb   ø€ ð	Ù�4“ˆB÷ Ùð	Ü�sœC ¤U¨2£YÓ/Ó0Ð0øô ô 	Úð	ûô œIÐ&ô 	Úð	ús    ƒ5 –A µAÁAÁAÁA)r   Ústaticmethod)rM   rN   s   f r   Úmake_analysatorrQ   z   s!   ø€ õ
ð Ÿ9™9€LÔÜ˜Ó%Ð%r   c                ó   € V P                  R4      pV^ 8¼  d   V RV P                  4       pMV P                  4       pVP                  R4      '       d¤    \        P	                  VR,          P                  4       4       Uu. uF(  pV'       g   K  VP                  R4      '       d   K&  VNK*  	  upR
,          p\        P                  ! RT R2\        P                  4      pTP                  T4      e   R	# R# u upi   \         d     R# i ; i)až  Check if the given regular expression matches the last part of the
shebang if one exists.

    >>> from pygments.util import shebang_matches
    >>> shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?')
    True
    >>> shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?')
    True
    >>> shebang_matches('#!/usr/bin/python-ruby', r'python(2\.\d)?')
    False
    >>> shebang_matches('#!/usr/bin/python/ruby', r'python(2\.\d)?')
    False
    >>> shebang_matches('#!/usr/bin/startsomethingwith python',
    ...                 r'python(2\.\d)?')
    True

It also checks for common windows executable file extensions::

    >>> shebang_matches('#!C:\\Python2.4\\Python.exe', r'python(2\.\d)?')
    True

Parameters (``'-f'`` or ``'--foo'`` are ignored so ``'perl'`` does
the same as ``'perl -e'``)

Note that this method automatically searches the whole string (eg:
the regular expression is wrapped in ``'^$'``)
Ú
Nz#!:é   NNÚ-FÚ^z(\.(exe|cmd|bat|bin))?$Téÿÿÿÿ)Úfindr   Ú
startswithÚsplit_path_rer5   r=   Ú
IndexErrorÚreÚcompileÚ
IGNORECASEÚsearch)rK   ÚregexÚindexÚ
first_lineÚxÚfounds   &&    r   Úshebang_matchesre   ‹   sì   € ð8 �I‰I�d‹O€EØ�„zØ˜&˜5�\×'Ñ'Ó)‰
à—Z‘Z“\ˆ
Ø×Ñ˜T×"Ò"ð	Ü -× 3Ñ 3°J¸rµN×4HÑ4HÓ4JÔ Kó 5Ñ K˜1Üô Ø"#§,¡,¨s×"3÷ �QÑ Kñ 5Ø57õ9ˆEô —
’
˜a ˜wÐ&=Ð>ÄÇÁÓNˆØ�<‰<˜ÓÒ*ÙÙùò5øäô 	Úð	ús0   Á,C> Â
C9ÂC9Â)C9Â/
C> Ã9C> Ã>DÄDc                óâ   € \         P                  V 4      pVf   R# VP                  ^4      p\        P                  ! V\        P
                  4      P                  VP                  4       4      RJ# )zµCheck if the doctype matches a regular expression (if present).

Note that this method only checks the first part of a DOCTYPE.
eg: 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
NF)Údoctype_lookup_rer_   Úgroupr\   r]   ÚIÚmatchr=   )rK   r`   ÚmÚdoctypes   &&  r   Údoctype_matchesrm   ¸   sT   € ô 	× Ñ  Ó&€AØ‚yÙØ�g‰g�a‹j€GÜ�:Š:�eœRŸT™TÓ"×(Ñ(¨¯©«Ó9ÀÐEÐEr   c                ó   € \        V R4      # )z3Check if the file looks like it has a html doctype.Úhtml)rm   )rK   s   &r   Úhtml_doctype_matchesrp   Å   s   € ä˜4 Ó)Ð)r   c                ó  € \         P                  V 4      '       d   R# \        V 4      p \        V,          #   \         dI    \
        P                  T 4      pTe    R# \        P                  T R,          4      RJpT\        T&   Tu # i ; i)z2Check if a doctype exists or if we have some tags.TN:Niè  N)Úxml_decl_rerj   ÚhashÚ_looks_like_xml_cacheÚKeyErrorrg   r_   Útag_re)rK   Úkeyrk   rL   s   &   r   Úlooks_like_xmlrx   Í   s}   € ä×Ñ˜×ÒÙÜ
ˆt‹*€CðÜ$ SÕ)Ð)øÜô Ü×$Ñ$ TÓ*ˆØŠ=ÚÜ�]‰]˜4 �;Ó'¨tÐ3ˆØ%'Ô˜cÑ"ØŠ	ðús   ª7 ·$B
Á)B
Â	B
c                óB   € RV ^
,	          ,           RV R,          ,           3# )zgGiven a unicode character code with length greater than 16 bits,
return the two 16 bit surrogate pair.
iÀ×  i Ü  iÿ  r   )Úcs   &r   Úsurrogatepairr{   Ý   s!   € ð �a˜2•gÕ ¨1¨u­9Õ!5Ð7Ð7r   c                óÖ  € . pRV,          ^,          pRV^,           ,          ^,          pVP                  WP,           R,           4       V'       d)   V F!  pVP                  Wg,           R,           4       K#  	  MJV FD  p\        VR,           4      pVP                  WhRR ,           VR	,          ,           R,           4       KF  	  VP                  VR,           4       RP                  V4      # )
z)Formats a sequence of strings for output.r<   z = (Ú,Ú"NÚ)rS   éþÿÿÿrW   )r?   Úreprr   )	Úvar_nameÚseqÚrawÚindent_levelÚlinesÚbase_indentÚinner_indentÚiÚrs	   &&&&     r   Úformat_linesr‹   æ   s½   € à€EØ˜Õ$ qÕ(€KØ˜,¨Õ*Õ+¨aÕ/€LØ	‡L�L�Õ'¨&Õ0Ô1ß
ãˆAØ�L‰L˜Õ)¨CÕ/Ö0ò ó ˆAä�Q˜•W“ˆAØ�L‰L˜¨#¨2¨Õ.°°2µÕ6¸Õ<Ö=ñ ð 
‡L�L�˜sÕ"Ô#Ø�9‰9�UÓÐr   c                ó�   € . p\        4       pV  F3  pWC9   g   WA9   d   K  VP                  V4       VP                  V4       K5  	  V# )zU
Returns a list with duplicates removed from the iterable `it`.

Order is preserved.
)Úsetr?   Úadd)ÚitÚalready_seenÚlstÚseenr‰   s   &&   r   Úduplicates_removedr“   ù   sD   € ð €CÜ‹5€DÛˆØŒ9˜Ô)ÙØ�
‰
�1ŒØ�‰�Žñ	 ð
 €Jr   c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚFuturei	  z{Generic class to defer some work.

Handled specially in RegexLexerMeta, to support regex string construction at
first use.
c                ó   € \         h©N)ÚNotImplementedError©Úselfs   &r   r   Ú
Future.get  s   € Ü!Ð!r   r   N)r   r   r	   r
   r   r   r   Ú__classdictcell__©Ú__classdict__s   @r   r•   r•   	  s   ø‡ € ñ÷
"ð "r   r•   c                óþ   €  V P                  R4      p V R3#   \         d[     ^ RIpTP                  4       pT P                  T4      p Y3u #   \        \        3 d    T P                  R4      p T R3u u # i ; ii ; i)z³Decode *text* with guessed encoding.

First try UTF-8; this should fail for non-UTF-8 encodings.
Then try the preferred locale encoding.
Fall back to latin-1, which always works.
zutf-8NÚlatin1)ÚdecodeÚUnicodeDecodeErrorÚlocaleÚgetpreferredencodingÚLookupError)rK   r£   Úprefencodings   &  r   Úguess_decoder§     s‡   € ð"Ø�{‰{˜7Ó#ˆØ�Wˆ}ÐøÜô "ð	"ÛØ!×6Ñ6Ó8ˆLØ—;‘;˜|Ó,ˆDØÐ%Ò%øÜ"¤KÐ0ô 	"Ø—;‘;˜xÓ(ˆDØ˜�>Ô!ð	"úð"ús,   ‚ —A<£'AÁ
A<Á&A8Á3A<Á7A8Á8A<c                ó²   € \        VRR4      '       d*    V P                  VP                  4      p WP                  3# \	        V 4      #   \         d     Li ; i)zºDecode *text* coming from terminal *term*.

First try the terminal encoding, if given.
Then try UTF-8.  Then try the preferred locale encoding.
Fall back to latin-1, which always works.
ÚencodingN)Úgetattrr¡   r©   r¢   r§   )rK   Úterms   &&r   Úguess_decode_from_terminalr¬   (  sX   € ô ˆt�Z ×&Ò&ð	'Ø—;‘;˜tŸ}™}Ó-ˆDð Ÿ™Ð&Ð&Ü˜ÓÐøô	 "ô 	Ùð	ús   •A ÁAÁAc                óh   € \        V RR4      '       d   V P                  # ^ RIpVP                  4       # )z7Return our best guess of encoding for the given *term*.r©   N)rª   r©   r£   r¤   )r«   r£   s   & r   Úterminal_encodingr®   9  s-   € äˆt�Z ×&Ò&Ø�}‰}ÐÛØ×&Ñ&Ó(Ð(r   c                   ó&   a € ] tR tRt o R tRtV tR# )ÚUnclosingTextIOWrapperiA  c                ó&   € V P                  4        R # r—   )Úflushr™   s   &r   ÚcloseÚUnclosingTextIOWrapper.closeC  s   € Ø�
‰
Žr   r   N)r   r   r	   r
   r³   r   rœ   r�   s   @r   r°   r°   A  s   ø‡ € ÷ð r   r°   )NFr—   )Fé    )r   )%r   r\   Úior   r]   rZ   ÚDOTALLÚ	MULTILINEÚVERBOSErg   r^   rv   ri   rr   r2   r   rG   r   r   r/   r3   r9   rD   rQ   re   rm   rp   rt   rx   r{   r‹   r“   r•   r§   r¬   r®   r°   r   r   r   Ú<module>rº      s  ðñó 
Ý ð —
’
˜9Ó%€Ø—J’Jð  ð ‡Y�Y�—‘Õ §
¡
Õ*ó,Ð ð 
�ŠÐ/Ø—M‘M B§I¡IÕ-°·±Õ<ó
>€à�jŠjÐ-¨r¯t©tÓ4€ôN�Jô Nô�)ô ô
ô=ô:
8ô4ò 	!ò&ò"*òZ
Fò*ð
 Ð òò 8ôô&÷ "ñ "ò"ò*ò")ô˜]ö r   