+
    i)                      a  0 t $ ^ RIHt ^ RIHt  0 RkRkRkRkRkRkR	kR
kRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkR kR!kR"kR#kR$kR%kR&kR'kR(kR)kR*kR+kR,kR-kR.kR/kR0kR1ktR2]R3&   0 RBmtR2]R4&   ^tR5]R6&    ! R7 R8]	4      t
RCR: R; llt. R9R93R< R= llt. R9R93R> R? llt]R@8X  d   ^ RAIt]P                   ! 4        RA# RA# )D    )annotations)Iterable 	
"*+/:<>?[\]()|zset[str]illegalCharactersreservedFileNamesintmaxFileNameLengthc                      ] tR t^otRtR# )NameTranslationError N)__name__
__module____qualname____firstlineno____static_attributes__r:       z/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/ufoLib/filenames.pyr9   r9   o   s    r@   r9    c          
     ,    V ^8  d   QhRRRRRRRRRR/#    userNamestrexistingIterable[str]prefixsuffixreturnr:   )formats   "rA   __annotate__rN   s   s;     g gg*g9<gKNggr@   c                   \        V \        4      '       g   \        R4      h\        V4      p\        V4      pV'       g   V ^ ,          R8X  d   RV R,          ,           p . pV  F?  pV\        9   d   RpMWwP                  4       8w  d
   VR,          pVP                  V4       KA  	  RP                  V4      p \        V,
          V,
          pV RV p . p	V P                  R4       F6  p
V
P                  4       \        9   d
   RV
,           p
V	P                  V
4       K8  	  RP                  V	4      p W ,           V,           pVP                  4       V9   d   \        WW#4      pV# )a  Converts from a user name to a file name.

Takes care to avoid illegal characters, reserved file names, ambiguity between
upper- and lower-case characters, and clashes with existing files.

Args:
        userName (str): The input file name.
        existing: A case-insensitive list of all existing file names.
        prefix: Prefix to be prepended to the file name.
        suffix: Suffix to be appended to the file name.

Returns:
        A suitable filename.

Raises:
        NameTranslationError: If no suitable name could be generated.

Examples::

        >>> userNameToFileName("a") == "a"
        True
        >>> userNameToFileName("A") == "A_"
        True
        >>> userNameToFileName("AE") == "A_E_"
        True
        >>> userNameToFileName("Ae") == "A_e"
        True
        >>> userNameToFileName("ae") == "ae"
        True
        >>> userNameToFileName("aE") == "aE_"
        True
        >>> userNameToFileName("a.alt") == "a.alt"
        True
        >>> userNameToFileName("A.alt") == "A_.alt"
        True
        >>> userNameToFileName("A.Alt") == "A_.A_lt"
        True
        >>> userNameToFileName("A.aLt") == "A_.aL_t"
        True
        >>> userNameToFileName(u"A.alT") == "A_.alT_"
        True
        >>> userNameToFileName("T_H") == "T__H_"
        True
        >>> userNameToFileName("T_h") == "T__h"
        True
        >>> userNameToFileName("t_h") == "t_h"
        True
        >>> userNameToFileName("F_F_I") == "F__F__I_"
        True
        >>> userNameToFileName("f_f_i") == "f_f_i"
        True
        >>> userNameToFileName("Aacute_V.swash") == "A_acute_V_.swash"
        True
        >>> userNameToFileName(".notdef") == "_notdef"
        True
        >>> userNameToFileName("con") == "_con"
        True
        >>> userNameToFileName("CON") == "C_O_N_"
        True
        >>> userNameToFileName("con.alt") == "_con.alt"
        True
        >>> userNameToFileName("alt.con") == "alt._con"
        True
z(The value for userName must be a string.._:   NNrB   N)
isinstancerG   
ValueErrorlenr4   lowerappendjoinr7   splitr5   handleClash1)rF   rH   rJ   rK   prefixLengthsuffixLengthfilteredUserName	charactersliceLengthpartspartfullNames   &&&&        rA   userNameToFileNamerc   s   s5   H h$$CDDv;Lv;L hqkS("%	))I//++I	*  ww'(H#l2\AK%HEs#::<,,:DT $ xxH 6)H~~8#FCOr@   c          
     ,    V ^8  d   QhRRRRRRRRRR/# rD   r:   )rM   s   "rA   rN   rN      s;     A AA*A9<AKNAAr@   c                   \        V4      p\        V4      pV\        V 4      ,           V,           ^,           \        8  d3   V\        V 4      ,           V,           ^,           p\        V,
          pV RV p Rp^p	Vf\   V \        V	4      P                  ^4      ,           p
W*,           V,           pVP	                  4       V9  d   TpMV	^,          p	V	R8  g   K^   Vf   \        WV4      pV# )a  A helper function that resolves collisions with existing names when choosing a filename.

This function attempts to append an unused integer counter to the filename.

    Args:
            userName (str): The input file name.
            existing: A case-insensitive list of all existing file names.
            prefix: Prefix to be prepended to the file name.
            suffix: Suffix to be appended to the file name.

    Returns:
            A suitable filename.

    >>> prefix = ("0" * 5) + "."
    >>> suffix = "." + ("0" * 10)
    >>> existing = ["a" * 5]

    >>> e = list(existing)
    >>> handleClash1(userName="A" * 5, existing=e,
    ...             prefix=prefix, suffix=suffix) == (
    ...     '00000.AAAAA000000000000001.0000000000')
    True

    >>> e = list(existing)
    >>> e.append(prefix + "aaaaa" + "1".zfill(15) + suffix)
    >>> handleClash1(userName="A" * 5, existing=e,
    ...             prefix=prefix, suffix=suffix) == (
    ...     '00000.AAAAA000000000000002.0000000000')
    True

    >>> e = list(existing)
    >>> e.append(prefix + "AAAAA" + "2".zfill(15) + suffix)
    >>> handleClash1(userName="A" * 5, existing=e,
    ...             prefix=prefix, suffix=suffix) == (
    ...     '00000.AAAAA000000000000001.0000000000')
    True
Nl   I5 )rU   r7   rG   zfillrV   handleClash2)rF   rH   rJ   rK   r[   r\   lr_   	finalNamecounternamerb   s   &&&&        rA   rZ   rZ      s    T v;Lv;Lc(m#l2R7:KK3x=(<7"<'!+L[)IG

#g,,,R00=6)>>8+ IqLGo% 6:	r@   c               (    V ^8  d   QhRRRRRRRR/# )rE   rH   rI   rJ   rG   rK   rL   r:   )rM   s   "rA   rN   rN   !  s,     = ==*-=<?==r@   c                *   \         \        V4      ,
          \        V4      ,
          p\        RV,          4      pRp^pVfD   V\        V4      ,           V,           pVP	                  4       V 9  d   TpMV^,          pWd8  g   KF   Vf   \        R4      hV# )a  A helper function that resolves collisions with existing names when choosing a filename.

This function is a fallback to :func:`handleClash1`. It attempts to append an unused integer counter to the filename.

    Args:
            userName (str): The input file name.
            existing: A case-insensitive list of all existing file names.
            prefix: Prefix to be prepended to the file name.
            suffix: Suffix to be appended to the file name.

    Returns:
            A suitable filename.

    Raises:
            NameTranslationError: If no suitable name could be generated.

    Examples::

      >>> prefix = ("0" * 5) + "."
      >>> suffix = "." + ("0" * 10)
      >>> existing = [prefix + str(i) + suffix for i in range(100)]

      >>> e = list(existing)
      >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
      ...   '00000.100.0000000000')
      True

      >>> e = list(existing)
      >>> e.remove(prefix + "1" + suffix)
      >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
      ...   '00000.1.0000000000')
      True

      >>> e = list(existing)
      >>> e.remove(prefix + "2" + suffix)
      >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
      ...   '00000.2.0000000000')
      True
9NzNo unique name could be found.)r7   rU   r6   rG   rV   r9   )rH   rJ   rK   	maxLengthmaxValueri   rj   rb   s   &&&     rA   rg   rg   !  s    V "CK/#f+=I3?#HIG

CL(61>>8+ IqLG"#CDDr@   __main__N>   auxconnulprncom1com2com3com4com5com6com7com8com9lpt1lpt2lpt3lpt4lpt5lpt6lpt7lpt8lpt9clock$)r:   rB   rB   )__conditional_annotations__
__future__r   collections.abcr   r4   __annotations__r5   r7   	Exceptionr9   rc   rZ   rg   r;   doctesttestmod)r   s   @rA   <module>r      s   " " $:0
0
0 0 	0
 0 0 0 0 0 	0 	0 0 0 	0 0  !0" #0$ %0& '0( )0* +0, -0. /00 102 304 506 708 90: ;0< =0> ?0@ A0B C0D E0F G0H I0J K0L M0N O0P Q0R S0T 	U0V W0X Y0Z [0\ ]0^ _0 8 0b 8 2  3 	9 	gV .0rQSAJ !"=@ zOO r@   